# Graphic support on Thinkpad E470



## Anti_Evil (Dec 7, 2017)

I've got a Thinkpad E470 laptop and I just installed the latest FreeBSD 12.0-CURRENT snapshot on it. I'd like to bring up the Windowing environment like KDE4 on it. So I've started to configure Xorg config files.

So, basically this laptop has two graphic cards (hybrid): Intel and Nvidia. (I couldnt find any option in BIOS to turn of the Nvidia card). and based on pciconf output I can tell that Intel card BusID is PCI:0:2:0 (Model: Intel HD Graphics 620)

So, what i did was :
1) adding i915kms kernel module to loader.conf
2) installing drm-next-kmod package
3) installing xorg-server package
4) installing xf86-video-intel package

and then:
1) Xorg -configure (to give me the initial file)
2) I've edited the xorg.conf and remove the secondary (nvidia) device from it
3) created driver-intel.conf and driver-scfb.conf in /etc/X11/xorg.conf.d/ with appropriate format 

and just ran series of test on device Driver part (in xorg.conf file), vesa, scfb, ..
But all failed.

when I check Xorg.0.log file, I see modules and drivers are getting loaded succesfuly but at the end it says: 
(WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
(EE) Screen 0 deleted because of no matching config section.
(EE) no screen found(EE)

Has anybody brought up graphic interface on Thinkpad E470 that could share X config with me ?
How can i resolve this issue ?


----------



## Anti_Evil (Dec 7, 2017)

dmesg:
https://pastebin.com/YBs9BpQb

kldstat:
https://pastebin.com/SUHiqi2F

pciconf:
https://pastebin.com/7C61j009

devinfo:
https://pastebin.com/sHrraiuF

pkg info:
https://pastebin.com/4uEj2hLq

/etc/X11/xorg.conf:
https://pastebin.com/ADYvPExJ

/etc/X11/xorg.conf.d/driver-intel.conf:
https://pastebin.com/qbGBufvt

/etc/X11/xorg.conf.d/driver-scfb.conf:
https://pastebin.com/cERFk2dM

/var/log/Xorg.0.log
https://pastebin.com/EcgTCxpc


----------



## scottro (Dec 7, 2017)

I have a page on the procedure that's worked for me with a later Intel card at http://srobb.net/freebsdintel.html

You shouldn't need to install the Intel driver  and you may have to compile the drm-next-kmod from ports which also means you'll have to check out the source.  It's all described in the link above.


----------



## SirDice (Dec 7, 2017)

Anti_Evil said:


> I've got a Thinkpad E470 laptop and I just installed the latest FreeBSD 12.0-CURRENT snapshot on it.


Topics about unsupported FreeBSD versions


----------



## Anti_Evil (Dec 7, 2017)

scottro said:


> I have a page on the procedure that's worked for me with a later Intel card at http://srobb.net/freebsdintel.html
> 
> You shouldn't need to install the Intel driver  and you may have to compile the drm-next-kmod from ports which also means you'll have to check out the source.  It's all described in the link above.



Thanks alot for reply!
I just read the blog post, very well written and useful 

Ok then, I'm going to remove xf86 drivers for intel. please correct if i'm wrong here, but you suggest to not install drm-next from pre-compile pkg (FreeBSD packaging), but instead I've to compile it from the ports. right ?

About rest of instructions I've actually did the same, like adding i915kms in kld_list (rc.conf) and assigning video group to local user. Please let me know i missed something here.

I just have one request and one question.
As far as the Intel video is Intel HD Graphics 620, are we certain that the driver works on it ? the intel process generation is Kaby Lake.
And could you please share your xorg.conf and related files to me.


----------



## Anti_Evil (Dec 7, 2017)

SirDice said:


> Topics about unsupported FreeBSD versions


Thank you SirDice for the hint, actually the reason that I stuck with -CURRENT version is that, 12.0-CURRENT supposed to support newer Intel chips (Kaby Lake).


----------



## T-Daemon (Dec 7, 2017)

Anti_Evil said:


> ...
> Ok then, I'm going to remove xf86 drivers for intel. please correct if i'm wrong here, but you suggest to not install drm-next from pre-compile pkg (FreeBSD packaging), but instead I've to compile it from the ports. right ?
> ...
> As far as the Intel video is Intel HD Graphics 620, are we certain that the driver works on it ? the intel process generation is Kaby Lake.
> And could you please share your xorg.conf and related files to me.


You can try the graphics/drm-next-kmod package first, if that gives you errors take the port.

Here are some users confirming Kaby Lake graphics will work with 12-CURRENT (May 2017).

According to the OP in the thread, there is no need for custom xorg configuration files:
https://lists.freebsd.org/pipermail/freebsd-x11/2017-May/019428.html .


----------



## Anti_Evil (Dec 8, 2017)

Thank you scottro, T-Daemon, 
So Building the drm-next from ports resolved the issue 
I've already installed my favorite windowing environment and it just working fine, I donno how to put it, but it just seems frame refresh time is abit high comparing to my old desktop. I think it is because I've used 'vesa' driver. I've tried modesetting but no luck. Do I have other options ?

ps: I'm quite happy with current situation , but just wanted to make sure if I could improve it. Thanks again


----------



## scottro (Dec 8, 2017)

Aren't you using drm-next rather than vesa? I don't test it a lot, so I can't really help.  Watching videos on it seems to be about the same as Linux, the only thing I find is that sometimes the mouse seems a bit slower.
Mostly, I use terminals, a browser and possibly mpv to play things.


----------



## Anti_Evil (Dec 8, 2017)

It is my current /etc/X11/xorg.conf :


```
Section "Device"
        Identifier  "Card0"
        Driver      "vesa"
        BusID       "PCI:0:2:0"
EndSection
```

Should i just change 'vesa' to 'drm-next' ?
Could you share your xorg.conf to me ?

Thanks alot.


----------



## T-Daemon (Dec 9, 2017)

Hi Anti_Evil. The X server is designed to work out of the box, there is no need to create a xorg.conf file, unless auto-configuration doesn’t work, it can even prevent proper operation. By loading the kernel module i915kms.ko (drm-next), X server is using the “intel” driver automatically. 


Setting “vesa” or something else as driver in xorg.conf forces Xorg to use that driver, with, possibly, a  suboptimal X experience. You should remove any video card driver configuration files. 
Also, configuration for Xorg is done by multiple files rather than with xorg.conf. More on this topic and examples: Handbook, Xorg Configuration

As a side note, it’s not vital, but it would be useful to know, in FreeBSD the configuration files for the operating system and application files are kept separate. Operating system configuration files and scripts in /etc, application files in /usr/local/etc. The recommended place for the Xorg configuration would be /usr/local/etc/X11/xorg.conf.d. More info about the layout of the file system: hier().


----------



## dragon321 (Dec 11, 2017)

Can somebody tell me if Intel Skylake Graphics (HD 520) working on FreeBSD 12-CURRENT? I compiled graphics/drm-next-kmod, created /usr/local/etc/X11/xorg.conf.d/driver-intel.conf with same configuration as author, add: 
	
	



```
i915kms_load="YES"
```
 to /boot/loader.conf, but when I try to start Xorg it not starting with error "no devices detected". I don't know why, according to:
https://wiki.freebsd.org/Graphics#Intel_Graphics

Skylake GPU should be supported. Can somebody with Intel Skylake GPU confirm that this GPU is working on 12-CURRENT?

PS: When I change Driver in driver-intel.conf from "intel" to "scfb" Xorg starting works without problems. But with scfb I can forget about acceleration.


----------



## scottro (Dec 11, 2017)

The wiki tends to be out of date. My page, the http://srobb.net/freebsdintel.html gives instructions, with slightly different syntax, to put the i915 line in /etc/rc.conf


----------



## dragon321 (Dec 13, 2017)

scottro It's working now. Thank You very much.


----------



## scottro (Dec 13, 2017)

Great, glad to hear it. Right now, CURRENT is working quite well on my Yoga2.  (Haswell ULT 4000, I believe--despite what I've been reading about Haswell being supported in 11.x, I can't get 11.x working on that machine).


----------



## ankscorek (Dec 16, 2017)

T-Daemon said:


> You can try the graphics/drm-next-kmod package first, if that gives you errors take the port.




```
# pkg install drm-next-kmod
Updating Synth repository catalogue...
Synth repository is up to date.
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'drm-next-kmod' have been found in the repositories
```


```
# uname -a
FreeBSD noname.noname.edu 11.1-RELEASE-p4 FreeBSD 11.1-RELEASE-p4 #0: Tue Nov 14 06:05:10 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386
```

xorg log snippet

```
(EE) 15: /usr/local/lib/xorg/modules/drivers/intel_drv.so (ignore+0x3d4f) [0x28f124fe]
```

After today's upgrade the screen resolution is 1024x768
How to come out of this?


----------



## Anti_Evil (Dec 16, 2017)

T-Daemon said:


> Hi Anti_Evil. The X server is designed to work out of the box, there is no need to create a xorg.conf file, unless auto-configuration doesn’t work, it can even prevent proper operation. By loading the kernel module i915kms.ko (drm-next), X server is using the “intel” driver automatically.
> 
> 
> Setting “vesa” or something else as driver in xorg.conf forces Xorg to use that driver, with, possibly, a  suboptimal X experience. You should remove any video card driver configuration files.
> ...



Thanks for feedback, 
Well I just removed xorg.conf to let i915kms kernel module loads intel driver automatically. But it didnt worked. I suppose there is alot of open issues with Kaby Lake processors. For now i just stick to vesa driver ..


----------



## scottro (Dec 16, 2017)

You have to use CURRENT to get most laptops less than 3-4 years old to work.  I have a little page on it, though it's based on my experience with 1 machine, at http://srobb.net/freebsdintel.html
Note that there are good reasons not to use CURRENT in production and discussing it is discouraged here, but practically speaking that also discourages discussion of FreeBSD on laptops built after 2013 or so.  

The drm-next-kmod only, at present, works with CURRENT, not with 11.x


----------



## ankscorek (Dec 17, 2017)

when is the intel support likely to return to 11.1

alternatively how to get optimal resolution using vesa drivers!?


----------



## abishai (Dec 18, 2017)

You can't get optimal resolution with vesa drivers. However, you can try x11-drivers/xf86-video-scfb if you use UEFI.


----------



## ankscorek (Dec 19, 2017)

this didnt help

output from linux of screen resolution supported by the machine


```
1366x768      59.86*+
   1280x1024     75.02    60.02
   1152x864      75.00
   1024x768      75.03    70.07    60.00
   832x624       74.55
   800x600       72.19    75.00    60.32    56.25
   640x480       75.00    72.81    66.67    59.94
   720x400       70.08
```

The vesa buffer is giving 1024x768 as normal user and 1152x864 as *CharlieRoot*


----------



## ankscorek (Jan 24, 2018)

any suggestions?


----------

