1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/gpu/drm/sti
Douglas Anderson ce3d99c834 drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers
Based on grepping through the source code these drivers appear 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.

All of the drivers in this patch were fairly straightforward to fix
since they already had a call to drm_atomic_helper_shutdown() at
remove/unbind time but were just lacking one at system shutdown. The
only hitch is that some of these drivers use the component model to
register/unregister their DRM devices. The shutdown callback is part
of the original device. The typical solution here, based on how other
DRM drivers do this, is to keep track of whether the device is bound
based on drvdata. In most cases the drvdata is the drm_device, so we
can just make sure it is NULL when the device is not bound. In some
drivers, this required minor code changes. To make things simpler,
drm_atomic_helper_shutdown() has been modified to consider a NULL
drm_device as a noop in the patch ("drm/atomic-helper:
drm_atomic_helper_shutdown(NULL) should be a noop").

Suggested-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn>
Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.2.I9115e5d094a43e687978b0699cc1fe9f2a3452ea@changeid
2023-09-21 10:41:04 -07:00
..
Kconfig drm: Drop ARCH_MULTIPLATFORM from dependencies 2023-03-14 12:57:22 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
NOTES
sti_awg_utils.c drm/sti: drop use of drmP.h 2019-06-06 17:11:26 +02:00
sti_awg_utils.h drm/sti: drop use of drmP.h 2019-06-06 17:11:26 +02:00
sti_compositor.c drm/sti: Convert to platform remove callback returning void 2023-06-08 09:04:12 -07:00
sti_compositor.h drm/sti: remove use of drm_debugfs functions as return values 2020-03-18 16:24:08 +01:00
sti_crtc.c drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
sti_crtc.h drm/sti: Convert to CRTC VBLANK callbacks 2020-02-13 13:10:09 +01:00
sti_cursor.c drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
sti_cursor.h drm/sti: drop use of drmP.h 2019-06-06 17:11:26 +02:00
sti_drv.c drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers 2023-09-21 10:41:04 -07:00
sti_drv.h drm/sti: drop use of drmP.h 2019-06-06 17:11:26 +02:00
sti_dvo.c drm/sti: Convert to platform remove callback returning void 2023-06-08 09:04:12 -07:00
sti_gdp.c drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
sti_gdp.h drm/sti: drop use of drmP.h 2019-06-06 17:11:26 +02:00
sti_hda.c drm/sti: Convert to platform remove callback returning void 2023-06-08 09:04:12 -07:00
sti_hdmi.c drm/sti: Convert to platform remove callback returning void 2023-06-08 09:04:12 -07:00
sti_hdmi.h drm/sti/sti_hdmi: convert to using is_hdmi from display info 2023-05-02 18:48:58 +03:00
sti_hdmi_tx3g4c28phy.c drm/sti/sti_hdmi_tx3g4c28phy: Provide function names for kernel-doc headers 2021-06-03 13:29:11 +02:00
sti_hdmi_tx3g4c28phy.h gpu: drm: sti: Adopt SPDX identifiers 2017-12-06 15:51:23 +01:00
sti_hqvdp.c drm/sti: Convert to platform remove callback returning void 2023-06-08 09:04:12 -07:00
sti_hqvdp_lut.h gpu: drm: sti: Adopt SPDX identifiers 2017-12-06 15:51:23 +01:00
sti_mixer.c drm/sti: remove use of drm_debugfs functions as return values 2020-03-18 16:24:08 +01:00
sti_mixer.h drm/sti: remove use of drm_debugfs functions as return values 2020-03-18 16:24:08 +01:00
sti_plane.c drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
sti_plane.h drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
sti_tvout.c drm/sti: Convert to platform remove callback returning void 2023-06-08 09:04:12 -07:00
sti_vid.c drm/sti: remove use of drm_debugfs functions as return values 2020-03-18 16:24:08 +01:00
sti_vid.h drm/sti: remove use of drm_debugfs functions as return values 2020-03-18 16:24:08 +01:00
sti_vtg.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
sti_vtg.h drm/sti: drop use of drmP.h 2019-06-06 17:11:26 +02:00