Re: [PATCH 1/6] drm/amdgpu: add AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS flag v3

2016-10-11 Thread Christian König

Am 07.10.2016 um 23:19 schrieb Felix Kuehling:

On 16-09-27 05:49 AM, Christian König wrote:

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1195,6 +1195,15 @@ int amdgpu_cs_sysvm_access_required(struct 
amdgpu_cs_parser *parser)
r = amdgpu_ttm_bind(>tbo, >tbo.mem);
if (unlikely(r))
return r;
+
+   if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)
+   continue;

Should you also continue if the BO is not VRAM?


No, the placement of the BO at this point isn't final. For older UVD 
blocks this can still be shuffled around to fulfill the placement 
restrictions.


So the BO could still move into VRAM even after this.

Regards,
Christian.



Regards,
   Felix


+
+   bo->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;
+   amdgpu_ttm_placement_from_domain(bo, bo->allowed_domains);
+   r = ttm_bo_validate(>tbo, >placement, false, false);
+   if (unlikely(r))
+   return r;
}
  
  	return 0;



___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH 1/6] drm/amdgpu: add AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS flag v3

2016-10-07 Thread Felix Kuehling
On 16-09-27 05:49 AM, Christian König wrote:
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -1195,6 +1195,15 @@ int amdgpu_cs_sysvm_access_required(struct 
> amdgpu_cs_parser *parser)
>   r = amdgpu_ttm_bind(>tbo, >tbo.mem);
>   if (unlikely(r))
>   return r;
> +
> + if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)
> + continue;

Should you also continue if the BO is not VRAM?

Regards,
  Felix

> +
> + bo->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;
> + amdgpu_ttm_placement_from_domain(bo, bo->allowed_domains);
> + r = ttm_bo_validate(>tbo, >placement, false, false);
> + if (unlikely(r))
> + return r;
>   }
>  
>   return 0;

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx