[PATCH:xwininfo] When matching window names, ensure name lengths match too

2011-06-08 Thread Alan Coopersmith
Prevents strncmp returning on partial matches when one is shorter.
https://bugs.freedesktop.org/show_bug.cgi?id=37710

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
---
 dsimple.c |   16 ++--
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/dsimple.c b/dsimple.c
index a9b8678..150f9db 100644
--- a/dsimple.c
+++ b/dsimple.c
@@ -253,7 +253,8 @@ recursive_Window_With_Name  (
 xcb_connection_t *dpy,
 xcb_window_t window,
 struct wininfo_cookies *cookies,
-const char *name)
+const char *name,
+size_t namelen)
 {
 xcb_window_t *children;
 unsigned int nchildren;
@@ -273,7 +274,8 @@ recursive_Window_With_Name  (
int prop_name_len = xcb_get_property_value_length (prop);
 
/* can't use strcmp, since prop.name is not null terminated */
-   if (strncmp (prop_name, name, prop_name_len) == 0) {
+   if ((namelen == prop_name_len) 
+   memcmp (prop_name, name, namelen) == 0) {
w = window;
}
}
@@ -294,7 +296,8 @@ recursive_Window_With_Name  (
if (xcb_get_wm_name_reply (dpy, cookies-get_wm_name,
   nameprop, err)) {
/* can't use strcmp, since nameprop.name is not null terminated */
-   if (strncmp (nameprop.name, name, nameprop.name_len) == 0) {
+   if ((namelen == nameprop.name_len) 
+   memcmp (nameprop.name, name, namelen) == 0) {
w = window;
}
 
@@ -309,7 +312,8 @@ recursive_Window_With_Name  (
int prop_name_len = xcb_get_property_value_length (prop);
 
/* can't use strcmp, since prop.name is not null terminated */
-   if (strncmp (prop_name, name, prop_name_len) == 0) {
+   if ((namelen == prop_name_len) 
+   memcmp (prop_name, name, namelen) == 0) {
w = window;
}
}
@@ -354,7 +358,7 @@ recursive_Window_With_Name  (
 
 for (i = 0; i  nchildren; i++) {
w = recursive_Window_With_Name (dpy, children[i],
-   child_cookies[i], name);
+   child_cookies[i], name, namelen);
if (w)
break;
 }
@@ -392,7 +396,7 @@ Window_With_Name (
 cookies.get_wm_name = xcb_get_wm_name (dpy, top);
 cookies.query_tree = xcb_query_tree (dpy, top);
 xcb_flush (dpy);
-return recursive_Window_With_Name(dpy, top, cookies, name);
+return recursive_Window_With_Name(dpy, top, cookies, name, strlen(name));
 }
 
 
-- 
1.7.3.2

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


[PATCH:xkbcomp] Replace repeated checks for gcc with _X_ATTRIBUTE_PRINTF from xproto

2011-06-08 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
---
 utils.h |   63 +--
 1 files changed, 9 insertions(+), 54 deletions(-)

diff --git a/utils.h b/utils.h
index 65e37c8..61a5987 100644
--- a/utils.h
+++ b/utils.h
@@ -115,12 +115,7 @@ extern Boolean uSetErrorFile(char * /* name */
 
 extern void
 uInformation(const char * /* s */ , ...
-)
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 6)))
-__attribute__ ((format(printf, 1, 2)))
-#endif
-;
+) _X_ATTRIBUTE_PRINTF(1, 2);
 
 #define ACTION6uAction
 #define ACTION5uAction
@@ -131,12 +126,7 @@ uInformation(const char * /* s */ , ...
 #define ACTION uAction
 
  extern void uAction(const char * /* s  */ , ...
-)
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 6)))
-__attribute__ ((format(printf, 1, 2)))
-#endif
-;
+) _X_ATTRIBUTE_PRINTF(1, 2);
 
 #define WARN6  uWarning
 #define WARN5  uWarning
@@ -147,12 +137,7 @@ uInformation(const char * /* s */ , ...
 #define WARN   uWarning
 
  extern void uWarning(const char * /* s  */ , ...
-)
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 6)))
-__attribute__ ((format(printf, 1, 2)))
-#endif
-;
+) _X_ATTRIBUTE_PRINTF(1, 2);
 
 #define ERROR6 uError
 #define ERROR5 uError
@@ -163,12 +148,7 @@ uInformation(const char * /* s */ , ...
 #define ERROR  uError
 
  extern void uError(const char * /* s  */ , ...
-)
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 6)))
-__attribute__ ((format(printf, 1, 2)))
-#endif
-;
+) _X_ATTRIBUTE_PRINTF(1, 2);
 
 #define FATAL6 uFatalError
 #define FATAL5 uFatalError
@@ -179,12 +159,7 @@ uInformation(const char * /* s */ , ...
 #define FATAL  uFatalError
 
  extern void uFatalError(const char * /* s  */ , ...
-)
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 6)))
-__attribute__ ((format(printf, 1, 2)))
-#endif
-;
+) _X_ATTRIBUTE_PRINTF(1, 2);
 
 /* WSGO stands for Weird Stuff Going On */
 #define WSGO6  uInternalError
@@ -196,12 +171,7 @@ uInformation(const char * /* s */ , ...
 #define WSGO   uInternalError
 
  extern void uInternalError(const char * /* s  */ , ...
-)
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 6)))
-__attribute__ ((format(printf, 1, 2)))
-#endif
-;
+) _X_ATTRIBUTE_PRINTF(1, 2);
 
  extern void uSetPreErrorMessage(char * /* msg */
 );
@@ -262,21 +232,11 @@ extern
  unsigned int DEBUG_VAR;
 
  extern void uDebug(char * /* s  */ , ...
-)
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 6)))
-__attribute__ ((format(printf, 1, 2)))
-#endif
-;
+) _X_ATTRIBUTE_PRINTF(1, 2);
 
  extern void uDebugNOI( /* no indent */
   char * /* s  */ , ...
-)
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 6)))
-__attribute__ ((format(printf, 1, 2)))
-#endif
-;
+) _X_ATTRIBUTE_PRINTF(1, 2);
 
  extern Boolean uSetDebugFile(char *name);
 
@@ -316,12 +276,7 @@ extern
  extern Boolean uSetEntryFile(char *name);
  extern void uEntry(int /* l */ ,
 char * /* s  */ , ...
-)
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 6)))
-__attribute__ ((format(printf, 2, 3)))
-#endif
-;
+) _X_ATTRIBUTE_PRINTF(2, 3);
 
  extern void uExit(int l, char *rtVal);
 #ifdef ENTRY_TRACKING_ON
-- 
1.7.3.2

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


[PATCH:ico] Replace local checks for gcc with _X_NORETURN from xproto 7.0.17

2011-06-08 Thread Alan Coopersmith
Also declare icoFatal as static since it's only used in this one file.

Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
---
 configure.ac |2 +-
 ico.c|9 -
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7a23166..284214a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,7 +36,7 @@ XORG_DEFAULT_OPTIONS
 AC_CONFIG_HEADERS([config.h])
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(ICO, x11 = 0.99.1)
+PKG_CHECK_MODULES(ICO, [x11 = 0.99.1 xproto = 7.0.17])
 
 XTHREADLIB=`$PKG_CONFIG --variable=xthreadlib x11`
 AC_SUBST(XTHREADLIB)
