All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks
@ 2021-03-23 14:54 Christian König
  2021-03-23 14:54 ` [PATCH 2/2] drm/amdgpu: re-apply "use the new cursor in the VM code"" Christian König
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Christian König @ 2021-03-23 14:54 UTC (permalink / raw)
  To: amd-gfx; +Cc: nirmodas, Guchun.Chen

When we don't have a physically backing store we should use zero instead
of the virtual start address since that isn't necessary a valid physical
one.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
index 40f2adf305bc..e94362ccf9d5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
@@ -54,7 +54,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
 	struct drm_mm_node *node;
 
 	if (!res || !res->mm_node) {
-		cur->start = start;
+		cur->start = 0;
 		cur->size = size;
 		cur->remaining = size;
 		cur->node = NULL;
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] drm/amdgpu: re-apply "use the new cursor in the VM code""
  2021-03-23 14:54 [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks Christian König
@ 2021-03-23 14:54 ` Christian König
  2021-03-23 15:42   ` Nirmoy
  2021-03-23 16:42 ` [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks Deucher, Alexander
  2021-03-24  3:26 ` Pan, Xinhui
  2 siblings, 1 reply; 6+ messages in thread
From: Christian König @ 2021-03-23 14:54 UTC (permalink / raw)
  To: amd-gfx; +Cc: nirmodas, Guchun.Chen

Now that we found the underlying problem we can re-apply this patch.

This reverts commit 867fee7f8821ff42e7308088cf0c3450ac49c17c.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 9268db1172bd..bc3951b71079 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -37,6 +37,7 @@
 #include "amdgpu_gmc.h"
 #include "amdgpu_xgmi.h"
 #include "amdgpu_dma_buf.h"
+#include "amdgpu_res_cursor.h"
 
 /**
  * DOC: GPUVM
@@ -1583,7 +1584,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
  * @last: last mapped entry
  * @flags: flags for the entries
  * @offset: offset into nodes and pages_addr
- * @nodes: array of drm_mm_nodes with the MC addresses
+ * @res: ttm_resource to map
  * @pages_addr: DMA addresses to use for mapping
  * @fence: optional resulting fence
  *
@@ -1598,13 +1599,13 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 				       bool unlocked, struct dma_resv *resv,
 				       uint64_t start, uint64_t last,
 				       uint64_t flags, uint64_t offset,
-				       struct drm_mm_node *nodes,
+				       struct ttm_resource *res,
 				       dma_addr_t *pages_addr,
 				       struct dma_fence **fence)
 {
 	struct amdgpu_vm_update_params params;
+	struct amdgpu_res_cursor cursor;
 	enum amdgpu_sync_mode sync_mode;
-	uint64_t pfn;
 	int r;
 
 	memset(&params, 0, sizeof(params));
@@ -1622,14 +1623,6 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 	else
 		sync_mode = AMDGPU_SYNC_EXPLICIT;
 
-	pfn = offset >> PAGE_SHIFT;
-	if (nodes) {
-		while (pfn >= nodes->size) {
-			pfn -= nodes->size;
-			++nodes;
-		}
-	}
-
 	amdgpu_vm_eviction_lock(vm);
 	if (vm->evicting) {
 		r = -EBUSY;
@@ -1648,23 +1641,17 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 	if (r)
 		goto error_unlock;
 
-	do {
+	amdgpu_res_first(res, offset, (last - start + 1) * AMDGPU_GPU_PAGE_SIZE,
+			 &cursor);
+	while (cursor.remaining) {
 		uint64_t tmp, num_entries, addr;
 
-
-		num_entries = last - start + 1;
-		if (nodes) {
-			addr = nodes->start << PAGE_SHIFT;
-			num_entries = min((nodes->size - pfn) *
-				AMDGPU_GPU_PAGES_IN_CPU_PAGE, num_entries);
-		} else {
-			addr = 0;
-		}
-
+		num_entries = cursor.size >> AMDGPU_GPU_PAGE_SHIFT;
 		if (pages_addr) {
 			bool contiguous = true;
 
 			if (num_entries > AMDGPU_GPU_PAGES_IN_CPU_PAGE) {
+				uint64_t pfn = cursor.start >> PAGE_SHIFT;
 				uint64_t count;
 
 				contiguous = pages_addr[pfn + 1] ==
@@ -1684,16 +1671,18 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 			}
 
 			if (!contiguous) {
-				addr = pfn << PAGE_SHIFT;
+				addr = cursor.start;
 				params.pages_addr = pages_addr;
 			} else {
-				addr = pages_addr[pfn];
+				addr = pages_addr[cursor.start >> PAGE_SHIFT];
 				params.pages_addr = NULL;
 			}
 
 		} else if (flags & (AMDGPU_PTE_VALID | AMDGPU_PTE_PRT)) {
-			addr += bo_adev->vm_manager.vram_base_offset;
-			addr += pfn << PAGE_SHIFT;
+			addr = bo_adev->vm_manager.vram_base_offset +
+				cursor.start;
+		} else {
+			addr = 0;
 		}
 
 		tmp = start + num_entries;
@@ -1701,14 +1690,9 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 		if (r)
 			goto error_unlock;
 
-		pfn += num_entries / AMDGPU_GPU_PAGES_IN_CPU_PAGE;
-		if (nodes && nodes->size == pfn) {
-			pfn = 0;
-			++nodes;
-		}
+		amdgpu_res_next(&cursor, num_entries * AMDGPU_GPU_PAGE_SIZE);
 		start = tmp;
-
-	} while (unlikely(start != last + 1));
+	};
 
 	r = vm->update_funcs->commit(&params, fence);
 
@@ -1737,7 +1721,6 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
 	struct amdgpu_bo_va_mapping *mapping;
 	dma_addr_t *pages_addr = NULL;
 	struct ttm_resource *mem;
-	struct drm_mm_node *nodes;
 	struct dma_fence **last_update;
 	struct dma_resv *resv;
 	uint64_t flags;
@@ -1746,7 +1729,6 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
 
 	if (clear || !bo) {
 		mem = NULL;
-		nodes = NULL;
 		resv = vm->root.base.bo->tbo.base.resv;
 	} else {
 		struct drm_gem_object *obj = &bo->tbo.base;
@@ -1761,7 +1743,6 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
 				bo = gem_to_amdgpu_bo(gobj);
 		}
 		mem = &bo->tbo.mem;
-		nodes = mem->mm_node;
 		if (mem->mem_type == TTM_PL_TT)
 			pages_addr = bo->tbo.ttm->dma_address;
 	}
@@ -1810,7 +1791,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
 		r = amdgpu_vm_bo_update_mapping(adev, bo_adev, vm, false, false,
 						resv, mapping->start,
 						mapping->last, update_flags,
-						mapping->offset, nodes,
+						mapping->offset, mem,
 						pages_addr, last_update);
 		if (r)
 			return r;
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: re-apply "use the new cursor in the VM code""
  2021-03-23 14:54 ` [PATCH 2/2] drm/amdgpu: re-apply "use the new cursor in the VM code"" Christian König
@ 2021-03-23 15:42   ` Nirmoy
  0 siblings, 0 replies; 6+ messages in thread
From: Nirmoy @ 2021-03-23 15:42 UTC (permalink / raw)
  To: Christian König, amd-gfx; +Cc: Guchun.Chen

Tested on Navi1x with "piglit run opengl results/test".

The series is Tested-by: Nirmoy Das<nirmoy.das@amd.com> from my side.


Curious to know how this holds up against Guchun's Vulkan cts test.


Regards,

Nirmoy



On 3/23/21 3:54 PM, Christian König wrote:
> Now that we found the underlying problem we can re-apply this patch.
>
> This reverts commit 867fee7f8821ff42e7308088cf0c3450ac49c17c.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 55 +++++++++-----------------
>   1 file changed, 18 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 9268db1172bd..bc3951b71079 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -37,6 +37,7 @@
>   #include "amdgpu_gmc.h"
>   #include "amdgpu_xgmi.h"
>   #include "amdgpu_dma_buf.h"
> +#include "amdgpu_res_cursor.h"
>   
>   /**
>    * DOC: GPUVM
> @@ -1583,7 +1584,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
>    * @last: last mapped entry
>    * @flags: flags for the entries
>    * @offset: offset into nodes and pages_addr
> - * @nodes: array of drm_mm_nodes with the MC addresses
> + * @res: ttm_resource to map
>    * @pages_addr: DMA addresses to use for mapping
>    * @fence: optional resulting fence
>    *
> @@ -1598,13 +1599,13 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
>   				       bool unlocked, struct dma_resv *resv,
>   				       uint64_t start, uint64_t last,
>   				       uint64_t flags, uint64_t offset,
> -				       struct drm_mm_node *nodes,
> +				       struct ttm_resource *res,
>   				       dma_addr_t *pages_addr,
>   				       struct dma_fence **fence)
>   {
>   	struct amdgpu_vm_update_params params;
> +	struct amdgpu_res_cursor cursor;
>   	enum amdgpu_sync_mode sync_mode;
> -	uint64_t pfn;
>   	int r;
>   
>   	memset(&params, 0, sizeof(params));
> @@ -1622,14 +1623,6 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
>   	else
>   		sync_mode = AMDGPU_SYNC_EXPLICIT;
>   
> -	pfn = offset >> PAGE_SHIFT;
> -	if (nodes) {
> -		while (pfn >= nodes->size) {
> -			pfn -= nodes->size;
> -			++nodes;
> -		}
> -	}
> -
>   	amdgpu_vm_eviction_lock(vm);
>   	if (vm->evicting) {
>   		r = -EBUSY;
> @@ -1648,23 +1641,17 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
>   	if (r)
>   		goto error_unlock;
>   
> -	do {
> +	amdgpu_res_first(res, offset, (last - start + 1) * AMDGPU_GPU_PAGE_SIZE,
> +			 &cursor);
> +	while (cursor.remaining) {
>   		uint64_t tmp, num_entries, addr;
>   
> -
> -		num_entries = last - start + 1;
> -		if (nodes) {
> -			addr = nodes->start << PAGE_SHIFT;
> -			num_entries = min((nodes->size - pfn) *
> -				AMDGPU_GPU_PAGES_IN_CPU_PAGE, num_entries);
> -		} else {
> -			addr = 0;
> -		}
> -
> +		num_entries = cursor.size >> AMDGPU_GPU_PAGE_SHIFT;
>   		if (pages_addr) {
>   			bool contiguous = true;
>   
>   			if (num_entries > AMDGPU_GPU_PAGES_IN_CPU_PAGE) {
> +				uint64_t pfn = cursor.start >> PAGE_SHIFT;
>   				uint64_t count;
>   
>   				contiguous = pages_addr[pfn + 1] ==
> @@ -1684,16 +1671,18 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
>   			}
>   
>   			if (!contiguous) {
> -				addr = pfn << PAGE_SHIFT;
> +				addr = cursor.start;
>   				params.pages_addr = pages_addr;
>   			} else {
> -				addr = pages_addr[pfn];
> +				addr = pages_addr[cursor.start >> PAGE_SHIFT];
>   				params.pages_addr = NULL;
>   			}
>   
>   		} else if (flags & (AMDGPU_PTE_VALID | AMDGPU_PTE_PRT)) {
> -			addr += bo_adev->vm_manager.vram_base_offset;
> -			addr += pfn << PAGE_SHIFT;
> +			addr = bo_adev->vm_manager.vram_base_offset +
> +				cursor.start;
> +		} else {
> +			addr = 0;
>   		}
>   
>   		tmp = start + num_entries;
> @@ -1701,14 +1690,9 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
>   		if (r)
>   			goto error_unlock;
>   
> -		pfn += num_entries / AMDGPU_GPU_PAGES_IN_CPU_PAGE;
> -		if (nodes && nodes->size == pfn) {
> -			pfn = 0;
> -			++nodes;
> -		}
> +		amdgpu_res_next(&cursor, num_entries * AMDGPU_GPU_PAGE_SIZE);
>   		start = tmp;
> -
> -	} while (unlikely(start != last + 1));
> +	};
>   
>   	r = vm->update_funcs->commit(&params, fence);
>   
> @@ -1737,7 +1721,6 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
>   	struct amdgpu_bo_va_mapping *mapping;
>   	dma_addr_t *pages_addr = NULL;
>   	struct ttm_resource *mem;
> -	struct drm_mm_node *nodes;
>   	struct dma_fence **last_update;
>   	struct dma_resv *resv;
>   	uint64_t flags;
> @@ -1746,7 +1729,6 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
>   
>   	if (clear || !bo) {
>   		mem = NULL;
> -		nodes = NULL;
>   		resv = vm->root.base.bo->tbo.base.resv;
>   	} else {
>   		struct drm_gem_object *obj = &bo->tbo.base;
> @@ -1761,7 +1743,6 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
>   				bo = gem_to_amdgpu_bo(gobj);
>   		}
>   		mem = &bo->tbo.mem;
> -		nodes = mem->mm_node;
>   		if (mem->mem_type == TTM_PL_TT)
>   			pages_addr = bo->tbo.ttm->dma_address;
>   	}
> @@ -1810,7 +1791,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
>   		r = amdgpu_vm_bo_update_mapping(adev, bo_adev, vm, false, false,
>   						resv, mapping->start,
>   						mapping->last, update_flags,
> -						mapping->offset, nodes,
> +						mapping->offset, mem,
>   						pages_addr, last_update);
>   		if (r)
>   			return r;
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks
  2021-03-23 14:54 [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks Christian König
  2021-03-23 14:54 ` [PATCH 2/2] drm/amdgpu: re-apply "use the new cursor in the VM code"" Christian König
@ 2021-03-23 16:42 ` Deucher, Alexander
  2021-03-24  3:26 ` Pan, Xinhui
  2 siblings, 0 replies; 6+ messages in thread
From: Deucher, Alexander @ 2021-03-23 16:42 UTC (permalink / raw)
  To: Christian König, amd-gfx; +Cc: Das, Nirmoy, Chen, Guchun


[-- Attachment #1.1: Type: text/plain, Size: 1999 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Acked-by: Alex Deucher <alexander.deucher@amd.com>
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com>
Sent: Tuesday, March 23, 2021 10:54 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Das, Nirmoy <Nirmoy.Das@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>
Subject: [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks

When we don't have a physically backing store we should use zero instead
of the virtual start address since that isn't necessary a valid physical
one.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
index 40f2adf305bc..e94362ccf9d5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
@@ -54,7 +54,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
         struct drm_mm_node *node;

         if (!res || !res->mm_node) {
-               cur->start = start;
+               cur->start = 0;
                 cur->size = size;
                 cur->remaining = size;
                 cur->node = NULL;
--
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C44108ad9138645327a7708d8ee0ba373%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081047640112%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=bswNGifbeRgbvoBw89PSiDTpzLbCbhqtX5xqMIRYsq8%3D&amp;reserved=0

[-- Attachment #1.2: Type: text/html, Size: 3952 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks
  2021-03-23 14:54 [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks Christian König
  2021-03-23 14:54 ` [PATCH 2/2] drm/amdgpu: re-apply "use the new cursor in the VM code"" Christian König
  2021-03-23 16:42 ` [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks Deucher, Alexander
@ 2021-03-24  3:26 ` Pan, Xinhui
  2021-03-24  7:40   ` Christian König
  2 siblings, 1 reply; 6+ messages in thread
From: Pan, Xinhui @ 2021-03-24  3:26 UTC (permalink / raw)
  To: Christian König, amd-gfx; +Cc: Das, Nirmoy, Chen, Guchun

[AMD Official Use Only - Internal Distribution Only]

I don’t think so. Start is offset here. We get the valid physical address from pages_addr[offset] when we update mapping.
Btw, what issue we are seeing?

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Christian K?nig
Sent: 2021年3月23日 22:55
To: amd-gfx@lists.freedesktop.org
Cc: Das, Nirmoy <Nirmoy.Das@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>
Subject: [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks

When we don't have a physically backing store we should use zero instead of the virtual start address since that isn't necessary a valid physical one.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
index 40f2adf305bc..e94362ccf9d5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
@@ -54,7 +54,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
 struct drm_mm_node *node;

 if (!res || !res->mm_node) {
-cur->start = start;
+cur->start = 0;
 cur->size = size;
 cur->remaining = size;
 cur->node = NULL;
--
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cxinhui.pan%40amd.com%7C031c743bd7c448e8d91508d8ee0ba402%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081053105295%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=lrJ6k3QBXqM9G6GRK25frFlqANkbfR4kAv6A3%2F8myBc%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks
  2021-03-24  3:26 ` Pan, Xinhui
@ 2021-03-24  7:40   ` Christian König
  0 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2021-03-24  7:40 UTC (permalink / raw)
  To: Pan, Xinhui, amd-gfx; +Cc: Das, Nirmoy, Chen, Guchun

Am 24.03.21 um 04:26 schrieb Pan, Xinhui:
> [AMD Official Use Only - Internal Distribution Only]
>
> I don’t think so. Start is offset here. We get the valid physical address from pages_addr[offset] when we update mapping.

Good point, mhm need to take an even closer look at this then.

> Btw, what issue we are seeing?

We see a BUG_ON() backtrace when this is used together with PRT mapping 
in OpenGL and Vulkan because the offset is just nonsense in this case.

Thanks for pointing our the issue,
Christian.

>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Christian K?nig
> Sent: 2021年3月23日 22:55
> To: amd-gfx@lists.freedesktop.org
> Cc: Das, Nirmoy <Nirmoy.Das@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>
> Subject: [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks
>
> When we don't have a physically backing store we should use zero instead of the virtual start address since that isn't necessary a valid physical one.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
> index 40f2adf305bc..e94362ccf9d5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
> @@ -54,7 +54,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
>   struct drm_mm_node *node;
>
>   if (!res || !res->mm_node) {
> -cur->start = start;
> +cur->start = 0;
>   cur->size = size;
>   cur->remaining = size;
>   cur->node = NULL;
> --
> 2.25.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cxinhui.pan%40amd.com%7C031c743bd7c448e8d91508d8ee0ba402%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081053105295%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=lrJ6k3QBXqM9G6GRK25frFlqANkbfR4kAv6A3%2F8myBc%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-24  7:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 14:54 [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks Christian König
2021-03-23 14:54 ` [PATCH 2/2] drm/amdgpu: re-apply "use the new cursor in the VM code"" Christian König
2021-03-23 15:42   ` Nirmoy
2021-03-23 16:42 ` [PATCH 1/2] drm/amdgpu: use zero as start for dummy resource walks Deucher, Alexander
2021-03-24  3:26 ` Pan, Xinhui
2021-03-24  7:40   ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.