mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-07 06:14:24 +08:00
drm/i915/overlay: Drop struct_mutex guard
The overlay uses the modeset mutex to control itself and only required the struct_mutex for requests, which is now obsolete. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-16-chris@chris-wilson.co.uk
This commit is contained in:
parent
a4e7ccdac3
commit
cb5eb07278
@ -5738,13 +5738,8 @@ void hsw_disable_ips(const struct intel_crtc_state *crtc_state)
|
|||||||
|
|
||||||
static void intel_crtc_dpms_overlay_disable(struct intel_crtc *intel_crtc)
|
static void intel_crtc_dpms_overlay_disable(struct intel_crtc *intel_crtc)
|
||||||
{
|
{
|
||||||
if (intel_crtc->overlay) {
|
if (intel_crtc->overlay)
|
||||||
struct drm_device *dev = intel_crtc->base.dev;
|
|
||||||
|
|
||||||
mutex_lock(&dev->struct_mutex);
|
|
||||||
(void) intel_overlay_switch_off(intel_crtc->overlay);
|
(void) intel_overlay_switch_off(intel_crtc->overlay);
|
||||||
mutex_unlock(&dev->struct_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Let userspace switch the overlay on again. In most cases userspace
|
/* Let userspace switch the overlay on again. In most cases userspace
|
||||||
* has to recompute where to put it anyway.
|
* has to recompute where to put it anyway.
|
||||||
|
@ -439,8 +439,6 @@ static int intel_overlay_release_old_vid(struct intel_overlay *overlay)
|
|||||||
struct i915_request *rq;
|
struct i915_request *rq;
|
||||||
u32 *cs;
|
u32 *cs;
|
||||||
|
|
||||||
lockdep_assert_held(&dev_priv->drm.struct_mutex);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Only wait if there is actually an old frame to release to
|
* Only wait if there is actually an old frame to release to
|
||||||
* guarantee forward progress.
|
* guarantee forward progress.
|
||||||
@ -751,7 +749,6 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
|
|||||||
struct i915_vma *vma;
|
struct i915_vma *vma;
|
||||||
int ret, tmp_width;
|
int ret, tmp_width;
|
||||||
|
|
||||||
lockdep_assert_held(&dev_priv->drm.struct_mutex);
|
|
||||||
WARN_ON(!drm_modeset_is_locked(&dev_priv->drm.mode_config.connection_mutex));
|
WARN_ON(!drm_modeset_is_locked(&dev_priv->drm.mode_config.connection_mutex));
|
||||||
|
|
||||||
ret = intel_overlay_release_old_vid(overlay);
|
ret = intel_overlay_release_old_vid(overlay);
|
||||||
@ -852,7 +849,6 @@ int intel_overlay_switch_off(struct intel_overlay *overlay)
|
|||||||
struct drm_i915_private *dev_priv = overlay->i915;
|
struct drm_i915_private *dev_priv = overlay->i915;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
lockdep_assert_held(&dev_priv->drm.struct_mutex);
|
|
||||||
WARN_ON(!drm_modeset_is_locked(&dev_priv->drm.mode_config.connection_mutex));
|
WARN_ON(!drm_modeset_is_locked(&dev_priv->drm.mode_config.connection_mutex));
|
||||||
|
|
||||||
ret = intel_overlay_recover_from_interrupt(overlay);
|
ret = intel_overlay_recover_from_interrupt(overlay);
|
||||||
@ -1068,11 +1064,7 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
|
|||||||
|
|
||||||
if (!(params->flags & I915_OVERLAY_ENABLE)) {
|
if (!(params->flags & I915_OVERLAY_ENABLE)) {
|
||||||
drm_modeset_lock_all(dev);
|
drm_modeset_lock_all(dev);
|
||||||
mutex_lock(&dev->struct_mutex);
|
|
||||||
|
|
||||||
ret = intel_overlay_switch_off(overlay);
|
ret = intel_overlay_switch_off(overlay);
|
||||||
|
|
||||||
mutex_unlock(&dev->struct_mutex);
|
|
||||||
drm_modeset_unlock_all(dev);
|
drm_modeset_unlock_all(dev);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -1088,7 +1080,6 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
|
|||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
drm_modeset_lock_all(dev);
|
drm_modeset_lock_all(dev);
|
||||||
mutex_lock(&dev->struct_mutex);
|
|
||||||
|
|
||||||
if (i915_gem_object_is_tiled(new_bo)) {
|
if (i915_gem_object_is_tiled(new_bo)) {
|
||||||
DRM_DEBUG_KMS("buffer used for overlay image can not be tiled\n");
|
DRM_DEBUG_KMS("buffer used for overlay image can not be tiled\n");
|
||||||
@ -1152,14 +1143,12 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
|
||||||
mutex_unlock(&dev->struct_mutex);
|
|
||||||
drm_modeset_unlock_all(dev);
|
drm_modeset_unlock_all(dev);
|
||||||
i915_gem_object_put(new_bo);
|
i915_gem_object_put(new_bo);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
mutex_unlock(&dev->struct_mutex);
|
|
||||||
drm_modeset_unlock_all(dev);
|
drm_modeset_unlock_all(dev);
|
||||||
i915_gem_object_put(new_bo);
|
i915_gem_object_put(new_bo);
|
||||||
|
|
||||||
@ -1233,7 +1222,6 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
drm_modeset_lock_all(dev);
|
drm_modeset_lock_all(dev);
|
||||||
mutex_lock(&dev->struct_mutex);
|
|
||||||
|
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
if (!(attrs->flags & I915_OVERLAY_UPDATE_ATTRS)) {
|
if (!(attrs->flags & I915_OVERLAY_UPDATE_ATTRS)) {
|
||||||
@ -1290,7 +1278,6 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
out_unlock:
|
out_unlock:
|
||||||
mutex_unlock(&dev->struct_mutex);
|
|
||||||
drm_modeset_unlock_all(dev);
|
drm_modeset_unlock_all(dev);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1288,10 +1288,6 @@ int intel_gt_terminally_wedged(struct intel_gt *gt)
|
|||||||
if (!test_bit(I915_RESET_BACKOFF, >->reset.flags))
|
if (!test_bit(I915_RESET_BACKOFF, >->reset.flags))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
/* XXX intel_reset_finish() still takes struct_mutex!!! */
|
|
||||||
if (mutex_is_locked(>->i915->drm.struct_mutex))
|
|
||||||
return -EAGAIN;
|
|
||||||
|
|
||||||
if (wait_event_interruptible(gt->reset.queue,
|
if (wait_event_interruptible(gt->reset.queue,
|
||||||
!test_bit(I915_RESET_BACKOFF,
|
!test_bit(I915_RESET_BACKOFF,
|
||||||
>->reset.flags)))
|
>->reset.flags)))
|
||||||
|
Loading…
Reference in New Issue
Block a user