diff --git a/ico.c b/ico.c
index 62a2e73..797aeba 100644
--- a/ico.c
+++ b/ico.c
@@ -254,11 +254,10 @@ static xcondition_rec count_cond;/* Xthreads doesn't 
define an equivalent to
  * Error handling
  */
 
-#if defined(__GNUC__)  \
-((__GNUC__  2) || ((__GNUC__ == 2)  (__GNUC_MINOR__ = 7)))
-void icoFatal (const char *fmt, const char *a0) __attribute__((__noreturn__));
-#endif
-void
+
+static void icoFatal (const char *fmt, const char *a0) _X_NORETURN;
+
+static void
 icoFatal(const char *fmt, const char *a0)
 {
fprintf(stderr, %s: , ProgramName);
-- 
1.7.3.2

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


Re: [PATCH:xwininfo] When matching window names, ensure name lengths match too

2011-06-08 Thread Mark Kettenis
 From: Alan Coopersmith alan.coopersm...@oracle.com
 Date: Tue,  7 Jun 2011 23:13:46 -0700
 
 Prevents strncmp returning on partial matches when one is shorter.
 https://bugs.freedesktop.org/show_bug.cgi?id=37710
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com

Reviewed-by: Mark Kettenis kette...@openbsd.org

  dsimple.c |   16 ++--
  1 files changed, 10 insertions(+), 6 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


Re: [PATCH:xkbcomp] Replace repeated checks for gcc with _X_ATTRIBUTE_PRINTF from xproto

2011-06-08 Thread Mark Kettenis
 From: Alan Coopersmith alan.coopersm...@oracle.com
 Date: Tue,  7 Jun 2011 23:55:25 -0700
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com

Strangely formatted code, but that's not your fault.

Reviewed-by: Mark Kettenis kette...@openbsd.org

  utils.h |   63 
 +--
  1 files changed, 9 insertions(+), 54 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


Re: [PATCH:ico] Replace local checks for gcc with _X_NORETURN from xproto 7.0.17

2011-06-08 Thread Mark Kettenis
 From: Alan Coopersmith alan.coopersm...@oracle.com
 Date: Wed,  8 Jun 2011 00:04:34 -0700
 
 Also declare icoFatal as static since it's only used in this one file.
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com

Reviewed-by: Mark Kettenis kette...@openbsd.org

 ---
  configure.ac |2 +-
  ico.c|9 -
  2 files changed, 5 insertions(+), 6 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


Re: [PATCH:ico] Replace local checks for gcc with _X_NORETURN from xproto 7.0.17

2011-06-08 Thread Cyril Brulebois
Alan Coopersmith alan.coopersm...@oracle.com (08/06/2011):
 Also declare icoFatal as static since it's only used in this one file.
 
 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com

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

Mraw,
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

[PATCH xf86-video-mga 0/9] Silence compile warnings and remove redundant defines

2011-06-08 Thread Nicolas Kaiser
These patches silence compile warnings, and remove some
unused or duplicated defines.
Tested on a Matrox G550 AGP.

[PATCH 1/9] include unistd.h for usleep()
[PATCH 2/9] fix formats in xf86DrvMsg()
[PATCH 3/9] hide conditionally used variable in mga_read_and_process_bios
[PATCH 4/9] remove unused variables in MGAG200EHPIXPLLSET
[PATCH 5/9] remove unused variables in CopyMungedScanlineFilterDown_AXP
[PATCH 6/9] hide conditionally used variable in MGACopyILOAD
[PATCH 7/9] maven: remove duplicated defines
[PATCH 8/9] storm: remove unused define PSZ
[PATCH 9/9] include xf86Modes.h for xf86ModeBandwidth()

Patch 1 and 9 additionally silence Gentoo QA warnings when
compiling as Gentoo ebuild:

* QA Notice: Package has poor programming practices which may compile
*fine but exhibit random runtime failures.
(..)
* Please do not file a Gentoo bug and instead report the above QA
* issues directly to the upstream developers of this software.
* Homepage: http://xorg.freedesktop.org/


 src/mga_bios.c   |2 +-
 src/mga_dacG.c   |6 +-
 src/mga_driver.c |1 +
 src/mga_exa.c|2 +-
 src/mga_maven.h  |3 ---
 src/mga_storm.c  |2 --
 src/mga_vga.c|2 ++
 src/mga_video.c  |6 --
 8 files changed, 10 insertions(+), 14 deletions(-)


Best regards,
Nicolas Kaiser
___
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-mga 1/9] include unistd.h for usleep()

2011-06-08 Thread Nicolas Kaiser
Silences compile warning
src/mga_vga.c:65: warning: implicit declaration of function 'usleep'

Additionally silences Gentoo QA warning
* QA Notice: Package has poor programming practices which may compile
*fine but exhibit random runtime failures.

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 src/mga_vga.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mga_vga.c b/src/mga_vga.c
index 0ac8bf7..255101d 100644
--- a/src/mga_vga.c
+++ b/src/mga_vga.c
@@ -11,6 +11,8 @@
 #include mga.h
 #include mga_reg.h
 
+#include unistd.h
+
 #define TEXT_AMOUNT 16384
 #define FONT_AMOUNT (8*8192)
 
-- 
1.7.5.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 xf86-video-mga 2/9] fix formats in xf86DrvMsg()

2011-06-08 Thread Nicolas Kaiser
Silences compile warnings
src/mga_exa.c:869: warning: format '%x' expects type
'unsigned int', but argument 5 has type 'long unsigned int'
and
src/mga_exa.c:869: warning: format '%x' expects type
'unsigned int', but argument 6 has type 'long unsigned int'

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 src/mga_exa.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mga_exa.c b/src/mga_exa.c
index f292327..e5eaa92 100644
--- a/src/mga_exa.c
+++ b/src/mga_exa.c
@@ -865,7 +865,7 @@ mgaExaInit(ScreenPtr pScreen)
 
 xf86DrvMsg(pScrn-scrnIndex, X_INFO, X %d Y %d bpp %d\n,
pScrn-virtualX, pScrn-virtualY, pScrn-bitsPerPixel);
-xf86DrvMsg(pScrn-scrnIndex, X_INFO, Start at %p, size %x, osb %x\n,
+xf86DrvMsg(pScrn-scrnIndex, X_INFO, Start at %p, size %lx, osb %lx\n,
pExa-memoryBase, pExa-memorySize, pExa-offScreenBase);
 
 /* In PW24 mode, we need to align to 3 64-bytes */
-- 
1.7.5.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 xf86-video-mga 3/9] hide conditionally used variable in mga_read_and_process_bios

2011-06-08 Thread Nicolas Kaiser
Silences compile warning
src/mga_bios.c:303: warning: unused variable 'rlen'

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 src/mga_bios.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mga_bios.c b/src/mga_bios.c
index b533dd1..e40bb86 100644
--- a/src/mga_bios.c
+++ b/src/mga_bios.c
@@ -299,8 +299,8 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn )
 MGAPtr pMga = MGAPTR(pScrn);
 #ifndef XSERVER_LIBPCIACCESS
 Bool pciBIOS = TRUE;
-#endif
 int rlen;
+#endif
 static const unsigned expected_length[] = { 0, 64, 64, 64, 128, 128 };
 unsigned version;
 unsigned pins_len;
-- 
1.7.5.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 xf86-video-mga 4/9] remove unused variables in MGAG200EHPIXPLLSET

2011-06-08 Thread Nicolas Kaiser
Silence compile warnings
src/mga_dacG.c: In function 'MGAG200EHPIXPLLSET':
src/mga_dacG.c:545: warning: unused variable 'ucS'
src/mga_dacG.c:544: warning: unused variable 'ucP'
src/mga_dacG.c:543: warning: unused variable 'ucN'
src/mga_dacG.c:542: warning: unused variable 'ucM'
src/mga_dacG.c:540: warning: unused variable 'ulFallBackCounter'

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 src/mga_dacG.c |6 +-
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/src/mga_dacG.c b/src/mga_dacG.c
index fca1031..ac62ddb 100644
--- a/src/mga_dacG.c
+++ b/src/mga_dacG.c
@@ -647,12 +647,8 @@ MGAG200EHPIXPLLSET(ScrnInfoPtr pScrn, MGARegPtr mgaReg)
 {
 MGAPtr pMga = MGAPTR(pScrn);
 
-unsigned long ulFallBackCounter, ulLoopCount, ulLockCheckIterations = 0, 
ulTempCount, ulVCount;
+unsigned long ulLoopCount, ulLockCheckIterations = 0, ulTempCount, 
ulVCount;
 unsigned char ucTempByte, ucPixCtrl, ucPLLLocked = FALSE;
-unsigned char ucM;
-unsigned char ucN;
-unsigned char ucP;
-unsigned char ucS;
 
 while(ulLockCheckIterations = 32  ucPLLLocked == FALSE)
 {
-- 
1.7.5.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 xf86-video-mga 5/9] remove unused variables in CopyMungedScanlineFilterDown_AXP

2011-06-08 Thread Nicolas Kaiser
Silence compile warnings
src/mga_video.c: In function 'CopyMungedScanlineFilterDown_AXP':
src/mga_video.c:1472: warning: unused variable 'vf'
src/mga_video.c:1472: warning: unused variable 'uf'

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 src/mga_video.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mga_video.c b/src/mga_video.c
index 8f5fc0b..f31ed69 100644
--- a/src/mga_video.c
+++ b/src/mga_video.c
@@ -1468,7 +1468,7 @@ static void CopyMungedScanlineFilterDown_AXP(CARD32 
*fb_ptr, short src_w,
 int beta , int xds)
 {
 unsigned int k,y0_1,y1_1,y0_2,y1_2,u,v;
-int yf[8], uf[4], vf[4];
+int yf[8];
   
 for(k=src_w/8;k;k--) {
y0_1=*tsp1;
-- 
1.7.5.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 xf86-video-mga 6/9] hide conditionally used variable in MGACopyILOAD

2011-06-08 Thread Nicolas Kaiser
Silence compile warning
src/mga_video.c: In function 'MGACopyILOAD':
src/mga_video.c:1801: warning: unused variable 'k'

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 src/mga_video.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mga_video.c b/src/mga_video.c
index f31ed69..afa3453 100644
--- a/src/mga_video.c
+++ b/src/mga_video.c
@@ -1797,7 +1797,7 @@ static void MGACopyILOAD(
 CARD32 *fb_ptr;
 CARD8  *ubuf, *vbuf;
 CARD32 *pu, *pv;
-int k,l;
+int l;
 short clip_x1, clip_x2, tmp_w;
 
 #ifdef DEBUG_MGA2164
@@ -1928,6 +1928,8 @@ static void MGACopyILOAD(
memcpy(fb_ptr, buf+src_x*2, src_w*2);
fb_ptr+=src_w*2;
 #else
+   int k;
+
CARD32 *tsp=(CARD32 *)(buf+src_x*2);
WAITFIFO(pMga-FifoSize/4);
for(k=src_w/8;k;k--) {
-- 
1.7.5.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 xf86-video-mga 7/9] maven: remove duplicated defines

2011-06-08 Thread Nicolas Kaiser
Remove duplicated defines.

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 src/mga_maven.h |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/mga_maven.h b/src/mga_maven.h
index 219d91e..478e0db 100644
--- a/src/mga_maven.h
+++ b/src/mga_maven.h
@@ -4,9 +4,6 @@
 #define MAVEN_WRITE (0x1B1)
 #define MAVEN_READ ((0x1B1)|1)
 
-#define I2C_CLOCK 0x20
-#define I2C_DATA 0x10
-
 /* MGA-TVO-C I2C (G200), Maven (G400) */
 #define I2C_CLOCK 0x20
 #define I2C_DATA 0x10
-- 
1.7.5.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 xf86-video-mga 8/9] storm: remove unused define PSZ

2011-06-08 Thread Nicolas Kaiser
Remove unused define PSZ.

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 src/mga_storm.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/mga_storm.c b/src/mga_storm.c
index f0e6194..df18f4a 100644
--- a/src/mga_storm.c
+++ b/src/mga_storm.c
@@ -1,5 +1,3 @@
-#define PSZ 8
-
 #ifdef HAVE_CONFIG_H
 #include config.h
 #endif
-- 
1.7.5.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 xf86-video-mga 9/9] include xf86Modes.h for xf86ModeBandwidth()

2011-06-08 Thread Nicolas Kaiser
Fixes compile warning
src/mga_driver.c: In function 'MGAValidMode':
 src/mga_driver.c:4340: warning: implicit declaration of function
'xf86ModeBandwidth'

Additionally silences Gentoo QA warning
* QA Notice: Package has poor programming practices which may compile
*fine but exhibit random runtime failures.

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 src/mga_driver.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mga_driver.c b/src/mga_driver.c
index e5fdec2..a0252e3 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -78,6 +78,7 @@
 #include micmap.h
 
 #include xf86DDC.h
+#include xf86Modes.h
 
 #include vbe.h
 
-- 
1.7.5.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] dri2: Pass AsyncSwap [vblank_mode=0] requests to the drivers

2011-06-08 Thread Chris Wilson
Currently, the midlayer dri2 code intercepts vblank_mode=0 SwapBuffers
and converts it to a CopyRegion request. This prevents the backend from
doing anything meaningful in this case and typically ends up being
vsync'ed since the drivers cannot distinguish it from a regular
CopyRegion request.

Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk
Cc: Jesse Barnes jbar...@virtuousgeek.org
Cc: Kristian Høgsberg k...@bitplanet.net
---
 hw/xfree86/dri2/dri2.c |   51 +--
 hw/xfree86/dri2/dri2.h |   12 ++-
 2 files changed, 47 insertions(+), 16 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index bf7ebb9..8df4f38 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -98,6 +98,7 @@ typedef struct _DRI2Screen {
 DRI2CreateBufferProcPtr CreateBuffer;
 DRI2DestroyBufferProcPtrDestroyBuffer;
 DRI2CopyRegionProcPtr   CopyRegion;
+DRI2AsyncSwapProcPtrAsyncSwap;
 DRI2ScheduleSwapProcPtr ScheduleSwap;
 DRI2GetMSCProcPtr   GetMSC;
 DRI2ScheduleWaitMSCProcPtr  ScheduleWaitMSC;
@@ -791,6 +792,27 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
 return FALSE;
 }
 
+static void
+DRI2AsyncSwapBuffers(ClientPtr client,
+DrawablePtr pDraw,
+DRI2BufferPtr pDestBuffer,
+DRI2BufferPtr pSrcBuffer,
+DRI2SwapEventPtr func, void *data)
+{
+   DRI2ScreenPtr ds = DRI2GetScreen(pDraw-pScreen);
+   BoxRec box;
+   RegionRec region;
+
+   box.x1 = 0;
+   box.y1 = 0;
+   box.x2 = pDraw-width;
+   box.y2 = pDraw-height;
+   RegionInit(region, box, 0);
+
+   (*ds-CopyRegion)(pDraw, region, pDestBuffer, pSrcBuffer);
+   DRI2SwapComplete(client, pDraw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, 
data);
+}
+
 int
 DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
CARD64 divisor, CARD64 remainder, CARD64 *swap_target,
@@ -824,21 +846,16 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, 
CARD64 target_msc,
 
 /* Old DDX or no swap interval, just blit */
 if (!ds-ScheduleSwap || !pPriv-swap_interval) {
-   BoxRec box;
-   RegionRec region;
-
-   box.x1 = 0;
-   box.y1 = 0;
-   box.x2 = pDraw-width;
-   box.y2 = pDraw-height;
-   RegionInit(region, box, 0);
-
-   pPriv-swapsPending++;
-
-   (*ds-CopyRegion)(pDraw, region, pDestBuffer, pSrcBuffer);
-   DRI2SwapComplete(client, pDraw, target_msc, 0, 0, DRI2_BLIT_COMPLETE,
-func, data);
-   return Success;
+   pPriv-swapsPending++;
+   if(ds-AsyncSwap)
+   (*ds-AsyncSwap)(client, pDraw,
+pDestBuffer, pSrcBuffer,
+func, data);
+   else
+   async_swap(client, pDraw,
+  pDestBuffer, pSrcBuffer,
+  func, data);
+   return Success;
 }
 
 /*
@@ -1128,6 +1145,10 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
 ds-AuthMagic = info-AuthMagic;
 }
 
+if (info-version = 6) {
+   ds-AsyncSwap = info-AsyncSwap;
+}
+
 /*
  * if the driver doesn't provide an AuthMagic function or the info struct
  * version is too low, it relies on the old method (using libdrm) or fail
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index fe0bf6c..15f9167 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -104,6 +104,12 @@ typedef int
(*DRI2ScheduleSwapProcPtr)(ClientPtr client,
   CARD64 remainder,
   DRI2SwapEventPtr func,
   void *data);
+typedef void   (*DRI2AsyncSwapProcPtr)(ClientPtr client,
+   DrawablePtr pDraw,
+   DRI2BufferPtr pDestBuffer,
+   DRI2BufferPtr pSrcBuffer,
+   DRI2SwapEventPtr func,
+   void *data);
 typedef DRI2BufferPtr  (*DRI2CreateBufferProcPtr)(DrawablePtr pDraw,
   unsigned int attachment,
   unsigned int format);
@@ -161,7 +167,7 @@ typedef void
(*DRI2InvalidateProcPtr)(DrawablePtr pDraw,
 /**
  * Version of the DRI2InfoRec structure defined in this header
  */
-#define DRI2INFOREC_VERSION 5
+#define DRI2INFOREC_VERSION 6
 
 typedef struct {
 unsigned int version;  /** Version of this struct */
@@ -189,6 +195,10 @@ typedef struct {
 /* added in version 5 */
 
 DRI2AuthMagicProcPtr   AuthMagic;
+
+/* added in version 6 */
+
+

Re: [PATCH 3/3] dix: support the transformation matrix for relative devices.

2011-06-08 Thread Simon Thum
(I removed some text)

 I think my wiki page has a scenario for high-resolution mice, plus
 some users asked for that. Perhaps the man page can be improved.
 
 the problem with pointer acceleration is that the UI to tweak it is is
 suboptimal. yes, there's xinput but we don't have a ubiquitous GUI tool for
 a per-device CD. it'd be great if the default settings for each device would
 adjust accordingly.
 
 evdev does report resolution if the kernel provides it, but only on absolute
 devices so far because that's all the kernel gives us.
The ideal way would be input sections - e.g. do CD if resolution is
large. My reason for turning to HAL was that it lets such bits to be
kept in userland.

What are the plans on that frontier?

 I failed to look at them, TB just shows me a mailto: url.
 
 each email has a Message-ID header, that's what you can search on when
 someone posts this.
I guess I'm officially lame now.

 What I'd drop are the schemes - and your transform would do away the
 last reason to keep them - enabling us to do the following data flow:

 1) derive velocity estimate from the raw data (that's read-only)
 2) transform relative
 3) multiply in acceleration

 If that coincides with daniel's patches (disclaimer: I didn't look at
 them), we've gotten away with one API bump.

 Sounds fine?
 
 yes, because unless I misunderstood it again, we can apply daniel's
 valuator_*_double patches and then just apply the transformation as
 originally proposed in this patch :)
 
 plus the velocity estimate, but that's hopefully the simple bit.
That seems to work out. When daniel's patches hit master, I'll be
removing the schemes.

But please, don't name the relative matrix scale. I fail to come up
with something more misleading...

Cheers,

Simon
___
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/4] xserver: Use lists and constants for matching modes in Match entries

2011-06-08 Thread Dan Nicholson
On Sat, Jun 4, 2011 at 10:48 PM, Oleh Nykyforchyn oleh@gmail.com wrote:
 Use lists and constants for matching modes in Match entries

You're leaving out some critical information here. Particularly that
each Match entry would take multiple arguments. I'm going to ignore
those details for now since I don't think we've agreed on it.


 Signed-off-by: Oleh Nykyforchyn oleh@gmail.com
 ---
  hw/xfree86/common/xf86Xinput.c |  117 +++---
  hw/xfree86/parser/InputClass.c |  336 
 +---
  hw/xfree86/parser/xf86Parser.h |   23 +++-
  3 files changed, 292 insertions(+), 184 deletions(-)

 diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
 index 26051ad..246108e 100644
 --- a/hw/xfree86/common/xf86Xinput.c
 +++ b/hw/xfree86/common/xf86Xinput.c
 @@ -443,77 +443,84 @@ HostOS(void)
  #endif
  }

 +/*
 + * Match an attribute against a pattern. Matching mode is
 + * determined by pattern-mode member.
 + */
  static int
 -match_substring(const char *attr, const char *pattern)
 +multi_match(const char *attr, xf86MatchPattern *pattern)

I like this function a lot now with the switch, but multi_match may
not be the best name. Maybe match_token? I'm also pretty sure pattern
could be const.

  {
 -    return (strstr(attr, pattern)) ? 0 : -1;
 -}
 +    if (!pattern) return 0;

I'm not sure others feel strongly about this, but I much prefer
expressions to be on a separate line from the conditional.

 +    switch (pattern-mode)
 +    {
 +        case MATCH_IS_INVALID:
 +            return 0;
 +        case MATCH_IS_STRCMP:
 +            return (strcmp(attr, pattern-str)) ? 0 : -1;
 +        case MATCH_IS_STRCASECMP:
 +            return (strcasecmp(attr, pattern-str)) ? 0 : -1;
 +        /*
 +         * If no Layout section is found, xf86ServerLayout.id becomes 
 (implicit)
 +         * It is convenient that  in patterns means no explicit layout
 +         */
 +        case MATCH_IS_STRIMPLICIT:
 +            if (*(pattern-str))
 +                return (strcmp(attr, pattern-str)) ? 0 : -1;
 +            else
 +                return (strcmp(attr, (implicit))) ? 0 : -1;
 +        case MATCH_IS_STRSTR:
 +            return (strstr(attr, pattern-str)) ? -1 : 0;
 +        case MATCH_IS_STRCASESTR:
 +            return (strcasestr(attr, pattern-str)) ? -1 : 0;
  #ifdef HAVE_FNMATCH_H
 -static int
 -match_pattern(const char *attr, const char *pattern)
 -{
 -    return fnmatch(pattern, attr, 0);
 -}
 +        case MATCH_IS_FILENAME:
 +            return (fnmatch(pattern-str, attr, 0)) ? 0 : -1;
 +        case MATCH_IS_PATHNAME:
 +            return (fnmatch(pattern-str, attr, FNM_PATHNAME)) ? 0 : -1;
  #else
 -#define match_pattern match_substring
 +        case MATCH_IS_FILENAME:
 +            return (strstr(attr, pattern-str)) ? -1 : 0;
 +        case MATCH_IS_PATHNAME:
 +            return (strstr(attr, pattern-str)) ? -1 : 0;
  #endif
 -
 -#ifdef HAVE_FNMATCH_H
 -static int
 -match_path_pattern(const char *attr, const char *pattern)
 -{
 -    return fnmatch(pattern, attr, FNM_PATHNAME);
 -}
 -#else
 -#define match_path_pattern match_substring
 -#endif
 -
 -/*
 - * If no Layout section is found, xf86ServerLayout.id becomes (implicit)
 - * It is convenient that  in patterns means no explicit layout
 - */
 -static int
 -match_string_implicit(const char *attr, const char *pattern)
 -{
 -    if (strlen(pattern)) {
 -        return strcmp(attr, pattern);
 -    } else {
 -        return strcmp(attr,(implicit));
 +        default:
 +        /* Impossible */
     }
  }

  /*
 - * Match an attribute against a list of NULL terminated arrays of patterns.
 - * If a pattern in each list entry is matched, return TRUE.
 + * Match an attribute against a list of xf86MatchGroup's.
 + * Return TRUE only if each list entry is successful.
  */
  static Bool
 -MatchAttrToken(const char *attr, struct list *patterns,
 -               int (*compare)(const char *attr, const char *pattern))
 +MatchAttrToken(const char *attr, struct list *groups)
  {
 -    const xf86MatchGroup *group;
 +    xf86MatchGroup *group;
 +    xf86MatchPattern *pattern;

 -    /* If there are no patterns, accept the match */
 -    if (list_is_empty(patterns))
 +    /* If there are no groups, accept the match */
 +    if (list_is_empty(groups))
         return TRUE;

 -    /* If there are patterns but no attribute, reject the match */
 +    /* If there are groups but no attribute, reject the match */
     if (!attr)
         return FALSE;

     /*
 -     * Otherwise, iterate the list of patterns ensuring each entry has a
 -     * match. Each list entry is a separate Match line of the same type.
 +     * Otherwise, iterate the list of groups ensuring each entry has a
 +     * match. Each list entry is a list of patterns obtained from
 +     * a separate Match line.
      */
 -    list_for_each_entry(group, patterns, entry) {
 -        char * const *cur;
 +    list_for_each_entry(group, groups, entry) {
         

[PATCH] dri2: Pass AsyncSwap [vblank_mode=0] requests to the drivers

2011-06-08 Thread Chris Wilson
Currently, the midlayer dri2 code intercepts vblank_mode=0 SwapBuffers
and converts it to a CopyRegion request. This prevents the backend from
doing anything meaningful in this case and typically ends up being
vsync'ed since the drivers cannot distinguish it from a regular
CopyRegion request.

Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk
Cc: Jesse Barnes jbar...@virtuousgeek.org
Cc: Kristian Høgsberg k...@bitplanet.net
---

Sigh... I broke the patch with a last minute name change. Please pretend
you never saw the previous patch.

Thanks,
-Chris

---
 hw/xfree86/dri2/dri2.c |   47 ---
 hw/xfree86/dri2/dri2.h |   12 +++-
 2 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index bf7ebb9..03ae1cc 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -98,6 +98,7 @@ typedef struct _DRI2Screen {
 DRI2CreateBufferProcPtr CreateBuffer;
 DRI2DestroyBufferProcPtrDestroyBuffer;
 DRI2CopyRegionProcPtr   CopyRegion;
+DRI2AsyncSwapProcPtrAsyncSwap;
 DRI2ScheduleSwapProcPtr ScheduleSwap;
 DRI2GetMSCProcPtr   GetMSC;
 DRI2ScheduleWaitMSCProcPtr  ScheduleWaitMSC;
@@ -791,6 +792,27 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
 return FALSE;
 }
 
+static void
+DRI2AsyncSwapBuffers(ClientPtr client,
+DrawablePtr pDraw,
+DRI2BufferPtr pDestBuffer,
+DRI2BufferPtr pSrcBuffer,
+DRI2SwapEventPtr func, void *data)
+{
+   DRI2ScreenPtr ds = DRI2GetScreen(pDraw-pScreen);
+   BoxRec box;
+   RegionRec region;
+
+   box.x1 = 0;
+   box.y1 = 0;
+   box.x2 = pDraw-width;
+   box.y2 = pDraw-height;
+   RegionInit(region, box, 0);
+
+   (*ds-CopyRegion)(pDraw, region, pDestBuffer, pSrcBuffer);
+   DRI2SwapComplete(client, pDraw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, 
data);
+}
+
 int
 DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
CARD64 divisor, CARD64 remainder, CARD64 *swap_target,
@@ -824,21 +846,11 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, 
CARD64 target_msc,
 
 /* Old DDX or no swap interval, just blit */
 if (!ds-ScheduleSwap || !pPriv-swap_interval) {
-   BoxRec box;
-   RegionRec region;
-
-   box.x1 = 0;
-   box.y1 = 0;
-   box.x2 = pDraw-width;
-   box.y2 = pDraw-height;
-   RegionInit(region, box, 0);
-
-   pPriv-swapsPending++;
-
-   (*ds-CopyRegion)(pDraw, region, pDestBuffer, pSrcBuffer);
-   DRI2SwapComplete(client, pDraw, target_msc, 0, 0, DRI2_BLIT_COMPLETE,
-func, data);
-   return Success;
+   pPriv-swapsPending++;
+   (*ds-AsyncSwap)(client, pDraw,
+pDestBuffer, pSrcBuffer,
+func, data);
+   return Success;
 }
 
 /*
@@ -1128,6 +1140,11 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
 ds-AuthMagic = info-AuthMagic;
 }
 
+ds-AsyncSwap = DRI2AsyncSwapBuffers;
+if (info-version = 6) {
+   ds-AsyncSwap = info-AsyncSwap;
+}
+
 /*
  * if the driver doesn't provide an AuthMagic function or the info struct
  * version is too low, it relies on the old method (using libdrm) or fail
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index fe0bf6c..15f9167 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -104,6 +104,12 @@ typedef int
(*DRI2ScheduleSwapProcPtr)(ClientPtr client,
   CARD64 remainder,
   DRI2SwapEventPtr func,
   void *data);
+typedef void   (*DRI2AsyncSwapProcPtr)(ClientPtr client,
+   DrawablePtr pDraw,
+   DRI2BufferPtr pDestBuffer,
+   DRI2BufferPtr pSrcBuffer,
+   DRI2SwapEventPtr func,
+   void *data);
 typedef DRI2BufferPtr  (*DRI2CreateBufferProcPtr)(DrawablePtr pDraw,
   unsigned int attachment,
   unsigned int format);
@@ -161,7 +167,7 @@ typedef void
(*DRI2InvalidateProcPtr)(DrawablePtr pDraw,
 /**
  * Version of the DRI2InfoRec structure defined in this header
  */
-#define DRI2INFOREC_VERSION 5
+#define DRI2INFOREC_VERSION 6
 
 typedef struct {
 unsigned int version;  /** Version of this struct */
@@ -189,6 +195,10 @@ typedef struct {
 /* added in version 5 */
 
 DRI2AuthMagicProcPtr   AuthMagic;
+
+/* added in version 6 */
+
+DRI2AsyncSwapProcPtr   AsyncSwap;
 }  

Re: [PATCH] dri2: Pass AsyncSwap [vblank_mode=0] requests to the drivers

2011-06-08 Thread Jesse Barnes
On Wed,  8 Jun 2011 19:06:11 +0100
Chris Wilson ch...@chris-wilson.co.uk wrote:

 Currently, the midlayer dri2 code intercepts vblank_mode=0 SwapBuffers
 and converts it to a CopyRegion request. This prevents the backend from
 doing anything meaningful in this case and typically ends up being
 vsync'ed since the drivers cannot distinguish it from a regular
 CopyRegion request.
 
 Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk
 Cc: Jesse Barnes jbar...@virtuousgeek.org
 Cc: Kristian Høgsberg k...@bitplanet.net
 ---
 
 Sigh... I broke the patch with a last minute name change. Please pretend
 you never saw the previous patch.

In hindsight, it would have been better if DRI2 never had a CopyRegion
hook and just let the driver decide what to do given all the params
(i.e. a very generic Swap hook).

But we don't have that and this looks like a nice addition.  It would
be good to add a blurb to the header file about the hook though, since
it could be easily confused with a hook that's supposed to schedule
something and return immediately or something, rather than a swap now,
tearing be damned hook.

-- 
Jesse Barnes, Intel Open Source Technology Center
___
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] Update .gitignore as new tests have been added

2011-06-08 Thread Gaetan Nadon
Refactor to follow the pattern one Makefile, one .gitignore
where needed.

Reviewed-by: Peter Hutterer peter.hutte...@who-t.net
Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 test/.gitignore |   16 
 test/xi2/.gitignore |   10 ++
 2 files changed, 14 insertions(+), 12 deletions(-)
 create mode 100644 test/xi2/.gitignore

diff --git a/test/.gitignore b/test/.gitignore
index 86e687f..48e8abe 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -1,15 +1,7 @@
 libxservertest.c
-
-input
-list
 xkb
+input
 xtest
-xi2/protocol-eventconvert
-xi2/protocol-xigetclientpointer
-xi2/protocol-xigetselectedevents
-xi2/protocol-xiquerydevice
-xi2/protocol-xiquerypointer
-xi2/protocol-xiqueryversion
-xi2/protocol-xiselectevents
-xi2/protocol-xisetclientpointer
-xi2/protocol-xiwarppointer
+list
+misc
+fixes
diff --git a/test/xi2/.gitignore b/test/xi2/.gitignore
new file mode 100644
index 000..3e9816d
--- /dev/null
+++ b/test/xi2/.gitignore
@@ -0,0 +1,10 @@
+protocol-eventconvert
+protocol-xigetclientpointer
+protocol-xigetselectedevents
+protocol-xipassivegrabdevice
+protocol-xiquerydevice
+protocol-xiquerypointer
+protocol-xiqueryversion
+protocol-xiselectevents
+protocol-xisetclientpointer
+protocol-xiwarppointer
-- 
1.7.4.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] docbook.am: --path is also required for xsltproc

2011-06-08 Thread Gaetan Nadon
The XSLT processor also needs to know about the entities defined
in xserver.ent. It removes error messages.

Reviewed-by: Alan Coopersmith alan.coopersm...@oracle.com
Signed-off-by: Gaetan Nadon mems...@videotron.ca
---
 docbook.am |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/docbook.am b/docbook.am
index 7ab7a00..0a297dd 100644
--- a/docbook.am
+++ b/docbook.am
@@ -78,6 +78,7 @@ sgmldbs_DATA = $(docbook:.xml=.html.db) $(docbook:.xml=.fo.db)
 # Flags for the XSL Transformation processor generating xref target databases
 XSLTPROC_FLAGS =   \
--path $(XORG_SGML_PATH)/X11  \
+   --path $(abs_top_builddir)\
--stringparam targets.filename $@ \
--stringparam collect.xref.targets only   \
--nonet --xinclude
-- 
1.7.4.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] dri2: Pass AsyncSwap [vblank_mode=0] requests to the drivers

2011-06-08 Thread Eric Anholt
On Wed, 8 Jun 2011 12:03:04 -0700, Jesse Barnes jbar...@virtuousgeek.org 
wrote:
 On Wed,  8 Jun 2011 19:06:11 +0100
 Chris Wilson ch...@chris-wilson.co.uk wrote:
 
  Currently, the midlayer dri2 code intercepts vblank_mode=0 SwapBuffers
  and converts it to a CopyRegion request. This prevents the backend from
  doing anything meaningful in this case and typically ends up being
  vsync'ed since the drivers cannot distinguish it from a regular
  CopyRegion request.
  
  Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk
  Cc: Jesse Barnes jbar...@virtuousgeek.org
  Cc: Kristian Høgsberg k...@bitplanet.net
  ---
  
  Sigh... I broke the patch with a last minute name change. Please pretend
  you never saw the previous patch.
 
 In hindsight, it would have been better if DRI2 never had a CopyRegion
 hook and just let the driver decide what to do given all the params
 (i.e. a very generic Swap hook).
 
 But we don't have that and this looks like a nice addition.  It would
 be good to add a blurb to the header file about the hook though, since
 it could be easily confused with a hook that's supposed to schedule
 something and return immediately or something, rather than a swap now,
 tearing be damned hook.

\o/ making vblank handling more predictable.

So, I'm wondering if we want to just drop the no-tearing support in
CopyRegion (aka MESA_copy_sub_buffer) that we snuck in back when we
didn't really have other no-tearing support.  It sounds like the clutter
compositors are using another swap control to sync to vblank before
dispatching their subbuffer blits.  Do we know about compiz?

(The latency between vblank signal from OML_sync_control to client
wakeup to server wakeup to render engine wakeup might make us miss the
vblank.  If we do, it means dropping from 60fps to 30fps, though, which
is perhaps even nastier than a tear?)


pgpABylNu23wI.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-video-mga 0/9] Silence compile warnings and remove redundant defines

2011-06-08 Thread Alan Coopersmith
On 06/ 8/11 01:57 AM, Nicolas Kaiser wrote:
 These patches silence compile warnings, and remove some
 unused or duplicated defines.
 Tested on a Matrox G550 AGP.
 
 [PATCH 1/9] include unistd.h for usleep()
 [PATCH 2/9] fix formats in xf86DrvMsg()
 [PATCH 3/9] hide conditionally used variable in mga_read_and_process_bios
 [PATCH 4/9] remove unused variables in MGAG200EHPIXPLLSET
 [PATCH 5/9] remove unused variables in CopyMungedScanlineFilterDown_AXP
 [PATCH 6/9] hide conditionally used variable in MGACopyILOAD
 [PATCH 7/9] maven: remove duplicated defines
 [PATCH 8/9] storm: remove unused define PSZ
 [PATCH 9/9] include xf86Modes.h for xf86ModeBandwidth()
 
 Patch 1 and 9 additionally silence Gentoo QA warnings when
 compiling as Gentoo ebuild:
 
 * QA Notice: Package has poor programming practices which may compile
 *fine but exhibit random runtime failures.
 (..)
 * Please do not file a Gentoo bug and instead report the above QA
 * issues directly to the upstream developers of this software.
 * Homepage: http://xorg.freedesktop.org/
 
 
  src/mga_bios.c   |2 +-
  src/mga_dacG.c   |6 +-
  src/mga_driver.c |1 +
  src/mga_exa.c|2 +-
  src/mga_maven.h  |3 ---
  src/mga_storm.c  |2 --
  src/mga_vga.c|2 ++
  src/mga_video.c  |6 --
  8 files changed, 10 insertions(+), 14 deletions(-)

Reviewed-by: Alan Coopersmith alan.coopersm...@oracle.com

-- 
-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 1/4] xserver: Use lists and constants for matching modes in Match entries

