diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-02 21:12:23 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-07-09 12:33:24 +0800 |
commit | 8c0b5d268d36b0d152bad343503e74056617ab43 (patch) | |
tree | b903c03928c2edd7f57c320f33b5dc25993236ef /drivers | |
parent | 138dfea86ff2b7eda936043b2acc734a1425aeaa (diff) | |
download | u-boot-8c0b5d268d36b0d152bad343503e74056617ab43.tar.gz u-boot-8c0b5d268d36b0d152bad343503e74056617ab43.tar.bz2 u-boot-8c0b5d268d36b0d152bad343503e74056617ab43.zip |
video: Add helpers for vidconsole for the copy framebuffer
Add a convenience function to call video_sync_copy() for a vidconsole.
Also add a memmove() helper, which does the memmove() as well as the sync.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 841cfdaf93..3a07f36ce2 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -629,6 +629,22 @@ UCLASS_DRIVER(vidconsole) = { .per_device_auto_alloc_size = sizeof(struct vidconsole_priv), }; +#ifdef CONFIG_VIDEO_COPY +int vidconsole_sync_copy(struct udevice *dev, void *from, void *to) +{ + struct udevice *vid = dev_get_parent(dev); + + return video_sync_copy(vid, from, to); +} + +int vidconsole_memmove(struct udevice *dev, void *dst, const void *src, + int size) +{ + memmove(dst, src, size); + return vidconsole_sync_copy(dev, dst, dst + size); +} +#endif + #if CONFIG_IS_ENABLED(CMD_VIDCONSOLE) void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row) { |