From: "Christian König" <deathsimple@vodafone.de>
To: "Michel Dänzer" <michel@daenzer.net>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] Revert "drm/radeon: remove drm_vblank_get|put from pflip handling"
Date: Tue, 17 Jun 2014 13:41:53 +0200 [thread overview]
Message-ID: <53A02981.80701@vodafone.de> (raw)
In-Reply-To: <1402999924-2403-1-git-send-email-michel@daenzer.net>
Am 17.06.2014 12:12, schrieb Michel Dänzer:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> This reverts commit 75f36d861957cb05b7889af24c8cd4a789398304.
>
> drm_vblank_get() is necessary to ensure the DRM vblank counter value is
> up to date in drm_send_vblank_event().
>
> Seems to fix weston hangs waiting for page flips to complete.
>
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Both patches are: Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/radeon/radeon_display.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> index 2a8b9f1..97d7a80 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -357,6 +357,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
>
> spin_unlock_irqrestore(&rdev->ddev->event_lock, flags);
>
> + drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id);
> radeon_fence_unref(&work->fence);
> radeon_irq_kms_pflip_irq_get(rdev, work->crtc_id);
> queue_work(radeon_crtc->flip_queue, &work->unpin_work);
> @@ -459,6 +460,12 @@ static void radeon_flip_work_func(struct work_struct *__work)
> base &= ~7;
> }
>
> + r = drm_vblank_get(crtc->dev, radeon_crtc->crtc_id);
> + if (r) {
> + DRM_ERROR("failed to get vblank before flip\n");
> + goto pflip_cleanup;
> + }
> +
> /* We borrow the event spin lock for protecting flip_work */
> spin_lock_irqsave(&crtc->dev->event_lock, flags);
>
> @@ -473,6 +480,16 @@ static void radeon_flip_work_func(struct work_struct *__work)
>
> return;
>
> +pflip_cleanup:
> + if (unlikely(radeon_bo_reserve(work->new_rbo, false) != 0)) {
> + DRM_ERROR("failed to reserve new rbo in error path\n");
> + goto cleanup;
> + }
> + if (unlikely(radeon_bo_unpin(work->new_rbo) != 0)) {
> + DRM_ERROR("failed to unpin new rbo in error path\n");
> + }
> + radeon_bo_unreserve(work->new_rbo);
> +
> cleanup:
> drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
> radeon_fence_unref(&work->fence);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2014-06-17 11:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-17 10:12 [PATCH 1/2] Revert "drm/radeon: remove drm_vblank_get|put from pflip handling" Michel Dänzer
2014-06-17 10:12 ` [PATCH 2/2] drm/radeon: Fix radeon_irq_kms_pflip_irq_get/put() imbalance Michel Dänzer
2014-06-17 11:41 ` Christian König [this message]
2014-06-17 13:45 ` [PATCH 1/2] Revert "drm/radeon: remove drm_vblank_get|put from pflip handling" Alex Deucher
2014-06-18 5:53 ` Michel Dänzer
2014-06-18 9:14 ` Christian König
2014-06-23 9:34 ` Michel Dänzer
2014-06-23 12:45 ` Christian König
2014-06-23 19:46 ` Dieter Nützel
2014-06-23 20:32 ` Dieter Nützel
2014-06-24 10:05 ` Michel Dänzer
2014-06-24 19:58 ` Dieter Nützel
2014-06-24 21:52 ` Dieter Nützel
[not found] ` <1d171bd5e2e5a09d6016b07936e5293c@mail.ud03.udmedia.de>
2014-06-25 7:57 ` Michel Dänzer
2014-06-25 23:34 ` Dieter Nützel
2014-06-26 9:34 ` Michel Dänzer
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=53A02981.80701@vodafone.de \
--to=deathsimple@vodafone.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=michel@daenzer.net \
/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.