[Concept,04/19] test: Add video_compress_fb_() with message parameter

Message ID 20260130035849.3580212-5-simon.glass@canonical.com
State New
Headers
Series Enhanced command-line editing with undo/redo support |

Commit Message

Simon Glass Jan. 30, 2026, 3:58 a.m. UTC
  Add video_compress_fb_() which takes an additional msg parameter to
describe the frame being checked. This helps with debugging when a
frame check fails.

The existing video_compress_fb() becomes a wrapper that passes NULL
for the message.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 test/dm/video.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
  

Patch

diff --git a/test/dm/video.c b/test/dm/video.c
index b7aa835c86a..421d50df064 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -138,8 +138,8 @@  static int video_write_bmp(struct unit_test_state *uts, struct udevice *dev,
 	return ret;
 }
 
-int video_compress_fb(struct unit_test_state *uts, struct udevice *dev,
-		      bool use_copy)
+static int video_compress_fb_(struct unit_test_state *uts, struct udevice *dev,
+			      bool use_copy, const char *msg)
 {
 	struct sandbox_state *state = state_get_current();
 	struct video_priv *priv = dev_get_uclass_priv(dev);
@@ -184,6 +184,12 @@  int video_compress_fb(struct unit_test_state *uts, struct udevice *dev,
 	return destlen;
 }
 
+int video_compress_fb(struct unit_test_state *uts, struct udevice *dev,
+		      bool use_copy)
+{
+	return video_compress_fb_(uts, dev, use_copy, NULL);
+}
+
 int video_check_copy_fb(struct unit_test_state *uts, struct udevice *dev)
 {
 	struct video_priv *priv = dev_get_uclass_priv(dev);