Commit 0a819515 authored by Daniel Vetter's avatar Daniel Vetter

drm/gma500: use drm_modeset_lock_all

Only two places:
- suspend/resume
- Some really strange mode validation tool with too much funny-lucking
  hand-rolled conversion code.
- The recently-added lastclose fbdev restore code.

Better safe than sorry, so convert both places to keep the locking
semantics as much as possible.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent a0e99e68
...@@ -194,7 +194,7 @@ static int psb_save_display_registers(struct drm_device *dev) ...@@ -194,7 +194,7 @@ static int psb_save_display_registers(struct drm_device *dev)
regs->saveCHICKENBIT = PSB_RVDC32(DSPCHICKENBIT); regs->saveCHICKENBIT = PSB_RVDC32(DSPCHICKENBIT);
/* Save crtc and output state */ /* Save crtc and output state */
mutex_lock(&dev->mode_config.mutex); drm_modeset_lock_all(dev);
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
if (drm_helper_crtc_in_use(crtc)) if (drm_helper_crtc_in_use(crtc))
crtc->funcs->save(crtc); crtc->funcs->save(crtc);
...@@ -204,7 +204,7 @@ static int psb_save_display_registers(struct drm_device *dev) ...@@ -204,7 +204,7 @@ static int psb_save_display_registers(struct drm_device *dev)
if (connector->funcs->save) if (connector->funcs->save)
connector->funcs->save(connector); connector->funcs->save(connector);
mutex_unlock(&dev->mode_config.mutex); drm_modeset_unlock_all(dev);
return 0; return 0;
} }
...@@ -234,7 +234,7 @@ static int psb_restore_display_registers(struct drm_device *dev) ...@@ -234,7 +234,7 @@ static int psb_restore_display_registers(struct drm_device *dev)
/*make sure VGA plane is off. it initializes to on after reset!*/ /*make sure VGA plane is off. it initializes to on after reset!*/
PSB_WVDC32(0x80000000, VGACNTRL); PSB_WVDC32(0x80000000, VGACNTRL);
mutex_lock(&dev->mode_config.mutex); drm_modeset_lock_all(dev);
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
if (drm_helper_crtc_in_use(crtc)) if (drm_helper_crtc_in_use(crtc))
crtc->funcs->restore(crtc); crtc->funcs->restore(crtc);
...@@ -243,7 +243,7 @@ static int psb_restore_display_registers(struct drm_device *dev) ...@@ -243,7 +243,7 @@ static int psb_restore_display_registers(struct drm_device *dev)
if (connector->funcs->restore) if (connector->funcs->restore)
connector->funcs->restore(connector); connector->funcs->restore(connector);
mutex_unlock(&dev->mode_config.mutex); drm_modeset_unlock_all(dev);
return 0; return 0;
} }
......
...@@ -153,11 +153,11 @@ static void psb_lastclose(struct drm_device *dev) ...@@ -153,11 +153,11 @@ static void psb_lastclose(struct drm_device *dev)
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = dev->dev_private;
struct psb_fbdev *fbdev = dev_priv->fbdev; struct psb_fbdev *fbdev = dev_priv->fbdev;
mutex_lock(&dev->mode_config.mutex); drm_modeset_lock_all(dev);
ret = drm_fb_helper_restore_fbdev_mode(&fbdev->psb_fb_helper); ret = drm_fb_helper_restore_fbdev_mode(&fbdev->psb_fb_helper);
if (ret) if (ret)
DRM_DEBUG("failed to restore crtc mode\n"); DRM_DEBUG("failed to restore crtc mode\n");
mutex_unlock(&dev->mode_config.mutex); drm_modeset_unlock_all(dev);
return; return;
} }
...@@ -486,7 +486,7 @@ static int psb_mode_operation_ioctl(struct drm_device *dev, void *data, ...@@ -486,7 +486,7 @@ static int psb_mode_operation_ioctl(struct drm_device *dev, void *data,
case PSB_MODE_OPERATION_MODE_VALID: case PSB_MODE_OPERATION_MODE_VALID:
umode = &arg->mode; umode = &arg->mode;
mutex_lock(&dev->mode_config.mutex); drm_modeset_lock_all(dev);
obj = drm_mode_object_find(dev, obj_id, obj = drm_mode_object_find(dev, obj_id,
DRM_MODE_OBJECT_CONNECTOR); DRM_MODE_OBJECT_CONNECTOR);
...@@ -535,7 +535,7 @@ static int psb_mode_operation_ioctl(struct drm_device *dev, void *data, ...@@ -535,7 +535,7 @@ static int psb_mode_operation_ioctl(struct drm_device *dev, void *data,
if (mode) if (mode)
drm_mode_destroy(dev, mode); drm_mode_destroy(dev, mode);
mode_op_out: mode_op_out:
mutex_unlock(&dev->mode_config.mutex); drm_modeset_unlock_all(dev);
return ret; return ret;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment