Skip to contentSkip to conversation

drm/amdgpu: skip BAR resizing if the bios already did it

PATCH In review Alex Deucher 3 participants 3 messages Jun 8, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: skip BAR resizing if the bios already did it

No need to do it again.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -0
index 1df28b7bf22e..539010798116 100644
@@ -909,6 +909,11 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
 	if (amdgpu_sriov_vf(adev))
 		return 0;
 
+	/* 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))
+		return 0;
+
 	/* Check if the root BUS has 64bit memory resources */
 	root = adev->pdev->bus;
 	while (root->parent)
Signature · 6 lines
2.25.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

Am 08.06.20 um 21:41 schrieb Alex Deucher:

Quoted 3 lines

No need to do it again.

Quoted 10 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 1df28b7bf22e..539010798116 100644
@@ -909,6 +909,11 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
  	if (amdgpu_sriov_vf(adev))

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev) · line 919

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -0
  		return 0;
 
+	/* 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))
+		return 0;
+
  	/* Check if the root BUS has 64bit memory resources */
  	root = adev->pdev->bus;
  	while (root->parent)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Acked-by on v1 1/1
#2 lore raw
In reply to Alex Deucher

Am 2020-06-08 um 3:41 p.m. schrieb Alex Deucher:

Quoted 3 lines

No need to do it again.

Quoted 10 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 1df28b7bf22e..539010798116 100644
@@ -909,6 +909,11 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
 	if (amdgpu_sriov_vf(adev))

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev) · line 919

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -0
 		return 0;
 
+	/* 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))
+		return 0;
+
 	/* Check if the root BUS has 64bit memory resources */
 	root = adev->pdev->bus;
 	while (root->parent)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx