Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 03/13] drm/i915/dsb: Generate the DSB buffer in commit_tail()
Date: Mon,  2 Sep 2024 16:53:32 +0300	[thread overview]
Message-ID: <20240902135342.1050-4-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20240902135342.1050-1-ville.syrjala@linux.intel.com>

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

Once we start using DSB for plane updates we'll need to defer
generating the DSB buffer until the clear color has been
read out. So we need to move at some of the DSB stuff into
commit_tail(). That is perhaps a better place for it anyway
as the ioctl thread can move on immediately without spending
time building the DSB commands.

We always have the MMIO fallback (in case the DSB buffer
allocation fails), so there's no real reason to keep any
of this in the synchronous part of the ioctl.

Because the DSB LUT programming doesn't depend on the plane
clear color we can still do that part before waiting for
fences/etc. which should help paralleize things a bit more.
The DSB plane programming will need to happen after those
however as that depends on the clear color.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 23 +++++++++-----------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 048051d9a624..a3555885597d 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -6732,17 +6732,12 @@ int intel_atomic_check(struct drm_device *dev,
 
 static int intel_atomic_prepare_commit(struct intel_atomic_state *state)
 {
-	struct intel_crtc_state __maybe_unused *crtc_state;
-	struct intel_crtc *crtc;
-	int i, ret;
+	int ret;
 
 	ret = drm_atomic_helper_prepare_planes(state->base.dev, &state->base);
 	if (ret < 0)
 		return ret;
 
-	for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i)
-		intel_color_prepare_commit(state, crtc);
-
 	return 0;
 }
 
@@ -7333,6 +7328,12 @@ static void intel_atomic_prepare_plane_clear_colors(struct intel_atomic_state *s
 	}
 }
 
+static void intel_atomic_dsb_prepare(struct intel_atomic_state *state,
+				     struct intel_crtc *crtc)
+{
+	intel_color_prepare_commit(state, crtc);
+}
+
 static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 {
 	struct drm_device *dev = state->base.dev;
@@ -7343,6 +7344,9 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 	intel_wakeref_t wakeref = 0;
 	int i;
 
+	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i)
+		intel_atomic_dsb_prepare(state, crtc);
+
 	intel_atomic_commit_fence_wait(state);
 
 	intel_td_flush(dev_priv);
@@ -7661,13 +7665,6 @@ int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
 		ret = intel_atomic_swap_state(state);
 
 	if (ret) {
-		struct intel_crtc_state *new_crtc_state;
-		struct intel_crtc *crtc;
-		int i;
-
-		for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i)
-			intel_color_cleanup_commit(new_crtc_state);
-
 		drm_atomic_helper_unprepare_planes(dev, &state->base);
 		intel_runtime_pm_put(&dev_priv->runtime_pm, state->wakeref);
 		return ret;
-- 
2.44.2


  parent reply	other threads:[~2024-09-02 13:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02 13:53 [PATCH 00/13] drm/i915: Use DSB for plane/color management commits Ville Syrjala
2024-09-02 13:53 ` [PATCH 01/13] drm/i915/dsb: Avoid reads of the DSB buffer for indexed register writes Ville Syrjala
2024-09-02 13:53 ` [PATCH 02/13] drm/i915: Prepare clear color before wait_for_dependencies() Ville Syrjala
2024-09-02 13:53 ` Ville Syrjala [this message]
2024-09-02 13:53 ` [PATCH 04/13] drm/i915/dsb: Enable programmable DSB interrupt Ville Syrjala
2024-09-02 13:53 ` [PATCH 05/13] drm/i915/dsb: Introduce intel_dsb_vblank_evade() Ville Syrjala
2024-09-02 13:53 ` [PATCH 06/13] drm/i915/dsb: Introduce intel_dsb_wait_usec() Ville Syrjala
2024-09-02 13:53 ` [PATCH 07/13] drm/i915/dsb: Introduce intel_dsb_wait_vblanks() Ville Syrjala
2024-09-02 13:53 ` [PATCH 08/13] drm/i915: Introduce intel_scanlines_to_usecs() Ville Syrjala
2024-09-02 13:53 ` [PATCH 09/13] drm/i915/dsb: Introduce intel_dsb_wait_vblank_delay() Ville Syrjala
2024-09-02 13:53 ` [PATCH 10/13] drm/i915: Extract intel_crtc_prepare_vblank_event() Ville Syrjala
2024-09-02 13:53 ` [PATCH 11/13] drm/i915: Plumb 'dsb' all way to the plane hooks Ville Syrjala
2024-09-02 13:53 ` [PATCH 12/13] drm/i915: Plumb 'dsb' all way to the color commit hooks Ville Syrjala
2024-09-02 13:53 ` [PATCH 13/13] drm/i915/dsb: Use DSB for plane/color management updates Ville Syrjala
2024-09-02 14:45 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Use DSB for plane/color management commits Patchwork
2024-09-02 14:45 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-09-02 15:05 ` ✓ Fi.CI.BAT: success " Patchwork
2024-09-03  7:56 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-09-17  7:00 ` [PATCH 00/13] " Manna, Animesh

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=20240902135342.1050-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox