Lines Matching full:hdcp

36 				      struct intel_hdcp *hdcp)  in intel_hdcp_disable_hdcp_line_rekeying()  argument
46 intel_de_rmw(dev_priv, MTL_CHICKEN_TRANS(hdcp->cpu_transcoder), in intel_hdcp_disable_hdcp_line_rekeying()
51 TRANS_DDI_FUNC_CTL(dev_priv, hdcp->cpu_transcoder), in intel_hdcp_disable_hdcp_line_rekeying()
85 * intel_hdcp_required_content_stream selects the most highest common possible HDCP
90 * HDCP 2.2 capable sink because of other sink are not capable of HDCP 2.2 in
155 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_prepare_streams() local
162 data->streams[0].stream_type = hdcp->content_type; in intel_hdcp_prepare_streams()
187 /* HDCP spec states that we must retry the bksv if it is invalid */ in intel_hdcp_read_valid_bksv()
207 const struct intel_hdcp_shim *shim = connector->hdcp.shim; in intel_hdcp_get_capability()
231 * HDCP 2.2 work
236 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp2_prerequisite() local
239 if (!hdcp->hdcp2_supported) in intel_hdcp2_prerequisite()
249 mutex_lock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp2_prerequisite()
250 if (!i915->display.hdcp.comp_added || !i915->display.hdcp.arbiter) { in intel_hdcp2_prerequisite()
251 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp2_prerequisite()
254 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp2_prerequisite()
262 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp2_get_capability() local
269 hdcp->shim->hdcp_2_2_get_capability(connector, &capable); in intel_hdcp2_get_capability()
278 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_get_remote_capability() local
280 if (!hdcp->shim->get_remote_hdcp_capability) in intel_hdcp_get_remote_capability()
283 hdcp->shim->get_remote_hdcp_capability(connector, hdcp_capable, in intel_hdcp_get_remote_capability()
347 * Another req for hdcp key loadability is enabled state of pll for in hdcp_key_loadable()
380 * Initiate loading the HDCP key from fuses. in intel_hdcp_load_keys()
382 * BXT+ platforms, HDCP key needs to be loaded by SW. Only display in intel_hdcp_load_keys()
391 "Failed to initiate HDCP key load (%d)\n", in intel_hdcp_load_keys()
474 enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder; in intel_hdcp_validate_v_prime()
703 drm_dbg_kms(&i915->drm, "SHA-1 mismatch, HDCP failed\n"); in intel_hdcp_validate_v_prime()
710 /* Implements Part 2 of the HDCP authorization procedure */
716 const struct intel_hdcp_shim *shim = connector->hdcp.shim; in intel_hdcp_auth_downstream()
739 * the HDCP encryption. That implies that repeater can't have its own in intel_hdcp_auth_downstream()
786 drm_dbg_kms(&i915->drm, "HDCP is enabled (%d downstream devices)\n", in intel_hdcp_auth_downstream()
794 /* Implements Part 1 of the HDCP authorization procedure */
799 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_auth() local
800 const struct intel_hdcp_shim *shim = hdcp->shim; in intel_hdcp_auth()
801 enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder; in intel_hdcp_auth()
820 * Detects whether the display is HDCP capable. Although we check for in intel_hdcp_auth()
821 * valid Bksv below, the HDCP over DP spec requires that we check in intel_hdcp_auth()
822 * whether the display supports HDCP before we write An. For HDMI in intel_hdcp_auth()
831 "Panel is not HDCP capable\n"); in intel_hdcp_auth()
913 * DP HDCP Spec mandates the two more reattempt to read R0, incase in intel_hdcp_auth()
952 drm_err(&i915->drm, "[CONNECTOR:%d:%s] Failed to enable HDCP 1.4 stream enc\n", in intel_hdcp_auth()
956 drm_dbg_kms(&i915->drm, "HDCP 1.4 transcoder: %s stream encrypted\n", in intel_hdcp_auth()
957 transcoder_name(hdcp->stream_transcoder)); in intel_hdcp_auth()
963 drm_dbg_kms(&i915->drm, "HDCP is enabled (no repeater present)\n"); in intel_hdcp_auth()
971 struct intel_hdcp *hdcp = &connector->hdcp; in _intel_hdcp_disable() local
973 enum transcoder cpu_transcoder = hdcp->cpu_transcoder; in _intel_hdcp_disable()
977 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] HDCP is being disabled...\n", in _intel_hdcp_disable()
980 if (hdcp->shim->stream_encryption) { in _intel_hdcp_disable()
981 ret = hdcp->shim->stream_encryption(connector, false); in _intel_hdcp_disable()
983 drm_err(&i915->drm, "[CONNECTOR:%d:%s] Failed to disable HDCP 1.4 stream enc\n", in _intel_hdcp_disable()
987 drm_dbg_kms(&i915->drm, "HDCP 1.4 transcoder: %s stream encryption disabled\n", in _intel_hdcp_disable()
988 transcoder_name(hdcp->stream_transcoder)); in _intel_hdcp_disable()
990 * If there are other connectors on this port using HDCP, in _intel_hdcp_disable()
991 * don't disable it until it disabled HDCP encryption for in _intel_hdcp_disable()
998 hdcp->hdcp_encrypted = false; in _intel_hdcp_disable()
1004 "Failed to disable HDCP, timeout clearing status\n"); in _intel_hdcp_disable()
1012 ret = hdcp->shim->toggle_signalling(dig_port, cpu_transcoder, false); in _intel_hdcp_disable()
1014 drm_err(&i915->drm, "Failed to disable HDCP signalling\n"); in _intel_hdcp_disable()
1018 drm_dbg_kms(&i915->drm, "HDCP is disabled\n"); in _intel_hdcp_disable()
1025 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp1_enable() local
1028 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] HDCP is being enabled...\n", in intel_hdcp1_enable()
1032 drm_err(&i915->drm, "HDCP key Load is not possible\n"); in intel_hdcp1_enable()
1043 drm_err(&i915->drm, "Could not load HDCP keys, (%d)\n", in intel_hdcp1_enable()
1048 /* Incase of authentication failures, HDCP spec expects reauth. */ in intel_hdcp1_enable()
1052 hdcp->hdcp_encrypted = true; in intel_hdcp1_enable()
1056 drm_dbg_kms(&i915->drm, "HDCP Auth failure (%d)\n", ret); in intel_hdcp1_enable()
1058 /* Ensuring HDCP encryption and signalling are stopped. */ in intel_hdcp1_enable()
1063 "HDCP authentication failed (%d tries/%d)\n", tries, ret); in intel_hdcp1_enable()
1067 static struct intel_connector *intel_hdcp_to_connector(struct intel_hdcp *hdcp) in intel_hdcp_to_connector() argument
1069 return container_of(hdcp, struct intel_connector, hdcp); in intel_hdcp_to_connector()
1077 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_update_value() local
1080 drm_WARN_ON(connector->base.dev, !mutex_is_locked(&hdcp->mutex)); in intel_hdcp_update_value()
1082 if (hdcp->value == value) in intel_hdcp_update_value()
1087 if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_ENABLED) { in intel_hdcp_update_value()
1094 hdcp->value = value; in intel_hdcp_update_value()
1097 if (!queue_work(i915->unordered_wq, &hdcp->prop_work)) in intel_hdcp_update_value()
1102 /* Implements Part 3 of the HDCP authorization procedure */
1107 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_check_link() local
1112 mutex_lock(&hdcp->mutex); in intel_hdcp_check_link()
1115 cpu_transcoder = hdcp->cpu_transcoder; in intel_hdcp_check_link()
1118 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_ENABLED || in intel_hdcp_check_link()
1119 !hdcp->hdcp_encrypted) { in intel_hdcp_check_link()
1127 "[CONNECTOR:%d:%s] HDCP link stopped encryption,%x\n", in intel_hdcp_check_link()
1137 if (hdcp->shim->check_link(dig_port, connector)) { in intel_hdcp_check_link()
1138 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { in intel_hdcp_check_link()
1146 "[CONNECTOR:%d:%s] HDCP link failed, retrying authentication\n", in intel_hdcp_check_link()
1151 drm_err(&i915->drm, "Failed to disable hdcp (%d)\n", ret); in intel_hdcp_check_link()
1163 mutex_unlock(&hdcp->mutex); in intel_hdcp_check_link()
1169 struct intel_hdcp *hdcp = container_of(work, struct intel_hdcp, in intel_hdcp_prop_work() local
1171 struct intel_connector *connector = intel_hdcp_to_connector(hdcp); in intel_hdcp_prop_work()
1175 mutex_lock(&hdcp->mutex); in intel_hdcp_prop_work()
1180 * we're running just after hdcp has been disabled, so just exit in intel_hdcp_prop_work()
1182 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) in intel_hdcp_prop_work()
1184 hdcp->value); in intel_hdcp_prop_work()
1186 mutex_unlock(&hdcp->mutex); in intel_hdcp_prop_work()
1208 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_prepare_ake_init()
1209 arbiter = i915->display.hdcp.arbiter; in hdcp2_prepare_ake_init()
1212 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_prepare_ake_init()
1220 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_prepare_ake_init()
1238 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_rx_cert_prepare_km()
1239 arbiter = i915->display.hdcp.arbiter; in hdcp2_verify_rx_cert_prepare_km()
1242 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_rx_cert_prepare_km()
1252 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_rx_cert_prepare_km()
1266 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_hprime()
1267 arbiter = i915->display.hdcp.arbiter; in hdcp2_verify_hprime()
1270 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_hprime()
1277 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_hprime()
1292 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_store_pairing_info()
1293 arbiter = i915->display.hdcp.arbiter; in hdcp2_store_pairing_info()
1296 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_store_pairing_info()
1304 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_store_pairing_info()
1319 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_prepare_lc_init()
1320 arbiter = i915->display.hdcp.arbiter; in hdcp2_prepare_lc_init()
1323 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_prepare_lc_init()
1331 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_prepare_lc_init()
1346 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_lprime()
1347 arbiter = i915->display.hdcp.arbiter; in hdcp2_verify_lprime()
1350 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_lprime()
1358 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_lprime()
1372 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_prepare_skey()
1373 arbiter = i915->display.hdcp.arbiter; in hdcp2_prepare_skey()
1376 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_prepare_skey()
1384 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_prepare_skey()
1401 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_rep_topology_prepare_ack()
1402 arbiter = i915->display.hdcp.arbiter; in hdcp2_verify_rep_topology_prepare_ack()
1405 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_rep_topology_prepare_ack()
1416 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_rep_topology_prepare_ack()
1431 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_mprime()
1432 arbiter = i915->display.hdcp.arbiter; in hdcp2_verify_mprime()
1435 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_mprime()
1442 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_verify_mprime()
1455 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_authenticate_port()
1456 arbiter = i915->display.hdcp.arbiter; in hdcp2_authenticate_port()
1459 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_authenticate_port()
1465 drm_dbg_kms(&i915->drm, "Enable hdcp auth failed. %d\n", in hdcp2_authenticate_port()
1467 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_authenticate_port()
1479 mutex_lock(&i915->display.hdcp.hdcp_mutex); in hdcp2_close_session()
1480 arbiter = i915->display.hdcp.arbiter; in hdcp2_close_session()
1483 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_close_session()
1489 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in hdcp2_close_session()
1503 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_authentication_key_exchange() local
1511 const struct intel_hdcp_shim *shim = hdcp->shim; in hdcp2_authentication_key_exchange()
1516 hdcp->seq_num_v = 0; in hdcp2_authentication_key_exchange()
1517 hdcp->seq_num_m = 0; in hdcp2_authentication_key_exchange()
1538 hdcp->is_repeater = HDCP_2_2_RX_REPEATER(msgs.send_cert.rx_caps[2]); in hdcp2_authentication_key_exchange()
1552 &hdcp->is_paired, in hdcp2_authentication_key_exchange()
1570 if (!hdcp->is_paired) { in hdcp2_authentication_key_exchange()
1582 hdcp->is_paired = true; in hdcp2_authentication_key_exchange()
1590 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_locality_check() local
1595 const struct intel_hdcp_shim *shim = hdcp->shim; in hdcp2_locality_check()
1625 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_session_key_exchange() local
1633 ret = hdcp->shim->write_2_2_msg(connector, &send_eks, in hdcp2_session_key_exchange()
1646 struct intel_hdcp *hdcp = &connector->hdcp; in _hdcp2_propagate_stream_management_info() local
1651 const struct intel_hdcp_shim *shim = hdcp->shim; in _hdcp2_propagate_stream_management_info()
1654 if (connector->hdcp.seq_num_m > HDCP_2_2_SEQ_NUM_MAX) in _hdcp2_propagate_stream_management_info()
1659 drm_hdcp_cpu_to_be24(msgs.stream_manage.seq_num_m, hdcp->seq_num_m); in _hdcp2_propagate_stream_management_info()
1681 data->seq_num_m = hdcp->seq_num_m; in _hdcp2_propagate_stream_management_info()
1686 hdcp->seq_num_m++; in _hdcp2_propagate_stream_management_info()
1696 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_authenticate_repeater_topology() local
1701 const struct intel_hdcp_shim *shim = hdcp->shim; in hdcp2_authenticate_repeater_topology()
1721 * device that is only HDCP 1.x or Legacy HDCP 2.0/2.1 compliant. in hdcp2_authenticate_repeater_topology()
1727 if (!dig_port->hdcp_mst_type1_capable && hdcp->content_type) { in hdcp2_authenticate_repeater_topology()
1737 if (!hdcp->hdcp2_encrypted && seq_num_v) { in hdcp2_authenticate_repeater_topology()
1743 if (seq_num_v < hdcp->seq_num_v) { in hdcp2_authenticate_repeater_topology()
1764 hdcp->seq_num_v = seq_num_v; in hdcp2_authenticate_repeater_topology()
1776 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_authenticate_sink() local
1777 const struct intel_hdcp_shim *shim = hdcp->shim; in hdcp2_authenticate_sink()
1801 hdcp->is_repeater, in hdcp2_authenticate_sink()
1802 hdcp->content_type); in hdcp2_authenticate_sink()
1807 if (hdcp->is_repeater) { in hdcp2_authenticate_sink()
1824 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_enable_stream_encryption() local
1825 enum transcoder cpu_transcoder = hdcp->cpu_transcoder; in hdcp2_enable_stream_encryption()
1831 drm_err(&i915->drm, "[CONNECTOR:%d:%s] HDCP 2.2 Link is not encrypted\n", in hdcp2_enable_stream_encryption()
1837 if (hdcp->shim->stream_2_2_encryption) { in hdcp2_enable_stream_encryption()
1838 ret = hdcp->shim->stream_2_2_encryption(connector, true); in hdcp2_enable_stream_encryption()
1840 drm_err(&i915->drm, "[CONNECTOR:%d:%s] Failed to enable HDCP 2.2 stream enc\n", in hdcp2_enable_stream_encryption()
1844 drm_dbg_kms(&i915->drm, "HDCP 2.2 transcoder: %s stream encrypted\n", in hdcp2_enable_stream_encryption()
1845 transcoder_name(hdcp->stream_transcoder)); in hdcp2_enable_stream_encryption()
1864 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_enable_encryption() local
1866 enum transcoder cpu_transcoder = hdcp->cpu_transcoder; in hdcp2_enable_encryption()
1872 if (hdcp->shim->toggle_signalling) { in hdcp2_enable_encryption()
1873 ret = hdcp->shim->toggle_signalling(dig_port, cpu_transcoder, in hdcp2_enable_encryption()
1877 "Failed to enable HDCP signalling. %d\n", in hdcp2_enable_encryption()
1903 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_disable_encryption() local
1905 enum transcoder cpu_transcoder = hdcp->cpu_transcoder; in hdcp2_disable_encryption()
1922 if (hdcp->shim->toggle_signalling) { in hdcp2_disable_encryption()
1923 ret = hdcp->shim->toggle_signalling(dig_port, cpu_transcoder, in hdcp2_disable_encryption()
1927 "Failed to disable HDCP signalling. %d\n", in hdcp2_disable_encryption()
1942 if (!connector->hdcp.is_repeater) in hdcp2_propagate_stream_management_info()
1951 if (connector->hdcp.seq_num_m > HDCP_2_2_SEQ_NUM_MAX) { in hdcp2_propagate_stream_management_info()
1998 /* Clearing the mei hdcp session */ in hdcp2_authenticate_and_encrypt()
2030 struct intel_hdcp *hdcp = &connector->hdcp; in _intel_hdcp2_enable() local
2035 hdcp->content_type); in _intel_hdcp2_enable()
2037 intel_hdcp_disable_hdcp_line_rekeying(connector->encoder, hdcp); in _intel_hdcp2_enable()
2042 hdcp->content_type, ret); in _intel_hdcp2_enable()
2048 hdcp->content_type); in _intel_hdcp2_enable()
2050 hdcp->hdcp2_encrypted = true; in _intel_hdcp2_enable()
2060 struct intel_hdcp *hdcp = &connector->hdcp; in _intel_hdcp2_disable() local
2066 if (hdcp->shim->stream_2_2_encryption) { in _intel_hdcp2_disable()
2067 ret = hdcp->shim->stream_2_2_encryption(connector, false); in _intel_hdcp2_disable()
2069 drm_err(&i915->drm, "[CONNECTOR:%d:%s] Failed to disable HDCP 2.2 stream enc\n", in _intel_hdcp2_disable()
2073 drm_dbg_kms(&i915->drm, "HDCP 2.2 transcoder: %s stream encryption disabled\n", in _intel_hdcp2_disable()
2074 transcoder_name(hdcp->stream_transcoder)); in _intel_hdcp2_disable()
2085 connector->hdcp.hdcp2_encrypted = false; in _intel_hdcp2_disable()
2097 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp2_check_link() local
2102 mutex_lock(&hdcp->mutex); in intel_hdcp2_check_link()
2104 cpu_transcoder = hdcp->cpu_transcoder; in intel_hdcp2_check_link()
2107 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_ENABLED || in intel_hdcp2_check_link()
2108 !hdcp->hdcp2_encrypted) { in intel_hdcp2_check_link()
2126 ret = hdcp->shim->check_2_2_link(dig_port, connector); in intel_hdcp2_check_link()
2128 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { in intel_hdcp2_check_link()
2137 if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED) in intel_hdcp2_check_link()
2162 mutex_unlock(&hdcp->mutex); in intel_hdcp2_check_link()
2168 struct intel_hdcp *hdcp = container_of(to_delayed_work(work), in intel_hdcp_check_work() local
2171 struct intel_connector *connector = intel_hdcp_to_connector(hdcp); in intel_hdcp_check_work()
2178 queue_delayed_work(i915->unordered_wq, &hdcp->check_work, in intel_hdcp_check_work()
2181 queue_delayed_work(i915->unordered_wq, &hdcp->check_work, in intel_hdcp_check_work()
2191 drm_dbg(&i915->drm, "I915 HDCP comp bind\n"); in i915_hdcp_component_bind()
2192 mutex_lock(&i915->display.hdcp.hdcp_mutex); in i915_hdcp_component_bind()
2193 i915->display.hdcp.arbiter = (struct i915_hdcp_arbiter *)data; in i915_hdcp_component_bind()
2194 i915->display.hdcp.arbiter->hdcp_dev = mei_kdev; in i915_hdcp_component_bind()
2195 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in i915_hdcp_component_bind()
2206 drm_dbg(&i915->drm, "I915 HDCP comp unbind\n"); in i915_hdcp_component_unbind()
2207 mutex_lock(&i915->display.hdcp.hdcp_mutex); in i915_hdcp_component_unbind()
2208 i915->display.hdcp.arbiter = NULL; in i915_hdcp_component_unbind()
2209 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in i915_hdcp_component_unbind()
2234 default: /* eDP, DSI TRANSCODERS are non HDCP capable */ in intel_get_hdcp_transcoder()
2299 mutex_lock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp_component_init()
2300 drm_WARN_ON(&i915->drm, i915->display.hdcp.comp_added); in intel_hdcp_component_init()
2302 i915->display.hdcp.comp_added = true; in intel_hdcp_component_init()
2303 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp_component_init()
2313 mutex_lock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp_component_init()
2314 i915->display.hdcp.comp_added = false; in intel_hdcp_component_init()
2315 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp_component_init()
2325 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp2_init() local
2330 drm_dbg_kms(&i915->drm, "Mei hdcp data init failed\n"); in intel_hdcp2_init()
2334 hdcp->hdcp2_supported = true; in intel_hdcp2_init()
2342 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_init() local
2353 hdcp->hdcp2_supported); in intel_hdcp_init()
2355 hdcp->hdcp2_supported = false; in intel_hdcp_init()
2360 hdcp->shim = shim; in intel_hdcp_init()
2361 mutex_init(&hdcp->mutex); in intel_hdcp_init()
2362 INIT_DELAYED_WORK(&hdcp->check_work, intel_hdcp_check_work); in intel_hdcp_init()
2363 INIT_WORK(&hdcp->prop_work, intel_hdcp_prop_work); in intel_hdcp_init()
2364 init_waitqueue_head(&hdcp->cp_irq_queue); in intel_hdcp_init()
2378 struct intel_hdcp *hdcp = &connector->hdcp; in _intel_hdcp_enable() local
2382 if (!hdcp->shim) in _intel_hdcp_enable()
2391 mutex_lock(&hdcp->mutex); in _intel_hdcp_enable()
2394 hdcp->value == DRM_MODE_CONTENT_PROTECTION_ENABLED); in _intel_hdcp_enable()
2395 hdcp->content_type = (u8)conn_state->hdcp_content_type; in _intel_hdcp_enable()
2398 hdcp->cpu_transcoder = pipe_config->mst_master_transcoder; in _intel_hdcp_enable()
2399 hdcp->stream_transcoder = pipe_config->cpu_transcoder; in _intel_hdcp_enable()
2401 hdcp->cpu_transcoder = pipe_config->cpu_transcoder; in _intel_hdcp_enable()
2402 hdcp->stream_transcoder = INVALID_TRANSCODER; in _intel_hdcp_enable()
2407 intel_get_hdcp_transcoder(hdcp->cpu_transcoder); in _intel_hdcp_enable()
2425 hdcp->content_type != DRM_MODE_HDCP_CONTENT_TYPE1) { in _intel_hdcp_enable()
2430 queue_delayed_work(i915->unordered_wq, &hdcp->check_work, in _intel_hdcp_enable()
2438 mutex_unlock(&hdcp->mutex); in _intel_hdcp_enable()
2449 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_enable() local
2452 * Enable hdcp if it's desired or if userspace is enabled and in intel_hdcp_enable()
2458 DRM_MODE_CONTENT_PROTECTION_ENABLED && hdcp->value == in intel_hdcp_enable()
2466 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_disable() local
2469 if (!hdcp->shim) in intel_hdcp_disable()
2472 mutex_lock(&hdcp->mutex); in intel_hdcp_disable()
2475 if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED) in intel_hdcp_disable()
2480 if (hdcp->hdcp2_encrypted) in intel_hdcp_disable()
2482 else if (hdcp->hdcp_encrypted) in intel_hdcp_disable()
2487 mutex_unlock(&hdcp->mutex); in intel_hdcp_disable()
2488 cancel_delayed_work_sync(&hdcp->check_work); in intel_hdcp_disable()
2499 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_update_pipe() local
2503 if (!connector->hdcp.shim) in intel_hdcp_update_pipe()
2507 (conn_state->hdcp_content_type != hdcp->content_type && in intel_hdcp_update_pipe()
2512 * During the HDCP encryption session if Type change is requested, in intel_hdcp_update_pipe()
2513 * disable the HDCP and reenable it with new TYPE value. in intel_hdcp_update_pipe()
2521 * Mark the hdcp state as DESIRED after the hdcp disable of type in intel_hdcp_update_pipe()
2525 mutex_lock(&hdcp->mutex); in intel_hdcp_update_pipe()
2526 hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED; in intel_hdcp_update_pipe()
2528 if (!queue_work(i915->unordered_wq, &hdcp->prop_work)) in intel_hdcp_update_pipe()
2530 mutex_unlock(&hdcp->mutex); in intel_hdcp_update_pipe()
2535 mutex_lock(&hdcp->mutex); in intel_hdcp_update_pipe()
2536 /* Avoid enabling hdcp, if it already ENABLED */ in intel_hdcp_update_pipe()
2538 hdcp->value != DRM_MODE_CONTENT_PROTECTION_ENABLED; in intel_hdcp_update_pipe()
2539 mutex_unlock(&hdcp->mutex); in intel_hdcp_update_pipe()
2541 * If HDCP already ENABLED and CP property is DESIRED, schedule in intel_hdcp_update_pipe()
2546 if (!queue_work(i915->unordered_wq, &hdcp->prop_work)) in intel_hdcp_update_pipe()
2558 mutex_lock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp_component_fini()
2559 if (!i915->display.hdcp.comp_added) { in intel_hdcp_component_fini()
2560 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp_component_fini()
2564 i915->display.hdcp.comp_added = false; in intel_hdcp_component_fini()
2565 mutex_unlock(&i915->display.hdcp.hdcp_mutex); in intel_hdcp_component_fini()
2575 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_cleanup() local
2577 if (!hdcp->shim) in intel_hdcp_cleanup()
2582 * off another HDCP enable, which would re-spawn the workers. in intel_hdcp_cleanup()
2591 cancel_delayed_work_sync(&hdcp->check_work); in intel_hdcp_cleanup()
2602 drm_WARN_ON(connector->base.dev, work_pending(&hdcp->prop_work)); in intel_hdcp_cleanup()
2604 mutex_lock(&hdcp->mutex); in intel_hdcp_cleanup()
2605 hdcp->shim = NULL; in intel_hdcp_cleanup()
2606 mutex_unlock(&hdcp->mutex); in intel_hdcp_cleanup()
2631 * Fix the HDCP uapi content protection state in case of modeset. in intel_hdcp_atomic_check()
2632 * FIXME: As per HDCP content protection property uapi doc, an uevent() in intel_hdcp_atomic_check()
2642 * Nothing to do if the state didn't change, or HDCP was activated since in intel_hdcp_atomic_check()
2643 * the last commit. And also no change in hdcp content type. in intel_hdcp_atomic_check()
2656 /* Handles the CP_IRQ raised from the DP HDCP sink */
2659 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_handle_cp_irq() local
2662 if (!hdcp->shim) in intel_hdcp_handle_cp_irq()
2665 atomic_inc(&connector->hdcp.cp_irq_count); in intel_hdcp_handle_cp_irq()
2666 wake_up_all(&connector->hdcp.cp_irq_queue); in intel_hdcp_handle_cp_irq()
2668 queue_delayed_work(i915->unordered_wq, &hdcp->check_work, 0); in intel_hdcp_handle_cp_irq()