@@ -53,6 +53,16 @@ config VIDEO_COPY
To use this, your video driver must set @copy_base in
struct video_uc_platdata.
+config VIDEO_COPY_TO_HW
+ bool "Enable copying the frame buffer to external display hardware"
+ depends on DM_VIDEO
+ help
+ Some devices have their own framebuffer memory that is not
+ shared directly with the CPU. For such devices, the framebuffer
+ must be copied to the device's own framebuffer memory, e.g. via SPI.
+ Enable this option and implement video_ops copy_fb_to_hw() to
+ support this feature.
+
config BACKLIGHT_PWM
bool "Generic PWM based Backlight Driver"
depends on BACKLIGHT && DM_PWM
@@ -196,6 +196,24 @@ void video_sync(struct udevice *vid, bool force)
last_sync = get_timer(0);
}
#endif
+ /*
+ * Some devices have their own framebuffer memory that is not
+ * shared directly with the CPU. For said devices, we need to
+ * copy U-Boot's framebuffer (priv->fb) to the device's own
+ * framebuffer memory. E.g., via SPI.
+ */
+ if (IS_ENABLED(CONFIG_VIDEO_COPY_TO_HW)) {
+ struct video_ops *ops = video_get_ops(vid);
+ int ret;
+
+ if (ops && ops->copy_fb_to_hw) {
+ ret = ops->copy_fb_to_hw(vid);
+ if (ret) {
+ dev_err(vid, "Could not copy frame buffer to hardware: %d\n",
+ ret);
+ }
+ }
+ }
}
void video_sync_all(void)
@@ -114,8 +114,14 @@ struct video_priv {
u8 bg_col_idx;
};
-/* Placeholder - there are no video operations at present */
struct video_ops {
+ /**
+ * copy_fb_to_hw() - Copy the current frame buffer to the hardware
+ *
+ * @dev: Video device
+ * @return 0 if OK, -ve on error
+ */
+ int (*copy_fb_to_hw)(struct udevice *dev);
};
#define video_get_ops(dev) ((struct video_ops *)(dev)->driver->ops)