Skip to content

Commit

Permalink
vt(4): Call post-switch callback after replacing the backend
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
dumbbell committed Nov 29, 2023
1 parent f54a389 commit 40c20fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sys/dev/vt/vt_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 40c20fc

Please sign in to comment.