All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 15/20] drm/i915/overlay: Drop struct_mutex guard
Date: Fri,  4 Oct 2019 14:40:10 +0100	[thread overview]
Message-ID: <20191004134015.13204-16-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20191004134015.13204-1-chris@chris-wilson.co.uk>

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>
---
 drivers/gpu/drm/i915/display/intel_display.c |  7 +------
 drivers/gpu/drm/i915/display/intel_overlay.c | 13 -------------
 drivers/gpu/drm/i915/gt/intel_reset.c        |  4 ----
 3 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 8f7365b8dffb..f3a94a9cff16 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -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)
 {
-	if (intel_crtc->overlay) {
-		struct drm_device *dev = intel_crtc->base.dev;
-
-		mutex_lock(&dev->struct_mutex);
+	if (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
 	 * has to recompute where to put it anyway.
diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
index e12e1a753af0..daea112cbb87 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.c
+++ b/drivers/gpu/drm/i915/display/intel_overlay.c
@@ -439,8 +439,6 @@ static int intel_overlay_release_old_vid(struct intel_overlay *overlay)
 	struct i915_request *rq;
 	u32 *cs;
 
-	lockdep_assert_held(&dev_priv->drm.struct_mutex);
-
 	/*
 	 * Only wait if there is actually an old frame to release to
 	 * guarantee forward progress.
@@ -751,7 +749,6 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
 	struct i915_vma *vma;
 	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));
 
 	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;
 	int ret;
 
-	lockdep_assert_held(&dev_priv->drm.struct_mutex);
 	WARN_ON(!drm_modeset_is_locked(&dev_priv->drm.mode_config.connection_mutex));
 
 	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)) {
 		drm_modeset_lock_all(dev);
-		mutex_lock(&dev->struct_mutex);
-
 		ret = intel_overlay_switch_off(overlay);
-
-		mutex_unlock(&dev->struct_mutex);
 		drm_modeset_unlock_all(dev);
 
 		return ret;
@@ -1088,7 +1080,6 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
 		return -ENOENT;
 
 	drm_modeset_lock_all(dev);
-	mutex_lock(&dev->struct_mutex);
 
 	if (i915_gem_object_is_tiled(new_bo)) {
 		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)
 		goto out_unlock;
 
-	mutex_unlock(&dev->struct_mutex);
 	drm_modeset_unlock_all(dev);
 	i915_gem_object_put(new_bo);
 
 	return 0;
 
 out_unlock:
-	mutex_unlock(&dev->struct_mutex);
 	drm_modeset_unlock_all(dev);
 	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);
-	mutex_lock(&dev->struct_mutex);
 
 	ret = -EINVAL;
 	if (!(attrs->flags & I915_OVERLAY_UPDATE_ATTRS)) {
@@ -1290,7 +1278,6 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
 
 	ret = 0;
 out_unlock:
-	mutex_unlock(&dev->struct_mutex);
 	drm_modeset_unlock_all(dev);
 
 	return ret;
diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c
index 055496f0825f..7b3d9d4517a0 100644
--- a/drivers/gpu/drm/i915/gt/intel_reset.c
+++ b/drivers/gpu/drm/i915/gt/intel_reset.c
@@ -1288,10 +1288,6 @@ int intel_gt_terminally_wedged(struct intel_gt *gt)
 	if (!test_bit(I915_RESET_BACKOFF, &gt->reset.flags))
 		return -EIO;
 
-	/* XXX intel_reset_finish() still takes struct_mutex!!! */
-	if (mutex_is_locked(&gt->i915->drm.struct_mutex))
-		return -EAGAIN;
-
 	if (wait_event_interruptible(gt->reset.queue,
 				     !test_bit(I915_RESET_BACKOFF,
 					       &gt->reset.flags)))
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-10-04 13:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 13:39 struct_mutex, last round? Chris Wilson
2019-10-04 13:39 ` [PATCH 01/20] drm/i915: Only track bound elements of the GTT Chris Wilson
2019-10-04 13:39 ` [PATCH 02/20] drm/i915: Mark up address spaces that may need to allocate Chris Wilson
2019-10-04 13:39 ` [PATCH 03/20] drm/i915: Pull i915_vma_pin under the vm->mutex Chris Wilson
2019-10-18  8:44   ` Daniel Vetter
2019-10-18  8:51     ` Daniel Vetter
2019-10-04 13:39 ` [PATCH 04/20] drm/i915: Push the i915_active.retire into a worker Chris Wilson
2019-10-04 13:40 ` [PATCH 05/20] drm/i915: Coordinate i915_active with its own mutex Chris Wilson
2019-10-04 13:40 ` [PATCH 06/20] drm/i915: Move idle barrier cleanup into engine-pm Chris Wilson
2019-10-04 13:40 ` [PATCH 07/20] drm/i915: Drop struct_mutex from around i915_retire_requests() Chris Wilson
2019-10-04 13:40 ` [PATCH 08/20] drm/i915: Remove the GEM idle worker Chris Wilson
2019-10-04 13:40 ` [PATCH 09/20] drm/i915: Merge wait_for_timelines with retire_request Chris Wilson
2019-10-04 13:40 ` [PATCH 10/20] drm/i915/gem: Retire directly for mmap-offset shrinking Chris Wilson
2019-10-04 13:40 ` [PATCH 11/20] drm/i915: Move request runtime management onto gt Chris Wilson
2019-10-04 13:40 ` [PATCH 12/20] drm/i915: Move global activity tracking from GEM to GT Chris Wilson
2019-10-04 13:40 ` [PATCH 13/20] drm/i915: Remove logical HW ID Chris Wilson
2019-10-04 13:40 ` [PATCH 14/20] drm/i915: Move context management under GEM Chris Wilson
2019-10-04 13:46   ` Tvrtko Ursulin
2019-10-04 13:40 ` Chris Wilson [this message]
2019-10-04 13:40 ` [PATCH 16/20] drm/i915: Drop struct_mutex guard from debugfs/framebuffer_info Chris Wilson
2019-10-04 13:40 ` [PATCH 17/20] drm/i915: Remove struct_mutex guard for debugfs/opregion Chris Wilson
2019-10-04 13:40 ` [PATCH 18/20] drm/i915: Drop struct_mutex from suspend state save/restore Chris Wilson
2019-10-04 13:40 ` [PATCH 19/20] drm/i915/selftests: Drop vestigal struct_mutex guards Chris Wilson
2019-10-04 13:40 ` [PATCH 20/20] drm/i915: Drop struct_mutex from around GEM initialisation Chris Wilson
2019-10-04 14:14 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/20] drm/i915: Only track bound elements of the GTT Patchwork
2019-10-04 14:49 ` ✗ Fi.CI.BAT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191004134015.13204-16-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.