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 9D11A21DFA8F1 for ; Wed, 5 Apr 2017 05:55:29 -0700 (PDT) Received: by mail-pf0-x243.google.com with SMTP id 197so1694812pfv.0 for ; Wed, 05 Apr 2017 05:55:29 -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=/C2IF7hYPAYQ1jPNKOE9fpCJno3kiVLmqzjWj4mWEiQ=; b=CLH1OK1VOKG09oZg6UxikjZn1UaqQka3aaqsdXyvApZNOQIWqf689DNpFxKXqq7Th+ X9P51ycIHVYrxINqeOXpucapHnVY+SiuxcGs4O0gJvemvCbKjO4OWGy+yaR9qjIrvCj8 QcPh6BhCbRYBiqu1hbUwBfh/6UdYiqQ8nCno6Fildk3Kj9W9dcGoaAuAGEETI5m2muk8 7ylxFqfRETWAVpMKSkFfQu2b3jAE4Qf2fi9HMAuzFz61vkFget7L/sERZRvyh8d1W9tP AzStFkl0zF8VWWjt1btRwW2R1uMezrHJJO45mb3+HuZWV16fcPSQib6NZWUj+KXY8UcC fhKQ== 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=/C2IF7hYPAYQ1jPNKOE9fpCJno3kiVLmqzjWj4mWEiQ=; b=c0WltoYKibvN9WKKQBKgT6SNuncZ2kyhotWMNMghPwEfCKMPwXEzzzy7vnp5AUh8Pv q7s7+BXzaAtB39DnxpXuETg5DLfWIymjc2dxwkoDMtXkhwe84Q2rZPoZXesQ1wSDD1d6 riVf4IUjCQb4unOG+FH+XARFQui2irPhRJsWWqR0dZyuHFwZkiuCXTjifcH45H2Ih/HC yuhYHO4qZ5LUW+vWBdrUFtQ4NDE+XVVETY9hBLv+RTs0ZrS5ouD8k4T/4feky96ti6Il XX1UK8sNsA8U5WmQCbUaOe+ecn2F0KDTf99uND5poK5d3tSrMIDNMihT/IzoooVUN1Do HTPg== X-Gm-Message-State: AFeK/H1Oz5Aj1kHz7fyeI3S4mbFqA4iRBbeQu+Bg40mwUvpQYggmiDu1Q4LkRZn8j49m4Q== X-Received: by 10.98.192.151 with SMTP id g23mr29078662pfk.254.1491396929027; Wed, 05 Apr 2017 05:55:29 -0700 (PDT) Received: from localhost.localdomain ([210.246.60.121]) by smtp.gmail.com with ESMTPSA id r66sm37609345pfi.49.2017.04.05.05.55.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 05 Apr 2017 05:55:28 -0700 (PDT) From: Phil Dennis-Jordan To: edk2-devel@lists.01.org Date: Thu, 6 Apr 2017 00:55:13 +1200 Message-Id: <1491396916-53170-1-git-send-email-lists@philjordan.eu> X-Mailer: git-send-email 2.3.2 (Apple Git-55) Subject: [PATCH v4 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 12:55:29 -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_svga_v4 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] 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 | 128 +++++++++++++++- 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, 835 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)