# screen resolution 1366:768 on a laptop running 9.0-RELEASE amd64



## jopeto (Jun 26, 2012)

Hello,

I recently installed FreeBSD 9.0 RELEASE amd64 on a Samsung RV520 with the following specs:

CPU: Intel Pentium B950
Chipset: Intel HM65
Graphics: Intel HD Graphics (HD3000)

Under windows it has a wide screen resolution of 1366:768 with a 60Hz refresh rate. However, after installing Xorg, no matter how I tweaked the configuration file, I could not get the resolution to be different from 1024x768, which means that everything appears squashed.

I sent an email to the freebsd-mobile list and I was advised the following:



> It seems to me that you will need Intel KMS support for this machine to enjoy
> the full screen resolution. It is available for 9.0 since a few days. It would require you to download the latest sources, compile them and install the kernel with this support.
> http://wiki.freebsd.org/Intel_GPU
> will tell you more.



Unfortunately the link provided does not really describe in detail what needs to be done (at least it's not obvious for someone like me). I looked through this forum and found the following link:
http://forums.freebsd.org/showpost.php?p=166892&postcount=102
However, this is only for the i386 version.

Can someone point me to a similar tutorial for the amd64 version, or at least give me some hints on what exactly I need to do in order to be able to get normal resolution on my screen?

Thanks a lot in advance.


----------



## jopeto (Jun 27, 2012)

OK, this is how I interpreted the instructions on this website: http://wiki.freebsd.org/Intel_GPU

Since the patches for KMS have been committed to RELENG_9, this means that I need to upgrade from 9-RELEASE to 9-STABLE, so these are the steps which I followed:


Add

```
WITH_NEW_XORG="Yes"
WITH_KMS="Yes"
```
to /etc/make.conf as advised on the website.

Run
[cmd=]# csup supfile[/cmd] where the supfile contains

```
*default host=cvsup4.fr.FreeBSD.org
*default base=/usr/db
*default prefix=/usr
*default release=cvs tag=RELENG_9
*default delete use-rel-suffix
*default compress

src-all
```

Build and install the kernel and world

```
# cd /usr/src
# make buildworld
# make buildkernel
# make installkernel
# reboot
# make installworld
# reboot
```

Unfortunately when I start X, the resolution of the screen is still the same and everything looks squashed.

I ran [cmd=]uname -a[/cmd] and indeed my *Free*BSD version has changed from RELEASE to STABLE, so I'm guessing the process was successful. How can I verify that I have installed the Intel KMS support and more importantly, any advice on how I can get the right resolution of my screen from here?

If this would be of any help, this is the output of `pciconf -lvb`

```
$ pciconf -lvb
hostb0@pci0:0:0:0:      class=0x060000 card=0xc597144d chip=0x01048086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '2nd Generation Core Processor Family DRAM Controller'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:2:0:     class=0x030000 card=0xc597144d chip=0x01068086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '2nd Generation Core Processor Family Integrated Graphics Controller'
    class      = display
    subclass   = VGA
    bar   [10] = type Memory, range 64, base 0xf0000000, size 4194304, enabled
    bar   [18] = type Prefetchable Memory, range 64, base 0xe0000000, size 268435456, enabled
    bar   [20] = type I/O Port, range 32, base 0x3000, size 64, enabled
none0@pci0:0:22:0:      class=0x078000 card=0xc597144d chip=0x1c3a8086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '6 Series/C200 Series Chipset Family MEI Controller'
    class      = simple comms
    bar   [10] = type Memory, range 64, base 0xf0605000, size 16, enabled
ehci0@pci0:0:26:0:      class=0x0c0320 card=0xc597144d chip=0x1c2d8086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '6 Series/C200 Series Chipset Family USB Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Memory, range 32, base 0xf060a000, size 1024, enabled
hdac0@pci0:0:27:0:      class=0x040300 card=0xc597144d chip=0x1c208086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '6 Series/C200 Series Chipset Family High Definition Audio Controller'
    class      = multimedia
    subclass   = HDA
    bar   [10] = type Memory, range 64, base 0xf0600000, size 16384, enabled
pcib1@pci0:0:28:0:      class=0x060400 card=0xc597144d chip=0x1c108086 rev=0xb4 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '6 Series/C200 Series Chipset Family PCI Express Root Port 1'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:28:3:      class=0x060400 card=0xc597144d chip=0x1c168086 rev=0xb4 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '6 Series/C200 Series Chipset Family PCI Express Root Port 4'
    class      = bridge
    subclass   = PCI-PCI
ehci1@pci0:0:29:0:      class=0x0c0320 card=0xc597144d chip=0x1c268086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '6 Series/C200 Series Chipset Family USB Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Memory, range 32, base 0xf0609000, size 1024, enabled
isab0@pci0:0:31:0:      class=0x060100 card=0xc597144d chip=0x1c498086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'HM65 Express Chipset Family LPC Controller'
    class      = bridge
    subclass   = PCI-ISA
ahci0@pci0:0:31:2:      class=0x010601 card=0xc597144d chip=0x1c038086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller'
    class      = mass storage
    subclass   = SATA
    bar   [10] = type I/O Port, range 32, base 0x3088, size  8, enabled
    bar   [14] = type I/O Port, range 32, base 0x3094, size  4, enabled
    bar   [18] = type I/O Port, range 32, base 0x3080, size  8, enabled
    bar   [1c] = type I/O Port, range 32, base 0x3090, size  4, enabled
    bar   [20] = type I/O Port, range 32, base 0x3060, size 32, enabled
    bar   [24] = type Memory, range 32, base 0xf0608000, size 2048, enabled
none1@pci0:0:31:3:      class=0x0c0500 card=0xc597144d chip=0x1c228086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '6 Series/C200 Series Chipset Family SMBus Controller'
    class      = serial bus
    subclass   = SMBus
    bar   [10] = type Memory, range 64, base 0xf0604000, size 256, enabled
    bar   [20] = type I/O Port, range 32, base 0xefa0, size 32, enabled
iwn0@pci0:1:0:0:        class=0x028000 card=0x50058086 chip=0x08968086 rev=0x34 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Centrino Wireless-N 130'
    class      = network
    bar   [10] = type Memory, range 64, base 0xf0500000, size 8192, enabled
re0@pci0:2:0:0: class=0x020000 card=0xc597144d chip=0x816810ec rev=0x06 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168B PCI Express Gigabit Ethernet controller'
    class      = network
    subclass   = ethernet
    bar   [10] = type I/O Port, range 32, base 0x2000, size 256, enabled
    bar   [18] = type Prefetchable Memory, range 64, base 0xf0404000, size 4096, enabled
    bar   [20] = type Prefetchable Memory, range 64, base 0xf0400000, size 16384, enabled
```


----------



## jopeto (Jun 27, 2012)

OK, I think I'm getting closer...

I followed post #152 in the following thread:
http://forums.freebsd.org/showthread.php?t=21852&page=7
and ran

```
# kldload i915kms
```
My screen did indeed go black, however I tried starting X blindly (just typing "startx" and pressing return) but nothing happened. I guess the problem is that I don't have the "new xorg" so I decided to follow the procedure in post #162 of the same thread and ran

```
# portmaster x11/xorg
```
I got the following error:

```
===>   py32-libxml2-2.7.8_1 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of textproc/py-libxml2
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** [check-already-installed] Error code 1

Stop in /usr/ports/textproc/py-libxml2.
*** [build-depends] Error code 1

Stop in /usr/ports/graphics/dri.

===>>> make failed for graphics/dri
===>>> Aborting update

===>>> Update for dri-7.4.4,2 failed
===>>> Aborting update

Terminated
===>>> The following actions were performed:
        Upgrade of libtool-2.4_1 to libtool-2.4.2
        Upgrade of libiconv-1.13.1_1 to libiconv-1.14
        Upgrade of libxml2-2.7.8_1 to libxml2-2.7.8_3
        Installation of textproc/py-libxml2 (py32-libxml2-2.7.8_1)
```

I tried a couple of things:

1. Ran

```
$ sudo pkg_delete -f py27-libxml2-2.7.8_1
```

2. Ran

```
$ cd /usr/ports/textproc/py-libxml2
$ sudo make deinstall
$ sudo make FORCE_PKG_REGISTER install
```

3. Ran

```
$ cd /usr/ports/textproc/py-libxml2
$ sudo make deinstall
$ sudo make reinstall
```

4. Set

```
setenv FORCE_PKG_REGISTER 1
```

But in all cases I end up with the same error. One thing to note is that in all cases when I try uninstalling, I get some messages about some files not existing. For example:

```
$ sudo pkg_delete -f py27-libxml2-2.7.8_1
pkg_delete: package 'py27-libxml2-2.7.8_1' is required by these other packages
and may not be deinstalled (but I'll delete it anyway):
gnome-doc-utils-0.20.3
gedit-2.30.4_1
policykit-gnome-0.9.2_5
gnome-mount-0.8_9
gvfs-1.6.6_1
Thunar-1.2.3
gimp-app-2.6.11_5,1
gimp-gutenprint-5.2.7
gimp-2.6.11,2
pkg_delete: file '/usr/local/share/doc/py-libxml2/TODO' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/attribs.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/build.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/compareNodes.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/ctxterror.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/cutnpaste.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/dtdvalid.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/error.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/inbuf.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/indexes.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/invalid.xml' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/nsdel.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/outbuf.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/push.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/pushSAX.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/pushSAXhtml.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/reader.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/reader2.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/reader3.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/reader4.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/reader5.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/reader6.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/reader7.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/reader8.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/readererr.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/readernext.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/regexp.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/relaxng.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/resolver.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/schema.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/serialize.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/sync.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/test.dtd' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/thread2.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/tst.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/tst.xml' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/tstLastError.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/tstURI.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/tstmem.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/tstxpath.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/valid.xml' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/validDTD.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/validRNG.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/validSchemas.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/validate.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/walker.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/xpath.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/xpathext.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/xpathleak.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/xpathns.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2/xpathret.py' doesn't exist
pkg_delete: file '/usr/local/share/examples/py-libxml2' doesn't exist
pkg_delete: unable to completely remove directory '/usr/local/share/examples/py-libxml2'
pkg_delete: file '/usr/local/share/doc/py-libxml2' doesn't exist
pkg_delete: unable to completely remove directory '/usr/local/share/doc/py-libxml2'
pkg_delete: couldn't entirely delete package `py27-libxml2-2.7.8_1'
(perhaps the packing list is incorrectly specified?)
```

Can someone give a suggestion how to cope with that problem?

Since, this thread became quite long and the essence of the problem changed, I will create and new thread about this, since it's doubtful anyone will read this one to the end.


----------



## jopeto (Jun 27, 2012)

New post with the problem regarding the installation of x11/xorg posted here:
http://forums.freebsd.org/showthread.php?t=33026


----------



## jopeto (Jun 28, 2012)

OK, making some progress...

I managed to install x11/xorg and after running [cmd=]X -configure[/cmd] I got a few errors. So I deinstalled and reinstalled x11-drivers/xf86-video-intel and x11-drivers/xf86-video-openchrome. After which I ran `X -configure` again. It gave some errors about the number of devices not matching the number of found devices, so I opened the /root/xorg.conf.new and discovered that for some reason there are two screens found. So I manually deleted the second one.

Now I have the following problem. I can start X only as root (the screen resolution works beautifully). However I cannot start X as a regular user and I cannot start fvwm. Any ideas?


----------



## jopeto (Jun 29, 2012)

Finally success!

I started from scratch and followed post #162 in this thread: http://forums.freebsd.org/showthread.php?t=21852&page=7

However, upon completion, it turned out that x11-drivers/xf86-video-intel had not installed, so I had to install it additionally. Afterwards I ran [cmd=]X -configure[/cmd] and the generated xorg.conf.new file contained two screens again for some reason. I deleted the second screen and placed the file in /etc/X11/xorg.conf.

Now the resolution 1366x768 works fine. I still have to see if there will be heating problems.


----------



## jopeto (Jun 30, 2012)

*laptop overheating*

Unfortunately after completing the procedure, I started registering abnormally high temperature*s* during regular computer operation (post #23 http://forums.freebsd.org/showthread.php?p=182391#post182391). This coupled with the design of the laptop where the power and LAN jacks are right on top of the fan turns the whole thing into a fire hazard, So I guess that means no FreeBSD on that laptop for now until the KMS patch becomes more mature.


----------



## jzac (Aug 4, 2012)

Thanks a lot for the info. Your posts saved quite a lot of time. I guess i too will wait till KMS patch matures.


----------

