@@ -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 );
@@ -489,6 +498,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
489
498
struct hdcp_workqueue * hdcp_work = handle ;
490
499
struct amdgpu_dm_connector * aconnector = config -> dm_stream_ctx ;
491
500
int link_index = aconnector -> dc_link -> link_index ;
501
+ unsigned int conn_index = aconnector -> base .index ;
492
502
struct mod_hdcp_display * display = & hdcp_work [link_index ].display ;
493
503
struct mod_hdcp_link * link = & hdcp_work [link_index ].link ;
494
504
struct hdcp_workqueue * hdcp_w = & hdcp_work [link_index ];
@@ -545,7 +555,10 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
545
555
guard (mutex )(& hdcp_w -> mutex );
546
556
547
557
mod_hdcp_add_display (& hdcp_w -> hdcp , link , display , & hdcp_w -> output );
548
-
558
+ drm_connector_get (& aconnector -> base );
559
+ if (hdcp_w -> aconnector [conn_index ])
560
+ drm_connector_put (& hdcp_w -> aconnector [conn_index ]-> base );
561
+ hdcp_w -> aconnector [conn_index ] = aconnector ;
549
562
process_output (hdcp_w );
550
563
}
551
564
0 commit comments