From nobody Sun Nov 24 19:57:25 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1A8BC192B65 for ; Mon, 4 Nov 2024 06:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730702648; cv=none; b=e9Uf6y5iQuRO/i9dqdh0l7yI+wfVxu6cBetOeCL17x9VHng21Gfwl4HSyoBD6BhTZ8BFa96c8y9m+eCDAibl3MV4rKO7niyoBbZTnAkblHpA+GAjQqBVqsVNBrPypV3GWEkDo3NgUvzlOajcPOVsvdmGyyEELpFIf+SSUzdV/iw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730702648; c=relaxed/simple; bh=O5YKofAFuVF+x8OXZQSiNKkX3T3r8k4gh/EML2qF2tM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bdW7GOStPFVp0OxECVmIc+Q1+dsXc8KesEshJ1aFl9QBQjDxvx+xeXeUJSXa3EM1W27qIBeiDzvzSjo8YSai0pDQqLwNzFY0VsRPQ2DUGXr++KTBdHlbGkhowhdMdfPwnfvThEkuj440tGlnVTpKLs6c7sa4YsPKTM2NbSsHsTw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NSFXhfW1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NSFXhfW1" Received: by smtp.kernel.org (Postfix) with ESMTPS id A8BF0C4CED0; Mon, 4 Nov 2024 06:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730702647; bh=O5YKofAFuVF+x8OXZQSiNKkX3T3r8k4gh/EML2qF2tM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=NSFXhfW1N3OXH8zXMWrIa+5aUgeTjrcTy1z6yHPdLhS2RiEdDdxsAAb47Bx2CCRT9 2t0IeFPbYOdLAmXyo6KKrZAu6M5fAcP45oThKhA9b8I7Ct+AcHNoC2a+JHFHEIZLO9 wyqlW3tvSormXJ2N3OXAETgrCKWOy8g547edRabniFLwXM3BCSuQ2BkN5cIXH5w+PB gm/nvKMBfx02x/d0EGZOBC0HPxTQ3AIMQL3mO/265gTmb1Mngv6lr1g0oWdB9nbJpU JC4NaJi2uji9vRC32vLvyetRQKFzWXf6FKpkMZOk8EILc9gSr18Fn/qsqFEqrmCJDm Jm2+GK01E3e2g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E5B2D111B0; Mon, 4 Nov 2024 06:44:06 +0000 (UTC) From: Hermes Wu via B4 Relay Date: Mon, 04 Nov 2024 14:43:35 +0800 Subject: [PATCH v7 05/10] drm/bridge: it6505: fix HDCP Bstatus check Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241104-v7-upstream-v7-5-8b71fd0f1d2d@ite.com.tw> References: <20241104-v7-upstream-v7-0-8b71fd0f1d2d@ite.com.tw> In-Reply-To: <20241104-v7-upstream-v7-0-8b71fd0f1d2d@ite.com.tw> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , AngeloGioacchino Del Regno , Hermes Wu Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Pin-yen Lin , Kenneth Hung , Pet Weng , Hermes Wu , Dmitry Baryshkov X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1730702658; l=1572; i=Hermes.wu@ite.com.tw; s=20241101; h=from:subject:message-id; bh=rnu9ObSyBuaI0l/D8L5MOJqyYmO7JqMRz5DsnO06FUA=; b=C/uXvsj0MrjbvoKC8toRcltBDTz9x/TPWWQjr1q+eFOMvG6C0z9DHyvDOPRmPFzCkygCco2x0 SZzTAThliZeA7E8XyFk/QUX8pQTAA5n9F8V0PNuJp+s1DRDZc/iu4J+ X-Developer-Key: i=Hermes.wu@ite.com.tw; a=ed25519; pk=FOYYbsP2Nlw6mjB3rLFYSLmAiENzj4AWQly5XTcDuMM= X-Endpoint-Received: by B4 Relay for Hermes.wu@ite.com.tw/20241101 with auth_id=268 X-Original-From: Hermes Wu Reply-To: Hermes.wu@ite.com.tw From: Hermes Wu When HDCP is activated, a DisplayPort source receiving CP_IRQ from the sink shall check Bstatus from DPCD and process the corresponding value Reviewed-by: Dmitry Baryshkov Signed-off-by: Hermes Wu --- drivers/gpu/drm/bridge/ite-it6505.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 9a90a36d0421422038b04ad00b2cb2e326a9cab4..760eab0b868874f96ccd4d5ec3e= 2f2d4ffb1e41c 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2323,14 +2323,20 @@ static int it6505_process_hpd_irq(struct it6505 *it= 6505) DRM_DEV_DEBUG_DRIVER(dev, "dp_irq_vector =3D 0x%02x", dp_irq_vector); =20 if (dp_irq_vector & DP_CP_IRQ) { - it6505_set_bits(it6505, REG_HDCP_TRIGGER, HDCP_TRIGGER_CPIRQ, - HDCP_TRIGGER_CPIRQ); - bstatus =3D it6505_dpcd_read(it6505, DP_AUX_HDCP_BSTATUS); if (bstatus < 0) return bstatus; =20 DRM_DEV_DEBUG_DRIVER(dev, "Bstatus =3D 0x%02x", bstatus); + + /*Check BSTATUS when recive CP_IRQ */ + if (bstatus & DP_BSTATUS_R0_PRIME_READY && + it6505->hdcp_status =3D=3D HDCP_AUTH_GOING) + it6505_set_bits(it6505, REG_HDCP_TRIGGER, HDCP_TRIGGER_CPIRQ, + HDCP_TRIGGER_CPIRQ); + else if (bstatus & (DP_BSTATUS_REAUTH_REQ | DP_BSTATUS_LINK_FAILURE) && + it6505->hdcp_status =3D=3D HDCP_AUTH_DONE) + it6505_start_hdcp(it6505); } =20 ret =3D drm_dp_dpcd_read_link_status(&it6505->aux, link_status); --=20 2.34.1