Displaying 18 results from an estimated 18 matches for "drm_ioctl_gem_close".
2014 Apr 08
0
[PATCH] libdrm/nouveau: safen up nouveau libdrm against concurrent access
Based on the original patch by Ilia Mirkin.
Handle races between nouveau_bo_name_get, nouveau_bo_prime_handle_ref and unreffing.
Because DRM_IOCTL_GEM_CLOSE is not refcounted, some special care was needed by holding
the lock during some ioctls.
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
---
---
nouveau/nouveau.c | 108 +++++++++++++++++++++++++++++++++++++++++...
2015 Feb 24
4
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...red bo is
+ * closed and re-opened in another thread a race
+ * against DRM_IOCTL_GEM_OPEN or drmPrimeFDToHandle
+ * might cause the bo to be closed accidentally while
+ * re-importing.
*/
- pthread_mutex_unlock(&nvdev->lock);
- return;
+ drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
}
- DRMLISTDEL(&nvbo->head);
- /*
- * This bo has to be closed with the lock held because gem
- * handles are not refcounted. If a shared bo is closed and
- * re-opened in another thread a race against
- * DRM_IOCTL_GEM_OPEN or drmPrimeFDToHandle might cause the
-...
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 Nov 26
0
[libdrm 08/13] nouveau: make use of nouveau_drm::fd instead of nouveau_device::fd
...t;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, &req);
}
pthread_mutex_unlock(&nvdev->lock);
} else {
- drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
+ drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &req);
}
if (bo->map)
drm_munmap(bo->map...
2015 Feb 25
2
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...truct nouveau_bo *bo)
> }
> pthread_mutex_unlock(&nvdev->lock);
> } else {
> - DRMLISTDEL(&nvbo->head);
> - pthread_mutex_unlock(&nvdev->lock);
> drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
> }
> if (bo->map)
> @@ -379,7 +377,6 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, uint32_t align,
> uint64_t size, union nouveau_bo_config *config,
> struct nouveau_bo **pbo)
> {
> - struct no...
2015 Feb 25
0
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...might cause the bo to be closed accidentally while
> + * re-importing.
> */
> - pthread_mutex_unlock(&nvdev->lock);
> - return;
> + drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
> }
> - DRMLISTDEL(&nvbo->head);
> - /*
> - * This bo has to be closed with the lock held because gem
> - * handles are not refcounted. If a shared bo is closed and
> - * re...
2015 Feb 24
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...o->refcnt) == 0) {
DRMLISTDEL(&nvbo->head);
/*
@@ -365,8 +365,6 @@ nouveau_bo_del(struct nouveau_bo *bo)
}
pthread_mutex_unlock(&nvdev->lock);
} else {
- DRMLISTDEL(&nvbo->head);
- pthread_mutex_unlock(&nvdev->lock);
drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
}
if (bo->map)
@@ -379,7 +377,6 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, uint32_t align,
uint64_t size, union nouveau_bo_config *config,
struct nouveau_bo **pbo)
{
- struct nouveau_device_priv *nvdev = nouveau_device(dev);
struct nouveau_...
2015 Feb 25
2
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...> >> pthread_mutex_unlock(&nvdev->lock);
> >> } else {
> >> - DRMLISTDEL(&nvbo->head);
> >> - pthread_mutex_unlock(&nvdev->lock);
> >> drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
> >> }
> >> if (bo->map)
> >> @@ -379,7 +377,6 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t
> flags, uint32_t align,
> >> uint64_t size, union nouveau_bo_config *config,
> >> struc...
2015 Feb 25
1
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...to be closed accidentally while
>> + * re-importing.
>> */
>> - pthread_mutex_unlock(&nvdev->lock);
>> - return;
>> + drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
>> }
>> - DRMLISTDEL(&nvbo->head);
>> - /*
>> - * This bo has to be closed with the lock held because gem
>> - * handles are not refcounted. If a shared bo is closed and
>&g...
2015 Feb 25
3
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...hread_mutex_unlock(&nvdev->lock);
> >>>> } else {
> >>>> - DRMLISTDEL(&nvbo->head);
> >>>> - pthread_mutex_unlock(&nvdev->lock);
> >>>> drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
> >>>> }
> >>>> if (bo->map)
> >>>> @@ -379,7 +377,6 @@ nouveau_bo_new(struct nouveau_device *dev,
> uint32_t
> >> flags, uint32_t align,
> >>>> uint64_t size, union nouveau_bo_conf...
2014 Mar 13
2
[PATCH] nouveau: safen up nouveau_device list usage against concurrent access
...ct 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_new(struct nouveau_device *dev, uint32_t flags, uint32_t align,
return ret;
}
+ pthread_mutex_lock(&nvdev->lock);
DRMLISTADD(&nvbo->head, &nvdev->bo_list);
+ pthread_mutex_unlock(&nvdev->lock);
*pbo = bo;
return 0...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...t;> }
>> pthread_mutex_unlock(&nvdev->lock);
>> } else {
>> - DRMLISTDEL(&nvbo->head);
>> - pthread_mutex_unlock(&nvdev->lock);
>> drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
>> }
>> if (bo->map)
>> @@ -379,7 +377,6 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, uint32_t align,
>> uint64_t size, union nouveau_bo_config *config,
>> struct nouveau_bo **pbo)
>>...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...; pthread_mutex_unlock(&nvdev->lock);
>>>> } else {
>>>> - DRMLISTDEL(&nvbo->head);
>>>> - pthread_mutex_unlock(&nvdev->lock);
>>>> drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
>>>> }
>>>> if (bo->map)
>>>> @@ -379,7 +377,6 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t
>> flags, uint32_t align,
>>>> uint64_t size, union nouveau_bo_config *config,
>>>>...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...unlock(&nvdev->lock);
>>>>>> } else {
>>>>>> - DRMLISTDEL(&nvbo->head);
>>>>>> - pthread_mutex_unlock(&nvdev->lock);
>>>>>> drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
>>>>>> }
>>>>>> if (bo->map)
>>>>>> @@ -379,7 +377,6 @@ nouveau_bo_new(struct nouveau_device *dev,
>> uint32_t
>>>> flags, uint32_t align,
>>>>>> uint64_t size, un...
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 ++++++++++++++
2019 Apr 04
1
Proof of concept for GPU forwarding for Linux guest on Linux host.
Hi,
This is a proof of concept of GPU forwarding for Linux guest on Linux host.
I'd like to get comments and suggestions from community before I put more
time on it. To summarize what it is:
1. It's a solution to bring GPU acceleration for Linux vm guest on Linux host.
It could works with different GPU although the current proof of concept only
works with Intel GPU.
2. The basic idea