[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#270743: radeonfb cannot detect display panel size and breaks



Package: kernel-image-2.6.8-powerpc
Version: 2.6.8-3
Severity: important

Hello,


booting kernel 2.6.8 on my iBook 2.2 with a Radeon Mobility M7, the
radeonfb driver fails to detect the display panel size, resulting in a
blank screen.  
I found some people reporting they could successfully start X in such a
situation, but trying this blindly didn't work either.  And yes, the
backlight is on, but the screen is all black.

The only way to get a working console with kernel 2.6 is "video=ofonly"
at the bootprompt, but this still breaks X, regardless whether with or
without the framebuffer driver.  Kernel 2.6.7 makes no difference,
2.4.26 differs only in that it automatically falls back to the OFfb.

I already posted the story to the debian-kernel [1] and debian-powerpc
lists, but there were no replies. :-(
Admittedly I'm not sure how to assess this, this is my first install of
Linux on this kind of hardware. (You may refer to my originating
installation report, see Bug #266472 [2].)
AFAIK radeonfb is required to run X on the iBook, right? If not: any
pointers?

Digging the lists, I found a couple of people reporting similar problems
on debian-powerpc, see [3] and [4]. [5] looks related, too. Their
investigations led me to find that apparently the radeonfb driver fails
to retrieve the display's EDID information:

ibook$ ls -1 /proc/device-tree/pci@f0000000/ATY,BeeParent@10/ATY,Bee_A/
AAPL,gray-page
address
character-set
compatible
depth
device_type
display-type
height
iso6429-1983-colors
linebytes
linux,phandle
name
width

... where some EDID info should show up, correct? And:

macos-shell$ ioreg -l | grep EDID
    | |     | |     "EDIDerr" = <f615>
    | |     | |     "EDIDerr" = <f615>
macos-shell$

... whatever /that/ means.

Attached to this message you find dmesg's output -- grabbed with a
remote shell -- running a rebuilt kernel 2.6.7, with
CONFIG_FB_RADEON_DEBUG enabled and the other config taken from the
Debian kernel (make oldconfig, Debian patches).
Further info, including a complete tarball of /proc/device-tree is
available at 

http://www.math.fu-berlin.de/~nschulz/linux/trouble/ibook/

Since one of my predecessors on the mailing lists mentioned he fixed his
problem with "hardcoding the EDID values" into the radeon driver, I
looked at its source, and my, what's that? 

This is from kernel-source-2.6.7/drivers/video/aty/radeon_monitor.c:

,----[ radeon_monitor.c lines 825-838 ]
| 		RTRACE("Guessing panel info...\n");
| 		if (rinfo->panel_info.xres == 0 || rinfo->panel_info.yres == 0) {
| 			u32 tmp = INREG(FP_HORZ_STRETCH) & HORZ_PANEL_SIZE;
| 			rinfo->panel_info.xres = ((tmp >> HORZ_PANEL_SHIFT) + 1) * 8;
| 			tmp = INREG(FP_VERT_STRETCH) & VERT_PANEL_SIZE;
| 			rinfo->panel_info.yres = (tmp >> VERT_PANEL_SHIFT) + 1;
| 		}
| 		if (rinfo->panel_info.xres == 0 || rinfo->panel_info.yres == 0) {
| 			printk(KERN_WARNING "radeonfb: Can't find panel size, going back to CRT\n");
| 			rinfo->mon1_type = MT_CRT;
| 			goto pickup_default;
| 		}
| 		printk(KERN_WARNING "radeonfb: Assuming panel size %dx%d\n",
| 		       info->panel_info.xres, rinfo->panel_info.yres);
`----

The second "if" will never be triggered!
Ah, wow, this is the precise source of these boot messages:

| Starting monitor auto detection...
| radeonfb: I2C (port 1) ... not found
| radeonfb: I2C (port 2) ... not found
| radeonfb: I2C (port 3) ... not found
| radeonfb: I2C (port 4) ... not found
| radeon_probe_OF_head
| head: ATY,Bee_A (letter: A, head_no: 0)
| analyzing OF properties...
| display-type: LCD
| radeon_probe_OF_head
| head: ATY,Bee_A (letter: A, head_no: 1)
| radeonfb: I2C (port 3) ... not found
| radeonfb: I2C (port 4) ... not found
| radeonfb: Monitor 1 type LCD found
| radeonfb: Monitor 2 type no found
| Guessing panel info...
| radeonfb: Assuming panel size 8x1
            ~~~~~~~~~~~~~~~~~~~~~~~

... and, apparently, already the crucial failure, since the patch below,
hardcoding the panel size into the driver at this point, works for me.
Both the console and X are now fine here.

--- KLUDG^WPATCH ---

diff -ru a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
--- a/drivers/video/aty/radeon_monitor.c	Wed Jun 16 07:18:37 2004
+++ b/drivers/video/aty/radeon_monitor.c	Sun Sep  5 04:44:14 2004
@@ -829,10 +829,10 @@
 			tmp = INREG(FP_VERT_STRETCH) & VERT_PANEL_SIZE;
 			rinfo->panel_info.yres = (tmp >> VERT_PANEL_SHIFT) + 1;
 		}
-		if (rinfo->panel_info.xres == 0 || rinfo->panel_info.yres == 0) {
-			printk(KERN_WARNING "radeonfb: Can't find panel size, going back to CRT\n");
-			rinfo->mon1_type = MT_CRT;
-			goto pickup_default;
+		if (rinfo->panel_info.xres == 8 || rinfo->panel_info.yres == 1) {
+			rinfo->panel_info.xres = 1024;
+			rinfo->panel_info.yres = 768;
+			printk(KERN_WARNING "radeonfb: Can't find panel size, falling back to hardcoded value\n");
 		}
 		printk(KERN_WARNING "radeonfb: Assuming panel size %dx%d\n",
 		       rinfo->panel_info.xres, rinfo->panel_info.yres);

--- END PATCH ---

Besides the wrong "if" condition and even if it's really a hardware
failure -- as Benh assumed in [6]: MacOS is still okay, so it looks like
its driver has some mechanism to cope with this situation.
This means there is some way to determine the panel size the radeonfb
driver misses, right?


Nikolaus


[1] http://lists.debian.org/debian-kernel/2004/09/msg00114.html
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=266472
[3] http://lists.debian.org/debian-powerpc/2003/08/msg00199.html
[4] http://lists.debian.org/debian-powerpc/2003/08/msg00398.html
[5] http://lists.debian.org/debian-powerpc/2003/10/msg00638.html
[6] http://lists.debian.org/debian-powerpc/2003/08/msg00473.html

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: powerpc (ppc)
Kernel: Linux 2.6.8-powerpc-fbfix
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (ignored: LC_ALL set to de_DE@euro)

Versions of packages kernel-image-2.6.8-powerpc depends on:
ii  initrd-tools                  0.1.74     tools to create initrd image for p
ii  module-init-tools             3.1-pre5-6 tools for managing Linux kernel mo

-- no debconf information
Total memory = 640MB; using 2048kB for hash table (at c0400000)
Linux version 2.6.7-fbdebug (nikolaus@kunigunde.dynalias.net) (gcc-Version 3.3.4 (Debian 1:3.3.4-6sarge1)) #1 Fri Sep 3 21:32:56 CEST 2004
Found UniNorth memory controller & host bridge, revision: 192
Mapped at 0xfdf00000
Found a Pangea mac-io controller, rev: 0, mapped at 0xfde80000
Processor NAP mode on idle enabled.
PowerMac motherboard: iBook 2 rev. 2
Found UniNorth PCI host bridge at 0xf0000000. Firmware bus number: 0->0
Found UniNorth PCI host bridge at 0xf2000000. Firmware bus number: 0->0
Found UniNorth PCI host bridge at 0xf4000000. Firmware bus number: 0->0
via-pmu: Server Mode is disabled
PMU driver 2 initialized for Core99, firmware: 0c
nvram: Checking bank 0...
nvram: gen0=686, gen1=685
nvram: Active bank is: 0
nvram: OF partition at 0x410
nvram: XP partition at 0x1020
nvram: NR partition at 0x1120
On node 0 totalpages: 163840
  DMA zone: 163840 pages, LIFO batch:16
  Normal zone: 0 pages, LIFO batch:1
  HighMem zone: 0 pages, LIFO batch:1
Built 1 zonelists
Kernel command line: root=/dev/hda3 ro 
PowerMac using OpenPIC irq controller at 0x80040000
OpenPIC Version 1.2 (4 CPUs and 64 IRQ sources) at fc62f000
OpenPIC timer frequency is 4.160000 MHz
PID hash table entries: 4096 (order 12: 32768 bytes)
GMT Delta read from XPRAM: 0 minutes, DST: off
time_init: decrementer frequency = 24.835245 MHz
Console: colour dummy device 80x25
Memory: 636288k available (1704k kernel code, 1108k data, 164k init, 0k highmem)
AGP special page: 0xe7fff000
Calibrating delay loop... 1585.15 BogoMIPS
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
checking if image is initramfs...it isn't (ungzip failed); looks like an initrd
Freeing initrd memory: 8192k freed
NET: Registered protocol family 16
PCI: Probing PCI hardware
Registering openpic with sysfs...
radeonfb_pci_register BEGIN
PCI: Enabling device 0000:00:10.0 (0086 -> 0087)
aper_base: 98000000 MC_FB_LOC to: 9bff9800, MC_AGP_LOC to: ffffa000
radeonfb: probed DDR SGRAM 32768k videoram
radeonfb: mapped 16384k videoram
radeonfb: Invalid ROM signature 0 should be 0xaa55
radeonfb: Retreived PLL infos from Open Firmware
radeonfb: Reference=27.00 MHz (RefDiv=12) Memory=180.00 Mhz, System=180.00 MHz
Starting monitor auto detection...
radeonfb: I2C (port 1) ... not found
radeonfb: I2C (port 2) ... not found
radeonfb: I2C (port 3) ... not found
radeonfb: I2C (port 4) ... not found
radeon_probe_OF_head
head: ATY,Bee_A (letter: A, head_no: 0)
analyzing OF properties...
display-type: LCD
radeon_probe_OF_head
head: ATY,Bee_A (letter: A, head_no: 1)
radeonfb: I2C (port 3) ... not found
radeonfb: I2C (port 4) ... not found
radeonfb: Monitor 1 type LCD found
radeonfb: Monitor 2 type no found
Guessing panel info...
radeonfb: Assuming panel size 8x1
radeonfb: Power Management enabled for Mobility chipsets
Registered "ati" backlight controller, level: 15/15
radeonfb: ATI Radeon LW  DDR SGRAM 32 MB
radeonfb_pci_register END
Thermal assist unit using timers, shrink_timer: 2000 jiffies
Registering PowerMac CPU frequency driver
Low: 400 Mhz, High: 800 Mhz, Boot: 800 Mhz, switch method: CPU
audit: initializing netlink socket (disabled)
audit(1094243974.607:0): initialized
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x0
Initializing Cryptographic API
hStart = 664, hEnd = 760, hTotal = 800
vStart = 409, vEnd = 411, vTotal = 450
h_total_disp = 0x4f0063	   hsync_strt_wid = 0x8c0292
v_total_disp = 0x18f01c1	   vsync_strt_wid = 0x820198
pixclock = 39729
freq = 2517
lvds_gen_cntl: 000d24a1
Console: switching to colour frame buffer device 80x25
Generic RTC Driver v1.07
Macintosh non-volatile memory driver v1.1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
IN from bad port 3f9 at c00d1b9c
IN from bad port 3f9 at c00d1b9c
IN from bad port 3f9 at c00d1b9c
IN from bad port 2f9 at c00d1b9c
IN from bad port 2f9 at c00d1b9c
IN from bad port 2f9 at c00d1b9c
IN from bad port 3e9 at c00d1b9c
IN from bad port 3e9 at c00d1b9c
IN from bad port 3e9 at c00d1b9c
IN from bad port 2e9 at c00d1b9c
IN from bad port 2e9 at c00d1b9c
IN from bad port 2e9 at c00d1b9c
pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>)
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
divert: not allocating divert_blk for non-ethernet device lo
MacIO PCI driver attached to Pangea chipset
Can't request resource 0 for MacIO device 0.80000000:mac-io
input: Macintosh mouse button emulation
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
adb: starting probe task...
adb devices: [2]: 2 c4 [3]: 3 1 [7]: 7 1f
ADB keyboard at 2, handler 1
Detected ADB keyboard, type ISO, swapping keys.
input: ADB keyboard on adb2:2.c4/input
input: ADB Powerbook buttons on adb7:7.1f/input
ADB mouse at 3, handler set to 4 (trackpad)
input: ADB mouse on adb3:3.01/input
adb: finished probe task...
ide0: Found Apple KeyLargo ATA-4 controller, bus ID 2, irq 19
Probing IDE interface ide0...
hda: TOSHIBA MK3018GAS, ATA DISK drive
hdb: TOSHIBA DVD-ROM SD-R2212, ATAPI CD/DVD-ROM drive
ide_pmac: Set UDMA timing for mode 2, reg: 0x1090038c
hda: Enabling Ultra DMA 2
hdb: MDMA, cycleTime: 120, accessTime: 75, recTime: 45
hdb: Set MDMA timing for mode 2, reg: 0x0001978c
hdb: Enabling MultiWord DMA 2
Using anticipatory io scheduler
ide0 at 0xea074000-0xea074007,0xea074160 on irq 19
mice: PS/2 mouse device common for all mice
Found KeyWest i2c on "uni-n", 2 channels, stepping: 4 bits
Found KeyWest i2c on "mac-io", 1 channel, stepping: 4 bits
NET: Registered protocol family 2
IP: routing cache hash table of 8192 buckets, 64Kbytes
TCP: Hash tables configured (established 262144 bind 65536)
RAMDISK: cramfs filesystem found at block 0
RAMDISK: Loading 4680 blocks [1 disk] into ram disk... |/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|done.
VFS: Mounted root (cramfs filesystem) readonly.
Freeing unused kernel memory: 164k init 4k chrp 32k prep
NET: Registered protocol family 1
SCSI subsystem initialized
hda: max request size: 128KiB
hda: 58605120 sectors (30005 MB), CHS=58140/16/63, UDMA(33)
 /dev/ide/host0/bus0/target0/lun0: [mac] p1 p2 p3 p4 p5 p6 p7 p8
SGI XFS with ACLs, large block numbers, no debug enabled
SGI XFS Quota Management subsystem
VFS: Can't find ext3 filesystem on dev hda3.
VFS: Can't find ext2 filesystem on dev hda3.
ReiserFS: hda3: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on hda3
XFS mounting filesystem hda3
Ending clean XFS mount for filesystem: hda3
hdb: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache, DMA
Uniform CD-ROM driver Revision: 3.20
ieee1394: Initialized config rom entry `ip1394'
sbp2: $Rev: 1219 $ Ben Collins <bcollins@debian.org>
ohci1394: $Rev: 1223 $ Ben Collins <bcollins@debian.org>
ohci1394: fw-host0: Unexpected PCI resource length of 1000!
ohci1394: fw-host0: OHCI-1394 1.0 (PCI): IRQ=[40]  MMIO=[f5000000-f50007ff]  Max Packet=[2048]
sungem.c:v0.98 8/24/03 David S. Miller (davem@redhat.com)
divert: allocating divert_blk for eth0
eth0: Sun GEM (PCI) 10/100/1000BaseT Ethernet 00:0a:95:67:ff:d2 
PHY ID: 4061e4, addr: 0
eth0: Found BCM5221 PHY
ieee1394: Host added: ID:BUS[0-00:1023]  GUID[000a95fffe67ffd2]
ip1394: $Rev: 1224 $ Ben Collins <bcollins@debian.org>
divert: not allocating divert_blk for non-ethernet device eth1
ip1394: eth1: IEEE-1394 IPv4 over 1394 Ethernet (fw-host0)
ts: Compaq touchscreen protocol output
Linux agpgart interface v0.100 (c) Dave Jones
agpgart: Detected Apple UniNorth/Pangea chipset
agpgart: Maximum main memory to use for agp memory: 565M
agpgart: configuring for size idx: 4
agpgart: AGP aperture is 16M @ 0x0
usbcore: registered new driver usbfs
usbcore: registered new driver hub
ohci_hcd: 2004 Feb 02 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci_hcd: block sizes: ed 64 td 64
PCI: Enabling device 0001:01:18.0 (0000 -> 0002)
ohci_hcd 0001:01:18.0: Apple Computer Inc. KeyLargo/Pangea USB
ohci_hcd 0001:01:18.0: irq 27, pci mem ea27c000
ohci_hcd 0001:01:18.0: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
PCI: Enabling device 0001:01:19.0 (0000 -> 0002)
ohci_hcd 0001:01:19.0: Apple Computer Inc. KeyLargo/Pangea USB (#2)
ohci_hcd 0001:01:19.0: irq 28, pci mem ea27e000
ohci_hcd 0001:01:19.0: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
PHY ID: 4061e4, addr: 0
eth0: Link is up at 100 Mbps, half-duplex.
eth0: Pause is disabled
NET: Registered protocol family 10
Disabled Privacy Extensions on device c02321e0(lo)
IPv6 over IPv4 tunneling driver
divert: not allocating divert_blk for non-ethernet device sit0
eth0: no IPv6 routers present

Reply to: