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 7088BFED3F1 for ; Fri, 24 Apr 2026 16:56:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25B508961D; Fri, 24 Apr 2026 16:56:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="wepIUkK4"; dkim-atps=neutral Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 512048961D for ; Fri, 24 Apr 2026 16:55:02 +0000 (UTC) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 459C01A3402 for ; Fri, 24 Apr 2026 16:55:01 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 16AE1604EB; Fri, 24 Apr 2026 16:55:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A878410720A31; Fri, 24 Apr 2026 18:54:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777049700; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ny5n9VtElbPy19NxhT28Wjh0N+BODK+nk44/MXIkfEU=; b=wepIUkK469EU1FF3d7RmPjvz5wxS+gNDMmNvU4WvHfs87yywYtdjLGCRbAwkY/h5JGnJu6 Wh53Ux5C9BDRjpkIsUox+yQaIsSsBeUXXEEGtbJttNqeK/V17rDR4WGG5rI9/0NbuPmUmz CobZIFeuColR6FyqpZrs/fayygle/M44uWEIHEMkjfXJTf67UcA8mUbWi9WgT3/rJ7AnM5 JMIIjvc11XZp/gItSTxE4VAUB1YE9MkA2sd5mH5WPMBlLcDj5Mwbs0hB9UiZuZVZ+6ckeI LN77jqWqCHKxAsChC4MLlB2Acf0uo+7d3ZYgm22qh2X5HZqDCzp+5wy/FleOLQ== From: Louis Chauvet Date: Fri, 24 Apr 2026 18:53:08 +0200 Subject: [PATCH i-g-t v11 33/49] lib/unigraf: Add configuration for CRC usage MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260424-unigraf-integration-v11-33-0c5f5346ae60@bootlin.com> References: <20260424-unigraf-integration-v11-0-0c5f5346ae60@bootlin.com> In-Reply-To: <20260424-unigraf-integration-v11-0-0c5f5346ae60@bootlin.com> To: igt-dev@lists.freedesktop.org Cc: thomas.petazzoni@bootlin.com, luca.ceresoli@bootlin.com, kory.maincent@bootlin.com, markyacoub@google.com, khaled.almahallawy@intel.com, Louis Chauvet X-Mailer: b4 0.16-dev 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" As Unigraf devices are able to compute a CRC for the input image, add a configuration file option to use them. Reviewed-by: Kory Maincent Signed-off-by: Louis Chauvet --- lib/vendor/unigraf/unigraf.c | 25 +++++++++++++++++++++++++ lib/vendor/unigraf/unigraf.h | 2 ++ 2 files changed, 27 insertions(+) diff --git a/lib/vendor/unigraf/unigraf.c b/lib/vendor/unigraf/unigraf.c index e7e643abbb98..e51495674f10 100644 --- a/lib/vendor/unigraf/unigraf.c +++ b/lib/vendor/unigraf/unigraf.c @@ -26,6 +26,7 @@ static TSI_HANDLE unigraf_device; static char *unigraf_default_edid; static char *unigraf_connector_name; +static bool unigraf_crc; /** * UNIGRAF_NAME_MAX - Maximum name length to be used for TSI functions @@ -62,6 +63,11 @@ static char *unigraf_connector_name; */ #define UNIGRAF_CONFIG_EDID_NAME "EDID" +/** + * UNIGRAF_CONFIG_USE_CRC_NAME - Key of the CRC selection in the configuration file + */ +#define UNIGRAF_CONFIG_USE_CRC_NAME "UseCRC" + /** * UNIGRAF_DEFAULT_ROLE_NAME - Default role name to search on the unigraf device */ @@ -367,6 +373,14 @@ bool unigraf_open_device(int drm_fd) unigraf_debug("No default EDID set, use IGT default.\n"); cfg_edid_name = NULL; } + + cfg_error = NULL; + unigraf_crc = g_key_file_get_boolean(igt_key_file, UNIGRAF_CONFIG_GROUP, + UNIGRAF_CONFIG_USE_CRC_NAME, &cfg_error); + if (cfg_error) { + unigraf_debug("CRC usage not configured, using unigraf CRC.\n"); + unigraf_crc = true; + } } unigraf_assert(TSIX_DEV_RescanDevices(0, TSI_DEVCAP_VIDEO_CAPTURE, 0)); @@ -686,3 +700,14 @@ void unigraf_read_crc(int stream, igt_crc_t *out) out->n_words = 3; out->has_valid_frame = false; } + +/** + * unigraf_use_crc() - Check if Unigraf device should be used for CRC computation + * + * Returns: true if the Unigraf device should be used for CRC computation, + * false otherwise. + */ +bool unigraf_use_crc(void) +{ + return unigraf_crc; +} diff --git a/lib/vendor/unigraf/unigraf.h b/lib/vendor/unigraf/unigraf.h index 67fb44db107b..34bdf15ed04b 100644 --- a/lib/vendor/unigraf/unigraf.h +++ b/lib/vendor/unigraf/unigraf.h @@ -75,4 +75,6 @@ void unigraf_select_stream(int stream); void unigraf_read_crc(int stream, igt_crc_t *out); +bool unigraf_use_crc(void); + #endif // UNIGRAF_H -- 2.54.0