public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 5/8] drm/i915: Remove last references to drm_atomic_get_existing* macros
Date: Thu, 20 Jul 2017 15:15:16 +0200	[thread overview]
Message-ID: <20170720131519.30104-6-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20170720131519.30104-1-maarten.lankhorst@linux.intel.com>

All the references to get_existing_state can be converted to
get_new_state or get_old_state, which means that i915 is now
get_existing_state free.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 57 +++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8bd8ed362e1a..d95b3ba1fe47 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4956,27 +4956,25 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)
 	struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
 	struct drm_atomic_state *old_state = old_crtc_state->base.state;
 	struct intel_crtc_state *pipe_config =
-		to_intel_crtc_state(crtc->base.state);
+		intel_atomic_get_new_crtc_state(old_state, crtc);
 	struct drm_plane *primary = crtc->base.primary;
-	struct drm_plane_state *old_pri_state =
-		drm_atomic_get_existing_plane_state(old_state, primary);
+	struct drm_plane_state *old_primary_state =
+		drm_atomic_get_old_plane_state(old_state, primary);
 
 	intel_frontbuffer_flip(to_i915(crtc->base.dev), pipe_config->fb_bits);
 
 	if (pipe_config->update_wm_post && pipe_config->base.active)
 		intel_update_watermarks(crtc);
 
-	if (old_pri_state) {
-		struct intel_plane_state *primary_state =
-			to_intel_plane_state(primary->state);
-		struct intel_plane_state *old_primary_state =
-			to_intel_plane_state(old_pri_state);
+	if (old_primary_state) {
+		struct drm_plane_state *new_primary_state =
+			drm_atomic_get_new_plane_state(old_state, primary);
 
 		intel_fbc_post_update(crtc);
 
-		if (primary_state->base.visible &&
+		if (new_primary_state->visible &&
 		    (needs_modeset(&pipe_config->base) ||
-		     !old_primary_state->base.visible))
+		     !old_primary_state->visible))
 			intel_post_enable_primary(&crtc->base);
 	}
 }
@@ -4989,22 +4987,21 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct drm_atomic_state *old_state = old_crtc_state->base.state;
 	struct drm_plane *primary = crtc->base.primary;
-	struct drm_plane_state *old_pri_state =
-		drm_atomic_get_existing_plane_state(old_state, primary);
+	struct drm_plane_state *old_primary_state =
+		drm_atomic_get_old_plane_state(old_state, primary);
 	bool modeset = needs_modeset(&pipe_config->base);
 	struct intel_atomic_state *old_intel_state =
 		to_intel_atomic_state(old_state);
 
-	if (old_pri_state) {
-		struct intel_plane_state *primary_state =
-			to_intel_plane_state(primary->state);
-		struct intel_plane_state *old_primary_state =
-			to_intel_plane_state(old_pri_state);
+	if (old_primary_state) {
+		struct drm_plane_state *new_primary_state =
+			drm_atomic_get_new_plane_state(old_state, primary);
 
-		intel_fbc_pre_update(crtc, pipe_config, primary_state);
+		intel_fbc_pre_update(crtc, pipe_config,
+				     to_intel_plane_state(new_primary_state));
 
-		if (old_primary_state->base.visible &&
-		    (modeset || !primary_state->base.visible))
+		if (old_primary_state->visible &&
+		    (modeset || !new_primary_state->visible))
 			intel_pre_disable_primary(&crtc->base);
 	}
 
@@ -10822,7 +10819,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)
 		struct drm_connector_state *connector_state;
 		struct intel_encoder *encoder;
 
-		connector_state = drm_atomic_get_existing_connector_state(state, connector);
+		connector_state = drm_atomic_get_new_connector_state(state, connector);
 		if (!connector_state)
 			connector_state = connector->state;
 
@@ -11039,15 +11036,15 @@ intel_modeset_update_crtc_state(struct drm_atomic_state *state)
 
 	/* Double check state. */
 	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
+		struct drm_plane_state *plane_state;
 		to_intel_crtc(crtc)->config = to_intel_crtc_state(new_crtc_state);
 
 		/*
 		 * Update legacy state to satisfy fbc code. This can
 		 * be removed when fbc uses the atomic state.
 		 */
-		if (drm_atomic_get_existing_plane_state(state, crtc->primary)) {
-			struct drm_plane_state *plane_state = crtc->primary->state;
-
+		plane_state = drm_atomic_get_new_plane_state(state, crtc->primary);
+		if (plane_state) {
 			crtc->primary->fb = plane_state->fb;
 			crtc->x = plane_state->src_x >> 16;
 			crtc->y = plane_state->src_y >> 16;
@@ -12250,6 +12247,9 @@ static void intel_update_crtc(struct drm_crtc *crtc,
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct intel_crtc_state *pipe_config = to_intel_crtc_state(new_crtc_state);
 	bool modeset = needs_modeset(new_crtc_state);
+	struct intel_plane_state *new_plane_state =
+		intel_atomic_get_new_plane_state(old_crtc_state->state,
+						 to_intel_plane(crtc->primary));
 
 	if (modeset) {
 		update_scanline_offset(intel_crtc);
@@ -12259,11 +12259,8 @@ static void intel_update_crtc(struct drm_crtc *crtc,
 				       pipe_config);
 	}
 
-	if (drm_atomic_get_existing_plane_state(state, crtc->primary)) {
-		intel_fbc_enable(
-		    intel_crtc, pipe_config,
-		    to_intel_plane_state(crtc->primary->state));
-	}
+	if (new_plane_state)
+		intel_fbc_enable(intel_crtc, pipe_config, new_plane_state);
 
 	drm_atomic_helper_commit_planes_on_crtc(old_crtc_state);
 
@@ -12739,7 +12736,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
 
 	if (old_obj) {
 		struct drm_crtc_state *crtc_state =
-			drm_atomic_get_existing_crtc_state(new_state->state,
+			drm_atomic_get_new_crtc_state(new_state->state,
 							   plane->state->crtc);
 
 		/* Big Hammer, we also need to ensure that any pending
-- 
2.11.0

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

  parent reply	other threads:[~2017-07-20 13:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
2017-07-20 13:15 ` [PATCH 1/8] drm/i915: Change use get_new_plane_state instead of existing plane state Maarten Lankhorst
2017-08-01  6:36   ` Mahesh Kumar
2017-08-01  7:55     ` Maarten Lankhorst
2017-07-20 13:15 ` [PATCH 2/8] drm/i915: Change get_existing_crtc_state to old state Maarten Lankhorst
2017-08-01  6:46   ` Mahesh Kumar
2017-08-01  7:53     ` Maarten Lankhorst
2017-08-01  8:04       ` Mahesh Kumar
2017-07-20 13:15 ` [PATCH 3/8] drm/i915: Use new atomic helpers in intel_plane_atomic_check Maarten Lankhorst
2017-08-01  7:57   ` Mahesh Kumar
2017-07-20 13:15 ` [PATCH 4/8] drm/i915: Use intel_atomic_get_new_crtc_state in intel_fbc.c Maarten Lankhorst
2017-08-01  8:00   ` Mahesh Kumar
2017-07-20 13:15 ` Maarten Lankhorst [this message]
2017-07-20 13:15 ` [PATCH 6/8] drm/i915: Do not update legacy state any more Maarten Lankhorst
2017-07-20 13:15 ` [RFC PATCH 7/8] drm/i915: Calculate ironlake intermediate watermarks correctly, v2 Maarten Lankhorst
2017-07-20 13:15 ` [RFC PATCH 8/8] drm/i915: Calculate vlv/chv intermediate watermarks correctly, v3 Maarten Lankhorst
2017-07-20 16:26   ` Maarten Lankhorst
2017-07-20 15:40 ` ✓ Fi.CI.BAT: success for drm/i915: Stop using get_existing_state 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=20170720131519.30104-6-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox