summaryrefslogtreecommitdiff
path: root/test/dm/video.c
AgeCommit message (Collapse)AuthorFilesLines
2020-12-14dm: treewide: Rename dev_get_platdata() to dev_get_plat()Simon Glass1-4/+4
Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-08dm: Rename DM test flags to make them more genericSimon Glass1-13/+13
The test flags used by driver model are currently not available to other tests. Rather than creating two sets of flags, make these flags generic by changing the DM_ prefix to UT_ and moving them to the test.h header. This will allow adding other test flags without confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-04dm: core: Drop header files from dm/test.hSimon Glass1-0/+1
These header file should not be included in other header files. Remove them and add to each individual file. Add test/test.h to test/ui.h since that is a reasonable place. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09video: sandbox: Add support for the copy framebufferSimon Glass1-21/+34
Enable this feature on sandbox by updating the SDL driver to have two framebuffers. Update the video tests to check that the copy framebuffer is kept in sync. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-07-09video: Add comments to struct sandbox_sdl_platSimon Glass1-1/+2
This struct is not commented but needs it. Also fix the comment in check_vidconsole_output() about the encoding for the rotation value. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-07-09video: Adjust rotated console to start at right edgeSimon Glass1-1/+1
At present when the console is rotated 180 degrees it starts almost a whole character to the left of the right edge (typically 7 pixels with an 8-pixel-wide font). On a display which aligns with the font width, this just wastes space. On a display that does not this can result in x_frac going negative for the final character (the one on the left side) and the overflow -EAGAIN check at the start of the function failing. Change the function to start at the rightmost pixel to fix these problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-05-19common: Drop log.h from common headerSimon Glass1-0/+1
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-06dm: core: Create a new header file for 'compat' featuresSimon Glass1-0/+1
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-05-20video: Factor out vidconsole_put_string()Marek Vasut1-8/+0
Pull the vidconsole_put_string() function from DM tests, make it available to e.g. boards that want to display information on the LCD on boot. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Anatolij Gustschin <agust@denx.de> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-12-29dm: video: fix test failures with enabled default TrueType fontAnatolij Gustschin1-3/+3
With enabled default Nimbus font dm_test_video_truetype* tests fail. Update expected expressions to fix them. Signed-off-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-17dm: video: correctly set the cursor positionHeinrich Schuchardt1-2/+2
The terminal escape sequence ESC [ <x> ; <y> H is used to set the cursor position. According to the ECMA 48 standard the upper left corner in the escape sequences is [1, 1]. The video uclass uses [0, 0] as upper left corner. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-10-09sandbox: video: Speed up video outputSimon Glass1-1/+1
At present there are many situations where sandbox syncs the display to the SDL frame buffer. This is a very expensive operation but is only needed every now and then. Update video_sync() so that we can specify whether this operation is really needed. At present this flag is not used on other architectures. It could also be used for reducing writeback-cache flushes but the benefit of that would need to be investigated. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini1-2/+0
We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-03-06dm: video: support increased intensity (bold)Heinrich Schuchardt1-1/+1
Support special rendition code 0 - reset attributes. Support special rendition code 1 - increased intensity (bold). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-03-06dm: video: show correct colors in graphical consoleHeinrich Schuchardt1-1/+1
Get RGB sequence in pixels right (swap blue and red). Do not set reserved bits. qemu-system-i386 -display sdl -vga virtio and qemu-system-i386 -display sdl -vga cirrus now display the similar colors (highlighting still missing) as qemu-system-i386 -nographic Testing is possible via setenv efi_selftest test output bootefi selftest Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-29video: test: Add ANSI escape sequence testsRob Clark1-0/+34
This adds tests for clear, set-cursor and color escape sequences. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Anatolij Gustschin <agust@denx.de>
2017-09-29video: test: Helper for writing stringsRob Clark1-12/+12
I'll need some more of this, let's not just copy-pasta the vidconsole_put_char() loop. Named to match vidconsole_put_char() in case that is ever useful outside of the tests. Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-02-06video: test: Adjust order of file closureSimon Glass1-1/+1
Close the file earlier to hopefully fix a Coverity error. Reported-by: Coverity (CID: 134901) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-01-30video: test: Add console tests for truetypeSimon Glass1-0/+63
This adds tests for the different character types, line wrap, scrolling and backspace. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30video: sandbox: Enable truetype fonts for sandboxSimon Glass1-1/+20
Enable this feature so that truetype fonts can be used on the sandbox console. Update the tests to select the normal/rotated console when needed. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-01-30video: Handle the 'bell' characterSimon Glass1-1/+1
This can be sent when to many characters are entered. Make sure it is ignored and does not cause a character to be displayed. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30video: Use fractional units for X coordinatesSimon Glass1-2/+2
With anti-aliased fonts we need a more fine-grained horizontal position than a single pixel. Characters can be positioned to start part-way through a pixel, with anti-aliasing (greyscale edges) taking care of the visual effect. To cope with this, use fractional units (1/256 pixel) for horizontal positions in the text console. Signed-off-by: Simon Glass <sjg@chromium.org> [agust: rebased] Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-01-21dm: video: test: Test that bitmap display works correctlySimon Glass1-0/+54
Add a test for the 'bmp' command. Test both the uncompressed and compressed versions of the file, since they use different code paths. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
2016-01-21dm: video: test: Add tests for rotated consolesSimon Glass1-0/+27
Test that text is displayed correctly when the console is rotated. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
2016-01-21dm: video: test: Add tests for the video uclassSimon Glass1-0/+190
Add tests that check that the video console is working correcty. Also check that text output produces the expected result. Test coverage includes character output, wrapping and scrolling. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>