Re: [PATCH 18/22] drm/i915/selftests: huge page tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Matthew Auld (2017-09-25 19:47:33)
> +static int igt_tmpfs_fallback(void *arg)
> +{
> +       struct drm_i915_private *i915 = arg;
> +       struct vfsmount *gemfs = i915->mm.gemfs;
> +       struct drm_i915_gem_object *obj;
> +       int err = 0;
> +
> +       /*
> +        * Make sure that we don't burst into a ball of flames upon falling back
> +        * to tmpfs, which we rely on if on the off-chance we encouter a failure
> +        * when setting up gemfs.
> +        */
> +
> +       i915->mm.gemfs = NULL;
> +
> +       obj = i915_gem_object_create(i915, PAGE_SIZE);
> +       if (IS_ERR(obj)) {
> +               err = PTR_ERR(obj);
> +               goto out_restore;
> +       }
> +
> +       err = i915_gem_object_pin_pages(obj);
> +       if (err)
> +               goto out_put;
> +
> +       i915_gem_object_unpin_pages(obj);
> +out_put:
> +       i915_gem_object_put(obj);
> +out_restore:
> +       i915->mm.gemfs = gemfs;
> +
> +       return err;
> +}

Very sensible! Do a vaddr = pin_map(); *vaddr; unpin_map() in the
middle (instead of just pin_pages). Could do with a vma_bind as well to
check that dma_map_sg() is also happy.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux