summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_gop.c
Commit message (Collapse)AuthorAgeFilesLines
* efi_loader: make gop_blt() staticHeinrich Schuchardt2023-02-101-5/+6
| | | | | | This function is not used externally. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* efi: Drop old LCD codeSimon Glass2022-10-301-30/+0
| | | | | | | This relies on the old LCD implementation which is to be removed. Drop the existing #ifdef and convert it to C code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Use uclass_first_device_err when accessing one deviceMichal Suchanek2022-10-171-1/+1
| | | | | | | | | | | | | | | | | | There is a number of users that use uclass_first_device to access the first and (assumed) only device in uclass. Some check the return value of uclass_first_device and also that a device was returned which is exactly what uclass_first_device_err does. Some are not checking that a device was returned and can potentially crash if no device exists in the uclass. Finally there is one that returns NULL on error either way. Convert all of these to use uclass_first_device_err instead, the return value will be removed from uclass_first_device in a later patch. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* efi_loader: remove support for CONFIG_LCDHeinrich Schuchardt2022-07-181-5/+0
| | | | | | There is no board left using CONFIG_LCD without CONFIG_DM_VIDEO. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* efi_loader: correct function comment styleHeinrich Schuchardt2022-01-291-1/+1
| | | | | | Replace @return and @param. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* efi_loader: GOP: Fix 30bpp block transfer supportMark Kettenis2021-10-091-1/+46
| | | | | | | | Convert pixel values when necessary like we do for 16bpp framebuffers. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: GOP: Add 30bpp supportMark Kettenis2021-10-091-2/+12
| | | | | | Provide correct framebuffer information for 30bpp modes. Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
* common: Drop asm/global_data.h from common headerWIP/2021-02-02-drop-asm_global_data-when-unusedSimon Glass2021-02-021-0/+1
| | | | | | | | | | | | Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* common: Drop log.h from common headerSimon Glass2020-05-181-0/+1
| | | | | | Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* doc: UEFI API documentationHeinrich Schuchardt2019-09-051-1/+1
| | | | | | | | Add some more files to the UEFI API documentation. Correct some Sphinx comments. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: GOP: provide accurate mode informationHeinrich Schuchardt2019-06-201-12/+12
| | | | | | For 5:6:5 modes provide correct frame buffer information. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: SetMode() must blank screenHeinrich Schuchardt2019-06-201-12/+38
| | | | | | EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode() must blank the screen. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: QueryMode() must allocate bufferHeinrich Schuchardt2019-06-201-1/+5
| | | | | | | | | EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode() must allocate a buffer for the mode information structure. Adjust the unit test to free the buffer. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: SetMode() parameters checkHeinrich Schuchardt2019-06-201-3/+5
| | | | | | | If EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode() is called with an invalid mode, return EFI_UNSUPPORTED. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: QueryMode() check parametersHeinrich Schuchardt2019-06-201-1/+8
| | | | | | Check the parameters of EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: Blt() with incorrect BltOperationHeinrich Schuchardt2019-06-201-1/+1
| | | | | | | If EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt() is called with an invalid value of BltOperation return EFI_INVALID_PARAMETER. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: consistent naming of protocol GUIDsHeinrich Schuchardt2019-04-231-1/+1
| | | | | | | | | | | | | We should consistently use the same name for protocol GUIDs as defined in the UEFI specification. Not adhering to this rule has led to duplicate definitions for the EFI_LOADED_IMAGE_PROTOCOL_GUID. Adjust misnamed protocol GUIDs. Adjust the text for the graphics output protocol in the output of the `efidebug dh` command. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* efi_loader: fix typosHeinrich Schuchardt2018-12-021-4/+7
| | | | | | | Fix typos in EFI subsystem comments. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: rename parent to headerHeinrich Schuchardt2018-12-021-7/+14
| | | | | | | | Rename the component parent of some EFI objects to header. This avoids misunderstandings. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: eliminate handle memberHeinrich Schuchardt2018-12-021-1/+1
| | | | | | | | A pointer to a struct efi_object is a handle. We do not need any handle member in this structure. Let's eliminate it. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* Remove <inttypes.h> includes and PRI* usages in printf() entirelyMasahiro Yamada2018-09-101-1/+0
| | | | | | | | | | | | | | | | In int-ll64.h, we always use the following typedefs: typedef unsigned int u32; typedef unsigned long uintptr_t; typedef unsigned long long u64; This does not need to match to the compiler's <inttypes.h>. Do not include it. The use of PRI* makes the code super-ugly. You can simply use "l" for printing uintptr_t, "ll" for u64, and no modifier for u32. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* efi_loader: Fix GOP 32bpp exposureAlexander Graf2018-06-211-1/+1
| | | | | | | | | | | We store pixels as BGRA in memory, as can be seen from struct efi_gop_pixel. So we need to expose the same format to UEFI payloads to actually have them use the correct colors. Reported-by: Fabian Vogt <fvogt@suse.com> Tested-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* SPDX: Convert a few files that were missed beforeTom Rini2018-05-101-2/+1
| | | | | | | | | | | As part of the main conversion a few files were missed. These files had additional whitespace after the '*' and before the SPDX tag and my previous regex was too strict. This time I did a grep for all SPDX tags and then filtered out anything that matched the correct styles. Fixes: 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style") Reported-by: Heinrich Schuchardt <xypron.debian@gmx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
* efi_loader: Optimize GOP moreAlexander Graf2018-04-041-62/+114
| | | | | | | | The GOP path was optimized, but still not as fast as it should be. Let's push it even further by trimming the hot path into simple 32bit load/store operations for buf->vid 32bpp operations. Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Optimize GOP switchAlexander Graf2018-04-041-34/+126
| | | | | | | | | | | | | We usually try to compile for size, not for speed. Unfortunately with the more powerful GOP infrastructure to handle all sorts of GOP operations, we end up slowing down our copying hot path quite a lot. So this patch moves the 4 possible GOP operation modes into separate functions which call a common function again. The end result of that is more optimized code that can properly do constant propagation throughout its switch() statements and thus removes compares in the hot path. Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: use __always_inline for pixel conversionHeinrich Schuchardt2018-04-041-2/+2
| | | | | | | | We optimize for size using -Os so gcc might ignore 'inline'. Pixel conversions are called so often that we always want to inline them. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: correctly support parameter delta in BltHeinrich Schuchardt2018-04-041-5/+27
| | | | | | | | | | | | | | | | | In the Blt service of the EFI_GRAPHICS_OUTPUT_PROTOCOL the parameter delta is measured in bytes and not in pixels. The coding only supports delta being a multiple of four. The UEFI specification does not explicitly require this but as pixels have a size of four bytes we should be able to assume four byte alignment. The corresponding unit test is corrected, too. It can be launched with setenv efi_selftest block image transfer bootefi selftest Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: implement missing bit blit operations in gopHeinrich Schuchardt2018-04-041-36/+122
| | | | | | | | With the patch all block image transfer operations of the EFI_GRAPHICS_OUTPUT_PROTOCOL are supported. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: return efi_status_t from efi_gop_registerHeinrich Schuchardt2018-04-041-12/+22
| | | | | | | | | All initialization routines should return a status code instead of a boolean. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> [agraf: Convert warnings to debug() prints] Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: helper function to add EFI object to listHeinrich Schuchardt2017-12-011-3/+1
| | | | | | | | | | | | | | To avoid duplicate coding provide a helper function that initializes an EFI object and adds it to the EFI object list. efi_exit() is the only place where we dereference a handle to obtain a protocol interface. Add a comment to the function. Suggested-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: manage protocols in a linked listHeinrich Schuchardt2017-12-011-0/+1
| | | | | | Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: efi_gop: use efi_add_protocolHeinrich Schuchardt2017-12-011-5/+10
| | | | | | | | Use efi_add_protocol to add protocol. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: efi_gop: use correct types for parametersHeinrich Schuchardt2017-12-011-7/+7
| | | | | | | | | | Use efi_uintn_t instead of unsigned long. EFI_GRAPHICS_OUTPUT_BLT_OPERATION is an enum. If we don't define an enum we have to pass it as u32. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: efi_gop: check calloc return valueHeinrich Schuchardt2017-12-011-0/+4
| | | | | | | | Calloc may return NULL. We have to check the return value. Fixes: be8d324191f efi_loader: Add GOP support Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: GOP fix for no displayRob Clark2017-08-111-1/+1
| | | | | | | | uclass_first_device() returns 0 if there is no device, but error if there is a device that failed to probe. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Fix warning in efi_gopAlexander Graf2017-07-311-1/+1
| | | | | | | | | | | Commit ca9193d2b16 ("efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCD") dropped the explicit (void*) cast for fb_base in efi gop support for CONFIG_LCD without DM. This patch adds it back, eliminating the now occuring warning again Fixes: ca9193d2b16 ("efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCD") Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCDRob Clark2017-07-241-1/+6
| | | | | | | Make EFI GOP support work with DM_VIDEO but without legacy LCD. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: refactor efi_open_protocolxypron.glpk@gmx.de2017-07-191-1/+1
| | | | | | | | | | | | | | | | | efi_open_protocol was implemented to call a protocol specific open function to retrieve the protocol interface. The UEFI specification does not know of such a function. It is not possible to implement InstallProtocolInterface with the current design. With the patch the protocol interface itself is stored in the list of installed protocols of an efi_object instead of an open function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> [agraf: fix efi gop support] Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: gop: Expose fb when 32bppAlexander Graf2016-10-191-0/+16
| | | | | | | When we're running in 32bpp mode, expose the frame buffer address to our payloads so that Linux efifb can pick it up. Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Add DM_VIDEO supportAlexander Graf2016-06-061-7/+50
| | | | | | | | | | | | Some systems are starting to shift to support DM_VIDEO which exposes the frame buffer through a slightly different interface. This is a poor man's effort to support the dm video interface instead of the lcd one. We still only support a single display device. Signed-off-by: Alexander Graf <agraf@suse.de> [trini: Remove fb_size / fb_base as they were not used] Signed-off-by: Tom Rini <trini@konsulko.com>
* efi_loader: gop: Don't expose fb addressAlexander Graf2016-05-271-3/+0
| | | | | | | | | | | | | | | | | | Recently Linux is gaining support for efifb on AArch64 and that support actually tries to make use of the frame buffer address we expose to it via gop. While this wouldn't be bad in theory, in practice it means a few bad things 1) We expose 16bit frame buffers as 32bit today 2) Linux can't deal with overlapping non-PCI regions between efifb and a different frame buffer driver For now, let's just disable exposure of the frame buffer address. Most OSs that get booted will have a native driver for the GPU anyway. Signed-off-by: Alexander Graf <agraf@suse.de> [trini: Remove line_len entirely] Signed-off-by: Tom Rini <trini@konsulko.com>
* efi_loader: Add GOP supportAlexander Graf2016-03-271-0/+152
The EFI standard defines a simple boot protocol that an EFI payload can use to access video output. This patch adds support to expose exactly that one (and the mode already in use) as possible graphical configuration to an EFI payload. With this, I can successfully run grub2 with graphical output. Signed-off-by: Alexander Graf <agraf@suse.de>