[Intel-xe] [PATCH v3 7/8] drm/xe: Only try to lock external BOs in VM bind

Thomas Hellström thomas.hellstrom at linux.intel.com
Wed Jun 14 11:46:02 UTC 2023


On 6/7/23 18:03, Matthew Brost wrote:
> We only need to try to lock a BO if it's external as non-external BOs
> share the dma-resv with the already locked VM. Trying to lock
> non-external BOs caused an issue (list corruption) in an uncoming patch
s/uncoming/upcoming/ ?
> which adds bulk LRU move. Since this code isn't needed, remove it.

I'm still curious as to why the list corruption happens. But since this 
patch shouldn't introduce any regressions and the code will probably 
change with drm_exec,

with the above typo fixed,

Reviewed-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>

>
> v2: New commit message, s/mattthew/matthew/
>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_vm.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index d1c380ad7f6b..2780f350ed33 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -2146,9 +2146,11 @@ static int vm_bind_ioctl(struct xe_vm *vm, struct xe_vma *vma,
>   		 */
>   		xe_bo_get(vbo);
>   
> -		tv_bo.bo = &vbo->ttm;
> -		tv_bo.num_shared = 1;
> -		list_add(&tv_bo.head, &objs);
> +		if (!vbo->vm) {
> +			tv_bo.bo = &vbo->ttm;
> +			tv_bo.num_shared = 1;
> +			list_add(&tv_bo.head, &objs);
> +		}
>   	}
>   
>   again:


More information about the Intel-xe mailing list