Commit Graph

388 Commits

Author SHA1 Message Date
Keith Packard
0d01b66df9 randr: handle RRSetCrtcConfigs request with zero configs
Need to actually return a reply in this case.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:09:11 -08:00
Keith Packard
b0f4bd61f0 ProcRRSetCrtcConfigs uses 'configs' without being initialized
If the client sends invalid data for this request, the server
will jump to 'sendReply' and call RRFreeCrtcConfigs, passing it the
uninitialized 'configs' and 'num_configs' values.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:09:08 -08:00
Keith Packard
752c368421 Separate out screen size and screen pixmap sizes in RRScreenSizeSet
This provides for separate sizes for the screen scanout and rendering
buffer and the application-visible screen size.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:09:04 -08:00
Keith Packard
a88d70fb20 Set sprite transforms from RRSetCrtcConfigs
These were getting ignored.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:58 -08:00
Keith Packard
afb6ebf1d5 randr: Hook up the new RandR 1.4 functionality
This bumps the supported RandR protocol version and adds the dispatch
hooks needed to call the new functions

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:52 -08:00
Keith Packard
82612045e1 randr: Add per-crtc pixmaps
This adds new driver hooks to allocate scanout pixmaps and
changes the mode setting APIs to pass the new scanout pixmaps
along from DIX. DIX is responsible for reference counting the pixmaps
by tracking them through RRCrtcNotify.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:48 -08:00
Keith Packard
d94a035ea9 randr: Implement RRSetCrtcConfigs
This provides a driver-independent implementation of the
RRSetCrtcConfigs API by simply using the existing interfaces.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:43 -08:00
Keith Packard
66294afcab randr: Add sprite position transforms
This implements sprite position transformations. Sprite image
transforms are passed all the way to the DDX layer, but the images are
not yet manipulated before being passed to the drivers.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:40 -08:00
Adam Jackson
5b98c6267f randr: Remove mirandr
This isn't used anywhere, not least because it's completely
nonfunctional.

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-10-18 17:38:23 -04:00
Tobias Droste
c7e4222c9a randr: set error numbers of resource types in RRExtenstionInit() (V2)
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30367

Currently the ddx calls xf86RandR12Init()
  (-> RRScreenInit()
     -> RRInit()
       -> RRModeInit()
       -> RRCrtcInit()
       -> RROutputInit())
before RRExtensionInit() is called. This causes RRErrorBase
being 0 while setting resource type error values (resource types:
RROutput, RRMode and RRCrtc). The fix moves the setting of error
values to own functions which are called in RRExtensionInit()
to get the right RRErrorBase.

V2: With header file

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-29 14:41:53 -07:00
Dave Airlie
80d1a548d6 rotation: fix cursor and overlap of one pixel.
Commit 77c7a64e88 was introduced to fix
a cursor off by one on Intel hw, however it also move the whole crtc
into an off by one position and you could see gnom-eshell overlapping.

This commit reverts that and instead fixes the cursor hotspot
translation to work like pixman does. We add 0.5 to the cursor vector
before translating, and floor the value afterwards.

Thanks to Soeren (ssp) for pointing out where the real problem was
after explaning how pixman translates points.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-22 11:38:30 -07:00
Keith Packard
fd69234db0 Ignore RandR timestamps harder
Checking timestamps in post 1.1 randr requests was never a good idea,
let's ignore them and just make the configuration changes.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
2010-06-10 19:16:20 -07:00
Mikhail Gusarov
7287ef9e6c Remove unnecessary parentheses around return values in functions
This patch was generated by the following Perl code:

perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10 06:42:42 -07:00
Mikhail Gusarov
67b824a81b randr: Make deletion of output properties more robust
Previously there was two branches of code with small discrepancies between them
(especially prop->valid_values field was not free(3)ed). Extract the common
routine and fix double-free prop->valid_values in RRDestroyOutputProperty by
the way.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-06-06 21:53:28 +07:00
Mikhail Gusarov
0a4d8cbdcd Remove more superfluous if(p) checks around free(p)
This patch has been generated by the following Coccinelle semantic patch:

@@
expression E;
@@

-if(E) { free(E); }
+free(E);

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-06 20:27:18 +07:00
Keith Packard
faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05 19:23:03 -07:00
Jamey Sharp
e7fae9ecc4 Move each screen's root-window pointer into ScreenRec.
Many references to the WindowTable array already had the corresponding
screen pointer handy, which meant they usually looked like
"WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of
keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

xf86-video-dummy currently uses WindowTable, so it needs to be updated
to reflect this change.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
c38552d115 Add typed resource-lookup errors for non-core resource types.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:48 -07:00
Jamey Sharp
8033fb6c97 Set event sequence number in WriteEventsToClient instead of at callers.
TryClientEvents already did this; this commit just moves the assignment
one level down so that no event source has to worry about sequence
numbers.

...No event source, that is, except XKB, which inexplicably calls
WriteToClient directly for several events.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:34 -07:00
Jamey Sharp
4b9600a416 Make WriteEventsToClient/WriteToClient no-op on fake or dead clients.
This matches the test in TryClientEvents, and is a superset of tests
done by the callers of these functions. The consequence of forgetting
these tests is a server crash, so they're always desirable. In my
opinion, it's better to not require the callers to remember to do these
checks.

For callers that don't do very much work before calling WriteToClient or
WriteEventsToClient, I've removed the redundant checks.

hw/xquartz/xpr/appledri.c has an interesting case: While its check for
"client == NULL" appears redundant with the test in WriteEventsToClient,
it dereferences client to get the sequence number.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=27497
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:34 -07:00
Jamey Sharp
92ed75ac59 Eliminate boilerplate around client->noClientException.
Just let Dispatch() check for a noClientException, rather than making
every single dispatch procedure take care of it.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-05-13 17:14:07 -07:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.

X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13 00:22:37 +07:00
Keith Packard
28b7b2b8d0 unifdef -B -DRENDER to always include RENDER code
This patch was created with:

