# MacBook Pro 5.1 and nouveau

## MacGyver031

Hi Folks,

I have been playing with EFI and nouveau-drm. I am unable to start X, because 

```
(EE) [drm] failed to open device

```

dmesg:

```
[drm] Initialized drm 1.1.0 20060810

failed to evaluate _DSM: 5

failed to evaluate _DSM: 5

VGA switcheroo: detected DSM switching method \_SB_.PCI0.IXVE.IGPU._DSM handle

nouveau 0000:02:00.0: power state changed by ACPI to D0

nouveau 0000:02:00.0: power state changed by ACPI to D0

nouveau 0000:02:00.0: enabling device (0002 -> 0003)

nouveau 0000:02:00.0: PCI INT A -> Link[Z003] -> GSI 16 (level, low) -> IRQ 16

nouveau 0000:02:00.0: setting latency timer to 64

[drm] nouveau 0000:02:00.0: Detected an NV50 generation card (0x096380c1)

[drm] nouveau 0000:02:00.0: Attempting to load BIOS image from PRAMIN

[drm] nouveau 0000:02:00.0: ... appears to be valid

[drm] nouveau 0000:02:00.0: BIT BIOS found

[drm] nouveau 0000:02:00.0: Bios version 62.94.58.00

[drm] nouveau 0000:02:00.0: TMDS table revision 2.0 not currently supported

[drm] nouveau 0000:02:00.0: Found Display Configuration Block version 4.0

[drm] nouveau 0000:02:00.0: Raw DCB entry 0: 01000103 00010034

[drm] nouveau 0000:02:00.0: Raw DCB entry 1: 02022286 0f200010

[drm] nouveau 0000:02:00.0: Raw DCB entry 2: 02022212 00020010

[drm] nouveau 0000:02:00.0: Raw DCB entry 3: 0000000e 00000000

[drm] nouveau 0000:02:00.0: DCB connector table: VHER 0x40 5 16 4

[drm] nouveau 0000:02:00.0:   0: 0x00000340: type 0x40 idx 0 tag 0xff

[drm] nouveau 0000:02:00.0:   1: 0x00001030: type 0x30 idx 1 tag 0x07

[drm] nouveau 0000:02:00.0:   2: 0x0000a546: type 0x46 idx 2 tag 0x08

[drm] nouveau 0000:02:00.0:   3: 0x00000400: type 0x00 idx 3 tag 0xff

[drm] nouveau 0000:02:00.0:   4: 0x00050146: type 0x46 idx 4 tag 0x51

[drm] nouveau 0000:02:00.0:   5: 0x00000210: type 0x10 idx 5 tag 0xff

[drm] nouveau 0000:02:00.0:   6: 0x00000211: type 0x11 idx 6 tag 0xff

[drm] nouveau 0000:02:00.0:   7: 0x00000213: type 0x13 idx 7 tag 0xff

[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 0 at offset 0xD47F

[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 1 at offset 0xD8CC

[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 2 at offset 0xE895

[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 3 at offset 0xE9DE

[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 4 at offset 0xEC4E

[drm] nouveau 0000:02:00.0: Parsing VBIOS init table at offset 0xECB3

[drm] nouveau 0000:02:00.0: 0xECB3: Condition still not met after 20ms, skipping following opcodes

[drm] nouveau 0000:02:00.0: 0xBFA6: parsing output script 0

[drm] nouveau 0000:02:00.0: 0xC5C2: parsing output script 0

[drm] nouveau 0000:02:00.0: 0xC3E4: parsing output script 0

[drm] nouveau 0000:02:00.0: Detected 256MiB VRAM

[TTM] Zone  kernel: Available graphics memory: 1896882 kiB.

[drm] nouveau 0000:02:00.0: 512 MiB GART (aperture)

[drm] nouveau 0000:02:00.0: Detected a LVDS output

[drm] nouveau 0000:02:00.0: Detected a DP output

[drm] nouveau 0000:02:00.0: Detected a TMDS output

[drm] nouveau 0000:02:00.0: Detected a LVDS connector

[drm] nouveau 0000:02:00.0: LVDS present in DCB table, but couldn't determine its native mode.  Disabling.

[drm] nouveau 0000:02:00.0: Detected a DVI-I connector

[drm] nouveau 0000:02:00.0:   no encoders, ignoring

[drm] nouveau 0000:02:00.0: Detected a DisplayPort connector

[drm] nouveau 0000:02:00.0: Detected a VGA connector

[drm] nouveau 0000:02:00.0:   no encoders, ignoring

[drm] nouveau 0000:02:00.0: Detected a DisplayPort connector

[drm] nouveau 0000:02:00.0:   no encoders, ignoring

[drm] nouveau 0000:02:00.0: Detected a TV connector

[drm] nouveau 0000:02:00.0:   no encoders, ignoring

[drm] nouveau 0000:02:00.0: timeout: (0x610200 & 0x1e0000) != 0

[drm] nouveau 0000:02:00.0: 0x610200 = 0x48052b08

[drm] nouveau 0000:02:00.0: timeout: (0x610200 & 0x1e0000) == 0

[drm] nouveau 0000:02:00.0: 0x610200 = 0x48050008

[TTM] Zone  kernel: Used memory at exit: 0 kiB.

nouveau 0000:02:00.0: PCI INT A disabled

nouveau: probe of 0000:02:00.0 failed with error -16

nouveau 0000:03:00.0: enabling device (0002 -> 0003)

...

nouveau 0000:03:00.0: PCI INT A -> Link[LGPU] -> GSI 16 (level, low) -> IRQ 16

nouveau 0000:03:00.0: setting latency timer to 64

[drm] nouveau 0000:03:00.0: Detected an NV50 generation card (0x0ac180b1)

vga_switcheroo: enabled

[drm] nouveau 0000:03:00.0: Attempting to load BIOS image from PRAMIN

[drm] nouveau 0000:03:00.0: ... appears to be valid

[drm] nouveau 0000:03:00.0: BIT BIOS found

[drm] nouveau 0000:03:00.0: Bios version 62.79.3e.00

[drm] nouveau 0000:03:00.0: TMDS table revision 2.0 not currently supported

[drm] nouveau 0000:03:00.0: Found Display Configuration Block version 4.0

[drm] nouveau 0000:03:00.0: Raw DCB entry 0: 01001123 00010034

[drm] nouveau 0000:03:00.0: Raw DCB entry 1: 02020232 00000010

[drm] nouveau 0000:03:00.0: Raw DCB entry 2: 02020286 0f220010

[drm] nouveau 0000:03:00.0: Raw DCB entry 3: 0000000e 00000000

[drm] nouveau 0000:03:00.0: DCB connector table: VHER 0x40 5 16 4

[drm] nouveau 0000:03:00.0:   0: 0x0000a146: type 0x46 idx 0 tag 0x08

[drm] nouveau 0000:03:00.0:   1: 0x00000240: type 0x40 idx 1 tag 0xff

[drm] nouveau 0000:03:00.0: Parsing VBIOS init table 0 at offset 0xD85A

[drm] nouveau 0000:03:00.0: Parsing VBIOS init table 1 at offset 0xDB0E

[drm] nouveau 0000:03:00.0: Parsing VBIOS init table 2 at offset 0xDB10

[drm] nouveau 0000:03:00.0: Parsing VBIOS init table 3 at offset 0xDBF5

[drm] nouveau 0000:03:00.0: Parsing VBIOS init table 4 at offset 0xDCBA

[drm] nouveau 0000:03:00.0: Parsing VBIOS init table at offset 0xDD1F

[drm] nouveau 0000:03:00.0: 0xDD1F: Condition still not met after 20ms, skipping following opcodes

[drm] nouveau 0000:03:00.0: 0xC216: parsing output script 0

[drm] nouveau 0000:03:00.0: 0xC5BE: parsing output script 0

[drm] nouveau 0000:03:00.0: 0xC79C: parsing output script 0

[drm] nouveau 0000:03:00.0: Detected 256MiB VRAM

[drm] nouveau 0000:03:00.0: Stolen system memory at: 0x0080000000

[TTM] Zone  kernel: Available graphics memory: 1896882 kiB.

[drm] nouveau 0000:03:00.0: 512 MiB GART (aperture)

[drm] nouveau 0000:03:00.0: Detected a LVDS output

[drm] nouveau 0000:03:00.0: Detected a TMDS output

[drm] nouveau 0000:03:00.0: Detected a DP output

[drm] nouveau 0000:03:00.0: Detected a DisplayPort connector

[drm] nouveau 0000:03:00.0: Detected a LVDS connector

[drm] nouveau 0000:03:00.0: timeout: (0x610200 & 0x1e0000) != 0

[drm] nouveau 0000:03:00.0: 0x610200 = 0x0c052b08

[drm] nouveau 0000:03:00.0: timeout: (0x610200 & 0x1e0000) == 0

[drm] nouveau 0000:03:00.0: 0x610200 = 0x0c050008

[TTM] Zone  kernel: Used memory at exit: 0 kiB.

nouveau 0000:03:00.0: PCI INT A disabled

nouveau: probe of 0000:03:00.0 failed with error -16

```

vgaswitcheroo:

```
0: :Pwr:0000:02:00.0

1: :Pwr:0000:03:00.0

```

Well, the obvious question is: Does anyone has a clue what I could search the net for to get my system working with nouveau?

I am aware that there is a report that 9400m is not supported, but "a" report is also "no" report.

Thanks.

----------

## MacGyver031

Got it working in the meantime.

I am now using Kernel 3.2.6-gentoo (from gentoo-sources), the in kernel nouveau driver (from staging drivers) and it works only when

EFIFB is not loaded, otherwise there is a Kernel panic

9600M GT is disabled with gpupwr, prior to loading nouveau driver when using EFI-boot (elilo or grub2)

As I am operating blind (may be I should consider using usb-rs232 adapter and serial console to watch what really happens) without console, I cannot really say where the system hangs when using the things mentioned.

BR.

----------

## MacGyver031

So made some more progress:

If someone is not willing to use gpupwr to deactivate 9600M GT, he has also the possibilty to load the driver with

```
modprobe nouveau noaccel=1 nofbaccel=1
```

but then you have no acceleration and in the console, the screen is scrambled. I have not started X with both adapters up.

With Kernel 3.2.6, I have seen that vga_switcheroo is not loaded. I am now working on that (so that I can as soon as nouveau is fixed to work with acceleration on 9600M GT, be able to use both adapters).

BR.

----------

## dutchThomas

Now that b43 works (mostly) on the bcm4322, nvidia is the last non-free driver on my macbook pro 5,2.  So if you have any luck getting accel working with nouveau keep us updated (:

----------

## MacGyver031

So, with gentoo-sources 3.4.2-gentoo-r1, there are many thing which work:

- Direct EFI-Booting without Bootloader

- EFIFB hands over to nouveau

- Backlight works with gmux-backlight

First of all, I am able to directly load Kernel (without bootloader) from the EFI. Please consider https://forums.gentoo.org/viewtopic-t-925104-highlight-.html for further information.

With 3.4.2-gentoo-r1, one has to use EFIFB prior to nouveau. It might have been random, but without EFIFB, I only get scrambled screen after nouveau loads.

Backlight works with APPLE_GMUX module: 

 *Quote:*   

>  Symbol: APPLE_GMUX [=m]                                                                 x  
> 
>   x Type  : tristate                                                                        x  
> 
>   x Prompt: Apple Gmux Driver                                                               x  
> ...

 

So, now I am examining EFIVars -> /sys/firmware/efi/vars/backlight-regs-xxxxxxxx/data to set brightness as it is done with OSX.

BR

----------

## khayyam

 *MacGyver031 wrote:*   

> - Direct EFI-Booting without Bootloader
> 
> [....] I am able to directly load Kernel (without bootloader) from the EFI.

 

Joanand ...

I wanted to ask, if your booting via EFI stub does this mean that the whole issue of 'blessing' the bootloader (grub.efi, rEFIt, or what-have-you) can be side-stepped? I have a macbook 1,1 and boot native EFI, with grub.efi on the EFI System Partition, and as I have no OSX (other than an install CD) 'blessing' is the last cord to be severed.

I assume, as per darkphader's guide, you are using efibootmgr, are there any issue with Apple's EFI mish-mash?

Thanks in advance & best ...

khay

----------

## MacGyver031

Hello Khay,

In order to get into efi, linux must be booted via efi. That means, either you bless or you use the failover of efi.

Let me show you how this works on my MacBook Pro:

```
efibootmgr
```

 *Quote:*   

> BootCurrent: 0000
> 
> BootOrder: 0000,0001,FFFF
> 
> Boot0000* Gentoo-3.4.0
> ...

 

```
ls /mnt/sda1/EFI/
```

 *Quote:*   

> drwxr-xr-x 5 root root 512 May 30 15:50 .
> 
> drwxr-xr-x 3 root root 512 Jan  1  1970 ..
> 
> drwxr-xr-x 2 root root 512 May 30 11:43 BOOT (has BOOTX64.EFI)
> ...

 

If you have installed Mac OSX on a shinny new harddrive, inside /dev/sda1 you will only find the folder "apple".

You will have to create the folder BOOT and Gentoo yourself.

Inside BOOT, you should place a functional Kernel (which has EFI Stub, EFIFB and commandline "root=/dev/sda2", where the root will be sda2), named BOOTX64.EFI. To select this, you will only need to press OPTION during startup and select "EFI BOOT".

If everything goes good, you should have the system running with EFI. Form here you can start using efibootmgr.

I have placed the default boot under Gentoo/New.efi (=Kernel 3.4.2-gentoo-r1) and the fallback under BOOT/BOOTX64.EFI (=Kernel 3.4.0). 

```
efibootmgr -v
```

 *Quote:*   

> BootCurrent: 0000
> 
> BootOrder: 0000,0001,FFFF
> 
> Boot0000* Gentoo-3.4.0  HD(1,28,64000,4934d585-3ff1-43e0-a2a6-e2a9666d9ea4)File(\EFI\Gentoo\New.efi)
> ...

 

After pressing OPTION key, you will most likely to only see BOOT/BOOTX64.EFI and not Gentoo/Kernel.efi. 

So to sum up: The naming should be "Gentoo" and not "Gentoo-3.4.0", "Gentoo-3.3.4" is not necessary (except one has accidently deleted the New.efi).

And the superpart: As long as the new Kernel replace New.efi, nothing has to be done (no blessing, no call of efibootmgr etc).

BR.

----------

## MacGyver031

PS: Easiest would be, if you have a pendrive which you can repartition, then you should delete the pendrive, create a GPT-table, a FAT32 partiton, called EFI, with BOOT flag set.

Create BOOT in the EFI-Partition and BOOTX64.EFI which you would like to test. Reboot your Mac, then pressing OPTION, you should see the external drive.

So you can test if the kernel is likely to boot without problem and if your Mac has the support for BOOT.

----------

## khayyam

Joanand ... thanks for your extensive explanation ...

 *MacGyver031 wrote:*   

> In order to get into efi, linux must be booted via efi. That means, either you bless or you use the failover of efi.

 

As I said, I currently boot using grub2.efi (in the form of BOOTIA32.EFI), however, without blessing the "EFI System Volume" and additionally the bootloader itself, I would be required to alt/option at bootime to select "EFI BOOT". This is the case even though the efi volume is per EFI specification and no other bootloader is present. Apple doesn't use the EFI volume (though one will be created if formating a disk with GPT partitioning via diskutil) but 'boot.efi' located on the OSX volume, which in my case simply doesn't exist as there is no OSX, just linux. I have assumed that Apple's firmware has the path to the OSX volume boot.efi hardcoded (infact efibootmgr shows one of its boot entries as /MaxDisk/usr/standalone/i386/boot.efi along with two entries for "Mac OS X" one of which is the blessed grub.efi) and that unless I fake (via 'bless') being somekind of OSX install then the firmware will fail to pass off to the bootloader (even though its detected as a valid "EFI BOOT"). This being the case I haven't wanted to tinker with it for fear of breaking it.

To clarify ... unless I do the following the volume/bootloader will not be treated as BootNext ... I will be required to alt/option and select it.

```
bless --folder=/Volumes/efi --file=/Volumes/efi/EFI/BOOT/BOOTIA32.EFI --setBoot

bless --mount=/Volumes/efi --file=/Volumes/efi/EFI/BOOT/BOOTIA32.EFI --setBoot
```

The efi specification states that given an efi volume on the disk it'll look for a (efi) bootloader on that volume, in the case of Apples efi mish-mash this doesn't seem to be the case, it doesn't use the efi volume at all, and expects the volume/bootloader to have been blessed. This 'blessing', I expect, is nothing other than setting envars, and this is the rubric of my question, can efibootmgr stand in place of 'bless' or does its idea of 'the efi standard' conflict with Apple's non-standard efi implimentation? I understand that the kernels efi stub will allow it to boot directly via efi, and I understand how to go about doing this, what I really want to know is how compatable is efibootmgr with the Apple efi implimentaion, is there anything I should be mindful of, etc.  

Currently efibootmgr shows ...

```
BootCurrent: 0080

Timeout: 5 seconds

BootOrder: 0080

Boot0071* /MaxDisk/usr/standalone/i386/boot.efi

Boot0080* Mac OS X

Boot0081* Mac OS X

Boot0082* 

BootFFFF*
```

Some of this is no doubt leftover envars from when OSX was intalled, and the 0080 entry the 'blessed' grub2.efi.

I'm currently booting 3.2.12-gentoo and am missing CONFIG_EFI_STUB but I'll update to 3.4.2 shortly and follow your instructions. I notice that you are not calling efibootmgr for anything more than listing, am I right in thinking that no envars are written, and if so that most of the magic here is provided by efi stub, with efibootmgr being used simply to read the current vars? Have you used it to modify efi?

 *MacGyver031 wrote:*   

> And the superpart: As long as the new Kernel replace New.efi, nothing has to be done (no blessing, no call of efibootmgr etc).

 

I see, but this suggests to me that nothing is being modified in efi, and this being the case, how is this voodoo passed on to the firmware, or am I missing something here? If efi were changed then there would be no need to stick to prior names given to the *.efi. This confuses me somewhat as I'm not understanding the relation between the efi system volume (file structure and what-have-you) and the envars which the firmware will use to find the *.efi (yes, I know in the case of BOOTIA32.EFI these are 'defaults' but this is not the case for New.efi), the only possible conclusion I can come to is that the kernel is writing envars to the firmware, is this why the reboot is required? Sorry if my questions seem confused but I'm trying to understand how this works exactly.

Anyhow, thanks again for your instructions ... and tollerance ...

best ... khay

ps. oh, BTW, because VFAT volumes are case insensitive /efi/boot/bootia32.efi is eq to */ BOOTIA32.EFI

pss. Redhat has a tool 'bless' which is intended for the same purpose as the OS X tool of the same name, for some reason however it only supports HFS+ volumes, which makes it useless for EFI System Volumes (unless they are reformated as HFS+).

----------

## MacGyver031

 *khayyam wrote:*   

> 
> 
> Currently efibootmgr shows ...
> 
> 

 

Could you give me the output of 

```
efibootmgr -v
```

?

----------

## khayyam

Joanand ...

I've since built 2.4.2 with CONFIG_EFI_STUB, etc, infact this is my first boot (using grub as I wanted to make sure CONFIG_CMDLINE, and everything was working as expected). I have some errands that I need to run, but I will test booting with kernel as BOOTIA32.EFI sometime later today.

Here is the output of 'efibootmgr -v' as requested:

```
BootCurrent: 0080

Timeout: 5 seconds

BootOrder: 0080

Boot0071* /MaxDisk/usr/standalone/i386/boot.efi   ACPI(a0341d0,0)PCI(1f,2)ATAPI(0,1,0)HD(3,42cf888,2800000,00006b38-3a37-0000-e87f-00003f0e0000)File(\usr\standalone\i386\boot.efi)

Boot0080* Mac OS X   ACPI(a0341d0,0)PCI(1f,2)ATAPI(0,1,0)HD(1,28,64000,a5d32078-64a7-4c13-a0f1-1286c2f6422b)File(\EFI\BOOT\BOOTIA32.efi)

Boot0081* Mac OS X   ACPI(a0341d0,0)PCI(1f,2)ATAPI(0,1,0)HD(2,64028,946b860,300f09d3-4d7f-46be-8a4b-868cc8b6d7e1)File(\System\Library\CoreServices\com.apple.bless.firmware\EFIUpdaterApp.efi)".-.x. .e.f.i.-.a.p.p.l.e.-.p.a.y.l.o.a.d.0.-.d.a.t.a."...

Boot0082*    ACPI(a0341d0,0)PCI(1f,2)ATAPI(0,1,0)HD(2,64028,946b860,45a0909b-6919-4ae1-860a-d500a15a3edc)

BootFFFF*    ACPI(a0341d0,0)PCI(1d,1)USB(0,0)HD(1,3f,9898,00000000)File(\efi\boot\bootia32.efi)
```

I took another look at the "EFI Stub - booting without a bootloader" guide, and I think I have a clearer picture of what happens, the only issue that I'm still not sure of is if I can run 'efibootmgr --create' ...

back later ... best

khay

----------

## MacGyver031

Only because I have succeeded, does not mean that you will. But if you are curios and want to risk, here is the cooking recipie:

```
efibootmgr --create --part 1 --label "Gentoo" --loader '\EFI\Gentoo\New.efi'
```

Where Part 1 is /dev/sda1 (or first disk, first partition).

Where New.efi is a running Kernel with EFI stub and with commandline with "root=/dev/sda2"

The command will make the entry 

 *Quote:*   

> Boot0000* Gentoo  HD(1,28,64000,4934d585-3ff1-43e0-a2a6-e2a9666d9ea4)File(\EFI\Gentoo\New.efi)

 

Now one needs to manipulate the boot order:

```
efibootmgr -o 0000,0080
```

This will make EFI try New.efi, if it fails, it will handover to BOOTIA32.efi.

BR

----------

## khayyam

 *MacGyver031 wrote:*   

> Only because I have succeeded, does not mean that you will.

 

Well, afaik all the macbooks have the same EFI v.1.10 (Apple) and so I was fairly confident that if it worked on later revisions it'd work for mine ... and I'm pleased to report ... it does!!

```
BootCurrent: 0000

Timeout: 5 seconds

BootOrder: 0000

Boot0000* 3.4.2-geek-gnu   HD(1,28,64000,a5d32078-64a7-4c13-a0f1-1286c2f6422b)File(\efi\linux\g342ia32.efi)

Boot0082*    ACPI(a0341d0,0)PCI(1f,2)ATAPI(0,1,0)HD(2,64028,946b860,45a0909b-6919-4ae1-860a-d500a15a3edc)

BootFFFF*    ACPI(a0341d0,0)PCI(1d,1)USB(0,0)HD(1,3f,9898,00000000)File(\efi\boot\bootia32.efi)
```

Thanks for all your help in that regard ... best

khay

----------

## funZX

Hi MacGyver,

I'm pretty much done with installing and configuring my Macbook Pro 5.1. All I still have to do is getting the hardware accelerated graphics. Problem is that if I don't pass "noaccel=1" to nouveau driver, it crashes at boot time. Do you have any progress on this on your side?

Thanks.

----------

## MacGyver031

 *funZX wrote:*   

> All I still have to do is getting the hardware accelerated graphics. Problem is that if I don't pass "noaccel=1" to nouveau driver, it crashes at boot time. Do you have any progress on this on your side?

 

As far as I have read, the dedicated graphic adapter nVidia 9600M works only without acceleration with nouveau.

nVidia 9400M (chipset graphic adapter) does work with nouveau and accleration.

If you have set the "powersave" option in Mac OSX, you will have to use "gpupwr" to deactivate nVidia 9600M and then you can safely load nouveau driver without any options.

If you require 9600M and hardware acceleration, you should use nVidia-drivers.

BR

----------

## funZX

Ok. Thank you very much.

For now I will make it as you suggested; maybe it will be fixed soon. I think I'm going to blacklist nouveau driver, and adding an init.d script before xdm to execute the "gpupwr" and loading nouveau.

----------

## MacGyver031

So in the meantime, Kernel 3.4.9 worked like a charm using gpupwr and nouveau drivers, but 3.5.x and 3.6.6 kicked me back to the begining.

So after upgrading to 3.5.7, I restarted my MacBook and saw that xorg crashes.

With 3.5.7, gpupwr and nouveau (with accel) leads to "slow" death of the system (CPU goes up to 100%) IF EFIFB is not used. If EFIFB is used, then system crashes immediately.

Loading nouveau with noaccel=1 creates scrambled display.

With gpupwr and nouveau with noaccel=1, nouveau fills the kernel log with

 *Quote:*   

> nouveau 0000:02:00.0: AUXCH(0): begin idle timeout 0xffffffff

 

Starting X after that leads to black screen and frozen laptop.

With 3.6.6 the same effects as in 3.5.7. But 3.6.6 has vgaswicheroo. Looking into switch state after loading nouveau with noaccel=1, showed that the display (which is scrambled) output is not selected on either of the two (DIS and IGD) devices.

So if there is anyone who has succeeded in forcing the output to select one of the adapter, it would be helpful.

Thanks.

----------

## MacGyver031

Hi folks,

Kernel 3.7.0 seems to bring me a step further, I can use the lower 75% of the screen (the upper 25% is scrambled).

If someone wants to try it out:

Compile the kernel with EFI Stub, EFIFB and nouveau.

Copy the kernel to /dev/sda1/efi/BOOT/BOOTX86.EFI

Reboot system (pressing OPTION (=ALT), select "EFI Boot") and load nouveau with

```
modprobe nouveau noaccel=1
```

You can disable the unused adapter by 

```
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
```

The screen will be totaly scrambled after loading nouveau. Then start X.

You will see that the upper 25% is scrambled, but lower 75% is readable.

This is a partial success, I hope that the developers make some more progress (and add acceleration to 9600m).

BR.

----------

## MacGyver031

Soo here we go:

Booting with EFI, EFIFB, Kernel 3.7.1 -> Loading nouveau with noaccel=1 -> Scrambled screen (EFI was set to use 9400m, integrated Adapter).

Swiching with vgaswitcheroo to discrete adapter -> Screen is ok, starting X works. Graphic adapter gets hot, fan is at 3100rpm.

Switching back to integrated  did not succeed (scrambled screen again). I think that handover from EFIFB to nouveau does not work well.

Next step: set EFI to use discrete adapter and then to switch to integrated to see if EFIFB handover is the fault.

BR.

----------

## MacGyver031

 *MacGyver031 wrote:*   

> 
> 
> Next step: set EFI to use discrete adapter and then to switch to integrated to see if EFIFB handover is the fault.
> 
> 

 

Soo, yesterday I installed MacOSX on a seperate disk, swiched default mode to use discrete adapter, started gentoo with 3.7.1, loaded my script:

```

#!/sbin/runscript

# Copyright 1999-2012 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

#This startup script loads the nouveau driver after disabling nVidia 9600M, in 

#case nVidia 9400m is available. If only nVidia 9600M is available, then

#acceleration is disabled.

start() {

        local KERVER=`/bin/uname -r`

        if [ "$KERVER" == "3.4.9-gentoo" ]; then

                #nVidia is found on PCI-ID 03:00.0

                local GRAPHICS=`/usr/sbin/lspci | grep 03:00.0`

                if [ "$GRAPHICS"=="" ]; then

                        ebegin "Loading driver(s) for nVidia 9600M."

                        modprobe nouveau noaccel=1

                        eend $?

                else

                        ebegin "Loading driver(s) for nVidia 9400M after disabling nVidia 9600M."

                        /root/sbin/gpupwr

                        modprobe nouveau

                        eend $?

                fi

        else

                ebegin "Kernel not supported. Please load Nouveau manually!"

                modprobe nouveau noaccel=1

                #echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch

                echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

                echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch

                eend $?

        fi

}

stop() {

        ebegin "Unloading Nouveau driver...."

        eend $?

}

```

and guess what: IT WORKS!

As soon as nouveau gets loaded, the screen gets scrambled. Switching from discrete adapter to integrated fixes the screen and it is readable.

The drawback is that I have no acceleration, if someone knows how to load nouveau to use acceleration on one adapter and none on the other, please tell me.

BR.

----------

## ZeuZ_NG

Any news regarding this? 

I've currently disabled the 9600GT adapter regardless of the Mac OS X set option through a serie of outb instructions on GRUB2.

Also EFI booting, but having problems with both nouveau and nvidia-drivers

----------

