# startx fails unless dri disabled



## xtremystinx (Mar 19, 2014)

I recently installed FreeBSD 10 on my pc, I'm using ATI 2100 video card (shared memory) and, most of the times, running `startx` lead to a blank screen. Monitor showed "No signal" message and finally "Sleep Mode" and the only thing I could do from there is press Alt+Ctrl+Del in order to reboot. I read many posts here, mostly from nvidia users, but can't get a fix for my system. The only thing that worked for me was a tip from a mail list that suggested to turn 
	
	



```
Option "DRI" "Off"
```
 in /etc/X11/xorg.conf. It worked but without dri I can't have xv as video output on mplayer or any other player (for example vlc) and x11 rises the cpu consumption to a point that turning the player full-screen causes audio-video getting out of sync. So I tried to `startx` with dri on and got another blank screen, then rebooted and disabled dri, started x without a problem and run `cat /var/log/Xorg.0.log.old | grep dri` which showed:

```
(WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
	X.Org XInput driver : 7.0
(--) Using syscons driver with X support (version 2.0)
(II) "dri" will be loaded. This was enabled by default and also specified in the config file.
(II) "dri2" will be loaded. This was enabled by default and also specified in the config file.
(II) LoadModule: "dri"
(II) Loading /usr/local/lib/xorg/modules/extensions/libdri.so
(II) Module dri: vendor="X.Org Foundation"
(II) LoadModule: "dri2"
(II) Loading /usr/local/lib/xorg/modules/extensions/libdri2.so
(II) Module dri2: vendor="X.Org Foundation"
(II) Loading /usr/local/lib/xorg/modules/drivers/radeon_drv.so
drmOpenDevice: node name is /dev/dri/card0
Failed to change owner or group for file /dev/dri! 2: No such file or directory
Failed to change owner or group for file /dev/dri/card0! 2: No such file or directory
Failed to change owner or group for file /dev/dri/card0! 2: No such file or directory
drmOpenDevice: node name is /dev/dri/card0
(II) RADEON(0): [dri] Found DRI library version 1.3.0 and kernel module version 1.31.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: node name is /dev/dri/card0
(II) RADEON(0): [dri] Visual configs initialized
```
My current /etc/X11/xorg.conf

```
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
	Option    "BlankTime"    "120"  # just blank the screen
	Option    "StandbyTime"  "10"  # DPMS state "stand by"
	Option    "SuspendTime"  "10"  # DPMS state "suspend"
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  "dbe"
	Load  "dri"
	Load  "dri2"
	Load  "extmod"
	Load  "record"
	Load  "glx"
	Load  "freetype"
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"
	#DisplaySize	  480   270	# mm
	Identifier   "Monitor0"
	VendorName   "PHL"
	ModelName    "Philips 226V4"
	HorizSync    30.0 - 83.0
	VertRefresh  56.0 - 76.0
	Option	    "DPMS"
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     "Dac6Bit"            	# [<bool>]
        #Option     "Dac8Bit"            	# [<bool>]
        #Option     "BusType"            	# [<str>]
        #Option     "CPPIOMode"          	# [<bool>]
        #Option     "CPusecTimeout"      	# <i>
        #Option     "AGPMode" "8"           	# <i>
        #Option     "AGPFastWrite"       	# [<bool>]
        #Option     "AGPSize"            	# <i>
        #Option     "GARTSize"           	# <i>
        #Option     "RingSize"           	# <i>
        #Option     "BufferSize"         	# <i>
        #Option     "EnableDepthMoves"   	# [<bool>]
        #Option     "EnablePageFlip"     	# [<bool>]
        #Option     "NoBackBuffer"       	# [<bool>]
        #Option     "DMAForXv"           	# [<bool>]
        #Option     "FBTexPercent"       	# <i>
        #Option     "DepthBits"          	# <i>
        #Option     "PCIAPERSize"        	# <i>
        #Option     "AccelDFS"           	# [<bool>]
        #Option     "IgnoreEDID"         	# [<bool>]
        #Option     "CustomEDID"         	# [<str>]
        #Option     "DisplayPriority"    	# [<str>]
        #Option     "PanelSize"          	# [<str>]
        #Option     "ForceMinDotClock"   	# <freq>
        #Option     "ColorTiling"        	# [<bool>]
        #Option     "VideoKey"           	# <i>
        #Option     "RageTheatreCrystal" 	# <i>
        #Option     "RageTheatreTunerPort" 	# <i>
        #Option     "RageTheatreCompositePort" 	# <i>
        #Option     "RageTheatreSVideoPort" 	# <i>
        #Option     "TunerType"          	# <i>
        #Option     "RageTheatreMicrocPath" 	# <str>
        #Option     "RageTheatreMicrocType" 	# <str>
        #Option     "ScalerWidth"        	# <i>
        #Option     "RenderAccel"        	# [<bool>]
        #Option     "SubPixelOrder"      	# [<str>]
        #Option     "ClockGating"        	# [<bool>]
        #Option     "VGAAccess"          	# [<bool>]
        #Option     "ReverseDDC"         	# [<bool>]
        #Option     "LVDSProbePLL"       	# [<bool>]
        #Option     "AccelMethod"        	# <str>
        Option     "DRI" "Off"               	# [<bool>]
        #Option     "ConnectorTable"     	# <str>
        #Option     "DefaultConnectorTable" 	# [<bool>]
        #Option     "DefaultTMDSPLL"     	# [<bool>]
        #Option     "TVDACLoadDetect"    	# [<bool>]
        #Option     "ForceTVOut"         	# [<bool>]
        #Option     "TVStandard"         	# <str>
        #Option     "IgnoreLidStatus"    	# [<bool>]
        #Option     "DefaultTVDACAdj"    	# [<bool>]
        #Option     "Int10"              	# [<bool>]
        #Option     "EXAVSync"           	# [<bool>]
        #Option     "ATOMTVOut"          	# [<bool>]
        #Option     "R4xxATOM"           	# [<bool>]
        #Option     "ForceLowPowerMode"  	# [<bool>]
        #Option     "DynamicPM"          	# [<bool>]
        #Option     "NewPLL"             	# [<bool>]
        #Option     "ZaphodHeads"        	# <str>
	Identifier  "Card0"
	Driver      "radeon"
	VendorName  "Advanced Micro Devices, Inc. [AMD/ATI]"
	BoardName   "RS740 [Radeon 2100]"
	BusID       "PCI:1:5:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection
```
I have xorg 7.7 and xf86-video-ati 6.14.6_1 installed from ports. Is there any other way I can start x server without disabling dri? Any help will be greatly appreciated.


----------



## wblock@ (Mar 19, 2014)

The KMS ports are the way forward for X.  They have not yet been tested on the X2100, but the X600 and X1270 work.  See https://wiki.freebsd.org/Graphics#Installing_KMS_Ports.


----------



## xtremystinx (Mar 19, 2014)

I followed the instructions from the link and everything went ok (took me a while  ), I think `startx` is working fine now. Thanks a lot @wblock@. I still can't use xv for an output driver though, it's as if dri is disabled although I'm not using the line Option "DRI" "Off" in /etc/X11/xorg.conf any more. Maybe this will help a little. `cat /var/log/Xorg.log | grep DRI` shows:

```
[    50.935] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[    50.935] 	X.Org XInput driver : 16.0
[    50.935] (II) "dri" will be loaded. This was enabled by default and also specified in the config file.
[    50.935] (II) "dri2" will be loaded. This was enabled by default and also specified in the config file.
[    50.949] (II) LoadModule: "dri"
[    50.949] (II) Loading /usr/local/lib/xorg/modules/extensions/libdri.so
[    50.971] (II) Module dri: vendor="X.Org Foundation"
[    50.971] (II) LoadModule: "dri2"
[    50.971] (II) Loading /usr/local/lib/xorg/modules/extensions/libdri2.so
[    50.972] (II) Module dri2: vendor="X.Org Foundation"
[    51.008] (II) Loading /usr/local/lib/xorg/modules/drivers/radeon_drv.so
[    51.053] (--) Using syscons driver with X support (version 2.0)
[    51.064] drmOpenDevice: node name is /dev/dri/card0
[    51.065] Failed to change owner or group for file /dev/dri! 2: No such file or directory
[    51.065] Failed to change owner or group for file /dev/dri/card0! 2: No such file or directory
[    51.065] Failed to change owner or group for file /dev/dri/card0! 2: No such file or directory
[    54.952] drmOpenDevice: node name is /dev/dri/card0
[    56.310] 	ABI class: X.Org XInput driver, version 16.0
[    56.310] (II) Using input driver 'kbd' for 'USB Keyboard'
[    56.335] 	ABI class: X.Org XInput driver, version 16.0
[    56.335] (II) Using input driver 'mouse' for 'Basic Optical Mouse'
[    56.340] (II) Using input driver 'kbd' for 'AT Keyboard'
```
Also running `xvinfo` gives:

```
X-Video Extension version 2.2
Screen #0
  no adaptors present
```
While using the older driver and with dri on, I could use xv even if `startx` failed most of the times... I guess I can't have both?


----------



## wblock@ (Mar 19, 2014)

`xvinfo` shows a bunch of information here.  It may be that the KMS drivers don't support that on older hardware, but I don't know.  People on the freebsd-x11 mailing list may be able to help with specifics.


----------



## xtremystinx (Mar 19, 2014)

Ok, *I*'ll see what *I* can do. Thanks again for all you help.


----------

