Skip to contentSkip to conversation

drm/amdgpu: fix gtt_mgr bo's offset

PATCH In review Flora Cui 3 participants 10 messages Sep 20, 2016 – Sep 21, 2016 5 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Flora Cui

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix gtt_mgr bo's offset

Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
index 262e872..b266cf7 100644
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
 
 	if (!r) {
 		mem->start = node->start;
-		tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
-		    tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+		tbo->offset = (mem->start << PAGE_SHIFT) +
+		    tbo->bdev->man[mem->mem_type].gpu_offset;
 	}
 
 	return r;
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1474362552-9062-1-git-send-email-Flora.Cui-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 11 lines · Flora Cui
Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
index 262e872..b266cf7 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, · line 132

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
 
  	if (!r) {
  		mem->start = node->start;
-		tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
-		    tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+		tbo->offset = (mem->start << PAGE_SHIFT) +
+		    tbo->bdev->man[mem->mem_type].gpu_offset;

mem->mem_type seems not set yet as well if I am correct.
IIRC, I feel it's better that tbo->offset is set out of this function after get_node successfully.

Regards,
David Zhou

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, · line 135

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
  	}
 
  	return r;

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw
Quoted 9 lines · On Tue, Sep 20, 2016 at 06:19:33PM +0800, zhoucm1 wrote:
Quoted 6 lines · Flora Cui
Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, · line 131

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
index 262e872..b266cf7 100644
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
 	if (!r) {
 		mem->start = node->start;
-		tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
-		    tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+		tbo->offset = (mem->start << PAGE_SHIFT) +
+		    tbo->bdev->man[mem->mem_type].gpu_offset;

mem->mem_type seems not set yet as well if I am correct.
IIRC, I feel it's better that tbo->offset is set out of this function after get_node successfully.

how about change to tbo->bdev->man[TTM_PL_TT].gpu_offset? since gtt_mgr is for GTT only.

Quoted 6 lines

Regards,
David Zhou

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
 	}
 	return r;

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

#5 lore raw

Am 20.09.2016 um 12:41 schrieb Flora Cui:

Quoted 24 lines · On Tue, Sep 20, 2016 at 06:19:33PM +0800, zhoucm1 wrote:
Quoted 8 lines · Flora Cui
Quoted 6 lines
Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, · line 131

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
index 262e872..b266cf7 100644
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
  	if (!r) {
  		mem->start = node->start;
-		tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
-		    tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+		tbo->offset = (mem->start << PAGE_SHIFT) +
+		    tbo->bdev->man[mem->mem_type].gpu_offset;

mem->mem_type seems not set yet as well if I am correct.
IIRC, I feel it's better that tbo->offset is set out of this function after get_node successfully.

Quoted 2 lines

how about change to tbo->bdev->man[TTM_PL_TT].gpu_offset? since gtt_mgr is for GTT only.

Not 100% correct either.

The problem is that sometimes a GTT MM node will be bound for a BO which is still in VRAM (e.g. on eviction for example).

So you need to check if (&tbo->mem == mem) and only then update the tbo's offset.

Regards,
Christian.

Quoted 10 lines
Quoted 6 lines

Regards,
David Zhou

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
  	}
  	return r;

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): b4bb5cc9-39de-aff6-ec12-2d97d0cc9fcd-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

author Reviewed-by Hawking Zhang
#7 lore raw

Does this change make sense?

Quoted 51 lines · Christian König

Am 20.09.2016 um 12:41 schrieb Flora Cui:

Quoted 24 lines · On Tue, Sep 20, 2016 at 06:19:33PM +0800, zhoucm1 wrote:
Quoted 8 lines · Flora Cui
Quoted 6 lines
Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, · line 131

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
index 262e872..b266cf7 100644
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
 	if (!r) {
 		mem->start = node->start;
-		tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
-		    tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+		tbo->offset = (mem->start << PAGE_SHIFT) +
+		    tbo->bdev->man[mem->mem_type].gpu_offset;

mem->mem_type seems not set yet as well if I am correct.
IIRC, I feel it's better that tbo->offset is set out of this function after get_node successfully.

Quoted 2 lines

how about change to tbo->bdev->man[TTM_PL_TT].gpu_offset? since gtt_mgr is for GTT only.

Not 100% correct either.

The problem is that sometimes a GTT MM node will be bound for a BO which is still in VRAM (e.g. on eviction for example).

So you need to check if (&tbo->mem == mem) and only then update the tbo's offset.

Regards,
Christian.

Quoted 10 lines
Quoted 6 lines

Regards,
David Zhou

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
 	}
 	return r;

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

Quoted 5 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
From 411f93d78e8f3691ce480146374c1e603c2c6db6 Mon Sep 17 00:00:00 2001

From: Flora Cui <[email protected]>
Date: Tue, 20 Sep 2016 17:07:31 +0800
Subject: [PATCH] drm/amdgpu: fix gtt_mgr bo's offset

Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +3 -2
index 262e872..f86c844 100644
@@ -128,8 +128,9 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
 
 	if (!r) {
 		mem->start = node->start;
-		tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
-		    tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+		if (&tbo->mem == mem)
+			tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
+			    tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
 	}
 
 	return r;
Signature · 1 line
2.7.4

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

#8 lore raw

Am 20.09.2016 um 13:16 schrieb Flora Cui:

Quoted 1 line

Does this change make sense?

Yes, exactly. Patch is Reviewed-by: Christian König <[email protected]>.

But please be aware that there is at least one other bug I'm currently investigating.

Regards,
Christian.

Quoted 49 lines · Christian König
Quoted 47 lines

Am 20.09.2016 um 12:41 schrieb Flora Cui:

Quoted 23 lines · On Tue, Sep 20, 2016 at 06:19:33PM +0800, zhoucm1 wrote:
Quoted 7 lines · Flora Cui
Quoted 6 lines
Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, · line 131

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
index 262e872..b266cf7 100644
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
  	if (!r) {
  		mem->start = node->start;
-		tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
-		    tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+		tbo->offset = (mem->start << PAGE_SHIFT) +
+		    tbo->bdev->man[mem->mem_type].gpu_offset;

mem->mem_type seems not set yet as well if I am correct.
IIRC, I feel it's better that tbo->offset is set out of this function after get_node successfully.

Quoted 2 lines

how about change to tbo->bdev->man[TTM_PL_TT].gpu_offset? since gtt_mgr is for GTT only.

Not 100% correct either.

The problem is that sometimes a GTT MM node will be bound for a BO which is still in VRAM (e.g. on eviction for example).

So you need to check if (&tbo->mem == mem) and only then update the tbo's offset.

Regards,
Christian.

Quoted 9 lines
Quoted 5 lines

Regards,
David Zhou

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
  	}
  	return r;

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

Quoted 4 lines
Quoted 4 lines

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): ec255145-4ee3-caab-bfc5-644f4afba6ad-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#10 lore raw
Quoted 4 lines · Christian König

Am 20.09.2016 um 13:16 schrieb Flora Cui:

Quoted 1 line

Does this change make sense?

Yes, exactly. Patch is Reviewed-by: Christian König <[email protected]>.

Hi Flora,
Does this change work?

if (&tbo->mem == mem)
this checking seems always be false, right?

Regards,
David Zhou

Quoted 62 lines

But please be aware that there is at least one other bug I'm currently investigating.

Regards,
Christian.

Quoted 54 lines · Christian König
Quoted 52 lines

Am 20.09.2016 um 12:41 schrieb Flora Cui:

Quoted 24 lines · On Tue, Sep 20, 2016 at 06:19:33PM +0800, zhoucm1 wrote:
Quoted 7 lines · Flora Cui
Quoted 6 lines
Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 16 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct · line 132

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
index 262e872..b266cf7 100644
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct 
 ttm_mem_type_manager *man,
      if (!r) {
          mem->start = node->start;
-        tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
- tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+        tbo->offset = (mem->start << PAGE_SHIFT) +
+ tbo->bdev->man[mem->mem_type].gpu_offset;

mem->mem_type seems not set yet as well if I am correct.
IIRC, I feel it's better that tbo->offset is set out of this function after get_node successfully.

Quoted 2 lines

how about change to tbo->bdev->man[TTM_PL_TT].gpu_offset? since gtt_mgr is for GTT only.

Not 100% correct either.

The problem is that sometimes a GTT MM node will be bound for a BO which is still in VRAM (e.g. on eviction for example).

So you need to check if (&tbo->mem == mem) and only then update the tbo's offset.

Regards,
Christian.

Quoted 9 lines
Quoted 5 lines

Regards,
David Zhou

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
      }
      return r;

_______________________________________________
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

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#12 lore raw
Quoted 6 lines · On Wed, Sep 21, 2016 at 09:54:04AM +0800, zhoucm1 wrote:
Quoted 3 lines · Christian König

Am 20.09.2016 um 13:16 schrieb Flora Cui:

Quoted 1 line

Does this change make sense?

Quoted 7 lines
Quoted 2 lines

Yes, exactly. Patch is Reviewed-by: Christian König <[email protected]>.

Hi Flora,
Does this change work?

if (&tbo->mem == mem)
this checking seems always be false, right?

mostly the check is true. eg amdgpu_bo_pin_restricted->amdgpu_ttm_bind(), the mem is &bo->tbo.mem

Quoted 71 lines

Regards,
David Zhou

Quoted 67 lines

But please be aware that there is at least one other bug I'm currently investigating.

Regards,
Christian.

Quoted 58 lines · Christian König
Quoted 56 lines

Am 20.09.2016 um 12:41 schrieb Flora Cui:

Quoted 26 lines · On Tue, Sep 20, 2016 at 06:19:33PM +0800, zhoucm1 wrote:
Quoted 16 lines · Flora Cui
Quoted 15 lines
Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
index 262e872..b266cf7 100644
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct
 ttm_mem_type_manager *man,
     if (!r) {
         mem->start = node->start;
Quoted 9 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
-        tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
- tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+        tbo->offset = (mem->start << PAGE_SHIFT) +
+ tbo->bdev->man[mem->mem_type].gpu_offset;

mem->mem_type seems not set yet as well if I am correct. IIRC, I feel it's better that tbo->offset is set out of this function after
get_node successfully.

Quoted 2 lines

how about change to tbo->bdev->man[TTM_PL_TT].gpu_offset? since gtt_mgr is for GTT only.

Not 100% correct either.

The problem is that sometimes a GTT MM node will be bound for a BO which is
still in VRAM (e.g. on eviction for example).

So you need to check if (&tbo->mem == mem) and only then update the tbo's
offset.

Regards,
Christian.

Quoted 9 lines
Quoted 5 lines

Regards,
David Zhou

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
     }
     return r;

_______________________________________________
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

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

author
#13 lore raw
In reply to a message not in the archive

we need this fix for urgent promotion. so please please reply me asap.

Quoted 51 lines · Christian König

Am 20.09.2016 um 12:41 schrieb Flora Cui:

Quoted 24 lines · On Tue, Sep 20, 2016 at 06:19:33PM +0800, zhoucm1 wrote:
Quoted 8 lines · Flora Cui
Quoted 6 lines
Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 15 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, · line 131

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
index 262e872..b266cf7 100644
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
 	if (!r) {
 		mem->start = node->start;
-		tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
-		    tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+		tbo->offset = (mem->start << PAGE_SHIFT) +
+		    tbo->bdev->man[mem->mem_type].gpu_offset;

mem->mem_type seems not set yet as well if I am correct.
IIRC, I feel it's better that tbo->offset is set out of this function after get_node successfully.

Quoted 2 lines

how about change to tbo->bdev->man[TTM_PL_TT].gpu_offset? since gtt_mgr is for GTT only.

Not 100% correct either.

The problem is that sometimes a GTT MM node will be bound for a BO which is still in VRAM (e.g. on eviction for example).

So you need to check if (&tbo->mem == mem) and only then update the tbo's offset.

Regards,
Christian.

Quoted 10 lines
Quoted 6 lines

Regards,
David Zhou

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
 	}
 	return r;

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

Quoted 4 lines

_______________________________________________
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

#14 lore raw
In reply to a message not in the archive

Am 20.09.2016 um 12:19 schrieb zhoucm1:

Quoted 9 lines · Flora Cui
Quoted 6 lines
Change-Id I89e9be3d5c96d46655f3a977fb557b20b4d87609
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct · line 132

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +2 -2
index 262e872..b266cf7 100644
@@ -128,8 +128,8 @@ int amdgpu_gtt_mgr_alloc(struct 
 ttm_mem_type_manager *man,
        if (!r) {
          mem->start = node->start;
-        tbo->offset = (tbo->mem.start << PAGE_SHIFT) +
- tbo->bdev->man[tbo->mem.mem_type].gpu_offset;
+        tbo->offset = (mem->start << PAGE_SHIFT) +
+            tbo->bdev->man[mem->mem_type].gpu_offset;

mem->mem_type seems not set yet as well if I am correct.
IIRC, I feel it's better that tbo->offset is set out of this function after get_node successfully.

The patch itself is indeed not correct, but it points me to the bug I've been searching for weeks now.

So thanks a lot for this.

Regards,
Christian.

Quoted 11 lines

Regards,
David Zhou

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, · line 135

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +0 -0
      }
        return r;

_______________________________________________
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