diff mbox series

[3/4] drm/amdgpu: always allow evicting to SYSTEM domain

Message ID 20210601122528.1643-3-christian.koenig@amd.com (mailing list archive)
State New, archived
Headers show
Series [1/4] drm/ttm: add TTM_PL_FLAG_TEMPORARY flag v3 | expand

Commit Message

Christian König June 1, 2021, 12:25 p.m. UTC
When we run out of GTT we should still be able to evict VRAM->SYSTEM
with a bounce bufferdrm/amdgpu: always allow evicting to SYSTEM domain

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Yu, Lang June 2, 2021, 1:30 a.m. UTC | #1
>-----Original Message-----
>From: Christian König <ckoenig.leichtzumerken@gmail.com>
>Sent: Tuesday, June 1, 2021 8:25 PM
>To: Yu, Lang <Lang.Yu@amd.com>; thomas_os@shipmail.org
>Cc: dri-devel@lists.freedesktop.org
>Subject: [PATCH 3/4] drm/amdgpu: always allow evicting to SYSTEM domain
>
>When we run out of GTT we should still be able to evict VRAM->SYSTEM with a
>bounce bufferdrm/amdgpu: always allow evicting to SYSTEM domain
>
>Signed-off-by: Christian König <christian.koenig@amd.com>
>---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>index 6bdff9005a47..0faf9765ef41 100644
>--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>@@ -147,14 +147,16 @@ static void amdgpu_evict_flags(struct
>ttm_buffer_object *bo,
> 			 * BOs to be evicted from VRAM
> 			 */
> 			amdgpu_bo_placement_from_domain(abo,
>AMDGPU_GEM_DOMAIN_VRAM |
>-
>AMDGPU_GEM_DOMAIN_GTT);
>+
>	AMDGPU_GEM_DOMAIN_GTT |
>+
>	AMDGPU_GEM_DOMAIN_CPU);
> 			abo->placements[0].fpfn = adev-
>>gmc.visible_vram_size >> PAGE_SHIFT;
> 			abo->placements[0].lpfn = 0;
> 			abo->placement.busy_placement = &abo-
>>placements[1];
> 			abo->placement.num_busy_placement = 1;
> 		} else {
> 			/* Move to GTT memory */
>-			amdgpu_bo_placement_from_domain(abo,
>AMDGPU_GEM_DOMAIN_GTT);
>+			amdgpu_bo_placement_from_domain(abo,
>AMDGPU_GEM_DOMAIN_GTT |
>+
>	AMDGPU_GEM_DOMAIN_CPU);
> 		}
> 		break;
> 	case TTM_PL_TT:
>--
>2.25.1

[Yu, Lang] 
Yeah, that's it.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 6bdff9005a47..0faf9765ef41 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -147,14 +147,16 @@  static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
 			 * BOs to be evicted from VRAM
 			 */
 			amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM |
-							 AMDGPU_GEM_DOMAIN_GTT);
+							AMDGPU_GEM_DOMAIN_GTT |
+							AMDGPU_GEM_DOMAIN_CPU);
 			abo->placements[0].fpfn = adev->gmc.visible_vram_size >> PAGE_SHIFT;
 			abo->placements[0].lpfn = 0;
 			abo->placement.busy_placement = &abo->placements[1];
 			abo->placement.num_busy_placement = 1;
 		} else {
 			/* Move to GTT memory */
-			amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT);
+			amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT |
+							AMDGPU_GEM_DOMAIN_CPU);
 		}
 		break;
 	case TTM_PL_TT: