aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2023-11-29 18:34:48 +0000
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2023-11-29 18:54:14 +0000
commit40c20fc29cad4d38d9a565e9c7ba78612097308e (patch)
tree24e53132e20b0700d1decba5054f245925abb0c4
parentf54a3890b1f419d4a9edc99000efef52b9071b8f (diff)
downloadsrc-40c20fc29cad4d38d9a565e9c7ba78612097308e.tar.gz
src-40c20fc29cad4d38d9a565e9c7ba78612097308e.zip
vt(4): Call post-switch callback after replacing the backend
[Why] For instance, it gives a chance to the new backend to refresh the screen. This is needed by the vt_drmfb backend and `drm_fb_helper`. This change was lost when I posted changes to reviews.freebsd.org and it broken the amdgpu driver... Thanks to manu@ for reporting the problem and wulf@ to find out the missing change! Tested by: manu Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D42834
-rw-r--r--sys/dev/vt/vt_core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index d6268db3537b..92c83aee5967 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -3283,6 +3283,13 @@ vt_replace_backend(const struct vt_driver *drv, void *softc)
/* Update windows sizes and initialize last items. */
vt_upgrade(vd);
+ /*
+ * Give a chance to the new backend to run the post-switch code, for
+ * instance to refresh the screen.
+ */
+ if (vd->vd_driver->vd_postswitch)
+ vd->vd_driver->vd_postswitch(vd);
+
#ifdef DEV_SPLASH
if (vd->vd_flags & VDF_SPLASH)
vtterm_splash(vd);