drm/amd/display: Use dc wake for get the replay state
authorRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tue, 28 May 2024 17:10:55 +0000 (11:10 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2024 20:17:12 +0000 (16:17 -0400)
Use dc_wake_and_execute_gpint with DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY to
get the replay state.

Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c

index 2873ac8f16fbbf4df0b2fbf82977385e97e6e4c0..fe431bd9baa21d88fe6ac149e35c3c89029bd159 100644 (file)
  */
 static void dmub_replay_get_state(struct dmub_replay *dmub, enum replay_state *state, uint8_t panel_inst)
 {
-       struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;
-       /* uint32_t raw_state = 0; */
        uint32_t retry_count = 0;
-       enum dmub_status status;
 
        do {
                // Send gpint command and wait for ack
-               status = dmub_srv_send_gpint_command(srv, DMUB_GPINT__GET_REPLAY_STATE, panel_inst, 30);
-
-               if (status == DMUB_STATUS_OK) {
-                       // GPINT was executed, get response
-                       dmub_srv_get_gpint_response(srv, (uint32_t *)state);
-               } else
+               if (!dc_wake_and_execute_gpint(dmub->ctx, DMUB_GPINT__GET_REPLAY_STATE, panel_inst,
+                                              (uint32_t *)state, DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY)) {
                        // Return invalid state when GPINT times out
                        *state = REPLAY_STATE_INVALID;
+               }
        } while (++retry_count <= 1000 && *state == REPLAY_STATE_INVALID);
 
        // Assert if max retry hit