When VIDEO_COPY is enabled, the "main" framebuffer is a cached work area
in U-Boot allocated memory and the "copy" framebuffer is the hardware
frame buffer displayed on the screen. The sandbox SDL video driver sets
copy_base to indicate support for this, but it displays the work area
instead. Change it to display the copy buffer if enabled.

Signed-off-by: Alper Nebi Yasak <alpernebiya...@gmail.com>
---

 drivers/video/video-uclass.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 3f9ddaadd15d..7cec6362570f 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -454,9 +454,13 @@ int video_sync(struct udevice *vid, bool force)
 
 #if defined(CONFIG_VIDEO_SANDBOX_SDL)
        static ulong last_sync;
+       void *fb = priv->fb;
+
+       if (IS_ENABLED(CONFIG_VIDEO_COPY))
+               fb = priv->copy_fb;
 
        if (force || get_timer(last_sync) > 100) {
-               sandbox_sdl_sync(priv->fb);
+               sandbox_sdl_sync(fb);
                last_sync = get_timer(0);
        }
 #endif
-- 
2.40.1

Reply via email to