diff options
author | Alan Cox <alan@linux.intel.com> | 2012-05-14 07:04:00 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-17 06:05:30 -0400 |
commit | 4ab2c7f15423f313187b310a48ee0ac631c414f1 (patch) | |
tree | 41844429f95ed794a8b513beee8cf3a7d442d656 /drivers/gpu/drm/gma500/framebuffer.c | |
parent | 6607e024014e4920e8d3e43bcfeec0436d43d980 (diff) |
gma500: unload fixes
Debugging the lid problem tested various error paths which were found
wanting so start fixing them up.
There is a ton of improvement work could be done here so that every bit
of functionality agrees if its _fini, _uninit, etc, and they agree who
is responsible for deciding if the clean up is needed.
That can come later.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/gma500/framebuffer.c')
-rw-r--r-- | drivers/gpu/drm/gma500/framebuffer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 659ed3933b5b..8d77224afc34 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c | |||
@@ -800,15 +800,20 @@ void psb_modeset_init(struct drm_device *dev) | |||
800 | 800 | ||
801 | if (dev_priv->ops->errata) | 801 | if (dev_priv->ops->errata) |
802 | dev_priv->ops->errata(dev); | 802 | dev_priv->ops->errata(dev); |
803 | |||
804 | dev_priv->modeset = true; | ||
803 | } | 805 | } |
804 | 806 | ||
805 | void psb_modeset_cleanup(struct drm_device *dev) | 807 | void psb_modeset_cleanup(struct drm_device *dev) |
806 | { | 808 | { |
807 | mutex_lock(&dev->struct_mutex); | 809 | struct drm_psb_private *dev_priv = dev->dev_private; |
810 | if (dev_priv->modeset) { | ||
811 | mutex_lock(&dev->struct_mutex); | ||
808 | 812 | ||
809 | drm_kms_helper_poll_fini(dev); | 813 | drm_kms_helper_poll_fini(dev); |
810 | psb_fbdev_fini(dev); | 814 | psb_fbdev_fini(dev); |
811 | drm_mode_config_cleanup(dev); | 815 | drm_mode_config_cleanup(dev); |
812 | 816 | ||
813 | mutex_unlock(&dev->struct_mutex); | 817 | mutex_unlock(&dev->struct_mutex); |
818 | } | ||
814 | } | 819 | } |