1 /* SPDX-License-Identifier: MIT */
3 * Copyright (C) 2020 Google, Inc.
6 * Sean Paul <seanpaul@chromium.org>
9 #include <drm/drm_dp_helper.h>
10 #include <drm/drm_dp_mst_helper.h>
11 #include <drm/drm_hdcp.h>
12 #include <drm/drm_print.h>
14 #include "intel_display_types.h"
15 #include "intel_ddi.h"
17 #include "intel_hdcp.h"
19 static void intel_dp_hdcp_wait_for_cp_irq(struct intel_hdcp
*hdcp
, int timeout
)
23 #define C (hdcp->cp_irq_count_cached != atomic_read(&hdcp->cp_irq_count))
24 ret
= wait_event_interruptible_timeout(hdcp
->cp_irq_queue
, C
,
25 msecs_to_jiffies(timeout
));
28 DRM_DEBUG_KMS("Timedout at waiting for CP_IRQ\n");
32 int intel_dp_hdcp_write_an_aksv(struct intel_digital_port
*dig_port
,
35 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
36 u8 aksv
[DRM_HDCP_KSV_LEN
] = {};
39 /* Output An first, that's easy */
40 dpcd_ret
= drm_dp_dpcd_write(&dig_port
->dp
.aux
, DP_AUX_HDCP_AN
,
42 if (dpcd_ret
!= DRM_HDCP_AN_LEN
) {
43 drm_dbg_kms(&i915
->drm
,
44 "Failed to write An over DP/AUX (%zd)\n",
46 return dpcd_ret
>= 0 ? -EIO
: dpcd_ret
;
50 * Since Aksv is Oh-So-Secret, we can't access it in software. So we
51 * send an empty buffer of the correct length through the DP helpers. On
52 * the other side, in the transfer hook, we'll generate a flag based on
53 * the destination address which will tickle the hardware to output the
54 * Aksv on our behalf after the header is sent.
56 dpcd_ret
= drm_dp_dpcd_write(&dig_port
->dp
.aux
, DP_AUX_HDCP_AKSV
,
57 aksv
, DRM_HDCP_KSV_LEN
);
58 if (dpcd_ret
!= DRM_HDCP_KSV_LEN
) {
59 drm_dbg_kms(&i915
->drm
,
60 "Failed to write Aksv over DP/AUX (%zd)\n",
62 return dpcd_ret
>= 0 ? -EIO
: dpcd_ret
;
67 static int intel_dp_hdcp_read_bksv(struct intel_digital_port
*dig_port
,
70 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
73 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
, DP_AUX_HDCP_BKSV
, bksv
,
75 if (ret
!= DRM_HDCP_KSV_LEN
) {
76 drm_dbg_kms(&i915
->drm
,
77 "Read Bksv from DP/AUX failed (%zd)\n", ret
);
78 return ret
>= 0 ? -EIO
: ret
;
83 static int intel_dp_hdcp_read_bstatus(struct intel_digital_port
*dig_port
,
86 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
90 * For some reason the HDMI and DP HDCP specs call this register
91 * definition by different names. In the HDMI spec, it's called BSTATUS,
92 * but in DP it's called BINFO.
94 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
, DP_AUX_HDCP_BINFO
,
95 bstatus
, DRM_HDCP_BSTATUS_LEN
);
96 if (ret
!= DRM_HDCP_BSTATUS_LEN
) {
97 drm_dbg_kms(&i915
->drm
,
98 "Read bstatus from DP/AUX failed (%zd)\n", ret
);
99 return ret
>= 0 ? -EIO
: ret
;
105 int intel_dp_hdcp_read_bcaps(struct intel_digital_port
*dig_port
,
108 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
111 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
, DP_AUX_HDCP_BCAPS
,
114 drm_dbg_kms(&i915
->drm
,
115 "Read bcaps from DP/AUX failed (%zd)\n", ret
);
116 return ret
>= 0 ? -EIO
: ret
;
123 int intel_dp_hdcp_repeater_present(struct intel_digital_port
*dig_port
,
124 bool *repeater_present
)
129 ret
= intel_dp_hdcp_read_bcaps(dig_port
, &bcaps
);
133 *repeater_present
= bcaps
& DP_BCAPS_REPEATER_PRESENT
;
138 int intel_dp_hdcp_read_ri_prime(struct intel_digital_port
*dig_port
,
141 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
144 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
, DP_AUX_HDCP_RI_PRIME
,
145 ri_prime
, DRM_HDCP_RI_LEN
);
146 if (ret
!= DRM_HDCP_RI_LEN
) {
147 drm_dbg_kms(&i915
->drm
, "Read Ri' from DP/AUX failed (%zd)\n",
149 return ret
>= 0 ? -EIO
: ret
;
155 int intel_dp_hdcp_read_ksv_ready(struct intel_digital_port
*dig_port
,
158 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
162 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
, DP_AUX_HDCP_BSTATUS
,
165 drm_dbg_kms(&i915
->drm
,
166 "Read bstatus from DP/AUX failed (%zd)\n", ret
);
167 return ret
>= 0 ? -EIO
: ret
;
169 *ksv_ready
= bstatus
& DP_BSTATUS_READY
;
174 int intel_dp_hdcp_read_ksv_fifo(struct intel_digital_port
*dig_port
,
175 int num_downstream
, u8
*ksv_fifo
)
177 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
181 /* KSV list is read via 15 byte window (3 entries @ 5 bytes each) */
182 for (i
= 0; i
< num_downstream
; i
+= 3) {
183 size_t len
= min(num_downstream
- i
, 3) * DRM_HDCP_KSV_LEN
;
184 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
,
185 DP_AUX_HDCP_KSV_FIFO
,
186 ksv_fifo
+ i
* DRM_HDCP_KSV_LEN
,
189 drm_dbg_kms(&i915
->drm
,
190 "Read ksv[%d] from DP/AUX failed (%zd)\n",
192 return ret
>= 0 ? -EIO
: ret
;
199 int intel_dp_hdcp_read_v_prime_part(struct intel_digital_port
*dig_port
,
202 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
205 if (i
>= DRM_HDCP_V_PRIME_NUM_PARTS
)
208 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
,
209 DP_AUX_HDCP_V_PRIME(i
), part
,
210 DRM_HDCP_V_PRIME_PART_LEN
);
211 if (ret
!= DRM_HDCP_V_PRIME_PART_LEN
) {
212 drm_dbg_kms(&i915
->drm
,
213 "Read v'[%d] from DP/AUX failed (%zd)\n", i
, ret
);
214 return ret
>= 0 ? -EIO
: ret
;
220 int intel_dp_hdcp_toggle_signalling(struct intel_digital_port
*dig_port
,
221 enum transcoder cpu_transcoder
,
224 /* Not used for single stream DisplayPort setups */
229 bool intel_dp_hdcp_check_link(struct intel_digital_port
*dig_port
,
230 struct intel_connector
*connector
)
232 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
236 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
, DP_AUX_HDCP_BSTATUS
,
239 drm_dbg_kms(&i915
->drm
,
240 "Read bstatus from DP/AUX failed (%zd)\n", ret
);
244 return !(bstatus
& (DP_BSTATUS_LINK_FAILURE
| DP_BSTATUS_REAUTH_REQ
));
248 int intel_dp_hdcp_capable(struct intel_digital_port
*dig_port
,
254 ret
= intel_dp_hdcp_read_bcaps(dig_port
, &bcaps
);
258 *hdcp_capable
= bcaps
& DP_BCAPS_HDCP_CAPABLE
;
262 struct hdcp2_dp_errata_stream_type
{
267 struct hdcp2_dp_msg_data
{
272 u32 timeout2
; /* Added for non_paired situation */
275 static const struct hdcp2_dp_msg_data hdcp2_dp_msg_data
[] = {
276 { HDCP_2_2_AKE_INIT
, DP_HDCP_2_2_AKE_INIT_OFFSET
, false, 0, 0 },
277 { HDCP_2_2_AKE_SEND_CERT
, DP_HDCP_2_2_AKE_SEND_CERT_OFFSET
,
278 false, HDCP_2_2_CERT_TIMEOUT_MS
, 0 },
279 { HDCP_2_2_AKE_NO_STORED_KM
, DP_HDCP_2_2_AKE_NO_STORED_KM_OFFSET
,
281 { HDCP_2_2_AKE_STORED_KM
, DP_HDCP_2_2_AKE_STORED_KM_OFFSET
,
283 { HDCP_2_2_AKE_SEND_HPRIME
, DP_HDCP_2_2_AKE_SEND_HPRIME_OFFSET
,
284 true, HDCP_2_2_HPRIME_PAIRED_TIMEOUT_MS
,
285 HDCP_2_2_HPRIME_NO_PAIRED_TIMEOUT_MS
},
286 { HDCP_2_2_AKE_SEND_PAIRING_INFO
,
287 DP_HDCP_2_2_AKE_SEND_PAIRING_INFO_OFFSET
, true,
288 HDCP_2_2_PAIRING_TIMEOUT_MS
, 0 },
289 { HDCP_2_2_LC_INIT
, DP_HDCP_2_2_LC_INIT_OFFSET
, false, 0, 0 },
290 { HDCP_2_2_LC_SEND_LPRIME
, DP_HDCP_2_2_LC_SEND_LPRIME_OFFSET
,
291 false, HDCP_2_2_DP_LPRIME_TIMEOUT_MS
, 0 },
292 { HDCP_2_2_SKE_SEND_EKS
, DP_HDCP_2_2_SKE_SEND_EKS_OFFSET
, false,
294 { HDCP_2_2_REP_SEND_RECVID_LIST
,
295 DP_HDCP_2_2_REP_SEND_RECVID_LIST_OFFSET
, true,
296 HDCP_2_2_RECVID_LIST_TIMEOUT_MS
, 0 },
297 { HDCP_2_2_REP_SEND_ACK
, DP_HDCP_2_2_REP_SEND_ACK_OFFSET
, false,
299 { HDCP_2_2_REP_STREAM_MANAGE
,
300 DP_HDCP_2_2_REP_STREAM_MANAGE_OFFSET
, false,
302 { HDCP_2_2_REP_STREAM_READY
, DP_HDCP_2_2_REP_STREAM_READY_OFFSET
,
303 false, HDCP_2_2_STREAM_READY_TIMEOUT_MS
, 0 },
304 /* local define to shovel this through the write_2_2 interface */
305 #define HDCP_2_2_ERRATA_DP_STREAM_TYPE 50
306 { HDCP_2_2_ERRATA_DP_STREAM_TYPE
,
307 DP_HDCP_2_2_REG_STREAM_TYPE_OFFSET
, false,
312 intel_dp_hdcp2_read_rx_status(struct intel_digital_port
*dig_port
,
315 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
318 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
,
319 DP_HDCP_2_2_REG_RXSTATUS_OFFSET
, rx_status
,
320 HDCP_2_2_DP_RXSTATUS_LEN
);
321 if (ret
!= HDCP_2_2_DP_RXSTATUS_LEN
) {
322 drm_dbg_kms(&i915
->drm
,
323 "Read bstatus from DP/AUX failed (%zd)\n", ret
);
324 return ret
>= 0 ? -EIO
: ret
;
331 int hdcp2_detect_msg_availability(struct intel_digital_port
*dig_port
,
332 u8 msg_id
, bool *msg_ready
)
338 ret
= intel_dp_hdcp2_read_rx_status(dig_port
, &rx_status
);
343 case HDCP_2_2_AKE_SEND_HPRIME
:
344 if (HDCP_2_2_DP_RXSTATUS_H_PRIME(rx_status
))
347 case HDCP_2_2_AKE_SEND_PAIRING_INFO
:
348 if (HDCP_2_2_DP_RXSTATUS_PAIRING(rx_status
))
351 case HDCP_2_2_REP_SEND_RECVID_LIST
:
352 if (HDCP_2_2_DP_RXSTATUS_READY(rx_status
))
356 DRM_ERROR("Unidentified msg_id: %d\n", msg_id
);
364 intel_dp_hdcp2_wait_for_msg(struct intel_digital_port
*dig_port
,
365 const struct hdcp2_dp_msg_data
*hdcp2_msg_data
)
367 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
368 struct intel_dp
*dp
= &dig_port
->dp
;
369 struct intel_hdcp
*hdcp
= &dp
->attached_connector
->hdcp
;
370 u8 msg_id
= hdcp2_msg_data
->msg_id
;
372 bool msg_ready
= false;
374 if (msg_id
== HDCP_2_2_AKE_SEND_HPRIME
&& !hdcp
->is_paired
)
375 timeout
= hdcp2_msg_data
->timeout2
;
377 timeout
= hdcp2_msg_data
->timeout
;
380 * There is no way to detect the CERT, LPRIME and STREAM_READY
381 * availability. So Wait for timeout and read the msg.
383 if (!hdcp2_msg_data
->msg_detectable
) {
388 * As we want to check the msg availability at timeout, Ignoring
389 * the timeout at wait for CP_IRQ.
391 intel_dp_hdcp_wait_for_cp_irq(hdcp
, timeout
);
392 ret
= hdcp2_detect_msg_availability(dig_port
,
399 drm_dbg_kms(&i915
->drm
,
400 "msg_id %d, ret %d, timeout(mSec): %d\n",
401 hdcp2_msg_data
->msg_id
, ret
, timeout
);
406 static const struct hdcp2_dp_msg_data
*get_hdcp2_dp_msg_data(u8 msg_id
)
410 for (i
= 0; i
< ARRAY_SIZE(hdcp2_dp_msg_data
); i
++)
411 if (hdcp2_dp_msg_data
[i
].msg_id
== msg_id
)
412 return &hdcp2_dp_msg_data
[i
];
418 int intel_dp_hdcp2_write_msg(struct intel_digital_port
*dig_port
,
419 void *buf
, size_t size
)
421 struct intel_dp
*dp
= &dig_port
->dp
;
422 struct intel_hdcp
*hdcp
= &dp
->attached_connector
->hdcp
;
425 ssize_t ret
, bytes_to_write
, len
;
426 const struct hdcp2_dp_msg_data
*hdcp2_msg_data
;
428 hdcp2_msg_data
= get_hdcp2_dp_msg_data(*byte
);
432 offset
= hdcp2_msg_data
->offset
;
434 /* No msg_id in DP HDCP2.2 msgs */
435 bytes_to_write
= size
- 1;
438 hdcp
->cp_irq_count_cached
= atomic_read(&hdcp
->cp_irq_count
);
440 while (bytes_to_write
) {
441 len
= bytes_to_write
> DP_AUX_MAX_PAYLOAD_BYTES
?
442 DP_AUX_MAX_PAYLOAD_BYTES
: bytes_to_write
;
444 ret
= drm_dp_dpcd_write(&dig_port
->dp
.aux
,
445 offset
, (void *)byte
, len
);
449 bytes_to_write
-= ret
;
458 ssize_t
get_receiver_id_list_size(struct intel_digital_port
*dig_port
)
460 u8 rx_info
[HDCP_2_2_RXINFO_LEN
];
464 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
,
465 DP_HDCP_2_2_REG_RXINFO_OFFSET
,
466 (void *)rx_info
, HDCP_2_2_RXINFO_LEN
);
467 if (ret
!= HDCP_2_2_RXINFO_LEN
)
468 return ret
>= 0 ? -EIO
: ret
;
470 dev_cnt
= (HDCP_2_2_DEV_COUNT_HI(rx_info
[0]) << 4 |
471 HDCP_2_2_DEV_COUNT_LO(rx_info
[1]));
473 if (dev_cnt
> HDCP_2_2_MAX_DEVICE_COUNT
)
474 dev_cnt
= HDCP_2_2_MAX_DEVICE_COUNT
;
476 ret
= sizeof(struct hdcp2_rep_send_receiverid_list
) -
477 HDCP_2_2_RECEIVER_IDS_MAX_LEN
+
478 (dev_cnt
* HDCP_2_2_RECEIVER_ID_LEN
);
484 int intel_dp_hdcp2_read_msg(struct intel_digital_port
*dig_port
,
485 u8 msg_id
, void *buf
, size_t size
)
487 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
490 ssize_t ret
, bytes_to_recv
, len
;
491 const struct hdcp2_dp_msg_data
*hdcp2_msg_data
;
493 hdcp2_msg_data
= get_hdcp2_dp_msg_data(msg_id
);
496 offset
= hdcp2_msg_data
->offset
;
498 ret
= intel_dp_hdcp2_wait_for_msg(dig_port
, hdcp2_msg_data
);
502 if (msg_id
== HDCP_2_2_REP_SEND_RECVID_LIST
) {
503 ret
= get_receiver_id_list_size(dig_port
);
509 bytes_to_recv
= size
- 1;
511 /* DP adaptation msgs has no msg_id */
514 while (bytes_to_recv
) {
515 len
= bytes_to_recv
> DP_AUX_MAX_PAYLOAD_BYTES
?
516 DP_AUX_MAX_PAYLOAD_BYTES
: bytes_to_recv
;
518 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
, offset
,
521 drm_dbg_kms(&i915
->drm
, "msg_id %d, ret %zd\n",
526 bytes_to_recv
-= ret
;
537 int intel_dp_hdcp2_config_stream_type(struct intel_digital_port
*dig_port
,
538 bool is_repeater
, u8 content_type
)
541 struct hdcp2_dp_errata_stream_type stream_type_msg
;
547 * Errata for DP: As Stream type is used for encryption, Receiver
548 * should be communicated with stream type for the decryption of the
550 * Repeater will be communicated with stream type as a part of it's
551 * auth later in time.
553 stream_type_msg
.msg_id
= HDCP_2_2_ERRATA_DP_STREAM_TYPE
;
554 stream_type_msg
.stream_type
= content_type
;
556 ret
= intel_dp_hdcp2_write_msg(dig_port
, &stream_type_msg
,
557 sizeof(stream_type_msg
));
559 return ret
< 0 ? ret
: 0;
564 int intel_dp_hdcp2_check_link(struct intel_digital_port
*dig_port
)
569 ret
= intel_dp_hdcp2_read_rx_status(dig_port
, &rx_status
);
573 if (HDCP_2_2_DP_RXSTATUS_REAUTH_REQ(rx_status
))
574 ret
= HDCP_REAUTH_REQUEST
;
575 else if (HDCP_2_2_DP_RXSTATUS_LINK_FAILED(rx_status
))
576 ret
= HDCP_LINK_INTEGRITY_FAILURE
;
577 else if (HDCP_2_2_DP_RXSTATUS_READY(rx_status
))
578 ret
= HDCP_TOPOLOGY_CHANGE
;
584 int intel_dp_hdcp2_capable(struct intel_digital_port
*dig_port
,
591 ret
= drm_dp_dpcd_read(&dig_port
->dp
.aux
,
592 DP_HDCP_2_2_REG_RX_CAPS_OFFSET
,
593 rx_caps
, HDCP_2_2_RXCAPS_LEN
);
594 if (ret
!= HDCP_2_2_RXCAPS_LEN
)
595 return ret
>= 0 ? -EIO
: ret
;
597 if (rx_caps
[0] == HDCP_2_2_RX_CAPS_VERSION_VAL
&&
598 HDCP_2_2_DP_HDCP_CAPABLE(rx_caps
[2]))
604 static const struct intel_hdcp_shim intel_dp_hdcp_shim
= {
605 .write_an_aksv
= intel_dp_hdcp_write_an_aksv
,
606 .read_bksv
= intel_dp_hdcp_read_bksv
,
607 .read_bstatus
= intel_dp_hdcp_read_bstatus
,
608 .repeater_present
= intel_dp_hdcp_repeater_present
,
609 .read_ri_prime
= intel_dp_hdcp_read_ri_prime
,
610 .read_ksv_ready
= intel_dp_hdcp_read_ksv_ready
,
611 .read_ksv_fifo
= intel_dp_hdcp_read_ksv_fifo
,
612 .read_v_prime_part
= intel_dp_hdcp_read_v_prime_part
,
613 .toggle_signalling
= intel_dp_hdcp_toggle_signalling
,
614 .check_link
= intel_dp_hdcp_check_link
,
615 .hdcp_capable
= intel_dp_hdcp_capable
,
616 .write_2_2_msg
= intel_dp_hdcp2_write_msg
,
617 .read_2_2_msg
= intel_dp_hdcp2_read_msg
,
618 .config_stream_type
= intel_dp_hdcp2_config_stream_type
,
619 .check_2_2_link
= intel_dp_hdcp2_check_link
,
620 .hdcp_2_2_capable
= intel_dp_hdcp2_capable
,
621 .protocol
= HDCP_PROTOCOL_DP
,
625 intel_dp_mst_hdcp_toggle_signalling(struct intel_digital_port
*dig_port
,
626 enum transcoder cpu_transcoder
,
629 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
633 usleep_range(6, 60); /* Bspec says >= 6us */
635 ret
= intel_ddi_toggle_hdcp_signalling(&dig_port
->base
,
636 cpu_transcoder
, enable
);
638 drm_dbg_kms(&i915
->drm
, "%s HDCP signalling failed (%d)\n",
639 enable
? "Enable" : "Disable", ret
);
644 bool intel_dp_mst_hdcp_check_link(struct intel_digital_port
*dig_port
,
645 struct intel_connector
*connector
)
647 struct drm_i915_private
*i915
= to_i915(dig_port
->base
.base
.dev
);
648 struct intel_dp
*intel_dp
= &dig_port
->dp
;
649 struct drm_dp_query_stream_enc_status_ack_reply reply
;
652 if (!intel_dp_hdcp_check_link(dig_port
, connector
))
655 ret
= drm_dp_send_query_stream_enc_status(&intel_dp
->mst_mgr
,
656 connector
->port
, &reply
);
658 drm_dbg_kms(&i915
->drm
,
659 "[CONNECTOR:%d:%s] failed QSES ret=%d\n",
660 connector
->base
.base
.id
, connector
->base
.name
, ret
);
664 return reply
.auth_completed
&& reply
.encryption_enabled
;
667 static const struct intel_hdcp_shim intel_dp_mst_hdcp_shim
= {
668 .write_an_aksv
= intel_dp_hdcp_write_an_aksv
,
669 .read_bksv
= intel_dp_hdcp_read_bksv
,
670 .read_bstatus
= intel_dp_hdcp_read_bstatus
,
671 .repeater_present
= intel_dp_hdcp_repeater_present
,
672 .read_ri_prime
= intel_dp_hdcp_read_ri_prime
,
673 .read_ksv_ready
= intel_dp_hdcp_read_ksv_ready
,
674 .read_ksv_fifo
= intel_dp_hdcp_read_ksv_fifo
,
675 .read_v_prime_part
= intel_dp_hdcp_read_v_prime_part
,
676 .toggle_signalling
= intel_dp_mst_hdcp_toggle_signalling
,
677 .check_link
= intel_dp_mst_hdcp_check_link
,
678 .hdcp_capable
= intel_dp_hdcp_capable
,
680 .protocol
= HDCP_PROTOCOL_DP
,
683 int intel_dp_init_hdcp(struct intel_digital_port
*dig_port
,
684 struct intel_connector
*intel_connector
)
686 struct drm_device
*dev
= intel_connector
->base
.dev
;
687 struct drm_i915_private
*dev_priv
= to_i915(dev
);
688 struct intel_encoder
*intel_encoder
= &dig_port
->base
;
689 enum port port
= intel_encoder
->port
;
690 struct intel_dp
*intel_dp
= &dig_port
->dp
;
692 if (!is_hdcp_supported(dev_priv
, port
))
695 if (intel_connector
->mst_port
)
696 return intel_hdcp_init(intel_connector
, port
,
697 &intel_dp_mst_hdcp_shim
);
698 else if (!intel_dp_is_edp(intel_dp
))
699 return intel_hdcp_init(intel_connector
, port
,
700 &intel_dp_hdcp_shim
);