git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-19 09:26:10 -07:00
Peter Harris
97b03037f4 Don't double-swap the RandR PropertyNotify event
The event is already swapped in randr.c/SRROutputPropertyNotifyEvent, so
it should not be swapped here.

X.Org Bugzilla #26511: http://bugs.freedesktop.org/show_bug.cgi?id=26511

Tested-by: Leonardo Chiquitto <leonardo@ngdn.org>
Acked-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Julien Cristau <jcristau at debian.org>
Signed-off-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-12 14:55:19 -08:00
Alan Coopersmith
895f40792a Add type name argument to CreateNewResourceType
Convert all calls of CreateNewResourceType to pass name argument

Breaks DIX ABI.

ABI versions bumped:

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18 17:44:12 -08:00
Alan Coopersmith
a11c58fa0c Ensure all resource types created have names registered
Calls RegisterResourceName to record the type name for
use by X-Resource, XACE/SELinux/XTsol, and DTrace.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-12-18 16:51:45 -08:00
Adam Jackson
c7d1319872 randr: Fill in errorValue when verifying outputs/crtcs/modes
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-09 08:35:05 -08:00
Peter Hutterer
55747d256d input: define server-supported protocol versions in one single file.
include/protocol-versions.h specifies each extension version as supported by
the server and sent back on the wire to the client.

This fixes up several issues with the server potentially reporting a higher
version of the protocol if recompiled against a newer version of the
protocol.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Rémi Cardona <remi@gentoo.org>
Acked-by: Julien Cristau <jcristau@debian.org>
2009-09-21 21:47:35 +10:00
Peter Hutterer
00dfe69aab randr: reply with the server or client version, whichever is lower.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-21 08:12:02 +10:00
Keith Packard
2df10a4986 RRDestroyOutputProperty: Free randr property valid values
These were leaked when the property was destroyed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-20 20:45:25 +10:00
Keith Packard
d3a84906c0 Free randr crtc and output pointer arrays
All of the crts and outputs were freed, but not the arrays full of
pointers to them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-20 20:45:25 +10:00
Eamon Walsh
4098ad72d0 xace: fix access mode in dixLookupWindow within several RandR calls.
Referencing a screen using a window only requires GetAttr access.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-17 14:51:11 -04:00
Peter Hutterer
86b239ff9c randr: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:14:01 +10:00
Adam Jackson
b2d2af76b4 randr: fix typo in swapped dispatch 2009-06-15 10:10:26 -04:00
Benjamin Defnet
b2bf67b61c 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>
2009-06-11 23:27:36 -07:00
Federico Mena Quintero
e244a5991e 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>
2009-06-09 13:30:45 -07:00
Keith Packard
69a9545d1f 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>
2009-06-08 16:54:28 -07:00
Julien Cristau
12e725d08b 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>
2009-05-24 11:13:47 +02:00
Eamon Walsh
57aff88c7d Fix most remaining deprecated resource lookups.
Callsites updated to use dixLookupResourceBy{Type,Class}.
TODO: Audit access modes to make sure they reflect the usage.
2009-04-29 01:04:37 -04:00
Eamon Walsh
6544490700 Correct access mode in call to dixLookupWindow() within RRSelectInput.
Reported by Alan Coopersmith.
2009-03-09 17:29:24 -04:00
Keith Packard
812e8d681a Oops. 62fc98c had crtc offsets applied backwards (fix from server-1.6-branch)
Crtc offsets are in screen space, not crtc space, and hence should be
applied relative to the screen->crtc transform, not the crtc->transform.

This fix was found in the 'cherry pick' of 62fc98c on server-1.6-branch,
clearly some new definition of 'cherry pick' that I am unaware of.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-25 11:08:01 -08:00
Keith Packard
77c7a64e88 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>
2009-02-25 10:12:23 -08:00
Adam Jackson
1230939965 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".
2009-02-17 13:57:02 -05:00
Peter Ã…strand
ddb8d8945d xserver: Avoid sending uninitialized padding data over the network
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:38 +10:00
Aaron Plattner
c18f454e4a 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>
(cherry picked from commit 660c2a7d4c)
2009-02-13 12:41:14 -08:00
Keith Packard
62fc98cb88 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>
2009-02-03 20:20:57 -08:00
Keith Packard
4de5705545 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>
2009-01-30 20:21:28 -08:00
Eric Anholt
317f2b4a9f 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.
2009-01-30 19:35:55 -08:00
Keith Packard
c1f2be1f3f 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>
2009-01-30 19:15:53 -08:00
Keith Packard
6e49fdd2c8 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>
2009-01-30 15:43:04 -08:00
Julien Cristau
47438a2161 randr: RRSetPrimaryOutput can be static 2009-01-11 08:54:12 +01:00
Paulo Cesar Pereira de Andrade
200230535f Update sdk headers to export new symbols.
All symbols in installed sdk headers should be explicitly tagged
as exported symbols. Otherwise, to ensure it is not a mistake, one
could write it as something like:
extern /* NOEXPORT */ type name ...;
but the proper procedure really should be to use a non sdk header
(or a "noinst_" one).
  This patch also removes prototypes to some functions that existed
only temporarily.
2009-01-05 16:49:57 -02:00
Daniel Stone
e351d10773 RandR: Only export Xinerama symbols when building Xinerama support
Otherwise compilation fails due to sdksyms.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-05 17:41:38 +02:00
Maarten Maathuis
332d65ec7a randr: Consider panned crtc's when calculating xinerama screen sizes.
- This will allow window managers and applications to actually use the panned area.
2008-12-19 18:59:27 +01:00
Maarten Maathuis
91f73b79b7 randr: Improve per-crtc gamma support.
- The Gamma values from the monitor section are now used during initial config.
- The old colormap system is disabled when gamma set hook is available.
- Gamma values are now persistent for the lifetime of the xserver.
- This requires no driver changes and should be driver ABI compatible.
2008-12-17 17:03:12 +01:00
Peter Hutterer
cb95642dc8 Remove #define NEED_EVENTS and NEED_REPLIES
A grep on xorg/* revealed there's no consumer of this define.

Quote Alan Coopersmith:
"The consumer was in past versions of the headers now located
in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h,
all the event definitions were only available if NEED_EVENTS were
defined, and all the reply definitions required NEED_REPLIES.

Looks like Xproto.h dropped them by X11R6.3, which didn't have
the #ifdef's anymore, so these are truly ancient now."

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-12 11:43:32 +10:00
Matthias Hopf
fd77ce9f88 randr: Oops, miscalculated panning rectangle's coordinates 2008-12-11 18:30:25 +01:00
Adam Jackson
86c64ddf21 randr: clear primaryOutput when the output is deleted 2008-12-10 11:31:28 -05:00
Adam Jackson
fe65f400ed randr: use primary output for RRFirstOutput() 2008-12-10 11:31:28 -05:00
Adam Jackson
cdcb516e56 randr: Mangle GetScreenResources sort order based on primary output 2008-12-10 11:31:28 -05:00
Adam Jackson
d7b316e82b randr: Mangle compat Xinerama reply based on primary output 2008-12-10 11:31:27 -05:00
Adam Jackson
9d58d2a319 randr: Add [GS]etOutputPrimary 2008-12-10 11:31:21 -05:00
Matthias Hopf
44bef8b850 randr: Update SProcRandrVector for panning 2008-12-05 15:37:15 +01:00
Matthias Hopf
825b2c2f4a randr: Nuke config-timestamp for panning 2008-12-04 18:16:43 +01:00
Matthias Hopf
eeeb98d1df randr: Protocol bits for panning support 2008-12-04 18:16:43 +01:00
Julien Cristau
0b5ecabfb8 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>
2008-12-03 17:33:47 +01:00
Paulo Cesar Pereira de Andrade
49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Adam Jackson
b0d371ab0a 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
2008-12-01 11:36:06 -05:00
Paulo Cesar Pereira de Andrade
fb22d4d928 Remove declarations of symbols that are never defined.
These symbols were removed from the X Server, or never declared.
  One symbol that may need special attention is XkbBuildCoreState(),
that doesn't have a prototype anywhere, but is called from
xkb/xkbEvents.c:XkbFilterEvents(), and also used by the macros
XkbStateFieldFromRec() and XkbGrabStateFromRec() defined in
include/xkbstr.h.
  fb/wfbrename.h also may need some cleanup, as it makes several
"renames" of non existing symbols.
2008-11-30 01:33:20 -02:00
Paulo Cesar Pereira de Andrade
d6cbd4511e Export symbols defined in the sdk.
This is the biggest "visibility" patch. Instead of doing a "export"
symbol on demand, export everything in the sdk, so that if some module
fails due to an unresolved symbol, it is because it is using a symbol
not in the sdk.

  Most exported symbols shouldn't really be made visible, neither
advertised in the sdk, as they are only used by a single shared object.

  Symbols in the sdk (or referenced in sdk macros), but not defined
anywhere include:
XkbBuildCoreState()
XkbInitialMap
XkbXIUnsupported
XkbCheckActionVMods()
XkbSendCompatNotify()
XkbDDXFakePointerButton()
XkbDDXApplyConfig()
_XkbStrCaseCmp()
_XkbErrMessages[]
_XkbErrCode
_XkbErrLocation
_XkbErrData
XkbAccessXDetailText()
XkbNKNDetailMaskText()
XkbLookupGroupAndLevel()
XkbInitAtoms()
XkbGetOrderedDrawables()
XkbFreeOrderedDrawables()
XkbConvertXkbComponents()
XkbWriteXKBSemantics()
XkbWriteXKBLayout()
XkbWriteXKBKeymap()
XkbWriteXKBFile()
XkbWriteCFile()
XkbWriteXKMFile()
XkbWriteToServer()
XkbMergeFile()
XkmFindTOCEntry()
XkmReadFileSection()
XkmReadFileSectionName()
InitExtInput()
xf86CheckButton()
xf86SwitchCoreDevice()
RamDacSetGamma()
RamDacRestoreDACValues()
xf86Bpp
xf86ConfigPix24
xf86MouseCflags[]
xf86SupportedMouseTypes[]
xf86NumMouseTypes
xf86ChangeBusIndex()
xf86EntityEnter()
xf86EntityLeave()
xf86WrapperInit()
xf86RingBell()
xf86findOptionBoolean()
xf86debugListOptions()
LoadSubModuleLocal()
LoaderSymbolLocal()
getInt10Rec()
xf86CurrentScreen
xf86ReallocatePciResources()
xf86NewSerialNumber()
xf86RandRSetInitialMode()
fbCompositeSolidMask_nx1xn
fbCompositeSolidMask_nx8888x0565C
fbCompositeSolidMask_nx8888x8888C
fbCompositeSolidMask_nx8x0565
fbCompositeSolidMask_nx8x0888
fbCompositeSolidMask_nx8x8888
fbCompositeSrc_0565x0565
fbCompositeSrc_8888x0565
fbCompositeSrc_8888x0888
fbCompositeSrc_8888x8888
fbCompositeSrcAdd_1000x1000
fbCompositeSrcAdd_8000x8000
fbCompositeSrcAdd_8888x8888
fbGeneration
fbIn
fbOver
fbOver24
fbOverlayGeneration
fbRasterizeEdges
fbRestoreAreas
fbSaveAreas
composeFunctions
VBEBuildVbeModeList()
VBECalcVbeModeIndex()
TIramdac3030CalculateMNPForClock()
shadowBufPtr
shadowFindBuf()
miRRGetScreenInfo()
RRSetScreenConfig()
RRModePruneUnused()
PixmanImageFromPicture()
extern int miPointerGetMotionEvents()
miClipPicture()
miRasterizeTriangle()
fbPush1toN()
fbInitializeBackingStore()
ddxBeforeReset()
SetupSprite()
InitSprite()
DGADeliverEvent()

  SPECIAL CASES
o defined as _X_INTERNAL
	xf86NewInputDevice()
o defined as static
	fbGCPrivateKey
	fbOverlayScreenPrivateKey
	fbScreenPrivateKey
	fbWinPrivateKey
o defined in libXfont.so, but declared in xorg/dixfont.h
	GetGlyphs()
	QueryGlyphExtents()
	QueryTextExtents()
	ParseGlyphCachingMode()
	InitGlyphCaching()
	SetGlyphCachingMode()
2008-11-29 23:56:06 -02:00
Keith Packard
fc70839431 Add server support for RRGetScreenResourcesCurrent
This depends on randrproto 1.2.99.1

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-11-26 15:50:54 -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
Zhenyu Wang
7c5ca85a9e randr: fix user mode create initial reference count
Don't need extra reference count adding when creating user mode.
This fixes user mode destroy, otherwise we get BadAccess error.
2008-09-03 09:41:00 +08:00
Tomas Carnecky
ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00
Julien Cristau
01264f1792 Add swapped dispatch for randr 1.2 requests 2008-08-21 09:24:02 +02:00
Adam Jackson
64ef7ed072 Centralize declaration of ConnectionInfo. 2008-08-20 13:14:34 -04:00
Tomas Carnecky
68fd6604a1 OutputPropertyNotifyMask is a valid thing to select for. 2008-07-31 10:03:56 -04:00
Adam Jackson
9757106bba Remove all empty extension reset hooks, replace with NULL. 2008-07-24 15:46:08 -04:00
Peter Hutterer
d894e86aa5 randr: remove superfluous check against uninitialised variable.
Thanks to Eamon Walsh for pointing this out.
2008-06-15 11:47:08 +09:30
Eamon Walsh
e90fcd8294 Fix "warning: no previous prototype for ‘miRROutputGetProperty’". 2008-06-13 22:26:43 -04:00
Peter Hutterer
fd06e8f8c1 Merge branch 'master' into dcdc_rework
Conflicts:

	Xext/xevie.c
	dix/dispatch.c
2008-04-07 07:56:41 +09:30
Jesse Barnes
ba85caacb5 Make xf86SetDesiredModes aware of current output configuration
By adding a new output callback, ->get_crtc, xf86SetDesiredModes is able to
avoid turning off outputs & CRTCs if the current output<->CRTC mappings are the
same as the desired configuration.  This helps avoid flickering displays at
startup time, which speeds things up a little and looks better.
2008-03-17 14:13:09 -07:00
Matthias Hopf
2036851125 Return randr interface version in xf86CrtcScreenInit()
Necessary to allow drivers to be run-time backwards compatible when using the
modes/ functions w/o providing their own copy.
2008-03-12 11:37:28 +01:00
Jesse Barnes
ca616b902b Allow RandR get output property to call into drivers
In order to report accurate values to users of the RandR property interface,
it's sometimes necessary to ask the driver to update the value (for example
when backlight brightness changes without the server's knowledge, due to hotkey
events or direct sysfs banging).

This patch wires up the core server code with a new xf86CrtcFuncs callback,
get_property, to allow for this.

The new code is available under the RANDR_13_INTERFACE define, which in turn
depends on the RANDR_12_INTERFACE code.
2008-03-06 13:50:58 -08:00
George Sapountzis
3d64290547 clean some "unused" warnings 2008-03-01 19:49:24 +02:00
Eamon Walsh
27bcf40cda XACE: Fix instances of DixUnknownAccess at hook callsites. 2008-02-28 16:43:43 -05:00
Peter Hutterer
8da83836b6 Merge branch 'master' into mpx
Conflicts:

	XTrap/xtrapddmi.c
	Xext/security.c
	Xext/xprint.c
	Xext/xtest.c
	Xext/xvdisp.c
	Xi/exevents.c
	Xi/grabdevb.c
	Xi/grabdevk.c
	Xi/opendev.c
	Xi/ungrdev.c
	Xi/ungrdevb.c
	Xi/ungrdevk.c
	dix/cursor.c
	dix/devices.c
	dix/dixutils.c
	dix/events.c
	dix/getevents.c
	dix/main.c
	dix/window.c
	hw/xfree86/ramdac/xf86Cursor.c
	include/dix.h
	include/input.h
	include/inputstr.h
	mi/midispcur.c
	mi/miinitext.c
	mi/misprite.c
	render/animcur.c
	xfixes/cursor.c
	xkb/xkbAccessX.c
2008-01-03 17:04:54 +10:30
Eamon Walsh
d4577e4853 Revert "registry: Register RANDR extension protocol names."
This reverts commit c827db57e4.

Moving all the names into dix/registry.c
2007-11-20 17:51:27 -05:00
Eamon Walsh
546d46224e Revert "registry: Register XINERAMA extension protocol names."
This reverts commit b9f5ab98c8.

Moving all the names into dix/registry.c
2007-11-20 17:37:48 -05:00
Eamon Walsh
2d17f47cc7 Merge branch 'master' into XACE-SELINUX
Conflicts:

	hw/xnest/Pixmap.c
	include/dix.h
2007-11-19 18:10:46 -05:00
Jernej Azarija
a46c30c3be Bug #12531: RRModesForScreen can fail to allocate. 2007-11-18 11:45:13 -05:00
Adam Jackson
70e50fa51f Allocate RRCrtcRecs with calloc. 2007-11-15 17:00:37 -05:00
Eamon Walsh
1603130236 Merge branch 'master' into XACE-SELINUX
Conflicts:

	Xext/xace.c
	Xext/xace.h
2007-11-14 13:35:50 -05:00
Matthias Hopf
f7dd0c72b8 Only clear crtc of output if it is the one we're actually working on.
Upon recreation of the RandR internal data structures in RRCrtcNotify() the
crtc of an output could be NULLed if the crtc was shared (cloned) between two
outputs and one of them got another crtc assigned.
2007-11-12 15:12:21 +01:00
Peter Hutterer
0b729051c0 Merge branch 'master' into mpx
Conflicts:

	Xi/extinit.c
	Xi/grabdev.c
	Xi/setmode.c
	Xi/ungrdev.c
	dix/devices.c
	dix/events.c
	dix/getevents.c
	include/dix.h
	mi/midispcur.c
	mi/misprite.c
	xkb/xkbActions.c
	xkb/xkbEvents.c
	xkb/xkbPrKeyEv.c
2007-11-07 15:37:23 +10:30
Eamon Walsh
a52c9b2a59 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dispatch.c
	dix/property.c
	hw/xfree86/common/xf86VidMode.c
	include/xkbsrv.h
	render/glyph.c
	xkb/xkbActions.c
2007-11-05 19:08:36 -05:00
Daniel Stone
2d738efb95 RandR: Remove usage of alloca
Replace with heap allocations.
2007-11-05 14:34:41 +00:00
Eamon Walsh
fe97f7c54a registry: Add some missing #include's. 2007-10-15 22:46:08 -04:00
Eamon Walsh
c827db57e4 registry: Register RANDR extension protocol names. 2007-10-15 19:06:01 -04:00
Eamon Walsh
b9f5ab98c8 registry: Register XINERAMA extension protocol names. 2007-10-15 16:18:37 -04:00
Eamon Walsh
6adeba1730 dix: Add a new "registry" mechanism for registering string names of things.
Supports protocol requests, events, and errors, and resource names.
Modify XRES extension to use it.
2007-10-11 14:18:59 -04:00
Eamon Walsh
97c150b61b Merge branch 'master' into XACE-SELINUX
Conflicts:

	afb/afbpntwin.c
	afb/afbscrinit.c
	afb/afbwindow.c
	cfb/cfb.h
	cfb/cfballpriv.c
	cfb/cfbscrinit.c
	cfb/cfbwindow.c
	configure.ac
	fb/wfbrename.h
	hw/xfree86/xf4bpp/ppcIO.c
	hw/xfree86/xf4bpp/ppcPntWin.c
	hw/xfree86/xf4bpp/ppcWindow.c
	hw/xfree86/xf8_32bpp/cfbscrinit.c
	mfb/mfb.h
	mfb/mfbpntwin.c
	mfb/mfbscrinit.c
	mfb/mfbwindow.c
	mi/miexpose.c

Note: conflicts caused by devPrivates rework vs. paintwindow changes.
2007-09-19 07:25:55 -04:00
Tilman Sauerbeck
7bd6557701 Initialize output->pendingProperties. 2007-09-15 14:01:57 +02:00
Peter Hutterer
cc5c926267 randr: RRPointerScreenConfigured needs to move all pointers.
Previous version only moved the VCP, causing "bogus pointer events" lateron.
Now we run through the device list, updating each pointer separately if
necessary.

Also stick a big warning into RRPointerMoved, not sure what device we need to
work on here.
2007-09-05 15:08:57 +09:30
Adam Jackson
1afdf8b0a9 [RANDR] Don't mark Xinerama as active if no crtcs are enabled. (bug #11504).
Clients expect any Xinerama-enabled screen to report at least one
monitor, but with RandR, there may not be any enabled crtcs. In this case,
tell the client that Xinerama is not active.
2007-08-31 22:11:13 -07:00
Marius Gedminas
0dc2bb6101 [RANDR] Compare only milliseconds of config time. (Bug #6502)
The timestamp transferred in the X protocol is a 32-bit number of
milliseconds.

The timestamp stored in the server is a structure that contains two fields:
months (!) and milliseconds.

When the server passes the config timestamp to the client, it discards the
months part and sends only the milliseconds part.

When the server receives the config timestamp from the client, it tries to
guess the "months" part by looking at the current time and then maybe adding
or
subtracting one.  The guess is wrong after the server has been running long
enough (several hours).

I have added two ErrorF calls around the 'if' statement that returns
RRSetConfigInvalidConfigTimestamp in randr/randr.c and my Xorg.0.log has
this:

  randr request got good config time: 0:-2103495671

for the first few successful xrandr calls, and

  randr request failed with RRSetConfigInvalidConfigTime: client passed
  1:-2103495671, server has 0:-2103495671

when it fails.  The server has been running for 8 and a half hours.

The obvious fix would be to ignore the months field and only compare the
milliseconds.
2007-08-31 21:36:37 -07:00
Eamon Walsh
4017d31902 devPrivates rework: since API is already broken, switch everything
over to new system.

Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
2007-08-28 09:28:25 -04:00
Peter Hutterer
f367285fd5 Merge branch 'master' into mpx
Conflicts:

	Xi/exevents.c
	dix/devices.c
	dix/getevents.c
	include/dix.h
	mi/mieq.c
2007-08-12 15:31:10 +09:30
Keith Packard
b2dcfbca24 RRScanOldConfig cannot use RRFirstOutput before output is configured.
RRFirstOutput returns the first active output, which won't be set until
after RRScanOldConfig is finished running. Instead, just use the first
output (which is the only output present with an old driver, after all).
2007-08-08 12:16:32 -07:00
Keith Packard
b4193a2eee RRScanOldConfig wasn't getting crtcs set correctly
The output crtc is set by RRCrtcNotify, which is called at the end of
RRScanOldConfig. Several uses of output->crtc in this function were wrong.
2007-08-07 12:47:18 -07:00
Keith Packard
2b93cbb5f8 Decrement mode count when removing RandR output mode.
Removing an output mode without decrementing the mode count scrambles the
output mode array badly.
2007-08-07 12:47:18 -07:00
Aaron Plattner
aec0d06469 Fix a crash when rotating the screen.
Remember output->crtc before setting a NULL mode because RRCrtcNotify now sets
output->crtc to NULL.  Use the saved crtc to set the new mode.
2007-07-31 16:33:37 -07:00
Gustavo Pichorim Boiko
8d23031904 Fix the output->crtc initialization in the old randr setup 2007-07-25 18:12:47 +02:00
Gustavo Pichorim Boiko
5b424b562e Set the crtc before the output change is notified
Set the new randr crtc of the output before the output change notification is
delivered to the clients.
Remove RROutputSetCrtc as it is not really necessary. All we have to do is set
the output's crtc on RRCrtcNotify
2007-07-23 14:47:45 -07:00
Keith Packard
8773ad023e Screen size bounds check in ProcRRSetCrtcConfig not masking out reflections.
When checking how to validate the selected mode and position against the
current screen size, the test against 90/270 rotation did not mask out
reflection, so that when reflection was specified, the 90/270 test would
never succeed. This caused incorrect bounds checking and would return
an error to the user instead of rotating the screen.
2007-07-14 09:03:47 -07:00
Peter Hutterer
1f97a76476 Merge branch 'master' into mpx
Conflicts:

	dix/devices.c
	hw/xfree86/common/xf86Xinput.c
	hw/xfree86/loader/xf86sym.c
	mi/mieq.c
2007-06-19 17:20:52 +09:30
Luo Jie
1f48995d66 Fix build of composite, dix, and randr when Xinerama is disabled. 2007-05-24 11:20:59 -07:00
Peter Hutterer
f28eea0647 Merge branch 'master' into mpx
Conflicts:

	dix/devices.c
	dix/events.c
2007-04-27 16:34:36 +09:30
Paulo Ricardo Zanoni
82f97e1c0c Enable event delivery for multiple heads.
Requires moving the spriteTrace into the DeviceIntRec and adjusting a few
functions to take in device argument, most notably XYToWindow().

Cursor rendering on the second screen is busted.
2007-04-26 15:58:50 +09:30
Adam Jackson
9c80eda826 Disable RANDR's fake Xinerama protocol when there's more than one screen.
... in the protocol sense.  Xinerama doesn't have any provision for more
than one protocol screen each with its own geometry.

Red Hat bug #231257.
2007-04-25 16:35:04 -04:00
Keith Packard
b5823ea3e1 RandR 1.2 spec says CRTC info contains screen-relative geometry.
Was reporting mode size instead of adjusting for rotation.
(cherry picked from commit e2e7c47a52)
2007-04-16 08:11:30 -03:00
Peter Hutterer
d4dad6f84f Merge branch 'master' into mpx
Conflicts:

	configure.ac
	dix/events.c
	hw/xfree86/common/xf86Xinput.c
2007-04-12 11:11:03 +09:30
Keith Packard
f77a8ea849 Rotate screen size as needed from RandR 1.1 change requests.
Screen size must reflect rotated mode size when setting rotated mode using
RandR 1.1 SetScreenConfig request.
(cherry picked from commit efcec7dbd3)
2007-04-10 12:36:50 -07:00
Aaron Plattner
c10df5b967 Swap RRScreenChangeNotifyEvent dimensions when the screen has one crtc and it's rotated.
RandR 1.1 clients expect the size fields in this event to be the unrotated
dimensions of the screen.  This behavior is "weird", but that's the way the old
code worked so we need to be bug-compatible with it.
2007-04-03 16:09:04 -07:00
Peter Hutterer
e8777a91f3 Merge branch 'master' into mpx
Conflicts:

	Xi/closedev.c
	Xi/exevents.c
	Xi/extinit.c
	Xi/listdev.c
	dix/window.c
	hw/xfree86/common/xf86Xinput.c
	include/extinit.h
	mi/mipointer.c
2007-04-02 15:36:26 +09:30
Keith Packard
804080a709 Make pending properties force mode set. And, remove AttachScreen calls.
Yes, two changes in one commit. Sorry 'bout that.

The first change ensures that when pending property values have been
changed, a mode set to the current mode will actually do something, rather
than being identified as a no-op. In addition, the driver no longer needs to
manage the migration of pending to current values, that is handled both
within the xf86 mode setting code (to deal with non-RandR changes) as well
as within the RandR extension itself.

The second change eliminates the two-call Create/AttachScreen stuff that was
done in a failed attempt to create RandR resources before the screen
structures were allocated. Merging these back into the Create function is
cleaner.
(cherry picked from commit 57e87e0d00)

Conflicts:

	randr/randrstr.h
	randr/rrcrtc.c

I think master and server-1.3-branch are more in sync now.
2007-03-24 00:01:47 -07:00
Keith Packard
476f2b5aef Incorrect extra memory copy in RRChangeOutputProperty.
Left over from previous version of the code, this memmove will break when
the mode is not Replace.
(cherry picked from commit 945aa0aa55)
2007-03-23 01:32:45 -07:00
Keith Packard
7093367c39 Fix Pending property API, adding RRPostPendingProperty.
Pending Properties take effect when the driver says they do, so provide an
API to tell DIX when a property effect is made. Also, allow driver
to reject property values in RRChangeOutputProperty.
(cherry picked from commit 8eb288fbd6)
2007-03-23 01:32:34 -07:00
Keith Packard
86d76390eb Make sure RandR events are delivered from RRCrtcSet.
Some paths were skipping the event delivery stage.
(cherry picked from commit 9ca7ba5d60)
2007-03-23 01:30:32 -07:00
Keith Packard
479b2be4ba Clear allocated RandR screen private structure.
Use xcalloc instead of xalloc when allocating this structure to ensure
consistent contents at startup.
(cherry picked from commit 16f4c0c175)
2007-03-23 01:30:10 -07:00
Peter Hutterer
015d728bcd Merge branch 'master' into mpx
Conflicts:

	dix/devices.c
	dix/events.c
	mi/misprite.c
2007-03-19 09:42:56 +10:30
Keith Packard
2489dae9f7 Correct ref counting of RRMode structures
RRModes are referenced by the resource db, RROutput and RRCrtc structures.
Ensure that the mode reference count is decremented each time a reference is
lost from one of these sources. The missing destroys were in
RRCrtcDestroyResource and RROutputDestroyResource, which only happen at
server reset time, so modes would be unavailable in subsequent server
generations.
2007-03-17 23:38:28 -07:00
Keith Packard
9d0c3b52f2 Eliminate RRModeRec devPrivate field.
The xf86 mode setting code was mis-using this field to try and store a
pointer to a DisplayModeRec, however, each output has its own copy of every
DisplayModeRec leaving the one in in the RRModeRec devPrivate field pointing
at a random DisplayModeRec.

Instead of attempting to rectify this, eliminating the devPrivate entirely
turned out to be very easy; the DDX code now accepts an arbitrary RRModeRec
structure and set that to the hardware, converting it on the fly to a
DisplayModeRec as needed.
(cherry picked from commit 3506b9376c)
2007-03-17 23:34:58 -07:00
Keith Packard
2c93083edd Add support for user-defined modelines in RandR.
The RandR protocol spec has several requests in support of user-defined
modes, but the implementation was stubbed out inside the X server. Fill out
the DIX portion and start on the xf86 DDX portion. It might be necessary to
add more code to the DDX to insert the user-defined modes into the output
mode list.
(cherry picked from commit 63cc2a51ef)

Conflicts:

	randr/randrstr.h

Updated code to work in master with recent security API changes.
2007-03-17 23:20:07 -07:00
Eric Anholt
3b71b0f89f Set the RandR version returned, rather than just passing the proto's version. 2007-03-15 13:21:00 -07:00
Jens Granseuer
689d52b624 Bugzilla #7145: fix build with gcc 2.95
Bugzilla #7145: <http://bugs.freedesktop.org/show_bug.cgi?id=7145>
Patch #8987: <http://bugs.freedesktop.org/attachment.cgi?id=8987>
2007-03-05 15:31:44 -08:00
Peter Hutterer
1f0075786f Merge branch 'master' into mpx
Conflicts:

	configure.ac
	dix/getevents.c
	hw/xfree86/ramdac/xf86Cursor.c
	mi/mipointer.c
	xkb/xkbUtils.c
2007-03-05 12:37:17 +10:30
Aaron Plattner
06c3021aec Don't crash setting a NULL mode with a randr classic DDX. Also remember to update the screen size during modesets. 2007-02-28 16:13:13 -08:00
Aaron Plattner
8b24575884 Return BadMatch if a client tries to clone non-cloneable outputs. 2007-02-28 12:35:50 -08:00
Keith Packard
8606aeb9b2 RRConfigureOutputProperty is a variable length request.
Replace REQUEST_SIZE_MATCH with REQUEST_AT_LEAST_SIZE
2007-02-17 15:16:11 -08:00
Keith Packard
258beebc77 Report correct RandR 1.0 sizeID. Report correct subpixel order.
RandR 1.0 sizeID must be computed the same way every time, so when reporting
it in the ScreenChangeNotify event, just construct the usual 1.0 data block
and use that.

subpixel geometry information can be computed by looking at the connected
outputs and finding any with subpixel geometry and using one of those for
the global screen subpixel geometry. This might be improved by reporting
None if more than one screen has information and they conflict.
2007-02-15 20:37:44 -08:00
Eric Anholt
4f2f3233c8 Fix the size expectations of xRRSetCrtcGamma.
It was using REQUEST_SIZE_MATCH (client request length must equal request size)
rather than REQUEST_AT_LEAST_SIZE (client request length must be at least
big enough for request size), and this request has data following the request
structure.
2007-02-01 15:10:29 -08:00
Peter Hutterer
15a81b6325 Merge branch 'master' 2007-01-28 17:18:57 +10:30
Eric Anholt
a53586eebc Warning fix for RRCrtcSetRotations(). 2007-01-24 13:36:25 -08:00
Keith Packard
b6b8559321 Make Xinearama screen information reflect CRTC rotation. 2007-01-24 13:34:58 -08:00
Eric Anholt
a811e92104 Account for CRTC rotation in the cursor containment code. 2007-01-18 14:28:41 -08:00
Eric Anholt
42a48786ac Add a setter for randr_crtc->rotations. 2007-01-17 14:34:42 -08:00
Eric Anholt
cde17015df When changing a non-pending property, call the screen rrOutputSetProperty hook. 2007-01-16 13:01:45 -08:00
Eric Anholt
e3add7c8ec Don't forget to add the property we configure to the properties list. 2007-01-16 13:01:44 -08:00
Keith Packard
953a9ef949 Track physical screen size and send out updates when that changes.
Events and internal data structures need to be updated whenever the physical
or pixel size of the screen changes. The code was ignoring the physical
size, so changing only that would not be registered anywhere.
(cherry picked from f42e3cea23 commit)
2007-01-02 09:18:50 +11:00
Keith Packard
e79602fca2 Use RRScreenSetSizeRange in 1.0 compat. Check RRGetInfo for error.
The RRScreenSizeSetRange function is used externally for 1.2 API drivers,
but can also be used in the 1.0 compatibility code. This also ensures that
the right changed bits are set so that clients are correctly notified when
the range changes.

RRGetInfo can return an error, use that to return BadAlloc to clients
instead of blindly going on with various requests.
(cherry picked from f05dd384d3 commit)
2007-01-02 09:13:39 +11:00
Peter Hutterer
2d0a63126b Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver 2006-12-19 10:31:40 +10:30
Eamon Walsh
25d5e0a629 Convert callers of SecurityLookupWindow() to dixLookupWindow(). 2006-12-15 15:50:46 -05:00
Eamon Walsh
04c721854f Convert callers of LookupWindow() to dixLookupWindow(). 2006-12-15 14:19:54 -05:00
Keith Packard
670bbb8731 RandR 1.2 rotation code must adjust width/height.
Mode lines reflect the monitor mode, not the projected size into the frame
buffer. Flip width/height around so that the dimensions are oriented
correctly.
(cherry picked from 612a8e6180 commit)
2006-12-15 18:32:32 +11:00
Keith Packard
6c6901434a RandR 1.0 refresh rates unscrambled. SetScreenConfig uses RRCrtcSet right.
RandR 1.0 refresh rates were scrambled when working with a 1.2 driver that
returned sizes in a mixed order. SetScreenConfig was treating RRCrtcSet as
returning an RandR status instead of a Bool.
(cherry picked from 6dc711833d commit)
2006-12-15 18:32:25 +11:00
Keith Packard
628c7daeb1 RandR: config time updates when hardware config changes.
The config time in the RandR protocol reflects when the hardware state has
changed. It was getting changed anytime the driver changed the usage
of the hardware as well.
(cherry picked from 98d18a6578 commit)
2006-12-15 18:32:18 +11:00
Keith Packard
d742025f43 RandR mode list needs both output and crtc modes.
When an output no longer reports the current mode, it must still be included
in the list advertised by the X server. Walk the crtcs to ensure it is
included.
(cherry picked from 78689d0d66 commit)
2006-12-15 18:32:10 +11:00
Eamon Walsh
51b69ff499 Remove instances of macro SECURITY_VERIFY_DRAWABLE. 2006-12-14 17:53:43 -05:00
Eamon Walsh
6c46645cfc Naming change: Security*Access -> Dix*Access 2006-12-14 14:45:42 -05:00
Peter Hutterer
eb1d9f51af Ironing some glitches caused by the merge 2006-12-05 18:50:19 +10:30
Keith Packard
89b2aa9be8 Destroying RandR crtc or output overwrites memory.
RRCrtcDestroyResource and RROutputDestroyResource had matching
bugs that would overwrite memory past the end of the storage
of the crtc or output arrays. Oops.
(cherry picked from 4202b23ed8 commit)
2006-12-02 10:46:30 +11:00
Keith Packard
23ba72323a RandR ListOutputProperties has nAtoms element, not nProperties
Earlier RandR 1.2 encoding revisions used 8-bit nProperties field.
Final RandR 1.2 spec uses 16-bit nAtoms field instead.
(cherry picked from 66b6358a39 commit)
2006-12-02 10:44:06 +11:00
Keith Packard
b0c8558b9d Ensure RandR resource types are registered before resources are created.
Now that resources can be created during server initialization, make sure
the crtc, output and mode resource types are created before attempting to
create associated resources.
(cherry picked from commit ec83d67416)
2006-11-28 11:13:43 -08:00
Keith Packard
6245e9dd47 Allocate correct size for RRPropertyRec (oops).
Neglected to change the allocation size from sizeof (PropertyRec) to
sizeof (RRPropertyRec). Lots of fun crashes this way.
(cherry picked from commit 0626eb8e5c)
2006-11-28 11:13:43 -08:00
Keith Packard
24abce8032 Change RandR property datatype to include pending/valid values.
This patch tracks the protocol changes which introduce more complex
semantics for RandR output properties including pending and valid value
information.
(cherry picked from commit af55c65bea)
2006-11-28 11:13:43 -08:00
Keith Packard
ef47d9c3ba Reduce calls to RRGetInfo.
RRGetInfo can be expensive. Don't invoke it when quering Xinerama
information or setting a new CRTC configuration.
(cherry picked from commit b5aa9eb8e6)
2006-11-16 17:39:26 -08:00
Keith Packard
07b26e690c Remove RandR output options.
RandR output options are now expected to be handled by properties instead.
(cherry picked from commit 8b2a7e94a1)
2006-11-16 17:39:21 -08:00
Keith Packard
0dee48b8af Add RRInit function to create resource types for RR objects.
To allow RandR objects to be created before the screen object exists,
the resource types must be registered with the resource database.
A driver wishing to create RandR objects must call RRInit before doing so.

Also, fix a segfault when setting Output data before it is associated with a
screen.
2006-11-08 23:17:55 -08:00
Keith Packard
ec77a95a02 Allow RandR objects to be created before the associated ScreenRec.
xf86 drivers need to create RandR object in the PreInit stage,
before the ScreenRec is allocated. Changing the RandR DIX code
to permit this required the addition of functions that later associate the
objects with the related screen.

An additional change is that modes are now global, and no longer associated
with a specific screen. This change actually makes mode management cleaner
as there is no more per-screen list of modes to deal with.

This changes the RandR 1.2 ABI/API for drivers.
2006-11-08 21:36:35 -08:00
Eric Anholt
cde8806c29 Don't bump the refcnt if the new mode is NULL. 2006-11-03 16:36:34 -08:00
Keith Packard
4056e6e79a Move physical size from mode to output.
Modes can be shared across different sized monitors this way.

Also caught some missing byteswapping and an incorrect return type.
2006-11-01 00:29:46 -08:00
Keith Packard
e21604914d Merge master back in and clean up some unfinished code (closes 8745) 2006-10-25 09:48:23 -07:00
Keith Packard
59511974db Merge branch 'master' into randr-1.2 2006-10-24 17:26:20 -07:00
Keith Packard
828c34e83c Byte swap RRSelectInput enable flags. 2006-10-24 17:23:02 -07:00
Keith Packard
054f8cd267 Limit pointer to valid crtc areas. Add event swapping. Fix change tracking.
Add function to keep pointer within valid crtc areas.
Finish event delivery and swapping code.
Separate configuration from layout changes to send correct events.
2006-10-13 17:34:53 -07:00
Keith Packard
1178796a4d Add preferred modes for each output. Round vrefresh. Deliver crtc events. 2006-10-05 22:31:35 -07:00
Keith Packard
c4f30c6353 Add mode origins and output options. Fix memmoves in resource free funcs.
Output options and mode origins both affected driver ABI.  memmove mistakes
were causing 'Freeing resource which isn't there' messages.

Prune unused non-user defined modes from available list now.
2006-10-03 21:06:11 -07:00