[PATCH] drm/amdgpu: skip vram reserve on firmware_v2_2 for bare-metal
Xu, Feifei
Feifei.Xu at amd.com
Wed Nov 23 10:16:55 UTC 2022
[AMD Official Use Only - General]
Reviewed-by: Feifei Xu <Feifei.Xu at amd.com>
-----Original Message-----
From: Gao, Likun <Likun.Gao at amd.com>
Sent: Wednesday, November 23, 2022 6:01 PM
To: amd-gfx list <amd-gfx at lists.freedesktop.org>
Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Xu, Feifei <Feifei.Xu at 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.Gao at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 17526 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20221123/4393b555/attachment-0001.bin>
More information about the amd-gfx
mailing list