Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/efi/loader/arch/amd64/framebuffer.c
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | for (idx = 0; idx < count; idx++) { | ||||
} | } | ||||
} | } | ||||
ofs += count; | ofs += count; | ||||
size -= count; | size -= count; | ||||
} | } | ||||
printf("No change detected in frame buffer"); | printf("No change detected in frame buffer"); | ||||
fail: | fail: | ||||
printf(" -- error %lu\n", status & ~EFI_ERROR_MASK); | printf(" -- error %lu\n", EFI_ERROR_CODE(status)); | ||||
free(data1); | free(data1); | ||||
return (-1); | return (-1); | ||||
} | } | ||||
static EFI_PCI_IO_PROTOCOL * | static EFI_PCI_IO_PROTOCOL * | ||||
efifb_uga_get_pciio(void) | efifb_uga_get_pciio(void) | ||||
{ | { | ||||
EFI_PCI_IO_PROTOCOL *pciio; | EFI_PCI_IO_PROTOCOL *pciio; | ||||
▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | command_gop(int argc, char *argv[]) | ||||
struct efi_fb efifb; | struct efi_fb efifb; | ||||
EFI_GRAPHICS_OUTPUT *gop; | EFI_GRAPHICS_OUTPUT *gop; | ||||
EFI_STATUS status; | EFI_STATUS status; | ||||
u_int mode; | u_int mode; | ||||
status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); | status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); | ||||
if (EFI_ERROR(status)) { | if (EFI_ERROR(status)) { | ||||
sprintf(command_errbuf, "%s: Graphics Output Protocol not " | sprintf(command_errbuf, "%s: Graphics Output Protocol not " | ||||
"present (error=%lu)", argv[0], status & ~EFI_ERROR_MASK); | "present (error=%lu)", argv[0], EFI_ERROR_CODE(status)); | ||||
return (CMD_ERROR); | return (CMD_ERROR); | ||||
} | } | ||||
if (argc < 2) | if (argc < 2) | ||||
goto usage; | goto usage; | ||||
if (!strcmp(argv[1], "set")) { | if (!strcmp(argv[1], "set")) { | ||||
char *cp; | char *cp; | ||||
if (argc != 3) | if (argc != 3) | ||||
goto usage; | goto usage; | ||||
mode = strtol(argv[2], &cp, 0); | mode = strtol(argv[2], &cp, 0); | ||||
if (cp[0] != '\0') { | if (cp[0] != '\0') { | ||||
sprintf(command_errbuf, "mode is an integer"); | sprintf(command_errbuf, "mode is an integer"); | ||||
return (CMD_ERROR); | return (CMD_ERROR); | ||||
} | } | ||||
status = gop->SetMode(gop, mode); | status = gop->SetMode(gop, mode); | ||||
if (EFI_ERROR(status)) { | if (EFI_ERROR(status)) { | ||||
sprintf(command_errbuf, "%s: Unable to set mode to " | sprintf(command_errbuf, "%s: Unable to set mode to " | ||||
"%u (error=%lu)", argv[0], mode, | "%u (error=%lu)", argv[0], mode, | ||||
status & ~EFI_ERROR_MASK); | EFI_ERROR_CODE(status)); | ||||
return (CMD_ERROR); | return (CMD_ERROR); | ||||
} | } | ||||
} else if (!strcmp(argv[1], "get")) { | } else if (!strcmp(argv[1], "get")) { | ||||
if (argc != 2) | if (argc != 2) | ||||
goto usage; | goto usage; | ||||
efifb_from_gop(&efifb, gop->Mode, gop->Mode->Info); | efifb_from_gop(&efifb, gop->Mode, gop->Mode->Info); | ||||
print_efifb(gop->Mode->Mode, &efifb, 1); | print_efifb(gop->Mode->Mode, &efifb, 1); | ||||
printf("\n"); | printf("\n"); | ||||
Show All 30 Lines | |||||
{ | { | ||||
struct efi_fb efifb; | struct efi_fb efifb; | ||||
EFI_UGA_DRAW_PROTOCOL *uga; | EFI_UGA_DRAW_PROTOCOL *uga; | ||||
EFI_STATUS status; | EFI_STATUS status; | ||||
status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); | status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); | ||||
if (EFI_ERROR(status)) { | if (EFI_ERROR(status)) { | ||||
sprintf(command_errbuf, "%s: UGA Protocol not present " | sprintf(command_errbuf, "%s: UGA Protocol not present " | ||||
"(error=%lu)", argv[0], status & ~EFI_ERROR_MASK); | "(error=%lu)", argv[0], EFI_ERROR_CODE(status)); | ||||
return (CMD_ERROR); | return (CMD_ERROR); | ||||
} | } | ||||
if (argc != 1) | if (argc != 1) | ||||
goto usage; | goto usage; | ||||
if (efifb_from_uga(&efifb, uga) != CMD_OK) { | if (efifb_from_uga(&efifb, uga) != CMD_OK) { | ||||
sprintf(command_errbuf, "%s: Unable to get UGA information", | sprintf(command_errbuf, "%s: Unable to get UGA information", | ||||
Show All 12 Lines |