Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/client: log: Implement struct drm_client_funcs.restore

Restore the log client's output when the DRM core invokes the restore
callback. Follow the existing behavior of fbdev emulation wrt. the
value of the force parameter.

If force is false, acquire the DRM master lock and reprogram the
display. This is the case when the user-space compositor exits and
the DRM core transfers the display back to the in-kernel client. This
also enables drm_log output during reboot and shutdown.

If force is true, reprogram without considering the master lock. This
overrides the current compositor and prints the log to the screen. In
case of system malfunction, users can enter SysRq+v to invoke the
emergency error reporting. See Documentation/admin-guide/sysrq.rst for
more information.

v2:
- s/exists/exits/ in second paragraph of commit description
- fix grammar in commit description

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patch.msgid.link/20251110154616.539328-4-tzimmermann@suse.de

+13
+13
drivers/gpu/drm/clients/drm_log.c
··· 315 315 drm_client_release(client); 316 316 } 317 317 318 + static int drm_log_client_restore(struct drm_client_dev *client, bool force) 319 + { 320 + int ret; 321 + 322 + if (force) 323 + ret = drm_client_modeset_commit_locked(client); 324 + else 325 + ret = drm_client_modeset_commit(client); 326 + 327 + return ret; 328 + } 329 + 318 330 static int drm_log_client_hotplug(struct drm_client_dev *client) 319 331 { 320 332 struct drm_log *dlog = client_to_drm_log(client); ··· 360 348 .owner = THIS_MODULE, 361 349 .free = drm_log_client_free, 362 350 .unregister = drm_log_client_unregister, 351 + .restore = drm_log_client_restore, 363 352 .hotplug = drm_log_client_hotplug, 364 353 .suspend = drm_log_client_suspend, 365 354 .resume = drm_log_client_resume,