public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/amdgpu: Ensure isp_kernel_buffer_alloc() creates a new BO
@ 2025-11-05 23:21 Sultan Alsawaf
  2025-11-06 18:46 ` Mario Limonciello
  0 siblings, 1 reply; 9+ messages in thread
From: Sultan Alsawaf @ 2025-11-05 23:21 UTC (permalink / raw)
  To: bin.du, pratap.nirujogi, mario.limonciello, amd-gfx, linux-kernel
  Cc: alexander.deucher, benjamin.chan, christian.koenig, dantony,
	gjorgji.rosikopulos, king.li, phil.jawich

From: Sultan Alsawaf <sultan@kerneltoast.com>

When the BO pointer provided to amdgpu_bo_create_kernel() points to
non-NULL, amdgpu_bo_create_kernel() takes it as a hint to pin that address
rather than allocate a new BO.

This functionality is never desired for allocating ISP buffers. A new BO
should always be created when isp_kernel_buffer_alloc() is called, per the
description for isp_kernel_buffer_alloc().

Ensure this by zeroing *bo right before the amdgpu_bo_create_kernel() call.

Fixes: 55d42f616976 ("drm/amd/amdgpu: Add helper functions for isp buffers")
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
index 9cddbf50442a..37270c4dab8d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
@@ -280,6 +280,8 @@ int isp_kernel_buffer_alloc(struct device *dev, u64 size,
 	if (ret)
 		return ret;
 
+	/* Ensure *bo is NULL so a new BO will be created */
+	*bo = NULL;
 	ret = amdgpu_bo_create_kernel(adev,
 				      size,
 				      ISP_MC_ADDR_ALIGN,
-- 
2.51.2


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

end of thread, other threads:[~2025-11-10 16:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05 23:21 [PATCH] drm/amd/amdgpu: Ensure isp_kernel_buffer_alloc() creates a new BO Sultan Alsawaf
2025-11-06 18:46 ` Mario Limonciello
2025-11-06 18:58   ` Sultan Alsawaf
2025-11-06 19:00     ` Mario Limonciello
2025-11-06 20:08     ` Nirujogi, Pratap
2025-11-06 20:31       ` Sultan Alsawaf
2025-11-06 20:51         ` Nirujogi, Pratap
2025-11-10  3:12           ` Du, Bin
2025-11-10 16:26             ` Nirujogi, Pratap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox