From 593a47f00e3c9cb3f748daae7d3fe04427c7e0c2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 12 Apr 2009 15:57:07 -0700 Subject: [PATCH] intel_gpu_dump: Get the devid so we can decode correctly on gen4. --- lib/intel_gpu_tools.c | 12 ++++++++++-- lib/intel_gpu_tools.h | 1 + tools/intel_gpu_dump.c | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/intel_gpu_tools.c b/lib/intel_gpu_tools.c index 3c2d65b..6c85d2a 100644 --- a/lib/intel_gpu_tools.c +++ b/lib/intel_gpu_tools.c @@ -54,10 +54,9 @@ intel_get_drm_devid(int fd) } void -intel_get_mmio(void) +intel_get_pci_device(void) { int err; - int mmio_bar; err = pci_system_init(); if (err != 0) { @@ -81,6 +80,15 @@ intel_get_mmio(void) if (pci_dev->vendor_id != 0x8086) errx(1, "Graphics card is non-intel"); devid = pci_dev->device_id; +} + +void +intel_get_mmio(void) +{ + int mmio_bar; + int err; + + intel_get_pci_device(); if (IS_9XX(devid)) mmio_bar = 0; diff --git a/lib/intel_gpu_tools.h b/lib/intel_gpu_tools.h index c1064a3..d696d72 100644 --- a/lib/intel_gpu_tools.h +++ b/lib/intel_gpu_tools.h @@ -42,6 +42,7 @@ INREG(uint32_t reg) return *(volatile uint32_t *)((volatile char *)mmio + reg); } +void intel_get_pci_device(void); void intel_get_mmio(void); void intel_get_drm_devid(int fd); void intel_copy_bo(struct intel_batchbuffer *batch, diff --git a/tools/intel_gpu_dump.c b/tools/intel_gpu_dump.c index 81b7f7d..3caa2b3 100644 --- a/tools/intel_gpu_dump.c +++ b/tools/intel_gpu_dump.c @@ -47,6 +47,7 @@ #include "intel_decode.h" #include "intel_chipset.h" +#include "intel_gpu_tools.h" #define BUFFER_FAIL(_count, _len, _name) do { \ fprintf(out, "Buffer size too small in %s (%d < %d)\n", \ @@ -1858,11 +1859,12 @@ main (int argc, char *argv[]) return 1; } + intel_get_pci_device(); filename = argv[1]; read_data_file (filename, &data, &count); - intel_decode (data, count, 0, 0); + intel_decode (data, count, 0, devid); free (data); -- 2.7.4