[PATCH v4 1/3] drm/amdgpu: Fix out-of-bounds issue in user fence

2025-01-01 Thread Arunpravin Paneer Selvam
] do_syscall_64+0x4d/0x120 [ +0.08] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ +0.07] RIP: 0033:0x7f7c3d31a94f Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd

[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] drm/amdgpu: Add a lock when accessing the buddy trim function

2024-12-24 Thread Arunpravin Paneer Selvam
51199] ? amdgpu_display_user_framebuffer_create+0x215/0x320 [amdgpu] [ 7197.251329] ? drm_internal_framebuffer_create+0xb7/0x1a0 [ 7197.251332] ? srso_alias_return_thunk+0x5/0xfbef5 Signed-off-by: Arunpravin Paneer Selvam Fixes: 4a5ad08f5377 ("drm/amdgpu: Add address alignment support to DCC buffers") --- drivers/gpu

[PATCH v3 3/3] drm/amdgpu: Fix wait IOCTL lockup issues.

2024-12-19 Thread Arunpravin Paneer Selvam
2] RBP: 7f3a009ff8f0 R08: 0001 R09: [ +0.01] R10: 0002 R11: 0246 R12: 561824bf39e0 [ +0.02] R13: c0406458 R14: 000c R15: 561824a25b60 [ +0.06] Signed-off-by: Arunpravin Paneer Selvam --- .../gp

[PATCH v3 2/3] drm/amdgpu: Improve the xa field names readability

2024-12-19 Thread Arunpravin Paneer Selvam
Make the xa field names used in the userqueue and userfence structure more understandable and add more clarity. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 31 ++- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.h | 4 +-- drivers/gpu

[PATCH v3 1/3] drm/amdgpu: Fix out-of-bounds issue in user fence

2024-12-19 Thread Arunpravin Paneer Selvam
] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ +0.07] RIP: 0033:0x7f7c3d31a94f Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 43 +++ .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.h | 3 +- 2 files changed, 17 insertions(+), 29 deletions

[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 v2 7/7] drm/amdgpu: Apply sign extension to seq64

2024-12-12 Thread Arunpravin Paneer Selvam
Apply sign extension to seq64 va address. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c

[PATCH v2 4/7] drm/amdgpu: Fix out-of-bounds issue in user fence

2024-12-12 Thread Arunpravin Paneer Selvam
] x64_sys_call+0x1205/0x20d0 [ +0.07] do_syscall_64+0x4d/0x120 [ +0.08] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ +0.07] RIP: 0033:0x7f7c3d31a94f Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v2 3/7] drm/amdgpu: Fix the use-after-free issue in wait IOCTL

2024-12-12 Thread Arunpravin Paneer Selvam
] x64_sys_call+0x1209/0x20d0 [ 366.492299] do_syscall_64+0x51/0x120 [ 366.492303] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 366.492418] RIP: 0033:0x7f86f3b1a94f Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH v2 2/7] drm/amdgpu: Fix NULL ptr dereference issue for non userq fences

2024-12-12 Thread Arunpravin Paneer Selvam
-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index 877cb17a14e9..3a88f754a395 100644 --- a

[PATCH v2 6/7] drm/amdgpu: Fix wait IOCTL lockup issues.

2024-12-12 Thread Arunpravin Paneer Selvam
: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 122 +++--- 1 file changed, 72 insertions(+), 50 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index 49dc78c2f0d7..5c39681c9720

[PATCH v2 5/7] drm/amdgpu: Modify the MES process va end limit

2024-12-12 Thread Arunpravin Paneer Selvam
From: Christian König Modify the MES process va end limit to max pfn. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 +- drivers/gpu/drm/amd/amdgpu

[PATCH v2 1/7] drm/amdgpu: Add mqd for userq compute queue

2024-12-12 Thread Arunpravin Paneer Selvam
Add mqd for userq compute queue for gfx11/gfx12 Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c| 4 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c| 4 drivers/gpu/drm/amd/include/v11_structs.h | 4 ++-- drivers/gpu/drm/amd/include/v12_structs.h | 4

[PATCH v2 4/4] drm/amdgpu: Fix out-of-bounds issue in user fence

2024-11-28 Thread Arunpravin Paneer Selvam
] x64_sys_call+0x1205/0x20d0 [ +0.07] do_syscall_64+0x4d/0x120 [ +0.08] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ +0.07] RIP: 0033:0x7f7c3d31a94f Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v2 3/4] drm/amdgpu: Fix the use-after-free issue in wait IOCTL

2024-11-28 Thread Arunpravin Paneer Selvam
] x64_sys_call+0x1209/0x20d0 [ 366.492299] do_syscall_64+0x51/0x120 [ 366.492303] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 366.492418] RIP: 0033:0x7f86f3b1a94f Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH v2 2/4] drm/amdgpu: Add mqd support for userq compute queue

2024-11-28 Thread Arunpravin Paneer Selvam
Add mqd support for userq compute queue. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c | 13 ++--- drivers/gpu/drm/amd/include/v11_structs.h| 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 1/4] drm/amdgpu: Fix NULL ptr dereference issue for non userq fences

2024-11-28 Thread Arunpravin Paneer Selvam
-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index 877cb17a14e9..3a88f754a395 100644 --- a

[PATCH 1/3] drm/amdgpu: Add NULL ptr check for non userq fences

2024-11-20 Thread Arunpravin Paneer Selvam
We are observing a NULL value in the non userq fences, thus added a NULL pointer check just to avoid the NULL pointer dereference crash. v2: Moved the NULL check above the non userq check. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++ 1

[PATCH 2/3] drm/amdgpu: Add mqd support for userq compute queue

2024-11-20 Thread Arunpravin Paneer Selvam
Add mqd support for userq compute queue. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c | 13 ++--- drivers/gpu/drm/amd/include/v11_structs.h| 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 3/3] drm/amdgpu: Fix dmesg warning from xarray

2024-11-20 Thread Arunpravin Paneer Selvam
Fix the warning issue generated at lib/xarray.c:1849. v2: keep the error handling same as before when the xalloc() call fails to store the fence_drv ref. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 -- 1 file changed, 4 insertions

[PATCH 1/3] drm/amdgpu: Add NULL ptr check for non userq fences

2024-11-20 Thread Arunpravin Paneer Selvam
We are observing a NULL value in the non userq fences, thus added a NULL pointer check just to avoid the NULL pointer dereference crash. v2: Moved the NULL check above the non userq check. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++ 1

[PATCH 3/3] drm/amdgpu: Fix PF issue when xalloc fails

2024-11-19 Thread Arunpravin Paneer Selvam
Fix the Page fault and warning issue when xalloc fails to store the fence_drv. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH 2/3] drm/amdgpu: Add mqd support for userq compute queue

2024-11-19 Thread Arunpravin Paneer Selvam
Add mqd support for userq compute queue. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c | 13 ++--- drivers/gpu/drm/amd/include/v11_structs.h| 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2] drm/amdgpu: Add NULL ptr check for non userq fences

2024-11-13 Thread Arunpravin Paneer Selvam
We are observing a NULL value in the non userq fences, thus added a NULL pointer check just to avoid the NULL pointer dereference crash. v2: Moved the NULL check above the non userq check. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++ 1

[PATCH] drm/amdgpu: Add NULL ptr check for non userq fences

2024-11-11 Thread Arunpravin Paneer Selvam
We are observing a NULL value in the non userq fences, thus added a NULL pointer check just to avoid the NULL pointer dereference crash. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu

[PATCH] drm/amdgpu: Fix UVD contiguous CS mapping problem

2024-11-11 Thread Arunpravin Paneer Selvam
and not set cases. Closes:https://gitlab.freedesktop.org/drm/amd/-/issues/3599 Closes:https://gitlab.freedesktop.org/drm/amd/-/issues/3501 Signed-off-by: Arunpravin Paneer Selvam Cc: sta...@vger.kernel.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 18 +++--- 1 file changed, 11

[PATCH] drm/amdgpu: Fix UVD contiguous CS mapping problem

2024-11-11 Thread Arunpravin Paneer Selvam
and not set cases. Closes:https://gitlab.freedesktop.org/drm/amd/-/issues/3599 Closes:https://gitlab.freedesktop.org/drm/amd/-/issues/3501 Signed-off-by: Arunpravin Paneer Selvam Cc: sta...@vger.kernel.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 18 +++--- 1 file changed, 11

[PATCH] drm/amdgpu: Modify userq signal/wait struct field names

2024-11-04 Thread Arunpravin Paneer Selvam
Modify kernel UAPI userq signal/wait struct field names and description corresponding to the libdrm UAPI review comments. libdrm MR: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/392 Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 20

[PATCH v2] drm/amdgpu: add userq specific kernel config for fence ioctls

2024-10-29 Thread Arunpravin Paneer Selvam
Keep the user queue fence signal and wait IOCTLs in the kernel config CONFIG_DRM_AMDGPU_NAVI3X_USERQ. v2(Christian): - Remove the userq specific config added for kernel queues fence init function. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c

[PATCH 1/2] drm/amdgpu: add userq specific kernel config for fence ioctls

2024-10-25 Thread Arunpravin Paneer Selvam
Keep the user queue fence signal and wait IOCTLs in the kernel config CONFIG_DRM_AMDGPU_NAVI3X_USERQ. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 16 2 files changed, 20

[PATCH 2/2] drm/amdgpu: Add gpu_addr support to seq64 allocation

2024-10-24 Thread Arunpravin Paneer Selvam
Add gpu address support to seq64 alloc function. v1:(Christian) - Add the user of this new interface change to the same patch. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c | 10 -- drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.h | 3

[PATCH] drm/amdgpu: Add gpu_addr support to seq64 allocation

2024-10-18 Thread Arunpravin Paneer Selvam
Add gpu address support to seq64 alloc function. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c | 10 -- drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.h | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH v4 09/09] drm/amdgpu: Add separate array of read and write for BO handles

2024-10-15 Thread Arunpravin Paneer Selvam
Drop AMDGPU_USERQ_BO_WRITE as this should not be a global option of the IOCTL, It should be option per buffer. Hence adding separate array for read and write BO handles. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König Suggested-by: Marek Olšák Suggested-by: Christian König

[PATCH v4 08/09] drm/amdgpu: add vm root BO lock before accessing the vm

2024-10-15 Thread Arunpravin Paneer Selvam
reference. Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 24 --- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd

[PATCH v4 07/09] drm/amdgpu: Add the missing error handling for xa_store() call

2024-10-15 Thread Arunpravin Paneer Selvam
Add the missing error handling for xa_store() call in the function amdgpu_userq_fence_driver_alloc(). Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v4 06/09] drm/amdgpu: Few optimization and fixes for userq fence driver

2024-10-15 Thread Arunpravin Paneer Selvam
the unnecessary comments. Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 44 --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 6 +-- .../gpu/drm

[PATCH v4 05/09] drm/amdgpu: Remove the MES self test

2024-10-15 Thread Arunpravin Paneer Selvam
Remove MES self test as this conflicts the userqueue fence interrupts. v2:(Christian) - remove the amdgpu_mes_self_test() function and any now unused code. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 - drivers/gpu

[PATCH v4 01/09] drm/amdgpu: Implement userqueue signal/wait IOCTL

2024-10-15 Thread Arunpravin Paneer Selvam
for the userq_xa xarray - drop the if check of userq_fence->fence_drv_array - use the i variable to initialize userq_fence->fence_drv_array_count - drop the fence reference before you free the array in the error handling, otherwise it could be that some references leaked

[PATCH v4 04/09] drm/amdgpu: Enable userq fence interrupt support

2024-10-15 Thread Arunpravin Paneer Selvam
e_drv might be freed. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 2 ++ .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 + drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c| 25 +-- 3 files change

[PATCH v4 02/09] drm/amdgpu: screen freeze and userq driver crash

2024-10-15 Thread Arunpravin Paneer Selvam
: Arunpravin Paneer Selvam Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index 95f232ad4a3d

[PATCH v4 03/09] drm/amdgpu: Add wait IOCTL timeline syncobj support

2024-10-15 Thread Arunpravin Paneer Selvam
. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 91 +-- include/uapi/drm/amdgpu_drm.h | 16 +++- 2 files changed, 99 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm

[PATCH v3 09/09] drm/amdgpu: Add separate array of read and write for BO handles

2024-09-30 Thread Arunpravin Paneer Selvam
Drop AMDGPU_USERQ_BO_WRITE as this should not be a global option of the IOCTL, It should be option per buffer. Hence adding separate array for read and write BO handles. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 238 +- include

[PATCH v3 05/09] drm/amdgpu: Remove the MES self test

2024-09-30 Thread Arunpravin Paneer Selvam
Remove MES self test as this conflicts the userqueue fence interrupts. v2:(Christian) - remove the amdgpu_mes_self_test() function and any now unused code. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 - drivers/gpu

[PATCH v3 03/09] drm/amdgpu: Add wait IOCTL timeline syncobj support

2024-09-30 Thread Arunpravin Paneer Selvam
handling - Use dma_fence_unwrap_for_each() in timeline fence as there could be more than one fence. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 99 +-- include/uapi/drm/amdgpu_drm.h | 16 ++- 2 files changed, 107

[PATCH v3 08/09] drm/amdgpu: add vm root BO lock before accessing the vm

2024-09-30 Thread Arunpravin Paneer Selvam
reference. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 24 --- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index

[PATCH v3 07/09] drm/amdgpu: Add the missing error handling for xa_store() call

2024-09-30 Thread Arunpravin Paneer Selvam
Add the missing error handling for xa_store() call in the function amdgpu_userq_fence_driver_alloc(). Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v3 06/09] drm/amdgpu: Few optimization and fixes for userq fence driver

2024-09-30 Thread Arunpravin Paneer Selvam
the unnecessary comments. Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 44 --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 6 +-- .../gpu/drm

[PATCH v3 01/09] drm/amdgpu: Implement userqueue signal/wait IOCTL

2024-09-30 Thread Arunpravin Paneer Selvam
for the userq_xa xarray - drop the if check of userq_fence->fence_drv_array - use the i variable to initialize userq_fence->fence_drv_array_count - drop the fence reference before you free the array in the error handling, otherwise it could be that some references leaked

[PATCH v3 04/09] drm/amdgpu: Enable userq fence interrupt support

2024-09-30 Thread Arunpravin Paneer Selvam
e_drv might be freed. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 2 ++ .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 + drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c| 25 +-- 3 files change

[PATCH v3 02/09] drm/amdgpu: screen freeze and userq driver crash

2024-09-30 Thread Arunpravin Paneer Selvam
: Arunpravin Paneer Selvam Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index 95f232ad4a3d

[PATCH v2 08/08] drm/amdgpu: add vm root BO lock before accessing the vm

2024-09-25 Thread Arunpravin Paneer Selvam
Add a vm root BO lock before accessing the userqueue VM. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers

[PATCH v2 07/08] drm/amdgpu: Add the missing error handling for xa_store() call

2024-09-25 Thread Arunpravin Paneer Selvam
Add the missing error handling for xa_store() call in the function amdgpu_userq_fence_driver_alloc(). Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH v2 05/08] drm/amdgpu: Remove the MES self test

2024-09-25 Thread Arunpravin Paneer Selvam
Remove MES self test as this conflicts the userqueue fence interrupts. v2:(Christian) - remove the amdgpu_mes_self_test() function and any now unused code. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 - drivers/gpu

[PATCH v2 06/08] drm/amdgpu: Add few optimizations to userq fence driver

2024-09-25 Thread Arunpravin Paneer Selvam
unnecessary comments. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 44 --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 6 +-- .../gpu/drm/amd/include/amdgpu_userqueue.h| 2

[PATCH v2 04/08] drm/amdgpu: Enable userq fence interrupt support

2024-09-25 Thread Arunpravin Paneer Selvam
e_drv might be freed. Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 2 ++ .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 + drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c| 25 +-- 3 files change

[PATCH v2 03/08] drm/amdgpu: Add wait IOCTL timeline syncobj support

2024-09-25 Thread Arunpravin Paneer Selvam
Add user fence wait IOCTL timeline syncobj support. v2:(Christian) - handle dma_fence_wait() return value. - shorten the variable name syncobj_timeline_points a bit. - move num_points up to avoid padding issues. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu

[PATCH v2 01/08] drm/amdgpu: Implement userqueue signal/wait IOCTL

2024-09-25 Thread Arunpravin Paneer Selvam
for the userq_xa xarray - drop the if check of userq_fence->fence_drv_array - use the i variable to initialize userq_fence->fence_drv_array_count - drop the fence reference before you free the array in the error handling, otherwise it could be that some references leaked

[PATCH v2 02/08] drm/amdgpu: screen freeze and userq driver crash

2024-09-25 Thread Arunpravin Paneer Selvam
: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index 96d1caf4c815..97b1af574407 100644 --- a

[PATCH 4/6] drm/amdgpu: Enable userq fence interrupt support

2024-08-30 Thread Arunpravin Paneer Selvam
e_drv might be freed. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 2 ++ .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 6 + drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c| 25 +-- 3 files changed, 20 insertions(+), 13 dele

[PATCH 2/6] drm/amdgpu: Add wait IOCTL timeline syncobj support

2024-08-30 Thread Arunpravin Paneer Selvam
Add user fence wait IOCTL timeline syncobj support. v2:(Christian) - handle dma_fence_wait() return value. - shorten the variable name syncobj_timeline_points a bit. - move num_points up to avoid padding issues. Signed-off-by: Arunpravin Paneer Selvam --- .../gpu/drm/amd/amdgpu

[PATCH 6/6] drm/amdgpu: Add few optimizations to userq fence driver

2024-08-30 Thread Arunpravin Paneer Selvam
amdgpu_userq_fence_driver_alloc(). Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 2 +- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 64 --- .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.h | 2 +- drivers/gpu/drm/amd/amdgpu

[PATCH 5/6] drm/amdgpu: Remove the MES self test

2024-08-30 Thread Arunpravin Paneer Selvam
Remove MES self test as this conflicts the userqueue fence interrupts. v2:(Christian) - remove the amdgpu_mes_self_test() function and any now unused code. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 - drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c

[PATCH 1/6] drm/amdgpu: Implement userqueue signal/wait IOCTL

2024-08-30 Thread Arunpravin Paneer Selvam
telling the hw to stop accessing it. - Add multi sync object support to userq signal IOCTL. V9: (Christian) - Store all the fence_drv ref to other drivers and not ourself. - Remove the userq fence xa implementation and replace with kvmalloc_array. Signed-off-by: Arunpravin Paneer S

[PATCH 3/6] drm/amdgpu: screen freeze and userq driver crash

2024-08-30 Thread Arunpravin Paneer Selvam
Screen freeze and userq fence driver crash while playing Xonotic Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b

[PATCH] drm/amdgpu: Add DCC GFX12 flag to enable address alignment

2024-08-05 Thread Arunpravin Paneer Selvam
display buffers unnecessarily that leads to memory allocation failure. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm

[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 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 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 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 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 v3] drm/amdgpu: Fix the BO release clear memory warning

2024-06-10 Thread Arunpravin Paneer Selvam
/0x220 [amdgpu] Fixes: a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality") Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Tested-by: Mikhail Gavrilov Tested-by: Richard Gong Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ge

[PATCH v2] drm/amdgpu: Fix the BO release clear memory warning

2024-06-06 Thread Arunpravin Paneer Selvam
("drm/amdgpu: Enable clear page functionality") Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/driv

[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 v10 6/6] drm/amdgpu: Enable userq fence interrupt support

2024-05-10 Thread Arunpravin Paneer Selvam
e MES self test function call. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 2 ++ .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 15 drivers/gpu/drm/amd/amdgpu/gfx_v1

[PATCH v10 1/6] drm/amdgpu: Implement a new userqueue fence driver

2024-05-10 Thread Arunpravin Paneer Selvam
the seq64 memory in user fence driver(Christian) - fix for the wptr va bo mapping(Christian) - move the fence_drv xa entry erase code from the interrupt handler into user fence destroy function Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König Suggested-by: Christian Kö

[PATCH v10 4/6] drm/amdgpu: Implement userqueue signal/wait IOCTL

2024-05-10 Thread Arunpravin Paneer Selvam
telling the hw to stop accessing it. - Add multi sync object support to userq signal IOCTL. v9: (Christian) - Store all the fence_drv ref to other drivers and not ourself. - Iterate over uq_fence_drv_xa without holding a lock. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Chris

[PATCH v10 5/6] drm/amdgpu: Remove the MES self test

2024-05-10 Thread Arunpravin Paneer Selvam
Remove MES self test as this conflicts the userqueue fence interrupts. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 --- drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 12 +--- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 14 +- 3

[PATCH v10 3/6] drm/amdgpu: UAPI headers for userqueue secure semaphore

2024-05-10 Thread Arunpravin Paneer Selvam
: Worked on review comments from Christian - Modify the bo flags description. Signed-off-by: Alex Deucher Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König --- include/uapi/drm/amdgpu_drm.h | 110 ++ 1 file changed, 110 insertions(+) diff

[PATCH v10 2/6] drm/amdgpu: Add mqd support for the fence address

2024-05-10 Thread Arunpravin Paneer Selvam
- Add a field in struct v11_gfx_mqd for userqueue fence address. - Assign fence gpu VA address to the userqueue mqd fence address fields. v2: Remove the mask and replace with lower_32_bits (Christian) Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König --- drivers/gpu

[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/amdgpu: Fix the BO release clear memory warning

2024-05-06 Thread Arunpravin Paneer Selvam
6.038655] [6.038656] ---[ end trace ]--- Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ob

[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 v9 5/5] drm/amdgpu: Enable userq fence interrupt support

2024-04-28 Thread Arunpravin Paneer Selvam
and this info is compared with the queue's mqd doorbell offset value. If they are same, we process the userq fence interrupt. Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 5 ++-- .../gpu/dr

[PATCH v9 3/5] drm/amdgpu: UAPI headers for userqueue Secure semaphore

2024-04-28 Thread Arunpravin Paneer Selvam
: Worked on review comments from Christian - Modify the bo flags description. Signed-off-by: Alex Deucher Signed-off-by: Arunpravin Paneer Selvam Reviewed-by: Christian König --- include/uapi/drm/amdgpu_drm.h | 115 ++ 1 file changed, 115 insertions(+) diff

[PATCH v9 4/5] drm/amdgpu: Implement userqueue signal/wait IOCTL

2024-04-28 Thread Arunpravin Paneer Selvam
telling the hw to stop accessing it. - Add multi sync object support to userq signal IOCTL. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 + .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 454 ++

  1   2   3   4   >