search for: nouveau_bo_priv

Displaying 20 results from an estimated 21 matches for "nouveau_bo_priv".

Did you mean: nouveau_bo_pin
2015 Feb 25
2
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...------ > 1 file changed, 23 insertions(+), 24 deletions(-) > > diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c > index 1c723b9..d411523 100644 > --- a/nouveau/nouveau.c > +++ b/nouveau/nouveau.c > @@ -349,8 +349,8 @@ nouveau_bo_del(struct nouveau_bo *bo) > struct nouveau_bo_priv *nvbo = nouveau_bo(bo); > struct drm_gem_close req = { bo->handle }; > > - pthread_mutex_lock(&nvdev->lock); > - if (nvbo->name) { > + if (nvbo->head.next) { > + pthread_mutex_lock(&nvdev->lock); > i...
2015 Feb 25
2
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...> >> > >> diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c > >> index 1c723b9..d411523 100644 > >> --- a/nouveau/nouveau.c > >> +++ b/nouveau/nouveau.c > >> @@ -349,8 +349,8 @@ nouveau_bo_del(struct nouveau_bo *bo) > >> struct nouveau_bo_priv *nvbo = nouveau_bo(bo); > >> struct drm_gem_close req = { bo->handle }; > >> > >> - pthread_mutex_lock(&nvdev->lock); > >> - if (nvbo->name) { > >> + if (nvbo->head.next) { > >> + pthread_m...
2015 Feb 24
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index 1c723b9..d411523 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -349,8 +349,8 @@ nouveau_bo_del(struct nouveau_bo *bo) struct nouveau_bo_priv *nvbo = nouveau_bo(bo); struct drm_gem_close req = { bo->handle }; - pthread_mutex_lock(&nvdev->lock); - if (nvbo->name) { + if (nvbo->head.next) { + pthread_mutex_lock(&nvdev->lock); if (atomic_read(&nvbo->refcnt) == 0) { DRMLISTDEL(&nvbo->head);...
2015 Feb 25
3
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
.../nouveau/nouveau.c b/nouveau/nouveau.c > >>>> index 1c723b9..d411523 100644 > >>>> --- a/nouveau/nouveau.c > >>>> +++ b/nouveau/nouveau.c > >>>> @@ -349,8 +349,8 @@ nouveau_bo_del(struct nouveau_bo *bo) > >>>> struct nouveau_bo_priv *nvbo = nouveau_bo(bo); > >>>> struct drm_gem_close req = { bo->handle }; > >>>> > >>>> - pthread_mutex_lock(&nvdev->lock); > >>>> - if (nvbo->name) { > >>>> + if (nvbo->head.next) {...
2015 Nov 26
0
[libdrm 08/13] nouveau: make use of nouveau_drm::fd instead of nouveau_device::fd
...sizeof(r)); } int @@ -417,6 +408,7 @@ nouveau_client_del(struct nouveau_client **pclient) static void nouveau_bo_del(struct nouveau_bo *bo) { + struct nouveau_drm *drm = nouveau_drm(&bo->device->object); struct nouveau_device_priv *nvdev = nouveau_device(bo->device); struct nouveau_bo_priv *nvbo = nouveau_bo(bo); struct drm_gem_close req = { .handle = bo->handle }; @@ -433,11 +425,11 @@ nouveau_bo_del(struct nouveau_bo *bo) * might cause the bo to be closed accidentally while * re-importing. */ - drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req); +...
2010 Jan 17
0
[PATCH] libdrm/nouveau: Support nested bo mapping
...+ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/nouveau/nouveau_bo.c b/nouveau/nouveau_bo.c index 10cc8a6..c1a9843 100644 --- a/nouveau/nouveau_bo.c +++ b/nouveau/nouveau_bo.c @@ -417,9 +417,12 @@ nouveau_bo_map_range(struct nouveau_bo *bo, uint32_t delta, uint32_t size, struct nouveau_bo_priv *nvbo = nouveau_bo(bo); int ret; - if (!nvbo || bo->map) + if (!nvbo) return -EINVAL; + if(nvbo->map_count++) + return 0; + if (!nouveau_bo_allocated(nvbo)) { if (nvbo->flags & (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART)) { ret = nouveau_bo_kalloc(nvbo, NULL); @@ -470,6 +473...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...23 insertions(+), 24 deletions(-) >> >> diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c >> index 1c723b9..d411523 100644 >> --- a/nouveau/nouveau.c >> +++ b/nouveau/nouveau.c >> @@ -349,8 +349,8 @@ nouveau_bo_del(struct nouveau_bo *bo) >> struct nouveau_bo_priv *nvbo = nouveau_bo(bo); >> struct drm_gem_close req = { bo->handle }; >> >> - pthread_mutex_lock(&nvdev->lock); >> - if (nvbo->name) { >> + if (nvbo->head.next) { >> + pthread_mutex_lock(&nvdev->lock)...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...>>> diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c >>>> index 1c723b9..d411523 100644 >>>> --- a/nouveau/nouveau.c >>>> +++ b/nouveau/nouveau.c >>>> @@ -349,8 +349,8 @@ nouveau_bo_del(struct nouveau_bo *bo) >>>> struct nouveau_bo_priv *nvbo = nouveau_bo(bo); >>>> struct drm_gem_close req = { bo->handle }; >>>> >>>> - pthread_mutex_lock(&nvdev->lock); >>>> - if (nvbo->name) { >>>> + if (nvbo->head.next) { >>>> +...
2015 Feb 26
4
[PATCH v2 1/4] Add atomic_inc_return to atomics.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at ubuntu.com> --- xf86atomic.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xf86atomic.h b/xf86atomic.h index 8c4b696..17fb088 100644 --- a/xf86atomic.h +++ b/xf86atomic.h @@ -49,6 +49,7 @@ typedef struct { # define atomic_read(x) ((x)->atomic) # define atomic_set(x, val) ((x)->atomic = (val)) # define atomic_inc(x)
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...u.c b/nouveau/nouveau.c >>>>>> index 1c723b9..d411523 100644 >>>>>> --- a/nouveau/nouveau.c >>>>>> +++ b/nouveau/nouveau.c >>>>>> @@ -349,8 +349,8 @@ nouveau_bo_del(struct nouveau_bo *bo) >>>>>> struct nouveau_bo_priv *nvbo = nouveau_bo(bo); >>>>>> struct drm_gem_close req = { bo->handle }; >>>>>> >>>>>> - pthread_mutex_lock(&nvdev->lock); >>>>>> - if (nvbo->name) { >>>>>> + if (nvbo-&...
2015 Feb 24
4
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...et = nouveau_bo_wrap_locked(dev, handle, pbo, 0); pthread_mutex_unlock(&nvdev->lock); return ret; } @@ -468,24 +474,13 @@ nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, struct nouveau_bo **pbo) { struct nouveau_device_priv *nvdev = nouveau_device(dev); - struct nouveau_bo_priv *nvbo; 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-...
2014 Mar 13
2
[PATCH] nouveau: safen up nouveau_device list usage against concurrent access
...ad_mutex_unlock(&nvdev->lock); free(pcli->kref); free(pcli); } @@ -331,9 +345,12 @@ nouveau_object_find(struct nouveau_object *obj, uint32_t pclass) static void nouveau_bo_del(struct nouveau_bo *bo) { + struct nouveau_device_priv *nvdev = nouveau_device(bo->device); struct nouveau_bo_priv *nvbo = nouveau_bo(bo); struct drm_gem_close req = { bo->handle }; + pthread_mutex_lock(&nvdev->lock); DRMLISTDEL(&nvbo->head); + pthread_mutex_unlock(&nvdev->lock); if (bo->map) munmap(bo->map, bo->size); drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOS...
2014 Apr 08
0
[PATCH] libdrm/nouveau: safen up nouveau libdrm against concurrent access
..._unlock(&nvdev->lock); free(pcli->kref); free(pcli); } @@ -331,12 +345,43 @@ nouveau_object_find(struct nouveau_object *obj, uint32_t pclass) static void nouveau_bo_del(struct nouveau_bo *bo) { + struct nouveau_device_priv *nvdev = nouveau_device(bo->device); struct nouveau_bo_priv *nvbo = nouveau_bo(bo); struct drm_gem_close req = { bo->handle }; - DRMLISTDEL(&nvbo->head); + + pthread_mutex_lock(&nvdev->lock); + if (nvbo->name) { + if (atomic_read(&bo->refcnt)) { + /* + * bo has been revived by a race with + * nouveau_bo_prime_handle_re...
2010 Jan 29
2
[PATCH 1/2] libdrm/nouveau: new optimized libdrm pushbuffer ABI
...ding(struct nouveau_bo *bo) struct drm_nouveau_gem_pushbuf_bo * nouveau_bo_emit_buffer(struct nouveau_channel *chan, struct nouveau_bo *bo) { - struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(chan->pushbuf); + struct nouveau_pushbuf_priv *nvpb = &nouveau_channel(chan)->pb; struct nouveau_bo_priv *nvbo = nouveau_bo(bo); struct drm_nouveau_gem_pushbuf_bo *pbbo; struct nouveau_bo *ref = NULL; diff --git a/nouveau/nouveau_channel.h b/nouveau/nouveau_channel.h index 294f749..ddcf8e4 100644 --- a/nouveau/nouveau_channel.h +++ b/nouveau/nouveau_channel.h @@ -29,11 +29,12 @@ struct nouveau_sub...
2015 Nov 26
18
[libdrm 01/13] nouveau: move more abi16-specific logic into abi16.c
...EL_CLASS)) { + if (obj->oclass == NOUVEAU_NOTIFIER_CLASS) { + *func = abi16_ntfy; + return true; + } + + *func = abi16_engobj; + return false; + } + + *func = NULL; + return false; +} + +drm_private void abi16_bo_info(struct nouveau_bo *bo, struct drm_nouveau_gem_info *info) { struct nouveau_bo_priv *nvbo = nouveau_bo(bo); diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index 97fd77b..8a0be2f 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -135,6 +135,7 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev) nvdev->gart_limit_percent = 80; DRMINITLISTHEAD(&...
2009 Dec 24
1
[PATCH] nouveau: when nouveau_bo_map fails you expect it to not be mapped
...tions(+), 7 deletions(-) diff --git a/nouveau/nouveau_bo.c b/nouveau/nouveau_bo.c index 10cc8a6..9a7c368 100644 --- a/nouveau/nouveau_bo.c +++ b/nouveau/nouveau_bo.c @@ -415,22 +415,28 @@ nouveau_bo_map_range(struct nouveau_bo *bo, uint32_t delta, uint32_t size, uint32_t flags) { struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - int ret; + int ret = 0; - if (!nvbo || bo->map) + if (!nvbo) return -EINVAL; + /* People should not double map, let's make sure they will notice. */ + if (bo->map) { + ret = -EINVAL; + goto out; + } + if (!nouveau_bo_allocated(nvbo)) { if (nvbo->...
2015 Nov 27
14
[libdrm v2 01/14] nouveau: import and install a selection of nvif headers from the kernel
From: Ben Skeggs <bskeggs at redhat.com> This commit also modifies the install path of the main libdrm_nouveau header to be under a nouveau/ subdirectory. Signed-off-by: Ben Skeggs <bskeggs at redhat.com> --- include/drm/nouveau_drm.h | 1 + nouveau/Makefile.am | 11 +++- nouveau/libdrm_nouveau.pc.in | 2 +- nouveau/nvif/cl0080.h | 45 ++++++++++++++
2015 Feb 25
0
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...unlock(&nvdev->lock); > return ret; > } > @@ -468,24 +474,13 @@ nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, > struct nouveau_bo **pbo) > { > struct nouveau_device_priv *nvdev = nouveau_device(dev); > - struct nouveau_bo_priv *nvbo; > 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...
2015 Feb 25
1
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...>> return ret; >> } >> @@ -468,24 +474,13 @@ nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, >> struct nouveau_bo **pbo) >> { >> struct nouveau_device_priv *nvdev = nouveau_device(dev); >> - struct nouveau_bo_priv *nvbo; >> struct drm_gem_open req = { .name = name }; >> int ret; >> >> pthread_mutex_lock(&nvdev->lock); >> - DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { >> - if (nvbo->name == name) { >>...
2015 Dec 16
16
[libdrm v3 01/14] nouveau: import and install a selection of nvif headers from the kernel
From: Ben Skeggs <bskeggs at redhat.com> This commit also modifies the install path of the main libdrm_nouveau header to be under a nouveau/ subdirectory. Signed-off-by: Ben Skeggs <bskeggs at redhat.com> --- include/drm/nouveau_drm.h | 1 + nouveau/Makefile.am | 11 +++- nouveau/libdrm_nouveau.pc.in | 2 +- nouveau/nvif/cl0080.h | 45 ++++++++++++++