Commit Graph

194 Commits

Author SHA1 Message Date
Benjamin Defnet
72c9bc64ff randr: fix operation order so that rotation+transform works
The matrix multiply to combine rotation and projective transforms was being
done in the wrong order.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b2bf67b61c)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-26 13:56:57 -07:00
Julien Cristau
b1eed8970f randr: fix server crash in RRGetScreenInfo
We don't return rates to randr < 1.1 clients, so don't allocate space
for them.  This fixes a FatalError due to not all allocated space being
used.

X.Org bug#21861 <http://bugs.freedesktop.org/show_bug.cgi?id=21861>

Reported-by: Guillaume Quintin <coincoin169g@gmail.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 12e725d08b)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-26 13:56:57 -07:00
Keith Packard
8d65439d5c Make RANDR 'set' timestamps follow client specified time. Bug 21987.
The lastSetTime value which indicates when the configuration within the
server was last changed was not getting set in the appropriate RandR
requests.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 69a9545d1f)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-06-29 14:17:47 -07:00
Federico Mena Quintero
d98f2792d2 dix/randr: Add missing fields to SRR*NotifyEvent()
Also, remove redundant field swaps and make others match the order in which
they are declared in the xRR*NotifyEvent structs.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit e244a5991e)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-06-29 14:17:35 -07:00
Eamon Walsh
b7dc7374bb Correct access mode in call to dixLookupWindow() within RRSelectInput.
Reported by Alan Coopersmith.
(cherry picked from commit 6544490700)
2009-04-08 16:05:11 -04:00
Keith Packard
e59aa804df RandR rotations and reflections offset by one pixel
The matrix computation for rotation and reflection resulted in dropping a
row or column of pixels as the offsets used in the matrix computations used
width and height rather than width-1 and height-1.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 77c7a64e88)
2009-02-25 11:12:43 -08:00
Adam Jackson
39eb1bee84 RANDR: Fail softly on GetPanning if the screen can't do it.
Just return a zeroed-out reply in that case.  This is unambiguous, and
distinguishes "you didn't name a CRTC" from "you named a CRTC that can't
do panning".
(cherry picked from commit 1230939965)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-17 19:11:30 -08:00
Keith Packard
536748aa88 Merge branch 'panning-for-server-1.6' into server-1.6-branch 2009-02-17 18:52:04 -08:00
Keith Packard
4992c31e6c Handle matrix computation overflow in RRTransformCompute
If the computation of the composite fixed-point transform for RandR
overflows at any point, take the resulting floating point transform and
scale that back to fit in a fixed point matrix. This ensures that a matrix
will always be available, although perhaps at reduced precision. Someday we
should add floating point matrices to Render.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 62fc98cb88)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-17 14:43:25 -08:00
Aaron Plattner
660c2a7d4c Query the DDX in ProcRRGetScreenInfo.
This is the RandR 1.1 version of GetScreenResources and needs to re-query the
DDX to see if the mode pool changed.

Fixes Launchpad bug #325115.
Signed-off-by: Adam Jackson <ajax@redhat.com>
2009-02-13 12:39:35 -08:00
Eric Anholt
56f6fb8c86 randr: Avoid re-querying the configuration on everything but GetScreenResources.
The new path should only re-query on the other requests when we haven't
gathered the information from the DDX yet (such as with a non-RandR 1.2 DDX).

