[U-Boot] [PATCH 04/37] video: Add a function to control cache flushing

Simon Glass sjg at chromium.org
Thu Jan 14 16:57:47 CET 2016


Allow the cache-flushing function of a video device to be controlled.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/video/video-uclass.c | 7 +++++++
 include/video.h              | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 63d0d9d..24d537e 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -42,6 +42,13 @@
  */
 DECLARE_GLOBAL_DATA_PTR;
 
+void video_set_flush_dcache(struct udevice *dev, bool flush)
+{
+	struct video_priv *priv = dev_get_uclass_priv(dev);
+
+	priv->flush_dcache = flush;
+}
+
 static ulong alloc_fb(struct udevice *dev, ulong *addrp)
 {
 	struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
diff --git a/include/video.h b/include/video.h
index 5fd426e..5b147ba 100644
--- a/include/video.h
+++ b/include/video.h
@@ -159,6 +159,14 @@ int video_get_xsize(struct udevice *dev);
  */
 int video_get_ysize(struct udevice *dev);
 
+/**
+ * Set whether we need to flush the dcache when changing the image. This
+ * defaults to off.
+ *
+ * @param flush		non-zero to flush cache after update, 0 to skip
+ */
+void video_set_flush_dcache(struct udevice *dev, bool flush);
+
 #endif /* CONFIG_DM_VIDEO */
 
 #ifndef CONFIG_DM_VIDEO
-- 
2.6.0.rc2.230.g3dd15c0



More information about the U-Boot mailing list