I know I'm talking to myself here, but ... (should this have gone to x11@ list?)

This change (seemingly) fixes the suspend/resume causing X to abort:

Index: src/radeon_crtc.c
===================================================================
RCS file: /cvs/obsd/xenocara/driver/xf86-video-ati/src/radeon_crtc.c,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 radeon_crtc.c
--- src/radeon_crtc.c   8 Aug 2012 16:25:22 -0000       1.7
+++ src/radeon_crtc.c   12 Jul 2013 05:02:50 -0000
@@ -502,7 +502,9 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, D
 static void
 radeon_crtc_mode_commit(xf86CrtcPtr crtc)
 {
-    if (crtc->scrn->pScreen != NULL)
+    RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
+
+    if (crtc->scrn->pScreen != NULL && 0 != radeon_crtc->cursor_offset)
        xf86_reload_cursors(crtc->scrn->pScreen);
 }

---- END

What I don't get is, why in 2013-FEB-12
radeon_legacy_allocate_memory() succeeded, according the Xorg.0.log
from then:

[    18.722] (II) RADEON(0): Will use 32 kb for hardware cursor 0 at
offset 0x00804000
[    18.722] (II) RADEON(0): Will use 32 kb for hardware cursor 1 at
offset 0x0080a000

Last change in that source file is:
revision 1.5
date: 2012/08/08 16:25:22;  author: matthieu;  state: Exp;  lines: +2 -2
Update to xf86-video-ati 6.14.6. Tested by mpi@, brad, eric@, ajacoutot@.

Which is prior to the snapshot date. I also don't see any changes in
the config* and Makefile* files relevant to dates of interest, that
may have affected the #Ifdef-s in that file.

The only one is Makefile.bsd-wrapper, which changed 2013-JUN-29 (rev
1.7) and then the change reverted, in rev 1.8.

Curious...
--patrick


$ cvs log -lN -d 2013-07-07
(stripped-down output)
Working file: Makefile.am
revision 1.5
date: 2012/03/04 16:01:12;  author: matthieu;  state: Exp;  lines: +6 -6

Working file: Makefile.in
revision 1.9
date: 2012/11/11 15:51:20;  author: matthieu;  state: Exp;  lines: +4 -4

Working file: aclocal.m4
revision 1.15
date: 2012/11/11 15:51:20;  author: matthieu;  state: Exp;  lines: +4 -39

Working file: config.guess
revision 1.4
date: 2012/11/11 15:51:20;  author: matthieu;  state: Exp;  lines: +5 -1

Working file: config.h.in
revision 1.9
date: 2012/11/11 15:51:20;  author: matthieu;  state: Exp;  lines: +3 -0

Working file: config.sub
revision 1.4
date: 2012/11/11 15:51:20;  author: matthieu;  state: Exp;  lines: +2 -2

Working file: configure
revision 1.15
date: 2012/11/11 15:51:20;  author: matthieu;  state: Exp;  lines: +56 -4

Working file: configure.ac
revision 1.9
date: 2012/11/11 15:49:43;  author: matthieu;  state: Exp;  lines: +21 -2





