mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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 <agraf@csgraf.de> [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 <alpernebiyasak@gmail.com> Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Link: https://lore.kernel.org/u-boot/20230821135111.3558478-12-alpernebiyasak@gmail.com/
This commit is contained in:
committed by
Simon Glass
parent
4aaa19bd18
commit
70dfd67478
@@ -105,6 +105,7 @@ static int check_copy_frame_buffer(struct unit_test_state *uts,
|
||||
if (!IS_ENABLED(CONFIG_VIDEO_COPY))
|
||||
return 0;
|
||||
|
||||
video_sync(dev, false);
|
||||
ut_assertf(!memcmp(priv->fb, priv->copy_fb, priv->fb_size),
|
||||
"Copy framebuffer does not match fb");
|
||||
|
||||
@@ -700,12 +701,22 @@ static int dm_test_video_copy(struct unit_test_state *uts)
|
||||
|
||||
/*
|
||||
* We should have the full content on the main buffer, but only
|
||||
* the new content should have been copied to the copy buffer.
|
||||
* 'damage' should have been copied to the copy buffer. This consists
|
||||
* of a while rectangle with the Denx logo and four lines of text. The
|
||||
* rest of the display is black.
|
||||
*
|
||||
* An easy way to try this is by changing video_sync() to call
|
||||
* sandbox_sdl_sync(priv->copy_fb) instead of priv->fb then running the
|
||||
* unit test:
|
||||
*
|
||||
* ./u-boot -Tl
|
||||
* ut dm dm_test_video_copy
|
||||
*/
|
||||
vidconsole_put_string(con, test_string);
|
||||
vidconsole_put_string(con, test_string);
|
||||
video_sync(dev, true);
|
||||
ut_asserteq(7589, compress_frame_buffer(uts, dev, false));
|
||||
ut_asserteq(5278, compress_frame_buffer(uts, dev, true));
|
||||
ut_asserteq(7704, compress_frame_buffer(uts, dev, true));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user