diff mbox series

[1/5] sandbox: video: Display copy framebuffer if enabled

Message ID 20230821181339.4135800-2-alpernebiyasak@gmail.com
State Under Review
Delegated to: Anatolij Gustschin
Headers show
Series sandbox: video: Refactor out of uclass, try partial screen updates | expand

Commit Message

Alper Nebi Yasak Aug. 21, 2023, 6:13 p.m. UTC
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 <alpernebiyasak@gmail.com>
---

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

Comments

Simon Glass Aug. 21, 2023, 10:10 p.m. UTC | #1
On Mon, 21 Aug 2023 at 12:13, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote:
>
> 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 <alpernebiyasak@gmail.com>
> ---
>
>  drivers/video/video-uclass.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

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