matroxfb causes corruption in both virtual consoles and xorg

Bug #581466 reported by topolinik on 2010-05-16
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
Unassigned

Bug Description

Loading matroxfb causes corruption in virtual consoles (ctrl+f1 up to ctrl+f6). Framebuffer is loaded with settings 800x600x32bpp (mode 0x115) as reported by dmesg, fbcon is loaded but characters in virtual consoles are unreadable, when I type something i just see some random pixels (located far away from the expected prompt), and also unreadable is the output of each command I launch. The only way to read what is shown on the screen is switching to xorg (ctrl+f7), then switching back to the virtual console, then the text is fixed; but, unfortunately, typing new characters brings the same result as before.
Also, the framebuffer is needed in order to enable tv-out on my matrox g550 via libdirectfb used by mplayer (device `-vo dfbmga'). Well, when I run `mplayer -vo dfbmga myfile.ext' then I can see the clip on my tv but the whole desktop gets corrupted showing random colors. Everything turns back to normal activity when I quit mplayer. This feature worked until a couple of weeks ago, in my good old hardy heron installation, when I watched movies on my tv while using desktop apps. (I must admit, I actually don't know if this bug is due to matroxfb or libdirectfb or mplayer).
Further, loading matroxfb makes gdm unable to show the login screen at 1280x1024 (it was able when no framebuffer was loaded). I tried this without xorg.conf file and gdm caused the monitor to go blank, showing an `unsupported frequency' alert. Then I created a xorg.conf file and set two resolutions in the same `modelines' statement: 1280x960 and 1280x1024; now gdm shows login at 1280x960 (the screen is still at 1280x1024 anyway, so I have to move my mouse in order to see it all), while xorg, which is loaded after login, is able to set 1280x1024.
I report this here and I will soon check a newer kernel package.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: linux-image-2.6.32-22-generic 2.6.32-22.33
Regression: Yes
Reproducible: Yes
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic i686
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
Architecture: i386
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: topolinik 1776 F.... pulseaudio
 /dev/snd/pcmC0D0p: topolinik 1776 F...m pulseaudio
CRDA: Error: [Errno 2] Nessun file o directory
Card0.Amixer.info:
 Card hw:0 'nForce2'/'NVidia nForce2 with ALC650E at irq 22'
   Mixer name : 'Realtek ALC650E'
   Components : 'AC97a:414c4722'
   Controls : 50
   Simple ctrls : 33
Card1.Amixer.info:
 Card hw:1 'UART'/'MPU-401 UART at 0x330, irq 10'
   Mixer name : ''
   Components : ''
   Controls : 0
   Simple ctrls : 0
Card1.Amixer.values:

Date: Sun May 16 22:23:50 2010
HibernationDevice: RESUME=UUID=ea6d2b9c-13b1-407b-8814-fdcd79f2ddc8
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
IwConfig:
 lo no wireless extensions.

 eth0 no wireless extensions.

 eth1 no wireless extensions.
MachineType: ASUSTeK Computer INC. A7N8X
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.32-22-generic root=UUID=e688872f-be02-48b3-9bea-b5060fd9b6c2 ro quiet splash
ProcEnviron:
 PATH=(custom, user)
 LANG=it_IT.utf8
 SHELL=/bin/bash
RelatedPackageVersions: linux-firmware 1.34
RfKill:

SourcePackage: linux
dmi.bios.date: 09/14/2004
dmi.bios.vendor: Phoenix Technologies, LTD
dmi.bios.version: ASUS A7N8X Deluxe ACPI BIOS Rev 1008
dmi.board.name: A7N8X
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: REV 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufactture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnPhoenixTechnologies,LTD:bvrASUSA7N8XDeluxeACPIBIOSRev1008:bd09/14/2004:svnASUSTeKComputerINC.:pnA7N8X:pvrREV1.xx:rvnASUSTeKComputerINC.:rnA7N8X:rvrREV1.xx:cvnChassisManufactture:ct3:cvrChassisVersion:
dmi.product.name: A7N8X
dmi.product.version: REV 1.xx
dmi.sys.vendor: ASUSTeK Computer INC.

topolinik (t0p0linik) wrote :
topolinik (t0p0linik) wrote :

