Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Handle legacy cursor update as normal update
Date: Thu, 29 Jun 2023 17:35:25 +0200	[thread overview]
Message-ID: <20230629153525.43222-2-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20230629153525.43222-1-maarten.lankhorst@linux.intel.com>

Move hw_done to cleanup, to ensure we only unpin cursor fb after we
received a flip event. This disables the legacy_cursor_update immediate
completion of flip_done events, and waits for flip_done before cleaning
up.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c      | 15 ++++++++++++++-
 .../gpu/drm/i915/display/intel_display_types.h    |  2 +-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 43bcd3d011bf5..38c3eb8d95789 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -6864,6 +6864,9 @@ static void intel_atomic_cleanup_work(struct work_struct *work)
 	struct intel_crtc *crtc;
 	int i;
 
+	if (state->cursor_update)
+		drm_atomic_helper_wait_for_flip_done(&i915->drm, &state->base);
+
 	for_each_old_intel_crtc_in_state(state, crtc, old_crtc_state, i)
 		intel_color_cleanup_commit(old_crtc_state);
 
@@ -7062,7 +7065,8 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 	 * - switch over to the vblank wait helper in the core after that since
 	 *   we don't need out special handling any more.
 	 */
-	drm_atomic_helper_wait_for_flip_done(dev, &state->base);
+	if (!state->cursor_update)
+		drm_atomic_helper_wait_for_flip_done(dev, &state->base);
 
 	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
 		if (new_crtc_state->do_async_flip)
@@ -7247,6 +7251,15 @@ int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
 				state->base.legacy_cursor_update = false;
 	}
 
+	if (state->base.legacy_cursor_update) {
+		/*
+		 * If this is a legacy cursor update, handle like a normal update,
+		 * but wait before calling cleanup
+		 */
+		state->base.legacy_cursor_update = false;
+		state->cursor_update = true;
+	}
+
 	ret = intel_atomic_prepare_commit(state);
 	if (ret) {
 		drm_dbg_atomic(&dev_priv->drm,
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index c85cf8adc7a69..01f7c8d24179c 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -646,7 +646,7 @@ struct intel_atomic_state {
 	/* Internal commit, as opposed to userspace/client initiated one */
 	bool internal;
 
-	bool dpll_set, modeset;
+	bool dpll_set, modeset, cursor_update;
 
 	struct intel_shared_dpll_state shared_dpll[I915_NUM_PLLS];
 
-- 
2.39.2


  reply	other threads:[~2023-06-29 15:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 15:35 [Intel-gfx] [PATCH 1/2] drm/i915: Swap ggtt_vma during legacy cursor update Maarten Lankhorst
2023-06-29 15:35 ` Maarten Lankhorst [this message]
2023-06-29 19:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
2023-06-30  5:52 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-25 20:26 ` [Intel-gfx] [PATCH 1/2] " Shankar, Uma
  -- strict thread matches above, loose matches on Subject: below --
2023-08-14  6:50 Maarten Lankhorst
2023-08-14  6:50 ` [Intel-gfx] [PATCH 2/2] drm/i915: Handle legacy cursor update as normal update Maarten Lankhorst
2023-08-18  8:37   ` kernel test robot
2023-08-10 12:41 [Intel-gfx] [PATCH 1/2] drm/i915: Swap ggtt_vma during legacy cursor update Maarten Lankhorst
2023-08-10 12:41 ` [Intel-gfx] [PATCH 2/2] drm/i915: Handle legacy cursor update as normal update Maarten Lankhorst
2023-06-21 11:48 [Intel-gfx] [PATCH 1/2] drm/i915: Swap ggtt_vma during legacy cursor update Maarten Lankhorst
2023-06-21 11:48 ` [Intel-gfx] [PATCH 2/2] drm/i915: Handle legacy cursor update as normal update Maarten Lankhorst
2023-06-21 23:09   ` kernel test robot
2023-06-21 23:40   ` kernel test robot

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=20230629153525.43222-2-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