From patchwork Sat Jun 8 12:01:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "mac.shen" X-Patchwork-Id: 13690998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4F0BC27C55 for ; Sat, 8 Jun 2024 12:02:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A36F10E0AC; Sat, 8 Jun 2024 12:02:34 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.b="SUMdcLVQ"; dkim-atps=neutral Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by gabe.freedesktop.org (Postfix) with ESMTPS id 32AF910E0BB for ; Sat, 8 Jun 2024 12:02:31 +0000 (UTC) X-UUID: f8d8311c258e11efa22eafcdcd04c131-20240608 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=gHxUY7w7XjpGw8WfXBlzEPf1bIqs8byUdA4MFVjjOKw=; b=SUMdcLVQqFY/t0T2Ia3W8EDKyoKgl1qg2aT35aXSlJlPGipjcRIEuLoYMYwm1ZZRejPt3115h2DgAxssMKO2DwNjtDb+TDMiwiURlJtsfKjjFYUYr5RdtIpuSSC/w+4wzEk2QJJU2r5fD7AO91a9EeGLoxGydNpUL8EnKzcGpwc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.39, REQID:10b53ba5-5461-4ab8-8f34-2731c6dd4478, IP:0, U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:393d96e, CLOUDID:1c7a5a44-4544-4d06-b2b2-d7e12813c598, B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULS X-UUID: f8d8311c258e11efa22eafcdcd04c131-20240608 Received: from mtkmbs09n2.mediatek.inc [(172.21.101.94)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1704320246; Sat, 08 Jun 2024 20:02:26 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Sat, 8 Jun 2024 20:02:24 +0800 Received: from mszsdhlt06.gcn.mediatek.inc (10.16.6.206) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Sat, 8 Jun 2024 20:02:23 +0800 From: mac.shen To: , , , , , , CC: , , , , , Subject: [PATCH v3 2/3] Subject: [PATCH] drm/mediatek/dp: Add HDCP2.x feature for DisplayPort Date: Sat, 8 Jun 2024 20:01:05 +0800 Message-ID: <20240608120219.21817-3-mac.shen@mediatek.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240608120219.21817-1-mac.shen@mediatek.com> References: <20240608120219.21817-1-mac.shen@mediatek.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--10.106600-8.000000 X-TMASE-MatchedRID: 7R7QocYGEysWk4/JZEVmwKOuVibdZNTvYQXxsZnRwoLO4ab65oVF2gBK GkW9znn56wjmyLa4MnSuVX99ICt6jpGPu1bK5ReTQ4srjeRbxTYraL2mh8ZVK+9Jtzyqge7Rvqn FtM6Nq/LwceN4v+p3z1WP8q4Dl63brbh5lywtukPXjUxnR1jUv6I0K26z6c86QUH1IMnQjZ9t4N HjBkiJIjfu8tBJWIkoPY+YkUBT2QzyTBeqcpWTVktzk37SzX4NSoCG4sefl8QUtdRZTmEaIRGP1 j/yNFUfghg6xqCjCHp07/QbLesPz6h+3Rlbev+JutvHF25zoU8Ruzt37P1zyx8weqfEhZ8RF2Hv 56robVTSdb0s+X82A9dpu+Np5N2N+qv/OX+8yfGsMW2Z7ncq+3nUZqRb3abmYdpcZH3BrBQRYxU cMJg2/HV+7QlJxn96Rt2+11CFEFIIcnJSFQlGhZ7tR0mnRAg15Y0kb0hqatxzeKCaw73ZgSc/xZ Yu98DIsF6NUfzrSAHYr7YV5QS6foBoGyFs+F1MogGd8wIUGIKpPPWKXS4CO3aMP8m6qk6S0O+nJ S4tIxV7p4L8DqSI9YNp9Vx47nIMWU/fB/XFmJyXIjSc2qlF9S7te75+XjKBzUFc4X2GObIzHkxH pTxbSmDNz9L0bHNAsPAy0Qg+1LmlTHNxJDwdpMpQKjU7fBXVMVx/3ZYby7/IvQIyugvKdU2pDx/ jTtOx6vSMekXwnnIrhiHB4yo8IjcpdZ3fQiLdFEUknJ/kEl6tIWznhjjBtfoLR4+zsDTtEU1sg5 GpXeU= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--10.106600-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 4091508EF741208265B666373FB4909ACDB3CB0AED341AD535569B33382A0E1C2000:8 X-MTK: N X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Changes in v3: - refine the function to get system time - refine the flow to do HDCP with content type and protection value which set by user space - refine the flow to update content protection - refine the flow to do HDCP2.x authentication per suggestion from the previous thread: https://patchwork.kernel.org/project/linux-mediatek /patch/20240205055055.25340-3-mac.shen@mediatek.com/ Signed-off-by: mac.shen --- drivers/gpu/drm/mediatek/Makefile | 1 + drivers/gpu/drm/mediatek/mtk_dp.c | 321 +++++--- drivers/gpu/drm/mediatek/mtk_dp.h | 103 +++ drivers/gpu/drm/mediatek/mtk_dp_hdcp2.c | 944 ++++++++++++++++++++++++ drivers/gpu/drm/mediatek/mtk_dp_hdcp2.h | 25 + drivers/gpu/drm/mediatek/mtk_dp_reg.h | 8 +- drivers/gpu/drm/mediatek/mtk_dpi.c | 3 + 7 files changed, 1321 insertions(+), 84 deletions(-) create mode 100644 drivers/gpu/drm/mediatek/mtk_dp.h create mode 100644 drivers/gpu/drm/mediatek/mtk_dp_hdcp2.c create mode 100644 drivers/gpu/drm/mediatek/mtk_dp_hdcp2.h diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek/Makefile index f27ddfbd2e12..19b7625ae573 100644 --- a/drivers/gpu/drm/mediatek/Makefile +++ b/drivers/gpu/drm/mediatek/Makefile @@ -28,6 +28,7 @@ mediatek-drm-hdmi-objs := mtk_cec.o \ obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mediatek-drm-hdmi.o mtk-dp-objs := tlc_dp_hdcp.o \ + mtk_dp_hdcp2.o \ mtk_dp.o obj-$(CONFIG_DRM_MEDIATEK_DP) += mtk-dp.o diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 536366956447..12854a04622f 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright (c) 2019-2022 MediaTek Inc. + * Copyright (c) 2019-2024 MediaTek Inc. * Copyright (c) 2022 BayLibre */ @@ -8,13 +8,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include #include #include #include @@ -30,10 +30,10 @@ #include #include #include -#include -#include