video: Use cache-alignment in video_sync()
authorSimon Glass <sjg@chromium.org>
Sun, 13 Nov 2016 21:22:06 +0000 (14:22 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 26 Nov 2016 00:59:31 +0000 (17:59 -0700)
Sometimes the frame buffer is not a multiple of the cache line size.
Adjust the cache-flushing code to avoid cache warnings/errors in this
case.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/video/video-uclass.c

index 11ca7937dc817ed8c40c392182aa8bd38d4f5b8f..3036e3a1f25f054617bbf5852f762268bf72027e 100644 (file)
@@ -117,7 +117,8 @@ void video_sync(struct udevice *vid)
 
        if (priv->flush_dcache) {
                flush_dcache_range((ulong)priv->fb,
-                                  (ulong)priv->fb + priv->fb_size);
+                                  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);