[PATCH 00/19] Input driver API rework and cleanup
As I have mentioned in the past, the input driver API is in need of a cleanup. For those easily amused, I recommend going through the input device addition process where one can find gimmicks such as the DIX calling the DDX which calls the driver to call back into the DDX to allocate a struct then handed to the driver to be used by the DIX. Or so, sometimes I get confused figuring this out in detail. This set of patches provides some of this cleanup, including a new input API. [PATCH 02/19] xfree86: rework driver PreInit API - XInput ABI 12 is the main one to look at here, the rest is just throwing out unnecessary stuff. All input drivers will need adjusting to this new API though the impact is relatively small, wacom will likely be the one most affected by it. I've ported evdev and synaptics already, the main evdev patch can be seen here: http://cgit.freedesktop.org/~whot/xf86-input-evdev/commit/?id=92e8dc49611398c8a9659b244645530cd26736fe Most notably, the effort required to support in-driver hotplugging is now much less (patches for that separately). Obviously, this work is aimed for server 1.10. It's available on the input-api branch in my personal repo, same for the evdev patches. Cheers, Peter The following changes since commit 750d4e82a0c1161292d24216bcff200cd6647611: XQuartz: xpbproxy: Don't take down the whole server on an IO error (2010-07-29 11:41:32 -0700) are available in the git repository at: git://people.freedesktop.org/~whot/xserver.git input-api Peter Hutterer (18): xfree86: fix compiler warning about implicied decl of DuplicateModule. xfree86: rework driver PreInit API - XInput ABI 12 config: expose config_info as an input option. xfree86: make xf86ActivateDevice static. xfree86: remove superflous assignments. input: Purge Register*Device() functions. xfree86: purge some unused defines. xfree86: remove XI86_CONFIGURED flag. xfree86: purge SendDragEvents support. input: set XKB extension for all new devices, not just xfree86 ones. xfree86: return the device from xf86ActivateDevice. xfree86: move xf86AllocateInput and xf86DeleteInput to xf86Xinput.c xfree86: add xf86IDrvMsg and friends for input driver logging. xfree86: remove LocalDeviceRec/Ptr definition. xfree86: remove unused DeviceAssocRec struct. xfree86: purge superfluous includes from xf86Xinput.c input: remove OpenInputDevice and CloseInputDevice DDX hooks. input: Purge AddOtherInputDevices DDX hook. Simon Thum (1): xfree86: Fix xf86 backend-specific input initialization Xi/closedev.c|1 - Xi/exevents.c|7 - Xi/listdev.c |3 - Xi/opendev.c |1 - Xi/stubs.c | 90 - config/hal.c |6 +- config/udev.c|7 +- dix/devices.c| 18 +-- doc/xml/Xserver-spec.xml | 25 --- hw/dmx/doc/dmx.xml | 14 +-- hw/dmx/input/dmxinputinit.c |8 +- hw/dmx/input/dmxxinput.c | 17 -- hw/kdrive/src/kinput.c | 32 hw/vfb/InitInput.c |2 - hw/xfree86/common/xf86Config.c |1 - hw/xfree86/common/xf86Helper.c | 111 hw/xfree86/common/xf86InPriv.h |3 - hw/xfree86/common/xf86Module.h |2 +- hw/xfree86/common/xf86Xinput.c | 333 ++ hw/xfree86/common/xf86Xinput.h | 68 +++ hw/xfree86/doc/devel/Registry|1 - hw/xfree86/doc/man/xorg.conf.man.pre |3 - hw/xquartz/darwin.c |5 - hw/xquartz/darwinXinput.c| 72 hw/xwin/InitInput.c |4 - include/XIstubs.h| 14 -- include/exevents.h |4 - include/input.h |6 - 28 files changed, 252 insertions(+), 606 deletions(-) ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 02/19] xfree86: rework driver PreInit API - XInput ABI 12
The main change introduced in this patch is the removal of the back-and-forth between DDX and the driver. The DDX now allocates the InputInfoRec and fills it with default values. The DDX processes common options (and module-specific default options, if appropriate) before passing the initialised struct to the driver. The driver may do module-specific initializations and return Success or an error code in the case of a failure. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Helper.c | 22 +- hw/xfree86/common/xf86Module.h |2 +- hw/xfree86/common/xf86Xinput.c | 10 ++ hw/xfree86/common/xf86Xinput.h |7 --- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 07f9f0a..897aaf3 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -276,7 +276,7 @@ xf86AllocateScrnInfoPrivateIndex(void) /* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */ InputInfoPtr -xf86AllocateInput(InputDriverPtr drv, int flags) +xf86AllocateInput(InputDriverPtr drv, IDevPtr idev) { InputInfoPtr new, *prev = NULL; @@ -293,6 +293,26 @@ xf86AllocateInput(InputDriverPtr drv, int flags) *prev = new; new-next = NULL; +new-fd = -1; +new-name = idev-identifier; +new-type_name = UNKNOWN; +new-device_control = NULL; +new-read_input = NULL; +new-history_size = 0; +new-control_proc = NULL; +new-close_proc = NULL; +new-switch_mode = NULL; +new-conversion_proc = NULL; +new-reverse_conversion_proc = NULL; +new-dev = NULL; +new-private_flags = 0; +new-always_core_feedback = NULL; +new-private = NULL; +new-conf_idev = idev; + +xf86CollectInputOptions(new, (const char**)drv-default_options, NULL); +xf86ProcessCommonOptions(new, new-options); + return new; } diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 51b9b16..aed2edc 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -83,7 +83,7 @@ typedef enum { */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) #define ABI_VIDEODRV_VERSION SET_ABI_VERSION(8, 0) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(11, 0) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 0) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index dc9be2b..7b7f70c 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -779,11 +779,13 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) goto unwind; } -pInfo = drv-PreInit(drv, idev, 0); +if (!(pInfo = xf86AllocateInput(drv, idev))) + goto unwind; -if (!pInfo) { -xf86Msg(X_ERROR, PreInit returned NULL for \%s\\n, idev-identifier); -rval = BadMatch; +rval = drv-PreInit(drv, pInfo, 0); + +if (rval != Success) { +xf86Msg(X_ERROR, PreInit returned %d for \%s\\n, rval, idev-identifier); goto unwind; } else if (!(pInfo-flags XI86_CONFIGURED)) { diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 20a3f1b..6789df6 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -97,13 +97,14 @@ typedef struct _InputDriverRec { intdriverVersion; char * driverName; void (*Identify)(int flags); -struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv, - IDevPtr dev, int flags); +int(*PreInit)(struct _InputDriverRec *drv, + struct _LocalDeviceRec* pInfo, int flags); void (*UnInit)(struct _InputDriverRec *drv, struct _LocalDeviceRec *pInfo, int flags); pointermodule; intrefCount; +char **default_options; } InputDriverRec, *InputDriverPtr; /* This is to input devices what the ScrnInfoRec is to screens. */ @@ -202,7 +203,7 @@ int xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL is_auto); /* xf86Helper.c */ extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags); extern _X_EXPORT void xf86DeleteInputDriver(int drvIndex); -extern _X_EXPORT InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags); +extern _X_INTERNAL InputInfoPtr xf86AllocateInput(InputDriverPtr drv, IDevPtr idev); extern _X_EXPORT InputDriverPtr xf86LookupInputDriver(const char *name); extern _X_EXPORT InputInfoPtr xf86LookupInput(const char *name); extern _X_EXPORT void xf86DeleteInput(InputInfoPtr pInp, int
[PATCH 03/19] config: expose config_info as an input option.
config_info is the only reliable indicator we have in the server for duplicate devices (drivers can test for maj/min on fds as well). Don't set this after the device has been initialized but assume it's important enough to set during NIDR. This makes the option config_info available to the drivers as well. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- config/hal.c |6 +- config/udev.c |7 ++- hw/xfree86/common/xf86Xinput.c |1 + 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/config/hal.c b/config/hal.c index b70488b..6e2850c 100644 --- a/config/hal.c +++ b/config/hal.c @@ -376,6 +376,7 @@ device_added(LibHalContext *hal_ctx, const char *udi) add_option(options, xkb_model, xkb_opts.model); if (xkb_opts.options) add_option(options, xkb_options, xkb_opts.options); +add_option(options, config_info, config_info); /* this isn't an error, but how else do you output something that the user can see? */ LogMessage(X_INFO, config/hal: Adding input device %s\n, name); @@ -385,11 +386,6 @@ device_added(LibHalContext *hal_ctx, const char *udi) goto unwind; } -for (; dev; dev = dev-next){ -free(dev-config_info); -dev-config_info = strdup(config_info); -} - unwind: if (set) libhal_free_property_set(set); diff --git a/config/udev.c b/config/udev.c index 9934490..cd46eec 100644 --- a/config/udev.c +++ b/config/udev.c @@ -189,17 +189,14 @@ device_added(struct udev_device *udev_device) } } +add_option(options, config_info, config_info); + LogMessage(X_INFO, config/udev: Adding input device %s (%s)\n, name, path); rc = NewInputDeviceRequest(options, attrs, dev); if (rc != Success) goto unwind; -for (; dev; dev = dev-next) { -free(dev-config_info); -dev-config_info = strdup(config_info); -} - unwind: free(config_info); while (!dev (tmpo = options)) { diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 7b7f70c..0cdaf03 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -357,6 +357,7 @@ xf86ActivateDevice(LocalDevicePtr local) dev-deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev-deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; +dev-config_info = xf86SetStrOption(local-options, config_info, NULL); RegisterOtherDevice(dev); XkbSetExtension(dev, ProcessKeyboardEvent); -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 04/19] xfree86: make xf86ActivateDevice static.
No-one but the joystick driver uses it and that one should be using NIDR instead. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86InPriv.h |3 --- hw/xfree86/common/xf86Xinput.c |2 +- hw/xfree86/common/xf86Xinput.h |1 - 3 files changed, 1 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/common/xf86InPriv.h b/hw/xfree86/common/xf86InPriv.h index 3838d69..1b9b502 100644 --- a/hw/xfree86/common/xf86InPriv.h +++ b/hw/xfree86/common/xf86InPriv.h @@ -37,9 +37,6 @@ extern InputDriverPtr *xf86InputDriverList; extern int xf86NumInputDrivers; -/* xf86Xinput.c */ -int xf86ActivateDevice(InputInfoPtr pInfo); - /* xf86Helper.c */ InputDriverPtr xf86LookupInputDriver(const char *name); diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 0cdaf03..57c866d 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -328,7 +328,7 @@ xf86ProcessCommonOptions(LocalDevicePtr local, * Returns TRUE on success, or FALSE otherwise. *** */ -int +static int xf86ActivateDevice(LocalDevicePtr local) { DeviceIntPtr dev; diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 6789df6..3c1a147 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -184,7 +184,6 @@ extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_co int *valuators); extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down); -extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local); extern _X_EXPORT LocalDevicePtr xf86FirstLocalDevice(void); extern _X_EXPORT int xf86ScaleAxis(int Cx, int Sxhigh, int Sxlow, int Rxhigh, int Rxlow); extern _X_EXPORT void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y); -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 05/19] xfree86: remove superflous assignments.
ActivateGrab and DeactivateGrab are set in AddInputDevice() already. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/kdrive/src/kinput.c |4 hw/xfree86/common/xf86Xinput.c |2 -- 2 files changed, 0 insertions(+), 6 deletions(-) diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 80a1458..fcb02b5 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -943,8 +943,6 @@ KdAddKeyboard (KdKeyboardInfo *ki) return !Success; } -ki-dixdev-deviceGrab.ActivateGrab = ActivateKeyboardGrab; -ki-dixdev-deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; RegisterOtherDevice(ki-dixdev); #ifdef DEBUG @@ -1014,8 +1012,6 @@ KdAddPointer (KdPointerInfo *pi) return BadDevice; } -pi-dixdev-deviceGrab.ActivateGrab = ActivatePointerGrab; -pi-dixdev-deviceGrab.DeactivateGrab = DeactivatePointerGrab; RegisterOtherDevice(pi-dixdev); for (prev = kdPointers; *prev; prev = (*prev)-next); diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 57c866d..65eea0e 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -355,8 +355,6 @@ xf86ActivateDevice(LocalDevicePtr local) dev-type = SLAVE; dev-spriteInfo-spriteOwner = FALSE; -dev-deviceGrab.ActivateGrab = ActivateKeyboardGrab; -dev-deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; dev-config_info = xf86SetStrOption(local-options, config_info, NULL); RegisterOtherDevice(dev); -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 06/19] input: Purge Register*Device() functions.
RegisterPointerDevice() and RegisterKeyboardDevice() were already mapped to RegisterOtherDevice() and obsolete. RegisterOtherDevice() was called for all devices and the two assignments can simply be moved into AddInputDevice(). Purge RegisterOtherDevice() and pretend it never happened. *lalalalala* Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- Xi/exevents.c |7 --- Xi/stubs.c |1 - dix/devices.c | 17 +++-- doc/xml/Xserver-spec.xml | 25 - hw/dmx/doc/dmx.xml | 14 +- hw/dmx/input/dmxinputinit.c|8 +--- hw/kdrive/src/kinput.c |4 hw/vfb/InitInput.c |2 -- hw/xfree86/common/xf86Xinput.c |1 - hw/xquartz/darwin.c|5 - hw/xquartz/darwinXinput.c |1 - hw/xwin/InitInput.c|4 include/exevents.h |4 include/input.h|6 -- 14 files changed, 5 insertions(+), 94 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index e990aeb..7eb67ff 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -111,13 +111,6 @@ XIShouldNotify(ClientPtr client, DeviceIntPtr dev) return 0; } -void -RegisterOtherDevice(DeviceIntPtr device) -{ -device-public.processInputProc = ProcessOtherEvent; -device-public.realInputProc = ProcessOtherEvent; -} - Bool IsPointerEvent(InternalEvent* event) { diff --git a/Xi/stubs.c b/Xi/stubs.c index 296a8c4..de80042 100644 --- a/Xi/stubs.c +++ b/Xi/stubs.c @@ -122,7 +122,6 @@ AddOtherInputDevices(void) dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE); dev-public.devicePrivate = private; -RegisterOtherDevice(dev); dev-inited = ((*dev-deviceProc)(dev, DEVICE_INIT) == Success); / diff --git a/dix/devices.c b/dix/devices.c index ac5806a..aea5778 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -261,8 +261,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) if (!dev) return (DeviceIntPtr)NULL; dev-id = devid; -dev-public.processInputProc = (ProcessInputProc)NoopDDA; -dev-public.realInputProc = (ProcessInputProc)NoopDDA; +dev-public.processInputProc = ProcessOtherEvent; +dev-public.realInputProc = ProcessOtherEvent; dev-public.enqueueInputProc = EnqueueEvent; dev-deviceProc = deviceProc; dev-startup = autoStart; @@ -272,6 +272,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) dev-deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev-deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; + dev-coreEvents = TRUE; /* sprite defaults */ @@ -1106,18 +1107,6 @@ NumMotionEvents(void) return inputInfo.pointer-valuator-numMotionEvents; } -void -RegisterPointerDevice(DeviceIntPtr device) -{ -RegisterOtherDevice(device); -} - -void -RegisterKeyboardDevice(DeviceIntPtr device) -{ -RegisterOtherDevice(device); -} - int dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode) { diff --git a/doc/xml/Xserver-spec.xml b/doc/xml/Xserver-spec.xml index 466b79d..26c89a4 100644 --- a/doc/xml/Xserver-spec.xml +++ b/doc/xml/Xserver-spec.xml @@ -1703,8 +1703,6 @@ Input initialization is a bit complicated. It all starts with InitInput(), a routine that you write to call AddInputDevice() twice (once for pointing device and once for keyboard.) -You also want to call RegisterKeyboardDevice() and RegisterPointerDevice() -on them. /para para When you Add the devices, a routine you supply for each device @@ -1724,8 +1722,6 @@ the pointer is the pointer. InitInput is a DDX routine you must write to initialize the input subsystem in DDX. It must call AddInputDevice() for each device that might generate events. -In addition, you must register the main keyboard and pointing devices by -calling RegisterPointerDevice() and RegisterKeyboardDevice(). /para para blockquoteprogramlisting @@ -1748,25 +1744,6 @@ Note also that except for the main keyboard and pointing device, an extension is needed to provide for a client interface to a device. /para para -blockquoteprogramlisting - - void RegisterPointerDevice(device) - DevicePtr device; -/programlisting/blockquote -RegisterPointerDevice is a DIX routine that your DDX code calls that -makes that device the main pointing device. -This routine is called once upon initialization and cannot be called again. -/para -para -blockquoteprogramlisting - - void RegisterKeyboardDevice(device) - DevicePtr device; -/programlisting/blockquote -RegisterKeyboardDevice makes the given device the main keyboard. -This routine is called once upon initialization and cannot be called again. -/para -para The following DIX procedures return the specified DevicePtr. They may or may not be useful
[PATCH 07/19] xfree86: purge some unused defines.
These defines have been write-only for a while now. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Xinput.h |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 3c1a147..1b71c64 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -59,7 +59,6 @@ #include XIstubs.h /* Input device flags */ -#define XI86_OPEN_ON_INIT 0x01 /* open the device at startup time */ #define XI86_CONFIGURED 0x02 /* the device has been configured */ #define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */ /* the device sends Xinput and core pointer events */ @@ -72,10 +71,6 @@ * is common due to the user's finger moving slightly. */ #define XI86_SEND_DRAG_EVENTS 0x08 -#define XI86_CORE_POINTER 0x10 /* device is the core pointer */ -#define XI86_CORE_KEYBOARD 0x20 /* device is the core keyboard */ -#define XI86_POINTER_CAPABLE 0x40 /* capable of being a core pointer */ -#define XI86_KEYBOARD_CAPABLE 0x80 /* capable of being a core keyboard */ #define XI_PRIVATE(dev) \ (((LocalDevicePtr)((dev)-public.devicePrivate))-private) -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 08/19] xfree86: remove XI86_CONFIGURED flag.
PreInit returns a status code. Let's use that instead of having it report Success in some cases but not set the XI86_CONFIGURED flag and thus signal an init failure. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Xinput.c | 52 --- hw/xfree86/common/xf86Xinput.h |1 - 2 files changed, 21 insertions(+), 32 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 0a0de8e..1f095d4 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -333,36 +333,32 @@ xf86ActivateDevice(LocalDevicePtr local) { DeviceIntPtr dev; -if (local-flags XI86_CONFIGURED) { -dev = AddInputDevice(serverClient, local-device_control, TRUE); +dev = AddInputDevice(serverClient, local-device_control, TRUE); -if (dev == NULL) -{ -xf86Msg(X_ERROR, Too many input devices. Ignoring %s\n, -local-name); -local-dev = NULL; -return FALSE; -} +if (dev == NULL) +{ +xf86Msg(X_ERROR, Too many input devices. Ignoring %s\n, +local-name); +local-dev = NULL; +return FALSE; +} -local-atom = MakeAtom(local-type_name, - strlen(local-type_name), - TRUE); -AssignTypeAndName(dev, local-atom, local-name); -dev-public.devicePrivate = (pointer) local; -local-dev = dev; - -dev-coreEvents = local-flags XI86_ALWAYS_CORE; -dev-type = SLAVE; -dev-spriteInfo-spriteOwner = FALSE; +local-atom = MakeAtom(local-type_name, strlen(local-type_name), TRUE); +AssignTypeAndName(dev, local-atom, local-name); +dev-public.devicePrivate = local; +local-dev = dev; -dev-config_info = xf86SetStrOption(local-options, config_info, NULL); +dev-coreEvents = local-flags XI86_ALWAYS_CORE; +dev-type = SLAVE; +dev-spriteInfo-spriteOwner = FALSE; -XkbSetExtension(dev, ProcessKeyboardEvent); +dev-config_info = xf86SetStrOption(local-options, config_info, NULL); -if (serverGeneration == 1) -xf86Msg(X_INFO, XINPUT: Adding extended input device \%s\ (type: %s)\n, -local-name, local-type_name); -} +XkbSetExtension(dev, ProcessKeyboardEvent); + +if (serverGeneration == 1) +xf86Msg(X_INFO, XINPUT: Adding extended input device \%s\ (type: %s)\n, +local-name, local-type_name); return TRUE; } @@ -786,12 +782,6 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) xf86Msg(X_ERROR, PreInit returned %d for \%s\\n, rval, idev-identifier); goto unwind; } -else if (!(pInfo-flags XI86_CONFIGURED)) { -xf86Msg(X_ERROR, PreInit failed for input device \%s\\n, -idev-identifier); -rval = BadMatch; -goto unwind; -} if (!xf86ActivateDevice(pInfo)) { diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 1b71c64..7528a51 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -59,7 +59,6 @@ #include XIstubs.h /* Input device flags */ -#define XI86_CONFIGURED 0x02 /* the device has been configured */ #define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */ /* the device sends Xinput and core pointer events */ #define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 09/19] xfree86: purge SendDragEvents support.
From the documentation: This is mainly to allow a touch screen to be used with netscape and other browsers which do strange things if the mouse moves between button down and button up. CLOSED - NOTOURBUG Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Xinput.c | 25 + hw/xfree86/common/xf86Xinput.h |8 hw/xfree86/doc/devel/Registry|1 - hw/xfree86/doc/man/xorg.conf.man.pre |3 --- 4 files changed, 1 insertions(+), 36 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 1f095d4..d45e3d1 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -276,17 +276,6 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ } } -static Bool -xf86SendDragEvents(DeviceIntPtrdevice) -{ -LocalDevicePtr local = (LocalDevicePtr) device-public.devicePrivate; - -if (device-button device-button-buttonsDown 0) -return local-flags XI86_SEND_DRAG_EVENTS; -else -return TRUE; -} - /*** * * xf86ProcessCommonOptions -- @@ -309,12 +298,6 @@ xf86ProcessCommonOptions(LocalDevicePtr local, xf86Msg(X_CONFIG, %s: always reports core events\n, local-name); } -if (xf86SetBoolOption(list, SendDragEvents, 1)) { -local-flags |= XI86_SEND_DRAG_EVENTS; -} else { -xf86Msg(X_CONFIG, %s: doesn't report drag events\n, local-name); -} - /* Backwards compatibility. */ local-history_size = GetMotionHistorySize(); } @@ -998,7 +981,6 @@ xf86PostMotionEventP(DeviceIntPtr device, int*valuators) { int i = 0, nevents = 0; -Bool drag = xf86SendDragEvents(device); DeviceEvent *event; int flags = 0; @@ -1045,12 +1027,7 @@ xf86PostMotionEventP(DeviceIntPtrdevice, for (i = 0; i nevents; i++) { event = (DeviceEvent*)((xf86Events + i)-event); -/* Don't post core motion events for devices not registered to send - * drag events. */ -if (event-header == ET_Internal -(event-type != ET_Motion || drag)) { -mieqEnqueue(device, (InternalEvent*)((xf86Events + i)-event)); -} +mieqEnqueue(device, (InternalEvent*)((xf86Events + i)-event)); } } diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 7528a51..8ca912e 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -62,14 +62,6 @@ #define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */ /* the device sends Xinput and core pointer events */ #define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE -/* if the device is the core pointer or is sending core events, and - * SEND_DRAG_EVENTS is false, and a buttons is done, then no motion events - * (mouse drag action) are sent. This is mainly to allow a touch screen to be - * used with netscape and other browsers which do strange things if the mouse - * moves between button down and button up. With a touch screen, this motion - * is common due to the user's finger moving slightly. - */ -#define XI86_SEND_DRAG_EVENTS 0x08 #define XI_PRIVATE(dev) \ (((LocalDevicePtr)((dev)-public.devicePrivate))-private) diff --git a/hw/xfree86/doc/devel/Registry b/hw/xfree86/doc/devel/Registry index 1fec230..e09228b 100644 --- a/hw/xfree86/doc/devel/Registry +++ b/hw/xfree86/doc/devel/Registry @@ -253,7 +253,6 @@ ReportDelay I I?? ReportingMode S Imay be raw or scaled ScreenNumber I IScreen number (for touch screen) SendCoreEventsB ISend core events -SendDragEventsB ISend drag events StopBits I ISerial port stop bits SwapXYB ISwap the X and Y axes UntouchDelay I I?? diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index 6b3636f..7c7a101 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -944,9 +944,6 @@ default. Devices with disabled will be \*qfloating\*q and only accessible by clients employing the X Input extension. This option controls the startup behavior only, a device may be reattached or set floating at runtime. -.TP 7 -.BI Option \*qSendDragEvents\*q \*q boolean \*q -Send core events while dragging. Enabled by default. .PP For pointing devices, the following options control how the pointer is accelerated or decelerated with respect to physical device motion. Most of -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 10/19] input: set XKB extension for all new devices, not just xfree86 ones.
Right now, Xephyr and others don't get to use XKB on the slave devices. Which works given that no-one cares about SDs just yet but event processing is different if the ProcessInputProc isn't wrapped properly. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- dix/devices.c |1 + hw/xfree86/common/xf86Xinput.c |2 -- 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dix/devices.c b/dix/devices.c index aea5778..5622d06 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -272,6 +272,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) dev-deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev-deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; +XkbSetExtension(dev, ProcessKeyboardEvent); dev-coreEvents = TRUE; diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index d45e3d1..1ee1e71 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -337,8 +337,6 @@ xf86ActivateDevice(LocalDevicePtr local) dev-config_info = xf86SetStrOption(local-options, config_info, NULL); -XkbSetExtension(dev, ProcessKeyboardEvent); - if (serverGeneration == 1) xf86Msg(X_INFO, XINPUT: Adding extended input device \%s\ (type: %s)\n, local-name, local-type_name); -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 11/19] xfree86: return the device from xf86ActivateDevice.
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Xinput.c |9 - 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 1ee1e71..b4ef200 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -311,7 +311,7 @@ xf86ProcessCommonOptions(LocalDevicePtr local, * Returns TRUE on success, or FALSE otherwise. *** */ -static int +static DeviceIntPtr xf86ActivateDevice(LocalDevicePtr local) { DeviceIntPtr dev; @@ -323,7 +323,7 @@ xf86ActivateDevice(LocalDevicePtr local) xf86Msg(X_ERROR, Too many input devices. Ignoring %s\n, local-name); local-dev = NULL; -return FALSE; +return NULL; } local-atom = MakeAtom(local-type_name, strlen(local-type_name), TRUE); @@ -341,7 +341,7 @@ xf86ActivateDevice(LocalDevicePtr local) xf86Msg(X_INFO, XINPUT: Adding extended input device \%s\ (type: %s)\n, local-name, local-type_name); -return TRUE; +return dev; } @@ -764,13 +764,12 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) goto unwind; } -if (!xf86ActivateDevice(pInfo)) +if (!(dev = xf86ActivateDevice(pInfo))) { rval = BadAlloc; goto unwind; } -dev = pInfo-dev; rval = ActivateDevice(dev, TRUE); if (rval != Success) { -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 12/19] xfree86: move xf86AllocateInput and xf86DeleteInput to xf86Xinput.c
Make xf86AllocateInput static in the process, this function is only called from one location. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Helper.c | 90 hw/xfree86/common/xf86Xinput.c | 89 +++ hw/xfree86/common/xf86Xinput.h |1 - 3 files changed, 89 insertions(+), 91 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 897aaf3..8eccb22 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -274,96 +274,6 @@ xf86AllocateScrnInfoPrivateIndex(void) return idx; } -/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */ -InputInfoPtr -xf86AllocateInput(InputDriverPtr drv, IDevPtr idev) -{ -InputInfoPtr new, *prev = NULL; - -if (!(new = calloc(sizeof(InputInfoRec), 1))) - return NULL; - -new-drv = drv; -drv-refCount++; -new-module = DuplicateModule(drv-module, NULL); - -for (prev = xf86InputDevs; *prev; prev = (*prev)-next) -; - -*prev = new; -new-next = NULL; - -new-fd = -1; -new-name = idev-identifier; -new-type_name = UNKNOWN; -new-device_control = NULL; -new-read_input = NULL; -new-history_size = 0; -new-control_proc = NULL; -new-close_proc = NULL; -new-switch_mode = NULL; -new-conversion_proc = NULL; -new-reverse_conversion_proc = NULL; -new-dev = NULL; -new-private_flags = 0; -new-always_core_feedback = NULL; -new-private = NULL; -new-conf_idev = idev; - -xf86CollectInputOptions(new, (const char**)drv-default_options, NULL); -xf86ProcessCommonOptions(new, new-options); - -return new; -} - - -/* - * Remove an entry from xf86InputDevs. Ideally it should free all allocated - * data. To do this properly may require a driver hook. - */ - -void -xf86DeleteInput(InputInfoPtr pInp, int flags) -{ -InputInfoPtr p; - -/* First check if the inputdev is valid. */ -if (pInp == NULL) - return; - -#if 0 -/* If a free function is defined, call it here. */ -if (pInp-free) - pInp-free(pInp, 0); -#endif - -if (pInp-module) - UnloadModule(pInp-module); - -if (pInp-drv) - pInp-drv-refCount--; - -/* This should *really* be handled in drv-UnInit(dev) call instead, but - * if the driver forgets about it make sure we free it or at least crash - * with flying colors */ -free(pInp-private); - -FreeInputAttributes(pInp-attrs); - -/* Remove the entry from the list. */ -if (pInp == xf86InputDevs) - xf86InputDevs = pInp-next; -else { - p = xf86InputDevs; - while (p p-next != pInp) - p = p-next; - if (p) - p-next = pInp-next; - /* Else the entry wasn't in the xf86InputDevs list (ignore this). */ -} -free(pInp); -} - Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad) { diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index b4ef200..9f48275 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -709,6 +709,95 @@ IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs) return ignore; } +/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */ +static InputInfoPtr +xf86AllocateInput(InputDriverPtr drv, IDevPtr idev) +{ +InputInfoPtr new, *prev = NULL; + +if (!(new = calloc(sizeof(InputInfoRec), 1))) + return NULL; + +new-drv = drv; +drv-refCount++; +new-module = DuplicateModule(drv-module, NULL); + +for (prev = xf86InputDevs; *prev; prev = (*prev)-next) +; + +*prev = new; +new-next = NULL; + +new-fd = -1; +new-name = idev-identifier; +new-type_name = UNKNOWN; +new-device_control = NULL; +new-read_input = NULL; +new-history_size = 0; +new-control_proc = NULL; +new-close_proc = NULL; +new-switch_mode = NULL; +new-conversion_proc = NULL; +new-reverse_conversion_proc = NULL; +new-dev = NULL; +new-private_flags = 0; +new-always_core_feedback = NULL; +new-private = NULL; +new-conf_idev = idev; + +xf86CollectInputOptions(new, (const char**)drv-default_options, NULL); +xf86ProcessCommonOptions(new, new-options); + +return new; +} + +/* + * Remove an entry from xf86InputDevs. Ideally it should free all allocated + * data. To do this properly may require a driver hook. + */ + +void +xf86DeleteInput(InputInfoPtr pInp, int flags) +{ +InputInfoPtr p; + +/* First check if the inputdev is valid. */ +if (pInp == NULL) + return; + +#if 0 +/* If a free function is defined, call it here. */ +if (pInp-free) + pInp-free(pInp, 0); +#endif + +if (pInp-module) + UnloadModule(pInp-module); + +if (pInp-drv) + pInp-drv-refCount--; + +/* This should *really* be handled in drv-UnInit(dev)
[PATCH 13/19] xfree86: add xf86IDrvMsg and friends for input driver logging.
Input driver messages are only standardised by convention, with the drivers prefixing the device name to most messages. This makes it rather hard to grep on evdev for example when looking for the evdev ouput. This patch adds three new logging functions, modeled after xf86DrvMsg(), the logging function for output drivers. New functions are xf86IDrvMsg()- input driver log message in default verbosity. xf86IDrvMsgVerb()- input driver log message in specified verbosity. xf86VIDrvMsgVerb() - same as xf86IDrvMsgVerb() but takes a varargs argument. Default log format is driver name: device name: message. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Helper.c | 37 + hw/xfree86/common/xf86Xinput.h | 11 +++ 2 files changed, 48 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 8eccb22..8f5ca45 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1190,6 +1190,43 @@ xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...) va_end(ap); } +/* Print input driver messages in the standard format of + driver: device name: message */ +void +xf86VIDrvMsgVerb(LocalDevicePtr dev, MessageType type, int verb, const char *format, +va_list args) +{ +char *msg; + +msg = Xprintf(%s: %s: %s, dev-drv-driverName, dev-name, format); +LogVMessageVerb(type, verb, %s, msg); +free(msg); +} + +/* Print input driver message, with verbose level specified directly */ +void +xf86IDrvMsgVerb(LocalDevicePtr dev, MessageType type, int verb, const char *format, + ...) +{ +va_list ap; + +va_start(ap, format); +xf86VIDrvMsgVerb(dev, type, verb, format, ap); +va_end(ap); +} + +/* Print input driver messages, with verbose level of 1 (default) */ +void +xf86IDrvMsg(LocalDevicePtr dev, MessageType type, const char *format, ...) +{ +va_list ap; + +va_start(ap, format); +xf86VIDrvMsgVerb(dev, type, 1, format, ap); +va_end(ap); +} + + /* Print non-driver messages with verbose level specified directly */ void xf86MsgVerb(MessageType type, int verb, const char *format, ...) diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 4851f8b..943e181 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -192,6 +192,17 @@ extern _X_EXPORT InputDriverPtr xf86LookupInputDriver(const char *name); extern _X_EXPORT InputInfoPtr xf86LookupInput(const char *name); extern _X_EXPORT void xf86DeleteInput(InputInfoPtr pInp, int flags); extern _X_EXPORT void xf86MotionHistoryAllocate(LocalDevicePtr local); +extern _X_EXPORT void xf86IDrvMsgVerb(LocalDevicePtr dev, + MessageType type, int verb, + const char *format, ...) _X_ATTRIBUTE_PRINTF(4,5); +extern _X_EXPORT void xf86IDrvMsg(LocalDevicePtr dev, + MessageType type, + const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4); +extern _X_EXPORT void xf86VIDrvMsgVerb(LocalDevicePtr dev, + MessageType type, + int verb, + const char *format, + va_list args); /* xf86Option.c */ extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts, -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 14/19] xfree86: remove LocalDeviceRec/Ptr definition.
Two names pointing to the same struct for over 7 years now. Remove the define, if drivers don't want to change they can always do the typedef themselves. Rename all LocalDevicePtr local to InputInfoPtr pInfo. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Helper.c | 10 ++-- hw/xfree86/common/xf86Xinput.c | 82 hw/xfree86/common/xf86Xinput.h | 40 ++- 3 files changed, 67 insertions(+), 65 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 8f5ca45..bdc4986 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1193,7 +1193,7 @@ xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...) /* Print input driver messages in the standard format of driver: device name: message */ void -xf86VIDrvMsgVerb(LocalDevicePtr dev, MessageType type, int verb, const char *format, +xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format, va_list args) { char *msg; @@ -1205,7 +1205,7 @@ xf86VIDrvMsgVerb(LocalDevicePtr dev, MessageType type, int verb, const char *for /* Print input driver message, with verbose level specified directly */ void -xf86IDrvMsgVerb(LocalDevicePtr dev, MessageType type, int verb, const char *format, +xf86IDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format, ...) { va_list ap; @@ -1217,7 +1217,7 @@ xf86IDrvMsgVerb(LocalDevicePtr dev, MessageType type, int verb, const char *form /* Print input driver messages, with verbose level of 1 (default) */ void -xf86IDrvMsg(LocalDevicePtr dev, MessageType type, const char *format, ...) +xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format, ...) { va_list ap; @@ -2050,7 +2050,7 @@ xf86IsUnblank(int mode) } void -xf86MotionHistoryAllocate(LocalDevicePtr local) +xf86MotionHistoryAllocate(InputInfoPtr pInfo) { -AllocateMotionHistory(local-dev); +AllocateMotionHistory(pInfo-dev); } diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 9f48275..defb83a 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -203,11 +203,11 @@ static void ApplyAccelerationSettings(DeviceIntPtr dev){ int scheme, i; DeviceVelocityPtr pVel; -LocalDevicePtr local = (LocalDevicePtr)dev-public.devicePrivate; +InputInfoPtr pInfo = (InputInfoPtr)dev-public.devicePrivate; char* schemeStr; if (dev-valuator dev-ptrfeed) { - schemeStr = xf86SetStrOption(local-options, AccelerationScheme, ); + schemeStr = xf86SetStrOption(pInfo-options, AccelerationScheme, ); scheme = dev-valuator-accelScheme.number; @@ -228,15 +228,15 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ if (InitPointerAccelerationScheme(dev, scheme)) { xf86Msg(X_CONFIG, %s: (accel) selected scheme %s/%i\n, - local-name, schemeStr, scheme); + pInfo-name, schemeStr, scheme); } else { xf86Msg(X_CONFIG, %s: (accel) could not init scheme %s\n, - local-name, schemeStr); + pInfo-name, schemeStr); scheme = dev-valuator-accelScheme.number; } } else { xf86Msg(X_CONFIG, %s: (accel) keeping acceleration scheme %i\n, -local-name, scheme); +pInfo-name, scheme); } free(schemeStr); @@ -245,22 +245,22 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ switch (scheme) { case PtrAccelPredictable: pVel = GetDevicePredictableAccelData(dev); -ProcessVelocityConfiguration (dev, local-name, local-options, +ProcessVelocityConfiguration (dev, pInfo-name, pInfo-options, pVel); break; } -i = xf86SetIntOption(local-options, AccelerationNumerator, +i = xf86SetIntOption(pInfo-options, AccelerationNumerator, dev-ptrfeed-ctrl.num); if (i = 0) dev-ptrfeed-ctrl.num = i; -i = xf86SetIntOption(local-options, AccelerationDenominator, +i = xf86SetIntOption(pInfo-options, AccelerationDenominator, dev-ptrfeed-ctrl.den); if (i 0) dev-ptrfeed-ctrl.den = i; -i = xf86SetIntOption(local-options, AccelerationThreshold, +i = xf86SetIntOption(pInfo-options, AccelerationThreshold, dev-ptrfeed-ctrl.threshold); if (i = 0) dev-ptrfeed-ctrl.threshold = i; @@ -269,10 +269,10 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ (*dev-ptrfeed-CtrlProc)(dev, dev-ptrfeed-ctrl); xf86Msg(X_CONFIG, %s: (accel) acceleration factor: %.3f\n, -
[PATCH 16/19] xfree86: purge superfluous includes from xf86Xinput.c
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Xinput.c | 16 1 files changed, 0 insertions(+), 16 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index defb83a..a6b0b58 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -59,20 +59,11 @@ #include xf86Priv.h #include xf86Config.h #include xf86Xinput.h -#include XIstubs.h #include xf86Optrec.h -#include xf86Parser.h #include mipointer.h -#include xf86InPriv.h -#include compiler.h #include extinit.h #include loaderProcs.h -#ifdef DPMSExtension -#include X11/extensions/dpmsconst.h -#include dpmsproc.h -#endif - #include exevents.h /* AddInputDevice */ #include exglobals.h #include eventstr.h @@ -85,15 +76,9 @@ #include sys/utsname.h #endif -#include extnsionst.h - -#include windowstr.h /* screenIsSaved */ - #include stdarg.h #include stdint.h /* for int64_t */ -#include X11/Xpoll.h - #include mi.h #include ptrveloc.h /* dix pointer acceleration */ @@ -105,7 +90,6 @@ #include xkbsrv.h -#include os.h EventListPtr xf86Events = NULL; -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 18/19] input: remove OpenInputDevice and CloseInputDevice DDX hooks.
In theory, these hooks were to be used for DDX-specific device enablement. None of the DDXs however did anything here. Now we call DEVICE_INIT on all devices when they are added, so the xfree86 DDX as the only one with real code didn't do anything here. kdrive checked for device validity but that's already handled in ProcXOpenDevice. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- Xi/closedev.c |1 - Xi/opendev.c |1 - Xi/stubs.c | 46 hw/dmx/input/dmxxinput.c | 12 -- hw/kdrive/src/kinput.c | 17 -- hw/xfree86/common/xf86Xinput.c | 41 --- hw/xquartz/darwinXinput.c | 28 include/XIstubs.h | 11 - 8 files changed, 0 insertions(+), 157 deletions(-) diff --git a/Xi/closedev.c b/Xi/closedev.c index e319c73..1064be6 100644 --- a/Xi/closedev.c +++ b/Xi/closedev.c @@ -162,6 +162,5 @@ ProcXCloseDevice(ClientPtr client) DeleteEventsFromChildren(d, p1, client); } -CloseInputDevice(d, client); return Success; } diff --git a/Xi/opendev.c b/Xi/opendev.c index e4c02d3..13841dc 100644 --- a/Xi/opendev.c +++ b/Xi/opendev.c @@ -115,7 +115,6 @@ ProcXOpenDevice(ClientPtr client) if (IsMaster(dev)) return BadDevice; -OpenInputDevice(dev, client, status); if (status != Success) return status; diff --git a/Xi/stubs.c b/Xi/stubs.c index de80042..4c9795a 100644 --- a/Xi/stubs.c +++ b/Xi/stubs.c @@ -68,24 +68,6 @@ SOFTWARE. /*** * - * Caller: ProcXCloseDevice - * - * Take care of implementation-dependent details of closing a device. - * Some implementations may actually close the device, others may just - * remove this clients interest in that device. - * - * The default implementation is to do nothing (assume all input devices - * are initialized during X server initialization and kept open). - * - */ - -void -CloseInputDevice(DeviceIntPtr d, ClientPtr client) -{ -} - -/*** - * * Caller: ProcXListInputDevices * * This is the implementation-dependent routine to initialize an input @@ -127,34 +109,6 @@ AddOtherInputDevices(void) } -/*** - * - * Caller: ProcXOpenDevice - * - * This is the implementation-dependent routine to open an input device. - * Some implementations open all input devices when the server is first - * initialized, and never close them. Other implementations open only - * the X pointer and keyboard devices during server initialization, - * and only open other input devices when some client makes an - * XOpenDevice request. This entry point is for the latter type of - * implementation. - * - * If the physical device is not already open, do it here. In this case, - * you need to keep track of the fact that one or more clients has the - * device open, and physically close it when the last client that has - * it open does an XCloseDevice. - * - * The default implementation is to do nothing (assume all input devices - * are opened during X server initialization and kept open). - * - */ - -void -OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status) -{ -*status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixUseAccess); -} - / * * Caller: ProcXSetDeviceMode diff --git a/hw/dmx/input/dmxxinput.c b/hw/dmx/input/dmxxinput.c index 8b58eeb..a5c28a9 100644 --- a/hw/dmx/input/dmxxinput.c +++ b/hw/dmx/input/dmxxinput.c @@ -51,23 +51,11 @@ #include dmxinputinit.h #include exevents.h -/** Close the input device. This is not required by the XINPUT model - * that DMX uses. */ -void CloseInputDevice (DeviceIntPtr d, ClientPtr client) -{ -} - /** This is not required by the XINPUT model that DMX uses. */ void AddOtherInputDevices(void) { } -/** Open an input device. This is not required by the XINPUT model that - * DMX uses. */ -void OpenInputDevice (DeviceIntPtr dev, ClientPtr client, int *status) -{ -} - /** Set device mode to \a mode. This is not implemented. */ int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode) { diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index a4691df..2ab6dc2 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -2176,23 +2176,6 @@ ProcessInputEvents (void) KdCheckLock (); } -/* FIXME use XSECURITY to work out whether the client should be allowed to - * open and close. */ -void -OpenInputDevice(DeviceIntPtr pDev, ClientPtr client, int *status) -{ -if (!pDev) -*status = BadDevice; -else -*status = Success; -} - -void -CloseInputDevice(DeviceIntPtr pDev, ClientPtr client) -{ -return;
[PATCH 19/19] input: Purge AddOtherInputDevices DDX hook.
This hook wasn't used by any DDX. Device addition and removal is handled by the config backend, so we don't need to do anything special that during the ListInputDevices request processing. Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- Xi/listdev.c |3 -- Xi/stubs.c | 43 hw/dmx/input/dmxxinput.c |5 hw/kdrive/src/kinput.c |7 -- hw/xfree86/common/xf86Xinput.c |5 hw/xquartz/darwinXinput.c | 43 include/XIstubs.h |3 -- 7 files changed, 0 insertions(+), 109 deletions(-) diff --git a/Xi/listdev.c b/Xi/listdev.c index 3b2272b..3e5f3d9 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -356,9 +356,6 @@ ProcXListInputDevices(ClientPtr client) rep.length = 0; rep.sequenceNumber = client-sequence; - -AddOtherInputDevices(); - /* allocate space for saving skip value */ skip = calloc(sizeof(Bool), inputInfo.numDevices); if (!skip) diff --git a/Xi/stubs.c b/Xi/stubs.c index 4c9795a..d9e8eec 100644 --- a/Xi/stubs.c +++ b/Xi/stubs.c @@ -66,49 +66,6 @@ SOFTWARE. #include XIstubs.h #include xace.h -/*** - * - * Caller: ProcXListInputDevices - * - * This is the implementation-dependent routine to initialize an input - * device to the point that information about it can be listed. - * Some implementations open all input devices when the server is first - * initialized, and never close them. Other implementations open only - * the X pointer and keyboard devices during server initialization, - * and only open other input devices when some client makes an - * XOpenDevice request. If some other process has the device open, the - * server may not be able to get information about the device to list it. - * - * This procedure should be used by implementations that do not initialize - * all input devices at server startup. It should do device-dependent - * initialization for any devices not previously initialized, and call - * AddInputDevice for each of those devices so that a DeviceIntRec will be - * created for them. - * - * The default implementation is to do nothing (assume all input devices - * are initialized during X server initialization and kept open). - * The commented-out sample code shows what you might do if you don't want - * the default. - * - */ - -void -AddOtherInputDevices(void) -{ -/** - for each uninitialized device, do something like: - -DeviceIntPtr dev; -DeviceProc deviceProc; -pointer private; - -dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE); -dev-public.devicePrivate = private; -dev-inited = ((*dev-deviceProc)(dev, DEVICE_INIT) == Success); -/ - -} - / * * Caller: ProcXSetDeviceMode diff --git a/hw/dmx/input/dmxxinput.c b/hw/dmx/input/dmxxinput.c index a5c28a9..54381b2 100644 --- a/hw/dmx/input/dmxxinput.c +++ b/hw/dmx/input/dmxxinput.c @@ -51,11 +51,6 @@ #include dmxinputinit.h #include exevents.h -/** This is not required by the XINPUT model that DMX uses. */ -void AddOtherInputDevices(void) -{ -} - /** Set device mode to \a mode. This is not implemented. */ int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode) { diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 2ab6dc2..61ee163 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -2176,13 +2176,6 @@ ProcessInputEvents (void) KdCheckLock (); } -/* We initialise all input devices at startup. */ -void -AddOtherInputDevices(void) -{ -return; -} - /* At the moment, absolute/relative is up to the client. */ int SetDeviceMode(register ClientPtr client, DeviceIntPtr pDev, int mode) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 14da6a5..2c54c53 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -416,11 +416,6 @@ ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control) } } -void -AddOtherInputDevices(void) -{ -} - /* * Get the operating system name from uname and store it statically to avoid * repeating the system call each time MatchOS is checked. diff --git a/hw/xquartz/darwinXinput.c b/hw/xquartz/darwinXinput.c index 64d9b23..15d9c52 100644 --- a/hw/xquartz/darwinXinput.c +++ b/hw/xquartz/darwinXinput.c @@ -82,49 +82,6 @@ CloseInputDevice(DeviceIntPtr d, ClientPtr client) DEBUG_LOG(CloseInputDevice(%p, %p)\n, d, client); } -/*** - * - * Caller: ProcXListInputDevices - * - * This is the implementation-dependent routine to initialize an input - *
[PATCH 17/19] xfree86: Fix xf86 backend-specific input initialization
From: Simon Thum simon.t...@gmx.de Instead of shoving it in rather unrelated places, move acceleration init into xf86NewInputDevice. Caveat: It's not clear atm how relevant other callers of ActivateDevice (like OpenDevice) actually are. Signed-off-by: Simon Thum simon.t...@gmx.de Reviewed-by: Peter Hutterer peter.hutte...@who-t.net Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/common/xf86Xinput.c | 27 --- 1 files changed, 24 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index a6b0b58..ea82638 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -93,6 +93,9 @@ EventListPtr xf86Events = NULL; +static int +xf86InputDevicePostInit(DeviceIntPtr dev); + /** * Eval config and modify DeviceVelocityRec accordingly */ @@ -782,6 +785,19 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) free(pInp); } +/* + * Apply backend-specific initialization. Invoked after ActiveteDevice(), + * i.e. after the driver successfully completed DEVICE_INIT and the device + * is advertised. + * @param dev the device + * @return Success or an error code + */ +static int +xf86InputDevicePostInit(DeviceIntPtr dev) { +ApplyAccelerationSettings(dev); +return Success; +} + /** * Create a new input device, activate and enable it. * @@ -851,6 +867,14 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) goto unwind; } +rval = xf86InputDevicePostInit(dev); +if (rval != Success) +{ + xf86Msg(X_ERROR, Couldn't post-init device \%s\\n, idev-identifier); + RemoveDevice(dev, TRUE); + goto unwind; +} + /* Enable it if it's properly initialised and we're currently in the VT */ if (enable dev-inited dev-startup xf86Screens[0]-vtSema) { @@ -1361,9 +1385,6 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) dev-valuator-axisVal[1] = screenInfo.screens[0]-height / 2; dev-last.valuators[1] = dev-valuator-axisVal[1]; } - -if(axnum == 0) /* to prevent double invocation */ - ApplyAccelerationSettings(dev); } -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PULL] input fixes for 1.9, unloved.
Keith, please pull and/or review the patches below. They are all fixes for 1.9. xkb: post-fix PointerKeys button events with a DeviceChangedEvent. exposed by 14327858391ebe929b806efb53ad79e789361883, devices with more valuators than the XTEST pointer device now skip events. xkb: if the button isn't down, don't fake an event. not strictly necessary for 1.9 but saves us a lot of effort, given that the ratio of physical releases to required XTEST releases is about a million to one. Xi: reset the unused classes pointer after copying fixes a bug exposed by the first patch above. Patches have been on the list, rumours have it the few people who looked at them ran away screaming before throwing Reviewed-by tags my way. Cheers, Peter The following changes since commit 750d4e82a0c1161292d24216bcff200cd6647611: XQuartz: xpbproxy: Don't take down the whole server on an IO error (2010-07-29 11:41:32 -0700) are available in the git repository at: git://people.freedesktop.org/~whot/xserver.git for-keith Peter Hutterer (3): xkb: post-fix PointerKeys button events with a DeviceChangedEvent. xkb: if the button isn't down, don't fake an event. Xi: reset the unused classes pointer after copying Xi/exevents.c|6 ++ xkb/xkbActions.c | 31 --- 2 files changed, 30 insertions(+), 7 deletions(-) ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] Add support for 18bpp
This is useful on PXA framebuffer. Signed-off-by: Marek Vasut marek.va...@gmail.com --- hw/xfree86/common/xf86Helper.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 07f9f0a..724c1a1 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -776,6 +776,9 @@ xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask) scrp-weight.red = scrp-weight.blue = 5; scrp-weight.green = 6; break; + case 18: + scrp-weight.red = scrp-weight.green = scrp-weight.blue = 6; + break; case 24: scrp-weight.red = scrp-weight.green = scrp-weight.blue = 8; break; -- 1.7.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] int10: Remove the vm86 and stub backends
On Thu, 29 Jul 2010 13:53:39 -0400, Adam Jackson a...@nwnk.net wrote: On Wed, 2010-07-28 at 11:35 -0400, Alex Deucher wrote: On Wed, Jul 28, 2010 at 11:29 AM, Alan Coopersmith alan.coopersm...@oracle.com wrote: Isn't vm86 even further limited to just those machines running the Linux kernel, not BSD or Solaris or anything else? (Okay, maybe that doesn't take a huge chunk out of the number of machines that can run it, but it is replacing one more platform-specific difference with common code.) I could have sworn one of the BSDs had implemented a vm86 syscall, but I can't find any reference to it now. It certainly doesn't seem to exist under Solaris. FreeBSD had one. Trying to use it was a huge disaster, emulation was totally the way to go. pgpDHn8eryOFf.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
RE: How to add the screen resoution support in driver?
On Fri, 2010-07-30 at 10:25 +0800, Huang, FrankR wrote: Take an example, we want to support 1024x600, I can add a Modeline to xorg.conf. But there is a call to driver named output-funcs-mode_valid to validate if that resolution should be supported. I found this function(lx_output_mode_valid) in our driver. If you add that modeline to xorg.conf, then it'll be presented to the driver's mode_valid hook. The only thing that hook should do is verify whether it's something the hardware can actually do (for example, that it doesn't take too much memory, or that it's not interlaced if your hardware can't do that). Mode sorting and preference is already handled by the core code. User-specified modes have a higher priority than modes gathered from EDID, and the preferred mode in EDID has a higher priority than the rest of the modes in EDID. Because we only want to return MODE_OK to this resolution. Which is our best method for this? Checking variable DisplayModePtr-type seems unworkable. I paste the link for lx_output_mode_valid function: http://cgit.freedesktop.org/xorg/driver/xf86-video-geode/tree/src/lx_output.c?id=e9447f5335681a78cf87ebf8c9659a6fecfc9746 If you are familiar with this part, you can give me a suggestion. From what I have known, the display timings, we can use a adjacent timing. It is not a issue for us. And I compulsively return MODE_OK, our HW can support 1024x600 already. The only thing is we should return MODE_OK I think. I don't understand the we can use a adjacent timing bit. You should be using the mode timings in the modeline itself. Why do you think you need to do something different? - ajax signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Add support for 18bpp
On Fri, 2010-07-30 at 10:13 +0200, Marek Vasut wrote: This is useful on PXA framebuffer. Signed-off-by: Marek Vasut marek.va...@gmail.com --- hw/xfree86/common/xf86Helper.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 07f9f0a..724c1a1 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -776,6 +776,9 @@ xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask) scrp-weight.red = scrp-weight.blue = 5; scrp-weight.green = 6; break; + case 18: + scrp-weight.red = scrp-weight.green = scrp-weight.blue = 6; + break; case 24: scrp-weight.red = scrp-weight.green = scrp-weight.blue = 8; break; Technically I think I wrote this, but it's trivial, so whatever. Reviewed-by: Adam Jackson a...@redhat.com - ajax signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH 00/19] Input driver API rework and cleanup
On Fri, 2010-07-30 at 16:21 +1000, Peter Hutterer wrote: 28 files changed, 252 insertions(+), 606 deletions(-) That's a nice number. Reviewed-by: Adam Jackson a...@redhat.com - ajax signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH 00/19] Input driver API rework and cleanup
On Fri, Jul 30, 2010 at 04:21:16PM +1000, Peter Hutterer wrote: As I have mentioned in the past, the input driver API is in need of a cleanup. For those easily amused, I recommend going through the input device addition process where one can find gimmicks such as the DIX calling the DDX which calls the driver to call back into the DDX to allocate a struct then handed to the driver to be used by the DIX. Or so, sometimes I get confused figuring this out in detail. This set of patches provides some of this cleanup, including a new input API. [PATCH 02/19] xfree86: rework driver PreInit API - XInput ABI 12 is the main one to look at here, the rest is just throwing out unnecessary stuff. I'm a fan. I've been running this on evdev and synaptics (I did the synaptics conversion myself from before you did it, but I assume they're pretty much the same), and it doesn't seem to have regressed anything. Xephyr is still broken in that it doesn't seem to be sending out KeymapNotifies, but that's nothing new. Reviewed-by: Daniel Stone dan...@fooishbar.org Cheers, Daniel signature.asc Description: Digital signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH 00/19] Input driver API rework and cleanup
On Fri, Jul 30, 2010 at 04:09:07PM +0100, Daniel Stone wrote: I'm a fan. I've been running this on evdev and synaptics (I did the synaptics conversion myself from before you did it, but I assume they're pretty much the same), and it doesn't seem to have regressed anything. ^^ for a few days So I think it's pretty solid. signature.asc Description: Digital signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [RFC] Refactoring of dix/dixutils.c
On Fri, Jul 30, 2010 at 12:22:23PM -0300, Fernando Carrijo wrote: I probably didn't understand quite well the reason for what you guys mean by server-side XCB. Google did't help too much either, although I wonder it might be not far from avoiding the burden of maintaining bulky and error-prone code by automatically generating server internal request dispatch stubs based on XML descriptions of the protocol. Correct! Is it better documented somewhere? I think there have been a couple of GSoC projects along those lines. Either way, I took notes of all people's opinions because I really plan to further investigate these questions in the future, as soon as I finish some other more immediate tasks. For the time being, I will deliver a patch series based on this RFC, with minor stylistic modifications. Sounds fine to me, though my word is not gospel. :) Cheers, Daniel signature.asc Description: Digital signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [RFC] Refactoring of dix/dixutils.c
On 7/30/10 5:22 PM, Fernando Carrijo wrote: I probably didn't understand quite well the reason for what you guys mean by server-side XCB. Google did't help too much either, although I wonder it might be not far from avoiding the burden of maintaining bulky and error-prone code by automatically generating server internal request dispatch stubs based on XML descriptions of the protocol. Is it better documented somewhere? A few weeks I slowly started to work on that. Currently I have the DPMS extension protocol completely handled with code that I generate from xml. Maybe it's time to submit my work so far for review. Btw, I've chosen to put the source into a top-level directory proto/, because, after all, it's related to the X11 protocol. tom ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] os: Turn off the scheduler alarm after an arbitrary length of time
On Thu, Jul 29, 2010 at 4:41 PM, Adam Jackson a...@redhat.com wrote: ... the continuous stream of SIGALRM shows up in strace and thus people report infinite stream of SIGALRM rather than whatever the bug actually is. I really hate those SIGALRMs. Reviewed-by: Patrick E. Kane pekan...@gmail.com Pat --- On Thu, Jul 29, 2010 at 4:41 PM, Adam Jackson a...@redhat.com wrote: If we're stuck in some difficult bit of processing, there's no point in punishing the client too strongly. Worse, the continuous stream of SIGALRM shows up in strace and thus people report infinite stream of SIGALRM rather than whatever the bug actually is. So if we're more than 10x past the maximum timeslice, just turn the signal off. Signed-off-by: Adam Jackson a...@redhat.com --- os/utils.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/os/utils.c b/os/utils.c index 51455cc..a3be61d 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1163,6 +1163,9 @@ static void SmartScheduleTimer (int sig) { SmartScheduleTime += SmartScheduleInterval; + + if (SmartScheduleTime = 10 * SmartScheduleMaxSlice) + SmartScheduleStopTimer(); } #endif -- 1.7.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] nls: Switch one of the interrobang sequences to gnaborretni
On Thu, 2010-07-29 at 16:56 -0400, James Cloos wrote: Makes sense. Reviewed-by: James Cloos cl...@jhcloos.com Pushed, thanks. - ajax signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Add support for 18bpp
Dne Pá 30. července 2010 16:39:22 Adam Jackson napsal(a): On Fri, 2010-07-30 at 10:13 +0200, Marek Vasut wrote: This is useful on PXA framebuffer. Signed-off-by: Marek Vasut marek.va...@gmail.com --- hw/xfree86/common/xf86Helper.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 07f9f0a..724c1a1 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -776,6 +776,9 @@ xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask) scrp-weight.red = scrp-weight.blue = 5; scrp-weight.green = 6; break; + case 18: + scrp-weight.red = scrp-weight.green = scrp-weight.blue = 6; + break; case 24: scrp-weight.red = scrp-weight.green = scrp-weight.blue = 8; break; Technically I think I wrote this, but it's trivial, so whatever. Reviewed-by: Adam Jackson a...@redhat.com - ajax Please put your credit there instead. I do not intend to snatch it from you (sorry if I did). ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [RFC] Refactoring of dix/dixutils.c
Tomas Carnecky t...@dbservice.com wrote: Fernando Carrijo wrote: I probably didn't understand quite well the reason for what you guys mean by server-side XCB. Google did't help too much either, although I wonder it might be not far from avoiding the burden of maintaining bulky and error-prone code by automatically generating server internal request dispatch stubs based on XML descriptions of the protocol. Is it better documented somewhere? A few weeks I slowly started to work on that. Currently I have the DPMS extension protocol completely handled with code that I generate from xml. Maybe it's time to submit my work so far for review. Btw, I've chosen to put the source into a top-level directory proto/, because, after all, it's related to the X11 protocol. Cool! That's a good direction for me to follow. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 3/7] dix: Extract lookup.c from within dixutils.c
Signed-off-by: Fernando Carrijo fcarr...@yahoo.com.br --- dix/Makefile.am |1 + dix/dixutils.c | 92 dix/lookup.c| 183 +++ include/dix.h |2 + 4 files changed, 186 insertions(+), 92 deletions(-) create mode 100644 dix/lookup.c diff --git a/dix/Makefile.am b/dix/Makefile.am index 2716ea5..c40a797 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -30,6 +30,7 @@ libdix_la_SOURCES = \ grabs.c \ initatoms.c \ inpututils.c\ + lookup.c\ pixmap.c\ privates.c \ property.c \ diff --git a/dix/dixutils.c b/dix/dixutils.c index 81c95bd..425f9b5 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -185,98 +185,6 @@ CompareISOLatin1Lowered(unsigned char *s1, int s1len, return (int) c1 - (int) c2; } -/* - * dixLookupWindow and dixLookupDrawable: - * Look up the window/drawable taking into account the client doing the - * lookup, the type of drawable desired, and the type of access desired. - * Return Success with *pDraw set if the window/drawable exists and the client - * is allowed access, else return an error code with *pDraw set to NULL. The - * access mask values are defined in resource.h. The type mask values are - * defined in pixmap.h, with zero equivalent to M_DRAWABLE. - */ -int -dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client, - Mask type, Mask access) -{ -DrawablePtr pTmp; -int rc; - -*pDraw = NULL; -client-errorValue = id; - -if (id == INVALID) - return BadDrawable; - -rc = dixLookupResourceByClass((pointer *)pTmp, id, RC_DRAWABLE, client, access); - -if (rc == BadValue) - return BadDrawable; -if (rc != Success) - return rc; -if (!((1 pTmp-type) (type ? type : M_DRAWABLE))) - return BadMatch; - -*pDraw = pTmp; -return Success; -} - -int -dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access) -{ -int rc; -rc = dixLookupDrawable((DrawablePtr*)pWin, id, client, M_WINDOW, access); -return (rc == BadDrawable) ? BadWindow : rc; -} - -int -dixLookupGC(GCPtr *pGC, XID id, ClientPtr client, Mask access) -{ -return dixLookupResourceByType((pointer *)pGC, id, RT_GC, client, access); -} - -int -dixLookupFontable(FontPtr *pFont, XID id, ClientPtr client, Mask access) -{ -int rc; -GC *pGC; -client-errorValue = id; /* EITHER font or gc */ -rc = dixLookupResourceByType((pointer *) pFont, id, RT_FONT, client, access); -if (rc != BadFont) - return rc; -rc = dixLookupResourceByType((pointer *) pGC, id, RT_GC, client, access); -if (rc == BadGC) - return BadFont; -if (rc == Success) - *pFont = pGC-font; -return rc; -} - -int -dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access) -{ -pointer pRes; -int rc = BadValue, clientIndex = CLIENT_ID(rid); - -if (!clientIndex || !clients[clientIndex] || (rid SERVER_BIT)) - goto bad; - -rc = dixLookupResourceByClass(pRes, rid, RC_ANY, client, DixGetAttrAccess); -if (rc != Success) - goto bad; - -rc = XaceHook(XACE_CLIENT_ACCESS, client, clients[clientIndex], access); -if (rc != Success) - goto bad; - -*pClient = clients[clientIndex]; -return Success; -bad: -if(client) -client-errorValue = rid; -*pClient = NULL; -return rc; -} - int AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, Bool toRoot, Bool map) diff --git a/dix/lookup.c b/dix/lookup.c new file mode 100644 index 000..a665c32 --- /dev/null +++ b/dix/lookup.c @@ -0,0 +1,183 @@ +/*** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +
[PATCH 6/7] dix: dixutils.c doesn't need those headers anymore. Remove them.
Signed-off-by: Fernando Carrijo fcarr...@yahoo.com.br --- dix/dixutils.c |9 - 1 files changed, 0 insertions(+), 9 deletions(-) diff --git a/dix/dixutils.c b/dix/dixutils.c index 898dbe5..26a73a3 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -81,22 +81,13 @@ Author: Adobe Systems Incorporated */ - #ifdef HAVE_DIX_CONFIG_H #include dix-config.h #endif -#include X11/X.h -#include X11/Xmd.h -#include misc.h -#include windowstr.h #include dixstruct.h -#include pixmapstr.h -#include gcstruct.h -#include scrnintstr.h #define XK_LATIN1 #include X11/keysymdef.h -#include xace.h /* * CompareTimeStamps returns -1, 0, or +1 depending on if the first -- 1.7.0.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] Refactoring of dixutils.c
So, here is the result of my preliminary attempt to bring some order to dix. The refactoring of the messy dixutils.c into more cohesive files sounded like a good oportunity for me to experiment with the code, and that's what the following statistics are about: [PATCH 1/7] dix: Extract blockhandler.c from within dixutils.c [PATCH 2/7] dix: Extract callback.c from within dixutils.c [PATCH 3/7] dix: Extract lookup.c from within dixutils.c [PATCH 4/7] dix: Extract sleepqueue.c from within dixutils.c [PATCH 5/7] dix: Extract workqueue.c from within dixutils.c [PATCH 6/7] dix: dixutils.c doesn't need those headers anymore. Remove them. [PATCH 7/7] dix: Cleanup dix.h to match the refactoring suffered by dixutils.c dix/Makefile.am|7 +- dix/blockhandler.c | 233 +++ dix/callback.c | 322 ++ dix/dixutils.c | 643 dix/lookup.c | 183 +++ dix/sleepqueue.c | 173 ++ dix/workqueue.c| 166 ++ include/dix.h | 51 +++-- 8 files changed, insertions(+), 667 deletions(-) This patch series adds no functional changes to dix whatsoever, and the mismatch between the number of lines added and removed can be explained by the replication of copyright messages in the newly created files. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 1/7] dix: Extract blockhandler.c from within dixutils.c
Signed-off-by: Fernando Carrijo fcarr...@yahoo.com.br --- dix/Makefile.am|1 + dix/blockhandler.c | 233 dix/dixutils.c | 145 include/dix.h |1 + 4 files changed, 235 insertions(+), 145 deletions(-) create mode 100644 dix/blockhandler.c diff --git a/dix/Makefile.am b/dix/Makefile.am index 5e2dad7..8164a34 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -7,6 +7,7 @@ libmain_la_SOURCES =\ libdix_la_SOURCES =\ atom.c \ + blockhandler.c \ colormap.c \ cursor.c\ deprecated.c\ diff --git a/dix/blockhandler.c b/dix/blockhandler.c new file mode 100644 index 000..edcb790 --- /dev/null +++ b/dix/blockhandler.c @@ -0,0 +1,233 @@ +/*** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +**/ + +/* + +(c)Copyright 1988,1991 Adobe Systems Incorporated. All rights reserved. + +Permission to use, copy, modify, distribute, and sublicense this software and its +documentation for any purpose and without fee is hereby granted, provided that +the above copyright notices appear in all copies and that both those copyright +notices and this permission notice appear in supporting documentation and that +the name of Adobe Systems Incorporated not be used in advertising or publicity +pertaining to distribution of the software without specific, written prior +permission. No trademark license to use the Adobe trademarks is hereby +granted. If the Adobe trademark Display PostScript(tm) is used to describe +this software, its functionality or for any other purpose, such use shall be +limited to a statement that this software works in conjunction with the Display +PostScript system. Proper trademark attribution to reflect Adobe's ownership +of the trademark shall be given whenever any such reference to the Display +PostScript system is made. + +ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR ANY +PURPOSE. IT IS PROVIDED AS IS WITHOUT EXPRESS OR IMPLIED WARRANTY. ADOBE +DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- +INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE TO YOU +OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,NEGLIGENCE, STRICT +LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT PROVIDE ANY TRAINING OR OTHER +SUPPORT FOR THE SOFTWARE. + +Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
[PATCH 2/7] dix: Extract callback.c from within dixutils.c
Signed-off-by: Fernando Carrijo fcarr...@yahoo.com.br --- dix/Makefile.am |1 + dix/callback.c | 322 +++ dix/dixutils.c | 233 3 files changed, 323 insertions(+), 233 deletions(-) create mode 100644 dix/callback.c diff --git a/dix/Makefile.am b/dix/Makefile.am index 8164a34..2716ea5 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -8,6 +8,7 @@ libmain_la_SOURCES =\ libdix_la_SOURCES =\ atom.c \ blockhandler.c \ + callback.c \ colormap.c \ cursor.c\ deprecated.c\ diff --git a/dix/callback.c b/dix/callback.c new file mode 100644 index 000..14f79a2 --- /dev/null +++ b/dix/callback.c @@ -0,0 +1,322 @@ +/*** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +**/ + +/* + +(c)Copyright 1988,1991 Adobe Systems Incorporated. All rights reserved. + +Permission to use, copy, modify, distribute, and sublicense this software and its +documentation for any purpose and without fee is hereby granted, provided that +the above copyright notices appear in all copies and that both those copyright +notices and this permission notice appear in supporting documentation and that +the name of Adobe Systems Incorporated not be used in advertising or publicity +pertaining to distribution of the software without specific, written prior +permission. No trademark license to use the Adobe trademarks is hereby +granted. If the Adobe trademark Display PostScript(tm) is used to describe +this software, its functionality or for any other purpose, such use shall be +limited to a statement that this software works in conjunction with the Display +PostScript system. Proper trademark attribution to reflect Adobe's ownership +of the trademark shall be given whenever any such reference to the Display +PostScript system is made. + +ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR ANY +PURPOSE. IT IS PROVIDED AS IS WITHOUT EXPRESS OR IMPLIED WARRANTY. ADOBE +DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- +INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE TO YOU +OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,NEGLIGENCE, STRICT +LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT PROVIDE ANY TRAINING OR OTHER +SUPPORT FOR THE SOFTWARE. + +Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems +Incorporated
[PATCH 4/7] dix: Extract sleepqueue.c from within dixutils.c
Signed-off-by: Fernando Carrijo fcarr...@yahoo.com.br --- dix/Makefile.am |1 + dix/dixutils.c | 85 -- dix/sleepqueue.c | 173 ++ include/dix.h|2 + 4 files changed, 176 insertions(+), 85 deletions(-) create mode 100644 dix/sleepqueue.c diff --git a/dix/Makefile.am b/dix/Makefile.am index c40a797..c03b412 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -39,6 +39,7 @@ libdix_la_SOURCES = \ registry.c \ resource.c \ selection.c \ + sleepqueue.c\ swaprep.c \ swapreq.c \ tables.c\ diff --git a/dix/dixutils.c b/dix/dixutils.c index 425f9b5..9d5ba2e 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -343,88 +343,3 @@ QueueWorkProc ( return TRUE; } -/* - * Manage a queue of sleeping clients, awakening them - * when requested, by using the OS functions IgnoreClient - * and AttendClient. Note that this *ignores* the troubles - * with request data interleaving itself with events, but - * we'll leave that until a later time. - */ - -typedef struct _SleepQueue { -struct _SleepQueue *next; -ClientPtr client; -ClientSleepProcPtr function; -pointerclosure; -} SleepQueueRec, *SleepQueuePtr; - -static SleepQueuePtr sleepQueue = NULL; - -Bool -ClientSleep (ClientPtr client, ClientSleepProcPtr function, pointer closure) -{ -SleepQueuePtr q; - -q = malloc(sizeof *q); -if (!q) - return FALSE; - -IgnoreClient (client); -q-next = sleepQueue; -q-client = client; -q-function = function; -q-closure = closure; -sleepQueue = q; -return TRUE; -} - -Bool -ClientSignal (ClientPtr client) -{ -SleepQueuePtr q; - -for (q = sleepQueue; q; q = q-next) - if (q-client == client) - { - return QueueWorkProc (q-function, q-client, q-closure); - } -return FALSE; -} - -void -ClientWakeup (ClientPtr client) -{ -SleepQueuePtr q, *prev; - -prev = sleepQueue; -while ( (q = *prev) ) -{ - if (q-client == client) - { - *prev = q-next; - free(q); - if (client-clientGone) - /* Oops -- new zombie cleanup code ensures this only -* happens from inside CloseDownClient; don't want to -* recurse here... -*/ - /* CloseDownClient(client) */; - else - AttendClient (client); - break; - } - prev = q-next; -} -} - -Bool -ClientIsAsleep (ClientPtr client) -{ -SleepQueuePtr q; - -for (q = sleepQueue; q; q = q-next) - if (q-client == client) - return TRUE; -return FALSE; -} - diff --git a/dix/sleepqueue.c b/dix/sleepqueue.c new file mode 100644 index 000..03c2b37 --- /dev/null +++ b/dix/sleepqueue.c @@ -0,0 +1,173 @@ +/*** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES
[PATCH 5/7] dix: Extract workqueue.c from within dixutils.c
Signed-off-by: Fernando Carrijo fcarr...@yahoo.com.br --- dix/Makefile.am |3 +- dix/dixutils.c | 79 -- dix/workqueue.c | 166 +++ include/dix.h |2 + 4 files changed, 170 insertions(+), 80 deletions(-) create mode 100644 dix/workqueue.c diff --git a/dix/Makefile.am b/dix/Makefile.am index c03b412..58316a1 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -43,7 +43,8 @@ libdix_la_SOURCES = \ swaprep.c \ swapreq.c \ tables.c\ - window.c + window.c\ + workqueue.c EXTRA_DIST = buildatoms BuiltInAtoms Xserver.d Xserver-dtrace.h.in diff --git a/dix/dixutils.c b/dix/dixutils.c index 9d5ba2e..898dbe5 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -264,82 +264,3 @@ void NoopDDA(void) { } - -/* - * A general work queue. Perform some task before the server - * sleeps for input. - */ - -WorkQueuePtr workQueue; -static WorkQueuePtr*workQueueLast = workQueue; - -void -ProcessWorkQueue(void) -{ -WorkQueuePtrq, *p; - -p = workQueue; -/* - * Scan the work queue once, calling each function. Those - * which return TRUE are removed from the queue, otherwise - * they will be called again. This must be reentrant with - * QueueWorkProc. - */ -while ((q = *p)) -{ - if ((*q-function) (q-client, q-closure)) - { - /* remove q from the list */ - *p = q-next;/* don't fetch until after func called */ - free(q); - } - else - { - p = q-next;/* don't fetch until after func called */ - } -} -workQueueLast = p; -} - -void -ProcessWorkQueueZombies(void) -{ -WorkQueuePtrq, *p; - -p = workQueue; -while ((q = *p)) -{ - if (q-client q-client-clientGone) - { - (void) (*q-function) (q-client, q-closure); - /* remove q from the list */ - *p = q-next;/* don't fetch until after func called */ - free(q); - } - else - { - p = q-next;/* don't fetch until after func called */ - } -} -workQueueLast = p; -} - -Bool -QueueWorkProc ( -Bool (*function)(ClientPtr /* pClient */, pointer /* closure */), -ClientPtr client, pointer closure) -{ -WorkQueuePtrq; - -q = malloc(sizeof *q); -if (!q) - return FALSE; -q-function = function; -q-client = client; -q-closure = closure; -q-next = NULL; -*workQueueLast = q; -workQueueLast = q-next; -return TRUE; -} - diff --git a/dix/workqueue.c b/dix/workqueue.c new file mode 100644 index 000..19c29f2 --- /dev/null +++ b/dix/workqueue.c @@ -0,0 +1,166 @@ +/*** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION
[PATCH xf86-video-xgi] Modify search for drm include.
From: Trevor Woerner twoer...@gmail.com The build system already includes the location of the drm header file (using -I) so the source doesn't need to hard-code the relative path. Reviewed-by: Gaetan Nadon mems...@videotron.ca Signed-off-by: Trevor Woerner twoer...@gmail.com --- src/xgi_dri.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/xgi_dri.c b/src/xgi_dri.c index d6a6d3d..93687e1 100755 --- a/src/xgi_dri.c +++ b/src/xgi_dri.c @@ -66,7 +66,7 @@ #include xgi_accel.h #include xgi_common.h -#include drm/drm.h +#include drm.h extern void GlxSetVisualConfigs( int nconfigs, -- 1.6.4.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] Check HAVE_XMLTO_TEXT before trying to use xmlto to make text files
Reported-by: Matt Turner matts...@gmail.com Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- doc/xml/xmlrules.in |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/doc/xml/xmlrules.in b/doc/xml/xmlrules.in index 0d094be..b7fda11 100644 --- a/doc/xml/xmlrules.in +++ b/doc/xml/xmlrules.in @@ -48,10 +48,12 @@ xorg.css: $(STYLESHEET_SRCDIR)/xorg.css endif if HAVE_XMLTO +if HAVE_XMLTO_TEXT BUILT_DOC_FILES += $(TXT_FILES) .xml.txt: @rm -f $@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $ +endif BUILT_DOC_FILES += $(HTML_FILES) .xml.html: -- 1.5.6.5 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Check HAVE_XMLTO_TEXT before trying to use xmlto to make text files
On Fri, 2010-07-30 at 17:45 -0700, Alan Coopersmith wrote: Reported-by: Matt Turner matts...@gmail.com Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com --- doc/xml/xmlrules.in |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/doc/xml/xmlrules.in b/doc/xml/xmlrules.in index 0d094be..b7fda11 100644 --- a/doc/xml/xmlrules.in +++ b/doc/xml/xmlrules.in @@ -48,10 +48,12 @@ xorg.css: $(STYLESHEET_SRCDIR)/xorg.css endif if HAVE_XMLTO +if HAVE_XMLTO_TEXT BUILT_DOC_FILES += $(TXT_FILES) .xml.txt: @rm -f $@ $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $ +endif BUILT_DOC_FILES += $(HTML_FILES) .xml.html: Tested-by: Gaetan Nadon mems...@videotron.ca signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel