diff options
author | Jani Nikula <jani.nikula@intel.com> | 2022-09-12 11:11:02 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2022-09-12 11:14:20 +0300 |
commit | 6f3562b3bca078b40aa198db8fdc68439b7b0399 (patch) | |
tree | bca5b69f6318824e66f9f6aa9a7f1eea0f216be3 /drivers/gpu/drm/i915/display/intel_hdcp.c | |
parent | 3fecf93c86087d1e1a9db28d3423db276639e776 (diff) | |
parent | 89b03aeaef16f8ab48c10c399f97c836bdbae838 (diff) | |
download | linux-6f3562b3bca078b40aa198db8fdc68439b7b0399.tar.xz |
Merge drm/drm-next into drm-intel-next
Backmerge to sync the DP MST atomic changes to drm-intel-next.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_hdcp.c')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_hdcp.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 987e02eea66a..6406fd487ee5 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -31,8 +31,30 @@ static int intel_conn_to_vcpi(struct intel_connector *connector) { + struct drm_dp_mst_topology_mgr *mgr; + struct drm_dp_mst_atomic_payload *payload; + struct drm_dp_mst_topology_state *mst_state; + int vcpi = 0; + /* For HDMI this is forced to be 0x0. For DP SST also this is 0x0. */ - return connector->port ? connector->port->vcpi.vcpi : 0; + if (!connector->port) + return 0; + mgr = connector->port->mgr; + + drm_modeset_lock(&mgr->base.lock, NULL); + mst_state = to_drm_dp_mst_topology_state(mgr->base.state); + payload = drm_atomic_get_mst_payload_state(mst_state, connector->port); + if (drm_WARN_ON(mgr->dev, !payload)) + goto out; + + vcpi = payload->vcpi; + if (drm_WARN_ON(mgr->dev, vcpi < 0)) { + vcpi = 0; + goto out; + } +out: + drm_modeset_unlock(&mgr->base.lock); + return vcpi; } /* |