]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu/vcn: Use buffer object's deletion logic
authorLijo Lazar <lijo.lazar@amd.com>
Wed, 8 Mar 2023 07:11:22 +0000 (12:41 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 13:56:32 +0000 (09:56 -0400)
VCN DPG buffer object is intialized to NULL. If allotted, buffer object
deletion logic will take care of NULL check and delete accordingly. This
is useful for cases where indirect sram flag could be manipulated later
after buffer allocation.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

index 57dabfe1a1bee31d3af579e4b05a3f27f104c3d3..06ec2dc5585712cda709b3581d6902e6a9ea4f6d 100644 (file)
@@ -235,11 +235,11 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev)
                if (adev->vcn.harvest_config & (1 << j))
                        continue;
 
-               if (adev->vcn.indirect_sram) {
-                       amdgpu_bo_free_kernel(&adev->vcn.inst[j].dpg_sram_bo,
-                                                 &adev->vcn.inst[j].dpg_sram_gpu_addr,
-                                                 (void **)&adev->vcn.inst[j].dpg_sram_cpu_addr);
-               }
+               amdgpu_bo_free_kernel(
+                       &adev->vcn.inst[j].dpg_sram_bo,
+                       &adev->vcn.inst[j].dpg_sram_gpu_addr,
+                       (void **)&adev->vcn.inst[j].dpg_sram_cpu_addr);
+
                kvfree(adev->vcn.inst[j].saved_bo);
 
                amdgpu_bo_free_kernel(&adev->vcn.inst[j].vcpu_bo,