summaryrefslogtreecommitdiff
path: root/include/video.h
AgeCommit message (Collapse)Author
2025-05-02video: Add a function to draw a rectangleSimon Glass
Provide a way to draw an unfilled box of a certain width. This is useful for grouping menu items together. Add a comment showing how to see the copy-framebuffer, for testing. Signed-off-by: Simon Glass <[email protected]>
2025-05-02video: Make white-on-black a video-device propertySimon Glass
The CONFIG_WHITE_ON_BLACK setting is hard-coded at build-time. It is useful to be able to control this when showing menus. Create a property to hold this information, using the CONFIG as the initial value. Signed-off-by: Simon Glass <[email protected]>
2025-05-01video: Use VIDEO_DAMAGE for VIDEO_COPYAlexander Graf
CONFIG_VIDEO_COPY implemented a range-based copying mechanism: If we print a single character, it will always copy the full range of bytes from the top left corner of the character to the lower right onto the uncached frame buffer. This includes pretty much the full line contents of the printed character. Since we now have proper damage tracking, let's make use of that to reduce the amount of data we need to copy. With this patch applied, we will only copy the tiny rectangle surrounding characters when we print them, speeding up the video console. After this, changes to the main frame buffer are not immediately copied to the copy frame buffer, but postponed until the next video device sync. So issue an explicit sync before inspecting the copy frame buffer contents for the video tests. Signed-off-by: Alexander Graf <[email protected]> [Alper: Rebase for fontdata->height/w, fill_part(), fix memmove(dev), drop from defconfig, use damage.xstart/yend, use IS_ENABLED(), call video_sync() before copy_fb check, update video_copy test] Co-developed-by: Alper Nebi Yasak <[email protected]> Signed-off-by: Alper Nebi Yasak <[email protected]> Link: https://lore.kernel.org/u-boot/[email protected]/
2025-05-01dm: video: Add damage tracking APIAlexander Graf
We are going to introduce image damage tracking to fasten up screen refresh on large displays. This patch adds damage tracking for up to one rectangle of the screen which is typically enough to hold blt or text print updates. Callers into this API and a reduced dcache flush code path will follow in later patches. Signed-off-by: Alexander Graf <[email protected]> Reported-by: Da Xue <[email protected]> [Alper: Use xstart/yend, document new fields, return void from video_damage(), declare priv, drop headers, use IS_ENABLED()] Co-developed-by: Alper Nebi Yasak <[email protected]> Signed-off-by: Alper Nebi Yasak <[email protected]> Link: https://lore.kernel.org/u-boot/[email protected]/ Reviewed-by: Simon Glass <[email protected]>
2025-01-22pci: video: Set up the pixel-format fieldSimon Glass
Add this information to the handoff structure so that it is available to U-Boot proper. Update bochs and the video handoff. Signed-off-by: Simon Glass <[email protected]>
2024-10-22video: Fix VNBYTES() macro commentMiquel Raynal
The VNBYTES() macro has been updated to silence possible warnings regarding authorized (but unusual) uses of this macro, but the comment was kept unchanged. A year has passed so let's fix the comment now to avoid confusions. Fixes: cc05d352fbc ("video: Add parentheses around VNBYTES() macro") Suggested-by: Tom Rini <[email protected]> Link: https://lore.kernel.org/u-boot/20240906183432.GG3879073@bill-the-cat/ Signed-off-by: Miquel Raynal <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-10-18video: Avoid starting a new line to close to the bottomSimon Glass
When starting a new text line, an assumption is made that the current vertical position is a multiple of the character height. When this is not true, characters can be written after the end of the framebuffer. This can causes crashes and strange errors from QEMU. Adjust the scrolling check when processing a newline character, to avoid any problems. Add some comments to make things a little clearer. Signed-off-by: Simon Glass <[email protected]>
2024-10-18video: Add a dark-grey console colourSimon Glass
This is useful for highlighting something with a black background, as is needed with cedit when using a white-on-black console. Add this as a new colour. Signed-off-by: Simon Glass <[email protected]>
2024-08-26video: Add a function to obtain the framebuffer addressSimon Glass
Add a new function which returns the framebuffer address of the first video device. This will allow the global_data field top be dropped. Signed-off-by: Simon Glass <[email protected]>
2024-07-31video: Move last_sync to private dataSimon Glass
Rather than using a static variable, use the video device's private data to remember when the last video sync was completed. This allows each display to have its own sync and avoids using static data in SPL. Signed-off-by: Simon Glass <[email protected]>
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 <[email protected]> Fixes: 8f661a5b662 ("efi_loader: gop: Expose fb when 32bpp") Reviewed-by: Bin Meng <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Nikhil M Jain <[email protected]> Reviewed-by: Bin Meng <[email protected]>
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 <[email protected]>
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 <[email protected]> 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 <[email protected]>
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 <[email protected]> Signed-off-by: Michal Simek <[email protected]> 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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]>
2023-01-16video: Fix unchnaged typoSimon Glass
Fix this typo in the header file. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]> Reviewed-by: Patrice Chotard <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
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 <[email protected]> Reviewed-by: Anatolij Gustschin <[email protected]> Tested-by: Bin Meng <[email protected]>
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 <[email protected]> Reviewed-by: Anatolij Gustschin <[email protected]> Reviewed-by: Bin Meng <[email protected]>
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 <[email protected]> Reviewed-by: Anatolij Gustschin <[email protected]> Acked-by: Neil Armstrong <[email protected]> Signed-off-by: Neil Armstrong <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]> [agust: merged BG color escape seq change to fix "ut dm video_ansi" test] Signed-off-by: Anatolij Gustschin <[email protected]>
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 <[email protected]> Reviewed-by: Anatolij Gustschin <[email protected]>
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 <[email protected]>
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 <[email protected]> Reviewed-by: Anatolij Gustschin <[email protected]>