aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_selftest/efi_selftest_bitblt.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-03-14 19:57:02 +0100
committerAlexander Graf <agraf@suse.de>2018-04-04 11:00:07 +0200
commit51a0f4512295429a8511d8fbce2e4d26d6bc1fcb (patch)
treeac52490acf0b8ecb90d887392534cd2461e32ad5 /lib/efi_selftest/efi_selftest_bitblt.c
parent6fc901c538907f48d4253a6e23987df2268f75ae (diff)
downloadu-boot-51a0f4512295429a8511d8fbce2e4d26d6bc1fcb.zip
u-boot-51a0f4512295429a8511d8fbce2e4d26d6bc1fcb.tar.gz
u-boot-51a0f4512295429a8511d8fbce2e4d26d6bc1fcb.tar.bz2
efi_loader: correctly support parameter delta in Blt
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>
Diffstat (limited to 'lib/efi_selftest/efi_selftest_bitblt.c')
-rw-r--r--lib/efi_selftest/efi_selftest_bitblt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/efi_selftest/efi_selftest_bitblt.c b/lib/efi_selftest/efi_selftest_bitblt.c
index 53cc633..0fb76cc7 100644
--- a/lib/efi_selftest/efi_selftest_bitblt.c
+++ b/lib/efi_selftest/efi_selftest_bitblt.c
@@ -87,7 +87,7 @@ static void EFIAPI notify(struct efi_event *event, void *context)
/* Copy image to video */
gop->blt(gop, bitmap, EFI_BLT_BUFFER_TO_VIDEO, sx, 0, dx, DEPTH,
- width, HEIGHT, WIDTH);
+ width, HEIGHT, WIDTH * sizeof(struct efi_gop_pixel));
}
/*
@@ -276,7 +276,7 @@ static int execute(void)
/* Copy port holes back to buffer */
ret = gop->blt(gop, bitmap, EFI_BLT_VIDEO_TO_BLT_BUFFER,
94, 57 + DEPTH, 94, 57,
- 90, 26, WIDTH);
+ 90, 26, WIDTH * sizeof(struct efi_gop_pixel));
if (ret != EFI_SUCCESS) {
efi_st_error("EFI_BLT_VIDEO_TO_BLT_BUFFER failed\n");
return EFI_ST_FAILURE;