# [SOLVED]can't get Xorg to work on intel965 macbook (4,1)

## VanFanel

Hello there 

I'm installing Gentoo in a Macbook 4,1 with Intel graphics (965 equipped with X3100). It uses the intel driver. 

This machine boots from EFI (Reffit GUI) , wich in turn loads GRUB2 (compiled for EFI with the correct configure options). 

It boots and puts my console in the EFI framebuffer (efifb). Everything is fine to this point. 

However, trying to launch Xorg leaves me with an scrambled console, and back to the prompt with errors. 

I've updated the Xorg server, and I've compiled the Intel AGP support in the kernel as a module, same as the Intel DRI kernel modules. I also emerged the inte-xfree86-driver. Everything seems to be in place. However, I can't get it to display a graphical desktop. 

The relevant part in dmesg says: 

```
agpgart-intel 0000:00:00.0: Intel 965GM Chipset 

agpgart-intel 0000:00:00.0: detected gtt size: 524288K total, 262144K mappable 

agpgart-intel 0000:00:00.0: detected 16384K stolen memory 

agpgart-intel 0000:00:00.0: AGP aperture is 256M @ 0x40000000 
```

..wich seems pretty ok to me, regarding hardware initialization and shared memory reservation. 

Now the latest /var/log/Xorg.log.0 says 

