# Problems with X.Org after upgrading to FreeBSD 10.0



## Rulus (Jan 24, 2014)

Hi.

I upgraded my FreeBSD version from 9.1 to 10.0 yesterday. After recompile all ports and other stuff, I started the X server. Although it works, some weird things are happening since then:

when I use x11/dmenu, it shows around the two monitors (before the upgrade, it showed just in the monitor from which I call it)

when I stop the X server, I can't start it again, if I do, I have to power off the computer (actually, I could start it two or three times, other time all the OS went down just for press enter after stop it the first time)
sometimes, when I am doing something (last time I was reading a file with Vi), X server stops working, but when I see the log, I can't see anything strange.
I'm using Radeon drivers (x11-drivers/xf86-video-ati) with KMS.

Thanks for your help.


----------



## trh411 (Jan 24, 2014)

Rulus said:
			
		

> I'm using Radeon drivers (x11-drivers/xf86-video-ati) with KMS.


Did you rebuild x11/xorg with WITH_NEW_XORG=yes and WITH_GALLIUM=yes in your /etc/make.conf? You might want to take a look at: https://wiki.freebsd.org/Graphics

EDIT: Replaced WITH_KMS with WITH_GALLIUM. Old habits die hard.


----------



## Rulus (Jan 24, 2014)

Yes, I did, following the steps of that page.


----------



## wblock@ (Jan 24, 2014)

What video card do you have?  I've been running KMS on 10-STABLE with Radeon 4650 or 4850 cards for a while now, and it's been very stable.  Some newer cards do not have complete support, and there seem to be some problematic older cards also.

I have not used x11/dmenu, but x11-wm/devilspie can be used to control where windows open.

The issue about stopping the X server is probably just the missing console mode.  After X has been running there is no code in 9.x or 10.x yet to re-enable the console video after X has exited.  Commands typed should still work, so you can type `startx` or `shutdown -r now`.


----------



## Rulus (Jan 24, 2014)

My card is the 5750, I saw that 5770 works.

Didn't know about that port, I'll check it later, but dmenu worked well, it's weird.

When I stop the X server I can see the console, the problem comes when I type `startx` again, and the problem is that my monitors start switching between power saving and a black screen, but maybe what happens is what you say, because some times I can go back to the console by pressing keys like Ctrl + Alt + Backspace and Ctrl + C. Later I'll try to use some command when it happens.

Thanks for the tips, will test and report as soon as possible.


----------



## Rulus (Jan 25, 2014)

OK, I've been testing and I found nothing about the X server stuff, but I found something interesting about x11/dmenu.

I have seen that although Xinerama option (used for multi-monitor support) of dmenu is checked at compilation, dmenu don't uses its library once installed. I compared the Makefile of the two latest commits and, in the last one, an 
	
	



```
.if
```
 related to Xinerama (executes a command if Xinerama option is not checked, but in the latest version the command is executed always) is removed. I commented the command that in the previous commit was inside the 
	
	



```
.if
```
 and now it works well (I tried to add the 
	
	



```
.if
```
 but throwed me an error, _Malformed conditional_). Is there any reason for remove that or should I report it to somebody?

More info here: http://docs.freebsd.org/cgi/getmsg....ext/2014/svn-ports-all/20140112.svn-ports-all

I commented this line:

```
@${REINPLACE_CMD} -e 's,$${XINERAMALIBS},,g' \
            -e 's,$${XINERAMAFLAGS},,g' ${WRKSRC}/config.mk
```


----------



## wblock@ (Jan 25, 2014)

Please start a new thread about x11/dmenu.  People who know and use it are probably not looking at this thread because it is not mentioned in the subject.


----------



## Rulus (Jan 27, 2014)

wblock@ said:
			
		

> Please start a new thread about x11/dmenu.  People who know and use it are probably not looking at this thread because it is not mentioned in the subject.


I'll do it in a moment.

About the crashes, in one of them I got this:

```
[  1912.503] [mi] EQ overflowing.  Additional events will be discarded until existing events are processed.
[  1912.503] [mi] These backtraces from mieqEnqueue may point to a culprit higher up the stack.
[  1912.503] [mi] mieq is *NOT* the cause.  It is a victim.
[  1912.503] [mi] EQ overflow continuing.  100 events have been dropped.
[  1912.504] [mi] EQ overflow continuing.  200 events have been dropped.
[  1912.505] [mi] Increasing EQ size to 512 to prevent dropped events.
[  1912.505] [mi] EQ processing has resumed after 297 dropped events.
[  1912.505] [mi] This may be caused my a misbehaving driver monopolizing the server's resources.
[  1945.365] (II) AIGLX: Suspending AIGLX clients for VT switch
```
from Xorg.0.log and this:

