Skip to contentSkip to conversation

drm/amd/display: Remove redundant AUTO color format handling in else

PATCH In review Nicolas Frattaroli 2 participants 2 messages Jul 20

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

PATCH 1/1 drm/amd/display: Remove redundant AUTO color format handling in else

The AUTO connector color format is handled in the earlier branches for both RGB and YUV420. The repeated check in the else branch is therefore redundant.

Remove it to make the code less confusing to read.

Fixes 8a0343b03b98 ("drm/amdgpu: Implement "color format" DRM property")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c +1 -6
index 88f938a8f24f..ea277c991234 100644
@@ -854,12 +854,7 @@ static void fill_stream_properties_from_drm_display_mode(
 		 * error bubbles up to userspace. This way, userspace knows it
 		 * needs to make a better choice.
 		 */
-		if (connector_state->color_format != DRM_CONNECTOR_COLOR_FORMAT_AUTO)
-			timing_out->pixel_encoding = PIXEL_ENCODING_UNDEFINED;
-		else if (drm_mode_is_420_only(info, mode_in))
-			timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420;
-		else
-			timing_out->pixel_encoding = PIXEL_ENCODING_RGB;
+		timing_out->pixel_encoding = PIXEL_ENCODING_UNDEFINED;
 	}
 
 	timing_out->timing_3d_format = TIMING_3D_FORMAT_NONE;

---
base-commit: e6a72e9b927165081566252d972ea1cbbee5bf28
change-id: 20260720-color-format-amdgpu-fix-09a03106c9da

Best regards,

Signature · 1 line
Nicolas Frattaroli <[email protected]>
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Nicolas Frattaroli

The AUTO connector color format is handled in the earlier branches for both RGB and YUV420. The repeated check in the else branch is therefore redundant.

Remove it to make the code less confusing to read.

Fixes 8a0343b03b98 ("drm/amdgpu: Implement "color format" DRM property")

Thanks!

Quoted 31 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c +1 -7
index 88f938a8f24f..ea277c991234 100644
@@ -854,12 +854,7 @@ static void fill_stream_properties_from_drm_display_mode(
 		 * error bubbles up to userspace. This way, userspace knows it
 		 * needs to make a better choice.
 		 */
-		if (connector_state->color_format != DRM_CONNECTOR_COLOR_FORMAT_AUTO)
-			timing_out->pixel_encoding = PIXEL_ENCODING_UNDEFINED;
-		else if (drm_mode_is_420_only(info, mode_in))
-			timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420;
-		else
-			timing_out->pixel_encoding = PIXEL_ENCODING_RGB;
+		timing_out->pixel_encoding = PIXEL_ENCODING_UNDEFINED;
 	}
 
 	timing_out->timing_3d_format = TIMING_3D_FORMAT_NONE;
 
---

base-commit: e6a72e9b927165081566252d972ea1cbbee5bf28
change-id: 20260720-color-format-amdgpu-fix-09a03106c9da

Best regards,

Signature · 1 line
Nicolas Frattaroli <[email protected]>