aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/drm/intel/gem/intel_be_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/drm/intel/gem/intel_be_device.c')
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_device.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.c b/src/gallium/winsys/drm/intel/gem/intel_be_device.c
index 2e191a6d126..de13fb39c7e 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_be_device.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.c
@@ -51,8 +51,7 @@ intel_be_buffer_unmap(struct pipe_winsys *winsys,
}
static void
-intel_be_buffer_destroy(struct pipe_winsys *winsys,
- struct pipe_buffer *buf)
+intel_be_buffer_destroy(struct pipe_buffer *buf)
{
drm_intel_bo_unreference(intel_bo(buf));
free(buf);
@@ -72,7 +71,7 @@ intel_be_buffer_create(struct pipe_winsys *winsys,
if (!buffer)
return NULL;
- buffer->base.refcount = 1;
+ pipe_reference_init(&buffer->base.reference, 1);
buffer->base.alignment = alignment;
buffer->base.usage = usage;
buffer->base.size = size;
@@ -115,7 +114,7 @@ intel_be_user_buffer_create(struct pipe_winsys *winsys, void *ptr, unsigned byte
if (!buffer)
return NULL;
- buffer->base.refcount = 1;
+ pipe_reference_init(&buffer->base.reference, 1);
buffer->base.alignment = 0;
buffer->base.usage = 0;
buffer->base.size = bytes;
@@ -155,7 +154,7 @@ intel_be_buffer_from_handle(struct pipe_screen *screen,
if (!buffer->bo)
goto err;
- buffer->base.refcount = 1;
+ pipe_reference_init(&buffer->base.reference, 1);
buffer->base.alignment = buffer->bo->align;
buffer->base.usage = PIPE_BUFFER_USAGE_GPU_READ |
PIPE_BUFFER_USAGE_GPU_WRITE |
@@ -215,15 +214,7 @@ intel_be_fence_refunref(struct pipe_winsys *sws,
struct intel_be_fence **p = (struct intel_be_fence **)ptr;
struct intel_be_fence *f = (struct intel_be_fence *)fence;
- assert(p);
-
- if (f)
- intel_be_fence_reference(f);
-
- if (*p)
- intel_be_fence_unreference(*p);
-
- *p = f;
+ intel_be_fence_reference(p, f);
}
static int