Another version of common pipe_screen reference counting. Please help test on AMD and Nouveau as those are the more complicated ones and I don't have h/w to test.
Changes in v4: - Move fd dup() back into driver winsys create screen functions which sometimes need the dup'ed fd before the pipe_screen is created. - Update vmwgfx driver which I missed updating in v3 - Update vc4 commit msg to reflect this is a new feature. 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 virgl: use common screen ref counting vc4: 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/target-helpers/drm_helper.h | 2 +- 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/drivers/svga/svga_public.h | 2 +- src/gallium/drivers/svga/svga_screen.c | 5 +- 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/targets/pipe-loader/pipe_vmwgfx.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 | 98 ++---------------- .../winsys/nouveau/drm/nouveau_drm_winsys.c | 69 +------------ src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 80 ++------------- src/gallium/winsys/svga/drm/vmw_screen.c | 54 ++-------- src/gallium/winsys/svga/drm/vmw_screen.h | 6 -- src/gallium/winsys/vc4/drm/vc4_drm_winsys.c | 11 +- src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 88 ++-------------- 40 files changed, 236 insertions(+), 468 deletions(-) create mode 100644 src/gallium/auxiliary/util/u_screen.c create mode 100644 src/gallium/auxiliary/util/u_screen.h -- 2.9.2 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev