1. 18 Aug, 2014 3 commits
    • Ville Syrjälä's avatar
      drm/i915: Don't try to enable cursor from setplane when crtc is disabled · 1add143c
      Ville Syrjälä authored
      Make sure the cursor gets fully clipped when enabling it on a disabled
      crtc via setplane. This will prevent the lower level code from
      attempting to enable the cursor in hardware.
      
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      1add143c
    • Ville Syrjälä's avatar
      drm/i915: Skip load detect when intel_crtc->new_enable==true · a459249c
      Ville Syrjälä authored
      During suspend we turn off the crtcs, but leave the staged config in
      place so that we can restore the display(s) to their previous state on
      resume.
      
      During resume when we attempt to apply the force pipe A quirk we use the
      load detect mechanism. That doesn't check whether there was an already
      staged configuration for the crtc since that's not even possible during
      normal runtime load detection. But during resume it is possible, and if
      we just blindly go and overwrite the staged crtc configuration for the
      load detection we can no longer restore the display to the correct
      state.
      
      Even worse, we don't even clear all the staged connector->encoder->crtc
      links so we may end up using a cloned setup for the load detection, and
      after we're done we just clear the links related to the VGA output
      leaving the links for the other outputs in place. This will eventually
      result in calling intel_set_mode() with mode==NULL but with valid
      connector->encoder->crtc links which will result in dereferencing the
      NULL mode since the code thinks it will have to a modeset.
      
      To avoid these problems don't use any crtc with new_enabled==true for
      load detection.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org (for 3.16)
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      a459249c
    • Ville Syrjälä's avatar
      drm/i915: Fix locking for intel_enable_pipe_a() · 208bf9fd
      Ville Syrjälä authored
      intel_enable_pipe_a() gets called with all the modeset locks already
      held (by drm_modeset_lock_all()), so trying to grab the same
      locks using another drm_modeset_acquire_ctx is going to fail miserably.
      
      Move most of the drm_modeset_acquire_ctx handling (init/drop/fini)
      out from intel_{get,release}_load_detect_pipe() into the callers
      (intel_{crt,tv}_detect()). Only the actual locking and backoff
      handling is left in intel_get_load_detect_pipe(). And in
      intel_enable_pipe_a() we just share the mode_config.acquire_ctx from
      drm_modeset_lock_all() which is already holding all the relevant locks.
      
      It's perfectly legal to lock the same ww_mutex multiple times using the
      same ww_acquire_ctx. drm_modeset_lock() will convert the returned
      -EALREADY into 0, so the caller doesn't need to do antyhing special.
      
      Fixes a hang on resume on my 830.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      208bf9fd
  2. 16 Aug, 2014 37 commits