[Mesa-dev] [RFC 0/7] Common pipe screen ref counting

Rob Herring robh at kernel.org
Fri Jun 17 17:45:29 UTC 2016


I needed to add screen ref counting to vc4 driver, so rather than yet 
another copy of the same fd hashing and ref counting code, I implemented 
it in the pipe-loader. AFAICT, the pipe-loader is the only place the 
winsys create screen functions are called and seemed to be the best 
location to put this. The tricky part is the destroy path and not 
freeing the screen before reference counting. I think I found all the 
callers of pipe_screen->destroy.

This is tested on virgl and freedreno on Android and radeon is build 
tested only.

Rob

Rob Herring (7):
  gallium: move pipe_screen destroy into pipe-loader
  pipe-loader-drm: Add common pipe_screen refcounting
  Revert "virgl: reuse screen when fd is already open"
  Revert "virgl: mark function as static"
  nouveau: remove screen ref counting
  freedreno: remove screen ref counting
  radeon: remove screen ref counting

 src/gallium/auxiliary/pipe-loader/pipe_loader.h    |  1 +
 .../auxiliary/pipe-loader/pipe_loader_drm.c        | 71 ++++++++++++++++-
 src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c |  6 ++
 src/gallium/auxiliary/target-helpers/drm_helper.h  |  7 +-
 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.h       |  2 -
 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/drivers/virgl/virgl_screen.c           |  1 -
 src/gallium/drivers/virgl/virgl_screen.h           |  6 --
 src/gallium/include/pipe/p_screen.h                |  1 +
 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      | 66 +---------------
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h      |  1 -
 .../winsys/freedreno/drm/freedreno_drm_winsys.c    | 89 +---------------------
 .../winsys/nouveau/drm/nouveau_drm_winsys.c        | 84 +-------------------
 src/gallium/winsys/radeon/drm/radeon_drm_winsys.c  | 80 +------------------
 src/gallium/winsys/virgl/drm/virgl_drm_public.h    |  4 +-
 src/gallium/winsys/virgl/drm/virgl_drm_winsys.c    | 89 +---------------------
 30 files changed, 95 insertions(+), 462 deletions(-)

-- 
2.7.4



More information about the mesa-dev mailing list