On Wed, Dec 12, 2012 at 8:07 AM, Daniel Vetter <daniel.vetter at ffwll.ch> 
wrote:
> Noticed while reviewing the fence locking in the radone pageflip
> handler.
>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/ttm/ttm_bo_util.c |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c 
> b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index b9c4e51..5c8b207 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -441,7 +441,9 @@ static int ttm_buffer_object_transfer(struct 
> ttm_buffer_object *bo,
>         fbo->vm_node = NULL;
>         atomic_set(&fbo->cpu_writers, 0);
>
> +       spin_lock(&bdev->fence_lock);
>         fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj);
> +       spin_unlock(&bdev->fence_lock);
>         kref_init(&fbo->list_kref);
>         kref_init(&fbo->kref);
>         fbo->destroy = &ttm_transfered_destroy;
> --

Instead of that i would just move the call to
ttm_buffer_object_transfer to happen before releasing the fence_lock
in ttm_bo_move_accel_cleanup , something like :


set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
ret = ttm_buffer_object_transfer(bo, &ghost_obj);
spin_unlock(&bdev->fence_lock);
if (tmp_obj)
  driver->sync_obj_unref(&tmp_obj);

if (ret)
   return ret;

Cheers,
Jerome

Reply via email to