Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a477651 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Keep physical cursors pinned while in use

The optimisation inherent in commit 6a2c4232 ("drm/i915: Make the
physical object coherent with GTT") relies on that once we allocated a
cursor we would have coherent, zero overhead access to the scanout plane
holding the cursor. That is we could then do the very frequent cursor
updates X enjoys with no indirection or kernel involvement. However,
that all hinges on the GGTT mmap of the cursor being pinned and not
require refaulting on each access -- handling such a page fault likely
requires the busy GGTT to be rearranged causing a stall. A very simple
fix is then to handle the physical cursor exactly like other cursors and
keep its vma pinned while active.

References: https://bugs.freedesktop.org/show_bug.cgi?id=107600


References: 6a2c4232 ("drm/i915: Make the physical object coherent with GTT")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180817082405.755-1-chris@chris-wilson.co.uk
parent 70b73f9a
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -12969,8 +12969,11 @@ static int intel_plane_pin_fb(struct intel_plane_state *plane_state)
	    INTEL_INFO(dev_priv)->cursor_needs_physical) {
	    INTEL_INFO(dev_priv)->cursor_needs_physical) {
		struct drm_i915_gem_object *obj = intel_fb_obj(fb);
		struct drm_i915_gem_object *obj = intel_fb_obj(fb);
		const int align = intel_cursor_alignment(dev_priv);
		const int align = intel_cursor_alignment(dev_priv);
		int err;


		return i915_gem_object_attach_phys(obj, align);
		err = i915_gem_object_attach_phys(obj, align);
		if (err)
			return err;
	}
	}


	vma = intel_pin_and_fence_fb_obj(fb,
	vma = intel_pin_and_fence_fb_obj(fb,