[Mesa-dev] [PATCH v3 00/11] Common pipe screen ref counting

Rob Herring robh at kernel.org
Wed Jul 20 22:25:01 UTC 2016


Another version of common pipe_screen reference counting.

Changes in v3:
- dup() fd and store in pipe_screen as the lifetime of the 
pipe_loader_drm_device and pipe_screen are different.
- Fix leaking of pipe_loader_drm_device. Only the last one closed was 
getting freed.
- Move mutex for fd hash table into u_screen.c

Rob

Rob Herring (11):
  gallium: move pipe_screen destroy into pipe-loader
  pipe-loader-drm: protect create_screen() calls with a mutex
  gallium: add common pipe_screen reference counting functions
  pipe-loader-drm: use pipe_screen_unreference to destroy screen
  nouveau: use common screen ref counting
  freedreno: use common screen ref counting
  amdgpu: use common screen ref counting
  radeon: use common screen ref counting
  vmwgfx: use common screen ref counting
  vc4: use common screen ref counting
  virgl: use common screen ref counting

 src/gallium/auxiliary/Makefile.sources             |   2 +
 src/gallium/auxiliary/pipe-loader/pipe_loader.h    |   1 +
 .../auxiliary/pipe-loader/pipe_loader_drm.c        |  15 ++-
 src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c |   6 ++
 src/gallium/auxiliary/util/u_screen.c              | 114 +++++++++++++++++++++
 src/gallium/auxiliary/util/u_screen.h              |  32 ++++++
 src/gallium/auxiliary/vl/vl_winsys_dri.c           |   1 -
 src/gallium/auxiliary/vl/vl_winsys_dri3.c          |   1 -
 src/gallium/auxiliary/vl/vl_winsys_drm.c           |   1 -
 src/gallium/drivers/freedreno/freedreno_screen.c   |   1 -
 src/gallium/drivers/freedreno/freedreno_screen.h   |  10 --
 src/gallium/drivers/nouveau/nouveau_screen.c       |   6 --
 src/gallium/drivers/nouveau/nouveau_screen.h       |   4 -
 src/gallium/drivers/nouveau/nv30/nv30_screen.c     |   3 -
 src/gallium/drivers/nouveau/nv50/nv50_screen.c     |   3 -
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c     |   3 -
 src/gallium/drivers/r300/r300_screen.c             |   3 -
 src/gallium/drivers/r600/r600_pipe.c               |   6 --
 src/gallium/drivers/radeon/radeon_winsys.h         |   8 --
 src/gallium/drivers/radeonsi/si_pipe.c             |   6 --
 src/gallium/include/pipe/p_screen.h                |   3 +
 src/gallium/state_trackers/clover/core/device.cpp  |   4 +-
 src/gallium/state_trackers/dri/dri_screen.c        |   3 -
 src/gallium/state_trackers/xa/xa_tracker.c         |   2 -
 src/gallium/tests/trivial/compute.c                |   1 -
 src/gallium/tests/trivial/quad-tex.c               |   1 -
 src/gallium/tests/trivial/tri.c                    |   1 -
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c      |  45 ++------
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h      |   1 -
 .../winsys/freedreno/drm/freedreno_drm_winsys.c    |  94 ++---------------
 .../winsys/nouveau/drm/nouveau_drm_winsys.c        |  89 ++--------------
 src/gallium/winsys/radeon/drm/radeon_drm_winsys.c  |  84 ++-------------
 src/gallium/winsys/svga/drm/vmw_screen.c           |  51 ++-------
 src/gallium/winsys/svga/drm/vmw_screen.h           |   6 --
 src/gallium/winsys/vc4/drm/vc4_drm_winsys.c        |   9 +-
 src/gallium/winsys/virgl/drm/virgl_drm_winsys.c    |  86 ++--------------
 36 files changed, 221 insertions(+), 485 deletions(-)
 create mode 100644 src/gallium/auxiliary/util/u_screen.c
 create mode 100644 src/gallium/auxiliary/util/u_screen.h

-- 
2.9.2



More information about the mesa-dev mailing list