From nobody Wed Mar 12 12:41:11 2025 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 609754DA04 for ; Mon, 30 Dec 2024 10:51:01 +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=1735555861; cv=none; b=dJEVSNhqaEWDj3R5T/aGkVmnbZVZu6a9/PHvkx/5srP5OcBhiJA0VrE9HgnUBL+/l55ctJO6tHxXEa0TD4b7udnZ7SM1xu7VTkmbXHXalvhFvW5JtIgRQfNN27k4AcAAzLDPcLdk4PBuGu+Nj+Vh5p91mNmAj15AMh5ZmQPI/II= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735555861; c=relaxed/simple; bh=SuDEzxxGQ/ta1asAIHNz3x/IkkoMDrKwg/H261/ZP48=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j6A8WhyRxgvudr2YiLkWdSWvEM8IYDf6OZWuMhq8V6nrSgCduViLBRsdhS1P4mZY+LnKP2Ef+RdYq3/8enQL/rHpqiC41McLKqh8x/qsGupBRvvKy2ctSD7hbrcJM9JMPYIixGSY8kWtI/m1+d42pb+HWd8koNe/cphl+WktIZg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UDBm/QUF; 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="UDBm/QUF" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3A387C4CEDC; 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=SuDEzxxGQ/ta1asAIHNz3x/IkkoMDrKwg/H261/ZP48=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=UDBm/QUFIjxEi2jqR8C7cp9g+dB2e3jcCccjKyHletEsILSSl7paq4TtMN3NLCCUA TxtCYUot4K82rDGwJKWS46wfYSJUWaOywLvX0G47yq4fj4ldQoXhbCeUG1f5Cm5byT D5gdAOVaAdalZYCqm6OH010Cyw0gFMsSN6CfXQ8xS1jN4dLXMJgA2cjotVUntrOGrZ rUVen6PmLVUTNVEtL8A1h0bBHn1uNcbl9noF95MiZ89VNA/KjucXN6bLbZrN5RFB5s A7IhwszRxOasVyrEWwtsdpkn85rmNVvUz72RL7yuCVDshj2Vxy+fjnfNV1spS1a3s7 aUHC+GNRwj2rA== 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 2871FE77196; Mon, 30 Dec 2024 10:51:01 +0000 (UTC) From: Hermes Wu via B4 Relay Date: Mon, 30 Dec 2024 18:51:20 +0800 Subject: [PATCH RESEND v7 02/10] drm/bridge: it6505: improve AUX operation for edid read 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: <20241230-v7-upstream-v7-2-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=1532; i=Hermes.wu@ite.corp-partner.google.com; s=20241230; h=from:subject:message-id; bh=32P1BrTFeT18E3yzyJHILz0Ri1zpfzlb6udBE3GEmSs=; b=2dZOs9x4YkiBzmjSloW0X5EYKRnmDxVT6KNWOTd0csrkFpovHUYqftrT8v6xm/Se7wUElWlMn edmRGtwPVIuDmZdQSf2TK7/QUA6xmSHVmqpZSchvaSYEzMU//pmU+Nt 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 Reply-To: Hermes.wu@ite.corp-partner.google.com From: Hermes Wu The original AUX operation using data registers is limited to 4 bytes. The AUX operation command CMD_AUX_I2C_EDID_READ uses AUX FIFO and is capable of reading 16 bytes. This improves the speed of EDID read. Reviewed-by: Dmitry Baryshkov Signed-off-by: Hermes Wu --- drivers/gpu/drm/bridge/ite-it6505.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 3272ca6951f2585f9592834869de23ac50ce41a4..9747d7ccf435d536da55c6a3ff7= 9e504b7c724f0 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -1076,10 +1076,13 @@ static ssize_t it6505_aux_do_transfer(struct it6505= *it6505, size_t size, enum aux_cmd_reply *reply) { int i, ret_size, ret =3D 0, request_size; + int fifo_max_size =3D (cmd =3D=3D CMD_AUX_I2C_EDID_READ) ? AUX_FIFO_MAX_S= IZE : 4; =20 mutex_lock(&it6505->aux_lock); - for (i =3D 0; i < size; i +=3D 4) { - request_size =3D min((int)size - i, 4); + i =3D 0; + do { + request_size =3D min_t(int, (int)size - i, fifo_max_size); + ret_size =3D it6505_aux_operation(it6505, cmd, address + i, buffer + i, request_size, reply); @@ -1088,8 +1091,9 @@ static ssize_t it6505_aux_do_transfer(struct it6505 *= it6505, goto aux_op_err; } =20 + i +=3D request_size; ret +=3D ret_size; - } + } while (i < size); =20 aux_op_err: mutex_unlock(&it6505->aux_lock); --=20 2.34.1