# imac, efifb, fglrx

## ArtemShinkarov

Hi there

I've just installed gentoo on iMac (21.5 inch, 2011). It mostly works, however there is an annoying thing that I cannot overcome.

So, I use rEFIt, which executes grub2 which fires-up gentoo kernel.

I have the following GPT partitions:

```
/dev/sda1  --  EFI boot

/dev/sda2  --  MacOS HFS+

/dev/sda3  --  Linux /boot

/dev/sda4  --  Linux swap

/dev/sda5  --  Linux root

```

Now, in order to boot the kernel I compile the following efi loader with:

```
grub2-mkimage -O x86_64-efi -o BOOTX64.EFI -p "(hd1,gpt3)/grub2" \

   part_gpt hfsplus fat ext2 normal chain boot configfile   \

   ls linux multiboot loopback appleldr xnu xnu_uuid jpeg   \

   png tga search loadenv font help echo loadbios fixvideo

```

And then I copy BOOTX64.EFI to /dev/sda1

[By the way I have no clue why I have to name my /dev/sda3 as (hd1,gpt3) instead of (hd0,gpt3), but I can live with that].

When the kernel starts, it gets a VGA-compatible display via efifb, here is a relevant part of dmesg:

```
[    2.859877] efifb: probing for efifb

[    2.860602] efifb: framebuffer at 0x90010000, mapped to 0xffffc90009d00000, using 8128k, total 8128k

[    2.860606] efifb: mode is 1920x1080x32, linelength=7680, pages=1

[    2.860607] efifb: scrolling: redraw

[    2.860610] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0

[    2.866877] Console: switching to colour frame buffer device 240x67

[    2.872668] fb0: EFI VGA frame buffer device

```

and happily boots.

Then I want to launch X, which works reasonably well, however, I cannot switch back to the framebuffer console via Ctrl+Shift+Fn, because fglrx does not recognize efifb.  Here is a relevant part of the Xorg.log.0

```
[   104.938] (**) fglrx(0): NoAccel = NO

[   104.938] (**) fglrx(0): AMD 2D Acceleration Architecture enabled

[   104.938] (--) fglrx(0): Chipset: "AMD Radeon 6600M and 6700M Series" (Chipset = 0x6741)

[   104.938] (--) fglrx(0): (PciSubVendor = 0x106b, PciSubDevice = 0x6741)

[   104.938] (==) fglrx(0): board vendor info: third party graphics adapter - NOT original AMD

[   104.938] (--) fglrx(0): Linear framebuffer (phys) at 0x90000000

[   104.938] (--) fglrx(0): MMIO registers at 0xa8800000

[   104.938] (--) fglrx(0): I/O port at 0x00002000

[   104.938] (==) fglrx(0): ROM-BIOS at 0x000c0000

[   104.952] (II) fglrx(0): ATIF platform detected

[   104.952] (II) fglrx(0): AC Adapter is used

[   104.970] (EE) fglrx(0): V_BIOS address 0xd00 out of range

[   104.970] (II) fglrx(0): Invalid ATI BIOS from int10, the adapter is not VGA-enabled

[   105.192] (II) fglrx(0): AMD Video BIOS revision 9 or later detected

```

My naiive guess is that (Linear frmebuffer=0x90010000  conflicts with efifb=0x90010000); but may be "Linear framebuffer" of fglrx is something different.

In order to cure the error about "V_BIOS address out of range" I was trying to use grub2 "fakebios" and "fixvideo" features in different combinations, but it didn't change anything.

I saw that some people use "loadbios" files, but in order to do that I have to have those files, which I don't.

Any guesses?

P.S. My grub.cfg looks like:

```
menuentry "Gentoo 3.5.3" {

   root=(hd1,gpt3)

   insmod efi_gop

   linux /kernel-genkernel-x86_64-3.5.3-gentoo  root=/dev/sda5 video=efifb agp=off real_root=/dev/sda5 rootfs=ext4

   initrd /initramfs-genkernel-x86_64-3.5.3-gentoo

}

menuentry "Gentoo 3.5.3 fixvideo" {

   root=(hd1,gpt3)

   insmod efi_uga

   insmod fixvideo

   fakebios

   linux /kernel-genkernel-x86_64-3.5.3-gentoo  root=/dev/sda5 video=efifb agp=off real_root=/dev/sda5 rootfs=ext4

   initrd /initramfs-genkernel-x86_64-3.5.3-gentoo

}

```

Yes, I am using ATI Radeon card:

```
# lspci | grep VGA

01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Whistler [AMD Radeon HD 6600M Series]

```

P.P.S.  I wouldn't want to switch from fglrx drivers as I use some OpenCL programs which I want to compile and run, and I am not sure that it is possible to combine radeon drivers with catalyst, which is needed for OpenCL SDK.

Cheers,

Artem.

----------

## Ant P.

A binary blob cannot be used at the same time as a framebuffer driver. Once you've started X, the framebuffer has to be permanently disabled. Also as it's a Mac there is no VGA mode to fall back on. This is one of the tradeoffs you have to live with.

----------

## ArtemShinkarov

Dear Ant P, thanks for a quick reply.

But could you substantiate a little bit why so?  As far as I know, framebuffer is just a piece of memory that stores a screen (roughly).  Now, even if the original driver would die, then the new driver could pick-up this screen at the given location.

As for binary blobs -- I recall using a combination of nvidia proprietary drivers with a framebuffer on Lenovo T61 laptop.  Why it should be different here?

Cheers,

Artem.

----------

