]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/amdgpu: Ensure isp_kernel_buffer_alloc() creates a new BO
authorSultan Alsawaf <sultan@kerneltoast.com>
Fri, 7 Nov 2025 18:07:13 +0000 (13:07 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 12 Nov 2025 03:51:27 +0000 (22:51 -0500)
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")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 73c8c29baac7f0c7e703d92eba009008cbb5228e)

drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c

index 9cddbf50442a40273e5a0a9f186b9d79d8040a9c..37270c4dab8dd777eea4de705ae513b694abe3d3 100644 (file)
@@ -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,