From: Dzmitry Sankouski <dsankouski@gmail.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Dzmitry Sankouski <dsankouski@gmail.com>, Simon Glass <sjg@chromium.org>
Subject: [PATCH v8 10/10] video console: add 12x22 console simple font test
Date: Tue, 7 Mar 2023 13:21:20 +0300 [thread overview]
Message-ID: <20230307102121.1925581-11-dsankouski@gmail.com> (raw)
In-Reply-To: <20230307102121.1925581-1-dsankouski@gmail.com>
Tests fonts wider than a byte.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
Changes in v8:
none
Changes in v7:
none
Changes in v6:
- rebase
- move sandbox defconfig change to separate patch
- run savedefconfig
Changes in v5:
N/A
Changes in v4:
N/A
Changes in v2:
N/A
none
test/dm/video.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/test/dm/video.c b/test/dm/video.c
index 17a33cc7af..30778157d9 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -151,6 +151,8 @@ static int dm_test_video_text(struct unit_test_state *uts)
ut_assertok(select_vidconsole(uts, "vidconsole0"));
ut_assertok(video_get_nologo(uts, &dev));
+ ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
+ ut_assertok(vidconsole_select_font(con, "8x16", 0));
ut_asserteq(46, compress_frame_buffer(uts, dev));
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
@@ -175,6 +177,42 @@ static int dm_test_video_text(struct unit_test_state *uts)
}
DM_TEST(dm_test_video_text, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+static int dm_test_video_text_12x22(struct unit_test_state *uts)
+{
+ struct udevice *dev, *con;
+ int i;
+
+#define WHITE 0xffff
+#define SCROLL_LINES 100
+
+ ut_assertok(select_vidconsole(uts, "vidconsole0"));
+ ut_assertok(video_get_nologo(uts, &dev));
+ ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
+ ut_assertok(vidconsole_select_font(con, "12x22", 0));
+ ut_asserteq(46, compress_frame_buffer(uts, dev));
+
+ ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
+ vidconsole_putc_xy(con, 0, 0, 'a');
+ ut_asserteq(89, compress_frame_buffer(uts, dev));
+
+ vidconsole_putc_xy(con, 0, 0, ' ');
+ ut_asserteq(46, compress_frame_buffer(uts, dev));
+
+ for (i = 0; i < 20; i++)
+ vidconsole_putc_xy(con, VID_TO_POS(i * 8), 0, ' ' + i);
+ ut_asserteq(363, compress_frame_buffer(uts, dev));
+
+ vidconsole_set_row(con, 0, WHITE);
+ ut_asserteq(46, compress_frame_buffer(uts, dev));
+
+ for (i = 0; i < 20; i++)
+ vidconsole_putc_xy(con, VID_TO_POS(i * 8), 0, ' ' + i);
+ ut_asserteq(363, compress_frame_buffer(uts, dev));
+
+ return 0;
+}
+DM_TEST(dm_test_video_text_12x22, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+
/* Test handling of special characters in the console */
static int dm_test_video_chars(struct unit_test_state *uts)
{
@@ -184,6 +222,7 @@ static int dm_test_video_chars(struct unit_test_state *uts)
ut_assertok(select_vidconsole(uts, "vidconsole0"));
ut_assertok(video_get_nologo(uts, &dev));
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
+ ut_assertok(vidconsole_select_font(con, "8x16", 0));
vidconsole_put_string(con, test_string);
ut_asserteq(466, compress_frame_buffer(uts, dev));
@@ -201,6 +240,7 @@ static int dm_test_video_ansi(struct unit_test_state *uts)
ut_assertok(select_vidconsole(uts, "vidconsole0"));
ut_assertok(video_get_nologo(uts, &dev));
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
+ ut_assertok(vidconsole_select_font(con, "8x16", 0));
/* reference clear: */
video_clear(con->parent);
@@ -249,6 +289,7 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot,
ut_assertok(video_get_nologo(uts, &dev));
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
+ ut_assertok(vidconsole_select_font(con, "8x16", 0));
ut_asserteq(46, compress_frame_buffer(uts, dev));
/* Check display wrap */
--
2.30.2
next prev parent reply other threads:[~2023-03-07 10:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 10:21 [PATCH v8 00/10] vidconsole: refactoring and support for wider fonts Dzmitry Sankouski
2023-03-07 10:21 ` [PATCH v8 01/10] video console: refactoring and optimization Dzmitry Sankouski
2023-03-07 10:21 ` [PATCH v8 02/10] video console: add support for fonts wider than 1 byte Dzmitry Sankouski
2023-03-07 10:21 ` [PATCH v8 03/10] video console: move 8x16 font data in named header Dzmitry Sankouski
2023-03-07 10:21 ` [PATCH v8 04/10] video console: implement multiple fonts configuration Dzmitry Sankouski
2023-03-07 15:22 ` Anatolij Gustschin
2023-03-10 8:35 ` Dzmitry Sankouski
2023-03-10 9:24 ` Anatolij Gustschin
2023-03-07 10:21 ` [PATCH v8 05/10] video console: move vidconsole_get_font_size() logic to driver ops Dzmitry Sankouski
2023-03-07 10:21 ` [PATCH v8 06/10] video console: allow font size configuration at runtime Dzmitry Sankouski
2023-03-07 10:21 ` [PATCH v8 07/10] video console: add 12x22 Sun font from linux Dzmitry Sankouski
2023-03-07 10:21 ` [PATCH v8 08/10] video console: add 16x32 Terminus " Dzmitry Sankouski
2023-03-07 10:21 ` [PATCH v8 09/10] video console: sandbox: add 12x22 font defconfigs Dzmitry Sankouski
2023-03-07 10:21 ` Dzmitry Sankouski [this message]
2023-03-10 9:26 ` [PATCH v8 00/10] vidconsole: refactoring and support for wider fonts Anatolij Gustschin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230307102121.1925581-11-dsankouski@gmail.com \
--to=dsankouski@gmail.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox