Skip to contentSkip to conversation

drm/amdgpu: fix dm_suspend/resume arguments to ip_block

PATCH In review Sunil Khatri 3 participants 3 messages Oct 8, 2024

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

PATCH 1/1 drm/amdgpu: fix dm_suspend/resume arguments to ip_block

"build failure after merge of the amdgpu tree" dm_suspend/dm_resume functions argument mismatch not caught in validation as it was under config CONFIG_DEBUG_KERNEL_DC which wasnt enabled by default.

Change argument from adev to ip_block.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -2
index e4511f2fb929..6d5b899941af 100644
@@ -5201,15 +5201,20 @@ static ssize_t s3_debug_store(struct device *device,
 	int s3_state;
 	struct drm_device *drm_dev = dev_get_drvdata(device);
 	struct amdgpu_device *adev = drm_to_adev(drm_dev);
+	struct amdgpu_ip_block *ip_block;
+
+	ip_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE);
+	if (!ip_block)
+		return -EINVAL;
 
 	ret = kstrtoint(buf, 0, &s3_state);
 
 	if (ret == 0) {
 		if (s3_state) {
-			dm_resume(adev);
+			dm_resume(ip_block);
 			drm_kms_helper_hotplug_event(adev_to_drm(adev));
 		} else
-			dm_suspend(adev);
+			dm_suspend(ip_block);
 	}
 
 	return ret == 0 ? count : 0;
Signature · 1 line
2.34.1
maintainer Acked-by on v1 1/1
#1 lore raw

Am 08.10.24 um 05:59 schrieb Sunil Khatri:

Quoted 9 lines

"build failure after merge of the amdgpu tree" dm_suspend/dm_resume functions argument mismatch not caught in validation as it was under config CONFIG_DEBUG_KERNEL_DC which wasnt enabled by default.

Change argument from adev to ip_block.

Quoted 31 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -2
index e4511f2fb929..6d5b899941af 100644
@@ -5201,15 +5201,20 @@ static ssize_t s3_debug_store(struct device *device,
  	int s3_state;
  	struct drm_device *drm_dev = dev_get_drvdata(device);
  	struct amdgpu_device *adev = drm_to_adev(drm_dev);
+	struct amdgpu_ip_block *ip_block;
+
+	ip_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE);
+	if (!ip_block)
+		return -EINVAL;
 
  	ret = kstrtoint(buf, 0, &s3_state);
 
  	if (ret == 0) {
  		if (s3_state) {
-			dm_resume(adev);
+			dm_resume(ip_block);
  			drm_kms_helper_hotplug_event(adev_to_drm(adev));
  		} else
-			dm_suspend(adev);
+			dm_suspend(ip_block);
  	}
 
  	return ret == 0 ? count : 0;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Sunil Khatri
Quoted 10 lines · Sunil Khatri

"build failure after merge of the amdgpu tree" dm_suspend/dm_resume functions argument mismatch not caught in validation as it was under config CONFIG_DEBUG_KERNEL_DC which wasnt enabled by default.

Change argument from adev to ip_block.

Please add:

Fixes 982d7f9bfe4a ("drm/amdgpu: update the handle ptr in suspend")
Fixes 7feb4f3ad8be ("drm/amdgpu: update the handle ptr in resume")
Quoted 34 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -3
index e4511f2fb929..6d5b899941af 100644
@@ -5201,15 +5201,20 @@ static ssize_t s3_debug_store(struct device *device,
        int s3_state;
        struct drm_device *drm_dev = dev_get_drvdata(device);
        struct amdgpu_device *adev = drm_to_adev(drm_dev);
+       struct amdgpu_ip_block *ip_block;
+
+       ip_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE);
+       if (!ip_block)
+               return -EINVAL;
 
        ret = kstrtoint(buf, 0, &s3_state);
 
        if (ret == 0) {
                if (s3_state) {
-                       dm_resume(adev);
+                       dm_resume(ip_block);
                        drm_kms_helper_hotplug_event(adev_to_drm(adev));
                } else
-                       dm_suspend(adev);
+                       dm_suspend(ip_block);
        }
 
        return ret == 0 ? count : 0;
--

2.34.1