Skip to contentSkip to conversation

amd/dc/dce100: On dce100, set clocks to 0 on suspend

PATCH In review David Francis 3 participants 5 messages Jul 12, 2018 4 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amd/dc/dce100: On dce100, set clocks to 0 on suspend

[Why]
When a dce100 asic was suspended, the clocks were not set to 0. Upon resume, the new clock was compared to the existing clock, they were found to be the same, and so the clock was not set. This resulted in a pernicious blackscreen.

[How]
In atomic commit, check to see if there are any active pipes. If no, set clocks to 0

---
 .../amd/display/dc/dce100/dce100_resource.c   | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +16 -3
index 8ed8eace42be..ad8ad4e1437c 100644
@@ -678,9 +678,22 @@ bool dce100_validate_bandwidth(
 	struct dc  *dc,
 	struct dc_state *context)
 {
-	/* TODO implement when needed but for now hardcode max value*/
-	context->bw.dce.dispclk_khz = 681000;
-	context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER;
+	int i;
+	bool at_least_one_pipe = false;
+
+	for (i = 0; i < dc->res_pool->pipe_count; i++) {
+		if (context->res_ctx.pipe_ctx[i].stream)
+			at_least_one_pipe = true;
+	}
+
+	if (at_least_one_pipe) {
+		/* TODO implement when needed but for now hardcode max value*/
+		context->bw.dce.dispclk_khz = 681000;
+		context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER;
+	} else {
+		context->bw.dce.dispclk_khz = 0;
+		context->bw.dce.yclk_khz = 0;
+	}
 
 	return true;
 }
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to a message not in the archive
Quoted 10 lines · David Francis

[Why]
When a dce100 asic was suspended, the clocks were not set to 0. Upon resume, the new clock was compared to the existing clock, they were found to be the same, and so the clock was not set. This resulted in a pernicious blackscreen.

[How]
In atomic commit, check to see if there are any active pipes. If no, set clocks to 0

Please add Fixes: tag with link to freedesktop bugzilla bug that this fixes.

I believe the issue is older than 4.18. Can you confirm? If so, please add

Harry

Quoted 26 lines
---
 .../amd/display/dc/dce100/dce100_resource.c   | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +9 -3
index 8ed8eace42be..ad8ad4e1437c 100644
@@ -678,9 +678,22 @@ bool dce100_validate_bandwidth(
 	struct dc  *dc,
 	struct dc_state *context)
 {
-	/* TODO implement when needed but for now hardcode max value*/
-	context->bw.dce.dispclk_khz = 681000;
-	context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER;
+	int i;
+	bool at_least_one_pipe = false;
+
+	for (i = 0; i < dc->res_pool->pipe_count; i++) {
+		if (context->res_ctx.pipe_ctx[i].stream)
+			at_least_one_pipe = true;
+	}
+
+	if (at_least_one_pipe) {

drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c bool dce100_validate_bandwidth( · line 699

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +7 -0
+		/* TODO implement when needed but for now hardcode max value*/
+		context->bw.dce.dispclk_khz = 681000;
+		context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER;
+	} else {
+		context->bw.dce.dispclk_khz = 0;
+		context->bw.dce.yclk_khz = 0;
+	}
 
 	return true;
 }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw
In reply to a message not in the archive
Quoted 7 lines · Harry Wentland
Quoted 6 lines · David Francis

[Why]
When a dce100 asic was suspended, the clocks were not set to 0. Upon resume, the new clock was compared to the existing clock, they were found to be the same, and so the clock was not set. This resulted in a pernicious blackscreen.

Quoted 6 lines
Quoted 4 lines

[How]
In atomic commit, check to see if there are any active pipes. If no, set clocks to 0

Please add Fixes: tag with link to freedesktop bugzilla bug that this fixes.

That would be

Bugzilla: https://...

(the Fixes tag is for referencing another commit which is fixed by this one)

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw
In reply to a message not in the archive

Upon closer inspection, this does not match any FDO bug. The FDO bug I thought this was related to was fixed by Michel Danzer, and this fixes an entirely separate issue.

________________________________
From: Michel Dänzer <[email protected]>
Sent: July 12, 2018 10:18:34 AM
To: Wentland, Harry; Francis, David; [email protected]
Subject: Re: [PATCH] amd/dc/dce100: On dce100, set clocks to 0 on suspend

Quoted 7 lines · Harry Wentland
Quoted 6 lines · David Francis

[Why]
When a dce100 asic was suspended, the clocks were not set to 0. Upon resume, the new clock was compared to the existing clock, they were found to be the same, and so the clock was not set. This resulted in a pernicious blackscreen.

Quoted 6 lines
Quoted 4 lines

[How]
In atomic commit, check to see if there are any active pipes. If no, set clocks to 0

Please add Fixes: tag with link to freedesktop bugzilla bug that this fixes.

That would be

Bugzilla: https://...

(the Fixes tag is for referencing another commit which is fixed by this one)

--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#8 lore raw
In reply to a message not in the archive
Quoted 2 lines · David

Upon closer inspection, this does not match any FDO bug.  The FDO bug I thought this was related to was fixed by Michel Danzer, and this fixes an entirely separate issue.

If I remember right we have a regression change for this. We should add that with the Fixes tag like so

Fixes 308425ff39dc ("drm/amd/display: redesign dce/dcn clock voltage update request")

Looks like it's not in any kernel tag yet, so no need to add stable like I previously thought.

Harry

Quoted 19 lines

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*From:* Michel Dänzer <[email protected]>
*Sent:* July 12, 2018 10:18:34 AM
*To:* Wentland, Harry; Francis, David; [email protected] *Subject:* Re: [PATCH] amd/dc/dce100: On dce100, set clocks to 0 on suspend

Quoted 12 lines · Harry Wentland
Quoted 10 lines · David Francis

[Why]
When a dce100 asic was suspended, the clocks were not set to 0. Upon resume, the new clock was compared to the existing clock, they were found to be the same, and so the clock was not set. This resulted in a pernicious blackscreen.

[How]
In atomic commit, check to see if there are any active pipes. If no, set clocks to 0

Quoted 12 lines
Quoted 1 line

Please add Fixes: tag with link to freedesktop bugzilla bug that this fixes.

That would be

Bugzilla: https://...

(the Fixes tag is for referencing another commit which is fixed by this one)

Signature · 2 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx