Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/efistub: Drop long obsolete UGA support

UGA is the EFI graphical output protocol that preceded GOP, and has been
long obsolete. Drop support for it from the x86 implementation of the
EFI stub - other architectures never bothered to implement it (save for
ia64)

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

-107
-10
arch/x86/platform/efi/efi.c
··· 54 54 #include <asm/uv/uv.h> 55 55 56 56 static unsigned long efi_systab_phys __initdata; 57 - static unsigned long uga_phys = EFI_INVALID_TABLE_ADDR; 58 57 static unsigned long efi_runtime, efi_nr_tables; 59 58 60 59 unsigned long efi_fw_vendor, efi_config_table; 61 60 62 61 static const efi_config_table_type_t arch_tables[] __initconst = { 63 - {UGA_IO_PROTOCOL_GUID, &uga_phys, "UGA" }, 64 62 #ifdef CONFIG_X86_UV 65 63 {UV_SYSTEM_TABLE_GUID, &uv_systab_phys, "UVsystab" }, 66 64 #endif ··· 70 72 &efi.acpi20, 71 73 &efi.smbios, 72 74 &efi.smbios3, 73 - &uga_phys, 74 75 #ifdef CONFIG_X86_UV 75 76 &uv_systab_phys, 76 77 #endif ··· 886 889 return true; 887 890 888 891 return false; 889 - } 890 - 891 - char *efi_systab_show_arch(char *str) 892 - { 893 - if (uga_phys != EFI_INVALID_TABLE_ADDR) 894 - str += sprintf(str, "UGA=0x%lx\n", uga_phys); 895 - return str; 896 892 } 897 893 898 894 #define EFI_FIELD(var) efi_ ## var
-3
drivers/firmware/efi/efi.c
··· 148 148 if (efi.smbios != EFI_INVALID_TABLE_ADDR) 149 149 str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios); 150 150 151 - if (IS_ENABLED(CONFIG_X86)) 152 - str = efi_systab_show_arch(str); 153 - 154 151 return str - buf; 155 152 } 156 153
-90
drivers/firmware/efi/libstub/x86-stub.c
··· 405 405 } 406 406 } 407 407 408 - /* 409 - * See if we have Universal Graphics Adapter (UGA) protocol 410 - */ 411 - static efi_status_t 412 - setup_uga(struct screen_info *si, efi_guid_t *uga_proto, unsigned long size) 413 - { 414 - efi_status_t status; 415 - u32 width, height; 416 - void **uga_handle = NULL; 417 - efi_uga_draw_protocol_t *uga = NULL, *first_uga; 418 - efi_handle_t handle; 419 - int i; 420 - 421 - status = efi_bs_call(allocate_pool, EFI_LOADER_DATA, size, 422 - (void **)&uga_handle); 423 - if (status != EFI_SUCCESS) 424 - return status; 425 - 426 - status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL, 427 - uga_proto, NULL, &size, uga_handle); 428 - if (status != EFI_SUCCESS) 429 - goto free_handle; 430 - 431 - height = 0; 432 - width = 0; 433 - 434 - first_uga = NULL; 435 - for_each_efi_handle(handle, uga_handle, size, i) { 436 - efi_guid_t pciio_proto = EFI_PCI_IO_PROTOCOL_GUID; 437 - u32 w, h, depth, refresh; 438 - void *pciio; 439 - 440 - status = efi_bs_call(handle_protocol, handle, uga_proto, 441 - (void **)&uga); 442 - if (status != EFI_SUCCESS) 443 - continue; 444 - 445 - pciio = NULL; 446 - efi_bs_call(handle_protocol, handle, &pciio_proto, &pciio); 447 - 448 - status = efi_call_proto(uga, get_mode, &w, &h, &depth, &refresh); 449 - if (status == EFI_SUCCESS && (!first_uga || pciio)) { 450 - width = w; 451 - height = h; 452 - 453 - /* 454 - * Once we've found a UGA supporting PCIIO, 455 - * don't bother looking any further. 456 - */ 457 - if (pciio) 458 - break; 459 - 460 - first_uga = uga; 461 - } 462 - } 463 - 464 - if (!width && !height) 465 - goto free_handle; 466 - 467 - /* EFI framebuffer */ 468 - si->orig_video_isVGA = VIDEO_TYPE_EFI; 469 - 470 - si->lfb_depth = 32; 471 - si->lfb_width = width; 472 - si->lfb_height = height; 473 - 474 - si->red_size = 8; 475 - si->red_pos = 16; 476 - si->green_size = 8; 477 - si->green_pos = 8; 478 - si->blue_size = 8; 479 - si->blue_pos = 0; 480 - si->rsvd_size = 8; 481 - si->rsvd_pos = 24; 482 - 483 - free_handle: 484 - efi_bs_call(free_pool, uga_handle); 485 - 486 - return status; 487 - } 488 - 489 408 static void setup_graphics(struct boot_params *boot_params) 490 409 { 491 410 efi_guid_t graphics_proto = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; 492 411 struct screen_info *si; 493 - efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID; 494 412 efi_status_t status; 495 413 unsigned long size; 496 414 void **gop_handle = NULL; 497 - void **uga_handle = NULL; 498 415 499 416 si = &boot_params->screen_info; 500 417 memset(si, 0, sizeof(*si)); ··· 422 505 if (status == EFI_BUFFER_TOO_SMALL) 423 506 status = efi_setup_gop(si, &graphics_proto, size); 424 507 425 - if (status != EFI_SUCCESS) { 426 - size = 0; 427 - status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL, 428 - &uga_proto, NULL, &size, uga_handle); 429 - if (status == EFI_BUFFER_TOO_SMALL) 430 - setup_uga(si, &uga_proto, size); 431 - } 432 508 } 433 509 434 510
-4
include/linux/efi.h
··· 363 363 #define ACPI_20_TABLE_GUID EFI_GUID(0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81) 364 364 #define SMBIOS_TABLE_GUID EFI_GUID(0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) 365 365 #define SMBIOS3_TABLE_GUID EFI_GUID(0xf2fd1544, 0x9794, 0x4a2c, 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94) 366 - #define UGA_IO_PROTOCOL_GUID EFI_GUID(0x61a4d49e, 0x6f68, 0x4f1b, 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0x0b, 0x07, 0xa2) 367 366 #define EFI_GLOBAL_VARIABLE_GUID EFI_GUID(0x8be4df61, 0x93ca, 0x11d2, 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c) 368 367 #define UV_SYSTEM_TABLE_GUID EFI_GUID(0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93) 369 368 #define LINUX_EFI_CRASH_GUID EFI_GUID(0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0) ··· 372 373 #define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID EFI_GUID(0x8b843e20, 0x8132, 0x4852, 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c) 373 374 #define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID EFI_GUID(0x05c99a21, 0xc70f, 0x4ad2, 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e) 374 375 #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a) 375 - #define EFI_UGA_PROTOCOL_GUID EFI_GUID(0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39) 376 376 #define EFI_PCI_IO_PROTOCOL_GUID EFI_GUID(0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a) 377 377 #define EFI_FILE_INFO_ID EFI_GUID(0x09576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) 378 378 #define EFI_SYSTEM_RESOURCE_TABLE_GUID EFI_GUID(0xb122a263, 0x3661, 0x4f68, 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80) ··· 1283 1285 / sizeof_field(struct linux_efi_memreserve, entry[0])) 1284 1286 1285 1287 void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size); 1286 - 1287 - char *efi_systab_show_arch(char *str); 1288 1288 1289 1289 /* 1290 1290 * The LINUX_EFI_MOK_VARIABLE_TABLE_GUID config table can be provided