Deal with DPMS in xf86-input driver

Peter Hutterer peter.hutterer at
Tue Oct 22 16:16:51 PDT 2013

On Tue, Oct 22, 2013 at 06:09:24PM +0000, Kautschitz Horst wrote:
> We are using an embedded Platform with X11R7.7 without Window Manager.
> The input is done over a Touchscreen with the xf86-input-tslib driver.
> The behaviour until now is that a touch (click) on the touchscreen generates an input event when dpms is active.
> This behaviour should be changed in such way that no touch(click) event should occur and screen should go on when dpms is active
> This has to be done because an operation  could start.
> So i want to implement following behaviour in the xf86-input-tslib driver.
> -          Check if dpms is active
> -          If dpms active - switch monitor to on
> o   -> force dpms mode to or simply create a moving event - no "click" should be announced
> I tried to implement this by using the DPMS Functions.
>          if (DPMSQueryExtension(dpy, &dummy, &dummy))
>             if (DPMSCapable(dpy)) {
>               DPMSInfo(dpy, &state, &onoff);
>               if (onoff) {
>                 ErrorF("DPMS is Enabled");
>                 switch (state) {
>                   case DPMSModeOn:
>                        ErrorF("  Monitor is On");
> ....
> My problem is that getting dpy in the driver breaks the xserver itself and i have no intention why. I also get no information why this happens until now.
>  dpy = XOpenDisplay(dpyName);
> Does anyone know a better way how to deal with such a behaviour?
> Is creating a socket to the XServer allowed in a driver?
> I also checked other input drivers but didn't find a starting point.

don't mix client and driver code, it leads to unhappiness. the driver is
loaded as module into the server, so you have access to anything inside the
server. Have a look at xserver/Xext/dpms.c, that's the entry point for the
dpms protocol. From there you can see what the server does in response to
the protocol requests - you can do the same from within the driver.

More information about the xorg mailing list