Re: [PATCH] input: properly align doubles in InitValuatorClassDeviceStruct

2011-02-26 Thread Daniel Stone
On Fri, Feb 25, 2011 at 09:02:20PM -0800, Keith Packard wrote:
 On Sat, 26 Feb 2011 00:00:39 +0100, Julien Cristau jcris...@debian.org 
 wrote:
  Some architectures (hi, sparc!) are unhappy with unaligned memory
  accesses.  So make sure the axisVal member of ValuatorClassRec has
  sizeof(double) alignment to avoid crashes and test failures.
 
 The 'standard' way to do this is to use a union to ensure correct
 alignment. Seems like simply moving the doubles to after the
 ValuatorClassRec and using a union between a double and the
 ValuatorClassRec would fix this without a lot of ugly pointer computations.

If we're going for more-invasive patches, why not just allocate axisVal
separately from ValuatorClassRec?

Cheers,
Daniel


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:xscope] Greatly reduce xscope's bss pages

2011-02-26 Thread walter harms
the patch look reasonable, just one small thing: the naming in unfortune
the original calloc() uses (number,size) perhaps you can rename it simply
into zalloc() (z=zero) or what every you thing fits.

Just my two cents,

re,
 wh


Am 26.02.2011 08:28, schrieb Alan Coopersmith:
 xscope had several static arrays of StaticMaxFD structures, which ended up
 in .bss sections.   StaticMaxFD was initialized to FD_SETSIZE.
 
 On 32-bit Solaris, the default value FD_SETSIZE is 1024.
 On 64-bit Solaris, the FD_SETSIZE is 64k, due to the SPARCv9 ABI.
 
 One of the structures allocated included the 32k data buffer for each FD.
 This resulted in the highly excessive mapping of 2gb of .bss when building
 64-bit binaries on Solaris, and 32mb for 32-bit binaries.
 
 After this patch, only 52k of .bss is mapped.
 (Actual RSS pages for xscope were barely changed.)
 
 To reduce this, the static tables were replaced with callocs of MaxFD
 tables, where MaxFD is now the smaller of StaticMaxFD or the current
 fd limit.   StaticMaxFD is reduced by default to 256, since xscope is
 rarely used with large numbers of clients (it can be recompiled with a
 larger StaticMaxFD when needed).
 
 Additionally, the 32k buffers are allocated only when FD's are opened to
 use them, instead of for the maximum possible number of FD's.
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
 ---
  common.c   |   16 
  decode11.c |   11 +++
  fd.c   |   11 +++
  fd.h   |   14 +-
  proto.h|1 +
  scope.c|   16 
  scope.h|4 ++--
  server.c   |2 +-
  table11.c  |1 +
  x11.h  |2 +-
  10 files changed, 49 insertions(+), 29 deletions(-)
 
 diff --git a/common.c b/common.c
 index 1d48530..7ac342c 100644
 --- a/common.c
 +++ b/common.c
 @@ -93,6 +93,22 @@ Malloc (longn)
return(p);
  }
  
 +void *
 +CallocPerFD (longn)
 +{
 +  void   *p;
 +  p = calloc(MaxFD, n);
 +  debug(64,(stderr, %lx = calloc(%d, %ld)\n, (unsigned long) p, MaxFD, n));
 +  if (p == NULL)
 +{
 +  fprintf(stderr, failed to allocate %d bytes for %d files\n,
 +   MaxFD * n, MaxFD);
 +  panic(cannot continue);
 +}
 +  return(p);
 +}
 +
 +
  void 
  Free(void   *p)
  {
 diff --git a/decode11.c b/decode11.c
 index a9360ff..fb5cb73 100644
 --- a/decode11.c
 +++ b/decode11.c
 @@ -133,19 +133,14 @@ struct QueueHeader
struct QueueEntry  *Tail;
  };
  
 -static struct QueueHeader  ReplyQ[StaticMaxFD];
 +static struct QueueHeader  *ReplyQ;
  
  /*  */
  
  void
  InitReplyQ (void)
  {
 -  short   i;
 -  for (i = 0; i  StaticMaxFD; i++)
 -{
 -  ReplyQ[i].Head = NULL;
 -  ReplyQ[i].Tail = NULL;
 -}
 +  ReplyQ = CallocPerFD(sizeof(struct QueueHeader));
  }
  
  void
 @@ -209,7 +204,7 @@ SequencedReplyExpected (
  
/* find the server associated with this client */
fd = FDPair(fd);
 -  if (fd  0 || fd = StaticMaxFD) return;
 +  if (fd  0 || fd = MaxFD) return;
  
/* attach the new queue entry to the end of the queue for the Server */
if (ReplyQ[fd].Tail != NULL)
 diff --git a/fd.c b/fd.c
 index 5096e70..623e45f 100644
 --- a/fd.c
 +++ b/fd.c
 @@ -84,7 +84,7 @@
  void
  InitializeFD(void)
  {
 -  register short  i;
 +  int  i;
  
enterprocedure(InitializeFD);
/* get the number of file descriptors the system will let us use */
 @@ -100,17 +100,12 @@ InitializeFD(void)
}
if (MaxFD  StaticMaxFD)
  {
 -  fprintf(stderr, Recompile with larger StaticMaxFD value %d\n, MaxFD);
MaxFD = StaticMaxFD;
  }
  
/* allocate space for a File Descriptor (FD) Table */
 -  FDD = (struct FDDescriptor *)
 -Malloc ((long)(MaxFD * sizeof (struct FDDescriptor)));
 -  if (FDD == NULL) {
 -  panic(Can't allocate memory!);
 -  }
 -  bzero(FDD, (MaxFD * sizeof (struct FDDescriptor)));
 +  FDD = CallocPerFD(sizeof (struct FDDescriptor));
 +  FDinfo = CallocPerFD(sizeof (struct fdinfo));
  
/* be sure all fd's are closed and marked not busy */
for (i = 0; i  MaxFD; i++)
 diff --git a/fd.h b/fd.h
 index 76a3e6e..a711359 100644
 --- a/fd.h
 +++ b/fd.h
 @@ -78,17 +78,21 @@ struct FDDescriptor
  };
  
  extern struct FDDescriptor *FDD /* array of FD descriptors */ ;
 -extern short   MaxFD /* maximum number of FD's possible */ ;
 +extern int MaxFD /* maximum number of FD's possible */ ;
  
 -extern short   nFDsInUse /* number of FD's actually in use */ ;
 +extern int nFDsInUse /* number of FD's actually in use */ ;
  
  extern fd_set  ReadDescriptors /* bit map of FD's in use -- for select  */ ;
  extern fd_set  WriteDescriptors /* bit map of write blocked FD's -- for 
 select */;
  extern fd_set  BlockedReadDescriptors /* bit map of FD's blocked from 
 reading */;
 -extern short   HighestFD /* highest FD in use -- for select */ ;
 +extern int HighestFD /* highest FD in use -- for select */ ;
  
 -/* need to change the MaxFD to allow 

Re: [PATCH:xscope] Greatly reduce xscope's bss pages

2011-02-26 Thread Mark Kettenis
 From: Alan Coopersmith alan.coopersm...@oracle.com
 Date: Fri, 25 Feb 2011 23:28:24 -0800
 
 xscope had several static arrays of StaticMaxFD structures, which ended up
 in .bss sections.   StaticMaxFD was initialized to FD_SETSIZE.
 
 On 32-bit Solaris, the default value FD_SETSIZE is 1024.
 On 64-bit Solaris, the FD_SETSIZE is 64k, due to the SPARCv9 ABI.
 
 One of the structures allocated included the 32k data buffer for each FD.
 This resulted in the highly excessive mapping of 2gb of .bss when building
 64-bit binaries on Solaris, and 32mb for 32-bit binaries.
 
 After this patch, only 52k of .bss is mapped.
 (Actual RSS pages for xscope were barely changed.)
 
 To reduce this, the static tables were replaced with callocs of MaxFD
 tables, where MaxFD is now the smaller of StaticMaxFD or the current
 fd limit.   StaticMaxFD is reduced by default to 256, since xscope is
 rarely used with large numbers of clients (it can be recompiled with a
 larger StaticMaxFD when needed).

Sorry, but the combination of your statements here and the actual
patch doesn't completely make sense to me.  Is reducing StaticMaxFD
really necessary now that you have made the allocations more
dynamical?  Most people will run with ulimit -n set to something sane,
so the allocations won't be excessive.  You'll probably still want to
clamp at FD_SETSIZE though, given how 32-bit Solaris switches around
the select(2) and poll(2) implementations if the user sets FD_SETSIZE
to a value larger than 1024.

If you do decide that the number of file descriptors should be clamped
at 256, please leave the warning about recompiling the code with a
larger value for StaticMaxFD.

Cheers,

Mark
___
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 xf86-video-vmware] Remove unused variable.

2011-02-26 Thread Cyril Brulebois
Fix the build with CFLAGS=-Wall -Werror:
|   CC vmware_drv_la-vmwaremodule.lo
| cc1: warnings being treated as errors
| vmwaremodule.c: In function ‘vmware_chain_module’:
| vmwaremodule.c:178: error: unused variable ‘ret’

Signed-off-by: Cyril Brulebois k...@debian.org
---
 src/vmwaremodule.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/vmwaremodule.c b/src/vmwaremodule.c
index 33d3cff..0da2440 100644
--- a/src/vmwaremodule.c
+++ b/src/vmwaremodule.c
@@ -175,7 +175,6 @@ vmware_chain_module(pointer opts)
 GDevPtr *gdevs;
 GDevPtr gdev;
 int i;
-pointer ret;
 
 vmware_devices = xf86MatchDevice(VMWARE_DRIVER_NAME, gdevs);
 vmwgfx_devices = xf86MatchDevice(VMWGFX_DRIVER_NAME, NULL);
-- 
1.7.2.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] Server build fixes

2011-02-26 Thread Keith Packard
On Sat, 26 Feb 2011 15:33:20 +0100, Cyril Brulebois k...@debian.org wrote:

 I fear that the sdksyms part is broken. If one builds with some
 options different than the ones used to generate the tarball, the file
 isn't generated again, leading to such issues.

Looks like sdksyms.c should be stuck in nodist_libloader_la_SOURCES so
that it doesn't get distributed. Nothing has changed here in a long
time, so I'm a bit confused why this cropped up so soon with 1.10.0;
the sdksyms.c stuff was added over two years ago.

A 'make clean' before 'make' will resolve the issue for the existing
1.10 package.

 A wild guess would be the “touch” added to configure leading to an
 up-to-date target. Also, I'm not sure it's a good idea to ship
 sdksyms.c in the tarball? (It was shipped already in rc3 and before,
 but that didn't lead to any issues.)

I read through the automake docs and they suggest placing a dependency
on the generated configuration header file. We've got several, but
there's the auto-generated do-not-use-config.h which holds all of the
cpp defines which sdksyms.c may use.

I think this is what we want:

diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 7f386cc..0e5b304 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -12,18 +12,21 @@ EXTRA_DIST = \
loaderProcs.h \
sdksyms.sh
 
+nodist_libloader_la_SOURCES = \
+   sdksyms.c
+
 libloader_la_SOURCES = \
loader.c \
loaderProcs.h \
loadext.c \
 loadmod.c \
-   os.c \
-   sdksyms.c
+   os.c
+
 libloader_la_LIBADD = $(DLOPEN_LIBS)
 
 CLEANFILES = sdksyms.c sdksyms.dep
 
-sdksyms.dep sdksyms.c: sdksyms.sh
+sdksyms.dep sdksyms.c: sdksyms.sh $(top_builddir)/include/do-not-use-config.h
CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) 
$(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
 
 SDKSYMS_DEP = sdksyms.dep

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


pgpODS5BKG9eO.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] Server build fixes

2011-02-26 Thread Dan Nicholson
On Sat, Feb 26, 2011 at 6:33 AM, Cyril Brulebois k...@debian.org wrote:
 Hi,

 Keith Packard kei...@keithp.com (25/02/2011):
 On Fri, 25 Feb 2011 06:43:58 -0800, Dan Nicholson dbn.li...@gmail.com 
 wrote:

  Dan Nicholson (2):
        xfree86: Allow sdksyms.dep to be included portably
        dmx: Construct paths in doxygen.conf to fix VPATH builds

 Merged.
    780a77a..6b951de  master - master

 I fear that the sdksyms part is broken. If one builds with some
 options different than the ones used to generate the tarball, the file
 isn't generated again, leading to such issues.

 Example:
 |   CC     sdksyms.lo
 | ../../../../hw/xfree86/loader/sdksyms.c:416: error: 'AugmentSelf' 
 undeclared here (not in a function)
 | ../../../../hw/xfree86/loader/sdksyms.c:417: error: 
 'RegisterAuthorizations' undeclared here (not in a function)

 if xdcmp is disabled, since in include/os.h we have:
 | #if XDMCP
 | extern _X_EXPORT void AugmentSelf(pointer /*from*/, int /*len*/);
 | extern _X_EXPORT void RegisterAuthorizations(void);
 | #endif

 A wild guess would be the “touch” added to configure leading to an
 up-to-date target. Also, I'm not sure it's a good idea to ship
 sdksyms.c in the tarball? (It was shipped already in rc3 and before,
 but that didn't lead to any issues.)

It should get run every time config.status is run, which is every time
configure runs. So, sdksyms.dep should get updated exactly when the
Makefiles do. I do agree that sdksyms.c shouldn't be shipped in the
tarball, but I think it should work anyway (patch attached).

If you unpack and run configure, that should create a sdksyms.dep
newer than sdksyms.c. Here's what I got after disting a tarball,
unpacking and running configure:

-rw-r--r--. 1 dan dan 213787 Feb 26 08:29 hw/xfree86/loader/sdksyms.c
-rw-r--r--. 1 dan dan  0 Feb 26 08:30 hw/xfree86/loader/sdksyms.dep
-rwxr-xr-x. 1 dan dan   7549 Feb 14 17:21 hw/xfree86/loader/sdksyms.sh

And when I run make, sdksyms.sh is run first and then sdksyms.c is
built. Can you check if that's the case on your error? Or, if you
manually run sdksyms.sh again, does the error go away? You may be
right, though. sdksyms.c doesn't explicitly depend on sdksyms.dep, so
if they're both there on the first run, then make may decide to skip
generating them.

--
Dan
From d37506472470436db3c0302ebf01b6082261fd87 Mon Sep 17 00:00:00 2001
From: Dan Nicholson dbn.li...@gmail.com
Date: Sat, 26 Feb 2011 08:34:27 -0800
Subject: [PATCH] xfree86: Don't distribute sdksyms.c

The contents of sdksyms.c are dependent on configuration, so they should
be freshly generated each time and not shipped in the tarball.

Signed-off-by: Dan Nicholson dbn.li...@gmail.com
---
 hw/xfree86/loader/Makefile.am |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 7f386cc..f9cc858 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -17,7 +17,8 @@ libloader_la_SOURCES = \
 	loaderProcs.h \
 	loadext.c \
 loadmod.c \
-	os.c \
+	os.c
+nodist_libloader_la_SOURCES = \
 	sdksyms.c
 libloader_la_LIBADD = $(DLOPEN_LIBS)
 
-- 
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] Server build fixes

2011-02-26 Thread Dan Nicholson
On Sat, Feb 26, 2011 at 10:31 AM, Keith Packard kei...@keithp.com wrote:
 On Sat, 26 Feb 2011 15:33:20 +0100, Cyril Brulebois k...@debian.org wrote:

 I fear that the sdksyms part is broken. If one builds with some
 options different than the ones used to generate the tarball, the file
 isn't generated again, leading to such issues.

 Looks like sdksyms.c should be stuck in nodist_libloader_la_SOURCES so
 that it doesn't get distributed. Nothing has changed here in a long
 time, so I'm a bit confused why this cropped up so soon with 1.10.0;
 the sdksyms.c stuff was added over two years ago.

 A 'make clean' before 'make' will resolve the issue for the existing
 1.10 package.

 A wild guess would be the “touch” added to configure leading to an
 up-to-date target. Also, I'm not sure it's a good idea to ship
 sdksyms.c in the tarball? (It was shipped already in rc3 and before,
 but that didn't lead to any issues.)

 I read through the automake docs and they suggest placing a dependency
 on the generated configuration header file. We've got several, but
 there's the auto-generated do-not-use-config.h which holds all of the
 cpp defines which sdksyms.c may use.

 I think this is what we want:

 diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
 index 7f386cc..0e5b304 100644
 --- a/hw/xfree86/loader/Makefile.am
 +++ b/hw/xfree86/loader/Makefile.am
 @@ -12,18 +12,21 @@ EXTRA_DIST = \
        loaderProcs.h \
        sdksyms.sh

 +nodist_libloader_la_SOURCES = \
 +       sdksyms.c
 +
  libloader_la_SOURCES = \
        loader.c \
        loaderProcs.h \
        loadext.c \
         loadmod.c \
 -       os.c \
 -       sdksyms.c
 +       os.c
 +
  libloader_la_LIBADD = $(DLOPEN_LIBS)

  CLEANFILES = sdksyms.c sdksyms.dep

 -sdksyms.dep sdksyms.c: sdksyms.sh
 +sdksyms.dep sdksyms.c: sdksyms.sh $(top_builddir)/include/do-not-use-config.h
        CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) 
 $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)

  SDKSYMS_DEP = sdksyms.dep

Oh, I didn't see this before I sent. This seems like a useful thing,
but I think there really needs to be a rule that sdksyms.c depends on
sdksyms.dep in case the dep file gets updated out-of-band from running
sdksyms.sh. nodisting the file will probably be good enough, but your
patch can't hurt.

Reviewed-by: Dan Nicholson dbn.li...@gmail.com

--
Dan
___
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] Delete RegionClipSpans()

2011-02-26 Thread Søren Sandmann
From: Søren Sandmann Pedersen s...@redhat.com

Nothing uses it.

Signed-off-by: Soren Sandmann s...@redhat.com
---
 dix/region.c|  234 ---
 include/regionstr.h |   10 --
 2 files changed, 0 insertions(+), 244 deletions(-)

diff --git a/dix/region.c b/dix/region.c
index 5ba3457..6820c1e 100644
--- a/dix/region.c
+++ b/dix/region.c
@@ -1423,237 +1423,3 @@ RegionFromRects(int nrects, xRectangle *prect, int 
ctype)
 }
 return pRgn;
 }
-
-#define ExchangeSpans(a, b)\
-{  \
-DDXPointRectpt;\
-inttw; \
-   \
-tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt;\
-tw = widths[a]; widths[a] = widths[b]; widths[b] = tw;  \
-}
-
-/* ||| I should apply the merge sort code to rectangle sorting above, and see
-   if mapping time can be improved.  But right now I've been at work 12 hours,
-   so forget it.
-*/
-
-static void QuickSortSpans(
-DDXPointRec spans[],
-intwidths[],
-intnumSpans)
-{
-inty;
-inti, j, m;
-DDXPointPtrr;
-
-/* Always called with numSpans  1 */
-/* Sorts only by y, doesn't bother to sort by x */
-
-do
-{
-   if (numSpans  9)
-   {
-   /* Do insertion sort */
-   int yprev;
-
-   yprev = spans[0].y;
-   i = 1;
-   do
-   { /* while i != numSpans */
-   y = spans[i].y;
-   if (yprev  y)
-   {
-   /* spans[i] is out of order.  Move into proper location. */
-   DDXPointRec tpt;
-   int tw, k;
-
-   for (j = 0; y = spans[j].y; j++) {}
-   tpt = spans[i];
-   tw  = widths[i];
-   for (k = i; k != j; k--)
-   {
-   spans[k] = spans[k-1];
-   widths[k] = widths[k-1];
-   }
-   spans[j] = tpt;
-   widths[j] = tw;
-   y = spans[i].y;
-   } /* if out of order */
-   yprev = y;
-   i++;
-   } while (i != numSpans);
-   return;
-   }
-
-   /* Choose partition element, stick in location 0 */
-   m = numSpans / 2;
-   if (spans[m].y  spans[0].y)ExchangeSpans(m, 0);
-   if (spans[m].y  spans[numSpans-1].y)   ExchangeSpans(m, numSpans-1);
-   if (spans[m].y  spans[0].y)ExchangeSpans(m, 0);
-   y = spans[0].y;
-
-/* Partition array */
-i = 0;
-j = numSpans;
-do
-   {
-   r = (spans[i]);
-   do
-   {
-   r++;
-   i++;
-} while (i != numSpans  r-y  y);
-   r = (spans[j]);
-   do
-   {
-   r--;
-   j--;
-} while (y  r-y);
-if (i  j)
-   ExchangeSpans(i, j);
-} while (i  j);
-
-/* Move partition element back to middle */
-ExchangeSpans(0, j);
-
-   /* Recurse */
-if (numSpans-j-1  1)
-   QuickSortSpans(spans[j+1], widths[j+1], numSpans-j-1);
-numSpans = j;
-} while (numSpans  1);
-}
-
-#define NextBand() \
-{  \
-clipy1 = pboxBandStart-y1;\
-clipy2 = pboxBandStart-y2;\
-pboxBandEnd = pboxBandStart + 1;   \
-while (pboxBandEnd != pboxLast  pboxBandEnd-y1 == clipy1) {  \
-   pboxBandEnd++;  \
-}  \
-for (; ppt != pptLast  ppt-y  clipy1; ppt++, pwidth++) {} \
-}
-
-/*
-Clip a list of scanlines to a region.  The caller has allocated the
-space.  FSorted is non-zero if the scanline origins are in ascending
-order.
-returns the number of new, clipped scanlines.
-*/
-
-int
-RegionClipSpans(
-RegionPtr  prgnDst,
-DDXPointPtr ppt,
-int*pwidth,
-intnspans,
-DDXPointPtrpptNew,
-int*pwidthNew,
-intfSorted)
-{
-DDXPointPtr pptLast;
-int*pwidthNewStart;/* the vengeance of Xerox! */
-inty, x1, x2;
-intnumRects;
-
-good(prgnDst);
-pptLast = ppt + nspans;
-pwidthNewStart = pwidthNew;
-
-if (!prgnDst-data)
-{
-   /* Do special fast code with clip boundaries in registers(?) */
-   /* It doesn't pay much to make use of fSorted 

[PATCH 1/3] Absorb miTriFan() into CompositeTriFan()

2011-02-26 Thread Søren Sandmann
From: Søren Sandmann Pedersen s...@redhat.com

There is no need to virtualize this function that nobody cares about.
---
 render/mitri.c   |   21 -
 render/picture.c |   23 +++
 2 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/render/mitri.c b/render/mitri.c
index b258c21..c74192c 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -108,25 +108,4 @@ miTriFan (CARD8op,
  int   npoint,
  xPointFixed   *points)
 {
-ScreenPtr  pScreen = pDst-pDrawable-pScreen;
-PictureScreenPtrps = GetPictureScreen(pScreen);
-xTriangle  *tris, *tri;
-xPointFixed*first;
-intntri;
-
-if (npoint  3)
-   return;
-ntri = npoint - 2;
-tris = malloc(ntri * sizeof (xTriangle));
-if (!tris)
-   return;
-first = points++;
-for (tri = tris; npoint = 3; npoint--, points++, tri++)
-{
-   tri-p1 = *first;
-   tri-p2 = points[0];
-   tri-p3 = points[1];
-}
-(*ps-Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
-free(tris);
 }
diff --git a/render/picture.c b/render/picture.c
index 0028cc7..e16163a 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1790,11 +1790,26 @@ CompositeTriFan (CARD8  op,
 intnpoints,
 xPointFixed*points)
 {
-PictureScreenPtr   ps = GetPictureScreen(pDst-pDrawable-pScreen);
+ScreenPtr  pScreen = pDst-pDrawable-pScreen;
+xTriangle  *tris, *tri;
+xPointFixed*first;
+intntri;
 
-ValidatePicture (pSrc);
-ValidatePicture (pDst);
-(*ps-TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
+if (npoints  3)
+   return;
+ntri = npoints - 2;
+tris = malloc(ntri * sizeof (xTriangle));
+if (!tris)
+   return;
+first = points++;
+for (tri = tris; npoints = 3; npoints--, points++, tri++)
+{
+   tri-p1 = *first;
+   tri-p2 = points[0];
+   tri-p3 = points[1];
+}
+CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+free(tris);
 }
 
 void
-- 
1.6.0.6

___
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 2/3] Absorb miTriStrip() into CompositeTriStrip()

2011-02-26 Thread Søren Sandmann
From: Søren Sandmann Pedersen s...@redhat.com

There is no need to virtualize this function that nobody cares about.
---
 render/mitri.c   |   19 ---
 render/picture.c |   22 ++
 2 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/render/mitri.c b/render/mitri.c
index c74192c..2ca7cc4 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -77,25 +77,6 @@ miTriStrip (CARD8op,
int npoint,
xPointFixed *points)
 {
-ScreenPtr  pScreen = pDst-pDrawable-pScreen;
-PictureScreenPtrps = GetPictureScreen(pScreen);
-xTriangle  *tris, *tri;
-intntri;
-
-if (npoint  3)
-   return;
-ntri = npoint - 2;
-tris = malloc(ntri * sizeof (xTriangle));
-if (!tris)
-   return;
-for (tri = tris; npoint = 3; npoint--, points++, tri++)
-{
-   tri-p1 = points[0];
-   tri-p2 = points[1];
-   tri-p3 = points[2];
-}
-(*ps-Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
-free(tris);
 }
 
 void
diff --git a/render/picture.c b/render/picture.c
index e16163a..015d633 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1773,11 +1773,25 @@ CompositeTriStrip (CARD8op,
   int  npoints,
   xPointFixed  *points)
 {
-PictureScreenPtr   ps = GetPictureScreen(pDst-pDrawable-pScreen);
+ScreenPtr   pScreen = pDst-pDrawable-pScreen;
+PictureScreenPtrps = GetPictureScreen(pScreen);
+xTriangle   *tris, *tri;
+int ntri;
 
-ValidatePicture (pSrc);
-ValidatePicture (pDst);
-(*ps-TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
+if (npoints  3)
+return;
+ntri = npoints - 2;
+tris = malloc(ntri * sizeof (xTriangle));
+if (!tris)
+return;
+for (tri = tris; npoints = 3; npoints--, points++, tri++)
+{
+tri-p1 = points[0];
+tri-p2 = points[1];
+tri-p3 = points[2];
+}
+CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+free(tris);
 }
 
 void
-- 
1.6.0.6

___
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 0/3] Delete some triangle related code

2011-02-26 Thread Søren Sandmann

The following patches absorb the miTriFan() and miTriStrip() functions
into CompositeTriFan() and CompositeTriStrip() respectively, and then
delete the TriStrip and TriFan hooks from PictureScreen.

None of the open source drivers have ever used these hooks, so there
is no point maintaining them.


Soren

 b/hw/dmx/dmx.h |2 -
 b/hw/dmx/dmxpict.c |   87 -
 b/hw/dmx/dmxpict.h |   10 -
 b/miext/cw/cw.h|2 -
 b/miext/cw/cw_render.c |   64 
 b/render/mipict.c  |2 -
 b/render/mipict.h  |   20 ---
 b/render/mitri.c   |   21 ---
 b/render/picture.c |   24 ++---
 b/render/picturestr.h  |3 -
 render/mitri.c |   43 
 render/picture.c   |   23 ++--
___
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 synaptics 1/8] United functions of SynapticsDefaultDimensions() and ReadDevDimensions()

2011-02-26 Thread Alexandr Shadchin
There is no point doing the same thing in different places

Signed-off-by: Alexandr Shadchin alexandr.shadc...@gmail.com
---
 src/alpscomm.c |2 +-
 src/ps2comm.c  |2 +-
 src/psmcomm.c  |2 +-
 src/synaptics.c|   96 ---
 src/synapticsstr.h |3 --
 5 files changed, 41 insertions(+), 64 deletions(-)

diff --git a/src/alpscomm.c b/src/alpscomm.c
index 84d2136..c5af681 100644
--- a/src/alpscomm.c
+++ b/src/alpscomm.c
@@ -233,5 +233,5 @@ struct SynapticsProtocolOperations alps_proto_operations = {
 ALPSQueryHardware,
 ALPSReadHwState,
 ALPSAutoDevProbe,
-SynapticsDefaultDimensions
+NULL
 };
diff --git a/src/ps2comm.c b/src/ps2comm.c
index 4e372b3..a34613e 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -672,5 +672,5 @@ struct SynapticsProtocolOperations psaux_proto_operations = 
{
 PS2QueryHardware,
 PS2ReadHwState,
 PS2AutoDevProbe,
-SynapticsDefaultDimensions
+NULL
 };
diff --git a/src/psmcomm.c b/src/psmcomm.c
index 741cd1d..903e6dd 100644
--- a/src/psmcomm.c
+++ b/src/psmcomm.c
@@ -181,5 +181,5 @@ struct SynapticsProtocolOperations psm_proto_operations = {
 PSMQueryHardware,
 PSMReadHwState,
 PSMAutoDevProbe,
-SynapticsDefaultDimensions
+NULL
 };
diff --git a/src/synaptics.c b/src/synaptics.c
index 56ce725..daa0542 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -174,63 +174,6 @@ _X_EXPORT XF86ModuleData synapticsModuleData = {
 /*
  * Function Definitions
  /
-/**
- * Fill in default dimensions for backends that cannot query the hardware.
- * Eventually, we want the edges to be 1900/5400 for x, 1900/4000 for y.
- * These values are based so that calculate_edge_widths() will give us the
- * right values.
- *
- * The default values 1900, etc. come from the dawn of time, when men where
- * men, or possibly apes.
- */
-void
-SynapticsDefaultDimensions(InputInfoPtr pInfo)
-{
-SynapticsPrivate *priv = (SynapticsPrivate *)pInfo-private;
-
-if (priv-minx = priv-maxx)
-{
-   priv-minx = 1615;
-   priv-maxx = 5685;
-   priv-resx = 0;
-
-   xf86Msg(X_PROBED,
-   %s: invalid x-axis range.  defaulting to %d - %d\n,
-   pInfo-name, priv-minx, priv-maxx);
-}
-
-if (priv-miny = priv-maxy)
-{
-   priv-miny = 1729;
-   priv-maxy = 4171;
-   priv-resx = 0;
-
-   xf86Msg(X_PROBED,
-   %s: invalid y-axis range.  defaulting to %d - %d\n,
-   pInfo-name, priv-miny, priv-maxy);
-}
-
-if (priv-minp = priv-maxp)
-{
-   priv-minp = 0;
-   priv-maxp = 256;
-
-   xf86Msg(X_PROBED,
-   %s: invalid pressure range.  defaulting to %d - %d\n,
-   pInfo-name, priv-minp, priv-maxp);
-}
-
-if (priv-minw = priv-maxw)
-{
-   priv-minw = 0;
-   priv-maxw = 16;
-
-   xf86Msg(X_PROBED,
-   %s: invalid finger width range.  defaulting to %d - %d\n,
-   pInfo-name, priv-minw, priv-maxw);
-}
-}
-
 static void
 SetDeviceAndProtocol(InputInfoPtr pInfo)
 {
@@ -444,7 +387,6 @@ static void set_default_parameters(InputInfoPtr pInfo)
  * If the range was autodetected, apply these edge widths to all four
  * sides.
  */
-SynapticsDefaultDimensions(pInfo);
 
 width = abs(priv-maxx - priv-minx);
 height = abs(priv-maxy - priv-miny);
@@ -2613,6 +2555,44 @@ ReadDevDimensions(InputInfoPtr pInfo)
 
 if (priv-proto_ops-ReadDevDimensions)
priv-proto_ops-ReadDevDimensions(pInfo);
+
+if (priv-minx = priv-maxx) {
+priv-minx = 1615;
+priv-maxx = 5685;
+priv-resx = 0;
+
+xf86Msg(X_PROBED,
+%s: invalid x-axis range.  defaulting to %d - %d\n,
+pInfo-name, priv-minx, priv-maxx);
+}
+
+if (priv-miny = priv-maxy) {
+priv-miny = 1729;
+priv-maxy = 4171;
+priv-resy = 0;
+
+xf86Msg(X_PROBED,
+%s: invalid y-axis range.  defaulting to %d - %d\n,
+pInfo-name, priv-miny, priv-maxy);
+}
+
+if (priv-minp = priv-maxp) {
+priv-minp = 0;
+priv-maxp = 256;
+
+xf86Msg(X_PROBED,
+%s: invalid pressure range.  defaulting to %d - %d\n,
+pInfo-name, priv-minp, priv-maxp);
+}
+
+if (priv-minw = priv-maxw) {
+priv-minw = 0;
+priv-maxw = 16;
+
+xf86Msg(X_PROBED,
+%s: invalid finger width range.  defaulting to %d - %d\n,
+pInfo-name, priv-minw, priv-maxw);
+}
 }
 
 static Bool
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 066b3f3..8f6593e 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -243,7 +243,4 @@ typedef struct _SynapticsPrivateRec
 enum TouchpadModel model;  

[PATCH synaptics 2/8] Removing extra call SetDeviceAndProtocol()

2011-02-26 Thread Alexandr Shadchin
SetDeviceAndProtocol() calling in SynapticsPreInit(), extra calling
in DeviceOn() unnecessary.

Signed-off-by: Alexandr Shadchin alexandr.shadc...@gmail.com
---
 src/synaptics.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/synaptics.c b/src/synaptics.c
index daa0542..b1d027f 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -786,7 +786,6 @@ DeviceOn(DeviceIntPtr dev)
 
 DBG(3, Synaptics DeviceOn called\n);
 
-SetDeviceAndProtocol(pInfo);
 pInfo-fd = xf86OpenSerial(pInfo-options);
 if (pInfo-fd == -1) {
xf86Msg(X_WARNING, %s: cannot open input device\n, pInfo-name);
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH synaptics 4/8] Move definition struct SynapticsHwInfo in ps2comm.h

2011-02-26 Thread Alexandr Shadchin
Signed-off-by: Alexandr Shadchin alexandr.shadc...@gmail.com
---
 src/ps2comm.c  |7 ---
 src/ps2comm.h  |8 ++--
 src/psmcomm.c  |7 ---
 src/synproto.h |1 -
 4 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/ps2comm.c b/src/ps2comm.c
index a34613e..1ea09c9 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -82,13 +82,6 @@
 #define PS2DBG(x)
 #endif
 
-struct SynapticsHwInfo {
-unsigned int model_id; /* Model-ID */
-unsigned int capabilities; /* Capabilities */
-unsigned int ext_cap;  /* Extended Capabilities */
-unsigned int identity; /* Identification */
-};
-
 /*
  * PS/2 Utility functions.
  * Many parts adapted from tpconfig.c by C. Scott Ananian
diff --git a/src/ps2comm.h b/src/ps2comm.h
index fec5634..99ff3ec 100644
--- a/src/ps2comm.h
+++ b/src/ps2comm.h
@@ -94,10 +94,14 @@
 
 typedef unsigned char byte;
 
+struct SynapticsHwInfo {
+unsigned int model_id; /* Model-ID */
+unsigned int capabilities; /* Capabilities */
+unsigned int ext_cap;  /* Extended Capabilities */
+unsigned int identity; /* Identification */
+};
 
 Bool ps2_putbyte(int fd, byte b);
-
-struct SynapticsHwInfo;
 void ps2_print_ident(const struct SynapticsHwInfo *synhw);
 
 #endif /* _PS2COMM_H_ */
diff --git a/src/psmcomm.c b/src/psmcomm.c
index 903e6dd..88263ae 100644
--- a/src/psmcomm.c
+++ b/src/psmcomm.c
@@ -52,13 +52,6 @@
 
 #define SYSCALL(call) while (((call) == -1)  (errno == EINTR))
 
-struct SynapticsHwInfo {
-unsigned int model_id; /* Model-ID */
-unsigned int capabilities; /* Capabilities */
-unsigned int ext_cap;  /* Extended Capabilities */
-unsigned int identity; /* Identification */
-};
-
 /*
  * Identify Touchpad
  * See also the SYN_ID_* macros
diff --git a/src/synproto.h b/src/synproto.h
index 96ddf3e..a899a73 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -79,7 +79,6 @@ enum SynapticsProtocol {
 };
 
 struct _SynapticsParameters;
-struct SynapticsHwInfo;
 struct CommData;
 
 struct SynapticsProtocolOperations {
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH synaptics 6/8] Remove extra definition CommData

2011-02-26 Thread Alexandr Shadchin
Signed-off-by: Alexandr Shadchin alexandr.shadc...@gmail.com
---
 src/synproto.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/synproto.h b/src/synproto.h
index 3fe70b9..4b37df0 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -79,7 +79,6 @@ enum SynapticsProtocol {
 };
 
 struct _SynapticsParameters;
-struct CommData;
 
 struct SynapticsProtocolOperations {
 void (*DeviceOnHook)(InputInfoPtr pInfo, struct _SynapticsParameters 
*para);
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH synaptics 7/8] Rewrite mechanisn detect Protocol and Device

2011-02-26 Thread Alexandr Shadchin
It is now easier to add new backends

Signed-off-by: Alexandr Shadchin alexandr.shadc...@gmail.com
---
 src/alpscomm.c  |8 +-
 src/ps2comm.c   |8 +-
 src/psmcomm.c   |7 +
 src/synaptics.c |   80 ---
 src/synproto.h  |   16 +++---
 5 files changed, 37 insertions(+), 82 deletions(-)

diff --git a/src/alpscomm.c b/src/alpscomm.c
index 3872f5c..dc76655 100644
--- a/src/alpscomm.c
+++ b/src/alpscomm.c
@@ -220,17 +220,11 @@ ALPSReadHwState(InputInfoPtr pInfo,
 return TRUE;
 }
 
-static Bool
-ALPSAutoDevProbe(InputInfoPtr pInfo)
-{
-return FALSE;
-}
-
 struct SynapticsProtocolOperations alps_proto_operations = {
 NULL,
 NULL,
 ALPSQueryHardware,
 ALPSReadHwState,
-ALPSAutoDevProbe,
+NULL,
 NULL
 };
diff --git a/src/ps2comm.c b/src/ps2comm.c
index b676ddc..92665c8 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -660,17 +660,11 @@ PS2ReadHwState(InputInfoPtr pInfo,
 return PS2ReadHwStatePriv(pInfo, psaux_proto_operations, comm, hwRet);
 }
 
-static Bool
-PS2AutoDevProbe(InputInfoPtr pInfo)
-{
-return FALSE;
-}
-
 struct SynapticsProtocolOperations psaux_proto_operations = {
 NULL,
 PS2DeviceOffHook,
 PS2QueryHardware,
 PS2ReadHwState,
-PS2AutoDevProbe,
+NULL,
 NULL
 };
diff --git a/src/psmcomm.c b/src/psmcomm.c
index ea8cf88..8d633bd 100644
--- a/src/psmcomm.c
+++ b/src/psmcomm.c
@@ -162,16 +162,11 @@ PSMReadHwState(InputInfoPtr pInfo,
 return PS2ReadHwStatePriv(pInfo, psm_proto_operations, comm, hwRet);
 }
 
-static Bool PSMAutoDevProbe(InputInfoPtr pInfo)
-{
-return FALSE;
-}
-
 struct SynapticsProtocolOperations psm_proto_operations = {
 NULL,
 NULL,
 PSMQueryHardware,
 PSMReadHwState,
-PSMAutoDevProbe,
+NULL,
 NULL
 };
diff --git a/src/synaptics.c b/src/synaptics.c
index 1a559a2..8819798 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -135,6 +135,18 @@ void InitDeviceProperties(InputInfoPtr pInfo);
 int SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
 BOOL checkonly);
 
+const static SynapticsProtocolRec protocols[] = {
+{psaux, psaux_proto_operations},
+{alps, alps_proto_operations},
+#ifdef BUILD_PSMCOMM
+{psm, psm_proto_operations},
+#endif
+#ifdef BUILD_EVENTCOMM
+{event, event_proto_operations},
+#endif
+{NULL, NULL}
+};
+
 InputDriverRec SYNAPTICS = {
 1,
 synaptics,
@@ -177,61 +189,23 @@ _X_EXPORT XF86ModuleData synapticsModuleData = {
 static void
 SetDeviceAndProtocol(InputInfoPtr pInfo)
 {
-char *str_par, *device;
 SynapticsPrivate *priv = pInfo-private;
-enum SynapticsProtocol proto = SYN_PROTO_PSAUX;
+char *proto, *device;
+int i;
 
+proto = xf86SetStrOption(pInfo-options, Protocol, NULL);
 device = xf86SetStrOption(pInfo-options, Device, NULL);
-if (!device) {
-   device = xf86SetStrOption(pInfo-options, Path, NULL);
-   if (device) {
-   pInfo-options =
-   xf86ReplaceStrOption(pInfo-options, Device, device);
-   }
-}
-if (device  strstr(device, /dev/input/event)) {
-#ifdef BUILD_EVENTCOMM
-   proto = SYN_PROTO_EVENT;
-#endif
-} else {
-   str_par = xf86FindOptionValue(pInfo-options, Protocol);
-   if (str_par  !strcmp(str_par, psaux)) {
-   /* Already set up */
-#ifdef BUILD_EVENTCOMM
-   } else if (str_par  !strcmp(str_par, event)) {
-   proto = SYN_PROTO_EVENT;
-#endif /* BUILD_EVENTCOMM */
-#ifdef BUILD_PSMCOMM
-   } else if (str_par  !strcmp(str_par, psm)) {
-   proto = SYN_PROTO_PSM;
-#endif /* BUILD_PSMCOMM */
-   } else if (str_par  !strcmp(str_par, alps)) {
-   proto = SYN_PROTO_ALPS;
-   } else { /* default to auto-dev */
-#ifdef BUILD_EVENTCOMM
-   if (!device  event_proto_operations.AutoDevProbe(pInfo))
-   proto = SYN_PROTO_EVENT;
-#endif
-   }
-}
-switch (proto) {
-case SYN_PROTO_PSAUX:
-   priv-proto_ops = psaux_proto_operations;
-   break;
-#ifdef BUILD_EVENTCOMM
-case SYN_PROTO_EVENT:
-   priv-proto_ops = event_proto_operations;
-   break;
-#endif /* BUILD_EVENTCOMM */
-#ifdef BUILD_PSMCOMM
-case SYN_PROTO_PSM:
-   priv-proto_ops = psm_proto_operations;
-   break;
-#endif /* BUILD_PSMCOMM */
-case SYN_PROTO_ALPS:
-   priv-proto_ops = alps_proto_operations;
-   break;
+for (i = 0; protocols[i].name; i++) {
+if (proto  device  !strcmp(proto, protocols[i].name))
+break;
+if (protocols[i].proto_ops-AutoDevProbe 
+protocols[i].proto_ops-AutoDevProbe(pInfo))
+break;
 }
+free(proto);
+free(device);
+
+priv-proto_ops = protocols[i].proto_ops;
 }
 
 /*
@@ -656,6 +630,10 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, 
int flags)
 
 /* may change pInfo-options */
 SetDeviceAndProtocol(pInfo);
+if (priv-proto_ops == NULL) {
+   

[PATCH synaptics 8/8] Now ps2comm and alpscomm backend optional

2011-02-26 Thread Alexandr Shadchin
Signed-off-by: Alexandr Shadchin alexandr.shadc...@gmail.com
---
OpenBSD don't support this backends. Backend for OpenBSD I'll add later.

 configure.ac|   20 +++-
 src/Makefile.am |8 ++--
 src/synaptics.c |2 ++
 src/synproto.h  |5 +++--
 4 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index ea66935..edfc4e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,21 +98,31 @@ AM_CONDITIONAL(DEBUG, [test x$DEBUGGING = xyes])
 AC_MSG_CHECKING([which optional backends will be build])
 case ${host} in
 *linux*)
-   AC_MSG_RESULT([eventcomm])
+   AC_MSG_RESULT([ps2comm alpscomm eventcomm])
+   BUILD_PS2COMM=yes
BUILD_EVENTCOMM=yes
-   AC_DEFINE(BUILD_EVENTCOMM, 1, [Optional backend eventcomm enabled])
;;
-*freebsd* | *openbsd* | *netbsd* | *dragonfly*)
-   AC_MSG_RESULT([psmcomm])
+*freebsd* | *netbsd* | *dragonfly*)
+   AC_MSG_RESULT([ps2comm alpscomm psmcomm])
+   BUILD_PS2COMM=yes
BUILD_PSMCOMM=yes
-   AC_DEFINE(BUILD_PSMCOMM, 1, [Optional backend psmcomm enabled])
;;
 *)
