Severe screen corruption after rotate the screen

Bug #833549 reported by Jammy Zhou
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Compiz Core
Fix Released
Undecided
Unassigned
compiz (Ubuntu)
Fix Released
Low
Alberto Milone

Bug Description

Steps to reproduce this bug:
- login to the system with unity-3d
- rotate the screen with xrandr command or using "System Settings"->"Displays"

Expected Results:
There should be no screen corruptions, and the unity launcher and panel should show normally

Actual Results:
Severe screen corruption happens after rotate

The problem happens for both radeon and fglrx driver. And it doesn't happen for unity-2d.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: xorg 1:7.6+7ubuntu6
ProcVersionSignature: Ubuntu 3.0.0-9.14-generic 3.0.3
Uname: Linux 3.0.0-9-generic i686
Architecture: i386
CompizPlugins: [core,bailer,detection,composite,opengl,decor,mousepoll,vpswitch,regex,animation,snap,expo,move,compiztoolbox,place,grid,imgpng,gnomecompat,wall,ezoom,workarounds,staticswitcher,resize,fade,unitymtgrabhandles,scale,session,unityshell]
CompositorRunning: compiz
CurrentDmesg: Error: command ['sh', '-c', 'dmesg | comm -13 --nocheck-order /var/log/dmesg -'] failed with exit code 1: comm: /var/log/dmesg: Permission denied
Date: Thu Aug 25 14:46:59 2011
DistUpgraded: Fresh install
DistroCodename: oneiric
DistroVariant: ubuntu
ExtraDebuggingInterest: Yes, whatever it takes to get this fixed in Ubuntu
GraphicsCard:
 ATI Technologies Inc Juniper XT [AMD Radeon HD 6000 Series] [1002:68ba] (prog-if 00 [VGA controller])
   Subsystem: Hightech Information System Ltd. Device [1787:2312]
 ATI Technologies Inc Juniper XT [AMD Radeon HD 6000 Series] [1002:68ba] (prog-if 00 [VGA controller])
   Subsystem: Hightech Information System Ltd. Device [1787:2312]
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha i386 (20110803.1)
MachineType: Gigabyte Technology Co., Ltd. P67A-D3-B3
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-9-generic root=UUID=55f57695-13db-4447-988b-59845e40f8e2 ro text
SourcePackage: xorg
Symptom: display
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/13/2011
dmi.bios.vendor: Award Software International, Inc.
dmi.bios.version: F3
dmi.board.name: P67A-D3-B3
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.modalias: dmi:bvnAwardSoftwareInternational,Inc.:bvrF3:bd04/13/2011:svnGigabyteTechnologyCo.,Ltd.:pnP67A-D3-B3:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnP67A-D3-B3:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
dmi.product.name: P67A-D3-B3
dmi.sys.vendor: Gigabyte Technology Co., Ltd.
version.compiz: compiz 1:0.9.5.92+bzr2791-0ubuntu1
version.libdrm2: libdrm2 2.4.26-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 7.11-0ubuntu3
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 7.11-0ubuntu3
version.xserver-xorg: xserver-xorg 1:7.6+7ubuntu6
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.6.0-1ubuntu13
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.99~git20110811.g93fc084-0ubuntu1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.15.901-1ubuntu2
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110411+8378443-1

Revision history for this message
Jammy Zhou (jammy-zhou) wrote :
Revision history for this message
Jammy Zhou (jammy-zhou) wrote :

Photo for the corruption is attached for reference

