xorg-autoconf 3.0

Core libraries and systems
Message
Author
mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

xorg-autoconf 3.0

#1 Post by mistfire »

This tool auto generate a full xorg.conf file with high accuracy and precision. It properly assign and configure the appropriate xorg driver and its parameter depending on the video card present on the computer. It was written in bash so it can tweak very easily. Requires lspci and lsmod.

The generated xorg.conf file was highly compatible with Puppy xorg utilities

UPDATE: xorg-autoconf is now stable at IBM-PC arch. ARM arch was on experimental stage

Usage:

Code: Select all

xorg-autoconf > /etc/X11/xorg.conf
Attachments
xorg-autoconf-3.0.pet
* Under the hood overhaul
* Improved system detection
(6.13 KiB) Downloaded 191 times
Last edited by mistfire on Sat 30 May 2020, 11:32, edited 21 times in total.

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#2 Post by mistfire »

I made some improvements and bugfix on xorg-autconf. It was uploaded on the first post of this thread

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#3 Post by mistfire »

Some bugfix on xorg-autoconf. The package was uploaded on the first post of this thread

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#4 Post by mistfire »

xorg-autoconf 2.0 released

* Improved handling of powervr-based intel gpu's
* Improved handling of via, amd, and nvidia gpu's
* Additional video card support

Download link was on the first post of this thread

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

#5 Post by mikeslr »

Hi mistfire,

Why, how and when would this be used?

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#6 Post by mistfire »

@mikeslr

l noticed that the original xorg auto detection was lack of finer control it justs loads the driver depending on the vendor of the device also sometimes it fails auto detect the video cards.

Also I noticed Barry's problem on his Intel GMA video card when using modesetting so he was using intel with uxa settings.

So by using this script, its possible to create xorg.conf with good accuracy and precision. Also its possible to have a finer control on generating xorg.conf file.

foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#7 Post by foxpup »

Hi mistfire

And when to use this script?
Anytime? Once or with every reboot?
From the command like xorgwizard?

Isn't this something for woofCE?

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#8 Post by mistfire »

@foxpup you can use it anytime if you want. It was launch from command line. It will just generate the possible contents of xorg.conf on the terminal to apply the configuration just redirect the terminal output to xorg.conf like this

Code: Select all

xorg-autoconf > /etc/X11/xorg.conf
I still make some improvements on the script especially on dealing with radeon video cards that supports amdgpu xorg driver and dealing with a proper modesetting configuration for newer gen intel HD graphics.

foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#9 Post by foxpup »

mistfire wrote:to apply the configuration just redirect the terminal output to xorg.conf like this

Code: Select all

xorg-autoconf > /etc/X11/xorg.conf
... and then reboot or restart X?
I still make some improvements on the script especially on dealing with radeon video cards that supports amdgpu xorg driver and dealing with a proper modesetting configuration for newer gen intel HD graphics.
Why not choose intel with intel gc?
Excuse my ignorance:
In a lot of Puppys, I see with intel gc that the first/automatic choice is often modesetting.
My inclination is then to run xorgwizard and set the intel driver.
Is that a good thing to do? or should I let modesetting? And why modesetting and not intel?

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#10 Post by mistfire »

@foxpup yes you need to restart X

On xorg-autoconf script, if an intel video card was made year 2012 or older. intel driver will be selected otherwise modesetting will be selected if its drm kernel module was loaded.

Major distros abandon intel xorg driver in favor of modesetting ddx for newer intel video card due to uncertainties of development on its upstream.

foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#11 Post by foxpup »

mistfire wrote:On xorg-autoconf script, if an intel video card was made year 2012 or older. intel driver will be selected otherwise modesetting will be selected if its drm kernel module was loaded.

Major distros abandon intel xorg driver in favor of modesetting ddx for newer intel video card due to uncertainties of development on its upstream.
Just googling around I came on this:
dglt wrote:skylake + modesetting = :scream: (yes, it's really that bad)

even with heavy compositor options the tearing is horrendous. with my optimus laptop with skylake cpu i use modesetting with nvidia prime mode because PRIME synchronization gets rid of tearing and modesetting is faster for offloading.

but using modesetting with intel-only mode is unusable, not just games or videos either. opening menus? tearing. webpage scrolling? tears that resemble the grand canyon.

from what i understand post-skylake cpu's dont have this issue with modesetting but i never tested this first hand.
https://forum.manjaro.org/t/intel-modes ... r/106549/2
Guess what: I have a machine with Skylake. :-)
Since I do not use Prime ( who does on Puppy ? ), according to this I should go for intel driver.
I haven't noticed tearing with modesetting though, maybe because I have this habit of choosing intel.

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#12 Post by mistfire »

@foxpup did you use the latest intel xorg driver? What is the model of your intel video card?

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#13 Post by enrique »

mistfire
I was looking for a tool like this. Thanks to mikeslr I found this thread. See http://murga-linux.com/puppy/viewtopic. ... 26#1051326

I have a laptop with dual GPU, Intel and AMD. In fact I only used Intel as it is less noisy and lower power. But I am in the process of enable OpenCL in the AMD. In the past few days while testing some drivers, I constantly break my Xorg server. Hopefully this will allow me to recover.

Now I did download and test it. In my case It failed. It did detect ONLY one Card, Intel, but failed to select correct driver & acceleration. This is what it reported

Code: Select all

Section "Device"
	Identifier  "Card0"
	Driver      "modesetting" #card0driver
	BusID       "" #card0busid
EndSection
The script is very easy to follow. So I am making some changes. As soon as I get it right I will post the suggested changes.

*In general I have BusterDog64. My default busybox does not have lspci. But I do not need busybox as I do have default lspci & lsmod. So all commands that call lspci failed.

*My version of sh and the "" on variables makes the result of bid fail. To correct I had to removes "" from around $PCILIST

Code: Select all

# bid="$(echo "$PCILIST" | grep "$1" | cut -f 1 -d ' ' | sed -e "s#^0##g" -e "s#:0#:#g" -e "s#\.#:#g")"
 bid="$($PCILIST | grep "$1" | cut -f 1 -d ' ' | sed -e "s#^0##g" -e "s#:0#:#g" -e "s#\.#:#g")"
*My GPU drivers are NOT inside /usr/lib/xorg/modules/drivers

Code: Select all

ls -la /usr/lib/xorg/modules/drivers
total 1772
drwxr-xr-x 2 root root      61 Nov 29 04:16 .
drwxr-xr-x 5 root root     252 Nov 29 04:16 ..
-rw-r--r-- 1 root root 1702440 Oct  9  2018 intel_drv.so
-rw-r--r-- 1 root root  111168 Mar  5  2019 modesetting_drv.so
*I suggest checking the system drivers like this

Code: Select all

lspci -nn | grep VGA
00:02.0 VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0116] (rev 09)
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Whistler [Radeon HD 6730M/6770M/7690M XT] [1002:6740]

For AMD
lspci -nk -d 1002:6740 | grep -e "Kernel driver" | cut -f 2 -d ':' | tr -d ' '
radeon

find /lib/modules | grep -i radeon
/lib/modules/4.19.0-6-amd64/kernel/drivers/gpu/drm/radeon/radeon.ko
/lib/modules/4.19.0-6-amd64/kernel/drivers/video/fbdev/aty/radeonfb.ko

For Intel
lspci -nk -d 8086:0116 | grep -e "Kernel driver" | cut -f 2 -d ':' | tr -d ' '
i915

find /lib/modules | grep -i i915
/lib/modules/4.19.0-6-amd64/kernel/drivers/gpu/drm/i915
/lib/modules/4.19.0-6-amd64/kernel/drivers/gpu/drm/i915/i915.ko
So this is what I think it should report

Code: Select all

Section "Device"
	Identifier  "Card0"
	Driver      "i915" #card0driver
	BusID       "0:2:0" #card0busid
EndSection

Section "Device"
	Identifier  "Card1"
	Driver      "radeon" #card1driver
	Option 	"AccelMethod" "exa"
	BusID       "1:0:0" #card1busid
EndSection
And I guess in my case I have to remove the comment in Device "Card0

Code: Select all

Section "Screen"
	Identifier "Screen0"
#	Device     "Card0"
Please see that I am not correcting you I am only suggesting possible solutions. In any case my BIG Thank you for allow me understanding this process creation. Very nice. Once I see it work for me I may post my suggested changes for you to consider.

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#14 Post by mistfire »

@enrique

How did you get the pci bus id without using busybox lspci applet?

Also I made comments on your suggestion, xorg driver is different from kernel module. You cant load kernel module as xorg driver. modesetting or its companion xorg driver will utilize those kernel modules for video cards

May I know your intel-amd hybrid gpu name and model please?

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#15 Post by enrique »

mistfire
I need more friends in the forum. Please see my post as a TESTER helping you out. Never as a correction. Then if you wish, use any valid info in your future upgrades. I believe you are building pets for puppy. Well Puppy Distributions are the BEST. But here in the forum there are other good solutions/derivatives that may not have the pedigree but are as good as Puppy. The distribution I am testing in BusterDog & StrechDog
Point is that may explain some of the differences. Latter today I will test your script as is in Bionic Puppy, compare the results and post them here. In that way we can see if bugs are related to differences in Puppy distro or the fact that I have a Multi GPU Laptop.
mistfire wrote:You cant load kernel module as xorg driver. modesetting or its companion xorg driver will utilize those kernel modules for video cards
Here is where you are the expert. I am only trying to learn from you. I will answer my best but I can be wrong. And again I am not trying to correct you.

If I look in

Code: Select all

root@live:~# ls /usr/lib/xorg/modules/drivers 
intel_drv.so  modesetting_drv.so
root@live:~# 
I could easily see your point. This suggest intel_drv.so modesetting_drv.so are ONLY xorg available drivers. But to me this is wrong conclusion. Lets see if they where in fact loaded:

Code: Select all

root@live:~# lsmod  | cut -f 1 -d ' ' | tr -d ' ' | grep -i -e 'intel_drv.so\|modesetting_drv.so'
root@live:~# 
See they are NOT been used. In fact the one used as reported by lspci are

Code: Select all

For AMD
lspci -nk -d 1002:6740 | grep -e "Kernel driver" | cut -f 2 -d ':' | tr -d ' '
radeon
For Intel
lspci -nk -d 8086:0116 | grep -e "Kernel driver" | cut -f 2 -d ':' | tr -d ' '
i915 
And can be verify by

Code: Select all

root@live:~# lsmod  | cut -f 1 -d ' ' | tr -d ' ' | grep -i -e 'i915\|radeon\|modesetting'
i915
radeon
root@live:~# 
or you can use proc

Code: Select all

root@live:~# ls /sys/bus/pci/devices/0000:00:02.0/driver/module/drivers
pci:i915
root@live:~# ls /sys/bus/pci/devices/0000:01:00.0/driver/module/drivers
pci:radeon
root@live:~#
mistfire wrote:How did you get the pci bus id without using busybox lspci applet?
Remeber I am a DebianDog user.
Lspci is provided by: pciutils. Lsmod is provided by: kmod. I assume as a Puppy user you look for a pet to install pciutils & kmod or use PPM.

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#16 Post by enrique »

mistfire wrote:May I know your intel-amd hybrid gpu name and model please?
For CPU Intel

Code: Select all

root@live:~# lspci -nn | grep 8086:0116
00:02.0 VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0116] (rev 09)

cat /proc/cpuinfo | grep -i -e 'vendor_id\|model name'
vendor_id	: GenuineIntel
model name	: Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz

cat /sys/bus/pci/devices/0000:00:02.0/uevent
DRIVER=i915
PCI_CLASS=30000
PCI_ID=8086:0116
PCI_SUBSYS_ID=103C:165A
PCI_SLOT_NAME=0000:00:02.0
MODALIAS=pci:v00008086d00000116sv0000103Csd0000165Abc03sc00i00
For AMG Discrete GPU
Wao this is not easy to explain. Easy answer is Intel, AMD & NVIDIA are lyiers. Long answer, they sell rejected IC as Lower Class IC. This can be a long talk, lets not get into it.
Reported Hardware

Code: Select all

lspci -nn | grep 1002:6740
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Whistler [Radeon HD 6730M/6770M/7690M XT] [1002:6740]

cat /sys/bus/pci/devices/0000:01:00.0/uevent
DRIVER=radeon
PCI_CLASS=30000
PCI_ID=1002:6740
PCI_SUBSYS_ID=103C:165A
PCI_SLOT_NAME=0000:01:00.0
MODALIAS=pci:v00001002d00006740sv0000103Csd0000165Abc03sc00i00
This means my hardware id are PCI_ID=1002:6740 PCI_SUBSYS_ID=103C:165A
If we do google you may end in

Code: Select all

http://pci-ids.ucw.cz/read/PC/1002/6740/103c165a
This confirm HARDWARE is in fact a Radeon HD 6770M (Whistler XT)

