diff options
| author | Chunming Zhou <david1.zhou@amd.com> | 2018-04-17 18:34:40 +0800 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-15 13:43:32 -0500 | 
| commit | 3f188453faf7ba5b59e8064df4afffbc946e25ec (patch) | |
| tree | 64c028c4dee60d1b0c9b37692234ffae98056cf0 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
| parent | aa2b2e2822831d78a283edb12cf8b7da21bdd0ed (diff) | |
drm/amdgpu: handle domain mask checking v2
if domain is illegal, we should return error.
v2:
  remove duplicated domain checking.
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 9 | 
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 9258f0694922..feece0a491a3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -360,7 +360,6 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,  	};  	struct amdgpu_bo *bo;  	unsigned long page_align, size = bp->size; -	u32 preferred_domains;  	size_t acc_size;  	int r; @@ -381,14 +380,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,  	drm_gem_private_object_init(adev->ddev, &bo->gem_base, size);  	INIT_LIST_HEAD(&bo->shadow_list);  	INIT_LIST_HEAD(&bo->va); -	preferred_domains = bp->preferred_domain ? bp->preferred_domain : +	bo->preferred_domains = bp->preferred_domain ? bp->preferred_domain :  		bp->domain; -	bo->preferred_domains = preferred_domains & (AMDGPU_GEM_DOMAIN_VRAM | -						     AMDGPU_GEM_DOMAIN_GTT | -						     AMDGPU_GEM_DOMAIN_CPU | -						     AMDGPU_GEM_DOMAIN_GDS | -						     AMDGPU_GEM_DOMAIN_GWS | -						     AMDGPU_GEM_DOMAIN_OA);  	bo->allowed_domains = bo->preferred_domains;  	if (bp->type != ttm_bo_type_kernel &&  	    bo->allowed_domains == AMDGPU_GEM_DOMAIN_VRAM)  | 