Bug #19037.
(cherry picked from commit 317f2b4a9f)
2009-01-30 20:34:07 -08:00
Keith Packard
6d928aa227 RandR crtcs not fetched correctly when primary output is set.
Primary outputs may not have a CRTC.
Loops fetching CRTCs respecting primary output were broken.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 4de5705545)
2009-01-30 20:22:04 -08:00
Keith Packard
759ed0679a RandR SetOutputPrimary should work with or without a crtc connected
The test was inverted from the protocol spec, and besides, the test is bogus
anyways.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit c1f2be1f3f)
2009-01-30 19:16:15 -08:00
Keith Packard
648807adb0 Make RandR CRTC info report panning area instead of just crtc area
This makes the RandR info consistent with the Xinerama info.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 6e49fdd2c8)
2009-01-30 15:44:45 -08:00
Maarten Maathuis
9b2958b3a2 randr: Consider panned crtc's when calculating xinerama screen sizes.
- This will allow window managers and applications to actually use the panned area.
(cherry picked from commit 332d65ec7a)
2009-01-30 15:44:32 -08:00
Adam Jackson
a82f10c5dd randr: clear primaryOutput when the output is deleted
(cherry picked from commit 86c64ddf21)
2008-12-16 09:55:24 -05:00
Adam Jackson
2bc53ce668 randr: use primary output for RRFirstOutput()
(cherry picked from commit fe65f400ed)
2008-12-16 09:55:20 -05:00
Adam Jackson
f0234a9eb8 randr: Mangle GetScreenResources sort order based on primary output
(cherry picked from commit cdcb516e56)
2008-12-16 09:55:17 -05:00
Adam Jackson
2ef02833d6 randr: Mangle compat Xinerama reply based on primary output
(cherry picked from commit d7b316e82b)
2008-12-16 09:55:14 -05:00
Adam Jackson
0bdfdaa7df randr: Add [GS]etOutputPrimary
(cherry picked from commit 9d58d2a319)
2008-12-16 09:55:09 -05:00
Matthias Hopf
19a978359d randr: Oops, miscalculated panning rectangle's coordinates 2008-12-12 11:01:56 +01:00
Matthias Hopf
4810226dfc randr: Update SProcRandrVector for panning
(cherry picked from commit 44bef8b850)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:57:47 -08:00
Matthias Hopf
68858b202a randr: Nuke config-timestamp for panning
(cherry picked from commit 825b2c2f4a)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:56:40 -08:00
Matthias Hopf
7cbded550d randr: Protocol bits for panning support
(cherry picked from commit eeeb98d1df)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:56:31 -08:00
Julien Cristau
90900976ce randr: add swapped dispatch for RR[GS]etCrtcTransform
Fix a memory leak in ProcRRGetCrtcTransform() while I'm at it.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Cc: Keith Packard <keithp@keithp.com>
(cherry picked from commit 0b5ecabfb8)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:39:35 -08:00
Adam Jackson
f5ef57e5fe randr: Don't send output property events on server exit
If the Window resource type is already gone, there's no point in trying
to send events, all it can do is access already-freed memory.

Relevant thread:

http://lists.freedesktop.org/archives/xorg/2008-November/040443.html
(cherry picked from commit b0d371ab0a)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-02 23:38:33 -08:00
Keith Packard
f0e7a792be Add server support for RRGetScreenResourcesCurrent
This depends on randrproto 1.2.99.1

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit fc70839431)
2008-11-26 15:55:56 -08:00
Keith Packard
9ffc671939 Move matrix operations from X server to pixman 0.13.2
pixman 0.13.2 now holds all of the matrix operations. This leaves
the protocol conversion routines and some ABI stubs in place

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-11-25 22:17:58 -08:00
Keith Packard
9c7679240a [randr] don't try to compute crtc transform when no mode is set.
Dereferencing the NULL mode pointer would cause a crash. As these transform
matrices won't be used while the CRTC is disabled, just leave their values
alone.
2008-11-24 13:24:41 -08:00
Keith Packard
315b6d0a42 Update RandR global transform when driver notifies of transform change.
Need to compute and save the global transform when the driver changes it.
2008-11-24 13:24:41 -08:00
Keith Packard
5d9282fde9 Export rrtransform.h as needed by randrstr.h
When the transform management was moved from randrstr.h, the associated
header file became necessary to build drivers. Include it as a part of the
sdk headers.
2008-11-24 13:24:41 -08:00
Keith Packard
93179c214f rrtransform needs randrstr to get RANDR_INTERFACE defines 2008-11-24 13:24:40 -08:00
Keith Packard
7c61db66a4 Create rrtransform.[ch]. Add RRTransform argument to RRCrtcNotify.
Instead of using a separate function to notify DIX about transform changes,
add the transform to RRCrtcNotify so that the whole Crtc state changes
atomically.
2008-11-24 13:24:40 -08:00
Keith Packard
6fe9c15731 Allow drivers to set crtc transforms.
Track curent transform down in the mode setting code so that it may be set
separately from RandR.
2008-11-24 13:24:40 -08:00
Keith Packard
49db14e4ac Handle RandR transform matrices in floating point.
RandR matrix computations lose too much precision in fixed point;
computations using the inverted matrix can be as much as 10 pixels off.
Convert them to double precision values and pass those around. These API
changes are fairly heavyweight; the official Render interface remains fixed
point, so the fixed point matrix comes along for the ride everywhere.
2008-11-24 13:24:40 -08:00
Keith Packard
6f734aecae 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.
2008-11-24 13:24:39 -08:00
Keith Packard
197aa78469 Report whether transforms are support from driver through extension to client
Add APIs to xf86RandR12 support and randr extension to record whether the
driver supports transforms, report that value in the RRGetCrtcTransform
reply.
2008-11-24 13:24:39 -08:00
Keith Packard
6d3a9e40a4 Compute matrix inversion instead of using wire version in RRCrtcTransformSet
It doesn't make sense to have the client invert this matrix when the server
can do so reasonably efficiently. This avoids weird fixed point rounding
errors when testing the transform against its inverse. Now to fix the
protocol.
2008-11-24 13:24:38 -08:00
Keith Packard
16c093afd4 Pass filter kernel size through transforms 2008-11-24 13:24:37 -08:00
Keith Packard
40f3dff6b3 Use transform when computing scanout size of modes
Report transformed crtc sizes through RandR and Xinerama. Test screen size
against transformed mode sizes when configuring the Crtc.
2008-11-24 13:24:37 -08:00
Keith Packard
f50349e193 [RANDR] Support filters in CRTC transforms.
Create new RRTransform datatype to hold all of the transform related
information, use that in lots of places to pass filters around.
2008-11-24 13:24:36 -08:00
Keith Packard
e3d6f279d5 Wire up RandR CRTC transform protocol, bump server to RandR 1.3
This involved removing a pile of matrix code from the DDX,
as well as moving a bit of transform logic from DDX to DIX.
2008-11-24 13:24:36 -08:00
Keith Packard
e063162e80 Add projective transforms to RandR DIX/DDX API.
New RRCrtcGetTransform function in DIX that DDX can use to get the pending
transform. The DDX code should be complete; the DIX code is just a stub at
this point.
2008-11-24 13:24:35 -08:00
James Cloos
b3c7e62664 Remove some null statements.
Remove several doubled statement-terminal semicolons.

Reported by Fernando Carrijo.
2008-11-08 12:21:20 -05:00
Pierre Willenbrock
8de26770a4 RANDR: Fix output property event delivery. 2008-10-16 14:28:14 -04:00
Keith Packard
9187f6ad9e RANDR: Delivery output property events. 2008-10-06 12:22:57 -04:00
Adam Jackson
e6b1c1fada const cleanup 2008-10-03 17:51:19 -04:00
Peter Harris
2b266eda6e Fix panoramiX request and reply swapping
Fix panoramiX request and reply swapping
 Set window and screen values in panoramix replies
 Prevent buffer overrun in ProcPanoramiXGetScreenSize
2008-09-21 19:19:24 +02:00
Keith Packard
31c62495f1 Drop a reference to user mode after create
User mode has no customer when create until assigned
to some output.
2008-09-10 13:11:09 +08:00
Zhenyu Wang
4e004c6828 Revert "randr: fix user mode create initial reference count"
This reverts commit 7c5ca85a9e.
2008-09-08 09:16:59 +08:00