USC - mouse cursor on AMD graphics is drawing incorrectly

Bug #1391975 reported by Gerry Boland on 2014-11-12
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Fix Released
Mir development team
mir (Ubuntu)

Bug Description

I've a Lenovo Flex 2 14D, which has an AMD APU.

In Unity-System-Compositor, I noticed the mouse cursor does not draw correctly. See photo attached

Related branches

Gerry Boland (gerboland) wrote :
Daniel van Vugt (vanvugt) wrote :

Hi (my blurry cam :). I think we might have to retest some more radeon systems to get a better idea of the problem...

This has been on my low-priority to-do list a while already.

tags: added: radeon
Daniel van Vugt (vanvugt) wrote :


Daniel van Vugt (vanvugt) wrote :

Just tested an older AMD APU radeon system and it works perfectly. Will try to set up another radeon soon but this bug might only apply to newer APUs...

I can't tell from the photo; is the issue just corruption under the cursor or is it stretched too?

Is mir_demo_server_* the same?

Changed in mir:
status: New → Incomplete
Daniel van Vugt (vanvugt) wrote :

Oh, I think I can tell what the bug is by looking at the photo. It looks like we're using a bad (doubled) stride value. That will make the cursor vertically squished and render rubbish under it. Because a doubled stride will run out of data only halfway down the image.

Changed in mir:
assignee: nobody → Daniel van Vugt (vanvugt)
status: Incomplete → In Progress
milestone: none → 0.9.0
Changed in mir:
importance: Undecided → High
PS Jenkins bot (ps-jenkins) wrote :

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

Changed in mir:
status: In Progress → Fix Committed
Gerry Boland (gerboland) wrote :

I took the attached MR and applied it to Mir 0.8. Cursor still drawing incorrectly.
Attached image shows how it looks to me now

Changed in mir:
status: Fix Committed → Confirmed
Changed in mir:
milestone: 0.9.0 → 0.10.0
Daniel van Vugt (vanvugt) wrote :

I assume X does not exhibit this bug?

We are definitely filling in the required 64x64 pixels, so the junk at the bottom is unexpected. It's possible radeon is not honoring the 64x64 GBM limitation and giving us a bigger buffer. In that case we should add gbm_bo_get_width/height queries to check what the driver is actually giving us.

Daniel van Vugt (vanvugt) wrote :

Also, please try building lp:mir and running mir_demo_server_*

Changed in mir:
status: Confirmed → In Progress
Daniel van Vugt (vanvugt) wrote :

Actually I can't see any reason for this now, other than a bug in Mesa/radeon driver.

Your new screenshot appears to show a block that is correctly 64px wide. It could be the driver is scanning out with 2x the correct stride, because the driver appears to know the correct width and height.

Can you please:
1. test X for a valid cursor (and attach the Xorg)
2. test mir_demo_server_shell
3. Run es2_info and attach the output
4. Verify you were testing the correct binary (freshly built mesa/libmirplatform{3,4}driver.so and not accidentally loading the old one).

Changed in mir:
status: In Progress → Incomplete
Gerry Boland (gerboland) wrote :

Tried again, bug fixed. Must've screed up last time

Changed in mir:
status: Incomplete → Fix Committed
Daniel van Vugt (vanvugt) wrote :

I'm curious now. Can you bisect for sure to verify it was actually my fix that resolves it? :)

Changed in mir:
milestone: 0.10.0 → 0.9.0
Gerry Boland (gerboland) wrote :

No I hadn't screwed up last time. I forgot the lightdm cursor is drawn by X.

I've tried current mir trunk, and cursor still 1/2 the height it should be. The noise underneath is not visible atm in mir_demo_server_shell, might just be the memory just happens to be zeros.

Am definitely using correct binary. X draws cursor ok, Mir doesn't.
I don't know how to run es2_info under Mir.
Xorg log: http://pastebin.ubuntu.com/9235306/

Changed in mir:
status: Fix Committed → Confirmed
milestone: 0.9.0 → 0.10.0
Daniel van Vugt (vanvugt) wrote :

Well X talks to radeon code directly, which will do the cursor whatever way is correct for radeon...

