Bug 9955

Summary: radeon-randr12-v3 branch: not driving iBook panel correctly
Product: xorg Reporter: John Steele Scott <toojays>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: alexm, magnus.henoch+bfdo
Version: git   
Hardware: PowerPC   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xorg conf used for this test
none
log file with current radeon-randr12-v3 branch driver
none
log file from master branch of a few days ago
none
picture of flickery panel
none
"iBookHacks" option from NetBSD
none
My xorg.conf
none
Log after crash with ATI driver from git master
none
Use correct enum value for MacModel none

Description John Steele Scott 2007-02-12 04:00:28 UTC
Okay, so now i can start X with the radeon-randr12-v3, but it's not quite usable. First problem is that it starts up running at 1280x800, with a very flickery screen. But I'm pretty sure that this panel can only do 1024x768, and nothing else.

I can change to 1024x768 using xrandr, but it's still heaps flickery, with white horizontal lines which extend about 1/4 from the right of the panel appearing to move down (or up?) the screen.

I don't know how to read this output, but I guess '+' means "preferred mode", and '*' means current mode? I'm pretty sure that for this panel, 1024x768 should be the only one coming up. Also the if 60Hz is supposed to be the refresh rate, Xorg.log reports 65Hz . . . maybe that's the problem? (although I didn't think refresh rate applied to digital panels?)

toojays@fuzz:~$ xrandr
Screen 0: minimum 320 x 240, current 1024 x 768, maximum 1280 x 800
DVI connected 1280x800+0+0 245mm x 184mm
   1024x768       60.0 +   60.0  
   1280x800       60.0* 
   1280x768       60.0  
   800x600        60.3  
   640x480        59.9  
VGA disconnected
toojays@fuzz:~$ xrandr -s 1024x768
toojays@fuzz:~$ xrandr
Screen 0: minimum 320 x 240, current 1024 x 768, maximum 1280 x 800
DVI connected 1024x768+0+0 245mm x 184mm
   1024x768       60.0*+   60.0* 
   1280x800       60.0  
   1280x768       60.0  
   800x600        60.3  
   640x480        59.9  
VGA disconnected
Comment 1 John Steele Scott 2007-02-12 04:01:25 UTC
Created attachment 8681 [details]
xorg conf used for this test
Comment 2 John Steele Scott 2007-02-12 04:02:19 UTC
Created attachment 8682 [details]
log file with current radeon-randr12-v3 branch driver
Comment 3 John Steele Scott 2007-02-12 04:04:08 UTC
Created attachment 8683 [details]
log file from master branch of a few days ago

1280 resolution does not appear anywhere here (although the 1024x768 modeline is the same as in the randr branch).
Comment 4 John Steele Scott 2007-02-12 04:06:09 UTC
Created attachment 8684 [details]
picture of flickery panel

Okay, it's a crappy photo, but you can see some lines over the black part of the terminal. These lines run all the way to the right hand side of the panel, are much more prominent than it seems from the photo, and appear to be moving up & down.
Comment 5 John Steele Scott 2007-02-12 04:08:53 UTC
Oops, I wasn't explicit about this in my original report: this problem does not occur with the master branch. That's why I attached a corresponding log file made using the master branch, for comparison.
Comment 6 Alex Deucher 2007-02-13 10:41:00 UTC
try again with Dave's latest commits.
Comment 7 John Steele Scott 2007-02-13 14:26:46 UTC
Nothing new has been commited since I filed this bug.
Comment 8 Daniel Stone 2007-02-27 01:36:22 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 9 Alex Deucher 2007-08-27 11:29:58 UTC
that branch is long dead.  please try ati git master or the 6.7.192 release.
Comment 10 Magnus Henoch 2007-08-27 12:02:23 UTC
Created attachment 11291 [details] [review]
"iBookHacks" option from NetBSD

I have the same problem, with an iBook G4 running NetBSD/powerpc, modular server version 1.3.0.0, xf86-video-ati 6.6.3.  NetBSD has long included a patch to XFree86 which adds an "iBookHacks" option to the radeon driver, which I have attached, slightly adapted for x.org.  I don't really know anything about it, except that it makes my screen work.  (Sorry if I'm missing something - is this bug appropriate for these released versions?)

I tried compiling the ATI driver from the git master branch and loading it into my server, to see if the problem had been fixed in the meantime, but my computer froze with a black screen.  Should I worry about that?  Should I try something else?
Comment 11 Alex Deucher 2007-08-27 12:26:42 UTC
can you attach the log and config file (In reply to comment #10)
> Created an attachment (id=11291) [details]
> "iBookHacks" option from NetBSD
> 
> I have the same problem, with an iBook G4 running NetBSD/powerpc, modular
> server version 1.3.0.0, xf86-video-ati 6.6.3.  NetBSD has long included a patch
> to XFree86 which adds an "iBookHacks" option to the radeon driver, which I have
> attached, slightly adapted for x.org.  I don't really know anything about it,
> except that it makes my screen work.  (Sorry if I'm missing something - is this
> bug appropriate for these released versions?)

The patch basically just hardcodes the pll for crtc1.  apparently OF sets it wrong by default?  We can add a similar quirk to the driver if it helps.  What are the pci ids and subsystem ids of your card?

> 
> I tried compiling the ATI driver from the git master branch and loading it into
> my server, to see if the problem had been fixed in the meantime, but my
> computer froze with a black screen.  Should I worry about that?  Should I try
> something else?
> 

Can you attach your xorg log and config?

Comment 12 Magnus Henoch 2007-08-27 12:59:25 UTC
(In reply to comment #11)
> The patch basically just hardcodes the pll for crtc1.  apparently OF sets it
> wrong by default?  We can add a similar quirk to the driver if it helps.  What
> are the pci ids and subsystem ids of your card?

As in "lspci -nv"?  Here:
00:10.0 Class 0300: 1002:5c63 (rev 01)
        Subsystem: 1002:5c63
        Flags: bus master, 66Mhz, medium devsel, latency 255, IRQ 48
        Memory at 98000000 (32-bit, prefetchable)
        I/O ports at 0400
        Memory at 90000000 (32-bit, non-prefetchable)
        Capabilities: [58] AGP version 2.0
        Capabilities: [50] Power Management version 2

> Can you attach your xorg log and config?

Will do.
Comment 13 Magnus Henoch 2007-08-27 13:00:00 UTC
Created attachment 11292 [details]
My xorg.conf
Comment 14 Magnus Henoch 2007-08-27 13:01:29 UTC
Created attachment 11293 [details]
Log after crash with ATI driver from git master
Comment 15 Alex Deucher 2007-08-27 13:15:52 UTC
does it work if you start X without the external monitor attached? Is the external port VGA or DVI? Does the ibook have a tv-out port and if so do you have it connected?  If not, lets try hardcoding the outputs:

Add:

Option "ConnectorTable" "2,2,2,1,3,0,2"

to the device section of your config.
Comment 16 Magnus Henoch 2007-08-27 13:59:04 UTC
(In reply to comment #15)
> does it work if you start X without the external monitor attached?

No.


> Is the
> external port VGA or DVI? Does the ibook have a tv-out port and if so do you
> have it connected?

It seems to be a multifunction port.  From http://support.apple.com/specs/ibook/iBook_G4.html :

"Video mirroring supports VGA video out to an external display or projector (requires included Apple VGA Video Adapter) and S-video and composite video out to a TV or VCR (requires optional Apple Video Adapter, sold separately)."

I'm using a VGA adapter.

>  If not, lets try hardcoding the outputs:
> 
> Add:
> 
> Option "ConnectorTable" "2,2,2,1,3,0,2"
> 
> to the device section of your config.

That doesn't work; it seems there should be eight numbers.
Comment 17 Alex Deucher 2007-08-27 14:04:42 UTC
(In reply to comment #16)
> (In reply to comment #15)
> > does it work if you start X without the external monitor attached?
> 
> No.
> 
> 
> > Is the
> > external port VGA or DVI? Does the ibook have a tv-out port and if so do you
> > have it connected?
> 
> It seems to be a multifunction port.  From
> http://support.apple.com/specs/ibook/iBook_G4.html :
> 
> "Video mirroring supports VGA video out to an external display or projector
> (requires included Apple VGA Video Adapter) and S-video and composite video out
> to a TV or VCR (requires optional Apple Video Adapter, sold separately)."
> 
> I'm using a VGA adapter.

Ah, ok, so it uses the tv dac.  very interesting.

> 
> >  If not, lets try hardcoding the outputs:
> > 
> > Add:
> > 
> > Option "ConnectorTable" "2,2,2,1,3,0,2"
> > 
> > to the device section of your config.
> 
> That doesn't work; it seems there should be eight numbers.
> 

Whoops!  it should be:
Option "ConnectorTable" "2,2,2,1,3,0,2,2"
for the primary dac or
Option "ConnectorTable" "2,2,2,1,3,1,2,2"
for the tv dac.  I suspect it's using the tv dac.
Comment 18 Magnus Henoch 2007-08-27 19:23:56 UTC
(In reply to comment #17)
> Whoops!  it should be:
> Option "ConnectorTable" "2,2,2,1,3,0,2,2"
> for the primary dac or
> Option "ConnectorTable" "2,2,2,1,3,1,2,2"
> for the tv dac.  I suspect it's using the tv dac.

With the latter line, the internal screen stays blank while the external screen works.  Cursors look strange; the X cursor looks like <> (wrapped around), and the terminal cursor has a similar defect.  Running Firefox reveals that the cursor is mirrored too.

With the former line, both screens stay blank.

In both cases, after exiting X, the external screen goes out of sync, and the system freezes.

As this is one of the problems that the iBookHacks patch tries to fix, I applied the RADEONRestorePLLRegisters part of it to the current source (I couldn't figure out where the other part would fit).  Using the latter ConnectorTable line, now both screens work, the internal screen does not have the display problem originally described, after exiting X I get a fully usable console, and everything is well except for the cursors.
Comment 19 Alex Deucher 2007-08-27 21:57:06 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > Whoops!  it should be:
> > Option "ConnectorTable" "2,2,2,1,3,0,2,2"
> > for the primary dac or
> > Option "ConnectorTable" "2,2,2,1,3,1,2,2"
> > for the tv dac.  I suspect it's using the tv dac.
> 
> With the latter line, the internal screen stays blank while the external screen
> works.  Cursors look strange; the X cursor looks like <> (wrapped around), and
> the terminal cursor has a similar defect.  Running Firefox reveals that the
> cursor is mirrored too.

the cursor is a known issue. see bug 11796 for a workaround

> 
> With the former line, both screens stay blank.
> 
> In both cases, after exiting X, the external screen goes out of sync, and the
> system freezes.
> 
> As this is one of the problems that the iBookHacks patch tries to fix, I
> applied the RADEONRestorePLLRegisters part of it to the current source (I
> couldn't figure out where the other part would fit).  Using the latter
> ConnectorTable line, now both screens work, the internal screen does not have
> the display problem originally described, after exiting X I get a fully usable
> console, and everything is well except for the cursors.
> 

excellent.  I'll see what I can do about getting a quirk in for the ibook so that the connector tables and pll are set correctly by default.
Comment 20 Alex Deucher 2007-08-29 20:13:08 UTC
can you update to the latest code in git and add:

Option "MacModel" "ibook"

to you config?  Everything should just work.
Comment 21 Magnus Henoch 2007-08-30 03:14:09 UTC
Created attachment 11330 [details] [review]
Use correct enum value for MacModel

After fixing the pasto (the MacModel option uses identifier OPTION_CONNECTORTABLE), everything works.  Thanks!

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.