]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: use platform enum instead of duplicating PCI ID if possible
authorJani Nikula <jani.nikula@intel.com>
Wed, 30 Nov 2016 15:43:06 +0000 (17:43 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 7 Dec 2016 13:20:43 +0000 (15:20 +0200)
Duplicating the PCI ID for IS_FOO checks is redundant for a bunch of
platforms. Simplify.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/4f79321aca2e003a627ba8b6809af3716b7c25c9.1480520526.git.jani.nikula@intel.com
drivers/gpu/drm/i915/i915_drv.h

index 01e9f5b11f354f05ecfb226deaac4d4791745102..8daa4fb13b52bcabf026aba28788c11ac0d7050f 100644 (file)
@@ -2515,13 +2515,13 @@ intel_info(const struct drm_i915_private *dev_priv)
 #define IS_REVID(p, since, until) \
        (INTEL_REVID(p) >= (since) && INTEL_REVID(p) <= (until))
 
-#define IS_I830(dev_priv)      (INTEL_DEVID(dev_priv) == 0x3577)
-#define IS_I845G(dev_priv)     (INTEL_DEVID(dev_priv) == 0x2562)
+#define IS_I830(dev_priv)      ((dev_priv)->info.platform == INTEL_I830)
+#define IS_I845G(dev_priv)     ((dev_priv)->info.platform == INTEL_I845G)
 #define IS_I85X(dev_priv)      ((dev_priv)->info.platform == INTEL_I85X)
-#define IS_I865G(dev_priv)     (INTEL_DEVID(dev_priv) == 0x2572)
+#define IS_I865G(dev_priv)     ((dev_priv)->info.platform == INTEL_I865G)
 #define IS_I915G(dev_priv)     ((dev_priv)->info.platform == INTEL_I915G)
-#define IS_I915GM(dev_priv)    (INTEL_DEVID(dev_priv) == 0x2592)
-#define IS_I945G(dev_priv)     (INTEL_DEVID(dev_priv) == 0x2772)
+#define IS_I915GM(dev_priv)    ((dev_priv)->info.platform == INTEL_I915GM)
+#define IS_I945G(dev_priv)     ((dev_priv)->info.platform == INTEL_I945G)
 #define IS_I945GM(dev_priv)    ((dev_priv)->info.platform == INTEL_I945GM)
 #define IS_I965G(dev_priv)     ((dev_priv)->info.platform == INTEL_I965G)
 #define IS_I965GM(dev_priv)    ((dev_priv)->info.platform == INTEL_I965GM)