Commit ed17b63e authored by Marek Olšák's avatar Marek Olšák Committed by Alex Deucher

drm/amdgpu/display: handle gfx12 in amdgpu_dm_plane_format_mod_supported

All this code has undefined behavior on GFX12 and shouldn't be executed.
Signed-off-by: default avatarMarek Olšák <marek.olsak@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8dd1426e
......@@ -1419,8 +1419,6 @@ static bool amdgpu_dm_plane_format_mod_supported(struct drm_plane *plane,
const struct drm_format_info *info = drm_format_info(format);
int i;
enum dm_micro_swizzle microtile = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier) & 3;
if (!info)
return false;
......@@ -1442,6 +1440,10 @@ static bool amdgpu_dm_plane_format_mod_supported(struct drm_plane *plane,
if (i == plane->modifier_count)
return false;
/* GFX12 doesn't have these limitations. */
if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) <= AMD_FMT_MOD_TILE_VER_GFX11) {
enum dm_micro_swizzle microtile = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier) & 3;
/*
* For D swizzle the canonical modifier depends on the bpp, so check
* it here.
......@@ -1466,6 +1468,7 @@ static bool amdgpu_dm_plane_format_mod_supported(struct drm_plane *plane,
if (info->num_planes > 1)
return false;
}
}
return true;
}
......
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