From nobody Thu Nov 14 16:59:12 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 47FE8BA38 for ; Mon, 5 Feb 2024 05:51:34 +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=1707112299; cv=none; b=ozVBUynNJbz+3amHEpCjEJI+OmoDDtrM8HATbI7DO5wwHdPFiNwuHFCxxu80LSn4LMFnD7QU0qPhkSIvc5jpWMPuc5NdHDi0TNTL0k9fpxhPJu7mtyMC+oB0IcxE8RXJLvxXAtzT1pfatBX/KniKevptkNq3tnGng78IRGWAIF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707112299; c=relaxed/simple; bh=LLGW4b/FjrKTRsBfHpncB63lndsuLXDmYjaseu/Ll+E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Q1BVzW7cqnLnOzsxQboef3RyOx0TIc5nANi+MM/oFMEs9JgQ8REMo3U4GJNTXe2JVw8ZFhWfg1qqBjNAYoRrpM20htAmMZRZl4eWOro80NFvPdkMyirzgCtrBlAOpdTohb2JuTHfAVtsRXqhgeTIukwI+zU0bLv80itjtiezfDE= 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=F0hjBsHo; 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="F0hjBsHo" X-UUID: 9a7c235ec3ea11eea2298b7352fd921d-20240205 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=cjwr8OfJxt9ACbx2ozd/vhd/QTWHF6m3uMddm4JGxwA=; b=F0hjBsHoJ91V5nOZru/slYLnUtN1+TbNGaRlQTsjPkGgDJAdKizOwwxWFv+px5GyfC6mNYfFc54DYvhA4hXexr1cwShXQEBi1ki2S7pu4IhX/uM+v9zx2fY8q7rmK5TZawycOvFZy33Te82zm1OXKDFx4X3edvItrka7hVQU0Q8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:16af0c50-c95a-4e74-9336-99f2de17cbb4,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:6f543d0,CLOUDID:04af84fe-c16b-4159-a099-3b9d0558e447,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 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULS X-UUID: 9a7c235ec3ea11eea2298b7352fd921d-20240205 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 42553156; Mon, 05 Feb 2024 13:51:27 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 5 Feb 2024 13:51:26 +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; Mon, 5 Feb 2024 13:51:26 +0800 From: mac.shen To: , , , , , , CC: , , , , , Subject: [PATCH v2 2/3] Subject: [PATCH] drm/mediatek/dp: Add HDCP2.x feature for DisplayPort Date: Mon, 5 Feb 2024 13:50:37 +0800 Message-ID: <20240205055055.25340-3-mac.shen@mediatek.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205055055.25340-1-mac.shen@mediatek.com> References: <20240205055055.25340-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--12.052400-8.000000 X-TMASE-MatchedRID: Ko/xPG+Qbtdocr5vRHCIakKcYi5Qw/RVFJFr2qlKix8UHVz/b87KIwc3 Uc04WCqQ3aflduQTdlKCwyR78G3yDd4bgXBxaoBL0Xw0ILvo/uUpWss5kPUFdMlgi/vLS272hCY Q0GRRnBOQZeD+o76AoTVj2AJAih8uNlBChwzdMMzTnRs9f/DkZp4Q/QN0mu6WNSweOixQAJKZAn qxTGmm4sP5Lp773ebNnL5zsA3xXh0WmnbffcYqJISvKOGqLLPKWDdWpJMntKhC7LJNP9sKquxgV 4GaRi5cytLZ8XDer2b1keySn5FFP7gcZtzF8Se3Yx1jPJKy+DxT4DtiSkMnWCp9nOAnLazCvkES pfBKzZR35pRAWpykN/OWMixYHwEQo27xiIuUglDhuXUWQoMQt+szMj2s3tqva0TOsL14A2lK0FA stcpT0oY0L6KZX8LSDVS4QmWw8VT1s8eCOeeiYKwxbZnudyr7GSqdEmeD/nW/wPtA9baOj2+3ct xX3zZNgs6uuv8OgBhvXoisElHfiHnkqK+DiFA+nu1HSadECDWagpdUd+Iwz2ecrqZc3vabUXVyd uKWVxC4/9wU9VR9Orw+nvdymavdiMEMY19woczUWdZik3yrYdspPGnf5a0gRaXolgMyx3FXXXTX sOyc4qOKAoYvxV6O2dUSZLK2MOy7sY7IeJaO+LdQIb8hCnY+LAnNohUyMa2nMzRhUWarpty6nSG CIrVTBi0hgQDrPd/m07dxH4adm1pgJVkXDtuh9Ib/6w+1lWSJ7IEVMTX5x6hGNiAliV44o8WMkQ Wv6iX7ev9h4HyIA1cppCzPq+1Uymsk/wUE4hoD/dHyT/Xh7Q== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--12.052400-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 356CDC7B5E6F71D0DBF110D907440BB9C662829359FA9C0A0110922FBF210CEE2000:8 X-MTK: N Content-Type: text/plain; charset="utf-8" Add HDCP2.x feature for DisplayPort. When userspace request the kernel protect future content communicated over the link with Content_Protection property, the feature will do HDCP2.x authentication if the sink support HDCP2.X. Changes in v2: - remove switch case, and refine code to make more clear - remove some definitions, and use the definitions in include/drm/drm_hdcp.h - use the struct which defined in include/drm/drm_hdcp.h - do HDCP2.x authentication when userspace request the kernel protect future content communicated per suggestion from the previous thread: https://lore.kernel.org/all/8fff59b5567449d8201dd1138c8fa 9218a545c46.camel@mediatek.com/ Signed-off-by: mac.shen --- drivers/gpu/drm/mediatek/Makefile | 1 + drivers/gpu/drm/mediatek/mtk_dp.c | 297 +++++-- drivers/gpu/drm/mediatek/mtk_dp.h | 99 +++ drivers/gpu/drm/mediatek/mtk_dp_hdcp2.c | 1021 +++++++++++++++++++++++ drivers/gpu/drm/mediatek/mtk_dp_hdcp2.h | 52 ++ drivers/gpu/drm/mediatek/mtk_dp_reg.h | 4 +- drivers/gpu/drm/mediatek/mtk_dpi.c | 3 + 7 files changed, 1392 insertions(+), 85 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 c80e6c2f9336..50ea069b047e 100644 --- a/drivers/gpu/drm/mediatek/Makefile +++ b/drivers/gpu/drm/mediatek/Makefile @@ -27,6 +27,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 e4c16ba9902d..7ff72f15528b 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