39#define CIRRUS_LOGIC_VENDOR_ID 0x1013
40#define CIRRUS_LOGIC_5430_DEVICE_ID 0x00a8
41#define CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID 0x00a0
42#define CIRRUS_LOGIC_5446_DEVICE_ID 0x00b8
48 UINT32 InternalModeIndex;
49 UINT32 HorizontalResolution;
50 UINT32 VerticalResolution;
54#define PIXEL_RED_SHIFT 0
55#define PIXEL_GREEN_SHIFT 3
56#define PIXEL_BLUE_SHIFT 6
58#define PIXEL_RED_MASK (BIT7 | BIT6 | BIT5)
59#define PIXEL_GREEN_MASK (BIT4 | BIT3 | BIT2)
60#define PIXEL_BLUE_MASK (BIT1 | BIT0)
62#define PIXEL_TO_COLOR_BYTE(pixel, mask, shift) ((UINT8) ((pixel & mask) << shift))
63#define PIXEL_TO_RED_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel, PIXEL_RED_MASK, PIXEL_RED_SHIFT)
64#define PIXEL_TO_GREEN_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel, PIXEL_GREEN_MASK, PIXEL_GREEN_SHIFT)
65#define PIXEL_TO_BLUE_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel, PIXEL_BLUE_MASK, PIXEL_BLUE_SHIFT)
67#define RGB_BYTES_TO_PIXEL(Red, Green, Blue) \
68 (UINT8) ( (((Red) >> PIXEL_RED_SHIFT) & PIXEL_RED_MASK) | \
69 (((Green) >> PIXEL_GREEN_SHIFT) & PIXEL_GREEN_MASK) | \
70 (((Blue) >> PIXEL_BLUE_SHIFT) & PIXEL_BLUE_MASK) )
72#define PIXEL24_RED_MASK 0x00ff0000
73#define PIXEL24_GREEN_MASK 0x0000ff00
74#define PIXEL24_BLUE_MASK 0x000000ff
76#define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff
81#define QEMU_VIDEO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('Q', 'V', 'I', 'D')
84 QEMU_VIDEO_CIRRUS_5430 = 1,
85 QEMU_VIDEO_CIRRUS_5446,
87 QEMU_VIDEO_BOCHS_MMIO,
88 QEMU_VIDEO_VMWARE_SVGA,
95 QEMU_VIDEO_VARIANT Variant;
103 UINT64 OriginalPciAttributes;
114 QEMU_VIDEO_VARIANT Variant;
116 UINTN FrameBufferBltConfigureSize;
117 UINT8 FrameBufferVramBarIndex;
139#define QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS(a) \
140 CR(a, QEMU_VIDEO_PRIVATE_DATA, GraphicsOutput, QEMU_VIDEO_PRIVATE_DATA_SIGNATURE)
147extern UINT8 Crtc_640_480_256_60[];
148extern UINT16 Seq_640_480_256_60[];
149extern UINT8 Crtc_800_600_256_60[];
150extern UINT16 Seq_800_600_256_60[];
151extern UINT8 Crtc_1024_768_256_60[];
152extern UINT16 Seq_1024_768_256_60[];
161#define CRTC_ADDRESS_REGISTER 0x3d4
162#define CRTC_DATA_REGISTER 0x3d5
163#define SEQ_ADDRESS_REGISTER 0x3c4
164#define SEQ_DATA_REGISTER 0x3c5
165#define GRAPH_ADDRESS_REGISTER 0x3ce
166#define GRAPH_DATA_REGISTER 0x3cf
167#define ATT_ADDRESS_REGISTER 0x3c0
168#define MISC_OUTPUT_REGISTER 0x3c2
169#define INPUT_STATUS_1_REGISTER 0x3da
170#define DAC_PIXEL_MASK_REGISTER 0x3c6
171#define PALETTE_INDEX_REGISTER 0x3c8
172#define PALETTE_DATA_REGISTER 0x3c9
174#define VBE_DISPI_IOPORT_INDEX 0x01CE
175#define VBE_DISPI_IOPORT_DATA 0x01D0
177#define VBE_DISPI_INDEX_ID 0x0
178#define VBE_DISPI_INDEX_XRES 0x1
179#define VBE_DISPI_INDEX_YRES 0x2
180#define VBE_DISPI_INDEX_BPP 0x3
181#define VBE_DISPI_INDEX_ENABLE 0x4
182#define VBE_DISPI_INDEX_BANK 0x5
183#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
184#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
185#define VBE_DISPI_INDEX_X_OFFSET 0x8
186#define VBE_DISPI_INDEX_Y_OFFSET 0x9
187#define VBE_DISPI_INDEX_VIDEO_MEMORY_64K 0xa
189#define VBE_DISPI_ID0 0xB0C0
190#define VBE_DISPI_ID1 0xB0C1
191#define VBE_DISPI_ID2 0xB0C2
192#define VBE_DISPI_ID3 0xB0C3
193#define VBE_DISPI_ID4 0xB0C4
194#define VBE_DISPI_ID5 0xB0C5
196#define VBE_DISPI_DISABLED 0x00
197#define VBE_DISPI_ENABLED 0x01
198#define VBE_DISPI_GETCAPS 0x02
199#define VBE_DISPI_8BIT_DAC 0x20
200#define VBE_DISPI_LFB_ENABLED 0x40
201#define VBE_DISPI_NOCLEARMEM 0x80
207QemuVideoGraphicsOutputConstructor (
212QemuVideoGraphicsOutputDestructor (
324 OUT CHAR16 **DriverName
402 OUT CHAR16 **ControllerName
415InitializeBochsGraphicsMode (
493QemuVideoBochsModeSetup (
RETURN_STATUS EFIAPI FrameBufferBltConfigure(IN VOID *FrameBuffer, IN EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo, IN OUT FRAME_BUFFER_CONFIGURE *Configure, IN OUT UINTN *ConfigureSize)
VOID SetDefaultPalette(QEMU_VIDEO_PRIVATE_DATA *Private)
VOID outb(QEMU_VIDEO_PRIVATE_DATA *Private, UINTN Address, UINT8 Data)
UINT8 inb(QEMU_VIDEO_PRIVATE_DATA *Private, UINTN Address)
EFI_STATUS EFIAPI QemuVideoControllerDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
UINT8 AttributeController[]
EFI_STATUS EFIAPI QemuVideoComponentNameGetControllerName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
VOID DrawLogo(QEMU_VIDEO_PRIVATE_DATA *Private, UINTN ScreenWidth, UINTN ScreenHeight)
QEMU_VIDEO_CIRRUS_MODES QemuVideoCirrusModes[]
UINT16 inw(QEMU_VIDEO_PRIVATE_DATA *Private, UINTN Address)
VOID InitializeCirrusGraphicsMode(QEMU_VIDEO_PRIVATE_DATA *Private, QEMU_VIDEO_CIRRUS_MODES *ModeData)
EFI_STATUS QemuVideoCirrusModeSetup(QEMU_VIDEO_PRIVATE_DATA *Private)
VOID outw(QEMU_VIDEO_PRIVATE_DATA *Private, UINTN Address, UINT16 Data)
EFI_STATUS EFIAPI QemuVideoComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS EFIAPI QemuVideoControllerDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
VOID SetPaletteColor(QEMU_VIDEO_PRIVATE_DATA *Private, UINTN Index, UINT8 Red, UINT8 Green, UINT8 Blue)
UINT8 GraphicsController[]
EFI_STATUS EFIAPI QemuVideoControllerDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)