AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Check resize bar register when system uses large bar
@ 2023-12-19  5:58 Ma Jun
  2023-12-20 14:10 ` Christian König
  0 siblings, 1 reply; 10+ messages in thread
From: Ma Jun @ 2023-12-19  5:58 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Ma Jun, mario.limonciello

Print a warnning message if the system can't access
the resize bar register when using large bar.

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 4b694696930e..e7aedb4bd66e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1417,6 +1417,12 @@ void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb)
 		__clear_bit(wb, adev->wb.used);
 }
 
+static inline void amdgpu_find_rb_register(struct amdgpu_device *adev)
+{
+	if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_REBAR))
+		DRM_WARN("System can't access the resize bar register,please check!!\n");
+}
+
 /**
  * amdgpu_device_resize_fb_bar - try to resize FB BAR
  *
@@ -1444,8 +1450,10 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
 
 	/* skip if the bios has already enabled large BAR */
 	if (adev->gmc.real_vram_size &&
-	    (pci_resource_len(adev->pdev, 0) >= adev->gmc.real_vram_size))
+	    (pci_resource_len(adev->pdev, 0) >= adev->gmc.real_vram_size)) {
+		amdgpu_find_rb_register(adev);
 		return 0;
+	}
 
 	/* Check if the root BUS has 64bit memory resources */
 	root = adev->pdev->bus;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-01-09  9:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19  5:58 [PATCH] drm/amdgpu: Check resize bar register when system uses large bar Ma Jun
2023-12-20 14:10 ` Christian König
2023-12-21  1:58   ` Ma, Jun
2023-12-30  2:22     ` Mario Limonciello
2024-01-05 13:39     ` Christian König
2024-01-05 16:11       ` Alex Deucher
2024-01-08  9:25         ` Ma, Jun
2024-01-08  9:24       ` Ma, Jun
2024-01-08 16:24         ` Christian König
2024-01-09  9:44           ` Ma, Jun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox