From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/display: Don't allow tile4 framebuffer to do hflip on Xe2
Date: Mon, 7 Oct 2024 19:47:09 +0300 [thread overview]
Message-ID: <9fc9f3cf-0d79-40a0-9148-b05c251d8004@gmail.com> (raw)
In-Reply-To: <wo5js5qkjy35yx6smin5yel3cute2tox65y7dxtdvnmo3bdkgy@sdv7uq5nfjdr>
On 12.9.2024 20.14, Lucas De Marchi wrote:
> On Thu, Sep 12, 2024 at 05:46:06PM GMT, Juha-Pekka Heikkila wrote:
>> On Intel Xe2 hw tile4 is not supported with horizontal flip
>>
>> bspec 69853
>
> Usual spelling is: "Bspec: 69853" and as part of the trailers below.
>
>>
>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
>> ---
>> drivers/gpu/drm/i915/display/intel_fb.c | 13 +++++++++++++
>> drivers/gpu/drm/i915/display/intel_fb.h | 1 +
>> drivers/gpu/drm/i915/display/skl_universal_plane.c | 12 ++++++++++++
>> 3 files changed, 26 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/
>> drm/i915/display/intel_fb.c
>> index d2ff21e98545..c9038d239eb2 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fb.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
>> @@ -439,6 +439,19 @@ bool intel_fb_needs_64k_phys(u64 modifier)
>> INTEL_PLANE_CAP_NEED64K_PHYS);
>> }
>>
>> +/**
>> + * intel_fb_is_tile4_modifier: Check if a modifier is a tile4
>> modifier type
>> + * @modifier: Modifier to check
>> + *
>> + * Returns:
>> + * Returns %true if @modifier is a tile4 modifier.
>
> double Returns
This same form is on all those helpers in same file
>
>> + */
>> +bool intel_fb_is_tile4_modifier(u64 modifier)
>> +{
>> + return plane_caps_contain_any(lookup_modifier(modifier)->plane_caps,
>> + INTEL_PLANE_CAP_TILING_4);
>> +}
>> +
>> static bool check_modifier_display_ver_range(const struct
>> intel_modifier_desc *md,
>> u8 display_ver_from, u8 display_ver_until)
>> {
>> diff --git a/drivers/gpu/drm/i915/display/intel_fb.h b/drivers/gpu/
>> drm/i915/display/intel_fb.h
>> index 068f3aee99aa..bff87994cf2c 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fb.h
>> +++ b/drivers/gpu/drm/i915/display/intel_fb.h
>> @@ -35,6 +35,7 @@ bool intel_fb_is_ccs_modifier(u64 modifier);
>> bool intel_fb_is_rc_ccs_cc_modifier(u64 modifier);
>> bool intel_fb_is_mc_ccs_modifier(u64 modifier);
>> bool intel_fb_needs_64k_phys(u64 modifier);
>> +bool intel_fb_is_tile4_modifier(u64 modifier);
>>
>> bool intel_fb_is_ccs_aux_plane(const struct drm_framebuffer *fb, int
>> color_plane);
>> int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb);
>> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/
>> drivers/gpu/drm/i915/display/skl_universal_plane.c
>> index 17d4c880ecc4..4de41ab5060a 100644
>> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
>> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
>> @@ -1591,6 +1591,18 @@ static int skl_plane_check_fb(const struct
>> intel_crtc_state *crtc_state,
>> return -EINVAL;
>> }
>>
>> + /*
>> + * Starting with LNL and BMG tile4 hflip is not supported
>> + */
>> + if (rotation & DRM_MODE_REFLECT_X &&
>> + intel_fb_is_tile4_modifier(fb->modifier) &&
>> + ((DISPLAY_VER(dev_priv) >= 14 && IS_DGFX(dev_priv)) ||
>> + (DISPLAY_VER(dev_priv) >= 20 && !IS_DGFX(dev_priv)))) {
>
> the correct bspec for BMG is 50387 where the only documented restriction is
> on linear surface formats. This can rather be simplified with:
>
> if (rotation & DRM_MODE_REFLECT_X &&
> intel_fb_is_tile4_modifier(fb->modifier) &&
> DISPLAY_VER(dev_priv) >= 20)
>
Yea, you're right. Seems I can drop bmg from here. What did look like
similar bug was not really so.
/Juha-Pekka
>> + drm_dbg_kms(&dev_priv->drm,
>> + "horizontal flip is not supported with tile4 surface
>> formats\n");
>> + return -EINVAL;
>> + }
>> +
>> if (drm_rotation_90_or_270(rotation)) {
>> if (!
>> intel_fb_supports_90_270_rotation(to_intel_framebuffer(fb))) {
>> drm_dbg_kms(&dev_priv->drm,
>> --
>> 2.45.2
>>
next prev parent reply other threads:[~2024-10-07 16:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 14:46 [PATCH] drm/i915/display: Don't allow tile4 framebuffer to do hflip on Xe2 Juha-Pekka Heikkila
2024-09-12 15:32 ` ✓ CI.Patch_applied: success for " Patchwork
2024-09-12 15:32 ` ✓ CI.checkpatch: " Patchwork
2024-09-12 15:34 ` ✓ CI.KUnit: " Patchwork
2024-09-12 15:46 ` ✓ CI.Build: " Patchwork
2024-09-12 15:48 ` ✓ CI.Hooks: " Patchwork
2024-09-12 15:49 ` ✗ CI.checksparse: warning " Patchwork
2024-09-12 16:22 ` [PATCH] " Ville Syrjälä
2024-09-12 17:14 ` Lucas De Marchi
2024-10-07 16:47 ` Juha-Pekka Heikkila [this message]
2024-09-12 19:50 ` Matt Roper
2024-09-13 11:40 ` Juha-Pekka Heikkila
2024-09-13 2:24 ` ✗ CI.FULL: failure for " Patchwork
2024-09-13 6:39 ` ✓ CI.BAT: success " 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=9fc9f3cf-0d79-40a0-9148-b05c251d8004@gmail.com \
--to=juhapekka.heikkila@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox