# Intel HD 3000 issues in Xorg



## Saos (Aug 22, 2012)

I've got a small notebook with Intel HD 3000 graphics on FreeBSD 9.0. I can run X just fine, unless I want to run at a resolution higher than 800x600 (I believe that's what it is...it's huge. That's what matters.)

In xorg.conf, I have:

```
Driver       "vesa"
```

But I want to use "intel". If I switch, X won't start. I've got xf86-video-intel driver installed, I even did make deinstall/reinstall to make sure it wasn't messed up.

I've seen a lot of other threads about this, but no definite answers. Anyone got a fix?


----------



## Saos (Aug 22, 2012)

I'm also considering trying a proprietary driver straight from Intel. They only have Windows and Linux downloads, so I'd probably have to use the Linux one, but would I need to set up emulation?


----------



## xibo (Aug 22, 2012)

1. Checkout FreeBSD 9.1 or 9-STABLE (or HEAD): See Handbook: Synchronizing Source.
2. Checkout a current snapshot of ports: See Handbook: Using the Ports Collection
3. Write

```
WITH_KMS="YES"
WITH_NEW_XORG="YES"
```
into /etc/make.conf
4. Compile and install the new version of FreeBSD that was checked out earlier:
`# make -C /usr/src KERNCONF=GENERIC buildworld kernel installworld && reboot` (Or go the 'safe' way and reboot after the kernel part into safe mode to do installworld and reboot again). Before rebooting, make sure to not have any third party modules being loaded automatically into the kernel, i.e. /boot/loader.conf contains only x_load lines for modules x that are part of FreeBSD (but not ports) and /etc/rc.conf loads no services that would do so either. 
5. After having rebooted to the new FreeBSD installation (check the output of uname -a to verify), rebuild all ports. Using portmaster from ports-mgmt/portmaster this can be done with `# portmaster -a -f`. Again, see the Handbook section on ports collection.
6. Enable all kernel modules from ports in /boot/loader.conf that were disabled earlier again.
7. Install x11-drivers/xf86-video-intel.
8. Recreate a new Xorg config file using `# X -configure`. Check that there is a Section for the intel card in ~/xorg.conf.new, and remove anything related to eventual vesa entries
9. Place ~/xorg.conf.new to /usr/local/etc/X11/xorg.conf
10. Drop to your non-root user and start X.

Notes:

Some people reported that loading drm at boot time causes the system to misbehave. That module is loaded by X on-demand, and does therefore not require being loaded (manually) at all.
Turning off X results in a black screen. While there is no screen, the system returns to syscons and commands typed into the keyboard, i.e. it's possible to restart X11.


----------



## Saos (Aug 25, 2012)

Does anyone know if things are fixed in 9.1? I'm thinking of trying the above workaround plus a few others later today.


----------



## SeanM (Sep 7, 2012)

Saos said:
			
		

> Does anyone know if things are fixed in 9.1? I'm thinking of trying the above workaround plus a few others later today.



I installed FreeBSD 9.0 x86_64 and my Xorg works fine I have an Intel HD 3000 and a Nvidia GT252M. The only problem is the screen resolution. x(


----------



## andersbo87 (Sep 21, 2012)

I also have pretty much the same problem. According to System Information on Mac OS X (I'm using a MacBook Pro 17 inch from 2011), I've got Intel HD 3000 and AMD Radeon HD 6770M graphics cards. My trouble is that even if I add 

```
WITH_KMS="YES"
WITH_NEW_XORG="YES"
```
to /etc/make.conf and (re)compile xorg (I'm running FreeBSD 9.1) and then install xf86-video-intel, when I run "Xorg -configure", Xorg only identifies my Radeon card (as Card0) and my Intel card (which I guess would be Card1) gets identified as vesa. Kldloading i915 and i915kms or putting i915_load="YES" and i915kms_load="YES" to /boot/loader.conf doesn't help either. From Device Manager in Windows, only my Radeon card shows up under Display adapters. Any help would be appreciated.


----------



## ramonovski (Dec 28, 2012)

After trying *xibo*'s solution, I got this in the 7th step:


```
===>  Configuring for xf86-video-intel-2.17.0_1
xf86-video-intel-2.17.0_1: Rebuild graphics/libdrm with the WITH_KMS option.
*** Error code 1

Stop in /usr/ports/x11-drivers/xf86-video-intel.
```

I've updated the whole ports, and then that particular port but I can't figure it out.

Can anyone help?

This is my last try until I remove FreeBSD on this laptop.

Thanks in advance.


----------



## wblock@ (Dec 28, 2012)

```
# cd /usr/ports/graphics/libdrm
# make config
(turn on the KMS option)
# make deinstall clean install
```


----------



## ramonovski (Dec 28, 2012)

Thanks, wblock.


```
CC     modetest.o
modetest.c:58:19: error: cairo.h: No such file or directory
modetest.c: In function 'make_pwetty':
modetest.c:394: error: 'cairo_surface_t' undeclared (first use in this function)
modetest.c:394: error: (Each undeclared identifier is reported only once
modetest.c:394: error: for each function it appears in.)
modetest.c:394: error: 'surface' undeclared (first use in this function)
modetest.c:395: error: 'cairo_t' undeclared (first use in this function)
modetest.c:395: error: 'cr' undeclared (first use in this function)
modetest.c:399: error: 'CAIRO_FORMAT_ARGB32' undeclared (first use in this function)
modetest.c:405: error: 'CAIRO_LINE_CAP_SQUARE' undeclared (first use in this function)
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 1
1 error
*** Error code 2
1 error
*** Error code 1

Stop in /usr/ports/graphics/libdrm.
*** Error code 1

Stop in /usr/ports/graphics/libdrm.
```

I give up with this laptop.


----------



## kpa (Dec 28, 2012)

Do you have an up to date ports tree? The error about cairo.h looks really strange because it's only included if graphics/cairo is installed and detected by the configure script.


----------



## xibo (Dec 28, 2012)

Install graphics/cairo. Also, this should be reported to x11@


----------



## kpa (Dec 28, 2012)

xibo said:
			
		

> Install graphics/cairo. Also, this should be reported to x11@



I can build graphics/libdrm fine if graphics/cairo is not installed so that's not the problem.


----------



## Saos (Dec 29, 2012)

I fixed this a while back by just switching to OpenBSD. Couldn't find a workaround that did the trick. Thanks for all your help guys.


----------

