]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amdgpu: remove redundant AMDGPU_HAS_VRAM
authorYifan Zhang <yifan1.zhang@amd.com>
Wed, 20 Aug 2025 06:55:41 +0000 (14:55 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Aug 2025 17:57:48 +0000 (13:57 -0400)
AMDGPU_HAS_VRAM is redundant with is_app_apu, as both refer to
APUs with no carve-out. Since AMDGPU_HAS_VRAM only occurs once,
remove AMDGPU_HAS_VRAM definition. The tmr allocation can be covered
with AMDGPU_GEM_DOMAIN_GTT | AMDGPU_GEM_DOMAIN_VRAM in both vram and
non vram ASICs.

Signed-off-by: Yifan Zhang <yifan1.zhang@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.h
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index ddd472e56f695beab25279debb24c9baf966fc86..01f53700694bc3bb51822af1b4ff0eb2285f5621 100644 (file)
@@ -946,12 +946,6 @@ enum amdgpu_enforce_isolation_mode {
        AMDGPU_ENFORCE_ISOLATION_NO_CLEANER_SHADER = 3,
 };
 
-
-/*
- * Non-zero (true) if the GPU has VRAM. Zero (false) otherwise.
- */
-#define AMDGPU_HAS_VRAM(_adev) ((_adev)->gmc.real_vram_size)
-
 struct amdgpu_device {
        struct device                   *dev;
        struct pci_dev                  *pdev;
index 772682974ac6a09ab415ce8a5f23b7ae69c4c2a2..2c4db7e9d7e8334f64cc9b4671481f438d2ec074 100644 (file)
@@ -880,9 +880,7 @@ static int psp_tmr_init(struct psp_context *psp)
                pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
                ret = amdgpu_bo_create_kernel(psp->adev, tmr_size,
                                              PSP_TMR_ALIGNMENT,
-                                             AMDGPU_HAS_VRAM(psp->adev) ?
-                                             AMDGPU_GEM_DOMAIN_VRAM :
-                                             AMDGPU_GEM_DOMAIN_GTT,
+                                             AMDGPU_GEM_DOMAIN_GTT | AMDGPU_GEM_DOMAIN_VRAM,
                                              &psp->tmr_bo, &psp->tmr_mc_addr,
                                              pptr);
        }