Commit 97c6efb3 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Rodrigo Vivi

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: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarZbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Acked-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240826170117.327709-2-maarten.lankhorst@linux.intel.comSigned-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 04cf420b
...@@ -169,7 +169,7 @@ static const struct intel_modifier_desc intel_modifiers[] = { ...@@ -169,7 +169,7 @@ static const struct intel_modifier_desc intel_modifiers[] = {
}, { }, {
.modifier = I915_FORMAT_MOD_4_TILED_BMG_CCS, .modifier = I915_FORMAT_MOD_4_TILED_BMG_CCS,
.display_ver = { 14, -1 }, .display_ver = { 14, -1 },
.plane_caps = INTEL_PLANE_CAP_TILING_4, .plane_caps = INTEL_PLANE_CAP_TILING_4 | INTEL_PLANE_CAP_NEED64K_PHYS,
}, { }, {
.modifier = I915_FORMAT_MOD_4_TILED_MTL_MC_CCS, .modifier = I915_FORMAT_MOD_4_TILED_MTL_MC_CCS,
.display_ver = { 14, 14 }, .display_ver = { 14, 14 },
...@@ -420,6 +420,24 @@ bool intel_fb_is_mc_ccs_modifier(u64 modifier) ...@@ -420,6 +420,24 @@ bool intel_fb_is_mc_ccs_modifier(u64 modifier)
INTEL_PLANE_CAP_CCS_MC); INTEL_PLANE_CAP_CCS_MC);
} }
/**
* intel_fb_needs_64k_phys: Check if modifier requires 64k physical placement.
* @modifier: Modifier to check
*
* Returns:
* Returns %true if @modifier requires 64k aligned physical pages.
*/
bool intel_fb_needs_64k_phys(u64 modifier)
{
const struct intel_modifier_desc *md = lookup_modifier_or_null(modifier);
if (!md)
return false;
return plane_caps_contain_any(md->plane_caps,
INTEL_PLANE_CAP_NEED64K_PHYS);
}
static bool check_modifier_display_ver_range(const struct intel_modifier_desc *md, static bool check_modifier_display_ver_range(const struct intel_modifier_desc *md,
u8 display_ver_from, u8 display_ver_until) u8 display_ver_from, u8 display_ver_until)
{ {
......
...@@ -28,11 +28,13 @@ struct intel_plane_state; ...@@ -28,11 +28,13 @@ struct intel_plane_state;
#define INTEL_PLANE_CAP_TILING_Y BIT(4) #define INTEL_PLANE_CAP_TILING_Y BIT(4)
#define INTEL_PLANE_CAP_TILING_Yf BIT(5) #define INTEL_PLANE_CAP_TILING_Yf BIT(5)
#define INTEL_PLANE_CAP_TILING_4 BIT(6) #define INTEL_PLANE_CAP_TILING_4 BIT(6)
#define INTEL_PLANE_CAP_NEED64K_PHYS BIT(7)
bool intel_fb_is_tiled_modifier(u64 modifier); bool intel_fb_is_tiled_modifier(u64 modifier);
bool intel_fb_is_ccs_modifier(u64 modifier); bool intel_fb_is_ccs_modifier(u64 modifier);
bool intel_fb_is_rc_ccs_cc_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_is_mc_ccs_modifier(u64 modifier);
bool intel_fb_needs_64k_phys(u64 modifier);
bool intel_fb_is_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane); 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); int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment