[PATCH 1/1] video: show 'physical' frame buffer on sandbox
Simon Glass
sjg at chromium.org
Mon May 4 15:00:14 CEST 2026
Hi Heinrich,
On 2026-05-01T15:16:12, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
> video: show 'physical' frame buffer on sandbox
>
> We allow using double buffering for video. This can be accomplished by
> cyclic copies or we may copy 'damaged' areas.
>
> To inspect the output we must inspect the target frame buffer that models
> the physical frame buffer on the sandbox.
>
> If double buffering is active, priv->copy_fb is a pointer to the target
> frame buffer.
>
> Fixes: 5c8dddadf1c9 ("video: Use cyclic to handle video sync")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
>
> drivers/video/video-uclass.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
> @@ -516,8 +516,7 @@ int video_sync(struct udevice *vid, bool force)
> video_flush_dcache(vid, true);
>
> #if defined(CONFIG_VIDEO_SANDBOX_SDL)
> - /* to see the copy framebuffer, use priv->copy_fb */
> - sandbox_sdl_sync(priv->fb);
> + sandbox_sdl_sync(priv->copy_fb ? priv->copy_fb : priv->fb);
> #endif
> priv->last_sync = get_timer(0);
The change matches what real hardware would display.
The Fixes: tag is misleading though. Commit 5c8dddadf1c9 only added
the cyclic timer; displaying priv->fb predates it by years, going back
to the introduction of the uclass, well before copy_fb existed in
2020. Please can you drop the Fixes: line or point it at the commit
that made this observable?
Also please update the stale comment in dm_test_video_copy() - it
tells the reader to manually edit video_sync() to call
sandbox_sdl_sync(priv->copy_fb), which is exactly what this patch
makes the default.
One more thing: video_flush_copy() only updates damaged regions, so on
a force sync with no damage we display whatever copy_fb last held. I
think that's fine because priv->fb hasn't changed either, but please
can you confirm?
Reviewed-by: Simon Glass <sjg at chromium.org>
Regards,
Simon
More information about the U-Boot
mailing list