From patchwork Fri Feb 2 22:09:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 10198177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 237C360388 for ; Fri, 2 Feb 2018 22:15:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A22728F7C for ; Fri, 2 Feb 2018 22:15:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2DDF28F92; Fri, 2 Feb 2018 22:15:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A38F928F7C for ; Fri, 2 Feb 2018 22:15:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D1766F14D; Fri, 2 Feb 2018 22:15:10 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 518446F163 for ; Fri, 2 Feb 2018 22:15:08 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2018 14:15:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,451,1511856000"; d="scan'208";a="24317156" Received: from mint-dev.iind.intel.com ([10.223.25.164]) by orsmga003.jf.intel.com with ESMTP; 02 Feb 2018 14:15:05 -0800 From: Ramalingam C To: intel-gfx@lists.freedesktop.org, seanpaul@chromium.org Date: Sat, 3 Feb 2018 03:39:09 +0530 Message-Id: <1517609350-10698-8-git-send-email-ramalingam.c@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517609350-10698-1-git-send-email-ramalingam.c@intel.com> References: <1517609350-10698-1-git-send-email-ramalingam.c@intel.com> Subject: [Intel-gfx] [PATCH v3 7/8] drm/i915: Reauthenticate HDCP on failure X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: daniel.vetter@ffwll.ch, rodrigo.vivi@intel.com MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Incase of HDCP authentication failure, HDCP spec expects reauthentication. Hence this patch adds the reauthentications to be compliance with spec. v2: do-while to for loop for simplicity. [Seanpaul] v3: positioning the logs effectively. [Seanpaul] Signed-off-by: Ramalingam C --- drivers/gpu/drm/i915/intel_hdcp.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c index 7ae8d83760ed..8f0cf476962f 100644 --- a/drivers/gpu/drm/i915/intel_hdcp.c +++ b/drivers/gpu/drm/i915/intel_hdcp.c @@ -578,7 +578,7 @@ static int _intel_hdcp_disable(struct intel_connector *connector) static int _intel_hdcp_enable(struct intel_connector *connector) { struct drm_i915_private *dev_priv = connector->base.dev->dev_private; - int i, ret; + int i, ret, tries = 3; DRM_DEBUG_KMS("[%s:%d] HDCP is being enabled...\n", connector->base.name, connector->base.base.id); @@ -599,17 +599,21 @@ static int _intel_hdcp_enable(struct intel_connector *connector) return ret; } - ret = intel_hdcp_auth(conn_to_dig_port(connector), - connector->hdcp_shim); - if (ret) { - DRM_ERROR("Failed to authenticate HDCP (%d)\n", ret); + /* Incase of authentication failures, HDCP spec expects reauth. */ + for (i = 0; i < tries; i++) { + ret = intel_hdcp_auth(conn_to_dig_port(connector), + connector->hdcp_shim); + if (!ret) + return 0; + + DRM_DEBUG_KMS("HDCP Auth failure (%d)\n", ret); /* Ensuring HDCP encryption and signalling are stopped. */ _intel_hdcp_disable(connector); - return ret; } - return 0; + DRM_ERROR("HDCP authentication failed (%d tries/%d)\n", tries, ret); + return ret; } static void intel_hdcp_check_work(struct work_struct *work)