mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: "Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <siqueira@igalia.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Daniel Stone" <daniel@fooishbar.org>,
	"Marius Vlad" <marius.vlad@collabora.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	 linux-kernel@vger.kernel.org, Dan Carpenter <error27@gmail.com>,
	 kernel@collabora.com,
	Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Subject: [PATCH] drm/amd/display: Remove redundant AUTO color format handling in else
Date: Mon, 20 Jul 2026 15:03:57 +0200	[thread overview]
Message-ID: <20260720-color-format-amdgpu-fix-v1-1-4ec896bb1531@collabora.com> (raw)

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.

Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/alCcJmDeIYEE94Eh@stanley.mountain/
Fixes: 8a0343b03b98 ("drm/amdgpu: Implement "color format" DRM property")
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
index 88f938a8f24f..ea277c991234 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
@@ -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,
--  
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>


             reply	other threads:[~2026-07-20 13:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 13:03 Nicolas Frattaroli [this message]
2026-07-20 13:55 ` Leo Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260720-color-format-amdgpu-fix-v1-1-4ec896bb1531@collabora.com \
    --to=nicolas.frattaroli@collabora.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=error27@gmail.com \
    --cc=harry.wentland@amd.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marius.vlad@collabora.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®