diff options
| author | Mario Limonciello <[email protected]> | 2023-09-25 12:57:47 -0500 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-09-26 17:00:23 -0400 |
| commit | 1ca965719b5bff60a7fcf489f38313ca237a7d77 (patch) | |
| tree | 01d1c28324943150c79b215ffc223fa6b923bc28 /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |
| parent | b2e1cbe6281feb880dbfbee47aa6defee4227cf0 (diff) | |
drm/amd/display: Change dc_set_power_state() to bool instead of int
DC code is reused by other OSes and so Linux return codes don't
make sense. Change dc_set_power_state() to boolean and add a wrapper
dm_set_power_state() to return a Linux error code for the memory
allocation failure.
Suggested-by: Harry Wentland <[email protected]>
Signed-off-by: Mario Limonciello <[email protected]>
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 3480a02af797..297a28843e3a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2638,6 +2638,11 @@ static void hpd_rx_irq_work_suspend(struct amdgpu_display_manager *dm) } } +static int dm_set_power_state(struct dc *dc, enum dc_acpi_cm_power_state power_state) +{ + return dc_set_power_state(dc, power_state) ? 0 : -ENOMEM; +} + static int dm_suspend(void *handle) { struct amdgpu_device *adev = handle; @@ -2671,7 +2676,7 @@ static int dm_suspend(void *handle) hpd_rx_irq_work_suspend(dm); - return dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D3); + return dm_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D3); } struct amdgpu_dm_connector * @@ -2865,7 +2870,7 @@ static int dm_resume(void *handle) if (r) DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r); - r = dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0); + r = dm_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0); if (r) return r; @@ -2917,7 +2922,7 @@ static int dm_resume(void *handle) } /* power on hardware */ - r = dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0); + r = dm_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0); if (r) return r; |