mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 08:15:07 -04:00
drm/xe/display: relocate the xe_display_pm_runtime_*() functions
Keep the xe_display_pm_runtime_*() functions together, in suspend/suspend_late/resume order. Also relocate the dependent d3cold functions near usage in the runtime pm functions. Reviewed-by: Michał Grzelak <michal.grzelak@intel.com> Link: https://patch.msgid.link/3e7de41c1a27ef250eb9c35c4858120bc9846301.1780389001.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -310,53 +310,6 @@ static bool suspend_to_idle(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void xe_display_enable_d3cold(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
|
||||
if (!xe->info.probe_display)
|
||||
return;
|
||||
|
||||
/*
|
||||
* We do a lot of poking in a lot of registers, make sure they work
|
||||
* properly.
|
||||
*/
|
||||
intel_display_power_disable(display);
|
||||
|
||||
intel_display_flush_cleanup_work(display);
|
||||
|
||||
intel_opregion_suspend(display, PCI_D3cold);
|
||||
|
||||
intel_dmc_suspend(display);
|
||||
|
||||
if (intel_display_device_present(display))
|
||||
intel_hpd_poll_enable(display);
|
||||
}
|
||||
|
||||
static void xe_display_disable_d3cold(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
|
||||
if (!xe->info.probe_display)
|
||||
return;
|
||||
|
||||
intel_dmc_resume(display);
|
||||
|
||||
if (intel_display_device_present(display))
|
||||
drm_mode_config_reset(&xe->drm);
|
||||
|
||||
intel_display_driver_init_hw(display);
|
||||
|
||||
intel_hpd_init(display);
|
||||
|
||||
if (intel_display_device_present(display))
|
||||
intel_hpd_poll_disable(display);
|
||||
|
||||
intel_opregion_resume(display);
|
||||
|
||||
intel_display_power_enable(display);
|
||||
}
|
||||
|
||||
void xe_display_pm_suspend(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
@@ -392,21 +345,6 @@ void xe_display_pm_suspend(struct xe_device *xe)
|
||||
intel_dmc_suspend(display);
|
||||
}
|
||||
|
||||
void xe_display_pm_runtime_suspend(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
|
||||
if (!xe->info.probe_display)
|
||||
return;
|
||||
|
||||
if (xe->d3cold.allowed) {
|
||||
xe_display_enable_d3cold(xe);
|
||||
return;
|
||||
}
|
||||
|
||||
intel_hpd_poll_enable(display);
|
||||
}
|
||||
|
||||
void xe_display_pm_suspend_late(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
@@ -418,24 +356,6 @@ void xe_display_pm_suspend_late(struct xe_device *xe)
|
||||
intel_display_power_suspend_late(display, s2idle);
|
||||
}
|
||||
|
||||
void xe_display_pm_runtime_suspend_late(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
|
||||
if (!xe->info.probe_display)
|
||||
return;
|
||||
|
||||
if (xe->d3cold.allowed)
|
||||
xe_display_pm_suspend_late(xe);
|
||||
|
||||
/*
|
||||
* If xe_display_pm_suspend_late() is not called, it is likely
|
||||
* that we will be on dynamic DC states with DMC wakelock enabled. We
|
||||
* need to flush the release work in that case.
|
||||
*/
|
||||
intel_dmc_wl_flush_release_work(display);
|
||||
}
|
||||
|
||||
void xe_display_pm_resume_early(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
@@ -483,6 +403,86 @@ void xe_display_pm_resume(struct xe_device *xe)
|
||||
intel_display_power_enable(display);
|
||||
}
|
||||
|
||||
static void xe_display_enable_d3cold(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
|
||||
if (!xe->info.probe_display)
|
||||
return;
|
||||
|
||||
/*
|
||||
* We do a lot of poking in a lot of registers, make sure they work
|
||||
* properly.
|
||||
*/
|
||||
intel_display_power_disable(display);
|
||||
|
||||
intel_display_flush_cleanup_work(display);
|
||||
|
||||
intel_opregion_suspend(display, PCI_D3cold);
|
||||
|
||||
intel_dmc_suspend(display);
|
||||
|
||||
if (intel_display_device_present(display))
|
||||
intel_hpd_poll_enable(display);
|
||||
}
|
||||
|
||||
static void xe_display_disable_d3cold(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
|
||||
if (!xe->info.probe_display)
|
||||
return;
|
||||
|
||||
intel_dmc_resume(display);
|
||||
|
||||
if (intel_display_device_present(display))
|
||||
drm_mode_config_reset(&xe->drm);
|
||||
|
||||
intel_display_driver_init_hw(display);
|
||||
|
||||
intel_hpd_init(display);
|
||||
|
||||
if (intel_display_device_present(display))
|
||||
intel_hpd_poll_disable(display);
|
||||
|
||||
intel_opregion_resume(display);
|
||||
|
||||
intel_display_power_enable(display);
|
||||
}
|
||||
|
||||
void xe_display_pm_runtime_suspend(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
|
||||
if (!xe->info.probe_display)
|
||||
return;
|
||||
|
||||
if (xe->d3cold.allowed) {
|
||||
xe_display_enable_d3cold(xe);
|
||||
return;
|
||||
}
|
||||
|
||||
intel_hpd_poll_enable(display);
|
||||
}
|
||||
|
||||
void xe_display_pm_runtime_suspend_late(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
|
||||
if (!xe->info.probe_display)
|
||||
return;
|
||||
|
||||
if (xe->d3cold.allowed)
|
||||
xe_display_pm_suspend_late(xe);
|
||||
|
||||
/*
|
||||
* If xe_display_pm_suspend_late() is not called, it is likely
|
||||
* that we will be on dynamic DC states with DMC wakelock enabled. We
|
||||
* need to flush the release work in that case.
|
||||
*/
|
||||
intel_dmc_wl_flush_release_work(display);
|
||||
}
|
||||
|
||||
void xe_display_pm_runtime_resume(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = xe->display;
|
||||
|
||||
Reference in New Issue
Block a user