From nobody Thu Nov 14 16:54:24 2024 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9B3212E6A for ; Sat, 8 Jun 2024 12:02:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717848160; cv=none; b=IQn1HHneCnAftthAqP/eVyOLP+X3sRhHDyIzXzoZUb+KKzZ7DvAt2QOIqSbagx8+qG8EGueu3Jj29RJKSPACMrYxmffwRaX48Zemqm/L8MfstQsBG84RjIiAs3ZTNXj2s7H1IwUZ+7KDvNdS/iWG7m6GgGoT6asdiKUXkIneQq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717848160; c=relaxed/simple; bh=8xTy1eRhKC+4PWG4zaMSQ67CXpcrR6+ez6rMfu5FmD8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qDQvK+yQKuuKz/hwXj9o841AfDM7X08v/onqLTWoHs1ku/lLyegDCjgjGlxnOTRdVztTJDQESRfeP5IaGNo99K2aytkBG3D0cKqw7F24wkO5x9G3dhIbNKWj9Af+qwJt/48tZHa8wlnxjE3yI7P1Lm2V4Ne6zLnCqghD8yfCtDs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=SUMdcLVQ; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="SUMdcLVQ" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Content-Type: text/plain; charset="utf-8" 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/M= akefile index f27ddfbd2e12..19b7625ae573 100644 --- a/drivers/gpu/drm/mediatek/Makefile +++ b/drivers/gpu/drm/mediatek/Makefile @@ -28,6 +28,7 @@ mediatek-drm-hdmi-objs :=3D mtk_cec.o \ obj-$(CONFIG_DRM_MEDIATEK_HDMI) +=3D mediatek-drm-hdmi.o =20 mtk-dp-objs :=3D tlc_dp_hdcp.o \ + mtk_dp_hdcp2.o \ mtk_dp.o =20 obj-$(CONFIG_DRM_MEDIATEK_DP) +=3D mtk-dp.o diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/m= tk_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 */ =20 @@ -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