amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: use pre-calculated bo size
@ 2021-04-13 20:57 Nirmoy Das
  2021-04-13 20:57 ` [PATCH 2/2] drm/radeon: " Nirmoy Das
  2021-04-14  6:52 ` [PATCH 1/2] drm/amdgpu: " Christian König
  0 siblings, 2 replies; 4+ messages in thread
From: Nirmoy Das @ 2021-04-13 20:57 UTC (permalink / raw)
  To: Christian.Koenig; +Cc: Nirmoy Das, amd-gfx

Use bo->tbo.base.size instead of calculating it from num_pages.

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] 4+ messages in thread

* [PATCH 2/2] drm/radeon: use pre-calculated bo size
  2021-04-13 20:57 [PATCH 1/2] drm/amdgpu: use pre-calculated bo size Nirmoy Das
@ 2021-04-13 20:57 ` Nirmoy Das
  2021-04-14  6:52 ` [PATCH 1/2] drm/amdgpu: " Christian König
  1 sibling, 0 replies; 4+ messages in thread
From: Nirmoy Das @ 2021-04-13 20:57 UTC (permalink / raw)
  To: Christian.Koenig; +Cc: Nirmoy Das, amd-gfx

Use bo->tbo.base.size instead of calculating it from num_pages.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/radeon/radeon_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index cee11c55fd15..fd8f6ccc267e 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -763,7 +763,7 @@ vm_fault_t radeon_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) <= rdev->mc.visible_vram_size)
 		return 0;
-- 
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] 4+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu: use pre-calculated bo size
  2021-04-13 20:57 [PATCH 1/2] drm/amdgpu: use pre-calculated bo size Nirmoy Das
  2021-04-13 20:57 ` [PATCH 2/2] drm/radeon: " Nirmoy Das
@ 2021-04-14  6:52 ` Christian König
  2021-04-14  8:07   ` Nirmoy
  1 sibling, 1 reply; 4+ messages in thread
From: Christian König @ 2021-04-14  6:52 UTC (permalink / raw)
  To: Nirmoy Das, Christian.Koenig; +Cc: amd-gfx

Am 13.04.21 um 22:57 schrieb Nirmoy Das:
> Use bo->tbo.base.size instead of calculating it from num_pages.

Those don't clash with the two I've send out yesterday, don't they?

>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>

Reviewed-by: Christian König <christian.koenig@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);

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

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

* Re: [PATCH 1/2] drm/amdgpu: use pre-calculated bo size
  2021-04-14  6:52 ` [PATCH 1/2] drm/amdgpu: " Christian König
@ 2021-04-14  8:07   ` Nirmoy
  0 siblings, 0 replies; 4+ messages in thread
From: Nirmoy @ 2021-04-14  8:07 UTC (permalink / raw)
  To: Christian König, Nirmoy Das, Christian.Koenig; +Cc: amd-gfx


On 4/14/21 8:52 AM, Christian König wrote:
> Am 13.04.21 um 22:57 schrieb Nirmoy Das:
>> Use bo->tbo.base.size instead of calculating it from num_pages.
>
> Those don't clash with the two I've send out yesterday, don't they?


It does, I didn't check dri-devel's [PATCH 1/7] drm/nouveau: use 
bo->base.size instead of mem->num_pages) series yesterday.


Regards,

Nirmoy


>
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>
> Reviewed-by: Christian König <christian.koenig@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);
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2021-04-14  8:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 20:57 [PATCH 1/2] drm/amdgpu: use pre-calculated bo size Nirmoy Das
2021-04-13 20:57 ` [PATCH 2/2] drm/radeon: " Nirmoy Das
2021-04-14  6:52 ` [PATCH 1/2] drm/amdgpu: " Christian König
2021-04-14  8:07   ` Nirmoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).