]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/display: Detect AuxCCS support via display parent interface
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tue, 9 Dec 2025 12:00:34 +0000 (13:00 +0100)
committerTvrtko Ursulin <tursulin@ursulin.net>
Thu, 11 Dec 2025 09:11:03 +0000 (09:11 +0000)
Whether AuxCCS can be properly supported depends on the support both from
the display side and non-display side of the driver.

Let us therefore allow for the non-display part to be queried via the
display parent interface.

The new interface replaces the HAS_AUX_CCS macro and we also remove the
FIXME from skl_universal_plane_create since now the xe will not advertise
the AuxCCS caps to start with so they do not need to be removed after
enumeration.

Also, by removing this build specific FIXME we come a step closer to fully
de-coupling display and non-display.

The existing HAS_AUX_CCS gets renamed to HAS_AUX_DIST since it is still
required for determining the need for PLANE_AUX_DIST programming.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
References: cf48bddd31de ("drm/i915/display: Disable AuxCCS framebuffers if built for Xe")
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com> # v1
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
Link: https://lore.kernel.org/r/20251209120034.9143-1-tursulin@igalia.com
drivers/gpu/drm/i915/display/intel_display_device.h
drivers/gpu/drm/i915/display/intel_fb.c
drivers/gpu/drm/i915/display/intel_parent.c
drivers/gpu/drm/i915/display/intel_parent.h
drivers/gpu/drm/i915/display/skl_universal_plane.c
drivers/gpu/drm/i915/i915_driver.c
include/drm/intel/display_parent_interface.h

