diff options
| author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-08-22 09:15:57 +0300 | 
|---|---|---|
| committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-08-22 10:53:42 +0300 | 
| commit | 1f7fd484fff1b432373f0d0682fb0e2015113161 (patch) | |
| tree | 1154402998a28db068e05c7960f6d09fe249c3dc /drivers/gpu/drm/i915/i915_gem.c | |
| parent | b7d151ba4b295abdc9736eed3fb85cd475f2c883 (diff) | |
| download | linux-1f7fd484fff1b432373f0d0682fb0e2015113161.tar.xz | |
drm/i915: Replace i915_vma_put_fence()
Avoid calling i915_vma_put_fence() by using our alternate paths that
bind a secondary vma avoiding the original fenced vma. For the few
instances where we need to release the fence (i.e. on binding when the
GGTT range becomes invalid), replace the put_fence with a revoke_fence.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190822061557.18402-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 36 | 
1 files changed, 14 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 68976689d569..eb31b69a316a 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -343,20 +343,16 @@ i915_gem_gtt_pread(struct drm_i915_gem_object *obj,  		return ret;  	wakeref = intel_runtime_pm_get(&i915->runtime_pm); -	vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, -				       PIN_MAPPABLE | -				       PIN_NONBLOCK /* NOWARN */ | -				       PIN_NOEVICT); +	vma = ERR_PTR(-ENODEV); +	if (!i915_gem_object_is_tiled(obj)) +		vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, +					       PIN_MAPPABLE | +					       PIN_NONBLOCK /* NOWARN */ | +					       PIN_NOEVICT);  	if (!IS_ERR(vma)) {  		node.start = i915_ggtt_offset(vma);  		node.allocated = false; -		ret = i915_vma_put_fence(vma); -		if (ret) { -			i915_vma_unpin(vma); -			vma = ERR_PTR(ret); -		} -	} -	if (IS_ERR(vma)) { +	} else {  		ret = insert_mappable_node(ggtt, &node, PAGE_SIZE);  		if (ret)  			goto out_unlock; @@ -557,20 +553,16 @@ i915_gem_gtt_pwrite_fast(struct drm_i915_gem_object *obj,  		wakeref = intel_runtime_pm_get(rpm);  	} -	vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, -				       PIN_MAPPABLE | -				       PIN_NONBLOCK /* NOWARN */ | -				       PIN_NOEVICT); +	vma = ERR_PTR(-ENODEV); +	if (!i915_gem_object_is_tiled(obj)) +		vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, +					       PIN_MAPPABLE | +					       PIN_NONBLOCK /* NOWARN */ | +					       PIN_NOEVICT);  	if (!IS_ERR(vma)) {  		node.start = i915_ggtt_offset(vma);  		node.allocated = false; -		ret = i915_vma_put_fence(vma); -		if (ret) { -			i915_vma_unpin(vma); -			vma = ERR_PTR(ret); -		} -	} -	if (IS_ERR(vma)) { +	} else {  		ret = insert_mappable_node(ggtt, &node, PAGE_SIZE);  		if (ret)  			goto out_rpm;  | 
