drm: bridge: dw-hdmi: fix input format/encoding from plat_data
Subsystems (3)
PATCH 1/1 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 alsways >=0, but the value 0 was still considered as RGB888 like the default behaviour.
This patch changes the if test to > 0.
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
--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +2 -2
@@ -1668,14 +1668,14 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) hdmi->hdmi_data.video_mode.mpixelrepetitioninput =0 ;/* TOFIX: Get input format from plat data or fallback to RGB888 */ -if (hdmi->plat_data->input_bus_format >=0 ) +if (hdmi->plat_data->input_bus_format) hdmi->hdmi_data.enc_in_bus_format = hdmi->plat_data->input_bus_format;else hdmi->hdmi_data.enc_in_bus_format =MEDIA_BUS_FMT_RGB888_1X24 ;/* TOFIX: Get input encoding from plat data or fallback to none */ -if (hdmi->plat_data->input_bus_encoding >=0 ) +if (hdmi->plat_data->input_bus_encoding) hdmi->hdmi_data.enc_in_encoding = hdmi->plat_data->input_bus_encoding;else
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Neil Armstrong
The
plat_data->input_bus_formatandplat_data->input_bus_encodingare unsigned long and are alsways >=0, but the value 0 was still considered as RGB888 like the default behaviour.
Quoted 8 lines
This patch changes the if test to > 0.
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).
Forgot...
Quoted 19 lines
Cc Dan Carpenter <[email protected]>Signed-off-by Neil Armstrong <[email protected]>--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1@@ -1668,14 +1668,14 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) hdmi->hdmi_data.video_mode.mpixelrepetitioninput =0 ;/* TOFIX: Get input format from plat data or fallback to RGB888 */ -if (hdmi->plat_data->input_bus_format >=0 ) +if (hdmi->plat_data->input_bus_format) hdmi->hdmi_data.enc_in_bus_format =
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) · line 1681
Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1hdmi->plat_data->input_bus_format; else hdmi->hdmi_data.enc_in_bus_format = MEDIA_BUS_FMT_RGB888_1X24;/* TOFIX: Get input encoding from plat data or fallback to none */ -if (hdmi->plat_data->input_bus_encoding >=0 ) +if (hdmi->plat_data->input_bus_encoding) hdmi->hdmi_data.enc_in_encoding = hdmi->plat_data->input_bus_encoding;else
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 2 lines · Neil Armstrong
The
plat_data->input_bus_formatandplat_data->input_bus_encodingare unsigned long and are alsways >=0, but the value 0 was still
s/alsways/always
Quoted 1 line
considered as RGB888 like the default behaviour.
Is RGB888 default behaviour for plat_data->input_bus_encoding too? You might want to rephrase it as the "default color space", or something along those lines.
Quoted 2 lines
This patch changes the if test to > 0.
The change technically makes the if statement check for a non-zero value.
Feel free to push to drm-misc after updating the commit message.
Thanks,
Archit
Quoted 36 lines
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 <[email protected]>Signed-off-by Neil Armstrong <[email protected]>--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +2
-2@@ -1668,14 +1668,14 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) hdmi->hdmi_data.video_mode.mpixelrepetitioninput =0 ;/* TOFIX: Get input format from plat data or fallback to RGB888 */ -if (hdmi->plat_data->input_bus_format >=0 ) +if (hdmi->plat_data->input_bus_format) hdmi->hdmi_data.enc_in_bus_format = hdmi->plat_data->input_bus_format;else hdmi->hdmi_data.enc_in_bus_format =MEDIA_BUS_FMT_RGB888_1X24 ;/* TOFIX: Get input encoding from plat data or fallback to none */ -if (hdmi->plat_data->input_bus_encoding >=0 ) +if (hdmi->plat_data->input_bus_encoding) hdmi->hdmi_data.enc_in_encoding = hdmi->plat_data->input_bus_encoding;else
Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 10 lines · Archit Taneja
Quoted 2 lines · Neil Armstrong
The
plat_data->input_bus_formatandplat_data->input_bus_encodingare unsigned long and are alsways >=0, but the value 0 was stills/alsways/always
Quoted 1 line
considered as RGB888 like the default behaviour.
Quoted 8 lines
Is RGB888 default behaviour for
plat_data->input_bus_encodingtoo? You might want to rephrase it as the "default color space", or something along those lines.Quoted 2 lines
This patch changes the if test to > 0.
The change technically makes the if statement check for a non-zero value.
Thanks, here is the rephrased commit message :
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.
Quoted 37 lines
Reviewed-by Archit Taneja <[email protected]>Feel free to push to drm-misc after updating the commit message.
Thanks,
ArchitQuoted 29 lines
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 <[email protected]>Signed-off-by Neil Armstrong <[email protected]>--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1@@ -1668,14 +1668,14 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) hdmi->hdmi_data.video_mode.mpixelrepetitioninput =0 ;/* TOFIX: Get input format from plat data or fallback to RGB888 */ -if (hdmi->plat_data->input_bus_format >=0 ) +if (hdmi->plat_data->input_bus_format) hdmi->hdmi_data.enc_in_bus_format = hdmi->plat_data->input_bus_format;else hdmi->hdmi_data.enc_in_bus_format =MEDIA_BUS_FMT_RGB888_1X24 ;
Quoted 8 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) · line 1681
Quoted 7 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1/* TOFIX: Get input encoding from plat data or fallback to none */ -if (hdmi->plat_data->input_bus_encoding >=0 ) +if (hdmi->plat_data->input_bus_encoding) hdmi->hdmi_data.enc_in_encoding = hdmi->plat_data->input_bus_encoding;else
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Neil Armstrong
AppliedQuoted 27 lines · Neil Armstrong
Quoted 10 lines · Archit Taneja
Quoted 2 lines · Neil Armstrong
The
plat_data->input_bus_formatandplat_data->input_bus_encodingare unsigned long and are alsways >=0, but the value 0 was stills/alsways/always
Quoted 1 line
considered as RGB888 like the default behaviour.
Quoted 8 lines
Is RGB888 default behaviour for
plat_data->input_bus_encodingtoo? You might want to rephrase it as the "default color space", or something along those lines.Quoted 2 lines
This patch changes the if test to > 0.
The change technically makes the if statement check for a non-zero value.
Thanks, here is the rephrased commit message :
The
plat_data->input_bus_formatandplat_data->input_bus_encodingare unsigned long and are always >=0, but the value 0 was still considered as RGB888 forinput_bus_formatand default color space forinput_bus_encodingin the reworked code.
Quoted 51 lines
This patch changes the if statement check for a non-zero value to either use the default input
bus_formatand/orbus_encodingfor a zero value and the providedbus_formatand/orbus_encodingfor a non zero value.Quoted 45 lines
Reviewed-by Archit Taneja <[email protected]>Feel free to push to drm-misc after updating the commit message.
Thanks,
ArchitQuoted 36 lines
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 <[email protected]>Signed-off-by Neil Armstrong <[email protected]>--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +2
-2@@ -1668,14 +1668,14 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) hdmi->hdmi_data.video_mode.mpixelrepetitioninput =0 ;/* TOFIX: Get input format from plat data or fallback to RGB888 */ -if (hdmi->plat_data->input_bus_format >=0 ) +if (hdmi->plat_data->input_bus_format) hdmi->hdmi_data.enc_in_bus_format = hdmi->plat_data->input_bus_format;else hdmi->hdmi_data.enc_in_bus_format =MEDIA_BUS_FMT_RGB888_1X24 ;/* TOFIX: Get input encoding from plat data or fallback to none */ -if (hdmi->plat_data->input_bus_encoding >=0 ) +if (hdmi->plat_data->input_bus_encoding) hdmi->hdmi_data.enc_in_encoding = hdmi->plat_data->input_bus_encoding;else
Applied to drm-misc-next
Thanks,
Neil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel