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 |
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 --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
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(-)