From 194b8799d27cd61bbc6da4e3ed333de261c07407 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 6 Nov 2017 20:18:09 +0100 Subject: [PATCH] drm/arm/mali: Use drm_mode_config_helper_suspend/resume() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Replace driver's code with the generic helpers that do the same thing. Cc: Liviu Dudau Cc: Brian Starkey Signed-off-by: Noralf Trønnes Reviewed-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20171106191812.38927-4-noralf@tronnes.org --- drivers/gpu/drm/arm/malidp_drv.c | 24 +++--------------------- drivers/gpu/drm/arm/malidp_drv.h | 1 - 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index b8944666a18f..75f0bce33941 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "malidp_drv.h" @@ -749,34 +750,15 @@ static int malidp_platform_remove(struct platform_device *pdev) static int __maybe_unused malidp_pm_suspend(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); - struct malidp_drm *malidp = drm->dev_private; - - drm_kms_helper_poll_disable(drm); - console_lock(); - drm_fbdev_cma_set_suspend(malidp->fbdev, 1); - console_unlock(); - malidp->pm_state = drm_atomic_helper_suspend(drm); - if (IS_ERR(malidp->pm_state)) { - console_lock(); - drm_fbdev_cma_set_suspend(malidp->fbdev, 0); - console_unlock(); - drm_kms_helper_poll_enable(drm); - return PTR_ERR(malidp->pm_state); - } - return 0; + return drm_mode_config_helper_suspend(drm); } static int __maybe_unused malidp_pm_resume(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); - struct malidp_drm *malidp = drm->dev_private; - drm_atomic_helper_resume(drm, malidp->pm_state); - console_lock(); - drm_fbdev_cma_set_suspend(malidp->fbdev, 0); - console_unlock(); - drm_kms_helper_poll_enable(drm); + drm_mode_config_helper_resume(drm); return 0; } diff --git a/drivers/gpu/drm/arm/malidp_drv.h b/drivers/gpu/drm/arm/malidp_drv.h index 2e2033140efc..70ed6aeccf05 100644 --- a/drivers/gpu/drm/arm/malidp_drv.h +++ b/drivers/gpu/drm/arm/malidp_drv.h @@ -24,7 +24,6 @@ struct malidp_drm { struct drm_crtc crtc; wait_queue_head_t wq; atomic_t config_valid; - struct drm_atomic_state *pm_state; u32 core_id; }; -- 2.30.2