summaryrefslogtreecommitdiff
path: root/src/uxa
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-26 10:07:23 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-28 14:49:07 +0100
commite94f66c951ae9e0d4304cf8005537a147bda5d79 (patch)
tree182721d9d3eed7f31a9840e04ba6d2f273e71be8 /src/uxa
parent04d5c33b9677fc920ad58522f93d832a42de4744 (diff)
intel: Move some backend specific macros out of the common header
All the IS_GEN/IS_DEVICE are only used by the UXA backend, so move them to its headers. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/uxa')
-rw-r--r--src/uxa/intel.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/uxa/intel.h b/src/uxa/intel.h
index d4c9aff2..2b1ff5e2 100644
--- a/src/uxa/intel.h
+++ b/src/uxa/intel.h
@@ -352,6 +352,31 @@ typedef struct intel_screen_private {
Bool has_prime_vmap_flush;
} intel_screen_private;
+#define INTEL_INFO(intel) ((intel)->info)
+#define IS_GENx(intel, X) (INTEL_INFO(intel)->gen >= 8*(X) && INTEL_INFO(intel)->gen < 8*((X)+1))
+#define IS_GEN1(intel) IS_GENx(intel, 1)
+#define IS_GEN2(intel) IS_GENx(intel, 2)
+#define IS_GEN3(intel) IS_GENx(intel, 3)
+#define IS_GEN4(intel) IS_GENx(intel, 4)
+#define IS_GEN5(intel) IS_GENx(intel, 5)
+#define IS_GEN6(intel) IS_GENx(intel, 6)
+#define IS_GEN7(intel) IS_GENx(intel, 7)
+#define IS_HSW(intel) (INTEL_INFO(intel)->gen == 075)
+
+/* Some chips have specific errata (or limits) that we need to workaround. */
+#define IS_I830(intel) (DEVICE_ID((intel)->PciInfo) == PCI_CHIP_I830_M)
+#define IS_845G(intel) (DEVICE_ID((intel)->PciInfo) == PCI_CHIP_845_G)
+#define IS_I865G(intel) (DEVICE_ID((intel)->PciInfo) == PCI_CHIP_I865_G)
+
+#define IS_I915G(pI810) (DEVICE_ID(pI810->PciInfo) == PCI_CHIP_I915_G || DEVICE_ID(pI810->PciInfo) == PCI_CHIP_E7221_G)
+#define IS_I915GM(pI810) (DEVICE_ID(pI810->PciInfo) == PCI_CHIP_I915_GM)
+
+#define IS_965_Q(pI810) (DEVICE_ID(pI810->PciInfo) == PCI_CHIP_I965_Q)
+
+/* supports Y tiled surfaces (pre-965 Mesa isn't ready yet) */
+#define SUPPORTS_YTILING(pI810) (INTEL_INFO(intel)->gen >= 040)
+#define HAS_BLT(pI810) (INTEL_INFO(intel)->gen >= 060)
+
#ifndef I915_PARAM_HAS_PRIME_VMAP_FLUSH
#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
#endif