aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_gop.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-10SPDX: Convert a few files that were missed beforeTom Rini1-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>
2018-04-04efi_loader: Optimize GOP moreAlexander Graf1-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>
2018-04-04efi_loader: Optimize GOP switchAlexander Graf1-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>
2018-04-04efi_loader: use __always_inline for pixel conversionHeinrich Schuchardt1-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>
2018-04-04efi_loader: correctly support parameter delta in BltHeinrich Schuchardt1-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>
2018-04-04efi_loader: implement missing bit blit operations in gopHeinrich Schuchardt1-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>
2018-04-04efi_loader: return efi_status_t from efi_gop_registerHeinrich Schuchardt1-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>
2017-12-01efi_loader: helper function to add EFI object to listHeinrich Schuchardt1-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>
2017-12-01efi_loader: manage protocols in a linked listHeinrich Schuchardt1-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>
2017-12-01efi_loader: efi_gop: use efi_add_protocolHeinrich Schuchardt1-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>
2017-12-01efi_loader: efi_gop: use correct types for parametersHeinrich Schuchardt1-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>
2017-12-01efi_loader: efi_gop: check calloc return valueHeinrich Schuchardt1-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>
2017-08-11efi_loader: GOP fix for no displayRob Clark1-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>
2017-07-31efi_loader: Fix warning in efi_gopAlexander Graf1-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>
2017-07-24efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCDRob Clark1-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>
2017-07-19efi_loader: refactor efi_open_protocolxypron.glpk@gmx.de1-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>
2016-10-19efi_loader: gop: Expose fb when 32bppAlexander Graf1-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>
2016-06-06efi_loader: Add DM_VIDEO supportAlexander Graf1-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>
2016-05-27efi_loader: gop: Don't expose fb addressAlexander Graf1-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>
2016-03-27efi_loader: Add GOP supportAlexander Graf1-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>