Bug 20287 - [UXA] rotation before gnome startup causes desktop corruption
Summary: [UXA] rotation before gnome startup causes desktop corruption
Status: VERIFIED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: high major
Assignee: Jesse Barnes
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-24 00:29 UTC by zhao jian
Modified: 2009-07-03 03:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
xorg.conf (3.81 KB, text/plain)
2009-02-24 00:29 UTC, zhao jian
no flags Details
xorg.0.log (78.18 KB, text/plain)
2009-02-24 00:29 UTC, zhao jian
no flags Details
desktop in uxa with tiling on (620.24 KB, image/jpeg)
2009-02-24 00:34 UTC, zhao jian
no flags Details
clear bo of scratch pixmap to handle reuse (1.05 KB, patch)
2009-07-02 12:51 UTC, Jesse Barnes
no flags Details | Splinter Review

Description zhao jian 2009-02-24 00:29:10 UTC
Created attachment 23250 [details]
xorg.conf

System Environment:
----------------------
Platform:               945gm
Arch:           i386
OSD:            Fedora release 9 (Sulphur)
Libdrm:         (master)4a0d19ef4f210cea9e60c5acc355df03723ef808
Mesa:            (mesa_7_4_branch)e2092bb23c956ba9ab940935f803ef843db81af2
Xserver:         (server-1.6-branch)4557b3f6c4273cd83b701beaf7a150c806fed298
Xf86_video_intel:  (master)81c652e9a666a7459bcc5217c8a5ec518b6e00da
Kernel:           (for-airlied)66647dc60d16fae9f6963fd98b6d9baa1a8dac69

Bug Description:
---------------------
In UXA mode, set the tiling on, if you use xrandr to rotate the desktop, it will hsa a messed output and when rotate back to normal its output is OK. Then log in to gnome, it will be almost blackscreen only can see the xterm with the title blurred. You drag it it appears no change.(see the attached photo)  In UXA mode disabling the tiling, the desktop will be OK. And in EXA mode the desktop will be OK both with tiling on and off.    


Reproduce Steps:
---------------------
1. set tiling on
1. xinit&
2. xrandr --output LVDS --rotate left
3. xrandr --output LVDS --rotate normal
4. gnome-session&
Comment 1 zhao jian 2009-02-24 00:29:48 UTC
Created attachment 23251 [details]
xorg.0.log
Comment 2 zhao jian 2009-02-24 00:34:25 UTC
Created attachment 23252 [details]
desktop in uxa with tiling on
Comment 3 Gordon Jin 2009-02-24 04:55:29 UTC
Jian, is rotation a required step to reproduce this bug? If so, this may be related to bug#20265.
Comment 4 zhao jian 2009-03-17 03:22:32 UTC
(In reply to comment #3)
> Jian, is rotation a required step to reproduce this bug? If so, this may be
> related to bug#20265.

Yes, it's a required step. But Jesse's patch to #20265 have no effect to this bug.  
Comment 5 Gordon Jin 2009-03-17 20:24:25 UTC
Does this happen if rotating after gnome-session (i.e. move step 4 before step 2)? If so, I'll consider this as major bug.
Comment 6 zhao jian 2009-03-19 01:40:25 UTC
(In reply to comment #5)
> Does this happen if rotating after gnome-session (i.e. move step 4 before step
> 2)? If so, I'll consider this as major bug.

If I start gnome-session directly, and rotating in gnome, it will have a disordered display. But when rotate it back to normal, it displays well. 
Comment 7 Gordon Jin 2009-03-22 02:23:05 UTC
How about using KMS?
Comment 8 zhao jian 2009-03-30 03:18:42 UTC
With KMS, it will crash X with the newest code. As #20943. 
Comment 9 Jesse Barnes 2009-04-07 18:00:53 UTC
This should be fixed now?
Comment 10 zhao jian 2009-04-07 19:49:09 UTC
With the newest code, both in UMS and KMS, it works well if I rotate after I started gnome-session, but it will still has the blurred screen if I rotate it and then start gnome-session. 
Libdrm:             (master)1faab66cfd1a854925da6ff7109aa614292dea90
Mesa:               (mesa_7_4_branch)de197cf991416f0cd65ad2e2d2ca9aa599b52075
Xserver:            (server-1.6-branch)60c161545af80eb78eb790a05bde79409dfdf16e
Xf86_video_intel:   (2.7)3e5586cace98f73a9f8403a6446d380899ecbce9
Kernel:             (drm-intel-2.6.29)71d7aec4bbf923eaf43563c03459726a746cd332
Comment 11 Jesse Barnes 2009-04-10 12:38:02 UTC
Yeah I see this too; but only after rotating then rotating back to normal and starting the session, both with and without tiling.
Comment 12 Jesse Barnes 2009-04-10 12:39:38 UTC
Even happens with EXA...
Comment 13 Jesse Barnes 2009-04-10 12:42:06 UTC
Happens on 965 too.
Comment 14 Jesse Barnes 2009-04-10 13:11:38 UTC
Ah no I see it with EXA but only if my pixmap management patch is applied, which points to the prepare/finish access hooks...
Comment 15 Jesse Barnes 2009-05-04 11:26:18 UTC
Seems like some sort of reuse or stale pointer issue.  I can reliably reproduce this but only if no other windows pop up before I start the GNOME session.  I had a failure dialog pop up last time, and when I started gnome-session after that it worked fine.
Comment 16 Eric Anholt 2009-05-15 22:47:56 UTC
This commit may affect weird tiling issues:

commit 87332a7cc16af82aa47e07fbf90da3635b071dbf
Author: Keith Packard <keithp@keithp.com>
Date:   Mon May 11 13:52:00 2009 -0700

    Use drm_intel_bo_disable_reuse API to flag scanout and cursor buffers

(only kms though, probably)
Comment 17 sascha heid 2009-05-24 16:43:42 UTC
I had the same problem with 2.7.1 when i just updated to karmic (ubuntu pre-alpha). I found this bug, updated to git and now rotation seems to work fine again. Im using a gma945 and exa (defaults to it).
Comment 18 Gordon Jin 2009-06-09 14:13:55 UTC
Jian, retest please.
Comment 19 zhao jian 2009-06-10 01:16:05 UTC
(In reply to comment #18)
> Jian, retest please.

It still has such problem with the newest code.
Comment 20 Gordon Jin 2009-06-12 11:42:57 UTC
increasing priority, assuming users setting rotation in xorg.conf will be impacted.
Comment 21 Jesse Barnes 2009-06-22 16:48:40 UTC
I see this even with tiling disabled, can you confirm?
Comment 22 zhao jian 2009-06-24 18:51:21 UTC
(In reply to comment #21)
> I see this even with tiling disabled, can you confirm?

Yes, with either server-1.6-branch and mesa_7_5_branch or all in master branch, with tiling disabled it still existed. 
Comment 23 Jesse Barnes 2009-07-02 12:51:31 UTC
Created attachment 27343 [details] [review]
clear bo of scratch pixmap to handle reuse

Can you confirm that this fixes things for you in both KMS and UMS mode?  It works for me, but I'm afraid it's papering over a bigger problem with scratch pixmaps.  Keith?
Comment 24 Jesse Barnes 2009-07-02 13:06:45 UTC
Fix pushed, please verify.

commit 882d992e7375d090f6ef031129e027412a51edf1
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Thu Jul 2 13:04:51 2009 -0700

    Clear the bo on the rotate scratch pixmap
Comment 25 Jesse Barnes 2009-07-02 13:08:43 UTC
err had to rebase before pushing:

commit c1755599db1d9a20954b84ccc07afd892bb6ac9e
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Thu Jul 2 13:04:51 2009 -0700

    Clear the bo on the rotate scratch pixmap
Comment 26 zhao jian 2009-07-03 03:56:30 UTC
(In reply to comment #25)
> err had to rebase before pushing:
> commit c1755599db1d9a20954b84ccc07afd892bb6ac9e
> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
> Date:   Thu Jul 2 13:04:51 2009 -0700
>     Clear the bo on the rotate scratch pixmap

Yes. It now works well. verified. 


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.