From nobody Sat Nov 2 12:19:34 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; dkim=fail spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1491546379707160.57451255513206; Thu, 6 Apr 2017 23:26:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2209321DFA7BD; Thu, 6 Apr 2017 23:26:18 -0700 (PDT) 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 2898120D77DC6 for ; Thu, 6 Apr 2017 23:26:17 -0700 (PDT) Received: by mail-pg0-x243.google.com with SMTP id g2so13256259pge.2 for ; Thu, 06 Apr 2017 23:26:17 -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.14 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 06 Apr 2017 23:26:16 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org 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:in-reply-to:references; bh=OdpsXf47hawZQMjvWWFbjKqheSs0UEskqoEQ8np95Jk=; b=MBXCtbofSQKWhlO4QoyEkN7ikb6yzRJYd/oRqB6lqPZdbOrvAv3dosCrjbWAmlroed oEyb1n+dM1eYVxm6uz3bMjH4QWo2Gk4YGghhMnf0+iDfRcCB7H6LzAoKjg+EN7pC+hM3 hCGYtFdVx7aqraTFhMCEb8pWGC9rrD9/SpZO0pNA0CWepCUKf0wMzsuGRoR5DzOBXfGT NStV+htiAhkA/z+lCDTyJXnukG+JL08CNLM113XNRffe9ZJwOBTD+5Su+cJspVqsul7C W2OdJ/shjQYgcbzYlJegDdaiUNCltu8hVDteh7OObuFVSVMACp7TESiCXfTjPeiKa2Y8 T/gQ== 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:in-reply-to :references; bh=OdpsXf47hawZQMjvWWFbjKqheSs0UEskqoEQ8np95Jk=; b=Z1qlfWUUR8Sk4ntxhqXM+w6VGXp7CsP++jfcUoQ0wNCxINK1W/MeR9zh7t64xE6/V6 x5vQxArRrJTtb4RHsjb5lh0hSKnZ9GmF1e3EUSDkn1VLXVjInMYdHzvH19/5vc1cMch4 nWUI+miKERAgzRh0V1MgzVuFm0i5l73zmrnctBs5BmBnxHJi2KgLki2NUD8xal0ZqjVT cPUQu1xYMJPUI9Xzkl+5QaMUwGFYXhYCg5CRV2uwWgcXQ/BS6xRYLasjuvr9oJfb/CB8 hkS3tis4opRLULEiuNMc047FCkloprCdifhgBPVFvatgq+8Zw0HkJ6ElFW0mVikdAEkr fr9w== X-Gm-Message-State: AFeK/H3dxPb/DbfbsJ4trniLuy01+67F9h6x61RpDyHI52pcD1TsldPRTr36d+KVSPiHgA== X-Received: by 10.99.170.2 with SMTP id e2mr39940994pgf.0.1491546376791; Thu, 06 Apr 2017 23:26:16 -0700 (PDT) From: Phil Dennis-Jordan To: edk2-devel@lists.01.org Date: Fri, 7 Apr 2017 18:25:56 +1200 Message-Id: <1491546358-58572-2-git-send-email-lists@philjordan.eu> X-Mailer: git-send-email 2.3.2 (Apple Git-55) In-Reply-To: <1491546358-58572-1-git-send-email-lists@philjordan.eu> References: <1491546358-58572-1-git-send-email-lists@philjordan.eu> Subject: [edk2] [PATCH v5 1/3] OvmfPkg: VMWare SVGA display device register definitions 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: , Cc: Jordan Justen , Phil Dennis-Jordan , Laszlo Ersek MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Phil Dennis-Jordan This adds a header file defining symbolic constants for the VMWare SVGA virtual display device in preparation for supporting it in QemuVideoDxe. It is mostly an extract of the file lib/vmware/svga_reg.h from commit 329dd537456f93a806841ec8a8213aed11395def of VMWare's vmware-svga repository at git://git.code.sf.net/p/vmware-svga/git (See also http://vmware-svga.sourceforge.net/ ) Only the bare essentials necessary for initialisation, modesetting and framebuffer access have been kept from the original file; macro names have been prefixed with VMWARE_SVGA_ instead of SVGA2_, and the enum definition has been adapted to comply with EDK2 naming conventions. The original file was released by VMWare under the MIT license, this has been retained. Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Phil Dennis-Jordan Reviewed-by: Laszlo Ersek Reviewed-by: Jordan Justen --- Notes: v2: - New, custom header file instead of importing VMWare's verbatim. [Lasz= lo] =20 v3: - Prefixed macros with VMWARE_SVGA_ instead of SVGA2_ [Jordan, Laszlo] - Adjusted enum definition to comply with EDK2 convention [Jordan, Lasz= lo] - Tweaks to definitions of numeric constants [Laszlo] - Renamed the file to fit with convention [Jordan, Laszlo] - Dropped the "2" from SVGA2 wherever appropriate. =20 v4, v5: (no changes) OvmfPkg/Include/IndustryStandard/VmwareSvga.h | 104 ++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/OvmfPkg/Include/IndustryStandard/VmwareSvga.h b/OvmfPkg/Includ= e/IndustryStandard/VmwareSvga.h new file mode 100644 index 000000000000..693d44bab6c3 --- /dev/null +++ b/OvmfPkg/Include/IndustryStandard/VmwareSvga.h @@ -0,0 +1,104 @@ +/** @file + + Macro and enum definitions of a subset of port numbers, register identif= iers + and values required for driving the VMWare SVGA virtual display adapter, + also implemented by Qemu. + + This file's contents was extracted from file lib/vmware/svga_reg.h in co= mmit + 329dd537456f93a806841ec8a8213aed11395def of VMWare's vmware-svga reposit= ory: + git://git.code.sf.net/p/vmware-svga/git + + + Copyright 1998-2009 VMware, Inc. All rights reserved. + Portions Copyright 2017 Phil Dennis-Jordan + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +**/ + +#ifndef _VMWARE_SVGA_H_ +#define _VMWARE_SVGA_H_ + +#include + +// +// IDs for recognising the device +// +#define VMWARE_PCI_VENDOR_ID_VMWARE 0x15AD +#define VMWARE_PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 + +// +// I/O port BAR offsets for register selection and read/write. +// +// The register index is written to the 32-bit index port, followed by a 3= 2-bit +// read or write on the value port to read or set that register's contents. +// +#define VMWARE_SVGA_INDEX_PORT 0x0 +#define VMWARE_SVGA_VALUE_PORT 0x1 + +// +// Some of the device's register indices for basic framebuffer functionali= ty. +// +typedef enum { + VmwareSvgaRegId =3D 0, + VmwareSvgaRegEnable =3D 1, + VmwareSvgaRegWidth =3D 2, + VmwareSvgaRegHeight =3D 3, + VmwareSvgaRegMaxWidth =3D 4, + VmwareSvgaRegMaxHeight =3D 5, + + VmwareSvgaRegBitsPerPixel =3D 7, + + VmwareSvgaRegRedMask =3D 9, + VmwareSvgaRegGreenMask =3D 10, + VmwareSvgaRegBlueMask =3D 11, + VmwareSvgaRegBytesPerLine =3D 12, + + VmwareSvgaRegFbOffset =3D 14, + + VmwareSvgaRegFbSize =3D 16, + VmwareSvgaRegCapabilities =3D 17, + + VmwareSvgaRegHostBitsPerPixel =3D 28, +} VMWARE_SVGA_REGISTER; + +// +// Values used with VmwareSvgaRegId for sanity-checking the device and get= ting +// its version. +// +#define VMWARE_SVGA_MAGIC 0x900000U +#define VMWARE_SVGA_MAKE_ID(ver) (VMWARE_SVGA_MAGIC << 8 | (ver)) + +#define VMWARE_SVGA_VERSION_2 2 +#define VMWARE_SVGA_ID_2 VMWARE_SVGA_MAKE_ID (VMWARE_SVGA_VERSIO= N_2) + +#define VMWARE_SVGA_VERSION_1 1 +#define VMWARE_SVGA_ID_1 VMWARE_SVGA_MAKE_ID (VMWARE_SVGA_VERSIO= N_1) + +#define VMWARE_SVGA_VERSION_0 0 +#define VMWARE_SVGA_ID_0 VMWARE_SVGA_MAKE_ID (VMWARE_SVGA_VERSIO= N_0) + +// +// One of the capability bits advertised by VmwareSvgaRegCapabilities. +// +#define VMWARE_SVGA_CAP_8BIT_EMULATION BIT8 + +#endif --=20 2.3.2 (Apple Git-55) _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel