* [PATCH] drm/amdgpu: Fix size calculation when init onchip memory
@ 2020-10-23 5:41 xinhui pan
2020-10-23 7:12 ` Christian König
0 siblings, 1 reply; 4+ messages in thread
From: xinhui pan @ 2020-10-23 5:41 UTC (permalink / raw)
To: amd-gfx; +Cc: alexander.deucher, xinhui pan, christian.koenig, Guchun.Chen
Size is page count here.
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 4a85f8cedd77..11dd3d9eac15 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -65,11 +65,11 @@
static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev,
unsigned int type,
- uint64_t size)
+ uint64_t size_in_page)
{
return ttm_range_man_init(&adev->mman.bdev, type,
TTM_PL_FLAG_UNCACHED, TTM_PL_FLAG_UNCACHED,
- false, size >> PAGE_SHIFT);
+ false, size_in_page);
}
/**
--
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] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: Fix size calculation when init onchip memory
2020-10-23 5:41 [PATCH] drm/amdgpu: Fix size calculation when init onchip memory xinhui pan
@ 2020-10-23 7:12 ` Christian König
2020-10-23 23:19 ` Luben Tuikov
0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2020-10-23 7:12 UTC (permalink / raw)
To: xinhui pan, amd-gfx; +Cc: alexander.deucher, Guchun.Chen
Am 23.10.20 um 07:41 schrieb xinhui pan:
> Size is page count here.
>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Ah yes that one again. At some point we really need to clean that up.
Patch is Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 4a85f8cedd77..11dd3d9eac15 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -65,11 +65,11 @@
>
> static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev,
> unsigned int type,
> - uint64_t size)
> + uint64_t size_in_page)
> {
> return ttm_range_man_init(&adev->mman.bdev, type,
> TTM_PL_FLAG_UNCACHED, TTM_PL_FLAG_UNCACHED,
> - false, size >> PAGE_SHIFT);
> + false, size_in_page);
> }
>
> /**
_______________________________________________
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] drm/amdgpu: Fix size calculation when init onchip memory
2020-10-23 7:12 ` Christian König
@ 2020-10-23 23:19 ` Luben Tuikov
2020-10-26 7:49 ` Christian König
0 siblings, 1 reply; 4+ messages in thread
From: Luben Tuikov @ 2020-10-23 23:19 UTC (permalink / raw)
To: Christian König, xinhui pan, amd-gfx; +Cc: alexander.deucher, Guchun.Chen
On 2020-10-23 03:12, Christian König wrote:
> Am 23.10.20 um 07:41 schrieb xinhui pan:
>> Size is page count here.
>>
>> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
>
> Ah yes that one again. At some point we really need to clean that up.
>
> Patch is Reviewed-by: Christian König <christian.koenig@amd.com>
>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index 4a85f8cedd77..11dd3d9eac15 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -65,11 +65,11 @@
>>
>> static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev,
>> unsigned int type,
>> - uint64_t size)
>> + uint64_t size_in_page)
>> {
>> return ttm_range_man_init(&adev->mman.bdev, type,
>> TTM_PL_FLAG_UNCACHED, TTM_PL_FLAG_UNCACHED,
>> - false, size >> PAGE_SHIFT);
>> + false, size_in_page);
Why don't we call this "page_count" or "num_pages"?
"size_in_page" is really confusing and not something people
say and use in English.
Regards,
Luben
>> }
>>
>> /**
>
> _______________________________________________
> 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&data=04%7C01%7Cluben.tuikov%40amd.com%7C868c9232cb924441c02308d8772307e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637390339646490801%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=H5r9C%2Bj3zVEsGSDNUlxl1%2Bg7lytcsczO7KpSymIv%2F0E%3D&reserved=0
>
_______________________________________________
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] drm/amdgpu: Fix size calculation when init onchip memory
2020-10-23 23:19 ` Luben Tuikov
@ 2020-10-26 7:49 ` Christian König
0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2020-10-26 7:49 UTC (permalink / raw)
To: Luben Tuikov, xinhui pan, amd-gfx; +Cc: alexander.deucher, Guchun.Chen
Am 24.10.20 um 01:19 schrieb Luben Tuikov:
> On 2020-10-23 03:12, Christian König wrote:
>> Am 23.10.20 um 07:41 schrieb xinhui pan:
>>> Size is page count here.
>>>
>>> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
>> Ah yes that one again. At some point we really need to clean that up.
>>
>> Patch is Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> index 4a85f8cedd77..11dd3d9eac15 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> @@ -65,11 +65,11 @@
>>>
>>> static int amdgpu_ttm_init_on_chip(struct amdgpu_device *adev,
>>> unsigned int type,
>>> - uint64_t size)
>>> + uint64_t size_in_page)
>>> {
>>> return ttm_range_man_init(&adev->mman.bdev, type,
>>> TTM_PL_FLAG_UNCACHED, TTM_PL_FLAG_UNCACHED,
>>> - false, size >> PAGE_SHIFT);
>>> + false, size_in_page);
> Why don't we call this "page_count" or "num_pages"?
> "size_in_page" is really confusing and not something people
> say and use in English.
Thinking more about it it would even better if we just stick with size,
cause this is a size in arbitrary units (and NOT pages!).
It's just TTM which misinterprets that as number of pages which is
something Dave and I are trying to fix right now.
Regards,
Christian.
>
> Regards,
> Luben
>
>>> }
>>>
>>> /**
>> _______________________________________________
>> 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&data=04%7C01%7Cluben.tuikov%40amd.com%7C868c9232cb924441c02308d8772307e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637390339646490801%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=H5r9C%2Bj3zVEsGSDNUlxl1%2Bg7lytcsczO7KpSymIv%2F0E%3D&reserved=0
>>
_______________________________________________
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:[~2020-10-26 7:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-23 5:41 [PATCH] drm/amdgpu: Fix size calculation when init onchip memory xinhui pan
2020-10-23 7:12 ` Christian König
2020-10-23 23:19 ` Luben Tuikov
2020-10-26 7:49 ` Christian König
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).