From e94f66c951ae9e0d4304cf8005537a147bda5d79 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 26 Jul 2013 10:07:23 +0100 Subject: 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 --- src/intel_driver.h | 25 ------------------------- src/sna/sna_video_hwmc.c | 2 +- src/uxa/intel.h | 25 +++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/intel_driver.h b/src/intel_driver.h index 22b623ff..7660f006 100644 --- a/src/intel_driver.h +++ b/src/intel_driver.h @@ -278,31 +278,6 @@ #define SUBSYS_ID(p) (p)->subdevice_id #define CHIP_REVISION(p) (p)->revision -#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) - struct intel_device_info { int gen; }; diff --git a/src/sna/sna_video_hwmc.c b/src/sna/sna_video_hwmc.c index 15a7844a..52f1560b 100644 --- a/src/sna/sna_video_hwmc.c +++ b/src/sna/sna_video_hwmc.c @@ -86,7 +86,7 @@ static int create_context(XvPortPtr port, XvMCContextPtr ctx, else priv->type = XVMC_I965_MPEG2_MC; priv->i965.is_g4x = sna->kgem.gen == 045; - priv->i965.is_965_q = IS_965_Q(sna); + priv->i965.is_965_q = DEVICE_ID(sna->PciInfo) == PCI_CHIP_I965_Q; priv->i965.is_igdng = sna->kgem.gen == 050; } else priv->type = XVMC_I915_MPEG2_MC; 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 -- cgit v1.2.3