Mir is different because we're going through GBM (Mesa) and asking radeon to conform to GBM rules. I think that's probably where the bug lies.

I can reproduce here locally, I have a fix.. cursor buffers now are allowed to have arbitrary sizes, even when you request a different one..

Changed in mir:
assignee: Daniel van Vugt (vanvugt) → Andreas Pokorny (andreas-pokorny)
Launchpad Janitor (janitor) wrote :

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

Changed in mesa (Ubuntu):
status: New → Confirmed
Changed in mir:
status: Confirmed → In Progress
Changed in mir:
assignee: Andreas Pokorny (andreas-pokorny) → Mir development team (mir-team)
tags: added: cursor
Changed in mir:
status: In Progress → Fix Committed
no longer affects: mesa (Ubuntu)
Changed in mir (Ubuntu):
importance: Undecided → High
status: New → Triaged
Daniel van Vugt (vanvugt) wrote :


A second fix has landed in r2125. Does it work for you?

Launchpad Janitor (janitor) wrote :
Download full text (5.2 KiB)

This bug was fixed in the package mir - 0.10.0+15.04.20150107.2-0ubuntu1

mir (0.10.0+15.04.20150107.2-0ubuntu1) vivid; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.10.0 (https://launchpad.net/mir/+milestone/0.10.0)
    - Enhancements:
      . Added support for Android HWC 1.3 devices.
      . Plumbing/preparation to support external displays on Android devices.
      . Reduced build dependencies.
      . Client API: Added version macros.
      . Began work on automatic driver probing, to intelligently choose the
        best driver for you.
      . Demo shell (mir_proving_server): Added desktop zoom feature using
        Super + mouse wheel.
      . Demo renamed: mir_demo_server_shell -> mir_proving_server
      . Other demo servers merged into -> mir_demo_server
      . Wider support for display buffer pixel formats in the mesa driver, for
        wider hardware support.
      . Performance: On mesa/desktop at least; only hold compositor buffers
        for the duration of the render, instead of the duration of the frame.
        Following this change the compositor report can now finally report
        render time instead of frame time.
      . Mir now starts reliably when a TV is connected by HDMI, and up to
        4K resolution (2160p) is known to work.
      . Plenty more enhancements logged in the bugs list below.
    - ABI summary: Servers need rebuilding, but clients do not;
      . Mirclient ABI unchanged at 8
      . Mircommon ABI unchanged at 3
      . Mirplatform ABI bumped to 5
      . Mirserver ABI bumped to 28
    - Bug fixes:
      . [regression] Mir servers (since 0.9) randomly crash in malloc due to
        heap corruption (LP: #1401488)
      . USC - mouse cursor on AMD graphics is drawing incorrectly
        (LP: #1391975)
      . Mir fails to start when a TV is connected by HDMI
        [std::exception::what: Invalid or inconsistent display configuration]
        (LP: #1395405)
      . Input/event driven clients may freeze indefinitely (LP: #1396006)
      . Mir server crashes with "std::exception::what: Failed to get front
        buffer object" when trying to fullscreen a surface (LP: #1398296)
      . Switching windows with a Trusted Prompt Session active loses the
        trusted prompt session (LP: #1355173)
      . CI test failure in multiple tests (LP: #1401364)
      . dh_install: usr/bin/mir_demo_server exists in debian/tmp but is not
        installed to anywhere (LP: #1401365)
      . [regression] demo-shell: Instead of moving surfaces they now fly
        off-screen (LP: #1403702)
      . [regression] Binaries are no longer runnable on other machines (or in
        other directories) (LP: #1406073)
      . [i865] unity-system-compositor fails to start: Failed to choose ARGB
        EGL config (LP: #1212753)
      . Mir's compositor holds buffers (blocking clients) for the duration of
        the frame, even when not necessary. (LP: #1264934)
      . Screen goes blank (black) briefly during display config changes which
        don't affect the display mode (LP: #1274359)
      . [enhancement] There should be a quit signal sent to sessions instead
        of killing them dir...


Changed in mir (Ubuntu):
status: Triaged → Fix Released
Changed in mir:
status: Fix Committed → Fix Released
PS Jenkins bot (ps-jenkins) wrote :

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

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

Other bug subscribers