Bug 263199

Summary: radeon 6.6.191: Xserver crash in RADEONScreenInit - related to MergedFB configuration
Product: [openSUSE] openSUSE 10.3 Reporter: Stefan Dirsch <sndirsch>
Component: X.OrgAssignee: Marcus Schaefer <ms>
Status: RESOLVED FIXED QA Contact: Stefan Dirsch <sndirsch>
Severity: Blocker    
Priority: P5 - None CC: aj, behlert, burnus, eich, peter
Version: Alpha 3   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: xorg.conf
Xorg.0.log
Fixing crash due to not completely initialized mergedfb setup
Set MonitorLayout option correctly for radeon driver
Add monitorlayout "AUTOCRT" option
Updated sax2 patch

Description Stefan Dirsch 2007-04-11 09:09:47 UTC
# gdb /usr/bin/Xorg
[...]
Program received signal SIGSEGV, Segmentation fault.
0xb7c24351 in RADEONScreenInit (scrnIndex=0, pScreen=0x8217e38, argc=1, 
    argv=0xbfa73774) at radeon_driver.c:3812
3812                if ((((RADEONMergedDisplayModePtr)pScrn->currentMode->Private)->CRT1->Flags &
(gdb) bt
#0  0xb7c24351 in RADEONScreenInit (scrnIndex=0, pScreen=0x8217e38, argc=1, 
    argv=0xbfa73774) at radeon_driver.c:3812
#1  0x0807607e in AddScreen (pfnInit=0xb7c24000 <RADEONScreenInit>, argc=1, 
    argv=0xbfa73774) at main.c:773
#2  0x080a814e in InitOutput (pScreenInfo=0x81ffb80, argc=1, argv=0xbfa73774)
    at xf86Init.c:927
#3  0x0807682b in main (argc=1, argv=0xbfa73774, envp=0xbfa7377c) at main.c:370
(gdb) p pScrn->currentMode->Private
$3 = (INT32 *) 0x0
(gdb)
Comment 1 Stefan Dirsch 2007-04-11 09:11:34 UTC
Created attachment 130335 [details]
xorg.conf
Comment 2 Stefan Dirsch 2007-04-11 09:12:05 UTC
Created attachment 130336 [details]
Xorg.0.log
Comment 3 Stefan Dirsch 2007-04-11 09:14:14 UTC
Workaround - which disables projector support - for now:
--- xorg.conf.old       2007-04-11 11:15:21.000000000 +0200
+++ xorg.conf   2007-04-11 11:15:29.000000000 +0200
@@ -159 +159 @@
-  Option       "MergedFB" "yes"
+  #Option       "MergedFB" "yes"
Comment 4 Stefan Dirsch 2007-04-11 10:31:53 UTC
Probably another workaround:

  Option "ColorTiling" "off"
Comment 5 Magnus Boman 2007-04-11 10:37:34 UTC
Is this bug the same as bug#263200
Comment 6 Stefan Dirsch 2007-04-11 12:12:29 UTC
Try workaround in original xorg.conf from my comment #3.
Comment 7 Magnus Boman 2007-04-11 12:20:53 UTC
Yep, that works... I'll mark my bug as a duplicate...
Comment 8 Magnus Boman 2007-04-11 12:21:13 UTC
*** Bug 263200 has been marked as a duplicate of this bug. ***
Comment 9 Stefan Dirsch 2007-04-11 12:25:47 UTC
Matthias is investigating.
Comment 10 Matthias Hopf 2007-04-12 18:28:52 UTC
Created attachment 130807 [details]
Fixing crash due to not completely initialized mergedfb setup

This patch fixes the crash.
Basically, MergedFB was set, but the driver didn't know about a second output device, which effectively disables MergedFB.
Comment 11 Matthias Hopf 2007-04-12 18:33:39 UTC
For finally enabling the external output again w/o monitor attached, we need an update of the sax2 driver profile. Patch pending.
Comment 12 Matthias Hopf 2007-04-12 18:33:56 UTC
Created attachment 130808 [details]
Set MonitorLayout option correctly for radeon driver

This sax2 patch enables setting of the MonitorLayout option correctly for the radeon driver - something we didn't do so far because we cannot reliably detect the primary display, but was also don't need to, because the driver has a (undocumented!) AUTO option for that...

My tests so far were only partially successful.

sax2 -r -a -b Radeon_DualHead_DriverOptions worked fine.
sax2 -r and doing everything manually didn't work correctly, the outputs were detected as wished, but the MonitorLayout option wasn't included in the final xorg.conf, also I noticed a core file.

I should probably retest after the Xorg patch has been embedded in the system rpms.
Comment 13 Stefan Dirsch 2007-04-12 18:59:01 UTC
submitted fixed xorg-x11-driver-video package for STABLE/Factory. Reassigning to Marcus to apply patch for sax2.
Comment 14 Matthias Hopf 2007-04-13 09:05:24 UTC
Marcus, please wait. I'm currently seeing issues with MonitorLayout on my machine.
Comment 15 Matthias Hopf 2007-04-13 12:52:26 UTC
Ok, we need decision from management for that one, as there is no perfect solution. So aj, Stefan (Behlert), please comment. Also Marcus, Egbert, please comment.


The scenario are ATI radeon cards (most with one DVI-I and one VGA outlet) and laptops with ATI chipsets. The issue is that the driver cannot detect monitors w/o DDC on the external CRTC driver (on most cards that is the DVI-I interface, but it *can* be the VGA interface on others). And I think that even for some monitors w/ old DDC implementations detection doesn't work correctly.


At the moment we have the possibility to select one of three solutions (all modulo undetected bugs, of course):

1) Do not include the MonitorLayout option.
   We didn't use one before, but the driver changed its behavior here, so
   without a MonitorLayout option we will *not* have the external laptop output
   activated for a large part of our users. Not good. OTOH a monitors attached
   during boot will most probably always be used correctly, even if it doesn't
   support DDC. When two monitors are attached, this does not have to be the
   case.

2) Include the MonitorLayout option.
   In that case on some cards with older monitors the monitor is not detected,
   and the MonitorLayout forces the card to use the internal CRTC for VGA. The
   user would have to attach the monitor to the other plug in this case. The
   external output on laptops will be active for all cases except for laptops
   with DVI-I external outputs (you don't know whether DVI or VGA will be
   connected).
   I can improve the sax2 patch to always select VGA if nothing is connected
   during configuration, if that sounds like a valid idea.

3) Include the MonitorLayout option, add AUTOFORCE for primary head.
   Same as last, but with an additional patch (to be written) that always
   activates VGA on the primary head, when nothing is detected.
   Might be the best solution, but I cannot make sure that this doesn't break
   any configurations (I cannot think of any ATM, DVI always has DDC, LVDS is
   always detected correctly or not at all).


I, personally, would go for 3) if I manage to get the patch right, else for 2). I have yet to check whether the tested monitor doesn't have DDC at all, or the DDC implementation of the radeon driver is missing pieces.
Comment 16 Andreas Jaeger 2007-04-13 13:32:20 UTC
Matthias, based on your comments I agree with going for 3 if possible - and using 2 as fallback.
Comment 17 Matthias Hopf 2007-04-13 14:19:59 UTC
Created attachment 131033 [details]
Add monitorlayout "AUTOCRT" option

This patch adds the functionality needed for 3).

When a monitor in MonitorLayout is specified as "AUTOCRT", it is set to CRT if no monitor is found at all and the connector type allows for VGA monitors (that is: only on VGA, DVI-I, DVI-A).
Comment 18 Matthias Hopf 2007-04-13 15:03:21 UTC
Created attachment 131045 [details]
Updated sax2 patch

Updated patch to use AUTOCRT option for primary head.

Marcus, please apply, and also please help me understand why with 'sax2 -r' ProfileRadeonGetMonitorLayout was called obviously, but the MonitorLayout option not included in xorg.conf.
Comment 19 Stefan Dirsch 2007-04-13 19:30:38 UTC
submitted new xorg-x11-driver-video package with '"AUTOCRT" option' patch.
Comment 20 Martin Vidner 2007-04-16 09:14:43 UTC
*** Bug 263874 has been marked as a duplicate of this bug. ***
Comment 21 Marcus Schaefer 2007-04-17 08:46:25 UTC
a few questions about the patch:

1) you set MonitorLayout in Radeon_DualHead.pl which is used for old
   Xinerama based configurations only. I thought MonitorLayout is only
   needed in case of device dependent merged framebuffer setup. So in
   this profile it doesn't make sense to me ?

2) in Radeon_DualHead_DriverOptions you added the MonitorLayout option
   at the beginning which changed the ID's of the options (+1). Within
   Radeon_DualHead_DriverOptions.pl there are a few options which will
   be overwritten according to these ID's. I adapted the patch to take
   care for that. Anything else looks good to me

