aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-07-31 08:44:09 -0600
committerAnatolij Gustschin <agust@denx.de>2024-07-31 16:52:51 +0200
commitb023948e4f839c612e57ea68b21cb40c96874c12 (patch)
treef1e96aa789650990c08ed60c44680c99c4d461c2 /drivers/video
parent8ada14b4d9dcdf9d0efa902d80f40b7d3e7b678d (diff)
downloadu-boot-b023948e4f839c612e57ea68b21cb40c96874c12.zip
u-boot-b023948e4f839c612e57ea68b21cb40c96874c12.tar.gz
u-boot-b023948e4f839c612e57ea68b21cb40c96874c12.tar.bz2
video: Move last_sync to private data
Rather than using a static variable, use the video device's private data to remember when the last video sync was completed. This allows each display to have its own sync and avoids using static data in SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/video-uclass.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index ff1382f..a95b5f1 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -349,6 +349,7 @@ void video_set_default_colors(struct udevice *dev, bool invert)
/* Flush video activity to the caches */
int video_sync(struct udevice *vid, bool force)
{
+ struct video_priv *priv = dev_get_uclass_priv(vid);
struct video_ops *ops = video_get_ops(vid);
int ret;
@@ -364,20 +365,15 @@ int video_sync(struct udevice *vid, bool force)
* out whether it exists? For now, ARM is safe.
*/
#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
- struct video_priv *priv = dev_get_uclass_priv(vid);
-
if (priv->flush_dcache) {
flush_dcache_range((ulong)priv->fb,
ALIGN((ulong)priv->fb + priv->fb_size,
CONFIG_SYS_CACHELINE_SIZE));
}
#elif defined(CONFIG_VIDEO_SANDBOX_SDL)
- struct video_priv *priv = dev_get_uclass_priv(vid);
- static ulong last_sync;
-
- if (force || get_timer(last_sync) > 100) {
+ if (force || get_timer(priv->last_sync) > 100) {
sandbox_sdl_sync(priv->fb);
- last_sync = get_timer(0);
+ priv->last_sync = get_timer(0);
}
#endif
return 0;