diff mbox series

[2/3] dw-hdmi: truly enforce 420-only formats when drm mode demands it

Message ID 20230528140001.1057084-3-adrian.larumbe@collabora.com (mailing list archive)
State Superseded
Delegated to: Neil Armstrong
Headers show
Series Add additional YUV420 bus format check for dw-meson's bridge enable | expand

Commit Message

Adrián Larumbe May 28, 2023, 2 p.m. UTC
The current output bus format selection logic is enforcing YUV420 even
when the drm mode allows for other bus formats as well.
Fix it by adding check for 420-only drm modes.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Neil Armstrong May 30, 2023, 7:46 a.m. UTC | #1
On 28/05/2023 16:00, Adrián Larumbe wrote:
> The current output bus format selection logic is enforcing YUV420 even
> when the drm mode allows for other bus formats as well.
> Fix it by adding check for 420-only drm modes.
> 
> Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
> ---
>   drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index d59a547f9cb2..1afb8f2603a0 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2710,9 +2710,10 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
>   		/* Default 8bit fallback */
>   		output_fmts[i++] = MEDIA_BUS_FMT_UYYVYY8_0_5X24;
>   
> -		*num_output_fmts = i;
> -
> -		return output_fmts;
> +		if (drm_mode_is_420_only(info, mode)) {
> +			*num_output_fmts = i;
> +			return output_fmts;
> +		}
>   	}
>   
>   	/*

Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index d59a547f9cb2..1afb8f2603a0 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2710,9 +2710,10 @@  static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
 		/* Default 8bit fallback */
 		output_fmts[i++] = MEDIA_BUS_FMT_UYYVYY8_0_5X24;
 
-		*num_output_fmts = i;
-
-		return output_fmts;
+		if (drm_mode_is_420_only(info, mode)) {
+			*num_output_fmts = i;
+			return output_fmts;
+		}
 	}
 
 	/*