From patchwork Fri Feb 2 20:11:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 10198095 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 3264060362 for ; Fri, 2 Feb 2018 20:17:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 230BD28617 for ; Fri, 2 Feb 2018 20:17:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1656628F49; Fri, 2 Feb 2018 20:17:31 +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 BCB1128617 for ; Fri, 2 Feb 2018 20:17:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4623E6F120; Fri, 2 Feb 2018 20:17:30 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id DADEE6F120 for ; Fri, 2 Feb 2018 20:17:29 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2018 12:17:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,450,1511856000"; d="scan'208";a="200935687" Received: from mint-dev.iind.intel.com ([10.223.25.164]) by fmsmga006.fm.intel.com with ESMTP; 02 Feb 2018 12:17:27 -0800 From: Ramalingam C To: intel-gfx@lists.freedesktop.org, seanpaul@chromium.org Date: Sat, 3 Feb 2018 01:41:35 +0530 Message-Id: <1517602296-2386-8-git-send-email-ramalingam.c@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517602296-2386-1-git-send-email-ramalingam.c@intel.com> References: <1517602296-2386-1-git-send-email-ramalingam.c@intel.com> Subject: [Intel-gfx] [PATCH v2 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]. Signed-off-by: Ramalingam C --- drivers/gpu/drm/i915/intel_hdcp.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c index 4b2821feb4b4..4a3db5de229e 100644 --- a/drivers/gpu/drm/i915/intel_hdcp.c +++ b/drivers/gpu/drm/i915/intel_hdcp.c @@ -572,7 +572,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); @@ -593,17 +593,26 @@ 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++) { + if (i) + DRM_DEBUG_KMS("[%s:%d] HDCP Reauth...\n", + connector->base.name, + connector->base.base.id); + + ret = intel_hdcp_auth(conn_to_dig_port(connector), + connector->hdcp_shim); + if (!ret) + return 0; + + DRM_ERROR("[%s:%d] Failed to authenticate HDCP (%d)\n", + connector->base.name, connector->base.base.id, ret); /* Ensuring HDCP encryption and signalling are stopped. */ _intel_hdcp_disable(connector); - return ret; } - return 0; + return ret; } static void intel_hdcp_check_work(struct work_struct *work)