]> xenbits.xensource.com Git - xenclient/ioemu.git/commitdiff
- Pass through some value of the real host in case of intel graphic
authorJean Guyader <jean.guyader@eu.citrix.com>
Thu, 9 Oct 2008 16:51:19 +0000 (17:51 +0100)
committerVincent Hanquez <vincent@snarc.org>
Fri, 31 Oct 2008 12:10:55 +0000 (12:10 +0000)
    card. The graphic card need the know how much merroy has been stolen
    from the physical RAM.

hw/pci.c

index 1de68fddd137c204b1806728bb9b60c614592378..067fd0cfb15bd17fb3657aa766ac5906486dafd2 100644 (file)
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -25,6 +25,7 @@
 #include "pci.h"
 #include "console.h"
 #include "net.h"
+#include "pass-through.h"
 
 //#define DEBUG_PCI
 
@@ -52,6 +53,8 @@ static void pci_set_irq(void *opaque, int irq_num, int level);
 target_phys_addr_t pci_mem_base;
 static PCIBus *first_bus;
 
+extern int vga_passthrough;
+
 static int pcibus_load(QEMUFile *f, void *opaque, int version_id)
 {
     int i, nirq;
@@ -441,7 +444,7 @@ uint32_t pci_data_read(void *opaque, uint32_t addr, int len)
     PCIBus *s = opaque;
     PCIDevice *pci_dev;
     int config_addr, bus_num;
-    uint32_t val;
+    uint32_t val = 0;
 
     bus_num = (addr >> 16) & 0xff;
     while (s && s->bus_num != bus_num)
@@ -466,6 +469,19 @@ uint32_t pci_data_read(void *opaque, uint32_t addr, int len)
         goto the_end;
     }
     config_addr = addr & 0xff;
+
+
+    if (vga_passthrough && pci_dev->devfn == 0x00) //Host Bridge
+    {
+        if (config_addr == 0x52) // GMCH
+            val = pt_pci_host_read_word(0, 0, 0, 0x52);
+        if (config_addr == 0xa0) // Top of memory
+            val = pt_pci_host_read_byte(0, 0, 0, 0xa0);
+        if (config_addr == 0x02) // Device ID
+            val = pt_pci_host_read_byte(0, 0, 0, 0x02);
+        goto the_end;
+    }
+
     val = pci_dev->config_read(pci_dev, config_addr, len);
 #if defined(DEBUG_PCI)
     printf("pci_config_read: %s: addr=%02x val=%08x len=%d\n",