search for: nouveau_fence_ref

Displaying 20 results from an estimated 37 matches for "nouveau_fence_ref".

2014 Mar 06
2
[PATCH] nouveau: fix fence waiting logic in screen destroy
...ruct pipe_screen *pscreen) if (!nouveau_drm_screen_unref(&screen->base)) return; - if (screen->base.fence.current && - screen->base.fence.current->state >= NOUVEAU_FENCE_STATE_EMITTED) { - nouveau_fence_wait(screen->base.fence.current); - nouveau_fence_ref (NULL, &screen->base.fence.current); + if (screen->base.fence.current) { + struct nouveau_fence *current = NULL; + + /* nouveau_fence_wait will create a new current fence, so wait on the + * _current_ one, and remove both. + */ + nouveau_fence_ref(screen->b...
2014 Mar 07
0
[PATCH] nouveau: fix fence waiting logic in screen destroy
...if (!nouveau_drm_screen_unref(&screen->base)) > return; > > - if (screen->base.fence.current && > - screen->base.fence.current->state >= NOUVEAU_FENCE_STATE_EMITTED) { > - nouveau_fence_wait(screen->base.fence.current); > - nouveau_fence_ref (NULL, &screen->base.fence.current); > + if (screen->base.fence.current) { > + struct nouveau_fence *current = NULL; > + > + /* nouveau_fence_wait will create a new current fence, so wait on the > + * _current_ one, and remove both. > + */ > +...
2014 Jun 17
0
[PATCH try 2 2/2] gallium/nouveau: move pushbuf and fences to context
.../gallium/drivers/nouveau/nouveau_buffer.c +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c @@ -217,8 +217,8 @@ nouveau_transfer_write(struct nouveau_context *nv, struct nouveau_transfer *tx, else nv->push_data(nv, buf->bo, buf->offset + base, buf->domain, size, data); - nouveau_fence_ref(nv->screen->fence.current, &buf->fence); - nouveau_fence_ref(nv->screen->fence.current, &buf->fence_wr); + nouveau_fence_ref(nv->fence.current, &buf->fence); + nouveau_fence_ref(nv->fence.current, &buf->fence_wr); } /* Does a CPU wait for the...
2014 Jun 17
2
[PATCH try 2 1/2] gallium/nouveau: decouple nouveau_fence implementation from screen
...;fence.head; fence; fence = next) { + for (fence = mgr->head; fence; fence = next) { next = fence->next; sequence = fence->sequence; @@ -153,12 +153,12 @@ nouveau_fence_update(struct nouveau_screen *screen, boolean flushed) nouveau_fence_trigger_work(fence); nouveau_fence_ref(NULL, &fence); - if (sequence == screen->fence.sequence_ack) + if (sequence == mgr->sequence_ack) break; } - screen->fence.head = next; + mgr->head = next; if (!next) - screen->fence.tail = NULL; + mgr->tail = NULL; if (flushed...
2014 Jun 21
3
[Mesa-dev] [PATCH try 2 2/2] gallium/nouveau: move pushbuf and fences to context
...veau_buffer.c > +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c > @@ -217,8 +217,8 @@ nouveau_transfer_write(struct nouveau_context *nv, struct nouveau_transfer *tx, > else > nv->push_data(nv, buf->bo, buf->offset + base, buf->domain, size, data); > > - nouveau_fence_ref(nv->screen->fence.current, &buf->fence); > - nouveau_fence_ref(nv->screen->fence.current, &buf->fence_wr); > + nouveau_fence_ref(nv->fence.current, &buf->fence); > + nouveau_fence_ref(nv->fence.current, &buf->fence_wr); > } > >...
2014 Jun 16
2
[PATCH 1/2] gallium/nouveau: decouple nouveau_fence implementation from screen
...e.head; fence; fence = next) { + for (fence = mgr->head; fence; fence = next) { next = fence->next; sequence = fence->sequence; @@ -153,12 +153,12 @@ nouveau_fence_update(struct nouveau_screen *screen, boolean flushed) nouveau_fence_trigger_work(fence); nouveau_fence_ref(NULL, &fence); - if (sequence == screen->fence.sequence_ack) + if (sequence == mgr->sequence_ack) break; } - screen->fence.head = next; + mgr->head = next; if (!next) - screen->fence.tail = NULL; + mgr->tail = NULL; if (f...
2014 May 27
1
[PATCH V3] nvc0: implement clear_buffer
...+ PUSH_DATAh(push, buf->address + offset); + PUSH_DATA (push, buf->address + offset); + + BEGIN_NVC0(push, NVC0_3D(RT_HORIZ(0)), 2); + PUSH_DATA (push, width * data_size); + PUSH_DATA (push, height); + + IMMED_NVC0(push, NVC0_3D(CLEAR_BUFFERS), 0x3c); + } + + nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence); + nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence_wr); + nvc0->dirty |= NVC0_NEW_FRAMEBUFFER; +} + +static void nvc0_clear_depth_stencil(struct pipe_context *pipe, struct pipe...
2014 May 26
1
[PATCH V2] nvc0: implement clear_buffer
...h, buf->address + offset); + PUSH_DATA (push, buf->address + offset); + + BEGIN_NVC0(push, NVC0_3D(RT_HORIZ(0)), 2); + PUSH_DATA (push, width * data_size); + PUSH_DATA (push, height); + + IMMED_NVC0(push, NVC0_3D(CLEAR_BUFFERS), 0x3c); + } + + nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence); + nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence_wr); + } + + nvc0->dirty |= NVC0_NEW_FRAMEBUFFER; +} + +static void nvc0_clear_depth_stencil(struct pipe_context *pipe,...
2014 May 14
0
[RFC PATCH v1 06/16] drm/ttm: kill fence_lock
...npopulate(struct ttm_tt *ttm) ttm_pool_unpopulate(ttm); } +static void +nouveau_bo_fence_unref(void **sync_obj) +{ + nouveau_fence_unref((struct nouveau_fence **)sync_obj); +} + void nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence) { - struct nouveau_fence *new_fence = nouveau_fence_ref(fence); - struct nouveau_fence *old_fence = NULL; - lockdep_assert_held(&nvbo->bo.resv->lock.base); - spin_lock(&nvbo->bo.bdev->fence_lock); - old_fence = nvbo->bo.sync_obj; - nvbo->bo.sync_obj = new_fence; - spin_unlock(&nvbo->bo.bdev->fence_lock); - - nouve...
2014 May 26
2
Implement buffer_clear for nvc0
Hi, please review the following patch! Thanks, Tobias Klausmann
2015 Oct 10
2
[PATCH] nouveau: avoid emitting new fences unnecessarily
..._STATE_EMITTING) - nouveau_fence_emit(screen->fence.current); + if (screen->fence.current->state < NOUVEAU_FENCE_STATE_EMITTING) { + if (screen->fence.current->ref > 1) + nouveau_fence_emit(screen->fence.current); + else + return; + } nouveau_fence_ref(NULL, &screen->fence.current); -- 2.4.9
2016 Jun 05
0
[RFC PATCH] nouveau: add locking
...veau/nouveau_fence.h +++ b/src/gallium/drivers/nouveau/nouveau_fence.h @@ -2,6 +2,7 @@ #ifndef __NOUVEAU_FENCE_H__ #define __NOUVEAU_FENCE_H__ +#include "util/u_atomic.h" #include "util/u_inlines.h" #include "util/list.h" @@ -47,10 +48,10 @@ static inline void nouveau_fence_ref(struct nouveau_fence *fence, struct nouveau_fence **ref) { if (fence) - ++fence->ref; + p_atomic_inc(&fence->ref); if (*ref) { - if (--(*ref)->ref == 0) + if (p_atomic_dec_zero(&(*ref)->ref)) nouveau_fence_del(*ref); } diff --git a/...
2014 Mar 01
1
[PATCH] nouveau: add valid range tracking to nouveau_buffer
...ouveau_buffer_allocate(struct nouveau_screen *screen, if (buf->bo) buf->address = buf->bo->offset + buf->offset; + util_range_set_empty(&buf->valid_buffer_range); + return TRUE; } @@ -124,6 +126,8 @@ nouveau_buffer_destroy(struct pipe_screen *pscreen, nouveau_fence_ref(NULL, &res->fence); nouveau_fence_ref(NULL, &res->fence_wr); + util_range_destroy(&res->valid_buffer_range); + FREE(res); NOUVEAU_DRV_STAT(nouveau_screen(pscreen), buf_obj_current_count, -1); @@ -387,6 +391,17 @@ nouveau_buffer_transfer_map(struct pipe_context...
2013 Nov 30
1
[PATCH 1/2] nouveau: avoid leaking fences while waiting
This fixes a memory leak in some situations. Also avoids emitting an extra fence if the kick handler does the call to nouveau_fence_next itself. Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> Cc: "9.2 10.0" <mesa-stable at lists.freedesktop.org> --- TBH I'm pretty confused by the whole fence refcounting logic and its interaction with emits, updates, etc. However
2014 May 26
0
[PATCH] nvc0: Implement buffer_clear for this type of hardware
...(RT_HORIZ(0)), 2); + PUSH_DATA (push, width * data_size); + PUSH_DATA (push, height); + + BEGIN_NVC0(push, NVC0_3D(CLEAR_BUFFERS), 1); + PUSH_DATA (push, 0x3c); + } + } + else { + nvc0_clear_buffer_rgb32(pipe,res,offset,size,data,data_size); + } + + nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence); + nouveau_fence_ref(nvc0->screen->base.fence.current, &buf->fence_wr); + + nvc0->dirty |= NVC0_NEW_FRAMEBUFFER; +} + +static void nvc0_clear_depth_stencil(struct pipe_context *pipe, struct pi...
2014 May 14
0
[RFC PATCH v1 12/16] drm/ttm: flip the switch, and convert to dma_fence
...drm_device *dev, int i) static void nv10_bo_put_tile_region(struct drm_device *dev, struct nouveau_drm_tile *tile, - struct nouveau_fence *fence) + struct fence *fence) { struct nouveau_drm *drm = nouveau_drm(dev); if (tile) { spin_lock(&drm->tile.lock); - tile->fence = nouveau_fence_ref(fence); + tile->fence = nouveau_fence_ref((struct nouveau_fence *)fence); tile->used = false; spin_unlock(&drm->tile.lock); } @@ -965,7 +965,8 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, if (ret == 0) { ret = nouveau_fence_new(chan, false...
2014 Jul 09
0
[PATCH 13/17] drm/ttm: flip the switch, and convert to dma_fence
...drm_device *dev, int i) static void nv10_bo_put_tile_region(struct drm_device *dev, struct nouveau_drm_tile *tile, - struct nouveau_fence *fence) + struct fence *fence) { struct nouveau_drm *drm = nouveau_drm(dev); if (tile) { spin_lock(&drm->tile.lock); - tile->fence = nouveau_fence_ref(fence); + tile->fence = nouveau_fence_ref((struct nouveau_fence *)fence); tile->used = false; spin_unlock(&drm->tile.lock); } @@ -965,7 +965,8 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, if (ret == 0) { ret = nouveau_fence_new(chan, false...
2015 Jun 22
2
[RFC PATCH 5/8] nv50: prevent NULL pointer dereference with pipe_query functions
...0_query_allocate(struct nv50_context *nv50, struct nv50_query *q, int size) > static void > nv50_query_destroy(struct pipe_context *pipe, struct pipe_query *pq) > { > + if (!pq) > + return; > + > nv50_query_allocate(nv50_context(pipe), nv50_query(pq), 0); > nouveau_fence_ref(NULL, &nv50_query(pq)->fence); > FREE(nv50_query(pq)); > @@ -152,6 +155,9 @@ nv50_query_begin(struct pipe_context *pipe, struct pipe_query *pq) > struct nouveau_pushbuf *push = nv50->base.pushbuf; > struct nv50_query *q = nv50_query(pq); > > + if (!pq) >...
2010 Feb 01
4
[PATCH 1/3] Introduce nouveau_bo_wait for waiting on a BO with a GPU channel
...; + if (chan) { + struct nouveau_fence *new_fence; + struct nouveau_channel *waited_chan; + + do { + struct nouveau_fence *prev_fence; + prev_fence = bo->sync_obj; + + waited_chan = nouveau_fence_channel(prev_fence); + if (likely(!waited_chan || waited_chan == chan)) + break; + + nouveau_fence_ref(prev_fence); + + ret = ttm_bo_wait(bo, false, false, true); + if (!ret) + goto unref_break; + + if (unlikely(prev_fence != bo->sync_obj)) + goto unref_continue; + + spin_unlock(&bo->lock); + new_fence = nouveau_fence_sync(prev_fence, chan); + spin_lock(&bo->lock);...
2010 May 31
2
[PATCH] drm/nouveau: reduce usage of fence spinlock to when absolutely necessary
...--- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -1141,7 +1141,6 @@ extern int nouveau_fence_wait(void *obj, void *arg, bool lazy, bool intr); extern int nouveau_fence_flush(void *obj, void *arg); extern void nouveau_fence_unref(void **obj); extern void *nouveau_fence_ref(void *obj); -extern void nouveau_fence_handler(struct drm_device *dev, int channel); /* nouveau_gem.c */ extern int nouveau_gem_new(struct drm_device *, struct nouveau_channel *, diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index faddf53..d0775f...