From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915/display: add HAS_AUX_CCS() feature check
Date: Fri, 10 Oct 2025 16:53:26 +0300 [thread overview]
Message-ID: <aOkP1mRjU-Ckfr6L@intel.com> (raw)
In-Reply-To: <f3839c6a87796d087b944720248d39462521d20b.1760094361.git.jani.nikula@intel.com>
On Fri, Oct 10, 2025 at 02:07:53PM +0300, Jani Nikula wrote:
> We should try to get rid of checks that depend on struct
> drm_i915_private (or struct xe_device) in display code. HAS_FLAT_CCS()
> is one of them. In the interest of simplicity, add a reversed
> HAS_AUX_CCS() feature check macro, as that's we mostly use it for in
> display.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> ---
>
> Is "display < 13 || mtl" good enough?
> ---
> drivers/gpu/drm/i915/display/intel_display_device.h | 1 +
> drivers/gpu/drm/i915/display/intel_fb.c | 4 +---
> drivers/gpu/drm/i915/display/skl_universal_plane.c | 4 ++--
> drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h | 2 --
> 4 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
> index 9960ac13a6dd..3ceecfe3b1b7 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
> @@ -144,6 +144,7 @@ struct intel_display_platforms {
>
> #define HAS_128B_Y_TILING(__display) (!(__display)->platform.i915g && !(__display)->platform.i915gm)
> #define HAS_4TILE(__display) ((__display)->platform.dg2 || DISPLAY_VER(__display) >= 14)
> +#define HAS_AUX_CCS(__display) (DISPLAY_VER(__display) < 13 || (__display)->platform.meteorlake)
That is missing ADL.
I think we'd need
IS_DISPLAY_VER(9, 12) || adl || mtl
or
IS_DISPLAY_VER(9, 14) && !dg2 && !bmg
Dunno which is uglier.
I was first thinking the latter could just be
'IS_DISPLAY_VER(9, 14) && !IS_DGFX' but looks like we don't have
IS_DFGX in the display code anymore, and also that would be wrong
for DG1 (assuming we'd say IS_DGFX==true for it).
> #define HAS_ASYNC_FLIPS(__display) (DISPLAY_VER(__display) >= 5)
> #define HAS_AS_SDP(__display) (DISPLAY_VER(__display) >= 13)
> #define HAS_BIGJOINER(__display) (DISPLAY_VER(__display) >= 11 && HAS_DSC(__display))
> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> index 7388791dfde0..9c256a2805e4 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> @@ -547,8 +547,6 @@ static bool plane_has_modifier(struct intel_display *display,
> u8 plane_caps,
> const struct intel_modifier_desc *md)
> {
> - struct drm_i915_private *i915 = to_i915(display->drm);
> -
> if (!IS_DISPLAY_VER(display, md->display_ver.from, md->display_ver.until))
> return false;
>
> @@ -560,7 +558,7 @@ static bool plane_has_modifier(struct intel_display *display,
> * where supported.
> */
> if (intel_fb_is_ccs_modifier(md->modifier) &&
> - HAS_FLAT_CCS(i915) != !md->ccs.packed_aux_planes)
> + HAS_AUX_CCS(display) != !!md->ccs.packed_aux_planes)
> return false;
>
> if (md->modifier == I915_FORMAT_MOD_4_TILED_BMG_CCS &&
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index e13fb781e7b2..0319174adf95 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -1572,7 +1572,7 @@ icl_plane_update_noarm(struct intel_dsb *dsb,
> }
>
> /* FLAT CCS doesn't need to program AUX_DIST */
> - if (!HAS_FLAT_CCS(to_i915(display->drm)) && DISPLAY_VER(display) < 20)
> + if (HAS_AUX_CCS(display))
> intel_de_write_dsb(display, dsb, PLANE_AUX_DIST(pipe, plane_id),
> skl_plane_aux_dist(plane_state, color_plane));
>
> @@ -2930,7 +2930,7 @@ skl_universal_plane_create(struct intel_display *display,
> caps = skl_plane_caps(display, pipe, plane_id);
>
> /* FIXME: xe has problems with AUX */
> - if (!IS_ENABLED(I915) && !HAS_FLAT_CCS(to_i915(display->drm)))
> + 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);
> diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
> index be3edf20de22..7c657ea98a44 100644
> --- a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
> +++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
> @@ -35,6 +35,4 @@ static inline struct drm_i915_private *to_i915(const struct drm_device *dev)
>
> #define IS_MOBILE(xe) (xe && 0)
>
> -#define HAS_FLAT_CCS(xe) (xe_device_has_flat_ccs(xe))
> -
> #endif
> --
> 2.47.3
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-10-10 13:53 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 11:07 [PATCH 0/3] drm/i915/display: 128-byte Y-tiling and flat CCS feature checks Jani Nikula
2025-10-10 11:07 ` [PATCH 1/3] drm/i915: include gen 2 in HAS_128_BYTE_Y_TILING() Jani Nikula
2025-10-10 13:57 ` Ville Syrjälä
2025-10-10 11:07 ` [PATCH 2/3] drm/i915/display: duplicate 128-byte Y-tiling feature check Jani Nikula
2025-10-10 14:01 ` Ville Syrjälä
2025-10-10 11:07 ` [PATCH 3/3] drm/i915/display: add HAS_AUX_CCS() " Jani Nikula
2025-10-10 13:53 ` Ville Syrjälä [this message]
2025-10-13 14:47 ` Jani Nikula
2025-10-13 14:45 ` [PATCH v2] " Jani Nikula
2025-10-13 17:21 ` Ville Syrjälä
2025-10-14 9:50 ` Jani Nikula
2025-10-10 12:42 ` ✗ CI.checkpatch: warning for drm/i915/display: 128-byte Y-tiling and flat CCS feature checks Patchwork
2025-10-10 12:43 ` ✓ CI.KUnit: success " Patchwork
2025-10-10 13:01 ` ✗ CI.checksparse: warning " Patchwork
2025-10-10 13:25 ` ✓ Xe.CI.BAT: success " Patchwork
2025-10-10 13:45 ` ✓ i915.CI.BAT: " Patchwork
2025-10-10 15:29 ` ✓ i915.CI.Full: " Patchwork
2025-10-10 18:23 ` ✓ Xe.CI.Full: " Patchwork
2025-10-13 15:11 ` ✗ CI.checkpatch: warning for drm/i915/display: 128-byte Y-tiling and flat CCS feature checks (rev2) Patchwork
2025-10-13 15:13 ` ✓ CI.KUnit: success " Patchwork
2025-10-13 15:29 ` ✗ CI.checksparse: warning " Patchwork
2025-10-13 16:04 ` ✓ Xe.CI.BAT: success " Patchwork
2025-10-13 16:27 ` ✓ i915.CI.BAT: " Patchwork
2025-10-13 17:51 ` ✗ Xe.CI.Full: failure " Patchwork
2025-10-13 19:22 ` ✗ i915.CI.Full: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aOkP1mRjU-Ckfr6L@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.