* [PATCH] drm/amdgpu: use pre-calculated bo size
@ 2021-04-13 20:42 Nirmoy Das
2021-04-13 20:50 ` [PATCH v2] " Nirmoy Das
0 siblings, 1 reply; 3+ messages in thread
From: Nirmoy Das @ 2021-04-13 20:42 UTC (permalink / raw)
To: Christian.Koenig; +Cc: Nirmoy Das, amd-gfx
Use bo->tbo.base.size instead of bo->tbo.mem.num_pages << PAGE_SHIFT.
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 936b3cfdde55..26deace78539 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2048,7 +2048,7 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,
return r;
}
- num_bytes = bo->tbo.mem.num_pages << PAGE_SHIFT;
+ num_bytes = bo->tbo.base.size;
num_loops = 0;
amdgpu_res_first(&bo->tbo.mem, 0, num_bytes, &cursor);
--
2.30.2
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2] drm/amdgpu: use pre-calculated bo size
2021-04-13 20:42 [PATCH] drm/amdgpu: use pre-calculated bo size Nirmoy Das
@ 2021-04-13 20:50 ` Nirmoy Das
2021-04-13 20:58 ` Nirmoy
0 siblings, 1 reply; 3+ messages in thread
From: Nirmoy Das @ 2021-04-13 20:50 UTC (permalink / raw)
To: Christian.Koenig; +Cc: Nirmoy Das, amd-gfx
Use bo->tbo.base.size instead of bo->tbo.mem.num_pages << PAGE_SHIFT.
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 1345f7eba011..74ecc0c1863f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -1371,7 +1371,7 @@ vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo)
if (bo->mem.mem_type != TTM_PL_VRAM)
return 0;
- size = bo->mem.num_pages << PAGE_SHIFT;
+ size = bo->base.size;
offset = bo->mem.start << PAGE_SHIFT;
if ((offset + size) <= adev->gmc.visible_vram_size)
return 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 936b3cfdde55..26deace78539 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2048,7 +2048,7 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,
return r;
}
- num_bytes = bo->tbo.mem.num_pages << PAGE_SHIFT;
+ num_bytes = bo->tbo.base.size;
num_loops = 0;
amdgpu_res_first(&bo->tbo.mem, 0, num_bytes, &cursor);
--
2.30.2
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] drm/amdgpu: use pre-calculated bo size
2021-04-13 20:50 ` [PATCH v2] " Nirmoy Das
@ 2021-04-13 20:58 ` Nirmoy
0 siblings, 0 replies; 3+ messages in thread
From: Nirmoy @ 2021-04-13 20:58 UTC (permalink / raw)
To: Nirmoy Das, Christian.Koenig; +Cc: amd-gfx
On 4/13/21 10:50 PM, Nirmoy Das wrote:
> Use bo->tbo.base.size instead of bo->tbo.mem.num_pages << PAGE_SHIFT.
Ignore this please, pressed send-email too quick!
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 1345f7eba011..74ecc0c1863f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -1371,7 +1371,7 @@ vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo)
> if (bo->mem.mem_type != TTM_PL_VRAM)
> return 0;
>
> - size = bo->mem.num_pages << PAGE_SHIFT;
> + size = bo->base.size;
> offset = bo->mem.start << PAGE_SHIFT;
> if ((offset + size) <= adev->gmc.visible_vram_size)
> return 0;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 936b3cfdde55..26deace78539 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2048,7 +2048,7 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,
> return r;
> }
>
> - num_bytes = bo->tbo.mem.num_pages << PAGE_SHIFT;
> + num_bytes = bo->tbo.base.size;
> num_loops = 0;
>
> amdgpu_res_first(&bo->tbo.mem, 0, num_bytes, &cursor);
> --
> 2.30.2
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-13 20:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 20:42 [PATCH] drm/amdgpu: use pre-calculated bo size Nirmoy Das
2021-04-13 20:50 ` [PATCH v2] " Nirmoy Das
2021-04-13 20:58 ` Nirmoy
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.