[AMD Official Use Only - General]


Reviewed-by: Feifei Xu <feifei...@amd.com>

-----Original Message-----
From: Gao, Likun <likun....@amd.com> 
Sent: Wednesday, November 23, 2022 6:01 PM
To: amd-gfx list <amd-gfx@lists.freedesktop.org>
Cc: Zhang, Hawking <hawking.zh...@amd.com>; Xu, Feifei <feifei...@amd.com>
Subject: [PATCH] drm/amdgpu: skip vram reserve on firmware_v2_2 for bare-metal

[AMD Official Use Only - General]

vram_usagebyfirmware v2_2 is only used in SRIOV case, skip the related settings 
in bare-metal case currently.

Signed-off-by: Likun Gao <likun....@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
index 9b97fa39d47a..d824ebe1d4d0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
@@ -147,14 +147,16 @@ static int amdgpu_atomfirmware_allocate_fb_v2_2(struct 
amdgpu_device *adev,
                          drv_start_addr,
                          drv_size);
 
-       if ((fw_start_addr & (ATOM_VRAM_BLOCK_NEEDS_NO_RESERVATION << 30)) == 
0) {
+       if (amdgpu_sriov_vf(adev) &&
+           (fw_start_addr & (ATOM_VRAM_BLOCK_NEEDS_NO_RESERVATION << 30)) == 
+0) {
                /* Firmware request VRAM reservation for SR-IOV */
                adev->mman.fw_vram_usage_start_offset = (fw_start_addr &
                        (~ATOM_VRAM_OPERATION_FLAGS_MASK)) << 10;
                adev->mman.fw_vram_usage_size = fw_size << 10;
        }
 
-       if ((drv_start_addr & (ATOM_VRAM_BLOCK_NEEDS_NO_RESERVATION << 30)) == 
0) {
+       if (amdgpu_sriov_vf(adev) &&
+           (drv_start_addr & (ATOM_VRAM_BLOCK_NEEDS_NO_RESERVATION << 30)) == 
+0) {
                /* driver request VRAM reservation for SR-IOV */
                adev->mman.drv_vram_usage_start_offset = (drv_start_addr &
                        (~ATOM_VRAM_OPERATION_FLAGS_MASK)) << 10;
--
2.25.1

<<attachment: winmail.dat>>

Reply via email to