drm/amd/display: Fix boolean expression in get_surf_rq_param
Subsystems (5)
PATCH 1/1 drm/amd/display: Fix boolean expression in get_surf_rq_param
Fix boolean expression by using logical AND operator '&&' instead of bitwise operator '&'.
This issue was detected with the help of Coccinelle.
--- drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c +1 -1
@@ -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 */
Signature · 1 line
2.20.1
Quoted 8 lines · 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")Signed-off-by Gustavo A. R. Silva <[email protected]>
and applied.
Harry
Quoted 10 lines
--- drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c +0
-0
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c static void get_surf_rq_param( · line 887
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c +1
-1@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 6 lines · Harry
Quoted 5 lines · 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.
Quoted 8 lines
Quoted 3 lines
Fixes 6d04ee9dc101 ("drm/amd/display: Restructuring and cleaning up DML")Signed-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Harry Wentland <[email protected]>and applied.
Thanks, Harry.
--
Gustavo
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
Quoted 34 lines · Harry
Quoted 8 lines · 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")Signed-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Harry Wentland <[email protected]>and applied.
Harry
Quoted 18 lines
--- drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c +1
-1@@ -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 */
Quoted 5 lines · Gustavo A. R. Silva
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.
Quoted 10 lines · Joe Perches
Quoted 5 lines · Gustavo A. R. Silva
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