Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228519
b: refs/heads/master
c: 21e86c1
h: refs/heads/master
i:
  228517: 77e2182
  228515: edfd376
  228511: 253ab30
v: v3
  • Loading branch information
Ben Skeggs committed Dec 3, 2010
1 parent a0a8211 commit db231fc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 63 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b12120a58e06cc6b799494c80215e418c14f9f5f
refs/heads/master: 21e86c1c8a844bf978f8fc431a59c9f5a578812d
1 change: 0 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/nouveau_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ struct nouveau_bo {
struct nouveau_tile_reg *tile;

struct drm_gem_object *gem;
struct drm_file *cpu_filp;
int pin_refcnt;
};

Expand Down
64 changes: 4 additions & 60 deletions trunk/drivers/gpu/drm/nouveau/nouveau_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ nouveau_gem_object_del(struct drm_gem_object *gem)
return;
nvbo->gem = NULL;

if (unlikely(nvbo->cpu_filp))
ttm_bo_synccpu_write_release(bo);

if (unlikely(nvbo->pin_refcnt)) {
nvbo->pin_refcnt = 1;
nouveau_bo_unpin(nvbo);
Expand Down Expand Up @@ -334,23 +331,6 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv,
validate_fini(op, NULL);
return -EINVAL;
}

if (unlikely(atomic_read(&nvbo->bo.cpu_writers) > 0)) {
validate_fini(op, NULL);

if (nvbo->cpu_filp == file_priv) {
NV_ERROR(dev, "bo %p mapped by process trying "
"to validate it!\n", nvbo);
return -EINVAL;
}

ret = ttm_bo_wait_cpu(&nvbo->bo, false);
if (ret) {
NV_ERROR(dev, "fail wait_cpu\n");
return ret;
}
goto retry;
}
}

return 0;
Expand Down Expand Up @@ -791,26 +771,9 @@ nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data,
return -ENOENT;
nvbo = nouveau_gem_object(gem);

if (nvbo->cpu_filp) {
if (nvbo->cpu_filp == file_priv)
goto out;

ret = ttm_bo_wait_cpu(&nvbo->bo, no_wait);
if (ret)
goto out;
}

if (req->flags & NOUVEAU_GEM_CPU_PREP_NOBLOCK) {
spin_lock(&nvbo->bo.bdev->fence_lock);
ret = ttm_bo_wait(&nvbo->bo, false, false, no_wait);
spin_unlock(&nvbo->bo.bdev->fence_lock);
} else {
ret = ttm_bo_synccpu_write_grab(&nvbo->bo, no_wait);
if (ret == 0)
nvbo->cpu_filp = file_priv;
}

out:
spin_lock(&nvbo->bo.bdev->fence_lock);
ret = ttm_bo_wait(&nvbo->bo, true, true, no_wait);
spin_unlock(&nvbo->bo.bdev->fence_lock);
drm_gem_object_unreference_unlocked(gem);
return ret;
}
Expand All @@ -819,26 +782,7 @@ int
nouveau_gem_ioctl_cpu_fini(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_nouveau_gem_cpu_prep *req = data;
struct drm_gem_object *gem;
struct nouveau_bo *nvbo;
int ret = -EINVAL;

gem = drm_gem_object_lookup(dev, file_priv, req->handle);
if (!gem)
return -ENOENT;
nvbo = nouveau_gem_object(gem);

if (nvbo->cpu_filp != file_priv)
goto out;
nvbo->cpu_filp = NULL;

ttm_bo_synccpu_write_release(&nvbo->bo);
ret = 0;

out:
drm_gem_object_unreference_unlocked(gem);
return ret;
return 0;
}

int
Expand Down
1 change: 0 additions & 1 deletion trunk/include/drm/nouveau_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ struct drm_nouveau_gem_pushbuf {
};

#define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001
#define NOUVEAU_GEM_CPU_PREP_NOBLOCK 0x00000002
#define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004
struct drm_nouveau_gem_cpu_prep {
uint32_t handle;
Expand Down

0 comments on commit db231fc

Please sign in to comment.