drm/amd/display: remove duplicate format modifier
Subsystems (3)
PATCH 1/1 drm/amd/display: remove duplicate format modifier
amdgpu_dm_plane_get_plane_modifiers always adds DRM_FORMAT_MOD_LINEAR to the list of modifiers. However, with gfx12, amdgpu_dm_plane_add_gfx12_modifiers also adds that modifier to the list. So we end up with two copies. Most apps just ignore this but some (like Weston) don't like it.
As a fix, we modify amdgpu_dm_plane_add_gfx12_modifiers to not add DRM_FORMAT_MOD_LINEAR to the list, matching the behavior of similar functions for other chips.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +1 -1
@@ -704,7 +704,7 @@ static void amdgpu_dm_plane_add_gfx12_modifiers(struct amdgpu_device *adev,uint8_t max_comp_block[] = {2 ,1 ,0 };uint64_t max_comp_block_mod[ARRAY_SIZE (max_comp_block)] = {0 };uint8_t i =0 , j =0 ; -uint64_t gfx12_modifiers[] = {mod_256k, mod_64k, mod_4k, mod_256b,DRM_FORMAT_MOD_LINEAR }; +uint64_t gfx12_modifiers[] = {mod_256k, mod_64k, mod_4k, mod_256b};for (i =0 ; i <ARRAY_SIZE (max_comp_block); i++) max_comp_block_mod[i] =AMD_FMT_MOD_SET (DCC_MAX_COMPRESSED_BLOCK , max_comp_block[i]);
Signature · 1 line
2.53.0
Quoted 7 lines · Erik Kurzinger
amdgpu_dm_plane_get_plane_modifiersalways addsDRM_FORMAT_MOD_LINEARto the list of modifiers. However, with gfx12,amdgpu_dm_plane_add_gfx12_modifiersalso adds that modifier to the list. So we end up with two copies. Most apps just ignore this but some (like Weston) don't like it.
Quoted 5 lines
As a fix, we modify
amdgpu_dm_plane_add_gfx12_modifiersto not addDRM_FORMAT_MOD_LINEARto the list, matching the behavior of similar functions for other chips.Signed-off-by Erik Kurzinger <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +1
-2@@ -704,7 +704,7 @@ static void amdgpu_dm_plane_add_gfx12_modifiers(struct amdgpu_device *adev,uint8_t max_comp_block[] = {2 ,1 ,0 };uint64_t max_comp_block_mod[ARRAY_SIZE (max_comp_block)] = {0 };uint8_t i =0 , j =0 ; -uint64_t gfx12_modifiers[] = {mod_256k, mod_64k, mod_4k, mod_256b,DRM_FORMAT_MOD_LINEAR }; +uint64_t gfx12_modifiers[] = {mod_256k, mod_64k, mod_4k, mod_256b};for (i =0 ; i <ARRAY_SIZE (max_comp_block); i++) max_comp_block_mod[i] =AMD_FMT_MOD_SET (DCC_MAX_COMPRESSED_BLOCK , max_comp_block[i]); --2.53.0
Quoted 9 lines · Alex Deucher
Quoted 7 lines · Erik Kurzinger
amdgpu_dm_plane_get_plane_modifiersalways addsDRM_FORMAT_MOD_LINEARto the list of modifiers. However, with gfx12,amdgpu_dm_plane_add_gfx12_modifiersalso adds that modifier to the list. So we end up with two copies. Most apps just ignore this but some (like Weston) don't like it.
Quoted 8 lines
Quoted 5 lines
As a fix, we modify
amdgpu_dm_plane_add_gfx12_modifiersto not addDRM_FORMAT_MOD_LINEARto the list, matching the behavior of similar functions for other chips.Signed-off-by Erik Kurzinger <[email protected]>Acked-by Alex Deucher <[email protected]>
Whoops, sorry, I've realized this is not correct. The logic later in the function assumes linear will be at the end of the array. I'll send a revised patch shortly.
Quoted 20 lines
Quoted 20 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +1
-2@@ -704,7 +704,7 @@ static void amdgpu_dm_plane_add_gfx12_modifiers(struct amdgpu_device *adev,uint8_t max_comp_block[] = {2 ,1 ,0 };uint64_t max_comp_block_mod[ARRAY_SIZE (max_comp_block)] = {0 };uint8_t i =0 , j =0 ; -uint64_t gfx12_modifiers[] = {mod_256k, mod_64k, mod_4k, mod_256b,DRM_FORMAT_MOD_LINEAR }; +uint64_t gfx12_modifiers[] = {mod_256k, mod_64k, mod_4k, mod_256b};for (i =0 ; i <ARRAY_SIZE (max_comp_block); i++) max_comp_block_mod[i] =AMD_FMT_MOD_SET (DCC_MAX_COMPRESSED_BLOCK , max_comp_block[i]); --2.53.0