Skip to content

Commit f30a3be

Browse files
Nicholas Kazlauskasalexdeucher
Nicholas Kazlauskas
authored andcommitted
drm/amd/display: Exit idle optimizations before HDCP execution
[WHY] PSP can access DCN registers during command submission and we need to ensure that DCN is not in PG before doing so. [HOW] Add a callback to DM to lock and notify DC for idle optimization exit. It can't be DC directly because of a potential race condition with the link protection thread and the rest of DM operation. Cc: Mario Limonciello <[email protected]> Cc: Alex Deucher <[email protected]> Reviewed-by: Charlene Liu <[email protected]> Acked-by: Alex Hung <[email protected]> Signed-off-by: Nicholas Kazlauskas <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent bc55c34 commit f30a3be

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c

+10
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ static uint8_t is_cp_desired_hdcp2(struct mod_hdcp *hdcp)
8888
!hdcp->connection.is_hdcp2_revoked;
8989
}
9090

91+
static void exit_idle_optimizations(struct mod_hdcp *hdcp)
92+
{
93+
struct mod_hdcp_dm *dm = &hdcp->config.dm;
94+
95+
if (dm->funcs.exit_idle_optimizations)
96+
dm->funcs.exit_idle_optimizations(dm->handle);
97+
}
98+
9199
static enum mod_hdcp_status execution(struct mod_hdcp *hdcp,
92100
struct mod_hdcp_event_context *event_ctx,
93101
union mod_hdcp_transition_input *input)
@@ -543,6 +551,8 @@ enum mod_hdcp_status mod_hdcp_process_event(struct mod_hdcp *hdcp,
543551
memset(&event_ctx, 0, sizeof(struct mod_hdcp_event_context));
544552
event_ctx.event = event;
545553

554+
exit_idle_optimizations(hdcp);
555+
546556
/* execute and transition */
547557
exec_status = execution(hdcp, &event_ctx, &hdcp->auth.trans_input);
548558
trans_status = transition(

drivers/gpu/drm/amd/display/modules/inc/mod_hdcp.h

+8
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ struct mod_hdcp_ddc {
156156
} funcs;
157157
};
158158

159+
struct mod_hdcp_dm {
160+
void *handle;
161+
struct {
162+
void (*exit_idle_optimizations)(void *handle);
163+
} funcs;
164+
};
165+
159166
struct mod_hdcp_psp {
160167
void *handle;
161168
void *funcs;
@@ -272,6 +279,7 @@ struct mod_hdcp_display_query {
272279
struct mod_hdcp_config {
273280
struct mod_hdcp_psp psp;
274281
struct mod_hdcp_ddc ddc;
282+
struct mod_hdcp_dm dm;
275283
uint8_t index;
276284
};
277285

0 commit comments

Comments
 (0)