[PATCH v2 1/2] drm/buddy: fix issue that force_merge cannot free all roots

2024-12-25 Thread Arunpravin Paneer Selvam
From: Lin.Cao If buddy manager have more than one roots and each root have sub-block need to be free. When drm_buddy_fini called, the first loop of force_merge will merge and free all of the sub block of first root, which offset is 0x0 and size is biggest(more than have of the mm size). In subseq

[PATCH v2 2/2] drm/buddy: Add a testcase to verify the multiroot fini

2024-12-25 Thread Arunpravin Paneer Selvam
- Added a testcase to verify the multiroot force merge fini. - Added a new field in_use to track the mm freed status. v2:(Matthew) - Add kunit_fail_current_test() when WARN_ON is true. Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Lin.Cao --- drivers/gpu/drm/drm_buddy.c

[PATCH 2/2] drm/buddy: Add a testcase to verify the multiroot fini

2024-12-16 Thread Arunpravin Paneer Selvam
- Added a testcase to verify the multiroot force merge fini. - Added a new field in_use to track the mm freed status. Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Lin.Cao --- drivers/gpu/drm/drm_buddy.c| 20 - drivers/gpu/drm/tests/drm_buddy_test.c | 30

[PATCH 1/2] drm/buddy: fix issue that force_merge cannot free all roots

2024-12-16 Thread Arunpravin Paneer Selvam
From: Lin.Cao If buddy manager have more than one roots and each root have sub-block need to be free. When drm_buddy_fini called, the first loop of force_merge will merge and free all of the sub block of first root, which offset is 0x0 and size is biggest(more than have of the mm size). In subseq

[PATCH v7 1/2] drm/buddy: Add start address support to trim function

2024-07-23 Thread Arunpravin Paneer Selvam
disable the allocator trimming part. This patch enables the drivers control trimming and they can do it themselves based on the application requirements. v1:(Matthew) - check new_start alignment with min chunk_size - use range_overflows() Signed-off-by: Arunpravin Paneer Selvam Acked-by: Alex

[PATCH v7 2/2] drm/amdgpu: Add address alignment support to DCC buffers

2024-07-23 Thread Arunpravin Paneer Selvam
into gmc_v12_0_get_dcc_alignment. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Alex Deucher Acked-by: Christian König Reviewed-by: Frank Min --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 6 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 29 ++-- drivers/gpu/drm/amd/amdgpu/gmc_v1

[PATCH v6 2/2] drm/amdgpu: Add address alignment support to DCC buffers

2024-07-18 Thread Arunpravin Paneer Selvam
exist. - Add the callback to amdgpu_gmc_funcs. v6: - Fix checkpatch warning reported by Intel CI. v7:(Christian) - remove the AMDGPU_GEM_CREATE_GFX12_DCC flag and keep a flag that checks the BO pinning and for a specific hw generation. Signed-off-by: Arunpravin Paneer Selvam Acked-by:

[PATCH v6 1/2] drm/buddy: Add start address support to trim function

2024-07-18 Thread Arunpravin Paneer Selvam
disable the allocator trimming part. This patch enables the drivers control trimming and they can do it themselves based on the application requirements. v1:(Matthew) - check new_start alignment with min chunk_size - use range_overflows() Signed-off-by: Arunpravin Paneer Selvam Acked-by: Alex

[PATCH v5 2/2] drm/amdgpu: Add address alignment support to DCC buffers

2024-07-16 Thread Arunpravin Paneer Selvam
exist. - Add the callback to amdgpu_gmc_funcs. v6: - Fix checkpatch error reported by Intel CI. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Alex Deucher Acked-by: Christian König Reviewed-by: Frank Min --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 6 drivers/gpu/drm/amd/a

[PATCH v5 1/2] drm/buddy: Add start address support to trim function

2024-07-16 Thread Arunpravin Paneer Selvam
disable the allocator trimming part. This patch enables the drivers control trimming and they can do it themselves based on the application requirements. v1:(Matthew) - check new_start alignment with min chunk_size - use range_overflows() Signed-off-by: Arunpravin Paneer Selvam Acked-by: Alex

[PATCH 2/2] drm/amdgpu: Add address alignment support to DCC buffers

2024-07-16 Thread Arunpravin Paneer Selvam
exist. - Add the callback to amdgpu_gmc_funcs. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Alex Deucher Acked-by: Christian König Reviewed-by: Frank Min --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 3 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 36 ++-- driver

[PATCH 1/2] drm/buddy: Add start address support to trim function

2024-07-16 Thread Arunpravin Paneer Selvam
disable the allocator trimming part. This patch enables the drivers control trimming and they can do it themselves based on the application requirements. v1:(Matthew) - check new_start alignment with min chunk_size - use range_overflows() Signed-off-by: Arunpravin Paneer Selvam Acked-by: Alex

[PATCH 2/2] drm/amdgpu: Add address alignment support to DCC buffers

2024-07-04 Thread Arunpravin Paneer Selvam
exist. - Add the callback to amdgpu_gmc_funcs. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 3 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 36 ++-- drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 15 3 files change

[PATCH] drm/buddy: Add start address support to trim function

2024-07-04 Thread Arunpravin Paneer Selvam
disable the allocator trimming part. This patch enables the drivers control trimming and they can do it themselves based on the application requirements. v1:(Matthew) - check new_start alignment with min chunk_size - use range_overflows() Signed-off-by: Arunpravin Paneer Selvam --- drivers

[PATCH] drm/buddy: Add start address support to trim function

2024-06-20 Thread Arunpravin Paneer Selvam
disable the allocator trimming part. This patch enables the drivers control trimming and they can do it themselves based on the application requirements. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.c | 22 -- drivers/gpu/drm/xe

[PATCH v2] drm/buddy: Fix the warn on's during force merge

2024-05-17 Thread Arunpravin Paneer Selvam
check. Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Matthew Auld Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature") Link: https://patchwork.kernel.org/project/dri-devel/patch/20240517135015.17565-1-arunpravin.paneersel...@amd.com/ --- drivers/gpu/drm/

[PATCH v2] drm/buddy: Fix the warn on's during force merge

2024-05-17 Thread Arunpravin Paneer Selvam
check. Signed-off-by: Arunpravin Paneer Selvam Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature") --- drivers/gpu/drm/drm_buddy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c ind

[PATCH] drm/buddy: Merge back blocks in bias range function

2024-05-17 Thread Arunpravin Paneer Selvam
ge as true. This resolves the unnecessary warn on's thrown during force_merge call. Signed-off-by: Arunpravin Paneer Selvam Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature") --- drivers/gpu/drm/drm_buddy.c | 32 ++-- 1 file chan

[PATCH v3 1/2] drm/buddy: Fix the range bias clear memory allocation issue

2024-05-14 Thread Arunpravin Paneer Selvam
failure following system goes into unresponsive state. Solution: Remove the unnecessary clear_avail check in the range bias allocation function. v2: add a kunit for this corner case (Daniel Vetter) Signed-off-by: Arunpravin Paneer Selvam Fixes: 96950929eb23 ("drm/buddy: Implement tracking

[PATCH v3 2/2] drm/tests: Add a unit test for range bias allocation

2024-05-14 Thread Arunpravin Paneer Selvam
tthew) - move the size to the variable declaration section. - move the mm.clear_avail init to allocator init. Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Matthew Auld --- drivers/gpu/drm/tests/drm_buddy_test.c | 36 +- 1 file changed, 35 insertions(+), 1 deletion(-)

[PATCH v2 1/2] drm/buddy: Fix the range bias clear memory allocation issue

