dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Alex Goins <agoins@nvidia.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH i915 v2 2/2] i915: wait for fences in atomic commit
Date: Mon, 2 Nov 2015 16:06:28 +0100	[thread overview]
Message-ID: <56377BF4.1040600@linux.intel.com> (raw)
In-Reply-To: <74f178dd8e9b1d3a57939dcb95ee361dc8f722e6.1446246896.git.agoins@nvidia.com>

Op 31-10-15 om 02:03 schreef Alex Goins:
> For all buffers backed by dmabuf, wait for its reservation object's fences
> before committing.
>
> Signed-off-by: Alex Goins <agoins@nvidia.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 1485640..3e6d588 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13097,6 +13097,8 @@ static int intel_atomic_commit(struct drm_device *dev,
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct drm_crtc *crtc;
>  	struct drm_crtc_state *crtc_state;
> +	struct drm_plane *plane;
> +	struct drm_plane_state *plane_state;
>  	int ret = 0;
>  	int i;
>  	bool any_ms = false;
> @@ -13112,6 +13114,28 @@ static int intel_atomic_commit(struct drm_device *dev,
>  
>  	drm_atomic_helper_swap_state(dev, state);
>  
> +	/* For all framebuffers backed by dmabuf, wait for fence */
> +	for_each_plane_in_state(state, plane, plane_state, i) {
> +		struct drm_framebuffer *fb;
> +		struct drm_i915_gem_object *obj;
> +
> +		fb = plane->state->fb;
> +		if (!fb)
> +			continue;
> +
> +		obj = intel_fb_obj(fb);
> +		if (!obj)
> +			continue;
> +
> +		mutex_lock(&obj->base.dev->object_name_lock);
> +		if (obj->base.dma_buf) {
> +			reservation_object_wait_timeout_rcu(
> +				obj->base.dma_buf->resv,
> +				true, false, msecs_to_jiffies(96));
> +		}
> +		mutex_unlock(&obj->base.dev->object_name_lock);
> +	}
> +
>  	for_each_crtc_in_state(state, crtc, crtc_state, i) {
>  		struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  
Could you put the wait inside prepare_plane_fb?
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-11-02 15:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-31  1:03 [PATCH i915 v2 0/2] PRIME Synchronization Alex Goins
2015-10-31  1:03 ` [PATCH i915 v2 1/2] i915: wait for fences in mmio_flip() Alex Goins
2015-11-02 11:21   ` Chris Wilson
2015-11-09 21:42     ` Alexander Goins
2015-11-16 15:15       ` Daniel Vetter
2015-11-16 18:32         ` Alexander Goins
2015-10-31  1:03 ` [PATCH i915 v2 2/2] i915: wait for fences in atomic commit Alex Goins
2015-11-02 15:06   ` Maarten Lankhorst [this message]
2015-11-09 21:42     ` Alexander Goins

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=56377BF4.1040600@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=agoins@nvidia.com \
    --cc=dri-devel@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