On Thu, Jul 11, 2013 at 3:56 AM, patrick keshishian <[email protected]> wrote:
> Hi,
>
> So after some investigating, this "crash" after suspend/resume cycle
> is actually an "abort" due to an assertion on xf86CursorScreenKeyRec
> not being initialized. Provided are a backtrace and print of said
> object[1].
>
> What I see happen is RADEONCursorInit() fails[2], so
> xf86_cursors_init() never gets called, which would call
> xf86InitCursor(), which initializes the xf86CursorScreenKeyRec.
>
> When RADEONCursorInit() fails, it logs the following and moves on:
>
> [  2009.859] (EE) RADEON(0): Hardware cursor initialization failed
> [  2009.859] (II) RADEON(0): Using software cursor
>
> Now, on resume (after a suspend), radeon_crtc_mode_commit() is invoked
> (see bt), and it calls xf86_reload_cursors(), which eventually causes
> the assert() and abort().
>
> So, the question is how to fix this situation, and where?
>
> Is there a way to detect the "Using software cursor" mode, during
> resume, and not call xf86_reload_cursors()? Is this even a good idea?
>
> I'm not sure what change between 2013-FEB-12 snapshot (last one that I
> know worked "fine") and now is causing this behavioral difference.
>
> Any hints as how to proceed would be appreciated.
>
> --patrick
>
> [1] gmail will/might screw the lines, so apologies in advance.
> #1  0x000000f56bc3aa6a in abort () at /usr/src/lib/libc/stdlib/abort.c:70
> #2  0x000000f56bbb85f4 in __assert2 (file=Variable "file" is not available.
> )
>     at /usr/src/lib/libc/gen/assert.c:52
> #3  0x000000f363ef94f6 in dixGetPrivateAddr (privates=0xf56acf1bf0,
>     key=0xf3644bed20) at privates.h:123
> #4  0x000000f363ef9555 in dixGetPrivate (privates=0xf56acf1bf0,
>     key=0xf3644bed20) at privates.h:138
> #5  0x000000f363ef94b2 in dixLookupPrivate (privates=0xf56acf1bf0,
>     key=0xf3644bed20) at privates.h:168
> #6  0x000000f363efa2b0 in xf86_reload_cursors (screen=0xf56acf1800)
>     at /usr/build/xenocara/xserver/hw/xfree86/modes/xf86Cursors.c:628
> #7  0x000000f56fe7f2e9 in radeon_crtc_mode_commit (crtc=0xf5646ac800)
>     at /usr/build/xenocara/driver/xf86-video-ati/src/radeon_crtc.c:506
> #8  0x000000f363ef23eb in xf86CrtcSetModeTransform (crtc=0xf5646ac800,
>     mode=0xf5646ac8e8, rotation=1, transform=0x0, x=0, y=0)
>     at /usr/build/xenocara/xserver/hw/xfree86/modes/xf86Crtc.c:354
> #9  0x000000f363ef780c in xf86SetDesiredModes (scrn=0xf56e329000)
>     at /usr/build/xenocara/xserver/hw/xfree86/modes/xf86Crtc.c:2653
> #10 0x000000f56fe26533 in RADEONEnterVT (arg=0xf56e329000)
>     at /usr/build/xenocara/driver/xf86-video-ati/src/radeon_driver.c:6279
> #11 0x000000f363f03dfc in xf86RandR12EnterVT (pScrn=0xf56e329000)
>     at /usr/build/xenocara/xserver/hw/xfree86/modes/xf86RandR12.c:1760
> #12 0x000000f363eaf7c4 in xf86VTSwitch ()
>     at /usr/build/xenocara/xserver/hw/xfree86/common/xf86Events.c:537
> #13 0x000000f363eaefdc in xf86Wakeup (blockData=0x0, err=3,
>     pReadmask=0xf3644bfba0)
>     at /usr/build/xenocara/xserver/hw/xfree86/common/xf86Events.c:286
> #14 0x000000f363e5edc9 in WakeupHandler (result=3, pReadmask=0xf3644bfba0)
>     at /usr/build/xenocara/xserver/dix/dixutils.c:423
> #15 0x000000f36402257c in WaitForSomething (pClientsReady=0xf56f9aa800)
>     at /usr/build/xenocara/xserver/os/WaitFor.c:224
> #16 0x000000f363e501a0 in Dispatch ()
>     at /usr/build/xenocara/xserver/dix/dispatch.c:361
> #17 0x000000f363e4101a in main (argc=6, argv=0x7f7ffffbf858,
>     envp=0x7f7ffffbf890) at /usr/build/xenocara/xserver/dix/main.c:295
>
> (gdb) p xf86CursorScreenKeyRec
> $54 = {offset = 0, size = 0, initialized = 0, allocated = 0,
>   type = PRIVATE_XSELINUX, next = 0x0}
>
>
> [2] This is a bit of a cute story (at least through novice eyes like
> mine anyway).
>
> info->useEXA doesn't get set because info->r600_shadow_fb is set,
> which is checked during RADEONPreInitAccel().
>
> RADEONCursorInit() // goes through the following motion:
> {
>         if (!info->useEXA) {
>                 radeon_crtc->cursor_offset =
>                 radeon_legacy_allocate_memory(...); // returns 0
>
>                 if (radeon_crtc->cursor_offset == 0)
>                         return FALSE;
>         }
> }
>
> // this one here, it's the cute one.
> uint32_t
> radeon_legacy_allocate_memory(ScrnInfoPtr pScrn,...)
> {
>         uint32_t offset = 0;
>
> #ifdef XF86DRM_MODE // NOT DEFINED
> #endif
> #ifdef USE_EXA  // DEFINED but!
>             if (info->useEXA) {
>                     // so nothing happens here.
>             }
> #endif
> #ifdef USE_XAA // NOT DEFINED
> #endif
>
>         return offset;
> }
>
>
>
>
> On Thu, Jul 4, 2013 at 3:02 PM, patrick keshishian <[email protected]> wrote:
>> A bit more of Xorg.0.log file which might be useful.
>>
>> If I 'tail -f' the Xorg.0.log file and suspend and resume, this is
>> what it shows. Not sure if there is any indication of X crash or what
>> ... this is a bit beyond my scope.
>>
>> $ tail -f /var/log/Xorg.0.log
>> [ 51774.664] (II) ws: /dev/wsmouse: minimum x position: 0
>> [ 51774.664] (II) ws: /dev/wsmouse: maximum x position: 1365
>> [ 51774.664] (II) ws: /dev/wsmouse: minimum y position: 0
>> [ 51774.664] (II) ws: /dev/wsmouse: maximum y position: 767
>> [ 51774.664] (==) ws: /dev/wsmouse: Buttons: 7
>> [ 51774.664] (**) ws: /dev/wsmouse: YAxisMapping: buttons 4 and 5
>> [ 51774.665] (**) /dev/wsmouse: (accel) keeping acceleration scheme 1
>> [ 51774.665] (**) /dev/wsmouse: (accel) acceleration profile 0
>> [ 51774.665] (**) /dev/wsmouse: (accel) acceleration factor: 2.000
>> [ 51774.665] (**) /dev/wsmouse: (accel) acceleration threshold: 4
>>
>> (suspending and resume happens here)
>>
>> [ 64222.173] Output UNIPHY0 transmitter setup success
>> [ 64222.187] Blank CRTC 0 success
>> [ 64222.187] Disable CRTC memreq 0 success
>> [ 64222.204] Disable CRTC 0 success
>> [ 64222.204] Blank CRTC 1 success
>> [ 64222.204] Disable CRTC memreq 1 success
>> [ 64222.204] Disable CRTC 1 success
>> [ 64231.224] Output UNIPHY0 transmitter setup success
>> [ 64231.224] Output UNIPHY0 transmitter setup success
>> [ 64231.224] Output CRT1 disable success
>> [ 64231.225] Blank CRTC 0 success
>> [ 64231.225] Disable CRTC memreq 0 success
>> [ 64231.241] Disable CRTC 0 success
>> [ 64231.241] Blank CRTC 1 success
>> [ 64231.242] Disable CRTC memreq 1 success
>> [ 64231.242] Disable CRTC 1 success
>> [ 64231.242] Output UNIPHY0 transmitter setup success
>> [ 64231.242] Blank CRTC 0 success
>> [ 64231.242] Disable CRTC memreq 0 success
>> [ 64231.242] Disable CRTC 0 success
>> [ 64231.242] Set CRTC 0 Source success
>> [ 64231.242] Mode 1366x768 - 1582 792 9
>> [ 64231.242] (II) RADEON(0): RADEONRestoreMemMapRegisters() :
>> [ 64231.242] (II) RADEON(0):   MC_FB_LOCATION   : 0x0f170f00 0x0f170f00
>> [ 64231.242] (II) RADEON(0):   MC_AGP_LOCATION  : 0x003f0000
>> [ 64231.257] Set DCPLL success
>> [ 64231.257] Picked PLL 0
>> [ 64231.257] before 7520 0x0
>> [ 64231.257] after 7520 0 0
>> [ 64231.257] best_freq: 75238
>> [ 64231.257] best_feedback_div: 79
>> [ 64231.257] best_frac_feedback_div: 0
>> [ 64231.257] best_ref_div: 7
>> [ 64231.257] best_post_div: 15
>> [ 64231.257] (II) RADEON(0): crtc(0) Clock: mode 75200, PLL 752380
>> [ 64231.257] (II) RADEON(0): crtc(0) PLL  : refdiv 7, fbdiv 0x4F(79),
>> fracfbdiv 0, pdiv 15
>> [ 64231.377] Set CRTC 0 PLL success
>> [ 64231.377] Set DTD CRTC Timing success
>> [ 64231.377] Set CRTC 0 Overscan success
>> [ 64231.377] Not using RMX
>> [ 64231.377] scaler 0 setup success
>> [ 64231.377] Set CRTC 0 Source success
>> [ 64231.857] Output UNIPHY0 transmitter setup success
>> [ 64231.857] Output DIG0 encoder setup success
>> [ 64231.857] Output UNIPHY0 transmitter setup success
>> [ 64232.317] Output UNIPHY0 transmitter setup success
>> tail: /var/log/Xorg.0.log has been replaced, reopening.
>> [ 64232.434] (--) checkDevMem: using aperture driver /dev/xf86
>> [ 64232.453] (--) Using wscons driver on /dev/ttyC4 in pcvt
>> compatibility mode (version 3.32)
>> [ 64233.474]
>> X.Org X Server 1.14.1
>> Release Date: 2013-04-17
>> [ 64233.474] X Protocol Version 11, Revision 0
>> [ 64233.474] Build Operating System: OpenBSD 5.3 amd64
>> [ 64233.474] Current Operating System: OpenBSD noir.mydomain 5.3
>> GENERIC.MP#9 amd64
>> [ 64233.474] Build Date: 27 June 2013  03:38:14PM
>> [ 64233.474]
>> [ 64233.475] Current version of pixman: 0.30.0
>> [ 64233.475]    Before reporting problems, check http://wiki.x.org
>>         to make sure that you have the latest version.
>> [ 64233.475] Markers: (--) probed, (**) from config file, (==) default 
>> setting,
>>         (++) from command line, (!!) notice, (II) informational,
>>         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
>> [ 64233.475] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Jul  4
>> 14:50:46 2013
>> [ 64233.476] (==) Using config file: "/etc/X11/xorg.conf"
>> [ 64233.476] (==) Using system config directory
>> "/usr/X11R6/share/X11/xorg.conf.d"

Reply via email to