All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Maarten Lankhorst <maarten.lankhorst@canonical.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 5/8] drm/radeon: cope with foreign fences inside display
Date: Wed, 17 Sep 2014 15:16:28 +0200	[thread overview]
Message-ID: <541989AC.90603@vodafone.de> (raw)
In-Reply-To: <1410957305-10190-6-git-send-email-maarten.lankhorst@canonical.com>

Am 17.09.2014 um 14:35 schrieb Maarten Lankhorst:
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/radeon.h         |  2 +-
>   drivers/gpu/drm/radeon/radeon_display.c | 30 +++++++++++++++++++-----------
>   2 files changed, 20 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index 82b0e11ade89..9aa75c1af4f4 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -710,7 +710,7 @@ struct radeon_flip_work {
>   	uint64_t			base;
>   	struct drm_pending_vblank_event *event;
>   	struct radeon_bo		*old_rbo;
> -	struct radeon_fence		*fence;
> +	struct fence			*fence;
>   };
>   
>   struct r500_irq_stat_regs {
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> index 4eb37976f879..00ead8c2758a 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -402,14 +402,21 @@ static void radeon_flip_work_func(struct work_struct *__work)
>   
>           down_read(&rdev->exclusive_lock);
>   	if (work->fence) {
> -		r = radeon_fence_wait(work->fence, false);
> -		if (r == -EDEADLK) {
> -			up_read(&rdev->exclusive_lock);
> -			do {
> -				r = radeon_gpu_reset(rdev);
> -			} while (r == -EAGAIN);
> -			down_read(&rdev->exclusive_lock);
> -		}
> +		struct radeon_fence *fence;
> +
> +		fence = to_radeon_fence(work->fence);
> +		if (fence && fence->rdev == rdev) {
> +			r = radeon_fence_wait(fence, false);
> +			if (r == -EDEADLK) {
> +				up_read(&rdev->exclusive_lock);
> +				do {
> +					r = radeon_gpu_reset(rdev);
> +				} while (r == -EAGAIN);
> +				down_read(&rdev->exclusive_lock);
> +			}
> +		} else
> +			r = fence_wait(work->fence, false);
> +
>   		if (r)
>   			DRM_ERROR("failed to wait on page flip fence (%d)!\n", r);
>   
> @@ -418,7 +425,8 @@ static void radeon_flip_work_func(struct work_struct *__work)
>   		 * confused about which BO the CRTC is scanning out
>   		 */
>   
> -		radeon_fence_unref(&work->fence);
> +		fence_put(work->fence);
> +		work->fence = NULL;
>   	}
>   
>   	/* We borrow the event spin lock for protecting flip_status */
> @@ -494,7 +502,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc,
>   		DRM_ERROR("failed to pin new rbo buffer before flip\n");
>   		goto cleanup;
>   	}
> -	work->fence = (struct radeon_fence *)fence_get(reservation_object_get_excl(new_rbo->tbo.resv));
> +	work->fence = fence_get(reservation_object_get_excl(new_rbo->tbo.resv));
>   	radeon_bo_get_tiling_flags(new_rbo, &tiling_flags, NULL);
>   	radeon_bo_unreserve(new_rbo);
>   
> @@ -576,7 +584,7 @@ pflip_cleanup:
>   
>   cleanup:
>   	drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
> -	radeon_fence_unref(&work->fence);
> +	fence_put(work->fence);
>   	kfree(work);
>   	return r;
>   }

  reply	other threads:[~2014-09-17 13:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 12:34 [PATCH 00/10] drm fence fixes and cross-dev sync Maarten Lankhorst
2014-09-17 12:34 ` [PATCH 1/8] drm/nouveau: bump driver patchlevel to 1.2.1 Maarten Lankhorst
2014-09-17 12:34 ` [PATCH 2/8] drm/nouveau: specify if interruptible wait is desired in nouveau_fence_sync Maarten Lankhorst
2014-09-17 12:35 ` [PATCH 3/8] drm: Pass dma-buf as argument to gem_prime_import_sg_table Maarten Lankhorst
2014-09-17 12:35 ` [PATCH 4/8] drm/ttm: add reservation_object as argument to ttm_bo_init Maarten Lankhorst
2014-09-17 12:35 ` [PATCH 5/8] drm/radeon: cope with foreign fences inside display Maarten Lankhorst
2014-09-17 13:16   ` Christian König [this message]
2014-09-17 12:35 ` [PATCH 6/8] drm/radeon: cope with foreign fences inside the reservation object Maarten Lankhorst
2014-09-17 13:09   ` Christian König
2014-09-25  9:52     ` Maarten Lankhorst
2014-09-25 10:39     ` [PATCH v2 " Maarten Lankhorst
2014-10-01  8:57       ` Maarten Lankhorst
2014-10-01  9:04         ` Christian König
2014-10-01  9:22           ` Maarten Lankhorst
2014-10-01 12:26             ` Alex Deucher
2014-09-18  3:26   ` [PATCH " Michel Dänzer
2014-09-18 10:22     ` Maarten Lankhorst
2014-09-19  1:19       ` Michel Dänzer
2014-09-17 12:35 ` [PATCH 7/8] drm/radeon: export reservation_object from dmabuf to ttm Maarten Lankhorst
2014-09-17 13:14   ` Christian König
2014-09-18  3:22   ` Michel Dänzer
2014-09-18 12:11   ` [PATCH v2 " Maarten Lankhorst
2014-09-18 13:13     ` Christian König
2014-09-17 12:35 ` [PATCH 8/8] drm/nouveau: " Maarten Lankhorst

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=541989AC.90603@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maarten.lankhorst@canonical.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.