linux/drivers/gpu/drm/loongson
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
loongson_device.c
loongson_module.c
loongson_module.h
lsdc_benchmark.c
lsdc_benchmark.h
lsdc_crtc.c
lsdc_debugfs.c
lsdc_drv.c drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers 2023-09-21 10:41:04 -07:00
lsdc_drv.h
lsdc_gem.c
lsdc_gem.h
lsdc_gfxpll.c
lsdc_gfxpll.h
lsdc_i2c.c
lsdc_i2c.h
lsdc_irq.c
lsdc_irq.h
lsdc_output_7a1000.c
lsdc_output_7a2000.c
lsdc_output.h
lsdc_pixpll.c drm/loongson: Fix error handling in lsdc_pixel_pll_setup() 2023-08-12 09:58:07 +08:00
lsdc_pixpll.h
lsdc_plane.c
lsdc_probe.c
lsdc_probe.h
lsdc_regs.h
lsdc_ttm.c drm/loongson: Add a check for lsdc_bo_create() errors 2023-08-04 13:31:32 +08:00
lsdc_ttm.h
Makefile