summaryrefslogtreecommitdiff
path: root/include/test
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-04-02 06:29:41 +1300
committerTom Rini <[email protected]>2025-05-02 13:40:25 -0600
commit7320a2cb9439c8bab3b8612ec37406cad5bb646c (patch)
tree8c63b9d26a2f6594978d84c6ed778242cfa43094 /include/test
parent8301239ad05b7b786e96c6a982c92ed06a4944c6 (diff)
test: video: Export the video-checking functions
We want to check the display contents in expo tests, so move the two needed functions to a new header file. Rename them to have a video_ prefix. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include/test')
-rw-r--r--include/test/video.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/test/video.h b/include/test/video.h
new file mode 100644
index 00000000000..000fd708c86
--- /dev/null
+++ b/include/test/video.h
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2013 Google, Inc.
+ */
+
+#ifndef __TEST_VIDEO_H
+#define __TEST_VIDEO_H
+
+#include <stdbool.h>
+
+struct udevice;
+struct unit_test_state;
+
+/**
+ * video_compress_fb() - Compress the frame buffer and return its size
+ *
+ * We want to write tests which perform operations on the video console and
+ * check that the frame buffer ends up with the correct contents. But it is
+ * painful to store 'known good' images for comparison with the frame
+ * buffer. As an alternative, we can compress the frame buffer and check the
+ * size of the compressed data. This provides a pretty good level of
+ * certainty and the resulting tests need only check a single value.
+ *
+ * @uts: Test state
+ * @dev: Video device
+ * @use_copy: Use copy frame buffer if available
+ * Return: compressed size of the frame buffer, or -ve on error
+ */
+int video_compress_fb(struct unit_test_state *uts, struct udevice *dev,
+ bool use_copy);
+
+/**
+ * check_copy_frame_buffer() - Compare main frame buffer to copy
+ *
+ * If the copy frame buffer is enabled, this compares it to the main
+ * frame buffer. Normally they should have the same contents after a
+ * sync.
+ *
+ * @uts: Test state
+ * @dev: Video device
+ * Return: 0, or -ve on error
+ */
+int video_check_copy_fb(struct unit_test_state *uts, struct udevice *dev);
+
+#endif