From mboxrd@z Thu Jan 1 00:00:00 1970 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 7E141F46133 for ; Mon, 23 Mar 2026 14:46:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3450C10E0E9; Mon, 23 Mar 2026 14:46:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="XGXw6bGz"; dkim-atps=neutral Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2597210E0E9 for ; Mon, 23 Mar 2026 14:45:58 +0000 (UTC) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 07B37C58080; Mon, 23 Mar 2026 14:46:23 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2CEDA5FEF6; Mon, 23 Mar 2026 14:45:56 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AAFE710450FAD; Mon, 23 Mar 2026 15:45:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1774277155; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=hri96SuB77jiWr3UFZP86U99znuPw1ej9p0gWyICjbo=; b=XGXw6bGzT9jTrLW9KC92ug23Um7dVft8m+FAKx6qdo/dW5v79QonOvHaOPx0yX42at+Lj+ d6qOuUfsqUmHwEZP5UDqHuwm2P2qA1ApHTy97BKTOJez/XKkwyGQAX95Aybzw1Z9ry5JSf J/7TvVzUfeLhKGvU8p4rVT9EAjwDW7LDQ9Co6LkxoOXsj3zjA899Vldsl9a9CDbPUmc2pH g6gN5gswBPZ7IYLqLOiPWJBJ1eKtKUuSnJ2TBKdC0yJvl0fBpNOJbsSpSry8vGYUB6eVv9 kZ5WQChO+xt+g/PpwZPOe12GIpiE73bYmn0nhnvqr9S1BQ/afnxlG9QSfrBeQQ== Message-ID: Date: Mon, 23 Mar 2026 15:46:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH i-g-t v9 29/49] lib/unigraf: Add helpers to read and write edid To: Kory Maincent Cc: igt-dev@lists.freedesktop.org, thomas.petazzoni@bootlin.com, luca.ceresoli@bootlin.com, markyacoub@google.com, khaled.almahallawy@intel.com References: <20260316-unigraf-integration-v9-0-a01dffc3b0cb@bootlin.com> <20260316-unigraf-integration-v9-29-a01dffc3b0cb@bootlin.com> <20260317163221.42ca4019@kmaincent-XPS-13-7390> From: Louis Chauvet Content-Language: en-US In-Reply-To: <20260317163221.42ca4019@kmaincent-XPS-13-7390> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" On 3/17/26 16:32, Kory Maincent wrote: > On Mon, 16 Mar 2026 17:17:50 +0100 > Louis Chauvet wrote: > >> Read and writing EDID on unigraf can be useful to emulate different >> screens, add helpers to read and write them. >> >> There is a limitation on the libTSI.so, it is only possible to read EDID >> using buffers of size multiple of 128 bytes, and there is no way to query >> the actual EDID size. The current implementation can only read EDID up to >> 2048 bytes. >> >> Signed-off-by: Louis Chauvet >> Reviewed-by: Luca Ceresoli >> --- >> lib/unigraf/unigraf.c | 59 >> +++++++++++++++++++++++++++++++++++++++++++++++++++ lib/unigraf/unigraf.h | >> 4 ++++ 2 files changed, 63 insertions(+) >> >> diff --git a/lib/unigraf/unigraf.c b/lib/unigraf/unigraf.c >> index b752ff573ace..d06da6742e95 100644 >> --- a/lib/unigraf/unigraf.c >> +++ b/lib/unigraf/unigraf.c >> @@ -56,6 +56,11 @@ static char *unigraf_connector_name; >> */ >> #define UNIGRAF_DEFAULT_INPUT_NAME "DP RX" >> >> +/** >> + * EDID_MAX_SIZE - Max EDID size that can be read from the unigraf. The >> + */ > > The ? Missing a sentence? > >> +#define EDID_MAX_SIZE 2048 >> + >> static void unigraf_close_device(void) >> { >> if (!unigraf_device) >> @@ -127,6 +132,20 @@ static void unigraf_init(void) >> value; >> \ }) >> > > ... > >> + >> +/** >> + * unigraf_write_edid() - Write EDID data to the specified stream >> + * @stream: The stream ID to write the EDID to >> + * @edid: Pointer to the EDID structure to write >> + * @edid_size: Size of the EDID data in bytes >> + * >> + * This function writes the provided EDID data to the specified stream. >> + */ >> +void unigraf_write_edid(uint32_t stream, const struct edid *edid, uint32_t >> edid_size) +{ > > edid_size not used in the function. True, I added a min(edid_size, EDID_MAX_SIZE) to avoid out of bound accesses. >> + unigraf_debug("Write EDID for stream %d...\n", stream); >> + >> + unigraf_write_u32(TSI_EDID_SELECT_STREAM, stream); >> + unigraf_write(TSI_EDID_TE_INPUT, edid, 2048); > > Use EDID_MAX_SIZE here or the edid_size parameter? Thanks! > Regards,