video: Add a test for 16bpp BMP files

Add a compressed 16bpp BMP file and a test to cover this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2021-11-19 13:23:58 -07:00 committed by Anatolij Gustschin
parent f5aa93eb53
commit c1cad06f69
5 changed files with 27 additions and 0 deletions

1
.gitattributes vendored
View File

@ -3,3 +3,4 @@
# Denote all files that are truly binary and should not be modified # Denote all files that are truly binary and should not be modified
*.bmp binary *.bmp binary
*.ttf binary *.ttf binary
*.gz binary

View File

@ -285,6 +285,7 @@ CONFIG_OSD=y
CONFIG_SANDBOX_OSD=y CONFIG_SANDBOX_OSD=y
CONFIG_SPLASH_SCREEN_ALIGN=y CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_VIDEO_BMP_RLE8=y CONFIG_VIDEO_BMP_RLE8=y
CONFIG_BMP_16BPP=y
CONFIG_W1=y CONFIG_W1=y
CONFIG_W1_GPIO=y CONFIG_W1_GPIO=y
CONFIG_W1_EEPROM=y CONFIG_W1_EEPROM=y

View File

@ -198,6 +198,7 @@ CONFIG_VIDEO_SANDBOX_SDL=y
CONFIG_OSD=y CONFIG_OSD=y
CONFIG_SANDBOX_OSD=y CONFIG_SANDBOX_OSD=y
CONFIG_VIDEO_BMP_RLE8=y CONFIG_VIDEO_BMP_RLE8=y
CONFIG_BMP_16BPP=y
CONFIG_CMD_DHRYSTONE=y CONFIG_CMD_DHRYSTONE=y
CONFIG_RSA_VERIFY_WITH_PKEY=y CONFIG_RSA_VERIFY_WITH_PKEY=y
CONFIG_TPM=y CONFIG_TPM=y

View File

@ -7,6 +7,7 @@
#include <common.h> #include <common.h>
#include <bzlib.h> #include <bzlib.h>
#include <dm.h> #include <dm.h>
#include <gzip.h>
#include <log.h> #include <log.h>
#include <malloc.h> #include <malloc.h>
#include <mapmem.h> #include <mapmem.h>
@ -339,6 +340,29 @@ static int dm_test_video_bmp8(struct unit_test_state *uts)
} }
DM_TEST(dm_test_video_bmp8, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); DM_TEST(dm_test_video_bmp8, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
/* Test drawing a bitmap file on a 16bpp display */
static int dm_test_video_bmp16(struct unit_test_state *uts)
{
ulong src, src_len = ~0UL;
uint dst_len = ~0U;
struct udevice *dev;
ulong dst = 0x10000;
ut_assertok(uclass_find_first_device(UCLASS_VIDEO, &dev));
ut_assertnonnull(dev);
ut_assertok(sandbox_sdl_set_bpp(dev, VIDEO_BPP16));
ut_assertok(read_file(uts, "tools/logos/denx-16bpp.bmp.gz", &src));
ut_assertok(gunzip(map_sysmem(dst, 0), dst_len, map_sysmem(src, 0),
&src_len));
ut_assertok(video_bmp_display(dev, dst, 0, 0, false));
ut_asserteq(3700, compress_frame_buffer(uts, dev));
return 0;
}
DM_TEST(dm_test_video_bmp16, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
/* Test drawing a bitmap file on a 32bpp display */ /* Test drawing a bitmap file on a 32bpp display */
static int dm_test_video_bmp32(struct unit_test_state *uts) static int dm_test_video_bmp32(struct unit_test_state *uts)
{ {

Binary file not shown.