FreeBSD Foundation's New Project: Implement GEM/KMS/DRI for Intel Graphics

Status
Not open for further replies.
I just got an X121e and was so used to Intel graphics card working out of the box that I didn't check any further than that but was a little more worries about Wifi and 3G etc. Of course it was completely the other way around. All network stuff worked immediately but graphics was only distorted Vesa.

Now I found this thread and upgraded to 10.0-current, patched, rebuilt etc. Now I can start X which looks a lot better but everything freezes. Neither keyboard or mouse works and I cannot even switch back to console. SSH works as long as I don't kill X. I tried the

Code:
Option "AutoAddDevices" "Off"

but it does not seem to help. Any suggestions? Should we disable HAL altogether now? Was KMS support fro DRI a good idea?
 
mrstolpe said:
I just got an X121e and was so used to Intel graphics card working out of the box that I didn't check any further than that but was a little more worries about Wifi and 3G etc. Of course it was completely the other way around. All network stuff worked immediately but graphics was only distorted Vesa.

Now I found this thread and upgraded to 10.0-current, patched, rebuilt etc. Now I can start X which looks a lot better but everything freezes. Neither keyboard or mouse works and I cannot even switch back to console. SSH works as long as I don't kill X. I tried the

Code:
Option "AutoAddDevices" "Off"

but it does not seem to help. Any suggestions? Should we disable HAL altogether now? Was KMS support fro DRI a good idea?

I checked that I had some remains from my previous Xorg build. After rebuild of xf86-input-ports at least mouse and keyboard works under X.

I still lose console as X starts and KDE keeps screaming about dbus though.
 
mrstolpe said:
I checked that I had some remains from my previous Xorg build. After rebuild of xf86-input-ports at least mouse and keyboard work under X.

I still lose console as X starts and KDE keeps screaming about dbus though.

Sorry to disturb you guys. The dbus problem was certainly a permission problem (I tend to do su -m and get a lot of root stuff in my home dir).

I really would like to have console and X working at the same time though.
 
Core i3-370M Ironlake Laptop

Installed 9-current from USB.

Code:
portsnap fetch extract

cd /usr/ports/ports-mgmt/portmaster

make install clean

portmaster -a

portmaster net/cvsup

cvsup 10-current source

cp -R /usr/src /src.bkup

fetch all.12.3.patch

build and install source (google "freebsd buildworld")

cd /usr/ports/ports-mgmt/portmaster; make install clean

portmaster -a

portmaster ncurses

portmaster patch

edit /usr/src/sys/dev/drm/i915_suspend.c (as mentioned) and i915_drv.h (similarly but towards the middle of the file)

patch -p1 -d /usr/src <all.12.3.patch (run find /usr/src "*.rej" -print)

restore source from backup after examining .rej files; look at man files for "patch" and "diff"

edit /usr/src/sys/sys/types.h

build and install patched source

portmaster devel/subversion

svn co [xorg-dev]

fetch xorgmerge

portmaster x11/xorg
 
Intel i915 (sandybridge with an nVidia GT 425m) works with 12.5 and 12.6 patch on FreeBSD 10.0-CURRENT. 12.4 not tested and 12.3 does'nt work because of build fail.

THe only thing it's impossible to return to a TTY and keyboard is frozen. So it's better to startx && sudo reboot (with a proper /usr/local/etc/sudoers file to avoid password ask) if you don't want your system to be frozen.

kldunload i915 after exiting Xorg just make the system rebooting immediately, causing filesystems being not unmounted the right way.
 
akregator said:
startx && sudo reboot (with a proper /usr/local/etc/sudoers file to avoid password ask)

Make that startx && shutdown -r now and add yourself to the operator group, that way You do not need sudo.
 
I am getting this issue even though i already changed the line 31 on i915_suspend.c after patching with all.13.0.patch

Code:
.
.
.
./../dev/drm/i915_suspend.c
/usr/home/alie/fbsd/src/sys/modules/drm/i915/../../../dev/drm/i915_suspend.c:41:21: error: use of undeclared identifier 'DPLL_A'
                return (I915_READ(DPLL_A) & DPLL_VCO_ENABLE);
                                  ^
@/dev/drm/i915_drv.h:1250:48: note: expanded from:                                                                                                               
#define I915_READ(reg)          i915_read32(dev_priv, (reg))
                                                       ^
/usr/home/alie/fbsd/src/sys/modules/drm/i915/../../../dev/drm/i915_suspend.c:43:21: error: use of undeclared identifier 'DPLL_B'                                 
                return (I915_READ(DPLL_B) & DPLL_VCO_ENABLE);
                                  ^
@/dev/drm/i915_drv.h:1250:48: note: expanded from:                                                                                                               
#define I915_READ(reg)          i915_read32(dev_priv, (reg))
                                                       ^
/usr/home/alie/fbsd/src/sys/modules/drm/i915/../../../dev/drm/i915_suspend.c:49:40: error: use of undeclared identifier 'PALETTE_A'                              
        unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);
                                              ^
/usr/home/alie/fbsd/src/sys/modules/drm/i915/../../../dev/drm/i915_suspend.c:49:52: error: use of undeclared identifier 'PALETTE_B'                              
        unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);
                                                          ^
/usr/home/alie/fbsd/src/sys/modules/drm/i915/../../../dev/drm/i915_suspend.c:68:40: error: use of undeclared identifier 'PALETTE_A'                              
        unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);
                                              ^
/usr/home/alie/fbsd/src/sys/modules/drm/i915/../../../dev/drm/i915_suspend.c:68:52: error: use of undeclared identifier 'PALETTE_B'                              
        unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);
                                                          ^
/usr/home/alie/fbsd/src/sys/modules/drm/i915/../../../dev/drm/i915_suspend.c:817:3: warning: implicit declaration of function 'ironlake_disable_drps' is invalid 
      in C99 [-Wimplicit-function-declaration]
                ironlake_disable_drps(dev);
.
.
.
 
There are other files where this line defers from the patch.
To avoid this problem, do this before patching:
Code:
for file in `grep 'a/' /path/to/the/patch/all.13.0.patch | grep -v diff | sed -e's/--- a/\/usr\/src/g'`
do
  sed -i ".old" -e's/\$FreeBSD\:.*\$/\$FreeBSD\$/g' "$file"
done
 
I got different issues now

Code:
/usr/home/alie/fbsd/src/sys/modules/drm/drm/../../../dev/drm/drm_crtc.c:3343:8: error: redefinition of 'drm_prop_enum_list'
struct drm_prop_enum_list {
       ^
/usr/home/alie/fbsd/src/sys/modules/drm/drm/../../../dev/drm/drm_crtc.c:39:8: note: previous definition is here                                                                                            
struct drm_prop_enum_list {
       ^
/usr/home/alie/fbsd/src/sys/modules/drm/drm/../../../dev/drm/drm_crtc.c:3363:34: error: redefinition of 'drm_dpms_enum_list'                                                                               
static struct drm_prop_enum_list drm_dpms_enum_list[] =
                                 ^
/usr/home/alie/fbsd/src/sys/modules/drm/drm/../../../dev/drm/drm_crtc.c:59:34: note: previous definition is here                                                                                           
static struct drm_prop_enum_list drm_dpms_enum_list[] =
.
.
.                                      
20 errors generated.
*** Error code 1
 
Did you patch a source which was already patched? Cause it might be your problem: you can't apply the patch a second time. You need to re-sync the source (using SVN) before applying the patch.

So,

First: Sync the source again using SVN. You can backup it after download to keep clean version of the source locally.

Second:
Code:
for file in `grep 'a/' /path/to/the/patch/all.13.0.patch | grep -v diff | sed -e's/--- a/\/path\/to\/src/g'`
do
  sed -i ".old" -e's/\$FreeBSD\:.*\$/\$FreeBSD\$/g' "$file"
done

And finally apply the patch.
 
I'm getting a blank/black screen with startx.

I managed to patch 9 Release with the standard /usr/src that came from the install CD and the patch applied cleanly. I used a special patch for 9 release source.

xf86-video-intel-kms doesnt seem to exist anymore, so I put
Code:
WITH_NEW_XORG="YES"
into my make.conf and it seemed to build the newer versions of xorg and xf86-video-intel correctly.

When I use the -retro option with Xorg it works. However, when I use startx I get a blank screen. My .xinitrc has "exec wmaker", i have also tried "exec startxfce4".

I have tried with and without a custom xorg.conf.

Does anyone have any suggestions? Thanks
 
ashleyd said:
Im getting a blank/black screen with startx.

Does anyone have any suggestions? Thanks

Have you upgraded your ports? Use portdowngrade to downgrade libxcb-1.7 from libxcb-1.8, it helped me.
 
Gentleman,

It is great pleasure for me to join this community. I really enjoy freebsd FreeBSD, I spend 2 to 3 hours per day on it. Ok, let's get to the serious point. Just like many I do have expectation to get my Intel Ironlake work at my best on freebsd FreeBSD laptop. I've tried to follow the procedure given by Martin to the best of my knowledge. unforturnately, I'm not as successful as tmow or others in getting this to work properly. Any help in getting this issue resolved would be much appreciated.

My /var/log/Xorg.0.log
Code:
X.Org X Server 1.10.4
Release Date: 2011-08-19
[   417.745] X Protocol Version 11, Revision 0
[   417.745] Build Operating System: FreeBSD 9.0-RELEASE i386 
[   417.745] Current Operating System: FreeBSD zoohoo.mydomain.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Sat Feb 11 12:35:54 CET 2012
     root@zoohoo.mydomain.com:/usr/obj/usr/src/sys/CUSTOM i386
[   417.747] Build Date: 11 February 2012  03:50:19PM
[   417.747] Current version of pixman: 0.24.2
[   417.747] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[   417.748] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   417.749] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Feb 11 16:32:47 2012
[   417.751] (++) Using config file: "xorg.conf.new"
[   417.754] (==) ServerLayout "X.org Configured"
[   417.754] (**) |-->Screen "Screen0" (0)
[   417.754] (**) |   |-->Monitor "Monitor0"
[   417.756] (**) |   |-->Device "Card0"
[   417.756] (**) |-->Screen "Screen1" (1)
[   417.756] (**) |   |-->Monitor "Monitor1"
[   417.758] (**) |   |-->Device "Card1"
[   417.759] (**) |-->Input Device "Mouse0"
[   417.759] (**) |-->Input Device "Keyboard0"
[   417.759] (==) Automatically adding devices
[   417.759] (==) Automatically enabling devices
[   417.762] (**) FontPath set to:
	/usr/local/lib/X11/fonts/misc/,
	/usr/local/lib/X11/fonts/TTF/,
	/usr/local/lib/X11/fonts/OTF/,
	/usr/local/lib/X11/fonts/Type1/,
	/usr/local/lib/X11/fonts/100dpi/,
	/usr/local/lib/X11/fonts/75dpi/,
	/usr/local/lib/X11/fonts/misc/,
	/usr/local/lib/X11/fonts/TTF/,
	/usr/local/lib/X11/fonts/OTF/,
	/usr/local/lib/X11/fonts/Type1/,
	/usr/local/lib/X11/fonts/100dpi/,
	/usr/local/lib/X11/fonts/75dpi/
[   417.762] (**) ModulePath set to "/usr/local/lib/xorg/modules"
[   417.763] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[   417.763] (WW) Disabling Mouse0
[   417.763] (WW) Disabling Keyboard0
[   417.763] (II) Loader magic: 0x81ef100
[   417.763] (II) Module ABI versions:
[   417.763] 	X.Org ANSI C Emulation: 0.4
[   417.763] 	X.Org Video Driver: 10.0
[   417.763] 	X.Org XInput driver : 12.2
[   417.763] 	X.Org Server Extension : 5.0
[   417.765] (--) PCI:*(0:0:2:0) 8086:0046:103c:172a rev 2, Mem @ 0xd0000000/4194304, 0xc0000000/268435456, I/O @ 0x00005080/8,
 BIOS @ 0x????????/65536
[   417.766] (II) "extmod" will be loaded. This was enabled by default and also specified in the config file.
[   417.766] (II) "dbe" will be loaded. This was enabled by default and also specified in the config file.
[   417.766] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[   417.766] (II) "record" will be loaded. This was enabled by default and also specified in the config file.
[   417.766] (II) "dri" will be loaded. This was enabled by default and also specified in the config file.
[   417.766] (II) "dri2" will be loaded. This was enabled by default and also specified in the config file.
[   417.766] (II) LoadModule: "extmod"
[   417.772] (II) Loading /usr/local/lib/xorg/modules/extensions/libextmod.so
[   417.775] (II) Module extmod: vendor="X.Org Foundation"
[   417.775] 	compiled for 1.10.4, module version = 1.0.0
[   417.775] 	Module class: X.Org Server Extension
[   417.775] 	ABI class: X.Org Server Extension, version 5.0
[   417.775] (II) Loading extension MIT-SCREEN-SAVER
[   417.775] (II) Loading extension XFree86-VidModeExtension
[   417.776] (II) Loading extension XFree86-DGA
[   417.776] (II) Loading extension DPMS
[   417.776] (II) Loading extension XVideo
[   417.776] (II) Loading extension XVideo-MotionCompensation
[   417.776] (II) Loading extension X-Resource
[   417.776] (II) LoadModule: "record"
[   417.781] (II) Loading /usr/local/lib/xorg/modules/extensions/librecord.so
[   417.782] (II) Module record: vendor="X.Org Foundation"
[   417.782] 	compiled for 1.10.4, module version = 1.13.0
[   417.782] 	Module class: X.Org Server Extension
[   417.783] 	ABI class: X.Org Server Extension, version 5.0
[   417.783] (II) Loading extension RECORD
[   417.783] (II) LoadModule: "dbe"
[   417.788] (II) Loading /usr/local/lib/xorg/modules/extensions/libdbe.so
[   417.789] (II) Module dbe: vendor="X.Org Foundation"
[   417.790] 	compiled for 1.10.4, module version = 1.0.0
[   417.790] 	Module class: X.Org Server Extension
[   417.790] 	ABI class: X.Org Server Extension, version 5.0
[   417.790] (II) Loading extension DOUBLE-BUFFER
[   417.790] (II) LoadModule: "glx"
[   417.795] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[   417.797] (II) Module glx: vendor="X.Org Foundation"
[   417.797] 	compiled for 1.10.4, module version = 1.0.0
[   417.798] 	ABI class: X.Org Server Extension, version 5.0
[   417.798] (==) AIGLX disabled
[   417.798] (II) Loading extension GLX
[   417.798] (II) LoadModule: "dri"
[   417.804] (II) Loading /usr/local/lib/xorg/modules/extensions/libdri.so
[   417.806] (II) Module dri: vendor="X.Org Foundation"
[   417.806] 	compiled for 1.10.4, module version = 1.0.0
[   417.806] 	ABI class: X.Org Server Extension, version 5.0
[   417.806] (II) Loading extension XFree86-DRI
[   417.807] (II) LoadModule: "dri2"
[   417.812] (II) Loading /usr/local/lib/xorg/modules/extensions/libdri2.so
[   417.814] (II) Module dri2: vendor="X.Org Foundation"
[   417.814] 	compiled for 1.10.4, module version = 1.2.0
[   417.814] 	ABI class: X.Org Server Extension, version 5.0
[   417.814] (II) Loading extension DRI2
[   417.814] (II) LoadModule: "intel"
[   417.824] (II) Loading /usr/local/lib/xorg/modules/drivers/intel_drv.so
[   417.830] (II) Module intel: vendor="X.Org Foundation"
[   417.830] 	compiled for 1.10.4, module version = 2.17.0
[   417.830] 	Module class: X.Org Video Driver
[   417.830] 	ABI class: X.Org Video Driver, version 10.0
[   417.830] (II) LoadModule: "vesa"
[   417.839] (II) Loading /usr/local/lib/xorg/modules/drivers/vesa_drv.so
[   417.840] (II) Module vesa: vendor="X.Org Foundation"
[   417.840] 	compiled for 1.10.4, module version = 2.3.0
[   417.841] 	Module class: X.Org Video Driver
[   417.841] 	ABI class: X.Org Video Driver, version 10.0
[   417.841] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,
	i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G,
	E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,
	965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,
	4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale,
	Sandybridge Desktop (GT1), Sandybridge Desktop (GT2),
	Sandybridge Desktop (GT2+), Sandybridge Mobile (GT1),
	Sandybridge Mobile (GT2), Sandybridge Mobile (GT2+),
	Sandybridge Server, Ivybridge Mobile (GT1), Ivybridge Mobile (GT2),
	Ivybridge Desktop (GT1), Ivybridge Desktop (GT2), Ivybridge Server
[   417.845] (II) VESA: driver for VESA chipsets: vesa
[   417.846] (--) Using syscons driver with X support (version 2.0)
[   417.846] (--) using VT number 9

[   417.859] (II) Loading /usr/local/lib/xorg/modules/drivers/intel_drv.so
[   417.859] (WW) Falling back to old probe method for vesa
[   417.859] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[   417.861] drmOpenDevice: node name is /dev/dri/card0
[   417.863] Failed to change owner or group for file /dev/dri! 2: No such file or directory
[   417.865] Failed to change owner or group for file /dev/dri/card0! 2: No such file or directory
[   417.865] drmOpenDevice: open result is -1, (No such file or directory)
[   417.865] Failed to change owner or group for file /dev/dri/card0! 2: No such file or directory
[   417.866] drmOpenDevice: open result is -1, (No such file or directory)
[   417.866] drmOpenDevice: Open failed
[   417.868] [drm] failed to load kernel module "i915"
[   417.868] (EE) intel(0): [drm] Failed to open DRM device for pci:0000:00:02.0: File exists
[   417.868] (EE) intel(0): Failed to become DRM master.
[   417.868] (==) intel(0): Depth 24, (--) framebuffer bpp 32
[   417.869] (==) intel(0): RGB weight 888
[   417.869] (==) intel(0): Default visual is TrueColor
[   417.869] (II) intel(0): Integrated Graphics Chipset: Intel(R) Arrandale
[   417.869] (--) intel(0): Chipset: "Arrandale"
[   417.871] (**) intel(0): Relaxed fencing disabled
[   417.871] (**) intel(0): Wait on SwapBuffers? enabled
[   417.871] (**) intel(0): Triple buffering? enabled
[   417.872] (**) intel(0): Framebuffer tiled
[   417.872] (**) intel(0): Pixmaps tiled
[   417.872] (**) intel(0): 3D buffers tiled
[   417.872] (**) intel(0): SwapBuffers wait enabled
[   417.872] (==) intel(0): video overlay key set to 0x101fe
[   417.872] (EE) intel(0): failed to get resources: Bad file descriptor
[   417.873] (II) UnloadModule: "intel"
[   417.873] (II) Unloading intel
[   417.873] (EE) Screen(s) found, but none have a usable configuration.
[   417.873] 
Fatal server error:
[   417.874] no screens found
[   417.874] 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[   417.874] Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   417.874]
 
Hello folks,

Back again to describe my (unseccessful) experience. I've restarted the process again this sunday afternoon; below is the procedure that I've rigorously applied:

step0: install FreeBSD 9.0 STABLE, using the i386 DVD image and my favorite text editor.

step1: update the ports tree

[CMD=""]portsnap fetch extract[/CMD]

step2: install required ports to get things done

Code:
cd /usr/ports/ports-mgmt/portmaster
make install clean
cd /usr/ports/devel/subversion
make install clean
portmaster net/cvsup

(reboot)

step3: update ports and complete source code
portmaster -a
cvsup cvsup0.txt

where

cvsup0.txt
Code:
*default host=cvsup.FreeBSD.org
*default prefix=/usr
*default base=/var/db
*default release=cvs tag=RELENG_9
*default delete use-rel-suffix compress

src-all

(very classical things I guess for most of you)

step4: manually editing i915_suspend.c and i915_drv.h so that "$FreeBSD: blah[...]blah$" becomes "$FreeBSD$"

step5: apply patch

patch -p1 -d /usr/src </root/drm-all.13.0-stable9.1.patch

step6: recompile kernel

Code:
cd /usr/src/sys/i386/conf
mkdir /root/kernels
cp GENERIC /root/kernels/CUSTOM
ln -s /root/kernels/CUSTOM
cd /usr/src
make buildkernel KERNCONF=CUSTOM

