[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libxrandr: Changes to 'upstream-experimental'



 .gitignore                      |    1 
 ChangeLog                       |  231 --------------------------------
 Makefile.am                     |   12 +
 configure.ac                    |    4 
 include/X11/extensions/Xrandr.h |   74 +++++++++-
 man/Makefile.am                 |    3 
 man/Xrandr.man                  |   11 -
 src/Makefile.am                 |    2 
 src/Xrandr.c                    |   64 +++++---
 src/Xrandrint.h                 |    3 
 src/XrrCrtc.c                   |  288 ++++++++++++++++++++++++++++++++++++++++
 src/XrrScreen.c                 |   23 ++-
 12 files changed, 431 insertions(+), 285 deletions(-)

New commits:
commit 0f11922bdc0d4e3929df4dc967379ea0b48338b8
Author: Matthias Hopf <mhopf@suse.de>
Date:   Thu Dec 4 18:24:42 2008 +0100

    Bump to 1.2.99.2.
    
    Note the .99

diff --git a/configure.ac b/configure.ac
index ceffa20..976cbc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,7 +30,7 @@ dnl try to keep these the same.  Note that the library has an extra
 dnl digit in the version number to track changes which don't affect the
 dnl protocol, so Xrandr version l.n.m corresponds to protocol version l.n
 dnl
-AC_INIT(libXrandr, 1.2.91, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
+AC_INIT(libXrandr, 1.2.99.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE

commit e788c1ed41e029e54470a2c79f1478c1be7bba92
Author: Matthias Hopf <mhopf@suse.de>
Date:   Thu Dec 4 15:51:07 2008 +0100

    Nuke config-timestamp for panning.

diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index 6b0cdd8..91b1671 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -479,7 +479,6 @@ XRRGetPanning (Display *dpy, XRRScreenResources *resources, RRCrtc crtc)
     req->reqType         = info->codes->major_opcode;
     req->randrReqType    = X_RRGetPanning;
     req->crtc            = crtc;
-    req->configTimestamp = resources->configTimestamp;
 
     if (!_XReply (dpy, (xReply *) &rep, 1, xFalse))
     {
@@ -539,7 +538,6 @@ XRRSetPanning (Display *dpy,
     req->randrReqType  = X_RRSetPanning;
     req->crtc          = crtc;
     req->timestamp     = panning->timestamp;
-    req->configTimestamp = resources->configTimestamp;
     req->left          = panning->left;
     req->top           = panning->top;
     req->width         = panning->width;

commit 1de7212d9a945403f13f4dc15a66ec115c3be44c
Author: Matthias Hopf <mhopf@suse.de>
Date:   Fri Nov 28 17:26:43 2008 +0100

    Panning support

diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 892fae8..80d9d47 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -412,6 +412,34 @@ XRRGetCrtcTransform (Display	*dpy,
  */
 int XRRUpdateConfiguration(XEvent *event);
 
+typedef struct _XRRPanning {
+    Time            timestamp;
+    unsigned int left;
+    unsigned int top;
+    unsigned int width;
+    unsigned int height;
+    unsigned int track_left;
+    unsigned int track_top;
+    unsigned int track_width;
+    unsigned int track_height;
+    int          border_left;
+    int          border_top;
+    int          border_right;
+    int          border_bottom;
+} XRRPanning;
+
+XRRPanning *
+XRRGetPanning (Display *dpy, XRRScreenResources *resources, RRCrtc crtc);
+
+void
+XRRFreePanning (XRRPanning *panning);
+
+Status
+XRRSetPanning (Display *dpy,
+	       XRRScreenResources *resources,
+	       RRCrtc crtc,
+	       XRRPanning *panning);
+
 _XFUNCPROTOEND
 
 #endif /* _XRANDR_H_ */
diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index 66dbc67..6b0cdd8 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -463,3 +463,100 @@ XRRGetCrtcTransform (Display	*dpy,
 
     return True;
 }
+
+XRRPanning *
+XRRGetPanning (Display *dpy, XRRScreenResources *resources, RRCrtc crtc)
+{
+    XExtDisplayInfo	    *info = XRRFindDisplay(dpy);
+    xRRGetPanningReply	    rep;
+    xRRGetPanningReq	    *req;
+    XRRPanning		    *xp;
+
+    RRCheckExtension (dpy, info, 0);
+
+    LockDisplay (dpy);
+    GetReq (RRGetPanning, req);
+    req->reqType         = info->codes->major_opcode;
+    req->randrReqType    = X_RRGetPanning;
+    req->crtc            = crtc;
+    req->configTimestamp = resources->configTimestamp;
+
+    if (!_XReply (dpy, (xReply *) &rep, 1, xFalse))
+    {
+	UnlockDisplay (dpy);
+	SyncHandle ();
+	return NULL;
+    }
+
+    if (! (xp = (XRRPanning *) Xmalloc(sizeof(XRRPanning))) ) {
+	_XEatData (dpy, sizeof(XRRPanning));
+	UnlockDisplay (dpy);
+	SyncHandle ();
+	return NULL;
+    }
+
+    xp->timestamp     = rep.timestamp;
+    xp->left          = rep.left;
+    xp->top           = rep.top;
+    xp->width         = rep.width;
+    xp->height        = rep.height;
+    xp->track_left    = rep.track_left;
+    xp->track_top     = rep.track_top;
+    xp->track_width   = rep.track_width;
+    xp->track_height  = rep.track_height;
+    xp->border_left   = rep.border_left;
+    xp->border_top    = rep.border_top;
+    xp->border_right  = rep.border_right;
+    xp->border_bottom = rep.border_bottom;
+
+    UnlockDisplay (dpy);
+    SyncHandle ();
+    return (XRRPanning *) xp;
+}
+
+void
+XRRFreePanning (XRRPanning *panning)
+{
+    Xfree (panning);
+}
+
+Status
+XRRSetPanning (Display *dpy,
+               XRRScreenResources *resources,
+               RRCrtc crtc,
+               XRRPanning *panning)
+{
+    XExtDisplayInfo	    *info = XRRFindDisplay(dpy);
+    xRRSetPanningReply      rep;
+    xRRSetPanningReq	    *req;
+    int			    i;
+
+    RRCheckExtension (dpy, info, 0);
+
+    LockDisplay(dpy);
+    GetReq (RRSetPanning, req);
+    req->reqType       = info->codes->major_opcode;
+    req->randrReqType  = X_RRSetPanning;
+    req->crtc          = crtc;
+    req->timestamp     = panning->timestamp;
+    req->configTimestamp = resources->configTimestamp;
+    req->left          = panning->left;
+    req->top           = panning->top;
+    req->width         = panning->width;
+    req->height        = panning->height;
+    req->track_left    = panning->track_left;
+    req->track_top     = panning->track_top;
+    req->track_width   = panning->track_width;
+    req->track_height  = panning->track_height;
+    req->border_left   = panning->border_left;
+    req->border_top    = panning->border_top;
+    req->border_right  = panning->border_right;
+    req->border_bottom = panning->border_bottom;
+
+    if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
+	rep.status = RRSetConfigFailed;
+    UnlockDisplay (dpy);
+    SyncHandle ();
+    return rep.status;
+}
+

commit 0dd24bd6ad3c437f320c5d8e922c479fb61b115f
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Dec 1 21:19:35 2008 +0100

    Bump to 1.2.91

diff --git a/configure.ac b/configure.ac
index 299eff8..ceffa20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,7 +30,7 @@ dnl try to keep these the same.  Note that the library has an extra
 dnl digit in the version number to track changes which don't affect the
 dnl protocol, so Xrandr version l.n.m corresponds to protocol version l.n
 dnl
-AC_INIT(libXrandr, 1.2.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
+AC_INIT(libXrandr, 1.2.91, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE

commit 0fa7452220701ee44d8bafc57001e362afcedb0c
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Dec 1 21:09:44 2008 +0100

    RRNotify subevents have 'window' at different offsets, the sequel
    
    f176b2bda103f6f38aabab8207f47a02cc797659 fixed XRRWireToEvent, but
    XRREventToWire had the same bug.
    
    Signed-off-by: Julien Cristau <jcristau@debian.org>

diff --git a/src/Xrandr.c b/src/Xrandr.c
index 2de995c..06dbe10 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -177,12 +177,12 @@ static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire)
 	XRRNotifyEvent *aevent = (XRRNotifyEvent *) event;
 	awire->type = aevent->type | (aevent->send_event ? 0x80 : 0);
 	awire->sequenceNumber = aevent->serial & 0xFFFF;
-	awire->window = aevent->window;
 	awire->subCode = aevent->subtype;
 	switch (aevent->subtype) {
 	case RRNotify_OutputChange: {
 	    xRROutputChangeNotifyEvent *awire = (xRROutputChangeNotifyEvent *) wire;
 	    XRROutputChangeNotifyEvent *aevent = (XRROutputChangeNotifyEvent *) event;
+	    awire->window = aevent->window;
 	    awire->output = aevent->output;
 	    awire->crtc = aevent->crtc;
 	    awire->mode = aevent->mode;
@@ -194,6 +194,7 @@ static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire)
 	case RRNotify_CrtcChange: {
 	    xRRCrtcChangeNotifyEvent *awire = (xRRCrtcChangeNotifyEvent *) wire;
 	    XRRCrtcChangeNotifyEvent *aevent = (XRRCrtcChangeNotifyEvent *) event;
+	    awire->window = aevent->window;
 	    awire->crtc = aevent->crtc;
 	    awire->mode = aevent->mode;
 	    awire->rotation = aevent->rotation;
@@ -206,6 +207,7 @@ static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire)
 	case RRNotify_OutputProperty: {
 	    xRROutputPropertyNotifyEvent *awire = (xRROutputPropertyNotifyEvent *) wire;
 	    XRROutputPropertyNotifyEvent *aevent = (XRROutputPropertyNotifyEvent *) event;
+	    awire->window = aevent->window;
 	    awire->output = aevent->output;
 	    awire->atom = aevent->property;
 	    awire->timestamp = aevent->timestamp;

commit 00f2e30d0b8296668776d62a4c47f96bf95faa08
Author: Julien Cristau <jcristau@debian.org>
Date:   Fri Nov 28 16:16:22 2008 +0100

    Set attr->pendingNparams in XRRGetCrtcTransform()

diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index f4d9322..66dbc67 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -444,6 +444,7 @@ XRRGetCrtcTransform (Display	*dpy,
 	e += 4;
 	attr->pendingParams[p] = (XFixed) f;
     }
+    attr->pendingNparams = rep.pendingNparamsFilter;
 
     memcpy (attr->currentFilter, e, rep.currentNbytesFilter);
     attr->currentFilter[rep.currentNbytesFilter] = '\0';

commit 908de8fc7228ecc7b02825ebede5fb937f3abf1b
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Nov 24 16:11:46 2008 -0500

    Add GetScreenResourcesCurrent

diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 77a7d04..0a75576 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -378,6 +378,11 @@ XRRFreeGamma (XRRCrtcGamma *gamma);
  */
 int XRRUpdateConfiguration(XEvent *event);
 
+/* Version 1.3 additions */
+
+XRRScreenResources *
+XRRGetScreenResourcesCurrent (Display *dpy, Window window);
+
 _XFUNCPROTOEND
 
 #endif /* _XRANDR_H_ */
diff --git a/src/XrrScreen.c b/src/XrrScreen.c
index c9f5204..df49bb5 100644
--- a/src/XrrScreen.c
+++ b/src/XrrScreen.c
@@ -32,8 +32,12 @@
 #include <X11/extensions/Xrender.h>
 #include "Xrandrint.h"
 
-XRRScreenResources *
-XRRGetScreenResources (Display *dpy, Window window)
+/*
+ * this is cheating on the knowledge that the two requests are identical
+ * but for the request number.
+ */
+static XRRScreenResources *
+doGetScreenResources (Display *dpy, Window window, int poll)
 {
     XExtDisplayInfo		*info = XRRFindDisplay(dpy);
     xRRGetScreenResourcesReply  rep;
@@ -75,7 +79,8 @@ XRRGetScreenResources (Display *dpy, Window window)
 
     GetReq (RRGetScreenResources, req);
     req->reqType = info->codes->major_opcode;
-    req->randrReqType = X_RRGetScreenResources;
+    req->randrReqType = poll ? X_RRGetScreenResources
+			     : X_RRGetScreenResourcesCurrent;
     req->window = window;
 
     if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
@@ -187,6 +192,18 @@ XRRGetScreenResources (Display *dpy, Window window)
     return (XRRScreenResources *) xrsr;
 }
 
+XRRScreenResources *
+XRRGetScreenResources(Display *dpy, Window window)
+{
+    return doGetScreenResources(dpy, window, 1);
+}
+
+XRRScreenResources *
+XRRGetScreenResourcesCurrent(Display *dpy, Window window)
+{
+    return doGetScreenResources(dpy, window, 0);
+}
+
 void
 XRRFreeScreenResources (XRRScreenResources *resources)
 {

commit 377126fdaf1094354d54b1743f9d2bf1f2de1e0c
Author: Keith Packard <keithp@keithp.com>
Date:   Fri Sep 12 20:18:21 2008 -0700

    Set NparamsFilter in XRRGetCrtcTransform return value.
    
    Leaving this uninitialized isn't very helpful, and can cause segfaults.

diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index a1d92cb..f4d9322 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -454,6 +454,7 @@ XRRGetCrtcTransform (Display	*dpy,
 	e += 4;
 	attr->currentParams[p] = (XFixed) f;
     }
+    attr->currentNparams = rep.currentNparamsFilter;
 
     if (extra)
 	XFree (extra);

commit f176b2bda103f6f38aabab8207f47a02cc797659
Author: Tomas Carnecky <tom@dbservice.com>
Date:   Wed Aug 13 10:24:11 2008 -0400

    RRNotify subevents have 'window' at different offsets.

diff --git a/src/Xrandr.c b/src/Xrandr.c
index 1629350..e3f9931 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -92,12 +92,12 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
 	aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
 	aevent->send_event = (awire->type & 0x80) != 0;
 	aevent->display = dpy;
-	aevent->window = awire->window;
 	aevent->subtype = awire->subCode;
 	switch (aevent->subtype) {
 	case RRNotify_OutputChange: {
 	    XRROutputChangeNotifyEvent *aevent = (XRROutputChangeNotifyEvent *) event;
 	    xRROutputChangeNotifyEvent *awire = (xRROutputChangeNotifyEvent *) wire;
+	    aevent->window = awire->window;
 	    aevent->output = awire->output;
 	    aevent->crtc = awire->crtc;
 	    aevent->mode = awire->mode;
@@ -109,6 +109,7 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
 	case RRNotify_CrtcChange: {
 	    XRRCrtcChangeNotifyEvent *aevent = (XRRCrtcChangeNotifyEvent *) event;
 	    xRRCrtcChangeNotifyEvent *awire = (xRRCrtcChangeNotifyEvent *) wire;
+	    aevent->window = awire->window;
 	    aevent->crtc = awire->crtc;
 	    aevent->mode = awire->mode;
 	    aevent->rotation = awire->rotation;
@@ -121,6 +122,7 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
 	case RRNotify_OutputProperty: {
 	    XRROutputPropertyNotifyEvent *aevent = (XRROutputPropertyNotifyEvent *) event;
 	    xRROutputPropertyNotifyEvent *awire = (xRROutputPropertyNotifyEvent *) wire;
+	    aevent->window = awire->window;
 	    aevent->output = awire->output;
 	    aevent->property = awire->atom;
 	    aevent->timestamp = awire->timestamp;

commit d631e453d62104b4a4afdcf0b34e6f3aefd62644
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Aug 13 10:21:51 2008 -0400

    Remove RCS tags.

diff --git a/src/Xrandr.c b/src/Xrandr.c
index c7bbc8e..1629350 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -1,6 +1,4 @@
 /*
- * $XFree86: xc/lib/Xrandr/Xrandr.c,v 1.13tsi Exp $
- *
  * Copyright © 2000 Compaq Computer Corporation, Inc.
  * Copyright © 2002 Hewlett Packard Company, Inc.
  *
diff --git a/src/Xrandrint.h b/src/Xrandrint.h
index 14675bd..90c4785 100644
--- a/src/Xrandrint.h
+++ b/src/Xrandrint.h
@@ -1,7 +1,4 @@
 /*
- * $XFree86: xc/lib/Xrandr/Xrandrint.h,v 1.2 2001/06/07 15:33:43 keithp Exp $
- *
- *
  * Copyright © 2000, Compaq Computer Corporation, 
  * Copyright © 2002, Hewlett Packard, Inc.
  *

commit bf476779616b24c6456339bc77896460f1a2545a
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Jul 2 15:28:08 2008 -0400

    libXrandr 1.2.3

diff --git a/configure.ac b/configure.ac
index c71515d..299eff8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,7 +30,7 @@ dnl try to keep these the same.  Note that the library has an extra
 dnl digit in the version number to track changes which don't affect the
 dnl protocol, so Xrandr version l.n.m corresponds to protocol version l.n
 dnl
-AC_INIT(libXrandr, 1.2.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
+AC_INIT(libXrandr, 1.2.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXrandr)
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE

commit 203fc002b6948c3942f0461a0346dd07b633222d
Author: thb <thb@openoffice.org>
Date:   Mon Jun 23 13:25:12 2008 -0400

    Bug #16430: Ignore ConfigureNotify on non-root windows in UpdateConfiguration

diff --git a/src/Xrandr.c b/src/Xrandr.c
index 8896675..c7bbc8e 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -395,9 +395,11 @@ int XRRUpdateConfiguration(XEvent *event)
     if (event->type == ConfigureNotify) {
 	rcevent = (XConfigureEvent *) event;
 	snum = XRRRootToScreen(dpy, rcevent->window);
-	dpy->screens[snum].width   = rcevent->width;
-	dpy->screens[snum].height  = rcevent->height;
-	return 1;
+	if (snum != -1) {
+	    dpy->screens[snum].width   = rcevent->width;
+	    dpy->screens[snum].height  = rcevent->height;
+	    return 1;
+	}
     }
 
     info = XRRFindDisplay(dpy);

commit 332eee90c4d00be3b11049e0261323abe89a96dc
Author: Peter Hutterer <peter@cs.unisa.edu.au>
Date:   Mon May 19 17:34:36 2008 +0930

    Rename parameters to clarify QueryVersion/QueryExtension.
    
    These parameters are not treated as input. Rename them to make the inner
    workings slightly more obvious.
    
    X.Org Bug 14511 <http://bugs.freedesktop.org/show_bug.cgi?id=14511>

diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 58dc75d..77a7d04 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -119,10 +119,12 @@ typedef struct {
 /* internal representation is private to the library */
 typedef struct _XRRScreenConfiguration XRRScreenConfiguration;	
 
-Bool XRRQueryExtension (Display *dpy, int *event_basep, int *error_basep);
+Bool XRRQueryExtension (Display *dpy,
+			int *event_base_return,
+			int *error_base_return);
 Status XRRQueryVersion (Display *dpy,
-			    int     *major_versionp,
-			    int     *minor_versionp);
+			    int     *major_version_return,
+			    int     *minor_version_return);
 
 XRRScreenConfiguration *XRRGetScreenInfo (Display *dpy,
 					  Window window);
diff --git a/man/Xrandr.man b/man/Xrandr.man
index 0c6a105..f5b1034 100644
--- a/man/Xrandr.man
+++ b/man/Xrandr.man
@@ -35,11 +35,11 @@
 .nf    
 .sp
 Bool XRRQueryExtension \^(\^Display *\fIdpy\fP, 
-	int *\fIevent_basep\fP, int *\fIerror_basep\fP\^);
+	int *\fIevent_base_return\fP, int *\fIerror_base_return\fP\^);
 .sp
 Status XRRQueryVersion \^(\^Display *\fIdpy\fP,
-	int *\fImajor_versionp\fP,
-	int *\fIminor_versionp\fP\^);
+	int *\fImajor_version_return\fP,
+	int *\fIminor_version_return\fP\^);
 .sp
 XRRScreenConfiguration *XRRGetScreenInfo \^(\^Display *dpy,
 	Drawable \fIdraw\fP\^);
diff --git a/src/Xrandr.c b/src/Xrandr.c
index b6068dc..8896675 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -272,13 +272,15 @@ int XRRRootToScreen(Display *dpy, Window root)
 }
 
 
-Bool XRRQueryExtension (Display *dpy, int *event_basep, int *error_basep)
+Bool XRRQueryExtension (Display *dpy,
+			int *event_base_return,
+			int *error_base_return)
 {
   XExtDisplayInfo *info = XRRFindDisplay (dpy);
 
     if (XextHasExtension(info)) {
-	*event_basep = info->codes->first_event;
-	*error_basep = info->codes->first_error;
+	*event_base_return = info->codes->first_event;
+	*error_base_return = info->codes->first_error;
 	return True;
     } else {
 	return False;

commit 824f3d4a3a4669526a5c391c6668df0384b49cdb
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Feb 5 15:37:32 2008 +0100

    Bug #14388: Remove XRRScreenConfig() and XRRConfig() from Xrandr.h.
    
    It seems that they were never actually implemented.
    Also remove the corresponding manpage symlinks.

diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index d87976b..58dc75d 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -177,8 +177,6 @@ int XRRRootToScreen(Display *dpy, Window root);
  */
 
 
-XRRScreenConfiguration *XRRScreenConfig(Display *dpy, int screen);
-XRRScreenConfiguration *XRRConfig(Screen *screen);
 void XRRSelectInput(Display *dpy, Window window, int mask);
 
 /* 
diff --git a/man/Makefile.am b/man/Makefile.am
index c922fef..f9928b3 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -70,8 +70,6 @@ Xrandr_shadows =                            \
     XRRConfigCurrentConfiguration           \
     XRRConfigCurrentRate                    \
     XRRRootToScreen                         \
-    XRRScreenConfig                         \
-    XRRConfig                               \
     XRRSelectInput
 
 shadows.DONE:
diff --git a/man/Xrandr.man b/man/Xrandr.man
index 00fe5f1..0c6a105 100644
--- a/man/Xrandr.man
+++ b/man/Xrandr.man
@@ -90,11 +90,6 @@ int XRRRootToScreen\^(\^
 	Display *\fIdpy\fP, 
 	Window \fIroot\fP\^);
 .sp
-XRRScreenConfiguration *XRRScreenConfig\^(\^
-	Display *\fIdpy\fP, int \fIscreen\fP\^);
-.sp
-XRRScreenConfiguration *XRRConfig\^(\^Screen *\fIscreen\fP\^);
-.sp
 void XRRSelectInput\^(\^Display *\fIdpy\fP, Window \fIwindow\fP, int \fImask\fP\^);
 .sp
 /\(** 

commit 7a21e7bc994c5fa7d3ab15ba7201667e134f1512
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Mar 18 16:02:36 2008 -0700

    Eliminate inverse matrix from randr transform protocol
    
    It is easier, and potentially more precise, to compute the inverse in the
    server where everything can eventually be kept in floating point form.

diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 32171f9..de18f3b 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -378,19 +378,16 @@ void
 XRRSetCrtcTransform (Display	*dpy,
 		     RRCrtc	crtc, 
 		     XTransform	*transform,
-		     XTransform	*inverse,
 		     char	*filter,
 		     XFixed	*params,
 		     int	nparams);
 
 typedef struct _XRRCrtcTransformAttributes {
     XTransform	pendingTransform;
-    XTransform	pendingInverse;
     char	*pendingFilter;
     int		pendingNparams;
     XFixed	*pendingParams;
     XTransform	currentTransform;
-    XTransform	currentInverse;
     char	*currentFilter;
     int		currentNparams;
     XFixed	*currentParams;
diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index 8bca1b1..a1d92cb 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -311,7 +311,6 @@ void
 XRRSetCrtcTransform (Display	*dpy,
 		     RRCrtc	crtc, 
 		     XTransform	*transform,
-		     XTransform	*inverse,
 		     char	*filter,
 		     XFixed	*params,
 		     int	nparams)
@@ -329,7 +328,6 @@ XRRSetCrtcTransform (Display	*dpy,
     req->crtc = crtc;
 
     xRenderTransform_from_XTransform (&req->transform, transform);
-    xRenderTransform_from_XTransform (&req->inverse, inverse);
 
     req->nbytesFilter = nbytes;
     req->length += ((nbytes + 3) >> 2) + nparams;
@@ -377,11 +375,9 @@ XRRGetCrtcTransform (Display	*dpy,
     {
 	/* For pre-1.3 servers, just report identity matrices everywhere */
 	rep.pendingTransform = identity;
-	rep.pendingInverse = identity;
 	rep.pendingNbytesFilter = 0;
 	rep.pendingNparamsFilter = 0;
 	rep.currentTransform = identity;
-	rep.currentInverse = identity;
 	rep.currentNbytesFilter = 0;
 	rep.currentNparamsFilter = 0;
     }
@@ -396,11 +392,9 @@ XRRGetCrtcTransform (Display	*dpy,
 	if (!_XReply (dpy, (xReply *) &rep, CrtcTransformExtra >> 2, xFalse))
 	{
 	    rep.pendingTransform = identity;
-	    rep.pendingInverse = identity;
 	    rep.pendingNbytesFilter = 0;
 	    rep.pendingNparamsFilter = 0;
 	    rep.currentTransform = identity;
-	    rep.currentInverse = identity;
 	    rep.currentNbytesFilter = 0;
 	    rep.currentNparamsFilter = 0;
 	}
@@ -432,9 +426,7 @@ XRRGetCrtcTransform (Display	*dpy,
 	return False;
     }
     XTransform_from_xRenderTransform (&attr->pendingTransform, &rep.pendingTransform);
-    XTransform_from_xRenderTransform (&attr->pendingInverse, &rep.pendingInverse);
     XTransform_from_xRenderTransform (&attr->currentTransform, &rep.currentTransform);
-    XTransform_from_xRenderTransform (&attr->currentInverse, &rep.currentInverse);
 
     attr->pendingParams = (XFixed *) (attr + 1);
     attr->currentParams = attr->pendingParams + rep.pendingNparamsFilter;

commit a6e5fa4ceb72795380496fcfe62c083866791dc1
Author: Keith Packard <keithp@keithp.com>
Date:   Sat Mar 15 00:33:30 2008 -0700

    Support CRTC Transform filters
    
    XRRGetCrtcTransform now returns a giant struct containing all of the
    transform and filter data.
    
    XRRSetCrtcTransform now accepts filter parameters.

diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 4112b39..32171f9 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -378,17 +378,34 @@ void
 XRRSetCrtcTransform (Display	*dpy,
 		     RRCrtc	crtc, 
 		     XTransform	*transform,
-		     XTransform	*inverse);
+		     XTransform	*inverse,
+		     char	*filter,
+		     XFixed	*params,
+		     int	nparams);
+
+typedef struct _XRRCrtcTransformAttributes {
+    XTransform	pendingTransform;
+    XTransform	pendingInverse;
+    char	*pendingFilter;
+    int		pendingNparams;
+    XFixed	*pendingParams;
+    XTransform	currentTransform;
+    XTransform	currentInverse;
+    char	*currentFilter;
+    int		currentNparams;
+    XFixed	*currentParams;
+} XRRCrtcTransformAttributes;
 
+/*
+ * Get current crtc transforms and filters.
+ * Pass *attributes to XFree to free
+ */
 Status
 XRRGetCrtcTransform (Display	*dpy,
 		     RRCrtc	crtc,
-		     XTransform	*pendingTransform,
-		     XTransform	*pendingInverse,
-		     XTransform	*currentTransform,
-		     XTransform	*currentInverse);
+		     XRRCrtcTransformAttributes **attributes);
 
-/* 
+/*
  * intended to take RRScreenChangeNotify,  or 
  * ConfigureNotify (on the root window)
  * returns 1 if it is an event type it understands, 0 if not
diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c
index 5b952e4..8bca1b1 100644
--- a/src/XrrCrtc.c
+++ b/src/XrrCrtc.c
@@ -273,14 +273,52 @@ XRRFreeGamma (XRRCrtcGamma *crtc_gamma)
 
 /* Version 1.3 additions */
 
+static void
+XTransform_from_xRenderTransform (XTransform *x,
+				  xRenderTransform *render)
+{
+    x->matrix[0][0] = render->matrix11;
+    x->matrix[0][1] = render->matrix12;
+    x->matrix[0][2] = render->matrix13;
+
+    x->matrix[1][0] = render->matrix21;
+    x->matrix[1][1] = render->matrix22;
+    x->matrix[1][2] = render->matrix23;
+
+    x->matrix[2][0] = render->matrix31;
+    x->matrix[2][1] = render->matrix32;
+    x->matrix[2][2] = render->matrix33;
+}
+
+static void
+xRenderTransform_from_XTransform (xRenderTransform *render,
+				  XTransform *x)
+{
+    render->matrix11 = x->matrix[0][0];
+    render->matrix12 = x->matrix[0][1];
+    render->matrix13 = x->matrix[0][2];
+
+    render->matrix21 = x->matrix[1][0];
+    render->matrix22 = x->matrix[1][1];
+    render->matrix23 = x->matrix[1][2];
+
+    render->matrix31 = x->matrix[2][0];
+    render->matrix32 = x->matrix[2][1];
+    render->matrix33 = x->matrix[2][2];
+}
+
 void
 XRRSetCrtcTransform (Display	*dpy,
 		     RRCrtc	crtc, 
 		     XTransform	*transform,
-		     XTransform	*inverse)
+		     XTransform	*inverse,
+		     char	*filter,
+		     XFixed	*params,
+		     int	nparams)
 {
     XExtDisplayInfo	    *info = XRRFindDisplay(dpy);
     xRRSetCrtcTransformReq  *req;
+    int			    nbytes = strlen (filter);
 
     RRSimpleCheckExtension (dpy, info);
 
@@ -290,26 +328,14 @@ XRRSetCrtcTransform (Display	*dpy,
     req->randrReqType = X_RRSetCrtcTransform;
     req->crtc = crtc;
 
-    req->transform.matrix11 = transform->matrix[0][0];
-    req->transform.matrix12 = transform->matrix[0][1];
-    req->transform.matrix13 = transform->matrix[0][2];
-    req->transform.matrix21 = transform->matrix[1][0];
-    req->transform.matrix22 = transform->matrix[1][1];
-    req->transform.matrix23 = transform->matrix[1][2];
-    req->transform.matrix31 = transform->matrix[2][0];
-    req->transform.matrix32 = transform->matrix[2][1];
-    req->transform.matrix33 = transform->matrix[2][2];
-
-    req->inverse.matrix11 = inverse->matrix[0][0];
-    req->inverse.matrix12 = inverse->matrix[0][1];
-    req->inverse.matrix13 = inverse->matrix[0][2];
-    req->inverse.matrix21 = inverse->matrix[1][0];
-    req->inverse.matrix22 = inverse->matrix[1][1];
-    req->inverse.matrix23 = inverse->matrix[1][2];
-    req->inverse.matrix31 = inverse->matrix[2][0];
-    req->inverse.matrix32 = inverse->matrix[2][1];
-    req->inverse.matrix33 = inverse->matrix[2][2];
-    
+    xRenderTransform_from_XTransform (&req->transform, transform);
+    xRenderTransform_from_XTransform (&req->inverse, inverse);
+
+    req->nbytesFilter = nbytes;
+    req->length += ((nbytes + 3) >> 2) + nparams;
+    Data (dpy, filter, nbytes);
+    Data32 (dpy, params, nparams << 2);
+
     UnlockDisplay (dpy);
     SyncHandle ();
 }
@@ -331,16 +357,18 @@ _XRRHasTransform (int major, int minor)
 Status
 XRRGetCrtcTransform (Display	*dpy,
 		     RRCrtc	crtc,
-		     XTransform	*pendingTransform,
-		     XTransform	*pendingInverse,
-		     XTransform	*currentTransform,
-		     XTransform	*currentInverse)
+		     XRRCrtcTransformAttributes **attributes)
 {
     XExtDisplayInfo		*info = XRRFindDisplay(dpy);
     XRandRInfo			*xrri;
     xRRGetCrtcTransformReply	rep;
     xRRGetCrtcTransformReq	*req;
     int				major_version, minor_version;
+    XRRCrtcTransformAttributes	*attr;
+    char			*extra = NULL, *e;
+    int				p;
+
+    *attributes = NULL;
 
     RRCheckExtension (dpy, info, False);
 
@@ -350,8 +378,12 @@ XRRGetCrtcTransform (Display	*dpy,
 	/* For pre-1.3 servers, just report identity matrices everywhere */
 	rep.pendingTransform = identity;
 	rep.pendingInverse = identity;
+	rep.pendingNbytesFilter = 0;
+	rep.pendingNparamsFilter = 0;
 	rep.currentTransform = identity;
 	rep.currentInverse = identity;
+	rep.currentNbytesFilter = 0;
+	rep.currentNparamsFilter = 0;
     }
     else
     {
@@ -365,64 +397,75 @@ XRRGetCrtcTransform (Display	*dpy,
 	{
 	    rep.pendingTransform = identity;
 	    rep.pendingInverse = identity;
+	    rep.pendingNbytesFilter = 0;
+	    rep.pendingNparamsFilter = 0;
 	    rep.currentTransform = identity;
 	    rep.currentInverse = identity;
+	    rep.currentNbytesFilter = 0;
+	    rep.currentNparamsFilter = 0;
+	}
+	else
+	{
+	    int extraBytes = rep.length * 4 - CrtcTransformExtra;
+	    extra = Xmalloc (extraBytes);
+	    if (!extra) {
+		_XEatData (dpy, extraBytes);
+		UnlockDisplay (dpy);
+		SyncHandle ();
+		return False;
+	    }
+	    _XRead (dpy, extra, extraBytes);
 	}
+
 	UnlockDisplay (dpy);
 	SyncHandle ();
     }
 
-    if (pendingTransform)
-    {
-	pendingTransform->matrix[0][0] = rep.pendingTransform.matrix11;
-	pendingTransform->matrix[0][1] = rep.pendingTransform.matrix12;
-	pendingTransform->matrix[0][2] = rep.pendingTransform.matrix13;
-	pendingTransform->matrix[1][0] = rep.pendingTransform.matrix21;
-	pendingTransform->matrix[1][1] = rep.pendingTransform.matrix22;
-	pendingTransform->matrix[1][2] = rep.pendingTransform.matrix23;
-	pendingTransform->matrix[2][0] = rep.pendingTransform.matrix31;
-	pendingTransform->matrix[2][1] = rep.pendingTransform.matrix32;
-	pendingTransform->matrix[2][2] = rep.pendingTransform.matrix33;
+    attr = Xmalloc (sizeof (XRRCrtcTransformAttributes) +
+		    rep.pendingNparamsFilter * sizeof (XFixed) +
+		    rep.currentNparamsFilter * sizeof (XFixed) +
+		    rep.pendingNbytesFilter + 1 +
+		    rep.currentNbytesFilter + 1);
+
+    if (!attr) {
+	XFree (extra);
+	return False;
     }
-    
-    if (pendingInverse)
-    {
-	pendingInverse->matrix[0][0] = rep.pendingInverse.matrix11;
-	pendingInverse->matrix[0][1] = rep.pendingInverse.matrix12;
-	pendingInverse->matrix[0][2] = rep.pendingInverse.matrix13;
-	pendingInverse->matrix[1][0] = rep.pendingInverse.matrix21;
-	pendingInverse->matrix[1][1] = rep.pendingInverse.matrix22;
-	pendingInverse->matrix[1][2] = rep.pendingInverse.matrix23;
-	pendingInverse->matrix[2][0] = rep.pendingInverse.matrix31;
-	pendingInverse->matrix[2][1] = rep.pendingInverse.matrix32;
-	pendingInverse->matrix[2][2] = rep.pendingInverse.matrix33;
+    XTransform_from_xRenderTransform (&attr->pendingTransform, &rep.pendingTransform);
+    XTransform_from_xRenderTransform (&attr->pendingInverse, &rep.pendingInverse);
+    XTransform_from_xRenderTransform (&attr->currentTransform, &rep.currentTransform);
+    XTransform_from_xRenderTransform (&attr->currentInverse, &rep.currentInverse);
+
+    attr->pendingParams = (XFixed *) (attr + 1);
+    attr->currentParams = attr->pendingParams + rep.pendingNparamsFilter;
+    attr->pendingFilter = (char *) (attr->currentParams + rep.currentNparamsFilter);
+    attr->currentFilter = attr->pendingFilter + rep.pendingNbytesFilter + 1;
+
+    e = extra;
+
+    memcpy (attr->pendingFilter, e, rep.pendingNbytesFilter);
+    attr->pendingFilter[rep.pendingNbytesFilter] = '\0';
+    e += (rep.pendingNbytesFilter + 3) & ~3;
+    for (p = 0; p < rep.pendingNparamsFilter; p++) {
+	INT32	f;
+	memcpy (&f, e, 4);
+	e += 4;
+	attr->pendingParams[p] = (XFixed) f;
     }
-    
-    if (currentTransform)
-    {
-	currentTransform->matrix[0][0] = rep.currentTransform.matrix11;
-	currentTransform->matrix[0][1] = rep.currentTransform.matrix12;
-	currentTransform->matrix[0][2] = rep.currentTransform.matrix13;
-	currentTransform->matrix[1][0] = rep.currentTransform.matrix21;
-	currentTransform->matrix[1][1] = rep.currentTransform.matrix22;
-	currentTransform->matrix[1][2] = rep.currentTransform.matrix23;
-	currentTransform->matrix[2][0] = rep.currentTransform.matrix31;


Reply to: