1549N/A--- intel/intel_bufmgr_gem.c Fri Feb 20 06:27:47 2015
1549N/A+++ intel/intel_bufmgr_gem.c Fri Feb 20 07:00:16 2015
1549N/A@@ -93,7 +93,7 @@
1549N/A typedef struct _drm_intel_bufmgr_gem {
1549N/A drm_intel_bufmgr bufmgr;
1549N/A
1549N/A- atomic_t refcount;
1549N/A+ int refcount;
1549N/A
1549N/A int fd;
1549N/A
1549N/A@@ -147,7 +147,7 @@
1089N/A struct _drm_intel_bo_gem {
1089N/A drm_intel_bo bo;
1089N/A
1089N/A- atomic_t refcount;
1089N/A+ int refcount;
1089N/A uint32_t gem_handle;
1089N/A const char *name;
1089N/A
1549N/A@@ -416,7 +416,7 @@
1089N/A {
1089N/A drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
1089N/A
1089N/A- atomic_inc(&bo_gem->refcount);
1549N/A+ bo_gem->refcount++;
1089N/A }
1089N/A
1089N/A /**
1549N/A@@ -772,7 +772,7 @@
1089N/A }
1089N/A
1089N/A bo_gem->name = name;
1089N/A- atomic_set(&bo_gem->refcount, 1);
1089N/A+ bo_gem->refcount = 1;
1089N/A bo_gem->validate_index = -1;
1089N/A bo_gem->reloc_tree_fences = 0;
1549N/A bo_gem->used_as_reloc_target = false;
1549N/A@@ -919,7 +919,7 @@
1549N/A DRMINITLISTHEAD(&bo_gem->vma_list);
1549N/A
1549N/A bo_gem->name = name;
1549N/A- atomic_set(&bo_gem->refcount, 1);
1549N/A+ bo_gem->refcount = 1;
1549N/A bo_gem->validate_index = -1;
1549N/A bo_gem->reloc_tree_fences = 0;
1549N/A bo_gem->used_as_reloc_target = false;
1549N/A@@ -1010,7 +1010,7 @@
1089N/A bo_gem->bo.virtual = NULL;
1089N/A bo_gem->bo.bufmgr = bufmgr;
1089N/A bo_gem->name = name;
1089N/A- atomic_set(&bo_gem->refcount, 1);
1089N/A+ bo_gem->refcount = 1;
1089N/A bo_gem->validate_index = -1;
1089N/A bo_gem->gem_handle = open_arg.handle;
1549N/A bo_gem->bo.handle = open_arg.handle;
1549N/A@@ -1239,8 +1239,8 @@
1089N/A {
1089N/A drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
1089N/A
1089N/A- assert(atomic_read(&bo_gem->refcount) > 0);
1089N/A- if (atomic_dec_and_test(&bo_gem->refcount))
1089N/A+ assert(bo_gem->refcount > 0);
1089N/A+ if (--bo_gem->refcount == 0)
1089N/A drm_intel_gem_bo_unreference_final(bo, time);
1089N/A }
1089N/A
1549N/A@@ -1248,7 +1248,7 @@
1089N/A {
1089N/A drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
1089N/A
1089N/A- assert(atomic_read(&bo_gem->refcount) > 0);
1089N/A+ assert(bo_gem->refcount > 0);
1549N/A
1549N/A if (atomic_add_unless(&bo_gem->refcount, -1, 1)) {
1089N/A drm_intel_bufmgr_gem *bufmgr_gem =
1549N/A@@ -1259,7 +1259,7 @@
1549N/A
1549N/A pthread_mutex_lock(&bufmgr_gem->lock);
1549N/A
1549N/A- if (atomic_dec_and_test(&bo_gem->refcount)) {
1549N/A+ if (--bo_gem->refcount == 0) {
1549N/A drm_intel_gem_bo_unreference_final(bo, time.tv_sec);
1549N/A drm_intel_gem_cleanup_bo_cache(bufmgr_gem, time.tv_sec);
1549N/A }
1549N/A@@ -2683,7 +2683,7 @@
1333N/A
1333N/A bo_gem->gem_handle = handle;
1333N/A
1333N/A- atomic_set(&bo_gem->refcount, 1);
1333N/A+ bo_gem->refcount = 1;
1333N/A
1333N/A bo_gem->name = "prime";
1333N/A bo_gem->validate_index = -1;
1549N/A@@ -3346,7 +3346,7 @@
1549N/A
1549N/A DRMLISTFOREACHENTRY(bufmgr_gem, &bufmgr_list, managers) {
1549N/A if (bufmgr_gem->fd == fd) {
1549N/A- atomic_inc(&bufmgr_gem->refcount);
1549N/A+ bufmgr_gem->refcount++;
1549N/A return bufmgr_gem;
1549N/A }
1549N/A }
1549N/A@@ -3362,7 +3362,7 @@
1549N/A if (atomic_add_unless(&bufmgr_gem->refcount, -1, 1)) {
1549N/A pthread_mutex_lock(&bufmgr_list_mutex);
1549N/A
1549N/A- if (atomic_dec_and_test(&bufmgr_gem->refcount)) {
1549N/A+ if (--bufmgr_gem->refcount == 0) {
1549N/A DRMLISTDEL(&bufmgr_gem->managers);
1549N/A drm_intel_bufmgr_gem_destroy(bufmgr);
1549N/A }
1549N/A@@ -3443,7 +3443,7 @@
1549N/A goto exit;
1549N/A
1549N/A bufmgr_gem->fd = fd;
1549N/A- atomic_set(&bufmgr_gem->refcount, 1);
1549N/A+ bufmgr_gem->refcount = 1;
1549N/A
1549N/A if (pthread_mutex_init(&bufmgr_gem->lock, NULL) != 0) {
1549N/A free(bufmgr_gem);