On Mon, Mar 01, 2010 at 07:34:40PM +0100, Maarten Maathuis wrote:
> - The headerfile says you can't write to it without holding the lock.
>
> Signed-off-by: Maarten Maathuis <[email protected]>
NAK, from my POV as we always use atomic_* on reserved it's useless
to protect it with spinlock.
Cheers,
Jerome
> ---
> drivers/gpu/drm/ttm/ttm_bo.c | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index f5333d9..2104885 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -476,9 +476,9 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object
> *bo, bool remove_all)
> drm_mm_put_block(bo->mem.mm_node);
> bo->mem.mm_node = NULL;
> }
> - spin_unlock(&glob->lru_lock);
>
> atomic_set(&bo->reserved, 0);
> + spin_unlock(&glob->lru_lock);
>
> while (put_count--)
> kref_put(&bo->list_kref, ttm_bo_ref_bug);
> @@ -1707,8 +1707,12 @@ EXPORT_SYMBOL(ttm_bo_wait);
>
> void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo)
> {
> + struct ttm_bo_global *glob = bo->glob;
> +
> + spin_lock(&glob->lru_lock);
> atomic_set(&bo->reserved, 0);
> wake_up_all(&bo->event_queue);
> + spin_unlock(&glob->lru_lock);
> }
>
> int ttm_bo_block_reservation(struct ttm_buffer_object *bo, bool
> interruptible,
> @@ -1849,8 +1853,10 @@ out:
> * already swapped buffer.
> */
>
> + spin_lock(&glob->lru_lock);
> atomic_set(&bo->reserved, 0);
> wake_up_all(&bo->event_queue);
> + spin_unlock(&glob->lru_lock);
> kref_put(&bo->list_kref, ttm_bo_release_list);
> return ret;
> }
> --
> 1.7.0
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> --
> _______________________________________________
> Dri-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dri-devel
>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel