DRM

From Spice

Contents

DRM

Summary

DRM (Direct Rendering Manager) driver for Linux.

Owner

  • Alon Levy

Current Status

Description

DRM driver for linux. Provides kernel mode setting (KMS), switch to qxl native mode from loading (instead of at X), follow up with rewriting of X driver to use it to allocate memory. Deallocation will still happen in the Kernel driver.


Steps

DRM driver standalone

  • fb operations: single allocator carving up space for command+palette+image+chunk. optimize later
  • single bo for ioctl allocated memory. use radeon scheme? 16 buffers corresponding to drawing buffers which are pixmaps.
  • allocator: ttm
  • fb mode image cache
    • currently don't cache anything.
    • can take the cache implementation from xf86-video-qxl (it's actually already there, just disabled).
  • applications that have to work before next stage - anything using fb:
    • regular console:
    • plymouth
    • X with modesetting driver
    • X with qxl driver

dumb ioctl

  • work with xf86-video-modesetting
  • by implementing the three dumb callbacks:
    • .dumb_create = radeon_mode_dumb_create,
      • DRM_IOCTL_MODE_CREATE_DUMB
    • .dumb_map_offset = radeon_mode_dumb_mmap,
      • drm_mode_mmap_dumb_ioctl / DRM_IOCTL_MODE_MAP_DUMB
    • .dumb_destroy = radeon_mode_dumb_destroy,
      • DRM_IOCTL_MODE_DESTROY_DUMB

ioctl design

ioctl implementation

X driver

Some graphics to show I know how to use asciio

C - changed N - new

         .------------------.
         |       App        |
         |                  |
         |   .--------.     |
         |   | libX11 |     |
         |   '--------'     |
         '--------|---------'
                  v
     .-------------------------.
     |          Xorg           |
     |                         |
     | .CCCCCCCCCCCCCCCCCCCCC. |
     | |     qxl_drv.so      | |
     | | changes: use libdrm | |
     | '---------------------' |
     |                         |
     |    .NNNNNNNNNNNNNNN.    |
     |    |  libdrm_qxl   |    |
     |    '---------------'    |
     '------------|------------'
                  |
                  v
    .---------------------------.
    |          kernel           |
    |                           |
    |    .NNNNNNNNNNNNNNN.      |
    |    |    qxl.ko     |      |
    |    '---------------'      |
    '------------|--------------'
                 |
                 v
     .-----------------------.
     |         qemu          |
     |                       |
     |  .------------------. |
     |  .       qxl        . |
     |  '------------------' |
     |            |          |
     '------------|----------'
                  |
                  v
       .---------------------.
       |       server        |
       |                     |
       '---------------------'