Skip to contentSkip to conversation

drm/amd/display: Fix warning caused by a bad fake property

PATCH New Guilherme G. Piccoli 1 participant 1 message Jan 14, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Fix warning caused by a bad fake property

Commit 5468c36d6285 ("drm/amd/display: Filter Invalid 420 Modes for HDMI TMDS") added a validation on driver probe to prevent invalid TMDS modes. For that, it requires to fake some plane properties before submitting to the validation routines.

Happens that one of such fake properties (swizzle) causes a boot-time warning due to an assert on swizzle routines. Since it's a fake property, change it hereby to a valid value to prevent such warning. Also, while at it, fix the unnecessary double assignment of this same property in code.

Fixes 5468c36d6285 ("drm/amd/display: Filter Invalid 420 Modes for HDMI TMDS")
Cc Fangzhi Zuo <[email protected]>
Cc Harry Wentland <[email protected]>
Cc Leo Li <[email protected]>
Cc Mark Broadworth <[email protected]>
Cc Rodrigo Siqueira <[email protected]>
Cc Sung Joon Kim <[email protected]>

---

Hi folks, notice my choice here was to set swizzle to DC_SW_LINEAR; I've considered creating a new enum member (like "DC_SW_FAKE", or something like that) but seems it's easier to just use the LINEAR one. In my (very cheap!) understanding, this shouldn't affect the purpose of the TMDS validation thing.

Lemme know if there's something to improve here, and thanks in advance for reviews/comments.
Cheers,

Guilherme

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
index 1b7f20a9d4ae..35ab39fd9345 100644
@@ -6261,9 +6261,8 @@ static enum dc_status dm_validate_stream_and_context(struct dc *dc,
 	dc_plane_state->plane_size.surface_size.width  = stream->src.width;
 	dc_plane_state->plane_size.chroma_size.height  = stream->src.height;
 	dc_plane_state->plane_size.chroma_size.width   = stream->src.width;
-	dc_plane_state->tiling_info.gfx9.swizzle =  DC_SW_UNKNOWN;
 	dc_plane_state->format = SURFACE_PIXEL_FORMAT_GRPH_ARGB8888;
-	dc_plane_state->tiling_info.gfx9.swizzle = DC_SW_UNKNOWN;
+	dc_plane_state->tiling_info.gfx9.swizzle = DC_SW_LINEAR;
 	dc_plane_state->rotation = ROTATION_ANGLE_0;
 	dc_plane_state->is_tiling_rotated = false;
 	dc_plane_state->tiling_info.gfx8.array_mode = DC_ARRAY_LINEAR_GENERAL;
Signature · 1 line
2.39.0