[Mesa-dev] [RFC] [PATCH 0/3] gbm: Add support for mapping bos

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Tue Nov 5 08:32:55 PST 2013


Hi,

This is a request for comments on the idea of being able to map gbm
bos and how to implement it. The idea here is to take advantage of
UMA atchitectures when the contents on the screen are a mix of GPU
and CPU rendered.

One of the problems of adding a map entry point to gbm is the fact
that it relies on the DRI image extension to do all the work. Instead
of extending that extension, the proposal here is to support different
gbm backends, which may optionally support mapping. However, this
requires changes to the EGL implementation, since the current
implementation is heavily coupled with gbm's dri backend.

The one problem in doing that is that the dri driver and gbm device no
longer share the same fd, so another way of sharing buffers between
then is necessary. As a stop gap measure I added the ability for gbm to
provide gem names (given that dri 2's interface relies on names anyway),
but a better solution is needed.

This would also let the dependency between libgbm and libEGL to be moved
to gbm's dri backend, and open up the possibility of running a Wayland
compositor on KMS with a software renderer that would still be able to
use overlays. This ties with the fast start patches I submitted to the
wayland mailing list.

Still talking about Wayland, I have a rough plan on how to make this
usable with that too. Since gbm is already Wayland aware to some extent,
given that it is able to import wl_buffers into gbm_bos, it seems like
a natural extension that it would be able to do the converse. That
ability together with an entry point for creating a gbm_device for a
given wl_display would be enough for making this available for any
wayland client.

Any comments on this will be highly appreciated.

Thanks,
Ander


Ander Conselvan de Oliveira (3):
  gbm: Add intel backend
  egl/dri: Add gbm platform
  gbm: Add entry points for mapping and unmapping bos

 configure.ac                        |    5 +-
 src/egl/drivers/dri2/Makefile.am    |    5 +
 src/egl/drivers/dri2/egl_dri2.c     |    6 +
 src/egl/drivers/dri2/egl_dri2.h     |   11 +-
 src/egl/drivers/dri2/platform_gbm.c |  545 +++++++++++++++++++++++++++++++++++
 src/egl/main/Makefile.am            |    5 +
 src/egl/main/egldisplay.c           |    3 +-
 src/egl/main/egldisplay.h           |    1 +
 src/gbm/Makefile.am                 |   12 +
 src/gbm/backends/dri/gbm_dri.c      |   11 +
 src/gbm/backends/intel/gbm_intel.c  |  269 +++++++++++++++++
 src/gbm/backends/intel/gbm_intel.h  |   77 +++++
 src/gbm/main/backend.c              |    2 +
 src/gbm/main/common_drm.h           |    1 +
 src/gbm/main/gbm.c                  |   54 +++-
 src/gbm/main/gbm.h                  |   18 ++
 src/gbm/main/gbmint.h               |    5 +
 17 files changed, 1022 insertions(+), 8 deletions(-)
 create mode 100644 src/egl/drivers/dri2/platform_gbm.c
 create mode 100644 src/gbm/backends/intel/gbm_intel.c
 create mode 100644 src/gbm/backends/intel/gbm_intel.h

-- 
1.7.9.5



More information about the mesa-dev mailing list