dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 08/10] drm/ttm: fix fence locking in ttm_buffer_object_transfer
Date: Tue, 18 Dec 2012 22:25:11 +0100	[thread overview]
Message-ID: <1355865913-14858-9-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1355865913-14858-1-git-send-email-daniel.vetter@ffwll.ch>

Noticed while reviewing the fence locking in the radeon pageflip
handler.

v2: Instead of grabbing the bdev->fence_lock in object_transfer just
move the single callsite of that function a few lines, so that it is
protected by the fence_lock. Suggested by Jerome Glisse.

v3: Fix typo in commit message.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/ttm/ttm_bo_util.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 9e9c5d2..d73d6e3 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -654,11 +654,13 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
 		 */
 
 		set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
+
+		/* ttm_buffer_object_transfer accesses bo->sync_obj */
+		ret = ttm_buffer_object_transfer(bo, &ghost_obj);
 		spin_unlock(&bdev->fence_lock);
 		if (tmp_obj)
 			driver->sync_obj_unref(&tmp_obj);
 
-		ret = ttm_buffer_object_transfer(bo, &ghost_obj);
 		if (ret)
 			return ret;
 
-- 
1.7.10.4

  parent reply	other threads:[~2012-12-18 21:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 21:25 [PATCH 00/10] kms locking rework prep patches Daniel Vetter
2012-12-18 21:25 ` [PATCH 01/10] drm: review locking rules in drm_crtc.c Daniel Vetter
2012-12-18 21:25 ` [PATCH 02/10] drm/doc: integrate drm_crtc.c kerneldoc Daniel Vetter
2012-12-19 18:19   ` Ville Syrjälä
2012-12-20 10:14     ` Daniel Vetter
2012-12-18 21:25 ` [PATCH 03/10] drm/<drivers>: reorder framebuffer init sequence Daniel Vetter
2012-12-18 21:25 ` [PATCH 04/10] drm/vmwgfx: " Daniel Vetter
2012-12-18 21:25 ` [PATCH 05/10] drm/gma500: move fbcon restore to lastclose Daniel Vetter
2012-12-18 21:25 ` [PATCH 06/10] drm/nouveau: protect evo_wait/evo_kick sections with a channel mutex Daniel Vetter
2012-12-20 13:19   ` [PATCH] " Daniel Vetter
2012-12-18 21:25 ` [PATCH 07/10] drm/nouveau: try to protect nbo->pin_refcount Daniel Vetter
2012-12-18 21:25 ` Daniel Vetter [this message]
2012-12-18 21:25 ` [PATCH 09/10] drm/<drivers>: Unified handling of unimplemented fb->create_handle Daniel Vetter
2012-12-18 21:25 ` [PATCH 10/10] drm: encapsulate crtc->set_config calls 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=1355865913-14858-9-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --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;
as well as URLs for NNTP newsgroup(s).