# Can't start second X server with Intel KMS (WITH_NEW_XORG)



## leet (Jul 24, 2014)

Hi

I can't start more than one X server, the driver sees the /dev/dri/card0, but does not open it. 

```
(EE) No devices detected
```
Full X log: http://pastebin.com/s68SbjJ6

I don't really know how this works, but I suspect that the device is locked by the already running X. Is multiple X servers with DRI possible at all with KMS driver? I must be missing something. It sure is working with NVidia blobs. Haven't tested anything else yet.

I'm on i386 9.3-RELEASE, kernel built with vt(4), i915kms loaded. I have multiple inactive ttys defined in /etc/ttys for X to use. Don't have an xorg.conf.  No HAL, DBus installed, devd is used for input devices.


----------



## leet (Jul 24, 2014)

*Re: Can't start second X server with Intel KMS (WITH_NEW_XOR*

Every time VT is switched Xorg prints the following:


```
[ 22244.394] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 22244.395] (WW) intel(0): drmDropMaster failed: Unknown error: -22
[ 22244.419] (II) AIGLX: Resuming AIGLX clients after VT switch
[ 22245.134] (II) intel(0): EDID vendor "DEL", prod id 41081
[ 22245.134] (II) intel(0): Using hsync ranges from config file
[ 22245.135] (II) intel(0): Using vrefresh ranges from config file
[ 22245.135] (II) intel(0): Printing DDC gathered Modelines:
```

New X startup attempt also triggers VT switch. I suppose this is the core of the problem. Intel driver can't release the card on VT switch.


----------



## leet (Jul 24, 2014)

*Re: Can't start second X server with Intel KMS (WITH_NEW_XOR*

I've turned on the dri debug with `sysctl hw.dri.debug=1` and saw that the kernel driver is failing this one:

```
[drm:pid4423:drm_dropmaster_ioctl] dropmaster
[drm:pid4423:drm_ioctl]     returning -22
```

I guess the drmDropMaster call to the kernel driver from X is not implemented yet.


> 4. I cannot switch back to the text console. Or, immediately after loading the driver, the console went black.
> 
> The VT switching code is not implemented (yet). In fact, the real cause is that driver turns on modesetting right after the load. This way, it is easier for me to test the driver. Eventually, this will be changed.


https://wiki.freebsd.org/Intel_GPU

So we need the VT switch code for multiple X instances too on Intel graphics. I hope the mighty devs will have the time for this.  §e


----------

