winsys/radeon: fix a race condition between winsys_create and winsys_destroy
authorMarek Olšák <marek.olsak@amd.com>
Tue, 8 Apr 2014 22:26:32 +0000 (00:26 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 10 Apr 2014 18:50:17 +0000 (20:50 +0200)
commitac330d4130cb005c75972da2a701b674413456ba
treef917b9391e52cdd292221a35f83f7605ea3dd9f2
parent7c57b01564b987259ec3ce8ed24266290fa60e75
winsys/radeon: fix a race condition between winsys_create and winsys_destroy

This also hides the reference count from drivers.

v2: update the reference count while the mutex is locked in winsys_create

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
src/gallium/winsys/radeon/drm/radeon_winsys.h