aboutsummaryrefslogtreecommitdiff
path: root/include/video.h
diff options
context:
space:
mode:
authorMichal Simek2020-12-03 09:30:00 +0100
committerMichal Simek2021-01-05 11:54:53 +0100
commit9d69c2d9a8eb27bfa2ac0ac1a0fc779f5eccb49b (patch)
tree3c4e106f7c8feb888469bf5e9b46a854d8929aae /include/video.h
parent9de731f295c5f1aa0f55f30b076b94f9cb72428e (diff)
video: Introduce video_sync operation
Some drivers like LCD connected via SPI requires explicit sync function which copy framebuffer content over SPI to controller to display. This hook doesn't exist yet that's why introduce it via video operations. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/video.h')
-rw-r--r--include/video.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/video.h b/include/video.h
index 1bfe6843a80..12fc525ab4e 100644
--- a/include/video.h
+++ b/include/video.h
@@ -114,8 +114,16 @@ struct video_priv {
u8 bg_col_idx;
};
-/* Placeholder - there are no video operations at present */
+/**
+ * struct video_ops - structure for keeping video operations
+ * @video_sync: Synchronize FB with device. Some device like SPI based LCD
+ * displays needs synchronization when data in an FB is available.
+ * For these devices implement video_sync hook to call a sync
+ * function. vid is pointer to video device udevice. Function
+ * should return 0 on success video_sync and error code otherwise
+ */
struct video_ops {
+ int (*video_sync)(struct udevice *vid);
};
#define video_get_ops(dev) ((struct video_ops *)(dev)->driver->ops)
@@ -155,7 +163,7 @@ int video_clear(struct udevice *dev);
* @force: True to force a sync even if there was one recently (this is
* very expensive on sandbox)
*
- * @return: 0 always
+ * @return: 0 on success, error code otherwise
*
* Some frame buffers are cached or have a secondary frame buffer. This
* function syncs these up so that the current contents of the U-Boot frame