summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/QemuVideoDxe/Initialize.c
Commit message (Collapse)AuthorAgeFilesLines
* OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ onesRebecca Cran2020-04-301-4/+4
| | | | | | | | | | | | | Generated mechanically with: find OvmfPkg -type f -exec sed -i -e 's/EFI_D_/DEBUG_/g' {} \; Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Cc: Philippe Mathieu-Daude <philmd@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200429215327.606467-1-rebecca@bsdio.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"yuchenlin2018-11-201-157/+0
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit c137d95081690d4877fbeb5f1856972e84ac32f2. The VMWare SVGA model now -- since commit 104bd1dc70 in QEMU -- falls back to stdvga (that is, Bochs) if we don't setup VMWare SVGA FIFO. To simplify QemuVideoDxe, we don't intend to implement the VMWare SVGA FIFO setup feature. It means our current VMW SVGA driver code is basically dead. To simplify the problem, we will replace the old VMWare SVGA driver to Bochs interface. It should work on all QEMU version. The first step for using Bochs interface is to revert old driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit 98856a724c2acdc0094220d4de615a557dad0f88) Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* Reapply "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"Laszlo Ersek2018-11-121-0/+157
| | | | | | | | | | | | | | | | | | | | | This reverts commit 98856a724c2acdc0094220d4de615a557dad0f88, reapplying c137d95081690d4877fbeb5f1856972e84ac32f2. Note that the commit now being reverted is technically correct; the only reason we're reverting it is because it should not have been pushed past the Soft Feature Freeze for the edk2-stable201811 tag. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: yuchenlin <yuchenlin@synology.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1319 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: yuchenlin <yuchenlin@synology.com>
* Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"yuchenlin2018-11-061-157/+0
| | | | | | | | | | | | | | | | | | | | | This reverts commit c137d95081690d4877fbeb5f1856972e84ac32f2. The VMWare SVGA model now -- since commit 104bd1dc70 in QEMU -- falls back to stdvga (that is, Bochs) if we don't setup VMWare SVGA FIFO. To simplify QemuVideoDxe, we don't intend to implement the VMWare SVGA FIFO setup feature. It means our current VMW SVGA driver code is basically dead. To simplify the problem, we will replace the old VMWare SVGA driver to Bochs interface. It should work on all QEMU version. The first step for using Bochs interface is to revert old driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/QemuVideoDxe: VMWare SVGA device supportPhil Dennis-Jordan2017-04-071-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | In addition to the QXL, Cirrus, etc. VGA adapters, Qemu also implements a basic version of VMWare's SVGA display device. Drivers for this device exist for some guest OSes which do not support Qemu's other display adapters, so supporting it in OVMF is useful in conjunction with those OSes. This change adds support for the SVGA device's framebuffer to QemuVideoDxe's graphics output protocol implementation, based on VMWare's documentation. The most basic initialisation, framebuffer layout query, and mode setting operations are implemented. The device relies on port-based 32-bit I/O, unfortunately on misaligned addresses. This limits the driver's support to the x86 family of platforms. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/QemuVideoDxe: rebase to ARRAY_SIZE()Laszlo Ersek2016-10-271-2/+2
| | | | | | | Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/QemuVideoDxe: upgrade VERBOSE debug messages to INFOLaszlo Ersek2016-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 5b2291f9567a ("OvmfPkg: QemuVideoDxe uses MdeModulePkg/FrameBufferLib"), QemuVideoDxe was rebased to FrameBufferBltLib. The FrameBufferBltLib instance added in commit b1ca386074bd ("MdeModulePkg: Add FrameBufferBltLib library instance") logs many messages on the VERBOSE level; for example, a normal boot with OVMF can produce 500+ "VideoFill" messages, dependent on the progress bar, when the VERBOSE bit is set in PcdDebugPrintErrorLevel. While FrameBufferBltLib is certainly allowed to log such messages on the VERBOSE level, we should separate those frequent messages from the (infrequent) ones produced by QemuVideoDxe itself. QemuVideoDxe logs VERBOSE messages in three locations (in two functions) at the moment. All of them are infrequent: both QemuVideoBochsModeSetup() and InstallVbeShim() are called from QemuVideoControllerDriverStart(), that is, when a device is bound. Upgrade these messages to INFO level, so that VERBOSE can be disabled in PcdDebugPrintErrorLevel -- perhaps selectively for OvmfPkg/QemuVideoDxe -- without hiding these infrequent messages. Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/QemuVideoDxe: drop QEMU_VIDEO_CIRRUS_MODES.RefreshRateLaszlo Ersek2016-10-161-8/+8
| | | | | | | | | | | | Thanks to the previous patch, this field is also unnecessary now. Remove it. The patch is best reviewed with "git show --word-diff". Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/QemuVideoDxe: drop useless QEMU_VIDEO_MODE_DATA.RefreshRateLaszlo Ersek2016-10-161-8/+4
| | | | | | | | | This field is never used beyond assignment and debug-logging. Remove it. Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: QemuVideoDxe: work around misreported QXL framebuffer sizeLaszlo Ersek2014-08-291-4/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting up the list of GOP modes offered on QEMU's stdvga ("VGA") and QXL ("qxl-vga") video devices, QemuVideoBochsModeSetup() filters those modes against the available framebuffer size. (Refer to SVN r15288 / git commit ec88061e.) The VBE_DISPI_INDEX_VIDEO_MEMORY_64K register of both stdvga and QXL is supposed to report the size of the drawable, VGA-compatibility framebuffer. Instead, up to and including qemu-2.1, this register actually reports the full video RAM (PCI BAR 0) size. In case of stdvga, this happens to be correct, because on that card the full PCI BAR 0 is usable for drawing; there is no difference between "drawable framebuffer size" and "video RAM (PCI BAR 0) size". However, on the QXL card, only an initial portion of the video RAM is suitable for drawing, as compatibility framebuffer; and the value currently reported by VBE_DISPI_INDEX_VIDEO_MEMORY_64K overshoots the valid size. Beyond the drawable range, the video RAM contains buffers and structures for the QXL guest-host protocol. Luckily, the size of the drawable QXL framebuffer can also be read from a register in the QXL ROM BAR (PCI BAR 2), so let's retrieve it from there. Without this fix, OVMF offers too large resolutions on the QXL card (up to the full size of the video RAM). If a GOP client selects such a resolution and draws into the video RAM past the compatibility segment, then the guest corrupts its communication structures (which is invalid guest behavior). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15978 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: QemuVideoDxe: add further BOCHS modesLaszlo Ersek2014-03-031-3/+37
| | | | | | | | | | | This brings the list of BOCHS video modes to par with the QEMU QXL implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15289 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: QemuVideoDxe: filter BOCHS modes vs. available frame buffer sizeLaszlo Ersek2014-03-031-18/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the next patch we'll add many new BOCHS modes, some of which require large frame buffers. The size of the QXL VGA compatibility framebuffer can be changed with the -global qxl-vga.vgamem_mb=$NUM_MB QEMU option. If $NUM_MB would exceed 32, then the following two QEMU options are necessary instead: -global qxl-vga.vgamem_mb=$NUM_MB \ -global qxl-vga.ram_size_mb=$((NUM_MB*2)) because the compatibility framebuffer can't cover more than half of PCI BAR #0. The latter defaults to 64MB in size, and is controlled by "ram_size_mb". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15288 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: QemuVideoDxe: clarify QEMU_VIDEO_MODE_DATA.ModeNumberLaszlo Ersek2014-03-031-6/+8
| | | | | | | | | | | | | | | | | | | The field name "ModeNumber" in QEMU_VIDEO_MODE_DATA is misleading -- it is not immediately obvious whether this field carries a client-visible mode number, in the GOP sense, or an internal, card type specific mode index. After checking all references, rename the field to "InternalModeIndex". Also, when filling in the card type independent QEMU_VIDEO_MODE_DATA array from the card type specific mode array, distinguish the GOP mode number from the internal mode index in the debug message. This patch effects no functional changes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15287 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: QemuVideoDxe: tidy up error checking/handling in & under Start()Laszlo Ersek2014-03-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QemuVideoControllerDriverStart(): - remove redundant zero-initialization of: - Private->Handle (2 locations) - Private->GopDevicePath (when at devpath end) - remove fields used for error handling only: - PciAttributesSaved - tigthen scope of temporaries: - MmioDesc - AcpiDeviceNode - supplement missing error checks: - AppendDevicePathNode() can fail with out-of-memory (2 locations) - when installing GopDevicePath - retval of QemuVideoGraphicsOutputConstructor() (can justifiedly fail with out-of-resources) - plug leaks on error: - free GopDevicePath (AppendDevicePathNode() allocates dynamically) - uninstall GopDevicePath - free Private->ModeData - call QemuVideoGraphicsOutputDestructor() - uninstall GOP In QemuVideoGraphicsOutputConstructor(), called by Start(): - supplement missing error checks: - QemuVideoGraphicsOutputSetMode() retval (it can fail with out-of-resources) - plug leaks on error: - free Mode->Info - free Mode In QemuVideoCirrusModeSetup() and QemuVideoBochsModeSetup(), both called by Start(): - supplement missing error checks: - AllocatePool() can fail in both In QemuVideoGraphicsOutputDestructor(), called by Start() on the error path: - plug leaks: - free Private->LineBuffer, which is allocated in Start() -> Constructor() -> SetMode() In QemuVideoGraphicsOutputSetMode(), called by Start() indirectly: - remove redundant zero-assignment to: - Private->LineBuffer Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15282 6f19259b-4bc3-4df7-8a09-765794883524
* QemuVideo: Add support for the bochs dispi interfacejljusten2012-11-271-0/+52
| | | | | | | | | | | | | | | Add code to handle qemu-emulated vga cards supporting the bochs dispi interface (standard vga, qxl vga). This requires qemu 1.3+ which provides the bochs dispi interface data register on a aligned io address. See http://git.qemu.org/?p=qemu.git;a=commitdiff;h=df9ffb726ff13f850b8829be1bc85ed621b903ac Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13968 6f19259b-4bc3-4df7-8a09-765794883524
* QemuVideo: prepare to support more hardwarejljusten2012-11-271-10/+10
| | | | | | | | | | | | | | Move to a table-driven hardware detection. Add a table with PCI IDs, card name and variant enum. Use the table for hardware detection and initialization. Rename Cirrus-specific data and code to carry "cirrus" in the name. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13967 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: Add QemuVideoDxe driverjljusten2011-04-121-0/+203
This driver provides a UEFI Graphics Output Protocol (GOP) driver for the QEMU Cirrus VGA hardware. It enables 24-bit color, and uses the standard 32-bit GOP pixel format whenever possible. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11524 6f19259b-4bc3-4df7-8a09-765794883524