[Mesa-dev] [PATCH 0/2] code de-duplication and non-pci support

Rob Clark robdclark at gmail.com
Sat Dec 14 11:28:31 PST 2013


From: Rob Clark <robclark at freedesktop.org>

It seems that over time, code related to finding driver name, dealing
with pci-id table, etc, has been copy/pasted everywhere it was needed.
Which is lame.  And annoying if you have a device which is not pci.

This patchset refactors it out into a simple loader util lib which is
statically linked wherever it is needed.  Perhaps there is some room
for sharing other util bits (like _eglLog, perhaps) later.

And once all this code is collected in one place, the 2nd patch only
has to fix one place to add support for platform devices ;-)

Rob Clark (2):
  loader: refactor duplicated code into loader util lib
  loader: fallback to drmGetVersion() for non-pci devices

 configure.ac                                       |   1 +
 include/pci_ids/pci_id_driver_map.h                |  29 ++-
 src/Makefile.am                                    |   2 +-
 src/egl/drivers/dri2/Makefile.am                   |   5 +-
 src/egl/drivers/dri2/common.c                      | 144 -----------
 src/egl/drivers/dri2/egl_dri2.h                    |   5 -
 src/egl/drivers/dri2/platform_android.c            | 105 +-------
 src/egl/drivers/dri2/platform_drm.c                |   5 +-
 src/egl/drivers/dri2/platform_wayland.c            |   5 +-
 src/gallium/auxiliary/pipe-loader/Makefile.am      |   4 +
 src/gallium/auxiliary/pipe-loader/pipe_loader.h    |   1 +
 .../auxiliary/pipe-loader/pipe_loader_drm.c        |  92 +------
 src/gallium/state_trackers/clover/core/device.cpp  |   2 +
 src/gallium/targets/egl-static/Makefile.am         |   2 +
 src/gallium/targets/egl-static/egl.c               | 186 +-------------
 src/gbm/Makefile.am                                |  10 +-
 src/gbm/backends/dri/driver_name.c                 |  89 -------
 src/gbm/backends/dri/gbm_dri.c                     |   3 +-
 src/gbm/backends/dri/gbm_driint.h                  |   3 -
 src/glx/dri3_common.c                              | 146 -----------
 src/glx/dri3_glx.c                                 |   3 +-
 src/glx/dri3_priv.h                                |   3 -
 src/loader/Makefile.am                             |  37 +++
 src/loader/loader.c                                | 276 +++++++++++++++++++++
 src/loader/loader.h                                |  57 +++++
 25 files changed, 442 insertions(+), 773 deletions(-)
 delete mode 100644 src/egl/drivers/dri2/common.c
 delete mode 100644 src/gbm/backends/dri/driver_name.c
 delete mode 100644 src/glx/dri3_common.c
 create mode 100644 src/loader/Makefile.am
 create mode 100644 src/loader/loader.c
 create mode 100644 src/loader/loader.h

-- 
1.8.4.2



More information about the mesa-dev mailing list