From patchwork Wed Oct 16 07:54:17 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: 13837851 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 5E094D20684 for ; Wed, 16 Oct 2024 07:54:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B88E410E6AE; Wed, 16 Oct 2024 07:54:14 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="s6wlyl30"; 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 2143F10E6AA for ; Wed, 16 Oct 2024 07:54:14 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8BC685C5BBA; Wed, 16 Oct 2024 07:54:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id B4145C4CEDA; Wed, 16 Oct 2024 07:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729065252; bh=KPrIiUCCJvcpVV496icokuhP6hghnoZ7VLpEGBD0vAg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=s6wlyl30aTN6Sb6cBsi4iXTnSgAHhTp7FgL+Dx4+B8S8pWQmGVw5TciicJHEXZ9KP d2PilA1apRW27J0mRBLNq6GxccaOOuVJrqT+VaeLBV8bu0m1goRjcGEh7Pt+3h8UQL G9cEWfed+ElahOe+1+Kzg4TYA5Qc1u/nETUvA8QNoqL6x4p0/rMog+UA4s88Hn9KW2 Di6afsDhTUeElkn72LRuhWZfAGduw1+tCqtxu1trYxNxNnkr3t2YO5G1iVH8RawXDX 3zralsVdjOc63PlPBmkuH0XlbAvRh6ftyPvJuAzzE6gWSdlMhSlbccol1Zh+iYEuP7 jXgOYejNa6s9A== 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 ABF90D206B0; Wed, 16 Oct 2024 07:54:12 +0000 (UTC) From: Hermes Wu via B4 Relay Date: Wed, 16 Oct 2024 15:54:17 +0800 Subject: [PATCH v6 05/10] drm/bridge: it6505: fix HDCP Bstatus check MIME-Version: 1.0 Message-Id: <20241016-upstream-v6-v6-5-4d93a0c46de1@ite.com.tw> References: <20241016-upstream-v6-v6-0-4d93a0c46de1@ite.com.tw> In-Reply-To: <20241016-upstream-v6-v6-0-4d93a0c46de1@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 , Pin-yen Lin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Kenneth Hung , Pet Weng , Hermes Wu X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1729065263; l=1511; i=Hermes.wu@ite.com.tw; s=20241016; h=from:subject:message-id; bh=Hdhgn2iSLeVVknrOzDCehQJFmQa5IML+EAJRH7ql5B0=; b=KmiRnZAqgwt29C/uSmasEHlJzvn/1X8tZctI0vzUChO5ZLG8v2pd4zYAzfN1XZAiGCBhWY0zq 0wY4lvw6MsOBnsVkZLVHChV4MzV+JiRPb1y36wmMynqpZjfi8yTsBDe X-Developer-Key: i=Hermes.wu@ite.com.tw; a=ed25519; pk=kV18uQEXox+1WccdQceCbMlJKN+BBNUk3N8VsoULcQ0= X-Endpoint-Received: by B4 Relay for Hermes.wu@ite.com.tw/20241016 with auth_id=250 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.com.tw 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 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 1159725f6871e5912aa6c2660823bee67115143e..65c17e53e05f3bc2a647474cba7d9d7e737f11b8 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2322,14 +2322,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);