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: 13691004 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6277CC25B76 for ; Sat, 8 Jun 2024 12:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gHxUY7w7XjpGw8WfXBlzEPf1bIqs8byUdA4MFVjjOKw=; b=bFxEpw/qDCU3r0Y55qaMcbE2l9 tkUIMzsv0qqhz4p3cW8KX8DRlqjCeFnhZe/MZKerQmRP3A1Of39wQ7DS4m2w0ecCaV4JPT2SRecYR pkQuIoOIhxmbkA9lG0LBFVo5Xgsc6ommexasrvZG9cqXY80m9v99Jd7jh8jEzcg99QcJzPyujdetH baTkwTlti4BtA3yc/SGGKLgYACiXpMkAPEJe0s7SBlvuOjaQO9uvaPTTK2fS89FZdFybI+RKqA4bE zSAVupRyEzJ289A5u5VtqUl92Q6TQuq1UKkSpG68Hak19vExbOhJll/8/PnuJGNwYeyfjTQqFvVW4 MIJGTb2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFv5i-0000000HOX4-3tbL; Sat, 08 Jun 2024 12:22:38 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFv5d-0000000HOVF-37Vn; Sat, 08 Jun 2024 12:22:37 +0000 X-UUID: c594af6c259111efba8bfb22b0451c12-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:acb7c3b5-42dc-4258-ba73-763961ff5130,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:a909c493-e2c0-40b0-a8fe-7c7e47299109,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: c594af6c259111efba8bfb22b0451c12-20240608 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 627090456; Sat, 08 Jun 2024 05:22:28 -0700 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240608_052233_834204_2BDF690F X-CRM114-Status: GOOD ( 27.67 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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