summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-04-03 00:22:41 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-04-03 00:22:41 +0200
commit16e44f5499e1754dfb10fc62b22675f5aa6ac781 (patch)
tree63296629de16b16c031084ad5ad94ec0090aeb06
parent74f6e413d3cba0e95d1233c71e119ff50cd406d2 (diff)
lib: fixup register access on gen2/3
This wreaked havoc with intel_reg_dumper since it's been broken in commit c6fe31bc473a7ae44bc42bad7da5faca3c924821 Author: Eugeni Dodonov <eugeni.dodonov@intel.com> Date: Thu Jun 21 14:31:34 2012 -0300 intel_reg_dumper: use intel_register_access_init/fini Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--lib/intel_mmio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/intel_mmio.c b/lib/intel_mmio.c
index 2281037c1..ff9cf3f93 100644
--- a/lib/intel_mmio.c
+++ b/lib/intel_mmio.c
@@ -173,13 +173,15 @@ intel_register_access_init(struct pci_device *pci_dev, int safe)
if (mmio_data.inited)
return -1;
+ if (intel_gen(pci_dev->device_id) >= 6)
+ goto done;
+
mmio_data.safe = safe != 0 ? true : false;
mmio_data.i915_devid = pci_dev->device_id;
- if (mmio_data.safe)
+ if (mmio_data.safe && intel_gen(pci_dev->device_id) >= 4)
mmio_data.map = intel_get_register_map(mmio_data.i915_devid);
- if (!(IS_GEN6(pci_dev->device_id) ||
- IS_GEN7(pci_dev->device_id)))
+ if (intel_gen(pci_dev->device_id) >= 6)
goto done;
/* Find where the forcewake lock is */