drm/i915: Split Pineview device info into desktop and mobile
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 26 Mar 2019 07:40:54 +0000 (07:40 +0000)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Mon, 1 Apr 2019 16:15:14 +0000 (17:15 +0100)
This allows the IS_PINEVIEW_<G|M> macros to be removed and avoid
duplication of device ids already defined in i915_pciids.h.

!IS_MOBILE check can be used in place of existing IS_PINEVIEW_G call
sites.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190326074057.27833-2-tvrtko.ursulin@linux.intel.com
arch/x86/kernel/early-quirks.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_pci.c
drivers/gpu/drm/i915/intel_pm.c
include/drm/i915_pciids.h

index 50d5848bf22efb5ffed1292bd8aa354689d2f7dd..f91d3ed2df621e9ef161be78356cb4588c824586 100644 (file)
@@ -525,7 +525,8 @@ static const struct pci_device_id intel_early_ids[] __initconst = {
        INTEL_I945G_IDS(&gen3_early_ops),
        INTEL_I945GM_IDS(&gen3_early_ops),
        INTEL_VLV_IDS(&gen6_early_ops),
-       INTEL_PINEVIEW_IDS(&gen3_early_ops),
+       INTEL_PINEVIEW_G_IDS(&gen3_early_ops),
+       INTEL_PINEVIEW_M_IDS(&gen3_early_ops),
        INTEL_I965G_IDS(&gen3_early_ops),
        INTEL_G33_IDS(&gen3_early_ops),
        INTEL_I965GM_IDS(&gen3_early_ops),
index f75600fa77c600f867c26f9c7fda13fbe179ad7a..d1fd8f7d6f8a7c5793a491370d6f17a1a10dc031 100644 (file)
@@ -2317,8 +2317,6 @@ static inline unsigned int i915_sg_segment_size(void)
 #define IS_G45(dev_priv)       IS_PLATFORM(dev_priv, INTEL_G45)
 #define IS_GM45(dev_priv)      IS_PLATFORM(dev_priv, INTEL_GM45)
 #define IS_G4X(dev_priv)       (IS_G45(dev_priv) || IS_GM45(dev_priv))
-#define IS_PINEVIEW_G(dev_priv)        (INTEL_DEVID(dev_priv) == 0xa001)
-#define IS_PINEVIEW_M(dev_priv)        (INTEL_DEVID(dev_priv) == 0xa011)
 #define IS_PINEVIEW(dev_priv)  IS_PLATFORM(dev_priv, INTEL_PINEVIEW)
 #define IS_G33(dev_priv)       IS_PLATFORM(dev_priv, INTEL_G33)
 #define IS_IRONLAKE_M(dev_priv)        (INTEL_DEVID(dev_priv) == 0x0046)
index a7e1611af26d4d670f098122f805856cccf2f0cf..716f2f95c57d03523e2862ff7308cddb56d76820 100644 (file)
@@ -257,7 +257,14 @@ static const struct intel_device_info intel_g33_info = {
        .display.has_overlay = 1,
 };
 
-static const struct intel_device_info intel_pineview_info = {
+static const struct intel_device_info intel_pineview_g_info = {
+       GEN3_FEATURES,
+       PLATFORM(INTEL_PINEVIEW),
+       .display.has_hotplug = 1,
+       .display.has_overlay = 1,
+};
+
+static const struct intel_device_info intel_pineview_m_info = {
        GEN3_FEATURES,
        PLATFORM(INTEL_PINEVIEW),
        .is_mobile = 1,
@@ -761,7 +768,8 @@ static const struct pci_device_id pciidlist[] = {
        INTEL_I965GM_IDS(&intel_i965gm_info),
        INTEL_GM45_IDS(&intel_gm45_info),
        INTEL_G45_IDS(&intel_g45_info),
-       INTEL_PINEVIEW_IDS(&intel_pineview_info),
+       INTEL_PINEVIEW_G_IDS(&intel_pineview_g_info),
+       INTEL_PINEVIEW_M_IDS(&intel_pineview_m_info),
        INTEL_IRONLAKE_D_IDS(&intel_ironlake_d_info),
        INTEL_IRONLAKE_M_IDS(&intel_ironlake_m_info),
        INTEL_SNB_D_GT1_IDS(&intel_sandybridge_d_gt1_info),
index 9a6eb2ef5f48672af4358d861bcd4ed3ab330987..0e05ee1f3ea0e20397112e488dd12a342386253d 100644 (file)
@@ -850,7 +850,7 @@ static void pineview_update_wm(struct intel_crtc *unused_crtc)
        u32 reg;
        unsigned int wm;
 
-       latency = intel_get_cxsr_latency(IS_PINEVIEW_G(dev_priv),
+       latency = intel_get_cxsr_latency(!IS_MOBILE(dev_priv),
                                         dev_priv->is_ddr3,
                                         dev_priv->fsb_freq,
                                         dev_priv->mem_freq);
@@ -9589,7 +9589,7 @@ void intel_init_pm(struct drm_i915_private *dev_priv)
                dev_priv->display.initial_watermarks = g4x_initial_watermarks;
                dev_priv->display.optimize_watermarks = g4x_optimize_watermarks;
        } else if (IS_PINEVIEW(dev_priv)) {
-               if (!intel_get_cxsr_latency(IS_PINEVIEW_G(dev_priv),
+               if (!intel_get_cxsr_latency(!IS_MOBILE(dev_priv),
                                            dev_priv->is_ddr3,
                                            dev_priv->fsb_freq,
                                            dev_priv->mem_freq)) {
index c7cdbfc4d033bc69dd41c703c9905e7e4c1abaaf..cb9b5b35aa2c08b7ec9617d6a458fa13551433f8 100644 (file)
        INTEL_VGA_DEVICE(0x2e42, info), /* B43_G */ \
        INTEL_VGA_DEVICE(0x2e92, info)  /* B43_G.1 */
 
-#define INTEL_PINEVIEW_IDS(info)                       \
-       INTEL_VGA_DEVICE(0xa001, info),                 \
+#define INTEL_PINEVIEW_G_IDS(info) \
+       INTEL_VGA_DEVICE(0xa001, info)
+
+#define INTEL_PINEVIEW_M_IDS(info) \
        INTEL_VGA_DEVICE(0xa011, info)
 
 #define INTEL_IRONLAKE_D_IDS(info) \