History

drm/fb-helper: Fix vt restore

In the past we had a pile of hacks to orchestrate access between fbdev emulation and native kms clients. We've tried to streamline this, by always preferring the kms side above fbdev calls when a drm master exists, because drm master controls access to the display resources. Unfortunately this breaks existing userspace, specifically Xorg. When exiting Xorg first restores the console to text mode using the KDSET ioctl on the vt. This does nothing, because a drm master is still around. Then it drops the drm master status, which again does nothing, because logind is keeping additional drm fd open to be able to orchestrate vt switches. In the past this is the point where fbdev was restored, as part of the ->lastclose hook on the drm side. Now to fix this regression we don't want to go back to letting fbdev restore things whenever it feels like, or to the pile of hacks we've had before. Instead try and go with a minimal exception to make the KDSET case work again, and nothing else. This means that if userspace does a KDSET call when switching between graphical compositors, there will be some flickering with fbcon showing up for a bit. But a) that's not a regression and b) userspace can fix it by improving the vt switching dance - logind should have all the information it needs. While pondering all this I'm also wondering wheter we should have a SWITCH_MASTER ioctl to allow race-free master status handover. But that's for another day. v2: Somehow forgot to cc all the fbdev people. v3: Fix typo Alex spotted.

Daniel Vetter committed 6 years ago

Commit dc5bdb61 parent 842ec613 files · +52 −15Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/fb.h+1−0
@@ -205,6 +205,7 @@ struct fb_bitfield { · 204 unmodified lines
205205 #define FB_ACTIVATE_ALL 64 /* change all VCs on this fb */
206206 #define FB_ACTIVATE_FORCE 128 /* force apply even when no change*/
207207 #define FB_ACTIVATE_INV_MODE 256 /* invalidate videomode */
208+#define FB_ACTIVATE_KD_TEXT 512 /* for KDSET vt ioctl */
208209
209210 #define FB_ACCELF_TEXT 1 /* (OBSOLETE) see fb_info.flags and vc_mode */
210211