@@ -485,21 +485,30 @@ bool drm_hdcp_atomic_check(struct drm_connector *connector,
return true;
/*
- * Nothing to do if content type is unchanged and one of:
- * - state didn't change
- * - HDCP was activated since the last commit
- * - attempting to set to desired while already enabled
+ * Content type changes require an HDCP disable/enable cycle.
*/
- if (old_hdcp == new_hdcp ||
- (old_hdcp == DRM_MODE_CONTENT_PROTECTION_DESIRED &&
+ if (new_conn_state->hdcp_content_type !=
+ old_conn_state->hdcp_content_type) {
+ new_conn_state->content_protection =
+ DRM_MODE_CONTENT_PROTECTION_DESIRED;
+ return true;
+ }
+
+ /*
+ * Ignore meaningless state changes:
+ * - HDCP was activated since the last commit
+ * - Attempting to set to desired while already enabled
+ */
+ if ((old_hdcp == DRM_MODE_CONTENT_PROTECTION_DESIRED &&
new_hdcp == DRM_MODE_CONTENT_PROTECTION_ENABLED) ||
(old_hdcp == DRM_MODE_CONTENT_PROTECTION_ENABLED &&
new_hdcp == DRM_MODE_CONTENT_PROTECTION_DESIRED)) {
- if (old_conn_state->hdcp_content_type ==
- new_conn_state->hdcp_content_type)
- return false;
+ new_conn_state->content_protection =
+ DRM_MODE_CONTENT_PROTECTION_ENABLED;
+ return false;
}
- return true;
+ /* Finally, if state changes, we need action */
+ return old_hdcp != new_hdcp;
}
EXPORT_SYMBOL(drm_hdcp_atomic_check);