Skip to contentSkip to conversation

drm: bridge: dw-hdmi: fix input format/encoding from plat_data

PATCH In review Neil Armstrong 2 participants 5 messages Apr 6, 2017 – Apr 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index 8b60503..100e1ee 100644
@@ -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
#1 lore raw
Quoted 4 lines · Neil Armstrong

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.

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).

[1] http://lkml.kernel.org/r/20170406052120.GA26578@mwanda

Forgot...

Fixes def23aa7e982 ("drm: bridge: dw-hdmi: Switch to V4L bus format and encodings")
Quoted 19 lines
---
 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
index 8b60503..100e1ee 100644
@@ -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 -1
 			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

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/1
#2 lore raw
In reply to Neil Armstrong
Quoted 2 lines · Neil Armstrong

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

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

---
 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
index 8b60503..100e1ee 100644
@@ -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
#3 lore raw
Quoted 10 lines · Archit Taneja
Quoted 2 lines · Neil Armstrong

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

s/alsways/always

Quoted 1 line

considered as RGB888 like the default behaviour.

Quoted 8 lines

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.

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

Feel free to push to drm-misc after updating the commit message.

Thanks,
Archit

Quoted 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

---
 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
index 8b60503..100e1ee 100644
@@ -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

author Applied
#4 lore raw
Quoted 27 lines · Neil Armstrong
Quoted 10 lines · Archit Taneja
Quoted 2 lines · Neil Armstrong

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

s/alsways/always

Quoted 1 line

considered as RGB888 like the default behaviour.

Quoted 8 lines

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.

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.

Quoted 51 lines

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 45 lines

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

---
 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
index 8b60503..100e1ee 100644
@@ -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