(reboot)

make installkernel KERNCONF=CUSTOM

(reboot)

step7: add to /etc/make.conf the following lines:

Code:
WITH_NEW_XORG="YES"
WITH_KMS="YES"

step8: install xorg

cd /usr/ports/x11/xorg
make install clean

(reboot)

step9: check out new version of Xorg then merge
svn co [url]https://trillian.chruetertee.ch/svn/ports/tags/xorg_7_5_2[/url]
leading to have /root/xorg_7_5_2 then merge by editing the merge scripts with:
KDEDIR="/root/xorg_7_5_2"

step10: rebuild xf86-* ports

portmaster -Raf

(a little bit too brutal, but exhaustive)

(reboot)

I'll be very happy if you can help me in my beginnings with FreeBSD.

Thanks and have a nice week.
 
Toto said:
step9: check out new version of Xorg then merge
svn co [url]https://trillian.chruetertee.ch/svn/ports/tags/xorg_7_5_2[/url]
leading to have /root/xorg_7_5_2 then merge by editing the merge scripts with:
KDEDIR="/root/xorg_7_5_2"

step10: rebuild xf86-* ports

It seems to me that you didn't execute the merge-script.
 
Well, step 9 should be rewritten as following:

step9: check out new version of Xorg, edit the merge script then apply:
svn co [url]https://trillian.chruetertee.ch/svn/ports/tags/xorg_7_5_2[/url]
leading to have /root/xorg_7_5_2 then editing the merge scripts with:
KDEDIR="/root/xorg_7_5_2"

then apply
sh xorgmerge

(merge script got executed)
 
tmow said:
Thanks to all of you and Martin Wilke (his blog post at http://miwi.bsdcrew.de/2012/02/cft-xorg-upgrade-7-5-2/) I've finally succeeded applying the patch.

Just a question, what should I do to keep it updated? Should I reapply the patches each time?

Thanks a lot!

I believe that as long as you don't touch your source or update it you will not have to apply the patch again, even if you rebuild your kernel. If you cvsup your /usr/src to update it then I assume you will need to apply the patch again.

I am running xorgmerge again every time I upgrade my ports just to be safe, it only takes 1 second.
 
Status
Not open for further replies.
Back
Top