[Mesa-dev] [PATCH RFC 0/2] GBM API extension to support fusing KMS and render devices

Lucas Stach l.stach at pengutronix.de
Fri Mar 4 13:49:14 UTC 2016


Hi all,

this is a first shot at trying to hash out an API to allow bootstrapping
an EGL context on top of split render/scanout DRM devices. It tries to make
things really easy for applications, while leaving them in full control over
swap/flip scheduling etc.

It adds 2 new API calls:

1. gbm_device_set_kms_provider()
   This is used to add a KMS device to the render GBM device.
2. gbm_bo_get_kms_bo()
   This should be used by applications to translate the buffer returned
   by gbm_surface_lock_front_buffer() into a buffer that can be used to
   construct DRM FBs.

The design requires a DRI2/Gallium driver to be present for the KMS
device, so we can construct a GBM device on top of it. This is then
coupled to the render GBM device. Some ASCII art to visualize it:

                                             EGLSurface
                                                 |
                                                 v
                                          gbm_surface_create
                                                 |
                                                 v
          ----------------------------gbm_device_set_kms_provider
          v                                      |
     GBM device                                  v
 (minimal gallium driver)                    GBM device
         |                                       |
         v                                       v
 ----------------------------------------------------------------------
     (imx-drm)                               (etnaviv)
    (tegra-drm)                              (nouveau)

While this currently does not do any negotiation about BO
width/height/stride/tiling constraints, it makes it clear that the single
place where this needs to happen is within GBM.

This API is really easy to use from an application POV (the patch to
convert the QT5.6 eglfs_kms backend to use this is less than 100LOC).
I have this running on top of a simple imx-drm gallium driver and etnaviv,
both of which are not upstream yet. I can provide git repos for those
components if necessary.

I hope that the Tegra guys can help to move things forward and would like
to hear from you if this design sounds sane to all of you.

Regards,
Lucas

Lucas Stach (2):
  GBM: add KMS provider interface
  GBM: use KMS device to allocate scanout and cursor BOs

 src/gbm/main/gbm.c    | 98 +++++++++++++++++++++++++++++++++++++++++++++++++--
 src/gbm/main/gbm.h    |  7 ++++
 src/gbm/main/gbmint.h |  6 ++++
 3 files changed, 108 insertions(+), 3 deletions(-)

-- 
2.7.0



More information about the mesa-dev mailing list