Commit 7132f7e0 authored by Sultan Alsawaf's avatar Sultan Alsawaf Committed by Alex Deucher
Browse files

drm/amd/amdgpu: Ensure isp_kernel_buffer_alloc() creates a new BO



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: 55d42f61 ("drm/amd/amdgpu: Add helper functions for isp buffers")
Reviewed-by: default avatarMario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: default avatarPratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: default avatarSultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 73c8c29b)
parent 33c99570
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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,