Commit 9807216f authored by Vivek Kasireddy's avatar Vivek Kasireddy Committed by Jani Nikula

drm/i915: Skip fence installation for objects with rotated views (v4)

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@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarVille Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarVivek Kasireddy <vivek.kasireddy@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1446170078-20792-1-git-send-email-vivek.kasireddy@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 9be64eee
...@@ -2389,22 +2389,24 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane, ...@@ -2389,22 +2389,24 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
* framebuffer compression. For simplicity, we always install * framebuffer compression. For simplicity, we always install
* a fence as the cost is not that onerous. * a fence as the cost is not that onerous.
*/ */
ret = i915_gem_object_get_fence(obj); if (view.type == I915_GGTT_VIEW_NORMAL) {
if (ret == -EDEADLK) { ret = i915_gem_object_get_fence(obj);
/* if (ret == -EDEADLK) {
* -EDEADLK means there are no free fences /*
* no pending flips. * -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 * This is propagated to atomic, but it uses
* change the returned error to -EBUSY. * -EDEADLK to force a locking recovery, so
*/ * change the returned error to -EBUSY.
ret = -EBUSY; */
goto err_unpin; ret = -EBUSY;
} else if (ret) goto err_unpin;
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; dev_priv->mm.interruptible = true;
intel_runtime_pm_put(dev_priv); intel_runtime_pm_put(dev_priv);
...@@ -2430,7 +2432,9 @@ static void intel_unpin_fb_obj(struct drm_framebuffer *fb, ...@@ -2430,7 +2432,9 @@ static void intel_unpin_fb_obj(struct drm_framebuffer *fb,
ret = intel_fill_fb_ggtt_view(&view, fb, plane_state); ret = intel_fill_fb_ggtt_view(&view, fb, plane_state);
WARN_ONCE(ret, "Couldn't get view from 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); i915_gem_object_unpin_from_display_plane(obj, &view);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment