Displaying 20 results from an estimated 23 matches for "prime_fd".
2015 Nov 26
0
[libdrm 08/13] nouveau: make use of nouveau_drm::fd instead of nouveau_device::fd
...*name = nvbo->name;
if (!*name) {
- int ret = drmIoctl(bo->device->fd, DRM_IOCTL_GEM_FLINK, &req);
+ int ret = drmIoctl(drm->fd, DRM_IOCTL_GEM_FLINK, &req);
if (ret) {
*name = 0;
@@ -613,6 +608,7 @@ int
nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
struct nouveau_bo **bo)
{
+ struct nouveau_drm *drm = nouveau_drm(&dev->object);
struct nouveau_device_priv *nvdev = nouveau_device(dev);
int ret;
unsigned int handle;
@@ -620,7 +616,7 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
nouveau_bo_ref(N...
2015 Feb 24
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...req);
+ struct nouveau_device_priv *nvdev = nouveau_device(bo->device);
+
if (ret) {
*name = 0;
return ret;
}
nvbo->name = *name = req.name;
+
+ nouveau_bo_make_global(nvbo);
}
return 0;
}
@@ -533,16 +542,6 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
ret = drmPrimeFDToHandle(dev->fd, prime_fd, &handle);
if (ret == 0) {
ret = nouveau_bo_wrap_locked(dev, handle, bo, 0);
- if (!ret) {
- struct nouveau_bo_priv *nvbo = nouveau_bo(*bo);
- if (!nvbo->name) {
- /*
- * XXX: Force locked DRM_IOCTL_GEM_CLOSE
- * to rule o...
2014 Apr 08
0
[PATCH] libdrm/nouveau: safen up nouveau libdrm against concurrent access
...gt;fd, DRM_IOCTL_GEM_FLINK, &req);
- if (ret)
+ if (ret) {
+ *name = 0;
return ret;
- nvbo->name = req.name;
+ }
+ nvbo->name = *name = req.name;
}
- *name = nvbo->name;
return 0;
}
@@ -466,19 +531,18 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
int ret;
unsigned int handle;
- ret = drmPrimeFDToHandle(dev->fd, prime_fd, &handle);
- if (ret) {
- nouveau_bo_ref(NULL, bo);
- return ret;
- }
+ nouveau_bo_ref(NULL, bo);
- ret = nouveau_bo_wrap(dev, handle, bo);
- if (ret) {
- nouveau_bo_ref(NULL, bo);
- return ret;
+ pth...
2015 Dec 16
0
[libdrm v3 13/14] nouveau: clean up nouveau.h, noting deprecated members/functions
...int32_t access,
+ struct nouveau_client *);
+int nouveau_bo_wait(struct nouveau_bo *, uint32_t access,
struct nouveau_client *);
-int nouveau_bo_wait(struct nouveau_bo *, uint32_t access,
- struct nouveau_client *);
-int nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
- struct nouveau_bo **);
-int nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd);
+int nouveau_bo_prime_handle_ref(struct nouveau_device *, int prime_fd,
+ struct nouveau_bo **);
+int nouveau_bo_set_prime(struct nouveau_bo *, int *prime_fd);
+
+struct nouveau_list {
+ struct nouvea...
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)
2014 Jul 31
1
[libdrm PATCH 1/3] nouveau: Only export public functions.
..._public void
nouveau_bo_ref(struct nouveau_bo *bo, struct nouveau_bo **pref)
{
struct nouveau_bo *ref = *pref;
@@ -524,7 +524,7 @@ nouveau_bo_ref(struct nouveau_bo *bo, struct nouveau_bo **pref)
*pref = bo;
}
-int
+drm_public int
nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
struct nouveau_bo **bo)
{
@@ -553,7 +553,7 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
return ret;
}
-int
+drm_public int
nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd)
{
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
@@ -567,7 +567,7 @@ n...
2015 Feb 24
4
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...(ret == 0) {
- ret = nouveau_bo_wrap_locked(dev, req.handle, pbo);
- nouveau_bo((*pbo))->name = name;
+ ret = nouveau_bo_wrap_locked(dev, req.handle, pbo, name);
}
pthread_mutex_unlock(&nvdev->lock);
@@ -537,7 +532,7 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
pthread_mutex_lock(&nvdev->lock);
ret = drmPrimeFDToHandle(dev->fd, prime_fd, &handle);
if (ret == 0) {
- ret = nouveau_bo_wrap_locked(dev, handle, bo);
+ ret = nouveau_bo_wrap_locked(dev, handle, bo, 0);
if (!ret) {
struct nouveau_bo_priv *nvbo = nouveau_bo(*bo);...
2014 Sep 26
0
[RFC PATCH 7/7] drm/prime: Support explicit fence on export
...385,7 +387,7 @@ static struct dma_buf *export_and_register_object(struct drm_device *dev,
* @dev: dev to export the buffer from
* @file_priv: drm file-private structure
* @handle: buffer handle to export
- * @flags: flags like DRM_CLOEXEC
+ * @flags: flags like DRM_CLOEXEC or DRM_SYNC_FD
* @prime_fd: pointer to storage for the fd id of the create dma-buf
*
* This is the PRIME export function which must be used mandatorily by GEM
@@ -401,6 +403,24 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev,
struct drm_gem_object *obj;
int ret = 0;
struct dma_buf *dmabuf;
+ struct fence *...
2024 Jun 18
1
[PATCH v2 3/8] rust: drm: add driver abstractions
...) -> *mut bindings::drm_gem_object,
+ >,
+ pub(crate) prime_handle_to_fd: Option<
+ unsafe extern "C" fn(
+ dev: *mut bindings::drm_device,
+ file_priv: *mut bindings::drm_file,
+ handle: u32,
+ flags: u32,
+ prime_fd: *mut core::ffi::c_int,
+ ) -> core::ffi::c_int,
+ >,
+ pub(crate) prime_fd_to_handle: Option<
+ unsafe extern "C" fn(
+ dev: *mut bindings::drm_device,
+ file_priv: *mut bindings::drm_file,
+ prime_fd: core::ffi::c_int,
+...
2024 Sep 02
2
[PATCH v2 3/8] rust: drm: add driver abstractions
...t,
> + >,
> + pub(crate) prime_handle_to_fd: Option<
> + unsafe extern "C" fn(
> + dev: *mut bindings::drm_device,
> + file_priv: *mut bindings::drm_file,
> + handle: u32,
> + flags: u32,
> + prime_fd: *mut core::ffi::c_int,
> + ) -> core::ffi::c_int,
> + >,
> + pub(crate) prime_fd_to_handle: Option<
> + unsafe extern "C" fn(
> + dev: *mut bindings::drm_device,
> + file_priv: *mut bindings::drm_file,
> +...
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
2014 Sep 29
1
[RFC PATCH 7/7] drm/prime: Support explicit fence on export
...dma_buf *export_and_register_object(struct drm_device *dev,
> * @dev: dev to export the buffer from
> * @file_priv: drm file-private structure
> * @handle: buffer handle to export
> - * @flags: flags like DRM_CLOEXEC
> + * @flags: flags like DRM_CLOEXEC or DRM_SYNC_FD
> * @prime_fd: pointer to storage for the fd id of the create dma-buf
> *
> * This is the PRIME export function which must be used mandatorily by GEM
> @@ -401,6 +403,24 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev,
> struct drm_gem_object *obj;
> int ret = 0;
> struct dma...
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 ++++++++++++++
2015 Feb 25
0
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...);
> - nouveau_bo((*pbo))->name = name;
> + ret = nouveau_bo_wrap_locked(dev, req.handle, pbo, name);
> }
>
> pthread_mutex_unlock(&nvdev->lock);
> @@ -537,7 +532,7 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
> pthread_mutex_lock(&nvdev->lock);
> ret = drmPrimeFDToHandle(dev->fd, prime_fd, &handle);
> if (ret == 0) {
> - ret = nouveau_bo_wrap_locked(dev, handle, bo);
> + ret = nouveau_bo_wrap_locked(dev, handle, bo, 0);
&g...
2015 Feb 25
1
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...nouveau_bo((*pbo))->name = name;
>> + ret = nouveau_bo_wrap_locked(dev, req.handle, pbo, name);
>> }
>>
>> pthread_mutex_unlock(&nvdev->lock);
>> @@ -537,7 +532,7 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
>> pthread_mutex_lock(&nvdev->lock);
>> ret = drmPrimeFDToHandle(dev->fd, prime_fd, &handle);
>> if (ret == 0) {
>> - ret = nouveau_bo_wrap_locked(dev, handle, bo);
>> + ret = nouveau_bo_wrap_locked(dev...
2020 Aug 13
1
[PATCH 20/20] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver
...> *
> @@ -361,6 +337,7 @@ struct drm_driver {
> */
> struct drm_gem_object *(*gem_create_object)(struct drm_device *dev,
> size_t size);
> +
> /**
> * @prime_handle_to_fd:
> *
> @@ -383,14 +360,7 @@ struct drm_driver {
> */
> int (*prime_fd_to_handle)(struct drm_device *dev, struct drm_file *file_priv,
> int prime_fd, uint32_t *handle);
> - /**
> - * @gem_prime_export:
> - *
> - * Export hook for GEM drivers. Deprecated in favour of
> - * &drm_gem_object_funcs.export.
> - */
> - struct dma_buf * (...
2014 Sep 26
14
[RFC] Explicit synchronization for Nouveau
Hi guys,
I'd like to start a new thread about explicit fence synchronization. This time
with a Nouveau twist. :-)
First, let me define what I understand by implicit/explicit sync:
Implicit synchronization
* Fences are attached to buffers
* Kernel manages fences automatically based on buffer read/write access
Explicit synchronization
* Fences are passed around independently
* Kernel takes
2020 Aug 13
0
[PATCH 20/20] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver
.../**
* @gem_create_object: constructor for gem objects
*
@@ -361,6 +337,7 @@ struct drm_driver {
*/
struct drm_gem_object *(*gem_create_object)(struct drm_device *dev,
size_t size);
+
/**
* @prime_handle_to_fd:
*
@@ -383,14 +360,7 @@ struct drm_driver {
*/
int (*prime_fd_to_handle)(struct drm_device *dev, struct drm_file *file_priv,
int prime_fd, uint32_t *handle);
- /**
- * @gem_prime_export:
- *
- * Export hook for GEM drivers. Deprecated in favour of
- * &drm_gem_object_funcs.export.
- */
- struct dma_buf * (*gem_prime_export)(struct drm_gem_object...
2020 Sep 15
0
[PATCH v2 21/21] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver
.../**
* @gem_create_object: constructor for gem objects
*
@@ -360,6 +336,7 @@ struct drm_driver {
*/
struct drm_gem_object *(*gem_create_object)(struct drm_device *dev,
size_t size);
+
/**
* @prime_handle_to_fd:
*
@@ -382,14 +359,7 @@ struct drm_driver {
*/
int (*prime_fd_to_handle)(struct drm_device *dev, struct drm_file *file_priv,
int prime_fd, uint32_t *handle);
- /**
- * @gem_prime_export:
- *
- * Export hook for GEM drivers. Deprecated in favour of
- * &drm_gem_object_funcs.export.
- */
- struct dma_buf * (*gem_prime_export)(struct drm_gem_object...