@@ -202,6 +202,9 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
202
202
unsigned int conn_index = aconnector -> base .index ;
203
203
204
204
guard (mutex )(& hdcp_w -> mutex );
205
+ drm_connector_get (& aconnector -> base );
206
+ if (hdcp_w -> aconnector [conn_index ])
207
+ drm_connector_put (& hdcp_w -> aconnector [conn_index ]-> base );
205
208
hdcp_w -> aconnector [conn_index ] = aconnector ;
206
209
207
210
memset (& link_adjust , 0 , sizeof (link_adjust ));
@@ -249,7 +252,6 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
249
252
unsigned int conn_index = aconnector -> base .index ;
250
253
251
254
guard (mutex )(& hdcp_w -> mutex );
252
- hdcp_w -> aconnector [conn_index ] = aconnector ;
253
255
254
256
/* the removal of display will invoke auth reset -> hdcp destroy and
255
257
* we'd expect the Content Protection (CP) property changed back to
@@ -265,7 +267,10 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
265
267
}
266
268
267
269
mod_hdcp_remove_display (& hdcp_w -> hdcp , aconnector -> base .index , & hdcp_w -> output );
268
-
270
+ if (hdcp_w -> aconnector [conn_index ]) {
271
+ drm_connector_put (& hdcp_w -> aconnector [conn_index ]-> base );
272
+ hdcp_w -> aconnector [conn_index ] = NULL ;
273
+ }
269
274
process_output (hdcp_w );
270
275
}
271
276
@@ -283,6 +288,10 @@ void hdcp_reset_display(struct hdcp_workqueue *hdcp_work, unsigned int link_inde
283
288
for (conn_index = 0 ; conn_index < AMDGPU_DM_MAX_DISPLAY_INDEX ; conn_index ++ ) {
284
289
hdcp_w -> encryption_status [conn_index ] =
285
290
MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF ;
291
+ if (hdcp_w -> aconnector [conn_index ]) {
292
+ drm_connector_put (& hdcp_w -> aconnector [conn_index ]-> base );
293
+ hdcp_w -> aconnector [conn_index ] = NULL ;
294
+ }
286
295
}
287
296
288
297
process_output (hdcp_w );
@@ -517,6 +526,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
517
526
struct hdcp_workqueue * hdcp_work = handle ;
518
527
struct amdgpu_dm_connector * aconnector = config -> dm_stream_ctx ;
519
528
int link_index = aconnector -> dc_link -> link_index ;
529
+ unsigned int conn_index = aconnector -> base .index ;
520
530
struct mod_hdcp_display * display = & hdcp_work [link_index ].display ;
521
531
struct mod_hdcp_link * link = & hdcp_work [link_index ].link ;
522
532
struct hdcp_workqueue * hdcp_w = & hdcp_work [link_index ];
@@ -573,7 +583,10 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
573
583
guard (mutex )(& hdcp_w -> mutex );
574
584
575
585
mod_hdcp_add_display (& hdcp_w -> hdcp , link , display , & hdcp_w -> output );
576
-
586
+ drm_connector_get (& aconnector -> base );
587
+ if (hdcp_w -> aconnector [conn_index ])
588
+ drm_connector_put (& hdcp_w -> aconnector [conn_index ]-> base );
589
+ hdcp_w -> aconnector [conn_index ] = aconnector ;
577
590
process_output (hdcp_w );
578
591
}
579
592
0 commit comments