Displaying 20 results from an estimated 50 matches for "nvdev".
Did you mean:
mvdev
2014 Mar 13
2
[PATCH] nouveau: safen up nouveau_device list usage against concurrent access
...au/private.h | 3 ++-
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index ee7893b..72c31cf 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -85,6 +85,12 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev)
if (!nvdev)
return -ENOMEM;
+ ret = pthread_mutex_init(&nvdev->lock, NULL);
+ if (ret) {
+ free(nvdev);
+ return ret;
+ }
+
nvdev->base.fd = fd;
ver = drmGetVersion(fd);
@@ -161,6 +167,7 @@ nouveau_device_del(struct nouveau_device **pdev)
if (nvdev->close)
drmClose(nvdev->bas...
2015 Nov 26
0
[libdrm 07/13] nouveau: stack legacy nouveau_device on top of nouveau_drm
...eau/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(getenv(&q...
2014 Apr 08
0
[PATCH] libdrm/nouveau: safen up nouveau libdrm against concurrent access
...rivate.h | 3 +-
2 files changed, 89 insertions(+), 22 deletions(-)
diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index ee7893b..75dfb0e 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -85,6 +85,12 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev)
if (!nvdev)
return -ENOMEM;
+ ret = pthread_mutex_init(&nvdev->lock, NULL);
+ if (ret) {
+ free(nvdev);
+ return ret;
+ }
+
nvdev->base.fd = fd;
ver = drmGetVersion(fd);
@@ -161,6 +167,7 @@ nouveau_device_del(struct nouveau_device **pdev)
if (nvdev->close)
drmClose(nvdev-&...
2015 Feb 25
2
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...9..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 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 point the 2 threads will clean up the same bo.
How is this fixed? When thread 2 increases refcount to 1 it removes
the bo from the list, and creates a new bo. The origi...
2015 Feb 25
2
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...t;> +++ 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(&...
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 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
...rm_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(&nvdev->bo_list);
nvdev->base.object.oclass = NOUVEAU_DEVICE_CLASS;
+ nvdev->base.object.length = ~0;
nvdev->base.lib_version = 0x01000000;
nvdev->base.chipset = chipset;
nvdev->base.vram_size = vram;
@@ -251,8 +252,8 @@ n...
2015 Feb 25
3
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...>>> @@ -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 24
0
[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) {
+ pthread_mutex_lock(&nvdev->lock);
if (atomic_read(&nvbo->refcnt) == 0) {
DRMLISTDEL(&nvbo->head);
/*
@@ -365,8 +365,6 @@ nouveau_bo_del(struct nouveau_bo *bo)
}
pthread_mutex_unlock(&nvdev->...
2015 Feb 25
0
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...t; wrote:
> 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 point the 2 threads will clean up the same bo.
>
> How is this fixed? When thread 2 increases refcount to 1 it removes
> the bo from the list...
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
1
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...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 point the 2 threads will clean up the same bo.
>>
>> How is this fixed? When thread 2 increases refcount to 1 it removes
&...
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
>> @@ -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
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...uveau/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) {
>>>>...
2009 Jul 25
2
[RFC] patch 0/4: DRM MMIO accessor cleanup
Hi,
this is continuation for the MMIO accessor rewrite and cleanup.
I am currently running nv28 with these patches applied, but
I cannot test on PPC.
Please, review and comment. If the direction is good, I'll do the
same to INSTANCE_{RD,WR} as I did for nv_{rd,wr}32, and change
PRAMIN from drm_local_map to simple ioremap.
Can the same be done for channel specific mappings, that is
2015 Feb 25
0
[PATCH 2/2] nouveau: Do not add most bo's to the global bo list.
...@@ -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) {
>&g...
2016 Oct 20
4
[PATCH net-next v2 6/9] net: use core MTU range checking in virt drivers
...MB */
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index f0919bd..3b28cf1 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -872,19 +872,12 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
struct netvsc_device *nvdev = ndevctx->nvdev;
struct hv_device *hdev = ndevctx->device_ctx;
struct netvsc_device_info device_info;
- int limit = ETH_DATA_LEN;
u32 num_chn;
int ret = 0;
if (ndevctx->start_remove || !nvdev || nvdev->destroy)
return -ENODEV;
- if (nvdev->nvsp_version >= NVSP_PR...
2016 Oct 20
4
[PATCH net-next v2 6/9] net: use core MTU range checking in virt drivers
...MB */
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index f0919bd..3b28cf1 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -872,19 +872,12 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
struct netvsc_device *nvdev = ndevctx->nvdev;
struct hv_device *hdev = ndevctx->device_ctx;
struct netvsc_device_info device_info;
- int limit = ETH_DATA_LEN;
u32 num_chn;
int ret = 0;
if (ndevctx->start_remove || !nvdev || nvdev->destroy)
return -ENODEV;
- if (nvdev->nvsp_version >= NVSP_PR...