Alex Launi (alexlauni)
Changed in compiz (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Jammy Zhou (jammy-zhou) wrote :

It seems a compiz problem that only the desktop width is updated in compiz, but the desktop height is not updated after rotate.

Following steps can simplify the problem.
- boot the system in text mode
- run X in remote terminal
- disable unity plugin in ccsm
- start compiz in remote terminal
- run xterm in remote terminal, and maximize xterm
- run xrandr --output xxx --rotate left in remote terminal, we can see that the screen is rotated, and the right part of the screen is totally black (with width of <original screen width - original screen height>)

Revision history for this message
Jammy Zhou (jammy-zhou) wrote :

This problem can be solved with the fix in PrivateScreen::updateOutputDevices() below.

--- screen.cpp.orig 2011-08-31 16:33:45.000000000 +0800
+++ screen.cpp 2011-08-31 16:33:03.000000000 +0800
@@ -1729,6 +1729,13 @@
        width = (int) uWidth;
        height = (int) uHeight;

+ // Update screen size
+ if (screen->width () != width || screen->height () != height)
+ {
+ screen->setWidth(width);
+ screen->setHeight(height);
+ }
+
        if (bits & XNegative)
            x = screen->width () + x - width;

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

This patch makes no sense, it changes he total screen size to the size of each monitor every single time we parse the geometry of a monitor. In addition, we change the total screen size anyways on PrivateScreen::reshape which is called whenever updateOutputDevices is called (except whenever the user force overrides the output devices)

Revision history for this message
Jammy Zhou (jammy-zhou) wrote : Re: [Bug 833549] Re: Severe screen corruption after rotate the screen
Download full text (4.8 KiB)

After rotate the screen, the calling sequence in compiz is as following:

PrivateScreen::configure
    -> PrivateScreen::reshape
    -> PrivateScreen::detectOutputDevices
        -> PrivateScreen::updateOutputDevices

In updateOutputDevices, screen->width() and screen->height() are
reversed, which caused the problem.
If the screen size should be updated in reshape(), it seems that the
width/height of the configure event in this case are not correct. So
is it a bug of X server?

As a workaround, my original patch can be changed to update screen
size only when the screen width is less then the output width or the
screen height is less then the output height.

2011/9/1 Sam Spilsbury <email address hidden>

> This patch makes no sense, it changes he total screen size to the size
> of each monitor every single time we parse the geometry of a monitor. In
> addition, we change the total screen size anyways on
> PrivateScreen::reshape which is called whenever updateOutputDevices is
> called (except whenever the user force overrides the output devices)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/833549
>
> Title:
> Severe screen corruption after rotate the screen
>
> Status in “compiz” package in Ubuntu:
> Confirmed
>
> Bug description:
> Steps to reproduce this bug:
> - login to the system with unity-3d
> - rotate the screen with xrandr command or using "System
> Settings"->"Displays"
>
> Expected Results:
> There should be no screen corruptions, and the unity launcher and panel
> should show normally
>
> Actual Results:
> Severe screen corruption happens after rotate
>
> The problem happens for both radeon and fglrx driver. And it doesn't
> happen for unity-2d.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 11.10
> Package: xorg 1:7.6+7ubuntu6
> ProcVersionSignature: Ubuntu 3.0.0-9.14-generic 3.0.3
> Uname: Linux 3.0.0-9-generic i686
> Architecture: i386
> CompizPlugins:
> [core,bailer,detection,composite,opengl,decor,mousepoll,vpswitch,regex,animation,snap,expo,move,compiztoolbox,place,grid,imgpng,gnomecompat,wall,ezoom,workarounds,staticswitcher,resize,fade,unitymtgrabhandles,scale,session,unityshell]
> CompositorRunning: compiz
> CurrentDmesg: Error: command ['sh', '-c', 'dmesg | comm -13
> --nocheck-order /var/log/dmesg -'] failed with exit code 1: comm:
> /var/log/dmesg: Permission denied
> Date: Thu Aug 25 14:46:59 2011
> DistUpgraded: Fresh install
> DistroCodename: oneiric
> DistroVariant: ubuntu
> ExtraDebuggingInterest: Yes, whatever it takes to get this fixed in Ubuntu
> GraphicsCard:
> ATI Technologies Inc Juniper XT [AMD Radeon HD 6000 Series] [1002:68ba]
> (prog-if 00 [VGA controller])
> Subsystem: Hightech Information System Ltd. Device [1787:2312]
> ATI Technologies Inc Juniper XT [AMD Radeon HD 6000 Series] [1002:68ba]
> (prog-if 00 [VGA controller])
> Subsystem: Hightech Information System Ltd. Device [1787:2312]
> InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha i386 (20110803.1)
> MachineType: Gigabyte Technology Co., Ltd. P67A-D3-B3
> ProcEnviron:
> PATH=(custom, no user)
> LANG=en_US.UTF-8
> SH...

Read more...

Revision history for this message
Alberto Milone (albertomilone) wrote :

I can reproduce the same problem with the open source driver (radeon).

Revision history for this message
Alberto Milone (albertomilone) wrote :
Revision history for this message
Alberto Milone (albertomilone) wrote :
Changed in compiz (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
Changed in compiz (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Alberto Milone (albertomilone) wrote :

The bug was much simpler than I though. We only forgot to call updateOutputDevices () after detectOutputDevices() (as we already do on initialisation) in PrivateScreen::configure() (src/screen.cpp).

The attached patch fixes the issue here with the open source driver.

Revision history for this message
Alberto Milone (albertomilone) wrote :

*much simpler than I thought

Revision history for this message
Jammy Zhou (jammy-zhou) wrote :

This patch also solved the problem in my side with fglrx driver. The updateOutputDevices() is not triggered in detectOutputDevices for this case, so we need to call updateOutputDevices explicitly.

Revision history for this message
Alberto Milone (albertomilone) wrote :

I've also successfully tested my patch with both nouveau and nvidia (nvidia-current, after enabling rotation in xorg.conf)

Revision history for this message
Alberto Milone (albertomilone) wrote :

it also works with the intel driver

Revision history for this message
Alberto Milone (albertomilone) wrote :

I've also tested the patch with 2 screens connected at the same time and rotations don't trigger the problem any more.

Changed in compiz (Ubuntu):
status: In Progress → Fix Committed
status: Fix Committed → In Progress
Changed in compiz-core:
status: New → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

The attachment "0001-Call-updateOutputDevices-after-detectOutputDevices-w.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package compiz - 1:0.9.5.94+bzr2803-0ubuntu1

---------------
compiz (1:0.9.5.94+bzr2803-0ubuntu1) oneiric; urgency=low

  [ David Barth ]
  * New upstream release 0.9.5.94
    - Merge in change to have a serverWindows () this break the API
    - "mumble fix", ie "It is possible to stack windows relative to windows that are destroyed" (LP: #837252)
    - fix for "Severe screen corruption after rotate the screen" (LP: #833549)
    - Remove inactive API
    - Fix for "vp switch causes windows to move further offscreen" (LP: #831987)
    - Debug messages removed
    - Memory leak fix in gtk and unity window decorators
    - Fix further issues with shaped windows mapping/unmapping (rev. 2793)
  * removed patches that were integrated into the new upstream release
    - debian/patches/100_core-fix-rev-2794.patch
    - debian/patches/101_memleak-fix-rev-2794.patch
    - debian/patches/102_attrib-fix-rev-2796.patch
    - debian/patches/103_driver_workaround.patch

  [ Didier Roche ]
  * debian/rules, debian/compiz-gnome.install, debian/compiz-keybindings.sed:
    - readd and tweak some compiz keys for g-c-c and Gnome integration
      This fixes Ctrl + Alt + T to open a terminal (LP: #820266)
 -- Didier Roche <email address hidden> Mon, 12 Sep 2011 08:09:46 +0200

Changed in compiz (Ubuntu):
status: In Progress → Fix Released
Changed in compiz-core:
status: Fix Committed → 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.