@@ -345,6 +345,12 @@ struct intel_hdcp {
struct delayed_work check_work;
struct work_struct prop_work;
+ /*
+ * Flag to differentiate that HDCP is being disabled originated from
+ * userspace or triggered from kernel DDI disable sequence.
+ */
+ bool is_hdcp_undesired;
+
/* HDCP1.4 Encryption status */
bool hdcp_encrypted;
@@ -2002,11 +2002,18 @@ int intel_hdcp_disable(struct intel_connector *connector)
mutex_lock(&hdcp->mutex);
if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
- hdcp->value = DRM_MODE_CONTENT_PROTECTION_UNDESIRED;
if (hdcp->hdcp2_encrypted)
ret = _intel_hdcp2_disable(connector);
else if (hdcp->hdcp_encrypted)
ret = _intel_hdcp_disable(connector);
+
+ if (hdcp->is_hdcp_undesired) {
+ hdcp->value = DRM_MODE_CONTENT_PROTECTION_UNDESIRED;
+ hdcp->is_hdcp_undesired = false;
+ } else {
+ hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
+ schedule_work(&hdcp->prop_work);
+ }
}
mutex_unlock(&hdcp->mutex);
@@ -2044,6 +2051,7 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
{
u64 old_cp = old_state->content_protection;
u64 new_cp = new_state->content_protection;
+ struct intel_connector *intel_conn = to_intel_connector(connector);
struct drm_crtc_state *crtc_state;
if (!new_state->crtc) {
@@ -2069,6 +2077,9 @@ void intel_hdcp_atomic_check(struct drm_connector *connector,
return;
}
+ if (new_cp == DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
+ intel_conn->hdcp.is_hdcp_undesired = true;
+
crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
new_state->crtc);
crtc_state->mode_changed = true;