[PATCH] drm/radeon/prime: reserve/unreserve around pin

Alex Deucher alexdeucher at gmail.com
Tue Jun 12 08:17:03 PDT 2012


On Tue, Jun 12, 2012 at 11:10 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> I finally got to test this code a bit more and hit the ttm
> no reserved assert, so add the reservations around the pinning.

Good catch.

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  drivers/gpu/drm/radeon/radeon_prime.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c
> index 8ddab4c7..6bef46a 100644
> --- a/drivers/gpu/drm/radeon/radeon_prime.c
> +++ b/drivers/gpu/drm/radeon/radeon_prime.c
> @@ -169,11 +169,17 @@ struct dma_buf *radeon_gem_prime_export(struct drm_device *dev,
>        struct radeon_bo *bo = gem_to_radeon_bo(obj);
>        int ret = 0;
>
> +       ret = radeon_bo_reserve(bo, false);
> +       if (unlikely(ret != 0))
> +               return ERR_PTR(ret);
> +
>        /* pin buffer into GTT */
>        ret = radeon_bo_pin(bo, RADEON_GEM_DOMAIN_GTT, NULL);
> -       if (ret)
> +       if (ret) {
> +               radeon_bo_unreserve(bo);
>                return ERR_PTR(ret);
> -
> +       }
> +       radeon_bo_unreserve(bo);
>        return dma_buf_export(bo, &radeon_dmabuf_ops, obj->size, flags);
>  }
>
> --
> 1.7.7.6
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list