diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-06-07 17:30:40 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-06-07 21:53:13 +0100 |
commit | 17f297b427a32ef5524a494de331c68366e8226d (patch) | |
tree | 8edba0fd79e95fa371e84f2f803763c2aa7c0965 /drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | |
parent | 93f2cde2a4f7947f6330ecfb9b27d13e2f4d43af (diff) | |
download | linux-rt-17f297b427a32ef5524a494de331c68366e8226d.tar.gz |
drm/i915/gtt: Push allocation to hw ppgtt constructor
In the next patch, we will subclass the gen6 hw_ppgtt. In order, for the
two different generations of hw ppgtt stucts to be of different size,
push the allocation down to the constructor.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180607163040.9781-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/selftests/i915_gem_gtt.c')
-rw-r--r-- | drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c index 58ab5e84ceb7..f80cf7ce3fa9 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -147,12 +147,16 @@ static int igt_ppgtt_alloc(void *arg) return -ENOMEM; mutex_lock(&dev_priv->drm.struct_mutex); - err = __hw_ppgtt_init(ppgtt, dev_priv); - if (err) - goto err_ppgtt; + ppgtt = __hw_ppgtt_create(dev_priv); + if (IS_ERR(ppgtt)) { + err = PTR_ERR(ppgtt); + goto err_unlock; + } - if (!ppgtt->vm.allocate_va_range) + if (!ppgtt->vm.allocate_va_range) { + err = 0; goto err_ppgtt_cleanup; + } /* Check we can allocate the entire range */ for (size = 4096; @@ -189,9 +193,9 @@ static int igt_ppgtt_alloc(void *arg) err_ppgtt_cleanup: ppgtt->vm.cleanup(&ppgtt->vm); -err_ppgtt: - mutex_unlock(&dev_priv->drm.struct_mutex); kfree(ppgtt); +err_unlock: + mutex_unlock(&dev_priv->drm.struct_mutex); return err; } |