Reverse Optimus does not work on my laptop

Alexander E. Patrakov patrakov at gmail.com
Fri Mar 22 08:11:45 PDT 2013


Hello.

[12 days ago I have sent this directly to Dave Airlie, received no reply]

I have tried patches by Dave Airlie related to reverse optimus on my
laptop. The temporary goal is to use the additional outputs provided
by the ATI card (yes, to use it as a dumb UDL-like device).
Unfortunately, I could not get it to work. Let's debug this. Sorry for
providing test results with possibly-stupid combinations of the
patches. If you want to scroll to the end of a stupid debugging
session, search for "=====".

First, here is the hardware:

aep-vaio ~ # lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor
Family DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation
Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200
Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset
Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset
Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset
Family PCI Express Root Port 1 (rev b4)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset
Family PCI Express Root Port 2 (rev b4)
00:1c.2 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset
Family PCI Express Root Port 3 (rev b4)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset
Family PCI Express Root Port 4 (rev b4)
00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset
Family PCI Express Root Port 7 (rev b4)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset
Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM67 Express Chipset Family LPC
Controller (rev 04)
00:1f.2 RAID bus controller: Intel Corporation 82801 Mobile SATA
Controller [RAID mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family
SMBus Controller (rev 04)
02:00.0 Network controller: Intel Corporation Centrino Advanced-N 6230
[Rainbow Peak] (rev 34)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd.
RTS5209 PCI Express Card Reader (rev 01)
04:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host
Controller (rev 04)
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 06)
08:00.0 PCI bridge: Intel Corporation Device 151b (rev 01)
0a:00.0 PCI bridge: Intel Corporation Device 151b (rev 01)
0a:03.0 PCI bridge: Intel Corporation Device 151b (rev 01)
0a:04.0 PCI bridge: Intel Corporation Device 151b (rev 01)
14:00.0 PCI bridge: Intel Corporation Device 151b (rev 01)
15:03.0 PCI bridge: Intel Corporation Device 151b (rev 01)
15:04.0 PCI bridge: Intel Corporation Device 151b (rev 01)
16:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee
ATI Whistler XT [AMD Radeon HD 6700M Series]
16:00.1 Audio device: Advanced Micro Devices [AMD] nee ATI
Turks/Whistler HDMI Audio [Radeon HD 6000 Series]
17:00.0 PCI bridge: Intel Corporation Device 151b (rev 01)
18:00.0 PCI bridge: Intel Corporation Device 151b (rev 01)
18:01.0 PCI bridge: Intel Corporation Device 151b (rev 01)
18:02.0 PCI bridge: Intel Corporation Device 151b (rev 01)
18:03.0 PCI bridge: Intel Corporation Device 151b (rev 01)
18:04.0 PCI bridge: Intel Corporation Device 151b (rev 01)
19:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 06)
1a:00.0 IDE interface: Marvell Technology Group Ltd. 88SE6121 SATA II
/ PATA Controller (rev b2)
1b:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host
Controller (rev 04)
aep-vaio ~ # lspci -n
00:00.0 0600: 8086:0104 (rev 09)
00:02.0 0300: 8086:0126 (rev 09)
00:16.0 0780: 8086:1c3a (rev 04)
00:1a.0 0c03: 8086:1c2d (rev 04)
00:1b.0 0403: 8086:1c20 (rev 04)
00:1c.0 0604: 8086:1c10 (rev b4)
00:1c.1 0604: 8086:1c12 (rev b4)
00:1c.2 0604: 8086:1c14 (rev b4)
00:1c.3 0604: 8086:1c16 (rev b4)
00:1c.6 0604: 8086:1c1c (rev b4)
00:1d.0 0c03: 8086:1c26 (rev 04)
00:1f.0 0601: 8086:1c4b (rev 04)
00:1f.2 0104: 8086:282a (rev 04)
00:1f.3 0c05: 8086:1c22 (rev 04)
02:00.0 0280: 8086:0091 (rev 34)
03:00.0 ff00: 10ec:5209 (rev 01)
04:00.0 0c03: 1033:0194 (rev 04)
05:00.0 0200: 10ec:8168 (rev 06)
08:00.0 0604: 8086:151b (rev 01)
0a:00.0 0604: 8086:151b (rev 01)
0a:03.0 0604: 8086:151b (rev 01)
0a:04.0 0604: 8086:151b (rev 01)
14:00.0 0604: 8086:151b (rev 01)
15:03.0 0604: 8086:151b (rev 01)
15:04.0 0604: 8086:151b (rev 01)
16:00.0 0300: 1002:6740
16:00.1 0403: 1002:aa90
17:00.0 0604: 8086:151b (rev 01)
18:00.0 0604: 8086:151b (rev 01)
18:01.0 0604: 8086:151b (rev 01)
18:02.0 0604: 8086:151b (rev 01)
18:03.0 0604: 8086:151b (rev 01)
18:04.0 0604: 8086:151b (rev 01)
19:00.0 0200: 10ec:8168 (rev 06)
1a:00.0 0101: 11ab:6121 (rev b2)
1b:00.0 0c03: 1033:0194 (rev 04)

=====

The laptop has a 1920x1080 panel connected to eDP1 on the intel card,
and I have connected a 1920x1200 monitor to HDMI-1 output of the
radeon card.

The laptop is currently running linux-3.8.2.

As I understand, to get reverse optimus working, I need this
xf86-video-ati patch:

>From 9b566bf2d446805242b9528831f55863ada8d32d Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Tue, 08 Jan 2013 05:56:37 +0000
Subject: radeon: add support for reverse prime

So, I have applied it on top of xf86-video-ati-7.1.0 (built without glamor).

And the following Dave's patches for xorg-server are not in 1.14.0:

>From 8389f3b5852acaf9e6f04083fd02708a4e38114f Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 04:23:57 +0000
Subject: randr: don't directly set changed bits in randr screen

>From 1ec20d6d0f8e8e9c3d4e3da83e58b204c0c85962 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 04:29:47 +0000
Subject: randr: make SetChanged modify the main protocol screen not
the gpu screen

>From c12b9c12a76f7ebdef1a029d80b674ac2f07006b Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 04:25:43 +0000
Subject: randr: only respected changed on the protocol screen

>From fdc5f7dacb92aa806d88a5fc44252c9b93623f0b Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 04:26:35 +0000
Subject: randr: report changes when we disconnect a GPU slave

>From 8df4c1054459af2e1410dd4fbdb37be7c53a4543 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 02:51:55 +0000
Subject: dix/gpu: remove asserts for output/offload from same slave

>From 630170f1f5ab370e2aa477ef2139da41ff02dd93 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 02:52:03 +0000
Subject: xf86crtc: don't use scrn->display for gpu screens

>From 57c54e29b931ef6bdf96eab52ec57c4ddab7e227 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 02:52:08 +0000
Subject: dix: allow pixmap dirty helper to be used for non-shared pixmaps

>From 984b25626089df1344c2a403b398037ea57d7312 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 02:52:13 +0000
Subject: gpu: call CreateScreenResources for GPU screens

Note that not all of them are in
http://cgit.freedesktop.org/~airlied/xserver/log/?h=reverse-prime ,
why?

=====

The test scenario is (via ssh from another computer):

gdb X
run -noreset

In the other terminal:

# DISPLAY=:0 xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x93 cap: 0xb, Source Output, Sink Output, Sink
Offload crtcs: 2 outputs: 4 associated providers: 0 name:Intel
Provider 1: id: 0x57 cap: 0xf, Source Output, Sink Output, Source
Offload, Sink Offload crtcs: 6 outputs: 2 associated providers: 0
name:radeon

# DISPLAY=:0 xrandr --setprovideroutputsource 0x57 0x93
# or whatever the IDs are
# DISPLAY=:0 xrandr --auto

Result: xorg crashes.

Without xorg patches (but with patched xf86-video-ati), I get this crash:

Program received signal SIGSEGV, Segmentation fault.
0x00007f44a1d122f5 in dixGetPrivateAddr (privates=0x410,
key=0x7f44a1f2c380 <exaScreenPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:124
124         return (char *) (*privates) + key->offset;
(gdb) bt full
#0  0x00007f44a1d122f5 in dixGetPrivateAddr (privates=0x410,
key=0x7f44a1f2c380 <exaScreenPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:124
        __PRETTY_FUNCTION__ = "dixGetPrivateAddr"
#1  0x00007f44a1d12352 in dixGetPrivate (privates=0x410,
key=0x7f44a1f2c380 <exaScreenPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:138
        __PRETTY_FUNCTION__ = "dixGetPrivate"
#2  0x00007f44a1d124cd in exaGetPixmapDriverPrivate (pPix=0x1eaafd0)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/exa/exa.c:68
        pExaPixmap = 0x4279f0 <_start>
#3  0x00007f44a5b64145 in radeon_set_pixmap_bo (pPix=0x1eaafd0, bo=0x1eb03a0)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/radeon.h:588
        driver_priv = 0xa
#4  0x00007f44a5b67ad3 in drmmode_xf86crtc_resize (scrn=0x1c3f740,
width=1920, height=1216)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/drmmode_display.c:1460
        xf86_config = 0x1f00ce0
        drmmode_crtc = 0x1f02740
        drmmode = 0x1f149d0
        info = 0x1f14780
        old_front = 0x1ea8ba0
        ret = 0
        screen = 0x1f1d370
        old_fb_id = 0
        i = 32580
        pitch = 7680
        old_width = 1920
        old_height = 1080
        old_pitch = 1920
        screen_size = 9338880
        cpp = 4
        front_bo = 0x1ea8ba0
        surface = {npix_x = 1920, npix_y = 1216, npix_z = 1, blk_w =
1, blk_h = 1, blk_d = 1, array_size = 1, last_level = 0,
          bpe = 4, nsamples = 1, flags = 66305, bo_size = 9338880,
bo_alignment = 16384, bankw = 1, bankh = 2, mtilea = 2,
          tile_split = 1024, stencil_tile_split = 512, stencil_offset
= 0, level = {{offset = 0, slice_size = 9338880,
              npix_x = 1920, npix_y = 1216, npix_z = 1, nblk_x = 1920,
nblk_y = 1216, nblk_z = 1, pitch_bytes = 7680, mode = 3}, {
              offset = 0, slice_size = 0, npix_x = 0, npix_y = 0,
npix_z = 0, nblk_x = 0, nblk_y = 0, nblk_z = 0, pitch_bytes = 0,
              mode = 0} <repeats 31 times>}, stencil_level = {{offset
= 0, slice_size = 0, npix_x = 0, npix_y = 0, npix_z = 0,
              nblk_x = 0, nblk_y = 0, nblk_z = 0, pitch_bytes = 0,
mode = 0} <repeats 32 times>}}
        psurface = 0x7fff00000001
        tiling_flags = 67248385
        base_align = 16384
        ppix = 0x1eaafd0
        fb_shadow = 0x7f44ab302a04 <_dl_fixup+244>
---Type <return> to continue, or q <return> to quit---
#5  0x00007f44a5b65b66 in drmmode_set_scanout_pixmap (crtc=0x1efef70,
ppix=0x2387b80)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/drmmode_display.c:668
        ret = 0
        screen = 0x1f1d370
        screenpix = 0x1eaafd0
#6  0x00000000004f0470 in xf86CrtcSetScanoutPixmap
(randr_crtc=0x1f36f20, pixmap=0x2387b80)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/hw/xfree86/modes/xf86RandR12.c:1870
        crtc = 0x1efef70
#7  0x00000000005401bb in rrCreateSharedPixmap (crtc=0x1f36f20,
width=1920, height=1200, x=0, y=0)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/randr/rrcrtc.c:428
        mpix = 0x23d9bd0
        spix = 0x2387b80
        master = 0x1f44b80
        ret = 32767
        depth = 24
        mscreenpix = 0x2264c40
        protopix = 0x2264c40
        pScrPriv = 0x1f35a10
#8  0x0000000000540973 in RRCrtcSet (crtc=0x1f36f20, mode=0x2378a00,
x=0, y=0, rotation=1, numOutputs=1, outputs=0x2387b60)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/randr/rrcrtc.c:557
        master = 0x1f44b80
        width = 1920
        height = 1200
        pScreen = 0x1f1d370
        ret = 1
        recompute = 1
        pScrPriv = 0x1f35a10
