@@ -173,6 +173,9 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
173
173
unsigned int conn_index = aconnector -> base .index ;
174
174
175
175
guard (mutex )(& hdcp_w -> mutex );
176
+ drm_connector_get (& aconnector -> base );
177
+ if (hdcp_w -> aconnector [conn_index ])
178
+ drm_connector_put (& hdcp_w -> aconnector [conn_index ]-> base );
176
179
hdcp_w -> aconnector [conn_index ] = aconnector ;
177
180
178
181
memset (& link_adjust , 0 , sizeof (link_adjust ));
@@ -220,7 +223,6 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
220
223
unsigned int conn_index = aconnector -> base .index ;
221
224
222
225
guard (mutex )(& hdcp_w -> mutex );
223
- hdcp_w -> aconnector [conn_index ] = aconnector ;
224
226
225
227
/* the removal of display will invoke auth reset -> hdcp destroy and
226
228
* we'd expect the Content Protection (CP) property changed back to
@@ -236,7 +238,10 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
236
238
}
237
239
238
240
mod_hdcp_remove_display (& hdcp_w -> hdcp , aconnector -> base .index , & hdcp_w -> output );
239
-
241
+ if (hdcp_w -> aconnector [conn_index ]) {
242
+ drm_connector_put (& hdcp_w -> aconnector [conn_index ]-> base );
243
+ hdcp_w -> aconnector [conn_index ] = NULL ;
244
+ }
240
245
process_output (hdcp_w );
241
246
}
242
247
@@ -254,6 +259,10 @@ void hdcp_reset_display(struct hdcp_workqueue *hdcp_work, unsigned int link_inde
254
259
for (conn_index = 0 ; conn_index < AMDGPU_DM_MAX_DISPLAY_INDEX ; conn_index ++ ) {
255
260
hdcp_w -> encryption_status [conn_index ] =
256
261
MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF ;
262
+ if (hdcp_w -> aconnector [conn_index ]) {
263
+ drm_connector_put (& hdcp_w -> aconnector [conn_index ]-> base );
264
+ hdcp_w -> aconnector [conn_index ] = NULL ;
265
+ }
257
266
}
258
267
259
268
process_output (hdcp_w );
@@ -488,6 +497,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
488
497
struct hdcp_workqueue * hdcp_work = handle ;
489
498
struct amdgpu_dm_connector * aconnector = config -> dm_stream_ctx ;
490
499
int link_index = aconnector -> dc_link -> link_index ;
500
+ unsigned int conn_index = aconnector -> base .index ;
491
501
struct mod_hdcp_display * display = & hdcp_work [link_index ].display ;
492
502
struct mod_hdcp_link * link = & hdcp_work [link_index ].link ;
493
503
struct hdcp_workqueue * hdcp_w = & hdcp_work [link_index ];
@@ -544,7 +554,10 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
544
554
guard (mutex )(& hdcp_w -> mutex );
545
555
546
556
mod_hdcp_add_display (& hdcp_w -> hdcp , link , display , & hdcp_w -> output );
547
-
557
+ drm_connector_get (& aconnector -> base );
558
+ if (hdcp_w -> aconnector [conn_index ])
559
+ drm_connector_put (& hdcp_w -> aconnector [conn_index ]-> base );
560
+ hdcp_w -> aconnector [conn_index ] = aconnector ;
548
561
process_output (hdcp_w );
549
562
}
550
563
0 commit comments