diff options
| author | Grant Likely <grant.likely@secretlab.ca> | 2012-02-28 13:48:58 -0600 | 
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2012-02-28 13:48:58 -0600 | 
| commit | b3950d50cfc343b3e7dc5c69c96a61b182fd1e37 (patch) | |
| tree | d54affae2b1e25464493b48aa88cd8d6b4770812 /drivers/gpu/drm/nouveau/nouveau_gem.c | |
| parent | daefd89efc279b142bbb054577c2d706da211723 (diff) | |
| parent | 280ad7fda5f95211857fda38960f2b6fdf6edd3e (diff) | |
| download | olio-linux-3.10-b3950d50cfc343b3e7dc5c69c96a61b182fd1e37.tar.xz olio-linux-3.10-b3950d50cfc343b3e7dc5c69c96a61b182fd1e37.zip  | |
Merge branch 'irqdomain/next' into gpio/next
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_gem.c')
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_gem.c | 23 | 
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 5f0bc57fdaa..7ce3fde4074 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -380,6 +380,25 @@ retry:  }  static int +validate_sync(struct nouveau_channel *chan, struct nouveau_bo *nvbo) +{ +	struct nouveau_fence *fence = NULL; +	int ret = 0; + +	spin_lock(&nvbo->bo.bdev->fence_lock); +	if (nvbo->bo.sync_obj) +		fence = nouveau_fence_ref(nvbo->bo.sync_obj); +	spin_unlock(&nvbo->bo.bdev->fence_lock); + +	if (fence) { +		ret = nouveau_fence_sync(fence, chan); +		nouveau_fence_unref(&fence); +	} + +	return ret; +} + +static int  validate_list(struct nouveau_channel *chan, struct list_head *list,  	      struct drm_nouveau_gem_pushbuf_bo *pbbo, uint64_t user_pbbo_ptr)  { @@ -393,7 +412,7 @@ validate_list(struct nouveau_channel *chan, struct list_head *list,  	list_for_each_entry(nvbo, list, entry) {  		struct drm_nouveau_gem_pushbuf_bo *b = &pbbo[nvbo->pbbo_index]; -		ret = nouveau_fence_sync(nvbo->bo.sync_obj, chan); +		ret = validate_sync(chan, nvbo);  		if (unlikely(ret)) {  			NV_ERROR(dev, "fail pre-validate sync\n");  			return ret; @@ -416,7 +435,7 @@ validate_list(struct nouveau_channel *chan, struct list_head *list,  			return ret;  		} -		ret = nouveau_fence_sync(nvbo->bo.sync_obj, chan); +		ret = validate_sync(chan, nvbo);  		if (unlikely(ret)) {  			NV_ERROR(dev, "fail post-validate sync\n");  			return ret;  |