Re: [PATCH 1/3] Have FreePixmap call screen hooks, not the other way around.

2011-10-03 Thread Michel Dänzer
On Sam, 2011-10-01 at 23:08 -0700, Jamey Sharp wrote: 
> In the process, move reference counting into FreePixmap instead of
> doing it inconsistently in the various screen hooks.

I like the series, the only minor nit being that the name 'FreePixmap'
still implies that the pixmap is freed immediately. How about something
like 'UnreferencePixmap' or an abbreviation thereof?


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast |  Debian, X and DRI developer
___
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 libXi] 1UL may be 4 bytes, force to 1ULL

2011-10-03 Thread Daniel Stone
Hi,

On 3 October 2011 06:06, Jeremy Huddleston  wrote:
> On Oct 2, 2011, at 16:30, Peter Hutterer wrote:
>> On Sun, Oct 02, 2011 at 10:52:03AM -0700, Jamey Sharp wrote:
>>> And I think ldexp is a much better idea than either. :-) It's more
>>> clear, and as an added bonus, probably faster. (You can multiply a
>>> double by a power of two just by adding the exponents. Division by an
>>> arbitrary constant is stupidly slow by comparison.)

True!

>>> To me, the interesting part of Jeremy's question was whether helper
>>> functions are worthwhile for these conversions,
>>
>> yes.

Indeed, I'd missed that, sorry.

>>> and if so, where they should live.
>>
>> preferably not in in the protocol. it exposes us to more bugs in the
>> protocol headers (which in theory should be static). And since they're
>> built-in updating them in case a bug is found is harder, you'll need to
>> rebuild anything that uses the headers, simply updating the component isn't
>> enough (that's from a distro POV).
>>
>> tbh, that's one case where I'd accept duplicate implementations in the
>> server and libX*.
>
> Yeah, with my port maintainer hat on, a bug in a proto header like that would 
> be *incredibly* annoying to push out.  I like the idea of them living as 
> static functions in libXi and the server.

Sounds good to me.

Cheers,
Daniel
___
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: [PULL] XI 2.1 - raw events and smooth scrolling

2011-10-03 Thread Max Schwarz
Hi Peter,

>   Input: Add smooth-scrolling support to GetPointerEvents
There's a subtle bug on that one: Old-style scroll button presses create 
inverted emulated presses (and maybe inverted valuator events, but I don't 
know which direction is 'up' or 'down' on the valuator).

Take a look at dix/getevents.c, GetPointerEvents():

> switch(buttons) {
> case 4:
>adj = 1.0;
> [snip]
> }
> [snip]
> adj *= pDev->valuator->axes[axis].scroll.increment;
> val = valuator_mask_get_double(&mask, axis) + adj;
> valuator_mask_set_double(&mask, axis, val);

So if increment > 0 and button 4 is pressed, the valuator gets incremented.

Later in emulate_scroll_button_events():

> delta = valuator_mask_get_double(mask, axis)
>  - valuator_mask_get_double(last, axis)
=> delta > 0
> b = (ax->scroll.type == SCROLL_TYPE_VERTICAL) ? 5 : 7
> if((incr > 0 && delta < 0) ||
>(incr < 0 && delta > 0))
>b--; /* we're scrolling up or left → button 4 or 6 */
Since incr > 0 and delta > 0, we get button 5.

So either that condition needs to be changed, or the conversion in 
GetPointerEvents() needs to be flipped.

Max
___
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 xserver 0/3] Prevent access to freed input buffer.

2011-10-03 Thread Rami Ylimäki
Some requests peek the client input buffer even after the request
handler has returned. For example, RecordEnableContext calls
IgnoreClient for the connection that originates the request, but also
installs callbacks that keep sending data to the connection until
RecordDisableContext is called from another connection. The callbacks
also assume that they can fetch the latest request op-codes from the
client input buffer (in RecordAReply), which is usually true for
recorded clients, but fails for recording clients.

Rami Ylimäki (3):
  os: Collect copy-pasted code into functions.
  os: Allow requests to preseve client input buffers for a longer time.
  record: Preserve client input buffer for RecordEnableContext request.

 include/os.h|2 +
 os/connection.c |7 +++
 os/io.c |  141 ---
 os/osdep.h  |4 ++
 record/record.c |7 +++
 5 files changed, 102 insertions(+), 59 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 xserver 1/3] os: Collect copy-pasted code into functions.

2011-10-03 Thread Rami Ylimäki
No functional changes.

Signed-off-by: Rami Ylimäki 
Reviewed-by: Erkki Seppälä 
---
 os/io.c |  126 +-
 1 files changed, 67 insertions(+), 59 deletions(-)

diff --git a/os/io.c b/os/io.c
index 955bf8b..6bfddfc 100644
--- a/os/io.c
+++ b/os/io.c
@@ -190,11 +190,69 @@ YieldControlDeath(void)
 timesThisConnection = 0;
 }
 
+/**
+ * Check whether the previous request indicated that an input buffer
+ * can be reused. If the input buffer belongs to the same client, it
+ * can be trivially reused. If the input buffer belongs to some other
+ * client, it is stolen and marked as free so that clients without
+ * input buffers can reuse it. However, if the input buffer has grown
+ * too large in the latter case, it's just released.
+ *
+ * @param[in] oc connection that requires an input buffer
+ */
+static void FreeAvailableInput(OsCommPtr oc)
+{
+if (AvailableInput)
+{
+   if (AvailableInput != oc)
+   {
+   register ConnectionInputPtr aci = AvailableInput->input;
+   if (aci->size > BUFWATERMARK)
+   {
+   free(aci->buffer);
+   free(aci);
+   }
+   else
+   {
+   aci->next = FreeInputs;
+   FreeInputs = aci;
+   }
+   AvailableInput->input = NULL;
+   }
+   AvailableInput = NULL;
+}
+}
+
+/**
+ * Find an input buffer for a request. If a client already has an
+ * input buffer, nothing needs to be done. Otherwise the buffer is
+ * taken from the list of reusable input buffers. If no input buffers
+ * can be reused, a new one is allocated.
+ *
+ * @param[in,out] oc connection that requires an input buffer
+ *
+ * @return the input buffer that was given for the connection
+ */
+static ConnectionInputPtr ReuseFreeInput(OsCommPtr oc)
+{
+ConnectionInputPtr oci = oc->input;
+if (!oci)
+{
+   if ((oci = FreeInputs))
+   FreeInputs = oci->next;
+   else
+   oci = AllocateInputBuffer();
+}
+if (oci)
+   oc->input = oci;
+return oci;
+}
+
 int
 ReadRequestFromClient(ClientPtr client)
 {
 OsCommPtr oc = (OsCommPtr)client->osPrivate;
-ConnectionInputPtr oci = oc->input;
+ConnectionInputPtr oci;
 int fd = oc->fd;
 unsigned int gotnow, needed;
 int result;
@@ -208,40 +266,14 @@ ReadRequestFromClient(ClientPtr client)
  * times).  This was done to save memory.
  */
 
-if (AvailableInput)
-{
-   if (AvailableInput != oc)
-   {
-   register ConnectionInputPtr aci = AvailableInput->input;
-   if (aci->size > BUFWATERMARK)
-   {
-   free(aci->buffer);
-   free(aci);
-   }
-   else
-   {
-   aci->next = FreeInputs;
-   FreeInputs = aci;
-   }
-   AvailableInput->input = (ConnectionInputPtr)NULL;
-   }
-   AvailableInput = (OsCommPtr)NULL;
-}
+FreeAvailableInput(oc);
 
 /* make sure we have an input buffer */
 
-if (!oci)
+if (!(oci = ReuseFreeInput(oc)))
 {
-   if ((oci = FreeInputs))
-   {
-   FreeInputs = oci->next;
-   }
-   else if (!(oci = AllocateInputBuffer()))
-   {
-   YieldControlDeath();
-   return -1;
-   }
-   oc->input = oci;
+YieldControlDeath();
+return -1;
 }
 
 /* advance to start of next request */
@@ -501,37 +533,13 @@ Bool
 InsertFakeRequest(ClientPtr client, char *data, int count)
 {
 OsCommPtr oc = (OsCommPtr)client->osPrivate;
-ConnectionInputPtr oci = oc->input;
+ConnectionInputPtr oci;
 int fd = oc->fd;
 int gotnow, moveup;
 
-if (AvailableInput)
-{
-   if (AvailableInput != oc)
-   {
-   ConnectionInputPtr aci = AvailableInput->input;
-   if (aci->size > BUFWATERMARK)
-   {
-   free(aci->buffer);
-   free(aci);
-   }
-   else
-   {
-   aci->next = FreeInputs;
-   FreeInputs = aci;
-   }
-   AvailableInput->input = (ConnectionInputPtr)NULL;
-   }
-   AvailableInput = (OsCommPtr)NULL;
-}
-if (!oci)
-{
-   if ((oci = FreeInputs))
-   FreeInputs = oci->next;
-   else if (!(oci = AllocateInputBuffer()))
-   return FALSE;
-   oc->input = oci;
-}
+FreeAvailableInput(oc);
+if (!(oci = ReuseFreeInput(oc)))
+return FALSE;
 oci->bufptr += oci->lenLastReq;
 oci->lenLastReq = 0;
 gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
-- 
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

[PATCH xserver 2/3] os: Allow requests to preseve client input buffers for a longer time.

2011-10-03 Thread Rami Ylimäki
Signed-off-by: Rami Ylimäki 
Reviewed-by: Erkki Seppälä 
---
 include/os.h|2 ++
 os/connection.c |7 +++
 os/io.c |   15 +++
 os/osdep.h  |4 
 4 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/include/os.h b/include/os.h
index fda0181..2bb27ca 100644
--- a/include/os.h
+++ b/include/os.h
@@ -158,6 +158,8 @@ extern _X_EXPORT void IgnoreClient(ClientPtr /*client*/);
 
 extern _X_EXPORT void AttendClient(ClientPtr /*client*/);
 
+extern _X_EXPORT void ReserveClientInput(ClientPtr /*client*/);
+
 extern _X_EXPORT void MakeClientGrabImpervious(ClientPtr /*client*/);
 
 extern _X_EXPORT void MakeClientGrabPervious(ClientPtr /*client*/);
diff --git a/os/connection.c b/os/connection.c
index b339f4e..94d627a 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1206,6 +1206,13 @@ AttendClient (ClientPtr client)
 }
 }
 
+void
+ReserveClientInput(ClientPtr client)
+{
+OsCommPtr oc = (OsCommPtr)client->osPrivate;
+ReserveOsInput(oc);
+}
+
 /* make client impervious to grabs; assume only executing client calls this */
 
 void
diff --git a/os/io.c b/os/io.c
index 6bfddfc..ddc605a 100644
--- a/os/io.c
+++ b/os/io.c
@@ -1093,6 +1093,21 @@ AllocateOutputBuffer(void)
 return oco;
 }
 
+/**
+ * Indicate that an input buffer can't be shared. This is needed by
+ * requests that must to access the input buffer even after the
+ * request handler has returned.
+ *
+ * @param[in] oc connection information
+ */
+void ReserveOsInput(OsCommPtr oc)
+{
+/* Check whether the input buffer has been already marked to be
+ * shared.  If so, revert the earlier decision. */
+if (AvailableInput == oc)
+AvailableInput = NULL;
+}
+
 void
 FreeOsBuffers(OsCommPtr oc)
 {
diff --git a/os/osdep.h b/os/osdep.h
index 087e36d..81c44a8 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -182,6 +182,10 @@ extern int FlushClient(
 int /*extraCount*/
 );
 
+extern void ReserveOsInput(
+OsCommPtr /*oc*/
+);
+
 extern void FreeOsBuffers(
 OsCommPtr /*oc*/
 );
-- 
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

[PATCH xserver 3/3] record: Preserve client input buffer for RecordEnableContext request.

2011-10-03 Thread Rami Ylimäki
This request installs hooks that keep sending replies even after the
request handler has finished. Each reply accesses the input buffer. If
we let the buffer to be shared, we will eventually read garbage or
even from freed memory.

Signed-off-by: Rami Ylimäki 
Reviewed-by: Erkki Seppälä 
---
 record/record.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/record/record.c b/record/record.c
index 5cae2b9..f0bfed7 100644
--- a/record/record.c
+++ b/record/record.c
@@ -44,6 +44,7 @@ and Jim Haggerty of Metheus.
 #include "inputstr.h"
 #include "eventconvert.h"
 #include "scrnintstr.h"
+#include "os.h"
 
 
 #include 
@@ -2423,6 +2424,12 @@ ProcRecordEnableContext(ClientPtr client)
 /* send StartOfData */
 RecordAProtocolElement(pContext, NULL, XRecordStartOfData, NULL, 0, 0, 0);
 RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0);
+
+/* We need to still access the client input buffer as we keep
+ * sending replies to this request even after the request has
+ * been technically completed. */
+ReserveClientInput(client);
+
 return Success;
 } /* ProcRecordEnableContext */
 
-- 
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] Remove incorrect & in swap_uint32

2011-10-03 Thread Michel Dänzer
On Don, 2011-09-29 at 13:10 +1000, Peter Hutterer wrote: 
> On Wed, Sep 28, 2011 at 05:27:45PM -0400, Matt Turner wrote:
> > Caused by commit 893e86a4, and hidden by the (char *) cast.
> > 
> > Signed-off-by: Matt Turner 
> > ---
> >  include/misc.h |2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/include/misc.h b/include/misc.h
> > index 1fea73e..180b3c1 100644
> > --- a/include/misc.h
> > +++ b/include/misc.h
> > @@ -277,7 +277,7 @@ static inline void __builtin_constant_p(int x)
> >  /* byte swap a 32-bit value */
> >  static inline void swap_uint32(uint32_t *x)
> >  {
> > -   char n = ((char *) &x)[0];
> > +   char n = ((char *) x)[0];
> > ((char *) x)[0] = ((char *) x)[3];
> > ((char *) x)[3] = n;
> > n = ((char *) x)[1];
> > -- 
> > 1.7.3.4
> > 
> 
> I recommend writing a few tests in test/misc.c for this. It won't take long,
> they're quite simple to write and may just spot another bug.

FWIW, this broke the existing xi2 tests, at least on powerpc.

I had to find that out using git bisect... what is this fix waiting for?


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast |  Debian, X and DRI developer
___
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

FOSDEM 2012 DevRoom requested.

2011-10-03 Thread Luc Verhaegen
With Matthieu proposing to talk about DRM/KMS for non-linux system, the 
deadline was met, and i have just filed a DevRoom request with the 
FOSDEM organizers. I should have an answer this month still.

One thing does seem to have changed though, DevRooms are for one day 
only unless properly motivated. With the current line-up it looks like 
we will then only get sunday (~ 7 talks).

Keith, at XDC you mentioned filling half a day with wayland stuff. Do 
solidify this ASAP so i can make sure that we get saturday as well.

Luc Verhaegen.
___
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: FOSDEM 2012 DevRoom requested.

2011-10-03 Thread Keith Packard
On Mon, 3 Oct 2011 16:26:20 +0200, Luc Verhaegen  wrote:

> Keith, at XDC you mentioned filling half a day with wayland stuff. Do 
> solidify this ASAP so i can make sure that we get saturday as well.

I'm working on this -- as you might imagine, getting funding for an
event this far in advance is not trivial.

Thanks for getting a devroom organized; I would have signed up myself if
I knew I could secure travel funding...

-- 
keith.pack...@intel.com


pgpnytei63frG.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: [PATCH xserver 3/3] record: Preserve client input buffer for RecordEnableContext request.

2011-10-03 Thread Keith Packard
On Mon,  3 Oct 2011 15:16:27 +0300, Rami Ylimäki  wrote:

> This request installs hooks that keep sending replies even after the
> request handler has finished. Each reply accesses the input buffer. If
> we let the buffer to be shared, we will eventually read garbage or
> even from freed memory.

Would it be possible to simply store any necessary data locally, instead
of hacking up the OS layer to store it for us?

-- 
keith.pack...@intel.com


pgp5fujbau5am.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: Maintaining backwards compatibility with swap macros

2011-10-03 Thread Matt Turner
On Mon, Oct 3, 2011 at 1:16 AM, Jeremy Huddleston
 wrote:
> Ok, given your agreement here, I'll go ahead with this if you don't beat me 
> to it.
>
> --Jeremy

Yes, if you have some time, please proceed.

Matt
___
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 libXft] Remove an extraneous FcPatternDestroy in XftFontOpenInfo

2011-10-03 Thread Alan Coopersmith

On 10/ 2/11 02:55 PM, Jeremy Huddleston wrote:


https://bugs.freedesktop.org/show_bug.cgi?id=5745

Signed-off-by: Jeremy Huddleston
---
  src/xftfreetype.c |1 -
  1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/xftfreetype.c b/src/xftfreetype.c
index 3f8dfef..1c5967a 100644
--- a/src/xftfreetype.c
+++ b/src/xftfreetype.c
@@ -798,7 +798,6 @@ XftFontOpenInfo (Display*dpy,
{
if (!font->ref++)
--info->num_unref_fonts;
-   FcPatternDestroy (pattern);
return&font->public;
}



I'm not sure, since if it passes that point, it saves the pattern in
the newly created font's font->public.pattern and then does the
FcPatternDestroy of it in XftFontDestroy.

Perhaps we just need to document that the pattern passed to XftFontOpenInfo
becomes the exclusive property of Xft and the caller is not allowed to use
it any more?

(Though it seems XftFontOpenInfo is missing from the function list in the
 Xft man page, so needs more love than that.)

--
-Alan Coopersmith-alan.coopersm...@oracle.com
 Oracle Solaris Platform Engineering: X Window System

___
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] Remove incorrect & in swap_uint32

2011-10-03 Thread Jeremy Huddleston

On Oct 3, 2011, at 05:58, Michel Dänzer wrote:

> On Don, 2011-09-29 at 13:10 +1000, Peter Hutterer wrote: 
>> On Wed, Sep 28, 2011 at 05:27:45PM -0400, Matt Turner wrote:
>>> Caused by commit 893e86a4, and hidden by the (char *) cast.
>>> 
>>> Signed-off-by: Matt Turner 
>>> ---
>>> include/misc.h |2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>> 
>>> diff --git a/include/misc.h b/include/misc.h
>>> index 1fea73e..180b3c1 100644
>>> --- a/include/misc.h
>>> +++ b/include/misc.h
>>> @@ -277,7 +277,7 @@ static inline void __builtin_constant_p(int x)
>>> /* byte swap a 32-bit value */
>>> static inline void swap_uint32(uint32_t *x)
>>> {
>>> -   char n = ((char *) &x)[0];
>>> +   char n = ((char *) x)[0];
>>> ((char *) x)[0] = ((char *) x)[3];
>>> ((char *) x)[3] = n;
>>> n = ((char *) x)[1];
>>> -- 
>>> 1.7.3.4
>>> 
>> 
>> I recommend writing a few tests in test/misc.c for this. It won't take long,
>> they're quite simple to write and may just spot another bug.
> 
> FWIW, this broke the existing xi2 tests, at least on powerpc.
> 
> I had to find that out using git bisect... what is this fix waiting for?

Matt's busy with midterms and whatnot, so I added it to my [PULL]...  Now we're 
just waiting on Keith to go through his queue backlog...

___
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 libXft] Remove an extraneous FcPatternDestroy in XftFontOpenInfo

2011-10-03 Thread Jeremy Huddleston
If that's the case, then this is a terrible API.  If the function returns NULL, 
the caller has no information about the state of its passed pattern.  It may 
have been deallocated and NULL returned during 'goto bail' or it may not have 
been deallocated and NULL returned because of invalid paramaters (currently 
just info == NULL).

Since the function isn't documented, I wonder if the "fix" would be to copy 
pattern and write documentation to this effect.  The problem would then be a 
leak for those expecting it to be freed, but that is certainly preferred, IMO.  
Also, the leak is easily fixed by requiring the new libXft and doing their own 
FcPatternDestroy.

This confusion has caused problems in external projects who expect it to not be 
freed.  The only non-xorg hit for XftFontOpenInfo in codesearch is actually a 
long comment debugging this issue and removing their FcPatternDestroy:

http://google.com/codesearch#Lbvu5g5_Qs8/mrxvt-0.5.2/src/main.c&q=XftFontOpenInfo%20lang:%5Ec$&type=cs


On Oct 3, 2011, at 09:53, Alan Coopersmith wrote:

> On 10/ 2/11 02:55 PM, Jeremy Huddleston wrote:
>> 
>> https://bugs.freedesktop.org/show_bug.cgi?id=5745
>> 
>> Signed-off-by: Jeremy Huddleston
>> ---
>>  src/xftfreetype.c |1 -
>>  1 files changed, 0 insertions(+), 1 deletions(-)
>> 
>> diff --git a/src/xftfreetype.c b/src/xftfreetype.c
>> index 3f8dfef..1c5967a 100644
>> --- a/src/xftfreetype.c
>> +++ b/src/xftfreetype.c
>> @@ -798,7 +798,6 @@ XftFontOpenInfo (Display *dpy,
>>  {
>>  if (!font->ref++)
>>  --info->num_unref_fonts;
>> -FcPatternDestroy (pattern);
>>  return&font->public;
>>  }
>> 
> 
> I'm not sure, since if it passes that point, it saves the pattern in
> the newly created font's font->public.pattern and then does the
> FcPatternDestroy of it in XftFontDestroy.
> 
> Perhaps we just need to document that the pattern passed to XftFontOpenInfo
> becomes the exclusive property of Xft and the caller is not allowed to use
> it any more?
> 
> (Though it seems XftFontOpenInfo is missing from the function list in the
> Xft man page, so needs more love than that.)
> 
> -- 
>   -Alan Coopersmith-alan.coopersm...@oracle.com
>Oracle Solaris Platform Engineering: X Window System
> 
> ___
> 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 1/2] xfree86/modes: Let the driver handle the transform

2011-10-03 Thread Keith Packard
On Wed, 21 Sep 2011 13:51:25 -0700, Aaron Plattner  wrote:

> I blame charset=iso-8859-1 due to my lame MTA.  Try the attached 
> patches.  Sorry.

(Something mangled even the attachments -- they were 8859-1 when I
received them. I used iconv to switch them to utf-8 and applied them.)

Merged.
   afb1fe6..57cd32e  master -> master

-- 
keith.pack...@intel.com


pgpzWcjy0LTKc.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: [PATCH v2 7/7] dix: NewCurrentScreen must work on pointers where possible

2011-10-03 Thread Keith Packard
On Thu, 22 Sep 2011 08:43:31 +1000, Peter Hutterer  
wrote:

> You mean like this?
> http://lists.x.org/archives/xorg-devel/2011-September/024807.html
> that was the first implementation, and I changed it for this one..

Right. Never mind. The new patch seems fine.

-- 
keith.pack...@intel.com


pgpz1a8sd6A0p.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: [PULL] XI 2.1 - raw events and smooth scrolling

2011-10-03 Thread Keith Packard
On Fri, 30 Sep 2011 09:51:38 +1000, Peter Hutterer  
wrote:

> Cyril Brulebois (3):
>   xkb: Fix case checks for Latin 1.
>   xkb: Fix case checks for Latin 2.
>   xkb: Fix case checks for Latin 4.
> 
> Daniel Stone (25):
>   Input: Add flags to DeviceEvent
>   Input: Add flags to RawDeviceEvent
>   Input: Convert ValuatorMask to double-precision internally
>   Input: Add double-precision valuator_mask API
>   Input: Store clipped absolute axes in the mask
>   Input: Prepare moveAbsolute for conversion to double
>   Input: Prepare moveRelative for conversion to double
>   Input: Convert clipAxis, moveAbsolute and moveRelative to double
>   Input: Convert transformAbsolute to work on doubles
>   Input: Set fractional member in set_raw_valuators
>   Input: Use trunc instead of lrintf in acceleration code
>   Input: Widen pointer acceleration types to double
>   Input: Convert acceleration code to using ValuatorMask
>   Input: Remove x and y from moveAbsolute/moveRelative
>   Input: Convert rescaleValuatorAxis to double
>   Input: Don't call positionSprite for non-pointer devices
>   Input: Convert positionSprite and GetPointerEvents to double
>   Input: Modify mask in-place in positionSprite
>   Input: Make RawDeviceEvent use doubles internally
>   Input: Make DeviceEvent use doubles internally
>   Input: Convert DeviceIntRec::last to use doubles
>   Input: Set last valuators in GetPointerEvents only
>   Input: Split GetPointerEvents body into a helper function
>   Input: Add vertical and horizontal scroll axes
>   Input: Add POINTER_EMULATED flag to GetPointerEvents
> 
> Max Schwarz (1):
>   Input: Fix frac calculation on [Raw]DeviceEvent conversion
> 
> Peter Hutterer (13):
>   input: switch InitValuatorAxisStruct to return Bool
>   input: allow for max < min for relative axes on  InitValuatorAxisStruct
>   dix: split client list retrieval out of DeliverEventToClients
>   dix: rename DeliverEventsToClients to DeliverEventsToWindowMask
>   dix: split DeliverEventToWindowMask up a bit more.
>   Xi: use temporary variable for filter.
>   dix: rename ProcessRawEvents to dix/events.c:DeliverRawEvent
>   Support (and require) XI 2.1
>   input: deliver raw events unconditionally for XI 2.1 clients.
>   dix: use 'rc' for return code in DeliverRawEvent
>   Merge branch 'raw-events' into next
>   Input: Add smooth-scrolling support to GetPointerEvents
>   Merge branch 'smooth-scrolling' into next

Ok, that's a big merge. It appears to build at least...
   57cd32e..f5d50b4  master -> master

-- 
keith.pack...@intel.com


pgpwr810b0Ea6.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: [PATCH] xf86/modes: Fix shadow rotation crashing when screen pixmap changes

2011-10-03 Thread Keith Packard

Merged.
   f5d50b4..463dd87  master -> master

-- 
keith.pack...@intel.com


pgptNm6mVKFcJ.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: [PATCH v2] Address regressions from e8ff555b95baab66cc7d060c1e7f9fdd49d3802f

2011-10-03 Thread Keith Packard
On Thu, 22 Sep 2011 21:55:34 -0700, Jeremy Huddleston  
wrote:

> Yeah, I'm certainly in favor of "something better" but for now, I
> settle for "something working" =/

Do we have 'something working' at this point? I don't see an obvious
resolution in this thread.

-- 
keith.pack...@intel.com


pgpaBzKBu82Hz.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: [PULL] Build fix and an XQuartz race fix

2011-10-03 Thread Keith Packard
On Sat, 24 Sep 2011 13:23:57 -0700, Jeremy Huddleston  
wrote:

> Jeremy Huddleston (2):
>   Address regressions from e8ff555b95ba and d206d52f657c to work with 
> other compilers
>   XQuartz: Use set_front_process rather than
>   X11ApplicationSetFrontProcess since we're already in the AppKit thread

Merged. Sorry for the noise on the old thread.
   463dd87..cf11ca3  master -> master

-- 
keith.pack...@intel.com


pgpJreftcnWo3.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: [PATCH v2] Address regressions from e8ff555b95baab66cc7d060c1e7f9fdd49d3802f

2011-10-03 Thread Jeremy Huddleston
It's in my [PULL] request.

http://cgit.freedesktop.org/~jeremyhu/xserver/commit/?h=for-keith&id=206b30ebc608d29a91cc18665d89e887cac4dba3

On Oct 3, 2011, at 11:43, Keith Packard wrote:

> On Thu, 22 Sep 2011 21:55:34 -0700, Jeremy Huddleston  
> wrote:
> 
>> Yeah, I'm certainly in favor of "something better" but for now, I
>> settle for "something working" =/
> 
> Do we have 'something working' at this point? I don't see an obvious
> resolution in this thread.
> 
> -- 
> keith.pack...@intel.com

___
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: [PULL: xserver master] cleanups from Alan & Gaetan

2011-10-03 Thread Keith Packard
On Fri, 23 Sep 2011 17:18:45 -0700, Alan Coopersmith 
 wrote:

> Alan Coopersmith (2):
>Assign ids to more tags in Xserver-Dtrace.xml
>Unconditionally #include 
> 
> Gaetan Nadon (3):
>dtrace: use docbook copyright markup for copyright holder
>dtrace: fix typo in title
>dix and os: gitignore dix.O and os.O

Merged.
   cf11ca3..9a55b36  master -> master

-- 
keith.pack...@intel.com


pgpORm1E15OFQ.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: [PATCH] kdrive: Fix build for opaque InputOption structure.

2011-10-03 Thread Keith Packard
On Mon, 26 Sep 2011 22:38:44 -0700, Jamey Sharp  wrote:
> Commit 05284a03f9002b03a66ae355b34790ec02b726f0 missed fixing up
> kdrive's use of the old non-opaque structure.

Merged.
   9a55b36..77743f8  master -> master

-- 
keith.pack...@intel.com


pgp2uRXPwHjCv.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: [PATCH xserver] autoconf: autoreconf of xserver produces warnings #38185

2011-10-03 Thread Keith Packard
On Tue, 27 Sep 2011 09:39:46 -0400, Gaetan Nadon  wrote:

> From: Christopher Yeleighton 

I had a local patch for exactly this issue which I've pushed.

-- 
keith.pack...@intel.com


pgpieaaK3RKW1.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: [PATCH] udev: make use of udev_enumerate_add_match_tag() only when it is available

2011-10-03 Thread Keith Packard
On Tue, 27 Sep 2011 18:04:06 +0100, Dave Airlie  wrote:
> From: Lennart Poettering 
> 
> udev_enumerate_add_match_tag() and udev_monitor_filter_add_match_tag()
> are mostly optimizations, hence simply skip these calls if they are not
> available in the installed version of libudev.

Merged.
   77743f8..fad04dd  master -> master

-- 
keith.pack...@intel.com


pgpRZzZ8qvCuq.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: [PULL] build fix, GC clipping cleanup

2011-10-03 Thread Keith Packard
On Wed, 28 Sep 2011 13:57:27 -0700, Jamey Sharp  wrote:
Non-text part: multipart/signed
> Hi Keith! Here's some reviewed code deletion (hooray!) and the fix to
> make kdrive build again after the last pull.

There was a comment requesting that FreePixmap be renamed
'UnreferencePixmap' or some such?

-- 
keith.pack...@intel.com


pgpPnCBg5TD9t.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: [PATCH v2 xserver 2/2] Xinput: use appropriate copyright markup for a multi licensed doc

2011-10-03 Thread Keith Packard
On Thu, 29 Sep 2011 07:53:16 -0400, Gaetan Nadon  wrote:
> Removed a duplicate paragraph.

Both of these are merged.
   fad04dd..2f09f6e  master -> master

-- 
keith.pack...@intel.com


pgp2omqgSp1UV.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: [PATCH xserver 3/3] ddxDesign: drop the url in the coporate authors list

2011-10-03 Thread Keith Packard
On Fri, 30 Sep 2011 07:16:34 -0400, Gaetan Nadon  wrote:
> It was such an eyesore once rendered in html.
> Now it looks like other authors.

These three patches have been merged.
   2f09f6e..ee3e260  master -> master

-- 
keith.pack...@intel.com


pgp15hl1ELkq9.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: [PATCH xserver 3/3] Xserver-spec: use appropriate copyright markup

2011-10-03 Thread Keith Packard
On Fri, 30 Sep 2011 07:21:57 -0400, Gaetan Nadon  wrote:

> Use docbook copyright markup for year and holder.

These three have been merged.
   ee3e260..466e4b3  master -> master

-- 
keith.pack...@intel.com


pgpIgRVpdLRds.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: [PATCH libXi] 1UL may be 4 bytes, force to 1ULL

2011-10-03 Thread Peter Hutterer
On Sun, Oct 02, 2011 at 10:06:55PM -0700, Jeremy Huddleston wrote:
> 
> On Oct 2, 2011, at 16:30, Peter Hutterer wrote:
> 
> > On Sun, Oct 02, 2011 at 10:52:03AM -0700, Jamey Sharp wrote:
> >> On 10/2/11, Daniel Stone  wrote:
> >>> On 2 October 2011 09:19, Jeremy Huddleston  wrote:
>  Peter, any thoughts on this?
> >>> 
> >>> I think using * (1 << 16) * (1 << 16) is a better idea than (1ULL << 32).
> >> 
> >> And I think ldexp is a much better idea than either. :-) It's more
> >> clear, and as an added bonus, probably faster. (You can multiply a
> >> double by a power of two just by adding the exponents. Division by an
> >> arbitrary constant is stupidly slow by comparison.)
> >> 
> >> To me, the interesting part of Jeremy's question was whether helper
> >> functions are worthwhile for these conversions, 
> > 
> > yes.
> > 
> >> and if so, where they should live.
> > 
> > preferably not in in the protocol. it exposes us to more bugs in the
> > protocol headers (which in theory should be static). And since they're
> > built-in updating them in case a bug is found is harder, you'll need to
> > rebuild anything that uses the headers, simply updating the component isn't
> > enough (that's from a distro POV).
> > 
> > tbh, that's one case where I'd accept duplicate implementations in the
> > server and libX*.
> 
> Yeah, with my port maintainer hat on, a bug in a proto header like that
> would be *incredibly* annoying to push out.  I like the idea of them
> living as static functions in libXi and the server.

I'd vote for putting them into the server with a few tests to make sure they
work mostly as requested. Once that's in, we can add them to the library,
hoping that there aren't any big bugs left.

Cheers,
  Peter
___
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: [PULL] some cleanups

2011-10-03 Thread Keith Packard
On Sun, 2 Oct 2011 18:34:57 +0600, Alexandr Shadchin 
 wrote:

>   g...@github.com:Koba/xserver.git reviewed

Please provide a git:// URL so we don't have to manually rewrite it.

> 
> Alexandr Shadchin (8):
>   bsd: Remove unused macros KBD_FD
>   bsd: Replacement screenFd on consoleFd because they are equivalent
>   bsd: Variable devConsoleFd need only if defined PCCONS_SUPPORT
>   bsd: Remove dead code
>   bsd: Some clean up
>   bsd: OpenBSD and NetBSD not need extra headers in PCVT_SUPPORT
>   bsd: ioctl KDENABIO/KDDISABIO do not matter for OpenBSD
>   Remove unused vtSysreq

Merged.
   466e4b3..6e965d8  master -> master

-- 
keith.pack...@intel.com


pgpUREyyr1eQn.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: [PULL] sdksyms.sh may not be executable.

2011-10-03 Thread Keith Packard
On Sat, 1 Oct 2011 17:43:22 +0200, Matthieu Herrb  
wrote:

>   Add a 'wscons' autoconf mechanism to configure input devices on
>   BSD. (2011-09-30 10:10:32 +0200)

>   sdksyms.sh may not be executable. (2011-10-01 17:35:19 +0200)

These two patches have been merged.
   6e965d8..6378d02  master -> master

-- 
keith.pack...@intel.com


pgp9wgQtEBwoz.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: [PULL] build fix, GC clipping cleanup

2011-10-03 Thread Jamey Sharp
On Mon, Oct 03, 2011 at 12:01:23PM -0700, Keith Packard wrote:
> On Wed, 28 Sep 2011 13:57:27 -0700, Jamey Sharp  wrote:
> > Hi Keith! Here's some reviewed code deletion (hooray!) and the fix to
> > make kdrive build again after the last pull.
> 
> There was a comment requesting that FreePixmap be renamed
> 'UnreferencePixmap' or some such?

Yeah, and I'm not opposed. (Although I'm hoping for a better name
choice...) It's probably a good idea to change the names anyway so any
unfixed callers are detected at compile time.

Would you pull the rest of my reviewed patches in the meantime though? I
have a lot of patches that depend on the clipping changes going in, and
the missing .gitignore entry keeps bugging me.

The following changes since commit 6378d0233d21088b6429755627b4253859892c72:

  Merge remote-tracking branch 'herrb/master' (2011-10-03 13:56:06 -0700)

are available in the git repository at:

  git://anongit.freedesktop.org/~jamey/xserver reviewed

Jamey Sharp (3):
  test: .gitignore the binary for xfree86.c.
  Quit wrapping ChangeClip, CopyClip, and DestroyClip in GCFuncs.
  Make GC clientClip always be a region.

 Xext/panoramiX.c   |   32 --
 dix/gc.c   |   64 ++---
 doc/Xserver-spec.xml   |   76 +--
 exa/exa.c  |   48 -
 exa/exa_accel.c|   18 ++--
 exa/exa_priv.h |6 +-
 exa/exa_unaccel.c  |6 +-
 fb/fbgc.c  |3 -
 hw/dmx/dmxgc.c |  115 +++---
 hw/dmx/dmxgc.h |3 -
 hw/kdrive/src/kxv.c|2 +-
 hw/xfree86/common/xf86VGAarbiter.c |   31 +--
 hw/xfree86/common/xf86VGAarbiterPriv.h |4 -
 hw/xfree86/common/xf86xv.c |2 +-
 hw/xfree86/shadowfb/shadow.c   |   35 ---
 hw/xfree86/xaa/xaaBitBlt.c |4 +-
 hw/xfree86/xaa/xaaGC.c |   31 --
 hw/xnest/GC.c  |  170 +---
 hw/xnest/XNGC.h|4 -
 hw/xwin/wingc.c|   42 
 include/gc.h   |2 +-
 include/gcstruct.h |   25 ++---
 mi/mibitblt.c  |4 +-
 mi/micopy.c|4 +-
 mi/miexpose.c  |2 +-
 mi/migc.c  |   74 +--
 mi/migc.h  |   16 ---
 mi/mioverlay.c |2 +-
 miext/cw/cw.c  |   52 +-
 miext/damage/damage.c  |   31 --
 miext/rootless/rootlessGC.c|   29 --
 render/mirect.c|2 +-
 test/.gitignore|1 +
 xfixes/region.c|   27 ++
 34 files changed, 164 insertions(+), 803 deletions(-)


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

[PATCH keyboard] man: link to xkeyboard-config(7) (#14494)

2011-10-03 Thread Peter Hutterer
X.Org Bug 14494 

Signed-off-by: Peter Hutterer 
---
 man/kbd.man |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/man/kbd.man b/man/kbd.man
index 3d6bf21..c8d70cc 100644
--- a/man/kbd.man
+++ b/man/kbd.man
@@ -88,6 +88,9 @@ enhance the keyboard layout details.  Default: not set.
 .BI "Option \*qXkbOptions\*q \*q" options \*q
 specifies the XKB keyboard option components.  These can be used to
 enhance the keyboard behaviour.  Default: not set.
+.PP
+For a list of available XKB options, see
+.B xkeyboard-config(__miscmansuffix__).
 .SH EXAMPLE
 The following xorg.conf fragment ensures that user will be able to switch 
between
 .I us
@@ -129,3 +132,5 @@ __xservername__(__appmansuffix__), 
__xconfigfile__(__filemansuffix__),
 Xserver(__appmansuffix__), X(__miscmansuffix__).
 
 hal(__miscmansuffix__), hald(__adminmansuffix__), fdi(__filemansuffix__).
+
+xkeyboard-config(__miscmansuffix__).
-- 
1.7.6.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


Re: [PATCH 1/3] Have FreePixmap call screen hooks, not the other way around.

2011-10-03 Thread Jamey Sharp
On Mon, Oct 03, 2011 at 12:03:33PM +0200, Michel Dänzer wrote:
> On Sam, 2011-10-01 at 23:08 -0700, Jamey Sharp wrote: 
> > In the process, move reference counting into FreePixmap instead of
> > doing it inconsistently in the various screen hooks.
> 
> I like the series, the only minor nit being that the name 'FreePixmap'
> still implies that the pixmap is freed immediately. How about something
> like 'UnreferencePixmap' or an abbreviation thereof?

Good point. Josh suggested ReleasePixmap, which I like. (I try to pick
short words instead of abbreviating long ones.) I've updated my
pixmap-hooks branch with that change, which didn't affect the other two
patches.

git://anongit.freedesktop.org/~jamey/xserver pixmap-hooks
http://cgit.freedesktop.org/~jamey/xserver/log/?h=pixmap-hooks

Would you like to provide a Reviewed-by now that I've made that change?

Jeremy, can I continue to use your Reviewed-by/Tested-by or would you
like to re-test now? I've tested with xf86-video-nested.

Jamey


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 keyboard] man: link to xkeyboard-config(7) (#14494)

2011-10-03 Thread Gaetan Nadon
On Tue, 2011-10-04 at 09:16 +1000, Peter Hutterer wrote:

> X.Org Bug 14494 
> 
> Signed-off-by: Peter Hutterer 
> ---
>  man/kbd.man |5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/man/kbd.man b/man/kbd.man
> index 3d6bf21..c8d70cc 100644
> --- a/man/kbd.man
> +++ b/man/kbd.man
> @@ -88,6 +88,9 @@ enhance the keyboard layout details.  Default: not set.
>  .BI "Option \*qXkbOptions\*q \*q" options \*q
>  specifies the XKB keyboard option components.  These can be used to
>  enhance the keyboard behaviour.  Default: not set.
> +.PP
> +For a list of available XKB options, see
> +.B xkeyboard-config(__miscmansuffix__).
>  .SH EXAMPLE
>  The following xorg.conf fragment ensures that user will be able to switch 
> between
>  .I us
> @@ -129,3 +132,5 @@ __xservername__(__appmansuffix__), 
> __xconfigfile__(__filemansuffix__),
>  Xserver(__appmansuffix__), X(__miscmansuffix__).
>  
>  hal(__miscmansuffix__), hald(__adminmansuffix__), fdi(__filemansuffix__).
> +
> +xkeyboard-config(__miscmansuffix__).

Reviewed-by: Gaetan Nadon 


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 1/3] Have FreePixmap call screen hooks, not the other way around.

2011-10-03 Thread Jeremy Huddleston

On Oct 3, 2011, at 4:16 PM, Jamey Sharp wrote:

> On Mon, Oct 03, 2011 at 12:03:33PM +0200, Michel Dänzer wrote:
>> On Sam, 2011-10-01 at 23:08 -0700, Jamey Sharp wrote: 
>>> In the process, move reference counting into FreePixmap instead of
>>> doing it inconsistently in the various screen hooks.
>> 
>> I like the series, the only minor nit being that the name 'FreePixmap'
>> still implies that the pixmap is freed immediately. How about something
>> like 'UnreferencePixmap' or an abbreviation thereof?
> 
> Good point. Josh suggested ReleasePixmap, which I like. (I try to pick
> short words instead of abbreviating long ones.) I've updated my
> pixmap-hooks branch with that change, which didn't affect the other two
> patches.
> 
> git://anongit.freedesktop.org/~jamey/xserver pixmap-hooks
> http://cgit.freedesktop.org/~jamey/xserver/log/?h=pixmap-hooks
> 
> Would you like to provide a Reviewed-by now that I've made that change?
> 
> Jeremy, can I continue to use your Reviewed-by/Tested-by or would you
> like to re-test now? I've tested with xf86-video-nested.

My tags remain.  I trust you to change around symbol names without changing 
functionality ;)

___
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] GLAMOR: Fix the coding style problem

2011-10-03 Thread Alan Coopersmith

On 10/ 1/11 10:12 AM, zhigang gong wrote:

Alan,

According to your previous comments, I fixed those indentation and
coding style problems
except the camelCase function naming rule. Will do that soon after
this patch get reviewed
and committed.

As the patch is too big to attach in this mail, I created a new branch
to track it. Please check
it at: git://people.freedesktop.org/~gongzg/xserver-glamor glamor-style-fixes.
commit cb1aa7d3...


Thanks - at a quick glance that at least seems more consistent with itself.
(The X server has so many coding styles already we don't enforce one true style,
but we do ask that each file have a consistent style, and not do things like
using different amounts of space per indent level in different parts of the 
file.)

--
-Alan Coopersmith-alan.coopersm...@oracle.com
 Oracle Solaris Platform Engineering: X Window System

___
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] prep work for screen crossing fixes

2011-10-03 Thread Peter Hutterer
A few prep work patches for the upcoming screen crossing fixes. Nothing
exciting but the screenInfo change is technically video ABI. Your choice if
you want to bump it again this cycle.

commit 6adc117f5f5c06568377ed4d8d1a9758b58dec71

The following changes since commit 6378d0233d21088b6429755627b4253859892c72:

  Merge remote-tracking branch 'herrb/master' (2011-10-03 13:56:06 -0700)

are available in the git repository at:

  git://people.freedesktop.org/~whot/xserver.git next

Peter Hutterer (5):
  dix: fill out root_x/y for keyboard events
  dix: warn about keyboard events with valuator masks
  dix: NewCurrentScreen must work on pointers where possible
  Move pointOnScreen to inpututils.c
  Store desktop dimensions in screenInfo.

 dix/dispatch.c |2 ++
 dix/events.c   |   25 +++--
 dix/getevents.c|   26 ++
 dix/inpututils.c   |   26 ++
 hw/xfree86/common/xf86Cursor.c |2 ++
 hw/xfree86/common/xf86RandR.c  |3 +++
 hw/xfree86/modes/xf86RandR12.c |2 ++
 include/input.h|3 +++
 include/scrnintstr.h   |2 ++
 9 files changed, 73 insertions(+), 18 deletions(-)


pgp4MmINhH1sC.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

[PATCH libXaw3d 1/5] Disable unused input and unput lex functions

2011-10-03 Thread Guillem Jover
Fixes gcc warnings:
laylex.c:1316:17: warning: 'yyunput' defined but not used [-Wunused-function]
laylex.c:1357:16: warning: 'input' defined but not used [-Wunused-function]

Signed-off-by: Guillem Jover 
---
 src/laylex.l |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/laylex.l b/src/laylex.l
index 2574782..c85e766 100644
--- a/src/laylex.l
+++ b/src/laylex.l
@@ -1,5 +1,7 @@
 %option prefix="LayYY"
 %option outfile="lex.yy.c"
+%option noinput
+%option nounput
 %{
 #ifndef FLEX_SCANNER
 #undef input
-- 
1.7.6.3

___
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 libXaw3d 2/5] Remove unused label

2011-10-03 Thread Guillem Jover
Fixes gcc warning:
laygram.c: In function 'LayYYparse':
laygram.y:242:7: warning: label 'unary' defined but not used [-Wunused-label]

Signed-off-by: Guillem Jover 
---
 src/laygram.y |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/laygram.y b/src/laygram.y
