On 2025-10-14 13:52, Kasiviswanathan, Harish wrote:
[Public]

Reviewed-by: Harish Kasiviswanathan<[email protected]>

This patch seems to effectively revert your earlier patch

commit f915f3af9984464c308787102990d85d4e988d2c
Author: Harish Kasiviswanathan<[email protected]>
Date:   Fri Apr 28 14:20:00 2023 -0400

    drm/amdgpu: For GFX 9.4.3 APU fix vram_usage value
For GFX 9.4.3 APP APU VRAM is allocated in GTT domain. While freeing
    memory check for GTT domain instead of VRAM if it is APP APU
Signed-off-by: Harish Kasiviswanathan<[email protected]>
    Reviewed-by: Felix Kuehling<[email protected]>
    Signed-off-by: Alex Deucher<[email protected]>

Are you sure that's the right thing to do? Are the original reasons for your patch no longer valid?

Regards,
  Felix




-----Original Message-----
From: Liu, Alysa<[email protected]>
Sent: Tuesday, October 14, 2025 9:43 AM
To:[email protected]
Cc: Kasiviswanathan, Harish<[email protected]>; Liu, 
Alysa<[email protected]>
Subject: [PATCH] drm/amdgpu: Fix vram_usage underflow

From: Alysa Liu<[email protected]>

vram_usage was subtracting non-vram memory size,
which caused it to become negative.

Signed-off-by: Alysa Liu<[email protected]>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 22c1bdc53d2e..c2fa330ff78b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -1961,9 +1961,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
          */
         if (size) {
                 if (!is_imported &&
-                  (mem->bo->preferred_domains == AMDGPU_GEM_DOMAIN_VRAM ||
-                  (adev->apu_prefer_gtt &&
-                   mem->bo->preferred_domains == AMDGPU_GEM_DOMAIN_GTT)))
+                  mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM)
                         *size = bo_size;
                 else
                         *size = 0;
--
2.34.1

Reply via email to