From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IJDfs-0002MC-JM for qemu-devel@nongnu.org; Thu, 09 Aug 2007 15:28:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IJDfp-0002KM-Up for qemu-devel@nongnu.org; Thu, 09 Aug 2007 15:28:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJDfp-0002KJ-Oc for qemu-devel@nongnu.org; Thu, 09 Aug 2007 15:27:57 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IJDfp-0008CB-De for qemu-devel@nongnu.org; Thu, 09 Aug 2007 15:27:57 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l79JRp7Q030506 for ; Thu, 9 Aug 2007 15:27:51 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l79JRphP014689 for ; Thu, 9 Aug 2007 15:27:51 -0400 Received: from [10.13.0.161] (erebor.install.boston.redhat.com [10.13.0.161]) by devserv.devel.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l79JRoBD029731 for ; Thu, 9 Aug 2007 15:27:50 -0400 From: Jeremy Katz Content-Type: multipart/mixed; boundary="=-ATpUtut5YIQAJOXQ2kio" Date: Thu, 09 Aug 2007 15:27:49 -0400 Message-Id: <1186687670.26986.19.camel@erebor.boston.redhat.com> Mime-Version: 1.0 Subject: [Qemu-devel] [PATCH/RFC] Set a (distinguishable) subsystem id for Cirrus VGA Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-ATpUtut5YIQAJOXQ2kio Content-Type: text/plain Content-Transfer-Encoding: 7bit The attached adds a PCI subsystem vendor ID of 0x514D (QM ascii->hex) for the Cirrus emulation so that you can tell that the system is running under qemu. This will make it so that, eg, we can detect that in X and know that resolutions > 800x600 won't blow up a monitor. Downside is that it's not an officially registered vendor ID as it looks like that requires joining the PCI-SIG. Also, if this is interesting, it's probably also worth doing for other emulated PCI devices as well. Jeremy --=-ATpUtut5YIQAJOXQ2kio Content-Disposition: attachment; filename=qemu-vendor-subsystem.patch Content-Type: text/x-patch; name=qemu-vendor-subsystem.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: hw/cirrus_vga.c =================================================================== RCS file: /sources/qemu/qemu/hw/cirrus_vga.c,v retrieving revision 1.26 diff -u -u -r1.26 cirrus_vga.c --- hw/cirrus_vga.c 31 Jul 2007 23:26:00 -0000 1.26 +++ hw/cirrus_vga.c 9 Aug 2007 19:27:03 -0000 @@ -3247,6 +3247,11 @@ pci_conf[0x0a] = PCI_CLASS_SUB_VGA; pci_conf[0x0b] = PCI_CLASS_BASE_DISPLAY; pci_conf[0x0e] = PCI_CLASS_HEADERTYPE_00h; +#define SUBSYSTEM_VENDOR_QEMU 0x514D + pci_conf[0x2c] = (uint8_t) (SUBSYSTEM_VENDOR_QEMU & 0xff); + pci_conf[0x2d] = (uint8_t) (SUBSYSTEM_VENDOR_QEMU >> 8); + pci_conf[0x2e] = (uint8_t) (device_id & 0xff); + pci_conf[0x2f] = (uint8_t) (device_id >> 8); /* setup VGA */ s = &d->cirrus_vga; --=-ATpUtut5YIQAJOXQ2kio--