[PATCH] drm/amd/amdgpu: if visible VRAM allocation fail, fall back to invisible try again

Christian König christian.koenig at amd.com
Fri Nov 10 12:23:39 UTC 2017


Am 10.11.2017 um 13:17 schrieb Roger He:
> Change-Id: Ib30efa5f007fce12a85a66722a8c9f76496f2dec
> Signed-off-by: Roger He <Hongbo.He at amd.com>

Yep, exactly what I had in mind during our discussion as well.

Patch is Reviewed-by: Christian König <christian.koenig at amd.com>.

Thanks for taking care of this,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index fb72edc..a1eaabb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -63,6 +63,11 @@ int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,
>   			     flags, NULL, resv, 0, &bo);
>   	if (r) {
>   		if (r != -ERESTARTSYS) {
> +			if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) {
> +				flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
> +				goto retry;
> +			}
> +
>   			if (initial_domain == AMDGPU_GEM_DOMAIN_VRAM) {
>   				initial_domain |= AMDGPU_GEM_DOMAIN_GTT;
>   				goto retry;




More information about the amd-gfx mailing list