Re: multitouch
On Mon, 8 Feb 2010 16:16:35 +1000 Peter Hutterer peter.hutte...@who-t.net said: my apologies for the late answer to this whole thing, but this is sort-of a reply to all three emails by you guys. On Tue, Jan 19, 2010 at 01:00:27PM +0100, Simon Thum wrote: Bradley T. Hughes wrote: On 01/18/2010 11:54 PM, ext Carsten Haitzler (The Rasterman) wrote: hey guys (sorry for starting a new thread - i only just subscribed - lurking on xorg as opposed to xorg-devel). interesting that this topic comes up now... multitouch. i'm here @ samsung and got multi-touch capable hardware - supports up to 10 touchpoints, so need support. now... i read the thread. i'm curious. brad - why do u think a single event (vs multiple) means less context switches (and thus less power consumption, cpu used etc.)? Even though the events may be buffered (like you mention), there's no guarantee that they will fit nicely into the buffer. I'm not say that this will always be the case, but I can foresee the need to write code that scans the existing event queue, possibly flushes and rereads, scans again, etc. to ensure that the client did actually get all of the events that it was interested in. even then u;'d be begging for bugs if you handle events massively out-of-order (eg several mouse moves/downs/ups between xi2 events). anyway not sure power here is a good argument - there are other ones that are better :) They other guys at my workplace do a touchtable, so I'm not particularly qualified. But there's 10 points in carsten's HW already, and from what I know it's not hard to imagine pressure or what not to become important. That's 30 axes and a limit of 36 axes - if that's not easy to lift I'd be wary of such an approach. the 36 axis limit is one defined in XI1. arguably, no sane multi-touch application should be using XI1 anyway. XI2 has a theoretical 16-bit limit on axis numbers, so that should be sufficient for devices in the near future. Yes, there are some limitations in the server but they can be fixed. good to hear :) There's also the fact that the current approach that Benjamin suggested requires an extra client to manage the slave devices. OTOH, if you're getting serious, there needs to be an instance translating events into gestures/metaphors anyway. So I don't see the point of avoiding an instance you're likely to need further on. A gesture recogniser instance will be mandatory. However, a client that modifies the list of input devices on demand and quite frequently hopefully won't. Benjamin's approach puts quite a load on the server and on all clients (presence events are sent to every client), IMO unnecessarily. why should one be at the xi2 event level? i'm dubious of this. i've thought it through a lot - you want gesture recognition happening higher up in the toolkit or app. you need context - does that gesture make sense. if one gesture was started but it ended in a way that gesture changed, u ned to cancel the previous action etc. imho multitouch etc. should stick to delivering as much info that the HW provides as cleanly and simply as possible via xi2 with minimal interruption of existing app functionality. The basic principle for the master/slave division is that even in the presence of multiple physical devices, what really counts in the GUI is the virtual input points. This used to be a cursor, now it can be multiple cursors and with multitouch it will be similar. Most multitouch gestures still have a single input point with auxiliary information attach. Prime example is the pinch gesture with thumb and index - it's not actually two separate points, it's one interaction. Having two master devices for this type of gesture is overkill. As a rule of thumb, each hand from each user usually constitutes an input point and thus should be represented as a master device. well that depends - if i take both my hands with 2 fingers and now i draw thins with both left and right hand.. i am using my hands as 2 independent core devices. the problem is - the screen can't tell the difference - neither can the app. i like 2 core devices - it means u can emulate multitouch screens with mice... you just need N mice for N fingers. :) this is a good way to encourage support in apps and toolkits as it can be more widely used. So all we need is hardware that can tell the difference between hands :) aaah we can wish :) An example device tree for two hands would thus look like this: MD1- MD XTEST device - physical mouse - right hand touch device - thumb subdevice - index subdevice MD2- MD XTEST device - physical trackball - left hand touch device - thumb subdevice - index subdevice - middle finger subdevice Where the subdevices are present on demand and may disappear. They may not even be actual devices but
Re: multitouch
A gesture recogniser instance will be mandatory. However, a client that modifies the list of input devices on demand and quite frequently hopefully won't. Benjamin's approach puts quite a load on the server and on all clients (presence events are sent to every client), IMO unnecessarily. why should one be at the xi2 event level? i'm dubious of this. i've thought it through a lot - you want gesture recognition happening higher up in the toolkit or app. you need context - does that gesture make sense. if one gesture was started but it ended in a way that gesture changed, u ned to cancel the previous action etc. imho multitouch etc. should stick to delivering as much info that the HW provides as cleanly and simply as possible via xi2 with minimal interruption of existing app functionality. FWIW, when I last thought through this, I also(?) leaned towards an approach which would roughly resemble the composite extension, but for input. Like with other hook-based things, it would enable best practices to emerge over time. but we have a problem now... we only have master and slave. we need N levels. i need on a collaborative table: person / \ hand hand / | | | | \ finger / | | \ finger finger | | finger finger finger in the end... n levels is likely going to be needed. we can flatten this sure, but in the end you will not be able to anymore. :( +1 But you need a specific level corresponding to a master device/virtual input. BTW, having special group start/end events in the stream is a possible impl ;) (Feel free to ignore me anyway, the project I did this for never really started so I'm just trying to not have it died in vain; also it was a quite different use case. I no longer have a real interest.) Cheers, Simon ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] added labels for multitouch valuators
So here is the new version after corrections of the two patches. ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] added labels for multitouch valuators
Thoses definitions have been included in the kernel but the X server is not updated accordingly. Without these definitions, the multitouch axes are not correctly labelled. Signed-off-by: Benjamin Tissoires tisso...@cena.fr --- Xi/xiproperty.c | 11 +++ include/xserver-properties.h | 11 +++ 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index ea66c54..be07831 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -93,6 +93,17 @@ static struct dev_properties {0, AXIS_LABEL_PROP_ABS_TILT_Y}, {0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH}, {0, AXIS_LABEL_PROP_ABS_VOLUME}, +{0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR}, +{0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR}, +{0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR}, +{0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR}, +{0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION}, +{0, AXIS_LABEL_PROP_ABS_MT_POSITION_X}, +{0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y}, +{0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE}, +{0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID}, +{0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID}, +{0, AXIS_LABEL_PROP_ABS_MT_PRESSURE}, {0, AXIS_LABEL_PROP_ABS_MISC}, {0, BTN_LABEL_PROP}, diff --git a/include/xserver-properties.h b/include/xserver-properties.h index 626d0ad..30e8efb 100644 --- a/include/xserver-properties.h +++ b/include/xserver-properties.h @@ -89,6 +89,17 @@ #define AXIS_LABEL_PROP_ABS_TILT_Y Abs Tilt Y #define AXIS_LABEL_PROP_ABS_TOOL_WIDTH Abs Tool Width #define AXIS_LABEL_PROP_ABS_VOLUME Abs Volume +#define AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR Abs MT Touch Major +#define AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR Abs MT Touch Minor +#define AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR Abs MT Width Major +#define AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR Abs MT Width Minor +#define AXIS_LABEL_PROP_ABS_MT_ORIENTATION Abs MT Orientation +#define AXIS_LABEL_PROP_ABS_MT_POSITION_X Abs MT Position X +#define AXIS_LABEL_PROP_ABS_MT_POSITION_Y Abs MT Position Y +#define AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE Abs MT Tool Type +#define AXIS_LABEL_PROP_ABS_MT_BLOB_ID Abs MT Blob ID +#define AXIS_LABEL_PROP_ABS_MT_TRACKING_ID Abs MT Tracking ID +#define AXIS_LABEL_PROP_ABS_MT_PRESSUREAbs MT Pressure #define AXIS_LABEL_PROP_ABS_MISCAbs Misc /* Button names */ -- 1.6.6 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH evdev] Added the names of the valuators for the multitouch properties
Thoses definitions have been included in the kernel but the X server and the evdev driver are not updated accordingly. Without these definitions, the multitouch axes are not correctly labelled. Signed-off-by: Benjamin Tissoires tisso...@cena.fr --- src/evdev.c | 27 +++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 58ffcea..8c9ee75 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2272,6 +2272,33 @@ static char* abs_labels[] = { AXIS_LABEL_PROP_ABS_MISC, /* undefined */ AXIS_LABEL_PROP_ABS_MISC, /* undefined */ AXIS_LABEL_PROP_ABS_VOLUME /* 0x20 */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MISC, /* undefined */ +AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR, /* 0x30 */ +AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR, /* 0x31 */ +AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR, /* 0x32 */ +AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR, /* 0x33 */ +AXIS_LABEL_PROP_ABS_MT_ORIENTATION, /* 0x34 */ +AXIS_LABEL_PROP_ABS_MT_POSITION_X, /* 0x35 */ +AXIS_LABEL_PROP_ABS_MT_POSITION_Y, /* 0x36 */ +AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE, /* 0x37 */ +AXIS_LABEL_PROP_ABS_MT_BLOB_ID, /* 0x38 */ +AXIS_LABEL_PROP_ABS_MT_TRACKING_ID, /* 0x39 */ +AXIS_LABEL_PROP_ABS_MT_PRESSURE,/* 0x3a */ }; static char* rel_labels[] = { -- 1.6.6 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH v2] xrandr: display gamma and brightness
On Feb 06, 10 11:18:21 +0100, Éric Piel wrote: Op 05-02-10 19:30, Matthias Hopf schreef: Any updates on that one? No need to rush, I'd just like to not have this forgotten... Also not from my side :-] Hi, No, no, I haven't forgotten... but I had no time to rework the patch yet. Hopefully the coming week I'll find the time :-) No probs. As I said, I just wanted to make sure that this is not on hold due to me missing some action :-) CU + have fun Matthias -- Matthias Hopf mh...@suse.de ____ __ Maxfeldstr. 5 / 90409 Nuernberg (_ | | (_ |__ m...@mshopf.de Phone +49-911-74053-715 __) |_| __) |__ R D www.mshopf.de ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
bitmasks branch
Hi, The bitmasks branch here: http://cgit.freedesktop.org/~sandmann/pixman/log/?h=bitmasks contains the initial reorganization in prepration for the full flags branch. Specifically, it adds the flag fields to the fast path tables, and it changes the fast path checks to be based on flags. I kept finding subtle bugs in it, but now I haven't found any for a while. Please take a look and see if you can spot any. Thanks, Soren ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [Mesa3d-dev] [RFC] Event-based buffer validation for DRI2.
Francisco Jerez curroje...@riseup.net writes: Francisco Jerez curroje...@riseup.net writes: The current buffer validation approach (AKA the DRI2 glViewport hack) is both incorrect (because a compliant OpenGL application may opt for the identity as viewport transform and work with window coordinates directly) and inefficient (some programs have the habit of calling glViewport several times per frame (e.g. OpenArena), causing many unnecessary roundtrips). This changeset gives DRI2 the ability to report drawable changes in an asynchronous way, but it's a bit intrusive so I expect all sorts of complaints to come. I've tested this with the gallium and classic nouveau drivers, using direct and indirect rendering, with single and double buffered apps, with older X servers, and it seems to work... I'm open to any comments. A revised changeset follows. Among other minor fixes, it avoids the DRI2InfoRec ABI breakup, so this version will hopefully be somewhat less intrusive on the X side. This time I've tried to preserve backwards compatibility with flush v2 (sigh), as intel has recently started to make use of it in a non-trivial way. [dri2proto patch v3] Define an event to notify clients about the validity of their buffers. [xserver patch v3 1/5] Add a PreConfigureWindow hook. [xserver patch v3 2/5] dri2: No need to blit from front on DRI2GetBuffers if they're just being reused. [xserver patch v3 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows. [xserver patch v3 4/5] glx/dri2: Notify the driver when its buffers become invalid. [xserver patch v3 5/5] dri2: Support the DRI2InvalidateBuffers event. [mesa patch v3 1/3] dri2: Event driven buffer validation. [mesa patch v3 2/3] dri/nouveau: Use event driven buffer validation. [mesa patch v3 3/3] st/dri2: Use event-driven buffer validation. I assume everyone is OK with these patches because they've been around for more than three weeks already... The following patch series is roughly the same as v3, but it's rebased over the latest conflicting changes. [dri2proto patch v4] Define an event to notify clients about the validity of their buffers. [xserver patch v4 1/5] Add a PreConfigureWindow hook. [xserver patch v4 2/5] dri2: No need to blit from front on DRI2GetBuffers if they're just being reused. [xserver patch v4 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows. [xserver patch v4 4/5] glx/dri2: Notify the driver when its buffers become invalid. [xserver patch v4 5/5] dri2: Support the DRI2InvalidateBuffers event. [mesa patch v4 1/3] dri2: Event driven buffer validation. [mesa patch v4 2/3] dri/nouveau: Use event driven buffer validation. [mesa patch v4 3/3] st/dri2: Use event-driven buffer validation. pgpxW9yyPT5Uy.pgp Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[dri2proto patch v4] Define an event to notify clients about the validity of their buffers.
Bumps the protocol and package versions. Signed-off-by: Francisco Jerez curroje...@riseup.net --- configure.ac |2 +- dri2proto.h | 19 +-- dri2proto.txt | 31 --- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index fc96197..c5affe3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.57]) -AC_INIT([DRI2Proto], [2.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) +AC_INIT([DRI2Proto], [2.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE diff --git a/dri2proto.h b/dri2proto.h index 43152c2..9708a4a 100644 --- a/dri2proto.h +++ b/dri2proto.h @@ -35,10 +35,10 @@ #define DRI2_NAME DRI2 #define DRI2_MAJOR 1 -#define DRI2_MINOR 2 +#define DRI2_MINOR 3 #define DRI2NumberErrors 0 -#define DRI2NumberEvents 1 +#define DRI2NumberEvents 2 #define DRI2NumberRequests 13 #define X_DRI2QueryVersion 0 @@ -59,6 +59,7 @@ * Events */ #define DRI2_BufferSwapComplete0 +#define DRI2_InvalidateBuffers 1 typedef struct { CARD32 attachment B32; @@ -299,4 +300,18 @@ typedef struct { } xDRI2BufferSwapComplete; #define sz_xDRI2BufferSwapComplete 32 +typedef struct { +CARD8 type; +CARD8 pad; +CARD16 sequenceNumber B16; +CARD32 drawable B32; +CARD32 pad1 B32; +CARD32 pad2 B32; +CARD32 pad3 B32; +CARD32 pad4 B32; +CARD32 pad5 B32; +CARD32 pad6 B32; +} xDRI2InvalidateBuffers; +#define sz_xDRI2InvalidateBuffers 32 + #endif diff --git a/dri2proto.txt b/dri2proto.txt index de58289..3d3eec4 100644 --- a/dri2proto.txt +++ b/dri2proto.txt @@ -125,9 +125,12 @@ or by using the OML swap buffers routine. 2.7 Events -DRI2 provides a single event to indicate when a DRI2SwapBuffers request has -been completed. This can be used to throttle drawing on the client side and -tie into application main loops. +DRI2 provides an event to indicate when a DRI2SwapBuffers request has +been completed. This can be used to throttle drawing on the client +side and tie into application main loops. + +Another event is generated when the validity of the requested buffers +changes. â â â â â â @@ -333,10 +336,6 @@ The name of this extension is DRI2. Returns the swap count value when the swap will actually occur (e.g. the last queued swap count + (pending swap count * swap interval)). - The client should invalidate its render buffers after sending this - request, causing a subsequent GetBuffers request to get updated buffer - info. - This request is only available with protocol version 1.2 or later. @@ -459,6 +458,22 @@ The name of this extension is DRI2. the swap was performed with a blit, and DRI2_FLIP_COMPLETE, indicating a full page flip was completed. +ââââ +DRI2InvalidateBuffers + ⶠ+ drawable: CARD32 +ââââ + + This event is generated when the buffers the client had + requested for 'drawable' (with DRI2GetBuffers or + DRI2GetBuffersWithFormat) become inappropriate because they + don't match the drawable dimensions anymore, or a buffer swap + has been performed. + + Note that the server is only required to warn the client once + about this condition, until the client takes care of bringing + them back up-to-date with another GetBuffers request. + â â â â â â 10. Extension Versioning @@ -491,6 +506,8 @@ The DRI2 extension has undergone a number of revisions before 2.2: Approaching perfection. Added requests for swapbuffers, MSC and SBC related requests, and events. + 2.3: Added the DRI2InvalidateBuffers event. + Compatibility up to 2.0 is not preserved, but was also never released. -- 1.6.4.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[xserver patch v4 1/5] Add a PreConfigureWindow hook.
Executed from the ConfigureWindow request, right before sending ConfigureNotify to the clients. This commit breaks the ScreenRec ABI. Signed-off-by: Francisco Jerez curroje...@riseup.net --- dix/window.c |4 hw/xfree86/common/xf86Module.h |6 +++--- include/scrnintstr.h | 10 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/dix/window.c b/dix/window.c index caff1cb..d9836e1 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2303,6 +2303,10 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) return(Success); ActuallyDoSomething: +if (pWin-drawable.pScreen-PreConfigureWindow) + (*pWin-drawable.pScreen-PreConfigureWindow)(pWin, x, y, + w, h, bw, pSib); + if (SubStrSend(pWin, pParent)) { memset(event, 0, sizeof(xEvent)); diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index bbf5786..d61758f 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -82,9 +82,9 @@ typedef enum { * mask is 0x. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(7, 0) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(9, 0) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(3, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(8, 0) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(10, 0) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define MODINFOSTRING1 0xef23fdc5 diff --git a/include/scrnintstr.h b/include/scrnintstr.h index ab50e7a..467b61c 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -399,6 +399,15 @@ typedefvoid (* PostChangeSaveUnderProcPtr)( WindowPtr /*pLayerWin*/, WindowPtr /*firstChild*/); +typedefvoid (* PreConfigureWindowProcPtr)( + WindowPtr /*pWin*/, + int /*x*/, + int /*y*/, + int /*w*/, + int /*h*/, + int /*bw*/, + WindowPtr /*pSib*/); + typedefvoid (* MoveWindowProcPtr)( WindowPtr /*pWin*/, int /*x*/, @@ -581,6 +590,7 @@ typedef struct _Screen { MarkOverlappedWindowsProcPtr MarkOverlappedWindows; ChangeSaveUnderProcPtr ChangeSaveUnder; PostChangeSaveUnderProcPtr PostChangeSaveUnder; +PreConfigureWindowProcPtr PreConfigureWindow; MoveWindowProcPtr MoveWindow; ResizeWindowProcPtrResizeWindow; GetLayerWindowProcPtr GetLayerWindow; -- 1.6.4.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[xserver patch v4 2/5] dri2: No need to blit from front on DRI2GetBuffers if they're just being reused.
It can be quite an expensive operation, so we're better off not doing it unless it's totally required. Signed-off-by: Francisco Jerez curroje...@riseup.net --- hw/xfree86/dri2/dri2.c | 42 +++--- 1 files changed, 23 insertions(+), 19 deletions(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index cd69ca0..48618e1 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -202,27 +202,25 @@ find_attachment(DRI2DrawablePtr pPriv, unsigned attachment) return -1; } -static DRI2BufferPtr +static Bool allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds, DRI2DrawablePtr pPriv, unsigned int attachment, unsigned int format, -int dimensions_match) +int dimensions_match, DRI2BufferPtr *buffer) { -DRI2BufferPtr buffer; -int old_buf; - -old_buf = find_attachment(pPriv, attachment); +int old_buf = find_attachment(pPriv, attachment); if ((old_buf 0) || !dimensions_match || (pPriv-buffers[old_buf]-format != format)) { - buffer = (*ds-CreateBuffer)(pDraw, attachment, format); + *buffer = (*ds-CreateBuffer)(pDraw, attachment, format); + return TRUE; + } else { - buffer = pPriv-buffers[old_buf]; + *buffer = pPriv-buffers[old_buf]; pPriv-buffers[old_buf] = NULL; + return FALSE; } - -return buffer; } static DRI2BufferPtr * @@ -238,6 +236,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, int have_fake_front = 0; int front_format = 0; int dimensions_match; +int buffers_changed = 0; int i; if (!pPriv) { @@ -256,8 +255,10 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, const unsigned attachment = *(attachments++); const unsigned format = (has_format) ? *(attachments++) : 0; - buffers[i] = allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment, - format, dimensions_match); + if (allocate_or_reuse_buffer(pDraw, ds, pPriv, attachment, +format, dimensions_match, +buffers[i])) + buffers_changed = 1; /* If the drawable is a window and the front-buffer is requested, * silently add the fake front-buffer to the list of requested @@ -287,15 +288,18 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, } if (need_real_front 0) { - buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv, - DRI2BufferFrontLeft, - front_format, dimensions_match); + if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFrontLeft, +front_format, dimensions_match, +buffers[i++])) + buffers_changed = 1; } if (need_fake_front 0) { - buffers[i++] = allocate_or_reuse_buffer(pDraw, ds, pPriv, - DRI2BufferFakeFrontLeft, - front_format, dimensions_match); + if (allocate_or_reuse_buffer(pDraw, ds, pPriv, DRI2BufferFakeFrontLeft, +front_format, dimensions_match, +buffers[i++])) + buffers_changed = 1; + have_fake_front = 1; } @@ -324,7 +328,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, * contents of the real front-buffer. This ensures correct operation of * applications that call glXWaitX before calling glDrawBuffer. */ -if (have_fake_front) { +if (have_fake_front buffers_changed) { BoxRec box; RegionRec region; -- 1.6.4.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[xserver patch v4 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows.
The spec says (regarding glXCreateWindow): If there is already a GLXFBConfig associated with win (as a result of a previous glXCreateWindow call), then a BadAlloc error is generated.. It will also come useful to implement DRI2InvalidateBuffers for the indirect case. Signed-off-by: Francisco Jerez curroje...@riseup.net --- glx/glxcmds.c | 51 +-- glx/glxserver.h |1 + 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 77afbf4..0e1c89c 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -51,6 +51,15 @@ #include indirect_table.h #include indirect_util.h +static int glxWindowPrivateKeyIndex; +static DevPrivateKey glxWindowPrivateKey = glxWindowPrivateKeyIndex; + +__GLXdrawable * +glxGetDrawableFromWindow(WindowPtr pWin) +{ + return dixLookupPrivate(pWin-devPrivates, glxWindowPrivateKey); +} + static int validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) { @@ -473,6 +482,7 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, int *error) { DrawablePtr pDraw; +WindowPtr pWin; __GLXdrawable *pGlxDraw; int rc; @@ -499,6 +509,12 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, return NULL; } +pWin = (WindowPtr)pDraw; + +pGlxDraw = glxGetDrawableFromWindow(pWin); +if (pGlxDraw) + return pGlxDraw; + if (pDraw-pScreen != glxc-pGlxScreen-pScreen) { client-errorValue = pDraw-pScreen-myNum; *error = BadMatch; @@ -519,6 +535,8 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, return NULL; } +dixSetPrivate(pWin-devPrivates, glxWindowPrivateKey, pGlxDraw); + return pGlxDraw; } @@ -1107,9 +1125,10 @@ __glXDrawableRelease(__GLXdrawable *drawable) } } -static int +static int DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config, - DrawablePtr pDraw, XID glxDrawableId, int type) + DrawablePtr pDraw, XID glxDrawableId, int type, + __GLXdrawable **ret) { __GLXdrawable *pGlxDraw; @@ -1128,6 +1147,9 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *conf return BadAlloc; } +if (ret) + *ret = pGlxDraw; + return Success; } @@ -1149,7 +1171,7 @@ DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config } err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, - glxDrawableId, GLX_DRAWABLE_PIXMAP); + glxDrawableId, GLX_DRAWABLE_PIXMAP, NULL); if (err == Success) ((PixmapPtr) pDraw)-refcnt++; @@ -1305,7 +1327,7 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, __glXleaveServer(GL_FALSE); return DoCreateGLXDrawable(client, pGlxScreen, config, pPixmap-drawable, - glxDrawableId, GLX_DRAWABLE_PBUFFER); + glxDrawableId, GLX_DRAWABLE_PBUFFER, NULL); } int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc) @@ -1409,6 +1431,8 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc) __GLXscreen*pGlxScreen; ClientPtr client = cl-client; DrawablePtr pDraw; +WindowPtr pWin; +__GLXdrawable *pGlxDraw; int err; if (!validGlxScreen(client, req-screen, pGlxScreen, err)) @@ -1422,11 +1446,26 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc) return BadWindow; } +pWin = (WindowPtr)pDraw; + +/* Make sure there're no already associated GLX drawables. */ +if (glxGetDrawableFromWindow(pWin)) { + client-errorValue = req-window; + return BadAlloc; +} + if (!validGlxFBConfigForWindow(client, config, pDraw, err)) return err; -return DoCreateGLXDrawable(client, pGlxScreen, config, - pDraw, req-glxwindow, GLX_DRAWABLE_WINDOW); +err = DoCreateGLXDrawable(client, pGlxScreen, config, + pDraw, req-glxwindow, + GLX_DRAWABLE_WINDOW, pGlxDraw); +if (err) + return err; + +dixSetPrivate(pWin-devPrivates, glxWindowPrivateKey, pGlxDraw); + +return Success; } int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc) diff --git a/glx/glxserver.h b/glx/glxserver.h index 1daf977..3c49b5e 100644 --- a/glx/glxserver.h +++ b/glx/glxserver.h @@ -80,6 +80,7 @@ typedef struct __GLXcontext __GLXcontext; extern __GLXscreen *glxGetScreen(ScreenPtr pScreen); extern __GLXclientState *glxGetClient(ClientPtr pClient); +extern __GLXdrawable *glxGetDrawableFromWindow(WindowPtr pWin); //
[xserver patch v4 4/5] glx/dri2: Notify the driver when its buffers become invalid.
Signed-off-by: Francisco Jerez curroje...@riseup.net --- glx/glxdri2.c | 28 +--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 0f998de..dae7b42 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -67,6 +67,7 @@ struct __GLXDRIscreen { xf86EnterVTProc*enterVT; xf86LeaveVTProc*leaveVT; +PreConfigureWindowProcPtr PreConfigureWindow; const __DRIcoreExtension *core; const __DRIdri2Extension *dri2; @@ -217,13 +218,13 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable) __GLXDRIscreen *screen = priv-screen; CARD64 unused; -if (screen-flush) - (*screen-flush-flushInvalidate)(priv-driDrawable); - if (DRI2SwapBuffers(client, drawable-pDraw, 0, 0, 0, unused, __glXdriSwapEvent, drawable-pDraw) != Success) return FALSE; +if (screen-flush) + (*screen-flush-invalidate)(priv-driDrawable); + return TRUE; } @@ -607,6 +608,24 @@ glxDRILeaveVT (int index, int flags) } static void +glxDRIPreConfigureWindow(WindowPtr pWin, int x, int y, int w, int h, int bw, +WindowPtr pSib) +{ +ScreenPtr pScreen = pWin-drawable.pScreen; +__GLXDRIscreen *screen = (__GLXDRIscreen *)glxGetScreen(pScreen); +__GLXDRIdrawable *draw = (__GLXDRIdrawable *)glxGetDrawableFromWindow(pWin); + +if (screen-PreConfigureWindow) + (*screen-PreConfigureWindow)(pWin, x, y, w, h, bw, pSib); + +if (!draw || (draw-height == h draw-width == w)) + return; + +if (screen-flush) + screen-flush-invalidate(draw-driDrawable); +} + +static void initializeExtensions(__GLXDRIscreen *screen) { const __DRIextension **extensions; @@ -782,6 +801,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen-leaveVT = pScrn-LeaveVT; pScrn-LeaveVT = glxDRILeaveVT; +screen-PreConfigureWindow = pScreen-PreConfigureWindow; +pScreen-PreConfigureWindow = glxDRIPreConfigureWindow; + LogMessage(X_INFO, AIGLX: Loaded and initialized %s\n, filename); -- 1.6.4.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[xserver patch v4 5/5] dri2: Support the DRI2InvalidateBuffers event.
Bumps the supported DRI2 protocol version. Signed-off-by: Francisco Jerez curroje...@riseup.net --- configure.ac|2 +- hw/xfree86/dri2/dri2.c | 109 +++ hw/xfree86/dri2/dri2.h |5 ++ hw/xfree86/dri2/dri2ext.c | 35 -- include/protocol-versions.h |2 +- 5 files changed, 147 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index ec9442b..efd54a5 100644 --- a/configure.ac +++ b/configure.ac @@ -752,7 +752,7 @@ RECORDPROTO=recordproto = 1.13.99.1 SCRNSAVERPROTO=scrnsaverproto = 1.1 RESOURCEPROTO=resourceproto DRIPROTO=xf86driproto = 2.1.0 -DRI2PROTO=dri2proto = 2.2 +DRI2PROTO=dri2proto = 2.3 XINERAMAPROTO=xineramaproto BIGFONTPROTO=xf86bigfontproto = 1.2.0 XCALIBRATEPROTO=xcalibrateproto diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 48618e1..3099ad8 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -52,6 +52,13 @@ static DevPrivateKey dri2WindowPrivateKey = dri2WindowPrivateKeyIndex; static int dri2PixmapPrivateKeyIndex; static DevPrivateKey dri2PixmapPrivateKey = dri2PixmapPrivateKeyIndex; +typedef struct _DRI2ClientRef *DRI2ClientRefPtr; + +struct _DRI2ClientRef { +DRI2ClientRefPtrnext; +XID resource; +}; + typedef struct _DRI2Drawable { unsigned intrefCount; int width; @@ -65,6 +72,8 @@ typedef struct _DRI2Drawable { CARD64 target_sbc; /* -1 means no SBC wait outstanding */ CARD64 last_swap_target; /* most recently queued swap target */ int swap_limit; /* for N-buffering */ +DRI2ClientRefPtrtrack_clients; /* Clients to notify on drawable changes. */ + } DRI2DrawableRec, *DRI2DrawablePtr; typedef struct _DRI2Screen *DRI2ScreenPtr; @@ -84,6 +93,8 @@ typedef struct _DRI2Screen { DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; HandleExposuresProcPtr HandleExposures; + +PreConfigureWindowProcPtrPreConfigureWindow; } DRI2ScreenRec; static DRI2ScreenPtr @@ -143,6 +154,7 @@ DRI2CreateDrawable(DrawablePtr pDraw) pPriv-swap_interval = 1; pPriv-last_swap_target = -1; pPriv-swap_limit = 1; /* default to double buffering */ +pPriv-track_clients = NULL; if (pDraw-type == DRAWABLE_WINDOW) { @@ -405,6 +417,78 @@ DRI2BlockClient(ClientPtr client, DrawablePtr pDraw) } } +extern RESTYPE dri2DrawableRes; + +int +DRI2TrackClient(DrawablePtr pDraw, int id) +{ +DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); +DRI2ClientRefPtr ref; + +if (pPriv == NULL) + return BadDrawable; + +/* Check if the client is already in. */ +for (ref = pPriv-track_clients; ref; ref = ref-next) { + if (CLIENT_ID(ref-resource) == id) + return Success; +} + +/* Allocate a client ref. */ +ref = xalloc(sizeof(*ref)); +if (ref == NULL) + return BadAlloc; + +ref-next = pPriv-track_clients; +pPriv-track_clients = ref; + +/* Allocate a resource for it. */ +ref-resource = FakeClientID(id); +if (!AddResource(ref-resource, dri2DrawableRes, pDraw)) + return BadAlloc; + +return Success; +} + +void +DRI2UntrackClient(DrawablePtr pDraw, int id) +{ +DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); +DRI2ClientRefPtr ref, *prev; + +if (pPriv == NULL) + return; + +prev = pPriv-track_clients; + +for (ref = *prev; ref; prev = ref-next, ref = ref-next) { + if (CLIENT_ID(ref-resource) == id) { + *prev = ref-next; + xfree(ref); + break; + } +} +} + +void +DRI2InvalidateDrawable(DrawablePtr pDraw) +{ +DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); +DRI2ClientRefPtr ref; + +if (pPriv == NULL) + return; + +while ((ref = pPriv-track_clients)) { + ClientPtr client = clients[CLIENT_ID(ref-resource)]; + + FreeResource(ref-resource, RT_NONE); + + if (client !client-clientGone) + DRI2InvalidateBuffersEvent(pDraw, client); +} +} + int DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, unsigned int dest, unsigned int src) @@ -758,6 +842,7 @@ DRI2DestroyDrawable(DrawablePtr pDraw) { DRI2ScreenPtr ds = DRI2GetScreen(pDraw-pScreen); DRI2DrawablePtr pPriv; +DRI2ClientRefPtr ref; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) @@ -776,6 +861,9 @@ DRI2DestroyDrawable(DrawablePtr pDraw) xfree(pPriv-buffers); } +while ((ref = pPriv-track_clients)) + FreeResource(ref-resource, RT_NONE); + /* If the window is destroyed while we have a swap pending, don't * actually free the priv yet. We'll need it in the DRI2SwapComplete() * callback and we'll free it there once we're done. */ @@ -811,6 +899,24 @@ DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic) return TRUE; } +static void
[mesa patch v4 1/3] dri2: Event driven buffer validation.
When a buffer invalidation event is received from the X server, the invalidate hook of the DRI2 flush extension is executed: A generic implementation (dri2InvalidateDrawable) is provided that just bumps the pStamp sequence number in __DRIdrawableRec. For old servers not supporting buffer invalidation events, the invalidate hook will be called before flushing the fake front/back buffer (that's typically once per frame -- not a lot worse than the situation we were in before). No effort has been made on preserving backwards compatibility with version 2 of the flush extension, but I think it's acceptable because AFAIK no released stack is making use of it. Note that this bumps the required dri2proto version to 2.3. --- v4: Drop flush v2 compatibility as the intel driver has stopped using it for throttling. #ifdef part of the code to make it easier to build with older protocol headers, along the lines of 01923fb72d. configure.ac |2 +- include/GL/internal/dri_interface.h | 14 - src/glx/x11/dri2.c | 10 +- src/glx/x11/dri2.h |3 ++ src/glx/x11/dri2_glx.c | 42 + src/glx/x11/glx_pbuffer.c|4 -- src/glx/x11/glxclient.h |4 ++ src/glx/x11/glxcmds.c|4 -- src/mesa/drivers/dri/common/dri_util.c | 15 - src/mesa/drivers/dri/common/dri_util.h |8 +++-- src/mesa/drivers/dri/intel/intel_context.c |1 - src/mesa/drivers/dri/intel/intel_screen.c| 10 ++ src/mesa/drivers/dri/intel/intel_tex_image.c |4 ++- 13 files changed, 76 insertions(+), 45 deletions(-) diff --git a/configure.ac b/configure.ac index b6c6535..d92d99a 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_CANONICAL_HOST dnl Versions for external dependencies LIBDRM_REQUIRED=2.4.15 LIBDRM_RADEON_REQUIRED=2.4.17 -DRI2PROTO_REQUIRED=2.2 +DRI2PROTO_REQUIRED=2.3 GLPROTO_REQUIRED=1.4.11 dnl Check for progs diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index ec6238f..6399787 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -262,22 +262,20 @@ struct __DRItexBufferExtensionRec { * Used by drivers that implement DRI2 */ #define __DRI2_FLUSH DRI2_Flush -#define __DRI2_FLUSH_VERSION 2 +#define __DRI2_FLUSH_VERSION 3 struct __DRI2flushExtensionRec { __DRIextension base; void (*flush)(__DRIdrawable *drawable); /** - * Flush all rendering queue in the driver to the drm and - * invalidate all buffers. The driver will call out to - * getBuffers/getBuffersWithFormat before it starts rendering - * again. + * Ask the driver to call getBuffers/getBuffersWithFormat before + * it starts rendering again. * - * \param drawable the drawable to flush and invalidate + * \param drawable the drawable to invalidate * - * \since 2 + * \since 3 */ -void (*flushInvalidate)(__DRIdrawable *drawable); +void (*invalidate)(__DRIdrawable *drawable); }; diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c index 91053d3..e692c8c 100644 --- a/src/glx/x11/dri2.c +++ b/src/glx/x11/dri2.c @@ -81,7 +81,7 @@ static XEXT_GENERATE_FIND_DISPLAY (DRI2FindDisplay, dri2Info, dri2ExtensionName, dri2ExtensionHooks, - 1, NULL) + DRI2NumberEvents, NULL) static Bool DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) @@ -126,7 +126,15 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) return True; } #endif +#ifdef DRI2_InvalidateBuffers + case DRI2_InvalidateBuffers: + { + xDRI2InvalidateBuffers *awire = (xDRI2InvalidateBuffers *)wire; + DRI2InvalidateBuffers(dpy, awire-drawable); + return False; + } +#endif default: /* client doesn't support server event */ break; diff --git a/src/glx/x11/dri2.h b/src/glx/x11/dri2.h index 114e9f8..943ac59 100644 --- a/src/glx/x11/dri2.h +++ b/src/glx/x11/dri2.h @@ -103,4 +103,7 @@ DRI2WaitSBC(Display *dpy, XID drawable, CARD64 target_sbc, CARD64 *ust, extern void DRI2SwapInterval(Display *dpy, XID drawable, int interval); +extern void +DRI2InvalidateBuffers(Display *dpy, XID drawable); + #endif diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c index 6200df9..736cd3a 100644 --- a/src/glx/x11/dri2_glx.c +++ b/src/glx/x11/dri2_glx.c @@ -66,6 +66,7 @@ struct __GLXDRIdisplayPrivateRec int driMinor; int driPatch; int swapAvailable; + int invalidateAvailable; }; struct __GLXDRIcontextPrivateRec @@ -309,12 +310,18 @@ dri2WaitGL(__GLXDRIdrawable * pdraw) XFixesDestroyRegion(pdraw-psc-dpy, region); } -
[mesa patch v4 2/3] dri/nouveau: Use event driven buffer validation.
--- src/mesa/drivers/dri/nouveau/nouveau_context.c | 33 +--- src/mesa/drivers/dri/nouveau/nouveau_screen.c | 12 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index b87b8db..6117f68 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -140,6 +140,8 @@ nouveau_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, __DRIbuffer *buffers = NULL; int i = 0, count, ret; + *stamp = *drawable-pStamp; + attachments[i++] = __DRI_BUFFER_FRONT_LEFT; if (fb-Visual.doubleBufferMode) attachments[i++] = __DRI_BUFFER_BACK_LEFT; @@ -218,10 +220,11 @@ nouveau_context_make_current(__DRIcontext *dri_ctx, __DRIdrawable *dri_draw, struct nouveau_context *nctx = dri_ctx-driverPrivate; GLcontext *ctx = nctx-base; - if (nctx-screen-context != nctx) { - nctx-screen-context = nctx; - BITSET_ONES(nctx-dirty); - } + if (nctx-screen-context == nctx) + return GL_TRUE; + + nctx-screen-context = nctx; + BITSET_ONES(nctx-dirty); /* Ask the X server for new renderbuffers. */ nouveau_update_renderbuffers(dri_ctx, dri_draw, @@ -267,6 +270,28 @@ void nouveau_validate_framebuffer(GLcontext *ctx) { struct nouveau_context *nctx = to_nouveau_context(ctx); + __DRIcontext *dri_ctx = to_nouveau_context(ctx)-dri_context; + __DRIdrawable *dri_draw = dri_ctx-driDrawablePriv; + __DRIdrawable *dri_read = dri_ctx-driReadablePriv; + + if ((ctx-DrawBuffer-Name == 0 +nctx-drawable.d_stamp != *dri_draw-pStamp) || + (dri_draw != dri_read +ctx-ReadBuffer-Name == 0 +nctx-drawable.r_stamp != *dri_read-pStamp)) { + if (nctx-drawable.dirty) + ctx-Driver.Flush(ctx); + + /* Ask the X server for new renderbuffers. */ + nouveau_update_renderbuffers(dri_ctx, dri_draw, +nctx-drawable.d_stamp); + if (dri_draw != dri_read) + nouveau_update_renderbuffers(dri_ctx, dri_read, +nctx-drawable.r_stamp); + + if (nouveau_next_dirty_state(ctx) = 0) + FIRE_RING(context_chan(ctx)); + } /* Someone's planning to draw something really soon. */ nctx-drawable.dirty = GL_TRUE; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c index de63282..b70d1f3 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c @@ -246,7 +246,19 @@ nouveau_destroy_buffer(__DRIdrawable *drawable) (struct gl_framebuffer **)drawable-driverPrivate, NULL); } +static void +nouveau_drawable_flush(__DRIdrawable *draw) +{ +} + +static const struct __DRI2flushExtensionRec nouveau_flush_extension = { +{ __DRI2_FLUSH, __DRI2_FLUSH_VERSION }, +nouveau_drawable_flush, +dri2InvalidateDrawable, +}; + static const __DRIextension *nouveau_screen_extensions[] = { +nouveau_flush_extension.base, NULL }; -- 1.6.4.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[mesa patch v4 3/3] st/dri2: Use event-driven buffer validation.
--- src/gallium/state_trackers/dri/dri_context.c |6 +-- src/gallium/state_trackers/dri/dri_drawable.c | 13 ++ src/gallium/state_trackers/dri/dri_screen.c | 12 ++ src/mesa/SConscript |1 - src/mesa/sources.mak |1 - src/mesa/state_tracker/st_atom.c |7 +++- src/mesa/state_tracker/st_cb_viewport.c | 50 - src/mesa/state_tracker/st_cb_viewport.h | 29 -- src/mesa/state_tracker/st_context.c |2 - 9 files changed, 33 insertions(+), 88 deletions(-) delete mode 100644 src/mesa/state_tracker/st_cb_viewport.c delete mode 100644 src/mesa/state_tracker/st_cb_viewport.h diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c index 6edbd9d..90ede35 100644 --- a/src/gallium/state_trackers/dri/dri_context.c +++ b/src/gallium/state_trackers/dri/dri_context.c @@ -166,10 +166,8 @@ dri_make_current(__DRIcontext * cPriv, if (__dri1_api_hooks) { dri1_update_drawables(ctx, draw, read); } else { -if (driDrawPriv) - dri_get_buffers(driDrawPriv); -if (driDrawPriv != driReadPriv driReadPriv) - dri_get_buffers(driReadPriv); +dri_update_buffer(ctx-pipe-screen, + ctx-pipe-priv); } } else { st_make_current(NULL, NULL, NULL); diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index f7ed660..7c8c3fd 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -276,7 +276,20 @@ dri_update_buffer(struct pipe_screen *screen, void *context_private) { struct dri_context *ctx = (struct dri_context *)context_private; + if (ctx-d_stamp == *ctx-dPriv-pStamp + ctx-r_stamp == *ctx-rPriv-pStamp) + return; + + ctx-d_stamp = *ctx-dPriv-pStamp; + ctx-r_stamp = *ctx-rPriv-pStamp; + + st_flush(ctx-st, PIPE_FLUSH_RENDER_CACHE, NULL); + + /* Ask the X server for new renderbuffers. */ dri_get_buffers(ctx-dPriv); + if (ctx-dPriv != ctx-rPriv) + dri_get_buffers(ctx-rPriv); + } void diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 2052867..1b02fe9 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -61,6 +61,17 @@ static const __DRItexBufferExtension dri2TexBufferExtension = { dri2_set_tex_buffer2, }; +static void +dri2_flush_drawable(__DRIdrawable *draw) +{ +} + +static const __DRI2flushExtension dri2FlushExtension = { +{ __DRI2_FLUSH, __DRI2_FLUSH_VERSION }, +dri2_flush_drawable, +dri2InvalidateDrawable, +}; + static const __DRIextension *dri_screen_extensions[] = { driReadDrawableExtension, driCopySubBufferExtension.base, @@ -68,6 +79,7 @@ static const __DRItexBufferExtension dri2TexBufferExtension = { driFrameTrackingExtension.base, driMediaStreamCounterExtension.base, dri2TexBufferExtension.base, + dri2FlushExtension.base, NULL }; diff --git a/src/mesa/SConscript b/src/mesa/SConscript index ea5bad2..0726fcb 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -174,7 +174,6 @@ if env['platform'] != 'winddk': 'state_tracker/st_cb_readpixels.c', 'state_tracker/st_cb_strings.c', 'state_tracker/st_cb_texture.c', - 'state_tracker/st_cb_viewport.c', 'state_tracker/st_context.c', 'state_tracker/st_debug.c', 'state_tracker/st_draw.c', diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 12d4c28..3543319 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -204,7 +204,6 @@ STATETRACKER_SOURCES = \ state_tracker/st_cb_readpixels.c \ state_tracker/st_cb_strings.c \ state_tracker/st_cb_texture.c \ - state_tracker/st_cb_viewport.c \ state_tracker/st_context.c \ state_tracker/st_debug.c \ state_tracker/st_draw.c \ diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 73df44d..6a7ebff 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -35,7 +35,8 @@ #include st_cb_bitmap.h #include st_program.h - +#include pipe/p_context.h + /** * This is used to initialize st-atoms[]. @@ -135,6 +136,10 @@ void st_validate_state( struct st_context *st ) check_program_state( st ); + if (st-pipe-screen-update_buffer) + st-pipe-screen-update_buffer(st-pipe-screen, + st-pipe-priv); + if (state-st == 0) return; diff --git a/src/mesa/state_tracker/st_cb_viewport.c b/src/mesa/state_tracker/st_cb_viewport.c deleted file mode 100644 index b29191a..000 ---
Re: [Mesa3d-dev] [xserver patch v4 4/5] glx/dri2: Notify the driver when its buffers become invalid.
Francisco, Will Mesa continue to build after these changes for people who have not tracked the latest glproto and dri2proto repos? I'd prefer to be able to build Mesa on at least the most recently released major distros, which may require the use of some #ifdefs in the changes. Keith On Mon, 2010-02-08 at 10:25 -0800, Francisco Jerez wrote: Signed-off-by: Francisco Jerez curroje...@riseup.net --- glx/glxdri2.c | 28 +--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 0f998de..dae7b42 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -67,6 +67,7 @@ struct __GLXDRIscreen { xf86EnterVTProc *enterVT; xf86LeaveVTProc *leaveVT; +PreConfigureWindowProcPtr PreConfigureWindow; const __DRIcoreExtension *core; const __DRIdri2Extension *dri2; @@ -217,13 +218,13 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable) __GLXDRIscreen *screen = priv-screen; CARD64 unused; -if (screen-flush) - (*screen-flush-flushInvalidate)(priv-driDrawable); - if (DRI2SwapBuffers(client, drawable-pDraw, 0, 0, 0, unused, __glXdriSwapEvent, drawable-pDraw) != Success) return FALSE; +if (screen-flush) + (*screen-flush-invalidate)(priv-driDrawable); + return TRUE; } @@ -607,6 +608,24 @@ glxDRILeaveVT (int index, int flags) } static void +glxDRIPreConfigureWindow(WindowPtr pWin, int x, int y, int w, int h, int bw, + WindowPtr pSib) +{ +ScreenPtr pScreen = pWin-drawable.pScreen; +__GLXDRIscreen *screen = (__GLXDRIscreen *)glxGetScreen(pScreen); +__GLXDRIdrawable *draw = (__GLXDRIdrawable *)glxGetDrawableFromWindow(pWin); + +if (screen-PreConfigureWindow) + (*screen-PreConfigureWindow)(pWin, x, y, w, h, bw, pSib); + +if (!draw || (draw-height == h draw-width == w)) + return; + +if (screen-flush) + screen-flush-invalidate(draw-driDrawable); +} + +static void initializeExtensions(__GLXDRIscreen *screen) { const __DRIextension **extensions; @@ -782,6 +801,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen-leaveVT = pScrn-LeaveVT; pScrn-LeaveVT = glxDRILeaveVT; +screen-PreConfigureWindow = pScreen-PreConfigureWindow; +pScreen-PreConfigureWindow = glxDRIPreConfigureWindow; + LogMessage(X_INFO, AIGLX: Loaded and initialized %s\n, filename); ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [Mesa3d-dev] [xserver patch v4 4/5] glx/dri2: Notify the driver when its buffers become invalid.
Keith Whitwell kei...@vmware.com writes: Francisco, Will Mesa continue to build after these changes for people who have not tracked the latest glproto and dri2proto repos? I'd prefer to be able to build Mesa on at least the most recently released major distros, which may require the use of some #ifdefs in the changes. That's one of the reasons of the last rebase, see the comments in [mesa patch v4 1/3] dri2: Event driven buffer validation.. Keith On Mon, 2010-02-08 at 10:25 -0800, Francisco Jerez wrote: Signed-off-by: Francisco Jerez curroje...@riseup.net --- glx/glxdri2.c | 28 +--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 0f998de..dae7b42 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -67,6 +67,7 @@ struct __GLXDRIscreen { xf86EnterVTProc *enterVT; xf86LeaveVTProc *leaveVT; +PreConfigureWindowProcPtr PreConfigureWindow; const __DRIcoreExtension *core; const __DRIdri2Extension *dri2; @@ -217,13 +218,13 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable) __GLXDRIscreen *screen = priv-screen; CARD64 unused; -if (screen-flush) -(*screen-flush-flushInvalidate)(priv-driDrawable); - if (DRI2SwapBuffers(client, drawable-pDraw, 0, 0, 0, unused, __glXdriSwapEvent, drawable-pDraw) != Success) return FALSE; +if (screen-flush) +(*screen-flush-invalidate)(priv-driDrawable); + return TRUE; } @@ -607,6 +608,24 @@ glxDRILeaveVT (int index, int flags) } static void +glxDRIPreConfigureWindow(WindowPtr pWin, int x, int y, int w, int h, int bw, + WindowPtr pSib) +{ +ScreenPtr pScreen = pWin-drawable.pScreen; +__GLXDRIscreen *screen = (__GLXDRIscreen *)glxGetScreen(pScreen); +__GLXDRIdrawable *draw = (__GLXDRIdrawable *)glxGetDrawableFromWindow(pWin); + +if (screen-PreConfigureWindow) +(*screen-PreConfigureWindow)(pWin, x, y, w, h, bw, pSib); + +if (!draw || (draw-height == h draw-width == w)) +return; + +if (screen-flush) +screen-flush-invalidate(draw-driDrawable); +} + +static void initializeExtensions(__GLXDRIscreen *screen) { const __DRIextension **extensions; @@ -782,6 +801,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen-leaveVT = pScrn-LeaveVT; pScrn-LeaveVT = glxDRILeaveVT; +screen-PreConfigureWindow = pScreen-PreConfigureWindow; +pScreen-PreConfigureWindow = glxDRIPreConfigureWindow; + LogMessage(X_INFO, AIGLX: Loaded and initialized %s\n, filename); pgp42OxHb0jy3.pgp Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] kdrive: Remove Xfbdev.
Use Xorg with the fbdev driver. Signed-off-by: Adam Jackson a...@redhat.com --- configure.ac| 14 - hw/kdrive/Makefile.am |7 +- hw/kdrive/fbdev/.gitignore |2 - hw/kdrive/fbdev/Makefile.am | 29 -- hw/kdrive/fbdev/Xfbdev.man | 28 -- hw/kdrive/fbdev/fbdev.c | 826 --- hw/kdrive/fbdev/fbdev.h | 99 - hw/kdrive/fbdev/fbinit.c| 101 -- include/kdrive-config.h.in |3 - 9 files changed, 1 insertions(+), 1108 deletions(-) delete mode 100644 hw/kdrive/fbdev/.gitignore delete mode 100644 hw/kdrive/fbdev/Makefile.am delete mode 100644 hw/kdrive/fbdev/Xfbdev.man delete mode 100644 hw/kdrive/fbdev/fbdev.c delete mode 100644 hw/kdrive/fbdev/fbdev.h delete mode 100644 hw/kdrive/fbdev/fbinit.c diff --git a/configure.ac b/configure.ac index ec9442b..480a78c 100644 --- a/configure.ac +++ b/configure.ac @@ -637,7 +637,6 @@ dnl kdrive and its subsystems AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto]) -AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto]) dnl kdrive options AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto]) AC_ARG_ENABLE(kdrive-mouse, AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto]) @@ -1986,17 +1985,6 @@ if test $KDRIVE = yes; then AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server]) AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx]) -AC_CHECK_HEADERS([linux/fb.h]) -if test $ac_cv_header_linux_fb_h = yes test x$XFBDEV = xauto; then -XFBDEV=yes -fi - -if test x$XFBDEV = xyes; then -KDRIVEFBDEVLIB=yes -AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server]) -fi - - PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB=yes], [HAVE_TSLIB=no]) if test x$HAVE_TSLIB = xno; then AC_CHECK_LIB(ts, ts_open, [HAVE_TSLIB=yes]) @@ -2097,7 +2085,6 @@ AM_CONDITIONAL(KDRIVE_EVDEV, [test x$KDRIVE_EVDEV = xyes]) AM_CONDITIONAL(KDRIVE_KBD, [test x$KDRIVE_KBD = xyes]) AM_CONDITIONAL(KDRIVE_MOUSE, [test x$KDRIVE_MOUSE = xyes]) AM_CONDITIONAL(TSLIB, [test x$HAVE_TSLIB = xyes]) -AM_CONDITIONAL(KDRIVEFBDEV, [test x$XFBDEV = xyes]) AM_CONDITIONAL(XEPHYR, [test x$KDRIVE = xyes test x$XEPHYR = xyes]) AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test x$KDRIVE = xyes test x$KDRIVEFBDEVLIB = xyes]) AM_CONDITIONAL(XFAKESERVER, [test x$KDRIVE = xyes test x$XFAKE = xyes]) @@ -2215,7 +2202,6 @@ hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/fake/Makefile -hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile test/Makefile diff --git a/hw/kdrive/Makefile.am b/hw/kdrive/Makefile.am index 906a14c..4f837c5 100644 --- a/hw/kdrive/Makefile.am +++ b/hw/kdrive/Makefile.am @@ -1,7 +1,3 @@ -if BUILD_KDRIVEFBDEVLIB -FBDEV_SUBDIRS = fbdev -endif - if XFAKESERVER XFAKE_SUBDIRS = fake endif @@ -15,7 +11,6 @@ LINUX_SUBDIRS = linux endif SERVER_SUBDIRS = \ - $(FBDEV_SUBDIRS)\ $(XEPHYR_SUBDIRS) \ $(XFAKE_SUBDIRS) @@ -24,7 +19,7 @@ SUBDIRS = \ $(LINUX_SUBDIRS)\ $(SERVER_SUBDIRS) -DIST_SUBDIRS = fbdev ephyr src linux fake +DIST_SUBDIRS = ephyr src linux fake relink: @for i in $(SERVER_SUBDIRS) ; do make -C $$i relink ; done diff --git a/hw/kdrive/fbdev/.gitignore b/hw/kdrive/fbdev/.gitignore deleted file mode 100644 index 80ad266..000 --- a/hw/kdrive/fbdev/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Add Override for this directory and it's subdirectories -Xfbdev diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am deleted file mode 100644 index 5d0ca3f..000 --- a/hw/kdrive/fbdev/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -INCLUDES = \ - @KDRIVE_INCS@ \ - @KDRIVE_CFLAGS@ - -noinst_LTLIBRARIES = libfbdev.la - -libfbdev_la_SOURCES = \ - fbdev.c \ - fbdev.h - -if KDRIVEFBDEV -bin_PROGRAMS = Xfbdev - -Xfbdev_SOURCES = \ - fbinit.c - -Xfbdev_LDADD = \ - libfbdev.la \ - @KDRIVE_LIBS@ - -Xfbdev_DEPENDENCIES = \ - libfbdev.la \ -
Re: [PATCH] kdrive: Remove Xfbdev.
Twas brillig at 14:27:40 08.02.2010 UTC-05 when a...@redhat.com did gyre and gimble: AJ Use Xorg with the fbdev driver. Nack. Xfree86 DDX is still too heavy to be used in embedded stuff where Xfbdev is used. Let's chop some unneeded bits from Xfree86 first. -- http://fossarchy.blogspot.com/ pgprYFTcwupZO.pgp Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] kdrive: Remove Xfbdev.
Twas brillig at 20:30:05 08.02.2010 UTC+01 when dotted...@dottedmag.net did gyre and gimble: AJ Use Xorg with the fbdev driver. MG Nack. Xfree86 DDX is still too heavy to be used in embedded stuff MG where Xfbdev is used. Let's chop some unneeded bits from Xfree86 MG first. And I am willing to maintain Xfbdev until it happens. -- http://fossarchy.blogspot.com/ pgp4bpBLPB9Lf.pgp Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [xserver patch v4 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows.
On Mon, Feb 8, 2010 at 1:25 PM, Francisco Jerez curroje...@riseup.net wrote: The spec says (regarding glXCreateWindow): If there is already a GLXFBConfig associated with win (as a result of a previous glXCreateWindow call), then a BadAlloc error is generated.. It will also come useful to implement DRI2InvalidateBuffers for the indirect case. Can you just use the existing __glXDrawableRes for tracking this? cheers, Kristian ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PULL] Fedora patch merge
Merges some patches I've had sitting in the Fedora tree for too long. Should be pretty uncontroversial. Thanks to Alan Coopersmith for checking my work on the multilib fix. --- The following changes since commit db687f718f760ba254ab51994769db101dc9ca3a: Peter Hutterer (1): xkb: sed True - TRUE and False - FALSE are available in the git repository at: git://people.freedesktop.org/~ajax/xserver.git fedora-merge Adam Jackson (3): os: Add -displayfd option. xfree86: If the driver found modes on an output, don't add more xfree86: Fix the sdk headers to be multilib-safe dix/globals.c |1 + doc/Xserver.man.pre |7 hw/xfree86/modes/xf86Crtc.c |5 ++- include/colormapst.h|4 +- include/opaque.h|1 + include/xorg-server.h.in|7 ++-- os/connection.c | 72 +-- os/utils.c | 11 ++ 8 files changed, 79 insertions(+), 29 deletions(-) - ajax signature.asc Description: This is a digitally signed message part ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [xserver patch v4 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows.
Kristian Høgsberg k...@bitplanet.net writes: On Mon, Feb 8, 2010 at 1:25 PM, Francisco Jerez curroje...@riseup.net wrote: The spec says (regarding glXCreateWindow): If there is already a GLXFBConfig associated with win (as a result of a previous glXCreateWindow call), then a BadAlloc error is generated.. It will also come useful to implement DRI2InvalidateBuffers for the indirect case. Can you just use the existing __glXDrawableRes for tracking this? I don't think so. To implement DRI2InvalidateBuffers we need a way to map an X11 window to its GLX window: In the GLX1.3 world the client decides the IDs of its GLX drawables so in general GLX and X11 drawable IDs aren't going to be the same. cheers, Kristian pgp4gyLRlZ0B5.pgp Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [Mesa3d-dev] [xserver patch v4 4/5] glx/dri2: Notify the driver when its buffers become invalid.
On Mon, 2010-02-08 at 10:41 -0800, Francisco Jerez wrote: Keith Whitwell kei...@vmware.com writes: Francisco, Will Mesa continue to build after these changes for people who have not tracked the latest glproto and dri2proto repos? I'd prefer to be able to build Mesa on at least the most recently released major distros, which may require the use of some #ifdefs in the changes. That's one of the reasons of the last rebase, see the comments in [mesa patch v4 1/3] dri2: Event driven buffer validation.. Ah, fantastic! Thanks Francisco. Keith ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] kdrive: Remove Xfbdev.
On Mon, 2010-02-08 at 20:30 +0100, Mikhail Gusarov wrote: Twas brillig at 14:27:40 08.02.2010 UTC-05 when a...@redhat.com did gyre and gimble: AJ Use Xorg with the fbdev driver. Nack. Xfree86 DDX is still too heavy to be used in embedded stuff where Xfbdev is used. Let's chop some unneeded bits from Xfree86 first. [citation needed] - ajax signature.asc Description: This is a digitally signed message part ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] kdrive: Remove Xfbdev.
Twas brillig at 16:07:17 08.02.2010 UTC-05 when a...@nwnk.net did gyre and gimble: AJ Use Xorg with the fbdev driver. Nack. Xfree86 DDX is still too heavy to be used in embedded stuff where Xfbdev is used. Let's chop some unneeded bits from Xfree86 first. AJ [citation needed] 787 664 root S 13628 5.5 0.0 /usr/bin/Xorg -logfile /tmp/Xorg.0.log -logverbose 1 -nolist 13 megs, compared to 1.4 of Xfbdev. -- http://fossarchy.blogspot.com/ pgp1StvYUvovc.pgp Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [xserver patch v4 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows.
On Mon, Feb 8, 2010 at 1:25 PM, Francisco Jerez curroje...@riseup.net wrote: The spec says (regarding glXCreateWindow): If there is already a GLXFBConfig associated with win (as a result of a previous glXCreateWindow call), then a BadAlloc error is generated.. It will also come useful to implement DRI2InvalidateBuffers for the indirect case. (from elsewhere in the thread:) Can you just use the existing __glXDrawableRes for tracking this? I don't think so. To implement DRI2InvalidateBuffers we need a way to map an X11 window to its GLX window: In the GLX1.3 world the client decides the IDs of its GLX drawables so in general GLX and X11 drawable IDs aren't going to be the same. Ah yes, you're right. A few comments below. Signed-off-by: Francisco Jerez curroje...@riseup.net --- glx/glxcmds.c | 51 +-- glx/glxserver.h | 1 + 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 77afbf4..0e1c89c 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -51,6 +51,15 @@ #include indirect_table.h #include indirect_util.h +static int glxWindowPrivateKeyIndex; +static DevPrivateKey glxWindowPrivateKey = glxWindowPrivateKeyIndex; + +__GLXdrawable * +glxGetDrawableFromWindow(WindowPtr pWin) +{ + return dixLookupPrivate(pWin-devPrivates, glxWindowPrivateKey); +} + static int validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) { @@ -473,6 +482,7 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, int *error) { DrawablePtr pDraw; + WindowPtr pWin; __GLXdrawable *pGlxDraw; int rc; @@ -499,6 +509,12 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, return NULL; } + pWin = (WindowPtr)pDraw; + + pGlxDraw = glxGetDrawableFromWindow(pWin); + if (pGlxDraw) + return pGlxDraw; If there already is a GLXWindow for the window, the validGlxDrawable() call above should return the __GLXdrawable for it, so this hunk shouldn't be necessary. if (pDraw-pScreen != glxc-pGlxScreen-pScreen) { client-errorValue = pDraw-pScreen-myNum; *error = BadMatch; @@ -519,6 +535,8 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, return NULL; } + dixSetPrivate(pWin-devPrivates, glxWindowPrivateKey, pGlxDraw); + return pGlxDraw; } @@ -1107,9 +1125,10 @@ __glXDrawableRelease(__GLXdrawable *drawable) } } -static int +static int DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config, - DrawablePtr pDraw, XID glxDrawableId, int type) + DrawablePtr pDraw, XID glxDrawableId, int type, + __GLXdrawable **ret) { __GLXdrawable *pGlxDraw; @@ -1128,6 +1147,9 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *conf return BadAlloc; } + if (ret) + *ret = pGlxDraw; + I would just see if type is GLX_DRAWABLE_WINDOW and set the window private in DoCreateGLXDrawable() if it is. Less code churn. The rest looks good. Kristian ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] kdrive: Remove Xfbdev.
On Mon, 2010-02-08 at 22:12 +0100, Mikhail Gusarov wrote: Twas brillig at 16:07:17 08.02.2010 UTC-05 when a...@nwnk.net did gyre and gimble: AJ Use Xorg with the fbdev driver. Nack. Xfree86 DDX is still too heavy to be used in embedded stuff where Xfbdev is used. Let's chop some unneeded bits from Xfree86 first. AJ [citation needed] 787 664 root S 13628 5.5 0.0 /usr/bin/Xorg -logfile /tmp/Xorg.0.log -logverbose 1 -nolist 13 megs, compared to 1.4 of Xfbdev. How much of that is .text or .rodata, are they built with the same set of extensions, does xdpyinfo bear that out, is that actually the fbdev driver or a hardware driver, etc. Also, what's the resolution and depth of the display under test, since Xfbdev does not use shadowfb by default but Xorg+fbdev does, and that'll show up as a malloc the size of the screen. Don't get me wrong, I'm in favor of reducing the xfree86 footprint, I just believe the case to be overstated. - ajax signature.asc Description: This is a digitally signed message part ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] xfree86: Add qxl driver to autodetect logic.
Signed-off-by: Adam Jackson a...@redhat.com --- hw/xfree86/common/xf86AutoConfig.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 1c4595e..384c7e5 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -194,6 +194,7 @@ videoPtrToDriverList(struct pci_device *dev, case 0x10c8:driverList[0] = neomagic; break; case 0x10de: case 0x12d2: driverList[0] = nv; break; case 0x1106:driverList[0] = openchrome; break; + case 0x1af4:driverList[0] = qxl; break; case 0x1163:driverList[0] = rendition; break; case 0x5333: switch (dev-device_id) -- 1.6.5.2 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] kdrive: Remove Xfbdev.
Twas brillig at 17:28:51 08.02.2010 UTC-05 when a...@nwnk.net did gyre and gimble: AJ [citation needed] 787 664 root S 13628 5.5 0.0 /usr/bin/Xorg -logfile /tmp/Xorg.0.log -logverbose 1 -nolist 13 megs, compared to 1.4 of Xfbdev. AJ How much of that is .text or .rodata Not much. -rwxr-xr-x1 root root 1525468 Nov 24 17:30 /usr/bin/Xorg -rwxr-xr-x1 root root 1528636 Jan 1 1970 /usr/bin/Xfbdev* But it's a bit apples to oranges - Xfbdev here is compiled for MIPS which features much lower code density than ARM (Xorg). Same Xfbdev for ARM is ~1.2 megs (don't have device to check right now). Both are compiled against glibc. AJ, are they built with the same set of extensions, does xdpyinfo bear AJthat out, is that actually the fbdev driver or a hardware driver, AJetc. Do you know where to get xdpyinfo for maemo 5? :) DDX + driver, I assume. But I did not check it yet. AJ Also, what's the resolution and depth of the display under test, AJ since Xfbdev does not use shadowfb by default but Xorg+fbdev does, AJ and that'll show up as a malloc the size of the screen. Xfbdev in this particular case was rotated. AJ Don't get me wrong, I'm in favor of reducing the xfree86 footprint, AJ I just believe the case to be overstated. I was wrong about 1.4. It's 13 megs vs 4.2 megs after second check. Anyway, try to run Xfree86 + fbdev (and some app) on 32meg device and you'll see. I understand you want to continue ajaxization, but *please* keep this stuff in tree for a bit longer, I will be the first who will want to kill it with fire as soon as Xfree86 fits targets I work on. -- http://fossarchy.blogspot.com/ pgpKBNWM3vRDm.pgp Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[xserver patch v5 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows.
The spec says (regarding glXCreateWindow): If there is already a GLXFBConfig associated with win (as a result of a previous glXCreateWindow call), then a BadAlloc error is generated.. It will also come useful to implement DRI2InvalidateBuffers for the indirect case. Signed-off-by: Francisco Jerez curroje...@riseup.net --- v5: Simplification as suggested by Kristian. glx/glxcmds.c | 24 +++- glx/glxserver.h |1 + 2 files changed, 24 insertions(+), 1 deletions(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 77afbf4..cac30e6 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -51,6 +51,15 @@ #include indirect_table.h #include indirect_util.h +static int glxWindowPrivateKeyIndex; +static DevPrivateKey glxWindowPrivateKey = glxWindowPrivateKeyIndex; + +__GLXdrawable * +glxGetDrawableFromWindow(WindowPtr pWin) +{ + return dixLookupPrivate(pWin-devPrivates, glxWindowPrivateKey); +} + static int validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) { @@ -519,6 +528,9 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, return NULL; } +dixSetPrivate(((WindowPtr)pDraw)-devPrivates, glxWindowPrivateKey, + pGlxDraw); + return pGlxDraw; } @@ -1107,7 +1119,7 @@ __glXDrawableRelease(__GLXdrawable *drawable) } } -static int +static int DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config, DrawablePtr pDraw, XID glxDrawableId, int type) { @@ -1128,6 +1140,10 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *conf return BadAlloc; } +if (type == GLX_DRAWABLE_WINDOW) + dixSetPrivate(((WindowPtr)pDraw)-devPrivates, + glxWindowPrivateKey, pGlxDraw); + return Success; } @@ -1422,6 +1438,12 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc) return BadWindow; } +/* Make sure there're no already associated GLX drawables. */ +if (glxGetDrawableFromWindow((WindowPtr)pDraw)) { + client-errorValue = req-window; + return BadAlloc; +} + if (!validGlxFBConfigForWindow(client, config, pDraw, err)) return err; diff --git a/glx/glxserver.h b/glx/glxserver.h index 1daf977..3c49b5e 100644 --- a/glx/glxserver.h +++ b/glx/glxserver.h @@ -80,6 +80,7 @@ typedef struct __GLXcontext __GLXcontext; extern __GLXscreen *glxGetScreen(ScreenPtr pScreen); extern __GLXclientState *glxGetClient(ClientPtr pClient); +extern __GLXdrawable *glxGetDrawableFromWindow(WindowPtr pWin); // -- 1.6.4.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] added labels for multitouch valuators
On Mon, Feb 08, 2010 at 01:50:43PM +0100, Benjamin Tissoires wrote: Thoses definitions have been included in the kernel but the X server is not updated accordingly. Without these definitions, the multitouch axes are not correctly labelled. Signed-off-by: Benjamin Tissoires tisso...@cena.fr Reviewed-by: Peter Hutterer peter.hutte...@who-t.net Cheers, Peter --- Xi/xiproperty.c | 11 +++ include/xserver-properties.h | 11 +++ 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index ea66c54..be07831 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -93,6 +93,17 @@ static struct dev_properties {0, AXIS_LABEL_PROP_ABS_TILT_Y}, {0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH}, {0, AXIS_LABEL_PROP_ABS_VOLUME}, +{0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR}, +{0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR}, +{0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR}, +{0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR}, +{0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION}, +{0, AXIS_LABEL_PROP_ABS_MT_POSITION_X}, +{0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y}, +{0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE}, +{0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID}, +{0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID}, +{0, AXIS_LABEL_PROP_ABS_MT_PRESSURE}, {0, AXIS_LABEL_PROP_ABS_MISC}, {0, BTN_LABEL_PROP}, diff --git a/include/xserver-properties.h b/include/xserver-properties.h index 626d0ad..30e8efb 100644 --- a/include/xserver-properties.h +++ b/include/xserver-properties.h @@ -89,6 +89,17 @@ #define AXIS_LABEL_PROP_ABS_TILT_Y Abs Tilt Y #define AXIS_LABEL_PROP_ABS_TOOL_WIDTH Abs Tool Width #define AXIS_LABEL_PROP_ABS_VOLUME Abs Volume +#define AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR Abs MT Touch Major +#define AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR Abs MT Touch Minor +#define AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR Abs MT Width Major +#define AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR Abs MT Width Minor +#define AXIS_LABEL_PROP_ABS_MT_ORIENTATION Abs MT Orientation +#define AXIS_LABEL_PROP_ABS_MT_POSITION_X Abs MT Position X +#define AXIS_LABEL_PROP_ABS_MT_POSITION_Y Abs MT Position Y +#define AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE Abs MT Tool Type +#define AXIS_LABEL_PROP_ABS_MT_BLOB_ID Abs MT Blob ID +#define AXIS_LABEL_PROP_ABS_MT_TRACKING_ID Abs MT Tracking ID +#define AXIS_LABEL_PROP_ABS_MT_PRESSUREAbs MT Pressure #define AXIS_LABEL_PROP_ABS_MISCAbs Misc /* Button names */ -- 1.6.6 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH video-apm 0/4] Move compiler flags from configure.ac to Makefile.am
Some unsed variables are removed and compiler flags are set in Makefile.am rather than in CFLAGS which is reseerved for the user to override. Applies to these modules: ./driver/xf86-video-apm ./driver/xf86-video-ark ./driver/xf86-video-dummy ./driver/xf86-video-qxl ./driver/xf86-video-vesa Gaetan Nadon (4): config: removed unused variables XORG_INCS and XF86RUSH_INCS config: remove unused INCLUDES='-I$(top_srcdir)/src' config: remove unrequired '-I$(top_srcdir)/src' config: move compiler flags from configure.ac to Makefile.am configure.ac|6 -- src/Makefile.am |3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH video-apm 1/4] config: removed unused variables XORG_INCS and XF86RUSH_INCS
Signed-off-by: Gaetan Nadon mems...@videotron.ca --- configure.ac |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index aded44e..70f0b0a 100644 --- a/configure.ac +++ b/configure.ac @@ -72,7 +72,7 @@ AC_SUBST([XF86RUSH_LIBS]) AC_SUBST([XF86RUSH_CFLAGS]) CFLAGS=$CFLAGS $XORG_CFLAGS $XF86RUSH_CFLAGS' -I$(top_srcdir)/src' -INCLUDES=$XORG_INCS $XF86RUSH_INCS '-I$(top_srcdir)/src' +INCLUDES='-I$(top_srcdir)/src' AC_SUBST([CFLAGS]) AC_SUBST([INCLUDES]) -- 1.6.0.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH video-apm 2/4] config: remove unused INCLUDES='-I$(top_srcdir)/src'
This statement is redundant and not used in the makefile Signed-off-by: Gaetan Nadon mems...@videotron.ca --- configure.ac |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 70f0b0a..ab716d0 100644 --- a/configure.ac +++ b/configure.ac @@ -72,9 +72,7 @@ AC_SUBST([XF86RUSH_LIBS]) AC_SUBST([XF86RUSH_CFLAGS]) CFLAGS=$CFLAGS $XORG_CFLAGS $XF86RUSH_CFLAGS' -I$(top_srcdir)/src' -INCLUDES='-I$(top_srcdir)/src' AC_SUBST([CFLAGS]) -AC_SUBST([INCLUDES]) save_CFLAGS=$CFLAGS CFLAGS=$XORG_CFLAGS -- 1.6.0.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH video-apm 3/4] config: remove unrequired '-I$(top_srcdir)/src'
The current dir is already included by default in the makefile top_builddir = .. DEFAULT_INCLUDES = -I. -I$(top_builddir) Signed-off-by: Gaetan Nadon mems...@videotron.ca --- configure.ac |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index ab716d0..34d1d91 100644 --- a/configure.ac +++ b/configure.ac @@ -71,7 +71,7 @@ AM_CONDITIONAL(XF86RUSH, test x$have_xf86rush = xyes) AC_SUBST([XF86RUSH_LIBS]) AC_SUBST([XF86RUSH_CFLAGS]) -CFLAGS=$CFLAGS $XORG_CFLAGS $XF86RUSH_CFLAGS' -I$(top_srcdir)/src' +CFLAGS=$CFLAGS $XORG_CFLAGS $XF86RUSH_CFLAGS AC_SUBST([CFLAGS]) save_CFLAGS=$CFLAGS -- 1.6.0.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH video-apm 4/4] config: move compiler flags from configure.ac to Makefile.am
CFLAGS is an automake defined variable that should not be set by the module. It should not be AC_SUBST either, it already is. Use AM_CFLAGS in Makefile.am. This will allow the user to override the flags as they will be in the right order. Signed-off-by: Gaetan Nadon mems...@videotron.ca --- configure.ac|4 src/Makefile.am |3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 34d1d91..7c25cf0 100644 --- a/configure.ac +++ b/configure.ac @@ -71,9 +71,6 @@ AM_CONDITIONAL(XF86RUSH, test x$have_xf86rush = xyes) AC_SUBST([XF86RUSH_LIBS]) AC_SUBST([XF86RUSH_CFLAGS]) -CFLAGS=$CFLAGS $XORG_CFLAGS $XF86RUSH_CFLAGS -AC_SUBST([CFLAGS]) - save_CFLAGS=$CFLAGS CFLAGS=$XORG_CFLAGS AC_CHECK_DECL(xf86ConfigIsaEntity, @@ -97,7 +94,6 @@ AC_HEADER_STDC if test x$XSERVER_LIBPCIACCESS = xyes; then PKG_CHECK_MODULES([PCIACCESS], [pciaccess = 0.8.0]) -XORG_CFLAGS=$XORG_CFLAGS $PCIACCESS_CFLAGS fi DRIVER_NAME=apm diff --git a/src/Makefile.am b/src/Makefile.am index 8a6779e..1fc336a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,6 +24,9 @@ # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. + +AM_CFLAGS = $(XORG_CFLAGS) $(PCIACCESS_CFLAGS) $(XF86RUSH_CFLAGS) + apm_drv_la_LTLIBRARIES = apm_drv.la apm_drv_la_LDFLAGS = -module -avoid-version apm_drv_ladir = @moduledir@/drivers -- 1.6.0.4 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: multitouch
On Mon, Feb 08, 2010 at 06:23:53PM +0900, Carsten Haitzler wrote: There's also the fact that the current approach that Benjamin suggested requires an extra client to manage the slave devices. OTOH, if you're getting serious, there needs to be an instance translating events into gestures/metaphors anyway. So I don't see the point of avoiding an instance you're likely to need further on. A gesture recogniser instance will be mandatory. However, a client that modifies the list of input devices on demand and quite frequently hopefully won't. Benjamin's approach puts quite a load on the server and on all clients (presence events are sent to every client), IMO unnecessarily. why should one be at the xi2 event level? i'm dubious of this. i've thought it through a lot - you want gesture recognition happening higher up in the toolkit or app. you need context - does that gesture make sense. if one gesture was started but it ended in a way that gesture changed, u ned to cancel the previous action etc. imho multitouch etc. should stick to delivering as much info that the HW provides as cleanly and simply as possible via xi2 with minimal interruption of existing app functionality. I think my wording was ambiguous - I do not want a gesture recognizer on the X side of the protocol. I want the X server to forward the events as unmodified as possible to the right client. That's all. The basic principle for the master/slave division is that even in the presence of multiple physical devices, what really counts in the GUI is the virtual input points. This used to be a cursor, now it can be multiple cursors and with multitouch it will be similar. Most multitouch gestures still have a single input point with auxiliary information attach. Prime example is the pinch gesture with thumb and index - it's not actually two separate points, it's one interaction. Having two master devices for this type of gesture is overkill. As a rule of thumb, each hand from each user usually constitutes an input point and thus should be represented as a master device. well that depends - if i take both my hands with 2 fingers and now i draw thins with both left and right hand.. i am using my hands as 2 independent core devices. Really? your fingers are more flexible than mine then, because while I can draw four lines like this, in reality they will be two sets of two lines instead. Hence again, two input points with one auxiliary point. Now, if you'd be starting to use your nose in addition to your hands, that's what I'd accept as a third input point (not sure if I'd want to be the next person to use the touchscreen then though ;) Buy you are right, the 2 master devices are a rule of thumb only and do not apply to all (most?) cases. the problem is - the screen can't tell the difference - neither can the app. i like 2 core devices - it means u can emulate multitouch screens with mice... you just need N mice for N fingers. :) this is a good way to encourage support in apps and toolkits as it can be more widely used. An example device tree for two hands would thus look like this: MD1- MD XTEST device - physical mouse - right hand touch device - thumb subdevice - index subdevice MD2- MD XTEST device - physical trackball - left hand touch device - thumb subdevice - index subdevice - middle finger subdevice Where the subdevices are present on demand and may disappear. They may not even be actual devices but just represented as flags in the events. The X server doesn't necessarily need to do anything with the subdevices. What the X server does need however is the division between the input points so it can route the events accordingly. This makes it possible to pinch in one app while doing something else in another app (note that I am always thinking of the multiple apps use-case, never the single app case). well this assumes u can tell the difference between 2 hands... :) you can't, yet. there's no reason to believe it can't be done in the future though. When I look at the Qt API, it is device-bound so naturally the division between the devices falls back onto X (as it should, anyway). The tricky bit about it is - at least with current hardware - how to decide how many slave devices and which touchpoints go into which slave device. Ideally, the hardware could just tell us but... well 2nd, 3rd, 4th etc. fingers for 1 hand would go in as slaves no? touchscreens don't have a state. the physical device has, but the actual touchpoints do not. so while you could create on slave device for each possible touch statically or on demand, this can equally well be served by a simple flag in a new type of event. The costs are less and it maps the actual hardware better too. Note that the MD/SD hierarchy is _not_ designed for