```
[  1320.196] 

X.Org X Server 1.9.5 

Release Date: 2011-03-17 

[  1320.214] X Protocol Version 11, Revision 0 

[  1320.221] Build Operating System: Linux 2.6.38.2-ck3 x86_64 Gentoo 

[  1320.227] Current Operating System: Linux commodore 2.6.38.2-ck3 #9 SMP PREEMPT Mon Jun 20 13:16:57 GMT 2011 x86_64 

[  1320.235] Kernel command line: BOOT_IMAGE=/boot/vmlinux root=/dev/sda3 reboot=pci video=efifb fix_video nomodeset quiet fastboot 

[  1320.242] Build Date: 20 June 2011  01:35:24PM 

[  1320.250]  

[  1320.258] Current version of pixman: 0.20.0 

[  1320.266]    Before reporting problems, check http://wiki.x.org 

   to make sure that you have the latest version. 

[  1320.283] Markers: (--) probed, (**) from config file, (==) default setting, 

   (++) from command line, (!!) notice, (II) informational, 

   (WW) warning, (EE) error, (NI) not implemented, (??) unknown. 

[  1320.309] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Jun 20 13:41:43 2011 

[  1320.318] (==) Using config file: "/etc/X11/xorg.conf" 

[  1320.327] (==) Using system config directory "/usr/share/X11/xorg.conf.d" 

[  1320.353] (==) ServerLayout "X.org Configured" 

[  1320.353] (**) |-->Screen "Screen0" (0) 

[  1320.353] (**) |   |-->Monitor "Monitor0" 

[  1320.353] (**) |   |-->Device "Card0" 

[  1320.353] (**) |-->Input Device "Mouse0" 

[  1320.353] (**) |-->Input Device "Keyboard0" 

[  1320.353] (==) Automatically adding devices 

[  1320.353] (==) Automatically enabling devices 

[  1320.456] (**) FontPath set to: 

   /usr/share/fonts/misc/, 

   /usr/share/fonts/TTF/, 

   /usr/share/fonts/OTF/, 

   /usr/share/fonts/Type1/, 

   /usr/share/fonts/100dpi/, 

   /usr/share/fonts/75dpi/, 

   /usr/share/fonts/misc/, 

   /usr/share/fonts/TTF/, 

   /usr/share/fonts/OTF/, 

   /usr/share/fonts/Type1/, 

   /usr/share/fonts/100dpi/, 

   /usr/share/fonts/75dpi/ 

[  1320.456] (**) ModulePath set to "/usr/lib64/xorg/modules" 

[  1320.456] (WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled. 

[  1320.456] (WW) Disabling Mouse0 

[  1320.456] (WW) Disabling Keyboard0 

[  1320.456] (II) Loader magic: 0x7cb060 

[  1320.456] (II) Module ABI versions: 

[  1320.456]    X.Org ANSI C Emulation: 0.4 

[  1320.456]    X.Org Video Driver: 8.0 

[  1320.456]    X.Org XInput driver : 11.0 

[  1320.456]    X.Org Server Extension : 4.0 

[  1320.458] (--) PCI:*(0:0:2:0) 8086:2a02:106b:00a1 rev 3, Mem @ 0x50100000/1048576, 0x40000000/268435456, I/O @ 0x00006110/8 

[  1320.458] (--) PCI: (0:0:2:1) 8086:2a03:106b:00a1 rev 3, Mem @ 0x50200000/1048576 

[  1320.458] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory) 

[  1320.458] (II) "extmod" will be loaded. This was enabled by default and also specified in the config file. 

[  1320.458] (II) "dbe" will be loaded. This was enabled by default and also specified in the config file. 

[  1320.458] (II) "glx" will be loaded. This was enabled by default and also specified in the config file. 

[  1320.458] (II) "record" will be loaded. This was enabled by default and also specified in the config file. 

[  1320.458] (II) "dri" will be loaded. This was enabled by default and also specified in the config file. 

[  1320.458] (II) "dri2" will be loaded. This was enabled by default and also specified in the config file. 

[  1320.458] (II) LoadModule: "dri" 

[  1320.486] (II) Loading /usr/lib64/xorg/modules/extensions/libdri.so 

[  1320.486] (II) Module dri: vendor="X.Org Foundation" 

[  1320.486]    compiled for 1.9.5, module version = 1.0.0 

[  1320.486]    ABI class: X.Org Server Extension, version 4.0 

[  1320.486] (II) Loading extension XFree86-DRI 

[  1320.486] (II) LoadModule: "dri2" 

[  1320.486] (II) Loading /usr/lib64/xorg/modules/extensions/libdri2.so 

[  1320.486] (II) Module dri2: vendor="X.Org Foundation" 

[  1320.486]    compiled for 1.9.5, module version = 1.2.0 

[  1320.486]    ABI class: X.Org Server Extension, version 4.0 

[  1320.487] (II) Loading extension DRI2 

[  1320.487] (II) LoadModule: "glx" 

[  1320.487] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so 

[  1320.487] (II) Module glx: vendor="X.Org Foundation" 

[  1320.487]    compiled for 1.9.5, module version = 1.0.0 

[  1320.487]    ABI class: X.Org Server Extension, version 4.0 

[  1320.487] (==) AIGLX enabled 

[  1320.487] (II) Loading extension GLX 

[  1320.487] (II) LoadModule: "record" 

[  1320.487] (II) Loading /usr/lib64/xorg/modules/extensions/librecord.so 

[  1320.487] (II) Module record: vendor="X.Org Foundation" 

[  1320.487]    compiled for 1.9.5, module version = 1.13.0 

[  1320.487]    Module class: X.Org Server Extension 

[  1320.487]    ABI class: X.Org Server Extension, version 4.0 

[  1320.487] (II) Loading extension RECORD 

[  1320.487] (II) LoadModule: "dbe" 

[  1320.487] (II) Loading /usr/lib64/xorg/modules/extensions/libdbe.so 

[  1320.487] (II) Module dbe: vendor="X.Org Foundation" 

[  1320.487]    compiled for 1.9.5, module version = 1.0.0 

[  1320.487]    Module class: X.Org Server Extension 

[  1320.487]    ABI class: X.Org Server Extension, version 4.0 

[  1320.487] (II) Loading extension DOUBLE-BUFFER 

[  1320.487] (II) LoadModule: "extmod" 

[  1320.487] (II) Loading /usr/lib64/xorg/modules/extensions/libextmod.so 

[  1320.487] (II) Module extmod: vendor="X.Org Foundation" 

[  1320.487]    compiled for 1.9.5, module version = 1.0.0 

[  1320.487]    Module class: X.Org Server Extension 

[  1320.487]    ABI class: X.Org Server Extension, version 4.0 

[  1320.487] (II) Loading extension MIT-SCREEN-SAVER 

[  1320.487] (II) Loading extension XFree86-VidModeExtension 

[  1320.487] (II) Loading extension XFree86-DGA 

[  1320.488] (II) Loading extension DPMS 

[  1320.488] (II) Loading extension XVideo 

[  1320.488] (II) Loading extension XVideo-MotionCompensation 

[  1320.488] (II) Loading extension X-Resource 

[  1320.488] (II) LoadModule: "intel" 

[  1320.488] (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so 

[  1320.532] (II) Module intel: vendor="X.Org Foundation" 

[  1320.532]    compiled for 1.9.2, module version = 2.14.0 

[  1320.532]    Module class: X.Org Video Driver 

[  1320.532]    ABI class: X.Org Video Driver, version 8.0 

[  1320.532] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810, 

   i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G, 

   E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G, 

   965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45, 

   4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale, 

   Sandybridge, Sandybridge, Sandybridge, Sandybridge, Sandybridge, 

   Sandybridge, Sandybridge 

[  1320.532] (--) using VT number 3 

[  1320.834] (EE) No devices detected. 

[  1320.834] 

Fatal server error: 

[  1320.834] no screens found 

[  1320.834] 

Please consult the The X.Org Foundation support 

    at http://wiki.x.org 

 for help. 

[  1320.834] Please also check the log file at "/var/log/Xorg.0.log" for additional information. 

[  1320.834] 
```

...wich says NO SCREENS FOUND, but I have a screen section wich looks good, here's my /etc/X11/xorg.conf file: 

```
Section "ServerLayout" 

   Identifier     "X.org Configured" 

   Screen      0  "Screen0" 0 0 

   InputDevice    "Mouse0" "CorePointer" 

   InputDevice    "Keyboard0" "CoreKeyboard" 

EndSection 

Section "Files" 

   ModulePath   "/usr/lib64/xorg/modules" 

   FontPath     "/usr/share/fonts/misc/" 

   FontPath     "/usr/share/fonts/TTF/" 

   FontPath     "/usr/share/fonts/OTF/" 

   FontPath     "/usr/share/fonts/Type1/" 

   FontPath     "/usr/share/fonts/100dpi/" 

   FontPath     "/usr/share/fonts/75dpi/" 

EndSection 

Section "Module" 

   Load  "dri" 

   Load  "dri2" 

   Load  "glx" 

   Load  "record" 

   Load  "dbe" 

   Load  "extmod" 

EndSection 

Section "InputDevice" 

   Identifier  "Keyboard0" 

   Driver      "kbd" 

EndSection 

Section "InputDevice" 

   Identifier  "Mouse0" 

   Driver      "mouse" 

   Option       "Protocol" "auto" 

   Option       "Device" "/dev/input/mice" 

   Option       "ZAxisMapping" "4 5 6 7" 

EndSection 

Section "Monitor" 

   Identifier   "Monitor0" 

   VendorName   "Monitor Vendor" 

   ModelName    "Monitor Model" 

EndSection 

Section "Device" 

        ### Available Driver options are:- 

        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False", 

        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz", 

        ### <percent>: "<f>%" 

        ### [arg]: arg optional 

        #Option     "AccelMethod"           # [<str>] 

        #Option     "DRI"                   # [<bool>] 

        #Option     "ColorKey"              # <i> 

        #Option     "VideoKey"              # <i> 

        #Option     "FallbackDebug"         # [<bool>] 

        #Option     "Tiling"                # [<bool>] 

        #Option     "Shadow"                # [<bool>] 

        #Option     "SwapbuffersWait"       # [<bool>] 

        #Option     "XvMC"                  # [<bool>] 

        #Option     "XvPreferOverlay"       # [<bool>] 

        #Option     "DebugFlushBatches"     # [<bool>] 

        #Option     "DebugFlushCaches"      # [<bool>] 

        #Option     "DebugWait"             # [<bool>] 

        #Option     "HotPlug"               # [<bool>] 

   Identifier  "Card0" 

   Driver      "intel" 

   BusID       "PCI:0:2:0" 

EndSection 

Section "Screen" 

   Identifier "Screen0" 

   Device     "Card0" 

   Monitor    "Monitor0" 

   SubSection "Display" 

      Viewport   0 0 

      Depth     1 

   EndSubSection 

   SubSection "Display" 

      Viewport   0 0 

      Depth     4 

   EndSubSection 

   SubSection "Display" 

      Viewport   0 0 

      Depth     8 

   EndSubSection 

   SubSection "Display" 

      Viewport   0 0 

      Depth     15 

   EndSubSection 

   SubSection "Display" 

      Viewport   0 0 

      Depth     16 

   EndSubSection 

   SubSection "Display" 

      Viewport   0 0 

      Depth     24 

   EndSubSection 

EndSection 
```

Just in case, here's my grub.cfg entry for Linux: 

```
menuentry "Linux" { 

        set debug=video 

        insmod efi_uga 

        search --set -f /boot/vmlinux 

        linux /boot/vmlinux root=/dev/sda3 reboot=pci video=efifb nomodeset quiet fastboot 

        #loadbios /boot/vbios.bin /boot/int10.bin 

} 

```

I had to disable modesetting because it makes efifb console scrambled from the beginning, so I can't see a thing. 

I also tried disabling KMS in the i915 driver in the kernel: I can see the efifb console then, but Xorg refuses to work, as explained above (disabling "KMS on by default" in kernel or disabling it in the GRUB entry is just the same, I believe). 

I also tried enabling KMS and, even if I get a broken efifb console, tried starting X. But it's the same, it generates an identical error log.[/code] 

So, what am I doing wrong? Getting desperate on this one.. 

thanks!Last edited by VanFanel on Wed Jun 22, 2011 1:14 pm; edited 1 time in total

----------

## Gusar

Your xorg.conf is outdated, you should remove it. But chances are high it won't fix your issue, because you're not the first one posting an xorg log that has no real error in it and yet it don't work. You do need KMS, the intel X driver won't work without it. What else... are you in the video group and do you have udev running?

----------

## VanFanel

ps -A shows udevd running, yes.

And yes, I am in the video group.

About the KMS, well, I have also tried with it ON, wich scrambles the EFIFB console. I really hate this EFIFB thing, it gets sclambled in every machine I saw booting Linux in EFI mode.

Any other suggestion? Without an error, I don't know what to try  :Sad: 

----------

## VanFanel

OK, it's fixed now, and I have full DRI support with the latest Intel drivers, KMS and intelfb as a bonus (for the accelerated framebuffer joy!).

So, here's what you're supposed to do, in order to get intel graphics working in a moder, EFI-booting system without BIOS emulation:

-Just in case, activate the I2C Intel 82801H, and the corresponding SMBUS support. Taking a good look at lspci for missing hardware is always a good idea  :Smile: 

-We need both in-kernel Intel DRI support drivers, including the i915 and the KMS on by default options activated, and the xf86-video-intel Xorg-side driver.

-Most important: THE INTEL DRIVER NEEDS LOADBIOS!! (Drivers not needing it are usually lame propietary ones like nvidia) And, of course, you've to extract your machine's bios: DO NOT USE another machine's bios, that was my error, bacause I was deploying the system from a nvidia macmini linux backup. Extract your own bios with 

```
dd if=/dev/mem of=/boot/vbios.bin bs=65536 skip=12 count=1

dd if=/dev/mem of=/boot/int10.bin bs=4 skip=16 count=1
```

-Your kernel boot line in grub.conf MUST have fix_video and video=efifb

-We also need 

```
loadbios /boot/vbios.bin /boot/int10.bin
```

 in the linux entry

Done. Beware with absurd things like not having a WM specified in .xinitrc, in my case 

```
exec openbox-session
```

----------

## andybotting

I'm looking at trying to do the same thing with my new Macbook Pro 8,2. It's got the Radeon/Intel combination and I was getting the same error as you, although I have some really crazy GRUB stuff I need to do to disable the radeon and switch the output to the intel card.

Do you have any special kernel patches you're using for EFI? Are you using 3.0 yet?

----------

