# Wrong screen resolution - how to fix



## avd238 (May 2, 2013)

Hi,

After having installed FreeBSD 9.1 on Fujitsu Lifebook A series, I proceeded to install Xorg, Xdm and Xfce4 (following the easy instructions from the Handbook). The resolution seems to be a problem. The maximum it allows me to set is 1024x768 while this display is capable of 1366x768. If someone could point me in the right direction.

Thanks!

PS Just in case IÂ´m posting here a part of /var/log/Xorg.0.log:


```
(II) VESA(0): VESA BIOS detected
(II) VESA(0): VESA VBE Version 3.0
(II) VESA(0): VESA VBE Total Mem: 65472 kB
(II) VESA(0): VESA VBE OEM: Intel(R)Sandybridge Mobile Graphics Chipset Accelera
ted VGA BIOS
(II) VESA(0): VESA VBE OEM Software Rev: 1.0
(II) VESA(0): VESA VBE OEM Vendor: Intel Corporation
(II) VESA(0): VESA VBE OEM Product: Intel(R)Sandybridge Mobile Graphics Controll
er
(II) VESA(0): VESA VBE OEM Product Rev: Hardware Version 0.0
(II) VESA(0): virtual address = 0x804e00000,
...
(==) VESA(0): Write-combining range (0x0,0x1000) was already clear
(II) VESA(0): Setting up VESA Mode 0x118 (1024x768)
```


----------



## SirDice (May 3, 2013)

Find out what graphics card the laptop has. It's currently using a generic vesa driver which isn't very good.


----------



## avd238 (May 4, 2013)

If I understand it correctly, according to `lspci` run from Linux, it is

VGA compatible controller: Intel 2nd Generation Core Processor Integrated Graphics Controller (rev 09)


----------



## fonz (May 4, 2013)

avd238 said:
			
		

> VGA compatible controller: Intel 2nd Generation Core Processor Integrated Graphics Controller (rev 09)


You'll probably want to try the intel driver for that: x11-drivers/xf86-video-intel.


----------



## wblock@ (May 4, 2013)

...which will need KMS.  See http://forums.freebsd.org/showthread.php?p=206841#post206841.


----------



## Beastie (May 4, 2013)

A Sandy Bridge being considered as a second generation Intel GPU... That's an interesting one!


----------



## avd238 (May 6, 2013)

Thank you. I will try installing the proper driver. Hope this can be done from the FreeBSD DVD.


----------



## avd238 (May 19, 2013)

*still no right resolution*

Sorry for delay - have been resolving my Internet issues...

Anyway, I did as prescribed above and generated the xorg.conf file. Its Device section looks like this:

```
Identifier  "Card0"
        Driver      "vesa"
        VendorName  "Intel Corporation"
        BoardName   "2nd Generation Core Processor Family Integrated Graphics Controller"
```
It seemed to recognize the video chip okay but the driver is still vesa and as a result it does not give me any resolution higher than 1024x768. Should I manually change it to something else?

Thanks


----------



## wblock@ (May 21, 2013)

Did you set up KMS as shown above?


----------



## avd238 (May 22, 2013)

Everything aside from the last part:



> Rebuild any other ports that have new versions.



I'm not quite sure about this. Most of the packages were installed straight in binary format using `pkg_add` (including xorg). 

Should I rebuild everything listed under `pkg_info`? Thanks.


----------



## wblock@ (May 22, 2013)

Sorry, I don't know if packages will work for enabling KMS.


----------



## jozze (Jun 14, 2013)

Well, you can always try setting the driver manually (just replace "vesa" with "intel", at least that's what I think the driver name is). xorg sometimes makes a wrong guess when creating the config file, and you have to fix that manually.

If it doesn't work, well, then just rebuild the ports. It will take a while though (maybe around 6 hours, maybe less, depends on what you have installed).

Firstly, if you don't have the ports tree on your hard drive, download it, with `# portsnap fetch extract`. After that, you'll have to rebuild ports along with all dependencies. The fastest way it would be to use ports-mgmt/portmaster, since you probably don't want other unnecessary ports.


```
# make -DBATCH -C /usr/ports/ports-mgmt/portmaster install clean
# portmaster -R -m -DBATCH /usr/ports/x11/xorg
```

The first command installs ports-mgmt/portmaster, and the 2nd one rebuilds all ports, that xorg depends on, without prompting for build-time configuration (so you'll use the default configuration, which is the one used for packages).

After that, you can delete portmaster as well as the ports tree under /usr/ports. Like @wblock@ said, I'm not really sure if such configuration is possible for packages, as they have a most generic configuration.


----------

