Lines Matching full:hdcp

36 				     struct intel_hdcp *hdcp,  in intel_hdcp_adjust_hdcp_line_rekeying()  argument
48 rekey_reg = TRANS_DDI_FUNC_CTL(display, hdcp->cpu_transcoder); in intel_hdcp_adjust_hdcp_line_rekeying()
52 rekey_reg = TRANS_DDI_FUNC_CTL(display, hdcp->cpu_transcoder); in intel_hdcp_adjust_hdcp_line_rekeying()
55 rekey_reg = CHICKEN_TRANS(display, hdcp->cpu_transcoder); in intel_hdcp_adjust_hdcp_line_rekeying()
92 * intel_hdcp_required_content_stream selects the most highest common possible HDCP
97 * HDCP 2.2 capable sink because of other sink are not capable of HDCP 2.2 in
162 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_prepare_streams() local
169 data->streams[0].stream_type = hdcp->content_type; in intel_hdcp_prepare_streams()
194 /* HDCP spec states that we must retry the bksv if it is invalid */ in intel_hdcp_read_valid_bksv()
214 const struct intel_hdcp_shim *shim = connector->hdcp.shim; in intel_hdcp_get_capability()
238 * HDCP 2.2 work
243 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp2_prerequisite() local
246 if (!hdcp->hdcp2_supported) in intel_hdcp2_prerequisite()
256 mutex_lock(&display->hdcp.hdcp_mutex); in intel_hdcp2_prerequisite()
257 if (!display->hdcp.comp_added || !display->hdcp.arbiter) { in intel_hdcp2_prerequisite()
258 mutex_unlock(&display->hdcp.hdcp_mutex); in intel_hdcp2_prerequisite()
261 mutex_unlock(&display->hdcp.hdcp_mutex); in intel_hdcp2_prerequisite()
269 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp2_get_capability() local
276 hdcp->shim->hdcp_2_2_get_capability(connector, &capable); in intel_hdcp2_get_capability()
285 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_get_remote_capability() local
287 if (!hdcp->shim->get_remote_hdcp_capability) in intel_hdcp_get_remote_capability()
290 hdcp->shim->get_remote_hdcp_capability(connector, hdcp_capable, in intel_hdcp_get_remote_capability()
355 * Another req for hdcp key loadability is enabled state of pll for in hdcp_key_loadable()
389 * Initiate loading the HDCP key from fuses. in intel_hdcp_load_keys()
391 * BXT+ platforms, HDCP key needs to be loaded by SW. Only display in intel_hdcp_load_keys()
400 "Failed to initiate HDCP key load (%d)\n", in intel_hdcp_load_keys()
483 enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder; in intel_hdcp_validate_v_prime()
712 drm_dbg_kms(display->drm, "SHA-1 mismatch, HDCP failed\n"); in intel_hdcp_validate_v_prime()
719 /* Implements Part 2 of the HDCP authorization procedure */
725 const struct intel_hdcp_shim *shim = connector->hdcp.shim; in intel_hdcp_auth_downstream()
748 * the HDCP encryption. That implies that repeater can't have its own in intel_hdcp_auth_downstream()
795 drm_dbg_kms(display->drm, "HDCP is enabled (%d downstream devices)\n", in intel_hdcp_auth_downstream()
803 /* Implements Part 1 of the HDCP authorization procedure */
808 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_auth() local
809 const struct intel_hdcp_shim *shim = hdcp->shim; in intel_hdcp_auth()
810 enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder; in intel_hdcp_auth()
829 * Detects whether the display is HDCP capable. Although we check for in intel_hdcp_auth()
830 * valid Bksv below, the HDCP over DP spec requires that we check in intel_hdcp_auth()
831 * whether the display supports HDCP before we write An. For HDMI in intel_hdcp_auth()
840 "Panel is not HDCP capable\n"); in intel_hdcp_auth()
922 * DP HDCP Spec mandates the two more reattempt to read R0, incase in intel_hdcp_auth()
961 drm_err(display->drm, "[CONNECTOR:%d:%s] Failed to enable HDCP 1.4 stream enc\n", in intel_hdcp_auth()
965 drm_dbg_kms(display->drm, "HDCP 1.4 transcoder: %s stream encrypted\n", in intel_hdcp_auth()
966 transcoder_name(hdcp->stream_transcoder)); in intel_hdcp_auth()
972 drm_dbg_kms(display->drm, "HDCP is enabled (no repeater present)\n"); in intel_hdcp_auth()
980 struct intel_hdcp *hdcp = &connector->hdcp; in _intel_hdcp_disable() local
982 enum transcoder cpu_transcoder = hdcp->cpu_transcoder; in _intel_hdcp_disable()
986 drm_dbg_kms(display->drm, "[CONNECTOR:%d:%s] HDCP is being disabled...\n", in _intel_hdcp_disable()
989 if (hdcp->shim->stream_encryption) { in _intel_hdcp_disable()
990 ret = hdcp->shim->stream_encryption(connector, false); in _intel_hdcp_disable()
992 drm_err(display->drm, "[CONNECTOR:%d:%s] Failed to disable HDCP 1.4 stream enc\n", in _intel_hdcp_disable()
996 drm_dbg_kms(display->drm, "HDCP 1.4 transcoder: %s stream encryption disabled\n", in _intel_hdcp_disable()
997 transcoder_name(hdcp->stream_transcoder)); in _intel_hdcp_disable()
999 * If there are other connectors on this port using HDCP, in _intel_hdcp_disable()
1000 * don't disable it until it disabled HDCP encryption for in _intel_hdcp_disable()
1007 hdcp->hdcp_encrypted = false; in _intel_hdcp_disable()
1013 "Failed to disable HDCP, timeout clearing status\n"); in _intel_hdcp_disable()
1021 ret = hdcp->shim->toggle_signalling(dig_port, cpu_transcoder, false); in _intel_hdcp_disable()
1023 drm_err(display->drm, "Failed to disable HDCP signalling\n"); in _intel_hdcp_disable()
1027 drm_dbg_kms(display->drm, "HDCP is disabled\n"); in _intel_hdcp_disable()
1034 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp1_enable() local
1037 drm_dbg_kms(display->drm, "[CONNECTOR:%d:%s] HDCP is being enabled...\n", in intel_hdcp1_enable()
1041 drm_err(display->drm, "HDCP key Load is not possible\n"); in intel_hdcp1_enable()
1052 drm_err(display->drm, "Could not load HDCP keys, (%d)\n", in intel_hdcp1_enable()
1057 intel_hdcp_adjust_hdcp_line_rekeying(connector->encoder, hdcp, true); in intel_hdcp1_enable()
1059 /* Incase of authentication failures, HDCP spec expects reauth. */ in intel_hdcp1_enable()
1063 hdcp->hdcp_encrypted = true; in intel_hdcp1_enable()
1067 drm_dbg_kms(display->drm, "HDCP Auth failure (%d)\n", ret); in intel_hdcp1_enable()
1069 /* Ensuring HDCP encryption and signalling are stopped. */ in intel_hdcp1_enable()
1074 "HDCP authentication failed (%d tries/%d)\n", tries, ret); in intel_hdcp1_enable()
1078 static struct intel_connector *intel_hdcp_to_connector(struct intel_hdcp *hdcp) in intel_hdcp_to_connector() argument
1080 return container_of(hdcp, struct intel_connector, hdcp); in intel_hdcp_to_connector()
1089 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_update_value() local
1091 drm_WARN_ON(display->drm, !mutex_is_locked(&hdcp->mutex)); in intel_hdcp_update_value()
1093 if (hdcp->value == value) in intel_hdcp_update_value()
1098 if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_ENABLED) { in intel_hdcp_update_value()
1105 hdcp->value = value; in intel_hdcp_update_value()
1108 if (!queue_work(i915->unordered_wq, &hdcp->prop_work)) in intel_hdcp_update_value()
1113 /* Implements Part 3 of the HDCP authorization procedure */
1118 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_check_link() local
1123 mutex_lock(&hdcp->mutex); in intel_hdcp_check_link()
1126 cpu_transcoder = hdcp->cpu_transcoder; in intel_hdcp_check_link()
1129 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_ENABLED || in intel_hdcp_check_link()
1130 !hdcp->hdcp_encrypted) { in intel_hdcp_check_link()
1138 "[CONNECTOR:%d:%s] HDCP link stopped encryption,%x\n", in intel_hdcp_check_link()
1148 if (hdcp->shim->check_link(dig_port, connector)) { in intel_hdcp_check_link()
1149 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { in intel_hdcp_check_link()
1157 "[CONNECTOR:%d:%s] HDCP link failed, retrying authentication\n", in intel_hdcp_check_link()
1162 drm_err(display->drm, "Failed to disable hdcp (%d)\n", ret); in intel_hdcp_check_link()
1171 drm_err(display->drm, "Failed to enable hdcp (%d)\n", ret); in intel_hdcp_check_link()
1180 mutex_unlock(&hdcp->mutex); in intel_hdcp_check_link()
1186 struct intel_hdcp *hdcp = container_of(work, struct intel_hdcp, in intel_hdcp_prop_work() local
1188 struct intel_connector *connector = intel_hdcp_to_connector(hdcp); in intel_hdcp_prop_work()
1192 mutex_lock(&hdcp->mutex); in intel_hdcp_prop_work()
1197 * we're running just after hdcp has been disabled, so just exit in intel_hdcp_prop_work()
1199 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) in intel_hdcp_prop_work()
1201 hdcp->value); in intel_hdcp_prop_work()
1203 mutex_unlock(&hdcp->mutex); in intel_hdcp_prop_work()
1225 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_prepare_ake_init()
1226 arbiter = display->hdcp.arbiter; in hdcp2_prepare_ake_init()
1229 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_prepare_ake_init()
1237 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_prepare_ake_init()
1255 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_verify_rx_cert_prepare_km()
1256 arbiter = display->hdcp.arbiter; in hdcp2_verify_rx_cert_prepare_km()
1259 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_rx_cert_prepare_km()
1269 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_rx_cert_prepare_km()
1283 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_verify_hprime()
1284 arbiter = display->hdcp.arbiter; in hdcp2_verify_hprime()
1287 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_hprime()
1294 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_hprime()
1309 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_store_pairing_info()
1310 arbiter = display->hdcp.arbiter; in hdcp2_store_pairing_info()
1313 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_store_pairing_info()
1321 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_store_pairing_info()
1336 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_prepare_lc_init()
1337 arbiter = display->hdcp.arbiter; in hdcp2_prepare_lc_init()
1340 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_prepare_lc_init()
1348 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_prepare_lc_init()
1363 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_verify_lprime()
1364 arbiter = display->hdcp.arbiter; in hdcp2_verify_lprime()
1367 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_lprime()
1375 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_lprime()
1389 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_prepare_skey()
1390 arbiter = display->hdcp.arbiter; in hdcp2_prepare_skey()
1393 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_prepare_skey()
1401 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_prepare_skey()
1418 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_verify_rep_topology_prepare_ack()
1419 arbiter = display->hdcp.arbiter; in hdcp2_verify_rep_topology_prepare_ack()
1422 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_rep_topology_prepare_ack()
1433 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_rep_topology_prepare_ack()
1448 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_verify_mprime()
1449 arbiter = display->hdcp.arbiter; in hdcp2_verify_mprime()
1452 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_mprime()
1459 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_verify_mprime()
1472 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_authenticate_port()
1473 arbiter = display->hdcp.arbiter; in hdcp2_authenticate_port()
1476 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_authenticate_port()
1482 drm_dbg_kms(display->drm, "Enable hdcp auth failed. %d\n", in hdcp2_authenticate_port()
1484 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_authenticate_port()
1496 mutex_lock(&display->hdcp.hdcp_mutex); in hdcp2_close_session()
1497 arbiter = display->hdcp.arbiter; in hdcp2_close_session()
1500 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_close_session()
1506 mutex_unlock(&display->hdcp.hdcp_mutex); in hdcp2_close_session()
1522 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_authentication_key_exchange() local
1530 const struct intel_hdcp_shim *shim = hdcp->shim; in hdcp2_authentication_key_exchange()
1535 hdcp->seq_num_v = 0; in hdcp2_authentication_key_exchange()
1536 hdcp->seq_num_m = 0; in hdcp2_authentication_key_exchange()
1558 * and then try HDCP authentication. The values of 10 and delay of 50ms in hdcp2_authentication_key_exchange()
1586 hdcp->is_repeater = HDCP_2_2_RX_REPEATER(msgs.send_cert.rx_caps[2]); in hdcp2_authentication_key_exchange()
1600 &hdcp->is_paired, in hdcp2_authentication_key_exchange()
1618 if (!hdcp->is_paired) { in hdcp2_authentication_key_exchange()
1630 hdcp->is_paired = true; in hdcp2_authentication_key_exchange()
1638 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_locality_check() local
1643 const struct intel_hdcp_shim *shim = hdcp->shim; in hdcp2_locality_check()
1673 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_session_key_exchange() local
1681 ret = hdcp->shim->write_2_2_msg(connector, &send_eks, in hdcp2_session_key_exchange()
1694 struct intel_hdcp *hdcp = &connector->hdcp; in _hdcp2_propagate_stream_management_info() local
1699 const struct intel_hdcp_shim *shim = hdcp->shim; in _hdcp2_propagate_stream_management_info()
1702 if (connector->hdcp.seq_num_m > HDCP_2_2_SEQ_NUM_MAX) in _hdcp2_propagate_stream_management_info()
1707 drm_hdcp_cpu_to_be24(msgs.stream_manage.seq_num_m, hdcp->seq_num_m); in _hdcp2_propagate_stream_management_info()
1729 data->seq_num_m = hdcp->seq_num_m; in _hdcp2_propagate_stream_management_info()
1734 hdcp->seq_num_m++; in _hdcp2_propagate_stream_management_info()
1744 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_authenticate_repeater_topology() local
1749 const struct intel_hdcp_shim *shim = hdcp->shim; in hdcp2_authenticate_repeater_topology()
1769 * device that is only HDCP 1.x or Legacy HDCP 2.0/2.1 compliant. in hdcp2_authenticate_repeater_topology()
1775 if (!dig_port->hdcp_mst_type1_capable && hdcp->content_type) { in hdcp2_authenticate_repeater_topology()
1785 if (!hdcp->hdcp2_encrypted && seq_num_v) { in hdcp2_authenticate_repeater_topology()
1791 if (seq_num_v < hdcp->seq_num_v) { in hdcp2_authenticate_repeater_topology()
1812 hdcp->seq_num_v = seq_num_v; in hdcp2_authenticate_repeater_topology()
1824 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_authenticate_sink() local
1825 const struct intel_hdcp_shim *shim = hdcp->shim; in hdcp2_authenticate_sink()
1849 hdcp->is_repeater, in hdcp2_authenticate_sink()
1850 hdcp->content_type); in hdcp2_authenticate_sink()
1855 if (hdcp->is_repeater) { in hdcp2_authenticate_sink()
1872 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_enable_stream_encryption() local
1873 enum transcoder cpu_transcoder = hdcp->cpu_transcoder; in hdcp2_enable_stream_encryption()
1879 drm_err(display->drm, "[CONNECTOR:%d:%s] HDCP 2.2 Link is not encrypted\n", in hdcp2_enable_stream_encryption()
1885 if (hdcp->shim->stream_2_2_encryption) { in hdcp2_enable_stream_encryption()
1886 ret = hdcp->shim->stream_2_2_encryption(connector, true); in hdcp2_enable_stream_encryption()
1888 drm_err(display->drm, "[CONNECTOR:%d:%s] Failed to enable HDCP 2.2 stream enc\n", in hdcp2_enable_stream_encryption()
1892 drm_dbg_kms(display->drm, "HDCP 2.2 transcoder: %s stream encrypted\n", in hdcp2_enable_stream_encryption()
1893 transcoder_name(hdcp->stream_transcoder)); in hdcp2_enable_stream_encryption()
1912 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_enable_encryption() local
1914 enum transcoder cpu_transcoder = hdcp->cpu_transcoder; in hdcp2_enable_encryption()
1920 if (hdcp->shim->toggle_signalling) { in hdcp2_enable_encryption()
1921 ret = hdcp->shim->toggle_signalling(dig_port, cpu_transcoder, in hdcp2_enable_encryption()
1925 "Failed to enable HDCP signalling. %d\n", in hdcp2_enable_encryption()
1951 struct intel_hdcp *hdcp = &connector->hdcp; in hdcp2_disable_encryption() local
1953 enum transcoder cpu_transcoder = hdcp->cpu_transcoder; in hdcp2_disable_encryption()
1971 if (hdcp->shim->toggle_signalling) { in hdcp2_disable_encryption()
1972 ret = hdcp->shim->toggle_signalling(dig_port, cpu_transcoder, in hdcp2_disable_encryption()
1976 "Failed to disable HDCP signalling. %d\n", in hdcp2_disable_encryption()
1991 if (!connector->hdcp.is_repeater) in hdcp2_propagate_stream_management_info()
2000 if (connector->hdcp.seq_num_m > HDCP_2_2_SEQ_NUM_MAX) { in hdcp2_propagate_stream_management_info()
2047 /* Clearing the mei hdcp session */ in hdcp2_authenticate_and_encrypt()
2079 struct intel_hdcp *hdcp = &connector->hdcp; in _intel_hdcp2_enable() local
2084 hdcp->content_type); in _intel_hdcp2_enable()
2086 intel_hdcp_adjust_hdcp_line_rekeying(connector->encoder, hdcp, false); in _intel_hdcp2_enable()
2091 hdcp->content_type, ret); in _intel_hdcp2_enable()
2097 hdcp->content_type); in _intel_hdcp2_enable()
2099 hdcp->hdcp2_encrypted = true; in _intel_hdcp2_enable()
2109 struct intel_hdcp *hdcp = &connector->hdcp; in _intel_hdcp2_disable() local
2115 if (hdcp->shim->stream_2_2_encryption) { in _intel_hdcp2_disable()
2116 ret = hdcp->shim->stream_2_2_encryption(connector, false); in _intel_hdcp2_disable()
2118 drm_err(display->drm, "[CONNECTOR:%d:%s] Failed to disable HDCP 2.2 stream enc\n", in _intel_hdcp2_disable()
2122 drm_dbg_kms(display->drm, "HDCP 2.2 transcoder: %s stream encryption disabled\n", in _intel_hdcp2_disable()
2123 transcoder_name(hdcp->stream_transcoder)); in _intel_hdcp2_disable()
2134 connector->hdcp.hdcp2_encrypted = false; in _intel_hdcp2_disable()
2146 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp2_check_link() local
2151 mutex_lock(&hdcp->mutex); in intel_hdcp2_check_link()
2153 cpu_transcoder = hdcp->cpu_transcoder; in intel_hdcp2_check_link()
2156 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_ENABLED || in intel_hdcp2_check_link()
2157 !hdcp->hdcp2_encrypted) { in intel_hdcp2_check_link()
2175 ret = hdcp->shim->check_2_2_link(dig_port, connector); in intel_hdcp2_check_link()
2177 if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { in intel_hdcp2_check_link()
2186 if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED) in intel_hdcp2_check_link()
2224 mutex_unlock(&hdcp->mutex); in intel_hdcp2_check_link()
2230 struct intel_hdcp *hdcp = container_of(to_delayed_work(work), in intel_hdcp_check_work() local
2233 struct intel_connector *connector = intel_hdcp_to_connector(hdcp); in intel_hdcp_check_work()
2241 queue_delayed_work(i915->unordered_wq, &hdcp->check_work, in intel_hdcp_check_work()
2244 queue_delayed_work(i915->unordered_wq, &hdcp->check_work, in intel_hdcp_check_work()
2253 drm_dbg(display->drm, "I915 HDCP comp bind\n"); in i915_hdcp_component_bind()
2254 mutex_lock(&display->hdcp.hdcp_mutex); in i915_hdcp_component_bind()
2255 display->hdcp.arbiter = (struct i915_hdcp_arbiter *)data; in i915_hdcp_component_bind()
2256 display->hdcp.arbiter->hdcp_dev = mei_kdev; in i915_hdcp_component_bind()
2257 mutex_unlock(&display->hdcp.hdcp_mutex); in i915_hdcp_component_bind()
2267 drm_dbg(display->drm, "I915 HDCP comp unbind\n"); in i915_hdcp_component_unbind()
2268 mutex_lock(&display->hdcp.hdcp_mutex); in i915_hdcp_component_unbind()
2269 display->hdcp.arbiter = NULL; in i915_hdcp_component_unbind()
2270 mutex_unlock(&display->hdcp.hdcp_mutex); in i915_hdcp_component_unbind()
2295 default: /* eDP, DSI TRANSCODERS are non HDCP capable */ in intel_get_hdcp_transcoder()
2362 mutex_lock(&display->hdcp.hdcp_mutex); in intel_hdcp_component_init()
2363 drm_WARN_ON(display->drm, display->hdcp.comp_added); in intel_hdcp_component_init()
2365 display->hdcp.comp_added = true; in intel_hdcp_component_init()
2366 mutex_unlock(&display->hdcp.hdcp_mutex); in intel_hdcp_component_init()
2376 mutex_lock(&display->hdcp.hdcp_mutex); in intel_hdcp_component_init()
2377 display->hdcp.comp_added = false; in intel_hdcp_component_init()
2378 mutex_unlock(&display->hdcp.hdcp_mutex); in intel_hdcp_component_init()
2388 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp2_init() local
2393 drm_dbg_kms(display->drm, "Mei hdcp data init failed\n"); in intel_hdcp2_init()
2397 hdcp->hdcp2_supported = true; in intel_hdcp2_init()
2405 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_init() local
2415 hdcp->hdcp2_supported); in intel_hdcp_init()
2417 hdcp->hdcp2_supported = false; in intel_hdcp_init()
2422 hdcp->shim = shim; in intel_hdcp_init()
2423 mutex_init(&hdcp->mutex); in intel_hdcp_init()
2424 INIT_DELAYED_WORK(&hdcp->check_work, intel_hdcp_check_work); in intel_hdcp_init()
2425 INIT_WORK(&hdcp->prop_work, intel_hdcp_prop_work); in intel_hdcp_init()
2426 init_waitqueue_head(&hdcp->cp_irq_queue); in intel_hdcp_init()
2441 struct intel_hdcp *hdcp = &connector->hdcp; in _intel_hdcp_enable() local
2445 if (!hdcp->shim) in _intel_hdcp_enable()
2454 mutex_lock(&hdcp->mutex); in _intel_hdcp_enable()
2457 hdcp->value == DRM_MODE_CONTENT_PROTECTION_ENABLED); in _intel_hdcp_enable()
2458 hdcp->content_type = (u8)conn_state->hdcp_content_type; in _intel_hdcp_enable()
2461 hdcp->cpu_transcoder = pipe_config->mst_master_transcoder; in _intel_hdcp_enable()
2462 hdcp->stream_transcoder = pipe_config->cpu_transcoder; in _intel_hdcp_enable()
2464 hdcp->cpu_transcoder = pipe_config->cpu_transcoder; in _intel_hdcp_enable()
2465 hdcp->stream_transcoder = INVALID_TRANSCODER; in _intel_hdcp_enable()
2470 intel_get_hdcp_transcoder(hdcp->cpu_transcoder); in _intel_hdcp_enable()
2488 hdcp->content_type != DRM_MODE_HDCP_CONTENT_TYPE1) { in _intel_hdcp_enable()
2493 queue_delayed_work(i915->unordered_wq, &hdcp->check_work, in _intel_hdcp_enable()
2501 mutex_unlock(&hdcp->mutex); in _intel_hdcp_enable()
2512 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_enable() local
2515 * Enable hdcp if it's desired or if userspace is enabled and in intel_hdcp_enable()
2521 DRM_MODE_CONTENT_PROTECTION_ENABLED && hdcp->value == in intel_hdcp_enable()
2529 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_disable() local
2532 if (!hdcp->shim) in intel_hdcp_disable()
2535 mutex_lock(&hdcp->mutex); in intel_hdcp_disable()
2538 if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED) in intel_hdcp_disable()
2543 if (hdcp->hdcp2_encrypted) in intel_hdcp_disable()
2545 else if (hdcp->hdcp_encrypted) in intel_hdcp_disable()
2550 mutex_unlock(&hdcp->mutex); in intel_hdcp_disable()
2551 cancel_delayed_work_sync(&hdcp->check_work); in intel_hdcp_disable()
2562 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_update_pipe() local
2566 if (!connector->hdcp.shim) in intel_hdcp_update_pipe()
2570 (conn_state->hdcp_content_type != hdcp->content_type && in intel_hdcp_update_pipe()
2575 * During the HDCP encryption session if Type change is requested, in intel_hdcp_update_pipe()
2576 * disable the HDCP and reenable it with new TYPE value. in intel_hdcp_update_pipe()
2584 * Mark the hdcp state as DESIRED after the hdcp disable of type in intel_hdcp_update_pipe()
2588 mutex_lock(&hdcp->mutex); in intel_hdcp_update_pipe()
2589 hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED; in intel_hdcp_update_pipe()
2591 if (!queue_work(i915->unordered_wq, &hdcp->prop_work)) in intel_hdcp_update_pipe()
2593 mutex_unlock(&hdcp->mutex); in intel_hdcp_update_pipe()
2598 mutex_lock(&hdcp->mutex); in intel_hdcp_update_pipe()
2599 /* Avoid enabling hdcp, if it already ENABLED */ in intel_hdcp_update_pipe()
2601 hdcp->value != DRM_MODE_CONTENT_PROTECTION_ENABLED; in intel_hdcp_update_pipe()
2602 mutex_unlock(&hdcp->mutex); in intel_hdcp_update_pipe()
2604 * If HDCP already ENABLED and CP property is DESIRED, schedule in intel_hdcp_update_pipe()
2609 if (!queue_work(i915->unordered_wq, &hdcp->prop_work)) in intel_hdcp_update_pipe()
2621 mutex_lock(&display->hdcp.hdcp_mutex); in intel_hdcp_component_fini()
2622 if (!display->hdcp.comp_added) { in intel_hdcp_component_fini()
2623 mutex_unlock(&display->hdcp.hdcp_mutex); in intel_hdcp_component_fini()
2627 display->hdcp.comp_added = false; in intel_hdcp_component_fini()
2628 mutex_unlock(&display->hdcp.hdcp_mutex); in intel_hdcp_component_fini()
2638 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_cleanup() local
2640 if (!hdcp->shim) in intel_hdcp_cleanup()
2645 * off another HDCP enable, which would re-spawn the workers. in intel_hdcp_cleanup()
2654 cancel_delayed_work_sync(&hdcp->check_work); in intel_hdcp_cleanup()
2665 drm_WARN_ON(connector->base.dev, work_pending(&hdcp->prop_work)); in intel_hdcp_cleanup()
2667 mutex_lock(&hdcp->mutex); in intel_hdcp_cleanup()
2668 hdcp->shim = NULL; in intel_hdcp_cleanup()
2669 mutex_unlock(&hdcp->mutex); in intel_hdcp_cleanup()
2694 * Fix the HDCP uapi content protection state in case of modeset. in intel_hdcp_atomic_check()
2695 * FIXME: As per HDCP content protection property uapi doc, an uevent() in intel_hdcp_atomic_check()
2705 * Nothing to do if the state didn't change, or HDCP was activated since in intel_hdcp_atomic_check()
2706 * the last commit. And also no change in hdcp content type. in intel_hdcp_atomic_check()
2719 /* Handles the CP_IRQ raised from the DP HDCP sink */
2722 struct intel_hdcp *hdcp = &connector->hdcp; in intel_hdcp_handle_cp_irq() local
2726 if (!hdcp->shim) in intel_hdcp_handle_cp_irq()
2729 atomic_inc(&connector->hdcp.cp_irq_count); in intel_hdcp_handle_cp_irq()
2730 wake_up_all(&connector->hdcp.cp_irq_queue); in intel_hdcp_handle_cp_irq()
2732 queue_delayed_work(i915->unordered_wq, &hdcp->check_work, 0); in intel_hdcp_handle_cp_irq()