Skip to contentSkip to conversation

drm/amdgpu: fix AGP location with VRAM at 0x0

PATCH In review Christian König 3 participants 4 messages Oct 4, 2018 – Oct 9, 2018 1 message not in the archive

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

PATCH 1/1 drm/amdgpu: fix AGP location with VRAM at 0x0

That also simplifies handling quite a bit.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +2 -5
index 9a5b252784a1..999e15945355 100644
@@ -200,16 +200,13 @@ void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
 	}
 
 	if (size_bf > size_af) {
-		mc->agp_start = mc->fb_start > mc->gart_start ?
-			mc->gart_end + 1 : 0;
+		mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask;
 		mc->agp_size = size_bf;
 	} else {
-		mc->agp_start = (mc->fb_start > mc->gart_start ?
-			mc->fb_end : mc->gart_end) + 1,
+		mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb);
 		mc->agp_size = size_af;
 	}
 
-	mc->agp_start = ALIGN(mc->agp_start, sixteen_gb);
 	mc->agp_end = mc->agp_start + mc->agp_size - 1;
 	dev_info(adev->dev, "AGP: %lluM 0x%016llX - 0x%016llX\n",
 			mc->agp_size >> 20, mc->agp_start, mc->agp_end);
Signature · 6 lines
2.14.1

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

A message that is not in the archive (sent off-list or not yet received): 20181004090210.1904-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Ping, can anybody review this?

Am 04.10.2018 um 11:02 schrieb Christian König:

Quoted 20 lines

That also simplifies handling quite a bit.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -2
index 9a5b252784a1..999e15945355 100644
@@ -200,16 +200,13 @@ void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
  	}
 
  	if (size_bf > size_af) {
-		mc->agp_start = mc->fb_start > mc->gart_start ?
-			mc->gart_end + 1 : 0;
+		mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask;
  		mc->agp_size = size_bf;
  	} else {

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) · line 212

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -3
-		mc->agp_start = (mc->fb_start > mc->gart_start ?
-			mc->fb_end : mc->gart_end) + 1,
+		mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb);
  		mc->agp_size = size_af;
  	}
 
-	mc->agp_start = ALIGN(mc->agp_start, sixteen_gb);
  	mc->agp_end = mc->agp_start + mc->agp_size - 1;
  	dev_info(adev->dev, "AGP: %lluM 0x%016llX - 0x%016llX\n",
  			mc->agp_size >> 20, mc->agp_start, mc->agp_end);

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

Reviewed-by Junwei Zhang
#3 lore raw
In reply to a message not in the archive
Quoted 3 lines · Christian König

That also simplifies handling quite a bit.

Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -2
index 9a5b252784a1..999e15945355 100644
@@ -200,16 +200,13 @@ void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
  	}
 
  	if (size_bf > size_af) {
-		mc->agp_start = mc->fb_start > mc->gart_start ?
-			mc->gart_end + 1 : 0;
+		mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask;
  		mc->agp_size = size_bf;
  	} else {

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc) · line 212

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -3
-		mc->agp_start = (mc->fb_start > mc->gart_start ?
-			mc->fb_end : mc->gart_end) + 1,
+		mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb);
  		mc->agp_size = size_af;
  	}
 
-	mc->agp_start = ALIGN(mc->agp_start, sixteen_gb);
  	mc->agp_end = mc->agp_start + mc->agp_size - 1;
  	dev_info(adev->dev, "AGP: %lluM 0x%016llX - 0x%016llX\n",
  			mc->agp_size >> 20, mc->agp_start, mc->agp_end);

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

Reviewed-by
#4 lore raw
In reply to a message not in the archive
Quoted 3 lines · Christian König

That also simplifies handling quite a bit.

Quoted 34 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +2 -5
index 9a5b252784a1..999e15945355 100644
@@ -200,16 +200,13 @@ void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
 	}
 
 	if (size_bf > size_af) {
-		mc->agp_start = mc->fb_start > mc->gart_start ?
-			mc->gart_end + 1 : 0;
+		mc->agp_start = (mc->fb_start - size_bf) & sixteen_gb_mask;
 		mc->agp_size = size_bf;
 	} else {
-		mc->agp_start = (mc->fb_start > mc->gart_start ?
-			mc->fb_end : mc->gart_end) + 1,
+		mc->agp_start = ALIGN(mc->fb_end + 1, sixteen_gb);
 		mc->agp_size = size_af;
 	}
 
-	mc->agp_start = ALIGN(mc->agp_start, sixteen_gb);
 	mc->agp_end = mc->agp_start + mc->agp_size - 1;
 	dev_info(adev->dev, "AGP: %lluM 0x%016llX - 0x%016llX\n",
 			mc->agp_size >> 20, mc->agp_start, mc->agp_end);
Signature · 6 lines
2.14.1

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

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