[PATCH 06/17] video: Allow syncing the entire framebuffer to the copy

Simon Glass sjg at chromium.org
Thu Jan 14 04:29:46 CET 2021


In some cases so much of the framebuffer is updated that it is not worth
copying the changes piece by piece to the copy framebuffer. Add a function
to copy the whole thing.

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

 drivers/video/video-uclass.c | 10 ++++++++++
 include/video.h              | 14 ++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 8883e290357..8a832aef01a 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -275,6 +275,16 @@ int video_sync_copy(struct udevice *dev, void *from, void *to)
 
 	return 0;
 }
+
+int video_sync_copy_all(struct udevice *dev)
+{
+	struct video_priv *priv = dev_get_uclass_priv(dev);
+
+	video_sync_copy(dev, priv->fb, priv->fb + priv->fb_size);
+
+	return 0;
+}
+
 #endif
 
 /* Set up the colour map */
diff --git a/include/video.h b/include/video.h
index 7b7f62a8277..a63dbbd7df9 100644
--- a/include/video.h
+++ b/include/video.h
@@ -236,11 +236,25 @@ void video_set_default_colors(struct udevice *dev, bool invert);
  *	frame buffer start
  */
 int video_sync_copy(struct udevice *dev, void *from, void *to);
+
+/**
+ * video_sync_copy_all() - Sync the entire framebuffer to the copy
+ *
+ * @dev: Vidconsole device being updated
+ * @return 0 (always)
+ */
+int video_sync_copy_all(struct udevice *dev);
 #else
 static inline int video_sync_copy(struct udevice *dev, void *from, void *to)
 {
 	return 0;
 }
+
+static inline int video_sync_copy_all(struct udevice *dev)
+{
+	return 0;
+}
+
 #endif
 
 #ifndef CONFIG_DM_VIDEO
-- 
2.30.0.284.gd98b1dd5eaa7-goog



More information about the U-Boot mailing list