Firmware which as result it is how GPU REALLY works
But the firmware installed in the device is for Radeon HD 6670 (Turks XT)

Conclusion if we query we will get,

Code: Select all

root@live:~# DRI_PRIME=0 glxgears -info
GL_RENDERER   = AMD TURKS (DRM 2.50.0 / 4.19.0-6-amd64, LLVM 7.0.1)
root@live:~# 
root@live:~# DRI_PRIME=1 glxgears -info
GL_RENDERER   = Mesa DRI Intel(R) Sandybridge Mobile
root@live:~# 

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#17 Post by mistfire »

@enrique

You must need to install fbdev and vesa xorg driver as a fallback. I wonder why they didn't include those fallbacks on BusterDog & StrechDog?

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#18 Post by enrique »

mistfire
One more time, let me start with that I am learning this as we speak. I can easily repeat something that in fact is wrong. So reader be aware that I can be wrong.

I have spent many... many hours reading on the net. I still have not found the easy simple explanation. I guess that explain why so many articles in the net. But I guess now I think I understand the processes.

1rst what I had post is not 100% wrong. My pc kernel boot using only kernel modules type ko located in

Code: Select all

/lib/modules/4.19.0-6-amd64/kernel/drivers/gpu/drm/radeon/radeon.ko
/lib/modules/4.19.0-6-amd64/kernel/drivers/video/fbdev/aty/radeonfb.ko 
And this is the reason Kernel show video on the screen.

Here Is where I was wrong.
1-Those kernel modules are NOT the same as Xorg modules type so located in

Code: Select all

/usr/lib/xorg/modules/drivers
This are object/binary libraries that get loaded by Xor Server. Just as any library is loaded when you run a program. Soo Xorg modules NEVER get Loaded as kernel modules and that is the reason why lsmod can/do not show them.
2-modesetting_drv.so is the default driver. So it gets loaded when no other module is found or not specify. I guess this explain why they removed vesa and fbdev.
3-You are correct modesetting will substitute intel. As default Debian package will not install intel_dvr.so. Interesting it is included in the "xserver-xorg-video-intel_2.99.917+git20180925-2_amd64.deb" But it never gets Installed!!!!! I guess it is not in the scripts.
4-RADEON/ATI GPU: To installed radeon_drv.so I need to install xserver-xorg-video-radeon_19.0.1-1_amd64.deb if not modesetting is loaded. In my test modesetting do work with mesa in 3D as informed by DRI_PRIME=1 LIBGL_DEBUG=verbose glxgears but its performance is as good as the HD3000 inside intel CPUs. I still need to reboot an see how it perform with radeon_dvr.so.

I am not finished with this. There is more test, to do and fine tune. As soon as I feel I am right I will post.
You must need to install fbdev and vesa xorg driver as a fallback. I wonder why they didn't include those fallbacks on BusterDog & StrechDog?
No. modesetting seems to be a one setting fits all, for all motherborads build after 2007. Another issue is if it is the best!

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#19 Post by mistfire »

xorg-autoconf 2.1 released

Changes:
* Improve handling of intel and radeon video cards
* Some optimizations (thanks @01micko)

foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

skylake and xorg driver

#20 Post by foxpup »

mistfire wrote:@foxpup did you use the latest intel xorg driver? What is the model of your intel video card?
I just use the driver that comes with the Puppy.
This for dPupStretch from radky:

Code: Select all

▶—— Video ——◀

Display Specifications:
• Monitor VertRefresh: 60.01 times/s
• Screen Dimensions: 1920x1080 pixels (507x285 millimeters)
• Screen Depth: 24 bits (planes)

Xorg Startup Log (/var/log/Xorg.0.log):
• Xorg Driver in use: intel
• Loaded Modules: dbe dri2 dri3 evdev glx libinput present synaptics
• X.Org version: 1.19.2

OpenGL 2D/3D Rendering:
• Direct Rendering: Yes
• Vendor: Intel Open Source Technology Center
• Renderer: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) x86/MMX/SSE2
• Version: 3.0 Mesa 13.0.6

VGA controller [0300]: Intel Corporation Skylake GT2 [HD Graphics 520] [8086:1916] (rev 07)
• Kernel Driver: i915
• Memory Used by Driver: 1094.51 KB
• Path: /lib/modules/4.9.149-stretch/kernel/drivers/gpu/drm/i915/i915.ko
• Description: Intel Graphics
• Video RAM: 1536M total, 256M prefetchable

Post Reply