From patchwork Thu Sep 26 07:50:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hermes Wu X-Patchwork-Id: 13813002 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 6F899CCFA13 for ; Thu, 26 Sep 2024 07:50:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCD1310EAE7; Thu, 26 Sep 2024 07:50:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=ite.com.tw header.i=@ite.com.tw header.b="TNGNeQQf"; dkim-atps=neutral Received: from ironport.ite.com.tw (60-251-196-230.hinet-ip.hinet.net [60.251.196.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id AD4EE10EAE2 for ; Thu, 26 Sep 2024 07:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ite.com.tw; s=dkim; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pi+QFeWgKpk+/I68ogVRXcsOGmQVhBx1Tx/8xnU0Dqk=; b=TNGNeQQf/PP4bn1p6KTPEFs8B2JMXtPNw+qK1yNaVng3LEojF/uhJzo7 bNw8pTt7PM6lFDZGHu9MbaKY7iTzN8ddadNtxhPRBzfmsEAWgWjio2rIq TdKHa9BImIvxCJu5AxpJvFWp1+v5KiXL0VpkQ4lBQqx5syd1phdyGN4w7 HNSTFCQvxeU4k5y3Jz1Ve/vxtPIQsNsE8rddEw5FWLTI11PiAqdRM6mi8 HSHSZk44kTo27qKKF/HqWtNzWvke6EB3tA9MtJpOkNY6Ruqn3DFdZX2xU nZ7Gef74wJB94OIgL2vb7Nvol3XEjfG6Z9UCN3LmJdvYGeV02R+vcY2xO Q==; X-CSE-ConnectionGUID: qvw8ssHbTxOTe8c7N5IFpg== X-CSE-MsgGUID: mHTnMsGdS/6YJDX4IjdxpQ== Received: from unknown (HELO mse.ite.com.tw) ([192.168.35.30]) by ironport.ite.com.tw with ESMTP; 26 Sep 2024 15:50:42 +0800 Received: from tpemail1.internal.ite.com.tw (TPEMAIL1.internal.ite.com.tw [192.168.15.58]) by mse.ite.com.tw with ESMTP id 48Q7ocuP044816; Thu, 26 Sep 2024 15:50:38 +0800 (GMT-8) (envelope-from Hermes.Wu@ite.com.tw) Received: from LAPTOP-C4GM1L3U.localdomain (192.168.82.6) by TPEMAIL1.internal.ite.com.tw (192.168.15.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 26 Sep 2024 15:50:38 +0800 From: Hermes Wu To: hermes wu CC: Kenneth Hung , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Hermes Wu , Allen Chen , AngeloGioacchino Del Regno , "open list:DRM DRIVERS" , open list Subject: [PATCH v4 06/11] drm/bridge: it6505: fix HDCP Bstatus check. Date: Thu, 26 Sep 2024 15:50:15 +0800 Message-ID: <20240926075018.22328-2-Hermes.Wu@ite.com.tw> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240926075018.22328-1-Hermes.Wu@ite.com.tw> References: <20240926075018.22328-1-Hermes.Wu@ite.com.tw> MIME-Version: 1.0 X-Originating-IP: [192.168.82.6] X-ClientProxiedBy: TPEMAIL1.internal.ite.com.tw (192.168.15.58) To TPEMAIL1.internal.ite.com.tw (192.168.15.58) X-TM-SNTS-SMTP: 1E2CC0F2EB62D09B0282AE46C73472B56B4DF3E7C203867C6794392B923BEB652002:8 X-MAIL: mse.ite.com.tw 48Q7ocuP044816 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Hermes Wu When HDCP is activated, A DisplayPort source receives CP_IRQ from the sink shall check Bstatus from DPCD and process the corresponding value. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Hermes Wu Reviewed-by: Dmitry Baryshkov --- 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 5d5ce12cd054..d2ec3dfc57d6 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);