2011-06-08 Thread Oleh Nykyforchyn
On Wed, 8 Jun 2011 10:39:40 -0700
Dan Nicholson dbn.li...@gmail.com wrote:

 On Sat, Jun 4, 2011 at 10:48 PM, Oleh Nykyforchyn oleh@gmail.com wrote:
  Use lists and constants for matching modes in Match entries
 
 You're leaving out some critical information here. Particularly that
 each Match entry would take multiple arguments.
You are right, but it MAY take multiple arguments, and this possibility
will not be used my most users. Most people simply will not notice
anything and their foo|bar will work as before. For others 
regex:^USB.*Mouse$
will be quite sufficient.

My reason to keep this option is the following: sometimes it is necessary
to interleave positive and negated conditions (I have had such an experience
in my multiseat setups, when input devices was to be distributed between seats).
Any of these conditions can be regexes, and RE have no builtin negation, hence
it is locical to accept multiple (negated and non-negated) RE's in a line. With 
a single
argument, to glue RE's via '|', each '\' must be doubled, and all '|' in RE
must be escaped, which is not very readable and convenient (imagine an 
explanation
in man page). This option adds no computational overhead and does not make the 
code
much more complicated. Why should we restrict ourselves to many simple 
patterns or
one regex?

 I'm going to ignore
 those details for now since I don't think we've agreed on it.
