All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH 15/19] drm: Remove drm_modeset_legacy_acquire_ctx and crtc->acquire_ctx
Date: Wed, 22 Mar 2017 22:50:54 +0100	[thread overview]
Message-ID: <20170322215058.8671-16-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20170322215058.8671-1-daniel.vetter@ffwll.ch>

With all the callers of drm_modeset_lock_crtc gone, and all the places
it was formerly used properly wiring the acquire ctx through, we can
remove this.

The only hidden context magic we still have is now the global one.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_atomic.c          | 14 --------------
 drivers/gpu/drm/drm_atomic_helper.c   |  4 ++--
 drivers/gpu/drm/drm_modeset_lock.c    | 21 ---------------------
 drivers/gpu/drm/i915/intel_display.c  |  4 ++--
 drivers/gpu/drm/i915/intel_pipe_crc.c |  2 +-
 include/drm/drm_crtc.h                |  9 ---------
 include/drm/drm_modeset_lock.h        |  2 --
 7 files changed, 5 insertions(+), 51 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 9b892af7811a..345310213820 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1516,19 +1516,9 @@ EXPORT_SYMBOL(drm_atomic_add_affected_planes);
 void drm_atomic_legacy_backoff(struct drm_atomic_state *state)
 {
 	struct drm_device *dev = state->dev;
-	unsigned crtc_mask = 0;
-	struct drm_crtc *crtc;
 	int ret;
 	bool global = false;
 
-	drm_for_each_crtc(crtc, dev) {
-		if (crtc->acquire_ctx != state->acquire_ctx)
-			continue;
-
-		crtc_mask |= drm_crtc_mask(crtc);
-		crtc->acquire_ctx = NULL;
-	}
-
 	if (WARN_ON(dev->mode_config.acquire_ctx == state->acquire_ctx)) {
 		global = true;
 
@@ -1542,10 +1532,6 @@ void drm_atomic_legacy_backoff(struct drm_atomic_state *state)
 	if (ret)
 		goto retry;
 
-	drm_for_each_crtc(crtc, dev)
-		if (drm_crtc_mask(crtc) & crtc_mask)
-			crtc->acquire_ctx = state->acquire_ctx;
-
 	if (global)
 		dev->mode_config.acquire_ctx = state->acquire_ctx;
 }
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index c0ec763ec538..08d10abcece0 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2289,7 +2289,7 @@ int drm_atomic_helper_set_config(struct drm_mode_set *set)
 		return -ENOMEM;
 
 	state->legacy_set_config = true;
-	state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
+	state->acquire_ctx = crtc->dev->mode_config.acquire_ctx;
 retry:
 	ret = __drm_atomic_helper_set_config(set, state);
 	if (ret != 0)
@@ -2990,7 +2990,7 @@ int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
 	if (!state)
 		return -ENOMEM;
 
-	state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
+	state->acquire_ctx = crtc->dev->mode_config.acquire_ctx;
 retry:
 	crtc_state = drm_atomic_get_crtc_state(state, crtc);
 	if (IS_ERR(crtc_state)) {
diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c
index c3ca6b859236..64ef09a6cccb 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -149,27 +149,6 @@ void drm_modeset_unlock_all(struct drm_device *dev)
 EXPORT_SYMBOL(drm_modeset_unlock_all);
 
 /**
- * drm_modeset_legacy_acquire_ctx - find acquire ctx for legacy ioctls
- * @crtc: drm crtc
- *
- * Legacy ioctl operations like cursor updates or page flips only have per-crtc
- * locking, and store the acquire ctx in the corresponding crtc. All other
- * legacy operations take all locks and use a global acquire context. This
- * function grabs the right one.
- */
-struct drm_modeset_acquire_ctx *
-drm_modeset_legacy_acquire_ctx(struct drm_crtc *crtc)
-{
-	if (crtc->acquire_ctx)
-		return crtc->acquire_ctx;
-
-	WARN_ON(!crtc->dev->mode_config.acquire_ctx);
-
-	return crtc->dev->mode_config.acquire_ctx;
-}
-EXPORT_SYMBOL(drm_modeset_legacy_acquire_ctx);
-
-/**
  * drm_warn_on_modeset_not_all_locked - check that all modeset locks are locked
  * @dev: device
  *
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e27ea89efd67..84abff3f43d9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10715,7 +10715,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 		state = drm_atomic_state_alloc(dev);
 		if (!state)
 			return -ENOMEM;
-		state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
+		state->acquire_ctx = dev->mode_config.acquire_ctx;
 
 retry:
 		plane_state = drm_atomic_get_plane_state(state, primary);
@@ -13075,7 +13075,7 @@ void intel_crtc_restore_mode(struct drm_crtc *crtc)
 		return;
 	}
 
-	state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
+	state->acquire_ctx = crtc->dev->mode_config.acquire_ctx;
 
 retry:
 	crtc_state = drm_atomic_get_crtc_state(state, crtc);
diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c
index 9fd9c70baeed..206ee4f0150e 100644
--- a/drivers/gpu/drm/i915/intel_pipe_crc.c
+++ b/drivers/gpu/drm/i915/intel_pipe_crc.c
@@ -522,7 +522,7 @@ static void hsw_trans_edp_pipe_A_crc_wa(struct drm_i915_private *dev_priv,
 		goto unlock;
 	}
 
-	state->acquire_ctx = drm_modeset_legacy_acquire_ctx(&crtc->base);
+	state->acquire_ctx = crtc->base.dev->mode_config.acquire_ctx;
 	pipe_config = intel_atomic_get_crtc_state(state, crtc);
 	if (IS_ERR(pipe_config)) {
 		ret = PTR_ERR(pipe_config);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index fe42a57393df..bca3330d8085 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -771,15 +771,6 @@ struct drm_crtc {
 	 */
 	spinlock_t commit_lock;
 
-	/**
-	 * @acquire_ctx:
-	 *
-	 * Per-CRTC implicit acquire context used by atomic drivers for legacy
-	 * IOCTLs, so that atomic drivers can get at the locking acquire
-	 * context.
-	 */
-	struct drm_modeset_acquire_ctx *acquire_ctx;
-
 #ifdef CONFIG_DEBUG_FS
 	/**
 	 * @debugfs_entry:
diff --git a/include/drm/drm_modeset_lock.h b/include/drm/drm_modeset_lock.h
index 2bb065bf0593..4b27c2bb955c 100644
--- a/include/drm/drm_modeset_lock.h
+++ b/include/drm/drm_modeset_lock.h
@@ -122,8 +122,6 @@ struct drm_plane;
 void drm_modeset_lock_all(struct drm_device *dev);
 void drm_modeset_unlock_all(struct drm_device *dev);
 void drm_warn_on_modeset_not_all_locked(struct drm_device *dev);
-struct drm_modeset_acquire_ctx *
-drm_modeset_legacy_acquire_ctx(struct drm_crtc *crtc);
 
 int drm_modeset_lock_all_ctx(struct drm_device *dev,
 			     struct drm_modeset_acquire_ctx *ctx);
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-03-22 21:51 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22 21:50 [PATCH 00/19] wire acquire ctx through legacy modeset paths Daniel Vetter
2017-03-22 21:50 ` [PATCH 01/19] drm: Wire up proper acquire ctx for plane functions Daniel Vetter
2017-03-27 20:12   ` Harry Wentland
2017-03-28  6:23     ` Daniel Vetter
2017-03-28  6:46       ` Daniel Vetter
2017-03-28  7:02       ` Daniel Vetter
2017-03-28 14:48         ` Harry Wentland
2017-03-22 21:50 ` [PATCH 02/19] drm: Add acquire ctx parameter to ->update_plane Daniel Vetter
2017-03-22 23:03   ` Russell King - ARM Linux
2017-03-24  7:07     ` Daniel Vetter
2017-03-22 21:50 ` [PATCH 03/19] drm: drm_plane_force_disable is not for atomic drivers Daniel Vetter
2017-03-22 21:50 ` [PATCH 04/19] drm: Add acquire ctx parameter to ->plane_disable Daniel Vetter
2017-03-22 21:50 ` [PATCH 05/19] drm/atomic-helper: remove backoff hack from disable/update_plane Daniel Vetter
2017-03-22 21:50 ` [PATCH 06/19] drm/vmwgfx: Drop the cursor locking hack Daniel Vetter
2017-03-23  6:22   ` Thomas Hellstrom
2017-03-23  7:28     ` Daniel Vetter
2017-03-23  7:31       ` Daniel Vetter
2017-03-23  8:35         ` Thomas Hellstrom
2017-03-23 10:10           ` Daniel Vetter
2017-03-23 10:32             ` Thomas Hellstrom
2017-03-23 12:56               ` Daniel Vetter
2017-03-27  3:01               ` Michel Dänzer
2017-03-27  6:28                 ` Daniel Vetter
2017-03-27  8:31                   ` Thomas Hellstrom
2017-03-29  8:00                     ` Daniel Vetter
2017-03-29  8:04                       ` Thomas Hellstrom
2017-03-22 21:50 ` [PATCH 07/19] drm/tegra: Don't use modeset_lock_crtc Daniel Vetter
2017-03-27 15:50   ` Daniel Vetter
2017-03-22 21:50 ` [PATCH 08/19] drm/tilcdc: Drop calls to modeset_lock_crtc Daniel Vetter
2017-03-24  9:46   ` Tomi Valkeinen
2017-03-25 21:19     ` Daniel Vetter
2017-03-24 13:34   ` Jyri Sarha
2017-03-22 21:50 ` [PATCH 09/19] drm: Make drm_modeset_lock_crtc internal Daniel Vetter
2017-03-22 21:50 ` [PATCH 10/19] drm: Roll out acquire context for the page_flip ioctl Daniel Vetter
2017-03-22 21:50 ` [PATCH 11/19] drm: Add acquire ctx parameter to ->page_flip(_target) Daniel Vetter
2017-03-22 21:50 ` [PATCH 12/19] drm/atomic-helper: remove backoff hack from page_flip Daniel Vetter
2017-03-22 21:50 ` [PATCH 13/19] drm: simplify the locking in the GETCRTC ioctl Daniel Vetter
2017-03-28  0:13   ` Harry Wentland
2017-03-28  6:27     ` Daniel Vetter
2017-03-28  7:01   ` [PATCH] " Daniel Vetter
2017-03-28 14:41     ` Harry Wentland
2017-03-30  7:36     ` [PATCH] Revert unrelated part of "drm: simplify the locking in the GETCRTC ioctl" Maarten Lankhorst
2017-03-30  7:48       ` Pandiyan, Dhinakaran
2017-03-30  7:56         ` [Intel-gfx] " Daniel Vetter
2017-03-22 21:50 ` [PATCH 14/19] drm: Remove drm_modeset_(un)lock_crtc Daniel Vetter
2017-03-22 21:50 ` Daniel Vetter [this message]
2017-03-22 21:50 ` [PATCH 16/19] drm: Restrict drm_mode_set_config_internal to non-atomic drivers Daniel Vetter
2017-03-22 21:50 ` [PATCH 17/19] drm: Add explicit acquire ctx handling around ->set_config Daniel Vetter
2017-03-22 21:50 ` [PATCH 18/19] drm: Add acquire ctx parameter to ->set_config Daniel Vetter
2017-04-04  0:06   ` Sinclair Yeh
2017-03-22 21:50 ` [PATCH 19/19] drm/atomic-helper: Remove the backoff hack from set_config Daniel Vetter
2017-03-23  9:37 ` ✗ Fi.CI.BAT: warning for wire acquire ctx through legacy modeset paths Patchwork
2017-03-28  0:31 ` [PATCH 00/19] " Harry Wentland
2017-03-28  7:20 ` ✓ Fi.CI.BAT: success for wire acquire ctx through legacy modeset paths (rev2) 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=20170322215058.8671-16-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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.