Skip to content

Commit febb414

Browse files
guilhermepiccolialexdeucher
authored andcommitted
drm/amd/display: Trivial swizzle-related code clean-ups
This is a very trivial code clean-up related to commit 5468c36 ("drm/amd/display: Filter Invalid 420 Modes for HDMI TMDS"). This commit added a validation on driver probe to prevent invalid TMDS modes, but one of the fake properties (swizzle) ended-up causing a warning on driver probe; was reported here: https://gitlab.freedesktop.org/drm/amd/-/issues/2264. It was fixed by commit a1cbe69 ("drm/amd/display: patch cases with unknown plane state to prevent warning"), but the validation code had a double variable assignment, which we hereby remove. Also, the fix relies in the dcn2{0,1}patch_unknown_plane_state() callbacks, so while at it we took the opportunity to perform a small code clean-up in such routines. Cc: Aurabindo Pillai <aurabindo.pillai@amd.com> Cc: Daniel Wheeler <daniel.wheeler@amd.com> Cc: Fangzhi Zuo <Jerry.Zuo@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Cc: Leo Li <sunpeng.li@amd.com> Cc: Mark Broadworth <mark.broadworth@amd.com> Cc: Melissa Wen <mwen@igalia.com> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Cc: Sung Joon Kim <Sungjoon.Kim@amd.com> Cc: Swapnil Patel <Swapnil.Patel@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 1c6d24b commit febb414

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6365,7 +6365,6 @@ static enum dc_status dm_validate_stream_and_context(struct dc *dc,
63656365
dc_plane_state->plane_size.surface_size.width = stream->src.width;
63666366
dc_plane_state->plane_size.chroma_size.height = stream->src.height;
63676367
dc_plane_state->plane_size.chroma_size.width = stream->src.width;
6368-
dc_plane_state->tiling_info.gfx9.swizzle = DC_SW_UNKNOWN;
63696368
dc_plane_state->format = SURFACE_PIXEL_FORMAT_GRPH_ARGB8888;
63706369
dc_plane_state->tiling_info.gfx9.swizzle = DC_SW_UNKNOWN;
63716370
dc_plane_state->rotation = ROTATION_ANGLE_0;

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,14 +2225,10 @@ enum dc_status dcn20_patch_unknown_plane_state(struct dc_plane_state *plane_stat
22252225
enum surface_pixel_format surf_pix_format = plane_state->format;
22262226
unsigned int bpp = resource_pixel_format_to_bpp(surf_pix_format);
22272227

2228-
enum swizzle_mode_values swizzle = DC_SW_LINEAR;
2229-
2228+
plane_state->tiling_info.gfx9.swizzle = DC_SW_64KB_S;
22302229
if (bpp == 64)
2231-
swizzle = DC_SW_64KB_D;
2232-
else
2233-
swizzle = DC_SW_64KB_S;
2230+
plane_state->tiling_info.gfx9.swizzle = DC_SW_64KB_D;
22342231

2235-
plane_state->tiling_info.gfx9.swizzle = swizzle;
22362232
return DC_OK;
22372233
}
22382234

drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,15 +1393,13 @@ static uint32_t read_pipe_fuses(struct dc_context *ctx)
13931393

13941394
static enum dc_status dcn21_patch_unknown_plane_state(struct dc_plane_state *plane_state)
13951395
{
1396-
enum dc_status result = DC_OK;
1397-
13981396
if (plane_state->ctx->dc->debug.disable_dcc == DCC_ENABLE) {
13991397
plane_state->dcc.enable = 1;
14001398
/* align to our worst case block width */
14011399
plane_state->dcc.meta_pitch = ((plane_state->src_rect.width + 1023) / 1024) * 1024;
14021400
}
1403-
result = dcn20_patch_unknown_plane_state(plane_state);
1404-
return result;
1401+
1402+
return dcn20_patch_unknown_plane_state(plane_state);
14051403
}
14061404

14071405
static const struct resource_funcs dcn21_res_pool_funcs = {

0 commit comments

Comments
 (0)