[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

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

2024-03-04 Thread Arunpravin Paneer Selvam
. 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.c | 61

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

2024-03-04 Thread Arunpravin Paneer Selvam
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 König

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
. 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.c | 61

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

2024-02-21 Thread Arunpravin Paneer Selvam
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 | 190

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

[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
nk: 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/drm/d

[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
nk: 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/drm/d

[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
nk: 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/drm/d

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
nk: 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/drive

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

2024-02-09 Thread Arunpravin Paneer Selvam
nk: 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/drive

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

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

2024-02-08 Thread Arunpravin Paneer Selvam
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/i915

[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 2/3] drm/amdgpu: Enable clear page functionality

2024-02-08 Thread Arunpravin Paneer Selvam
. 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 ++- drivers/gpu/drm/amd/amdgpu

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 required

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 find

[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 Tested

Re: [Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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: [Intel-gfx] [PATCH 1/3] drm/buddy: Fix contiguous memory allocation issues

2023-08-23 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

Re: [Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

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

2023-08-21 Thread Arunpravin Paneer Selvam
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_buddy.c b

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

2023-01-12 Thread Arunpravin Paneer Selvam
in 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: [Intel-gfx] [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

[Intel-gfx] [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: [Intel-gfx] [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: [Intel-gfx] [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

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

2022-11-16 Thread Arunpravin Paneer Selvam
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/drm/drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem.c