diff options
author | Chia-I Wu <[email protected]> | 2015-05-21 16:30:03 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2015-06-14 15:43:20 +0800 |
commit | 1885ac490834e70d831b5b4a287c272b4148761c (patch) | |
tree | ca048cac2b6e78f3df2289b78296eabb83051c66 /src/gallium/drivers/ilo/ilo_screen.c | |
parent | ab7229b9b6b160e805d14d600a432e76a5e88ef8 (diff) |
ilo: avoid resource owning in core
It is up to the users whether to reference count the BOs or not.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_screen.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_screen.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c index b0fed730512..80e01c7bd1d 100644 --- a/src/gallium/drivers/ilo/ilo_screen.c +++ b/src/gallium/drivers/ilo/ilo_screen.c @@ -31,7 +31,6 @@ #include "vl/vl_decoder.h" #include "vl/vl_video_buffer.h" #include "genhw/genhw.h" /* for GEN6_REG_TIMESTAMP */ -#include "core/ilo_fence.h" #include "core/ilo_format.h" #include "core/intel_winsys.h" @@ -43,8 +42,7 @@ struct pipe_fence_handle { struct pipe_reference reference; - - struct ilo_fence fence; + struct intel_bo *seqno_bo; }; static float @@ -642,7 +640,7 @@ ilo_screen_fence_reference(struct pipe_screen *screen, STATIC_ASSERT(&((struct pipe_fence_handle *) NULL)->reference == NULL); if (pipe_reference(&old->reference, &fence->reference)) { - ilo_fence_cleanup(&old->fence); + intel_bo_unref(old->seqno_bo); FREE(old); } } @@ -655,10 +653,14 @@ ilo_screen_fence_finish(struct pipe_screen *screen, const int64_t wait_timeout = (timeout > INT64_MAX) ? -1 : timeout; bool signaled; - signaled = ilo_fence_wait(&fence->fence, wait_timeout); + signaled = (!fence->seqno_bo || + intel_bo_wait(fence->seqno_bo, wait_timeout) == 0); + /* XXX not thread safe */ - if (signaled) - ilo_fence_set_seq_bo(&fence->fence, NULL); + if (signaled && fence->seqno_bo) { + intel_bo_unref(fence->seqno_bo); + fence->seqno_bo = NULL; + } return signaled; } @@ -677,7 +679,6 @@ ilo_screen_fence_signalled(struct pipe_screen *screen, struct pipe_fence_handle * ilo_screen_fence_create(struct pipe_screen *screen, struct intel_bo *bo) { - struct ilo_screen *is = ilo_screen(screen); struct pipe_fence_handle *fence; fence = CALLOC_STRUCT(pipe_fence_handle); @@ -686,8 +687,7 @@ ilo_screen_fence_create(struct pipe_screen *screen, struct intel_bo *bo) pipe_reference_init(&fence->reference, 1); - ilo_fence_init(&fence->fence, &is->dev); - ilo_fence_set_seq_bo(&fence->fence, bo); + fence->seqno_bo = intel_bo_ref(bo); return fence; } @@ -697,7 +697,7 @@ ilo_screen_destroy(struct pipe_screen *screen) { struct ilo_screen *is = ilo_screen(screen); - ilo_dev_cleanup(&is->dev); + intel_winsys_destroy(is->dev.winsys); FREE(is); } |