Skip to contentSkip to conversation

drm/amd/amdgpu: set allow_reserved_eviction and resv when bo allocation and cs

PATCH In review Roger He 4 participants 4 messages Dec 14, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Roger He

author
#0 lore raw

PATCH 1/2 drm/amd/amdgpu: set allow_reserved_eviction and resv when bo allocation and cs

Change-Id I0c6571c2a64e6c5bdad80ccbcccb40eba1c20b4e
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c     | 6 +++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 7 ++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +5 -1
index 44523a8..ace6152 100644
@@ -343,7 +343,11 @@ static int amdgpu_cs_bo_validate(struct amdgpu_cs_parser *p,
 				 struct amdgpu_bo *bo)
 {
 	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
-	struct ttm_operation_ctx ctx = { true, false };
+	struct ttm_operation_ctx ctx = {
+		.interruptible = true,
+		.no_wait_gpu = false,
+		.resv = bo->tbo.resv
+	};
 	uint32_t domain;
 	int r;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +6 -1
index dc0a8be..86340cf 100644
@@ -327,7 +327,12 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
 			       uint64_t init_value,
 			       struct amdgpu_bo **bo_ptr)
 {
-	struct ttm_operation_ctx ctx = { !kernel, false };
+	struct ttm_operation_ctx ctx = {
+		.interruptible = !kernel,
+		.no_wait_gpu = false,
+		.allow_reserved_eviction = true,
+		.resv = resv
+	};
 	struct amdgpu_bo *bo;
 	enum ttm_bo_type type;
 	unsigned long page_align;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to a message not in the archive

Here again a better commit message is needed. Just something like the following:

This enables eviction of other per VM BOs during allocation and allows reaping of deleted per VM BOs during CS again.

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

Am 14.12.2017 um 09:12 schrieb Roger He:

Quoted 32 lines
Change-Id I0c6571c2a64e6c5bdad80ccbcccb40eba1c20b4e
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c     | 6 +++++-
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 7 ++++++-
  2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +5 -1
index 44523a8..ace6152 100644
@@ -343,7 +343,11 @@ static int amdgpu_cs_bo_validate(struct amdgpu_cs_parser *p,
  				 struct amdgpu_bo *bo)
  {
  	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
-	struct ttm_operation_ctx ctx = { true, false };
+	struct ttm_operation_ctx ctx = {
+		.interruptible = true,
+		.no_wait_gpu = false,
+		.resv = bo->tbo.resv
+	};
  	uint32_t domain;
  	int r;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
index dc0a8be..86340cf 100644
@@ -327,7 +327,12 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
  			       uint64_t init_value,
  			       struct amdgpu_bo **bo_ptr)
  {

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c static int amdgpu_bo_do_create(struct amdgpu_device *adev, · line 338

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +6 -1
-	struct ttm_operation_ctx ctx = { !kernel, false };
+	struct ttm_operation_ctx ctx = {
+		.interruptible = !kernel,
+		.no_wait_gpu = false,
+		.allow_reserved_eviction = true,
+		.resv = resv
+	};
  	struct amdgpu_bo *bo;
  	enum ttm_bo_type type;
  	unsigned long page_align;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by
#4 lore raw
In reply to a message not in the archive
Quoted 50 lines · Christian König

Here again a better commit message is needed. Just something like the following:

This enables eviction of other per VM BOs during allocation and allows reaping of deleted per VM BOs during CS again.

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

Am 14.12.2017 um 09:12 schrieb Roger He:

Quoted 40 lines
Change-Id I0c6571c2a64e6c5bdad80ccbcccb40eba1c20b4e

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c     | 6 +++++- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 7 ++++++-

  2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +5 -1
index 44523a8..ace6152 100644
@@ -343,7 +343,11 @@ static int amdgpu_cs_bo_validate(struct 
 amdgpu_cs_parser *p,
                    struct amdgpu_bo *bo)
   {
       struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
-    struct ttm_operation_ctx ctx = { true, false };
+    struct ttm_operation_ctx ctx = {
+        .interruptible = true,
+        .no_wait_gpu = false,
+        .resv = bo->tbo.resv
+    };
       uint32_t domain;
       int r;

  diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index dc0a8be..86340cf 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +6 -1
@@ -327,7 +327,12 @@ static int amdgpu_bo_do_create(struct 
 amdgpu_device *adev,
                      uint64_t init_value,
                      struct amdgpu_bo **bo_ptr)
   {
-    struct ttm_operation_ctx ctx = { !kernel, false };
+    struct ttm_operation_ctx ctx = {
+        .interruptible = !kernel,
+        .no_wait_gpu = false,
+        .allow_reserved_eviction = true,
+        .resv = resv
+    };
Quoted 8 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
       struct amdgpu_bo *bo;
       enum ttm_bo_type type;

      unsigned long page_align;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#5 lore raw
In reply to a message not in the archive
Quoted 12 lines · Roger He
Change-Id I0c6571c2a64e6c5bdad80ccbcccb40eba1c20b4e
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c     | 6 +++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 7 ++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0 -0
index 44523a8..ace6152 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_bo_validate(struct amdgpu_cs_parser *p, · line 350

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +5 -1
@@ -343,7 +343,11 @@ static int amdgpu_cs_bo_validate(struct amdgpu_cs_parser *p,
 				 struct amdgpu_bo *bo)
 {
 	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
-	struct ttm_operation_ctx ctx = { true, false };
+	struct ttm_operation_ctx ctx = {
+		.interruptible = true,
+		.no_wait_gpu = false,
+		.resv = bo->tbo.resv
+	};

Might be better to explicitly initialize

.allow_reserved_eviction = false,

here as well.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx