summaryrefslogtreecommitdiff
path: root/drivers/video/video-uclass.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-10-01 11:55:14 -0600
committerSimon Glass <sjg@chromium.org>2018-10-09 04:40:27 -0600
commit55d39911c0579b91a27f0acf3d0c1e123bb29ac1 (patch)
tree6494c7650aebd1d22ec3a0d6565f85426d4f46a4 /drivers/video/video-uclass.c
parentc3aed5db591ee38068dc2b6d73b04638bd7b7b26 (diff)
sandbox: video: Speed up video output
At present there are many situations where sandbox syncs the display to the SDL frame buffer. This is a very expensive operation but is only needed every now and then. Update video_sync() so that we can specify whether this operation is really needed. At present this flag is not used on other architectures. It could also be used for reducing writeback-cache flushes but the benefit of that would need to be investigated. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video/video-uclass.c')
-rw-r--r--drivers/video/video-uclass.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index dd0873767b..fea0886c41 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -128,7 +128,7 @@ void video_set_default_colors(struct video_priv *priv)
}
/* Flush video activity to the caches */
-void video_sync(struct udevice *vid)
+void video_sync(struct udevice *vid, bool force)
{
/*
* flush_dcache_range() is declared in common.h but it seems that some
@@ -147,7 +147,7 @@ void video_sync(struct udevice *vid)
struct video_priv *priv = dev_get_uclass_priv(vid);
static ulong last_sync;
- if (get_timer(last_sync) > 10) {
+ if (force || get_timer(last_sync) > 10) {
sandbox_sdl_sync(priv->fb);
last_sync = get_timer(0);
}
@@ -162,7 +162,7 @@ void video_sync_all(void)
dev;
uclass_find_next_device(&dev)) {
if (device_active(dev))
- video_sync(dev);
+ video_sync(dev, true);
}
}