search for: drm_gem_close

Displaying 15 results from an estimated 15 matches for "drm_gem_close".

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_mutex_lock(&nvdev->lock); > if (atomic_read(&nvbo->refcnt) == 0) { >...
2015 Feb 25
2
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...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 (a...
2015 Feb 25
3
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...411523 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->lo...
2014 Mar 13
2
[PATCH] nouveau: safen up nouveau_device list usage against concurrent access
...i->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_CLOSE, &req); @@ -363,7 +380,9 @@ nouveau_bo_ne...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...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->refcn...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...>> 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 24
0
[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); if (atomic_read(&nvbo->refcnt) == 0) { DRMLISTDEL(&nvbo->head); /* @@ -365,8 +365,6 @@ nouveau_bo_del(struct...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...gt;>>>>> --- 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(&a...
2014 Apr 08
0
[PATCH] libdrm/nouveau: safen up nouveau libdrm against concurrent access
...ef); 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_ref, or nouveau_bo_name_ref. + * + * In theo...
2015 Nov 26
0
[libdrm 08/13] nouveau: make use of nouveau_drm::fd instead of nouveau_device::fd
...u_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); + drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &amp...
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 24
4
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
While I've closed off most races in a previous patch, a small race still existed where importing then unreffing cound cause an invalid bo. Add a test for this case. Racing sequence fixed: - thread 1 releases bo, refcount drops to zero, blocks on acquiring nvdev->lock. - thread 2 increases refcount to 1. - thread 2 decreases refcount to zero, blocks on acquiring nvdev->lock. At this
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 Nov 26
18
[libdrm 01/13] nouveau: move more abi16-specific logic into abi16.c
From: Ben Skeggs <bskeggs at redhat.com> Signed-off-by: Ben Skeggs <bskeggs at redhat.com> --- nouveau/abi16.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++----- nouveau/nouveau.c | 56 +++++++------------------------------------------ nouveau/private.h | 7 ++----- 3 files changed, 67 insertions(+), 58 deletions(-) diff --git a/nouveau/abi16.c b/nouveau/abi16.c index
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 ++++++++++++++