/* Flush video activity to the caches */
int video_sync(struct udevice *vid, bool force)
{
+ struct video_ops *ops = video_get_ops(vid);
+ int ret;
+
+ if (ops && ops->video_sync) {
+ ret = ops->video_sync(vid);
+ if (ret)
+ return ret;
+ }
+
/*
* flush_dcache_range() is declared in common.h but it seems that some
* architectures do not actually implement it. Is there a way to find
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)
* @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