From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 10/13] drm/i915: Extract intel_crtc_prepare_vblank_event()
Date: Mon, 2 Sep 2024 16:53:39 +0300 [thread overview]
Message-ID: <20240902135342.1050-11-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>
Extract the code for staging the vblank event for the
flip done interrupt handler. We'll reuse this for DSB
stuff later.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_crtc.c | 21 +++++++++++++++------
drivers/gpu/drm/i915/display/intel_crtc.h | 3 +++
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index 77cfab1d13de..30616101b4f2 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -495,12 +495,8 @@ void intel_pipe_update_start(struct intel_atomic_state *state,
intel_psr_lock(new_crtc_state);
if (new_crtc_state->do_async_flip) {
- spin_lock_irq(&crtc->base.dev->event_lock);
- /* arm the event for the flip done irq handler */
- crtc->flip_done_event = new_crtc_state->uapi.event;
- spin_unlock_irq(&crtc->base.dev->event_lock);
-
- new_crtc_state->uapi.event = NULL;
+ intel_crtc_prepare_vblank_event(new_crtc_state,
+ &crtc->flip_done_event);
return;
}
@@ -600,6 +596,19 @@ void intel_crtc_arm_vblank_event(struct intel_crtc_state *crtc_state)
crtc_state->uapi.event = NULL;
}
+void intel_crtc_prepare_vblank_event(struct intel_crtc_state *crtc_state,
+ struct drm_pending_vblank_event **event)
+{
+ struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+ unsigned long irqflags;
+
+ spin_lock_irqsave(&crtc->base.dev->event_lock, irqflags);
+ *event = crtc_state->uapi.event;
+ spin_unlock_irqrestore(&crtc->base.dev->event_lock, irqflags);
+
+ crtc_state->uapi.event = NULL;
+}
+
/**
* intel_pipe_update_end() - end update of a set of display registers
* @state: the atomic state
diff --git a/drivers/gpu/drm/i915/display/intel_crtc.h b/drivers/gpu/drm/i915/display/intel_crtc.h
index c1dd8c42cea2..4b0bdddc1db5 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.h
+++ b/drivers/gpu/drm/i915/display/intel_crtc.h
@@ -12,6 +12,7 @@ enum i9xx_plane_id;
enum pipe;
struct drm_display_mode;
struct drm_i915_private;
+struct drm_pending_vblank_event;
struct intel_atomic_state;
struct intel_crtc;
struct intel_crtc_state;
@@ -31,6 +32,8 @@ int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
int intel_scanlines_to_usecs(const struct drm_display_mode *adjusted_mode,
int scanlines);
void intel_crtc_arm_vblank_event(struct intel_crtc_state *crtc_state);
+void intel_crtc_prepare_vblank_event(struct intel_crtc_state *crtc_state,
+ struct drm_pending_vblank_event **event);
u32 intel_crtc_max_vblank_count(const struct intel_crtc_state *crtc_state);
int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe);
struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc);
--
2.44.2
next prev parent reply other threads:[~2024-09-02 13:54 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 ` [PATCH 03/13] drm/i915/dsb: Generate the DSB buffer in commit_tail() Ville Syrjala
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 ` Ville Syrjala [this message]
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-11-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