* [PATCH 0/2] drm/ttm: A couple of small fixes @ 2010-04-28 9:33 Thomas Hellstrom 2010-04-28 9:33 ` [PATCH 1/2] drm/ttm: Remove some leftover debug messages Thomas Hellstrom 2010-05-27 12:14 ` Resend: [PATCH 0/2] drm/ttm: A couple of small fixes Thomas Hellstrom 0 siblings, 2 replies; 5+ messages in thread From: Thomas Hellstrom @ 2010-04-28 9:33 UTC (permalink / raw) To: airlied; +Cc: dri-devel The first patch removes some leftover debug messages in the ttm_lock code so far only used by the vmwgfx driver. The second patch removes the ttm_bo_block_reservation() function, since it is buggy. A bo shouldn't be reserved while remaining on lru lists. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] drm/ttm: Remove some leftover debug messages. 2010-04-28 9:33 [PATCH 0/2] drm/ttm: A couple of small fixes Thomas Hellstrom @ 2010-04-28 9:33 ` Thomas Hellstrom 2010-04-28 9:33 ` [PATCH 2/2] drm/ttm: Remove the ttm_bo_block_reservation() function Thomas Hellstrom 2010-05-27 12:14 ` Resend: [PATCH 0/2] drm/ttm: A couple of small fixes Thomas Hellstrom 1 sibling, 1 reply; 5+ messages in thread From: Thomas Hellstrom @ 2010-04-28 9:33 UTC (permalink / raw) To: airlied; +Cc: Thomas Hellstrom, dri-devel Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> --- drivers/gpu/drm/ttm/ttm_lock.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_lock.c b/drivers/gpu/drm/ttm/ttm_lock.c index 3d172ef..de41e55 100644 --- a/drivers/gpu/drm/ttm/ttm_lock.c +++ b/drivers/gpu/drm/ttm/ttm_lock.c @@ -204,7 +204,6 @@ static int __ttm_vt_unlock(struct ttm_lock *lock) lock->flags &= ~TTM_VT_LOCK; wake_up_all(&lock->queue); spin_unlock(&lock->lock); - printk(KERN_INFO TTM_PFX "vt unlock.\n"); return ret; } @@ -265,10 +264,8 @@ int ttm_vt_lock(struct ttm_lock *lock, ttm_lock_type, &ttm_vt_lock_remove, NULL); if (ret) (void)__ttm_vt_unlock(lock); - else { + else lock->vt_holder = tfile; - printk(KERN_INFO TTM_PFX "vt lock.\n"); - } return ret; } -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] drm/ttm: Remove the ttm_bo_block_reservation() function. 2010-04-28 9:33 ` [PATCH 1/2] drm/ttm: Remove some leftover debug messages Thomas Hellstrom @ 2010-04-28 9:33 ` Thomas Hellstrom 0 siblings, 0 replies; 5+ messages in thread From: Thomas Hellstrom @ 2010-04-28 9:33 UTC (permalink / raw) To: airlied; +Cc: Thomas Hellstrom, dri-devel It's unused and buggy in its current form, since it can place a bo in the reserved state without removing it from lru lists. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> --- drivers/gpu/drm/ttm/ttm_bo.c | 30 +----------------------------- include/drm/ttm/ttm_bo_driver.h | 28 ---------------------------- 2 files changed, 1 insertions(+), 57 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index dd47b2a..0e3754a 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1716,40 +1716,12 @@ int ttm_bo_wait(struct ttm_buffer_object *bo, } EXPORT_SYMBOL(ttm_bo_wait); -void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo) -{ - atomic_set(&bo->reserved, 0); - wake_up_all(&bo->event_queue); -} - -int ttm_bo_block_reservation(struct ttm_buffer_object *bo, bool interruptible, - bool no_wait) -{ - int ret; - - while (unlikely(atomic_cmpxchg(&bo->reserved, 0, 1) != 0)) { - if (no_wait) - return -EBUSY; - else if (interruptible) { - ret = wait_event_interruptible - (bo->event_queue, atomic_read(&bo->reserved) == 0); - if (unlikely(ret != 0)) - return ret; - } else { - wait_event(bo->event_queue, - atomic_read(&bo->reserved) == 0); - } - } - return 0; -} - int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait) { int ret = 0; /* - * Using ttm_bo_reserve instead of ttm_bo_block_reservation - * makes sure the lru lists are updated. + * Using ttm_bo_reserve makes sure the lru lists are updated. */ ret = ttm_bo_reserve(bo, true, no_wait, false, 0); diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index e929c27..6b9db91 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -789,34 +789,6 @@ extern void ttm_bo_unreserve(struct ttm_buffer_object *bo); extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, bool interruptible); -/** - * ttm_bo_block_reservation - * - * @bo: A pointer to a struct ttm_buffer_object. - * @interruptible: Use interruptible sleep when waiting. - * @no_wait: Don't sleep, but rather return -EBUSY. - * - * Block reservation for validation by simply reserving the buffer. - * This is intended for single buffer use only without eviction, - * and thus needs no deadlock protection. - * - * Returns: - * -EBUSY: If no_wait == 1 and the buffer is already reserved. - * -ERESTARTSYS: If interruptible == 1 and the process received a signal - * while sleeping. - */ -extern int ttm_bo_block_reservation(struct ttm_buffer_object *bo, - bool interruptible, bool no_wait); - -/** - * ttm_bo_unblock_reservation - * - * @bo: A pointer to a struct ttm_buffer_object. - * - * Unblocks reservation leaving lru lists untouched. - */ -extern void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo); - /* * ttm_bo_util.c */ -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Resend: [PATCH 0/2] drm/ttm: A couple of small fixes 2010-04-28 9:33 [PATCH 0/2] drm/ttm: A couple of small fixes Thomas Hellstrom 2010-04-28 9:33 ` [PATCH 1/2] drm/ttm: Remove some leftover debug messages Thomas Hellstrom @ 2010-05-27 12:14 ` Thomas Hellstrom 2010-05-27 20:14 ` Dave Airlie 1 sibling, 1 reply; 5+ messages in thread From: Thomas Hellstrom @ 2010-05-27 12:14 UTC (permalink / raw) To: airlied; +Cc: Thomas Hellstrom, dri-devel Ping! On 04/28/2010 11:33 AM, Thomas Hellstrom wrote: > The first patch removes some leftover debug messages in the ttm_lock code > so far only used by the vmwgfx driver. > > The second patch removes the ttm_bo_block_reservation() function, since > it is buggy. A bo shouldn't be reserved while remaining on lru lists. > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel > /Thomas ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Resend: [PATCH 0/2] drm/ttm: A couple of small fixes 2010-05-27 12:14 ` Resend: [PATCH 0/2] drm/ttm: A couple of small fixes Thomas Hellstrom @ 2010-05-27 20:14 ` Dave Airlie 0 siblings, 0 replies; 5+ messages in thread From: Dave Airlie @ 2010-05-27 20:14 UTC (permalink / raw) To: Thomas Hellstrom; +Cc: Thomas Hellstrom, dri-devel On Thu, 2010-05-27 at 14:14 +0200, Thomas Hellstrom wrote: > Ping! > Ack! Should have been in 2.6.34. Dave. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-27 20:17 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-04-28 9:33 [PATCH 0/2] drm/ttm: A couple of small fixes Thomas Hellstrom 2010-04-28 9:33 ` [PATCH 1/2] drm/ttm: Remove some leftover debug messages Thomas Hellstrom 2010-04-28 9:33 ` [PATCH 2/2] drm/ttm: Remove the ttm_bo_block_reservation() function Thomas Hellstrom 2010-05-27 12:14 ` Resend: [PATCH 0/2] drm/ttm: A couple of small fixes Thomas Hellstrom 2010-05-27 20:14 ` Dave Airlie
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.