Just tried the whole thing using latest kernel (Linux LucidHome 2.6.34-020634rc7-generic #020634rc7 SMP Mon May 10 10:08:20 UTC 2010 i686 GNU/Linux) and nothing changed.

Jeremy Foshee (jeremyfoshee) wrote :

Hi topolinik,

If you could also please test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

    [This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete
topolinik (t0p0linik) wrote :

> If you could also...
Done, as reported in comment #2.

Tag updated.

tags: removed: needs-upstream-testing
topolinik (t0p0linik) wrote :

Got an update. I tried a fine tune on my xorg.conf (attached).
Adding the statement:
 Option "DRI" "False"
into the "Device" section fixes the corruption of virtual consoles, so now the text appears perfect. This works with any kernel I tried: 2.6.34rc7, 2.6.34 (final), 2.6.33-4, 2.6.32-22 (bundled with lucid lynx) whilst still enabling tv out using `mplayer -vo dfbmga clip.avi' brings to desktop corruption and still gdm can't run at 1280x1024.

As a side note, disabling DRI slows down 3D performances, so now glxgears running at full screen reports 76 fps (enabling DRI I get 190 fps).

topolinik (t0p0linik) wrote :

> Also, the framebuffer is needed in order to enable tv-out on my matrox g550...
[cut]
> Everything turns back to normal activity when I quit mplayer.
This needs some explanation, since the story is a bit more complicated.
When I run `mplayer -vo dfbmga myfile.ext' then the clip appears con my tv, at the same time my desktop gets corrupted, it's at 640x480 and filled with random pixels. Now two cases:
1) During playback I switch to a virtual console, then come back to xorg. After this, the desktop appears again at 1280x1024 but xorg works badly, it skips many window decorations, it still shows some corruption at the higher border of the screen and if I move some window then it's likely to disappear. Quitting mplayer doesn't restore xorg functionality so I have to shut it down (that is, logout and then login again) in order to have back a working desktop.
2) If I press `q' during playback, then mplayer quits, but my desktop isn't still usable. It gets at 800x600 and still filled with random pixels. Now I can switch to a virtual console, then back to xorg and finally I have a working desktop.
I can post more details, if needed.
All this description brings me the idea there is a bad interaction between matroxfb and some other software.
I need some help.

topolinik (t0p0linik) wrote :

> at the same time my desktop gets corrupted, it's at 640x480 ...
DirectFB behaves so since I didn't specify any screen mode into my config file ~/.directfbrc

> my desktop isn't still usable. It gets at 800x600...
This is because at boot I asked for video mode 0x115 (800x600x32bpp).

I attached my latest .directfbrc you can see the `mode' statement I just added, since directfb turns my desktop at the specified resolution and it reads modelines/timings from /etc/fb.modes . Sadly, even at the right resolution, it's always filled with random pixels. The question is: what am I setting wrong?
Why does directfb change the screen resolution? I don't expect directfb acts ON MY DESKTOP! it just has to do its job on second head, NOT ON MY DESKTOP! It didn't use to change my desktop settings when I had good old hardy heron, and nothing changed since then (I mean, into my config files).

topolinik (t0p0linik) wrote :

No ideas?
No hints?

Come on, guys, I know this scenario seems complicated. As you can see, many different software may be involved into this bug: framebuffer module (shipped with linux kernel), xorg core, xorg mga driver, mplayer, directfb. What I would like is to let raise which of them is the root of the problem and I will submit the bug report to the right person. But in order to do this, I need some hint; I'm not scared in compiling custom/debug builds by myself.

To be honest, I'm going to give this dual-booted PC to my dad and I would like very much if I could tell him he can do with it everything he used to do with his old windows xp and even more. But this is actually a lie (his scanner will never work with sane and he knows).

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
madbiologist (me-again) wrote :

Given that you get the same issue with kernel 2.6.34-rc7, I'm wondering if some relevant DRM changes made their way into kernel 2.6.33, which would then mean that they would have been backported to Lucid. If this is the case, then kernel 2.6.36-rc2 should help you. From the changelog:

commit c81476df1b4241aefba4ff83a7701b3a926bd7ce
Author: Ondrej Zary
Date: Thu Aug 19 14:13:25 2010 -0700

    matroxfb: fix incorrect use of memcpy_toio()

    Screen is completely corrupted since 2.6.34. Bisection revealed that it's
    caused by commit 6175ddf06b61720 ("x86: Clean up mem*io functions.").

    H. Peter Anvin explained that memcpy_toio() does not copy data in 32bit
    chunks anymore on x86.

    Signed-off-by: Ondrej Zary
    Cc: Brian Gerst
    Cc: H. Peter Anvin
    Cc: Petr Vandrovec
    Cc: Jean Delvare
    Cc: <email address hidden> [2.6.34.x, 2.6.35.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

A PPA of this kernel is available at http://kernel.ubuntu.com/~kernel-ppa/mainline/

Thank you for your suggestion.
But nothing changed, even with this latest kernel.
Just note: if I run

$ dmesg |grep -i matrox
[ 1.289437] matroxfb 0000:03:00.0: PCI INT A -> Link[APC4] -> GSI 19 (level, high) -> IRQ 19
[ 1.289443] matroxfb: Matrox G550 detected
[ 1.390065] matroxfb: MTRR's turned on
[ 1.390087] matroxfb: 800x600x32bpp (virtual: 800x5242)
[ 1.390091] matroxfb: framebuffer at 0xD8000000, mapped to 0xe0a00000, size 33554432
[ 1.440416] fb0: MATROX frame buffer device
[ 22.428639] matroxfb 0000:03:00.0: putting AGP V2 device into 4x mode
[ 24.024542] Modules linked in: mga drm xt_limit xt_tcpudp ipt_LOG ipt_MASQUERADE xt_DSCP
ipt_REJECT nf_conntrack_irc nf_conntrack_ftp xt_state nls_iso8859_1 nls_cp437 vfat fat iptable_nat
nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables
x_tables usblp snd_wavefront snd_cs4236 snd_wss_lib snd_opl3_lib snd_intel8x0 snd_ac97_codec
ac97_bus snd_hwdep snd_pcm snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi snd_seq_midi_event
snd_seq snd_timer snd_seq_device snd ppdev ns558 gameport lp nvidia_agp parport_pc soundcore
snd_page_alloc i2c_nforce2 shpchp agpgart parport usbhid hid ohci1394 ieee1394 3c59x forcedeth mii
pata_amd floppy matroxfb_base matroxfb_DAC1064 matroxfb_accel matroxfb_Ti3026 matroxfb_g450 g450_pll
matroxfb_misc

here I see many matroxfb_* modules are built-in into the kernel. Could I get different results
building these as loadable modules? Notice that directfb docs suggest using matroxfb to be loaded alone.
Elio

Il 24/08/2010 11:25, madbiologist ha scritto:
> Given that you get the same issue with kernel 2.6.34-rc7, I'm wondering
> if some relevant DRM changes made their way into kernel 2.6.33, which
> would then mean that they would have been backported to Lucid. If this
> is the case, then kernel 2.6.36-rc2 should help you. From the
> changelog:
>
> commit c81476df1b4241aefba4ff83a7701b3a926bd7ce
> Author: Ondrej Zary
> Date: Thu Aug 19 14:13:25 2010 -0700
>
> matroxfb: fix incorrect use of memcpy_toio()
>
> Screen is completely corrupted since 2.6.34. Bisection revealed that it's
> caused by commit 6175ddf06b61720 ("x86: Clean up mem*io functions.").
>
> H. Peter Anvin explained that memcpy_toio() does not copy data in 32bit
> chunks anymore on x86.
>
> Signed-off-by: Ondrej Zary
> Cc: Brian Gerst
> Cc: H. Peter Anvin
> Cc: Petr Vandrovec
> Cc: Jean Delvare
> Cc:<email address hidden> [2.6.34.x, 2.6.35.x]
> Signed-off-by: Andrew Morton
> Signed-off-by: Linus Torvalds
>
> A PPA of this kernel is available at http://kernel.ubuntu.com/~kernel-
> ppa/mainline/
>

Manuel Hachtkemper (hacman) wrote :

Hello,

we found out, that "video=matroxfb:noaccel" in the grub commandline is a good workaround for this issue.

We also noticed, that using xdm/wdm + X-programs dn't produce this issue, in opposite using K and G applications. Strange.

Best regards,
Manuel Hachtkemper

Manuel Hachtkemper (hacman) wrote :

I have forwarded the bug to the upstream: https://bugs.freedesktop.org/show_bug.cgi?id=32441
Perhaps they can solve the bug itself, instead of searching for workarounds.

topolinik (t0p0linik) wrote :

Thank you Manuel, although on freedesktop I was told nobody is actually offering support for mga driver nowadays (see https://bugs.freedesktop.org/show_bug.cgi?id=24966 , I am user Elio Blanca).
Hope things are going to change.

topolinix, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ .

If it remains an issue, could you please run the following command in the development release from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p linux <replace-with-bug-number>

Also, could you please test the latest upstream kernel available following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Please do not test the daily folder, but the one all the way at the bottom. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested. For example:
kernel-fixed-upstream-v3.11-rc5

This can be done by clicking on the yellow circle with a black pencil icon next to the word Tags located at the bottom of the bug description. As well, please remove the tag:
needs-upstream-testing

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

As well, please remove the tag:
needs-upstream-testing

If you are unable to test the mainline kernel, please comment as to why specifically you were unable to test it and add the following tags:
kernel-unable-to-test-upstream
kernel-unable-to-test-upstream-VERSION-NUMBER

Once testing of the upstream kernel is complete, please mark this bug's Status as Confirmed. Please let us know your results. Thank you for your understanding.

tags: added: bios-outdated-1009 needs-upstream-testing
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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