Skip to content

Commit 4a47765

Browse files
committed
drm/i915: Keep physical cursors pinned while in use
The optimisation inherent in commit 6a2c423 ("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: 6a2c423 ("drm/i915: Make the physical object coherent with GTT") Signed-off-by: Chris Wilson <[email protected]> Cc: Ville Syrjälä <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 70b73f9 commit 4a47765

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12969,8 +12969,11 @@ static int intel_plane_pin_fb(struct intel_plane_state *plane_state)
1296912969
INTEL_INFO(dev_priv)->cursor_needs_physical) {
1297012970
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
1297112971
const int align = intel_cursor_alignment(dev_priv);
12972+
int err;
1297212973

12973-
return i915_gem_object_attach_phys(obj, align);
12974+
err = i915_gem_object_attach_phys(obj, align);
12975+
if (err)
12976+
return err;
1297412977
}
1297512978

1297612979
vma = intel_pin_and_fence_fb_obj(fb,

0 commit comments

Comments
 (0)