But yes, commit messages will be expanded when we agree on details.
 

  +/*
  + * Match an attribute against a pattern. Matching mode is
  + * determined by pattern-mode member.
  + */
   static int
  -match_substring(const char *attr, const char *pattern)
  +multi_match(const char *attr, xf86MatchPattern *pattern)
 
 I like this function a lot now with the switch, but multi_match may
 not be the best name. Maybe match_token?
OK

 I'm also pretty sure pattern
 could be const.
No, read the third patch. A pattern can contain a regex_t, which is
dynamically allocated before the first use (probably never).

 
   {
  -    return (strstr(attr, pattern)) ? 0 : -1;
  -}
  +    if (!pattern) return 0;
 
 I'm not sure others feel strongly about this, but I much prefer
 expressions to be on a separate line from the conditional.
No problem
 
  -                            iclass-match_layout, match_string_implicit))
  +    if (!MatchAttrToken(xf86ConfigLayout.id, iclass-match_layout))
              return FALSE;
      }
 
 1. This brace appears to be hanging. Did this compile?
Yes, it was a last minute change, which seemed to be obvious and not compiled,
and was wrong.

 
 2. The handling of (implicit) with the new MATCH_IS_STRIMPLICIT
 seems not very ideal. Instead of having a new type, why don't we just
 sanitize xf86ConfigLayout.id before passing it to MatchAttrToken?
 
 const char *layout;
 if (strcmp(xf86ConfigLayout.id, (implicit)) == 0)
 layout = ;
 else
 layout = xf86ConfigLayout.id;
 if (!MatchAttrToken(layout, iclass-match_layout))
 return FALSE;
 
 And then MATCH_IS_STRCMP is can be used normally.
OK, nice idea.

 
  +    if (!str) return;
 
 Same comment as above.
OK

 
  -    group = malloc(sizeof(*group));
  -    if (group) {
  -        group-values = values;
  -        list_add(group-entry, head);
  +    if (!*group) {
  +        *group = malloc(sizeof(**group));
  +        if (!*group) return;
  +        list_init((*group)-patterns);
      }
 
 I think it would be a lot cleaner to initialize the group in
 xf86parseInputClassSection instead of magically doing it here.
Multiple arguments: sometimes we start a new group, and sometimes
we add to an existing one.

 
  +
  +  again:
  +    /* start new pattern */
  +    if ((pattern = calloc(sizeof(*pattern),1)) == NULL)
  +        return;
  +    list_add(pattern-entry, (*group)-patterns);
  +
  +    pattern-mode = pref_mode;
  +
  +    if ((next = index(str, TOKEN_SEP)))
  +        n = next-str;
  +    else
  +        n = strlen(str);
 
 Why use this index loop when strtok will already do it for you? I'd
 rather not start building a parser here.
Because strtok (as You noticed) gobbles empty tokens, which does not
allow to use  for (implicit) layout. BTW, this superparser is much
shorter that xstrtokenize().
 
  +
  +    if ((pattern-str = strndup(str, n)) == NULL) {
  +        pattern-mode = MATCH_IS_INVALID;
 
 If strndup failed, I don't think calling it invalid is correct.
Suggestions? I don't like an idea to exit initialization process. 

 
  +    }
          case MATCH_PRODUCT:
  -            if (xf86getSubToken((ptr-comment)) != STRING)
  +            while 
  ((token=xf86getSubTokenWithTab((ptr-comment),InputClassTab)) == STRING) {
 
 Please add spaces around = and after ,. Makes the code much easier to read.
OK
 
  +                add_to_group(group, val.str, MATCH_IS_STRSTR);
  +            }
  +            xf86unGetToken(token);
  +            if (group)
  +                list_add(group-entry, ptr-match_product);
  +            else
                  

Re: [PATCH 2/4] Remove the cacheing of the last scratch PixmapRec

2011-06-08 Thread Aaron Plattner
On Sun, Jun 05, 2011 at 10:36:07PM -0700, Chris Wilson wrote:
 In order for the driver to be notified of when the resource backing the
 scratch pixmap becomes no longer accessible, it needs to be called on
 every FreeScratchPixmapHeader(). As we instead maybe cached the
 PixmapRec (to avoid the free and malloc overhead), this notification
 went astray, and the driver would fail to insert the correct barriers on
 the backing resource. That resource would then be reused by the Xserver,
 leading to rampant memory corruption as the GPU flushed it write caches
 at some point in the future and overwriting random structures.
 
 In addition we introduce a new hint, CREATE_PIXMAP_USAGE_SCRATCH_HEADER,
 so that the driver can be warned during pixmap creation (and lifetime)
 if the pixmap points to other data.
 
 A side-effect of removing the cache is that several members of the
 ScreenInfo structure and associated routines become redundant and
 deleted as well. So we bump the ABI version as well.
 
 Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk
 ---
  dix/dispatch.c |1 -
  dix/main.c |4 +--
  dix/pixmap.c   |   58 
 
  fb/fbpixmap.c  |2 +-
  hw/xfree86/common/xf86Module.h |2 +-
  include/pixmap.h   |7 +---
  include/scrnintstr.h   |8 +++---
  7 files changed, 32 insertions(+), 50 deletions(-)
[...]
 diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
 index 2a5c805..cf7557e 100644
 --- a/hw/xfree86/common/xf86Module.h
 +++ b/hw/xfree86/common/xf86Module.h
 @@ -82,7 +82,7 @@ typedef enum {
   * mask is 0x.
   */
  #define ABI_ANSIC_VERSIONSET_ABI_VERSION(0, 4)
 -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(11, 0)
 +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(12, 0)
  #define ABI_XINPUT_VERSION   SET_ABI_VERSION(13, 0)
  #define ABI_EXTENSION_VERSIONSET_ABI_VERSION(5, 0)
  #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)

As a reminder, you'll need to wait until server-1.11-branch is created
because the ABI was (supposedly) frozen at xorg-server-1.10.99.901.

-- Aaron
___
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/4] xserver: Use lists and constants for matching modes in Match entries

2011-06-08 Thread Oleh Nykyforchyn
On Wed, 8 Jun 2011 10:39:40 -0700
Dan Nicholson dbn.li...@gmail.com wrote:

 Why did you change all the breaks to continues? If there was code
 below the switch you'd be skipping it.
Sorry, You are right, it does not matter here.

Oleh
___
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-video-mga 1/9] include unistd.h for usleep()

2011-06-08 Thread Cyril Brulebois
Nicolas Kaiser ni...@nikai.net (08/06/2011):
 Silences compile warning
 src/mga_vga.c:65: warning: implicit declaration of function 'usleep'
 
 Additionally silences Gentoo QA warning
 * QA Notice: Package has poor programming practices which may compile
 *fine but exhibit random runtime failures.
 
 Signed-off-by: Nicolas Kaiser ni...@nikai.net

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

Mraw,
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: [PATCH 3/3] dix: support the transformation matrix for relative devices.

2011-06-08 Thread Peter Hutterer
On Wed, Jun 08, 2011 at 07:30:52PM +0200, Simon Thum wrote:
 (I removed some text)
 
  I think my wiki page has a scenario for high-resolution mice, plus
  some users asked for that. Perhaps the man page can be improved.
  
  the problem with pointer acceleration is that the UI to tweak it is is
  suboptimal. yes, there's xinput but we don't have a ubiquitous GUI tool for
  a per-device CD. it'd be great if the default settings for each device would
  adjust accordingly.
  
  evdev does report resolution if the kernel provides it, but only on absolute
  devices so far because that's all the kernel gives us.
 The ideal way would be input sections - e.g. do CD if resolution is
 large. My reason for turning to HAL was that it lets such bits to be
 kept in userland.
 
 What are the plans on that frontier?

The plans are mostly to have sensible defaults and push everything else into
run-time configuration in the desktop environment.

There is no straightforward way to do this right now but we do support udev
tags. so in theory, udev rules could check for high-res devices and could
assign a free-form tag to it. Then you can have your InputClass section
use MatchTag on this to apply a CD. Not ideal though since the resolution is
a numeric value and not easily expressed in a tag.

I think we're much better off increasing the CD to a higher default if the
resolution provided is high enough.

  I failed to look at them, TB just shows me a mailto: url.
  
  each email has a Message-ID header, that's what you can search on when
  someone posts this.
 I guess I'm officially lame now.
 
  What I'd drop are the schemes - and your transform would do away the
  last reason to keep them - enabling us to do the following data flow:
 
  1) derive velocity estimate from the raw data (that's read-only)
  2) transform relative
  3) multiply in acceleration
 
  If that coincides with daniel's patches (disclaimer: I didn't look at
  them), we've gotten away with one API bump.
 
  Sounds fine?
  
  yes, because unless I misunderstood it again, we can apply daniel's
  valuator_*_double patches and then just apply the transformation as
  originally proposed in this patch :)
  
  plus the velocity estimate, but that's hopefully the simple bit.
 That seems to work out. When daniel's patches hit master, I'll be
 removing the schemes.
 
 But please, don't name the relative matrix scale. I fail to come up
 with something more misleading...

I think you misread here. there are two matrices in the patch, transform
and scale. Transform is the one set by the client and applied to all
devices including relative onces.. Scale is the one only applied on absolute
devices to get the mapping into the current desktop dimensions (so that
transformation can be specified as [0..1] instead of [0..current width]).
That seems like sensible naming, isn't it?

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:xkbcomp] Replace repeated checks for gcc with _X_ATTRIBUTE_PRINTF from xproto

2011-06-08 Thread Alan Coopersmith
On 06/ 8/11 01:06 AM, Mark Kettenis wrote:
 From: Alan Coopersmith alan.coopersm...@oracle.com
 Date: Tue,  7 Jun 2011 23:55:25 -0700

 Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com
 
 Strangely formatted code, but that's not your fault.

Yeah, xkbcomp's utils.h is rather messy all around - but as I looked
at cleaning it up I saw so many things that needed fixing, I just
punted for now.   It could use reformatting and dropping unused macros
(it defines 1-10 argument variants of each macro from the days before
 varargs macros, but many of those variants are never used).

-- 
-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 1/4] xserver: Use lists and constants for matching modes in Match entries

2011-06-08 Thread Peter Hutterer
On Wed, Jun 08, 2011 at 11:58:20PM +0300, Oleh Nykyforchyn wrote:
 On Wed, 8 Jun 2011 10:39:40 -0700
 Dan Nicholson dbn.li...@gmail.com wrote:
 
  On Sat, Jun 4, 2011 at 10:48 PM, Oleh Nykyforchyn oleh@gmail.com 
  wrote:
   Use lists and constants for matching modes in Match entries
  
  You're leaving out some critical information here. Particularly that
  each Match entry would take multiple arguments.
 You are right, but it MAY take multiple arguments, and this possibility
 will not be used my most users. Most people simply will not notice
 anything and their foo|bar will work as before. For others 
 regex:^USB.*Mouse$
 will be quite sufficient.
 
 My reason to keep this option is the following: sometimes it is necessary
 to interleave positive and negated conditions (I have had such an experience
 in my multiseat setups, when input devices was to be distributed between 
 seats).
 Any of these conditions can be regexes, and RE have no builtin negation, hence
 it is locical to accept multiple (negated and non-negated) RE's in a line. 
 With a single
 argument, to glue RE's via '|', each '\' must be doubled, and all '|' in RE
 must be escaped, which is not very readable and convenient (imagine an 
 explanation
 in man page). This option adds no computational overhead and does not make 
 the code
 much more complicated. Why should we restrict ourselves to many simple 
 patterns or
 one regex?
 
  I'm going to ignore
  those details for now since I don't think we've agreed on it.
 But yes, commit messages will be expanded when we agree on details.

no, please expand them now. Commit messages are as much for reviewers as
they are for archeologists in a week's time. I can't point this one out
often enough:
http://who-t.blogspot.com/2009/12/on-commit-messages.html

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