efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCD

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>
This commit is contained in:
Rob Clark 2017-07-21 15:00:27 -04:00 committed by Alexander Graf
parent 3e094c592b
commit ca9193d2b1
3 changed files with 8 additions and 2 deletions

View file

@ -230,7 +230,7 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
#ifdef CONFIG_PARTITIONS #ifdef CONFIG_PARTITIONS
efi_disk_register(); efi_disk_register();
#endif #endif
#ifdef CONFIG_LCD #if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
efi_gop_register(); efi_gop_register();
#endif #endif
#ifdef CONFIG_NET #ifdef CONFIG_NET

View file

@ -17,6 +17,7 @@ obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o
obj-y += efi_memory.o efi_device_path_to_text.o obj-y += efi_memory.o efi_device_path_to_text.o
obj-$(CONFIG_LCD) += efi_gop.o obj-$(CONFIG_LCD) += efi_gop.o
obj-$(CONFIG_DM_VIDEO) += efi_gop.o
obj-$(CONFIG_PARTITIONS) += efi_disk.o obj-$(CONFIG_PARTITIONS) += efi_disk.o
obj-$(CONFIG_NET) += efi_net.o obj-$(CONFIG_NET) += efi_net.o
obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o

View file

@ -28,6 +28,7 @@ struct efi_gop_obj {
struct efi_gop_mode mode; struct efi_gop_mode mode;
/* Fields we only have acces to during init */ /* Fields we only have acces to during init */
u32 bpix; u32 bpix;
void *fb;
}; };
static efi_status_t EFIAPI gop_query_mode(struct efi_gop *this, u32 mode_number, static efi_status_t EFIAPI gop_query_mode(struct efi_gop *this, u32 mode_number,
@ -71,7 +72,7 @@ static efi_status_t EFIAPI gop_blt(struct efi_gop *this, void *buffer,
if (operation != EFI_BLT_BUFFER_TO_VIDEO) if (operation != EFI_BLT_BUFFER_TO_VIDEO)
return EFI_EXIT(EFI_INVALID_PARAMETER); return EFI_EXIT(EFI_INVALID_PARAMETER);
fb = (void*)gd->fb_base; fb = gopobj->fb;
line_len16 = gopobj->info.width * sizeof(u16); line_len16 = gopobj->info.width * sizeof(u16);
line_len32 = gopobj->info.width * sizeof(u32); line_len32 = gopobj->info.width * sizeof(u32);
@ -130,6 +131,7 @@ int efi_gop_register(void)
struct efi_gop_obj *gopobj; struct efi_gop_obj *gopobj;
u32 bpix, col, row; u32 bpix, col, row;
u64 fb_base, fb_size; u64 fb_base, fb_size;
void *fb;
#ifdef CONFIG_DM_VIDEO #ifdef CONFIG_DM_VIDEO
struct udevice *vdev; struct udevice *vdev;
@ -144,6 +146,7 @@ int efi_gop_register(void)
row = video_get_ysize(vdev); row = video_get_ysize(vdev);
fb_base = (uintptr_t)priv->fb; fb_base = (uintptr_t)priv->fb;
fb_size = priv->fb_size; fb_size = priv->fb_size;
fb = priv->fb;
#else #else
int line_len; int line_len;
@ -152,6 +155,7 @@ int efi_gop_register(void)
row = panel_info.vl_row; row = panel_info.vl_row;
fb_base = gd->fb_base; fb_base = gd->fb_base;
fb_size = lcd_get_size(&line_len); fb_size = lcd_get_size(&line_len);
fb = gd->fb_base;
#endif #endif
switch (bpix) { switch (bpix) {
@ -200,6 +204,7 @@ int efi_gop_register(void)
gopobj->info.pixels_per_scanline = col; gopobj->info.pixels_per_scanline = col;
gopobj->bpix = bpix; gopobj->bpix = bpix;
gopobj->fb = fb;
/* Hook up to the device list */ /* Hook up to the device list */
list_add_tail(&gopobj->parent.link, &efi_obj_list); list_add_tail(&gopobj->parent.link, &efi_obj_list);