Page MenuHomeFreeBSD

vt: add a vt_dummy driver
Needs ReviewPublic

Authored by corvink on Mar 27 2023, 10:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 30 2024, 8:16 AM
Unknown Object (File)
Jan 25 2024, 4:51 AM
Unknown Object (File)
Jan 4 2024, 4:45 PM
Unknown Object (File)
Jan 1 2024, 1:23 PM
Unknown Object (File)
Dec 20 2023, 4:53 AM
Unknown Object (File)
Dec 13 2023, 5:18 AM
Unknown Object (File)
Dec 9 2023, 4:42 PM
Unknown Object (File)
Dec 1 2023, 7:47 AM

Details

Summary

By default vt uses vt_efifb if no video driver is loaded. vt_efifb grabs
the EFI framebuffer and writes directly to it. When the graphics driver
is unloaded from the GPU, vt_efifb still writes to the EFI framebuffer.
If GPU passthrough for a bhyve VM is used, the guest uses the EFI
framebuffer too. When vt_efifb writes new data to the EFI framebuffer it
results in stripes on the guest display. This can be avoided by loading
this new vt_dummy driver that ignores all draw calls.

Note: As vt_dummy ignores all draw call, loading it will freeze the
display.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 50598
Build 47489: arc lint + arc unit

Event Timeline

corvink added a subscriber: guest-patmaddox.
  • remove obsolete __FBSDID

Unsure if this is the best approach so I have a few questions :

    • What happens if you kldload vt_dummy and then kldunload vt_dummy ? Do you get back efifb ?
  • Wouldn't setting FB_FLAG_NOWRITE somewhere in bhyve work too ? (We would need some vt function that will freeze/unfreeze the current vt)

Adding @dumbbell in case he have some ideas.

In D39283#894397, @manu wrote:

Unsure if this is the best approach so I have a few questions :

  • What happens if you kldload vt_dummy and then kldunload vt_dummy ? Do you get back efifb ?

Yes, it get's back to efifb without any issues.

  • Wouldn't setting FB_FLAG_NOWRITE somewhere in bhyve work too ? (We would need some vt function that will freeze/unfreeze the current vt)

Looks like setting FB_FLAG_NOWRITE could be sufficient. There's no interface to set it yet. I'm going to test it.

Yeah, I solved the same problem in drm initially by writing a dummy driver too, but now it's been replaced by FB_FLAG_NOWRITE.
This is how we're doing it, it's a bit annoying that we have to check the driver and reach into its softc, ideally flags like that would be a more outer-level thing somehow (?)

Yeah, I solved the same problem in drm initially by writing a dummy driver too, but now it's been replaced by FB_FLAG_NOWRITE.
This is how we're doing it, it's a bit annoying that we have to check the driver and reach into its softc, ideally flags like that would be a more outer-level thing somehow (?)

Yes we clearly need some api to freeze/unfreeze the current vt now that we have two use case. And also something for userland (and maybe hooked to vidcontrol somehow ?)

In D39283#895533, @manu wrote:

Yeah, I solved the same problem in drm initially by writing a dummy driver too, but now it's been replaced by FB_FLAG_NOWRITE.
This is how we're doing it, it's a bit annoying that we have to check the driver and reach into its softc, ideally flags like that would be a more outer-level thing somehow (?)

Yes we clearly need some api to freeze/unfreeze the current vt now that we have two use case. And also something for userland (and maybe hooked to vidcontrol somehow ?)

FYI: The userland part of bhyve will decide if vt should be freezed or not. So, it requires a userland api.