dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param
@ 2019-01-03 19:48 Gustavo A. R. Silva
  2019-01-03 21:11 ` Wentland, Harry
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-03 19:48 UTC (permalink / raw)
  To: Dmytro Laktyushkin, Harry Wentland, Leo Li, Alex Deucher,
	Christian König, David (ChunMing) Zhou, David Airlie,
	Daniel Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, Gustavo A. R. Silva

Fix boolean expression by using logical AND operator '&&'
instead of bitwise operator '&'.

This issue was detected with the help of Coccinelle.

Fixes: 6d04ee9dc101 ("drm/amd/display: Restructuring and cleaning up DML")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
index c2037daa8e66..d341b69fdc1a 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
@@ -881,7 +881,7 @@ static void get_surf_rq_param(
 	/* the dpte_group_bytes is reduced for the specific case of vertical
 	 * access of a tile surface that has dpte request of 8x1 ptes.
 	 */
-	if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) /*reduced, in this case, will have page fault within a group */
+	if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) /*reduced, in this case, will have page fault within a group */
 		rq_sizing_param->dpte_group_bytes = 512;
 	else
 		/*full size */
-- 
2.20.1

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

* Re: [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param
  2019-01-03 19:48 [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param Gustavo A. R. Silva
@ 2019-01-03 21:11 ` Wentland, Harry
  2019-01-03 21:18   ` Gustavo A. R. Silva
  2019-03-22  3:10   ` Gustavo A. R. Silva
  0 siblings, 2 replies; 6+ messages in thread
From: Wentland, Harry @ 2019-01-03 21:11 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Laktyushkin, Dmytro, Li, Sun peng (Leo),
	Deucher, Alexander, Koenig, Christian, Zhou, David(ChunMing),
	David Airlie, Daniel Vetter
  Cc: dri-devel, amd-gfx, linux-kernel

On 2019-01-03 2:48 p.m., Gustavo A. R. Silva wrote:
> Fix boolean expression by using logical AND operator '&&'
> instead of bitwise operator '&'.
> 
> This issue was detected with the help of Coccinelle.
> 
> Fixes: 6d04ee9dc101 ("drm/amd/display: Restructuring and cleaning up DML")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

and applied.

Harry

