diff options
| author | Alexander Graf <[email protected]> | 2022-06-10 00:59:21 +0200 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2025-05-01 04:32:45 -0600 |
| commit | 70dfd674782adb47a641288925484d6edc8df963 (patch) | |
| tree | b724faa2e63804c31a98e8b6fac815650d963b90 /include | |
| parent | 4aaa19bd181adf9556b31c3dcd66635ae6594c70 (diff) | |
video: Use VIDEO_DAMAGE for VIDEO_COPY
CONFIG_VIDEO_COPY implemented a range-based copying mechanism: If we
print a single character, it will always copy the full range of bytes
from the top left corner of the character to the lower right onto the
uncached frame buffer. This includes pretty much the full line contents
of the printed character.
Since we now have proper damage tracking, let's make use of that to reduce
the amount of data we need to copy. With this patch applied, we will only
copy the tiny rectangle surrounding characters when we print them,
speeding up the video console.
After this, changes to the main frame buffer are not immediately copied
to the copy frame buffer, but postponed until the next video device
sync. So issue an explicit sync before inspecting the copy frame buffer
contents for the video tests.
Signed-off-by: Alexander Graf <[email protected]>
[Alper: Rebase for fontdata->height/w, fill_part(), fix memmove(dev),
drop from defconfig, use damage.xstart/yend, use IS_ENABLED(),
call video_sync() before copy_fb check, update video_copy test]
Co-developed-by: Alper Nebi Yasak <[email protected]>
Signed-off-by: Alper Nebi Yasak <[email protected]>
Link: https://lore.kernel.org/u-boot/[email protected]/
Diffstat (limited to 'include')
| -rw-r--r-- | include/video.h | 37 | ||||
| -rw-r--r-- | include/video_console.h | 52 |
2 files changed, 0 insertions, 89 deletions
diff --git a/include/video.h b/include/video.h index 7eed112e00c..2fe2f73a865 100644 --- a/include/video.h +++ b/include/video.h @@ -355,43 +355,6 @@ void video_set_default_colors(struct udevice *dev, bool invert); */ int video_default_font_height(struct udevice *dev); -#ifdef CONFIG_VIDEO_COPY -/** - * vidconsole_sync_copy() - Sync back to the copy framebuffer - * - * This ensures that the copy framebuffer has the same data as the framebuffer - * for a particular region. It should be called after the framebuffer is updated - * - * @from and @to can be in either order. The region between them is synced. - * - * @dev: Vidconsole device being updated - * @from: Start/end address within the framebuffer (->fb) - * @to: Other address within the frame buffer - * Return: 0 if OK, -EFAULT if the start address is before the start of the - * 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 - #ifdef CONFIG_VIDEO_DAMAGE /** * video_damage() - Notify the video subsystem about screen updates. diff --git a/include/video_console.h b/include/video_console.h index 723d2315606..13197fa4518 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -537,56 +537,4 @@ void vidconsole_list_fonts(struct udevice *dev); */ int vidconsole_get_font_size(struct udevice *dev, const char **name, uint *sizep); -#ifdef CONFIG_VIDEO_COPY -/** - * vidconsole_sync_copy() - Sync back to the copy framebuffer - * - * This ensures that the copy framebuffer has the same data as the framebuffer - * for a particular region. It should be called after the framebuffer is updated - * - * @from and @to can be in either order. The region between them is synced. - * - * @dev: Vidconsole device being updated - * @from: Start/end address within the framebuffer (->fb) - * @to: Other address within the frame buffer - * Return: 0 if OK, -EFAULT if the start address is before the start of the - * frame buffer start - */ -int vidconsole_sync_copy(struct udevice *dev, void *from, void *to); - -/** - * vidconsole_memmove() - Perform a memmove() within the frame buffer - * - * This handles a memmove(), e.g. for scrolling. It also updates the copy - * framebuffer. - * - * @dev: Vidconsole device being updated - * @dst: Destination address within the framebuffer (->fb) - * @src: Source address within the framebuffer (->fb) - * @size: Number of bytes to transfer - * Return: 0 if OK, -EFAULT if the start address is before the start of the - * frame buffer start - */ -int vidconsole_memmove(struct udevice *dev, void *dst, const void *src, - int size); -#else - -#include <string.h> - -static inline int vidconsole_sync_copy(struct udevice *dev, void *from, - void *to) -{ - return 0; -} - -static inline int vidconsole_memmove(struct udevice *dev, void *dst, - const void *src, int size) -{ - memmove(dst, src, size); - - return 0; -} - -#endif - #endif |
