search for: nouveau_device_priv

Displaying 20 results from an estimated 23 matches for "nouveau_device_priv".

2015 Feb 25
2
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...SE, &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_bo_priv *nvbo = calloc(1, sizeof(*nvbo)); > struct nouveau_bo *bo = &nvbo->base; > int ret; > @@ -397,10 +394,6 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, uint32_t align, >...
2015 Feb 25
2
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...>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_bo_priv *nvbo = calloc(1, sizeof(*nvbo)); > >> struct nouveau_bo *bo = &nvbo->base; > >> int ret; > >> @@ -397,10 +394,6 @@ nouveau_bo_new(struct nouveau_device *dev, > uint32_t f...
2015 Nov 26
0
[libdrm 07/13] nouveau: stack legacy nouveau_device on top of nouveau_drm
...veau/nouveau.c b/nouveau/nouveau.c index 9f82fde..e304a1b 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -244,39 +244,36 @@ nouveau_device_open_existing(struct nouveau_device **pdev, int close, int fd, int nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev) { - struct nouveau_device_priv *nvdev = calloc(1, sizeof(*nvdev)); - struct nouveau_device *dev = &nvdev->base; + struct nouveau_drm *drm; + struct nouveau_device_priv *nvdev; + struct nouveau_device *dev; uint64_t chipset, vram, gart, bousage; - drmVersionPtr ver; int ret; char *tmp; -#ifdef DEBUG - debug_init(ge...
2014 Apr 08
0
[PATCH] libdrm/nouveau: safen up nouveau libdrm against concurrent access
...v->client[id / 32] &= ~(1 << (id % 32)); + pthread_mutex_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...
2015 Feb 24
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...ev->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_bo_priv *nvbo = calloc(1, sizeof(*nvbo)); struct nouveau_bo *bo = &nvbo->base; int ret; @@ -397,10 +394,6 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, uint32_t align, return ret; } - pthread_mutex_lock(&nvdev->...
2015 Feb 25
3
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...veau_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_bo_priv *nvbo = calloc(1, sizeof(*nvbo)); > >>>> struct nouveau_bo *bo = &nvbo->base; > >>>> int ret; > >>>> @@ -397,10 +394,6 @@ nouveau_bo_new(struct nouv...
2015 Feb 24
4
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...MLISTDEL(&nvbo->head); @@ -418,7 +407,7 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, uint32_t align, static int nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle, - struct nouveau_bo **pbo) + struct nouveau_bo **pbo, int name) { struct nouveau_device_priv *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; -...
2014 Mar 13
2
[PATCH] nouveau: safen up nouveau_device list usage against concurrent access
...nvdev->client[id / 32] &= ~(1 << (id % 32)); + pthread_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,...
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
...); + return drmCommandWrite(drm->fd, DRM_NOUVEAU_SETPARAM, &r, 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. */ - d...
2009 May 24
1
[Bug 21908] New: SIGSEGV when no kernel DRM present
...xperienced SIGSEGV when no kernel-side DRM is present. The component version: xserver: 1.5.3 libdrm: 2.4.9 xf86-video-nouveau: git from 13/04/2009 The problem was narrowed down to nv_driver.c:NVMapMemSW() - the function declares 'struct nouveau_device', which in fact, should be 'struct nouveau_device_priv' for DRM related functions to work properly. The crashes were related to the accesses to 'mm_enabled' field of 'struct nouveau_device_priv', which points to a garbage when only 'struct nouveau_device' declared. Attached patch (against git from 13/04/2009) solved the pr...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...} >> 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_bo_priv *nvbo = calloc(1, sizeof(*nvbo)); >> struct nouveau_bo *bo = &nvbo->base; >> int ret; >> @@ -397,10 +394,6 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, uint32_t align, &gt...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...t;> @@ -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_bo_priv *nvbo = calloc(1, sizeof(*nvbo)); >>>> struct nouveau_bo *bo = &nvbo->base; >>>> int ret; >>>> @@ -397,10 +394,6 @@ nouveau_bo_new(struct nouveau_device *dev, &gt...
2014 Jul 31
1
[libdrm PATCH 1/3] nouveau: Only export public functions.
...m, but the DRI driver against the old */ -int +drm_public int nouveau_device_open_existing(struct nouveau_device **pdev, int close, int fd, drm_context_t ctx) { return -EACCES; } -int +drm_public int nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev) { struct nouveau_device_priv *nvdev = calloc(1, sizeof(*nvdev)); @@ -147,7 +147,7 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev) return 0; } -int +drm_public int nouveau_device_open(const char *busid, struct nouveau_device **pdev) { int ret = -ENODEV, fd = drmOpen("nouveau", busid);...
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...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_bo_priv *nvbo = calloc(1, sizeof(*nvbo)); >>>>>> struct nouveau_bo *bo = &nvbo->base; >>>>>> int ret; >>>>>> @@ -397,10 +394,6 @@ nouveau_bo_new...
2015 Feb 25
0
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...struct nouveau_device *dev, uint32_t flags, uint32_t align, > > static int > nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle, > - struct nouveau_bo **pbo) > + struct nouveau_bo **pbo, int name) > { > struct nouveau_device_priv *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-...
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
1
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...uint32_t flags, uint32_t align, >> >> static int >> nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle, >> - struct nouveau_bo **pbo) >> + struct nouveau_bo **pbo, int name) >> { >> struct nouveau_device_priv *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) { >>...
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
2010 Jan 17
0
[PATCH] libdrm/nouveau: Support nested bo mapping
...& (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART)) { ret = nouveau_bo_kalloc(nvbo, NULL); @@ -470,6 +473,9 @@ nouveau_bo_unmap(struct nouveau_bo *bo) { struct nouveau_bo_priv *nvbo = nouveau_bo(bo); + if(--nvbo->map_count) + return 0; + if (bo->map && !nvbo->sysmem) { struct nouveau_device_priv *nvdev = nouveau_device(bo->device); struct drm_nouveau_gem_cpu_fini req; diff --git a/nouveau/nouveau_private.h b/nouveau/nouveau_private.h index 39758d1..512bc1e 100644 --- a/nouveau/nouveau_private.h +++ b/nouveau/nouveau_private.h @@ -115,6 +115,7 @@ struct nouveau_bo_priv { drm_handle_...