drm/i915: move psr_setup_done to psr struct
authorRodrigo Vivi <rodrigo.vivi@gmail.com>
Fri, 23 May 2014 20:45:51 +0000 (13:45 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 11 Jun 2014 14:57:23 +0000 (16:57 +0200)
"Because our driver assumes only one panel is PSR capable, and we
already have other PSR information on dev_priv instead of intel_dp. If
we ever support multiple PSR panels, we'll have to move struct
i915_psr to intel_dp anyway." (by Paulo)

v2: Avoid more than one setup. Removing initialization
    and trusting allocation. (By Paulo Zanoni).
v3: rebase.
v4: Adding comment.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h

index 49414d30e8d42d3068cbd21990f1403e3e8b1f5a..ef7ab0af7e478e62f4effc2ab9f0c0aa53c61a79 100644 (file)
@@ -638,6 +638,7 @@ struct i915_drrs {
 struct i915_psr {
        bool sink_support;
        bool source_ok;
+       bool setup_done;
 };
 
 enum intel_pch {
index 52fda950fd2a1556cb23fc000e5a7a575e58e4e1..82edfbceb1ff29a67feb9de8cadee8855fdcc3d8 100644 (file)
@@ -1665,7 +1665,7 @@ static void intel_edp_psr_setup(struct intel_dp *intel_dp)
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct edp_vsc_psr psr_vsc;
 
-       if (intel_dp->psr_setup_done)
+       if (dev_priv->psr.setup_done)
                return;
 
        /* Prepare VSC packet as per EDP 1.3 spec, Table 3.10 */
@@ -1680,7 +1680,7 @@ static void intel_edp_psr_setup(struct intel_dp *intel_dp)
        I915_WRITE(EDP_PSR_DEBUG_CTL(dev), EDP_PSR_DEBUG_MASK_MEMUP |
                   EDP_PSR_DEBUG_MASK_HPD | EDP_PSR_DEBUG_MASK_LPSP);
 
-       intel_dp->psr_setup_done = true;
+       dev_priv->psr.setup_done = true;
 }
 
 static void intel_edp_psr_enable_sink(struct intel_dp *intel_dp)
@@ -4279,8 +4279,6 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 
        intel_dp_aux_init(intel_dp, intel_connector);
 
-       intel_dp->psr_setup_done = false;
-
        if (!intel_edp_init_connector(intel_dp, intel_connector, &power_seq)) {
                drm_dp_aux_unregister(&intel_dp->aux);
                if (is_edp(intel_dp)) {
index bda0ae3d80cc667a5f2706fade10ed58825d34ff..fbf032da1c696b22a5f44d2b4cc14675a63657fe 100644 (file)
@@ -537,7 +537,6 @@ struct intel_dp {
        unsigned long last_power_cycle;
        unsigned long last_power_on;
        unsigned long last_backlight_off;
-       bool psr_setup_done;
        bool use_tps3;
        struct intel_connector *attached_connector;