summaryrefslogtreecommitdiff
path: root/src/reg_dumper
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-04-21 15:49:01 -0700
committerEric Anholt <eric@anholt.net>2009-04-27 17:05:59 -0700
commite5133a94dc78411eaef324131ea8056aeb81779e (patch)
treef6ef2a10a7e175e33605cd678d6719d0e136619c /src/reg_dumper
parent4653a7db622ad54a3182d93c81331765d930db34 (diff)
unifdef LIBPCIACCESS and XSERVER_LIBPCIACCESS.
Depending on new server means these are always present.
Diffstat (limited to 'src/reg_dumper')
-rw-r--r--src/reg_dumper/gtt.c8
-rw-r--r--src/reg_dumper/hotplug.c5
-rw-r--r--src/reg_dumper/idle.c5
-rw-r--r--src/reg_dumper/main.c6
-rw-r--r--src/reg_dumper/reg_dumper.h9
-rw-r--r--src/reg_dumper/util.c5
6 files changed, 10 insertions, 28 deletions
diff --git a/src/reg_dumper/gtt.c b/src/reg_dumper/gtt.c
index ead5935b..4a46f118 100644
--- a/src/reg_dumper/gtt.c
+++ b/src/reg_dumper/gtt.c
@@ -59,9 +59,9 @@ int main(int argc, char **argv)
else {
/* 915/945 chips has GTT range in bar 3*/
int err = 0;
- err = pci_device_map_range (pI830->pci_dev,
- pI830->pci_dev->regions[3].base_addr,
- pI830->pci_dev->regions[3].size,
+ err = pci_device_map_range (pI830->PciInfo,
+ pI830->PciInfo->regions[3].base_addr,
+ pI830->PciInfo->regions[3].size,
PCI_DEV_MAP_FLAG_WRITABLE,
(void **)&gtt);
if (err != 0) {
@@ -70,7 +70,7 @@ int main(int argc, char **argv)
}
}
- aper_size = pI830->pci_dev->regions[2].size;
+ aper_size = pI830->PciInfo->regions[2].size;
for (start = 0; start < aper_size; start += KB(4)) {
uint32_t start_pte = INGTT(start);
diff --git a/src/reg_dumper/hotplug.c b/src/reg_dumper/hotplug.c
index 68fe5842..de463844 100644
--- a/src/reg_dumper/hotplug.c
+++ b/src/reg_dumper/hotplug.c
@@ -72,10 +72,7 @@ int main(int argc, char **argv)
if (dev->vendor_id != 0x8086)
errx(1, "Graphics card is non-intel");
- i830.PciInfo = &i830.pci_info_rec;
- i830.PciInfo->chipType = dev->device_id;
-
- i830.pci_dev = dev;
+ i830.PciInfo = dev;
mmio_bar = IS_I9XX((&i830)) ? 0 : 1;
diff --git a/src/reg_dumper/idle.c b/src/reg_dumper/idle.c
index 8d60c0ca..cbd68aa3 100644
--- a/src/reg_dumper/idle.c
+++ b/src/reg_dumper/idle.c
@@ -142,10 +142,7 @@ int main(int argc, char **argv)
if (dev->vendor_id != 0x8086)
errx(1, "Graphics card is non-intel");
- i830.PciInfo = &i830.pci_info_rec;
- i830.PciInfo->chipType = dev->device_id;
-
- i830.pci_dev = dev;
+ i830.PciInfo = dev;
mmio_bar = IS_I9XX((&i830)) ? 0 : 1;
diff --git a/src/reg_dumper/main.c b/src/reg_dumper/main.c
index 5c8ef9ed..ce883ef8 100644
--- a/src/reg_dumper/main.c
+++ b/src/reg_dumper/main.c
@@ -29,7 +29,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
-#include <pciaccess.h>
#include <err.h>
#include "reg_dumper.h"
@@ -62,10 +61,7 @@ int main(int argc, char **argv)
if (dev->vendor_id != 0x8086)
errx(1, "Graphics card is non-intel");
- i830.PciInfo = &i830.pci_info_rec;
- i830.PciInfo->chipType = dev->device_id;
-
- i830.pci_dev = dev;
+ i830.PciInfo = dev;
mmio_bar = IS_I9XX((&i830)) ? 0 : 1;
diff --git a/src/reg_dumper/reg_dumper.h b/src/reg_dumper/reg_dumper.h
index 9f24d5cc..8c2eb0bb 100644
--- a/src/reg_dumper/reg_dumper.h
+++ b/src/reg_dumper/reg_dumper.h
@@ -29,6 +29,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#include <pciaccess.h>
#include "common.h"
/** @file
@@ -45,18 +46,12 @@ typedef char Bool;
#define X_WARNING 1
#define X_ERROR 2
-struct pci_info_rec {
- uint16_t chipType;
-};
-
typedef struct _i830 {
/* Fields in common with the real pI830 */
- struct pci_info_rec *PciInfo;
+ struct pci_device *PciInfo;
Bool use_drm_mode;
/* Fields used for setting up reg_dumper */
- struct pci_device *pci_dev;
- struct pci_info_rec pci_info_rec;
volatile unsigned char *mmio;
} I830Rec, *I830Ptr;
diff --git a/src/reg_dumper/util.c b/src/reg_dumper/util.c
index 6dd1e487..4d6380e9 100644
--- a/src/reg_dumper/util.c
+++ b/src/reg_dumper/util.c
@@ -65,10 +65,7 @@ void intel_i830rec_init(I830Ptr pI830)
if (dev->vendor_id != 0x8086)
errx(1, "Graphics card is non-intel");
- pI830->PciInfo = &pI830->pci_info_rec;
- pI830->PciInfo->chipType = dev->device_id;
-
- pI830->pci_dev = dev;
+ pI830->PciInfo = dev;
mmio_bar = IS_I9XX(pI830) ? 0 : 1;