summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_screen.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2015-03-06 02:03:10 +0800
committerChia-I Wu <[email protected]>2015-03-06 02:25:03 +0800
commit4ddd981e407f9e97fcbb862c241f1ce165616fd4 (patch)
tree5127116d96ae302939b00c7ad718796899fc95c1 /src/gallium/drivers/ilo/ilo_screen.c
parent70ef171e91582f60a010a4f0ea9f7ff5ba971ab4 (diff)
ilo: add more convenient intel_bo_{ref,unref}()
They both check for NULL and intel_bo_ref() returns the referenced bo. They replace intel_bo_{reference,unreference}().
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_screen.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_screen.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c
index c9577c8be41..bf0a84a44eb 100644
--- a/src/gallium/drivers/ilo/ilo_screen.c
+++ b/src/gallium/drivers/ilo/ilo_screen.c
@@ -600,15 +600,13 @@ ilo_fence_reference(struct pipe_screen *screen,
if (likely(p)) {
old = ilo_fence(*p);
*p = f;
- }
- else {
+ } else {
old = NULL;
}
STATIC_ASSERT(&((struct ilo_fence *) NULL)->reference == NULL);
if (pipe_reference(&old->reference, &fence->reference)) {
- if (old->bo)
- intel_bo_unreference(old->bo);
+ intel_bo_unref(old->bo);
FREE(old);
}
}
@@ -621,7 +619,7 @@ ilo_fence_signalled(struct pipe_screen *screen,
/* mark signalled if the bo is idle */
if (fence->bo && !intel_bo_is_busy(fence->bo)) {
- intel_bo_unreference(fence->bo);
+ intel_bo_unref(fence->bo);
fence->bo = NULL;
}
@@ -645,7 +643,7 @@ ilo_fence_finish(struct pipe_screen *screen,
return false;
/* mark signalled */
- intel_bo_unreference(fence->bo);
+ intel_bo_unref(fence->bo);
fence->bo = NULL;
return true;
@@ -666,9 +664,7 @@ ilo_fence_create(struct pipe_screen *screen, struct intel_bo *bo)
pipe_reference_init(&fence->reference, 1);
- if (bo)
- intel_bo_reference(bo);
- fence->bo = bo;
+ fence->bo = intel_bo_ref(bo);
return fence;
}