All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code
@ 2022-12-15 16:37 ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-12-15 16:37 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira
  Cc: Arnd Bergmann, Alex Deucher, Christian König, Pan, Xinhui,
	David Airlie, Daniel Vetter, Wenjing Liu, George Shen, Alan Liu,
	amd-gfx, dri-devel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The dp_retrieve_lttpr_cap() return type changed from 'bool'
to 'enum dc_status', so now the early 'return' uses the wrong
type:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 'dp_retrieve_lttpr_cap':
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:5075:24: error: implicit conversion from 'enum <anonymous>' to 'enum dc_status' [-Werror=enum-conversion]
 5075 |                 return false;
      |                        ^~~~~

Convert it to return 'DC_OK', which is the same value as 'false'.

Fixes: b473bd5fc333 ("drm/amd/display: refine wake up aux in retrieve link caps")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
No idea if DC_OK is the intended return code, but it leaves the behavior
unchanged and fixes the warning.
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index af9411ee3c74..95dbfa4e996a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -5095,7 +5095,7 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
 	bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
 
 	if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
-		return false;
+		return DC_OK;
 
 	/* By reading LTTPR capability, RX assumes that we will enable
 	 * LTTPR extended aux timeout if LTTPR is present.
-- 
2.35.1


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

* [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code
@ 2022-12-15 16:37 ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-12-15 16:37 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira
  Cc: Alan Liu, Arnd Bergmann, Pan, Xinhui, Wenjing Liu, linux-kernel,
	amd-gfx, dri-devel, George Shen, Alex Deucher,
	Christian König

From: Arnd Bergmann <arnd@arndb.de>

The dp_retrieve_lttpr_cap() return type changed from 'bool'
to 'enum dc_status', so now the early 'return' uses the wrong
type:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 'dp_retrieve_lttpr_cap':
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:5075:24: error: implicit conversion from 'enum <anonymous>' to 'enum dc_status' [-Werror=enum-conversion]
 5075 |                 return false;
      |                        ^~~~~

Convert it to return 'DC_OK', which is the same value as 'false'.

Fixes: b473bd5fc333 ("drm/amd/display: refine wake up aux in retrieve link caps")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
No idea if DC_OK is the intended return code, but it leaves the behavior
unchanged and fixes the warning.
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index af9411ee3c74..95dbfa4e996a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -5095,7 +5095,7 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
 	bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
 
 	if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
-		return false;
+		return DC_OK;
 
 	/* By reading LTTPR capability, RX assumes that we will enable
 	 * LTTPR extended aux timeout if LTTPR is present.
-- 
2.35.1


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

* [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code
@ 2022-12-15 16:37 ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-12-15 16:37 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira
  Cc: Alan Liu, Arnd Bergmann, Pan, Xinhui, Wenjing Liu, linux-kernel,
	amd-gfx, dri-devel, Daniel Vetter, George Shen, Alex Deucher,
	David Airlie, Christian König

From: Arnd Bergmann <arnd@arndb.de>

The dp_retrieve_lttpr_cap() return type changed from 'bool'
to 'enum dc_status', so now the early 'return' uses the wrong
type:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 'dp_retrieve_lttpr_cap':
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:5075:24: error: implicit conversion from 'enum <anonymous>' to 'enum dc_status' [-Werror=enum-conversion]
 5075 |                 return false;
      |                        ^~~~~

Convert it to return 'DC_OK', which is the same value as 'false'.

Fixes: b473bd5fc333 ("drm/amd/display: refine wake up aux in retrieve link caps")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
No idea if DC_OK is the intended return code, but it leaves the behavior
unchanged and fixes the warning.
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index af9411ee3c74..95dbfa4e996a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -5095,7 +5095,7 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
 	bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
 
 	if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
-		return false;
+		return DC_OK;
 
 	/* By reading LTTPR capability, RX assumes that we will enable
 	 * LTTPR extended aux timeout if LTTPR is present.
-- 
2.35.1


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

* Re: [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code
  2022-12-15 16:37 ` Arnd Bergmann
@ 2022-12-15 17:56   ` Michel Dänzer
  -1 siblings, 0 replies; 8+ messages in thread
From: Michel Dänzer @ 2022-12-15 17:56 UTC (permalink / raw)
  To: Arnd Bergmann, Harry Wentland, Leo Li, Rodrigo Siqueira
  Cc: Alan Liu, Arnd Bergmann, Pan, Xinhui, Wenjing Liu, linux-kernel,
	amd-gfx, dri-devel, Daniel Vetter, George Shen, Alex Deucher,
	David Airlie, Christian König

On 12/15/22 17:37, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The dp_retrieve_lttpr_cap() return type changed from 'bool'
> to 'enum dc_status', so now the early 'return' uses the wrong
> type:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 'dp_retrieve_lttpr_cap':
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:5075:24: error: implicit conversion from 'enum <anonymous>' to 'enum dc_status' [-Werror=enum-conversion]
>  5075 |                 return false;
>       |                        ^~~~~
> 
> Convert it to return 'DC_OK', which is the same value as 'false'.
> 
> Fixes: b473bd5fc333 ("drm/amd/display: refine wake up aux in retrieve link caps")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> No idea if DC_OK is the intended return code, but it leaves the behavior
> unchanged and fixes the warning.
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> index af9411ee3c74..95dbfa4e996a 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> @@ -5095,7 +5095,7 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
>  	bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
>  
>  	if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
> -		return false;
> +		return DC_OK;

		return status;

seems more appropriate. (Otherwise the status = DC_ERROR_UNEXPECTED initialization has no effect)


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer


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

* Re: [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code
@ 2022-12-15 17:56   ` Michel Dänzer
  0 siblings, 0 replies; 8+ messages in thread
From: Michel Dänzer @ 2022-12-15 17:56 UTC (permalink / raw)
  To: Arnd Bergmann, Harry Wentland, Leo Li, Rodrigo Siqueira
  Cc: Alan Liu, Arnd Bergmann, Pan, Xinhui, Wenjing Liu, linux-kernel,
	amd-gfx, dri-devel, George Shen, Alex Deucher,
	Christian König

On 12/15/22 17:37, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The dp_retrieve_lttpr_cap() return type changed from 'bool'
> to 'enum dc_status', so now the early 'return' uses the wrong
> type:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 'dp_retrieve_lttpr_cap':
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:5075:24: error: implicit conversion from 'enum <anonymous>' to 'enum dc_status' [-Werror=enum-conversion]
>  5075 |                 return false;
>       |                        ^~~~~
> 
> Convert it to return 'DC_OK', which is the same value as 'false'.
> 
> Fixes: b473bd5fc333 ("drm/amd/display: refine wake up aux in retrieve link caps")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> No idea if DC_OK is the intended return code, but it leaves the behavior
> unchanged and fixes the warning.
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> index af9411ee3c74..95dbfa4e996a 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> @@ -5095,7 +5095,7 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
>  	bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
>  
>  	if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
> -		return false;
> +		return DC_OK;

		return status;

seems more appropriate. (Otherwise the status = DC_ERROR_UNEXPECTED initialization has no effect)


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer


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

* Re: [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code
  2022-12-15 17:56   ` Michel Dänzer
  (?)
@ 2022-12-16 12:38     ` Arnd Bergmann
  -1 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-12-16 12:38 UTC (permalink / raw)
  To: Michel Dänzer, Arnd Bergmann, Harry Wentland, Leo Li,
	Rodrigo Siqueira
  Cc: Alan Liu, Pan, Xinhui, Wenjing Liu, linux-kernel, amd-gfx,
	dri-devel, Daniel Vetter, George Shen, Alex Deucher, Dave Airlie,
	Christian König

On Thu, Dec 15, 2022, at 18:56, Michel Dänzer wrote:
> On 12/15/22 17:37, Arnd Bergmann wrote:
/amd/display/dc/core/dc_link_dp.c
>> index af9411ee3c74..95dbfa4e996a 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> @@ -5095,7 +5095,7 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
>>  	bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
>>  
>>  	if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
>> -		return false;
>> +		return DC_OK;
>
> 		return status;
>
> seems more appropriate. (Otherwise the status = DC_ERROR_UNEXPECTED 
> initialization has no effect)

Ok, makes sense. I'd also remove the unused initialization in that
case though:

 enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
 {
        uint8_t lttpr_dpcd_data[8];
-       enum dc_status status = DC_ERROR_UNEXPECTED;
-       bool is_lttpr_present = false;
+       enum dc_status status;
+       bool is_lttpr_present;
 
        /* Logic to determine LTTPR support*/
        bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
 
        if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
-               return false;
+               return DC_ERROR_UNEXPECTED;
 
        /* By reading LTTPR capability, RX assumes that we will enable
         * LTTPR extended aux timeout if LTTPR is present.

I'll send that as a v2 once that passes my build test and nobody
has further suggestions.

       Arnd

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

* Re: [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code
@ 2022-12-16 12:38     ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-12-16 12:38 UTC (permalink / raw)
  To: Michel Dänzer, Arnd Bergmann, Harry Wentland, Leo Li,
	Rodrigo Siqueira
  Cc: Alan Liu, Pan, Xinhui, Wenjing Liu, linux-kernel, dri-devel,
	amd-gfx, George Shen, Alex Deucher, Christian König

On Thu, Dec 15, 2022, at 18:56, Michel Dänzer wrote:
> On 12/15/22 17:37, Arnd Bergmann wrote:
/amd/display/dc/core/dc_link_dp.c
>> index af9411ee3c74..95dbfa4e996a 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> @@ -5095,7 +5095,7 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
>>  	bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
>>  
>>  	if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
>> -		return false;
>> +		return DC_OK;
>
> 		return status;
>
> seems more appropriate. (Otherwise the status = DC_ERROR_UNEXPECTED 
> initialization has no effect)

Ok, makes sense. I'd also remove the unused initialization in that
case though:

 enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
 {
        uint8_t lttpr_dpcd_data[8];
-       enum dc_status status = DC_ERROR_UNEXPECTED;
-       bool is_lttpr_present = false;
+       enum dc_status status;
+       bool is_lttpr_present;
 
        /* Logic to determine LTTPR support*/
        bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
 
        if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
