drm: Improve integration with syscons. Move taskqueue handling to syscons.
commitba409a882dc5e1cc866af08fb776472b17c11826
authorImre Vadász <imre@vdsz.com>
Sun, 20 Nov 2016 21:01:40 +0000 (20 22:01 +0100)
committerImre Vadász <imre@vdsz.com>
Mon, 28 Nov 2016 00:08:05 +0000 (28 01:08 +0100)
treebcbd77eb82c47234f1332c8fd58f423d73b2779f
parent88af68e6fba1f28152ca994c2e2530c4490b2a8d
drm: Improve integration with syscons. Move taskqueue handling to syscons.

* Adds asynctd_lk to syscons' softc to synchronize unregister_framebuffer
  code with the asynchronous screen refresh threads.

* Use a generation counter in syscons to check if sc_update_render() needs
  to update the VT resolution/mode. Remove struct fb_info *fbi pointer
  from scr_stat, and always check the struct fb_info *fbi pointer in the
  softc struct instead.

* Use videio_in_progress flag to make initial fb_set_par call a bit safer.

* Moves driver callbacks from struct fb_info itself into struct fb_ops,
  and adds fb_blank and fb_debug_enter callbacks which will be wired up
  in future commits.

* Add unregister_framebuffer() function to syscons, which is needed for
  cleanly detaching a drm graphics driver which is used as framebuffer
  console. The screen will turn off, blank or display a frozen screen,
  after the graphics driver has detached.

* Use drm_fb_helper_unregister_framebuffer() and drm_fb_helper_release_fbi()
  functions in radeon and i915, which are needed for cleanly detaching the
  drivers.

* With radeonkms detaching and re-attaching is working very reliably
  on an AMD G-T44R APU (i.e. HD6250 graphics).

* Detaching i915 on a Haswell notebook barely worked with several errors,
  and trying to re-attach i915 caused the machine to hang.
sys/dev/drm/drm_fb_helper.c
sys/dev/drm/drm_modeset_lock.c
sys/dev/drm/i915/intel_fbdev.c
sys/dev/drm/include/drm/drm_fb_helper.h
sys/dev/drm/radeon/radeon_fb.c
sys/dev/misc/syscons/scvidctl.c
sys/dev/misc/syscons/syscons.c
sys/dev/misc/syscons/syscons.h
sys/platform/pc64/include/framebuffer.h
sys/platform/pc64/x86_64/machdep.c