New Feature: Virtual display framework Date: Fri, 21 Feb 2014 12:18:39 +0530  |  Posted by: Anup Patel

Recently, we have added virtual display framework which will be available from Xvisor v0.2.4 onwards.

The main aim of virtual display framework is to have generic layer which enables daemons, libraries, commands, and other parts of Xvisor to:

  1. Get events for guest framebuffer operations (e.g. resize, copy rectangle, fill rectangle, etc.)
  2. Get location of guest framebuffer
  3. Get contents of guest framebuffer
  4. Get pixel format of guest framebuffer

The virtual display framework has two important entities namely vmm_vdisplay and vmm_surface. The display (or framebuffer) emulators will create vmm_vdisplay instance to emulate a virtual display for a guest insance. The display emulator will also use vmm_vdisplay_surface_xxx() APIs to give hints to vmm_surface instances about changes in virtual display. The GUI rendering daemons/libraries will create vmm_surface instance and add/bind it to a vmm_vdisplay instance. More than one GUI rendering daemons/libraries can add their vmm_surface instances to a single vmm_vdisplay instance.

To see virtual display framework in-action, use "e;vscreen hard_bind"e; or "e;vscreen soft_bind"e; commands for capturing guest screen on host framebuffer (or host video device). This commands use vscreen library which in-turn uses virtual input device framework, virtual display framework, framebuffer framework, and input device framework for capturing guest virtual screen on host framebuffer.

The vscreen library provides two mechanisms for capturing guest screen:

  1. Soft bind: We periodically read contents of guest framebuffer and draw them on host framebuffer. This mechanism of screen capturing will consume lot of CPU time for syncing/updating/redrawing guest screen on host framebuffer.
  2. Hard bind: We point our host framebuffer controller directly to guest framebuffer if the resolution and pixel format of guest framebuffer matches host framebuffer. This mechanism of screen capturing is faster and better than vscreen soft bind but requires a extra support from host framebuffer driver.