```
drmn0: info: GPU reset succeeded, trying to resume
info: [drm] probing gen 2 caps for device 1002:5a16 = 2/0
info: [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0
info: [drm] PCIE GART of 512M enabled (table at 0x0000000000040000).
drmn0: info: WB enabled
drmn0: info: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0x0xfffff8007348bc00
drmn0: info: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0x0xfffff8007348bc0c
info: [drm] ring test on 0 succeeded in 1 usecs
info: [drm] ring test on 3 succeeded in 1 usecs
info: [drm] ib test on ring 0 succeeded in 0 usecs
info: [drm] ib test on ring 3 succeeded in 1 usecs
[mi] EQ overflowing.  Additional events will be discarded until existing events are processed.
[mi] These backtraces from mieqEnqueue may point to a culprit higher up the stack.
[mi] mieq is *NOT* the cause.  It is a victim.
[mi] EQ overflow continuing.  100 events have been dropped.
[mi] EQ overflow continuing.  200 events have been dropped.
[mi] Increasing EQ size to 512 to prevent dropped events.
[mi] EQ processing has resumed after 297 dropped events.
[mi] This may be caused my a misbehaving driver monopolizing the server's resources.
drmn0: error: GPU lockup CP stall for more than 10000msec
drmn0: warning: GPU lockup (waiting for 0x000000000011d951)
drmn0: error: failed to get a new IB (-11)
error: [drm:pid1114:radeon_cs_ib_chunk] *ERROR* Failed to get ib !
drmn0: info: Saved 4855 dwords of commands on ring 0.
drmn0: info: GPU softreset: 0x00000003
drmn0: info:   GRBM_STATUS               = 0xA0003828
drmn0: info:   GRBM_STATUS_SE0           = 0x00000007
drmn0: info:   GRBM_STATUS_SE1           = 0x00000007
drmn0: info:   SRBM_STATUS               = 0x200000C0
drmn0: info:   R_008674_CP_STALLED_STAT1 = 0x00000000
drmn0: info:   R_008678_CP_STALLED_STAT2 = 0x00010000
drmn0: info:   R_00867C_CP_BUSY_STAT     = 0x00020106
drmn0: info:   R_008680_CP_STAT          = 0x80038647
drmn0: info:   GRBM_SOFT_RESET=0x00007F6B
drmn0: info:   GRBM_STATUS               = 0x00003828
drmn0: info:   GRBM_STATUS_SE0           = 0x00000007
drmn0: info:   GRBM_STATUS_SE1           = 0x00000007
drmn0: info:   SRBM_STATUS               = 0x200000C0
drmn0: info:   R_008674_CP_STALLED_STAT1 = 0x00000000
drmn0: info:   R_008678_CP_STALLED_STAT2 = 0x00000000
drmn0: info:   R_00867C_CP_BUSY_STAT     = 0x00000000
drmn0: info:   R_008680_CP_STAT          = 0x00000000
drmn0: info: GPU reset succeeded, trying to resume
info: [drm] probing gen 2 caps for device 1002:5a16 = 2/0
info: [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0
info: [drm] PCIE GART of 512M enabled (table at 0x0000000000040000).
drmn0: info: WB enabled
drmn0: info: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0x0xfffff8007348bc00
drmn0: info: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0x0xfffff8007348bc0c
info: [drm] ring test on 0 succeeded in 1 usecs
info: [drm] ring test on 3 succeeded in 1 usecs
info: [drm] ib test on ring 0 succeeded in 0 usecs
info: [drm] ib test on ring 3 succeeded in 1 usecs
```
from X output. Any idea? it crashes a lot of times, but in theory my card is supported. Now I've disabled the acceleration to try.

Thanks.


----------



## Rulus (Jan 27, 2014)

Ok, in the last eight hours I had no problems. Seems that setting the "NoAccel" flag to "true" in xorg.conf fixes the problem. Maybe Asus changes the card (that I have) in some way, I don't know, but I'll wait for a real fix for this.

I'll wait one or two days and if I have no problems I will mark the post as solved.

Regards.


----------



## robert1307 (Mar 12, 2014)

Have same issue after upgrading to 10.0. Last messages from Xorg.log:


```
[ 39470.187] [mi] EQ overflowing.  Additional events will be discarded until existing events are processed.
[ 39470.187] [mi] These backtraces from mieqEnqueue may point to a culprit higher up the stack.
[ 39470.187] [mi] mieq is *NOT* the cause.  It is a victim.
[ 39470.587] [mi] EQ overflow continuing.  100 events have been dropped.
[ 39471.235] [mi] EQ overflow continuing.  200 events have been dropped.
[ 39471.635] [mi] EQ overflow continuing.  300 events have been dropped.
[ 39472.035] [mi] EQ overflow continuing.  400 events have been dropped.
[ 39472.603] [mi] EQ overflow continuing.  500 events have been dropped.
[ 39473.003] [mi] EQ overflow continuing.  600 events have been dropped.
[ 39473.563] [mi] EQ overflow continuing.  700 events have been dropped.
```

