1. 23 Jul, 2014 9 commits
    • Daniel Vetter's avatar
      drm/i915: Fix up PSR frontbuffer tracking · 9ca15301
      Daniel Vetter authored
      I've tried to split this up, but all the changes are so tightly
      related that I didn't find a good way to do this without breaking
      bisecting. Essentially this completely changes how psr is glued into
      the overall driver, and there's not much you can do to soften such a
      paradigm change.
      
      - Use frontbuffer tracking bits stuff to separate disable and
        re-enable.
      
      - Don't re-check everything in the psr work. We have now accurate
        tracking for everything, so no need to check for sprites or tiling
        really. Allows us to ditch tons of locks.
      
      - That in turn allows us to properly cancel the work in the disable
        function - no more deadlocks.
      
      - Add a check for HSW sprites and force a flush. Apparently the
        hardware doesn't forward the flushing when updating the sprite base
        address. We can do the same trick everywhere else we have such
        issues, e.g. on baytrail with ... everything.
      
      - Don't re-enable psr with a delay in psr_exit. It really must be
        turned off forever if we detect a gtt write. At least with the
        current frontbuffer render tracking. Userspace can do a busy ioctl
        call or no-op pageflip to re-enable psr.
      
      - Drop redundant checks for crtc and crtc->active - now that they're
        only called from enable this is guaranteed.
      
      - Fix up the hsw port check. eDP can also happen on port D, but the
        issue is exactly that it doesn't work there. So an || check is
        wrong.
      
      - We still schedule the psr work with a delay. The frontbuffer
        flushing interface mandates that we upload the next full frame, so
        need to wait a bit. Once we have single-shot frame uploads we can do
        better here.
      
      v2: Don't enable psr initially, rely upon the fb flush of the initial
      plane setup for that. Gives us more unified code flow and makes the
      crtc enable sequence less a special case.
      
      v3: s/psr_exit/psr_invalidate/ for consistency
      
      v4: Fixup whitespace.
      
      v5: Correctly bail out of psr_invalidate/flush when
      dev_priv->psr.enabled is NULL. Spotted by Rodrigo.
      
      v6:
      - Only schedule work when there's work to do. Fixes WARNINGs reported
        by Rodrigo.
      - Comments Chris requested to clarify the code.
      
      v7: Fix conflict on rebase (Rodrigo)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v6)
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      9ca15301
    • Daniel Vetter's avatar
      drm/i915: Add locking to psr code · f0355c4a
      Daniel Vetter authored
      It's not really optional to have locking ...
      
      The ugly part is how much locking the psr work needs since it has to
      recheck everything. Which is way too much. But we need to ditch the
      psr work in it's current form anyway and implement proper frontbuffer
      tracking.
      
      The other nasty bit that had to go was the delayed work cancle in
      psr_exit. Which means a bunch of races just became a bit more likely,
      but mea culpa.
      
      v2: Fixup HAS_PSR checks, resulting in uninitialized mutex issues.
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      f0355c4a
    • Daniel Vetter's avatar
      drm/i915: More checks for psr.enabled · 109fc2ad
      Daniel Vetter authored
      We need to make sure that no one else is using this in the
      enable function and also that the work item hasn't raced
      with the disabled function.
      
      v2: Improve bisectability by moving one hunk to an earlier patch.
      
      v3: added missing dev_priv declaration (Rodrigo)
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v2)
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      109fc2ad
    • Daniel Vetter's avatar
      drm/i915: Lock down psr sw/hw state tracking · 3638379c
      Daniel Vetter authored
      Make sure we track the sw side (psr.active) correctly and WARN
      everywhere it might get out of sync with the hw.
      
      v2: Fixup WARN_ON logic inversion, reported by Rodrigo.
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      3638379c
    • Daniel Vetter's avatar
      drm/i915: Don't try to disable psr harder from the work item · e921bcbf
      Daniel Vetter authored
      It's disabled already except when we've raced.
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      e921bcbf
    • Daniel Vetter's avatar
      drm/i915: Track the psr dp connector in dev_priv->psr.enabled · 2807cf69
      Daniel Vetter authored
      Trying to fish that one out through looping is a bit a locking
      nightmare. So just set it and use it in the work struct.
      
      v2:
      - Don't Oops in psr_work, spotted by Rodrigo.
      - Fix compile warning.
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      2807cf69
    • Daniel Vetter's avatar
      drm/i915: Add a FIXME about drrs/psr interactions · 1fcc9d1c
      Daniel Vetter authored
      Can't review this right now due to lack of DRRS code.
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Vandana Kannan <vandana.kannan@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      1fcc9d1c
    • Daniel Vetter's avatar
      drm/i915: Run psr_setup unconditionally · 9a603f48
      Daniel Vetter authored
      Due to runtime pm and system s/r we need to restore hw state every
      time we enable a pipe again. Hence trying to avoid that is just
      pointless book-keeping which Rodrigo then tried to work around by
      manually adding psr_setup calls to our resume code.
      
      Much simpler to just remove code instead.
      
      v2: Properly bail out of psr exit if psr isn't enabled. Spotted by
      Rodrigo.
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      9a603f48
    • Borun Fu's avatar
      drm/i915: Power gating display wells during i915_pm_suspend · b04c5bd6
      Borun Fu authored
      On VLV, after i915_pm_suspend display power wells are staying
      power ungated. So, after initiating mem sleep "echo mem > /sys/power/state"
      Display is staing D0 State. There might be better way/place to power gate
      these wells. Also, we need to make sure that if wells are power gated due to
      DPMS OFF sequence, they need not be turned off by i915_pm_suspend again.
      
      v2: Extracted helper for intel_crtc_disable and power gating CRTC power wells.
      [Daniel]
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Change-Id: I34c80da66aa24c423a5576c68aa1f3a8d0f43848
      Signed-off-by: default avatarBorun Fu <borun.fu@intel.com>
      Signed-off-by: default avatarSagar Kamble <sagar.a.kamble@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      b04c5bd6
  2. 12 Jul, 2014 2 commits
  3. 11 Jul, 2014 18 commits
  4. 10 Jul, 2014 11 commits