Skip to content

Commit 29e82a2

Browse files
Ovidiu Buneaalexdeucher
authored andcommitted
drm/amd/display: Add GPINT retries to ips_query_residency_info
[why & how] GPINTs can timeout without returning any data. Since this path is only for testing purposes, it should retry several times to ensure data is collected. Reviewed-by: Nicholas Kazlauskas <[email protected]> Signed-off-by: Ovidiu Bunea <[email protected]> Signed-off-by: Tom Chung <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 6d8f738 commit 29e82a2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#define CTX dc_dmub_srv->ctx
4141
#define DC_LOGGER CTX->logger
42+
#define GPINT_RETRY_NUM 20
4243

4344
static void dc_dmub_srv_construct(struct dc_dmub_srv *dc_srv, struct dc *dc,
4445
struct dmub_srv *dmub)
@@ -1888,11 +1889,14 @@ void dc_dmub_srv_ips_query_residency_info(struct dc_dmub_srv *dc_dmub_srv, struc
18881889
if (command_code == DMUB_GPINT__INVALID_COMMAND)
18891890
return;
18901891

1891-
// send gpint commands and wait for ack
1892-
if (!dc_wake_and_execute_gpint(dc_dmub_srv->ctx, DMUB_GPINT__GET_IPS_RESIDENCY_PERCENT,
1893-
(uint16_t)(output->ips_mode),
1894-
&output->residency_percent, DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY))
1895-
output->residency_percent = 0;
1892+
for (i = 0; i < GPINT_RETRY_NUM; i++) {
1893+
// false could mean GPINT timeout, in which case we should retry
1894+
if (dc_wake_and_execute_gpint(dc_dmub_srv->ctx, DMUB_GPINT__GET_IPS_RESIDENCY_PERCENT,
1895+
(uint16_t)(output->ips_mode), &output->residency_percent,
1896+
DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY))
1897+
break;
1898+
udelay(100);
1899+
}
18961900

18971901
if (!dc_wake_and_execute_gpint(dc_dmub_srv->ctx, DMUB_GPINT__GET_IPS_RESIDENCY_ENTRY_COUNTER,
18981902
(uint16_t)(output->ips_mode),

0 commit comments

Comments
 (0)