[PATCH 14/23] video: Add a test for 16bpp BMP files
Simon Glass
sjg at chromium.org
Fri Nov 19 21:23:58 CET 2021
Add a compressed 16bpp BMP file and a test to cover this.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
.gitattributes | 1 +
configs/sandbox_defconfig | 1 +
configs/sandbox_flattree_defconfig | 1 +
test/dm/video.c | 24 ++++++++++++++++++++++++
tools/logos/denx-16bpp.bmp.gz | Bin 0 -> 4516 bytes
5 files changed, 27 insertions(+)
create mode 100644 tools/logos/denx-16bpp.bmp.gz
diff --git a/.gitattributes b/.gitattributes
index 899473ab0fb..1879a2dfb3c 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -3,3 +3,4 @@
# Denote all files that are truly binary and should not be modified
*.bmp binary
*.ttf binary
+*.gz binary
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index c390afe9de5..5dffc704bd6 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -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
diff --git a/configs/sandbox_flattree_defconfig b/configs/sandbox_flattree_defconfig
index 7cc76bf2713..e879ca40041 100644
--- a/configs/sandbox_flattree_defconfig
+++ b/configs/sandbox_flattree_defconfig
@@ -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
diff --git a/test/dm/video.c b/test/dm/video.c
index d5648f0c59b..c496b05df76 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -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)
{
diff --git a/tools/logos/denx-16bpp.bmp.gz b/tools/logos/denx-16bpp.bmp.gz
new file mode 100644
index 0000000000000000000000000000000000000000..ed99c58192e9e1ecbd3b118823f197a484cdad34
GIT binary patch
literal 4516
zcmV;V5nJvbiwFqVVwGV412HaQZEyhPT|aE%Ocu}PRyqktuqbIxqRfVkmFq6urnmx3
zyq7X%N<xUV>Avm0R2xVlZMu)*3aTuS6iK(~HqvPmAjL-41nC-I!)HhXx{B{SjEC``
z at pue2HthVg(gy#V`T4y!@4flscfzNCEey*i<=;o;-#^uVuNJt4KY;_v at qaJDf1~oh
zg at yn8d12u%>Ywla{*Mm}4$Gq9?>_=jgvHgxi1LpO;7noB?>hTmAQMSu-mJLvyB*Um
z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