mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 02:19:54 -04:00
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 <harry.wentland@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
b2e1cbe628
commit
1ca965719b
@@ -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;
|
||||
|
||||
|
||||
@@ -4723,7 +4723,7 @@ void dc_power_down_on_boot(struct dc *dc)
|
||||
dc->hwss.power_down_on_boot(dc);
|
||||
}
|
||||
|
||||
int dc_set_power_state(
|
||||
bool dc_set_power_state(
|
||||
struct dc *dc,
|
||||
enum dc_acpi_cm_power_state power_state)
|
||||
{
|
||||
@@ -4731,7 +4731,7 @@ int dc_set_power_state(
|
||||
struct display_mode_lib *dml;
|
||||
|
||||
if (!dc->current_state)
|
||||
return 0;
|
||||
return true;
|
||||
|
||||
switch (power_state) {
|
||||
case DC_ACPI_CM_POWER_STATE_D0:
|
||||
@@ -4758,7 +4758,7 @@ int dc_set_power_state(
|
||||
|
||||
ASSERT(dml);
|
||||
if (!dml)
|
||||
return -ENOMEM;
|
||||
return false;
|
||||
|
||||
/* Preserve refcount */
|
||||
refcount = dc->current_state->refcount;
|
||||
@@ -4777,7 +4777,7 @@ int dc_set_power_state(
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void dc_resume(struct dc *dc)
|
||||
|
||||
@@ -2283,7 +2283,7 @@ void dc_notify_vsync_int_state(struct dc *dc, struct dc_stream_state *stream, bo
|
||||
|
||||
/* Power Interfaces */
|
||||
|
||||
int dc_set_power_state(
|
||||
bool dc_set_power_state(
|
||||
struct dc *dc,
|
||||
enum dc_acpi_cm_power_state power_state);
|
||||
void dc_resume(struct dc *dc);
|
||||
|
||||
Reference in New Issue
Block a user