diff options
author | Simon Glass <sjg@chromium.org> | 2021-11-19 23:23:55 +0300 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2021-12-27 01:02:19 +0300 |
commit | 646e169aa0e6e699aa9aa861a0b2ad6705031cba (patch) | |
tree | a6060d5f75c6ea536646d1d18a956caa5df7c8af /test/dm/video.c | |
parent | 51f92c143019de3ad719d8ee7bcab8c1d9d87d1c (diff) | |
download | u-boot-646e169aa0e6e699aa9aa861a0b2ad6705031cba.tar.xz |
video: bmp: Update RLE8 support to use the write function
Update this code to use write_pix8() rather than writing the pixels only
for a single supported display depth. This allows us to support any
depth.
Add some more tests too.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm/video.c')
-rw-r--r-- | test/dm/video.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/dm/video.c b/test/dm/video.c index c8c6668c8b..d5648f0c59 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -373,6 +373,44 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts) } DM_TEST(dm_test_video_bmp_comp, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +/* Test drawing a bitmap file on a 32bpp display */ +static int dm_test_video_comp_bmp32(struct unit_test_state *uts) +{ + struct udevice *dev; + ulong addr; + + ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev)); + ut_assertnonnull(dev); + ut_assertok(sandbox_sdl_set_bpp(dev, VIDEO_BPP32)); + + ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr)); + + ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); + ut_asserteq(2024, compress_frame_buffer(uts, dev)); + + return 0; +} +DM_TEST(dm_test_video_comp_bmp32, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + +/* Test drawing a bitmap file on a 8bpp display */ +static int dm_test_video_comp_bmp8(struct unit_test_state *uts) +{ + struct udevice *dev; + ulong addr; + + ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev)); + ut_assertnonnull(dev); + ut_assertok(sandbox_sdl_set_bpp(dev, VIDEO_BPP8)); + + ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr)); + + ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); + ut_asserteq(1247, compress_frame_buffer(uts, dev)); + + return 0; +} +DM_TEST(dm_test_video_comp_bmp8, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + /* Test TrueType console */ static int dm_test_video_truetype(struct unit_test_state *uts) { |