Created attachment 83409 [details] i915_error_state I noticed that on IVB, page flips ioctls end up blocking when the GPU is busy. Specifically the RCS -> BCS ring switch seems to be what's taking time (this time is spent in i915_gem_object_pin_to_display_plane). When I try to use the RCS instead of the BCS ring (by changing gen7_queue_flip) on my IVB chromebook (8086:0166) I get GPU lockups. Attached is the i915_error_state (undecoded).
Created attachment 83453 [details] [review] The patch I used to switch queue_flip to RCS
This is reproducible on Sandybridge and HSW as well.
Bug filed internally. Will get support from design/validation teams.
Yeah, pageflips don't work on RCS, which is why we issue them on the blitter. The ring switch should only block if you have semaphores disabled (which is not the default pretty much for this reason). I suspect we have a "semaphores are a bit broken" bug underlying here, but closing this for now since the apparent bug isn't one.
Ben asked me to reopen this.
(In reply to comment #0) > Created attachment 83409 [details] > i915_error_state > > I noticed that on IVB, page flips ioctls end up blocking when the GPU is > busy. Specifically the RCS -> BCS ring switch seems to be what's taking time > (this time is spent in i915_gem_object_pin_to_display_plane). Ok, Ben is looking into why pageflipping on the RCS doesn't work, since he thinks it should. Orthogonal to that issue we shouldn't block in pin_to_display_plane, at least if semaphores are enabled (which they are by default). Stephane can you please dig into where exactly we blow through massive amounts of time in there?
I may have lied about SNB being broken in an earlier commit. RCS flips do not hang on SNB. Whether or not we get the same double interrupts I'm seeing on ge7 is TBD. Still leaving this as a HSW bug so we're more in sync with internal validation.
unmasking DERRMR (0x44050) makes the hang go away. Still investigating why this only effects RCS, and still investigating why we see 2 interrupts per flip.
Note that unmasking DERRMR around the MI_DISPLAY_FLIP is insufficient.
Also HSW has a different vsync mechanism, so you are free to play fun and games with DERRMR there.
Messing around, the semaphore stall here greatly impacts UX. With BCS flips, there is perceptibly greater lag than RCS flips.
So the DERRMR trick fails on IVB with multiple planes as it misses some events. Appears to be stable on HSW though.
Created attachment 84278 [details] [review] RCS flips + DERRMR=0 on Haswell
Created attachment 84293 [details] [review] Use RCS flips on ivb+ This is still surviving on my ivb desktop that easily failed with DERRMR==0.
Patch is on the mailing list. Assigning to Daniel for merging. https://patchwork.kernel.org/patch/2849753/ https://patchwork.kernel.org/patch/2849754/
commit ffe74d75502e3a9b0791240b5562bcbecc6ab8dc Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Aug 26 20:58:12 2013 +0100 drm/i915: Use RCS flips on Ivybridge+ RCS flips do work on Iybridge+ so long as we can unmask the messages through DERRMR. However, there are quite a few workarounds mentioned regarding unmasking more than one event or triggering more than one message through DERRMR. Those workarounds in principle prevent us from performing pipelined flips (and asynchronous flips across multiple planes) and equally apply to the "known good" BCS ring. Given that it already appears to work, and also appears to work with unmasking all 3 planes at once (and queuing flips across multiple planes), be brave. Bugzlla: https://bugs.freedesktop.org/show_bug.cgi?id=67600 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Lightly-tested-by: Stephane Marchesin <marchesin@icps.u-strasbg.fr> Cc: Stephane Marchesin <marchesin@icps.u-strasbg.fr> Cc: Ben Widawsky <ben@bwidawsk.net> Tested-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.