diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-08-17 04:24:05 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-08-31 03:58:57 -0400 |
commit | 4a477651033e48851386d12e773584c99a878670 (patch) | |
tree | 5be4bbb51885637eee56d7d73587a9b1b3ae2ff7 | |
parent | 70b73f9ac113983f9c7db9887447f1344ac5b69b (diff) |
drm/i915: Keep physical cursors pinned while in use
The optimisation inherent in commit 6a2c4232ece1 ("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: 6a2c4232ece1 ("drm/i915: Make the physical object coherent with GTT")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180817082405.755-1-chris@chris-wilson.co.uk
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index ec3e24f07486..b79ad9c57d35 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -12969,8 +12969,11 @@ static int intel_plane_pin_fb(struct intel_plane_state *plane_state) | |||
12969 | INTEL_INFO(dev_priv)->cursor_needs_physical) { | 12969 | INTEL_INFO(dev_priv)->cursor_needs_physical) { |
12970 | struct drm_i915_gem_object *obj = intel_fb_obj(fb); | 12970 | struct drm_i915_gem_object *obj = intel_fb_obj(fb); |
12971 | const int align = intel_cursor_alignment(dev_priv); | 12971 | const int align = intel_cursor_alignment(dev_priv); |
12972 | int err; | ||
12972 | 12973 | ||
12973 | return i915_gem_object_attach_phys(obj, align); | 12974 | err = i915_gem_object_attach_phys(obj, align); |
12975 | if (err) | ||
12976 | return err; | ||
12974 | } | 12977 | } |
12975 | 12978 | ||
12976 | vma = intel_pin_and_fence_fb_obj(fb, | 12979 | vma = intel_pin_and_fence_fb_obj(fb, |