Skip to content

Commit 89755ee

Browse files
committed
drm/imx/dcss: Call drm_atomic_helper_shutdown() at shutdown time
Based on grepping through the source code this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart comes straight out of the kernel doc "driver instance overview" in drm_drv.c. Suggested-by: Maxime Ripard <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Tested-by: Laurentiu Palcu <[email protected]> Reviewed-by: Laurentiu Palcu <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20230921122641.RFT.v2.1.I134336fce7eac5a63bdac46d57b0888858fc8081@changeid
1 parent 330140d commit 89755ee

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

drivers/gpu/drm/imx/dcss/dcss-drv.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ static int dcss_drv_platform_remove(struct platform_device *pdev)
9292
return 0;
9393
}
9494

95+
static void dcss_drv_platform_shutdown(struct platform_device *pdev)
96+
{
97+
struct dcss_drv *mdrv = dev_get_drvdata(&pdev->dev);
98+
99+
dcss_kms_shutdown(mdrv->kms);
100+
}
101+
95102
static struct dcss_type_data dcss_types[] = {
96103
[DCSS_IMX8MQ] = {
97104
.name = "DCSS_IMX8MQ",
@@ -114,6 +121,7 @@ MODULE_DEVICE_TABLE(of, dcss_of_match);
114121
static struct platform_driver dcss_platform_driver = {
115122
.probe = dcss_drv_platform_probe,
116123
.remove = dcss_drv_platform_remove,
124+
.shutdown = dcss_drv_platform_shutdown,
117125
.driver = {
118126
.name = "imx-dcss",
119127
.of_match_table = dcss_of_match,

drivers/gpu/drm/imx/dcss/dcss-kms.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,10 @@ void dcss_kms_detach(struct dcss_kms_dev *kms)
172172
dcss_crtc_deinit(&kms->crtc, drm);
173173
drm->dev_private = NULL;
174174
}
175+
176+
void dcss_kms_shutdown(struct dcss_kms_dev *kms)
177+
{
178+
struct drm_device *drm = &kms->base;
179+
180+
drm_atomic_helper_shutdown(drm);
181+
}

drivers/gpu/drm/imx/dcss/dcss-kms.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct dcss_kms_dev {
3434

3535
struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss);
3636
void dcss_kms_detach(struct dcss_kms_dev *kms);
37+
void dcss_kms_shutdown(struct dcss_kms_dev *kms);
3738
int dcss_crtc_init(struct dcss_crtc *crtc, struct drm_device *drm);
3839
void dcss_crtc_deinit(struct dcss_crtc *crtc, struct drm_device *drm);
3940
struct dcss_plane *dcss_plane_init(struct drm_device *drm,

0 commit comments

Comments
 (0)