xf86Xinput: Modify API for server-managed fd support
With systemd-logind support, the xserver, rather than the drivers will be responsible for opening/closing the fd for input devices. This commit adds a new capabilities field to the InputDriverRec and a XI86_DRV_CAP_SERVER_FD flag for drivers to indicate that they support server managed fds. This commit adds a new XI86_SERVER_FD flag to indicate to drivers when the server is managing the fd and they should not open/close it. Note that even if drivers declare they support server managed fds there is no guarantee they will actually get them. Since this changes the input driver ABI, this commit bumps it. systemd-logind tracks devices by their chardev major + minor numbers, since we are breaking ABI anyways also add major and minor fields for easy storage / retrieval of these. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6b79f28f5c
commit
3346166a65
|
@ -81,7 +81,7 @@ typedef enum {
|
|||
*/
|
||||
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
|
||||
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(15, 0)
|
||||
#define ABI_XINPUT_VERSION SET_ABI_VERSION(20, 0)
|
||||
#define ABI_XINPUT_VERSION SET_ABI_VERSION(21, 0)
|
||||
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(8, 0)
|
||||
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
|
||||
|
||||
|
|
|
@ -949,6 +949,12 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
|
|||
goto unwind;
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(key, "major") == 0)
|
||||
pInfo->major = atoi(value);
|
||||
|
||||
if (strcmp(key, "minor") == 0)
|
||||
pInfo->minor = atoi(value);
|
||||
}
|
||||
|
||||
nt_list_for_each_entry(option, options, list.next) {
|
||||
|
|
|
@ -64,6 +64,10 @@
|
|||
/* 0x08 is reserved for legacy XI86_SEND_DRAG_EVENTS, do not use for now */
|
||||
/* server-internal only */
|
||||
#define XI86_DEVICE_DISABLED 0x10 /* device was disabled before vt switch */
|
||||
#define XI86_SERVER_FD 0x20 /* fd is managed by xserver */
|
||||
|
||||
/* Input device driver capabilities */
|
||||
#define XI86_DRV_CAP_SERVER_FD 0x01
|
||||
|
||||
/* This holds the input driver entry and module information. */
|
||||
typedef struct _InputDriverRec {
|
||||
|
@ -76,6 +80,7 @@ typedef struct _InputDriverRec {
|
|||
struct _InputInfoRec * pInfo, int flags);
|
||||
void *module;
|
||||
const char **default_options;
|
||||
int capabilities;
|
||||
} InputDriverRec, *InputDriverPtr;
|
||||
|
||||
/* This is to input devices what the ScrnInfoRec is to screens. */
|
||||
|
@ -96,6 +101,8 @@ typedef struct _InputInfoRec {
|
|||
int *valuators, int first_valuator, int num_valuators);
|
||||
|
||||
int fd;
|
||||
int major;
|
||||
int minor;
|
||||
DeviceIntPtr dev;
|
||||
void *private;
|
||||
const char *type_name;
|
||||
|
|
Loading…
Reference in New Issue