Going to set NoAccel to true. Will update this thread after week of testing.


----------



## robert1307 (Mar 23, 2014)

Yep, that did the trick. It also solved 100% CPU usage in Firefox when scrolling the page.


----------



## hruodr (Mar 29, 2014)

wblock@ said:
			
		

> The issue about stopping the X server is probably just the missing console mode.  After X has been running there is no code in 9.x or 10.x yet to re-enable the console video after X has exited.  Commands typed should still work, so you can type `startx` or `shutdown -r now`.



I installed FreeBSD 10.0 on this hardware: http://www.asus.com/Motherboards/E35M1M/.

After `xinit&` and noting that the mouse does not work, I get only a black screen with `Ctrl-Alt-F1`. I cannot
go back to a console to fix the problems.

With `shutdown -p now`, I get the typical 





> peep


, but the system does not power off. And after switching off
and reboot I get the message that / was unproperly unmounted.

It is frustrating! Since I installed FreeBSD again after some years, I see only problems.

Is there a better solution than to continue using OpenBSD and to forget FreeBSD?

Rodrigo.


----------



## wblock@ (Mar 29, 2014)

Upgrade to 10-STABLE, which now has support for vt(9), the graphical console driver.  It also requires building a custom kernel as shown in the /usr/src/sys/amd64/conf/VT example.

It has worked for me on an AMD A8-3850 processor with a 6550D APU, on an i5 with built-in graphics, and on a different i5 with several 4000- and 5000-series graphics cards.  X works, console works in graphics mode, and switching between the two works.


----------



## hruodr (Apr 2, 2014)

wblock@ said:
			
		

> Upgrade to 10-STABLE, which now has support for vt(9), the graphical console driver.  It also requires building a custom kernel as shown in the /usr/src/sys/amd64/conf/VT example.



Thanks. The fonts are not sharp, but after starting X and changing to console, I get very sharp fonts, but small. Is there a way of making fonts bigger / changing fonts?

Putting `hw.vga.textmode=1` in loader.conf I get normal fonts in the console, but then (1) `moused` does not work in the console and (2) `xinit` makes the system crash.

The mouse under X works after adding 


```
hald_enable="YES"
dbus_enable="YES"
```
in rc.conf, but then I have continously problems with the mouse that stop working. I get messages like:


```
sysmouse: unknown ioctl: t:40007413
sysmouse: unknown ioctl: t:40007413
sysmouse: unknown ioctl: t:80007410
ugen2.2: <MOON> at usbus2 (disconnected)
ums0: at uhub2, port 2, addr 2 (disconnected)
ugen2.2: <MOON> at usbus2
ums0: <MOON AND, class 0/0, rev 1.00/0.10, addr 2> on usbus2
ums0: 3 buttons and [XYZ] coordinates ID=0
sysmouse: unknown ioctl: t:40007413
sysmouse: unknown ioctl: t:40007413
sysmouse: unknown ioctl: t:80007410
ugen2.2: <MOON> at usbus2 (disconnected)
ugen2.2: <MOON> at usbus2 (disconnected)
```

I think, under these circumstances it is still not the time to switch to FreeBSD. But I will continue to update the local svn mirror and try to experiment.

I would realy like a meager system. Unfortunately there is no good browser for plan9.

Rodrigo


----------



## wblock@ (Apr 2, 2014)

There's a little information on Newcons here: https://wiki.freebsd.org/Newcons.  Man pages are only now being started.

If you want a small system, don't use HAL.  Turn off the option in x11-servers/xorg-server and it can be avoided.  Gnome and KDE still require it, but those are not small systems.

I haven't had a problems with using the mouse in the console, but have not tried it much.  The unknown ioctl messages go to console ttyv0 along with other system messages.  I suspect they are compatibility issues from the old console, but not serious ones.


----------



## hruodr (Apr 3, 2014)

wblock@ said:
			
		

> There's a little information on Newcons here: https://wiki.freebsd.org/Newcons.  Man pages are only now being If you want a small system, don't use HAL.  Turn off the option in x11-servers/xorg-server and it can be avoided.  Gnome and KDE still require it, but those are not small systems.ones.



OK, I will disable HAL with `make config` in /usr/ports/x11/xorg-servers the next time I compile X.

`make config` answers "No options to configure" in /usr/ports/x11/xorg, and I would preffer to compile this for having all standard X.

Is there a port containing the standard X clients? Like xterm, twm, xclock, xman, etc? The ones that usualy come with X? 

Why is X so split in many ports? Why Ctr-Alt-Del does not work by default? Why `xinit` brings a black background (that may be obtained with `xsetroot -solid black`) instead of the usual grid? To make it more complicated? To make problems bigger when one has problems with X?

I deleted hald_enable="YES" and dbus_enable="YES" from /etc/rc.conf, and did usual configuration with  `Xorg -configure`. I did get a `xorg.conf` file. But I get an error and core dump when I configure, here the last messages in Xorg.0.log:


```
[  1063.012] (**) ModulePath set to "/usr/local/lib/xorg/modules"
[  1063.012] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vm
mouse' will be disabled.
[  1063.012] (WW) Disabling Mouse0
[  1063.012] (WW) Disabling Keyboard0
[  1063.012] (II) [KMS] No DRICreatePCIBusID symbol, no kernel modesetting.
[  1063.013] Segmentation fault at address 0x0
[  1063.013] 
Fatal server error:
[  1063.013] Caught signal 11 (Segmentation fault). Server aborting
```

The mouse works only after adding the following to /etc/X11/xorg.conf:


```
Section "ServerFlags"
    Option "AutoAddDevices" "False"
EndSection
```

Using the wheel lames the mouse for a while. Do I need to change something in 


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

???


Thanks
Rodrigo.


----------



## SirDice (Apr 3, 2014)

hruodr said:
			
		

> `make config` answers "No options to configure" in x11/xorg, and I would prefer to compile this for having all standard X.


The x11/xorg port is a so-called "meta-port". It doesn't contain anything of itself, it merely depends on other ports. So this port doesn't have anything to configure. What would work is using `make config-recursive`. That will run `make config` on the port and all its dependencies. 



> Is there a port containing the standard X clients? Like xterm, twm, xclock, xman, etc? The ones that usualy come with X? Why is X so split in many ports?


That's because of the way Xorg is written. Back before Xorg 7.x and with the old XFree86 you had a single monolithic port that installed everything (xterm, TWM, etc). But it was continuously out of date (you can still notice that with x11/xterm for example) and you had to rebuild the whole thing from scratch, including the parts that weren't updated like TWM. At some point Xorg moved everything to separate modules, and thus we had separate ports. The plus side of this is that it's now possible to create a very minimalistic installation using only the bare necessities (x11/xorg-minimal for example). Something that simply wasn't possible with the old monolithic builds. And you can now simply update x11/xterm without having to rebuild everything else too.


----------



## wblock@ (Apr 3, 2014)

hruodr said:
			
		

> `make config` answers "No options to configure" in /usr/ports/x11/xorg, and I would preffer to compile this for having all standard X.



x11-servers/xorg-server is the only part of X that uses HAL.



> ```
> [  1063.012] (**) ModulePath set to "/usr/local/lib/xorg/modules"
> [  1063.012] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vm
> mouse' will be disabled.
> ...



That says no kernel modesetting, which could mean several things.  Have you installed the KMS drivers?  Have you updated the system but not rebuilt the KMS drivers yet?


----------



## hruodr (Apr 4, 2014)

wblock@ said:
			
		

> hruodr said:
> 
> 
> 
> ...



I didnt find something like KMS in GENERIC and I did delete a lot of things there. In spite of it, I get in /boot/kernel a lot of modules with kms. I did in the console

`kldload radeonkms.ko`

and got the nice small sharp font. After that I gave again `Xorg -config` and got exactly the same error with core dumping.

By the way, how do I compile `kms` in the kernel? `man -k kms` brings no answer.

Thanks again!
Rodrigo.


----------



## wblock@ (Apr 4, 2014)

There is a link to the wiki page in post #2.  The specific link to building the KMS drivers is https://wiki.freebsd.org/Graphics#Installing_KMS_Ports.


----------



## SirDice (Apr 4, 2014)

hruodr said:
			
		

> I didn't find something like KMS in GENERIC and I did delete a lot of things there. In spite of it, I get in /boot/kernel a lot of modules with kms.


I'm not sure if you are aware of this but please do not edit or otherwise modify GENERIC. When we see GENERIC in a `uname -a` output we expect it to have the original options, settings and devices. There's no way to tell you're actually running a custom kernel. Please make a copy of GENERIC, rename it and modify its ident line. This will avoid any confusion.


----------



## hruodr (Apr 4, 2014)

wblock@ said:
			
		

> There is a link to the wiki page in post #2.  The specific link to building the KMS drivers is https://wiki.freebsd.org/Graphics#Installing_KMS_Ports.



Yes, I did that. The errors are in spite of it.



			
				SirDice said:
			
		

> I'm not sure if you are aware of this but please do not edit or otherwise modify GENERIC.



Of course modified a copy of GENERIC, not GENERIC.

Rodrigo.


----------

