drm/i915: get rid of dev_priv->info->has_pch_split
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Tue, 3 Jul 2012 18:57:32 +0000 (15:57 -0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 5 Jul 2012 07:56:05 +0000 (09:56 +0200)
Previously we had has_pch_split to tell us whether we had a PCH or not
and we also had dev_priv->pch_type to tell us which kind of PCH it
was, but it could only be used if we were 100% sure we did have a PCH.
Now that PCH_NONE was added to dev_priv->pch_type we don't need
has_pch_split anymore: we can just check for pch_type != PCH_NONE.

The HAS_PCH_{IBX,CPT,LPT} macros use dev_priv->pch_type, so they can
only be called after intel_detect_pch. The HAS_PCH_SPLIT macro looks
at dev_priv->info->has_pch_split, which is available earlier.

Since the goal is to implement HAS_PCH_SPLIT using dev_priv->pch_type
instead of dev_priv->info->has_pch_split, we need to make sure that
intel_detect_pch is called before any calls to HAS_PCH_SPLIT are made.
So we moved the intel_detect_pch call to an earlier stage.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h

index 4dc76976c0d0c274604a850c92166b1ba3b78feb..f64ef4b723fda8cc0d916294d3e1cd01a87dba40 100644 (file)
@@ -1547,6 +1547,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
                goto out_mtrrfree;
        }
 
+       /* This must be called before any calls to HAS_PCH_* */
+       intel_detect_pch(dev);
+
        intel_irq_init(dev);
        intel_gt_init(dev);
 
@@ -1599,8 +1602,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
        /* Start out suspended */
        dev_priv->mm.suspended = 1;
 
-       intel_detect_pch(dev);
-
        if (drm_core_check_feature(dev, DRIVER_MODESET)) {
                ret = i915_load_modeset_init(dev);
                if (ret < 0) {
index c7e76e03a684046bbd986ea23f747c3aa86e88b5..f2c0100e0630925adbcba24edc3ef42c88f54b76 100644 (file)
@@ -216,7 +216,6 @@ static const struct intel_device_info intel_ironlake_d_info = {
        .gen = 5,
        .need_gfx_hws = 1, .has_hotplug = 1,
        .has_bsd_ring = 1,
-       .has_pch_split = 1,
 };
 
 static const struct intel_device_info intel_ironlake_m_info = {
@@ -224,7 +223,6 @@ static const struct intel_device_info intel_ironlake_m_info = {
        .need_gfx_hws = 1, .has_hotplug = 1,
        .has_fbc = 1,
        .has_bsd_ring = 1,
-       .has_pch_split = 1,
 };
 
 static const struct intel_device_info intel_sandybridge_d_info = {
@@ -233,7 +231,6 @@ static const struct intel_device_info intel_sandybridge_d_info = {
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
        .has_llc = 1,
-       .has_pch_split = 1,
        .has_force_wake = 1,
 };
 
@@ -244,7 +241,6 @@ static const struct intel_device_info intel_sandybridge_m_info = {
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
        .has_llc = 1,
-       .has_pch_split = 1,
        .has_force_wake = 1,
 };
 
@@ -254,7 +250,6 @@ static const struct intel_device_info intel_ivybridge_d_info = {
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
        .has_llc = 1,
-       .has_pch_split = 1,
        .has_force_wake = 1,
 };
 
@@ -265,7 +260,6 @@ static const struct intel_device_info intel_ivybridge_m_info = {
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
        .has_llc = 1,
-       .has_pch_split = 1,
        .has_force_wake = 1,
 };
 
@@ -293,7 +287,6 @@ static const struct intel_device_info intel_haswell_d_info = {
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
        .has_llc = 1,
-       .has_pch_split = 1,
        .has_force_wake = 1,
 };
 
@@ -303,7 +296,6 @@ static const struct intel_device_info intel_haswell_m_info = {
        .has_bsd_ring = 1,
        .has_blt_ring = 1,
        .has_llc = 1,
-       .has_pch_split = 1,
        .has_force_wake = 1,
 };
 
index 57d05c798c4b9aada4b3f5fd68049e0f0898a1e2..d839e4c24d69347924d417cc5cffce8d31df0d93 100644 (file)
@@ -288,7 +288,6 @@ struct intel_device_info {
        u8 is_crestline:1;
        u8 is_ivybridge:1;
        u8 is_valleyview:1;
-       u8 has_pch_split:1;
        u8 has_force_wake:1;
        u8 is_haswell:1;
        u8 has_fbc:1;
@@ -1121,13 +1120,13 @@ struct drm_i915_file_private {
 #define HAS_PIPE_CXSR(dev) (INTEL_INFO(dev)->has_pipe_cxsr)
 #define I915_HAS_FBC(dev) (INTEL_INFO(dev)->has_fbc)
 
-#define HAS_PCH_SPLIT(dev) (INTEL_INFO(dev)->has_pch_split)
 #define HAS_PIPE_CONTROL(dev) (INTEL_INFO(dev)->gen >= 5)
 
 #define INTEL_PCH_TYPE(dev) (((struct drm_i915_private *)(dev)->dev_private)->pch_type)
 #define HAS_PCH_LPT(dev) (INTEL_PCH_TYPE(dev) == PCH_LPT)
 #define HAS_PCH_CPT(dev) (INTEL_PCH_TYPE(dev) == PCH_CPT)
 #define HAS_PCH_IBX(dev) (INTEL_PCH_TYPE(dev) == PCH_IBX)
+#define HAS_PCH_SPLIT(dev) (INTEL_PCH_TYPE(dev) != PCH_NONE)
 
 #define HAS_FORCE_WAKE(dev) (INTEL_INFO(dev)->has_force_wake)