From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (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 2331920080904 for ; Wed, 5 Apr 2017 02:58:09 -0700 (PDT) Received: by mail-pf0-x243.google.com with SMTP id 197so1244817pfv.0 for ; Wed, 05 Apr 2017 02:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philjordan-eu.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=FOFGQj1pOiHii4FT97uulMtvqSfz2VqfbpfVJLDmWbw=; b=1rG+7P0pB/Q0Xt4tVQeCP0Y0RsdGuMPfFGxz6iJ/P7rKEOuPoRpulerMtEXpiSNwYk 5MULBgPPoSFIDW/IXhrnsGYm+6Zjwuyt7dOTDTNjIbHtL5neyLUz4kv07/P/LK3lQwD7 JbAXFro0QWX4DdL6Ig+2VOu0p7eoGkvmDnAtnWYJDACsMX5yZeQVZBejsKF/972Td0cT aJ4ISgFjov3HX1JLFNzLS7mcXvWogAjGOsD/NPhELCVqpJOpBk5D7znPFH7CDIZ3tjvt v2uomzsfrDwXTmtqE5X3pFNrenCqjrDIUj1/GhuzMgYC94WGqjLjjSmXQiW3onHEBswE gtwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=FOFGQj1pOiHii4FT97uulMtvqSfz2VqfbpfVJLDmWbw=; b=HZ9XdhQPcozCxWrEtCXc8XAzNvk12H62yZomeFmhdIqijgcX8XiJi+meTsmJoY4ca/ w9Q9Hx8ZF9ErkSPnY2N37uiKwt18GYMHpfmXuHVuAWhTHKAp/sBSIHcngQr8JJhskdde ltdP5RbYHhBuWlvNjRRFPnQnowLR9lIl/nEFi8rbhYP8iGANMQphcRsX4QR+I0H19XgK vWhbTpb8R6GfZg5uizOjuzFLxlzSNwNTTM28q+rXWDVYZ71vrUrGn6T7EMLoXpKz1d7w jBvtz2p3uoKqjADj3p7ntoQzIfqG86ng1iSIzPBdd8d1XvDIqInhuo55zu3t4tHuG0Xl LJvQ== X-Gm-Message-State: AFeK/H0/PMvD0esyQIViKHOIOj1Nuqhg+JxBqe+7C6FBCozs7GkASPo9RKeCW27Aaa8hSQ== X-Received: by 10.99.253.5 with SMTP id d5mr28503249pgh.47.1491386288305; Wed, 05 Apr 2017 02:58:08 -0700 (PDT) Received: from localhost.localdomain ([210.246.60.121]) by smtp.gmail.com with ESMTPSA id b128sm36594102pfg.54.2017.04.05.02.58.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 05 Apr 2017 02:58:07 -0700 (PDT) From: Phil Dennis-Jordan To: edk2-devel@lists.01.org Date: Wed, 5 Apr 2017 21:57:57 +1200 Message-Id: <1491386280-50077-1-git-send-email-lists@philjordan.eu> X-Mailer: git-send-email 2.3.2 (Apple Git-55) Subject: [PATCH v3 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: Wed, 05 Apr 2017 09:58:09 -0000 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_svga2_v3 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. 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 | 127 ++++++++++++++- OvmfPkg/QemuVideoDxe/Gop.c | 61 +++++++- OvmfPkg/QemuVideoDxe/Initialize.c | 161 ++++++++++++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c | 70 +++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c | 80 ++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c | 78 ++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c | 66 ++++++++ 11 files changed, 834 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)