Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What is an Xorg driver? Which one?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Mon Jan 18, 2021 12:50 am    Post subject: What is an Xorg driver? Which one? Reply with quote

Today I'm trying to manually configure Xorg (/etc/X11/xorg.conf).
I'm confused about a couple of general aspects about X.
I hope that someone will be able to answer a couple of questions.

My Intel iGPU needs a kernel driver (built in the kernel), a firmware blob (built in the kernel), and a Xorg driver (probably xf86-video-intel).
How do these three things work togheter?
And why can't I put the Intel driver as module, without an initramfs?

Also, I have not understood which Xorg drivers should I install.
Are in general the specific drivers like xf86-input-elographics more reliable than generic evdev?

I read here on the forum that the wiki might be outdated about Intel drivers.
With a modern Intel GPU I ended up setting the following package.use
Is this correct for optimal performance?
Code:
x11-base/xorg-drivers VIDEO_CARDS: intel
media-libs/mesa -llvm VIDEO_CARDS: i965 iris


As always I made a lot of questions.

Thanks very much for your time,
Leonardo
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1303
Location: EU or US

PostPosted: Mon Jan 18, 2021 3:23 am    Post subject: Reply with quote

Do you know what device nodes are? Here is some easy reading: https://unix.stackexchange.com/questions/241173/how-are-dev-linux-files-created

Kernel driver creates this node for your GPU, /dev/dri/card0 (this is the first card, second would be card1, third card2). Nothing can access hardware directly, everything goes thru kernel. Without this node Xorg cannot access your GPU. Xorg driver uses this node to do the actual work and render the picture to your screen.

To my knowledge with Intel the firmware is optional, you get picture without firmware, but some features will be missing.

You do not need initramfs if you build firmware into kernel.

With Intel graphics you can use Xorg intel driver or Xorg modesetting driver. Latter is always built with Xorg, you do not have to set any variables to get it.

You are not supposed to install any Xorg drivers by hand, you set VIDEO_CARDS and INPUT_DEVICES variables in make.conf and the drivers will be pulled in by emerge.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3635

PostPosted: Mon Jan 18, 2021 7:56 am    Post subject: Reply with quote

Buffoon wrote:
[...] and INPUT_DEVICES variables in make.conf and the drivers will be pulled in by emerge.

Even INPUT_DEVICES would not need to be set explicitly as it defaults to libinput.
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 569
Location: Bavaria

PostPosted: Mon Jan 18, 2021 12:05 pm    Post subject: Re: What is an Xorg driver? Which one? Reply with quote

Leonardo.b wrote:
Is this correct for optimal performance?

I have an Intel i7-6700 (skylake) and tried the standard intel driver and the deprecated xf86-video-intel (see more: https://wiki.gentoo.org/wiki/Intel#Intel_DDX). This one is really faster and has a lower cpu utilisation when watching a 4k video than the standard. So - with a plasma-desktop profile - my make.conf for this is (excerpt):
Code:
VIDEO_CARDS="intel i965 iris"
[...]
# xf86-video-intel
USE="$USE sna uxa vaapi xvmc"

In the wiki-page you will see you must also activate it with "/etc/X11/xorg.conf.d/20-modesetting.conf" =>
Code:
Section "Device"
    Identifier  "Intel Graphics"
    Driver      "intel"
    Option      "AccelMethod"    "sna"

After this just do an "emerge -uNDv @world"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47626
Location: 56N 3W

PostPosted: Mon Jan 18, 2021 1:31 pm    Post subject: Reply with quote

Leonardo.b,

The video driver for almost all systems is in two or more pieces.
There is the kernel part, which will give you a framebuffer console at no extra change.
Then there is the userspace part.

For Intel chipsets that are a choice of kernel bits and userspace bits. You need all the right bits for your chipset.
To add to the interest, some Intel chipsets need firnware too.

Please post your
Code:
lspci -nnk
and put your dmesg and kernel .config onto pastebins.
That will show what you need, what you have and what you have missing.

You do not need any xorg.cong to get started. The automatics will work alone but you get a right handed mouse and a USA QWERTY keymap.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Mon Jan 18, 2021 3:37 pm    Post subject: Reply with quote

Ok, so the kernel handles all the hardware, while the Xorg drivers translate from the Xorg language to the kernel language. For this reason I can get a console without any additional software, but I need a driver for the keyboard on X
Is it correct?
Or does the userpace talk directly with the hardware?

This evening I'll go down the man pages for the details.

NeddySeagoon,
With libinput everything works, but I want to avoid catch-all solutions where possible.
If you don't mind, I'll try to configure it first, and then I'll post what you asked.


Leonardo
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1303
Location: EU or US

PostPosted: Mon Jan 18, 2021 3:48 pm    Post subject: Reply with quote

Buffoon wrote:
Nothing can access hardware directly, everything goes thru kernel.

Leonardo.b wrote:
Or does the userpace talk directly with the hardware?

OK, there are special cases when kernel allows userspace limited access to hardware, it is called IOMMU and is used to give virtual machines exclusive access to a piece of hardware.
Back to top
View user's profile Send private message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Mon Jan 18, 2021 4:20 pm    Post subject: Reply with quote

Good. I was confused because I didn't see the difference between kernel modules and Xorg drivers.
Thanks for the clarification.


Last edited by Leonardo.b on Tue Jan 19, 2021 12:38 am; edited 1 time in total
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 569
Location: Bavaria

PostPosted: Mon Jan 18, 2021 4:46 pm    Post subject: Reply with quote

Buffoon wrote:
[...] it is called IOMMU and is used to give virtual machines exclusive access to a piece of hardware.

... and it is needed to protect against low level I/O-attacks and therefore I highly recommend to configure iommu in the kernel (even without using a virtual machine).
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47626
Location: 56N 3W

PostPosted: Mon Jan 18, 2021 4:58 pm    Post subject: Reply with quote

Leonardo.b,

Configuring Xorg is only needed for fine tuning. Its operational, maybe suboptimally, with no configuration at all.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 569
Location: Bavaria

PostPosted: Mon Jan 18, 2021 6:03 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Configuring Xorg is only needed for fine tuning. Its operational, maybe suboptimally, with no configuration at all.

This is true for all users having an en- or us-keyboard. All others must at least do this:

Setting a keyboard ... but this is not so easy for a beginner because:

1. https://wiki.gentoo.org/wiki/Localization/Guide#Keyboard_layout_for_the_X_server links to:

2a. old and deprecated: https://wiki.gentoo.org/wiki/Xorg/Guide#Configuring_the_keyboard and
2b. old and deprecated: https://wiki.gentoo.org/wiki/Keyboard_layout_switching#X11

because this is also deprecated:

(https://wiki.gentoo.org/wiki/Evdev#Keyboard_layout)

The only correct link is:

https://wiki.gentoo.org/wiki/Libinput

but there is no example of setting the keyboard, so you have to link up all pages to get this result:
Code:
cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/

and edit this file for example like this:
Code:
Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "xkb_layout" "de"
EndSection
Back to top
View user's profile Send private message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Tue Jan 19, 2021 12:32 am    Post subject: Reply with quote

Ok, I read the manpages for X and related. They are poor and I had to search for extra documentation online.
A good index avaiable with info would have been beautiful... bad luck, I didn't find it, and I don't need it anymore.
Anyway the subject is popular and the documentation doesn't miss. I should be able to walk by myself now.
As always, I thanks all you for all the advices.

Also, another question.
It seems that the only benefit in libinput is to be easy to configure.
I am moving away from it and trying the deprecated alternatives.
Am I doing a good deal?

pietinger,
do we need vaapi xvmc USE flags?
Portage complains to me saying that they are useless without a raedon or noveau card.
The advice about xf86-video-intel seems right; modesetting was slow and buggy.

NeddySeagoon;
I'm quite sure that I want a full xorg.conf because the automatic makes an horrible jobs since when I replaced udev with a static /dev, following your example.
But that's for another time, and for "Unsupported Software".


Leonardo
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 569
Location: Bavaria

PostPosted: Tue Jan 19, 2021 1:43 am    Post subject: Reply with quote

Leonardo.b wrote:
do we need vaapi xvmc USE flags?

Yes. On my system I have: mesa and xine-lib uses both flags; ffmpeg and vlc uses vaapi; xf86-video-intel offers xvmc only when set.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2993
Location: Canada

PostPosted: Tue Jan 19, 2021 6:19 am    Post subject: Re: What is an Xorg driver? Which one? Reply with quote

Leonardo.b wrote:
Today I'm trying to manually configure Xorg (/etc/X11/xorg.conf).
I'm confused about a couple of general aspects about X.
I hope that someone will be able to answer a couple of questions.

My Intel iGPU needs a kernel driver (built in the kernel), a firmware blob (built in the kernel), and a Xorg driver (probably xf86-video-intel).
How do these three things work togheter?
And why can't I put the Intel driver as module, without an initramfs?

Also, I have not understood which Xorg drivers should I install.
Are in general the specific drivers like xf86-input-elographics more reliable than generic evdev?

I read here on the forum that the wiki might be outdated about Intel drivers.
With a modern Intel GPU I ended up setting the following package.use
Is this correct for optimal performance?
Code:
x11-base/xorg-drivers VIDEO_CARDS: intel
media-libs/mesa -llvm VIDEO_CARDS: i965 iris


As always I made a lot of questions.

Thanks very much for your time,
Leonardo



It is pretty convoluted on the user side for intel drivers. Basically you have 3 options of a reasonably new chipset set by VIDEO_CARDS, namely i965, intel, and iris
To have working setup, you need at least one of them.

However these options set USE flags in different pieces of software. Among them only 'intel' installs a separate xf86-video-intel classical (quite optimized but depreciated) standalone drtiver from Intel.
The other are option to xorg-server and/or mesa, since new intel architecture is incorporated there.

I have the following comment in in my make.conf on my laptop

Code:

# Hardware
# VIDEO_CARDS="intel"  - uses chip specific 2D acceleration driver, not installed if i965 is also set.
# VIDEO_CARDS="i965"   - uses Glamor 2D acceleration driver in xorg-server, overwrites intel for xorg-drivers.
# However, for 3D 'intel' can be needed, since this is the only flag recognized by libdrm,
# and is required to be set to use, for example, vaapi.  Thus we set both !
# VIDEO_CARDS="iris" is purely Mesa flag, new 3D driver for Gen8+ intel GPUs that uses Gallium3D
# VIDEO_CARDS="intel i965" for Mesa use 'classic' 3D driver
VIDEO_CARDS="i965 intel iris"


Note that his is all mostly about 2D acceleration - either standalone driver, or Glamor, or doing 2D through Gallium3D.

Note that intel driver will not be installed if i965 is also specified (did not check recently if iris is also exclusive, used to be not).

Note that some VIDEO_CARDS flags may be used for other purposes - as 'intel' is for libdrm

Also note, that setting vaapi USE flag for Mesa will be of no use on intel hardware, it will be ignore, mesa does not have vaapi support for intel. To use vaapi on intel you need
to install a separate x11-libs/libva-intel-driver
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 569
Location: Bavaria

PostPosted: Tue Jan 19, 2021 11:20 am    Post subject: Re: What is an Xorg driver? Which one? Reply with quote

dmpogo wrote:
[...] To use vaapi on intel you need to install a separate x11-libs/libva-intel-driver

Yes, I forgot to mention it ... of course I have it installed. When you emerge "libva-utils" you can check with:
Code:
# vainfo
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib64/va/drivers/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/lib64/va/drivers/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.5.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
[...]

vainfo also tries to use the new iHD driver, which you will get with unstable "x11-libs/libva-intel-media-driver" (I dont recommend for now).
Back to top
View user's profile Send private message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Tue Jan 19, 2021 10:54 pm    Post subject: Reply with quote

It took me some time; here the output you aksed...

lspci -nnk: https://dpaste.com/7HZSC8ZZS.txt
dmesg: https://dpaste.com/DW7DDU5TK.txt
Kernel config: https://dpaste.com/CDAACF7HH.txt

The Intel video card is 8086:3ea0 , the Nvidia one 10de:1d13 .
The touchscreen should be 04F3:23F4 , and the touchpad 06CB:CD4F , but check.
Is there a website like cateee.net for the X drivers?

My xorg.conf is still a work in progress - but at least now the video and the keyboard work.
I'm going to try the suggestions I read in your last two posts.
VIDEO_CARDS variable is a mess.

Leonardo
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47626
Location: 56N 3W

PostPosted: Tue Jan 19, 2021 11:20 pm    Post subject: Reply with quote

Leonardo.b,

Lets go back to the beginning and understand what you want to achieve.

Yours lspci reads like its from a laptop with an Optimus Graphics system.
Optimus is one and a half graphics systems.

The Intel graphics system is complete. It can draw the display into the pixel buffer and paint the pixel buffer onto the display surface.
The nVidia graphics system is only half a graphics system. It can draw the display into the pixel buffer. That's all.

If you do have Optimus, then that places constraints on how things are configured.

Please confirm if you have Optimus or not and if you do, do you want to use the nVidia GPU at all?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Tue Jan 19, 2021 11:26 pm    Post subject: Reply with quote

Oh! I forgot this detail... yes, I have an Nvidia card too.
I have a sticky on the laptop, so I think it's Optimus.

I don't want to use the nvidia card at all.

-- edit
I argument...
I don't want the nVidia binary drivers installed in the kernel, because I don't trust them; while the open source Nouveau is terrible both on performance and power usage, expecially for moderns Pascal cards like the one I own.
The most resource hungry games I run is gnuchess, so I like to keep the nVidia GPU powered off, and save battery life.
That's the most sane solution for me.

Then there is the possibility of installing the drivers, just for playing with them and see what happens.
I keep it for another day.

So I don't want the nvidia card at all.

Leonardo
Back to top
View user's profile Send private message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Mon Jan 25, 2021 4:53 pm    Post subject: Reply with quote

I walk slowly; here what I have now:xorg.conf

I'm sure there is something very wrong since I had to hand copy the link because I can't copy/paste.
But as a general result, X works better than before.
Intel graphics works thanks to your suggestions.
I set the keyboard reading man kbd, that is avaiable with USE="-minimal" in xorg-server.

I think I should leave here a couple of links to some pages I found useful meanwhile.
I will not do because I can't copy/paste.

Leonardo
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47626
Location: 56N 3W

PostPosted: Mon Jan 25, 2021 5:08 pm    Post subject: Reply with quote

Leonardo.b,

Driver "kbd" and Driver "synaptics" are both in the process of being removed.
In fact, kbd has already gone.

Code:
$ eix xorg-drivers
[I] x11-base/xorg-drivers
...
Installed versions:  1.20-r2{tbz2}(15:54:59 16/05/20)(INPUT_DEVICES="-elographics -evdev -joystick -libinput -synaptics -vmmouse -void -wacom"


It still works, I'm using it to post this, but
Code:
x11-drivers/xf86-input-keyboard
has been removed from the ::gentoo repo.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Mon Jan 25, 2021 5:18 pm    Post subject: Reply with quote

I think I have stolen xf86-input-keyboard from your gentoo-static on GitHub.
What's the idea behind removing it?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47626
Location: 56N 3W

PostPosted: Mon Jan 25, 2021 5:54 pm    Post subject: Reply with quote

Leonardo.b,

Heh. :)

Neither x11-drivers/xf86-input-keyboard nor x11-drivers/xf86-input-mouse have been required for many years, having been replaced by x11-drivers/xf86-input-evdev.
x11-drivers/xf86-input-evdev is itself being replaced by libinput now.

The final nail was upstream removing Linux support from x11-drivers/xf86-input-keyboard, so new releases won't work on Linux anyway, without that change being reverted. Gentoo tries to follow upstream and avoid carrying its own patch sets, so for old unused software, there was no point in keeping it.
Well, there are two users but we don't count :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Mon Jan 25, 2021 6:31 pm    Post subject: Reply with quote

Ok, I understand.

Being pratical, is it something I care?
Is there any need to upgrade the keyboard and touchpad drivers?

NeddySeagoon wrote:
Well, there are two users but we don't count :)

No luck, I can't code.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47626
Location: 56N 3W

PostPosted: Mon Jan 25, 2021 6:55 pm    Post subject: Reply with quote

Leonardo.b,

If it works, you don't care until it breaks. Its your Gentoo, your way.
Support will be minimal or even less though.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Leonardo.b
Tux's lil' helper
Tux's lil' helper


Joined: 10 Oct 2020
Posts: 81

PostPosted: Mon Jan 25, 2021 8:07 pm    Post subject: Reply with quote

Okay, that's fine.

Thanks for your time
Leonardo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum