From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9B40B2194233D for ; Thu, 6 Apr 2017 23:26:14 -0700 (PDT) Received: by mail-pg0-x242.google.com with SMTP id 79so13310643pgf.0 for ; Thu, 06 Apr 2017 23:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philjordan-eu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=5ygOrLQzKfcLy6FL27DDIbQ5SZOuhxe+TAfgAuqKVyU=; b=S2L4hk2uj3fv3OmcDFC57DAuORLlnlWmEUDGscd5eg586mu1zzbyxz/g8B4sWy1iFd NO6VjK30EqSoMjJe3CBg0ATwV9+xEUmsm0SylDxEDjaTSVuthvCbK2M5nfulNwbN6Kwj oj7TIISAmBUKTfoZbpFLT7Pdoxs8QtgY1dvIunCNFR0f1b8U+yyV1Af8G8vMGMeOdwrE v8/HD1dXS11g87ooDIRRhoS0sD3eWHufsQ5H5K6qQqPWC487V5HmPDK7CfjpEBDXLI6D 1E90WuB+sexxEMqlddBo83+IMIZ79oxZGQOdHC+U26rZoVTpTV0wdWXH5KjQrpNk+XYR KV9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5ygOrLQzKfcLy6FL27DDIbQ5SZOuhxe+TAfgAuqKVyU=; b=OU/Ff6mVF/ZgnZmGc9LRIsiqUM3A79tMiDRLCgWRPHRWLVTNviAsfff6zm7749nTsX KCQt8KOK0YoNm1RruH1JGB/GpA/QvE9U+ong/5JQfztxCPUMNz4BzsyFHL7AxORCqMfH /s939AerqepzpOpggCcCh0107YWODCeYJZNoFwa/ew24pggM0WfRCtaC1pPTBmTspJzv gw3ax/uOSksctmY8wBG91QbrQn4pdDn23nswHdjdZejcpxFUy/VMWkgxIkOahLnMzO5+ 4irJGdbaoAnA/KAjLUc9FaIzzpWqepvyKZhZcyVFkyoI5oL9+0pJPqUT4FGB2ACCDWIy BhYg== X-Gm-Message-State: AFeK/H1YYC9aH7Ee88GrfmlCmq+xN9FJHKms8Qke4UPzKb3ryKfwIs5ibtqt1A9z9I2vzg== X-Received: by 10.98.11.218 with SMTP id 87mr37773319pfl.214.1491546373962; Thu, 06 Apr 2017 23:26:13 -0700 (PDT) Received: from Phils-MBP-57025.fritz.box.fritz.box ([165.84.56.107]) by smtp.gmail.com with ESMTPSA id e70sm7124608pfh.84.2017.04.06.23.26.11 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 06 Apr 2017 23:26:13 -0700 (PDT) From: Phil Dennis-Jordan To: edk2-devel@lists.01.org Cc: Phil Dennis-Jordan Date: Fri, 7 Apr 2017 18:25:55 +1200 Message-Id: <1491546358-58572-1-git-send-email-lists@philjordan.eu> X-Mailer: git-send-email 2.3.2 (Apple Git-55) Subject: [PATCH v5 0/3] OvmfPkg/QemuVideoDxe: Add VMWare SVGA framebuffer support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Apr 2017 06:26:14 -0000 From: Phil Dennis-Jordan This extends the QemuVideoDxe driver to support the VMWare SVGA display device implemented by Qemu. Drivers for this device exist for guest OSes which do not support Qemu's other display adapters, so supporting it in OVMF is useful in conjunction with those OSes. I've tried to follow the existing pattern for device-specific code in OVMF's QemuVideoDxe driver as much as possible, with a minimum of additional code. For the functionality this driver uses, 2 I/O ports are used with 32-bit wide reads and writes. Unfortunately, one of them is not 32-bit aligned. This is fine as far as x86/x86-64 is concerned, but neither EDK2's IoLib nor other platforms support such an access pattern. This issue was already encountered/discussed on the edk2-devel list 4 years ago: http://edk2-devel.narkive.com/bwH3r0us/unaligned-i-o I've therefore added UnalignedIoWrite/Read32() helper functions for Ia32/X64, which I've based on IoLib's aligned ones. Because querying mode properties on the device is only possible by actually entering the mode, all display modes are queried on startup and saved for when they are queried. Feature branch: https://github.com/pmj/edk2/tree/ovmf_vmware_svga_v5 v2: - Unaligned I/O helpers are now in a separate commit. [Laszlo] - New header file with only essential device constants [Laszlo] - ArmVirtPkg build failures fixed [Laszlo] - Code formatting improvements in main driver code. v3: - Hardware describing header definitions now prefixed [Jordan, Laszlo] - "2" dropped from "SVGA2" wherever it made sense. [Jordan, Laszlo] - Various formatting tweaks to the unaligned IO helpers [Laszlo] - Mode properties are now queried and stored up front. [Laszlo] - Lots of formatting fixes in the driver code. [Laszlo] - PCI BAR confusion resolved. [Laszlo] - Found & fixed a memory leak. v4: (only patch 3/3 changed) - Struct assignment fix, pixel mask simplified, comment & whitespace fixes. [Laszlo] v5: (only patch 3/3 changed) - Removed duplicate hardware register read. [Laszlo] - Fixed modelist memory leak. [Laszlo] Phil Dennis-Jordan (3): OvmfPkg: VMWare SVGA display device register definitions OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O. OvmfPkg/QemuVideoDxe: VMWare SVGA device support OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf | 6 + OvmfPkg/Include/IndustryStandard/VmwareSvga.h | 104 +++++++++++++ OvmfPkg/QemuVideoDxe/Qemu.h | 29 ++++ OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h | 59 ++++++++ OvmfPkg/QemuVideoDxe/Driver.c | 134 ++++++++++++++++- OvmfPkg/QemuVideoDxe/Gop.c | 61 +++++++- OvmfPkg/QemuVideoDxe/Initialize.c | 157 ++++++++++++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c | 70 +++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c | 80 ++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c | 78 ++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c | 66 ++++++++ 11 files changed, 837 insertions(+), 7 deletions(-) create mode 100644 OvmfPkg/Include/IndustryStandard/VmwareSvga.h create mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h create mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c create mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c create mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c create mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c -- 2.3.2 (Apple Git-55)