All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
@ 2017-04-06  9:34 ` Neil Armstrong
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2017-04-06  9:34 UTC (permalink / raw)
  To: dri-devel
  Cc: Neil Armstrong, laurent.pinchart+renesas, architt, Jose.Abreu,
	linux-kernel, Dan Carpenter

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

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 8b60503..100e1ee 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -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
-- 
1.9.1

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

* [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
@ 2017-04-06  9:34 ` Neil Armstrong
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2017-04-06  9:34 UTC (permalink / raw)
  To: dri-devel
  Cc: Jose.Abreu, laurent.pinchart+renesas, Neil Armstrong,
	linux-kernel, Dan Carpenter

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

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 8b60503..100e1ee 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -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
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
  2017-04-06  9:34 ` Neil Armstrong
@ 2017-04-06  9:41   ` Neil Armstrong
  -1 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2017-04-06  9:41 UTC (permalink / raw)
  To: dri-devel
  Cc: laurent.pinchart+renesas, architt, Jose.Abreu, linux-kernel,
	Dan Carpenter

On 04/06/2017 11:34 AM, Neil Armstrong wrote:
> 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

Forgot...

Fixes: def23aa7e982 ("drm: bridge: dw-hdmi: Switch to V4L bus format and encodings")

> 
> Cc: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 8b60503..100e1ee 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -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
> 

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

* Re: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
@ 2017-04-06  9:41   ` Neil Armstrong
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2017-04-06  9:41 UTC (permalink / raw)
  To: dri-devel
  Cc: Jose.Abreu, laurent.pinchart+renesas, linux-kernel, Dan Carpenter

On 04/06/2017 11:34 AM, Neil Armstrong wrote:
> 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

Forgot...

Fixes: def23aa7e982 ("drm: bridge: dw-hdmi: Switch to V4L bus format and encodings")

> 
> Cc: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 8b60503..100e1ee 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -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
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
  2017-04-06  9:34 ` Neil Armstrong
@ 2017-04-07  8:32   ` Archit Taneja
  -1 siblings, 0 replies; 10+ messages in thread
From: Archit Taneja @ 2017-04-07  8:32 UTC (permalink / raw)
  To: Neil Armstrong, dri-devel
  Cc: laurent.pinchart+renesas, Jose.Abreu, linux-kernel, Dan Carpenter



On 04/06/2017 03:04 PM, Neil Armstrong wrote:
> 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

> 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.
>
> This patch changes the if test to > 0.

The change technically makes the if statement check for a
non-zero value.

Reviewed-by: Archit Taneja <architt@codeaurora.org>

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

Thanks,
Archit

>
> 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>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 8b60503..100e1ee 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -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
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
@ 2017-04-07  8:32   ` Archit Taneja
  0 siblings, 0 replies; 10+ messages in thread
From: Archit Taneja @ 2017-04-07  8:32 UTC (permalink / raw)
  To: Neil Armstrong, dri-devel
  Cc: Jose.Abreu, laurent.pinchart+renesas, linux-kernel, Dan Carpenter



On 04/06/2017 03:04 PM, Neil Armstrong wrote:
> 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

> 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.
>
> This patch changes the if test to > 0.

The change technically makes the if statement check for a
non-zero value.

Reviewed-by: Archit Taneja <architt@codeaurora.org>

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

Thanks,
Archit

>
> 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>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 8b60503..100e1ee 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -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
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
  2017-04-07  8:32   ` Archit Taneja
@ 2017-04-07  8:37     ` Neil Armstrong
  -1 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2017-04-07  8:37 UTC (permalink / raw)
  To: Archit Taneja, dri-devel
  Cc: laurent.pinchart+renesas, Jose.Abreu, linux-kernel, Dan Carpenter

On 04/07/2017 10:32 AM, Archit Taneja wrote:
> 
> 
> On 04/06/2017 03:04 PM, Neil Armstrong wrote:
>> 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
> 
>> 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.
>>
>> 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.

> 
> Reviewed-by: Archit Taneja <architt@codeaurora.org>
> 
> Feel free to push to drm-misc after updating the commit message.
> 
> Thanks,
> Archit
> 
>>
>> 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>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>> ---
>>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> index 8b60503..100e1ee 100644
>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> @@ -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
>>
> 

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

* Re: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
@ 2017-04-07  8:37     ` Neil Armstrong
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2017-04-07  8:37 UTC (permalink / raw)
  To: Archit Taneja, dri-devel
  Cc: Jose.Abreu, laurent.pinchart+renesas, linux-kernel, Dan Carpenter

On 04/07/2017 10:32 AM, Archit Taneja wrote:
> 
> 
> On 04/06/2017 03:04 PM, Neil Armstrong wrote:
>> 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
> 
>> 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.
>>
>> 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.

> 
> Reviewed-by: Archit Taneja <architt@codeaurora.org>
> 
> Feel free to push to drm-misc after updating the commit message.
> 
> Thanks,
> Archit
> 
>>
>> 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>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>> ---
>>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> index 8b60503..100e1ee 100644
>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> @@ -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
>>
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
  2017-04-07  8:37     ` Neil Armstrong
@ 2017-04-07  9:10       ` Neil Armstrong
  -1 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2017-04-07  9:10 UTC (permalink / raw)
  To: Archit Taneja, dri-devel
  Cc: laurent.pinchart+renesas, Jose.Abreu, linux-kernel, Dan Carpenter

On 04/07/2017 10:37 AM, Neil Armstrong wrote:
> On 04/07/2017 10:32 AM, Archit Taneja wrote:
>>
>>
>> On 04/06/2017 03:04 PM, Neil Armstrong wrote:
>>> 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
>>
>>> 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.
>>>
>>> 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.
> 
>>
>> Reviewed-by: Archit Taneja <architt@codeaurora.org>
>>
>> Feel free to push to drm-misc after updating the commit message.
>>
>> Thanks,
>> Archit
>>
>>>
>>> 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>
>>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>>> ---
>>>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> index 8b60503..100e1ee 100644
>>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> @@ -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

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

* Re: [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data
@ 2017-04-07  9:10       ` Neil Armstrong
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2017-04-07  9:10 UTC (permalink / raw)
  To: Archit Taneja, dri-devel
  Cc: Jose.Abreu, laurent.pinchart+renesas, linux-kernel, Dan Carpenter

On 04/07/2017 10:37 AM, Neil Armstrong wrote:
> On 04/07/2017 10:32 AM, Archit Taneja wrote:
>>
>>
>> On 04/06/2017 03:04 PM, Neil Armstrong wrote:
>>> 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
>>
>>> 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.
>>>
>>> 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.
> 
>>
>> Reviewed-by: Archit Taneja <architt@codeaurora.org>
>>
>> Feel free to push to drm-misc after updating the commit message.
>>
>> Thanks,
>> Archit
>>
>>>
>>> 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>
>>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
>>> ---
>>>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> index 8b60503..100e1ee 100644
>>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> @@ -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
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-04-07  9:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06  9:34 [PATCH] drm: bridge: dw-hdmi: fix input format/encoding from plat_data Neil Armstrong
2017-04-06  9:34 ` Neil Armstrong
2017-04-06  9:41 ` Neil Armstrong
2017-04-06  9:41   ` Neil Armstrong
2017-04-07  8:32 ` Archit Taneja
2017-04-07  8:32   ` Archit Taneja
2017-04-07  8:37   ` Neil Armstrong
2017-04-07  8:37     ` Neil Armstrong
2017-04-07  9:10     ` Neil Armstrong
2017-04-07  9:10       ` Neil Armstrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.