From patchwork Mon Dec 30 10:51:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hermes Wu via B4 Relay X-Patchwork-Id: 13923225 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 D5A2CE77194 for ; Mon, 30 Dec 2024 10:51:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3988C10E494; Mon, 30 Dec 2024 10:51:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Drtol7ya"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C1D810E494 for ; Mon, 30 Dec 2024 10:51:03 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 88AED5C5964; Mon, 30 Dec 2024 10:50:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 73F92C4CEE3; Mon, 30 Dec 2024 10:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735555861; bh=O5YKofAFuVF+x8OXZQSiNKkX3T3r8k4gh/EML2qF2tM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Drtol7yaWUNirKwKz/4qJbc0BlDcqfEXdHKqnI8uexNT9VX92E+LKxR2554w4AZQ7 m2HUMzC8vok+JP+Us4ObhR6dqI0hxMzvE4jIZB4wTyMQFi59fBcfRM/FLcZTjYyRbn WEkUxl1LI1NC8XNbwy7rYDPXiGE8B/DhwKiaV3k12GNoeca0vqyUO5W5WOVtLXiD12 kpHVUURxs0OkEPn5+R/fu0Ntevl/8n2xUw2gBkBpKUUA/Q7XVCFOHOy2EuNaQWcl94 Kd65nfA05ZQf1cX4kAqoKZfEfa1zrC0SGR3w8mzp7GkeLNij2FyA1s1EtZMD4VgNxX AVmDaukNXjzUA== 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 6AD2CE77188; Mon, 30 Dec 2024 10:51:01 +0000 (UTC) From: Hermes Wu via B4 Relay Date: Mon, 30 Dec 2024 18:51:23 +0800 Subject: [PATCH RESEND v7 05/10] drm/bridge: it6505: fix HDCP Bstatus check MIME-Version: 1.0 Message-Id: <20241230-v7-upstream-v7-5-e0fdd4844703@ite.corp-partner.google.com> References: <20241230-v7-upstream-v7-0-e0fdd4844703@ite.corp-partner.google.com> In-Reply-To: <20241230-v7-upstream-v7-0-e0fdd4844703@ite.corp-partner.google.com> 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 , Allen Chen 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=1735555881; l=1572; i=Hermes.wu@ite.corp-partner.google.com; s=20241230; h=from:subject:message-id; bh=rnu9ObSyBuaI0l/D8L5MOJqyYmO7JqMRz5DsnO06FUA=; b=bpIuIa3ffw40lUivVrVQOGwJfOl6bRbz9LKO/9WnOhoZR0BggQheerjjYivd3rgzDPZDQcprh TvhEtzOGUiSD4tLAsd6KWUg/Aep0phtI+AJQN9CG8eF1NqNr2eggIba X-Developer-Key: i=Hermes.wu@ite.corp-partner.google.com; a=ed25519; pk=qho5Dawp2WWj9CGyjtJ6/Y10xH8odjRdS6SXDaDAerU= X-Endpoint-Received: by B4 Relay for Hermes.wu@ite.corp-partner.google.com/20241230 with auth_id=307 X-Original-From: Hermes Wu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Hermes.wu@ite.corp-partner.google.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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/ite-it6505.c index 9a90a36d0421422038b04ad00b2cb2e326a9cab4..760eab0b868874f96ccd4d5ec3e2f2d4ffb1e41c 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 *it6505) DRM_DEV_DEBUG_DRIVER(dev, "dp_irq_vector = 0x%02x", dp_irq_vector); if (dp_irq_vector & DP_CP_IRQ) { - it6505_set_bits(it6505, REG_HDCP_TRIGGER, HDCP_TRIGGER_CPIRQ, - HDCP_TRIGGER_CPIRQ); - bstatus = it6505_dpcd_read(it6505, DP_AUX_HDCP_BSTATUS); if (bstatus < 0) return bstatus; DRM_DEV_DEBUG_DRIVER(dev, "Bstatus = 0x%02x", bstatus); + + /*Check BSTATUS when recive CP_IRQ */ + if (bstatus & DP_BSTATUS_R0_PRIME_READY && + it6505->hdcp_status == 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 == HDCP_AUTH_DONE) + it6505_start_hdcp(it6505); } ret = drm_dp_dpcd_read_link_status(&it6505->aux, link_status);