index cd8d18f..e6a75d7 100644
--- a/src/laygram.y
+++ b/src/laygram.y
@@ -239,7 +239,7 @@ expr:   expr PLUS expr
|   expr PERCENTOF expr
{ goto binary; }
|   MINUS expr  %prec UMINUS
-   { unary: ;
+   {
$$ = New(ExprRec);
$$->type = Unary;
$$->u.unary.op = $1;
-- 
1.7.6.3

___
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 libXaw3d 5/5] Define call_data to 0 in NotifyScroll()

2011-10-03 Thread Guillem Jover
Fixes gcc warning:
Scrollbar.c: In function 'NotifyScroll':
Scrollbar.c:950:12: warning: 'call_data' may be used uninitialized in this 
function [-Wuninitialized]

Signed-off-by: Guillem Jover 
---
 src/Scrollbar.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/Scrollbar.c b/src/Scrollbar.c
index 429a660..be74ed3 100644
--- a/src/Scrollbar.c
+++ b/src/Scrollbar.c
@@ -922,7 +922,7 @@ static void
 NotifyScroll (Widget w, XEvent *event, String *params, Cardinal *num_params)
 {
 ScrollbarWidget sbw = (ScrollbarWidget) w;
-intptr_t call_data;
+intptr_t call_data = 0;
 char style;
 Position x, y;
 
-- 
1.7.6.3

___
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 libXaw3d 0/5] Warning fixes

2011-10-03 Thread Guillem Jover
Hi!

Here's some changes I had laying around.

regards,
guillem


Guillem Jover (5):
  Disable unused input and unput lex functions
  Remove unused label
  Only use variable t in MoveThumb() on XAW_ARROW_SCROLLBARS
  Use intptr_t instead of int when casting from and to XtPointer
  Define call_data to 0 in NotifyScroll()

 configure.ac|1 +
 src/Scrollbar.c |   15 ++-
 src/Text.c  |5 +++--
 src/TextPop.c   |5 +++--
 src/Viewport.c  |4 +++-
 src/laygram.y   |2 +-
 src/laylex.l|2 ++
 7 files changed, 23 insertions(+), 11 deletions(-)

-- 
1.7.6.3

___
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 libXaw3d 4/5] Use intptr_t instead of int when casting from and to XtPointer

2011-10-03 Thread Guillem Jover
Fixes gcc warnings:
Scrollbar.c: In function 'NotifyScroll':
Scrollbar.c:955:37: warning: cast to pointer from integer of different size 
[-Wint-to-pointer-cast]
Text.c: In function 'HScroll':
Text.c:1274:41: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]
Text.c: In function 'VScroll':
Text.c:1431:31: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]
TextPop.c: In function 'DoSearch':
TextPop.c:808:31: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]
TextPop.c: In function 'Replace':
TextPop.c:942:31: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]
Viewport.c: In function 'ScrollUpDownProc':
Viewport.c:866:15: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]

Signed-off-by: Guillem Jover 
---
 configure.ac|1 +
 src/Scrollbar.c |8 +---
 src/Text.c  |5 +++--
 src/TextPop.c   |5 +++--
 src/Viewport.c  |4 +++-
 5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index c70959c..d74ccc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,7 @@ AC_PROG_LEX
 PKG_CHECK_MODULES(X11, [x11 xt xmu xext])
 AC_CHECK_HEADERS([wctype.h wchar.h widec.h])
 AC_CHECK_FUNCS([iswspace])
+AC_TYPE_INTPTR_T
 
 XAW3D_CPPFLAGS=
 
diff --git a/src/Scrollbar.c b/src/Scrollbar.c
index 98aac74..429a660 100644
--- a/src/Scrollbar.c
+++ b/src/Scrollbar.c
@@ -69,6 +69,8 @@ SOFTWARE.
 
 #include 
 
+#include 
+
 /* Private definitions. */
 
 #ifdef XAW_ARROW_SCROLLBARS
