[Intel-gfx] [PATCH] drm/i915: Handle i915_ppgtt_put correctly
Daniel Vetter
daniel at ffwll.ch
Tue Aug 19 16:07:20 CEST 2014
On Tue, Aug 19, 2014 at 10:50 AM, Michel Thierry
<michel.thierry at intel.com> wrote:
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -2223,6 +2223,7 @@ static struct i915_vma *__i915_gem_vma_create(struct drm_i915_gem_object *obj,
> INIT_LIST_HEAD(&vma->exec_list);
> vma->vm = vm;
> vma->obj = obj;
> + vma->ppgtt_refcount = 0;
>
> switch (INTEL_INFO(vm->dev)->gen) {
> case 8:
> @@ -2267,8 +2268,10 @@ i915_gem_obj_lookup_or_create_vma(struct drm_i915_gem_object *obj,
> if (!vma)
> vma = __i915_gem_vma_create(obj, vm);
>
> - if (!i915_is_ggtt(vm))
> + if (!i915_is_ggtt(vm)) {
> i915_ppgtt_get(i915_vm_to_ppgtt(vm));
> + vma->ppgtt_refcount++;
> + }
Shouldn't we just move the ppgtt into the vma_create hunk (or
function) instead of this complication?
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the Intel-gfx
mailing list