drm/i915: Handle intel_plane and intel_plane_state in to_intel_display()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 24 Oct 2024 16:53:54 +0000 (19:53 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 29 Oct 2024 18:53:52 +0000 (20:53 +0200)
Allow one to pass intel_plane/intel_plane_state to
to_intel_display(). Works exactly like their crtc
counterparts.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241024165356.17756-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_display_types.h

index 2bb1fa6..e63a1d2 100644 (file)
@@ -2104,6 +2104,10 @@ to_intel_frontbuffer(struct drm_framebuffer *fb)
        __drm_device_to_intel_display((p)->base.dev)
 #define __intel_hdmi_to_intel_display(p)       \
        __drm_device_to_intel_display(hdmi_to_dig_port(p)->base.base.dev)
+#define __intel_plane_to_intel_display(p)              \
+       __drm_device_to_intel_display((p)->base.dev)
+#define __intel_plane_state_to_intel_display(p)                        \
+       __drm_device_to_intel_display((p)->uapi.plane->dev)
 
 /* Helper for generic association. Map types to conversion functions/macros. */
 #define __assoc(type, p) \
@@ -2122,6 +2126,8 @@ to_intel_frontbuffer(struct drm_framebuffer *fb)
                 __assoc(intel_digital_port, p),        \
                 __assoc(intel_dp, p),                  \
                 __assoc(intel_encoder, p),             \
-                __assoc(intel_hdmi, p))
+                __assoc(intel_hdmi, p),                \
+                __assoc(intel_plane, p),               \
+                __assoc(intel_plane_state, p))
 
 #endif /*  __INTEL_DISPLAY_TYPES_H__ */