libgl1-mesa-dri: display inverted (upside-down) in startkde after natty upgrade

Bug #781353 reported by Ariel Faigon
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mesa (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I just upgraded from Maverick (10.10) to Natty (11.04)

The first and biggest regression I noticed is display appearing upside down.

I use KDE with plasma desktop (kwin) on Intel (Xorg Driver is "intel") - with desktop effects enabled.

kdm starts fine allowing me to login.

While the splash image combo at the center of the screen shows progress it suddenly flips upside down as if the screen bitmap got inverted.

When the desktop finally appears I have the KDE panel and the application windows in the right places but content inside them is inverted upside down. All fonts are upside-down inverted even inside text based apps like konsole.

Searching the web reveals a similar report pointing at plasma and desktop effects.
https://bugs.kde.org/show_bug.cgi?id=259578 (marked as resolved and has a screenshot)
http://bugsfiles.kde.org/attachment.cgi?id=54449

Which is exactly what I see after upgrading to Natty.

Revision history for this message
IKT (ikt) wrote :

Can you change the way the screen displays in the display driver properties?

Changed in ubuntu:
status: New → Incomplete
Revision history for this message
Ariel Faigon (ariel.faigon) wrote :

Hi IKT, thanks for the followup.

Unfortunately No.

In KDE you may change the orientation of the *whole* display (System-settings -> Display and Monitor -> Size and Orientation)
but if you look at the screenshot attached to the bug, it is not the *whole* display that is inverted, it is each application window that's inverted. The Windows themselves appear in the right locations. Also, in my case the 'orientation' menu doesn't allow me to rotate since it has only one option in it "No Rotation".

Also the problem is in KDE (plasma) only. Gnome with no-effects works correctly.

More info:
Moving my whole ~/.kde dir aside doesn't solve the problem, so it doesn't seem to be related to enabling visual effects in kwin in my case. Thanks again.

Revision history for this message
Ariel Faigon (ariel.faigon) wrote :
Download full text (7.1 KiB)

One more important comment, sorry.

https://bugs.kde.org/show_bug.cgi?id=259578
says this is a driver issue (Xorg) and may be related to erroneous hardware detection.
I'm running the "intel" version of Xorg.

Relevant excerpts from /var/log/Xorg.1.log

[ 172.739]
X.Org X Server 1.10.1
Release Date: 2011-04-15
[ 172.739] X Protocol Version 11, Revision 0
[ 172.739] Build Operating System: Linux 2.6.24-29-server x86_64 Ubuntu
[ 172.739] Current Operating System: Linux io 2.6.38-9-generic #43-Ubuntu SMP
[ 172.739] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.38-9-generic root=UUID=72ea6862-93b4-426a-be72-cd8d420b367c ro quiet splash vt.handoff=7
[ 172.739] Build Date: 19 April 2011 03:40:45PM
[ 172.739] xorg-server 2:1.10.1-1ubuntu1 (For technical support please see http://www.ubuntu.com/support)
[ 172.739] Current version of pixman: 0.20.2
[ 172.739] Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[ 172.739] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 172.739] (==) Log file: "/var/log/Xorg.1.log", Time: Wed May 11 10:49:06 2011
[ 172.740] (==) Using config file: "/etc/X11/xorg.conf"
[ 172.740] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 172.740] (==) ServerLayout "X.org Configured"
[ 172.740] (**) |-->Screen "Screen0" (0)
[ 172.740] (**) | |-->Monitor "Monitor0"
[ 172.740] (**) | |-->Device "Card0"
...
[ 172.741] (II) "extmod" will be loaded. This was enabled by default and also specified in the config file.
[ 172.741] (II) "dbe" will be loaded. This was enabled by default and also specified in the config file.
[ 172.741] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[ 172.741] (II) "record" will be loaded. This was enabled by default and also specified in the config file.
[ 172.741] (II) "dri" will be loaded. This was enabled by default and also specified in the config file.
[ 172.741] (II) "dri2" will be loaded. This was enabled by default and also specified in the config file.
...
[ 172.744] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,
        i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G,
        E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,
        965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,
        4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale,
        Sandybridge, Sandybridge, Sandybridge, Sandybridge, Sandybridge,
        Sandybridge, Sandybridge
[ 172.744] (++) using VT number 8
[ 173.067] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
[ 173.067] drmOpenDevice: node name is /dev/dri/card0
[ 173.067] drmOpenDevice: open result is 9, (OK)
[ 173.067] drmOpenByBusid: Searching for BusID pci:0000:00:02.0
[ 173.067] drmOpenDevice: node name is /dev/dri/card0
[ 173.067] drmOpenDevice: open result is 9, (OK)
[ 173.067] drmOpenByBusid: drmOpenMinor returns 9
[ 173.067] drm...

Read more...

Revision history for this message
Ariel Faigon (ariel.faigon) wrote :

Looks like a bug had been filed on the freedesktop.org bugzilla against the intel driver / Mesa (OpenGL):

     https://bugs.freedesktop.org/show_bug.cgi?id=33592

There's also a patch against:
    src/mesa/drivers/dri/i915/intel_tris.c

   From: Henri Verbeet <email address hidden>
  To: <email address hidden>
   Date: Sun, 27 Feb 2011 07:22:28 +0100
   Subject: i915: Only invert wpos when rendering to the system framebuffer.

Which I'll be happy to test/verify.
Can you provide a new package of the intel-x-org driver for testing?

tags: added: dri driver i915 i965 intel libgl1-mesa-dri
summary: - display inverted (upside-down left-right) in startkde after natty
- upgrade
+ libgl1-mesa-dri: display inverted (upside-down left-right) in startkde
+ after natty upgrade
description: updated
summary: - libgl1-mesa-dri: display inverted (upside-down left-right) in startkde
- after natty upgrade
+ libgl1-mesa-dri: display inverted (upside-down) in startkde after natty
+ upgrade
Revision history for this message
Ariel Faigon (ariel.faigon) wrote :