#9  0x0000000000542021 in ProcRRSetCrtcConfig (client=0x237a360)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/randr/rrcrtc.c:1162
        stuff = 0x2376528
        rep = {type = 0 '\000', status = 0 '\000', sequenceNumber = 0,
length = 0, newTimestamp = 0, pad1 = 0, pad2 = 0, pad3 = 0,
          pad4 = 0, pad5 = 0}
        pScreen = 0x1f1d370
        pScrPriv = 0x1f35a10
        crtc = 0x1f36f20
        mode = 0x2378a00
        numOutputs = 1
        outputs = 0x2387b60
        outputIds = 0x2376544
        time = {months = 0, milliseconds = 1205868}
        rotation = 1
        ret = 0
---Type <return> to continue, or q <return> to quit---
        i = 1
        j = 1
        status = 0 '\000'
#10 0x000000000053eecf in ProcRRDispatch (client=0x237a360)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/randr/randr.c:557
        stuff = 0x2376528
#11 0x00000000004378a7 in Dispatch ()
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/dispatch.c:432
        clientReady = 0x238b090
        result = 0
        client = 0x237a360
        nready = 0
        icheck = 0x8ac070 <checkForInput>
        start_tick = 200
#12 0x00000000004280e1 in main (argc=2, argv=0x7fffda6c8048,
envp=0x7fffda6c8060)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/main.c:295
        i = 1
        alwaysCheckForInput = {0, 1}

So, obviously, privates look wrong.

(gdb) up
#1  0x00007f44a1d12352 in dixGetPrivate (privates=0x410,
key=0x7f44a1f2c380 <exaScreenPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:138
138         return *(void **) dixGetPrivateAddr(privates, key);
(gdb) up
#2  0x00007f44a1d124cd in exaGetPixmapDriverPrivate (pPix=0x1eaafd0)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/exa/exa.c:68
68          ExaPixmapPriv(pPix);
(gdb) print *pPix
$1 = {drawable = {type = 0 '\000', class = 0 '\000', depth = 0 '\000',
bitsPerPixel = 0 '\000', id = 0, x = 1920, y = 0,
    width = 0, height = 0, pScreen = 0x20, serialNumber = 689},
devPrivates = 0x5a1106 <SetDeviceIndicators+951>,
  refcnt = 31727856, devKind = 0, devPrivate = {ptr = 0x0, val = 0,
uval = 0, fptr = 0x0}, screen_x = -26464, screen_y = 493,
  usage_hint = 0, master_pixmap = 0x1ed9560}

Looks rather strange. If you think that I should print more values,
please tell me so.

There is also an interesting piece of the log (i.e. the driver is not
happy with the native resolution of the HDMI monitor, fixed by some
later patch):

[  1039.462] (II) RADEON(G0): EDID (in hex):
[  1039.462] (II) RADEON(G0):   00ffffffffffff0010ac16f04c334b30
[  1039.462] (II) RADEON(G0):   1715010380342078ea1ec5ae4f34b126
[  1039.462] (II) RADEON(G0):   0e5054a54b008180a940d100714f0101
[  1039.462] (II) RADEON(G0):   010101010101283c80a070b023403020
[  1039.462] (II) RADEON(G0):   360006442100001a000000ff00463532
[  1039.462] (II) RADEON(G0):   354d313633304b334c0a000000fc0044
[  1039.462] (II) RADEON(G0):   454c4c2055323431300a2020000000fd
[  1039.462] (II) RADEON(G0):   00384c1e5111000a2020202020200187
[  1039.462] (II) RADEON(G0):   020329f15090050403020716011f1213
[  1039.462] (II) RADEON(G0):   14201511062309070767030c00100038
[  1039.462] (II) RADEON(G0):   2d83010000e3050301023a801871382d
[  1039.462] (II) RADEON(G0):   40582c450006442100001e011d801871
[  1039.462] (II) RADEON(G0):   1c1620582c250006442100009e011d00
[  1039.462] (II) RADEON(G0):   7251d01e206e28550006442100001e8c
[  1039.462] (II) RADEON(G0):   0ad08a20e02d10103e96000644210000
[  1039.462] (II) RADEON(G0):   1800000000000000000000000000003e
[  1039.462] (II) RADEON(G0): Not using mode "1920x1200" (height too
large for virtual size)
[  1039.462] (II) RADEON(G0): Not using mode "1600x1200" (height too
large for virtual size)
[  1039.462] (II) RADEON(G0): Printing probed modes for output HDMI-1
[  1039.462] (II) RADEON(G0): Modeline "1920x1080"x50.0  148.50  1920
2448 2492 2640  1080 1084 1089 1125 +hsync +vsync (56.2 kHz e)
[  1039.462] (II) RADEON(G0): Modeline "1920x1080"x60.0  148.50  1920
2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz e)
[  1039.462] (II) RADEON(G0): Modeline "1920x1080"x24.0   74.25  1920
2558 2602 2750  1080 1084 1089 1125 +hsync +vsync (27.0 kHz e)
[  1039.462] (II) RADEON(G0): Modeline "1920x1080i"x50.0   74.25  1920
2448 2492 2640  1080 1084 1094 1125 interlace +hsync +vsync (28.1 kHz
e)
and so on

=====

OK, so I thought I need xorg patches, too. I have applied them
all up to and including 57c54e29b931ef6bdf96eab52ec57c4ddab7e227. This
does not crash under the same testcase (the HDMI-connected screen is
just filled with random RGB noise), but it does crash in the same
place (but obviously with a different cause) if I run xfce4-panel.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000567a35 in dixGetPrivateAddr (privates=0x410, key=0x8a8460
<damageScrPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:124
124         return (char *) (*privates) + key->offset;
(gdb) bt full
#0  0x0000000000567a35 in dixGetPrivateAddr (privates=0x410,
key=0x8a8460 <damageScrPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:124
        __PRETTY_FUNCTION__ = "dixGetPrivateAddr"
#1  0x0000000000567a92 in dixGetPrivate (privates=0x410, key=0x8a8460
<damageScrPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:138
        __PRETTY_FUNCTION__ = "dixGetPrivate"
#2  0x0000000000567b59 in dixLookupPrivate (privates=0x410,
key=0x8a8460 <damageScrPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:168
No locals.
#3  0x0000000000567e8b in damageRegionAppend (pDrawable=0x19bc9d0,
pRegion=0x7fff1dc957e0, clip=0, subWindowMode=-1)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/miext/damage/damage.c:180
        pScreen = 0x20
        pScrPriv = 0x7fff1dc95cf0
        pDamage = 0x7fff1dc957e0
        pNext = 0x7fff1dc95800
        clippedRec = {extents = {x1 = -1, y1 = -1, x2 = 0, y2 = 0},
data = 0x1a6}
        pDamageRegion = 0x7fff1dc957e0
        pixClip = {extents = {x1 = 31312, y1 = 421, x2 = 0, y2 = 0},
data = 0x40fa30}
        draw_x = 32767
        draw_y = 499734448
        screen_x = 0
        screen_y = 26986960
