# intel drm/dri



## lissyara (Aug 18, 2009)

it's very, very slow... =(
what is reason? I remeber, ~2 years ago it will be very fast...
may be some broken now?

```
lissyara-gp$ kldstat | grep -E "drm|i919"
34    2 0xc12a0000 17a50    drm.ko
lissyara-gp$ kldstat | grep -E "drm|i915"
33    1 0xc1295000 a708     i915.ko
34    2 0xc12a0000 17a50    drm.ko
lissyara-gp$ uname -a
FreeBSD lissyara-gp.grand-prix 8.0-BETA2 FreeBSD 8.0-BETA2 #0 r196195M: Fri Aug 14 01:55:37 MSD 2009     lissyara@lissyara-gp.grand-prix:/usr/obj/usr/src/sys/GENERIC  i386
lissyara-gp$ ll /dev/dri/card0
crw-rw----  1 root  wheel    0,  38 14 Ð°Ð²Ð³ 02:35 /dev/dri/card0
lissyara-gp$
```


```
lissyara-gp$ glxgears
Failed to initialize GEM.  Falling back to classic.
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
266 frames in 5.0 seconds = 52.973 FPS
266 frames in 5.0 seconds = 52.975 FPS
258 frames in 5.0 seconds = 51.462 FPS
251 frames in 5.0 seconds = 50.057 FPS
XIO:  fatal IO error 35 (Resource temporarily unavailable) on X server ":0.0"
      after 3604 requests (42 known processed) with 0 events remaining.
lissyara-gp$ xdriinfo
Screen 0: i915
lissyara-gp$
```


```
lissyara-gp$ pciconf -lv
vgapci0@pci0:0:2:0:     class=0x030000 card=0x80a51043 chip=0x25728086 rev=0x02 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Integrated Graphics Device (82865G)'
    class      = display
    subclass   = VGA
```


----------



## vermaden (Aug 18, 2009)

You propably have enabled VSYNC setting that limits FPS to monitor refresh RATE, you can change that with *http://freshports.org/graphics/driconf/* port or by hand editing */etc/drirc*, more here:
http://dri.freedesktop.org/wiki/ConfigurationInfrastructure
http://dri.freedesktop.org/wiki/DriConf
http://dri.freedesktop.org/wiki/ConfigurationOptions


----------



## adamk (Aug 18, 2009)

As you can see from the output, the framerate for glxgears is being capped at the monitors refresh rate.  This is done intentionally to discourage users from using glxgears as a benchmark (among other reasons, probably)  

Install driconf and configure it to never synchronize with the vertical refresh rate and then try again, if you really care what framerate glxgears is giving you.