-               return false;
+               return DC_ERROR_UNEXPECTED;
 
        /* By reading LTTPR capability, RX assumes that we will enable
         * LTTPR extended aux timeout if LTTPR is present.

I'll send that as a v2 once that passes my build test and nobody
has further suggestions.

       Arnd

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

* Re: [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code
@ 2022-12-16 12:38     ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-12-16 12:38 UTC (permalink / raw)
  To: Michel Dänzer, Arnd Bergmann, Harry Wentland, Leo Li,
	Rodrigo Siqueira
  Cc: Alan Liu, Pan, Xinhui, Wenjing Liu, linux-kernel, dri-devel,
	amd-gfx, Daniel Vetter, George Shen, Alex Deucher, Dave Airlie,
	Christian König

On Thu, Dec 15, 2022, at 18:56, Michel Dänzer wrote:
> On 12/15/22 17:37, Arnd Bergmann wrote:
/amd/display/dc/core/dc_link_dp.c
>> index af9411ee3c74..95dbfa4e996a 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
>> @@ -5095,7 +5095,7 @@ enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
>>  	bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
>>  
>>  	if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
>> -		return false;
>> +		return DC_OK;
>
> 		return status;
>
> seems more appropriate. (Otherwise the status = DC_ERROR_UNEXPECTED 
> initialization has no effect)

Ok, makes sense. I'd also remove the unused initialization in that
case though:

 enum dc_status dp_retrieve_lttpr_cap(struct dc_link *link)
 {
        uint8_t lttpr_dpcd_data[8];
-       enum dc_status status = DC_ERROR_UNEXPECTED;
-       bool is_lttpr_present = false;
+       enum dc_status status;
+       bool is_lttpr_present;
 
        /* Logic to determine LTTPR support*/
        bool vbios_lttpr_interop = link->dc->caps.vbios_lttpr_aware;
 
        if (!vbios_lttpr_interop || !link->dc->caps.extended_aux_timeout_support)
-               return false;
+               return DC_ERROR_UNEXPECTED;
 
        /* By reading LTTPR capability, RX assumes that we will enable
         * LTTPR extended aux timeout if LTTPR is present.

I'll send that as a v2 once that passes my build test and nobody
has further suggestions.

       Arnd

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

end of thread, other threads:[~2022-12-16 14:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15 16:37 [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code Arnd Bergmann
2022-12-15 16:37 ` Arnd Bergmann
2022-12-15 16:37 ` Arnd Bergmann
2022-12-15 17:56 ` Michel Dänzer
2022-12-15 17:56   ` Michel Dänzer
2022-12-16 12:38   ` Arnd Bergmann
2022-12-16 12:38     ` Arnd Bergmann
2022-12-16 12:38     ` Arnd Bergmann

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.