diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-08-13 08:09:46 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-08-13 09:39:23 -0400 |
commit | 82e3b8c130f046b7dd1e7898c10e40edb52fee6d (patch) | |
tree | fd356f0f4a7557e34ed4cdee0bf65feb474ea654 /drivers/gpu/drm/i915/i915_drv.c | |
parent | 7312e2ddec1ffe4511a85a2814df44e79ded3c1d (diff) |
drm/i915: Localise the fbdev console lock frobbing
Rather than take and release the console_lock() around a non-existent
DRM_I915_FBDEV, move the lock acquisation into the callee where it will
be compiled out by the config option entirely. This includes moving the
deferred fb_set_suspend() dance and encapsulating it entirely within
intel_fbdev.c.
v2: Use an integral work item so that we can explicitly flush the work
upon suspend/unload.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
[danvet: Add the flush_work in fbdev_fini per the mailing list
discussion. And s/BUG_ON/WARN_ON/ because.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index ec96f9a9724c..01de97776d81 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -558,9 +558,7 @@ static int i915_drm_freeze(struct drm_device *dev) | |||
558 | intel_uncore_forcewake_reset(dev, false); | 558 | intel_uncore_forcewake_reset(dev, false); |
559 | intel_opregion_fini(dev); | 559 | intel_opregion_fini(dev); |
560 | 560 | ||
561 | console_lock(); | 561 | intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED, true); |
562 | intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED); | ||
563 | console_unlock(); | ||
564 | 562 | ||
565 | dev_priv->suspend_count++; | 563 | dev_priv->suspend_count++; |
566 | 564 | ||
@@ -599,18 +597,6 @@ int i915_suspend(struct drm_device *dev, pm_message_t state) | |||
599 | return 0; | 597 | return 0; |
600 | } | 598 | } |
601 | 599 | ||
602 | void intel_console_resume(struct work_struct *work) | ||
603 | { | ||
604 | struct drm_i915_private *dev_priv = | ||
605 | container_of(work, struct drm_i915_private, | ||
606 | console_resume_work); | ||
607 | struct drm_device *dev = dev_priv->dev; | ||
608 | |||
609 | console_lock(); | ||
610 | intel_fbdev_set_suspend(dev, FBINFO_STATE_RUNNING); | ||
611 | console_unlock(); | ||
612 | } | ||
613 | |||
614 | static int i915_drm_thaw_early(struct drm_device *dev) | 600 | static int i915_drm_thaw_early(struct drm_device *dev) |
615 | { | 601 | { |
616 | struct drm_i915_private *dev_priv = dev->dev_private; | 602 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -681,17 +667,7 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) | |||
681 | 667 | ||
682 | intel_opregion_init(dev); | 668 | intel_opregion_init(dev); |
683 | 669 | ||
684 | /* | 670 | intel_fbdev_set_suspend(dev, FBINFO_STATE_RUNNING, false); |
685 | * The console lock can be pretty contented on resume due | ||
686 | * to all the printk activity. Try to keep it out of the hot | ||
687 | * path of resume if possible. | ||
688 | */ | ||
689 | if (console_trylock()) { | ||
690 | intel_fbdev_set_suspend(dev, FBINFO_STATE_RUNNING); | ||
691 | console_unlock(); | ||
692 | } else { | ||
693 | schedule_work(&dev_priv->console_resume_work); | ||
694 | } | ||
695 | 671 | ||
696 | mutex_lock(&dev_priv->modeset_restore_lock); | 672 | mutex_lock(&dev_priv->modeset_restore_lock); |
697 | dev_priv->modeset_restore = MODESET_DONE; | 673 | dev_priv->modeset_restore = MODESET_DONE; |