All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 3/8] drm/i915: Extract intel_fbc_update()
Date: Wed, 14 Apr 2021 05:23:04 +0300	[thread overview]
Message-ID: <20210414022309.30898-4-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20210414022309.30898-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pull the fbc enable vs. disable stuff into a small helper so
we don't have to have it pollute the higher level modeset code.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c |  5 +---
 drivers/gpu/drm/i915/display/intel_fbc.c     | 26 ++++++++++++++++++--
 drivers/gpu/drm/i915/display/intel_fbc.h     |  2 +-
 3 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 411b46c012f8..a4b8fb5c20f0 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -9799,10 +9799,7 @@ static void intel_update_crtc(struct intel_atomic_state *state,
 			intel_encoders_update_pipe(state, crtc);
 	}
 
-	if (new_crtc_state->update_pipe && !new_crtc_state->enable_fbc)
-		intel_fbc_disable(crtc);
-	else
-		intel_fbc_enable(state, crtc);
+	intel_fbc_update(state, crtc);
 
 	/* Perform vblank evasion around commit operation */
 	intel_pipe_update_start(new_crtc_state);
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 178243a6d3a2..4968e79a6235 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -1250,8 +1250,8 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
  * intel_fbc_enable multiple times for the same pipe without an
  * intel_fbc_disable in the middle, as long as it is deactivated.
  */
-void intel_fbc_enable(struct intel_atomic_state *state,
-		      struct intel_crtc *crtc)
+static void intel_fbc_enable(struct intel_atomic_state *state,
+			     struct intel_crtc *crtc)
 {
 	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
 	struct intel_plane *plane = to_intel_plane(crtc->base.primary);
@@ -1324,6 +1324,28 @@ void intel_fbc_disable(struct intel_crtc *crtc)
 	mutex_unlock(&fbc->lock);
 }
 
+/**
+ * intel_fbc_update: enable/disable FBC on the CRTC
+ * @state: atomic state
+ * @crtc: the CRTC
+ *
+ * This function checks if the given CRTC was chosen for FBC, then enables it if
+ * possible. Notice that it doesn't activate FBC. It is valid to call
+ * intel_fbc_update multiple times for the same pipe without an
+ * intel_fbc_disable in the middle.
+ */
+void intel_fbc_update(struct intel_atomic_state *state,
+		      struct intel_crtc *crtc)
+{
+	const struct intel_crtc_state *crtc_state =
+		intel_atomic_get_new_crtc_state(state, crtc);
+
+	if (crtc_state->update_pipe && !crtc_state->enable_fbc)
+		intel_fbc_disable(crtc);
+	else
+		intel_fbc_enable(state, crtc);
+}
+
 /**
  * intel_fbc_global_disable - globally disable FBC
  * @dev_priv: i915 device instance
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.h b/drivers/gpu/drm/i915/display/intel_fbc.h
index 6dc1edefe81b..b97d908738e6 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.h
+++ b/drivers/gpu/drm/i915/display/intel_fbc.h
@@ -24,7 +24,7 @@ bool intel_fbc_pre_update(struct intel_atomic_state *state,
 void intel_fbc_post_update(struct intel_atomic_state *state,
 			   struct intel_crtc *crtc);
 void intel_fbc_init(struct drm_i915_private *dev_priv);
-void intel_fbc_enable(struct intel_atomic_state *state,
+void intel_fbc_update(struct intel_atomic_state *state,
 		      struct intel_crtc *crtc);
 void intel_fbc_disable(struct intel_crtc *crtc);
 void intel_fbc_global_disable(struct drm_i915_private *dev_priv);
-- 
2.26.3

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

  parent reply	other threads:[~2021-04-14  2:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  2:23 [Intel-gfx] [PATCH 0/8] drm/i915: FBC cleanups Ville Syrjala
2021-04-14  2:23 ` [Intel-gfx] [PATCH 1/8] drm/i915: Add frontbuffer tracking tracepoints Ville Syrjala
2021-04-21 13:01   ` Jani Nikula
2021-04-14  2:23 ` [Intel-gfx] [PATCH 2/8] drm/i915: Rewrite the FBC tiling check a bit Ville Syrjala
2021-04-14 15:09   ` Jani Nikula
2021-04-15 15:34     ` Ville Syrjälä
2021-04-21 13:00       ` Jani Nikula
2021-04-14  2:23 ` Ville Syrjala [this message]
2021-04-21 13:00   ` [Intel-gfx] [PATCH 3/8] drm/i915: Extract intel_fbc_update() Jani Nikula
2021-04-14  2:23 ` [Intel-gfx] [PATCH 4/8] drm/i915: Clear no_fbc_reason on activate Ville Syrjala
2021-04-21 13:48   ` Jani Nikula
2021-04-14  2:23 ` [Intel-gfx] [PATCH 5/8] drm/i915: Move the "recompress on activate" to a central place Ville Syrjala
2021-04-21 13:17   ` Jani Nikula
2021-04-14  2:23 ` [Intel-gfx] [PATCH 6/8] drm/i915: Nuke lots of crap from intel_fbc_state_cache Ville Syrjala
2021-04-14  2:23 ` [Intel-gfx] [PATCH 7/8] drm/i915: No FBC+double wide pipe Ville Syrjala
2021-04-14  2:23 ` [Intel-gfx] [PATCH 8/8] drm/i915: Pimp the FBC debugfs output Ville Syrjala
2021-04-21 13:59   ` Jani Nikula
2021-04-14  3:08 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: FBC cleanups Patchwork
2021-04-14  3:10 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-04-14  3:13 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2021-04-14  3:38 ` [Intel-gfx] ✗ 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=20210414022309.30898-4-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@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 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.