#4  0x000000000056e12e in DamageRegionAppend (pDrawable=0x19bc9d0,
pRegion=0x7fff1dc957e0)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/miext/damage/damage.c:1950
No locals.
#5  0x00007f030e8f9c9b in redisplay_dirty (screen=0x1a2f670, dirty=0x19d6900)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/radeon_kms.c:248
        pScrn = 0x1751740
        pixregion = {extents = {x1 = 0, y1 = 0, x2 = 1920, y2 = 1200},
data = 0x0}
#6  0x00007f030e8f9d4a in radeon_dirty_update (screen=0x1a2f670)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/radeon_kms.c:268
        region = 0x1ea3c00
        ent = 0x19d6900
#7  0x00007f030e8f9e35 in RADEONBlockHandler_KMS (arg=0x1a2f670,
pTimeout=0x7fff1dc95ad8, pReadmask=0x8b3000 <LastSelectMask>)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/radeon_kms.c:290
        pScreen = 0x1a2f670
        pScrn = 0x1751740
        info = 0x1a26780
#8  0x0000000000445ccc in BlockHandler (pTimeout=0x7fff1dc95ad8,
pReadmask=0x8b3000 <LastSelectMask>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/dixutils.c:390
        i = 0
        j = 0
---Type <return> to continue, or q <return> to quit---
#9  0x000000000060cd52 in WaitForSomething (pClientsReady=0x1eb6c90)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/os/WaitFor.c:210
        i = 0
        waittime = {tv_sec = 422, tv_usec = 175000}
        wt = 0x7fff1dc95ae0
        timeout = 422175
        clientsReadable = {fds_bits = {0 <repeats 16 times>}}
        clientsWritable = {fds_bits = {206158430224, 140733693123248,
140733693123360, 140733693123104, 0, 6411827, 30,
            4327747424, 140733693123200, 27450992, 140733693123152,
6416063, 19, 4299323936, 140733693123200, 27450992}}
        curclient = 0
        selecterr = 0
        nready = 0
        devicesReadable = {fds_bits = {30, 140733693123200, 1, 12,
8388648, 0, 32764384, 27451152, 9117888, 27620272,
            140733693123008, 5246855, 2048, 32764384, 6618527, 8841842235}}
        now = 2673489
        someReady = 0
#10 0x00000000004376af in Dispatch ()
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/dispatch.c:361
        clientReady = 0x1eb6c90
        result = 0
        client = 0x1a2df10
        nready = -1
        icheck = 0x8ac070 <checkForInput>
        start_tick = 400
#11 0x0000000000428111 in main (argc=3, argv=0x7fff1dc95cf8,
envp=0x7fff1dc95d18)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/main.c:295
        i = 1
        alwaysCheckForInput = {0, 1}
(gdb) up
#1  0x0000000000567a92 in dixGetPrivate (privates=0x410, key=0x8a8460
<damageScrPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:138
138         return *(void **) dixGetPrivateAddr(privates, key);
(gdb) up
#2  0x0000000000567b59 in dixLookupPrivate (privates=0x410,
key=0x8a8460 <damageScrPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:168
168             return dixGetPrivate(privates, key);
(gdb) up
#3  0x0000000000567e8b in damageRegionAppend (pDrawable=0x19bc9d0,
pRegion=0x7fff1dc957e0, clip=0, subWindowMode=-1)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/miext/damage/damage.c:180
180         damageScrPriv(pScreen);
(gdb) up
#4  0x000000000056e12e in DamageRegionAppend (pDrawable=0x19bc9d0,
pRegion=0x7fff1dc957e0)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/miext/damage/damage.c:1950
1950        damageRegionAppend(pDrawable, pRegion, FALSE, -1);
(gdb) print pDrawable
$1 = (DrawablePtr) 0x19bc9d0
(gdb) print *pDrawable
$2 = {type = 0 '\000', class = 0 '\000', depth = 0 '\000',
bitsPerPixel = 0 '\000', id = 0, x = 1920, y = 0, width = 1920,
  height = 1200, pScreen = 0x20, serialNumber = 689}
(gdb) up
#5  0x00007f030e8f9c9b in redisplay_dirty (screen=0x1a2f670, dirty=0x19d6900)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/radeon_kms.c:248
248             DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion);
(gdb) print *screen
$4 = {myNum = 256, id = 0, x = 0, y = 0, width = 1920, height = 1200,
mmWidth = 508, mmHeight = 318, numDepths = 7,
  rootDepth = 24 '\030', allowedDepths = 0x1a419a0, rootVisual = 33,
defColormap = 32, minInstalledCmaps = 1,
  maxInstalledCmaps = 1, backingStoreSupport = 0 '\000',
saveUnderSupport = 0 '\000', whitePixel = 16777215, blackPixel = 0,
  GCperDepth = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
PixmapPerDepth = {0x0}, devPrivate = 0x19bc9d0, numVisuals = 2,
  visuals = 0x1a41a20, root = 0x0, screensaver = {pWindow = 0x0, wid =
0, blanked = 0 '\000', ExternalScreenSaver = 0x0},
  screenSpecificPrivates = {{key = 0x0, offset = 0, created = 0,
allocated = 0}, {key = 0x0, offset = 368, created = 0,
      allocated = 0}, {key = 0x0, offset = 0, created = 0, allocated =
0}, {key = 0x0, offset = 0, created = 0, allocated = 0}, {
      key = 0x0, offset = 104, created = 0, allocated = 0}, {key =
0x0, offset = 208, created = 0, allocated = 0}, {key = 0x0,
      offset = 0, created = 0, allocated = 0}, {key = 0x0, offset = 0,
created = 0, allocated = 0}, {key = 0x1d79810, offset = 64,
      created = 0, allocated = 0}, {key = 0x1a428e0, offset = 136,
created = 1, allocated = 0}, {key = 0x1a42900, offset = 72,
      created = 0, allocated = 0}, {key = 0x0, offset = 8, created =
0, allocated = 0}, {key = 0x0, offset = 0, created = 0,
      allocated = 0}, {key = 0x0, offset = 24, created = 0, allocated
= 0}, {key = 0x0, offset = 0, created = 0, allocated = 0}, {
      key = 0x0, offset = 8, created = 0, allocated = 0}, {key = 0x0,
offset = 0, created = 0, allocated = 0}, {key = 0x0,
      offset = 0, created = 0, allocated = 0}, {key = 0x0, offset = 0,
created = 0, allocated = 0}},
  CloseScreen = 0x491536 <DGACloseScreen>, QueryBestSize = 0x4f2f15
<xf86CursorQueryBestSize>,
  SaveScreen = 0x7f030e8fb993 <RADEONSaveScreen_KMS>, GetImage =
0x5fd2ed <miSpriteGetImage>,
  GetSpans = 0x5fd4ed <miSpriteGetSpans>, SourceValidate = 0x5fd739
<miSpriteSourceValidate>,
  CreateWindow = 0x7f030e494da9 <fbCreateWindow>, DestroyWindow =
0x4b98b3 <xf86XVDestroyWindow>,
  PositionWindow = 0x7f030e494e5d <fbPositionWindow>,
ChangeWindowAttributes = 0x7f030aaac864 <exaChangeWindowAttributes>,
  RealizeWindow = 0x7f030e494e4e <fbMapWindow>, UnrealizeWindow =
0x7f030e494e72 <fbUnmapWindow>,
  ValidateTree = 0x600199 <miValidateTree>, PostValidateTree = 0x0,
WindowExposures = 0x4b9ab6 <xf86XVWindowExposures>,
  CopyWindow = 0x5fd93d <miSpriteCopyWindow>, ClearToBackground =
0x606a62 <miClearToBackground>,
  ClipNotify = 0x4b9cc4 <xf86XVClipNotify>, RestackWindow = 0x0,
CreatePixmap = 0x7f030aab1095 <exaCreatePixmap_mixed>,
  DestroyPixmap = 0x51a013 <XvDestroyPixmap>, RealizeFont =
0x7f030e4901d2 <fbRealizeFont>,
  UnrealizeFont = 0x7f030e4901e5 <fbUnrealizeFont>, ConstrainCursor =
0x5f6648 <miPointerConstrainCursor>,
  ConstrainCursorHarder = 0x4f04b2 <xf86RandR13ConstrainCursorHarder>,
CursorLimits = 0x5f66dd <miPointerCursorLimits>,
  DisplayCursor = 0x5f6593 <miPointerDisplayCursor>, RealizeCursor =
0x5f64e6 <miPointerRealizeCursor>,
  UnrealizeCursor = 0x5f653c <miPointerUnrealizeCursor>, RecolorCursor
= 0x4f301d <xf86CursorRecolorCursor>,
  SetCursorPosition = 0x5f6705 <miPointerSetCursorPosition>, CreateGC
= 0x5683fe <damageCreateGC>,
  CreateColormap = 0x7f030e4736bc <fbInitializeColormap>,
DestroyColormap = 0x4915fc <DGADestroyColormap>,
  InstallColormap = 0x4916cc <DGAInstallColormap>, UninstallColormap =
0x49177c <DGAUninstallColormap>,
  ListInstalledColormaps = 0x7f030e473631 <fbListInstalledColormaps>,
StoreColors = 0x5fde74 <miSpriteStoreColors>,
  ResolveColor = 0x7f030e47368a <fbResolveColor>, BitmapToRegion =
0x7f030aaaca20 <exaBitmapToRegion>,
  SendGraphicsExpose = 0x5ebf49 <miSendGraphicsExpose>, BlockHandler =
0x7f030e8f9d86 <RADEONBlockHandler_KMS>,
  WakeupHandler = 0x445bfc <NoopDDA>, devPrivates = 0x1d797d0,
CreateScreenResources = 0x4de935 <xf86CrtcCreateScreenResources>,
  ModifyPixmapHeader = 0x7f030aab13b5 <exaModifyPixmapHeader_mixed>,
GetWindowPixmap = 0x7f030e4902c3 <_fbGetWindowPixmap>,
  SetWindowPixmap = 0x56d421 <damageSetWindowPixmap>, GetScreenPixmap
= 0x5fb2c7 <miGetScreenPixmap>,
  SetScreenPixmap = 0x5fb2dc <miSetScreenPixmap>, pScratchPixmap =
0x0, totalPixmapSize = 208,
  MarkWindow = 0x606c3b <miMarkWindow>, MarkOverlappedWindows =
0x606ca9 <miMarkOverlappedWindows>,
  ConfigNotify = 0x5d806c <DRI2ConfigNotify>, MoveWindow = 0x607030
<miMoveWindow>,
  ResizeWindow = 0x6073e5 <miSlideAndSizeWindow>, GetLayerWindow =
0x60810f <miGetLayerWindow>,
  HandleExposures = 0x606f11 <miHandleValidateExposures>,
ReparentWindow = 0x0, SetShape = 0x608121 <miSetShape>,
---Type <return> to continue, or q <return> to quit---
  ChangeBorderWidth = 0x608333 <miChangeBorderWidth>,
MarkUnrealizedWindow = 0x60853d <miMarkUnrealizedWindow>,
  DeviceCursorInitialize = 0x5f681c <miPointerDeviceInitialize>,
DeviceCursorCleanup = 0x5f694c <miPointerDeviceCleanup>,
  canDoBGNoneRoot = 0, isGPU = 1, unattached_list = {next = 0x1a2fb18,
prev = 0x1a2fb18}, unattached_head = {next = 0x1a2fb28,
    prev = 0x1a2fb28}, current_master = 0x1a56fc0, output_slave_list =
{next = 0x1a2fb40, prev = 0x1a2fb40}, output_head = {
    next = 0x1a57490, prev = 0x1a57490}, SharePixmapBacking =
0x7f030aab1baa <exaSharePixmapBacking_mixed>,
  SetSharedPixmapBacking = 0x7f030aab1c3c <exaSetSharedPixmapBacking_mixed>,
  StartPixmapTracking = 0x466734 <PixmapStartDirtyTracking>,
StopPixmapTracking = 0x466838 <PixmapStopDirtyTracking>,
  pixmap_dirty_list = {next = 0x19d6920, prev = 0x19d6920},
offload_slave_list = {next = 0x1a2fb90, prev = 0x1a2fb90},
  offload_head = {next = 0x0, prev = 0x0}, ReplaceScanoutPixmap =
0x5435cf <RRReplaceScanoutPixmap>}
(gdb) print dirty
$5 = (PixmapDirtyUpdatePtr) 0x19d6900
(gdb) print *dirty
$6 = {src = 0x1a2d150, slave_dst = 0x19bc9d0, x = 0, y = 0, damage =
0x1ea3bf0, ent = {next = 0x1a2fb80, prev = 0x1a2fb80}}
(gdb) print *dirty->slave_dst
$7 = {drawable = {type = 0 '\000', class = 0 '\000', depth = 0 '\000',
bitsPerPixel = 0 '\000', id = 0, x = 1920, y = 0,
    width = 1920, height = 1200, pScreen = 0x20, serialNumber = 689},
devPrivates = 0x5a1106 <SetDeviceIndicators+715>,
  refcnt = 26558704, devKind = 0, devPrivate = {ptr = 0x0, val = 0,
uval = 0, fptr = 0x0}, screen_x = -19936, screen_y = 414,
  usage_hint = 0, master_pixmap = 0x19eaee0}

If you need me to print anything else, say so.

=====

With 984b25626089df1344c2a403b398037ea57d7312 on top of the above,
xorg-server crashes on start:

Program received signal SIGSEGV, Segmentation fault.
0x000000000056ddeb in DamageRegister (pDrawable=0x0, pDamage=0x20800a0)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/miext/damage/damage.c:1802
1802        ScreenPtr pScreen = pDrawable->pScreen;
(gdb) bt full
#0  0x000000000056ddeb in DamageRegister (pDrawable=0x0, pDamage=0x20800a0)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/miext/damage/damage.c:1802
        pScreen = 0x258
        pScrPriv = 0x0
#1  0x00000000004f11b5 in xf86RotatePrepare (pScreen=0x1d3c670)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/hw/xfree86/modes/xf86Rotate.c:171
        crtc = 0x1d1df70
        pScrn = 0x1a5e740
        xf86_config = 0x1d1fce0
        c = 0
#2  0x00000000004f1250 in xf86RotateRedisplay (pScreen=0x1d3c670)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/hw/xfree86/modes/xf86Rotate.c:192
        pScrn = 0x1a5e740
        xf86_config = 0x1d1fce0
        damage = 0x20800a0
        region = 0x1a67210
#3  0x00000000004f13c2 in xf86RotateBlockHandler (pScreen=0x1d3c670,
pTimeout=0x7fffb0d72c18, pReadmask=0x8b3000 <LastSelectMask>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/hw/xfree86/modes/xf86Rotate.c:238
        pScrn = 0x1a5e740
        xf86_config = 0x1d1fce0
        rotation_active = 0
#4  0x0000000000445d08 in BlockHandler (pTimeout=0x7fffb0d72c18,
pReadmask=0x8b3000 <LastSelectMask>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/dixutils.c:390
        i = 0
        j = 9094040
#5  0x000000000060ce86 in WaitForSomething (pClientsReady=0x21c4e60)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/os/WaitFor.c:210
        i = 0
        waittime = {tv_sec = 600, tv_usec = 0}
        wt = 0x7fffb0d72c20
        timeout = 600000
        clientsReadable = {fds_bits = {0 <repeats 16 times>}}
        clientsWritable = {fds_bits = {0, 1, 0, 640, 0, 1,
472446402652, 532575944823, 0, 35511312, 140568536544832, 576,
            35387184, 35511888, 576, 140568533255192}}
        curclient = 93
        selecterr = 110
        nready = 0
        devicesReadable = {fds_bits = {0, 140568536544832, 160, 40, 4,
35655552, 0, 140568533257557, 65535, 35404880, 160,
            6396363, 268435456, 0, 0, 0}}
        now = 3604779
        someReady = 0
#6  0x00000000004376eb in Dispatch ()
---Type <return> to continue, or q <return> to quit---
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/dispatch.c:361
        clientReady = 0x21c4e60
        result = 1
        client = 0x21bf97c
        nready = 7
        icheck = 0x8ac070 <checkForInput>
        start_tick = 30775648
#7  0x000000000042814e in main (argc=3, argv=0x7fffb0d72e38,
envp=0x7fffb0d72e58)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/main.c:298
        i = 1
        alwaysCheckForInput = {0, 1}

In this case, it is obvious that xorg wants to register rotational
damage on the root window before having created it. Or maybe it thinks
that a GPU screen doesn't need a root window.

(gdb) up
#1  0x00000000004f11b5 in xf86RotatePrepare (pScreen=0x1d3c670)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/hw/xfree86/modes/xf86Rotate.c:171
171                     DamageRegister(&pScreen->root->drawable,
(gdb) print pScreen
$1 = (ScreenPtr) 0x1d3c670
(gdb) print *pScreen
$2 = {myNum = 256, id = 0, x = 0, y = 0, width = 1920, height = 1200,
mmWidth = 508, mmHeight = 317, numDepths = 7,
  rootDepth = 24 '\030', allowedDepths = 0x1d4e9a0, rootVisual = 33,
defColormap = 32, minInstalledCmaps = 1,
  maxInstalledCmaps = 1, backingStoreSupport = 0 '\000',
saveUnderSupport = 0 '\000', whitePixel = 16777215, blackPixel = 0,
  GCperDepth = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
PixmapPerDepth = {0x0}, devPrivate = 0x2088060, numVisuals = 2,
  visuals = 0x1d4ea20, root = 0x0, screensaver = {pWindow = 0x0, wid =
0, blanked = 0 '\000', ExternalScreenSaver = 0x0},
  screenSpecificPrivates = {{key = 0x0, offset = 0, created = 0,
allocated = 0}, {key = 0x0, offset = 368, created = 0,
      allocated = 0}, {key = 0x0, offset = 0, created = 0, allocated =
0}, {key = 0x0, offset = 0, created = 0, allocated = 0}, {
      key = 0x0, offset = 104, created = 0, allocated = 0}, {key =
0x0, offset = 208, created = 0, allocated = 0}, {key = 0x0,
      offset = 0, created = 0, allocated = 0}, {key = 0x0, offset = 0,
created = 0, allocated = 0}, {key = 0x2086810, offset = 64,
      created = 0, allocated = 0}, {key = 0x1d4f8e0, offset = 136,
created = 2, allocated = 0}, {key = 0x1d4f900, offset = 72,
      created = 0, allocated = 0}, {key = 0x0, offset = 8, created =
0, allocated = 0}, {key = 0x0, offset = 0, created = 0,
      allocated = 0}, {key = 0x0, offset = 24, created = 0, allocated
= 0}, {key = 0x0, offset = 0, created = 0, allocated = 0}, {
      key = 0x0, offset = 8, created = 0, allocated = 0}, {key = 0x0,
offset = 0, created = 0, allocated = 0}, {key = 0x0,
      offset = 0, created = 0, allocated = 0}, {key = 0x0, offset = 0,
created = 0, allocated = 0}},
  CloseScreen = 0x491572 <DGACloseScreen>, QueryBestSize = 0x4f3049
<xf86CursorQueryBestSize>,
  SaveScreen = 0x7fd8a5dc9993 <RADEONSaveScreen_KMS>, GetImage =
0x5fd421 <miSpriteGetImage>,
  GetSpans = 0x5fd621 <miSpriteGetSpans>, SourceValidate = 0x5fd86d
<miSpriteSourceValidate>,
  CreateWindow = 0x7fd8a5962da9 <fbCreateWindow>, DestroyWindow =
0x4b98ef <xf86XVDestroyWindow>,
  PositionWindow = 0x7fd8a5962e5d <fbPositionWindow>,
ChangeWindowAttributes = 0x7fd8a1f7a864 <exaChangeWindowAttributes>,
  RealizeWindow = 0x7fd8a5962e4e <fbMapWindow>, UnrealizeWindow =
0x7fd8a5962e72 <fbUnmapWindow>,
  ValidateTree = 0x6002cd <miValidateTree>, PostValidateTree = 0x0,
WindowExposures = 0x4b9af2 <xf86XVWindowExposures>,
  CopyWindow = 0x5fda71 <miSpriteCopyWindow>, ClearToBackground =
0x606b96 <miClearToBackground>,
  ClipNotify = 0x4b9d00 <xf86XVClipNotify>, RestackWindow = 0x0,
CreatePixmap = 0x7fd8a1f7f095 <exaCreatePixmap_mixed>,
  DestroyPixmap = 0x51a147 <XvDestroyPixmap>, RealizeFont =
0x7fd8a595e1d2 <fbRealizeFont>,
  UnrealizeFont = 0x7fd8a595e1e5 <fbUnrealizeFont>, ConstrainCursor =
0x5f677c <miPointerConstrainCursor>,
  ConstrainCursorHarder = 0x4f05e6 <xf86RandR13ConstrainCursorHarder>,
CursorLimits = 0x5f6811 <miPointerCursorLimits>,
  DisplayCursor = 0x5f66c7 <miPointerDisplayCursor>, RealizeCursor =
0x5f661a <miPointerRealizeCursor>,
  UnrealizeCursor = 0x5f6670 <miPointerUnrealizeCursor>, RecolorCursor
= 0x4f3151 <xf86CursorRecolorCursor>,
  SetCursorPosition = 0x5f6839 <miPointerSetCursorPosition>, CreateGC
= 0x568532 <damageCreateGC>,
  CreateColormap = 0x7fd8a59416bc <fbInitializeColormap>,
DestroyColormap = 0x491638 <DGADestroyColormap>,
  InstallColormap = 0x491708 <DGAInstallColormap>, UninstallColormap =
0x4917b8 <DGAUninstallColormap>,
  ListInstalledColormaps = 0x7fd8a5941631 <fbListInstalledColormaps>,
StoreColors = 0x5fdfa8 <miSpriteStoreColors>,
  ResolveColor = 0x7fd8a594168a <fbResolveColor>, BitmapToRegion =
0x7fd8a1f7aa20 <exaBitmapToRegion>,
  SendGraphicsExpose = 0x5ec07d <miSendGraphicsExpose>, BlockHandler =
0x4f136e <xf86RotateBlockHandler>,
  WakeupHandler = 0x445c38 <NoopDDA>, devPrivates = 0x20867d0,
  CreateScreenResources = 0x7fd8a5dc7a8d <RADEONCreateScreenResources_KMS>,
  ModifyPixmapHeader = 0x7fd8a1f7f3b5 <exaModifyPixmapHeader_mixed>,
GetWindowPixmap = 0x7fd8a595e2c3 <_fbGetWindowPixmap>,
  SetWindowPixmap = 0x56d555 <damageSetWindowPixmap>, GetScreenPixmap
= 0x5fb3fb <miGetScreenPixmap>,
  SetScreenPixmap = 0x5fb410 <miSetScreenPixmap>, pScratchPixmap =
0x0, totalPixmapSize = 208,
  MarkWindow = 0x606d6f <miMarkWindow>, MarkOverlappedWindows =
0x606ddd <miMarkOverlappedWindows>,
  ConfigNotify = 0x5d81a0 <DRI2ConfigNotify>, MoveWindow = 0x607164
<miMoveWindow>,
  ResizeWindow = 0x607519 <miSlideAndSizeWindow>, GetLayerWindow =
0x608243 <miGetLayerWindow>,
---Type <return> to continue, or q <return> to quit---
  HandleExposures = 0x607045 <miHandleValidateExposures>,
ReparentWindow = 0x0, SetShape = 0x608255 <miSetShape>,
  ChangeBorderWidth = 0x608467 <miChangeBorderWidth>,
MarkUnrealizedWindow = 0x608671 <miMarkUnrealizedWindow>,
  DeviceCursorInitialize = 0x5f6950 <miPointerDeviceInitialize>,
DeviceCursorCleanup = 0x5f6a80 <miPointerDeviceCleanup>,
  canDoBGNoneRoot = 0, isGPU = 1, unattached_list = {next = 0x1d3cb18,
prev = 0x1d3cb18}, unattached_head = {next = 0x1d64468,
    prev = 0x1d64468}, current_master = 0x1d63fc0, output_slave_list =
{next = 0x1d3cb40, prev = 0x1d3cb40}, output_head = {
    next = 0x0, prev = 0x0}, SharePixmapBacking = 0x7fd8a1f7fbaa
<exaSharePixmapBacking_mixed>,
  SetSharedPixmapBacking = 0x7fd8a1f7fc3c <exaSetSharedPixmapBacking_mixed>,
  StartPixmapTracking = 0x466770 <PixmapStartDirtyTracking>,
StopPixmapTracking = 0x466874 <PixmapStopDirtyTracking>,
  pixmap_dirty_list = {next = 0x1d3cb80, prev = 0x1d3cb80},
offload_slave_list = {next = 0x1d3cb90, prev = 0x1d3cb90},
  offload_head = {next = 0x0, prev = 0x0}, ReplaceScanoutPixmap =
0x543703 <RRReplaceScanoutPixmap>}
(gdb) print pScreen->root
$3 = (WindowPtr) 0x0

=====

OK, so I decided to stick with what is currently published on the top
of http://cgit.freedesktop.org/~airlied/xserver/log/?h=reverse-prime
but applied on top of xorg-server 1.14.0, i.e.:

>From 8df4c1054459af2e1410dd4fbdb37be7c53a4543 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 02:51:55 +0000
Subject: dix/gpu: remove asserts for output/offload from same slave

>From 630170f1f5ab370e2aa477ef2139da41ff02dd93 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 02:52:03 +0000
Subject: xf86crtc: don't use scrn->display for gpu screens

>From 57c54e29b931ef6bdf96eab52ec57c4ddab7e227 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 02:52:08 +0000
Subject: dix: allow pixmap dirty helper to be used for non-shared pixmaps

(note: no "gpu: call CreateScreenResources for GPU screens" patch)

With the above, I get exactly the same crash as I described as "after
running xfce4-panel". I.e. in dixGetPrivateAddr (privates=0x410,
key=0x8a8460 <damageScrPrivateKeyRec>) due to a wrong value in
pScreen. I duplicate it here just in case:

(gdb) bt full
#0  0x0000000000567941 in dixGetPrivateAddr (privates=0x410,
key=0x8a8460 <damageScrPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:124
        __PRETTY_FUNCTION__ = "dixGetPrivateAddr"
#1  0x000000000056799e in dixGetPrivate (privates=0x410, key=0x8a8460
<damageScrPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:138
        __PRETTY_FUNCTION__ = "dixGetPrivate"
#2  0x0000000000567a65 in dixLookupPrivate (privates=0x410,
key=0x8a8460 <damageScrPrivateKeyRec>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/include/privates.h:168
No locals.
#3  0x0000000000567d97 in damageRegionAppend (pDrawable=0x23e89d0,
pRegion=0x7fff3fc026f0, clip=0, subWindowMode=-1)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/miext/damage/damage.c:180
        pScreen = 0x20
        pScrPriv = 0x7fff3fc02c00
        pDamage = 0x7fff3fc026f0
        pNext = 0x7fff3fc02710
        clippedRec = {extents = {x1 = -1, y1 = -1, x2 = 0, y2 = 0},
data = 0x217}
        pDamageRegion = 0x7fff3fc026f0
        pixClip = {extents = {x1 = 14928, y1 = 584, x2 = 0, y2 = 0},
data = 0x40fa30}
        draw_x = 32767
        draw_y = 1069557440
        screen_x = 0
        screen_y = 37652944
#4  0x000000000056e03a in DamageRegionAppend (pDrawable=0x23e89d0,
pRegion=0x7fff3fc026f0)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/miext/damage/damage.c:1950
No locals.
#5  0x00007f52b08d4c9b in redisplay_dirty (screen=0x245b670, dirty=0x28dd520)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/radeon_kms.c:248
        pScrn = 0x217d740
        pixregion = {extents = {x1 = 0, y1 = 0, x2 = 1920, y2 = 1200},
data = 0x0}
#6  0x00007f52b08d4d4a in radeon_dirty_update (screen=0x245b670)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/radeon_kms.c:268
        region = 0x2184530
        ent = 0x28dd520
#7  0x00007f52b08d4e35 in RADEONBlockHandler_KMS (arg=0x245b670,
pTimeout=0x7fff3fc029e8, pReadmask=0x8b3000 <LastSelectMask>)
    at /usr/portage/packages/portage/x11-drivers/xf86-video-ati-7.1.0/work/xf86-video-ati-7.1.0/src/radeon_kms.c:290
        pScreen = 0x245b670
        pScrn = 0x217d740
        info = 0x2452780
#8  0x0000000000445c9c in BlockHandler (pTimeout=0x7fff3fc029e8,
pReadmask=0x8b3000 <LastSelectMask>)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/dixutils.c:390
        i = 0
        j = 0
---Type <return> to continue, or q <return> to quit---
#9  0x000000000060cc5e in WaitForSomething (pClientsReady=0x28e2c90)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/os/WaitFor.c:210
        i = 0
        waittime = {tv_sec = 535, tv_usec = 681000}
        wt = 0x7fff3fc029f0
        timeout = 535681
        clientsReadable = {fds_bits = {0 <repeats 16 times>}}
        clientsWritable = {fds_bits = {206158430224, 140734262946240,
140734262946352, 140734262946096, 0, 6411583, 30,
            4338404768, 140734262946192, 42865824, 140734262946144,
6415819, 19, 4299323888, 140734262946192, 42865824}}
        curclient = 0
        selecterr = 0
        nready = 0
        devicesReadable = {fds_bits = {30, 140734262946192, 1, 12,
8388648, 0, 43422144, 42865984, 9117888, 38286256,
            140734262946000, 5246759, 2048, 43422144, 6618271, 11559599675}}
        now = 5203343
        someReady = 0
#10 0x000000000043767f in Dispatch ()
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/dispatch.c:361
        clientReady = 0x28e2c90
        result = 0
        client = 0x28e1540
        nready = -1
        icheck = 0x8ac070 <checkForInput>
        start_tick = 280
#11 0x00000000004280e1 in main (argc=3, argv=0x7fff3fc02c08,
envp=0x7fff3fc02c28)
    at /usr/portage/packages/portage/x11-base/xorg-server-1.14.0/work/xorg-server-1.14.0/dix/main.c:295
        i = 1
        alwaysCheckForInput = {0, 1}

=====

Finally, I added the final patch:

>From 984b25626089df1344c2a403b398037ea57d7312 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Wed, 09 Jan 2013 02:52:13 +0000
Subject: gpu: call CreateScreenResources for GPU screens

With that, I get exactly the same crash-on-start as already described
above (but not directly above), due to the root window being NULL.

Could you please tell me which patch set is supposed to work, and
maybe send me some fixups or debugging patches?

-- 
Alexander E. Patrakov


More information about the xorg-devel mailing list