From patchwork Fri Mar 8 17:00:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 10845175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFD4117E9 for ; Fri, 8 Mar 2019 16:58:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B0682DFB9 for ; Fri, 8 Mar 2019 16:58:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F9372DFCB; Fri, 8 Mar 2019 16:58:20 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 3B00E2DFB9 for ; Fri, 8 Mar 2019 16:58:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 432126E403; Fri, 8 Mar 2019 16:58:19 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A1E46E3F5 for ; Fri, 8 Mar 2019 16:58:17 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2019 08:58:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,456,1544515200"; d="scan'208";a="132694456" Received: from dut-ram.iind.intel.com ([10.223.34.157]) by fmsmga007.fm.intel.com with ESMTP; 08 Mar 2019 08:58:15 -0800 From: Ramalingam C To: intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, maarten.lankhorst@linux.intel.com Date: Fri, 8 Mar 2019 22:30:08 +0530 Message-Id: <20190308170008.10450-9-ramalingam.c@intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190308170008.10450-1-ramalingam.c@intel.com> References: <20190308170008.10450-1-ramalingam.c@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 8/8] drm/i915: Populate downstream info for HDCP2.2 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Populates the downstream info for HDCP2.2 encryption also. On success of encryption Blob is updated. Additional two variable are added to downstream info blob. Such as ver_in_force and content type. v2: s/cp_downstream/content_protection_downstream [daniel] Signed-off-by: Ramalingam C --- drivers/gpu/drm/i915/intel_hdcp.c | 30 +++++++++++++++++++++++++++++- include/uapi/drm/drm_mode.h | 3 +++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c index 777f40202a15..3350b37375db 100644 --- a/drivers/gpu/drm/i915/intel_hdcp.c +++ b/drivers/gpu/drm/i915/intel_hdcp.c @@ -1283,6 +1283,12 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector) return -EPERM; } + hdcp->downstream_info->ver_in_force = DRM_MODE_HDCP22_IN_FORCE; + hdcp->downstream_info->content_type = hdcp->content_type; + memcpy(hdcp->downstream_info->bksv, msgs.send_cert.cert_rx.receiver_id, + HDCP_2_2_RECEIVER_ID_LEN); + hdcp->downstream_info->is_repeater = hdcp->is_repeater; + /* * Here msgs.no_stored_km will hold msgs corresponding to the km * stored also. @@ -1474,6 +1480,11 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector) return -EPERM; } + hdcp->downstream_info->device_count = device_cnt; + hdcp->downstream_info->depth = HDCP_2_2_DEPTH(rx_info[0]); + memcpy(hdcp->downstream_info->ksv_list, msgs.recvid_list.receiver_ids, + device_cnt * HDCP_2_2_RECEIVER_ID_LEN); + ret = hdcp2_verify_rep_topology_prepare_ack(connector, &msgs.recvid_list, &msgs.rep_ack); @@ -1660,6 +1671,13 @@ static int _intel_hdcp2_enable(struct intel_connector *connector) if (ret) { DRM_DEBUG_KMS("HDCP2 Type%d Enabling Failed. (%d)\n", hdcp->content_type, ret); + + memset(hdcp->downstream_info, 0, + sizeof(struct content_protection_downstream_info)); + drm_connector_update_content_protection_downstream_property( + &connector->base, + hdcp->downstream_info); + return ret; } @@ -1667,12 +1685,17 @@ static int _intel_hdcp2_enable(struct intel_connector *connector) connector->base.name, connector->base.base.id, hdcp->content_type); + drm_connector_update_content_protection_downstream_property( + &connector->base, + hdcp->downstream_info); hdcp->hdcp2_encrypted = true; + return 0; } static int _intel_hdcp2_disable(struct intel_connector *connector) { + struct intel_hdcp *hdcp = &connector->hdcp; int ret; DRM_DEBUG_KMS("[%s:%d] HDCP2.2 is being Disabled\n", @@ -1683,8 +1706,13 @@ static int _intel_hdcp2_disable(struct intel_connector *connector) if (hdcp2_deauthenticate_port(connector) < 0) DRM_DEBUG_KMS("Port deauth failed.\n"); - connector->hdcp.hdcp2_encrypted = false; + hdcp->hdcp2_encrypted = false; + memset(hdcp->downstream_info, 0, + sizeof(struct content_protection_downstream_info)); + drm_connector_update_content_protection_downstream_property( + &connector->base, + hdcp->downstream_info); return ret; } diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 3973d35c3b57..dc81713d3a07 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -223,6 +223,9 @@ struct content_protection_downstream_info { /* Version of HDCP authenticated (1.4/2.2) */ __u32 ver_in_force; + /* Applicable only for HDCP2.2 */ + __u8 content_type; + /* KSV of immediate HDCP Sink. In Little-Endian Format. */ char bksv[DRM_MODE_HDCP_KSV_LEN];