Even better, though, is to use a real world application such as openarena ( http://dri.freedesktop.org/wiki/Benchmarking ).

Adam


----------



## thuglife (Aug 18, 2009)

http://www.mail-archive.com/freebsd-questions@freebsd.org/msg220322.html

You should also disable sync_to_vblank, install graphics/driconf to do so.

Xorg and intel drivers are under some architectural changes that they affect performance.


----------



## tuan (Jan 4, 2010)

Hello everybody, 

I am having the dri / Intel driver bug that is very similar to the one described in this post : while using a Vtk routine that uses openGL, I ran into the same Xorg issue as the one previously described :


```
Failed to initialize GEM.  Falling back to classic.
Assertion failed: (tab->EvalMesh2), function install_vtxfmt, file vtxfmt.c, line 137.
```

I used driconf to never synchronize with vertical refresh, as discussed in previous posts :


```
<driconf>
    <device screen="0" driver="i915">
        <application name="all">
            <option name="force_s3tc_enable" value="false" />
            <option name="no_rast" value="false" />
            <option name="fthrottle_mode" value="2" />
            <option name="bo_reuse" value="1" />
            [B]<option name="vblank_mode" value="0" />[/B]
            <option name="allow_large_textures" value="2" />
        </application>
    </device>
</driconf>
```

But to no avail, the bug is still there. Bizarrely enough, a few weeks ago, a fresh install of vtk5 on this laptop had worked properly.

Here is xorg.conf : 


```
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "ServerFlags"
        Option "AllowEmptyInput" "False"
EndSection

Section "Files"
	ModulePath   "/usr/local/lib/xorg/modules"
	FontPath     "/usr/local/lib/X11/fonts/misc/"
	FontPath     "/usr/local/lib/X11/fonts/TTF/"
	FontPath     "/usr/local/lib/X11/fonts/OTF"
	FontPath     "/usr/local/lib/X11/fonts/Type1/"
	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
	Load  "extmod"
	Load  "record"
	Load  "dbe"
	Load  "glx"
	Load  "dri"
	Load  "dri2"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/sysmouse"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "NoAccel"            	# [<bool>]
        #Option     "SWcursor"           	# [<bool>]
        #Option     "ColorKey"           	# <i>
        #Option     "CacheLines"         	# <i>
        #Option     "Dac6Bit"            	# [<bool>]
        [B]Option     "DRI"                	# [<bool>][/B]
        #Option     "NoDDC"              	# [<bool>]
        #Option     "ShowCache"          	# [<bool>]
        #Option     "XvMCSurfaces"       	# <i>
        #Option     "PageFlip"           	# [<bool>]
	Identifier  "Card0"
	Driver      "intel"
	VendorName  "Intel Corporation"
	BoardName   "Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller"
	BusID       "PCI:0:2:0"
EndSection
```


```
#pciconf -lv 

vgapci0@pci0:0:2:0:     class=0x030000 card=0x01d81028 chip=0x27a28086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Mobile 945GM/GU Express Integrated Graphics Controller'
    class      = display
    subclass   = VGA
vgapci1@pci0:0:2:1:     class=0x038000 card=0x01d81028 chip=0x27a68086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Mobile 945GM/GU Express Integrated Graphics Controller'
    class      = display
```
In case it helps, on the core of the application,using gdb, I get this :

```
(gdb) bt
#0  0x0000000804f90ffc in thr_kill () from /lib/libc.so.7
#1  0x000000080502c58b in abort () from /lib/libc.so.7
#2  0x00000008050139a5 in __assert () from /lib/libc.so.7
#3  0x00000008065dd2c0 in _mesa_install_save_vtxfmt ()
   from /usr/local/lib/libMesaGL.so
#4  0x000000080cf14fb6 in vbo_save_init () from /usr/local/lib/dri/i915_dri.so
#5  0x000000080cf0ed55 in _vbo_CreateContext ()
   from /usr/local/lib/dri/i915_dri.so
#6  0x000000080ce5e738 in intelInitContext ()
   from /usr/local/lib/dri/i915_dri.so
#7  0x000000080ce51311 in i915CreateContext ()
   from /usr/local/lib/dri/i915_dri.so
#8  0x000000080ce639aa in intelCreateContext ()
   from /usr/local/lib/dri/i915_dri.so
#9  0x000000080ce38225 in driCreateNewContext ()
   from /usr/local/lib/dri/i915_dri.so
#10 0x00000008063d071f in driCreateContext () from /usr/local/lib/libGL.so.1
#11 0x00000008063ab330 in CreateContext () from /usr/local/lib/libGL.so.1
#12 0x00000008063ab723 in glXCreateContext () from /usr/local/lib/libGL.so.1
#13 0x00000008018db277 in vtkXOpenGLRenderWindow::WindowInitialize ()
   from /usr/local/lib/libvtkRendering.so.5.0
#14 0x00000008018d8d9b in vtkXOpenGLRenderWindow::Start ()
   from /usr/local/lib/libvtkRendering.so.5.0
---Type <return> to continue, or q <return> to quit---
#15 0x0000000801866c9d in vtkRenderWindow::DoStereoRender ()
   from /usr/local/lib/libvtkRendering.so.5.0
#16 0x0000000801868bfe in vtkRenderWindow::DoFDRender ()
   from /usr/local/lib/libvtkRendering.so.5.0
#17 0x0000000801869164 in vtkRenderWindow::DoAARender ()
   from /usr/local/lib/libvtkRendering.so.5.0
#18 0x0000000801867fa1 in vtkRenderWindow::Render ()
   from /usr/local/lib/libvtkRendering.so.5.0
#19 0x00000008018d922e in vtkXOpenGLRenderWindow::Render ()
   from /usr/local/lib/libvtkRendering.so.5.0
```

Would anybody have any idea by chance ? 

Rgds.


----------



## paradox (Jan 4, 2010)

as i see you have problem with mesa

```
#2  0x00000008050139a5 in __assert () from /lib/libc.so.7
#3  0x00000008065dd2c0 in _mesa_install_save_vtxfmt ()
   from /usr/local/lib/libMesaGL.so
```
try to reinstall mesa library or pkg or port


----------



## adamk (Jan 4, 2010)

It could very well be a bug in Mesa, in which case you should either try a newer version and/or open up a bug report on freedesktop.

Adam


----------



## tuan (Jan 7, 2010)

I still had the bug after a reinstallation of the mesagl port. I am going to report a bug. Many thanks.


----------



## tuan (Jan 7, 2010)

I just have one last question : this software that we have developped that uses Vtk and the MesaGL port works without any problem on desktops that do not have the  Mobile 945GM Intel graphics driver. That would probably mean that the bug is in the DRI module, rather than in MesaGL, is that correct ?


----------



## adamk (Jan 7, 2010)

Most likely, yes.

Adam


----------



## wowan400 (Apr 18, 2010)

In Xorg 7.5 problem with DRM will be fixed?
http://people.freebsd.org/~rnoland/xf86-video-intel-take2.patch


----------



## adamk (Apr 18, 2010)

wowan400 said:
			
		

> In Xorg 7.5 problem with DRM will be fixed?
> http://people.freebsd.org/~rnoland/xf86-video-intel-take2.patch



It might help if you said what problem with the DRM you are talking about.

Adam


----------

