Skip to content

Commit 809734c

Browse files
Samsagaxalexdeucher
authored andcommitted
drm/amd/display: Revert logic for plane modifiers
This file was split in commit 5d945cb ("drm/amd/display: Create a file dedicated to planes") and the logic in dm_plane_format_mod_supported() function got changed by a switch logic. That change broke drm_plane modifiers setting on series 5000 APUs (tested on OXP mini AMD 5800U and HP Dev One 5850U PRO) leading to Gamescope not working as reported on GitHub[1] To reproduce the issue, enter a TTY and run: $ gamescope -- vkcube With said commit applied it will abort. This one restores the old logic, fixing the issue that affects Gamescope. [1](ValveSoftware/gamescope#624) Cc: <[email protected]> # 6.0.x Signed-off-by: Joaquín Ignacio Aramendía <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 969758b commit 809734c

File tree

1 file changed

+7
-43
lines changed

1 file changed

+7
-43
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
13691369
{
13701370
struct amdgpu_device *adev = drm_to_adev(plane->dev);
13711371
const struct drm_format_info *info = drm_format_info(format);
1372-
struct hw_asic_id asic_id = adev->dm.dc->ctx->asic_id;
1372+
int i;
13731373

13741374
enum dm_micro_swizzle microtile = modifier_gfx9_swizzle_mode(modifier) & 3;
13751375

@@ -1386,49 +1386,13 @@ static bool dm_plane_format_mod_supported(struct drm_plane *plane,
13861386
return true;
13871387
}
13881388

1389-
/* check if swizzle mode is supported by this version of DCN */
1390-
switch (asic_id.chip_family) {
1391-
case FAMILY_SI:
1392-
case FAMILY_CI:
1393-
case FAMILY_KV:
1394-
case FAMILY_CZ:
1395-
case FAMILY_VI:
1396-
/* asics before AI does not have modifier support */
1397-
return false;
1398-
case FAMILY_AI:
1399-
case FAMILY_RV:
1400-
case FAMILY_NV:
1401-
case FAMILY_VGH:
1402-
case FAMILY_YELLOW_CARP:
1403-
case AMDGPU_FAMILY_GC_10_3_6:
1404-
case AMDGPU_FAMILY_GC_10_3_7:
1405-
switch (AMD_FMT_MOD_GET(TILE, modifier)) {
1406-
case AMD_FMT_MOD_TILE_GFX9_64K_R_X:
1407-
case AMD_FMT_MOD_TILE_GFX9_64K_D_X:
1408-
case AMD_FMT_MOD_TILE_GFX9_64K_S_X:
1409-
case AMD_FMT_MOD_TILE_GFX9_64K_D:
1410-
return true;
1411-
default:
1412-
return false;
1413-
}
1414-
break;
1415-
case AMDGPU_FAMILY_GC_11_0_0:
1416-
case AMDGPU_FAMILY_GC_11_0_1:
1417-
switch (AMD_FMT_MOD_GET(TILE, modifier)) {
1418-
case AMD_FMT_MOD_TILE_GFX11_256K_R_X:
1419-
case AMD_FMT_MOD_TILE_GFX9_64K_R_X:
1420-
case AMD_FMT_MOD_TILE_GFX9_64K_D_X:
1421-
case AMD_FMT_MOD_TILE_GFX9_64K_S_X:
1422-
case AMD_FMT_MOD_TILE_GFX9_64K_D:
1423-
return true;
1424-
default:
1425-
return false;
1426-
}
1427-
break;
1428-
default:
1429-
ASSERT(0); /* Unknown asic */
1430-
break;
1389+
/* Check that the modifier is on the list of the plane's supported modifiers. */
1390+
for (i = 0; i < plane->modifier_count; i++) {
1391+
if (modifier == plane->modifiers[i])
1392+
break;
14311393
}
1394+
if (i == plane->modifier_count)
1395+
return false;
14321396

14331397
/*
14341398
* For D swizzle the canonical modifier depends on the bpp, so check

0 commit comments

Comments
 (0)