From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::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 D3E8A20D77820 for ; Sun, 2 Apr 2017 15:45:06 -0700 (PDT) Received: by mail-pg0-x243.google.com with SMTP id 81so25704707pgh.3 for ; Sun, 02 Apr 2017 15:45:06 -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=6xzb+g5QoVsDK4MIqUSmGbI2r6TxM3eSSCvuLFuHl2A=; b=KUrK5GnADLVIZCjOeA0upqBl7bZI9MVeGHGsi6WNZEY1ZQiUoO2v9amm2mJIqaoO/w 5jryGz38J49LAkrS+iApcVrd6EyUJUWgzEfHfAgnhVCJKQ7U3+9TBbqspHLVJL2kzFH3 mEm3Dzz8dV2IP9Qt+T6YdghzVLr8ixkNF4yBtAieFItMe92ISamc56cZjwd2pKiZLJud budSdP/HVNcsJlRZtKxNTwMdMe+8DRBnXAn+PTx8ezz673ZzpKWgvM3cam8ofnafMnym gTCgWzBnWhrr3S0kCPirArVj/uZbgqg83fYHlV/rBFuTCkOvcxJvHIDZEYcwnG54dA2w 02rg== 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=6xzb+g5QoVsDK4MIqUSmGbI2r6TxM3eSSCvuLFuHl2A=; b=kME49jrYdew707zRO/LzpNWvalrth/F098eJLayZePo/boZrvOqcd1DECqHZSVsLI+ jsiGTtOlA7jkE3Bw23EdqrpoHy6L/PUasWLNo/keTwU3l10KNymegIvE1awpRNxviS22 IZAl86s7E2J8J4LljUfiHlhxNjMuxhn3i50acHt33M/J3X1WBVBENv0bc5PvM7Qv6G+T JTSWdws7Q3HJhb5h2d7yxFJWr2v4cACS9C92DEbinZ6Ug7OxqA+iqLENJL9lhWwJLIVM wMIBXHq6nCRTB+je/J9yfSO30vwOny9ni7Whg3X/WNpIHcQhpQGsMLoGg66e8kReiUFn TfDg== X-Gm-Message-State: AFeK/H1thbouWDENctJMLCYoO+wGqHm5Azfi6sJC+tFLnMCziAipwc5QD2n4mz/NGQEA5A== X-Received: by 10.84.136.135 with SMTP id 7mr17802109pll.149.1491173106224; Sun, 02 Apr 2017 15:45:06 -0700 (PDT) Received: from localhost.localdomain ([210.246.60.121]) by smtp.gmail.com with ESMTPSA id l127sm21891336pga.7.2017.04.02.15.45.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 02 Apr 2017 15:45:05 -0700 (PDT) From: Phil Dennis-Jordan To: edk2-devel@lists.01.org Date: Mon, 3 Apr 2017 10:44:54 +1200 Message-Id: <1491173097-37305-1-git-send-email-lists@philjordan.eu> X-Mailer: git-send-email 2.3.2 (Apple Git-55) Subject: [PATCH v2 0/3] OvmfPkg/QemuVideoDxe: Add VMWare SVGA2 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: Sun, 02 Apr 2017 22:45:07 -0000 This extends the QemuVideoDxe driver to support the VMWare SVGA2 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. 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. Phil Dennis-Jordan (3): OvmfPkg: VMWare SVGA2 display device register definitions OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O. OvmfPkg/QemuVideoDxe: VMWare SVGA II device support. OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf | 6 ++ OvmfPkg/Include/IndustryStandard/VMWareSVGA2.h | 102 +++++++++++++++++++ OvmfPkg/QemuVideoDxe/Qemu.h | 37 +++++++ OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h | 59 +++++++++++ OvmfPkg/QemuVideoDxe/Driver.c | 76 ++++++++++++++ OvmfPkg/QemuVideoDxe/Gop.c | 74 +++++++++++++- OvmfPkg/QemuVideoDxe/Initialize.c | 107 ++++++++++++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c | 69 +++++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c | 79 +++++++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c | 81 +++++++++++++++ OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c | 65 ++++++++++++ 11 files changed, 754 insertions(+), 1 deletion(-) create mode 100644 OvmfPkg/Include/IndustryStandard/VMWareSVGA2.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)