From nobody Sun Nov 24 19:56:14 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 D0A6D18D633 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=1730702646; cv=none; b=FZozFxsnsv6lfttZraHZ4J++HXFmmeBxnq+nYPSftfhqfVabod5qta2tWPg2xQOeCjwgjreWs97eTBdFbdxo4iU5ALQrRVWGSPl/QXD8KEIN0kcJOJKHnPbkTpb1ajmWWGWLyzlAAU+xE1XW8SobAzDP7FJvj9wFVqFt94UTOkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730702646; 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=T7/KCW4MI2xVJoBlQ2T0l9zgyJ+ErG77KnmG2SEtPoX3/W/3s3ylml3ujUW3atu+DKr4QKCnY9/ZRtOaxSrEJTdG0hxnvXKAFOx7rOxVzWcfodrbn5xvH7hl45r1PHxMMVVlNC5urp60CQ+LDHYprgg6SctLgBSsMo7jrauB9Fc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LK9ZT56h; 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="LK9ZT56h" Received: by smtp.kernel.org (Postfix) with ESMTPS id 6016DC4AF09; 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=SuDEzxxGQ/ta1asAIHNz3x/IkkoMDrKwg/H261/ZP48=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=LK9ZT56hg8TncXc1GQZ/Ks5gEIfvy+KOH47qs1ktMVjcySWgr+dqkIHe7hg1MUhj2 uU55cFE18m5Q4tttbyZszu04b4+wheFJ8CH/5T+oenk7Te2jDvugAtnLhHJj2p0Bof L+0NkIw9lp59wZmOgIgg26BJ486FFaDCY1Aekc3JEkub7EMEhWr8qnqSuM6Yg+VxRL lFtPdrO9ZROz0jXxQEp5OT5TzItugFU9Wi0pswlmew0CwNBINq5YDS5hy/WN627DIa 8CJT1O6Ijsl2x7gtagZo3JZiMjEkQJWxTPBoCyeMykCOMaf/Yv5QZyfCN//EY0FGFs fOh+6cuYUIysw== 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 4D8E7D11185; Mon, 4 Nov 2024 06:44:06 +0000 (UTC) From: Hermes Wu via B4 Relay Date: Mon, 04 Nov 2024 14:43:32 +0800 Subject: [PATCH 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: <20241104-v7-upstream-v7-2-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 , Dmitry Baryshkov X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1730702658; l=1532; i=Hermes.wu@ite.com.tw; s=20241101; h=from:subject:message-id; bh=32P1BrTFeT18E3yzyJHILz0Ri1zpfzlb6udBE3GEmSs=; b=jAs4ALalPFcT/no3nP40m25b5d4wCMZzy9ChzrGptppyfoD/zleahHwKaciyvSguICLiNee66 CacZdXxGEfmA1sLto+u5wJqWVQ1m7IwfxlxbzcRJXLAO7j8jXEfUYg2 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 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