[PATCH i-g-t v7 24/48] lib/unigraf: Add reset function

Louis Chauvet
2026-02-23T12:09:12Z

To have a consistent state at the beginning of tests, add a unigraf_reset
function that will restore a known state.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
---
lib/unigraf/unigraf.c | 12 ++++++++++++
lib/unigraf/unigraf.h | 2 ++
2 files changed, 14 insertions(+)

diff --git a/lib/unigraf/unigraf.c b/lib/unigraf/unigraf.c
index ec351ebbd89c..bd47cebb8480 100644
--- a/lib/unigraf/unigraf.c
+++ b/lib/unigraf/unigraf.c
@@ -267,6 +267,8 @@ bool unigraf_open_device(int drm_fd)
unigraf_assert(TSIX_VIN_Select(unigraf_device, chosen_input));
unigraf_assert(TSIX_VIN_Enable(unigraf_device, chosen_input));

+ unigraf_reset();
+
return true;
}

@@ -280,3 +282,13 @@ void unigraf_require_device(int drm_fd)
{
igt_require(unigraf_open_device(drm_fd));
}
+
+/**
+ * unigraf_reset() - Reset the Unigraf device
+ *
+ * This function performs a hardware reset of the Unigraf device, restoring it to a
+ * default state. This includes resetting all configuration parameters, stream settings,
+ * and link parameters to default values.
+ */
+void unigraf_reset(void)
+{}
diff --git a/lib/unigraf/unigraf.h b/lib/unigraf/unigraf.h
index c08ce62894c5..4c2cbd6b1aa5 100644
--- a/lib/unigraf/unigraf.h
+++ b/lib/unigraf/unigraf.h
@@ -40,4 +40,6 @@ bool unigraf_open_device(int drm_fd);

void unigraf_require_device(int drm_fd);

+void unigraf_reset(void);
+
#endif // UNIGRAF_H

--
2.52.0