public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/5] drm/i915: Signal drm events for atomic
Date: Tue, 14 Jun 2016 10:21:02 +0200	[thread overview]
Message-ID: <5258a40c-3c34-3af8-63bb-fdcfacca5f91@linux.intel.com> (raw)
In-Reply-To: <1465827229-1704-1-git-send-email-daniel.vetter@ffwll.ch>

Op 13-06-16 om 16:13 schreef Daniel Vetter:
> This is part of what atomic must implement. And it's also required
> to be able to use the helper nonblocking support.
>
> v2: Always send out the drm event, remove the planes_changed check.
Hey,

There used to be a patch to add a test in kms_atomic for testing vblank events, has this ever been committed?

~Maarten
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 13 ++++++++++---
>  drivers/gpu/drm/i915/intel_sprite.c  | 14 ++++++++++++++
>  2 files changed, 24 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 801e4c17dd8d..a4ebf9df7dc3 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13774,13 +13774,21 @@ static int intel_atomic_commit(struct drm_device *dev,
>  		bool modeset = needs_modeset(crtc->state);
>  		struct intel_crtc_state *pipe_config =
>  			to_intel_crtc_state(crtc->state);
> -		bool update_pipe = !modeset && pipe_config->update_pipe;
>  
>  		if (modeset && crtc->state->active) {
>  			update_scanline_offset(to_intel_crtc(crtc));
>  			dev_priv->display.crtc_enable(crtc);
>  		}
>  
> +		/* Complete events for now disable pipes here. */
> +		if (modeset && !crtc->state->active && crtc->state->event) {
> +			spin_lock_irq(&dev->event_lock);
> +			drm_crtc_send_vblank_event(crtc, crtc->state->event);
> +			spin_unlock_irq(&dev->event_lock);
> +
> +			crtc->state->event = NULL;
> +		}
> +
>  		if (!modeset)
>  			intel_pre_plane_update(to_intel_crtc_state(old_crtc_state));
>  
> @@ -13788,8 +13796,7 @@ static int intel_atomic_commit(struct drm_device *dev,
>  		    drm_atomic_get_existing_plane_state(state, crtc->primary))
>  			intel_fbc_enable(intel_crtc);
>  
> -		if (crtc->state->active &&
> -		    (crtc->state->planes_changed || update_pipe))
> +		if (crtc->state->active)
>  			drm_atomic_helper_commit_planes_on_crtc(old_crtc_state);
>  
>  		if (pipe_config->base.active && needs_vblank_wait(pipe_config))
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 324ccb06397d..fc654173c491 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -166,6 +166,20 @@ void intel_pipe_update_end(struct intel_crtc *crtc, struct intel_flip_work *work
>  
>  	trace_i915_pipe_update_end(crtc, end_vbl_count, scanline_end);
>  
> +	/* We're still in the vblank-evade critical section, this can't race.
> +	 * Would be slightly nice to just grab the vblank count and arm the
> +	 * event outside of the critical section - the spinlock might spin for a
> +	 * while ... */
> +	if (crtc->base.state->event) {
> +		WARN_ON(drm_crtc_vblank_get(&crtc->base) != 0);
> +
> +		spin_lock(&crtc->base.dev->event_lock);
> +		drm_crtc_arm_vblank_event(&crtc->base, crtc->base.state->event);
> +		spin_unlock(&crtc->base.dev->event_lock);
> +
> +		crtc->base.state->event = NULL;
> +	}
> +
>  	local_irq_enable();
>  
>  	if (crtc->debug.start_vbl_count &&


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

  parent reply	other threads:[~2016-06-14  8:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 14:13 [PATCH 1/5] drm/i915: Signal drm events for atomic Daniel Vetter
2016-06-13 14:13 ` [PATCH 2/5] drm/i915: Roll out the helper nonblock tracking Daniel Vetter
2016-06-14 12:24   ` [PATCH 2.5/5] Reapply "drm/i915: Pass atomic states to fbc update, functions." Maarten Lankhorst
2016-06-14 12:37     ` Daniel Vetter
2016-06-13 14:13 ` [PATCH 3/5] drm/i915: nonblocking commit Daniel Vetter
2016-06-14  7:24   ` Maarten Lankhorst
2016-06-14 16:01   ` [PATCH] " Daniel Vetter
2016-06-28  4:27   ` [PATCH 3/5] " Daniel Stone
2016-06-13 14:13 ` [PATCH 4/5] drm/i915: Move fb_bits updating later in atomic_commit Daniel Vetter
2016-06-13 14:57   ` Chris Wilson
2016-06-13 14:13 ` [PATCH 5/5] drm/i915: Use atomic commits for legacy page_flips Daniel Vetter
2016-06-15  8:01   ` Maarten Lankhorst
2016-06-20 18:30     ` Matthew Auld
2016-06-21 14:23       ` Daniel Vetter
2016-06-21 21:00         ` Chris Wilson
2016-06-13 14:44 ` ✗ Ro.CI.BAT: failure for series starting with [1/5] drm/i915: Signal drm events for atomic Patchwork
2016-06-14  8:21 ` Maarten Lankhorst [this message]
2016-06-14 12:38   ` [PATCH 1/5] " Daniel Vetter

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=5258a40c-3c34-3af8-63bb-fdcfacca5f91@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --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