I spent some more time on this bug. Here are some updates:

    libgl1-mesa-dri 7.9~git20100924-0ubuntu2 doesn't have the bug
    libgl1-mesa-dri 7.10.2-0ubuntu has the bug.

It turned out that the patch by Henri Verbeet (mentioned above) is only for i915.

I've built libgl1-mesa-dri from source and applied the patch.
My chipset is i965 so it didn't make any difference for me.

I found a temporary work-around:
In /etc/X11/xorg.conf, I disable DRI this way:

    Section "Device"
        Option "DRI" "False" ### This solves the issue
        Identifier "Card0"
        Driver "intel"
        VendorName "Intel Corporation"
        BoardName "4 Series Chipset Integrated Graphics Controller"
        BusID "PCI:0:2:0"
    EndSection

Of course, I lose most desktop effects, but at least I get KDE back. Displays aren't upside-down anymore.

This is a serious regression in Natty.

Changed in ubuntu:
status: Incomplete → Confirmed
Revision history for this message
IKT (ikt) wrote :

just setting to mesa

affects: ubuntu → mesa (Ubuntu)
bugbot (bugbot)
tags: added: kubuntu
Revision history for this message
Chris Halse Rogers (raof) wrote :

What's probably happened - although I can't tell, because you haven't included the logs with “ubuntu-bug” - is that the upgrade has somehow managed to install one of the proprietary drivers. Their libGLs are different, and one of the ways that they're different is that they store textures the other way up :).

Revision history for this message
Ariel Faigon (ariel.faigon) wrote :

Chris,

Thanks. I don't believe it is a proprietary driver issue. This is using the stock FOSS X.org intel (i965) drivers.
Plus, the bug has been traced to the mesa/dri code which is totally FOSS.

It has been fixed in the i915 code but not yet in the i965 code.

Also, if you look at the screenshot provided by one of the early reporters, you'd see that the inversion is a pure bitmap inversion of each full window, not a texture inversion. http://bugsfiles.kde.org/attachment.cgi?id=54449

Revision history for this message
Ariel Faigon (ariel.faigon) wrote :

Looks like Chris may have been right after all and I was wrong.

See this comment in the original freedesktop bug:

     https://bugs.freedesktop.org/show_bug.cgi?id=33592#c15

I'm not in front of the buggy system right now so I can't completely verify, but when I remotely ssh to it, I can see that the nvidia .so's are actually loaded on a system with only intel graphics (used to have an nvidia card in the past), which is wrong:

    $ lsof | grep nvidia | sed -e 's@.* \(/.*\)$@\1@' | sort -u
    /usr/lib/nvidia-current/libGL.so.270.41.06
    /usr/lib/nvidia-current/libnvidia-glcore.so.270.41.06
    /usr/lib/nvidia-current/tls/libnvidia-tls.so.270.41.06

It seems very plausible that the mistakenly loaded nvidia layer is flipping those pixels.

Will verify this on Tuesday.

Revision history for this message
Ariel Faigon (ariel.faigon) wrote :

Confirming that this bug goes away after:

  $ apt-get purge nvidia-settings nvidia-current nvidia-common

and restarting X.

Should be closed as invalid. Sorry for the trouble.

Changed in mesa (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
apetrelli (antonio-petrelli) wrote :

I tried installing 7.11 from here:
https://launchpad.net/~suraia/+archive/ppa
The bug still appears but only after login page.
Warning: this also installs kernel 3.0.0!

I have an NVidia Optimus: Intel i915 (default settings) + GEForce 540 M

Revision history for this message
apetrelli (antonio-petrelli) wrote :

Ok probably I specify the problem wrong. So it is a problem with libGL version of NVidia proprietary driver and the open source one.
In fact I cannot uninstall nvidia driver since I have an Optimus laptop, where I use the discrete card with Ironhide.
Is there a workaround for this situation, such as explicitly specify libGL path in XOrg configuration file?

Revision history for this message
Chris Halse Rogers (raof) wrote : Re: [Ubuntu-x-swat] [Bug 781353] Re: libgl1-mesa-dri: display inverted (upside-down) in startkde after natty upgrade

You can select which libGL is used by running ‘sudo update-alternatives
--config x86_64-linux-gnu_gl_conf’ (on amd64) or ‘sudo
update-alternatives --config i386-linux-gnu_gl_conf’ (on i386).

Revision history for this message
apetrelli (antonio-petrelli) wrote :

Thanks Chris but that piece of configuration does not exists.
I tried to switch gl_conf (pointing either to mesa or nvidia-current) but it did not work either.
The only thing that worked is letting /usr/lib/nvidia-current/libGL.so.1 symbolic link to point to /usr/lib/mesa/libGL.so.1
However I think that this is a job for ironhide. This is another confirmation that this is not a mesa bug.

Thanks again

Revision history for this message
Stefan Müller (smu-blackbox) wrote :

I just want to add som details on this bug:

My wife just installed Kubuntu 12.04 (64Bit). Her machine has a Geforce 330m. The nvidia driver did not work so she used the intel driver (at least from what I understand). Yesterday some xserver packages were updated. I cannot read the name - as all of the screen is flipped. So there is a regression if this was marked as fixed.

Revision history for this message
Stefan Müller (smu-blackbox) wrote :

Just want to update this issue:

For me it works now. I installed the 32Bit Version of Kubuntu but did not install any nvida drivers. I set "Use XRenderer" in some KDE settings dialog. So, it seems advisable to stay away from nvidia stuff. I you installed the dirver use apt-purge to remove as supposed by Ariel above.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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