Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp27224lqp; Sat, 8 Jun 2024 05:03:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvQKNJftog9P4lD9GvWoB5GWIAaNID4T32abmDKGHTEOYyZPtBT9Dpra12WczFimICiBmh/G3Nk3/trcJxAaRNhJeubCTMutcIWaRUag== X-Google-Smtp-Source: AGHT+IEvoDod9m4N+0lT0bb3EeCqpNod3Ic3yeHkLV4pmFFkei2Ay6ijr1Wdx6Uk9IdlVlJYlZ0f X-Received: by 2002:a50:d5da:0:b0:57c:61ca:eb8c with SMTP id 4fb4d7f45d1cf-57c61caec8fmr1675065a12.42.1717848197259; Sat, 08 Jun 2024 05:03:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717848197; cv=pass; d=google.com; s=arc-20160816; b=nNAyu+cFzlQSMWa9pgHgZgEN4SvbAlMtwTjplvn3J+5sSdB/3GvI0b4bPVMoCDVHai 4QJvf7sKwzd0dYLRJme9gjPLsgkrO2AHEy4mH7M/Xj2xSLaKm6cY1xgr8cK3s+aQHJyj GeIdZMmd8+UC0L0Vsj5L+l6j8fIPSQ4gnsaSN/xfeuWek8qQcGEMWaPXqsBdV5+6uEgO 5iT8HQQzeFOaJxgEpvGuOe5d7E4IaPI7h2ECyXTMP9SD/KSnLmvZS3Ml56yOxBxy/161 Wyc12R9l06fwjU0eP8Bfn4BXDovd/KslcQ+VbUnk253WovihpUIBNdyCzwiAVExIg3fu mfKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=gHxUY7w7XjpGw8WfXBlzEPf1bIqs8byUdA4MFVjjOKw=; fh=WhjuODKPx+hct0aOs2gsaA1P+XCee5Uk7PgastOwHwE=; b=QB2snMOtZL7arhWJZMKTsIf2tujXUAp2ZZn66OQ7PYokf32dHpIHyW9IjYrI/cOoYN P0C61o4KW0J4VT8cP1RiC6RLwzAamNIRbVRH071WYE6mrqmgNvsQ15ZorLHgobyngzzo YHNwCrO6fXQ7NGsbiMlTdaEoejAxY5uENi3Sm4pXwLrS0yp/Xwy837j7FtHkmxqQ6nIw 0aXw951s3S5FNmJR/qVAiuQt9iadg9q9w6y7d/OEjDtJdaqxGlhhbOFaD4rw23sN8QKD V2dJBOqiyci2vYJiInIHusRg8jdPQrSw/Pc3yBb0z4GfEnkRHAHsESlqfzTvB9hHO/O1 kJ7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=SUMdcLVQ; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-207025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae289d77si2788663a12.612.2024.06.08.05.03.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 05:03:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=SUMdcLVQ; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-207025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 66ACF1F218ED for ; Sat, 8 Jun 2024 12:03:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 136D1178CD2; Sat, 8 Jun 2024 12:02:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="SUMdcLVQ" 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 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: 8bit Content-Type: text/plain 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 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