search for: nouveau_bo_ref

Displaying 20 results from an estimated 97 matches for "nouveau_bo_ref".

2012 Nov 25
0
[PATCH] drm/nouveau: unpin various bo's before destroying
...82a0d9c..6578cd2 100644 --- a/drivers/gpu/drm/nouveau/nv04_crtc.c +++ b/drivers/gpu/drm/nouveau/nv04_crtc.c @@ -730,6 +730,7 @@ static void nv_crtc_destroy(struct drm_crtc *crtc) drm_crtc_cleanup(crtc); nouveau_bo_unmap(nv_crtc->cursor.nvbo); + nouveau_bo_unpin(nv_crtc->cursor.nvbo); nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo); kfree(nv_crtc); } @@ -1056,8 +1057,11 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num) 0, 0x0000, NULL, &nv_crtc->cursor.nvbo); if (!ret) { ret = nouveau_bo_pin(nv_crtc->cursor.nvbo, TTM_PL_FLAG_VRAM); - if (!ret) + if (!ret...
2020 Oct 06
1
[RFC] gem: fix "refcount_t: underflow; use-after-free"
we can't use nouveau_bo_ref here as no ttm object was allocated and nouveau_bo_ref mainly deals with that. Simply deallocate the object. Signed-off-by: Karol Herbst <kherbst at redhat.com> --- drm/nouveau/nouveau_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drm/nouveau/nouveau_gem.c b/dr...
2009 Dec 21
2
[PATCH 1/2] Unreference state/buffer objects on context/screen destruction
...screen.c (wersja 32083) +++ nv50/nv50_screen.c (kopia robocza) @@ -162,7 +162,22 @@ nv50_screen_destroy(struct pipe_screen *pscreen) { struct nv50_screen *screen = nv50_screen(pscreen); + unsigned i; + for (i = 0; i < 2; i++) { + if (screen->constbuf_parm[i]) + nouveau_bo_ref(NULL, &screen->constbuf_parm[i]); + } + + if (screen->constbuf_misc[0]) + nouveau_bo_ref(NULL, &screen->constbuf_misc[0]); + if (screen->tic) + nouveau_bo_ref(NULL, &screen->tic); + if (screen->tsc) + nouveau_bo_ref(NULL, &screen-&g...
2014 Mar 13
2
[PATCH] nouveau: safen up nouveau_device list usage against concurrent access
...ruct nouveau_device *dev, uint32_t handle, struct nouveau_bo_priv *nvbo; int ret; + pthread_mutex_lock(&nvdev->lock); DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { if (nvbo->base.handle == handle) { + pthread_mutex_unlock(&nvdev->lock); *pbo = NULL; nouveau_bo_ref(&nvbo->base, pbo); return 0; } } + pthread_mutex_unlock(&nvdev->lock); ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_GEM_INFO, &req, sizeof(req)); @@ -396,7 +418,9 @@ nouveau_bo_wrap(struct nouveau_device *dev, uint32_t handle, atomic_set(&nvbo->r...
2015 Jan 05
2
drm/nouveau: dont switch vt on suspend
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at ubuntu.com> --- diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 3ed12a8cfc91..a4a586807903 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -370,6 +370,7 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, ret = -ENOMEM; goto
2015 Nov 02
2
help with push
...ks in advance. 2015-11-02 14:44 GMT-03:00 Ilia Mirkin <imirkin at alum.mit.edu>: > See libdrm's pushbuf.c -- iirc push->cur points to a GART-mapped bo. > > http://cgit.freedesktop.org/mesa/drm/tree/nouveau/pushbuf.c#n682 > > nouveau_pushbuf_data(push, NULL, 0, 0); > nouveau_bo_ref(bo, &nvpb->bo); > nouveau_bo_ref(NULL, &bo); > > nvpb->bgn = nvpb->bo->map; > nvpb->ptr = nvpb->bgn; > push->cur = nvpb->bgn; > push->end = push->cur + (nvpb->bo->size / 4); > push->end -= 2 + push->rsvd_kick; /* space for suffi...
2015 Nov 02
2
help with push
Hi, sorry if I misunderstood everything... In the file src/gallium/drivers/nouveau/nv30/nv30_screen.c there is loans of PUSH_DATA which is basically *push->curr = data; I'm thinking that somehow push->curr is the bo->map = drm_mmap(...) that is called in nouveau_bo_map. But I cannot see how they are linked... Because when nouveau_bo_map calls nouveau_bo_wait push =
2015 Mar 29
1
[PATCH] nouveau: synchronize "scratch runout" destruction with the command stream
...alloc(struct nouveau_context *nv, struct nouveau_bo **pbo, 4096, size, NULL, pbo); } +struct bos +{ + unsigned nr; + struct nouveau_bo **arr; +}; + +static void +unref_bos(void *d) +{ + struct bos *b = d; + int i; + + for (i = 0; i < b->nr; ++i) + nouveau_bo_ref(NULL, &b->arr[i]); + + FREE(b->arr); + FREE(b); +} + void nouveau_scratch_runout_release(struct nouveau_context *nv) { if (!nv->scratch.nr_runout) return; - do { - --nv->scratch.nr_runout; - nouveau_bo_ref(NULL, &nv->scratch.runout[nv->scratch...
2014 Sep 01
2
[PATCH 1/3] nv50: set the miptree address when clearing bo's in vp2 init
The mt address is about to be used more, make sure it's set appropriately. Reported-by: Emil Velikov <emil.l.velikov at gmail.com> Tested-by: Emil Velikov <emil.l.velikov at gmail.com> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> Cc: "10.2 10.3" <mesa-stable at lists.freedesktop.org> --- src/gallium/drivers/nouveau/nv50/nv84_video.c | 2 ++ 1 file
2020 Nov 03
0
[PATCH AUTOSEL 5.9 34/35] drm/nouveau/gem: fix "refcount_t: underflow; use-after-free"
From: Karol Herbst <kherbst at redhat.com> [ Upstream commit 925681454d7b557d404b5d28ef4469fac1b2e105 ] we can't use nouveau_bo_ref here as no ttm object was allocated and nouveau_bo_ref mainly deals with that. Simply deallocate the object. Signed-off-by: Karol Herbst <kherbst at redhat.com> Signed-off-by: Ben Skeggs <bskeggs at redhat.com> Signed-off-by: Sasha Levin <sashal at kernel.org> --- drivers/gpu/dr...
2020 Nov 03
0
[PATCH AUTOSEL 5.8 28/29] drm/nouveau/gem: fix "refcount_t: underflow; use-after-free"
From: Karol Herbst <kherbst at redhat.com> [ Upstream commit 925681454d7b557d404b5d28ef4469fac1b2e105 ] we can't use nouveau_bo_ref here as no ttm object was allocated and nouveau_bo_ref mainly deals with that. Simply deallocate the object. Signed-off-by: Karol Herbst <kherbst at redhat.com> Signed-off-by: Ben Skeggs <bskeggs at redhat.com> Signed-off-by: Sasha Levin <sashal at kernel.org> --- drivers/gpu/dr...
2020 Nov 03
0
[PATCH AUTOSEL 5.4 23/24] drm/nouveau/gem: fix "refcount_t: underflow; use-after-free"
From: Karol Herbst <kherbst at redhat.com> [ Upstream commit 925681454d7b557d404b5d28ef4469fac1b2e105 ] we can't use nouveau_bo_ref here as no ttm object was allocated and nouveau_bo_ref mainly deals with that. Simply deallocate the object. Signed-off-by: Karol Herbst <kherbst at redhat.com> Signed-off-by: Ben Skeggs <bskeggs at redhat.com> Signed-off-by: Sasha Levin <sashal at kernel.org> --- drivers/gpu/dr...
2009 Aug 10
1
[RFC] drm/nouveau: optimize code emission of inline functions
[This email is either empty or too large to be displayed at this time]
2014 Apr 08
0
[PATCH] libdrm/nouveau: safen up nouveau libdrm against concurrent access
...,18 +472,21 @@ nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, struct drm_gem_open req = { .name = name }; int ret; + pthread_mutex_lock(&nvdev->lock); DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { if (nvbo->name == name) { *pbo = NULL; nouveau_bo_ref(&nvbo->base, pbo); + pthread_mutex_unlock(&nvdev->lock); return 0; } } ret = drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req); if (ret == 0) { - ret = nouveau_bo_wrap(dev, req.handle, pbo); + ret = nouveau_bo_wrap_locked(dev, req.handle, pbo); nouveau_bo...
2017 Jun 07
5
[Bug 101335] New: build failure: nouveau_screen.c:105:8: error: implicit declaration of function ‘nouveau_drm_new’;
...u_drm’ ret = nouveau_device_new(&screen->drm->client, NV_DEVICE, ^~ CC nouveau_texture.lo nouveau_screen.c: In function ‘nouveau_destroy_screen’: nouveau_screen.c:230:2: error: implicit declaration of function ‘nouveau_drm_del’; did you mean ‘nouveau_bo_ref’? [-Werror=implicit-function-declaration] nouveau_drm_del(&screen->drm); ^~~~~~~~~~~~~~~ nouveau_bo_ref cc1: some warnings being treated as errors -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug. -------------- next part --...
2013 Jul 22
0
[RFC PATCH] Support running nested in a Mir compositor
...uot;, ret, fd); + assert(!ret); + + dst = pScreen->CreatePixmap(pScreen, 0, 0, pScrn->depth, 0); + if (dst == NullPixmap) + goto cleanup_bo; + + pScreen->ModifyPixmapHeader(dst, pScrn->virtualX, pScrn->virtualY, pScrn->depth, pScrn->depth, + pScrn->virtualX, NULL); + nouveau_bo_ref(bo_dst, &nouveau_pixmap(dst)->bo); + + ret = exa->PrepareCopy (src, dst, 0, 0, GXcopy, FB_ALLONES); + if (ret) { + exa->Copy (dst, 0, 0, 0, 0, pScrn->virtualX, pScrn->virtualY); + exa->DoneCopy (dst); + PUSH_KICK(pNv->pushbuf); + } + +cleanup_bo: + nouveau_bo_ref(NULL, &...
2015 Feb 24
4
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...nvdev = nouveau_device(dev); struct drm_nouveau_gem_info req = { .handle = handle }; @@ -427,8 +416,24 @@ nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle, DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { if (nvbo->base.handle == handle) { - *pbo = NULL; - nouveau_bo_ref(&nvbo->base, pbo); + if (atomic_inc_return(&nvbo->refcnt) == 1) { + /* + * Uh oh, this bo is dead and someone else + * will free it, but because refcnt is + * now non-zero fortunately they won't + * call the ioctl to close the bo. + * + * Remove this b...
2013 Jun 30
0
[PATCH v2] nv50: H.264/MPEG2 decoding support via VP2, available on NV84-NV96, NVA0
...if (ret) + goto error; + + ret = nv84_copy_firmware(fw1, fw->map, size1); + if (fw2 && !ret) + ret = nv84_copy_firmware(fw2, fw->map + dec->vp_fw2_offset, size2); + munmap(fw->map, fw->size); + fw->map = NULL; + if (!ret) + return fw; +error: + nouveau_bo_ref(NULL, &fw); + return NULL; +} + +static struct nouveau_bo * +nv84_load_bsp_firmware(struct nouveau_device *dev, struct nv84_decoder *dec) +{ + return nv84_load_firmwares( + dev, dec, "/lib/firmware/nouveau/nv84_bsp-h264", NULL); +} + +static struct nouveau_bo * +nv84_load_...
2013 Jun 27
4
[PATCH] nv50: H.264/MPEG2 decoding support via VP2, available on NV84-NV96, NVA0
...gt;client); + if (ret) goto error; + + ret = nv84_copy_firmware(fw1, fw->map, size1); + if (fw2 && !ret) + ret = nv84_copy_firmware(fw2, fw->map + dec->vp_fw2_offset, size2); + munmap(fw->map, fw->size); + fw->map = NULL; + if (!ret) return fw; +error: + nouveau_bo_ref(NULL, &fw); + return NULL; +} + +static struct nouveau_bo * +nv84_load_bsp_firmware(struct nouveau_device *dev, struct nv84_decoder *dec) +{ + return nv84_load_firmwares( + dev, dec, "/lib/firmware/nouveau/nv84_bsp-h264", NULL); +} + +static struct nouveau_bo * +nv84_load_...
2015 Nov 02
0
help with push
See libdrm's pushbuf.c -- iirc push->cur points to a GART-mapped bo. http://cgit.freedesktop.org/mesa/drm/tree/nouveau/pushbuf.c#n682 nouveau_pushbuf_data(push, NULL, 0, 0); nouveau_bo_ref(bo, &nvpb->bo); nouveau_bo_ref(NULL, &bo); nvpb->bgn = nvpb->bo->map; nvpb->ptr = nvpb->bgn; push->cur = nvpb->bgn; push->end = push->cur + (nvpb->bo->size / 4); push->end -= 2 + push->rsvd_kick; /* space for suffix */ Not sure what problem you...