Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 278ca8d6 authored by David Francis's avatar David Francis Committed by Alex Deucher
Browse files

drm/amd/display: 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

Signed-off-by: default avatarDavid Francis <David.Francis@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent aafded88
Loading
Loading
Loading
Loading
+16 −3
Original line number Original line Diff line number Diff line
@@ -678,9 +678,22 @@ bool dce100_validate_bandwidth(
	struct dc  *dc,
	struct dc  *dc,
	struct dc_state *context)
	struct dc_state *context)
{
{
	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*/
		/* TODO implement when needed but for now hardcode max value*/
		context->bw.dce.dispclk_khz = 681000;
		context->bw.dce.dispclk_khz = 681000;
		context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER;
		context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER;
	} else {
		context->bw.dce.dispclk_khz = 0;
		context->bw.dce.yclk_khz = 0;
	}


	return true;
	return true;
}
}