Skip to content

Commit ffafd12

Browse files
juhapekkalucasdemarchi
authored andcommitted
drm/i915/display: Don't allow tile4 framebuffer to do hflip on display20 or greater
On display ver 20 onwards tile4 is not supported with horizontal flip Bspec: 69853 Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Sai Teja Pottumuttu <[email protected]> Signed-off-by: Mika Kahola <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 73e8e2f) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 6df106e commit ffafd12

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

drivers/gpu/drm/i915/display/intel_fb.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,19 @@ bool intel_fb_needs_64k_phys(u64 modifier)
438438
INTEL_PLANE_CAP_NEED64K_PHYS);
439439
}
440440

441+
/**
442+
* intel_fb_is_tile4_modifier: Check if a modifier is a tile4 modifier type
443+
* @modifier: Modifier to check
444+
*
445+
* Returns:
446+
* Returns %true if @modifier is a tile4 modifier.
447+
*/
448+
bool intel_fb_is_tile4_modifier(u64 modifier)
449+
{
450+
return plane_caps_contain_any(lookup_modifier(modifier)->plane_caps,
451+
INTEL_PLANE_CAP_TILING_4);
452+
}
453+
441454
static bool check_modifier_display_ver_range(const struct intel_modifier_desc *md,
442455
u8 display_ver_from, u8 display_ver_until)
443456
{

drivers/gpu/drm/i915/display/intel_fb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ bool intel_fb_is_ccs_modifier(u64 modifier);
3535
bool intel_fb_is_rc_ccs_cc_modifier(u64 modifier);
3636
bool intel_fb_is_mc_ccs_modifier(u64 modifier);
3737
bool intel_fb_needs_64k_phys(u64 modifier);
38+
bool intel_fb_is_tile4_modifier(u64 modifier);
3839

3940
bool intel_fb_is_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane);
4041
int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb);

drivers/gpu/drm/i915/display/skl_universal_plane.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,17 @@ static int skl_plane_check_fb(const struct intel_crtc_state *crtc_state,
15911591
return -EINVAL;
15921592
}
15931593

1594+
/*
1595+
* Display20 onward tile4 hflip is not supported
1596+
*/
1597+
if (rotation & DRM_MODE_REFLECT_X &&
1598+
intel_fb_is_tile4_modifier(fb->modifier) &&
1599+
DISPLAY_VER(dev_priv) >= 20) {
1600+
drm_dbg_kms(&dev_priv->drm,
1601+
"horizontal flip is not supported with tile4 surface formats\n");
1602+
return -EINVAL;
1603+
}
1604+
15941605
if (drm_rotation_90_or_270(rotation)) {
15951606
if (!intel_fb_supports_90_270_rotation(to_intel_framebuffer(fb))) {
15961607
drm_dbg_kms(&dev_priv->drm,

0 commit comments

Comments
 (0)