Commit 4f9e860e authored by Fernando Ramos's avatar Fernando Ramos Committed by Sean Paul

drm/gma500: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()

As requested in Documentation/gpu/todo.rst, replace driver calls to
drm_modeset_lock_all() with DRM_MODESET_LOCK_ALL_BEGIN() and
DRM_MODESET_LOCK_ALL_END()
Signed-off-by: default avatarFernando Ramos <greenfoo@u92.eu>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210924064324.229457-15-greenfoo@u92.eu
parent 984c9949
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/backlight.h> #include <linux/backlight.h>
#include <drm/drm.h> #include <drm/drm.h>
#include <drm/drm_drv.h>
#include "gma_device.h" #include "gma_device.h"
#include "intel_bios.h" #include "intel_bios.h"
...@@ -169,8 +170,10 @@ static int psb_save_display_registers(struct drm_device *dev) ...@@ -169,8 +170,10 @@ static int psb_save_display_registers(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_modeset_acquire_ctx ctx;
struct gma_connector *connector; struct gma_connector *connector;
struct psb_state *regs = &dev_priv->regs.psb; struct psb_state *regs = &dev_priv->regs.psb;
int ret;
/* Display arbitration control + watermarks */ /* Display arbitration control + watermarks */
regs->saveDSPARB = PSB_RVDC32(DSPARB); regs->saveDSPARB = PSB_RVDC32(DSPARB);
...@@ -183,7 +186,7 @@ static int psb_save_display_registers(struct drm_device *dev) ...@@ -183,7 +186,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 */
drm_modeset_lock_all(dev); DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
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))
dev_priv->ops->save_crtc(crtc); dev_priv->ops->save_crtc(crtc);
...@@ -193,8 +196,9 @@ static int psb_save_display_registers(struct drm_device *dev) ...@@ -193,8 +196,9 @@ static int psb_save_display_registers(struct drm_device *dev)
if (connector->save) if (connector->save)
connector->save(&connector->base); connector->save(&connector->base);
drm_modeset_unlock_all(dev); DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
return 0;
return ret;
} }
/** /**
...@@ -207,8 +211,10 @@ static int psb_restore_display_registers(struct drm_device *dev) ...@@ -207,8 +211,10 @@ static int psb_restore_display_registers(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_modeset_acquire_ctx ctx;
struct gma_connector *connector; struct gma_connector *connector;
struct psb_state *regs = &dev_priv->regs.psb; struct psb_state *regs = &dev_priv->regs.psb;
int ret;
/* Display arbitration + watermarks */ /* Display arbitration + watermarks */
PSB_WVDC32(regs->saveDSPARB, DSPARB); PSB_WVDC32(regs->saveDSPARB, DSPARB);
...@@ -223,7 +229,7 @@ static int psb_restore_display_registers(struct drm_device *dev) ...@@ -223,7 +229,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);
drm_modeset_lock_all(dev); DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
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))
dev_priv->ops->restore_crtc(crtc); dev_priv->ops->restore_crtc(crtc);
...@@ -232,8 +238,8 @@ static int psb_restore_display_registers(struct drm_device *dev) ...@@ -232,8 +238,8 @@ static int psb_restore_display_registers(struct drm_device *dev)
if (connector->restore) if (connector->restore)
connector->restore(&connector->base); connector->restore(&connector->base);
drm_modeset_unlock_all(dev); DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
return 0; return ret;
} }
static int psb_power_down(struct drm_device *dev) static int psb_power_down(struct drm_device *dev)
......
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