mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH] drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420
@ 2022-11-16 14:35 Guillaume BRUN
  2022-11-29 11:09 ` Robert Foss
  2022-12-01  8:26 ` Neil Armstrong
  0 siblings, 2 replies; 3+ messages in thread
From: Guillaume BRUN @ 2022-11-16 14:35 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	dri-devel, linux-kernel, linux-amlogic
  Cc: Guillaume BRUN, Christian Hewitt

Cheap monitors sometimes advertise YUV modes they don't really have
(HDMI specification mandates YUV support so even monitors without actual
support will often wrongfully advertise it) which results in YUV matches
and user forum complaints of a red tint to light colour display areas in
common desktop environments.

Moving the default RGB fall-back before YUV selection results in RGB
mode matching in most cases, reducing complaints.

Fixes: 6c3c719936da ("drm/bridge: synopsys: dw-hdmi: add bus format negociation")
Signed-off-by: Guillaume BRUN <the.cheaterman@gmail.com>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 40d8ca37f5bc..aa51c61a78c7 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2720,6 +2720,9 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
 	 * if supported. In any case the default RGB888 format is added
 	 */
 
+	/* Default 8bit RGB fallback */
+	output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24;
+
 	if (max_bpc >= 16 && info->bpc == 16) {
 		if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
 			output_fmts[i++] = MEDIA_BUS_FMT_YUV16_1X48;
@@ -2753,9 +2756,6 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
 	if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
 		output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24;
 
-	/* Default 8bit RGB fallback */
-	output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24;
-
 	*num_output_fmts = i;
 
 	return output_fmts;
-- 
2.37.3


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420
  2022-11-16 14:35 [PATCH] drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420 Guillaume BRUN
@ 2022-11-29 11:09 ` Robert Foss
  2022-12-01  8:26 ` Neil Armstrong
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Foss @ 2022-11-29 11:09 UTC (permalink / raw)
  To: Guillaume BRUN
  Cc: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, David Airlie, Daniel Vetter, dri-devel,
	linux-kernel, linux-amlogic, Christian Hewitt

On Wed, 16 Nov 2022 at 15:35, Guillaume BRUN <the.cheaterman@gmail.com> wrote:
>
> Cheap monitors sometimes advertise YUV modes they don't really have
> (HDMI specification mandates YUV support so even monitors without actual
> support will often wrongfully advertise it) which results in YUV matches
> and user forum complaints of a red tint to light colour display areas in
> common desktop environments.
>
> Moving the default RGB fall-back before YUV selection results in RGB
> mode matching in most cases, reducing complaints.
>
> Fixes: 6c3c719936da ("drm/bridge: synopsys: dw-hdmi: add bus format negociation")
> Signed-off-by: Guillaume BRUN <the.cheaterman@gmail.com>
> Tested-by: Christian Hewitt <christianshewitt@gmail.com>
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 40d8ca37f5bc..aa51c61a78c7 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2720,6 +2720,9 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
>          * if supported. In any case the default RGB888 format is added
>          */
>
> +       /* Default 8bit RGB fallback */
> +       output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24;
> +
>         if (max_bpc >= 16 && info->bpc == 16) {
>                 if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
>                         output_fmts[i++] = MEDIA_BUS_FMT_YUV16_1X48;
> @@ -2753,9 +2756,6 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
>         if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
>                 output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24;
>
> -       /* Default 8bit RGB fallback */
> -       output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24;
> -
>         *num_output_fmts = i;
>
>         return output_fmts;
> --
> 2.37.3
>

Reviewed-by: Robert Foss <robert.foss@linaro.org>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420
  2022-11-16 14:35 [PATCH] drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420 Guillaume BRUN
  2022-11-29 11:09 ` Robert Foss
@ 2022-12-01  8:26 ` Neil Armstrong
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2022-12-01  8:26 UTC (permalink / raw)
  To: Andrzej Hajda, Jonas Karlman, linux-kernel, Laurent Pinchart,
	Guillaume BRUN, Robert Foss, Jernej Skrabec, Daniel Vetter,
	dri-devel, David Airlie, linux-amlogic
  Cc: Christian Hewitt

Hi,

On Wed, 16 Nov 2022 15:35:23 +0100, Guillaume BRUN wrote:
> Cheap monitors sometimes advertise YUV modes they don't really have
> (HDMI specification mandates YUV support so even monitors without actual
> support will often wrongfully advertise it) which results in YUV matches
> and user forum complaints of a red tint to light colour display areas in
> common desktop environments.
> 
> Moving the default RGB fall-back before YUV selection results in RGB
> mode matching in most cases, reducing complaints.
> 
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-fixes)

[1/1] drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=d3d6b1bf85aefe0ebc0624574b3bb62f0693914c

-- 
Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-01  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 14:35 [PATCH] drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420 Guillaume BRUN
2022-11-29 11:09 ` Robert Foss
2022-12-01  8:26 ` Neil Armstrong

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®