Skip to content

Commit cc2c954

Browse files
committed
drm: renesas: shmobile: Use suspend/resume helpers
Replace the custom suspend/resume handling by calls into drm_mode_config_helper_{suspend,resume}(). Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/a52147ca6033e0a59675f37f0326c7404fc5919c.1694767209.git.geert+renesas@glider.be
1 parent e3c8898 commit cc2c954

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -287,19 +287,6 @@ static void shmob_drm_crtc_stop(struct shmob_drm_crtc *scrtc)
287287
scrtc->started = false;
288288
}
289289

290-
void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc)
291-
{
292-
shmob_drm_crtc_stop(scrtc);
293-
}
294-
295-
void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc)
296-
{
297-
if (scrtc->dpms != DRM_MODE_DPMS_ON)
298-
return;
299-
300-
shmob_drm_crtc_start(scrtc);
301-
}
302-
303290
static inline struct shmob_drm_crtc *to_shmob_crtc(struct drm_crtc *crtc)
304291
{
305292
return container_of(crtc, struct shmob_drm_crtc, base);

drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ struct shmob_drm_connector {
4040

4141
int shmob_drm_crtc_create(struct shmob_drm_device *sdev);
4242
void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc);
43-
void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc);
44-
void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc);
4543

4644
int shmob_drm_encoder_create(struct shmob_drm_device *sdev);
4745
int shmob_drm_connector_create(struct shmob_drm_device *sdev,

drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <drm/drm_drv.h>
2121
#include <drm/drm_fbdev_generic.h>
2222
#include <drm/drm_gem_dma_helper.h>
23+
#include <drm/drm_modeset_helper.h>
2324
#include <drm/drm_module.h>
2425
#include <drm/drm_probe_helper.h>
2526
#include <drm/drm_vblank.h>
@@ -115,22 +116,14 @@ static int shmob_drm_pm_suspend(struct device *dev)
115116
{
116117
struct shmob_drm_device *sdev = dev_get_drvdata(dev);
117118

118-
drm_kms_helper_poll_disable(&sdev->ddev);
119-
shmob_drm_crtc_suspend(&sdev->crtc);
120-
121-
return 0;
119+
return drm_mode_config_helper_suspend(&sdev->ddev);
122120
}
123121

124122
static int shmob_drm_pm_resume(struct device *dev)
125123
{
126124
struct shmob_drm_device *sdev = dev_get_drvdata(dev);
127125

128-
drm_modeset_lock_all(&sdev->ddev);
129-
shmob_drm_crtc_resume(&sdev->crtc);
130-
drm_modeset_unlock_all(&sdev->ddev);
131-
132-
drm_kms_helper_poll_enable(&sdev->ddev);
133-
return 0;
126+
return drm_mode_config_helper_resume(&sdev->ddev);
134127
}
135128

136129
static int shmob_drm_pm_runtime_suspend(struct device *dev)

0 commit comments

Comments
 (0)