AC_MSG_RESULT([none])
;;
 esac
+if test x$BUILD_EVENTCOMM = xyes; then
+AC_DEFINE(BUILD_EVENTCOMM, 1, [Optional backend eventcomm enabled])
+fi
+if test x$BUILD_PSMCOMM = xyes; then
+AC_DEFINE(BUILD_PSMCOMM, 1, [Optional backend psmcomm enabled])
+fi
+if test x$BUILD_PS2COMM = xyes; then
+AC_DEFINE(BUILD_PS2COMM, 1, [Optional backend ps2comm and alpscomm 
enabled])
+fi
 AM_CONDITIONAL([BUILD_EVENTCOMM], [test x${BUILD_EVENTCOMM} = xyes])
 AM_CONDITIONAL([BUILD_PSMCOMM], [test x${BUILD_PSMCOMM} = xyes])
+AM_CONDITIONAL([BUILD_PS2COMM], [test x${BUILD_PS2COMM} = xyes])
 
 # -
 #  Dependencies for synclient and syndaemon
diff --git a/src/Makefile.am b/src/Makefile.am
index 0637445..ff513f1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -32,11 +32,15 @@ AM_CPPFLAGS = -I$(top_srcdir)/include
 AM_CFLAGS = $(XORG_CFLAGS)
 
 @DRIVER_NAME@_drv_la_SOURCES = @DRIVER_NAME@.c synapticsstr.h \
-   alpscomm.c \
-   ps2comm.c ps2comm.h \
synproto.h \
properties.c
 
+if BUILD_PS2COMM
+@DRIVER_NAME@_drv_la_SOURCES += \
+   alpscomm.c \
+   ps2comm.c ps2comm.h
+endif
+
 if BUILD_EVENTCOMM
 @DRIVER_NAME@_drv_la_SOURCES += \
eventcomm.c eventcomm.h
diff --git a/src/synaptics.c b/src/synaptics.c
index 8819798..3b6e63b 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -136,8 +136,10 @@ int SetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
 BOOL checkonly);
 
 const static SynapticsProtocolRec protocols[] = {
+#ifdef BUILD_PS2COMM
 {psaux, psaux_proto_operations},
 {alps, alps_proto_operations},
+#endif
 #ifdef BUILD_PSMCOMM
 {psm, psm_proto_operations},
 #endif
diff --git a/src/synproto.h b/src/synproto.h
index 9c25428..700cf7a 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -84,14 +84,15 @@ typedef struct {
 struct SynapticsProtocolOperations *proto_ops;
 } SynapticsProtocolRec;
 
+#ifdef BUILD_PS2COMM
 extern struct SynapticsProtocolOperations psaux_proto_operations;
+extern struct SynapticsProtocolOperations alps_proto_operations;
+#endif /* BUILD_PS2COMM */
 #ifdef BUILD_EVENTCOMM
 extern struct SynapticsProtocolOperations event_proto_operations;
 #endif /* BUILD_EVENTCOMM */
 #ifdef BUILD_PSMCOMM
 extern struct SynapticsProtocolOperations psm_proto_operations;
 #endif /* BUILD_PSMCOMM */
-extern struct SynapticsProtocolOperations alps_proto_operations;
-
 
 #endif /* _SYNPROTO_H_ */
-- 
1.7.3.5

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PULL] Server build fixes

2011-02-26 Thread Cyril Brulebois
Dan Nicholson dbn.li...@gmail.com (26/02/2011):
 And when I run make, sdksyms.sh is run first and then sdksyms.c is
 built. Can you check if that's the case on your error? Or, if you
 manually run sdksyms.sh again, does the error go away? You may be
 right, though. sdksyms.c doesn't explicitly depend on sdksyms.dep,
 so if they're both there on the first run, then make may decide to
 skip generating them.

Here's what I get:

* after tar xf on 1.10.0's tarball:
$ find -name 'sdksym*' -ls
10352198 -rwxr-xr-x   1 cyrilcyril7549 Dec 20 09:48 
./hw/xfree86/loader/sdksyms.sh
1035228  216 -rw-r--r--   1 cyrilcyril  213889 Feb 26 06:14 
./hw/xfree86/loader/sdksyms.c

* after configure --disable-xv
$ find -name 'sdksym*' -ls
10352198 -rwxr-xr-x   1 cyrilcyril7549 Dec 20 09:48 
./hw/xfree86/loader/sdksyms.sh
12375154 -rw-r--r--   1 cyrilcyril   8 Feb 27 02:13 
./hw/xfree86/loader/.deps/sdksyms.Plo
10354680 -rw-r--r--   1 cyrilcyril   0 Feb 27 02:13 
./hw/xfree86/loader/sdksyms.dep
1035228  216 -rw-r--r--   1 cyrilcyril  213889 Feb 26 06:14 
./hw/xfree86/loader/sdksyms.c

* after make breaks:
$ find -name 'sdksym*' -ls
10352198 -rwxr-xr-x   1 cyrilcyril7549 Dec 20 09:48 
./hw/xfree86/loader/sdksyms.sh
1237514   20 -rw-r--r--   1 cyrilcyril   19021 Feb 27 02:22 
./hw/xfree86/loader/.deps/sdksyms.Tpo
12375154 -rw-r--r--   1 cyrilcyril   8 Feb 27 02:13 
./hw/xfree86/loader/.deps/sdksyms.Plo
10354680 -rw-r--r--   1 cyrilcyril   0 Feb 27 02:13 
./hw/xfree86/loader/sdksyms.dep
1035228  216 -rw-r--r--   1 cyrilcyril  213889 Feb 26 06:14 
./hw/xfree86/loader/sdksyms.c

Will give your patch a try later, probably “tomorrow”.

KiBi.


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] Server build fixes

2011-02-26 Thread Cyril Brulebois
Hi,

Keith Packard kei...@keithp.com (26/02/2011):
 I read through the automake docs and they suggest placing a
 dependency on the generated configuration header file. We've got
 several, but there's the auto-generated do-not-use-config.h which
 holds all of the cpp defines which sdksyms.c may use.
 
 I think this is what we want: […]

at least, this fixes the issue I was having. Steps to reproduce:
  git checkout master
  git clean -xdf
  autoreconf -vfi
  ./configure
  make dist
  # elsewhere
  tar xf $tarball
  cd $directory
  ./configure --disable-xv

With master → fails, master + your patch → works. Accordingly:

Tested-by: Cyril Brulebois k...@debian.org

Also, the generated sdksyms.c lands in the build directory, meaning
one can happily do stuff like:
  mkdir build1 build2
  (cd build1  ../configure --disable-stuff)
  (cd build2  ../configure --enable-stuff)
  make -C build1
  make -C build2

And even “make” build1 and build2 in parallel.

(FYI, that's what we do in Debian: we build two flavours; one regular,
one for the debian-installer; with a configuration phase, then a build
phase; hence my issues with --disable-xv and the like. ;))

Thanks.

KiBi.


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

xextproto 7.2.0?

2011-02-26 Thread Keith Packard

Does anyone already have plans to release xextproto version 7.2.0? X
server 1.10 needs something with the sync fence requests in it.

I don't see any obvious bugs pending in bugzilla that would prevent a
release of this module; anyone know different?

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


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