search for: nouveau_fence_wait

Displaying 20 results from an estimated 50 matches for "nouveau_fence_wait".

2014 Mar 06
2
[PATCH] nouveau: fix fence waiting logic in screen destroy
nouveau_fence_wait has the expectation that an external entity is holding onto the fence being waited on, not that it is merely held onto by the current pointer. Fixes a use-after-free in nouveau_fence_wait when used on the screen's current fence. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75279 Sign...
2014 Mar 07
0
[PATCH] nouveau: fix fence waiting logic in screen destroy
On 06/03/14 04:01, Ilia Mirkin wrote: > nouveau_fence_wait has the expectation that an external entity is > holding onto the fence being waited on, not that it is merely held onto > by the current pointer. Fixes a use-after-free in nouveau_fence_wait > when used on the screen's current fence. > IMHO one should flatten all the fence handlin...
2014 Aug 22
1
[Bug 82975] New: Regression: NULL pointer dereference in nouveau_fence_wait after upgrading to 10.2.6
https://bugs.freedesktop.org/show_bug.cgi?id=82975 Priority: medium Bug ID: 82975 Assignee: nouveau at lists.freedesktop.org Summary: Regression: NULL pointer dereference in nouveau_fence_wait after upgrading to 10.2.6 QA Contact: xorg-team at lists.x.org Severity: major Classification: Unclassified OS: Linux (All) Reporter: scott at chaos-dragon.com Hardware: x86-64 (AMD64) Status: NEW Version: unspecified...
2015 Oct 10
2
[PATCH] nouveau: avoid emitting new fences unnecessarily
...ile changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/nouveau_fence.c b/src/gallium/drivers/nouveau/nouveau_fence.c index ee4e08d..18b1592 100644 --- a/src/gallium/drivers/nouveau/nouveau_fence.c +++ b/src/gallium/drivers/nouveau/nouveau_fence.c @@ -190,8 +190,10 @@ nouveau_fence_wait(struct nouveau_fence *fence) /* wtf, someone is waiting on a fence in flush_notify handler? */ assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING); - if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) + if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) { + PUSH_SPACE(s...
2022 Aug 19
4
[PATCH] nouveau: explicitly wait on the fence in nouveau_bo_move_m2mf
...+ * + * wait on the fence here explicitly as going through + * ttm_bo_move_accel_cleanup somehow doesn't seem to do it. + * + * Without this the operation can timeout and we'll fallback to a + * software copy, which might take several minutes to finish. + */ + nouveau_fence_wait(fence, false, false); ret = ttm_bo_move_accel_cleanup(bo, &fence->base, evict, false, -- 2.37.1
2019 Jul 29
0
[PATCH 4/9] nouveau: factor out dmem fence completion
...00644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c @@ -133,6 +133,19 @@ static void nouveau_dmem_page_free(struct page *page) spin_unlock(&chunk->lock); } +static void nouveau_dmem_fence_done(struct nouveau_fence **fence) +{ + if (fence) { + nouveau_fence_wait(*fence, true, false); + nouveau_fence_unref(fence); + } else { + /* + * FIXME wait for channel to be IDLE before calling finalizing + * the hmem object. + */ + } +} + static void nouveau_dmem_fault_alloc_and_copy(struct vm_area_struct *vma, const unsigned long *src_pfns, @@ -236,15...
2013 Nov 30
1
[PATCH 1/2] nouveau: avoid leaking fences while waiting
...in <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 valgrind was happy with this. But it wasn't happy when I was doing nouveau_fence_wait from nv50_draw_elements, saying that the fence allocated by nouveau_fence_new was leaked. (Note that the kick handler when doing vbo stuff does NOT do nouveau_fence_next on its own... but adding that there still didn't fix all my issues, nor is it likely desirable.) src/gallium/drivers/nouvea...
2023 Aug 29
1
[PATCH drm-misc-next] drm/nouveau: fence: fix undefined fence state after emit
..._chan.c @@ -70,11 +70,9 @@ nouveau_channel_idle(struct nouveau_channel *chan) struct nouveau_fence *fence = NULL; int ret; - ret = nouveau_fence_new(&fence); + ret = nouveau_fence_new(&fence, chan); if (!ret) { - ret = nouveau_fence_emit(fence, chan); - if (!ret) - ret = nouveau_fence_wait(fence, false, false); + ret = nouveau_fence_wait(fence, false, false); nouveau_fence_unref(&fence); } diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c index 61e84562094a..12feecf71e75 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++...
2014 May 14
0
[RFC PATCH v1 07/16] drm/nouveau: rework to new fence interface
...*fctx; - struct fence_work *work = NULL; + struct nouveau_fence_work *work; - if (nouveau_fence_done(fence)) { - func(data); - return; - } + if (fence_is_signaled(&fence->base)) + goto err; - fctx = chan->fence; work = kmalloc(sizeof(*work), GFP_KERNEL); if (!work) { WARN_ON(nouveau_fence_wait(fence, false, false)); - func(data); - return; + goto err; } - spin_lock(&fctx->lock); - if (!fence->channel) { - spin_unlock(&fctx->lock); - kfree(work); - func(data); - return; - } - - INIT_WORK(&work->base, nouveau_fence_work_handler); + INIT_WORK(&work-&gt...
2010 Jan 06
0
[PATCH] Fix null deref in nouveau_fence_emit due to deleted fence
...nce_new(chan, &fence, false) + || nouveau_fence_emit(fence); if (ret) { NV_ERROR(dev, "error fencing pushbuf: %d\n", ret); WIND_RING(chan); @@ -605,7 +596,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, } if (nouveau_gem_pushbuf_sync(chan)) { - ret = nouveau_fence_wait(op.fence, NULL, false, false); + ret = nouveau_fence_wait(fence, NULL, false, false); if (ret) { for (i = 0; i < req->nr_dwords; i++) NV_ERROR(dev, "0x%08x\n", pushbuf[i]); @@ -614,7 +605,8 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, } out: - v...
2014 Jun 16
2
[PATCH 1/2] gallium/nouveau: decouple nouveau_fence implementation from screen
...if (fence->state >= NOUVEAU_FENCE_STATE_EMITTED) - nouveau_fence_update(screen, FALSE); + nouveau_fence_update(mgr, FALSE); return fence->state == NOUVEAU_FENCE_STATE_SIGNALLED; } @@ -183,7 +183,7 @@ nouveau_fence_signalled(struct nouveau_fence *fence) boolean nouveau_fence_wait(struct nouveau_fence *fence) { - struct nouveau_screen *screen = fence->screen; + struct nouveau_fence_mgr *mgr = fence->mgr; uint32_t spins = 0; /* wtf, someone is waiting on a fence in flush_notify handler? */ @@ -193,19 +193,19 @@ nouveau_fence_wait(struct nouveau_fence...
2014 Jun 17
2
[PATCH try 2 1/2] gallium/nouveau: decouple nouveau_fence implementation from screen
...mgr; if (fence->state >= NOUVEAU_FENCE_STATE_EMITTED) - nouveau_fence_update(screen, FALSE); + nouveau_fence_update(mgr, FALSE); return fence->state == NOUVEAU_FENCE_STATE_SIGNALLED; } @@ -183,7 +183,7 @@ nouveau_fence_signalled(struct nouveau_fence *fence) boolean nouveau_fence_wait(struct nouveau_fence *fence) { - struct nouveau_screen *screen = fence->screen; + struct nouveau_fence_mgr *mgr = fence->mgr; uint32_t spins = 0; /* wtf, someone is waiting on a fence in flush_notify handler? */ @@ -193,19 +193,19 @@ nouveau_fence_wait(struct nouveau_fence *fen...
2014 Jun 17
0
[PATCH try 2 2/2] gallium/nouveau: move pushbuf and fences to context
...*pipe) { struct nv30_context *nv30 = nv30_context(pipe); + /* need to flush before destroying the bufctx */ + nouveau_pushbuf_kick(nv30->base.pushbuf, nv30->base.pushbuf->channel); + + if (nv30->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(nv30->base.fence.current, &current); + nouveau_fence_wait(current); + nouveau_fence_ref(NULL, &current); + nouveau_fence_ref(NULL, &nv30->ba...
2013 Nov 14
9
[Bug 71620] New: nouveau_fence_wait_uevent NULL pointer dereference
https://bugs.freedesktop.org/show_bug.cgi?id=71620 Priority: medium Bug ID: 71620 Assignee: nouveau at lists.freedesktop.org Summary: nouveau_fence_wait_uevent NULL pointer dereference Severity: normal Classification: Unclassified OS: Linux (All) Reporter: kdatanasov at gmail.com Hardware: x86-64 (AMD64) Status: NEW Version: unspecified Component: Drivers/DRI/nouveau...
2014 Jun 21
3
[Mesa-dev] [PATCH try 2 2/2] gallium/nouveau: move pushbuf and fences to context
...30 = nv30_context(pipe); > > + /* need to flush before destroying the bufctx */ > + nouveau_pushbuf_kick(nv30->base.pushbuf, nv30->base.pushbuf->channel); > + > + if (nv30->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(nv30->base.fence.current, &current); > + nouveau_fence_wait(current); > + nouveau_fence_ref(NULL, &current); > + nouveau_fe...
2018 Jan 11
3
[PATCH 0/3] drm/nouveau: Add support for fence FDs
From: Thierry Reding <treding at nvidia.com> This small series of patches implements support for waiting on and emitting fence FDs on kickoff. This enables explicit fencing and can be used for example to synchronize buffer accesses between the display engine and the GPU on Tegra. The first patch lays the groundwork by splitting up nouveau_fence_sync() to allow reuse. Patch 2 is where the
2010 May 31
2
[PATCH] drm/nouveau: reduce usage of fence spinlock to when absolutely necessary
....sequence_ack) { struct nouveau_fence *fence = NULL; diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 9eff502..cd87378 100644 --- 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 n...
2016 Jun 05
0
[RFC PATCH] nouveau: add locking
...truct nouveau_screen *screen, bool flushed) if (fence->state == NOUVEAU_FENCE_STATE_EMITTED) fence->state = NOUVEAU_FENCE_STATE_FLUSHED; } + pipe_mutex_unlock(screen->fence.list_mutex); } #define NOUVEAU_FENCE_MAX_SPINS (1 << 31) @@ -198,18 +205,27 @@ nouveau_fence_wait(struct nouveau_fence *fence, struct pipe_debug_callback *debu uint32_t spins = 0; int64_t start = 0; + /* Fast-path for the case where the fence is already signaled to avoid + * messing around with mutexes and timing. + */ + if (fence->state == NOUVEAU_FENCE_STATE_SIGNALLED)...
2014 May 26
2
Implement buffer_clear for nvc0
Hi, please review the following patch! Thanks, Tobias Klausmann
2014 Feb 25
0
[Bug 75279] XCloseDisplay() takes one minute around nouveau_dri.so, freezing Firefox startup
...edesktop.org/show_bug.cgi?id=75279 --- Comment #19 from Benoit Jacob <bjacob at mozilla.com> --- A duplicate Mozilla bug has a stack with symbols: https://bugzilla.mozilla.org/show_bug.cgi?id=975512#c1 #0 0x0000003f3a2da007 in sched_yield () from /lib64/libc.so.6 #1 0x00007f1e003bb1d1 in nouveau_fence_wait () from /usr/lib64/dri/nouveau_dri.so #2 0x00007f1e0039d635 in nvc0_screen_destroy () from /usr/lib64/dri/nouveau_dri.so #3 0x00007f1e002c6d9f in dri_destroy_screen_helper () from /usr/lib64/dri/nouveau_dri.so #4 0x00007f1e002c6e25 in dri_destroy_screen () from /usr/lib64/dri/nouveau...