> ---
>  drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
> index c2037daa8e66..d341b69fdc1a 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
> @@ -881,7 +881,7 @@ static void get_surf_rq_param(
>  	/* the dpte_group_bytes is reduced for the specific case of vertical
>  	 * access of a tile surface that has dpte request of 8x1 ptes.
>  	 */
> -	if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) /*reduced, in this case, will have page fault within a group */
> +	if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) /*reduced, in this case, will have page fault within a group */
>  		rq_sizing_param->dpte_group_bytes = 512;
>  	else
>  		/*full size */
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param
  2019-01-03 21:11 ` Wentland, Harry
@ 2019-01-03 21:18   ` Gustavo A. R. Silva
  2019-03-22  3:10   ` Gustavo A. R. Silva
  1 sibling, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-03 21:18 UTC (permalink / raw)
  To: Wentland, Harry, Laktyushkin, Dmytro, Li, Sun peng (Leo),
	Deucher, Alexander, Koenig, Christian, Zhou, David(ChunMing),
	David Airlie, Daniel Vetter
  Cc: amd-gfx, dri-devel, linux-kernel



On 1/3/19 3:11 PM, Wentland, Harry wrote:
> On 2019-01-03 2:48 p.m., Gustavo A. R. Silva wrote:
>> Fix boolean expression by using logical AND operator '&&'
>> instead of bitwise operator '&'.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Fixes: 6d04ee9dc101 ("drm/amd/display: Restructuring and cleaning up DML")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> 
> and applied.
> 

Thanks, Harry.

--
Gustavo

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

* Re: [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param
  2019-01-03 21:11 ` Wentland, Harry
  2019-01-03 21:18   ` Gustavo A. R. Silva
@ 2019-03-22  3:10   ` Gustavo A. R. Silva
  2019-03-22  3:14     ` Joe Perches
  1 sibling, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-03-22  3:10 UTC (permalink / raw)
  To: Wentland, Harry, Laktyushkin, Dmytro, Li, Sun peng (Leo),
	Deucher, Alexander, Koenig, Christian, Zhou, David(ChunMing),
	David Airlie, Daniel Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, stable

Hi Harry,

I noticed this patch is already in mainline, but the stable tag
was removed.  What is the reason for that if this bug is present
in stable?

Thanks
--
Gustavo

On 1/3/19 3:11 PM, Wentland, Harry wrote:
> On 2019-01-03 2:48 p.m., Gustavo A. R. Silva wrote:
>> Fix boolean expression by using logical AND operator '&&'
>> instead of bitwise operator '&'.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Fixes: 6d04ee9dc101 ("drm/amd/display: Restructuring and cleaning up DML")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> 
> and applied.
> 
> Harry
> 
>> ---
>>  drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
>> index c2037daa8e66..d341b69fdc1a 100644
>> --- a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
>> +++ b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
>> @@ -881,7 +881,7 @@ static void get_surf_rq_param(
>>  	/* the dpte_group_bytes is reduced for the specific case of vertical
>>  	 * access of a tile surface that has dpte request of 8x1 ptes.
>>  	 */
>> -	if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) /*reduced, in this case, will have page fault within a group */
>> +	if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) /*reduced, in this case, will have page fault within a group */
>>  		rq_sizing_param->dpte_group_bytes = 512;
>>  	else
>>  		/*full size */
>>

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

* Re: [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param
  2019-03-22  3:10   ` Gustavo A. R. Silva
@ 2019-03-22  3:14     ` Joe Perches
  2019-03-22  3:30       ` Gustavo A. R. Silva
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2019-03-22  3:14 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Wentland, Harry, Laktyushkin, Dmytro, Li,
	Sun peng (Leo),
	Deucher, Alexander, Koenig, Christian, Zhou, David(ChunMing),
	David Airlie, Daniel Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, stable

On Thu, 2019-03-21 at 22:10 -0500, Gustavo A. R. Silva wrote:
> Hi Harry,
> 
> I noticed this patch is already in mainline, but the stable tag
> was removed.  What is the reason for that if this bug is present
> in stable?

It's not a bug, it's just a style issue and
the && use in some compilers it may be slower.

bool when set is 1.

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

* Re: [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param
  2019-03-22  3:14     ` Joe Perches
@ 2019-03-22  3:30       ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2019-03-22  3:30 UTC (permalink / raw)
  To: Joe Perches, Wentland, Harry, Laktyushkin, Dmytro, Li,
	Sun peng (Leo),
	Deucher, Alexander, Koenig, Christian, Zhou, David(ChunMing),
	David Airlie, Daniel Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, stable



On 3/21/19 10:14 PM, Joe Perches wrote:
> On Thu, 2019-03-21 at 22:10 -0500, Gustavo A. R. Silva wrote:
>> Hi Harry,
>>
>> I noticed this patch is already in mainline, but the stable tag
>> was removed.  What is the reason for that if this bug is present
>> in stable?
> 
> It's not a bug, it's just a style issue and
> the && use in some compilers it may be slower.
> 

You're right. What might be a bug in some cases
is the other way around.

Thanks, Joe.

--
Gustavo

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

end of thread, other threads:[~2019-03-22  3:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03 19:48 [PATCH] drm/amd/display: Fix boolean expression in get_surf_rq_param Gustavo A. R. Silva
2019-01-03 21:11 ` Wentland, Harry
2019-01-03 21:18   ` Gustavo A. R. Silva
2019-03-22  3:10   ` Gustavo A. R. Silva
2019-03-22  3:14     ` Joe Perches
2019-03-22  3:30       ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).