qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Katz <katzj@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH/RFC] Set a (distinguishable) subsystem id for Cirrus VGA
Date: Thu, 09 Aug 2007 15:27:49 -0400	[thread overview]
Message-ID: <1186687670.26986.19.camel@erebor.boston.redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

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

[-- Attachment #2: qemu-vendor-subsystem.patch --]
[-- Type: text/x-patch, Size: 764 bytes --]

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;

             reply	other threads:[~2007-08-09 19:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-09 19:27 Jeremy Katz [this message]
2007-08-10 16:28 ` [Qemu-devel] [PATCH/RFC] Set a (distinguishable) subsystem id for Cirrus VGA Paul Brook
2007-08-10 17:13   ` Jeremy Katz
2007-08-10 18:16     ` Paul Brook
2007-08-10 18:55     ` Anthony Liguori
2007-08-10 22:47       ` WaxDragon
2007-08-11 17:14       ` andrzej zaborowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1186687670.26986.19.camel@erebor.boston.redhat.com \
    --to=katzj@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).