Lines Matching defs:connector
34 struct intel_connector *connector)
42 if (!connector->port)
44 mgr = connector->port->mgr;
48 payload = drm_atomic_get_mst_payload_state(mst_state, connector->port);
93 static void intel_hdcp_prepare_streams(struct intel_connector *connector)
95 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
97 struct intel_hdcp *hdcp = &connector->hdcp;
99 if (!intel_encoder_is_mst(intel_attached_encoder(connector))) {
143 bool intel_hdcp_capable(struct intel_connector *connector)
145 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
146 const struct intel_hdcp_shim *shim = connector->hdcp.shim;
164 bool intel_hdcp2_capable(struct intel_connector *connector)
166 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
167 struct drm_i915_private *i915 = to_i915(connector->base.dev);
168 struct intel_hdcp *hdcp = &connector->hdcp;
379 int intel_hdcp_validate_v_prime(struct intel_connector *connector,
383 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
384 struct drm_i915_private *i915 = to_i915(connector->base.dev);
385 enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder;
623 int intel_hdcp_auth_downstream(struct intel_connector *connector)
625 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
626 struct drm_i915_private *i915 = to_i915(connector->base.dev);
627 const struct intel_hdcp_shim *shim = connector->hdcp.shim;
684 ret = intel_hdcp_validate_v_prime(connector, shim,
706 static int intel_hdcp_auth(struct intel_connector *connector)
708 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
709 struct drm_i915_private *i915 = to_i915(connector->base.dev);
710 struct intel_hdcp *hdcp = &connector->hdcp;
712 enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder;
861 ret = shim->stream_encryption(connector, true);
864 connector->base.name, connector->base.base.id);
872 return intel_hdcp_auth_downstream(connector);
878 static int _intel_hdcp_disable(struct intel_connector *connector)
880 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
881 struct drm_i915_private *i915 = to_i915(connector->base.dev);
882 struct intel_hdcp *hdcp = &connector->hdcp;
889 connector->base.name, connector->base.base.id);
892 ret = hdcp->shim->stream_encryption(connector, false);
895 connector->base.name, connector->base.base.id);
933 static int _intel_hdcp_enable(struct intel_connector *connector)
935 struct drm_i915_private *i915 = to_i915(connector->base.dev);
936 struct intel_hdcp *hdcp = &connector->hdcp;
940 connector->base.name, connector->base.base.id);
961 ret = intel_hdcp_auth(connector);
970 _intel_hdcp_disable(connector);
983 static void intel_hdcp_update_value(struct intel_connector *connector,
986 struct drm_device *dev = connector->base.dev;
987 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
988 struct intel_hdcp *hdcp = &connector->hdcp;
989 struct drm_i915_private *i915 = to_i915(connector->base.dev);
991 drm_WARN_ON(connector->base.dev, !mutex_is_locked(&hdcp->mutex));
1007 drm_connector_get(&connector->base);
1013 static int intel_hdcp_check_link(struct intel_connector *connector)
1015 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1016 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1017 struct intel_hdcp *hdcp = &connector->hdcp;
1038 connector->base.name, connector->base.base.id,
1041 intel_hdcp_update_value(connector,
1047 if (hdcp->shim->check_link(dig_port, connector)) {
1049 intel_hdcp_update_value(connector,
1057 connector->base.name, connector->base.base.id);
1059 ret = _intel_hdcp_disable(connector);
1062 intel_hdcp_update_value(connector,
1068 ret = _intel_hdcp_enable(connector);
1071 intel_hdcp_update_value(connector,
1087 struct intel_connector *connector = intel_hdcp_to_connector(hdcp);
1088 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1099 drm_hdcp_update_content_protection(&connector->base,
1105 drm_connector_put(&connector->base);
1115 hdcp2_prepare_ake_init(struct intel_connector *connector,
1118 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1120 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1142 hdcp2_verify_rx_cert_prepare_km(struct intel_connector *connector,
1148 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1150 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1173 static int hdcp2_verify_hprime(struct intel_connector *connector,
1176 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1178 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1199 hdcp2_store_pairing_info(struct intel_connector *connector,
1202 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1204 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1226 hdcp2_prepare_lc_init(struct intel_connector *connector,
1229 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1231 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1253 hdcp2_verify_lprime(struct intel_connector *connector,
1256 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1258 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1279 static int hdcp2_prepare_skey(struct intel_connector *connector,
1282 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1284 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1306 hdcp2_verify_rep_topology_prepare_ack(struct intel_connector *connector,
1311 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1313 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1338 hdcp2_verify_mprime(struct intel_connector *connector,
1341 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1343 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1363 static int hdcp2_authenticate_port(struct intel_connector *connector)
1365 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1367 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1388 static int hdcp2_close_session(struct intel_connector *connector)
1390 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1391 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1410 static int hdcp2_deauthenticate_port(struct intel_connector *connector)
1412 return hdcp2_close_session(connector);
1416 static int hdcp2_authentication_key_exchange(struct intel_connector *connector)
1418 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1419 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1420 struct intel_hdcp *hdcp = &connector->hdcp;
1436 ret = hdcp2_prepare_ake_init(connector, &msgs.ake_init);
1468 ret = hdcp2_verify_rx_cert_prepare_km(connector, &msgs.send_cert,
1483 ret = hdcp2_verify_hprime(connector, &msgs.send_hprime);
1496 ret = hdcp2_store_pairing_info(connector, &msgs.pairing_info);
1505 static int hdcp2_locality_check(struct intel_connector *connector)
1507 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1508 struct intel_hdcp *hdcp = &connector->hdcp;
1517 ret = hdcp2_prepare_lc_init(connector, &msgs.lc_init);
1533 ret = hdcp2_verify_lprime(connector, &msgs.send_lprime);
1541 static int hdcp2_session_key_exchange(struct intel_connector *connector)
1543 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1544 struct intel_hdcp *hdcp = &connector->hdcp;
1548 ret = hdcp2_prepare_skey(connector, &send_eks);
1561 int _hdcp2_propagate_stream_management_info(struct intel_connector *connector)
1563 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1565 struct intel_hdcp *hdcp = &connector->hdcp;
1573 if (connector->hdcp.seq_num_m > HDCP_2_2_SEQ_NUM_MAX)
1602 ret = hdcp2_verify_mprime(connector, &msgs.stream_ready);
1611 int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
1613 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1614 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1615 struct intel_hdcp *hdcp = &connector->hdcp;
1671 ret = hdcp2_verify_rep_topology_prepare_ack(connector,
1686 static int hdcp2_authenticate_sink(struct intel_connector *connector)
1688 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1689 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1690 struct intel_hdcp *hdcp = &connector->hdcp;
1694 ret = hdcp2_authentication_key_exchange(connector);
1700 ret = hdcp2_locality_check(connector);
1707 ret = hdcp2_session_key_exchange(connector);
1722 ret = hdcp2_authenticate_repeater_topology(connector);
1733 static int hdcp2_enable_stream_encryption(struct intel_connector *connector)
1735 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1736 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1738 struct intel_hdcp *hdcp = &connector->hdcp;
1746 connector->base.name, connector->base.base.id);
1752 ret = hdcp->shim->stream_2_2_encryption(connector, true);
1755 connector->base.name, connector->base.base.id);
1765 if (hdcp2_deauthenticate_port(connector) < 0)
1774 static int hdcp2_enable_encryption(struct intel_connector *connector)
1776 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1777 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1778 struct intel_hdcp *hdcp = &connector->hdcp;
1813 static int hdcp2_disable_encryption(struct intel_connector *connector)
1815 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1816 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1817 struct intel_hdcp *hdcp = &connector->hdcp;
1851 hdcp2_propagate_stream_management_info(struct intel_connector *connector)
1853 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1856 if (!connector->hdcp.is_repeater)
1860 ret = _hdcp2_propagate_stream_management_info(connector);
1865 if (connector->hdcp.seq_num_m > HDCP_2_2_SEQ_NUM_MAX) {
1879 static int hdcp2_authenticate_and_encrypt(struct intel_connector *connector)
1881 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1882 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1886 ret = hdcp2_authenticate_sink(connector);
1888 intel_hdcp_prepare_streams(connector);
1890 ret = hdcp2_propagate_stream_management_info(connector);
1898 ret = hdcp2_authenticate_port(connector);
1908 if (hdcp2_deauthenticate_port(connector) < 0)
1918 ret = hdcp2_enable_encryption(connector);
1922 if (hdcp2_deauthenticate_port(connector) < 0)
1928 ret = hdcp2_enable_stream_encryption(connector);
1933 static int _intel_hdcp2_enable(struct intel_connector *connector)
1935 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1936 struct intel_hdcp *hdcp = &connector->hdcp;
1940 connector->base.name, connector->base.base.id,
1943 ret = hdcp2_authenticate_and_encrypt(connector);
1951 connector->base.name, connector->base.base.id,
1959 _intel_hdcp2_disable(struct intel_connector *connector, bool hdcp2_link_recovery)
1961 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
1962 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1964 struct intel_hdcp *hdcp = &connector->hdcp;
1968 connector->base.name, connector->base.base.id);
1971 ret = hdcp->shim->stream_2_2_encryption(connector, false);
1974 connector->base.name, connector->base.base.id);
1984 ret = hdcp2_disable_encryption(connector);
1986 if (hdcp2_deauthenticate_port(connector) < 0)
1989 connector->hdcp.hdcp2_encrypted = false;
1997 static int intel_hdcp2_check_link(struct intel_connector *connector)
1999 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
2000 struct drm_i915_private *i915 = to_i915(connector->base.dev);
2001 struct intel_hdcp *hdcp = &connector->hdcp;
2023 _intel_hdcp2_disable(connector, true);
2024 intel_hdcp_update_value(connector,
2030 ret = hdcp->shim->check_2_2_link(dig_port, connector);
2033 intel_hdcp_update_value(connector,
2046 ret = hdcp2_authenticate_repeater_topology(connector);
2048 intel_hdcp_update_value(connector,
2055 connector->base.name, connector->base.base.id,
2060 connector->base.name, connector->base.base.id);
2063 ret = _intel_hdcp2_disable(connector, true);
2067 connector->base.name, connector->base.base.id, ret);
2068 intel_hdcp_update_value(connector,
2073 ret = _intel_hdcp2_enable(connector);
2077 connector->base.name, connector->base.base.id,
2079 intel_hdcp_update_value(connector,
2096 struct intel_connector *connector = intel_hdcp_to_connector(hdcp);
2097 struct drm_i915_private *i915 = to_i915(connector->base.dev);
2099 if (drm_connector_is_unregistered(&connector->base))
2102 if (!intel_hdcp2_check_link(connector))
2105 else if (!intel_hdcp_check_link(connector))
2164 static int initialize_hdcp_port_data(struct intel_connector *connector,
2171 struct drm_i915_private *i915 = to_i915(connector->base.dev);
2252 static void intel_hdcp2_init(struct intel_connector *connector,
2256 struct drm_i915_private *i915 = to_i915(connector->base.dev);
2257 struct intel_hdcp *hdcp = &connector->hdcp;
2260 ret = initialize_hdcp_port_data(connector, dig_port, shim);
2269 int intel_hdcp_init(struct intel_connector *connector,
2273 struct drm_i915_private *i915 = to_i915(connector->base.dev);
2274 struct intel_hdcp *hdcp = &connector->hdcp;
2281 intel_hdcp2_init(connector, dig_port, shim);
2284 drm_connector_attach_content_protection_property(&connector->base,
2307 struct intel_connector *connector;
2320 for_each_intel_connector_iter(connector, &conn_iter) {
2321 if (connector->base.status == connector_status_disconnected)
2324 if (!intel_encoder_is_mst(intel_attached_encoder(connector)))
2327 conn_dig_port = intel_attached_dig_port(connector);
2332 intel_conn_to_vcpi(&state->base, connector);
2356 struct intel_connector *connector =
2357 to_intel_connector(conn_state->connector);
2358 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
2359 struct intel_hdcp *hdcp = &connector->hdcp;
2366 if (!connector->encoder) {
2368 connector->base.name, connector->base.base.id);
2394 if (intel_hdcp2_capable(connector)) {
2397 ret = _intel_hdcp2_enable(connector);
2412 if (ret && intel_hdcp_capable(connector) &&
2414 ret = _intel_hdcp_enable(connector);
2420 intel_hdcp_update_value(connector,
2431 int intel_hdcp_disable(struct intel_connector *connector)
2433 struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
2434 struct intel_hdcp *hdcp = &connector->hdcp;
2446 intel_hdcp_update_value(connector,
2449 ret = _intel_hdcp2_disable(connector, false);
2451 ret = _intel_hdcp_disable(connector);
2465 struct intel_connector *connector =
2466 to_intel_connector(conn_state->connector);
2467 struct intel_hdcp *hdcp = &connector->hdcp;
2469 struct drm_i915_private *i915 = to_i915(connector->base.dev);
2471 if (!connector->hdcp.shim)
2486 intel_hdcp_disable(connector);
2495 drm_connector_get(&connector->base);
2512 drm_connector_get(&connector->base);
2538 void intel_hdcp_cleanup(struct intel_connector *connector)
2540 struct intel_hdcp *hdcp = &connector->hdcp;
2546 * If the connector is registered, it's possible userspace could kick
2549 drm_WARN_ON(connector->base.dev,
2550 connector->base.registration_state == DRM_CONNECTOR_REGISTERED);
2553 * Now that the connector is not registered, check_work won't be run,
2561 * function. Instead, we rely on the connector references grabbed before
2562 * scheduling prop_work to ensure the connector is alive when prop_work
2567 drm_WARN_ON(connector->base.dev, work_pending(&hdcp->prop_work));
2574 void intel_hdcp_atomic_check(struct drm_connector *connector,
2584 * If the connector is being disabled with CP enabled, mark it
2585 * desired so it's re-enabled when the connector is brought back
2622 void intel_hdcp_handle_cp_irq(struct intel_connector *connector)
2624 struct intel_hdcp *hdcp = &connector->hdcp;
2625 struct drm_i915_private *i915 = to_i915(connector->base.dev);
2630 atomic_inc(&connector->hdcp.cp_irq_count);
2631 wake_up_all(&connector->hdcp.cp_irq_queue);