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:
parent
f5aa93eb53
commit
c1cad06f69
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -3,3 +3,4 @@
|
||||
# Denote all files that are truly binary and should not be modified
|
||||
*.bmp binary
|
||||
*.ttf binary
|
||||
*.gz binary
|
||||
|
@ -285,6 +285,7 @@ CONFIG_OSD=y
|
||||
CONFIG_SANDBOX_OSD=y
|
||||
CONFIG_SPLASH_SCREEN_ALIGN=y
|
||||
CONFIG_VIDEO_BMP_RLE8=y
|
||||
CONFIG_BMP_16BPP=y
|
||||
CONFIG_W1=y
|
||||
CONFIG_W1_GPIO=y
|
||||
CONFIG_W1_EEPROM=y
|
||||
|
@ -198,6 +198,7 @@ CONFIG_VIDEO_SANDBOX_SDL=y
|
||||
CONFIG_OSD=y
|
||||
CONFIG_SANDBOX_OSD=y
|
||||
CONFIG_VIDEO_BMP_RLE8=y
|
||||
CONFIG_BMP_16BPP=y
|
||||
CONFIG_CMD_DHRYSTONE=y
|
||||
CONFIG_RSA_VERIFY_WITH_PKEY=y
|
||||
CONFIG_TPM=y
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <common.h>
|
||||
#include <bzlib.h>
|
||||
#include <dm.h>
|
||||
#include <gzip.h>
|
||||
#include <log.h>
|
||||
#include <malloc.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);
|
||||
|
||||
/* 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 */
|
||||
static int dm_test_video_bmp32(struct unit_test_state *uts)
|
||||
{
|
||||
|
BIN
tools/logos/denx-16bpp.bmp.gz
Normal file
BIN
tools/logos/denx-16bpp.bmp.gz
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user