2024-05-12 Thread Arunpravin Paneer Selvam
failure following system goes into unresponsive state. Solution: Remove the unnecessary clear_avail check in the range bias allocation function. v2: add a kunit for this corner case (Daniel Vetter) Signed-off-by: Arunpravin Paneer Selvam Fixes: 96950929eb23 ("drm/buddy: Implement tracking

[PATCH v2 2/2] drm/tests: Add a unit test for range bias allocation

2024-05-12 Thread Arunpravin Paneer Selvam
ff-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/tests/drm_buddy_test.c | 35 ++ 1 file changed, 35 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_buddy_test.c b/drivers/gpu/drm/tests/drm_buddy_test.c index e3b50e240d36..a194f271bc55 100644 --- a/drivers/gpu/drm/

[PATCH] drm/buddy: Fix the range bias clear memory allocation issue

2024-05-07 Thread Arunpravin Paneer Selvam
failure following system goes into unresponsive state. Solution: Remove the unnecessary clear_avail check in the range bias allocation function. Signed-off-by: Arunpravin Paneer Selvam Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature") Reviewed-by: Matthew Auld --

[PATCH] drm/buddy: Fix the range bias clear memory allocation issue

2024-05-06 Thread Arunpravin Paneer Selvam
failure following system goes into unresponsive state. Solution: Remove the unnecessary clear_avail check in the range bias allocation function. Signed-off-by: Arunpravin Paneer Selvam Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature") --- drivers/gpu/drm/drm_b

[PATCH v11 3/3] drm/tests: Add a test case for drm buddy clear allocation

2024-04-14 Thread Arunpravin Paneer Selvam
with non power-of-two size to ensure the multi-root force_merge during fini. v3: - add randomness in size calculation(Matthew) Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Matthew Auld Suggested-by: Matthew Auld --- drivers/gpu/drm/tests/drm_buddy_test.c | 143

[PATCH v11 1/3] drm/buddy: Implement tracking clear page feature

2024-04-14 Thread Arunpravin Paneer Selvam
when contains && split(Matthew) - add range support to force merge function. v6: - modify the alloc_range() function clear page non merged blocks allocation(Matthew) - correct the list_insert function name(Matthew). Signed-off-by: Arunpravin Paneer Selvam Signed-off-by:

[PATCH v11 2/3] drm/amdgpu: Enable clear page functionality

2024-04-14 Thread Arunpravin Paneer Selvam
s_cleared(&cursor) check. v4(Christian): - vres flag setting move to vram manager file - use dma_fence_get_stub in amdgpu_ttm_clear_buffer function - make fence a mandatory parameter and drop the if and the get/put dance Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian Kö

[PATCH v10 3/3] drm/tests: Add a test case for drm buddy clear allocation

2024-04-08 Thread Arunpravin Paneer Selvam
with non power-of-two size to ensure the multi-root force_merge during fini. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld --- drivers/gpu/drm/tests/drm_buddy_test.c | 141 + 1 file changed, 141 insertions(+) diff --git a/drivers/gpu/drm/tests

[PATCH v10 1/3] drm/buddy: Implement tracking clear page feature

2024-04-08 Thread Arunpravin Paneer Selvam
when contains && split(Matthew) - add range support to force merge function. Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Matthew Auld Suggested-by: Christian König Suggested-by: Matthew Auld --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/dr

[PATCH v10 2/3] drm/amdgpu: Enable clear page functionality

2024-04-08 Thread Arunpravin Paneer Selvam
s_cleared(&cursor) check. v4(Christian): - vres flag setting move to vram manager file - use dma_fence_get_stub in amdgpu_ttm_clear_buffer function - make fence a mandatory parameter and drop the if and the get/put dance Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian Kö

[PATCH v9 3/3] drm/tests: Add a test case for drm buddy clear allocation

2024-03-18 Thread Arunpravin Paneer Selvam
Add a new test case for the drm buddy clear and dirty allocation. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld --- drivers/gpu/drm/tests/drm_buddy_test.c | 127 + 1 file changed, 127 insertions(+) diff --git a/drivers/gpu/drm/tests

[PATCH v9 2/3] drm/amdgpu: Enable clear page functionality

2024-03-18 Thread Arunpravin Paneer Selvam
s_cleared(&cursor) check. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König Acked-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 22 --- .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 25 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm

[PATCH v9 1/3] drm/buddy: Implement tracking clear page feature

2024-03-18 Thread Arunpravin Paneer Selvam
n drm buddy file and remove the defrag use in amdgpu driver. - Remove list_empty() check(Matthew) - Remove unnecessary space, headers and placement of new variables(Matthew) - Add a unit test case(Matthew) Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Matthew Auld Suggest

[PATCH v8 2/3] drm/amdgpu: Enable clear page functionality

2024-03-04 Thread Arunpravin Paneer Selvam
s_cleared(&cursor) check. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König Acked-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 22 --- .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 25 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm

[PATCH v8 3/3] drm/buddy: Add user for defragmentation

2024-03-04 Thread Arunpravin Paneer Selvam
Add amdgpu driver as user for the drm buddy defragmentation. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 17 +++-- drivers/gpu/drm/drm_buddy.c | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a

[PATCH v8 1/3] drm/buddy: Implement tracking clear page feature

2024-03-04 Thread Arunpravin Paneer Selvam
order instead max_order in fini() function(Matthew) - change bool 1 to true(Matthew) - add check if min_block_size is power of 2(Matthew) - modify the min_block_size datatype to u64(Matthew) Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Matthew Auld Suggested-by: Christian

Re: [PATCH v7 3/3] drm/buddy: Add defragmentation support

2024-02-22 Thread Arunpravin Paneer Selvam
Hi Christian, On 2/21/2024 7:58 PM, Christian König wrote: Am 21.02.24 um 13:18 schrieb Arunpravin Paneer Selvam: Add a function to support defragmentation. Thinking more about it maybe you want to call this function differently. Essentially we are force merging pages even if their cleared

[PATCH v7 3/3] drm/buddy: Add defragmentation support

2024-02-21 Thread Arunpravin Paneer Selvam
defragmentation in the fini() function - place a condition to test if min_order is equal to 0 - replace the list with safe_reverse() variant as we might remove the block from the list. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld --- drivers/gpu/drm/amd/amdgpu

[PATCH v7 2/3] drm/amdgpu: Enable clear page functionality

2024-02-21 Thread Arunpravin Paneer Selvam
s_cleared(&cursor) check. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König Acked-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 22 --- .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 25 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm

[PATCH v7 1/3] drm/buddy: Implement tracking clear page feature

2024-02-21 Thread Arunpravin Paneer Selvam
_list change in arguments. v3: (Matthew) - Keep DRM_BUDDY_HEADER_CLEAR define sorted. Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Matthew Auld Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/drm_buddy.c

Re: [PATCH] drm/buddy: Modify duplicate list_splice_tail call

2024-02-18 Thread Arunpravin Paneer Selvam
Hi Christian, On 2/16/2024 5:29 PM, Christian König wrote: Am 16.02.24 um 12:46 schrieb Arunpravin Paneer Selvam: On 2/16/2024 4:41 PM, Matthew Auld wrote: On 16/02/2024 10:00, Arunpravin Paneer Selvam wrote: Remove the duplicate list_splice_tail call when the total_allocated < s

Re: [PATCH v6 1/3] drm/buddy: Implement tracking clear page feature

2024-02-16 Thread Arunpravin Paneer Selvam
Hi Matthew, Could you review the v6? Thanks, Arun. On 2/8/2024 9:19 PM, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it successfully clears the blocks in the free path. On the otherhand, DRM buddy marks each

Re: [PATCH] drm/buddy: Modify duplicate list_splice_tail call

2024-02-16 Thread Arunpravin Paneer Selvam
On 2/16/2024 4:41 PM, Matthew Auld wrote: On 16/02/2024 10:00, Arunpravin Paneer Selvam wrote: Remove the duplicate list_splice_tail call when the total_allocated < size condition is true. Cc: # 6.7+ Fixes: 8746c6c9dfa3 ("drm/buddy: Fix alloc_range() error handling code") Repo

Re: [PATCH 2/6] drm/buddy: fix range bias

2024-02-16 Thread Arunpravin Paneer Selvam
Looks good. Reviewed-by: Arunpravin Paneer Selvam On 2/15/2024 11:14 PM, Matthew Auld wrote: There is a corner case here where start/end is after/before the block range we are currently checking. If so we need to be sure that splitting the block will eventually give use the block size we

Re: [PATCH 4/6] drm/tests/drm_buddy: add alloc_range_bias test

2024-02-16 Thread Arunpravin Paneer Selvam
Reviewed-by: Arunpravin Paneer Selvam On 2/15/2024 11:14 PM, Matthew Auld wrote: Sanity check range bias with DRM_BUDDY_RANGE_ALLOCATION. Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Christian König --- drivers/gpu/drm/tests/drm_buddy_test.c | 218

Re: [PATCH 3/6] drm/buddy: check range allocation matches alignment

2024-02-16 Thread Arunpravin Paneer Selvam
Its good to check the alignment Reviewed-by: Arunpravin Paneer Selvam On 2/15/2024 11:14 PM, Matthew Auld wrote: Likely not a big deal for real users, but for consistency we should respect the min_page_size here. Main issue is that bias allocations turns into normal range allocation if the

Re: [PATCH 1/6] drm/tests/drm_buddy: fix 32b build

2024-02-16 Thread Arunpravin Paneer Selvam
Reviewed-by: Arunpravin Paneer Selvam On 2/15/2024 11:14 PM, Matthew Auld wrote: Doesn't seem to compile on 32b, presumably due to u64 mod/division. Simplest is to just switch over to u32 here. Also make print modifiers consistent with that. Fixes: a64056bb5a32 ("drm/tests/drm_

[PATCH] drm/buddy: Modify duplicate list_splice_tail call

2024-02-16 Thread Arunpravin Paneer Selvam
Remove the duplicate list_splice_tail call when the total_allocated < size condition is true. Cc: # 6.7+ Fixes: 8746c6c9dfa3 ("drm/buddy: Fix alloc_range() error handling code") Reported-by: Bert Karwatzki Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.

[PATCH v2 2/2] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-14 Thread Arunpravin Paneer Selvam
From: Matthew Auld Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. v2: Fix checkpatch warnings. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Limonciello Cc: Christian König Reviewed-by: Arunpravin Paneer Selvam

[PATCH v2 1/2] drm/buddy: Fix alloc_range() error handling code

2024-02-14 Thread Arunpravin Paneer Selvam
o Link: https://patchwork.kernel.org/project/dri-devel/patch/20240207174456.341121-1-arunpravin.paneersel...@amd.com/ Acked-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/

[PATCH 2/2] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-13 Thread Arunpravin Paneer Selvam
From: Matthew Auld Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Limonciello Cc: Christian König Reviewed-by: Arunpravin Paneer Selvam Signed-off-by: Arunpravin

[PATCH 1/2] drm/buddy: Fix alloc_range() error handling code

2024-02-13 Thread Arunpravin Paneer Selvam
o Link: https://patchwork.kernel.org/project/dri-devel/patch/20240207174456.341121-1-arunpravin.paneersel...@amd.com/ Acked-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/

[PATCH 2/2] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-13 Thread Arunpravin Paneer Selvam
Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Reviewed-by: Arunpravin Paneer Selvam Cc: Arunpravin Paneer Selvam Cc: Limonciello Cc: Christian König Signed-off-by: Arunpravin Paneer Selvam

[PATCH 1/2] drm/buddy: Fix alloc_range() error handling code

2024-02-13 Thread Arunpravin Paneer Selvam
o Link: https://patchwork.kernel.org/project/dri-devel/patch/20240207174456.341121-1-arunpravin.paneersel...@amd.com/ Acked-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/

Re: [PATCH] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-12 Thread Arunpravin Paneer Selvam
Hi Matthew, Can I push this test case along with the bug fix patch. Thanks, Arun. On 2/8/2024 8:06 PM, Matthew Auld wrote: Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam

Re: [PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-09 Thread Arunpravin Paneer Selvam
Hi Daniel, On 2/9/2024 11:34 PM, Daniel Vetter wrote: On Fri, Feb 09, 2024 at 08:56:24PM +0530, Arunpravin Paneer Selvam wrote: Few users have observed display corruption when they boot the machine to KDE Plasma or playing games. We have root caused the problem that whenever alloc_range

[PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-09 Thread Arunpravin Paneer Selvam
o Link: https://patchwork.kernel.org/project/dri-devel/patch/20240207174456.341121-1-arunpravin.paneersel...@amd.com/ Acked-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/

[PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-09 Thread Arunpravin Paneer Selvam
o Link: https://patchwork.kernel.org/project/dri-devel/patch/20240207174456.341121-1-arunpravin.paneersel...@amd.com/ Reviewed-by: Matthew Auld Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_buddy.c b/

Re: [PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-09 Thread Arunpravin Paneer Selvam
On 2/8/2024 7:47 PM, Matthew Auld wrote: On 08/02/2024 13:47, Arunpravin Paneer Selvam wrote: Hi Matthew, On 2/8/2024 7:00 PM, Matthew Auld wrote: On 07/02/2024 17:44, Arunpravin Paneer Selvam wrote: Few users have observed display corruption when they boot the machine to KDE Plasma or

Re: [PATCH v5 1/3] drm/buddy: Implement tracking clear page feature

2024-02-08 Thread Arunpravin Paneer Selvam
On 1/31/2024 11:52 PM, Matthew Auld wrote: On 30/01/2024 19:48, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks in the free path. On the otherhand,    DRM buddy marks each block as

[PATCH v6 3/3] drm/buddy: Add defragmentation support

2024-02-08 Thread Arunpravin Paneer Selvam
Add a function to support defragmentation. v1: Defragment the memory beginning from min_order till the required memory space is available. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld --- drivers/gpu/drm/drm_buddy.c | 67 +++-- include

[PATCH v6 1/3] drm/buddy: Implement tracking clear page feature

2024-02-08 Thread Arunpravin Paneer Selvam
_list change in arguments. Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Matthew Auld Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/drm_buddy.c | 192 ++ drivers/gpu/drm

[PATCH v6 2/3] drm/amdgpu: Enable clear page functionality

2024-02-08 Thread Arunpravin Paneer Selvam
s_cleared(&cursor) check. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 22 --- .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 25 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 61 ++- dr

Re: [PATCH v3 1/2] drm/buddy: Implement tracking clear page feature

2024-02-08 Thread Arunpravin Paneer Selvam
On 1/31/2024 11:59 PM, Matthew Auld wrote: On 30/01/2024 20:30, Arunpravin Paneer Selvam wrote: Hi Matthew, On 12/21/2023 12:51 AM, Matthew Auld wrote: Hi, On 14/12/2023 13:42, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the

Re: [PATCH] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-08 Thread Arunpravin Paneer Selvam
On 2/8/2024 8:06 PM, Matthew Auld wrote: Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. That's really quick :) Reviewed-by: Arunpravin Paneer Selvam References:https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Limonciel

Re: [PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-08 Thread Arunpravin Paneer Selvam
Hi Matthew, On 2/8/2024 7:00 PM, Matthew Auld wrote: On 07/02/2024 17:44, Arunpravin Paneer Selvam wrote: Few users have observed display corruption when they boot the machine to KDE Plasma or playing games. We have root caused the problem that whenever alloc_range() couldn't find the req

Re: [PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-08 Thread Arunpravin Paneer Selvam
Hi Christian, On 2/8/2024 12:27 PM, Christian König wrote: Am 07.02.24 um 18:44 schrieb Arunpravin Paneer Selvam: Few users have observed display corruption when they boot the machine to KDE Plasma or playing games. We have root caused the problem that whenever alloc_range() couldn't fin

[PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-07 Thread Arunpravin Paneer Selvam
be if the total allocated size is less than the required size, the function should return -ENOSPC. Gitlab ticket link - https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Fixes: 0a1844bf0b53 ("drm/buddy: Improve contiguous memory allocation") Signed-off-by: Arunpravin Paneer Selvam T

Re: [PATCH v3 1/2] drm/buddy: Implement tracking clear page feature

2024-01-30 Thread Arunpravin Paneer Selvam
Hi Matthew, On 12/21/2023 12:51 AM, Matthew Auld wrote: Hi, On 14/12/2023 13:42, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks in the free path. On the otherhand,    DRM buddy marks

[PATCH v5 3/3] drm/buddy: Add defragmentation support

2024-01-30 Thread Arunpravin Paneer Selvam
Add a function to support defragmentation. v5: Defragment the freelist order array beginning from min_order. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld --- drivers/gpu/drm/drm_buddy.c | 70 ++--- 1 file changed, 58 insertions(+), 12

[PATCH v5 1/3] drm/buddy: Implement tracking clear page feature

2024-01-30 Thread Arunpravin Paneer Selvam
below, drm_buddy_is_clear(block) != drm_buddy_is_clear(buddy) Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/drm_buddy.c | 169 +++--- drivers/gpu/drm

[PATCH v5 2/3] drm/amdgpu: Enable clear page functionality

2024-01-30 Thread Arunpravin Paneer Selvam
s_cleared(&cursor) check. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 22 --- .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 25 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 61 ++- dr

[PATCH v4 3/3] drm/buddy: Add defragmentation support

2024-01-25 Thread Arunpravin Paneer Selvam
Add a function to support defragmentation. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld --- drivers/gpu/drm/drm_buddy.c | 48 - 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu

[PATCH v4 2/3] drm/amdgpu: Enable clear page functionality

2024-01-25 Thread Arunpravin Paneer Selvam
s_cleared(&cursor) check. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 22 --- .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 25 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 61 ++- dr

[PATCH v4 1/3] drm/buddy: Implement tracking clear page feature

2024-01-25 Thread Arunpravin Paneer Selvam
below, drm_buddy_is_clear(block) != drm_buddy_is_clear(buddy) Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/drm_buddy.c | 169 +++--- drivers/gpu/drm

Re: [PATCH v3 1/2] drm/buddy: Implement tracking clear page feature

2023-12-21 Thread Arunpravin Paneer Selvam
Hi Matthew, On 12/21/2023 12:51 AM, Matthew Auld wrote: Hi, On 14/12/2023 13:42, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks in the free path. On the otherhand,    DRM buddy marks

[PATCH v3 2/2] drm/amdgpu: Enable clear page functionality

2023-12-14 Thread Arunpravin Paneer Selvam
s_cleared(&cursor) check. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 22 --- .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 25 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 61 ++- dr

[PATCH v3 1/2] drm/buddy: Implement tracking clear page feature

2023-12-14 Thread Arunpravin Paneer Selvam
below, drm_buddy_is_clear(block) != drm_buddy_is_clear(buddy) Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/drm_buddy.c | 169 +++--- drivers/gpu/drm

[PATCH v2 2/2] drm/amdgpu: Enable clear page functionality

2023-12-10 Thread Arunpravin Paneer Selvam
N_RELEASE for clearing the buffers in the free path to properly wait for fences etc.. (Christian) Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 16 +++--- .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 25 + dr

[PATCH v2 1/2] drm/buddy: Implement tracking clear page feature

2023-12-10 Thread Arunpravin Paneer Selvam
below, drm_buddy_is_clear(block) != drm_buddy_is_clear(buddy) Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/drm_buddy.c | 169 +++--- drivers/gpu/drm

[PATCH 2/2] drm/amdgpu: Enable clear page functionality

2023-12-07 Thread Arunpravin Paneer Selvam
Add clear page support in vram memory region. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 13 +++-- .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h| 25 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 50 +++ drivers/gpu

[PATCH 1/2] drm/buddy: Implement tracking clear page feature

2023-12-07 Thread Arunpravin Paneer Selvam
rwise, we prefer to keep the blocks as separated. - Track the available cleared pages size Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/drm_buddy.c | 169 +++--- dr

Re: [PATCH v2 1/3] drm/buddy: Improve contiguous memory allocation

2023-09-13 Thread Arunpravin Paneer Selvam
On 11/09/23 03:46, Matthew Auld wrote: On 09/09/2023 17:09, Arunpravin Paneer Selvam wrote: Problem statement: The current method roundup_power_of_two() to allocate contiguous address triggers -ENOSPC in some cases even though we have enough free spaces and so to help with that we introduce a

[PATCH v2 3/3] drm/i915: Move the size computations to drm buddy

2023-09-09 Thread Arunpravin Paneer Selvam
- Move roundup_power_of_two() to drm buddy file to support the new try harder mechanism for contiguous allocation. - Move trim function call to drm_buddy_alloc_blocks() function. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 23

[PATCH v2 2/3] drm/amdgpu: Move the size computations to drm buddy

2023-09-09 Thread Arunpravin Paneer Selvam
- Move roundup_power_of_two() and IS_ALIGNED() computations to drm buddy file to support the new try harder mechanism for contiguous allocation. - Move trim function call to drm_buddy_alloc_blocks() function. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu

[PATCH v2 1/3] drm/buddy: Improve contiguous memory allocation

2023-09-09 Thread Arunpravin Paneer Selvam
() function to return total allocated size on -ENOSPC err and traverse RHS/LHS to allocate the required size (Matthew). Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.c | 138 include/drm/drm_buddy.h | 6 +- 2 files changed

Re: [PATCH 1/3] drm/buddy: Fix contiguous memory allocation issues

2023-08-22 Thread Arunpravin Paneer Selvam
On 22/08/23 22:52, Christian König wrote: Am 21.08.23 um 13:16 schrieb Christian König: Am 21.08.23 um 12:14 schrieb Arunpravin Paneer Selvam: The way now contiguous requests are implemented such that the size rounded up to power of 2 and the corresponding order block picked from the

Re: [PATCH 1/3] drm/buddy: Fix contiguous memory allocation issues

2023-08-22 Thread Arunpravin Paneer Selvam
On 21/08/23 10:46, Matthew Auld wrote: Hi, On 21/08/2023 11:14, Arunpravin Paneer Selvam wrote: The way now contiguous requests are implemented such that the size rounded up to power of 2 and the corresponding order block picked from the freelist. In addition to the older method, the new

Re: [PATCH 0/4] drm/amdgpu: Explicitly add a flexible array at the end of 'struct amdgpu_bo_list' and simplify amdgpu_bo_list_create()

2023-08-21 Thread Arunpravin Paneer Selvam
Hi Christian, I ran GLMark2, unigine heaven and Tomb Raider on steam. I didn't observe any issues. Regards, Arun. On 8/21/2023 4:33 PM, Christian König wrote: Am 20.08.23 um 11:51 schrieb Christophe JAILLET: This serie simplifies amdgpu_bo_list_create() and usage of the 'struct amdgpu_bo_li

[PATCH 3/3] drm/i915: Remove the contiguous computation and trim

2023-08-21 Thread Arunpravin Paneer Selvam
Paneer Selvam --- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 23 +++ 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c index a1bc804cfa15..0d735d5c2b35 100644 --- a

[PATCH 2/3] drm/amdgpu: Remove the contiguous computation and trim

2023-08-21 Thread Arunpravin Paneer Selvam
Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 58 ++-- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index c7085a747b03..18f58efc9dc7 100644 --- a/drivers

[PATCH 1/3] drm/buddy: Fix contiguous memory allocation issues

2023-08-21 Thread Arunpravin Paneer Selvam
part and trim function to the drm buddy manager. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.c | 253 ++-- include/drm/drm_buddy.h | 6 +- 2 files changed, 248 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_budd

Re: [PATCH] drm/buddy: Fix drm buddy info output format

2023-08-07 Thread Arunpravin Paneer Selvam
looks good to me as well. Reviewed-by: Arunpravin Paneer Selvam On 8/7/2023 12:17 PM, Christian König wrote: Am 04.08.23 um 08:56 schrieb Ma Jun: [1] Change pages to blocks to avoid confusion. [2] Fix output format to align the output info. Signed-off-by: Ma Jun Of hand looks good to me

Re: [PATCH RFC 2/2] drm: add documentation for drm_buddy_test kUnit test

2023-07-13 Thread Arunpravin Paneer Selvam
Looks good, Feel free to add Reviewed-by: Arunpravin Paneer Selvam Regards, Arun. On 7/13/2023 12:09 PM, Christian König wrote: [Adding Arun] Am 12.07.23 um 16:28 schrieb Mauro Carvalho Chehab: As an example for the new documentation tool, add a documentation for drm_buddy_test. I opted

[PATCH v2] drm: Optimize drm buddy top-down allocation method

2023-01-12 Thread Arunpravin Paneer Selvam
ascending order and compare the last entry of each order list in the freelist and return the max block. This patch improves the 3D benchmark scores and solves fragmentation issues. All drm buddy selftests are verfied. drm_buddy: pass:6 fail:0 skip:0 total:6 Signed-off-by: Arunpravin Paneer Selvam

Re: [PATCH] drm: Alloc high address for drm buddy topdown flag

2023-01-10 Thread Arunpravin Paneer Selvam
Hi Matthew, On 1/10/2023 5:32 PM, Matthew Auld wrote: On 07/01/2023 15:15, Arunpravin Paneer Selvam wrote: As we are observing low numbers in viewperf graphics benchmark, we are strictly not allowing the top down flag enabled allocations to steal the memory space from cpu visible region. The

[PATCH] drm: Alloc high address for drm buddy topdown flag

2023-01-07 Thread Arunpravin Paneer Selvam
list in the freelist and return the max block. This patch improves the viewperf 3D benchmark scores. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/drm_buddy.c | 81 - 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/drivers/gpu

Re: [PATCH v3] drm: Optimise for continuous memory allocation

2022-11-28 Thread Arunpravin Paneer Selvam
Hi Xinhui, On 11/28/2022 12:04 PM, xinhui pan wrote: Currently drm-buddy does not have full knowledge of continuous memory. Lets consider scenario below. order 1:L R order 0: LL LR RL RR for order 1 allocation, it can offer L or R or LR+RL. For now, we only impl

Re: [PATCH 1/9] drm/amdgpu: generally allow over-commit during BO allocation

2022-11-27 Thread Arunpravin Paneer Selvam
Hi Christian, Looks good to me. Reviewed-by: Arunpravin Paneer Selvam for the series. Regards, Arun. On 11/25/2022 3:51 PM, Christian König wrote: We already fallback to a dummy BO with no backing store when we allocate GDS,GWS and OA resources and to GTT when we allocate VRAM. Drop all

Re: [PATCH 2/2] drm/gem: Remove BUG_ON in drm_gem_private_object_init

2022-11-21 Thread Arunpravin Paneer Selvam
On 11/22/2022 10:48 AM, Somalapuram, Amaranath wrote: On 11/16/2022 2:50 PM, Arunpravin Paneer Selvam wrote: Hi Amar, On 11/16/2022 2:20 PM, Somalapuram Amaranath wrote: ttm_resource allocate size in bytes i.e less than page size. Signed-off-by: Somalapuram Amaranath ---   drivers/gpu

  1   2   >