Skip to contentSkip to conversation

drm/amdgpu: use runpm flag rather than fbcon for kfd runtime suspend (v2)

PATCH In review Alex Deucher 4 participants 4 messages Feb 4, 2021 – Feb 5, 2021

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

PATCH 2/3 drm/amdgpu: use runpm flag rather than fbcon for kfd runtime suspend (v2)

the flag used by kfd is not actually related to fbcon, it just happens to align. Use the runpm flag instead so that we can decouple it from the fbcon flag.

v2: fix resume as well

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index 0ee6514ee55c..b7ebd424bbc7 100644
@@ -3734,7 +3734,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
 	r = amdgpu_device_ip_suspend_phase1(adev);
 
-	amdgpu_amdkfd_suspend(adev, !fbcon);
+	amdgpu_amdkfd_suspend(adev, adev->in_runpm);
 
 	/* evict vram memory */
 	amdgpu_bo_evict_vram(adev);
@@ -3818,7 +3818,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
 			}
 		}
 	}
-	r = amdgpu_amdkfd_resume(adev, !fbcon);
+	r = amdgpu_amdkfd_resume(adev, adev->in_runpm);
 	if (r)
 		return r;
 
Signature · 6 lines
2.29.2

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

[AMD Official Use Only - Internal Distribution Only]

If it's part of adev, does it need an arg? Can't kfd check it directly?

Thanks,
Lijo
________________________________
From: amd-gfx <[email protected]> on behalf of Alex Deucher <[email protected]>
Sent: Friday, February 5, 2021 1:34:50 AM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 2/3] drm/amdgpu: use runpm flag rather than fbcon for kfd runtime suspend (v2)

the flag used by kfd is not actually related to fbcon, it just happens to align. Use the runpm flag instead so that we can decouple it from the fbcon flag.

v2: fix resume as well

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index 0ee6514ee55c..b7ebd424bbc7 100644
@@ -3734,7 +3734,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
         r = amdgpu_device_ip_suspend_phase1(adev);
 
-       amdgpu_amdkfd_suspend(adev, !fbcon);
+       amdgpu_amdkfd_suspend(adev, adev->in_runpm);
 
         /* evict vram memory */
         amdgpu_bo_evict_vram(adev);
@@ -3818,7 +3818,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
                         }
                 }
         }
-       r = amdgpu_amdkfd_resume(adev, !fbcon);
+       r = amdgpu_amdkfd_resume(adev, adev->in_runpm);
         if (r)
                 return r;
 

--
2.29.2

_______________________________________________
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=04%7C01%7Clijo.lazar%40amd.com%7C9c0a731196964976779a08d8c9482859%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637480659051377089%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=HZniciTDOipp%2FQvNqdbKUERQUSciId5HmhQYviQfxaw%3D&amp;reserved=0

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

Reviewed-by
#2 lore raw

Am 2021-02-04 um 9:20 p.m. schrieb Lazar, Lijo:

Quoted 8 lines

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

If it's part of adev, does it need an arg? Can't kfd check it directly?

We could. Actually amdgpu_amdkfd_suspend/resume are just a set of wrapper functions before calling into KFD. That would be the perfect place to check the adev->run_pm flag.

Either way, this patch is

Regards,
  Felix

Quoted 47 lines

Thanks,
Lijo
------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Alex Deucher <[email protected]>
*Sent:* Friday, February 5, 2021 1:34:50 AM
*To:* [email protected] <[email protected]> *Cc:* Deucher, Alexander <[email protected]> *Subject:* [PATCH 2/3] drm/amdgpu: use runpm flag rather than fbcon for kfd runtime suspend (v2)

the flag used by kfd is not actually related to fbcon, it just happens to align.  Use the runpm flag instead so that we can decouple it from the fbcon flag.

v2: fix resume as well

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 0ee6514ee55c..b7ebd424bbc7 100644
@@ -3734,7 +3734,7 @@ int amdgpu_device_suspend(struct drm_device
 *dev, bool fbcon)


         r = amdgpu_device_ip_suspend_phase1(adev);
-       amdgpu_amdkfd_suspend(adev, !fbcon); +       amdgpu_amdkfd_suspend(adev, adev->in_runpm);
         /* evict vram memory */ amdgpu_bo_evict_vram(adev);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -3818,7 +3818,7 @@ int amdgpu_device_resume(struct drm_device *dev,
 bool fbcon)
                          }
                  }
          }
-       r = amdgpu_amdkfd_resume(adev, !fbcon);
+       r = amdgpu_amdkfd_resume(adev, adev->in_runpm);
          if (r)
                  return r;
Quoted 13 lines

Signature · 11 lines
2.29.2

_______________________________________________
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

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

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

[AMD Public Use]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, February 4, 2021 3:05 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 2/3] drm/amdgpu: use runpm flag rather than fbcon for kfd runtime suspend (v2)

[CAUTION: External Email]

the flag used by kfd is not actually related to fbcon, it just happens to align. Use the runpm flag instead so that we can decouple it from the fbcon flag.

v2: fix resume as well

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index 0ee6514ee55c..b7ebd424bbc7 100644
@@ -3734,7 +3734,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
        r = amdgpu_device_ip_suspend_phase1(adev);
 
-       amdgpu_amdkfd_suspend(adev, !fbcon);
+       amdgpu_amdkfd_suspend(adev, adev->in_runpm);
 
        /* evict vram memory */
        amdgpu_bo_evict_vram(adev);
@@ -3818,7 +3818,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
                        }
                }
        }
-       r = amdgpu_amdkfd_resume(adev, !fbcon);
+       r = amdgpu_amdkfd_resume(adev, adev->in_runpm);
        if (r)
                return r;
 

--
2.29.2

_______________________________________________
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=04%7C01%7Crajneesh.bhardwaj%40amd.com%7C9c0a731196964976779a08d8c9482859%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637480659048145725%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=SYs%2FSx9iZmQemW3IcKm7z3Kv5QQQVwjOA7b5idtxE%2Fk%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx