video problem with ydl 2.3 and xfree86 on powerbook g4

Stefan Bruda yellowdog-general@lists.terrasoftsolutions.com
Wed Jul 24 20:43:01 2002


Hi.

At 20:23 -0400 on 24-7-2002 jl@excite.com wrote:
 >
 > I am running into video problem trying to install ydl 2.3 on my
 > powerbook G4.  

It took me quite some time to get X working on my tibook (same
generation as yours). I was installing YDL 2.2 instead of your 2.3,
but it looks like 2.3 has similar problems.

I will try here to summarize my set of fixes to the problem. I should
warn you though that I had to experiment a lot and I didn't write
things down or something, so I might have forgotten some
information; if things do not work following my advice, feel free to
contact me and I will try to see whether I missed something.

 > During installation phrase, I cannot use the GUI installer at all.

Nope, I used the text installer and I cannot think of any way of using
the GUI. The text installer is OK though (as OK and the YDL installer
is anyway, I kind of hate its "features" like not allowing an install
over existing partitions and compared to the installer of the ancient
LinuxPPC 2000 it simply sucks; but that's another story altogether).
Anyway, as I was saying, the text installed does its job and you do
not have a choice that I know of anyway.

  > How do I configure XFree86 for powerbook G4?  I tried the
  > Xconfigurator already.  I was had limited success at getting the
  > XFree86 to run in 8 bit color mode.

The stock kernel of YDL 2.2 (2.4.18-6a I believe) had no chance at all
to drive the ATI Radeon Mobility. It did not even sense its
parameters. So, I was stuck with the failsafe mode which turned out
to be a lousy framebuffer with 8-bit depth (like in your case I
believe).

So, first step is to check out what your kernel thinks about your
graphic card. Take a peek at /var/log/dmesg (referred to henceforth as
dmesg) and look for the lines that start with "radeonfb" (without
quotes). At the beginning of the file you should have something like
this:

   radeonfb: ref_clk=2700, ref_div=12, xclk=36675 from OF
   radeonfb: detected DFP panel size from EDID: 1280x854

and a bit later on:

   radeonfb: pm reg @50, clk_pwrmgt: f17500, pll_pwrmgt: a027e01f, mdll_cko: 980098
   radeonfb: ATI Radeon M7 LW  DDR SGRAM 32 MB

If instead of these you see... umm, I don't quite remember the
original lines, but I seem to recall that not even the last line was
present. In any case, if those parameters are not detected by the
kernel you are in for a kernel installation.

Maybe you are however lucky than me, so before thinking about a new
kernel try adding one of the following lines to the kernel arguments:

   video=radeon:1280x854-8@60   (feel free to experiment with 16 and 
                                 24 instead of 8), or
   video=radeonfb:1280x854-8@60 (again, you may want to experiment
                                 with 16 and 24).

Given the above lines from my dmesg the latter variant looks better.
These lines were suggested in various earlier postings on this list.
The reason I don't know much about them is that none worked for me.
The only two consequences (depending on the kernel I was running at
the time) were either no change at all or a blank display very early
in the boot process.

Anyway, try these kernmel arguments and see whether you get the last
two lines that I mentioned in dmesg. If you do not get them, I cannot
think of anything else than a new kernel. I am running one of the
latest benh's (but I am willing to change it in case anybody discovers
one that solves my tibook's sleep problems!!), but others may work as
well.

Depending on how confident you are, you can compile yours from source
(see the howto on the YDL site, and take a peek at the kernel howto
from LDP as well), or install a precompiled one
(http://www.ibooklinux.net/plain_page.php?caller=ibooklinux.php3+record=85
contains very good instructions on how to do that). In either case,
you can get the kernel archives (source or compiled) from
http://ppckernel.org/. 

Email me if you need further assistance on this one, as I will not
ellaborate (after all, you may not even need to go through kernel
installation).

So I assume that your kernel detects the graphic card. Now for the
X. The XFree86 that came with YDL 2.2 worked in my case with 24-bit
depth, but using /dev/fb. To make things work like this, I used the
XF86config file that I include below, with the following changes:

(a) The line

        ModulePath  "/usr/local/X11R6/lib/modules"

    should be commented out, and

(b) In the following two lines

	#Device	   "FBDev"
        Device     "Radeon"

    exchange comments; that is, they should become

	Device	   "FBDev"
        #Device     "Radeon"

    (after all, I just mentioned that I am gonna use /dev/fb).
    Finally,

(c) I don't remember whether this makes things better, but you may want
    to experiment with the line

	#DefaultFbBpp	32

    by removing the comment and see whether things are more to your
    liking afterwards.

The really interesting part in the config file is the modeline for the
new tibook LCD display. There were some that were vehiculated on this
list (if you are curious, they are in the included XF86config below,
but commented out), but the one that works best appears to be

        Modeline "1280x854" 79.816 1280 1296 1408 1536  854 855 858 866  -HSync -VSync

This one is again included in the config file. Don't trust me though,
issue the following command at the prompt

   fbset -x

and compare the things you get with the values from the modeline
(adjusting the latter if necessary).

Once you did all of these, you should have a crisp, 24-bit depth X in
no time, albeit in nonaccelerated mode.

For an attempt at the accelerated mode, I later installed the binaries
from http://www.penguinppc.org/~daenzer/XFree86-4.2/. If you are
interested in trying them out, read the "ReadMe" file and then follow
the "binaries" link to download the thing. Just ignore the XF86config
file posted there, as it is for the older tibook. Oh, yeah, it is
stated in the changelog that "you need a fairly recent benh kernel for
the DRM to work; the X server will likely lock up on startup
otherwise." I did not quite test this claim, as by the time I
installed this version I was already using a "fairly recent benh
kernel."

This package works on my system (currently featuring a 2.4.19-rc1-ben0
kernel, it worked with some earlier, benh versions as well) rigth with
the XF86config included below.

As you noticed, the option "UseFBDev" is still needed, so I am not
much better off than in the first case. I am using this latter
configuration though, if only because I took the time to download and
unpack it. ;-)

Actually, this variant does almost work without the UseFBDev. As
opposed to the YDL stock XFree86 (which blanks the screen or shows
garbage), this one does show a comprehensible image even in the
absence of UseFBDev (with a way faster rendering too). However, there
also are some extraneous artifacts in that image, which I have no idea
how to get rid of (advice is most welcome!!).

As a final note, the image on the graphical terminal may appear from
time to time shaky and garbled. Again, I don't know why (and again
advice is most welcome :-) ), but don't panic: just switch to another
virtual terminal (VT) and then back to VT7, and repeat this till the
problem disappears (I cannot think of any time when I needed more than
two such switches, one worked most of the times). This problem
manifests itself only when X is restarted, or when you switch back
from another VT, so it is not really a problem, more of an
inconvenience really.

 > The kde desktop also takes for forever to startup.

I don't know if the above mangling with the OS solves this problem,
sorry. Truth being told, I am not a fan of KDE and thus I am not using
it.

Hope this helps anyway. If there is something I forgot, or something
that does not work, let me (better yet, the list) know. But I would
rather hear the success story... :-)

Regards,
Stefan

-- 
If it was so, it might be; and if it were so, it would be; but as
it isn't, it ain't. That's logic.
    --Lewis Carroll, Through the Looking-Glass


--- XF86config-4 begins here ---

# XF86Config-4 (XFree86 server configuration file).
#
# Edit this file with caution, and see the XF86Config manual page.
# (Type "man XF86Config" at the shell prompt.)

Section "ServerLayout"
	Identifier     "XFree86 Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"

        # ModulePath set by default to "/usr/X11R6/lib/modules"
        ModulePath  "/usr/local/X11R6/lib/modules"

# The location of the RGB database.  Note, this is the name of the
# file minus the extension (like ".txt" or ".db").  There is normally
# no need to change the default.

	RgbPath	    "/usr/X11R6/lib/X11/rgb"

# Multiple FontPath entries are allowed (they are concatenated together)
# By default, YDL 2.0 and later now use a font server independent of
# the X server to render fonts.

	FontPath	"unix/:7100"			# local font server
EndSection

Section "Module"
	Load  "GLcore"
	Load  "dbe"
	Load  "dri"
	Load  "extmod"
	Load  "glx"
	Load  "record"
#	Load  "xtrap"

	Load  "ddc"
#	Load  "bitmap"
	Load  "freetype"
#	Load  "speedo"
	Load  "type1"
	Load  "vbe"
	Load  "int10"
EndSection

Section "InputDevice"
	Identifier	"Keyboard0"
	Driver		"keyboard"

	Option "Protocol"	"Standard"

	Option "AutoRepeat"	"250 30"

	Option "LeftAlt"	"Meta"
	Option "RightAlt"	"Meta"
	Option "ScrollLock"	"Compose"
	Option "RightCtl"	"Control"

        # XkbModel no longer used in XF 4.1.0
	#Option "XkbModel"	"macintosh"
	Option "XkbLayout"	"us"
EndSection

Section "InputDevice"
	Identifier	"Mouse0"
	Driver		"mouse"
	Option		"ZAxisMapping" "4 5"
	Option		"Protocol" "IMPS/2"
	Option		"Device" "/dev/mouse"
EndSection

Section "Monitor"
	Identifier	"Monitor0"
	VendorName	"Apple"
	ModelName	"New Titanium LCD"

	Option		"DPMS"
	HorizSync	 30-130
	VertRefresh	 50-160

	UseModes         "Modes0"
EndSection

Section "Modes"
 	Identifier	"Modes0"
 
 	# Apple iMac modes
 	Modeline "1024x768"   78.525 1024 1049 1145 1312   768  769  772  800 +hsync +vsync
 	Modeline "800x600"    62.357  800  821  901 1040   600  601  604  632 +hsync +vsync
 	Modeline "640x480"    49.886  640  661  725  832   480  481  484  514 +hsync +vsync
 	# Apple monitors tend to do 832x624
 	Modeline "832x624"    57      832  876  940 1152   624  625  628  667 -hsync -vsync
 	# Apple PowerBook G3
 	Modeline "800x600"    100     800  816  824  840   600  616  624  640 -hsync -vsync
 	# Generated (see below)
 	# D: 79.815 MHz, H: 51.963 kHz, V: 60.003 Hz
        Modeline "1280x854" 79.816 1280 1296 1408 1536  854 855 858 866  -HSync -VSync
        # (old modeline)
        #Modeline "1280x854" 79.815 1280 1296 1408 1536  854 855 858 866  -HSync -VSync
        # (Steve Penn's)
 	#Modeline "1280x854" 80 1280 1312 1408 1664  854 857 863 902  -HSync -VSync
EndSection

#[root@tibook X11]# fbset -x
#
#Mode "1280x854"
#    # D: 79.815 MHz, H: 51.963 kHz, V: 60.003 Hz
#    DotClock 79.816
#    HTimings 1280 1296 1408 1536
#    VTimings 854 855 858 866
#    Flags    "-HSync" "-VSync"
#EndMode


Section "Device"
	Identifier	"FBDev"
	#Option	"ShadowFB"	"true"
	Option	"fbdev"		"/dev/fb0"
	Driver	"fbdev"
	BusID	"PCI:0:16:0"
EndSection

Section "Device"
	Identifier "Radeon"
	Driver "radeon"
	BusID "PCI:0:16:0"

        Option "UseFBDev"

        #Option	"ShadowFB"	"true"
EndSection

Section "Screen"

	Identifier "Screen0"
	#Device	   "FBDev"
        Device     "Radeon"
	Monitor	   "Monitor0"
	DefaultDepth	24
	#DefaultFbBpp	32	
	SubSection "Display"
		Depth		8
		Modes 		"1280x854"
	EndSubSection
	SubSection "Display"
		Depth		16
		Modes 		"1280x854"
	EndSubSection
	SubSection "Display"
		Depth		24
		Modes 		"1280x854"
	EndSubSection
EndSection

Section "DRI"
           Mode 0666
EndSection

--- XF86config-4 ends here ---