I can't say why the MonitorLayout option wasn't included with the
information above. The resulting profile file can be found in:

   /var/lib/sax/Radeon_DualHead_DriverOptions.tmp

could you check the file if the contents are valid ?

Thanks
Comment 22 Matthias Hopf 2007-04-17 16:46:23 UTC
(In reply to comment #21)
> a few questions about the patch:
> 
> 1) you set MonitorLayout in Radeon_DualHead.pl which is used for old
>    Xinerama based configurations only. I thought MonitorLayout is only
>    needed in case of device dependent merged framebuffer setup. So in
>    this profile it doesn't make sense to me ?

This was only due to desperation. I just reflected all MonitorLayout specific code I could find in related .pl files for other drivers.

> 2) in Radeon_DualHead_DriverOptions you added the MonitorLayout option
>    at the beginning which changed the ID's of the options (+1). Within
>    Radeon_DualHead_DriverOptions.pl there are a few options which will
>    be overwritten according to these ID's. I adapted the patch to take
>    care for that. Anything else looks good to me

Ah. Maybe that was the reason why MonitorLayout wasn't included. Maybe it was overwritten.

> could you check the file if the contents are valid ?

I'll check.
Comment 23 Matthias Hopf 2007-04-18 17:20:42 UTC
Newest xorg-x11-driver-video, newest sax2*, invoking 'sax2 -r' on 'gkar', activating secondary head:


/var/lib/sax/Radeon_DualHead_DriverOptions.tmp:

[...]
Device  -> [X] -> Option = SaXDualHead

Device  -> [X] -> Raw -> 20 -> Option = "MonitorLayout" "AUTOCRT,CRT"
Device  -> [X] -> Raw -> 21 -> Option = "MergedFB" "yes"
[...]
Device->[X]->Raw->20->Option="MonitorLayout" "AUTOCRT,CRT"
Device->[X]->Raw->21->Option="MergedFB" "yes"


/var/log/SaX.log:
[...]
*** Selecting AUTOCRT,CRT as monitor configuration
[...]


/etc/X11/xorg.conf:
Section "Device"
  BoardName    "FireGL V3100 (RV370) 5B64 (PCIE)"
  BusID        "1:0:0"
  Driver       "radeon"
  Identifier   "Device[0]"
  Option       "SaXDualHead"
  Option       "IgnoreEDID"
  Option       "MergedFB"
  Option       "SaXDualMonitorVendor" "--> VESA"
  Option       "CRT2VRefresh" "50-60"
  Option       "CRT2Position" "Clone"
  Option       "GARTSize" "32"
  Option       "MetaModes" "1024x768,1024x768;800x600,800x600"
  Option       "SaXDualOrientation" "LeftOf"
  Option       "SaXDualResolution" "1024x768"
  Option       "CRT2HSync" "31-50"
  Option       "SaXDualMode" "Clone"
  Option       "SaXDualHSync" "31-50"
  Option       "SaXDualMonitorModel" "1024X768@60HZ"
  Option       "SaXDualVSync" "50-60"
  VendorName   "ATI"
EndSection


No MonitorLayout, though it was detected correctly :-(((

The machine is up and running OS10.3a3 if you want to try out something yourself.
Comment 24 Marcus Schaefer 2007-04-19 13:36:10 UTC
while calling sax2 it tells you what profiles it includes.
What profiles are listed in that output ? I assume some kind
of option id clash with other profiles...
Comment 25 Marcus Schaefer 2007-04-20 14:27:25 UTC
sax2 -b MergedFB -a 

  --> works correctly

I assume you used the GUI and the MonitorLayout for radeon is new
needs a fix in the GUI as well. Will check that
Comment 26 Marcus Schaefer 2007-04-20 14:41:42 UTC
fixed, package submitted, please test with new sax2 package
relevant Changelog:

   -------------------------------------------------------------------
   Fri Apr 20 16:35:47 CEST 2007 - ms@suse.de

    - added MonitorLayout setup for radeon driver in xapi (#263199)


Comment 27 Matthias Hopf 2007-04-23 15:54:13 UTC
(In reply to comment #25)
> I assume you used the GUI and the MonitorLayout for radeon is new
> needs a fix in the GUI as well. Will check that

Ah. I see. Yes, I tried the DAU mode.

(In reply to comment #26)
> fixed, package submitted, please test with new sax2 package
> relevant Changelog:

Tested. Works ok.

Thanks!