]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: Shuffle modeset reset handling around
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 16 Jan 2014 21:28:44 +0000 (22:28 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 24 Jan 2014 16:22:52 +0000 (17:22 +0100)
Currently we're doing the reset handling a bit late, and we're doing
it both in the driver load code and on resume. This makes it unusable
for e.g. resetting the panel power sequence state like Paulo wants to.

Instead of adding yet another single-use callback shuffle things
around:
- Output handling code is responsible to reset/init all state on its
  own at driver load time.
- We call the reset functions much earlier, before we start using any
  of the modeset code.

Compared to Paulo's new ->resume callback the only difference in
placement is that ->reset is still called without dev->struct_mutex
held. Which is imo a feature.

v2: Rebase on top of the now merge dinq.

Cc: Paulo Zanoni <przanoni@gmail.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/intel_crt.c
drivers/gpu/drm/i915/intel_display.c

index 04f1f02c4019f57873caeb0c70fea14e0816ddeb..56e5ebbf322fccae79463160c724167cd4fcb137 100644 (file)
@@ -643,6 +643,7 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
        /* KMS EnterVT equivalent */
        if (drm_core_check_feature(dev, DRIVER_MODESET)) {
                intel_init_pch_refclk(dev);
+               drm_mode_config_reset(dev);
 
                mutex_lock(&dev->struct_mutex);
 
@@ -655,7 +656,6 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
                intel_modeset_init_hw(dev);
 
                drm_modeset_lock_all(dev);
-               drm_mode_config_reset(dev);
                intel_modeset_setup_hw_state(dev, true);
                drm_modeset_unlock_all(dev);
 
index e2e39e65f10954b8076b3ed01b565f0cb173bb0d..5b444a4b625caa449d26eebaf12126253344521d 100644 (file)
@@ -857,4 +857,6 @@ void intel_crt_init(struct drm_device *dev)
 
                dev_priv->fdi_rx_config = I915_READ(_FDI_RXA_CTL) & fdi_config;
        }
+
+       intel_crt_reset(connector);
 }
index 8d9dde9b7261ab464ef56125dea71930976478c0..8a715d4fae8493662adb2ac9773d6473745a6d83 100644 (file)
@@ -11441,7 +11441,6 @@ void intel_modeset_gem_init(struct drm_device *dev)
        intel_setup_overlay(dev);
 
        mutex_lock(&dev->mode_config.mutex);
-       drm_mode_config_reset(dev);
        intel_modeset_setup_hw_state(dev, false);
        mutex_unlock(&dev->mode_config.mutex);
 }