Skip to content

Commit

Permalink
drm/amd/display: Return invalid state if GPINT times out
Browse files Browse the repository at this point in the history
[Why]
GPINT timeout is causing PSR_STATE_0 to be returned when it shouldn't.
We must guarantee that PSR is fully disabled before doing hw programming
on driver-side.

[How]
Return invalid state if GPINT command times out. Let existing retry
logic send the GPINT until successful.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Wyatt Wood <wyatt.wood@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Wyatt Wood authored and Alex Deucher committed Mar 2, 2021
1 parent 45a1261 commit 8039bc7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,18 @@ static void dmub_psr_get_state(struct dmub_psr *dmub, enum dc_psr_state *state)
{
struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;
uint32_t raw_state;
enum dmub_status status = DMUB_STATUS_INVALID;

// Send gpint command and wait for ack
dmub_srv_send_gpint_command(srv, DMUB_GPINT__GET_PSR_STATE, 0, 30);

dmub_srv_get_gpint_response(srv, &raw_state);

*state = convert_psr_state(raw_state);
status = dmub_srv_send_gpint_command(srv, DMUB_GPINT__GET_PSR_STATE, 0, 30);

if (status == DMUB_STATUS_OK) {
// GPINT was executed, get response
dmub_srv_get_gpint_response(srv, &raw_state);
*state = convert_psr_state(raw_state);
} else
// Return invalid state when GPINT times out
*state = 0xFF;
}

/*
Expand Down

0 comments on commit 8039bc7

Please sign in to comment.