* [PATCH] drm/amd/display: Simplify same effect if/else blocks @ 2023-01-15 10:00 Deepak R Varma 2023-01-15 20:52 ` Joe Perches 2023-03-03 21:11 ` Hamza Mahfooz 0 siblings, 2 replies; 9+ messages in thread From: Deepak R Varma @ 2023-01-15 10:00 UTC (permalink / raw) To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König, Pan, Xinhui, David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel Cc: Saurabh Singh Sengar, Praveen Kumar The if / else block code has same effect irrespective of the logical evaluation. Hence, simply the implementation by removing the unnecessary conditional evaluation. While at it, also fix the long line checkpatch complaint. Issue identified using cond_no_effect.cocci Coccinelle semantic patch script. Signed-off-by: Deepak R Varma <drv@mailo.com> --- Please note: The proposed change is compile tested only. If there are any inbuilt test cases that I should run for further verification, I will appreciate guidance about it. Thank you. drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 0cb8d1f934d1..776209e5d21f 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -3470,14 +3470,9 @@ static void commit_planes_for_stream(struct dc *dc, /* Since phantom pipe programming is moved to post_unlock_program_front_end, * move the SubVP lock to after the phantom pipes have been setup */ - if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { - if (dc->hwss.subvp_pipe_control_lock) - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); - } else { - if (dc->hwss.subvp_pipe_control_lock) - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); - } - + if (dc->hwss.subvp_pipe_control_lock) + dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, + NULL, subvp_prev_use); return; } -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks 2023-01-15 10:00 [PATCH] drm/amd/display: Simplify same effect if/else blocks Deepak R Varma @ 2023-01-15 20:52 ` Joe Perches 2023-01-22 18:53 ` Deepak R Varma 2023-03-03 21:11 ` Hamza Mahfooz 1 sibling, 1 reply; 9+ messages in thread From: Joe Perches @ 2023-01-15 20:52 UTC (permalink / raw) To: Deepak R Varma, Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König, Pan, Xinhui, David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel Cc: Saurabh Singh Sengar, Praveen Kumar On Sun, 2023-01-15 at 15:30 +0530, Deepak R Varma wrote: > The if / else block code has same effect irrespective of the logical > evaluation. Hence, simply the implementation by removing the unnecessary > conditional evaluation. While at it, also fix the long line checkpatch > complaint. Issue identified using cond_no_effect.cocci Coccinelle > semantic patch script. > > Signed-off-by: Deepak R Varma <drv@mailo.com> > --- > Please note: The proposed change is compile tested only. If there are any > inbuilt test cases that I should run for further verification, I will appreciate > guidance about it. Thank you. Preface: I do not know the code. Perhaps Rodrigo Siqueira made a copy/paste error submitting the code for commit 9114b55fabae ("drm/amd/display: Fix SubVP control flow in the MPO context") as the code prior to this change is identical. Perhaps one of the false uses should be true or dependent on the interdependent_update_lock state. > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c [] > @@ -3470,14 +3470,9 @@ static void commit_planes_for_stream(struct dc *dc, > /* Since phantom pipe programming is moved to post_unlock_program_front_end, > * move the SubVP lock to after the phantom pipes have been setup > */ > - if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { > - if (dc->hwss.subvp_pipe_control_lock) > - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > - } else { > - if (dc->hwss.subvp_pipe_control_lock) > - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > - } > - Perhaps something like: if (dc->hwss.subvp_pipe_control_lock) dc->hwss.subvp_pipe_control_lock(dc, context, should_lock_all_pipes && dc->hwss.interdependent_update_lock, should_lock_all_pipes, NULL, subvp_prev_use); > + if (dc->hwss.subvp_pipe_control_lock) > + dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, > + NULL, subvp_prev_use); > return; > } > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks 2023-01-15 20:52 ` Joe Perches @ 2023-01-22 18:53 ` Deepak R Varma 2023-03-01 20:21 ` Deepak R Varma 0 siblings, 1 reply; 9+ messages in thread From: Deepak R Varma @ 2023-01-22 18:53 UTC (permalink / raw) To: Joe Perches, Rodrigo Siqueira, Alex Deucher, Aurabindo Pillai Cc: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König, Pan, Xinhui, David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel, Saurabh Singh Sengar, Praveen Kumar On Sun, Jan 15, 2023 at 12:52:10PM -0800, Joe Perches wrote: > On Sun, 2023-01-15 at 15:30 +0530, Deepak R Varma wrote: > > The if / else block code has same effect irrespective of the logical > > evaluation. Hence, simply the implementation by removing the unnecessary > > conditional evaluation. While at it, also fix the long line checkpatch > > complaint. Issue identified using cond_no_effect.cocci Coccinelle > > semantic patch script. > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > --- > > Please note: The proposed change is compile tested only. If there are any > > inbuilt test cases that I should run for further verification, I will appreciate > > guidance about it. Thank you. > > Preface: I do not know the code. > > Perhaps Rodrigo Siqueira made a copy/paste error submitting the code for > commit 9114b55fabae ("drm/amd/display: Fix SubVP control flow in the MPO context") > as the code prior to this change is identical. > > Perhaps one of the false uses should be true or dependent on the > interdependent_update_lock state. Thank you Joe for the recommendation. Hi Rodrigo, Can you review and comment on if and what is wrong with your commit? Thank you, ./drv > > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c > [] > > @@ -3470,14 +3470,9 @@ static void commit_planes_for_stream(struct dc *dc, > > /* Since phantom pipe programming is moved to post_unlock_program_front_end, > > * move the SubVP lock to after the phantom pipes have been setup > > */ > > - if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { > > - if (dc->hwss.subvp_pipe_control_lock) > > - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > > - } else { > > - if (dc->hwss.subvp_pipe_control_lock) > > - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > > - } > > - > > Perhaps something like: > > if (dc->hwss.subvp_pipe_control_lock) > dc->hwss.subvp_pipe_control_lock(dc, context, > should_lock_all_pipes && > dc->hwss.interdependent_update_lock, > should_lock_all_pipes, NULL, subvp_prev_use); > > > + if (dc->hwss.subvp_pipe_control_lock) > > + dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, > > + NULL, subvp_prev_use); > > return; > > } > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks 2023-01-22 18:53 ` Deepak R Varma @ 2023-03-01 20:21 ` Deepak R Varma 2023-03-02 16:37 ` Harry Wentland 0 siblings, 1 reply; 9+ messages in thread From: Deepak R Varma @ 2023-03-01 20:21 UTC (permalink / raw) To: Joe Perches, Rodrigo Siqueira, Alex Deucher, Aurabindo Pillai Cc: Harry Wentland, Leo Li, Christian König, Pan, Xinhui, David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel, Saurabh Singh Sengar, Praveen Kumar, Deepak R Varma On Mon, Jan 23, 2023 at 12:23:19AM +0530, Deepak R Varma wrote: > On Sun, Jan 15, 2023 at 12:52:10PM -0800, Joe Perches wrote: > > On Sun, 2023-01-15 at 15:30 +0530, Deepak R Varma wrote: > > > The if / else block code has same effect irrespective of the logical > > > evaluation. Hence, simply the implementation by removing the unnecessary > > > conditional evaluation. While at it, also fix the long line checkpatch > > > complaint. Issue identified using cond_no_effect.cocci Coccinelle > > > semantic patch script. > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > --- > > > Please note: The proposed change is compile tested only. If there are any > > > inbuilt test cases that I should run for further verification, I will appreciate > > > guidance about it. Thank you. > > > > Preface: I do not know the code. > > > > Perhaps Rodrigo Siqueira made a copy/paste error submitting the code for > > commit 9114b55fabae ("drm/amd/display: Fix SubVP control flow in the MPO context") > > as the code prior to this change is identical. > > > > Perhaps one of the false uses should be true or dependent on the > > interdependent_update_lock state. > > Thank you Joe for the recommendation. > > Hi Rodrigo, > Can you review and comment on if and what is wrong with your commit? Hello Rodrigo, Alex, Could you please suggest what would be the necessary fix for this typo error? Thank you, Deepak. > > Thank you, > ./drv > > > > > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c > > [] > > > @@ -3470,14 +3470,9 @@ static void commit_planes_for_stream(struct dc *dc, > > > /* Since phantom pipe programming is moved to post_unlock_program_front_end, > > > * move the SubVP lock to after the phantom pipes have been setup > > > */ > > > - if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { > > > - if (dc->hwss.subvp_pipe_control_lock) > > > - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > > > - } else { > > > - if (dc->hwss.subvp_pipe_control_lock) > > > - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > > > - } > > > - > > > > Perhaps something like: > > > > if (dc->hwss.subvp_pipe_control_lock) > > dc->hwss.subvp_pipe_control_lock(dc, context, > > should_lock_all_pipes && > > dc->hwss.interdependent_update_lock, > > should_lock_all_pipes, NULL, subvp_prev_use); > > > > > + if (dc->hwss.subvp_pipe_control_lock) > > > + dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, > > > + NULL, subvp_prev_use); > > > return; > > > } > > > > > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks 2023-03-01 20:21 ` Deepak R Varma @ 2023-03-02 16:37 ` Harry Wentland 2023-03-03 17:50 ` Deepak R Varma 2023-03-03 20:35 ` Harry Wentland 0 siblings, 2 replies; 9+ messages in thread From: Harry Wentland @ 2023-03-02 16:37 UTC (permalink / raw) To: Deepak R Varma, Joe Perches, Rodrigo Siqueira, Alex Deucher, Aurabindo Pillai Cc: Leo Li, Christian König, Pan, Xinhui, David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel, Saurabh Singh Sengar, Praveen Kumar On 3/1/23 15:21, Deepak R Varma wrote: > On Mon, Jan 23, 2023 at 12:23:19AM +0530, Deepak R Varma wrote: >> On Sun, Jan 15, 2023 at 12:52:10PM -0800, Joe Perches wrote: >>> On Sun, 2023-01-15 at 15:30 +0530, Deepak R Varma wrote: >>>> The if / else block code has same effect irrespective of the logical >>>> evaluation. Hence, simply the implementation by removing the unnecessary >>>> conditional evaluation. While at it, also fix the long line checkpatch >>>> complaint. Issue identified using cond_no_effect.cocci Coccinelle >>>> semantic patch script. >>>> >>>> Signed-off-by: Deepak R Varma <drv@mailo.com> >>>> --- >>>> Please note: The proposed change is compile tested only. If there are any >>>> inbuilt test cases that I should run for further verification, I will appreciate >>>> guidance about it. Thank you. >>> >>> Preface: I do not know the code. >>> >>> Perhaps Rodrigo Siqueira made a copy/paste error submitting the code for >>> commit 9114b55fabae ("drm/amd/display: Fix SubVP control flow in the MPO context") >>> as the code prior to this change is identical. >>> >>> Perhaps one of the false uses should be true or dependent on the >>> interdependent_update_lock state. >> >> Thank you Joe for the recommendation. >> >> Hi Rodrigo, >> Can you review and comment on if and what is wrong with your commit? > > Hello Rodrigo, Alex, > Could you please suggest what would be the necessary fix for this typo error? > It's not quite a "typo" error. When I look at this code in our internal repo I see a couple missing lock calls here that differ between the two cases. I don't know why this was never ported over and am surprised it doesn't lead to issues. I would prefer we keep the code as-is for now until this gets sorted. Harry > Thank you, > Deepak. > >> >> Thank you, >> ./drv >> >>> >>>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c >>> [] >>>> @@ -3470,14 +3470,9 @@ static void commit_planes_for_stream(struct dc *dc, >>>> /* Since phantom pipe programming is moved to post_unlock_program_front_end, >>>> * move the SubVP lock to after the phantom pipes have been setup >>>> */ >>>> - if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { >>>> - if (dc->hwss.subvp_pipe_control_lock) >>>> - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); >>>> - } else { >>>> - if (dc->hwss.subvp_pipe_control_lock) >>>> - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); >>>> - } >>>> - >>> >>> Perhaps something like: >>> >>> if (dc->hwss.subvp_pipe_control_lock) >>> dc->hwss.subvp_pipe_control_lock(dc, context, >>> should_lock_all_pipes && >>> dc->hwss.interdependent_update_lock, >>> should_lock_all_pipes, NULL, subvp_prev_use); >>> >>>> + if (dc->hwss.subvp_pipe_control_lock) >>>> + dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, >>>> + NULL, subvp_prev_use); >>>> return; >>>> } >>>> >>> >> >> > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks 2023-03-02 16:37 ` Harry Wentland @ 2023-03-03 17:50 ` Deepak R Varma 2023-03-03 20:35 ` Harry Wentland 1 sibling, 0 replies; 9+ messages in thread From: Deepak R Varma @ 2023-03-03 17:50 UTC (permalink / raw) To: Harry Wentland Cc: Joe Perches, Rodrigo Siqueira, Alex Deucher, Aurabindo Pillai, Leo Li, Christian König, Pan, Xinhui, David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel, Saurabh Singh Sengar, Praveen Kumar On Thu, Mar 02, 2023 at 11:37:30AM -0500, Harry Wentland wrote: > > > On 3/1/23 15:21, Deepak R Varma wrote: > > On Mon, Jan 23, 2023 at 12:23:19AM +0530, Deepak R Varma wrote: > >> On Sun, Jan 15, 2023 at 12:52:10PM -0800, Joe Perches wrote: > >>> On Sun, 2023-01-15 at 15:30 +0530, Deepak R Varma wrote: > >>>> The if / else block code has same effect irrespective of the logical > >>>> evaluation. Hence, simply the implementation by removing the unnecessary > >>>> conditional evaluation. While at it, also fix the long line checkpatch > >>>> complaint. Issue identified using cond_no_effect.cocci Coccinelle > >>>> semantic patch script. > >>>> > >>>> Signed-off-by: Deepak R Varma <drv@mailo.com> > >>>> --- > >>>> Please note: The proposed change is compile tested only. If there are any > >>>> inbuilt test cases that I should run for further verification, I will appreciate > >>>> guidance about it. Thank you. > >>> > >>> Preface: I do not know the code. > >>> > >>> Perhaps Rodrigo Siqueira made a copy/paste error submitting the code for > >>> commit 9114b55fabae ("drm/amd/display: Fix SubVP control flow in the MPO context") > >>> as the code prior to this change is identical. > >>> > >>> Perhaps one of the false uses should be true or dependent on the > >>> interdependent_update_lock state. > >> > >> Thank you Joe for the recommendation. > >> > >> Hi Rodrigo, > >> Can you review and comment on if and what is wrong with your commit? > > > > Hello Rodrigo, Alex, > > Could you please suggest what would be the necessary fix for this typo error? > > > > It's not quite a "typo" error. When I look at this code in our internal repo I see > a couple missing lock calls here that differ between the two cases. I don't know why > this was never ported over and am surprised it doesn't lead to issues. > > I would prefer we keep the code as-is for now until this gets sorted. Sounds good. Do let me know if I can be of any help. Deepak. > > Harry > > > Thank you, > > Deepak. > > > >> > >> Thank you, > >> ./drv > >> > >>> > >>>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c > >>> [] > >>>> @@ -3470,14 +3470,9 @@ static void commit_planes_for_stream(struct dc *dc, > >>>> /* Since phantom pipe programming is moved to post_unlock_program_front_end, > >>>> * move the SubVP lock to after the phantom pipes have been setup > >>>> */ > >>>> - if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { > >>>> - if (dc->hwss.subvp_pipe_control_lock) > >>>> - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > >>>> - } else { > >>>> - if (dc->hwss.subvp_pipe_control_lock) > >>>> - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > >>>> - } > >>>> - > >>> > >>> Perhaps something like: > >>> > >>> if (dc->hwss.subvp_pipe_control_lock) > >>> dc->hwss.subvp_pipe_control_lock(dc, context, > >>> should_lock_all_pipes && > >>> dc->hwss.interdependent_update_lock, > >>> should_lock_all_pipes, NULL, subvp_prev_use); > >>> > >>>> + if (dc->hwss.subvp_pipe_control_lock) > >>>> + dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, > >>>> + NULL, subvp_prev_use); > >>>> return; > >>>> } > >>>> > >>> > >> > >> > > > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks 2023-03-02 16:37 ` Harry Wentland 2023-03-03 17:50 ` Deepak R Varma @ 2023-03-03 20:35 ` Harry Wentland 2023-03-04 23:48 ` Joe Perches 1 sibling, 1 reply; 9+ messages in thread From: Harry Wentland @ 2023-03-03 20:35 UTC (permalink / raw) To: Deepak R Varma, Joe Perches, Rodrigo Siqueira, Alex Deucher, Aurabindo Pillai Cc: Leo Li, Christian König, Pan, Xinhui, David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel, Saurabh Singh Sengar, Praveen Kumar On 3/2/23 11:37, Harry Wentland wrote: > > > On 3/1/23 15:21, Deepak R Varma wrote: >> On Mon, Jan 23, 2023 at 12:23:19AM +0530, Deepak R Varma wrote: >>> On Sun, Jan 15, 2023 at 12:52:10PM -0800, Joe Perches wrote: >>>> On Sun, 2023-01-15 at 15:30 +0530, Deepak R Varma wrote: >>>>> The if / else block code has same effect irrespective of the logical >>>>> evaluation. Hence, simply the implementation by removing the unnecessary >>>>> conditional evaluation. While at it, also fix the long line checkpatch >>>>> complaint. Issue identified using cond_no_effect.cocci Coccinelle >>>>> semantic patch script. >>>>> >>>>> Signed-off-by: Deepak R Varma <drv@mailo.com> >>>>> --- >>>>> Please note: The proposed change is compile tested only. If there are any >>>>> inbuilt test cases that I should run for further verification, I will appreciate >>>>> guidance about it. Thank you. >>>> >>>> Preface: I do not know the code. >>>> >>>> Perhaps Rodrigo Siqueira made a copy/paste error submitting the code for >>>> commit 9114b55fabae ("drm/amd/display: Fix SubVP control flow in the MPO context") >>>> as the code prior to this change is identical. >>>> >>>> Perhaps one of the false uses should be true or dependent on the >>>> interdependent_update_lock state. >>> >>> Thank you Joe for the recommendation. >>> >>> Hi Rodrigo, >>> Can you review and comment on if and what is wrong with your commit? >> >> Hello Rodrigo, Alex, >> Could you please suggest what would be the necessary fix for this typo error? >> > > It's not quite a "typo" error. When I look at this code in our internal repo I see > a couple missing lock calls here that differ between the two cases. I don't know why > this was never ported over and am surprised it doesn't lead to issues. > > I would prefer we keep the code as-is for now until this gets sorted. > Actually I was wrong. Too many similar-looking snippets in this function made me look at the wrong thing. This change is fine and Reviewed-by: Harry Wentland <harry.wentland@amd.com. Harry > Harry > >> Thank you, >> Deepak. >> >>> >>> Thank you, >>> ./drv >>> >>>> >>>>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c >>>> [] >>>>> @@ -3470,14 +3470,9 @@ static void commit_planes_for_stream(struct dc *dc, >>>>> /* Since phantom pipe programming is moved to post_unlock_program_front_end, >>>>> * move the SubVP lock to after the phantom pipes have been setup >>>>> */ >>>>> - if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { >>>>> - if (dc->hwss.subvp_pipe_control_lock) >>>>> - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); >>>>> - } else { >>>>> - if (dc->hwss.subvp_pipe_control_lock) >>>>> - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); >>>>> - } >>>>> - >>>> >>>> Perhaps something like: >>>> >>>> if (dc->hwss.subvp_pipe_control_lock) >>>> dc->hwss.subvp_pipe_control_lock(dc, context, >>>> should_lock_all_pipes && >>>> dc->hwss.interdependent_update_lock, >>>> should_lock_all_pipes, NULL, subvp_prev_use); >>>> >>>>> + if (dc->hwss.subvp_pipe_control_lock) >>>>> + dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, >>>>> + NULL, subvp_prev_use); >>>>> return; >>>>> } >>>>> >>>> >>> >>> >> >> > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks 2023-03-03 20:35 ` Harry Wentland @ 2023-03-04 23:48 ` Joe Perches 0 siblings, 0 replies; 9+ messages in thread From: Joe Perches @ 2023-03-04 23:48 UTC (permalink / raw) To: Harry Wentland, Deepak R Varma, Rodrigo Siqueira, Alex Deucher, Aurabindo Pillai Cc: Leo Li, Christian König, Pan, Xinhui, David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel, Saurabh Singh Sengar, Praveen Kumar On Fri, 2023-03-03 at 15:35 -0500, Harry Wentland wrote: > Actually I was wrong. Too many similar-looking snippets in this > function made me look at the wrong thing. This change is fine and > Reviewed-by: Harry Wentland <harry.wentland@amd.com. So why was the change made in the first place? Please explain commit 9114b55fabae. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks 2023-01-15 10:00 [PATCH] drm/amd/display: Simplify same effect if/else blocks Deepak R Varma 2023-01-15 20:52 ` Joe Perches @ 2023-03-03 21:11 ` Hamza Mahfooz 1 sibling, 0 replies; 9+ messages in thread From: Hamza Mahfooz @ 2023-03-03 21:11 UTC (permalink / raw) To: Deepak R Varma, Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König, Pan, Xinhui, David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel Cc: Praveen Kumar, Saurabh Singh Sengar On 1/15/23 05:00, Deepak R Varma wrote: > The if / else block code has same effect irrespective of the logical > evaluation. Hence, simply the implementation by removing the unnecessary > conditional evaluation. While at it, also fix the long line checkpatch > complaint. Issue identified using cond_no_effect.cocci Coccinelle > semantic patch script. > > Signed-off-by: Deepak R Varma <drv@mailo.com> Applied, thanks! > --- > Please note: The proposed change is compile tested only. If there are any > inbuilt test cases that I should run for further verification, I will appreciate > guidance about it. Thank you. > > drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c > index 0cb8d1f934d1..776209e5d21f 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c > @@ -3470,14 +3470,9 @@ static void commit_planes_for_stream(struct dc *dc, > /* Since phantom pipe programming is moved to post_unlock_program_front_end, > * move the SubVP lock to after the phantom pipes have been setup > */ > - if (should_lock_all_pipes && dc->hwss.interdependent_update_lock) { > - if (dc->hwss.subvp_pipe_control_lock) > - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > - } else { > - if (dc->hwss.subvp_pipe_control_lock) > - dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, NULL, subvp_prev_use); > - } > - > + if (dc->hwss.subvp_pipe_control_lock) > + dc->hwss.subvp_pipe_control_lock(dc, context, false, should_lock_all_pipes, > + NULL, subvp_prev_use); > return; > } > -- Hamza ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-03-04 23:53 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-01-15 10:00 [PATCH] drm/amd/display: Simplify same effect if/else blocks Deepak R Varma 2023-01-15 20:52 ` Joe Perches 2023-01-22 18:53 ` Deepak R Varma 2023-03-01 20:21 ` Deepak R Varma 2023-03-02 16:37 ` Harry Wentland 2023-03-03 17:50 ` Deepak R Varma 2023-03-03 20:35 ` Harry Wentland 2023-03-04 23:48 ` Joe Perches 2023-03-03 21:11 ` Hamza Mahfooz
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).