Skip to contentSkip to conversation

drm/amdgpu: drop scratch regs save and restore from S3/S4 handling

PATCH In review Alex Deucher 3 participants 5 messages Dec 12, 2017 – Dec 13, 2017 2 messages not in the archive

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

PATCH 1/3 drm/amdgpu: drop scratch regs save and restore from S3/S4 handling

The expectation is that the base driver doesn't mess with these. Some components interact with these directly so let the components handle these directly.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
index 98d62a991b67..ca1cf8a71dda 100644
@@ -2577,7 +2577,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
 	 */
 	amdgpu_bo_evict_vram(adev);
 
-	amdgpu_atombios_scratch_regs_save(adev);
 	pci_save_state(dev->pdev);
 	if (suspend) {
 		/* Shut down the device */
@@ -2626,7 +2625,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
 		if (r)
 			goto unlock;
 	}
-	amdgpu_atombios_scratch_regs_restore(adev);
 
 	/* post card */
 	if (amdgpu_need_post(adev)) {
Signature · 6 lines
2.13.6

_______________________________________________
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): 20171212202720.6954-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/3 drm/amdgpu: drop scratch regs save and restore from GPU reset handling

The expectation is that the base driver doesn't mess with these. Some components interact with these directly so let the components handle these directly.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
index ca1cf8a71dda..046b9d5bc14d 100644
@@ -2896,9 +2896,7 @@ static int amdgpu_reset(struct amdgpu_device *adev, uint64_t* reset_flags)
 		r = amdgpu_suspend(adev);
 
 retry:
-		amdgpu_atombios_scratch_regs_save(adev);
 		r = amdgpu_asic_reset(adev);
-		amdgpu_atombios_scratch_regs_restore(adev);
 		/* post card */
 		amdgpu_atom_asic_init(adev->mode_info.atom_context);
 
Signature · 6 lines
2.13.6

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

PATCH 3/3 drm/amdgpu: drop amdgpu_atombios_scratch_regs_save/restore

In reply to a message not in the archive

No longer used.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 22 ----------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.h |  2 --
 2 files changed, 24 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +0 -22
index 39f4d0df1ada..ffaf0534e33c 100644
@@ -1721,28 +1721,6 @@ void amdgpu_atombios_scratch_regs_init(struct amdgpu_device *adev)
 	WREG32(adev->bios_scratch_reg_offset + 6, bios_6_scratch);
 }
 
-void amdgpu_atombios_scratch_regs_save(struct amdgpu_device *adev)
-{
-	int i;
-
-	for (i = 0; i < AMDGPU_BIOS_NUM_SCRATCH; i++)
-		adev->bios_scratch[i] = RREG32(adev->bios_scratch_reg_offset + i);
-}
-
-void amdgpu_atombios_scratch_regs_restore(struct amdgpu_device *adev)
-{
-	int i;
-
-	/*
-	 * VBIOS will check ASIC_INIT_COMPLETE bit to decide if
-	 * execute ASIC_Init posting via driver
-	 */
-	adev->bios_scratch[7] &= ~ATOM_S7_ASIC_INIT_COMPLETE_MASK;
-
-	for (i = 0; i < AMDGPU_BIOS_NUM_SCRATCH; i++)
-		WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]);
-}
-
 void amdgpu_atombios_scratch_regs_engine_hung(struct amdgpu_device *adev,
 					      bool hung)
 {
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.h +0 -2
index b0d5d1d7fdba..58507f9ff856 100644
@@ -196,8 +196,6 @@ bool amdgpu_atombios_has_gpu_virtualization_table(struct amdgpu_device *adev);
 
 void amdgpu_atombios_scratch_regs_lock(struct amdgpu_device *adev, bool lock);
 void amdgpu_atombios_scratch_regs_init(struct amdgpu_device *adev);
-void amdgpu_atombios_scratch_regs_save(struct amdgpu_device *adev);
-void amdgpu_atombios_scratch_regs_restore(struct amdgpu_device *adev);
 void amdgpu_atombios_scratch_regs_engine_hung(struct amdgpu_device *adev,
 					      bool hung);
 bool amdgpu_atombios_scratch_need_asic_init(struct amdgpu_device *adev);
Signature · 6 lines
2.13.6

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw
In reply to a message not in the archive
Quoted 5 lines · Alex Deucher

The expectation is that the base driver doesn't mess with these. Some components interact with these directly so let the components handle these directly.

Series is Reviewed-by: Harry Wentland <[email protected]>

Harry

Quoted 18 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
index 98d62a991b67..ca1cf8a71dda 100644
@@ -2577,7 +2577,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
 	 */
 	amdgpu_bo_evict_vram(adev);
 
-	amdgpu_atombios_scratch_regs_save(adev);
 	pci_save_state(dev->pdev);
 	if (suspend) {
 		/* Shut down the device */

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) · line 2630

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
@@ -2626,7 +2625,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
 		if (r)
 			goto unlock;
 	}
-	amdgpu_atombios_scratch_regs_restore(adev);
 
 	/* post card */
 	if (amdgpu_need_post(adev)) {

_______________________________________________
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): b1504171-6807-235a-39f5-e3e3c595e8c4-5C7GfCeVMHo@public.gmane.org

#6 lore raw

Am 13.12.2017 um 00:52 schrieb Harry Wentland:

Quoted 7 lines · Alex Deucher
Quoted 5 lines

The expectation is that the base driver doesn't mess with these. Some components interact with these directly so let the components handle these directly.

Series is Reviewed-by: Harry Wentland <[email protected]>

Christian.

Quoted 25 lines

Harry

Quoted 22 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 --
  1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
index 98d62a991b67..ca1cf8a71dda 100644
@@ -2577,7 +2577,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)
  	 */
  	amdgpu_bo_evict_vram(adev);
 
-	amdgpu_atombios_scratch_regs_save(adev);
  	pci_save_state(dev->pdev);
  	if (suspend) {
  		/* Shut down the device */
@@ -2626,7 +2625,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
  		if (r)
  			goto unlock;
  	}
-	amdgpu_atombios_scratch_regs_restore(adev);
 
Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) · line 2630

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
  	/* post card */
  	if (amdgpu_need_post(adev)) {

_______________________________________________
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