@@ -785,7 +787,7 @@ RepeatNotify(XtPointer client_data, XtIntervalId *idp)
 {
 #define A_FEW_PIXELS 5
 ScrollbarWidget sbw = (ScrollbarWidget) client_data;
-int call_data;
+intptr_t call_data;
 if (sbw->scrollbar.scroll_mode != 1 && sbw->scrollbar.scroll_mode != 3) {
sbw->scrollbar.timer_id = (XtIntervalId) 0;
return;
@@ -874,7 +876,7 @@ static void
 NotifyScroll (Widget w, XEvent *event, String *params, Cardinal *num_params)
 {
 ScrollbarWidget sbw = (ScrollbarWidget) w;
-int call_data;
+intptr_t call_data;
 Position x, y;
 
 if (sbw->scrollbar.scroll_mode == 2  /* if scroll continuous */
@@ -920,7 +922,7 @@ static void
 NotifyScroll (Widget w, XEvent *event, String *params, Cardinal *num_params)
 {
 ScrollbarWidget sbw = (ScrollbarWidget) w;
-int call_data;
+intptr_t call_data;
 char style;
 Position x, y;
 
diff --git a/src/Text.c b/src/Text.c
index 36bef53..be4d592 100644
--- a/src/Text.c
+++ b/src/Text.c
@@ -58,6 +58,7 @@ SOFTWARE.
 #ifdef XAW_INTERNATIONALIZATION
 #include "XawI18n.h"
 #endif
+#include 
 #include 
 #include 
 #include 
@@ -1271,7 +1272,7 @@ HScroll(Widget w, XtPointer closure, XtPointer callData)
 {
   TextWidget ctx = (TextWidget) closure;
   Widget tw = (Widget) ctx;
-  Position old_left, pixels = (Position)(int) callData;
+  Position old_left, pixels = (Position)(intptr_t) callData;
   XRectangle rect, t_rect;
   int s = ((ThreeDWidget)ctx->text.threeD)->threeD.shadow_width;
 
@@ -1428,7 +1429,7 @@ static void
 VScroll(Widget w, XtPointer closure, XtPointer callData)
 {
   TextWidget ctx = (TextWidget)closure;
-  int height, nlines, lines = (int) callData;
+  int height, nlines, lines = (intptr_t) callData;
 
   height = ctx->core.height - VMargins(ctx);
   if (height < 1)
diff --git a/src/TextPop.c b/src/TextPop.c
index 5233f30..037fd5b 100644
--- a/src/TextPop.c
+++ b/src/TextPop.c
@@ -63,6 +63,7 @@ in this Software without prior written authorization from the 
X Consortium.
 #ifdef XAW_INTERNATIONALIZATION
 #include "XawI18n.h"
 #endif
+#include 
 #include 
 #include/* for O_RDONLY */
 #include 
@@ -805,7 +806,7 @@ DoSearch(struct SearchAndReplace * search)
   text.length = strlen(text.ptr);
   text.firstPos = 0;
 
-  dir = (XawTextScanDirection)(int) 
((XPointer)XawToggleGetCurrent(search->left_toggle) -
+  dir = (XawTextScanDirection)(intptr_t) 
((XPointer)XawToggleGetCurrent(search->left_toggle) -
R_OFFSET);
 
   pos = XawTextSearch( tw, dir, &text);
@@ -939,7 +940,7 @@ Replace(struct SearchAndReplace *search, Boolean once_only, 
Boolean show_current
 #endif
   replace.length = strlen(replace.ptr);
 
-  dir = (XawTextScanDirection)(int) 
((XPointer)XawToggleGetCurrent(search->left_toggle) -
+  dir = (XawTextScanDirection)(intptr_t) 
((XPointer)XawToggleGetCurrent(search->left_toggle) -
R_OFFSET);
   /* CONSTCOND */
   while (TRUE) {
diff --git a/src/Viewport.c b/src/Viewport.c
index d8b1188..abb8961 100644
--- a/src/Viewport.c
+++ b/src/Viewport.c
@@ -57,6 +57,8 @@ SOFTWARE.
 #include 
 #include 
 
+#include 
+
 static void ScrollUpDownProc(Widget, XtPointer, XtPointer);
 static void ThumbProc(Widget, XtPointer, XtPointer);
 static Boolean GetGeometry(Widget, Dimension, Dimension);
@@ -863,7 +865,7 @@ ScrollUpDownProc(Widget widget, XtPointer closure, 
XtPoi

[PATCH libXaw3d 3/5] Only use variable t in MoveThumb() on XAW_ARROW_SCROLLBARS

2011-10-03 Thread Guillem Jover
Fixes gcc warning:
Scrollbar.c: In function 'MoveThumb':
Scrollbar.c:1006:16: warning: variable 't' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Guillem Jover 
---
 src/Scrollbar.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Scrollbar.c b/src/Scrollbar.c
index 02eb980..98aac74 100644
--- a/src/Scrollbar.c
+++ b/src/Scrollbar.c
@@ -1003,7 +1003,10 @@ MoveThumb (Widget w, XEvent *event, String *params, 
Cardinal *num_params)
 {
 ScrollbarWidget sbw = (ScrollbarWidget) w;
 Position x, y;
-float loc, t, s;
+float loc, s;
+#ifdef XAW_ARROW_SCROLLBARS
+float t;
+#endif
 
 #ifndef XAW_ARROW_SCROLLBARS
 if (sbw->scrollbar.direction == 0) return; /* if no StartScroll */
@@ -1015,9 +1018,9 @@ MoveThumb (Widget w, XEvent *event, String *params, 
Cardinal *num_params)
 
 ExtractPosition (event, &x, &y);
 loc = FractionLoc (sbw, x, y);
-t = sbw->scrollbar.top;
 s = sbw->scrollbar.shown;
 #ifdef XAW_ARROW_SCROLLBARS
+t = sbw->scrollbar.top;
 if (sbw->scrollbar.scroll_mode != 2 )
   /* initialize picked position */
   sbw->scrollbar.picked = (FloatInRange( loc, t, t + s ) - t);
-- 
1.7.6.3

___
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: [PULL] prep work for screen crossing fixes

2011-10-03 Thread Keith Packard
On Tue, 4 Oct 2011 13:26:35 +1000, Peter Hutterer  
wrote:
Non-text part: multipart/signed

>   Store desktop dimensions in screenInfo.

Do we need the minimum x/y of the desktop too?

-- 
keith.pack...@intel.com


pgp4u1l5e5huc.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: [PATCH keyboard] man: link to xkeyboard-config(7) (#14494)

2011-10-03 Thread Alan Coopersmith

On 10/ 3/11 04:16 PM, Peter Hutterer wrote:

X.Org Bug 14494

Signed-off-by: Peter Hutterer


Looks good to me - pushed:

To ssh://git.freedesktop.org/git/xorg/driver/xf86-input-keyboard
   20beb15..45f9f45  master -> master

--
-Alan Coopersmith-alan.coopersm...@oracle.com
 Oracle Solaris Platform Engineering: X Window System

___
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: [PULL] prep work for screen crossing fixes

2011-10-03 Thread Peter Hutterer
On Mon, Oct 03, 2011 at 09:02:19PM -0700, Keith Packard wrote:
> On Tue, 4 Oct 2011 13:26:35 +1000, Peter Hutterer  
> wrote:
> Non-text part: multipart/signed
> 
> >   Store desktop dimensions in screenInfo.
> 
> Do we need the minimum x/y of the desktop too?

is it ever other than 0/0?

Cheers,
  Peter
___
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: [PULL] prep work for screen crossing fixes

2011-10-03 Thread Jamey Sharp
On Tue, Oct 04, 2011 at 02:15:53PM +1000, Peter Hutterer wrote:
> On Mon, Oct 03, 2011 at 09:02:19PM -0700, Keith Packard wrote:
> > On Tue, 4 Oct 2011 13:26:35 +1000, Peter Hutterer 
> >  wrote:
> > Non-text part: multipart/signed
> > 
> > >   Store desktop dimensions in screenInfo.
> > 
> > Do we need the minimum x/y of the desktop too?
> 
> is it ever other than 0/0?

Sure, that's legal (though crazy). Besides the xorg.conf ServerLayout
syntax for positioning a Screen "RightOf", "Below", etc, you can also
set the screen's absolute position.

On another note: When Xinerama is active, it sticks the root window
dimensions in the ConnectionInfo global structure. Does that make this
any easier, or otherwise is there an opportunity for sharing code there?

Jamey


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

[PATCH 00/12] Multihead screen crossing fixes

2011-10-03 Thread Peter Hutterer

This is another attempt at the screen crossing fixes that I sent out last
month. The basic goal was to make switching between ScreenRecs work for
absolute devices. Which turned out tricky and the best solution I came up
with was to unify multiscreen pointer behaviour between RandR and Xinerama -
an absolute device is now mapped to the total area across all screens.

Patches 01-06 are general cleanup and documentation fixes, the fun starts at
07. For the true connoisseur of insanity I recommend 12/12, the comment
before fill_pointer_events is worth reading. I'm sure you'll be laughing
until bedtime at the necessity of juggling 5 different coordinate systems
between devices, pointer placement and protocol events.  
(That's the simplest solution I could come up with, everything else I tried
I ran into a wall.)

Cheers,
  Peter

This code came at a cost of three kittens and one moose.
___
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 01/12] dix: document transformAbsolute

2011-10-03 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index ebf2653..f3026a3 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1020,6 +1020,14 @@ transform(struct pixman_f_transform *m, double *x, 
double *y)
 *y = p.v[1];
 }
 
+/**
+ * Apply the device's transformation matrix to the valuator mask and replace
+ * the scaled values in mask. This transformation only applies to valuators
+ * 0 and 1, others will be untouched.
+ *
+ * @param dev The device the valuators came from
+ * @param[in,out] mask The valuator mask.
+ */
 static void
 transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
 {
-- 
1.7.6.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 02/12] dix: fix missing verb in comment

2011-10-03 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index f3026a3..9f513d0 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -760,8 +760,9 @@ accelPointer(DeviceIntPtr dev, ValuatorMask* valuators, 
CARD32 ms)
  * miPointerSetPosition() and then scale back into device coordinates (if
  * needed). miPSP will change x/y if the screen was crossed.
  *
- * The coordinates provided are always absolute. The parameter mode whether
- * it was relative or absolute movement that landed us at those coordinates.
+ * The coordinates provided are always absolute. The parameter mode
+ * specifies whether it was relative or absolute movement that landed us at
+ * those coordinates.
  *
  * @param dev The device to be moved.
  * @param mode Movement mode (Absolute or Relative)
-- 
1.7.6.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 03/12] dix: rename moveAbsolute to clipAbsolute

2011-10-03 Thread Peter Hutterer
Let's be honest about what it does.

moveRelative accumulates delta _and_ clips in some cases, so that one can
keep it's name.

Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 9f513d0..772466c 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -693,7 +693,7 @@ UpdateFromMaster(InternalEvent* events, DeviceIntPtr dev, 
int type, int *num_eve
  * @param mask Valuator data for this event.
  */
 static void
-moveAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
+clipAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
 {
 int i;
 
@@ -1146,7 +1146,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr 
pDev, int type,
 }
 
 transformAbsolute(pDev, &mask);
-moveAbsolute(pDev, &mask);
+clipAbsolute(pDev, &mask);
 } else {
 if (flags & POINTER_ACCELERATE)
 accelPointer(pDev, &mask, ms);
-- 
1.7.6.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 04/12] dix: moveRelative modifies parameter in-place, say so.

2011-10-03 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 772466c..6d516dc 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -713,7 +713,7 @@ clipAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
  * Move the device's pointer by the values given in @valuators.
  *
  * @param dev The device whose pointer is to be moved.
- * @param mask Valuator data for this event.
+ * @param[in,out] mask Valuator data for this event, modified in-place.
  */
 static void
 moveRelative(DeviceIntPtr dev, ValuatorMask *mask)
-- 
1.7.6.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 05/12] dix: don't allow keyboard devices to submit motion or button events.

2011-10-03 Thread Peter Hutterer
GPE unconditionally dereferences pDev->valuator if a mask is present. This
shouldn't really happen but if it does, don't crash, just ignore the events
with an error.

Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 6d516dc..87441fc 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1099,6 +1099,11 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr 
pDev, int type,
 switch (type)
 {
 case MotionNotify:
+if (!pDev->valuator)
+{
+ErrorF("[dix] motion events from device %d without 
valuators\n", pDev->id);
+return 0;
+}
 if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0)
 return 0;
 break;
@@ -1106,6 +,11 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr 
pDev, int type,
 case ButtonRelease:
 if (!pDev->button || !buttons)
 return 0;
+if (mask_in && valuator_mask_size(mask_in) > 0 && !pDev->valuator)
+{
+ErrorF("[dix] button event with valuator from device %d 
without valuators\n", pDev->id);
+return 0;
+}
 break;
 default:
 return 0;
-- 
1.7.6.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 06/12] xfree86: remove xf86XInputSetScreen

2011-10-03 Thread Peter Hutterer
Keeping track of which screen the pointer within the input driver is
obsolete now. To bind to a screen, use the transformation matrix instead.

Signed-off-by: Peter Hutterer 
---
 hw/xfree86/common/xf86Xinput.c |   19 ---
 hw/xfree86/common/xf86Xinput.h |1 -
 2 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index ea1f927..ad18339 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1345,25 +1345,6 @@ xf86ScaleAxis(intCx,
 return X;
 }
 
-/*
- * This function checks the given screen against the current screen and
- * makes changes if appropriate. It should be called from an XInput driver's
- * ReadInput function before any events are posted, if the device is screen
- * specific like a touch screen.
- */
-void
-xf86XInputSetScreen(InputInfoPtr   pInfo,
-   int screen_number,
-   int x,
-   int y)
-{
-if (miPointerGetScreen(pInfo->dev) !=
-  screenInfo.screens[screen_number]) {
-   miPointerSetScreen(pInfo->dev, screen_number, x, y);
-}
-}
-
-
 Bool
 xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int 
minval, int maxval,
   int resolution, int min_res, int max_res, int mode)
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 189f7ab..909fb57 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -143,7 +143,6 @@ extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr 
device, unsigned int ke
int is_down);
 extern _X_EXPORT InputInfoPtr xf86FirstLocalDevice(void);
 extern _X_EXPORT int xf86ScaleAxis(int Cx, int to_max, int to_min, int 
from_max, int from_min);
-extern _X_EXPORT void xf86XInputSetScreen(InputInfoPtr pInfo, int 
screen_number, int x, int y);
 extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, 
XF86OptionPtr options);
 extern _X_EXPORT Bool xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, 
Atom label, int minval,
int maxval, int resolution, int min_res,
-- 
1.7.6.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 07/12] dix: move screen- to device coordinate scaling to separate function

2011-10-03 Thread Peter Hutterer
No functional changes.

Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |   50 --
 1 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 87441fc..c52a516 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -753,6 +753,37 @@ accelPointer(DeviceIntPtr dev, ValuatorMask* valuators, 
CARD32 ms)
 }
 
 /**
+ * Scale from absolute screen coordinates to absolute coordinates in the
+ * device's coordinate range.
+ *
+ * @param dev The device to scale for.
+ * @param[in, out] mask The mask in sceen coordinates, modified in place to
+ * contain device coordinate range.
+ */
+static void
+scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask)
+{
+double scaled;
+ScreenPtr scr = miPointerGetScreen(dev);
+
+if (valuator_mask_isset(mask, 0))
+{
+scaled = rescaleValuatorAxis(valuator_mask_get_double(mask, 0),
+ NULL, dev->valuator->axes + 0,
+ scr->width);
+valuator_mask_set_double(mask, 0, scaled);
+}
+if (valuator_mask_isset(mask, 1))
+{
+scaled = rescaleValuatorAxis(valuator_mask_get_double(mask, 1),
+ NULL, dev->valuator->axes + 1,
+ scr->height);
+valuator_mask_set_double(mask, 1, scaled);
+}
+}
+
+
+/**
  * If we have HW cursors, this actually moves the visible sprite. If not, we
  * just do all the screen crossing, etc.
  *
@@ -1136,24 +1167,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr 
pDev, int type,
 if (flags & POINTER_ABSOLUTE)
 {
 if (flags & POINTER_SCREEN) /* valuators are in screen coords */
-{
-double scaled;
-
-if (valuator_mask_isset(&mask, 0))
-{
-scaled = rescaleValuatorAxis(valuator_mask_get_double(&mask, 
0),
- NULL, pDev->valuator->axes + 0,
- scr->width);
-valuator_mask_set_double(&mask, 0, scaled);
-}
-if (valuator_mask_isset(&mask, 1))
-{
-scaled = rescaleValuatorAxis(valuator_mask_get_double(&mask, 
1),
- NULL, pDev->valuator->axes + 1,
- scr->height);
-valuator_mask_set_double(&mask, 1, scaled);
-}
-}
+scale_from_screen(pDev, &mask);
 
 transformAbsolute(pDev, &mask);
 clipAbsolute(pDev, &mask);
-- 
1.7.6.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 08/12] dix: drop screen argument from positionSprite

2011-10-03 Thread Peter Hutterer
We can just get this in the function, no effective functional changes.

Also return the screen to the caller. Though we don't use it yet, we will in
a follow-up patch.

Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index c52a516..450792b 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -797,20 +797,20 @@ scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask)
  *
  * @param dev The device to be moved.
  * @param mode Movement mode (Absolute or Relative)
- * @param scr Screen the device's sprite is currently on.
  * @param mask Mask of axis values for this event
  * @param screenx Screen x coordinate the sprite is on after the update.
  * @param screeny Screen y coordinate the sprite is on after the update.
  */
-static void
-positionSprite(DeviceIntPtr dev, int mode, ScreenPtr scr, ValuatorMask *mask,
+static ScreenPtr
+positionSprite(DeviceIntPtr dev, int mode, ValuatorMask *mask,
double *screenx, double *screeny)
 {
 int isx, isy; /* screen {x, y}, in int */
 double x, y;
+ScreenPtr scr = miPointerGetScreen(dev);
 
 if (!dev->valuator || dev->valuator->numAxes < 2)
-return;
+return scr;
 
 if (valuator_mask_isset(mask, 0))
 x = valuator_mask_get_double(mask, 0);
@@ -859,6 +859,8 @@ positionSprite(DeviceIntPtr dev, int mode, ScreenPtr scr, 
ValuatorMask *mask,
 valuator_mask_set_double(mask, 0, x);
 if (valuator_mask_isset(mask, 1))
 valuator_mask_set_double(mask, 1, y);
+
+return scr;
 }
 
 /**
@@ -1124,7 +1126,6 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr 
pDev, int type,
 DeviceEvent *event;
 RawDeviceEvent *raw;
 double screenx = 0.0, screeny = 0.0;
-ScreenPtr scr = miPointerGetScreen(pDev);
 ValuatorMask mask;
 
 switch (type)
@@ -1180,7 +1181,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr 
pDev, int type,
 if ((flags & POINTER_NORAW) == 0)
 set_raw_valuators(raw, &mask, raw->valuators.data);
 
-positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative, scr,
+positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
&mask, &screenx, &screeny);
 updateHistory(pDev, &mask, ms);
 
-- 
1.7.6.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 09/12] mi: return the screen from miPointerSetPosition

2011-10-03 Thread Peter Hutterer
miPointerSetPosition may switch screens. Always return the screen the sprite
is on instead of relying on callers to call miPointerGetScreen().

Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |3 +--
 mi/mipointer.c  |   14 +++---
 mi/mipointer.h  |2 +-
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 450792b..8b7ffeb 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -833,8 +833,7 @@ positionSprite(DeviceIntPtr dev, int mode, ValuatorMask 
*mask,
  * screenx back into device co-ordinates. */
 isx = trunc(*screenx);
 isy = trunc(*screeny);
-miPointerSetPosition(dev, mode, &isx, &isy);
-scr = miPointerGetScreen(dev);
+scr = miPointerSetPosition(dev, mode, &isx, &isy);
 if (isx != trunc(*screenx))
 {
 *screenx -= trunc(*screenx) - isx;
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 670f63b..4901d13 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -574,7 +574,7 @@ miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr pScreen,
  * @param[in,out] y The y coordinate in screen coordinates (in regards to total
  * desktop size)
  */
-void
+ScreenPtr
 miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y)
 {
 miPointerScreenPtr pScreenPriv;
@@ -584,12 +584,12 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, 
int *y)
 miPointerPtrpPointer; 
 
 if (!pDev || !pDev->coreEvents)
-return;
+return NULL;
 
 pPointer = MIPOINTER(pDev);
 pScreen = pPointer->pScreen;
 if (!pScreen)
-   return; /* called before ready */
+   return NULL;/* called before ready */
 
 if (*x < 0 || *x >= pScreen->width || *y < 0 || *y >= pScreen->height)
 {
@@ -622,11 +622,11 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, 
int *y)
 if (pScreen->ConstrainCursorHarder)
pScreen->ConstrainCursorHarder(pDev, pScreen, mode, x, y);
 
-if (pPointer->x == *x && pPointer->y == *y &&
-pPointer->pScreen == pScreen)
-return;
+if (pPointer->x != *x || pPointer->y != *y ||
+pPointer->pScreen != pScreen)
+miPointerMoveNoEvent(pDev, pScreen, *x, *y);
 
-miPointerMoveNoEvent(pDev, pScreen, *x, *y);
+return pScreen;
 }
 
 /**
diff --git a/mi/mipointer.h b/mi/mipointer.h
index c4265f9..35428df 100644
--- a/mi/mipointer.h
+++ b/mi/mipointer.h
@@ -131,7 +131,7 @@ extern _X_EXPORT void miPointerGetPosition(
 
 /* Moves the cursor to the specified position.  May clip the co-ordinates:
  * x and y are modified in-place. */
-extern _X_EXPORT void miPointerSetPosition(
+extern _X_EXPORT ScreenPtr miPointerSetPosition(
 DeviceIntPtr pDev,
 int mode,
 int *x,
-- 
1.7.6.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 10/12] mi: switch miPointerSetPosition to take doubles

2011-10-03 Thread Peter Hutterer
Don't switch between doubles and ints in the caller, instead take doubles in
miPointerSetPosition and do the conversion there. For full feature we should
change everything down from here for doubles too.

Functional change: previously we'd restore the remainder regardless of
screen switching/confinement (despite what the comment said). Now,
screen changing or cursor constraints will cause the remainder be clipped
off. This should happen for cursor constraints but arguably not for screen
crossing.

This also corrects a currently wrong comment about miPointerSetPosition's
input coordinates.

Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |   27 ---
 mi/mipointer.c  |   47 +--
 mi/mipointer.h  |4 ++--
 3 files changed, 43 insertions(+), 35 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 8b7ffeb..945e275 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -805,8 +805,8 @@ static ScreenPtr
 positionSprite(DeviceIntPtr dev, int mode, ValuatorMask *mask,
double *screenx, double *screeny)
 {
-int isx, isy; /* screen {x, y}, in int */
 double x, y;
+double tmpx, tmpy;
 ScreenPtr scr = miPointerGetScreen(dev);
 
 if (!dev->valuator || dev->valuator->numAxes < 2)
@@ -827,25 +827,22 @@ positionSprite(DeviceIntPtr dev, int mode, ValuatorMask 
*mask,
 *screeny = rescaleValuatorAxis(y, dev->valuator->axes + 1, NULL,
scr->height);
 
+tmpx = *screenx;
+tmpy = *screeny;
 /* miPointerSetPosition takes care of crossing screens for us, as well as
- * clipping to the current screen.  In the event we actually change screen,
- * we just drop the float component on the floor, then convert from
- * screenx back into device co-ordinates. */
-isx = trunc(*screenx);
-isy = trunc(*screeny);
-scr = miPointerSetPosition(dev, mode, &isx, &isy);
-if (isx != trunc(*screenx))
-{
-*screenx -= trunc(*screenx) - isx;
+ * clipping to the current screen. */
+scr = miPointerSetPosition(dev, mode, screenx, screeny);
+
+/* If we were constrained, rescale x/y from the screen coordinates so
+ * the device valuators reflect the correct position. For screen
+ * crossing this doesn't matter much, the coords would be 0 or max.
+ */
+if (tmpx != *screenx)
 x = rescaleValuatorAxis(*screenx, NULL, dev->valuator->axes + 0,
 scr->width);
-}
-if (isy != trunc(*screeny))
-{
-*screeny -= trunc(*screeny) - isy;
+if (tmpy != *screeny)
 y = rescaleValuatorAxis(*screeny, NULL, dev->valuator->axes + 1,
 scr->height);
-}
 
 /* Update the MD's co-ordinates, which are always in screen space. */
 if (!IsMaster(dev) || !IsFloating(dev)) {
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 4901d13..55e4081 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -569,17 +569,16 @@ miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr 
pScreen,
  *
  * @param pDev The device to move
  * @param mode Movement mode (Absolute or Relative)
- * @param[in,out] x The x coordinate in screen coordinates (in regards to total
- * desktop size)
- * @param[in,out] y The y coordinate in screen coordinates (in regards to total
- * desktop size)
+ * @param[in,out] screenx The x coordinate in screen coordinates
+ * @param[in,out] screeny The y coordinate in screen coordinates
  */
 ScreenPtr
-miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y)
+miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, double 
*screeny)
 {
 miPointerScreenPtr pScreenPriv;
 ScreenPtr  pScreen;
 ScreenPtr  newScreen;
+intx, y;
 
 miPointerPtrpPointer; 
 
@@ -591,13 +590,16 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, 
int *y)
 if (!pScreen)
return NULL;/* called before ready */
 
-if (*x < 0 || *x >= pScreen->width || *y < 0 || *y >= pScreen->height)
+x = trunc(*screenx);
+y = trunc(*screeny);
+
+if (x < 0 || x >= pScreen->width || y < 0 || y >= pScreen->height)
 {
pScreenPriv = GetScreenPrivate (pScreen);
if (!pPointer->confined)
{
newScreen = pScreen;
-   (*pScreenPriv->screenFuncs->CursorOffScreen) (&newScreen, x, y);
+   (*pScreenPriv->screenFuncs->CursorOffScreen) (&newScreen, &x, &y);
if (newScreen != pScreen)
{
pScreen = newScreen;
@@ -610,21 +612,30 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, 
int *y)
}
 }
 /* Constrain the sprite to the current limits. */
-if (*x < pPointer->limits.x1)
-   *x = pPointer->limits.x1;
-if (*x >= pPointer->limits.x2)
-   *x = pPointer->limits.x2 - 1;
-if (*y < pPointer->limits.y1)
-   *y = pPointer->limits.y1;
-if (*y >= pPointe

[PATCH 11/12] dix: move MD last.valuator update into fill_pointer_events

2011-10-03 Thread Peter Hutterer
Don't update the MD where it's not expected, positionSprite should really
just do that - position the sprite.

Signed-off-by: Peter Hutterer 
---
 dix/getevents.c |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 945e275..b0725aa 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -844,12 +844,6 @@ positionSprite(DeviceIntPtr dev, int mode, ValuatorMask 
*mask,
 y = rescaleValuatorAxis(*screeny, NULL, dev->valuator->axes + 1,
 scr->height);
 
-/* Update the MD's co-ordinates, which are always in screen space. */
-if (!IsMaster(dev) || !IsFloating(dev)) {
-DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
-master->last.valuators[0] = *screenx;
-master->last.valuators[1] = *screeny;
-}
 
 if (valuator_mask_isset(mask, 0))
 valuator_mask_set_double(mask, 0, x);
@@ -1189,6 +1183,13 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr 
pDev, int type,
 pDev->last.valuators[i] = valuator_mask_get_double(&mask, i);
 }
 
+/* Update the MD's co-ordinates, which are always in screen space. */
+if (!IsMaster(pDev) || !IsFloating(pDev)) {
+DeviceIntPtr master = GetMaster(pDev, MASTER_POINTER);
+master->last.valuators[0] = screenx;
+master->last.valuators[1] = screeny;
+}
+
 event = &events->device_event;
 init_device_event(event, pDev, ms);
 
-- 
1.7.6.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 12/12] input: change pointer screen crossing behaviour for multiple ScreenRecs

2011-10-03 Thread Peter Hutterer
miPointerSetPosition traditionally took coordinates on a per-screen basis,
triggering a screen switch when these went out-of-bounds. For absolute
devices, this prevented screen crossing in the negative x/y direction.

This patch changes the event generation patch to handle screen coordinates
in a desktop range (i.e. all screens together). Screen switches are
triggered when these coordinates are not on the current screen.

This unifies the pointer behaviour of single ScreenRec multihead and
multiple ScreenRecs multihead in that the cursor by default moves about the
whole screen rather than be confined to one single screen. The
transformation matrix may then be used to actually confine the cursor to the
screen again.

Note: fill_pointer_events has to deal with several different coordinate
systems. Make sure you read the comment before trying to understand the code.

Signed-off-by: Peter Hutterer 
---
 dix/devices.c  |   10 +++--
 dix/getevents.c|  120 
 include/inputstr.h |5 +-
 mi/mipointer.c |   18 +++-
 4 files changed, 117 insertions(+), 36 deletions(-)

diff --git a/dix/devices.c b/dix/devices.c
index 64557aa..7879405 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -612,6 +612,7 @@ CorePointerProc(DeviceIntPtr pDev, int what)
 int i = 0;
 Atom btn_labels[NBUTTONS] = {0};
 Atom axes_labels[NAXES] = {0};
+ScreenPtr scr = screenInfo.screens[0];
 
 switch (what) {
 case DEVICE_INIT:
@@ -638,10 +639,11 @@ CorePointerProc(DeviceIntPtr pDev, int what)
pDev->name);
 return BadAlloc; /* IPDS only fails on allocs */
 }
-pDev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2;
-pDev->last.valuators[0] = pDev->valuator->axisVal[0];
-pDev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2;
-pDev->last.valuators[1] = pDev->valuator->axisVal[1];
+/* axisVal is per-screen, last.valuators is desktop-wide */
+pDev->valuator->axisVal[0] = scr->width / 2;
+pDev->last.valuators[0] = pDev->valuator->axisVal[0] + scr->x;
+pDev->valuator->axisVal[1] = scr->height / 2;
+pDev->last.valuators[1] = pDev->valuator->axisVal[1] + scr->y;
 break;
 
 case DEVICE_CLOSE:
diff --git a/dix/getevents.c b/dix/getevents.c
index b0725aa..a6f4e78 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -295,7 +295,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr 
pDev)
 int i;
 DeviceIntPtr lastSlave;
 
-/* master->last.valuators[0]/[1] is in screen coords and the actual
+/* master->last.valuators[0]/[1] is in desktop-wide coords and the actual
  * position of the pointer */
 pDev->last.valuators[0] = master->last.valuators[0];
 pDev->last.valuators[1] = master->last.valuators[1];
@@ -757,8 +757,8 @@ accelPointer(DeviceIntPtr dev, ValuatorMask* valuators, 
CARD32 ms)
  * device's coordinate range.
  *
  * @param dev The device to scale for.
- * @param[in, out] mask The mask in sceen coordinates, modified in place to
- * contain device coordinate range.
+ * @param[in, out] mask The mask in desktop coordinates, modified in place
+ * to contain device coordinate range.
  */
 static void
 scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask)
@@ -768,14 +768,16 @@ scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask)
 
 if (valuator_mask_isset(mask, 0))
 {
-scaled = rescaleValuatorAxis(valuator_mask_get_double(mask, 0),
+scaled = valuator_mask_get_double(mask, 0) + scr->x;
+scaled = rescaleValuatorAxis(scaled,
  NULL, dev->valuator->axes + 0,
  scr->width);
 valuator_mask_set_double(mask, 0, scaled);
 }
 if (valuator_mask_isset(mask, 1))
 {
-scaled = rescaleValuatorAxis(valuator_mask_get_double(mask, 1),
+scaled = valuator_mask_get_double(mask, 1) + scr->y;
+scaled = rescaleValuatorAxis(scaled,
  NULL, dev->valuator->axes + 1,
  scr->height);
 valuator_mask_set_double(mask, 1, scaled);
@@ -793,16 +795,21 @@ scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask)
  *
  * The coordinates provided are always absolute. The parameter mode
  * specifies whether it was relative or absolute movement that landed us at
- * those coordinates.
+ * those coordinates. see fill_pointer_events for information on coordinate
+ * systems.
  *
  * @param dev The device to be moved.
  * @param mode Movement mode (Absolute or Relative)
- * @param mask Mask of axis values for this event
- * @param screenx Screen x coordinate the sprite is on after the update.
- * @param screeny Screen y coordinate the sprite is on after the update.
+ * @param[in,out] mask Mask of axis values for this event, returns the
+ * per-screen device coordinates after confinement
+ * @param[out] devx x

Re: [PULL] prep work for screen crossing fixes

2011-10-03 Thread Peter Hutterer
On Mon, Oct 03, 2011 at 10:02:28PM -0700, Jamey Sharp wrote:
> On Tue, Oct 04, 2011 at 02:15:53PM +1000, Peter Hutterer wrote:
> > On Mon, Oct 03, 2011 at 09:02:19PM -0700, Keith Packard wrote:
> > > On Tue, 4 Oct 2011 13:26:35 +1000, Peter Hutterer 
> > >  wrote:
> > > Non-text part: multipart/signed
> > > 
> > > >   Store desktop dimensions in screenInfo.
> > > 
> > > Do we need the minimum x/y of the desktop too?
> > 
> > is it ever other than 0/0?
> 
> Sure, that's legal (though crazy). Besides the xorg.conf ServerLayout
> syntax for positioning a Screen "RightOf", "Below", etc, you can also
> set the screen's absolute position.

right, that's for a single screen. but can the desktop origin ever be
non-zero? Can you have layout where the first screen goes from say -1024..0
and the second from 0..1204?

> On another note: When Xinerama is active, it sticks the root window
> dimensions in the ConnectionInfo global structure. Does that make this
> any easier, or otherwise is there an opportunity for sharing code there?

possibly, I'll try to find out

Cheers,
  Peter
___
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/12] Multihead screen crossing fixes

2011-10-03 Thread Jamey Sharp
For patches 1 through 9:

Reviewed-by: Jamey Sharp 

For patch 10 on, I had to call a lifeguard to rescue me from drowning in
input semantics. I like the sound of "unify multiscreen pointer
behaviour between RandR and Xinerama" though. :-)

Jamey

On Tue, Oct 04, 2011 at 03:23:56PM +1000, Peter Hutterer wrote:
> 
> This is another attempt at the screen crossing fixes that I sent out last
> month. The basic goal was to make switching between ScreenRecs work for
> absolute devices. Which turned out tricky and the best solution I came up
> with was to unify multiscreen pointer behaviour between RandR and Xinerama -
> an absolute device is now mapped to the total area across all screens.
> 
> Patches 01-06 are general cleanup and documentation fixes, the fun starts at
> 07. For the true connoisseur of insanity I recommend 12/12, the comment
> before fill_pointer_events is worth reading. I'm sure you'll be laughing
> until bedtime at the necessity of juggling 5 different coordinate systems
> between devices, pointer placement and protocol events.  
> (That's the simplest solution I could come up with, everything else I tried
> I ran into a wall.)
> 
> Cheers,
>   Peter
> 
> This code came at a cost of three kittens and one moose.
> ___
> 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


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: [PULL] prep work for screen crossing fixes

2011-10-03 Thread Jamey Sharp
On Tue, Oct 04, 2011 at 03:35:41PM +1000, Peter Hutterer wrote:
> On Mon, Oct 03, 2011 at 10:02:28PM -0700, Jamey Sharp wrote:
> > On Tue, Oct 04, 2011 at 02:15:53PM +1000, Peter Hutterer wrote:
> > > On Mon, Oct 03, 2011 at 09:02:19PM -0700, Keith Packard wrote:
> > > > On Tue, 4 Oct 2011 13:26:35 +1000, Peter Hutterer 
> > > >  wrote:
> > > > >   Store desktop dimensions in screenInfo.
> > > > 
> > > > Do we need the minimum x/y of the desktop too?
> > > 
> > > is it ever other than 0/0?
> > 
> > Sure, that's legal (though crazy). Besides the xorg.conf ServerLayout
> > syntax for positioning a Screen "RightOf", "Below", etc, you can also
> > set the screen's absolute position.
> 
> right, that's for a single screen. but can the desktop origin ever be
> non-zero? Can you have layout where the first screen goes from say -1024..0
> and the second from 0..1204?

I believe that could happen in this kind of config, for example:

Screen "screen1" -1024 0
Screen "screen2" RightOf "screen1"

I think it might also happen if you did:

Screen "screen1"
Screen "screen2" LeftOf "screen1"

I also don't think there's anything forcing screens to be contiguous. In
general I believe the config parser gives you plenty of rope to shoot
yourself in the foot.

Jamey


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 1/3] Have FreePixmap call screen hooks, not the other way around.

2011-10-03 Thread Michel Dänzer
On Mon, 2011-10-03 at 16:16 -0700, Jamey Sharp wrote: 
> On Mon, Oct 03, 2011 at 12:03:33PM +0200, Michel Dänzer wrote:
> > On Sam, 2011-10-01 at 23:08 -0700, Jamey Sharp wrote: 
> > > In the process, move reference counting into FreePixmap instead of
> > > doing it inconsistently in the various screen hooks.
> > 
> > I like the series, the only minor nit being that the name 'FreePixmap'
> > still implies that the pixmap is freed immediately. How about something
> > like 'UnreferencePixmap' or an abbreviation thereof?
> 
> Good point. Josh suggested ReleasePixmap, which I like. (I try to pick
> short words instead of abbreviating long ones.)

Good choice.

> I've updated my pixmap-hooks branch with that change, which didn't
> affect the other two patches. 
> 
> git://anongit.freedesktop.org/~jamey/xserver pixmap-hooks
> http://cgit.freedesktop.org/~jamey/xserver/log/?h=pixmap-hooks
> 
> Would you like to provide a Reviewed-by now that I've made that change?

Reviewed-by: Michel Dänzer 


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast |  Debian, X and DRI developer
___
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] mkfontscale: Support FontForge weight designations.

2011-10-03 Thread Maxim Iorsh
Fontforge uses 'ExtraLight' and 'Heavy' weights in Type 1 fonts, which
should be understood by mkfontscale. Other FontForge designations are
already addressed.

Signed-off-by: Maxim Iorsh 
---
 mkfontscale.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/mkfontscale.c b/mkfontscale.c
index 31553cb..49bbe77 100644
--- a/mkfontscale.c
+++ b/mkfontscale.c
@@ -426,6 +426,8 @@ t1Weight(char *weight)
 return NULL;
 if(strcmp(weight, "Thin") == 0)
 return "thin";
+if(strcmp(weight, "ExtraLight") == 0) /* FontForge uses this for 200*/
+return "extralight";
 if(strcmp(weight, "Light") == 0)
 return "light";
 if(strcmp(weight, "Regular") == 0)
@@ -446,6 +448,8 @@ t1Weight(char *weight)
 return "semibold";
 else if(strcmp(weight, "Bold") == 0)
 return "bold";
+else if(strcmp(weight, "Heavy") == 0) /* FontForge uses this for 800*/
+return "extrabold";
 else if(strcmp(weight, "Black") == 0)
 return "black";
 else {
-- 
1.7.3.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


Re: [PULL] build fix, GC clipping cleanup

2011-10-03 Thread Jamey Sharp
On Mon, Oct 03, 2011 at 03:13:09PM -0700, Jamey Sharp wrote:
> On Mon, Oct 03, 2011 at 12:01:23PM -0700, Keith Packard wrote:
> > On Wed, 28 Sep 2011 13:57:27 -0700, Jamey Sharp  wrote:
> > > Hi Keith! Here's some reviewed code deletion (hooray!) and the fix to
> > > make kdrive build again after the last pull.
> > 
> > There was a comment requesting that FreePixmap be renamed
> > 'UnreferencePixmap' or some such?
> 
> Yeah, and I'm not opposed. (Although I'm hoping for a better name
> choice...) It's probably a good idea to change the names anyway so any
> unfixed callers are detected at compile time.
> 
> Would you pull the rest of my reviewed patches in the meantime though? I
> have a lot of patches that depend on the clipping changes going in, and
> the missing .gitignore entry keeps bugging me.

And now, with that fixed and review tags updated, please pull the whole
thing:

The following changes since commit 6378d0233d21088b6429755627b4253859892c72:

  Merge remote-tracking branch 'herrb/master' (2011-10-03 13:56:06 -0700)

are available in the git repository at:

  git://anongit.freedesktop.org/~jamey/xserver reviewed

Jamey Sharp (6):
  test: .gitignore the binary for xfree86.c.
  Quit wrapping ChangeClip, CopyClip, and DestroyClip in GCFuncs.
  Make GC clientClip always be a region.
  Introduce ReleasePixmap to unreference, call screen hooks, and free.
  Introduce CreatePixmap, allocating a header and calling screen hooks.
  Move pixmap size limit checking to CreatePixmap, from screen hooks.

 Xext/panoramiX.c   |   32 --
 Xext/saver.c   |4 +-
 Xext/shm.c |   34 +++
 Xext/xvmain.c  |   10 +--
 composite/compalloc.c  |6 +-
 composite/compwindow.c |7 +-
 dbe/midbe.c|   42 +++-
 dix/dispatch.c |   12 +--
 dix/gc.c   |   89 -
 dix/glyphcurs.c|8 +-
 dix/pixmap.c   |   55 +++
 dix/window.c   |   21 ++--
 doc/Xserver-spec.xml   |  119 +++---
 exa/exa.c  |   48 -
 exa/exa_accel.c|   18 ++--
 exa/exa_classic.c  |   70 ++---
 exa/exa_driver.c   |   50 --
 exa/exa_glyphs.c   |   20 ++---
 exa/exa_mixed.c|   56 +--
 exa/exa_offscreen.c|4 +-
 exa/exa_priv.h |   27 +++---
 exa/exa_render.c   |7 +-
 exa/exa_unaccel.c  |6 +-
 fb/fb.h|   12 +--
 fb/fb24_32.c   |2 +-
 fb/fbgc.c  |7 +-
 fb/fboverlay.c |4 +-
 fb/fbpixmap.c  |   67 +++--
 fb/fbwindow.c  |2 +-
 glx/glxcmds.c  |3 +-
 hw/dmx/dmxgc.c |  115 +++---
 hw/dmx/dmxgc.h |3 -
 hw/dmx/dmxpixmap.c |   42 ++---
 hw/dmx/dmxpixmap.h |6 +-
 hw/dmx/glxProxy/glxext.c   |4 +-
 hw/kdrive/src/kxv.c|2 +-
 hw/xfree86/common/xf86DGA.c|6 +-
 hw/xfree86/common/xf86VGAarbiter.c |   42 ++---
 hw/xfree86/common/xf86VGAarbiterPriv.h |7 +-
 hw/xfree86/common/xf86xv.c |2 +-
 hw/xfree86/shadowfb/shadow.c   |   35 ---
 hw/xfree86/xaa/xaaBitBlt.c |4 +-
 hw/xfree86/xaa/xaaGC.c |   31 --
 hw/xfree86/xaa/xaaInit.c   |   99 +--
 hw/xnest/GC.c  |  170 +---
 hw/xnest/Pixmap.c  |   40 ++--
 hw/xnest/XNGC.h|4 -
 hw/xnest/XNPixmap.h|5 +-
 hw/xwin/win.h  |5 +-
 hw/xwin/wingc.c|   42 
 hw/xwin/winpixmap.c|   51 +++---
 include/gc.h   |2 +-
 include/gcstruct.h |   25 ++---
 include/pixmap.h   |9 +-
 include/scrnintstr.h   |   10 +--
 mi/miarc.c |9 +-
 mi/mibitblt.c  |   18 ++--
 mi/micopy.c|4 +-
 mi/midispcur.c |   26 +++---
 mi/miexpose.c  |2 +-
 mi/migc.c  |   76 +--
 mi/migc.h  |   16 ---
 mi/miglblt.c   |   10 +-
 mi/mioverlay.c |2 +