Re: [PATCH 54/55] drm/i915: Mark the context and address space as closed

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

 



On ma, 2016-07-25 at 18:32 +0100, Chris Wilson wrote:
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -907,6 +907,7 @@ struct i915_gem_context {
>  	struct list_head link;
>  
>  	u8 remap_slice;
> +	bool closed:1;

Not a whole bool? I think it could be.
 
>  
> +static void i915_ppgtt_close(struct i915_address_space *vm)
> +{
> +	struct list_head *phases[] = {
> +		&vm->active_list,
> +		&vm->inactive_list,
> +		&vm->unbound_list,
> +		NULL,
> +	}, **phase;
> +
> +	GEM_BUG_ON(vm->closed);
> +	vm->closed = true;
> +
> +	for (phase = phases; *phase; phase++) {
> +		struct i915_vma *vma, *vn;
> +
> +		list_for_each_entry_safe(vma, vn, *phase, vm_link)
> +			if (!vma->closed)
> +				i915_vma_close(vma);
> +	}

Pretty sure rather listing three three function calls here would be
nicer;

i915_ppgtt_do_close(vm->active_list);
i915_ppgtt_do_close(vm->inactive_list);
...

Patch really makes the tracking easier to follow, there also seems to
be a hint of paranoia, but it's with GEM_BUG_ON() so should not hurt.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
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