aboutsummaryrefslogtreecommitdiff
path: root/include/video.h
AgeCommit message (Collapse)Author
2023-11-14efi: Correct handling of frame bufferSimon Glass
The efi_gop driver uses private fields from the video uclass to obtain a pointer to the frame buffer. Use the platform data instead. Check the VIDEO_COPY setting to determine which frame buffer to use. Once the next stage is running (and making use of U-Boot's EFI boot services) U-Boot does not handle copying from priv->fb to the hardware framebuffer, so we must allow EFI to write directly to the hardware framebuffer. We could provide a function to read this, but it seems better to just document how it works. The original change ignored an explicit comment in the video.h file ("Things that are private to the uclass: don't use these in the driver") which is why this was missed when the VIDEO_COPY feature was added. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 8f661a5b662 ("efi_loader: gop: Expose fb when 32bpp") Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-09-04Merge tag 'v2023.10-rc4' into nextTom Rini
Prepare v2023.10-rc4
2023-09-02video: fix typo in video_sync_all documentationHeinrich Schuchardt
%s/there/their/ Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08video: Add parentheses around VNBYTES() macroDan Carpenter
The VNBYTES() macro needs to have parentheses to prevent some (harmless) macro expansion bugs. The VNBYTES() macro is used like this: VID_TO_PIXEL(x) * VNBYTES(vid_priv->bpix) The * operation is done before the / operation. It still ends up with the same results, but it's not ideal. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-21include: video: Reserve video using blobNikhil M Jain
Add method to reserve video framebuffer information using blob, received from previous stage. Signed-off-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17x86: Pass video settings from SPL to U-Boot properSimon Glass
When video is set up in SPL, U-Boot proper needs to use the correct parameters so it can write to the display. Put these in a bloblist so they are available to U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-14video: Use enum with video_index_to_colour()Simon Glass
Use the provided enum with this function, so it is clearer what should be passed to it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14video: Correct docs for video_index_to_colour()Simon Glass
This uses the private data of the video uclass, not the console uclass (its child). Update the comment to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: a032e4b55ea ("video: Move console colours to the video uclass")
2023-07-14video: Provide a way to clear part of the consoleSimon Glass
This is useful when the background colour must be written before text is updated, to avoid strange display artifacts. Add a function for this, using the existing code from the truetype console. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-06-12video: Add support for RGBA8888 formatMichal Simek
Add support for RGBA8888 32bpp format where pixels are picked in 32-bit integers, where the colors are stored in memory such that R is at lowest address, G after that, B after that, and A last. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/aa1de54b7d4ff46df6858f76d52634e0c5c71a4a.1684312924.git.michal.simek@amd.com
2023-04-24cmd: bmp: Split bmp commands and functionsNikhil M Jain
To enable splash screen at SPL, need to compile cmd/bmp.c which also includes bmp commands, since SPL doesn't use commands split bmp.c into common/bmp.c which includes all bmp functions and cmd/bmp.c which only contains bmp commands. Add function delclaration for bmp_info in video.h. Signed-off-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-13video: Allow a copy framebuffer with pre-allocated fbSimon Glass
At present it is not possible for the video driver to use a pre-allocated frame buffer (such as is done with EFI) with the copy framebuffer. This can be useful to speed up the display. Adjust the implementation so that copy_size can be set to the required size, with this being allocated if the normal framebuffer size is 0. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-16video: Fix unchnaged typoSimon Glass
Fix this typo in the header file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2022-10-30video: Move bmp_display() prototype to video.hSimon Glass
The lcd.h header is about to be deleted, so move this prototype. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Add a way to get the default font heightSimon Glass
This is not as simple as it seems. Add a function to provide it so that the upcoming menu feature can space lines out correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Add a function to get the dimensions of a BMP imageSimon Glass
This is useful for some other users, so break this out into a function. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Add function to obtain the U-Boot logoSimon Glass
It is useful to show the logo from other code, coming in a later feature. Add a function to obtain it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Allow filling the display with a colourSimon Glass
Generalise the video_clear() function to allow filling with a different colour. Tidy up the comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Move console colours to the video uclassSimon Glass
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>
2022-03-28video: Clean up the uclass headerSimon Glass
Drop the unnecessary cruft from this header and update the title. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-19doc: replace @return by Return:Heinrich Schuchardt
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>
2021-12-26video: Support showing the U-Boot logoSimon Glass
Show the U-Boot logo by default. This is only 7KB in size so seems like a useful default for boards that enable a display. If SPLASH_SCREEN is enabled, it is not enabled by default, so as not to conflict with that feature. Also disable it for tests, since we don't want to complicate the output. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-26video: Drop the uclass colour mapSimon Glass
We don't need this anymore since we use the BMP palette directly. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-30video: Add video_is_active functionPatrick Delaunay
Add the helper function video_is_active() to test if one video device is active. This function can be used in board code to execute operation only when the display is probed / really used. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2021-10-09video: Add 30bpp supportMark Kettenis
Add support for 30bpp mode where pixels are picked in 32-bit integers but use 10 bits instead of 8 bits for each component. Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2021-01-27video: Allow syncing the entire framebuffer to the copySimon Glass
In some cases so much of the framebuffer is updated that it is not worth copying the changes piece by piece to the copy framebuffer. Add a function to copy the whole thing. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-06Merge tag 'xilinx-for-v2021.04' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2021.04 arm64: - DT updates microblaze: - Add support for NOR device support spi: - Fix unaligned data write issue nand: - Minor code change xilinx: - Fru fix in limit calculation - Fill git repo link for all Xilinx boards video: - Add support for seps525 spi display tools: - Minor Vitis file support cmd/common - Minor code indentation fixes serial: - Uartlite debug uart initialization fix
2021-01-05video: Introduce video_sync operationMichal Simek
Some drivers like LCD connected via SPI requires explicit sync function which copy framebuffer content over SPI to controller to display. This hook doesn't exist yet that's why introduce it via video operations. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-01-05video: Let video_sync to return error valueMichal Simek
This patch is preparation for follow up one to support cases where synchronization can fail. Suggested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-01-05video: Fix video sync kernel-doc formatMichal Simek
Place description below function parameters to make kernel-doc stript happy. Also rename dev to vid to be aligned with function parameters. Fixes: 1acafc73bfc7 ("dm: video: Add a video uclass") Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-13dm: treewide: Rename ..._platdata variables to just ..._platSimon Glass
Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass
We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-09-25x86: video: Show information about each video deviceSimon Glass
At present the 'bdinfo' command shows the framebuffer address, but not the address of the copy framebuffer, if present. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09video: Add support for copying to a hardware framebufferSimon Glass
Some architectures use a cached framebuffer and flush the cache as needed so that changes are visible. This is supported by U-Boot. However x86 uses an uncached framebuffer with a 'write-combining' feature to speed up writes. Reads are permitted but they are extremely expensive. Unfortunately, reading from the frame buffer is quite common, e.g. to scroll it. This makes scrolling very slow. Add a new feature which supports copying modified parts of the frame buffer to the uncached hardware buffer. This speeds up scrolling by at least 10x on x86 so the extra complexity cost seems worth it. As a starting point, add the Kconfig, update the video structures to keep track of the buffer and add a function to do the copy. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09video: Add a comment for struct video_uc_platdataSimon Glass
Add a few notes to explain the purpose of each member of this struct. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-01-07video: meson: Drop unnecessary header includesSimon Glass
These files should not be included in meson header files. Drop them and tidy up the affected C files. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-04-14video/console: Implement reverse video ANSI sequence for DM_VIDEOAndre Przywara
The video console for DM_VIDEO compliant drivers only understands a very small number of ANSI sequences. First and foremost it misses the "reverse video" command, which is used by our own bootmenu command to highlight the selected entry. To avoid forcing people to use their imagination when using the bootmenu, let's just implement the rather simple reverse effect. We need to store the background colour index for that, so that we can recalculate both the foreground and background colour pixel values. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> [agust: merged BG color escape seq change to fix "ut dm video_ansi" test] Signed-off-by: Anatolij Gustschin <agust@denx.de>
2018-12-03video: Allow driver to specify the line lengthSimon Glass
At present line_length is always calculated in video_post_probe(). But some hardware may use a different line length, e.g. with a 1366-wide display. Allow the driver to set this value if needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-11-20video: Update video_set_default_colors() to support invertSimon Glass
It is useful to be able to invert the colours in some cases so that the text matches the background colour. Add a parameter to the function to support this. It is strange that function takes a private data structure from another driver as an argument. It seems better to pass the device and have the function internally work out how to find its required information. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09video: Tidy up a few comments in video.oSimon Glass
Add a little more information to one comment and update the guard comment to be more accurate. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-10-09video: Adjust video_clear() to return an errorSimon Glass
All driver-model operation should return an error code. Adjust this function to do so also. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-10-09sandbox: video: Speed up video outputSimon Glass
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-09-28include/video.h: Remove declaration of functions that don't exist.Liviu Dudau
video_init, video_putc and video_puts functions are not implemented anywhere, remove their declaration from the header. Signed-off-by: Liviu Dudau <liviu.dudau@foss.arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2018-03-06dm: video: support increased intensity (bold)Heinrich Schuchardt
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: use constants to refer to colorsHeinrich Schuchardt
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>
2017-09-29dm: video: Add basic ANSI escape sequence supportRob Clark
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>
2016-10-23video: Move video_get_info_str() prototype to a header fileSimon Glass
This should be defined in a header file so that arguments are checked. Move it to video.h. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-05-25video: Add an enum for active low/highSimon Glass
This is used for video signals in some drivers so provide a standard way of representing it in an enum. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2016-01-30video: Correct 'tor' typo in commentSimon Glass
This should be 'rot', not 'tor'. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30video: Allow selection of the driver and font sizeSimon Glass
Provide a way for the video console driver to be selected. This is controlled by the video driver's private data. This can be set up when the driver is probed so that it is ready for the video_post_probe() method. The font size is provided as well. The console driver may or may not support this depending on its capability. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Anatolij Gustschin <agust@denx.de>