Skip to contentSkip to conversation

drm/display: guard if clause

PATCH In review Asher Song 3 participants 3 messages Sep 1, 2022

Subsystems (3)
lore
Share & tools
lore

Asher Song

author
#0 lore raw

PATCH 1/1 drm/display: guard if clause

To eliminate the following compiling error, guard if clause.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'commit_planes_for_stream':
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3521:2: error: this 'if' clause does not guard... [-Werror=misleading-indentation] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3523:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' if (update_type != UPDATE_TYPE_FAST)
^~

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
index b49237390cce..66072ac1bb4f 100644
@@ -3505,11 +3505,12 @@ static void commit_planes_for_stream(struct dc *dc,
 					top_pipe_to_program->stream_res.tg);
 		}
 
-	if (update_type != UPDATE_TYPE_FAST)
+	if (update_type != UPDATE_TYPE_FAST){
 		dc->hwss.post_unlock_program_front_end(dc, context);
 		if (update_type != UPDATE_TYPE_FAST)
 			if (dc->hwss.commit_subvp_config)
 				dc->hwss.commit_subvp_config(dc, context);
+	}
 
 	/* Since phantom pipe programming is moved to post_unlock_program_front_end,
 	 * move the SubVP lock to after the phantom pipes have been setup
Signature · 1 line
2.25.1
maintainer
#1 lore raw

Well please adjust the subject line, that should read something like "drm/amd/display:..." or "drm/amdgpu:...".

Am 01.09.22 um 11:11 schrieb Asher Song:

Quoted 18 lines

To eliminate the following compiling error, guard if clause.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'commit_planes_for_stream':
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3521:2: error: this 'if' clause does not guard... [-Werror=misleading-indentation] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3523:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' if (update_type != UPDATE_TYPE_FAST)
^~

---
  drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
index b49237390cce..66072ac1bb4f 100644

drivers/gpu/drm/amd/display/dc/core/dc.c static void commit_planes_for_stream(struct dc *dc, · line 3513

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
@@ -3505,11 +3505,12 @@ static void commit_planes_for_stream(struct dc *dc,
  					top_pipe_to_program->stream_res.tg);
  		}
 
-	if (update_type != UPDATE_TYPE_FAST)
+	if (update_type != UPDATE_TYPE_FAST){
  		dc->hwss.post_unlock_program_front_end(dc, context);
  		if (update_type != UPDATE_TYPE_FAST)
  			if (dc->hwss.commit_subvp_config)
  				dc->hwss.commit_subvp_config(dc, context);
+	}

That looks like a step into the right directly, but please re-read the code:

if (update_type != UPDATE_TYPE_FAST) {
....
    if (update_type != UPDATE_TYPE_FAST)
    ....
}

That's certainly still not correct.

Regards,
Christian.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
  	/* Since phantom pipe programming is moved to post_unlock_program_front_end,
  	 * move the SubVP lock to after the phantom pipes have been setup
#2 lore raw

Yes, exactly. The logic in two successive if checks of "(update_type != UPDATE_TYPE_FAST) " is incorrect still.

Possibly we can update code by dropping one if check as below. Anyway, this needs confirm from display team @Lee, Alvin @Lei, Jun.

if (update_type != UPDATE_TYPE_FAST) {

   	dc->hwss.post_unlock_program_front_end(dc, context);
	if (dc->hwss.commit_subvp_config)
		dc->hwss.commit_subvp_config(dc, context);
}

Regards,
Guchun

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Thursday, September 1, 2022 7:07 PM
To: Song, Asher <[email protected]>; [email protected]; Lee, Alvin <[email protected]>; Lei, Jun <[email protected]>; Chen, Guchun <[email protected]>
Subject: Re: [PATCH] drm/display: guard if clause

Well please adjust the subject line, that should read something like "drm/amd/display:..." or "drm/amdgpu:...".

Am 01.09.22 um 11:11 schrieb Asher Song:

Quoted 20 lines

To eliminate the following compiling error, guard if clause.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'commit_planes_for_stream':
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3521:2: error: this
'if' clause does not guard... [-Werror=misleading-indentation]
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3523:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' if (update_type != UPDATE_TYPE_FAST)
^~

---
  drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
index b49237390cce..66072ac1bb4f 100644

drivers/gpu/drm/amd/display/dc/core/dc.c static void commit_planes_for_stream(struct dc *dc, · line 3513

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
@@ -3505,11 +3505,12 @@ static void commit_planes_for_stream(struct dc *dc,
  					top_pipe_to_program->stream_res.tg);
  		}
 
-	if (update_type != UPDATE_TYPE_FAST)
+	if (update_type != UPDATE_TYPE_FAST){
  		dc->hwss.post_unlock_program_front_end(dc, context);
  		if (update_type != UPDATE_TYPE_FAST)
  			if (dc->hwss.commit_subvp_config)
  				dc->hwss.commit_subvp_config(dc, context);
+	}

That looks like a step into the right directly, but please re-read the code:

if (update_type != UPDATE_TYPE_FAST) {
....
    if (update_type != UPDATE_TYPE_FAST)
    ....
}

That's certainly still not correct.

Regards,
Christian.

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
  	/* Since phantom pipe programming is moved to post_unlock_program_front_end,
  	 * move the SubVP lock to after the phantom pipes have been setup