index 11c2b2883f35f78683656a65d428b3b8479d8d89..50b2e9ae2c183ed72e2d4102f428597e19e2c15d 100644 (file)
@@ -149,7 +149,7 @@ struct intel_display_platforms {
 #define HAS_4TILE(__display)           ((__display)->platform.dg2 || DISPLAY_VER(__display) >= 14)
 #define HAS_ASYNC_FLIPS(__display)     (DISPLAY_VER(__display) >= 5)
 #define HAS_AS_SDP(__display)          (DISPLAY_VER(__display) >= 13)
-#define HAS_AUX_CCS(__display)         (IS_DISPLAY_VER(__display, 9, 12) || (__display)->platform.alderlake_p || (__display)->platform.meteorlake)
+#define HAS_AUX_DIST(__display)                (IS_DISPLAY_VER(__display, 9, 12) || (__display)->platform.alderlake_p || (__display)->platform.meteorlake)
 #define HAS_BIGJOINER(__display)       (DISPLAY_VER(__display) >= 11 && HAS_DSC(__display))
 #define HAS_CASF(__display)            (DISPLAY_VER(__display) >= 20)
 #define HAS_CDCLK_CRAWL(__display)     (DISPLAY_INFO(__display)->has_cdclk_crawl)
index b34b4961fe1c595f1a42dedc15543d6cc5ae9169..5b8e02ca2faf666f5701d42f6e2dcceec989d297 100644 (file)
@@ -21,6 +21,7 @@
 #include "intel_fb_bo.h"
 #include "intel_frontbuffer.h"
 #include "intel_panic.h"
+#include "intel_parent.h"
 #include "intel_plane.h"
 
 #define check_array_bounds(display, a, i) drm_WARN_ON((display)->drm, (i) >= ARRAY_SIZE(a))
@@ -558,7 +559,7 @@ static bool plane_has_modifier(struct intel_display *display,
         * where supported.
         */
        if (intel_fb_is_ccs_modifier(md->modifier) &&
-           HAS_AUX_CCS(display) != !!md->ccs.packed_aux_planes)
+           intel_parent_has_auxccs(display) != !!md->ccs.packed_aux_planes)
                return false;
 
        if (md->modifier == I915_FORMAT_MOD_4_TILED_BMG_CCS &&
index d16163007545db11e3640ac0041ce6f89d10bced..1d7bee7d2ccda8c213b3c60eb6eb4812fe57423e 100644 (file)
@@ -170,3 +170,8 @@ void intel_parent_fence_priority_display(struct intel_display *display, struct d
        if (display->parent->fence_priority_display)
                display->parent->fence_priority_display(fence);
 }
+
+bool intel_parent_has_auxccs(struct intel_display *display)
+{
+       return display->parent->has_auxccs && display->parent->has_auxccs(display->drm);
+}
index bc740dfad9854f99e8cb227f2fe1d4b164dc108a..1bb584d850e5bc485554db7cf8c520a041710079 100644 (file)
@@ -52,4 +52,6 @@ bool intel_parent_has_fenced_regions(struct intel_display *display);
 
 void intel_parent_fence_priority_display(struct intel_display *display, struct dma_fence *fence);
 
+bool intel_parent_has_auxccs(struct intel_display *display);
+
 #endif /* __INTEL_PARENT_H__ */
index 6cd94f400e3f7620d4a17d95150f5e338310b39c..40148d225410a852e3c242833a2a62bd1549533a 100644 (file)
@@ -22,6 +22,7 @@
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
 #include "intel_panic.h"
+#include "intel_parent.h"
 #include "intel_plane.h"
 #include "intel_psr.h"
 #include "intel_psr_regs.h"
@@ -1602,7 +1603,7 @@ icl_plane_update_noarm(struct intel_dsb *dsb,
        }
 
        /* FLAT CCS doesn't need to program AUX_DIST */
-       if (HAS_AUX_CCS(display))
+       if (HAS_AUX_DIST(display))
                intel_de_write_dsb(display, dsb, PLANE_AUX_DIST(pipe, plane_id),
                                   skl_plane_aux_dist(plane_state, color_plane));
 
@@ -2972,12 +2973,6 @@ skl_universal_plane_create(struct intel_display *display,
        else
                caps = skl_plane_caps(display, pipe, plane_id);
 
-       /* FIXME: xe has problems with AUX */
-       if (!IS_ENABLED(I915) && HAS_AUX_CCS(display))
-               caps &= ~(INTEL_PLANE_CAP_CCS_RC |
-                         INTEL_PLANE_CAP_CCS_RC_CC |
-                         INTEL_PLANE_CAP_CCS_MC);
-
        modifiers = intel_fb_plane_get_modifiers(display, caps);
 
        ret = drm_universal_plane_init(display->drm, &plane->base,
index fe84df4eae8fa4c10e39df8ef8d2156f4de80ec1..0300a1df8bd2afcbb33db1b3cef6caee7ec38313 100644 (file)
@@ -757,6 +757,15 @@ static void fence_priority_display(struct dma_fence *fence)
                i915_gem_fence_wait_priority_display(fence);
 }
 
+static bool has_auxccs(struct drm_device *drm)
+{
+       struct drm_i915_private *i915 = to_i915(drm);
+
+       return IS_GRAPHICS_VER(i915, 9, 12) ||
+              IS_ALDERLAKE_P(i915) ||
+              IS_METEORLAKE(i915);
+}
+
 static const struct intel_display_parent_interface parent = {
        .hdcp = &i915_display_hdcp_interface,
        .rpm = &i915_display_rpm_interface,
@@ -766,6 +775,7 @@ static const struct intel_display_parent_interface parent = {
        .vgpu_active = vgpu_active,
        .has_fenced_regions = has_fenced_regions,
        .fence_priority_display = fence_priority_display,
+       .has_auxccs = has_auxccs,
 };
 
 const struct intel_display_parent_interface *i915_driver_parent_interface(void)
index cc13b2ce1324cc45f7aaabf61d6ba8f00f68dc13..9733c508ad4c50be7360d1da575e9c0ac5a12ea3 100644 (file)
@@ -100,6 +100,9 @@ struct intel_display_parent_interface {
 
        /** @fence_priority_display: Set display priority. Optional. */
        void (*fence_priority_display)(struct dma_fence *fence);
+
+       /** @has_auxcss: Are AuxCCS formats supported by the parent. Optional. */
+       bool (*has_auxccs)(struct drm_device *drm);
 };
 
 #endif