summaryrefslogtreecommitdiff
path: root/include/video_console.h
Commit message (Collapse)AuthorAgeFilesLines
* video: Clear the vidconsole rather than the videoSimon Glass2023-03-131-0/+9
| | | | | | | | | | It is better to clear the console device rather than the video device, since the console has the text display. We also need to reset the cursor position with the console, but not with the video device. Add a new function to handle this and update the 'cls' command to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* video console: move vidconsole_get_font_size() logic to driver opsDzmitry Sankouski2023-03-071-2/+12
| | | | | | | | | | Since multiple vidconsole drivers exists, vidconsole_get_font_size() implementation cannot longer live in vidconsole_uclass.c file. Move current vidconsole_get_font_size logic to truetype driver ops. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* video console: refactoring and optimizationDzmitry Sankouski2023-03-071-0/+3
| | | | | | | | | | | | | - move common code to vidconsole_internal.h and console_core.c - unite probe functions - get rid of code duplications in switch across bpp values - extract common pixel fill logic in two functions one per horizontal and vertical filling - rearrange statements in put_xy* methods in unified way - replace types - uint*_t to u* Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* video: Add font functions to the vidconsole APISimon Glass2023-01-161-12/+63
| | | | | | | | | Support for fonts currently depends on the type of vidconsole in use. Add two new methods to enumerate fonts and to set the font. Fix a few other method comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
* video: Add commands to list and change fontsSimon Glass2022-10-301-0/+9
| | | | | | | | | | Add a new 'font' command which allows the fonts to be listed as well as selecting a different font and size. Allow the test to run on sandbox, where multiple font/size combinations are supported, as well as sandbox_flattree, where they are not. Signed-off-by: Simon Glass <sjg@chromium.org>
* video: Add a way to change the font name and sizeSimon Glass2022-10-301-0/+16
| | | | | | | It is useful to be able to support multiple fonts. Add a function to handle this as well as one to list the available fonts. Signed-off-by: Simon Glass <sjg@chromium.org>
* video: Provide a function to set the cursor positionSimon Glass2022-10-301-0/+12
| | | | | | | Add an exported function which allows the cursor position to be set to pixel granularity. Make use of this in the existing code. Signed-off-by: Simon Glass <sjg@chromium.org>
* video: Move console colours to the video uclassSimon Glass2022-10-301-37/+0
| | | | | | | | | | | | At present these are attached to vidconsole which means that the video uclass requires that a console is enabled. This is not the intention. The colours are a reasonable way of indexing common colours in any case, so move them to the video uclass instead. Rename vid_console_color() to video_index_to_colour() now that it is more generic. Also fix the inconsistent spelling in these functions. Signed-off-by: Simon Glass <sjg@chromium.org>
* doc: replace @return by Return:Heinrich Schuchardt2022-01-191-9/+9
| | | | | | | | | | | | Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* video: Add helpers for vidconsole for the copy framebufferSimon Glass2020-07-091-0/+49
| | | | | | | | | Add a convenience function to call video_sync_copy() for a vidconsole. Also add a memmove() helper, which does the memmove() as well as the sync. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
* video: Drop unnecessary #ifdef around vid_console_color()Simon Glass2020-07-091-4/+2
| | | | | | | | | | All of the functions in this file only apply if DM_VIDEO is enabled. Drop the #ifdef as it just clutters things up. Add the needed forward declaration. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* video: Factor out vidconsole_put_string()Marek Vasut2019-05-201-0/+16
| | | | | | | | | | 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>
* dm: video: support more escape sequencesHeinrich Schuchardt2018-09-281-12/+16
| | | | | | | | | | | | | | | | The EFI subsystems needs to know the size of the terminal. If the environment variable stdout = serial,vidconsole this size cannot be read from the video console. So the EFI subsystem sends escape sequences to read the size. With this patch we get support for the following escape sequences: ESC "7" Save cursor position ESC "8" Restore cursor position Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* dm: video: adjust struct vidconsole_priv descriptionHeinrich Schuchardt2018-09-281-1/+1
| | | | | | The third component of struct vidconsole_priv is ycur. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-071-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>
* dm: video: support increased intensity (bold)Heinrich Schuchardt2018-03-061-2/+10
| | | | | | | | 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>
* dm: video: use constants to refer to colorsHeinrich Schuchardt2018-03-061-0/+35
| | | | | | | | | | Use constants to refer to colors. Adjust initialization of foreground and background color to avoid setting reserved bits. Consistently u32 instead of unsigned for color bit mask. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: video: Add basic ANSI escape sequence supportRob Clark2017-09-291-0/+11
| | | | | | | | | Really just the subset that is needed by efi_console. Perhaps more will be added later, for example color support would be useful to implement efi_cout_set_attribute(). Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* video: Provide a backspace methodSimon Glass2016-01-301-0/+14
| | | | | | | | With proportional fonts the vidconsole uclass cannot itself erase the previous character. Provide an optional method so that the driver can handle this operation. Signed-off-by: Simon Glass <sjg@chromium.org>
* video: Provide a signal when a new console line is startedSimon Glass2016-01-301-0/+14
| | | | | | | When we start a new line (due to the user pressing return), signal this to the driver so that it can flush its buffer of character positions. Signed-off-by: Simon Glass <sjg@chromium.org>
* video: Provide a left margin for the text consoleSimon Glass2016-01-301-0/+2
| | | | | | | Allow the left margin to be set so that text does not have to be right up against the left side. On some panels this makes it hard to read. Signed-off-by: Simon Glass <sjg@chromium.org>
* video: Use fractional units for X coordinatesSimon Glass2016-01-301-9/+31
| | | | | | | | | | | | | | 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>
* dm: video: Add a uclass for the text consoleSimon Glass2016-01-201-0/+136
The existing LCD/video interface suffers from conflating the bitmap display with text output on that display. As a result the implementation is more complex than it needs to me. We can support multiple text console drivers. Create a separate uclass to support this, with its own API. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>