Skip to contentSkip to conversation

drm/amdgpu/gmc10: remove dead code

PATCH In review Alex Deucher 3 participants 4 messages Jan 9, 2020

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

PATCH 1/2 drm/amdgpu/gmc10: remove dead code

Leftover from bring up. We look up the actual pre-OS memory usage value later in the same function.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0 -9
index 7dc8c068c62a..faa310b76b50 100644
@@ -736,15 +736,6 @@ static int gmc_v10_0_sw_init(void *handle)
 	 */
 	adev->gmc.mc_mask = 0xffffffffffffULL; /* 48 bit MC */
 
-	/*
-	 * Reserve 8M stolen memory for navi10 like vega10
-	 * TODO: will check if it's really needed on asic.
-	 */
-	if (amdgpu_emu_mode == 1)
-		adev->gmc.stolen_size = 0;
-	else
-		adev->gmc.stolen_size = 9 * 1024 *1024;
-
 	r = dma_set_mask_and_coherent(adev->dev, DMA_BIT_MASK(44));
 	if (r) {
 		printk(KERN_WARNING "amdgpu: No suitable DMA available.\n");
Signature · 6 lines
2.24.1

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

PATCH 2/2 drm/amdgpu/gmc10: free stolen memory in late_init

We don't need to store the pre-OS console memory after the driver has loaded so free it.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +2 -0
index faa310b76b50..5ad89bb6f3ba 100644
@@ -566,6 +566,8 @@ static int gmc_v10_0_late_init(void *handle)
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 	int r;
 
+	amdgpu_bo_late_init(adev);
+
 	r = amdgpu_gmc_allocate_vm_inv_eng(adev);
 	if (r)
 		return r;
Signature · 6 lines
2.24.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to Alex Deucher
Quoted 4 lines · Alex Deucher

Leftover from bring up. We look up the actual pre-OS memory usage value later in the same function.

Series are Reviewed-by: Huang Rui <[email protected]>

Quoted 31 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0 -9
index 7dc8c068c62a..faa310b76b50 100644
@@ -736,15 +736,6 @@ static int gmc_v10_0_sw_init(void *handle)
 	 */
 	adev->gmc.mc_mask = 0xffffffffffffULL; /* 48 bit MC */
 
-	/*
-	 * Reserve 8M stolen memory for navi10 like vega10
-	 * TODO: will check if it's really needed on asic.
-	 */
-	if (amdgpu_emu_mode == 1)
-		adev->gmc.stolen_size = 0;
-	else
-		adev->gmc.stolen_size = 9 * 1024 *1024;
-
 	r = dma_set_mask_and_coherent(adev->dev, DMA_BIT_MASK(44));
 	if (r) {
 		printk(KERN_WARNING "amdgpu: No suitable DMA available.\n");
Signature · 6 lines
2.24.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cray.huang%40amd.com%7Cfcadbf4647914b13864b08d794b24878%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637141365794342902&amp;sdata=NLyK5M3lt7wTTYi3qKerRge46seP7DEi06vjCOOeo3Q%3D&amp;reserved=0

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

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

Am 09.01.20 um 04:16 schrieb Alex Deucher:

Quoted 4 lines

Leftover from bring up. We look up the actual pre-OS memory usage value later in the same function.

Quoted 14 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 9 ---------
  1 file changed, 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0 -2
index 7dc8c068c62a..faa310b76b50 100644
@@ -736,15 +736,6 @@ static int gmc_v10_0_sw_init(void *handle)
  	 */
  	adev->gmc.mc_mask = 0xffffffffffffULL; /* 48 bit MC */
 
-	/*
-	 * Reserve 8M stolen memory for navi10 like vega10

drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c static int gmc_v10_0_sw_init(void *handle) · line 741

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0 -7
-	 * TODO: will check if it's really needed on asic.
-	 */
-	if (amdgpu_emu_mode == 1)
-		adev->gmc.stolen_size = 0;
-	else
-		adev->gmc.stolen_size = 9 * 1024 *1024;
-
  	r = dma_set_mask_and_coherent(adev->dev, DMA_BIT_MASK(44));
  	if (r) {
  		printk(KERN_WARNING "amdgpu: No suitable DMA available.\n");

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