[PATCH] xrandr: Fix bug in calling crtc_set_transform()

2014-08-16 Thread Nikhil Mahale
Compare pending transformation with currently pending transformation on
server,
instead of comparing it with current transformation on server.

Signed-off-by: Nikhil Mahale nmah...@nvidia.com
---
 xrandr.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/xrandr.c b/xrandr.c
index 366f6dc..4097a52 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -324,7 +324,10 @@ struct _crtc {
 Rotation   rotation;
 output_t   **outputs;
 intnoutput;
-transform_tcurrent_transform, pending_transform;
+/* current and pending transformation on server */
+transform_tcurrent_transform, current_pending_transform;
+/* pending transformation on client */
+transform_t pending_transform;
 };

 struct _output_prop {
@@ -1331,11 +1334,17 @@ get_crtcs (void)
   attr-currentFilter,
   attr-currentParams,
   attr-currentNparams);
+set_transform (crtcs[c].current_pending_transform,
+   attr-pendingTransform,
+   attr-pendingFilter,
+   attr-pendingParams,
+   attr-pendingNparams);
XFree (attr);
}
else
{
init_transform (crtcs[c].current_transform);
+copy_transform (crtcs[c].current_pending_transform,
crtcs[c].current_transform);
}
copy_transform (crtcs[c].pending_transform, 
crtcs[c].current_transform);
}
@@ -1568,7 +1577,7 @@ crtc_apply (crtc_t *crtc)
s = RRSetConfigSuccess;
 else
 {
-   if (!equal_transform (crtc-current_transform, 
crtc-pending_transform))
+   if (!equal_transform (crtc-current_pending_transform,
crtc-pending_transform))
crtc_set_transform (crtc, crtc-pending_transform);
s = XRRSetCrtcConfig (dpy, res, crtc-crtc.xid, CurrentTime,
  crtc-x, crtc-y, mode, crtc-rotation,
-- 
1.8.1.5

---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
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 renderproto] Add floating point transforms

2014-08-16 Thread walter harms


Am 15.08.2014 17:55, schrieb Keith Packard:
 Fixed point coordinates don't provide reasonable precision for
 transformation operations; the resulting transforms are often off by
 several pixels.
 
 Allow clients to represent the transformation using either fixed point
 or floating point.
 
 Signed-off-by: Keith Packard kei...@keithp.com
 ---
  configure.ac|  2 +-
  render.h|  5 -
  renderproto.h   | 26 ++
  renderproto.txt | 42 --
  4 files changed, 71 insertions(+), 4 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
 index 8154a3a..43d054f 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -1,5 +1,5 @@
  AC_PREREQ([2.60])
 -AC_INIT([RenderProto], [0.11.1], 
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
 +AC_INIT([RenderProto], [0.12.0], 
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
  AM_INIT_AUTOMAKE([foreign dist-bzip2])
  
  # Require xorg-macros: XORG_DEFAULT_OPTIONS
 diff --git a/render.h b/render.h
 index 7ecde3f..0f04cc6 100644
 --- a/render.h
 +++ b/render.h
 @@ -77,7 +77,10 @@ typedef XIDPictFormat;
  #define X_RenderCreateLinearGradient34
  #define X_RenderCreateRadialGradient35
  #define X_RenderCreateConicalGradient   36
 -#define RenderNumberRequests (X_RenderCreateConicalGradient+1)
 +/* 0.12 */
 +#define X_RenderSetPictureTransformFloat37
 +
 +#define RenderNumberRequests (X_RenderSetPictureTransformFloat+1)
  
  #define BadPictFormat0
  #define BadPicture   1
 diff --git a/renderproto.h b/renderproto.h
 index b7b72c1..4fe8da6 100644
 --- a/renderproto.h
 +++ b/renderproto.h
 @@ -640,6 +640,32 @@ typedef struct {
  
  #define sz_xRenderCreateConicalGradientReq 24
  
 +/* 0.12 and higher */
 +
 +typedef struct {
 +floatmatrix11;
 +floatmatrix12;
 +floatmatrix13;
 +floatmatrix21;
 +floatmatrix22;
 +floatmatrix23;
 +floatmatrix31;
 +floatmatrix32;
 +floatmatrix33;
 +} xRenderTransformFloat;


Would it make sense to use double for internal calculation ?
Most systems provide 64bit (or more) fpu-registers these days.

re,
 wh

 +#define sz_xRenderTransformFloat 36
 +
 +typedef struct {
 +CARD8reqType;
 +CARD8renderReqType;
 +CARD16   length B16;
 +Picture  picture B32;
 +xRenderTransformFloattransform;
 +} xRenderSetPictureTransformFloatReq;
 +
 +#define sz_xRenderSetPictureTransformFloatReq44
 +
  #undef Window
  #undef Drawable
  #undef Font
 diff --git a/renderproto.txt b/renderproto.txt
 index 9f1f231..fe5a233 100644
 --- a/renderproto.txt
 +++ b/renderproto.txt
 @@ -1,6 +1,6 @@
   The X Rendering Extension
 -   Version 0.11
 -2009-07-15
 +   Version 0.12
 +2014-08-13
 Keith Packard
   kei...@keithp.com
  
 @@ -12,6 +12,10 @@ Rendering geometric figures is accomplished by client-side 
 tessellation into
  either triangles or trapezoids.  Text is drawn by loading glyphs into the
  server and rendering sets of them.
  
 +1.1 Version 0.12
 +
 +Version 0.12 adds 32-bit floating point transforms.
 +
  2. Acknowledgments
  
  This extension was the work of many people, in particular:
 @@ -252,6 +256,15 @@ ANIMCURSORELT[
   cursor: CURSOR
   delay:  CARD32
   ]
 +6.1 Protocol Types added in Version 0.12
 +
 +FLOAT32-bit IEEE 754 single precision float
 +TRANSFORMFLOAT   [
 + p11, p12, p13:  FLOAT
 + p21, p22, p23:  FLOAT
 + p31, p32, p33:  FLOAT
 + ]
 +
  7. Standard PictFormats
  
  The server must support a Direct PictFormat with 8 bits each of red, green,
 @@ -1143,6 +1156,29 @@ CreateConicalGradient
   The colors are non premultiplied.
  
   
 +14.1 Extension requests added in Version 0.12
 +
 +SetPictureTransformFloat
 +
 + picture:PICTURE
 + transform:  TRANSFORMFLOAT
 +
 + Errors:
 + Alloc, Value, Picture
 +
 + This request changes the projective transformation used to
 + map coordinates when 'picture' is used as the source or
 + mask in any compositing operation.  The transform
 + maps from destination pixel geometry back to the source pixel
 + geometry.
 +
 + Setting a transform via this request replaces any transform
 + set by SetPictureTransform. Similarly, setting a transform via
 + SetPictureTransform replaces any transform set with this
 + request.
 +
 + The matrix must be invertable, else a Value error is generated.
 +
  15. Extension Versioning