LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   [How-to]Alternative way to set up Xorg for modern graphics cards. (https://www.linuxquestions.org/questions/linux-from-scratch-13/%5Bhow-to%5Dalternative-way-to-set-up-xorg-for-modern-graphics-cards-4175577962/)

ReaperX7 04-20-2016 04:28 PM

[How-to]Alternative way to set up Xorg for modern graphics cards.
 
As a follow up to the guide I wrote a while back, I figured I'd share this new guide with you all as it targets newer and more simplified methods of setting up X using the default modesetting driver.

1. Why use the modesetting driver?

The modesetting driver really has no stumbling blocks as the DDX drivers do. In short, one driver simply can pass off instructions to the glamoregl driver which in turn loads Mesa as the rendering agent. There's no fiddling with complicated acceleration methods that may or may not work, and the configuration is fairly simplistic.

2. Will my graphics card be supported?

If your graphics card is already supported in Mesa, then you have nothing to worry about. Modesetting differs from the DDX drivers by using the EGL stack to perform accelerated video draws rather than the xrender methods. However, some modern graphics cards that may not yet have acceleration in DDX drivers, may have support in Mesa using known rendering agents. This means graphics cards like AMD's R* series, Nvidia's Maxwell cards, and Intel latest offerings should have already exposed abilities in Mesa.

3. Will any graphics card work in modesetting?

Not exactly. You will have to have a driver that in the kernel has a KMS driver and support in Mesa for accelerated OpenGL graphics. Unfortunately, this will leave many older cards off the list of DRI1 series drivers. It's not tested, but if you can get mesa-7.11.2 to build with egl and opengl es support enabled, and the kernel video drivers have kms support, there is a chance you might get support, but this is untested. You will otherwise get support through the llvmpipe driver.

The currently supported list in Mesa is as follows:
Code:

i915
i965
ilo
llvmpipe
nouveau
r200
r300
r600
radeon
radeonsi
swrast
svga

The ilo driver is Intel's experimental Gallium driver from LunarG. This driver is fairly new but is already getting lots of testing.

Note: Due to the nature of modesetting, newer Intel graphics that might not have proper support under i915 or i965 may get support through ilo, so make sure ilo is in the list of Gallium drivers supported when you build and install Mesa.

4. How to I enable this driver? My card is automatically loaded through the auto-detected method, and it's loading the DDX driver.

Create a file in /etc/X11/xorg.conf.d with the name 11-modesetting.conf and enter the following:

Code:

Section "Device"
        Identifier "name of your graphics card here"
        Driver "modesetting"
        Option "SWCursor" "boolean"
        Option "kmsdev" "/dev/dri/card0"
        Option "ShadowFB" "boolean"
        Option "AccelMethod" "glamor"
        Option "PageFlip" "boolean"
        Option "ZaphodHeads" "Your specific video ports like DVI-I-1, VGA-1, and HDMI-1"
EndSection

You should refer to modesetting's manpage with man modesetting for details on how to set this up. The boolean entries are for true or false to enable/disable a feature. The only actual things you will want to enter are your outputs under ZaphodHeads and the name of your graphics card. I recommend you keep SWCursor and ShadowFB disabled by default.

Example: My ZaphodHeads on my GeForce GTX 460 are listed as "DVI-I-1,DVI-I-2,HDMI-1"

5. What about input devices?

The xf86-input-evdev and xf86-input-libinput drivers should normally load as needed.

If needed you can create a file such as 20-input.conf in /etc/X11/xorg.conf.d:

Code:

Section "InputDevice"
  Identifier "Device name here"
  Driver "evdev or libinput"
  Option "Device" "device path in /dev"
EndSection

Refer to the manpages for libinput and evdev for further explainations.

Note: If Xfce is built with support for xf86-input-libinput, libinput will be automatically loaded by Xfce.

This should greatly reduce any problems of setting up Xorg.

Emerson 04-20-2016 04:50 PM

What about MPEG-2 and MPEG-4 hardware decoding.

ReaperX7 04-21-2016 08:30 AM

Libvdpau-va-gl will be needed for Intel based chips and libvdpau will be needed for AMD and Nvidia. As long as you have Direct Rendering enabled, which glamoregl should allow for modern graphics chips, you should get the appropriate acceleration when X is used.

You will need to set a system or user environment variable:

Code:

export VDPAU_DRIVER=
to the appropriate driver in /usr/lib/vdpau. Intel based cards should use va_gl while Nvidia and AMD should use the driver for the card series supported.

Edit:

One thing I'd like to get is feedback on this from other users in the form of logs and readouts.

If you have success with this method please post the output from the following commands as an attached text file:

Code:

lspci
cat /var/log/Xorg.0.log
glxinfo

I would like to get feedback especially from Intel graphics users, Nvidia Maxwell, and Radeon R series.

ReaperX7 04-26-2016 06:22 PM

6. What about Intel's DDX drivers using "sna"?

Intel supports various methods of acceleration in it's DDX drivers. UXA and SNA being the most modern of the listed. However, UXA is reported to be slow with some graphics while SNA is faster but also buggy mess that can crash things.

See what I mean by DDX drivers being a mess? Rather than fallback on this mess, just go with the EGL stack. You can get comparable acceleration via glamor that is near SNA levels, just less buggy, especially with troublesome graphics like those with Skylake CPUs that are just barely getting decent support in the git pulls of the DDX drivers. Glamor already has exposed Intel accelerated protocols through Mesa, so why bother with a DDX driver that may or may not work?

7. Do I need to install firmware?

Yes you will need firmware for EGL to load. If you downloaded the entire Linux-Firmware git repository, simply enter the directory and issue make install and reboot the machine.

ReaperX7 05-28-2016 11:08 AM

Update:

The current list of drivers is lightly expanded to include:

Code:

i915
i965
ilo
llvmpipe
nouveau
r200
r300
r600
radeon
radeonsi
swrast
svga
virgl

Virgl is the new Virgil 3D driver for QEmu. It is supposed to act as a new driver to allow host GPU acceleration capability in a VM while remaining independent.

Take note that Mesa has support for two additional drivers: freedreno and vc4 however the use of these drivers is more experimental and more limited to embedded platforms, such as Raspberry Pi and others.

Code:

vc4 - Broadcom VC4
freedreno - Adreno Series

You should only build these drivers as needed. Freedreno will require support enabled in the kernel, building and installing xf86-video-freedreno, and built into libdrm. Broadcom VC4 is supported through Modesetting.

ReaperX7 06-18-2016 08:53 PM

8. Modesetting didn't work. It just didn't load.

Many older graphics chips unfortunately won't work with modesetting due to the fact that they lack 128 address registers on the chip. Many older chips like the Intel(R) 945GM only contain a 64 address register space. For these types of cards you will unfortunately need the DDX driver. You can still get optimal performance but the older method.

If you need to setup the DDX driver, use the manual pages to check options to create your 11-<name of driver>.conf to get the most out of it. I also recommend installing the xf86-video-fbdev driver as a fallback for any issues.

sparkybulbul 09-03-2016 07:33 PM

Mesa driver for Broadcom VC4.
https://github.com/anholt/mesa/wiki/VC4


All times are GMT -5. The time now is 12:27 PM.