Skip to content

Commit 97c6efb

Browse files
mlankhorstrodrigovivi
authored andcommitted
drm/i915/display: Plane capability for 64k phys alignment
Some plane formats have been designed to require 64k physical alignment. By returning whether this is the case for certain formats, we do not need to hardcode this check inside Xe. Signed-off-by: Maarten Lankhorst <[email protected]> Reviewed-by: Zbigniew Kempczyński <[email protected]> Acked-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 04cf420 commit 97c6efb

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static const struct intel_modifier_desc intel_modifiers[] = {
169169
}, {
170170
.modifier = I915_FORMAT_MOD_4_TILED_BMG_CCS,
171171
.display_ver = { 14, -1 },
172-
.plane_caps = INTEL_PLANE_CAP_TILING_4,
172+
.plane_caps = INTEL_PLANE_CAP_TILING_4 | INTEL_PLANE_CAP_NEED64K_PHYS,
173173
}, {
174174
.modifier = I915_FORMAT_MOD_4_TILED_MTL_MC_CCS,
175175
.display_ver = { 14, 14 },
@@ -420,6 +420,24 @@ bool intel_fb_is_mc_ccs_modifier(u64 modifier)
420420
INTEL_PLANE_CAP_CCS_MC);
421421
}
422422

423+
/**
424+
* intel_fb_needs_64k_phys: Check if modifier requires 64k physical placement.
425+
* @modifier: Modifier to check
426+
*
427+
* Returns:
428+
* Returns %true if @modifier requires 64k aligned physical pages.
429+
*/
430+
bool intel_fb_needs_64k_phys(u64 modifier)
431+
{
432+
const struct intel_modifier_desc *md = lookup_modifier_or_null(modifier);
433+
434+
if (!md)
435+
return false;
436+
437+
return plane_caps_contain_any(md->plane_caps,
438+
INTEL_PLANE_CAP_NEED64K_PHYS);
439+
}
440+
423441
static bool check_modifier_display_ver_range(const struct intel_modifier_desc *md,
424442
u8 display_ver_from, u8 display_ver_until)
425443
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ struct intel_plane_state;
2828
#define INTEL_PLANE_CAP_TILING_Y BIT(4)
2929
#define INTEL_PLANE_CAP_TILING_Yf BIT(5)
3030
#define INTEL_PLANE_CAP_TILING_4 BIT(6)
31+
#define INTEL_PLANE_CAP_NEED64K_PHYS BIT(7)
3132

3233
bool intel_fb_is_tiled_modifier(u64 modifier);
3334
bool intel_fb_is_ccs_modifier(u64 modifier);
3435
bool intel_fb_is_rc_ccs_cc_modifier(u64 modifier);
3536
bool intel_fb_is_mc_ccs_modifier(u64 modifier);
37+
bool intel_fb_needs_64k_phys(u64 modifier);
3638

3739
bool intel_fb_is_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane);
3840
int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb);

0 commit comments

Comments
 (0)