[PATCH] drm/i915: Don't disable HDCP if it's not enabled

Sean Paul seanpaul at chromium.org
Tue Jan 9 15:00:25 UTC 2018


If HDCP is already disabled, skip the disable function. We'll still run
the disable function if state is DESIRED since there may have been a
problem and a retry is desired.

Signed-off-by: Sean Paul <seanpaul at chromium.org>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index 3c164a27d50b..c4b101d06311 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -623,8 +623,10 @@ int intel_hdcp_disable(struct intel_connector *connector)
 
 	mutex_lock(&connector->hdcp_mutex);
 
-	connector->hdcp_value = DRM_MODE_CONTENT_PROTECTION_UNDESIRED;
-	ret = _intel_hdcp_disable(connector);
+	if (connector->hdcp_value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
+		connector->hdcp_value = DRM_MODE_CONTENT_PROTECTION_UNDESIRED;
+		ret = _intel_hdcp_disable(connector);
+	}
 
 	mutex_unlock(&connector->hdcp_mutex);
 	cancel_delayed_work_sync(&connector->hdcp_check_work);
-- 
2.16.0.rc0.223.g4a4ac83678-goog



More information about the Intel-gfx-trybot mailing list