Skip to content

Commit e20c29a

Browse files
committed
drm: bridge: dw-hdmi: fix input format/encoding from plat_data
The plat_data->input_bus_format and plat_data->input_bus_encoding are unsigned long and are always >=0, but the value 0 was still considered as RGB888 for input_bus_format and default color space for input_bus_encoding in the reworked code. This patch changes the if statement check for a non-zero value to either use the default input bus_format and/or bus_encoding for a zero value and the provided bus_format and/or bus_encoding for a non zero value. Thanks to Dan Carpenter for his bug report at [1]. Tested on Amlogic P230 (with CSC enabled for YUV444 to RGB) and Rockchip RK3288 ACT8846 EVB Board (no CSC involved, direct RGB passthrough). [1] http://lkml.kernel.org/r/20170406052120.GA26578@mwanda Cc: Dan Carpenter <dan.carpenter@oracle.com> Fixes: def23aa ("drm: bridge: dw-hdmi: Switch to V4L bus format and encodings") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Archit Taneja <architt@codeaurora.org> [narmstrong@baylibre.com: reworded commit message and added Fixes tag] Link: http://patchwork.freedesktop.org/patch/msgid/1491471244-24989-1-git-send-email-narmstrong@baylibre.com
1 parent 09bffa6 commit e20c29a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,14 +1654,14 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
16541654
hdmi->hdmi_data.video_mode.mpixelrepetitioninput = 0;
16551655

16561656
/* TOFIX: Get input format from plat data or fallback to RGB888 */
1657-
if (hdmi->plat_data->input_bus_format >= 0)
1657+
if (hdmi->plat_data->input_bus_format)
16581658
hdmi->hdmi_data.enc_in_bus_format =
16591659
hdmi->plat_data->input_bus_format;
16601660
else
16611661
hdmi->hdmi_data.enc_in_bus_format = MEDIA_BUS_FMT_RGB888_1X24;
16621662

16631663
/* TOFIX: Get input encoding from plat data or fallback to none */
1664-
if (hdmi->plat_data->input_bus_encoding >= 0)
1664+
if (hdmi->plat_data->input_bus_encoding)
16651665
hdmi->hdmi_data.enc_in_encoding =
16661666
hdmi->plat_data->input_bus_encoding;
16671667
else

0 commit comments

Comments
 (0)