[PATCH] drm/radeon: delay virtual address destruction to bo destruction

Jerome Glisse j.glisse at gmail.com
Wed Aug 8 07:13:23 PDT 2012


On Wed, Aug 8, 2012 at 10:36 AM,  <j.glisse at gmail.com> wrote:
> From: Jerome Glisse <jglisse at redhat.com>
>
> Use the ttm bo delayed destruction queue so that we don't block
> userspace when destroying bo. The virtual address destruction
> will happen at same time as the real bo destruction when everythings
> using the bo is done.

Haven't had time to test this extensively. Probably won't have time to
seriously test this before next week. This is mostly an optimization
to avoid stalling userspace when destroying bo.

Cheers,
Jerome


>
> Signed-off-by: Jerome Glisse <jglisse at redhat.com>
> ---
>  drivers/gpu/drm/radeon/radeon_drv.c |    2 +-
>  drivers/gpu/drm/radeon/radeon_gem.c |   20 --------------------
>  2 files changed, 1 insertion(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index dcea6f0..38443e7 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -368,7 +368,7 @@ static struct drm_driver kms_driver = {
>         .gem_init_object = radeon_gem_object_init,
>         .gem_free_object = radeon_gem_object_free,
>         .gem_open_object = radeon_gem_object_open,
> -       .gem_close_object = radeon_gem_object_close,
> +       .gem_close_object = NULL,
>         .dma_ioctl = radeon_dma_ioctl_kms,
>         .dumb_create = radeon_mode_dumb_create,
>         .dumb_map_offset = radeon_mode_dumb_mmap,
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index 1b57b00..b5835c8 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -127,26 +127,6 @@ int radeon_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_pri
>         return 0;
>  }
>
> -void radeon_gem_object_close(struct drm_gem_object *obj,
> -                            struct drm_file *file_priv)
> -{
> -       struct radeon_bo *rbo = gem_to_radeon_bo(obj);
> -       struct radeon_device *rdev = rbo->rdev;
> -       struct radeon_fpriv *fpriv = file_priv->driver_priv;
> -       struct radeon_vm *vm = &fpriv->vm;
> -
> -       if (rdev->family < CHIP_CAYMAN) {
> -               return;
> -       }
> -
> -       if (radeon_bo_reserve(rbo, false)) {
> -               dev_err(rdev->dev, "leaking bo va because we fail to reserve bo\n");
> -               return;
> -       }
> -       radeon_vm_bo_rmv(rdev, vm, rbo);
> -       radeon_bo_unreserve(rbo);
> -}
> -
>  static int radeon_gem_handle_lockup(struct radeon_device *rdev, int r)
>  {
>         if (r == -EDEADLK) {
> --
> 1.7.10.4
>


More information about the dri-devel mailing list