From nobody Sun Nov 24 18:59:30 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 1E95C18DF7E for ; Mon, 4 Nov 2024 06:44:06 +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=1730702647; cv=none; b=f/OGVnYuNCLqx+xetZ7VdBRxNQDXu5qLrYH4RqbTS6cHIRJnOw6zMtMch299WSK95MxqkuJkLKRM0KQkgBuqWUVcq6ylGg1sC6eaDocsiUkzoEe9ej+8DwDG8ZalImFBK6FbWBkw0jGyNfKrn4gLf5XJM//+IzGx1FPui6pkBbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730702647; c=relaxed/simple; bh=jR2JMfJCmR1wfBbhPP6zy7q7nwwmkUtFCoBy/b3loG4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XtKIM8PESbNmHYdZWV/GzA/ldobna8nk4VEiQXdCIHjf590cdxecs/KTq553LWIgtBJCB95ZNylpZ8+T4rlqyZn2r2FV70hV9I5fl8+y+1io+uT4pGPk+3K9iBeFrN/uuoWbDtEmw4A73xf4EFcNm957AGGdnZwXhnWrelHK3ws= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LAxt+jjM; 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="LAxt+jjM" Received: by smtp.kernel.org (Postfix) with ESMTPS id BD61BC4CED0; 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=1730702646; bh=jR2JMfJCmR1wfBbhPP6zy7q7nwwmkUtFCoBy/b3loG4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=LAxt+jjMikIm0hjB2DMyT/e9Qatz9+6LfDQgpnsUkpqFqpRbF4wlaPvjGFcgObqgD JicTEqiREt/lqgsl7V3kO9UCDtxcw9lgs8Mtl4yW8GYmzCIRla3QoCHrTw4fZpEPxn NHYfwQxYdkYizQhvj5viqJi/FIA551BsWr0/FVEFT/FkTyqWiyxAACYpiwXZWpyUmA PUaLhk2OW8XOOr3PoemVm1ZQ8ye0LAo/XPQ4BZnkcSuZIPY5VDHXnKotsmw0JSHD7h QXSMjTnvW2xJaRbrEvUEbPn3WAK4k4r+v0U6GJUbDwPqnblrJXYwc032r/CdcfmbVq 6JLR4IefUpY7A== 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 B292ED11185; Mon, 4 Nov 2024 06:44:06 +0000 (UTC) From: Hermes Wu via B4 Relay Date: Mon, 04 Nov 2024 14:43:36 +0800 Subject: [PATCH v7 06/10] drm/bridge: it6505: fix HDCP encryption when R0 ready 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-6-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 X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1730702658; l=1834; i=Hermes.wu@ite.com.tw; s=20241101; h=from:subject:message-id; bh=sT+HSufURG0ocwd8z5VQGG+kfKlsP8Ww3M5fRH8xXGg=; b=ZH6GYOr4kWn6zBGSHNeEApWJNxLdCuWluDe6uyqVd5OS9UDU2RlwMhZlzDsDCsmX6NfbfD+AZ mhH6cmGfcj8A/7Lo3a/T5eNdGSomVkv5qthhXuOzahJu4aAyyc8MWmg 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 starting HDCP authentication, HDCP encryption should be enabled when R0'is checked. Change encryption enables time at R0' ready. The hardware HDCP engine trigger is changed and the repeater KSV fails will restart HDCP. Signed-off-by: Hermes Wu --- drivers/gpu/drm/bridge/ite-it6505.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 760eab0b868874f96ccd4d5ec3e2f2d4ffb1e41c..614fbb6295237708aa5b692de87= ab5548c499da5 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2092,15 +2092,12 @@ static void it6505_hdcp_wait_ksv_list(struct work_s= truct *work) ksv_list_check =3D it6505_hdcp_part2_ksvlist_check(it6505); DRM_DEV_DEBUG_DRIVER(dev, "ksv list ready, ksv list check %s", ksv_list_check ? "pass" : "fail"); - if (ksv_list_check) { - it6505_set_bits(it6505, REG_HDCP_TRIGGER, - HDCP_TRIGGER_KSV_DONE, HDCP_TRIGGER_KSV_DONE); + + if (ksv_list_check) return; - } + timeout: - it6505_set_bits(it6505, REG_HDCP_TRIGGER, - HDCP_TRIGGER_KSV_DONE | HDCP_TRIGGER_KSV_FAIL, - HDCP_TRIGGER_KSV_DONE | HDCP_TRIGGER_KSV_FAIL); + it6505_start_hdcp(it6505); } =20 static void it6505_hdcp_work(struct work_struct *work) @@ -2473,7 +2470,11 @@ static void it6505_irq_hdcp_ksv_check(struct it6505 = *it6505) { struct device *dev =3D it6505->dev; =20 - DRM_DEV_DEBUG_DRIVER(dev, "HDCP event Interrupt"); + DRM_DEV_DEBUG_DRIVER(dev, "HDCP repeater R0 event Interrupt"); + /* 1B01 HDCP encription should start when R0 is ready*/ + it6505_set_bits(it6505, REG_HDCP_TRIGGER, + HDCP_TRIGGER_KSV_DONE, HDCP_TRIGGER_KSV_DONE); + schedule_work(&it6505->hdcp_wait_ksv_list); } =20 --=20 2.34.1