Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/efi/loader/arch/amd64/framebuffer.c
Show All 33 Lines | |||||
#include <stand.h> | #include <stand.h> | ||||
#include <efi.h> | #include <efi.h> | ||||
#include <efilib.h> | #include <efilib.h> | ||||
#include <efiuga.h> | #include <efiuga.h> | ||||
#include <efipciio.h> | #include <efipciio.h> | ||||
#include <machine/metadata.h> | #include <machine/metadata.h> | ||||
#include "framebuffer.h" | |||||
static EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; | static EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; | ||||
static EFI_GUID pciio_guid = EFI_PCI_IO_PROTOCOL_GUID; | static EFI_GUID pciio_guid = EFI_PCI_IO_PROTOCOL_GUID; | ||||
static EFI_GUID uga_guid = EFI_UGA_DRAW_PROTOCOL_GUID; | static EFI_GUID uga_guid = EFI_UGA_DRAW_PROTOCOL_GUID; | ||||
static u_int | static u_int | ||||
efifb_color_depth(struct efi_fb *efifb) | efifb_color_depth(struct efi_fb *efifb) | ||||
{ | { | ||||
uint32_t mask; | uint32_t mask; | ||||
▲ Show 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
efifb_from_uga(struct efi_fb *efifb, EFI_UGA_DRAW_PROTOCOL *uga) | efifb_from_uga(struct efi_fb *efifb, EFI_UGA_DRAW_PROTOCOL *uga) | ||||
{ | { | ||||
EFI_PCI_IO_PROTOCOL *pciio; | EFI_PCI_IO_PROTOCOL *pciio; | ||||
char *ev, *p; | char *ev, *p; | ||||
EFI_STATUS status; | EFI_STATUS status; | ||||
ssize_t offset; | ssize_t offset; | ||||
uint64_t fbaddr, fbsize; | uint64_t fbaddr; | ||||
uint32_t horiz, vert, stride; | uint32_t horiz, vert, stride; | ||||
uint32_t np, depth, refresh; | uint32_t np, depth, refresh; | ||||
status = uga->GetMode(uga, &horiz, &vert, &depth, &refresh); | status = uga->GetMode(uga, &horiz, &vert, &depth, &refresh); | ||||
if (EFI_ERROR(status)) | if (EFI_ERROR(status)) | ||||
return (1); | return (1); | ||||
efifb->fb_height = vert; | efifb->fb_height = vert; | ||||
efifb->fb_width = horiz; | efifb->fb_width = horiz; | ||||
▲ Show 20 Lines • Show All 283 Lines • Show Last 20 Lines |