Changeset 100688 in vbox for trunk/src/VBox
- Timestamp:
- Jul 25, 2023 7:08:45 AM (17 months ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/ArmVirtPkg/ArmVirtQemu.dsc
r100680 r100688 462 462 !ifdef $(VBOX) 463 463 OvmfPkg/SataControllerDxe/SataControllerDxe.inf 464 VBoxPkg/VmwSvga3Dxe/VmwSvga3VideoDxe.inf 464 VBoxPkg/VmwSvga3Dxe/VmwSvga3VideoDxe.inf { 465 <LibraryClasses> 466 # Optimized SetMem doesn't work on VGA framebuffer. 467 BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf 468 } 465 469 !endif 466 470 -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VmwSvga3Dxe/Driver.c
r100681 r100688 21 21 NULL 22 22 }; 23 23 24 24 25 /** … … 204 205 Private->PciIo, 205 206 EfiPciIoAttributeOperationEnable, 206 EFI_PCI_DEVICE_ENABLE | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY, 207 (EFI_PCI_DEVICE_ENABLE | 208 EFI_PCI_IO_ATTRIBUTE_BUS_MASTER), 207 209 NULL 208 210 ); … … 211 213 } 212 214 213 /** @todo Set up device */ 215 // 216 // Initialize the device. 217 // 218 Status = VmwSvga3DeviceInit(Private); 219 if (EFI_ERROR (Status)) { 220 goto RestoreAttributes; 221 } 214 222 215 223 // … … 254 262 if (EFI_ERROR (Status)) { 255 263 goto FreeGopDevicePath; 256 }257 258 //259 // Construct video mode buffer260 //261 /** @todo */262 263 if (EFI_ERROR (Status)) {264 goto UninstallGopDevicePath;265 264 } 266 265 … … 424 423 425 424 // 425 // Teardown the device. 426 // 427 Status = VmwSvga3DeviceUninit (Private); 428 if (EFI_ERROR (Status)) { 429 return Status; 430 } 431 432 // 426 433 // Restore original PCI attributes 427 434 // -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VmwSvga3Dxe/Gop.c
r100681 r100688 65 65 Info->PixelInformation.ReservedMask = 0; 66 66 Info->PixelsPerScanLine = Info->HorizontalResolution; 67 } 68 69 STATIC 70 EFI_STATUS 71 VmwSvga3VideoUpdate ( 72 IN VMWSVGA3_VIDEO_PRIVATE_DATA *Private, 73 IN UINT32 Width, 74 IN UINT32 Height 75 ) 76 { 77 VMWSVGA3_CTX_CMD_UPDATE *CmdUpdate = (VMWSVGA3_CTX_CMD_UPDATE *)Private->CmdBuf; 78 79 CmdUpdate->CmdId = VMWSVGA3_CMD_UPDATE; 80 CmdUpdate->x = 0; 81 CmdUpdate->y = 0; 82 CmdUpdate->Width = Width; 83 CmdUpdate->Height = Height; 84 85 return VmwSvga3CmdBufProcess(Private, sizeof(VMWSVGA3_CTX_CMD_UPDATE), VMWSVGA3_CB_CTX_0); 67 86 } 68 87 … … 189 208 } 190 209 191 /** @todo */192 193 210 This->Mode->Mode = ModeNumber; 194 211 This->Mode->Info->HorizontalResolution = mVmwSvga3ModeInfo[ModeNumber].HorizontalResolution; … … 198 215 VmwSvga3VideoCompleteModeData (Private, This->Mode); 199 216 217 VmwSvga3WriteReg(Private, VMWSVGA3_REG_ENABLE, 0); 218 VmwSvga3WriteReg(Private, VMWSVGA3_REG_CONFIG_DONE, 0); 219 220 VmwSvga3WriteReg(Private, VMWSVGA3_REG_WIDTH, mVmwSvga3ModeInfo[ModeNumber].HorizontalResolution); 221 VmwSvga3WriteReg(Private, VMWSVGA3_REG_HEIGHT, mVmwSvga3ModeInfo[ModeNumber].VerticalResolution); 222 VmwSvga3WriteReg(Private, VMWSVGA3_REG_BITS_PER_PIXEL, 32); 223 224 VmwSvga3WriteReg(Private, VMWSVGA3_REG_ENABLE, 1); 225 VmwSvga3WriteReg(Private, VMWSVGA3_REG_CONFIG_DONE, 1); 226 200 227 // 201 228 // Re-initialize the frame buffer configure when mode changes. 202 229 // 230 DEBUG ((DEBUG_INFO, "VmwSvga3: Configuring framebuffer\n")); 203 231 Status = FrameBufferBltConfigure ( 204 (VOID *) (UINTN)This->Mode->FrameBufferBase,232 (VOID *)This->Mode->FrameBufferBase, 205 233 This->Mode->Info, 206 234 Private->FrameBufferBltConfigure, … … 223 251 // 224 252 Status = FrameBufferBltConfigure ( 225 (VOID *) (UINTN)This->Mode->FrameBufferBase,253 (VOID *)This->Mode->FrameBufferBase, 226 254 This->Mode->Info, 227 255 Private->FrameBufferBltConfigure, … … 250 278 ASSERT_RETURN_ERROR (Status); 251 279 252 return EFI_SUCCESS; 280 return VmwSvga3VideoUpdate ( 281 Private, 282 This->Mode->Info->HorizontalResolution, 283 This->Mode->Info->VerticalResolution 284 ); 253 285 } 254 286 … … 333 365 } 334 366 335 /** @todo Update screen. */ 367 if (!EFI_ERROR(Status)) 368 Status = VmwSvga3VideoUpdate( 369 Private, 370 This->Mode->Info->HorizontalResolution, 371 This->Mode->Info->VerticalResolution 372 ); 336 373 337 374 gBS->RestoreTPL (OriginalTPL); … … 379 416 Private->FrameBufferBltConfigureSize = 0; 380 417 381 //382 // Initialize the hardware383 //384 418 Status = GraphicsOutput->SetMode (GraphicsOutput, 0); 385 419 if (EFI_ERROR (Status)) { -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VmwSvga3Dxe/VmwSvga3.h
r100681 r100688 42 42 43 43 // 44 // Used commands 45 // 46 #define VMWSVGA3_CMD_UPDATE 1 47 48 // 49 // Command buffer context definitions 50 // 51 #define VMWSVGA3_CB_CTX_DEVICE 0x3f 52 #define VMWSVGA3_CB_CTX_0 0 53 54 // 55 // Command buffer status definitions 56 // 57 #define VMWSVGA3_CB_STATUS_NONE 0 58 #define VMWSVGA3_CB_STATUS_COMPLETED 1 59 60 // 61 // Command buffer flags 62 // 63 #define VMWSVGA3_CB_FLAG_NONE 0 64 #define VMWSVGA3_CB_FLAG_NO_IRQ (1 << 0) 65 66 // 67 // Device context commands 68 // 69 #define VMWSVGA3_CMD_DC_START_STOP_CTX 1 70 71 // 72 // Command buffer header 73 // 74 typedef struct 75 { 76 volatile UINT32 Status; // Modified by device 77 volatile UINT32 ErrorOffset; // Modified by device 78 UINT64 Id; 79 UINT32 Flags; 80 UINT32 Length; 81 UINT64 PhysicalAddress; 82 UINT32 Offset; 83 UINT32 DxContext; // Valid if DX_CONTEXT flag set, must be zero otherwise 84 UINT32 Reserved[6]; 85 } VMWSVGA3_CB_HDR; 86 87 // 88 // Update command definition 89 // 90 typedef struct { 91 UINT32 CmdId; 92 UINT32 x; 93 UINT32 y; 94 UINT32 Width; 95 UINT32 Height; 96 } VMWSVGA3_CTX_CMD_UPDATE; 97 98 // 99 // Start/Stop context command definition 100 // 101 typedef struct { 102 UINT32 CmdId; 103 UINT32 Enable; 104 UINT32 Context; 105 } VMWSVGA3_DC_CMD_START_STOP_CTX; 106 107 // 44 108 // VMware SVGA 3 Video Private Data Structure 45 109 // … … 59 123 UINT8 FrameBufferVramBarIndex; 60 124 125 VMWSVGA3_CB_HDR *CmdBufHdr; 126 VOID *CmdBuf; 127 128 EFI_PHYSICAL_ADDRESS PhysicalAddressCmdBufHdr; 129 EFI_PHYSICAL_ADDRESS PhysicalAddressCmdBuf; 130 131 VOID *CmdBufMapping; 61 132 } VMWSVGA3_VIDEO_PRIVATE_DATA; 62 63 ///64 /// Card-specific Video Mode structures65 ///66 typedef struct {67 UINT32 Width;68 UINT32 Height;69 UINT32 ColorDepth;70 UINT8 *CrtcSettings;71 UINT16 *SeqSettings;72 UINT8 MiscSetting;73 } QEMU_VIDEO_CIRRUS_MODES;74 133 75 134 #define VMWSVGA3_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS(a) \ … … 81 140 extern UINT8 AttributeController[]; 82 141 extern UINT8 GraphicsController[]; 83 extern QEMU_VIDEO_CIRRUS_MODES VmwSvga3VideoModes[];84 142 extern EFI_DRIVER_BINDING_PROTOCOL gVmwSvga3VideoDriverBinding; 85 143 extern EFI_COMPONENT_NAME_PROTOCOL gVmwSvga3VideoComponentName; … … 87 145 88 146 // 147 // PCI BARs defined by SVGA3 148 // 149 #define VMWSVGA3_MMIO_BAR 0 150 #define VMWSVGA3_VRAM_BAR 2 151 152 // 89 153 // MMIO Registers defined by SVGA3 90 154 // 91 /** @todo */ 155 #define VMWSVGA3_REG_ID 0 156 # define VMWSVGA3_REG_ID_SVGA3 0x90000003 157 #define VMWSVGA3_REG_ENABLE 4 158 #define VMWSVGA3_REG_WIDTH 8 159 #define VMWSVGA3_REG_HEIGHT 12 160 #define VMWSVGA3_REG_DEPTH 24 161 #define VMWSVGA3_REG_BITS_PER_PIXEL 28 162 #define VMWSVGA3_REG_CONFIG_DONE 80 163 #define VMWSVGA3_REG_IRQMASK 132 164 #define VMWSVGA3_REG_COMMAND_LOW 192 165 #define VMWSVGA3_REG_COMMAND_HIGH 196 166 #define VMWSVGA3_REG_IRQ_STATUS 328 92 167 93 168 // … … 296 371 // Local Function Prototypes 297 372 // 298 VOID299 VmwSvga3InitializeGraphicsMode (300 VMWSVGA3_VIDEO_PRIVATE_DATA *Private,301 QEMU_VIDEO_CIRRUS_MODES *ModeData302 );303 304 373 EFI_STATUS 305 374 VmwSvga3VideoModeSetup ( … … 307 376 ); 308 377 378 UINT32 379 VmwSvga3ReadReg ( 380 IN VMWSVGA3_VIDEO_PRIVATE_DATA *VmwSvga3, 381 IN UINT32 Offset 382 ); 383 384 VOID 385 VmwSvga3WriteReg ( 386 IN VMWSVGA3_VIDEO_PRIVATE_DATA *VmwSvga3, 387 IN UINT32 Offset, 388 IN UINT32 Data 389 ); 390 391 EFI_STATUS 392 VmwSvga3DeviceInit ( 393 IN VMWSVGA3_VIDEO_PRIVATE_DATA *This 394 ); 395 396 EFI_STATUS 397 VmwSvga3DeviceUninit ( 398 IN VMWSVGA3_VIDEO_PRIVATE_DATA *This 399 ); 400 401 EFI_STATUS 402 VmwSvga3CmdBufProcess ( 403 IN VMWSVGA3_VIDEO_PRIVATE_DATA *This, 404 IN UINTN NumberOfBytes, 405 IN UINT32 Context 406 ); 407 309 408 #endif -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VmwSvga3Dxe/VmwSvga3VideoDxe.inf
r100681 r100688 32 32 Driver.c 33 33 Gop.c 34 Hardware.c 34 35 VmwSvga3.h 35 36
Note:
See TracChangeset
for help on using the changeset viewer.