DRM's fbdev emulation has long supported SysRq+v to bring up the framebuffer console for emergency output. Wire up sysrq for all DRM clients and make it work with drm_log.
Patch 1 and 2 set up DRM client functionality for sysrq. The patches adopt existing conventions from fbdev emulation, so that there's no visible change to users. Invoke SysRq+v to bring up the in-kernel DRM client. Patch 3 adds restore functionality to drm_log. This enables SysRq, but also brings back drm_log when the user-space releases control of the display. Tested on amdgpu and bochs. Thomas Zimmermann (3): drm/client: Pass force parameter to client restore drm/client: Support emergency restore via sysrq for all clients drm/client: log: Implement struct drm_client_funcs.restore drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/clients/drm_fbdev_client.c | 6 +- drivers/gpu/drm/clients/drm_log.c | 13 ++++ drivers/gpu/drm/drm_client.c | 1 + drivers/gpu/drm/drm_client_event.c | 4 +- drivers/gpu/drm/drm_client_sysrq.c | 65 ++++++++++++++++++++ drivers/gpu/drm/drm_drv.c | 3 + drivers/gpu/drm/drm_fb_helper.c | 69 +++------------------- drivers/gpu/drm/drm_file.c | 2 +- drivers/gpu/drm/drm_internal.h | 11 ++++ include/drm/drm_client.h | 8 ++- include/drm/drm_client_event.h | 4 +- include/drm/drm_device.h | 8 +++ include/drm/drm_fb_helper.h | 8 +-- 14 files changed, 126 insertions(+), 79 deletions(-) create mode 100644 drivers/gpu/drm/drm_client_sysrq.c -- 2.51.1
