Re: [PATCH] drm/i915: Skip fence installation for objects with rotated views (v4)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 30 Oct 2015, Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> wrote:
> On Thu, Oct 29, 2015 at 06:54:38PM -0700, Vivek Kasireddy wrote:
>> While pinning a fb object to the display plane, only install a fence
>> if the object is using a normal view. This corresponds with the
>> behavior found in i915_gem_object_do_pin() where the fencability
>> criteria is determined only for objects with normal views.
>> 
>> v2:
>> Look at the object's map_and_fenceable flag to determine whether to
>> install a fence or not (Chris).
>> 
>> v3:
>> Pin and unpin a fence only if the current view type is normal.
>> 
>> v4:
>> Extend the "view type is normal" check for pin_fence as well.
>> 
>> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
>> Cc: Ville Syrjala <ville.syrjala@xxxxxxxxxxxxxxx>
>> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@xxxxxxxxx>
>
> lgtm
> Reviewed-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Pushed to drm-intel-next-fixes, thanks for the patch and review.

BR,
Jani.

>
>> ---
>>  drivers/gpu/drm/i915/intel_display.c | 36 ++++++++++++++++++++----------------
>>  1 file changed, 20 insertions(+), 16 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 2fdfca1..9c80968 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -2419,22 +2419,24 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
>>  	 * framebuffer compression.  For simplicity, we always install
>>  	 * a fence as the cost is not that onerous.
>>  	 */
>> -	ret = i915_gem_object_get_fence(obj);
>> -	if (ret == -EDEADLK) {
>> -		/*
>> -		 * -EDEADLK means there are no free fences
>> -		 * no pending flips.
>> -		 *
>> -		 * This is propagated to atomic, but it uses
>> -		 * -EDEADLK to force a locking recovery, so
>> -		 * change the returned error to -EBUSY.
>> -		 */
>> -		ret = -EBUSY;
>> -		goto err_unpin;
>> -	} else if (ret)
>> -		goto err_unpin;
>> +	if (view.type == I915_GGTT_VIEW_NORMAL) {
>> +		ret = i915_gem_object_get_fence(obj);
>> +		if (ret == -EDEADLK) {
>> +			/*
>> +			 * -EDEADLK means there are no free fences
>> +			 * no pending flips.
>> +			 *
>> +			 * This is propagated to atomic, but it uses
>> +			 * -EDEADLK to force a locking recovery, so
>> +			 * change the returned error to -EBUSY.
>> +			 */
>> +			ret = -EBUSY;
>> +			goto err_unpin;
>> +		} else if (ret)
>> +			goto err_unpin;
>>  
>> -	i915_gem_object_pin_fence(obj);
>> +		i915_gem_object_pin_fence(obj);
>> +	}
>>  
>>  	dev_priv->mm.interruptible = true;
>>  	intel_runtime_pm_put(dev_priv);
>> @@ -2460,7 +2462,9 @@ static void intel_unpin_fb_obj(struct drm_framebuffer *fb,
>>  	ret = intel_fill_fb_ggtt_view(&view, fb, plane_state);
>>  	WARN_ONCE(ret, "Couldn't get view from plane state!");
>>  
>> -	i915_gem_object_unpin_fence(obj);
>> +	if (view.type == I915_GGTT_VIEW_NORMAL)
>> +		i915_gem_object_unpin_fence(obj);
>> +
>>  	i915_gem_object_unpin_from_display_plane(obj, &view);
>>  }
>>  
>> -- 
>> 2.4.3

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux