Displaying 20 results from an estimated 55 matches for "nouveau_fence_new".
2023 Aug 29
1
[PATCH drm-misc-next] drm/nouveau: fence: fix undefined fence state after emit
nouveau_fence_emit() can fail before and after initializing the
dma-fence and hence before and after initializing the dma-fence' kref.
In order to avoid nouveau_fence_emit() potentially failing before
dma-fence initialization pass the channel to nouveau_fence_new() already
and perform the required check before even allocating the fence.
While at it, restore the original behavior of nouveau_fence_new() and
add nouveau_fence_create() for separate (pre-)allocation instead. Always
splitting up allocation end emit wasn't a good idea in the first place.
Henc...
2022 Aug 19
4
[PATCH] nouveau: explicitly wait on the fence in nouveau_bo_move_m2mf
...m/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 35bb0bb3fe61..126b3c6e12f9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -822,6 +822,15 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict,
 		if (ret == 0) {
 			ret = nouveau_fence_new(chan, false, &fence);
 			if (ret == 0) {
+				/* TODO: figure out a better solution here
+				 *
+				 * 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...
2020 Jul 29
0
BUG: unable to handle page fault for address nouveau_fence_new
...003ff R12: 00000001067fdb37
R13: ffff9a53f5c07480 R14: 0000000000000dc0 R15: ffff9a53f5c07480
FS:  00007fb65997f700(0000) GS:ffff9a53f6cc0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000001067fdb67 CR3: 000000013d42d000 CR4: 00000000000406e0
Call Trace:
 nouveau_fence_new+0x42/0xc0 [nouveau]
 nouveau_gem_ioctl_pushbuf+0xe30/0x1230 [nouveau]
 ? nouveau_gem_ioctl_new+0xf0/0xf0 [nouveau]
 drm_ioctl_kernel+0xcc/0x110 [drm]
 drm_ioctl+0x202/0x390 [drm]
 ? nouveau_gem_ioctl_new+0xf0/0xf0 [nouveau]
 nouveau_drm_ioctl+0x91/0xd0 [nouveau]
 ksys_ioctl+0xa4/0xd0
 __x64_sys_ioc...
2010 Jan 06
0
[PATCH] Fix null deref in nouveau_fence_emit due to deleted fence
...ence);
+	validate_fini_list(&op->gart_list, fence);
+	validate_fini_list(&op->both_list, fence);
 }
 
 static int
@@ -420,10 +413,6 @@ nouveau_gem_pushbuf_validate(struct nouveau_channel *chan,
 	INIT_LIST_HEAD(&op->gart_list);
 	INIT_LIST_HEAD(&op->both_list);
 
-	ret = nouveau_fence_new(chan, &op->fence, false);
-	if (ret)
-		return ret;
-
 	if (nr_buffers == 0)
 		return 0;
 
@@ -541,6 +530,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
 	struct drm_nouveau_gem_pushbuf_bo *bo = NULL;
 	struct nouveau_channel *chan;
 	struct validate_op op;
+	struct nouv...
2014 Jun 16
2
[PATCH 1/2] gallium/nouveau: decouple nouveau_fence implementation from screen
...ns(+), 78 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nouveau_fence.c b/src/gallium/drivers/nouveau/nouveau_fence.c
index c686710..09b3b1e 100644
--- a/src/gallium/drivers/nouveau/nouveau_fence.c
+++ b/src/gallium/drivers/nouveau/nouveau_fence.c
@@ -31,14 +31,14 @@
  #endif
  
  boolean
-nouveau_fence_new(struct nouveau_screen *screen, struct nouveau_fence **fence,
+nouveau_fence_new(struct nouveau_fence_mgr *mgr, struct nouveau_fence **fence,
                    boolean emit)
  {
     *fence = CALLOC_STRUCT(nouveau_fence);
     if (!*fence)
        return FALSE;
  
-   (*fence)->screen = screen;...
2023 Aug 05
1
[PATCH drm-misc-next] nouveau/dmem: fix copy-paste error in nouveau_dmem_migrate_chunk()
.../gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c
index 4ad40e42cae1..61e84562094a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dmem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c
@@ -678,7 +678,7 @@ static void nouveau_dmem_migrate_chunk(struct nouveau_drm *drm,
 	}
 
 	if (!nouveau_fence_new(&fence))
-		nouveau_fence_emit(fence, chunk->drm->dmem->migrate.chan);
+		nouveau_fence_emit(fence, drm->dmem->migrate.chan);
 	migrate_vma_pages(args);
 	nouveau_dmem_fence_done(&fence);
 	nouveau_pfns_map(svmm, args->vma->vm_mm, args->start, pfns, i);
base-commit:...
2020 Jul 28
1
BUG: unable to handle page fault for address nouveau_fence_new
...003ff R12: 00000001067fdb37
R13: ffff9a53f5c07480 R14: 0000000000000dc0 R15: ffff9a53f5c07480
FS:  00007fb65997f700(0000) GS:ffff9a53f6cc0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000001067fdb67 CR3: 000000013d42d000 CR4: 00000000000406e0
Call Trace:
 nouveau_fence_new+0x42/0xc0 [nouveau]
 nouveau_gem_ioctl_pushbuf+0xe30/0x1230 [nouveau]
 ? nouveau_gem_ioctl_new+0xf0/0xf0 [nouveau]
 drm_ioctl_kernel+0xcc/0x110 [drm]
 drm_ioctl+0x202/0x390 [drm]
 ? nouveau_gem_ioctl_new+0xf0/0xf0 [nouveau]
 nouveau_drm_ioctl+0x91/0xd0 [nouveau]
 ksys_ioctl+0xa4/0xd0
 __x64_sys_ioc...
2013 Nov 30
1
[PATCH 1/2] nouveau: avoid leaking fences while waiting
...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/nouveau/nouveau_fence.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletio...
2016 Feb 02
2
[Bug 93968] New: BUG in nouveau_fbcon_sync()
...fffff813fb6c5>] dump_stack+0x4e/0x79
[   37.438538]  [<ffffffff810a6fb9>] ___might_sleep+0x149/0x200
[   37.438540]  [<ffffffff810a70b9>] __might_sleep+0x49/0x80
[   37.438544]  [<ffffffff81202dfd>] kmem_cache_alloc_trace+0x20d/0x2e0
[   37.438600]  [<ffffffffa0272e9b>] ? nouveau_fence_new+0x3b/0x90 [nouveau]
[   37.438624]  [<ffffffffa0272e9b>] nouveau_fence_new+0x3b/0x90 [nouveau]
[   37.438649]  [<ffffffffa02707b2>] nouveau_channel_idle+0x42/0xb0 [nouveau]
[   37.438673]  [<ffffffffa026bb3f>] nouveau_fbcon_sync+0x7f/0xb0 [nouveau]
[   37.438677]  [<ffffffff814...
2010 May 14
1
Kernel module fails to initialize on AMD751 based system with NV34
...22/0x40
May 14 19:17:28 max-desktop kernel: [    3.743667]  [<d8a286c8>]
nouveau_dma_wait+0x38/0x1b0 [nouveau]
May 14 19:17:28 max-desktop kernel: [    3.743715]  [<d8a2a4ec>]
nouveau_fence_emit+0x12c/0x170 [nouveau]
May 14 19:17:28 max-desktop kernel: [    3.743763]  [<d8a2a5b0>]
nouveau_fence_new+0x80/0xe0 [nouveau]
May 14 19:17:28 max-desktop kernel: [    3.743778]  [<c0356582>] ?
ioread32+0x22/0x40
May 14 19:17:28 max-desktop kernel: [    3.743821]  [<d8a2144b>]
nouveau_channel_free+0x8b/0x1f0 [nouveau]
May 14 19:17:28 max-desktop kernel: [    3.743865]  [<d8a21a8e>]
nou...
2015 Mar 29
1
[PATCH] nouveau: synchronize "scratch runout" destruction with the command stream
...L, &nv->scratch.runout[nv->scratch.nr_runout]);
-   } while (nv->scratch.nr_runout);
 
-   FREE(nv->scratch.runout);
+   struct bos *b = MALLOC(sizeof(*b));
+   b->arr = nv->scratch.runout;
+   b->nr  = nv->scratch.nr_runout;
+
+   struct nouveau_fence *fence = NULL;
+   nouveau_fence_new(nv->screen, &fence, TRUE);
+   nouveau_fence_work(fence, unref_bos, b);
+
    nv->scratch.end = 0;
    nv->scratch.runout = NULL;
+   nv->scratch.nr_runout = 0;
 }
 
 /* Allocate an extra bo if we can't fit everything we need simultaneously.
-- 
2.1.0
2019 Aug 08
0
[PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_to_ram
...,
-				nouveau_dmem_page_addr(spage));
-		if (ret) {
-			dst_pfns[i] = MIGRATE_PFN_ERROR;
-			__free_page(dpage);
-			continue;
-		}
-	}
+	if (drm->dmem->migrate.copy_func(drm, 1, NOUVEAU_APER_HOST, *dma_addr,
+			NOUVEAU_APER_VRAM, nouveau_dmem_page_addr(spage)))
+		goto error_dma_unmap;
 
-	nouveau_fence_new(drm->dmem->migrate.chan, false, &fault->fence);
-
-	return;
+	args->dst[0] = migrate_pfn(page_to_pfn(dpage)) | MIGRATE_PFN_LOCKED;
+	ret = 0;
 
+error_dma_unmap:
+	dma_unmap_page(dev, *dma_addr, PAGE_SIZE, DMA_BIDIRECTIONAL);
+error_free_page:
+	__free_page(dpage);
 error:
-	for (ad...
2019 Jul 29
0
[PATCH 5/9] nouveau: simplify nouveau_dmem_migrate_to_ram
...NOUVEAU_APER_VRAM,
-				nouveau_dmem_page_addr(spage));
-		if (ret) {
-			dst_pfns[i] = MIGRATE_PFN_ERROR;
-			__free_page(dpage);
-			continue;
-		}
-	}
+	*dma_addr = dma_map_page(dev, dpage, 0, PAGE_SIZE, DMA_BIDIRECTIONAL);
+	if (dma_mapping_error(dev, *dma_addr))
+		goto error_free_page;
 
-	nouveau_fence_new(drm->dmem->migrate.chan, false, &fault->fence);
+	if (drm->dmem->migrate.copy_func(drm, 1, NOUVEAU_APER_HOST, *dma_addr,
+			NOUVEAU_APER_VRAM, nouveau_dmem_page_addr(spage)))
+		goto error_dma_unmap;
 
-	return;
+	*dst = migrate_pfn(page_to_pfn(dpage)) | MIGRATE_PFN_LOCKED;
 
+e...
2019 Aug 08
1
[PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_to_ram
...{
> -			dst_pfns[i] = MIGRATE_PFN_ERROR;
> -			__free_page(dpage);
> -			continue;
> -		}
> -	}
> +	if (drm->dmem->migrate.copy_func(drm, 1, NOUVEAU_APER_HOST, *dma_addr,
> +			NOUVEAU_APER_VRAM, nouveau_dmem_page_addr(spage)))
> +		goto error_dma_unmap;
>   
> -	nouveau_fence_new(drm->dmem->migrate.chan, false, &fault->fence);
> -
> -	return;
> +	args->dst[0] = migrate_pfn(page_to_pfn(dpage)) | MIGRATE_PFN_LOCKED;
> +	ret = 0;
This needs to be "return 0;" here so that dpage is not unmapped
while the DMA I/O is in progress. It gets unma...
2014 Jun 17
2
[PATCH try 2 1/2] gallium/nouveau: decouple nouveau_fence implementation from screen
...tions(+), 78 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nouveau_fence.c b/src/gallium/drivers/nouveau/nouveau_fence.c
index c686710..09b3b1e 100644
--- a/src/gallium/drivers/nouveau/nouveau_fence.c
+++ b/src/gallium/drivers/nouveau/nouveau_fence.c
@@ -31,14 +31,14 @@
 #endif
 
 boolean
-nouveau_fence_new(struct nouveau_screen *screen, struct nouveau_fence **fence,
+nouveau_fence_new(struct nouveau_fence_mgr *mgr, struct nouveau_fence **fence,
                   boolean emit)
 {
    *fence = CALLOC_STRUCT(nouveau_fence);
    if (!*fence)
       return FALSE;
 
-   (*fence)->screen = screen;
+   (...
2019 Jul 29
0
[PATCH 6/9] nouveau: simplify nouveau_dmem_migrate_vma
...ntinue;
-		}
-
-		ret = copy(drm, 1, NOUVEAU_APER_VRAM,
-				nouveau_dmem_page_addr(dpage),
-				NOUVEAU_APER_HOST,
-				migrate->dma[migrate->dma_nr++]);
-		if (ret) {
-			nouveau_dmem_page_free_locked(drm, dpage);
-			dst_pfns[i] = 0;
-			continue;
-		}
-	}
+	struct page *dpage, *spage;
 
-	nouveau_fence_new(drm->dmem->migrate.chan, false, &migrate->fence);
+	spage = migrate_pfn_to_page(src);
+	if (!spage || !(src & MIGRATE_PFN_MIGRATE))
+		goto out;
 
-	return;
+	dpage = nouveau_dmem_page_alloc_locked(drm);
+	if (!dpage)
+		return 0;
 
-error:
-	for (addr = start, i = 0; addr < end...
2015 Jan 02
2
[PATCH] nv50: enable texture compression
...t;= 0x01000101);
+
    BEGIN_NV04(push, NV50_3D(RT_CONTROL), 1);
    PUSH_DATA (push, 1);
 
@@ -871,7 +878,7 @@ nv50_screen_create(struct nouveau_device *dev)
    if (!nv50_blitter_create(screen))
       goto fail;
 
-   nv50_screen_init_hwctx(screen);
+   nv50_screen_init_hwctx(dev, screen);
 
    nouveau_fence_new(&screen->base, &screen->base.fence.current, FALSE);
 
-- 
2.2.1
2017 Aug 13
1
[Bug 102192] New: Dell XPS 15 9560: PU: 1 PID: 58 at drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c:190 gf100_vm_flush+0x1b3/0x1c0
...ll Trace:
[ 1730.734259]  nvkm_vm_unmap_at+0xb9/0x100 [nouveau]
[ 1730.734272]  nvkm_vm_unmap+0x1b/0x20 [nouveau]
[ 1730.734288]  nouveau_vram_manager_del+0x60/0x80 [nouveau]
[ 1730.734291]  ttm_bo_mem_put+0x2a/0x30 [ttm]
[ 1730.734293]  ttm_bo_move_accel_cleanup+0x10c/0x200 [ttm]
[ 1730.734308]  ? nouveau_fence_new+0x58/0x90 [nouveau]
[ 1730.734324]  nouveau_bo_move_m2mf.constprop.14+0x170/0x1a0 [nouveau]
[ 1730.734340]  nouveau_bo_move+0xac/0x430 [nouveau]
[ 1730.734342]  ttm_bo_handle_move_mem+0x280/0x5b0 [ttm]
[ 1730.734344]  ttm_bo_evict+0x116/0x2b0 [ttm]
[ 1730.734346]  ? find_busiest_group+0x122/0x980
[...
2015 Jan 02
0
[PATCH] nv50: enable texture compression
..._3D(RT_CONTROL), 1);
>     PUSH_DATA (push, 1);
>
> @@ -871,7 +878,7 @@ nv50_screen_create(struct nouveau_device *dev)
>     if (!nv50_blitter_create(screen))
>        goto fail;
>
> -   nv50_screen_init_hwctx(screen);
> +   nv50_screen_init_hwctx(dev, screen);
>
>     nouveau_fence_new(&screen->base, &screen->base.fence.current, FALSE);
>
> --
> 2.2.1
>
> _______________________________________________
> Nouveau mailing list
> Nouveau at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
2014 May 14
0
[RFC PATCH v1 07/16] drm/nouveau: rework to new fence interface
...nouveau_fence_del);
+		fence_put(&(*pfence)->base);
 	*pfence = NULL;
 }
 
@@ -307,7 +377,7 @@ struct nouveau_fence *
 nouveau_fence_ref(struct nouveau_fence *fence)
 {
 	if (fence)
-		kref_get(&fence->kref);
+		fence_get(&fence->base);
 	return fence;
 }
 
@@ -325,9 +395,7 @@ nouveau_fence_new(struct nouveau_channel *chan, bool sysmem,
 	if (!fence)
 		return -ENOMEM;
 
-	INIT_LIST_HEAD(&fence->work);
 	fence->sysmem = sysmem;
-	kref_init(&fence->kref);
 
 	ret = nouveau_fence_emit(fence, chan);
 	if (ret)
@@ -336,3 +404,85 @@ nouveau_fence_new(struct nouveau_channel *ch...