Bug 46796 - [X800SE] Mouse cursor corruption when switching users
Summary: [X800SE] Mouse cursor corruption when switching users
Status: RESOLVED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Radeon (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
: 36769 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-29 16:06 UTC by Bryce Harrington
Modified: 2012-04-06 06:14 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
BootDmesg.txt (52.14 KB, text/plain)
2012-02-29 16:07 UTC, Bryce Harrington
no flags Details
CurrentDmesg.txt (582 bytes, text/plain)
2012-02-29 16:07 UTC, Bryce Harrington
no flags Details
IMAG0011.jpg (70.90 KB, image/jpeg)
2012-02-29 16:07 UTC, Bryce Harrington
no flags Details
XorgLog.txt (88.82 KB, text/plain)
2012-02-29 16:07 UTC, Bryce Harrington
no flags Details
Restrict offset for legacy hardware cursor. (6.14 KB, patch)
2012-03-01 03:05 UTC, Michel Dänzer
no flags Details | Splinter Review
Verbose test patch (5.79 KB, patch)
2012-03-06 09:30 UTC, Michel Dänzer
no flags Details | Splinter Review
Verbose test patch with crash fixed (5.91 KB, patch)
2012-03-12 05:13 UTC, Michel Dänzer
no flags Details | Splinter Review
Submitted fix (4.50 KB, patch)
2012-03-14 07:57 UTC, Michel Dänzer
no flags Details | Splinter Review

Description Bryce Harrington 2012-02-29 16:06:22 UTC
Forwarding this bug from Ubuntu reporter Jonathan Voss:
http://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-ati/+bug/929960

[Problem]
Mouse cursor corruption when switching users with an older ATI card

[Original Description]
I'm guessing the box is 64x64 pixels. It's got horizontal lines across it. The mouse pointer looks completely normal in screenshots, so I am including a picture taken with my phone.

It looked messed up in the same way on the other account, and continues to look messed up now that I have switched back. It still functions normally, but it's a little hard to know where you're clicking since the actual pointer seems to be a bit away from the upper left corner of this box.

I've just reproduced it twice tonight. It seems to happen randomly when switching to other accounts or to the login screen. I can't get it to happen consistently however so it's hard to tell what's causing it. Since my last reboot, I've switched through a bunch of accounts, gnome3, unity, and unity 2d, without getting the mouse corruption.

By the way, I use a program called redshift, which causes a reddish hue at night, as can be seen in the picture. Redshift does not appear to affect the mouse pointer though. It may also cause this bug I guess.

DistroRelease: Ubuntu 12.04
Package: xorg 1:7.6+10ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-14.23-generic 3.2.3
Uname: Linux 3.2.0-14-generic i686
.tmp.unity.support.test.0:
 
ApportVersion: 1.91-0ubuntu1
Architecture: i386
CompizPlugins: [core,bailer,detection,composite,opengl,decor,mousepoll,move,compiztoolbox,snap,regex,place,imgpng,vpswitch,grid,gnomecompat,resize,animation,wall,unitymtgrabhandles,session,expo,fade,workarounds,ezoom,scale,unityshell]
CompositorRunning: None
Date: Thu Feb  9 21:35:01 2012
DistUpgraded: Log time: 2012-01-29 13:29:25.075442
DistroCodename: precise
DistroVariant: ubuntu
ExtraDebuggingInterest: Yes, whatever it takes to get this fixed in Ubuntu
GraphicsCard:
 Advanced Micro Devices [AMD] nee ATI R423 UK [Radeon X800SE (PCIE)] [1002:554b] (prog-if 00 [VGA controller])
   Subsystem: C.P. Technology Co. Ltd Device [148c:2154]
   Subsystem: C.P. Technology Co. Ltd Device [148c:2155]
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release i386 (20100816.1)
Lsusb:
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 001 Device 003: ID 0bc2:0503 Seagate RSS LLC 
 Bus 002 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
MachineType: System manufacturer System Product Name
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-14-generic root=UUID=9735bb88-e60b-48fc-8db3-4153611e79a3 ro quiet splash vt.handoff=7
SourcePackage: xorg
Symptom: display
UpgradeStatus: Upgraded to precise on 2012-02-08 (1 days ago)
dmi.bios.date: 11/08/2005
dmi.bios.vendor: Phoenix Technologies, LTD
dmi.bios.version: ASUS A8N5X ACPI BIOS Revision 0502
dmi.board.name: A8N5X
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: 1.XX
dmi.chassis.asset.tag: 123456789000
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnPhoenixTechnologies,LTD:bvrASUSA8N5XACPIBIOSRevision0502:bd11/08/2005:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnA8N5X:rvr1.XX:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer
version.compiz: compiz 1:0.9.6+bzr20110929-0ubuntu8
version.libdrm2: libdrm2 2.4.30-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 8.0~rc2-0ubuntu4
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 8.0~rc2-0ubuntu4
version.xserver-xorg-core: xserver-xorg-core 2:1.11.3-0ubuntu10
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.6.99.901-1ubuntu3
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.99~git20111219.aacbd629-0ubuntu2
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.17.0-1ubuntu3
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20111201+b5534a1-1build2
Comment 1 Bryce Harrington 2012-02-29 16:07:00 UTC
Created attachment 57834 [details]
BootDmesg.txt
Comment 2 Bryce Harrington 2012-02-29 16:07:16 UTC
Created attachment 57835 [details]
CurrentDmesg.txt
Comment 3 Bryce Harrington 2012-02-29 16:07:29 UTC
Created attachment 57836 [details]
IMAG0011.jpg
Comment 4 Bryce Harrington 2012-02-29 16:07:50 UTC
Created attachment 57837 [details]
XorgLog.txt
Comment 5 Michel Dänzer 2012-03-01 03:05:00 UTC
Created attachment 57853 [details] [review]
Restrict offset for legacy hardware cursor.

Does this kernel patch fix the problem?
Comment 6 Michel Dänzer 2012-03-06 09:30:19 UTC
Created attachment 58066 [details] [review]
Verbose test patch

In order to facilitate testing, here's another version of the fix which prints a message

[drm] Fixing large cursor offset 0xXXXXXXXX >= 0x08000000

when the suspected problem would have occurred. So if such a message appears in dmesg but the cursor is unharmed, we know this is indeed the proper fix.
Comment 7 jonathan 2012-03-06 19:41:29 UTC
This is a bit above my head I think. I got the source for xserver-xorg-video-ati from the Ubuntu repositories and tried to apply the patch to it. It looks like a lot of the right files are there, but there's no radeon_gem.c. The package version is 6.14.99~git20111219.aacbd629-0ubuntu2, which includes a date that I think indicates that it's not TOO old, however I cloned the git repository at git://anongit.freedesktop.org/xorg/driver/xf86-video-ati and had the same problem. I've also never tested a kernel mod so I'm not sure what I would do if I got the patch to compile.
Comment 8 Michel Dänzer 2012-03-07 00:21:12 UTC
(In reply to comment #7)
> I got the source for xserver-xorg-video-ati from the Ubuntu repositories and
> tried to apply the patch to it.

That can't work, as the patch is for the kernel, not the X driver.

You should be able to get the source for your running kernel with

apt-get source linux-image-$(uname -r)


> I've also never tested a kernel mod so I'm not sure what I would do if
> I got the patch to compile.

Boot the patched kernel (or load the patched radeon kernel module) and try to reproduce the problem. Look for the message from comment #6 in dmesg.
Comment 9 jonathan 2012-03-10 17:04:58 UTC
This patch causes my computer to crash at login. However, it's not a super bad crash because I was able to ssh in and check dmesg. The comment did not appear. Just to make sure it wasn't something I did when trying to compile a kernel, I reversed the patch and recompiled, and I'm running that kernel now, so I'm pretty sure it's the patch.
Comment 10 Michel Dänzer 2012-03-12 05:13:22 UTC
Created attachment 58312 [details] [review]
Verbose test patch with crash fixed

(In reply to comment #9)
> This patch causes my computer to crash at login. However, it's not a super bad
> crash because I was able to ssh in and check dmesg.

Sorry about that, here's another test patch which shouldn't crash.
Comment 11 jonathan 2012-03-12 16:41:14 UTC
I think this patch works as intended. Well actually, it's hard for me to say it actually fixed the problem due to its random nature, but I haven't had the mouse corruption issue on this patched driver, and the message appears in dmesg:

[  524.112945] [drm] Fixing large cursor offset 0x0d1e0000 >= 0x00000000
[  537.020931] [drm:drm_mode_getfb] *ERROR* invalid framebuffer id
[  537.308976] [drm] Fixing large cursor offset 0x0cf80000 >= 0x00000000
[  607.000940] [drm:drm_mode_getfb] *ERROR* invalid framebuffer id

I have to say that the log confuses me since 1 << 27 is not 0.
Comment 12 Michel Dänzer 2012-03-14 07:57:05 UTC
Created attachment 58436 [details] [review]
Submitted fix

(In reply to comment #11)
> [...] I haven't had the mouse corruption issue on this patched driver, and the
> message appears in dmesg:

Okay, so an unpatched driver probably would use too large offsets sometimes, which would definitely explain the corrupted cursor. So the fix seems to be working.


> I have to say that the log confuses me since 1 << 27 is not 0.

Indeed, but that's just a bug of the DRM_INFO call. :) (Type mismatch between format string and values)


I'm attaching the fix as I submitted it for inclusion into the kernel.
Comment 13 Chris Rankin 2012-03-31 14:26:15 UTC
Duplicate of #36769, perhaps?
Comment 14 Florian Mickler 2012-04-05 06:50:20 UTC
A patch referencing this bug report has been merged in Linux v3.4-rc1:

commit c4353016dac10133fa5d8535af83f0c4845a2915
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Wed Mar 14 17:12:41 2012 +0100

    drm/radeon: Restrict offset for legacy hardware cursor.
Comment 15 Michel Dänzer 2012-04-05 06:55:05 UTC
Resolving per comment #14, reopen if you're still seeing the problem with the fix.
Comment 16 Alex Deucher 2012-04-06 06:14:08 UTC
*** Bug 36769 has been marked as a duplicate of this bug. ***


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.