Mir

[intel] Bypass mode makes the cursor break up into horizontal line artefacts

Bug #1218735 reported by Daniel van Vugt
46
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Mir
Invalid
High
Unassigned
xf86-video-intel
New
Undecided
Chris Wilson
mir (Ubuntu)
Fix Released
Undecided
Unassigned
xorg-server (Ubuntu)
Invalid
High
Chris Wilson
xserver-xorg-video-intel (Ubuntu)
Fix Released
High
Chris Wilson

Bug Description

Mir's bypass mode makes the X cursor break up into horizontal line artefacts. I can see some pixels updating where the cursor should be, but not all of them.

There's a flickering ghost of where the mouse pointer was just a moment ago, comprised of small horizontal lines.

I've *heard* this is an intel-specific bug due to particular caching behaviour of intel graphics, triggered by bypass (but only seen when bypassing XMir surfaces, not other Mir surfaces).

WORKAROUND:
1. sudo -s
2. cd /usr/sbin
3. mv unity-system-compositor unity-system-compositor.bin
4. Now create a new file "unity-system-compositor" with:
---8<---8<---8<---8<---8<---8<---8<---
#!/bin/sh
export MIR_BYPASS=0
exec $0.bin $*
---8<---8<---8<---8<---8<---8<---8<---
5. chmod 755 unity-system-compositor

Tags: bypass

Related branches

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please be careful not to confuse this with bug 1216472. It will happen at the same time, unless you're using the workaround.

Changed in mir:
importance: Undecided → High
Changed in xmir:
importance: Undecided → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Subscribed ickle. Hopefully he can explain what's going on.

tags: added: bypass
Revision history for this message
Chris Wilson (ickle) wrote :

The bug is not specific to XMir surfaces, just that's the only place where you are doing small enough updates to notice the cache dirt. The bug is caused by the use of incorrect cache attributes when rendering with GL.

The bug is exactly that the rendering to the cursor is landing in the cache - but the display engine reads directly from memory and does not snoop the caches. Hence, the when we output to the display, we see the stale pixels and does not see the new data until it gets random evicted from the cache. This cache flush happens as a natural consequence of larger renders, such as the full screen redraws used elsewhere, which would have previously masked the bug.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Hmm,

"The bug is caused by the use of incorrect cache attributes when rendering with GL."
But with bypass we're not using any GL at all...

I did find a simple way to make the bug go away though -- just mir_wait_for(mir_surface_swap_buffers(...)) in XMir. The wait does make most X operations slow, but at least the cursor appears perfect, fast, and free of artefacts.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Found another simple way to avoid the bug, using this hack:
https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1216472/comments/14

Changed in xorg-server (Ubuntu):
importance: Undecided → High
Revision history for this message
Chris Wilson (ickle) wrote :

#5 can be explained by that there is so much rendering go on, that the cache is completely thrashed (and if there were dirty cache lines they would be randomly over all the screen rather than concentrated in a small area around the cursor).

#4. Fine, but you're not telling the DDX that you have a scanout buffer either... Hmm.

Revision history for this message
Chris Wilson (ickle) wrote :

Pushed a patch to treat the xmir fd as scanout, which fixes the pointer corruption. Not happy that I have to guess which fd belong to scanouts and which will be copied from.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks Chris. It is safe to assume XMir will always use scanout buffers, so long as the multimonitor layout doesn't have any overlaps.

Changed in xmir:
assignee: nobody → Chris Wilson (ickle)
status: New → In Progress
Changed in xorg-server (Ubuntu):
assignee: nobody → Chris Wilson (ickle)
Changed in mir:
status: New → Invalid
Changed in xorg-server (Ubuntu):
status: New → Confirmed
Changed in xserver-xorg-video-intel (Ubuntu):
assignee: nobody → Chris Wilson (ickle)
status: New → Confirmed
status: Confirmed → In Progress
Changed in xmir:
status: In Progress → Confirmed
Changed in xserver-xorg-video-intel:
assignee: nobody → Chris Wilson (ickle)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xserver-xorg-video-intel - 2:2.21.14-4ubuntu4

---------------
xserver-xorg-video-intel (2:2.21.14-4ubuntu4) saucy; urgency=low

  * XMir: Make a conservative guess as to whether the Mir buffer will be used
    for scanout, and take caching decisions appropriately. Fixes "cache dirt"
    transient horizontal-line misrendering with Mir bypass (LP: #1218735)
  * xmir.patch: Split monolithic concatenated patch out into a quilt patch
    series.
 -- Christopher James Halse Rogers <email address hidden> Thu, 05 Sep 2013 15:56:49 +1000

Changed in xserver-xorg-video-intel (Ubuntu):
status: In Progress → Fix Released
Changed in xmir:
status: Confirmed → Invalid
Changed in xorg-server (Ubuntu):
status: Confirmed → Invalid
Changed in xserver-xorg-video-intel (Ubuntu):
importance: Undecided → High
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.0.11

Changed in mir:
status: Invalid → Fix Committed
Changed in mir:
status: Fix Committed → Invalid
no longer affects: mir (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mir (Ubuntu):
status: New → Confirmed
Revision history for this message
MA (mariusa) wrote :

I have 2:2.21.14-4ubuntu4, but still encounter the bug #1221399, a dupe of this.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If you encounter any bugs after the fix is installed, please log a new bug.

Changed in mir (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.7 KiB)

This bug was fixed in the package mir - 0.0.11+13.10.20130924.1-0ubuntu1

---------------
mir (0.0.11+13.10.20130924.1-0ubuntu1) saucy; urgency=low

  [ kg ]
  * bump version for ABI break (LP: #1229212)

  [ Robert Ancell ]
  * Allow an application to override the options being populated.
  * Pass the program options to parse_options().
  * Add missing include for std::cerr.
  * Report when paused and resumed via configuration. (LP: #1192843)
  * Add missing directory separator when searching for a config file to
    parse.

  [ Kevin Gunn ]
  * change test timeouts and fix fence.

  [ Alexandros Frantzis ]
  * examples: Only check key information for key events This fixes a
    memory error reported by valgrind for examples that use eglapp.
  * shell: Apply the base configuration on a hardware change only if no
    per-session configuration is active.
  * graphics: consolidated fixed for nested code and examples on android
    stack.

  [ Eleni Maria Stea ]
  * graphics: Pull in Eleni's changes to get the DRM fd to init GBM from
    the host Mir instance.

  [ Didier Roche ]
  * remove (unused in the ppa as we have libmirserver3) hack to force
    depending and building against the exact same version.

  [ Robert Carr ]
  * Add DPMS configuration API. (LP: #1193222)
  * Deduplicate mtd::NullDisplayConfig and
    mtd::NullDisplayConfiguration.
  * Fix multiple internal client surfaces on android. (LP: #1228144)
  * change test timeouts and fix fence.
  * Add DPMS API and GBM/android impls.

  [ Kevin DuBois ]
  * platform, graphics: support nested (mir-on-mir) rendering on the
    Android platform.

  [ Michael Terry ]
  * Change how Mir chooses socket locations to make it simpler for a
    nested-Mir world, by using MIR_SOCKET as the host socket if no other
    host socket is provided and passing MIR_SOCKET on to any children.
    Also, change --nested-mode to --host-socket for clarity and add --
    standalone to force standalone mode.

  [ Daniel d'Andrada ]
  * android-input housekeeping - Updated README - Removed some dead
    code.

  [ Daniel van Vugt ]
  * Add DPMS configuration API. (LP: #1193222)
  * Add a "flags" field to MirBufferPackage so that clients can find out
    if the buffer they've been given is scanout-capable. This is
    normally something a client should never need to know. However there
    are two specialized cases where it's required to fix bugs in the
    intel and radeon X drivers:   LP: #1218735, LP: #1218815 The intel
    fix (already landed) contains a hack which will be updated after
    this branch lands. (LP: #1218815, #1218735)
  * GBM: Ensure that we don't create scanout buffers if bypass is
    explicitly disabled from the environment. (LP: #1227133) . (LP:
    #1227133)

  [ Alan Griffiths ]
  * graphics: Pull in Eleni's changes to get the DRM fd to init GBM from
    the host Mir instance.
  * input: Separate the code for dispatching input from that reading it.
  * graphics: Hook up nested surfaces events to input.
  * input: Connect nested input relay to input dispatch.
  * graphics: Simplify NativeAndroidPlatform out of existence.
  * tests: Fixes to get the tests "passing" on android/arm stack. (LP...

Read more...

Changed in mir (Ubuntu):
status: Invalid → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.