[1/3] drm/amdgpu: set GTT_USWC on reserved VRAM allocations

Submitted by Marek Olšák on Oct. 5, 2018, 9:01 p.m.

Details

Message ID 20181005210144.13999-1-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Marek Olšák Oct. 5, 2018, 9:01 p.m.
From: Marek Olšák <marek.olsak@amd.com>

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 904014dc5915..8e0f47343e0e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -241,21 +241,23 @@  int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
 	if (!size) {
 		amdgpu_bo_unref(bo_ptr);
 		return 0;
 	}
 
 	memset(&bp, 0, sizeof(bp));
 	bp.size = size;
 	bp.byte_align = align;
 	bp.domain = domain;
 	bp.flags = AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
-		AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;
+		   AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
+		   (domain & AMDGPU_GEM_DOMAIN_VRAM ?
+			    AMDGPU_GEM_CREATE_CPU_GTT_USWC : 0);
 	bp.type = ttm_bo_type_kernel;
 	bp.resv = NULL;
 
 	if (!*bo_ptr) {
 		r = amdgpu_bo_create(adev, &bp, bo_ptr);
 		if (r) {
 			dev_err(adev->dev, "(%d) failed to allocate kernel bo\n",
 				r);
 			return r;
 		}

Comments

Am 05.10.2018 um 23:01 schrieb Marek Olšák:
> From: Marek Olšák <marek.olsak@amd.com>
>
> Signed-off-by: Marek Olšák <marek.olsak@amd.com>

VRAM is always accessed USWC, so that doesn't looks like it would have 
any effect to me.

The rest of the series looks good to me,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 904014dc5915..8e0f47343e0e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -241,21 +241,23 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
>   	if (!size) {
>   		amdgpu_bo_unref(bo_ptr);
>   		return 0;
>   	}
>   
>   	memset(&bp, 0, sizeof(bp));
>   	bp.size = size;
>   	bp.byte_align = align;
>   	bp.domain = domain;
>   	bp.flags = AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
> -		AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;
> +		   AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
> +		   (domain & AMDGPU_GEM_DOMAIN_VRAM ?
> +			    AMDGPU_GEM_CREATE_CPU_GTT_USWC : 0);
>   	bp.type = ttm_bo_type_kernel;
>   	bp.resv = NULL;
>   
>   	if (!*bo_ptr) {
>   		r = amdgpu_bo_create(adev, &bp, bo_ptr);
>   		if (r) {
>   			dev_err(adev->dev, "(%d) failed to allocate kernel bo\n",
>   				r);
>   			return r;
>   		}