From: jsg Date: Sat, 15 Jun 2024 03:47:56 +0000 (+0000) Subject: drm/amdgpu: Fix VRAM memory accounting X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c5c76a35864627b87d7d95289238333535fc1751;p=openbsd drm/amdgpu: Fix VRAM memory accounting From Mukul Joshi 422f3259ac6508e7289232fd7cb915914a527c70 in linux-6.6.y/6.6.33 f06446ef23216090d1ee8ede1a7d7ae430c22dcc in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index 6044d3fc845..6bbd18cb7c1 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -213,7 +213,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev, (kfd_mem_limit.ttm_mem_used + ttm_mem_needed > kfd_mem_limit.max_ttm_mem_limit) || (adev && xcp_id >= 0 && adev->kfd.vram_used[xcp_id] + vram_needed > - vram_size - reserved_for_pt)) { + vram_size - reserved_for_pt - atomic64_read(&adev->vram_pin_size))) { ret = -ENOMEM; goto release; }