Compare commits

...

344 Commits

Author SHA1 Message Date
Matthieu Herrb 03ff880e8b Fix CVE-2011-4029: File permission change vulnerability.
Use fchmod() to change permissions of the lock file instead
of chmod(), thus avoid the race that can be exploited to set
a symbolic link to any file or directory in the system.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit b67581cf82)
(cherry picked from commit 12f65819ff)
2011-10-21 20:43:22 +02:00
Matthieu Herrb 3394ae378d Fix CVE-2011-4028: File disclosure vulnerability.
use O_NOFOLLOW to open the existing lock file, so symbolic links
aren't followed, thus avoid revealing if it point to an existing
file.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 6ba44b91e3)
(cherry picked from commit f80d233578)
2011-10-21 20:43:19 +02:00
Julien Cristau 656307e93a glx: Work around wrong request lengths sent by mesa
mesa used to send too long requests for GLXDestroyPixmap,
GLXDestroyWindow, GLXChangeDrawableAttributes, GLXGetDrawableAttributes
and GLXGetFBConfigsSGIX.

Fixes a regression introduced in ec9c97c6bf
X.Org bug#33324 <https://bugs.freedesktop.org/show_bug.cgi?id=33324>

Reported-by: xunx.fang@intel.com
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 402b329c3a)
2011-10-21 20:37:51 +02:00
Julien Cristau c821bd84e5 glx: fix BindTexImageEXT length check
The request is followed by a list of attributes.

X.Org bug#33449

Reported-and-tested-by: meng <mengmeng.meng@intel.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 1137c11be0)
2011-10-21 20:37:51 +02:00
Julien Cristau 5b76d710d3 glx: fix request length check for CreateGLXPbufferSGIX
The request is followed by an attribute list.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit a883cf1545)
2011-10-21 20:37:51 +02:00
Julien Cristau 7ed56f793f glx: validate numAttribs field before using it
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit d9225b9602)
2011-10-21 20:37:51 +02:00
Julien Cristau 4f6ee6177c glx: swap the request arrays entirely, not just half of them
Various glx requests include a list of pairs of attributes.  We were
only swapping the first half.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 62319e8381)
2011-10-21 20:37:51 +02:00
Julien Cristau 00130263a2 glx: check request length before swapping
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 6c69235a9d)
2011-10-21 20:37:51 +02:00
Julien Cristau 6ff0bcfcc0 glx: validate request lengths
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry-picked from commit ec9c97c6bf)
2011-10-21 20:37:51 +02:00
Jeremy Huddleston 94458a6e09 XQuartz GL: Add $(GL_CFLAGS) to CFLAGS
This fixes a build failure I found on tinderbox.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit f641e4b34a)

Conflicts:

	hw/xquartz/GL/Makefile.am

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-03-13 15:10:00 -07:00
Benjamin Tissoires ee8664ee85 xf86ScaleAxis: support for high resolution devices
High resolution devices was generating integer overflow.
For instance the wacom Cintiq 21UX has an axis value up to
87000. Thus the term (dSx * (Cx - Rxlow)) is greater than
MAX_INT32.

Using 64bits integer avoids such problem.

Signed-off-by: Philippe Ribet <ribet@cena.fr>
Signed-off-by: Benjamin Tissoires <tissoire@cena.fr>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a780e5b363)
2011-03-07 10:44:05 +01:00
Julien Cristau 01bc98e313 glx: make sure screen is non-negative in validGlxScreen
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 3f0d3f4d97)
2011-02-15 16:05:03 +01:00
Julien Cristau d77ffa918b Revert "randr: check for virtual size limits before set crtc"
Apparently these checks break rotation with the nvidia drivers:
https://bbs.archlinux.org/viewtopic.php?pid=877761
http://bugs.debian.org/611619
Let's not do that in a stable branch.

This reverts commit 6a6d907e77.

Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-31 14:14:47 +01:00
Peter Hutterer 5549d99acb mi: handle DGA subtypes when determining the master device.
The subtype in the DGA event is the core type and all ET_ event types (where
applicable) are identical to the core types. Thus the switch statement below
will work as required and assign the right master device.

Fixes a crasher bug on keyboard devices with valuators. If a device sends a
motion event while grabbed and a DGA client is active (but has not selected
input through DGA), the valuator event is posted through the VCK and
eventually results in a NULL-pointer dereference on dev->valuator.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 31ab9f8860)
(cherry picked from commit faecab3b13)
2011-01-12 10:17:46 +01:00
Ville Syrjälä 2fd67c3454 xfree86/modes: Take rotation into account when checking mode size
Assume that a mode can be used in either landscape or portrait
orientation. I suppose the correct thing to do would be to
collect all the supported rotations from the CRTCs that can be used
with a specific output, but that information doesn't seem to be
readily available when these checks are done. So just assume that
either orientation is fine.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 2e781457d4)
(cherry picked from commit aec278eb65)
2011-01-10 15:20:32 +01:00
Tiago Vignatti 6a6d907e77 randr: check for virtual size limits before set crtc
Return a error if the screen is configured to an invalid size.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit d1107918d4)
2011-01-10 15:19:34 +01:00
Michel Dänzer 5b979a13df EXA: Fix crash with fill using 1x1 tile of depth < 8 (bug #24703).
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24703 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit e06fa80400)
2011-01-10 15:16:45 +01:00
Jörn Horstmann 561afd799f Add EDID quirk for HP Compaq nc8430.
Like some other LPL panels, this one reports the vertical size in cm rather
than mm.
Patch taken from Launchpad bug #380009 <https://launchpad.net/bugs/380009>

X.Org Bug 28414 <https://bugs.freedesktop.org/show_bug.cgi?id=28414>

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 4b88c7be8d)
2011-01-10 15:16:39 +01:00
Adam Jackson cd82012d5d x86emu: Fix more mis-decoding of the data prefix
cc2c73ddcb4370a7c3ad439cda4da825156c26c9's three-cent titanium tax
doesn't go too far enough.  Fix the rest of the call and jmp
instructions to handle the data prefix correctly.

Reference: Intel 64 and IA-32 Architectures Software Developer's Manual
Volume 2A: Instruction Set Reference, A-M

http://www.intel.com/Assets/PDF/manual/253666.pdf

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit bb18f27715)
2011-01-09 11:54:29 +01:00
Luc Verhaegen 2194c381c8 x86emu: fix jump_near_IMM to handle DATA: flag correctly.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24348

Before (data flag ignored -> broken):
66                  DATA:
e944f1              JMP       1ff6

After (fixed):
66                  DATA:
e944f1ffff          JMP       00001ff8

This subtle difference in the length of decoded instruction meant
that the VBE call jumped to the routine setting AX=0x14F (VBE Failed)
instead of the routine that set AX=0x4F (VBE success).

The ability to run the same code in vm86 significantly aided the
debugging of this issue. Those X.org developers who would like to drop
vm86 better take special care towards _all_ vesa bugs, as those will
expose further issues.

Patch applies easily to even xserver 1.4.2.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Tested-by: Luc Verhaegen <libv@skynet.be>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit cc2c73ddcb)
2011-01-09 11:54:21 +01:00
James Jones c038d008e4 Add and use SERVER_SYNC_*_VERSION
Most extensions have a version defined
in the protocol headers, and also in the
server's protocol-versions.h.  The latter
defines which version the server advertises
support for.  Sync wasn't included in
protocol-versions.h, and was advertising
support for whatever was in the protocol
headers the server was built against.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 27593eea7e)
2011-01-02 13:09:36 +01:00
Andrea Canciani 472163b7f3 render: Fix byteswapping of gradient stops
The function swapStops repeatedly swaps the color components as
CARD16, but incorrectly steps over them as if they were CARD32.

This causes half of the stops not to be swapped at all and some
unrelated data be swapped instead.

Signed-off-by: Andrea Canciani <ranma42@gmail.com>
Reviewed-by: Soren Sandmann <sandmann@daimi.au.dk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit dab064fa5e)
2010-12-03 11:32:12 +01:00
Cyril Brulebois 6f7f3e2b79 Fix screen number checks.
screenInfo.numScreens is not a valid screen number, they go from 0 to
numScreens - 1.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 279ef1ffd7)
2010-12-01 23:49:36 +01:00
Julien Cristau bcab9213fb DGA: fix screen number check
screenInfo.numScreens is not a valid screen number, they go from 0 to
numScreens - 1.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 8684543021)
2010-12-01 23:49:31 +01:00
Bill Nottingham f86265529b xfree86: store the screen's gamma information on init.
This fixes a gamma issue on vt switch observed with KDM. VT switching away
and back would result in a black screen. Avoid this by storing the current
gamma information on init.

https://bugzilla.redhat.com/show_bug.cgi?id=533217

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 566d09a5cd)
2010-12-01 23:48:26 +01:00
Adam Jackson 333a635591 xfree86: apply gamma settings on EnterVT.
When entering the VT, re-apply the saved gamma settings for each screen.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit c050aa2f5f)
2010-12-01 23:48:19 +01:00
Peter Hutterer c9bca39848 Xi: move property reset from extension shutdown to init.
If any part of the stack calls XIGetKnownProperty during device shutdown
the property is re-initialized before the server generation resets, leaving
the value invalid again.

Move the reset to the extension init which happens before input devices are
initialized before the first property is requested.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 5cd11d2356)
2010-11-14 00:35:06 +01:00
Peter Hutterer 266dc682f6 Xi: reset the known properties at the end of the server generation.
Properties allocated through XIGetKnownProperty() aren't reset on the second
server generation but keep the old value. As a result, wrong Atoms are
supplied to the driver, resulting in potential data corruption or weird
error message.

Reproducible by running "xlsatom | grep FLOAT" twice on a plain X server.
The second X server generation won't have the FLOAT atom defined anymore,
despite the users of this atom not noticing any errors.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9802839d35)
2010-11-14 00:35:06 +01:00
Adam Jackson 240e7c50ce ddc: Don't probe for DDC/CI or EEPROM
For whatever reason, some (broken) monitors will crash if you do this.
We're not actually using this information for anything, so let's just
not do it.

Originally reported as http://bugzilla.redhat.com/620333

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit d2064fbb68)
2010-11-14 00:35:03 +01:00
Dirk Wallenstein d7c2f764b3 xkb: Fix omissions in geometry initialization #27679
_XkbCopyGeom did not copy all of the data from the source geometry. This
resulted in failures when trying to obtain the keymap from a server
where the default geometry has not been replaced by a custom
configuration.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit bac1c5f1be)
2010-11-11 13:19:23 +01:00
Alan Coopersmith 8981b0a99c Don't coredump on "X -showopts" (bug 25874)
Don't try walking the xf86ConfigLayout.screens table if it's empty
https://bugs.freedesktop.org/show_bug.cgi?id=25874

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b8615d5927)
2010-11-11 13:16:10 +01:00
Nicolas George a3e6e599f5 Change keyboard controls on slave keyboards (#27926)
Makes the use of IsMaster in ProcChangeKeyboardControl consistent with other
similar loops.

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 968a79dcf5)
2010-11-11 13:14:58 +01:00
Ben Skeggs 48407d86e3 randr: prevent an unnecessary screen resize with multiple displays
crtc->{x,y} is always 0 when xf86DefaultScreenLimits() is called, so we
calculate too small an area for the initial framebuffer and force a resize
to happen.

This commit fixes the code to use desired{X,Y} instead, which contains the
initial output positions.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f7af00e9f0)
2010-11-11 13:09:25 +01:00
Peter Hutterer a6374668bd Xi: don't copy the modifier key count when copying device classes (#25480)
The modifier key count is maintained by the XKB layer and
increased/decreased for all modifiers that set state.

Test case, MD/SD modifier key count in comment:
1. keyboard 1: press and hold Shift_L    # SD:1     MD:1
2. keyboard 2: press and release Shift_L # SD:1,0   MD:1,0
<class copy happens>                     # SD:1     MD:1
3. keyboard 1: release Shift_L           # SD:0     MD:1
4. keyboard 1: press and release Shift_L # SD:1,0   MD:2,1

The modifier is now logically down on the MD but not on keyboard 1 or
keyboard 2.

XKB is layered in before the DIX, it increases/decreases the modifier key
count accordingly. In the above example, during (2), the MD gets the key
release and thus clears the modifier bit. (3) doesn't forward the release to
the MD because it is already cleared. The copy of modifierKeysDown when the
lastSlave changes however increases the counter for the held key. On (4),
the press and release are both forwarded to the MD, causing a offset by 1
and thus do not clear the logical modifier state.

X.Org Bug 25480 <http://bugs.freedesktop.org/show_bug.cgi?id=25480>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit dc614484f9)
2010-11-11 12:56:35 +01:00
Dave Airlie 6892697640 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>
(cherry picked from commit 80d1a548d6)
2010-11-11 12:52:41 +01:00
Peter Hutterer 06fda4d3c8 Revert "dix: use the event mask of the grab for TryClientEvents."
Behaviour of earlier X servers was to deliver the ButtonPress event
unconditionally, regardless of the actual event mask being set. This is
documented in the protocol:
"This request establishes a passive grab.  In the future, the pointer is
actively grabbed as described in GrabPointer, the last-pointer-grab time is
set to the time at which the button was pressed (as transmitted in the
ButtonPress event), and the ButtonPress event is reported if all of the
following conditions are true:
    <list of conditions, event mask is not one of them>"

Thus, a GrabButton event will always deliver the button press event, a
GrabKey always the key press event, etc. Same goes for XI and XI2.

Reproducible with a simple client requesting a button grab in the form of:
    XGrabButton(dpy, AnyButton, AnyModifier, win, True, ButtonReleaseMask,
                GrabModeAsync, GrabModeAsync, None, None);

On servers before MPX/XI2, the client will receive a button press and
release event. On current servers, the client receives only the release.
Clients that expect the press event to be delivered unconditionally.

XTS Xlib13 XGrabButton 5/39 now passes.

This reverts commit 48585bd1e3.
Effectively reverts commit 1c612acca8 as well,
the code introduced with 1c612 is not needed anymore.

Conflicts:

	dix/events.c

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1884db430a)
2010-11-11 12:50:20 +01:00
Joe Shaw 2fce4783f4 fix a sign problem with valuator data.
Without this patch, any negative valuator value is wrong when returned
from XQueryDeviceState().  This is a regression from at least xserver
1.4.

Valuator data is set in dix/getevents.c:set_valuators() by copying
signed int values into an unsigned int field
DeviceEvent.valuators.data.

That data is converted into a double with an implicit cast by
assignment to axisVal[i] in Xi/exevents.c:UpdateDeviceState().

That double is converted back to a signed int in
queryst.c:ProcXQueryDeviceState().  If the original value in
set_valuators() is negative, the double value will be > 2^31 and the
conversion back to a signed int is undefined.  (Although I
consistently see the value -2^31.)

Fix this by changing the definition of DeviceEvent.valuators.data from
uint32_t to int32_t.

Signed-off-by: Joe Shaw <joeshaw@litl.com>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit e354ccac36)
2010-11-11 12:38:06 +01:00
Adam Jackson 9d939ea0f4 dix: Default DPMS timeout values to match screensaver values
These have the same default, but if you specify something different with
-s on the command line, only the screensaver time is changed.  As DPMS
is usually what's desired, change it to match.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 2a763c9023)
2010-11-11 12:35:09 +01:00
Aaron Plattner 0ca9f07f73 os: Return BadLength instead of disconnecting BigReq clients (#4565)
If a client sends a big request that's too big (i.e. bigger than
maxBigRequestSize << 2 bytes), the server just disconnects it.  This makes the
client receive SIGPIPE the next time it tries to send something.

The X Test Suite sends requests that are too big when the test specifies the
TOO_LONG test type.  When the client receives SIGPIPE, XTS marks it as
UNRESOLVED, which counts as a failure.

Instead, remember how long the request is supposed to be and then return that
size.  Dispatch() checks the length and sends BadLength to the client.  Then,
whenever oci->ignoreBytes is nonzero, ignore the data read instead of trying to
process it as a request.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit cf88363db0)
2010-09-30 16:23:13 -07:00
Keith Packard 3336e1f7f3 Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998
Because some EnterVT code needs to remove it self from the
call chain, we need to fix all of the wrappers to correctly
unwrap/rewrap during the call chain. This is a follow-on to the fix
for bug 27114 in commit 68a9ee8370.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Jesse Barnes <jesse.barnes@intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
(cherry picked from commit d75e8146c4, and
conflict from b618705 fixed up)
Signed-off-by: Julien Cristau <jcristau@debian.org>
2010-09-08 18:42:57 +02:00
Keith Packard 3fabfc198b Clean up RandR12 bits on screen close (bug 27114)
When resetting the server, pScrn->EnterVT must be unwrapped or the
next server generation will end up wrapping the wrapper and causing an
infinite recursion on EnterVT.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Michael Stapelberg <michael+freedesktop@stapelberg.de>
(cherry picked from commit 68a9ee8370)
2010-09-04 11:43:20 +02:00
Alan Coopersmith 4c313472c4 Xserver(1) man page updates
- Note that -br is now default.
- Move -bs after -br for alphabetical ordering.
- Remove -config option that's been hidden in "ignore" section,
  since ajax removed the -config code a couple years back.
- Add -nocursor option.
- Add xinput & xrandr to list of runtime server control programs
- Replace XDarwin with Xquartz in list of Xservers

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 7b09335a46)
2010-08-21 14:10:01 -07:00
Simon Farnsworth 7787526a71 Don't crash when asked if a client that has disconnected was local
ProcDRI2Dispatch uses LocalClient to determine if it's safe to respond
to a client that has made DRI2 requests which aren't sensible for
remote clients (anything but version). When the client has disappeared
mid-request stream (e.g. as a result of a kill -9, or a client-side
bug), LocalClient causes the X server to follow suit, as
((OsCommPtr)client->osPrivate)->trans_conn is NULL at this point.

The simple and obvious fix is to just return "not local" when
trans_conn is NULL, which fixes the crash I was seeing; however Keith
Packard pointed out that just checking trans_conn isn't enough;
quoting Keith:

"This looks almost right to me -- I reviewed the os code to see when
_XSERVTransClose is called (which is what frees the trans_conn data) and
found that every place which called that immediately set trans_conn to
NULL, except for the call in CloseDownFileDescriptor which is only
called from CloseDownConnection and which is immediately followed by
freeing the OsCommRec and setting client->osPrivate to NULL. So, I'd
suggest checking client->osPrivate in addition to the above check."

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 660f6ab549)
2010-08-21 14:01:10 -07:00
Alan Coopersmith e1cf1e88bb Fix compiler issues with getifaddrs() call on OpenSolaris
OpenSolaris recently added support for the getifaddrs() API.

Building with that uncovered two compiler issues (one warning, one error)
in the code that was now being built for the first time in our builds:

"access.c", line 768: warning: argument #1 is incompatible with prototype:
        prototype: pointer to struct sockaddr {unsigned short sa_family, array[14] of char sa_data} : "access.c", line 213
        argument : pointer to struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2}

"access.c", line 838: assignment type mismatch:
        struct sockaddr {unsigned short sa_family, array[14] of char sa_data} "=" struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2}

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit e42a29d269)
2010-08-21 13:53:32 -07:00
Jesse Adkins c4717321c0 xfree86: parser: Never use constant strings for driver names (fixes #17438)
When the parser sees the "keyboard" driver, it automatically (and
 silently) replaces it with the constant string "kbd".
Everybody else uses malloc'd memory for the driver name, so input
 device closure assumes it can use free.
Free val.str, so this crash doesn't turn into a memory leak. Whew.

Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit bce12f2956)
2010-08-21 13:40:50 -07:00
Keith Packard 7c54498665 fb: make isClipped always reject negative coordinates (bug 11503)
A window with either dimension > 32767 can be positioned such that
coordinates > 32767 are visible on the screen. Attempts to draw to
those pixels will generate coordinates wrapped around to negative
values.

The optimized clipping macro, 'isClipped', in fbbits.h, computes
clipping in window space rather than screen space using int16 values,
and so it too has coordinates wrapped around to negative values and
hence ends up accepting the wrapped drawing coordinates.

Two possible fixes for this problem

 1) Detect wrapped region coordinates and clip those to 32767.
 2) Detect negative incoming coordinates and reject those

This patch takes the second approach as it is much shorter, simply
detecting when either X or Y incoming coordinate is negative, which
can never be 'within' any drawable.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 3e56efcfb6)
2010-08-21 20:41:37 +01:00
Chris Wilson f43e105ee8 edid: Adjust rounding of max_clock
A simple hack to accommodate various EDID who have detailed modes that
exceed the EDID's max pixel clock. The pixel clock is only defined in
units of 10MHz and often appears as the maximum pixel code of the
detailed modes, rounded to the nearest 10MHz. Adjusting the max_clock to
include an extra 5MHz prevents the parser from rejecting the detailed
modes.

The kernel uses the same fuzz and by including it in X we can use the
same modes in X as for the console.

Fixes:

  Bug 23833 - X uses different refresh rate to that set by kernel module
  https://bugs.freedesktop.org/show_bug.cgi?id=23833

In the future, we will want to try harder to keep the KMS modes but at
the same time we need to apply the restrictions as specified by the
user's configuration, and need to fill in modes for fullscreen games on
fixed-mode panels.

Reported-and-tested-by: Fabio Pedretti <fabio.ped@libero.it>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 951605b466)
2010-08-21 20:41:31 +01:00
Adam Jackson d5248f0364 render: Bounds check for nglyphs in ProcRenderAddGlyphs (#28801)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 5725849a1b)
2010-08-21 20:41:16 +01:00
Chris Wilson 845f0bb1b9 xace: Invalid reference to out-of-scope data.
The callback data passed by reference to the hook was allocated on stack
within the scope of the case statement. The compiler is free to reuse
any of that stack space whilst making the function call so we may end up
passing garbage into the callback.

References:

  Bug 18451 - Xorg server 1.5.2 SEGV during XFixesGetCursorImage()
  https://bugs.freedesktop.org/show_bug.cgi?id=18451

v2: Drop the unrelated hunk that snuck in when ammending the commit
message.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 6dae7f3792)
2010-08-21 20:08:10 +01:00
Peter Hutterer f07fc1461d xkb: fix invalid memory writes in _XkbCopyGeom.
Classic strlen/strcpy mistake of
   foo = malloc(strlen(bar));
   strcpy(foo, bar);

Testcase: valgrind Xephyr :1

==8591== Invalid write of size 1
==8591==    at 0x4A0638F: strcpy (mc_replace_strmem.c:311)
==8591==    by 0x605593: _XkbCopyGeom (xkbUtils.c:1994)
==8591==    by 0x605973: XkbCopyKeymap (xkbUtils.c:2118)
==8591==    by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560)
==8591==    by 0x4472E2: CoreKeyboardProc (devices.c:577)
==8591==    by 0x447162: ActivateDevice (devices.c:530)
==8591==    by 0x4475D6: InitCoreDevices (devices.c:672)
==8591==    by 0x4449EE: main (main.c:254)
==8591==  Address 0x6f96505 is 0 bytes after a block of size 53 alloc'd
==8591==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)
==8591==    by 0x6054B7: _XkbCopyGeom (xkbUtils.c:1980)
==8591==    by 0x605973: XkbCopyKeymap (xkbUtils.c:2118)
==8591==    by 0x6122B3: InitKeyboardDeviceStruct (xkbInit.c:560)
==8591==    by 0x4472E2: CoreKeyboardProc (devices.c:577)
==8591==    by 0x447162: ActivateDevice (devices.c:530)
==8591==    by 0x4475D6: InitCoreDevices (devices.c:672)
==8591==    by 0x4449EE: main (main.c:254)

Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by-and-apologised-for: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 7f19a7a6e9)

Conflicts:

	xkb/xkbUtils.c
(cherry picked from commit f85552aa45)

Signed-off-by: Julien Cristau <jcristau@debian.org>
2010-07-05 15:53:27 +01:00
Pierre-Loup A. Griffais b963839139 xf86: Don't crash when switching modes through RandR without owning the VT.
While VT-switched, FB access is disabled and should remain so. Trying to switch
modes in that state would re-enable it, potentially causing crashes if trying
to access it before the driver has recovered from the mode switch.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 41bdb6c003)

Signed-off-by: Julien Cristau <jcristau@debian.org>
2010-07-05 15:53:27 +01:00
Éric Piel 5154dede3d exa: fix ExaCheckCopyNtoN for exa_classic when source = dest
In case you want to copy a region with source = dest, you have the same pixmap
as source and dest.

At the end of exaPixmapIsOffscreen_classic() the devPrivate.ptr is reset to
NULL (look at the sources).

Now this is what happens in ExaCheckCopyNtoN:

exaPrepareAccess( pDst );
   Calls IsOffscreen()
      sets devPrivate.ptr to NULL
   sets up devPrivate.ptr to real pointer
   Everything OK
exaPrepareAccess( pSrc );
   Calls IsOffscreen()
      sets devPrivate.ptr to NULL
   BAILS OUT CAUSE OF NESTED OPERATION SINCE DST EQUALS SRC

We end up with devPrivate.ptr as NULL, and that is clearly wrong.

In particular this fixes a segfault when using the psb driver (bug 28077)

Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 7e8f100121)
2010-06-17 15:21:09 +01:00
Cyril Brulebois f44ebbd3d5 Fix null pointer dereference in xf86_reload_cursors().
Upon resume, X may try to dereference a null pointer, which has been
reported in Debian bug #507916 (http://bugs.debian.org/507916).

Jim Paris came up with a patch which solves the problem for him. Here's
a (hopefully) fixed version of his patch (without the typo).

Cc: Jim Paris <jim@jtan.com>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-By: Matthias Hopf <mhopf@suse.de>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit fa6c701257)
2010-06-03 16:53:54 +02:00
Peter Hutterer d2f29b85d1 xfree86: dga needs to use the master keyboard state (#27573)
GetPairedDevice() may not always return the keyboard, resulting in a
null-pointer dereference when accessing the XKB state.
For floating devices, the GetMaster() returns the device itself.

X.Org Bug 27573 <http://bugs.freedesktop.org/show_bug.cgi?id=27573>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit 10de9e8ee3)
2010-05-18 19:38:17 +02:00
Jeremy Huddleston 89a2b2771f XQuartz: Don't use deltaXY for determining pointer location on scroll events
<rdar://problem/7989690>

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Edward Moy <emoy@apple.com>
(cherry picked from commit ecfeabec8d)
2010-05-17 22:53:04 -07:00
Jeremy Huddleston 754b995a3f XQuartz: Don't trust deltaXY for middle mouse clicks.
The middle mouse clicks return erroneous values after returning from
Fast User Switching.

<rdar://problem/7979468>
http://xquartz.macosforge.org/trac/ticket/389

Signed-off-by: Martin Otte <otte@duke.edu>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Edward Moy <emoy@apple.com>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit a911292c85)
2010-05-17 22:52:55 -07:00
Julien Cristau 1e7a9b15de XQuartz: add new localization files to EXTRA_DIST
commit 206531f75c added localization files
for ar, add them to the Makefile.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 72758287f7)
2010-05-15 10:43:20 -07:00
Chris Humbert c247f81ca1 dix: make DeviceEvent coordinates signed for Xinerama. #24986
With Xinerama enabled, event coordinates are relative to Screen 0, so
they can be negative.  The new DeviceEvent's coordinates are of type
uint16_t, making screens above and to the left of Screen 0 unusable.

X.Org Bug 24986 <https://bugs.freedesktop.org/show_bug.cgi?id=24986>

Signed-off-by: Chris Humbert <freedesktop@mahadri.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 21ed660f30)
2010-05-15 19:29:19 +02:00
Peter Hutterer e9a2eb86e9 xserver 1.7.7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-04 11:12:44 +10:00
Peter Hutterer ad48184752 Xext: only update the sprite on pointer events.
A call to miPointerUpdateSprite for the XTEST keyboard may result in a
NULL pointer dereference in miDCPutUpCursor() when the save buffer is NULL.

XTS test case: Xlib 11 KeymapNotify

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit af170a4ab7)
2010-05-04 10:54:38 +10:00
Jeremy Huddleston d2229e829d XQuartz GLX: Change around includes for better compatability with different OS versions
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 0efd7b8d82)
2010-05-02 20:05:38 -07:00
Jeremy Huddleston 86f37fa862 rootless: Add some sanity checking to miPaintWindow
This avoids painting the root window when it isn't actually drawable.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 7b506fdc84)
2010-05-02 20:05:29 -07:00
Jeremy Huddleston 1dbdcfbcbc rootless: Remove an unneeded comment
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 4d3789c9b3)
2010-05-02 20:05:23 -07:00
Oliver McFadden 67a50803da x-list.c: null-returning function malloc() was called without checking
Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 048d15192a)
2010-05-02 20:05:18 -07:00
Michel Dänzer 2c94da4e22 EXA: Check sys_ptr isn't NULL before passing it to the UploadToScreen hook.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=27380 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 7b65175266)
2010-04-22 14:16:59 +02:00
Peter Hutterer 7815b02e8d Revert "mi: don't thrash resources when displaying the software cursor across screens"
This commit leads to a segfault on the very first XTS test case.

Backtrace:
0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db]
1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75]
2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c]
3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579]
4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830]
5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33]
6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79]
7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e]
8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe]
9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a]
10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a)
[0x73969a]
11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5]
12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d]
13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6]
14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1]
Segmentation fault at address 0x10b2d5f8

valgrind output:
==5069== Invalid read of size 4
==5069==    at 0x80F928D: FreePicture (picture.c:1531)
==5069==    by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867)
==5069==    by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968)
==5069==    by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292)
==5069==    by 0x807973E: CloseDevice (devices.c:840)
==5069==    by 0x80799B6: CloseDownDevices (devices.c:933)
==5069==    by 0x8062705: main (main.c:309)
==5069==  Address 0x4cce844 is 12 bytes inside a block of size 84 free'd
==5069==    at 0x40057F6: free (vg_replace_malloc.c:325)
==5069==    by 0x80A3DE0: Xfree (utils.c:1154)
==5069==    by 0x80F9332: FreePicture (picture.c:1576)
==5069==    by 0x80FBB4B: PictureDestroyWindow (picture.c:69)
==5069==    by 0x810B1A3: damageDestroyWindow (damage.c:1840)
==5069==    by 0x80864F1: FreeWindowResources (window.c:846)
==5069==    by 0x8086812: DeleteWindow (window.c:925)
==5069==    by 0x806B53E: FreeClientResources (resource.c:806)
==5069==    by 0x806B60F: FreeAllResources (resource.c:823)
==5069==    by 0x80626E4: main (main.c:299)
==5069==
==5069== Invalid write of size 4
==5069==    at 0x80F9295: FreePicture (picture.c:1531)
==5069==    by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867)
==5069==    by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968)
==5069==    by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292)
==5069==    by 0x807973E: CloseDevice (devices.c:840)
==5069==    by 0x80799B6: CloseDownDevices (devices.c:933)
==5069==    by 0x8062705: main (main.c:309)
==5069==  Address 0x4cce844 is 12 bytes inside a block of size 84 free'd
==5069==    at 0x40057F6: free (vg_replace_malloc.c:325)
==5069==    by 0x80A3DE0: Xfree (utils.c:1154)
==5069==    by 0x80F9332: FreePicture (picture.c:1576)
==5069==    by 0x80FBB4B: PictureDestroyWindow (picture.c:69)
==5069==    by 0x810B1A3: damageDestroyWindow (damage.c:1840)
==5069==    by 0x80864F1: FreeWindowResources (window.c:846)
==5069==    by 0x8086812: DeleteWindow (window.c:925)
==5069==    by 0x806B53E: FreeClientResources (resource.c:806)
==5069==    by 0x806B60F: FreeAllResources (resource.c:823)
==5069==    by 0x80626E4: main (main.c:299)

XTS test case: Xproto pAllocColor

This reverts commit 00b8b7ad61.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-21 11:48:50 +10:00
Peter Hutterer ba2ba32e04 xserver 1.7.6.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-21 09:31:00 +10:00
Peter Hutterer e8fae02f19 dix: Fix crash in DeliverGrabbedEvents.
If both devices are synchronously grabbed, first with a GrabPointer, then
with a GrabKeyboard (GrabModeSync on both), sync.other of each device points
to the grab of the respective other device.

If the keyboard is then thawed through a AllowSome request, the VCK's
sync.other is reset to NULL. Subsequently, an event on the VCP would crash
the server when dereferencing sync.other on the VCP.

The check's purpose is to compare if the other device is grabbed by the same
client, which should be checked by accessing (dev->deviceGrab->grab->resource).
A check of the server-1.3 sources confirms that.

XTS test case: Xlib13 XAllowEvents 20.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9ddbb03fa5)
2010-04-21 09:31:00 +10:00
Cyril Brulebois aa6a18fdeb exa: handle pixmap create/destroy in lower layers
- Pixmaps that are created during a fallback are automatically prepared access.
- During the fallback accelerated ops are blocked to prevent new/scratch gc's
  from triggering accelerated ops on mapped pixmaps.
- A few cases of incorrect wrapping (on the top level pointer instead of
  between damage and (w)fb) have been removed.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 342f3689d1)

Conflicts:

	exa/exa_mixed.c

Debian bug#576816 <http://bugs.debian.org/576816>

Tested-by: Arthur Marsh <arthur.marsh@internode.on.net>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-19 13:48:13 +10:00
Julien Cristau acbcb77bf6 XGE: don't register an extension event
The GenericEvent is a core event, we never send an extension event, so
don't reserve an id for one.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit fc5d767408)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-16 08:12:42 +10:00
Julien Cristau c52b9e143d vfb: add a name and type to the pointer and keyboard
Fixes a crash in XIQueryDevice which calls strlen on a NULL pointer.

 #0  strlen () at ../sysdeps/x86_64/strlen.S:31
 #1  0x00000000004c16ed in SizeDeviceInfo (dev=0x969bd0)
     at ../../Xi/xiquerydevice.c:204
 #2  0x00000000004c1a01 in ProcXIQueryDevice (client=0xa57510)
     at ../../Xi/xiquerydevice.c:98

Debian bug#575905 <http://bugs.debian.org/575905>

Reported-by: "Bernhard R. Link" <brlink@debian.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0e7703f9b1)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-16 08:12:37 +10:00
Pierre-Loup A. Griffais 9a9a19ac4e mi: don't thrash resources when displaying the software cursor across screens
This changes the DC layer to maintain a persistent set of GCs/pixmaps/pictures
for each pScreen instead of failing to thrash between them when changing
screens.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 00b8b7ad61)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-16 08:12:28 +10:00
Tim Yamin ff02e0e4a2 dix: fix cursor screen check for xinerama setups.
The de-duplication of CheckPhysLimits 942eae6868 added a
condition that is invalid for a Xinerama setup. pScreen is invalid for the
Xinerama case, so comparing it to anything is a bad idea.

Signed-off-by: Tim Yamin <plasm@roo.me.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5f31e21961)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-16 08:11:05 +10:00
Jeremy Huddleston 8616c5eb75 XQuartz GLX: Don't let garbage enter our pixel request
https://bugs.freedesktop.org/show_bug.cgi?id=27654

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5b0faf3554)
2010-04-15 14:13:40 -07:00
Jeremy Huddleston 0dd9d27eaa XQuartz: Fix possible NULL dereference in ListenOnOpenFD
<rdar://problem/7862319>

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Marc Majka <majka@apple.com>
(cherry picked from commit fe7778e58e)
2010-04-15 14:13:22 -07:00
Jeremy Huddleston 3d7d699e3a XQuartz: Localization update
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 206531f75c)
2010-04-15 14:12:53 -07:00
Jeremy Huddleston e7ab6537c2 XQuartz: Add a GUI preference for the Alt / Mode_switch toggle
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Kevin Van Vechten <kvv@apple.com>
(cherry picked from commit 59edde7c28)
2010-04-12 22:31:48 -07:00
Jeremy Huddleston 30f4c7e4fb XQuartz: Customize the NSDefaults id in the man file.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Kevin Van Vechten <kvv@apple.com>
(cherry picked from commit 5600f7f001)
2010-04-12 22:31:31 -07:00
Jeremy Huddleston a75e4be03c XQuartz: Add a defaults option to toggle Alt / Mode_switch
See option_sends_alt in Xquartz(1)

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Kevin Van Vechten <kvv@apple.com>
(cherry picked from commit 840d12c7a6)
2010-04-12 22:05:56 -07:00
Jeremy Huddleston af86a25009 XQuartz: Blacklist some oddball legacy Mac keycodes that break wine
http://xquartz.macosforge.org/trac/ticket/295

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Kevin Van Vechten <kvv@apple.com>
(cherry picked from commit d6f160510a)
2010-04-12 22:05:39 -07:00
Peter Hutterer 501c0ee635 xserver 1.7.6.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-12 11:51:21 +10:00
Tiago Vignatti 8c0548bc34 xfree86: die gracefully in the vga arbiter if AddScreen fails
vga arbiter will be locked in one device while AbortDDX will call LeaveVT
routines from the other device. Fail!

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b9ad452ec9)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-09 22:23:31 +10:00
Peter Hutterer e7154e9375 dix: if owner-events is true for passive grabs, add the window mask (#25400)
A client requesting a GrabModeSync button grab, owner-events true, with only
the ButtonRelease mask set would never receive the press event even if the
grab window had the ButtonPress mask set.

The protocol requires that if owner-events is true, then the delivery mask
is the combination of the grab mask + the window event mask.

X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Jim Ramsay <i.am@jimramsay.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1c612acca8)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-09 10:50:53 +10:00
Michel Dänzer d33b3bf41b Xext: Fix cursor reference counting hazard.
Make sure the reference count of the new cursor is increased before the old
one is decreased, otherwise bad things will happen if they're one and the
same and the reference count is 1 initially. Not sure this can actually happen
here, but better safe than sorry.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 3083c5d0c4)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-09 10:49:56 +10:00
Mikhail Gusarov 4520d5cc5f kdrive: Bump evdev maxKeycode
There are keycodes > 193 in evdev, e.g. KEY_WIMAX which is 246 .

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Adam Jackson <ajax@nwnk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit e086b99c1f)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-09 10:48:24 +10:00
Peter Hutterer 48f8a7d125 configure: Always define XINPUT.
This define was removed in e251c9e75a "Remove all traces of #ifdef XINPUT
and the matching bits from the configure.ac". Drivers that support multiple
server versions and still check for ifdef XINPUT now always build without
XINPUT support if they're calling XORG_DRIVER_CHECK_EXT(XINPUT, inputproto).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit 6389405b56)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-09 09:47:54 +10:00
Jeremy Huddleston 1130a0def9 XKB: Fix garbage initialization
XkbEnableDisableControls set extra garbage bits on the xkbControlsNotify
changedControls mask because it was uninitialized on the stack.

Found by clang

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 8311cd5f89)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-09 09:47:43 +10:00
Paulo Ricardo Zanoni ff5af4dc2d dix: be more verbose when we run out of opcodes
If we run out of opcodes, nothing is print on the log, making the
problem hard to debug. In the current Xserver, if you enable some
extensions like multibuffer (+2 events) and use nvidia binary driver (+5
events) you can run out of opcode numbers.

Signed-off-by: Paulo Ricardo Zanoni <pzanoni@mandriva.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit a9fe7cfa77)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-09 09:47:01 +10:00
Pierre-Loup A. Griffais 2350035463 Don't keep a pointer to a possibly freed cursor when changing screens, preventing a crash in xf86CursorEnableDisableFBAccess() trying to restore it.
Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6b09f66d8c)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-09 09:46:50 +10:00
Peter Hutterer 2297ad916a dix: EventToCore needs to copy the root window too.
This value isn't actually set for normal events but it saves us some work
for the record extension support.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b4baab90c0)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-07 13:39:43 +10:00
Jeremy Huddleston 49a2b55e0e XQuartz: Re-query dixScreenOrigins as the value could've changed.
Fix a regression in 9c9c3a85b0

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Acked-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 28a5f14b40)
2010-03-29 15:27:48 -07:00
Jeremy Huddleston 68319e7f07 XQuartz: Workaround weird key data reported on some layouts
This should make 'Unicode Hex Input' work as an input layout.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Acked-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 339207be6f)
2010-03-29 15:27:48 -07:00
Roland Scheidegger 2ad8aae749 hw/xfree86: move reference counting out of the UseHWCursor[ARGB] functions
The problem is that the xf86_use_hw_cursor(_argb) functions may get this
correctly now, some drivers will replace these generic versions with their
own functions. It is pretty insane to expect them to do reference counting
of the cursor (as an example, look at driver/xf86-video-vmware to see how
that looks like as a workaround). There are even places in xserver itself
which replace these two functions.
The segfaults if no reference counting is done are caused because the
reference count of the cursor reached zero, hence the cursor was freed,
however xf86CursorEnableDisableFBAccess() brought it back to life from
the dead (from the SavedCursor).
This patch hence adds reference counting in xf86CursorSetCursor. As per Michel
Daenzer's suggestion, also free the cursor upon xf86CursorCloseScreen.
In theory with this it should be possible to remove the reference
counting in the UseHwCursor functions I think, though it should also be
safe to keep them.

Signed-off-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 67a8c659f2)
2010-03-25 19:31:37 +01:00
Tomas Carnecky e481a4912b Fix typos in the swap functions
This should fix bug #3539.

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 0c2fde5c8a)
2010-03-25 02:28:23 -07:00
Peter Harris 2fa794f246 Fix crash when all glyphs of a given depth are freed, but not all glyphsets
This is how the crash can be triggered with only two clients on the system:
Client A: (already running)
Client B: Connect
Client B: CreateGlyphSet(depthN)
Client A: Disconnect
Server: free globalGlyphs(depthN)
Client B: AddGlyphs(depthN)
Server: SEGV

This crash was introduced with the FindGlyphsByHash function
in 516b96387b. Before that revision,
ResizeGlyphSet was always called before FindGlyphRef, which would
re-create globalGlyphs(depthN) if necessary.

X.Org Bug 20718 <http://bugs.freedesktop.org/show_bug.cgi?id=20718>

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 185185eeb4)
2010-03-24 11:33:00 -04:00
Jeremy Huddleston 4c85c3815a XQuartz: Constrain the pointer to the updated display bounds on display reconfigure.
http://xquartz.macosforge.org/trac/ticket/346
(cherry picked from commit ed31d50b5f)
2010-03-22 00:15:54 -07:00
Jeremy Huddleston b226618f55 XQuartz: pbproxy: Make standalone xpbproxy respect the launchd prefix
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 38215cc43e4c012588c7a50344b8fe368d1252cc)
2010-03-20 16:48:45 -07:00
Jeremy Huddleston 088777f2b6 XQuartz: xpbproxy: Cleanup xpbproxy threading
Confine xpbproxy to a single thread
Runs inside its own CFRunLoop

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 69869d79f4c21eb385ff3c64bac649d93c7dd2ad)
2010-03-20 16:48:45 -07:00
Jeremy Huddleston b3f4a9a64b XQuartz: Minor cleanup
Move RandRInit to where it will need to be (not yet implemented)

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 7da4f9df9c6490e3e604c170415d5af2d8c8ff29)
2010-03-20 16:48:45 -07:00
Jeremy Huddleston b444205399 XQuartz: GLX: Fix Availability for Tiger ppc workaround
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 88baffc25a193c7c7154a94a687e7cb0f8b180ba)
2010-03-20 16:48:45 -07:00
Peter Hutterer c552ec12f9 xserver 1.7.6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-17 10:50:41 +10:00
Jeremy Huddleston 63ef872068 Revert "XQuartz: Explicitly pass a bellProc to make XBell() work again."
I'm not quite sure why this was necessary, but DDXRingBell is being called
from CoreKeyboardBell, so we don't need a separate bellProc which would
result in multiple rings.

This reverts commit 7e7e7935ee.

Conflicts:

	hw/xquartz/quartzKeyboard.c

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-03-16 11:40:53 -07:00
Jeremy Huddleston 31292a7c77 XQuartz: Use an empty xkb keymap by default
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5172253bae)
2010-03-16 00:01:47 -07:00
Peter Hutterer 5b4fabb910 configure: restore SHA1_LIB for XSERVER_SYS_LIBS
Accidentally removed in ff5fb43a4b, caused by
a botched merge when cherry-picking 178da6534f.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-15 09:03:19 +10:00
Peter Hutterer 5a2b3f36a0 xserver 1.7.5.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-12 16:53:06 +10:00
Peter Hutterer c25b34fe61 Merge branch 'server-1.7-nominations' into server-1.7-branch 2010-03-12 16:37:28 +10:00
Peter Hutterer ff5fb43a4b Xext: Link to external libraries when necessary.
Although the DDX should be linked to the necessary libraries, we may
also need to pull them in directly to the module to ensure the symbols
are resolved at runtime. Should fix this bug with XSELINUX:

/usr/bin/X: symbol lookup error:
/usr/lib64/xorg/modules/extensions/libextmod.so: undefined symbol:
is_selinux_enabled

-v2: use _LIBADD instead of _LIBS; remove SELINUX_LIBS from
     XSERVER_SYS_LIBS as it should only be needed in extmod.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 178da6534f)

Conflicts:

	configure.ac
2010-03-12 14:39:19 +10:00
Daniel Stone a69c7a4c53 Record: Avoid duplicates from replaying frozen events
Reintroduce a check which used to be there in the old
ProcessKeyboardEvent/ProcessPointerEvent codepath, which avoids us
recording events subject to a grab twice: once when it's first processed
in EnqueueEvent, and then again when it's thawed and being replayed.

This required a tiny amount of code motion to expose syncEvents.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a2ea8c2f2c)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-12 14:38:57 +10:00
Dave Airlie 3ae6a3779d dri2: return FALSE not BadValue.
With 1.7 if you try and send a DRI2Connect with this value set
to anything but 0, the server will segfault due to the strlen
in the function this returns to, since BadValue != FALSE.

Fixed via other work in 1.8.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-03-10 16:07:09 +10:00
Peter Hutterer 2086e4920a Revert "dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)"
Reported-by: Florian Mickerl <florian@mickler.org>
"this regresses my desktop. fluxbox is not able to move the windows around
anymore. also popup of context-menue does not work. (well sometimes it does,
but then the fluxbox-keyboard-shortcuts do not work)"

This reverts commit 351d11fd46.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-09 09:42:42 +10:00
Peter Hutterer 1242e494c8 xserver 1.7.5.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-05 09:27:13 +10:00
Keith Packard d023b78c73 Allow for missing or disabled compat_output
When the compat output is missing (I don't think this is actually
possible), or is disabled (and hence has no crtc), we would like to
avoid dereferencing NULL pointers. This patch creates inline functions
to extract the current compat output, crtc or associated RandR crtc
structure, carefully checking for NULL pointers everywhere.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit de86a3a344)
2010-03-04 16:12:17 +01:00
Peter Hutterer 7def5cdf7d configure: move SELINUX_LIBS to XSERVER_SYS_LIBS
All ddxs require linking against selinux if enabled.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1c2abec479)

Conflicts:

	configure.ac
2010-03-04 15:43:04 +10:00
Peter Hutterer 4026682511 configure: move libselinux requirement up to the common section.
Let's have all version-specific requirements in one block.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit cab99b947c)

Conflicts:

	configure.ac
2010-03-04 15:43:04 +10:00
Peter Hutterer 351d11fd46 dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)
A client requesting a GrabModeSync button grab, owner-events true, with only
the ButtonRelease mask set would never receive the press event even if the
grab window had the ButtonPress mask set.

The protocol requires that if owner-events is true, then the delivery mask
is the combination of the grab mask + the window event mask.

DeliverGrabbedEvents does this already for us, checking first the delivery
based on owner_events and then based on the grab mask. AFAICT, the device
cannot enter the states FREEZE_BOTH_NEXT_EVENT or FREEZE_NEXT_EVENT that
would be handled by DGE in any possible path here.

Bonus point - CheckPassiveGrabsOnWindows suddenly becomes a lot lesss
complicated.

X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit cf72b5437d)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-03-04 15:43:03 +10:00
Alan Coopersmith 8f743f17ed Solaris xf86OSRingBell() off-by-one error in filling iov[] array
When generating sound buffers for /dev/audio bells, insert waveform
for beep *or* silence, but not both, so we don't write one entry past
the end of the iov buffer when the final bit of soundwave ends up in
the final entry allocated in the iov array.

Fixes OpenSolaris bug 6894890:
 http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6894890

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-24 18:51:59 -08:00
Peter Hutterer d35e08b6db dix: remove now-erroneous comment about frozen slave devices.
A direct grab on a slave device through XI2 detaches it, regardless of
whether the grab is sync or async. So this comment doesn't apply to XI2
anyway.

For XI1, aside from your life being miserable already, it doesn't matter as
XI1 does not have a concept of attachment. You can freeze a device and if
you don't freeze _all_ other devices at the same time, the master device can
still happily send events to the client.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit c0d9419131)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-25 11:50:58 +10:00
Peter Hutterer 11c27f261e dix: try to ring the bell even if the current device doesn't have one. (#24503)
Evdev devices do not have the bell proc set, but XTEST devices do. By
exiting early, the bell only rings if the last keyboard used was the XTEST
keyboard and hence the bell proc is still set on the master but not if an
evdev keyboard was used last.

The better approach here is to try to ring the bell on all devices attached
to this master device in case one or more actually do produce an audible
sound. That's also XKB's behaviour if XkbUseCoreKbd is specified as device
identifier.

X.Org Bug 24503 <http://bugs.freedesktop.org/show_bug.cgi?id=24503>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 758f697175)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-25 11:49:59 +10:00
Eamon Walsh 1f96c03718 xselinux: Bump extension minor version.
Changes introduced in this version:
	- 3 window-related requests now handle pixmaps also.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit db4f676f25)
2010-02-23 16:58:52 -05:00
Eamon Walsh dd9573d408 xselinux: Rename window-related requests that now support pixmaps.
Renamed requests:
	SetWindowCreateContext -> SetDrawableCreateContext
	GetWindowCreateContext -> GetDrawableCreateContext
	GetWindowContext -> GetDrawableContext

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-23 16:58:41 -05:00
Eamon Walsh 7cec236a03 xselinux: Allow GetWindowContext to be used for pixmaps as well.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-23 16:43:17 -05:00
Eamon Walsh 1b6f498b84 xselinux: Remove reference counting calls for SID objects.
Starting with libselinux 2.0.86, SID objects are no longer
reference counted and the sidput() and sidget() calls are no-ops.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-23 16:35:46 -05:00
Eamon Walsh c030ec32b6 libselinux now has a pkgconfig file. Use it.
Also remove HAVE_NETLINK_AVC_ACQUIRE_FD tests, because we now
require a version of libselinux that has it.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-02-23 15:45:27 -05:00
Peter Hutterer c8dd981c7f Xi: assume BadMode for non-BadMatch errors returned from SetDeviceMode.
The XI protocol spec only allows for two errors on the SetDeviceMode
requests: BadMatch or BadMode. BadMode however is a dynamically assigned
extension error and the driver doesn't have access to the actual error
number. Hence, if a SetDeviceMode driver returns an error other than
BadMatch, assume BadMode.

The two exceptions are BadAlloc and BadImplementations, pass these on to the
client (any request is allowed to return either of those).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit e40ba5798c)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-23 10:51:25 +10:00
Chris Dekter 5ac8298469 Re-enable RECORD extension.
RECORD was disabled during the switch to internal events. This patch
modifies the record callback to work with internal events instead of
xEvents. The InternalEvents are converted to core/Xi events as needed.

Since record is a loadable extension, the EventTo* calls must be externed.

Signed-off-by: Chris Dekter <cdekter@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 122fc0e7a0)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-23 10:51:13 +10:00
Tiago Vignatti d1732a637e xfree86: vgaarb: remove useless debug
This is RAC's remnant. Any sane person would use a more wise method of
debugging instead.

X.Org Bug 26074 <http://bugs.freedesktop.org/show_bug.cgi?id=26074>

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 5e81078cf5)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-22 11:11:59 +10:00
Peter Hutterer dd0217fc93 dix: don't update the slave coordinates from the VCK.
A keyboard event from a device with both valuators and keys will be posted
through the VCK. In this case, do not update the slave device coordinates
from the VCK - they're always 0/0. Leave them as-is, for the next pointer
event will continue where it left.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 6f265d55a6)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-19 11:41:54 +10:00
Jeremy Huddleston 8dda9ba67a XQuartz: Fix a possible buffer overrun in quartzAudio
Also dropped deprecated API while there

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 4e8bf12b13)
2010-02-18 09:56:47 -08:00
Jeremy Huddleston 4d8ad88b57 XQuartz: clang static analysis fixes
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 4127e8e5be)
2010-02-18 09:55:24 -08:00
Peter Hutterer f0ec2e0d7d xserver 1.7.5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-16 13:08:02 +10:00
Julien Cristau 15e9a3fc0c dix: restore lastDeviceEventTime update in dixSaveScreens
This was removed in 6b5978dcf1 (Do not
reset lastDeviceEventTime when we do dixSaveScreens), but caused a
regression for XResetScreenSaver.  Add the lastDeviceEventTime update
back, but restrict it to that case.

X.Org bug#25855 <http://bugs.freedesktop.org/25855>

Reported-by: Lubos Lunak <l.lunak@suse.cz>
Tested-by: Lubos Lunak <l.lunak@suse.cz>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 001ce71dc1)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-16 11:30:46 +10:00
Peter Harris 38a83dce23 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>
(cherry picked from commit 97b03037f4)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-16 11:30:46 +10:00
Peter Hutterer 829980a4ff Xi: reset the sli pointers after copying device classes. (#25640)
If the indicator flags have the XkbSLI_IsDefault bit set, the indicator map
and names aren't their own bit of memory but rather point into the
device->key->xkbInfo->desc structure. XkbCopySrvLedInfo knows about this and
leaves the pointers alone.

When copying the classes from the slave to the master, these pointers are
copied and still point to the dev->key class of the slave device. If the
slave device is removed, the memory becomes invalid and a call to modify
this data (e.g. XkbSetIndicators) may cause a deadlock.

The copying of dev->key relies on dev->kbdfeed to be already set up. Hence
the pointers need to be reset once _both_ kbdfeed and key have been copied
into the master device.

X.Org Bug 25640 <http://bugs.freedesktop.org/show_bug.cgi?id=25640>
Fedora Bug 540584 <https://bugzilla.redhat.com/show_bug.cgi?id=540584>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 48f7298657)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-16 11:30:46 +10:00
Robert Morell 34cedd1e3d RENDER: Fix gradient and solid fill pictures with Xinerama, and misc cleanup
If these aren't wrapped, then procs that are wrapped (such as
RenderChangePicture) will fail in Xinerama when they see the resource
type of a picture created through one of these interfaces is PictureType
and not XRT_PICTURE like those allocated via RenderCreatePicture.

Signed-off-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 4d575b0559)
2010-02-05 08:13:42 -08:00
Peter Hutterer 85b04bb0eb xserver 1.7.4.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-05 18:08:37 +10:00
Oldřich Jedlička 219a0d8fb5 Allow driver to call DeleteInputDeviceRequest during UnInit
When the input driver (like xf86-input-wacom) removes it's devices
during a call to UnInit, the CloseDownDevices() cannot handle it. The
"next" variable can become a pointer to freed memory.

The patch introduces order-independent device freeing mechanism by
remembering the already freed device ids. The devices can reorder any
time during freeing. No device will be double-freed - if the removing
failed for any reason; some implementations of DeleteInputDeviceRequest
don't free the devices already.

Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz>
Reviewed-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 08b22c7faf)
2010-02-05 08:18:15 +10:00
Horst Wente a6a4c20121 xkb: make ctrl+alt+keypad + / ctrl+alt+keypad - work again (#25743)
Video mode switching via keypad keys did not work

Signed-off-by: Horst Wente <horst.wente@acm.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b91cec26de)
2010-02-05 08:17:58 +10:00
Oldřich Jedlička a5b558d065 Fix typo in updateSlaveDeviceCoords
The index [0] for the second valuator looks bogus; fix it.

Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 993e78d6c4)
2010-02-05 08:17:55 +10:00
Robert Morell 5d34e78c81 Render: Fix request size verification
RenderSetPictureClipRectangles and the Xinerama version of
RenderChangePicture were using the wrong structure types for request
size verification.

Signed-off-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 8d6b183833)
2010-02-04 08:01:16 +10:00
Simon Thum 6f53399492 xfree86: remove man page reference inexistent acceleration profile
not implemented in the X.org server 1.7

Signed-off-by: Simon Thum <simon.thum@gmx.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-03 15:23:22 +10:00
Jeremy Huddleston 1c126ba531 XQuartz: Attatch a stub display when CoreGraphics reports no displays.
This is half of the required changes to address the "stuck mouse pointer"
bug that occurs when X11 launches while the displays are asleep.  The
remainder of the fix is part of libXplugin which needs to be updated to
send XP_EVENT_DISPLAY_CHANGED when the display wakes up.  If you don't
have a recent enough libXplugin (expected in 2.5.0_beta2 or later), you
can cause this event to be sent by changing your display resolution (or
you could just start X11.app with your screens awake).

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 52456c602c)
2010-01-31 01:22:07 -08:00
Alan Coopersmith 734a6b9c21 Avoid segfaults in XF86VidMode GammaRamp functions if randr_crtc is NULL
Fixes crash when xscreensaver tries to use GammaRamp calls to fade out
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6915712

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27 16:46:28 -08:00
Aaron Zang b47231b2fd Solaris: Avoid switching to inactive VT's
Fix for OpenSolaris bug 6876992: "[vconsole] Ctrl+Alt+F12 switchs to blank
console screen with hotkeys property turned-off"
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6876992

Xorg needs to do sanity test for the VT it is commanded to switch to.
If the VT is not opened by any process, discard the switching request.

The changes also contain the fix for some flaws discovered when
getting the new gdm to run.

Signed-off-by: Aaron Zang <Aaron.Zang@Sun.COM>
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-27 16:44:10 -08:00
Pierre-Loup A. Griffais 66b6e2fd49 Fix source pictures getting random transforms after 2d6a8f6683.
*xoff and *yoff were uninitialized for source-only pictures.x

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit a6bd5d2e48)
2010-01-27 14:58:56 -08:00
Christian Zander a191318f8d x86emu: Respect the LEA 67h address size prefix.
Signed-off-by: Christian Zander <chzander@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f57bc0ede8)
2010-01-27 14:58:51 -08:00
Peter Hutterer d3e5430457 xserver 1.7.4.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-01-23 12:55:38 +13:00
Jeremy Huddleston 43412c6b8b XQuartz: Update copyright in bundle for 2010
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 6bde306f7f)
2010-01-20 16:51:51 -08:00
Jeremy Huddleston 268c00d24b XQuartz: Setup the modifier map in the quartz thread
This avoids possible doing it twice which could result in incorrect
keycodes for alt due to our loss of information about its side.

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 6008cc1164)
2010-01-20 16:51:46 -08:00
Simon Thum b852834bb1 os: state effect of -a and -t options more precisely
Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 14e4e4a294)
2010-01-19 17:36:10 +13:00
Gaetan Nadon d76f09406d macros: use PKG_CONFIG variable rather than executable name
User can defined alternate location for pkg-config.
Once option in place, all instances of pkg-config must be converted.

Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 6a2a578327)
2010-01-19 17:35:55 +13:00
Gaetan Nadon 08c2df881d configure: use backticks rather than $() for commands
This patch to xserver configure.ac is to increase code portability to
non POSIX system by using backticks rather than $() for command
substitution for BUILD_DATE and BUILD_TIME.

Reviewed-by: RĂ©mi Cardona <remi@gentoo.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 6313d2da6c)
2010-01-19 17:35:04 +13:00
Simon Thum b7e903526c xfree86: document pointer acceleration in xorg.conf.man
Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0722c287a4)

Conflicts:

	hw/xfree86/doc/man/xorg.conf.man.pre
2010-01-19 17:34:49 +13:00
Simon Thum c5e5a7adf0 doc: actually document SendDragEvents
Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 14039b5a79)

Conflicts:

	hw/xfree86/doc/man/xorg.conf.man.pre
2010-01-19 17:33:27 +13:00
Peter Hutterer 88582f3d41 xserver 1.7.4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-01-08 09:38:58 +10:00
Adam Tkac e54309e2ec Do not define members of include/eventstr.h:EventType enum conditionally.
Main problem is that EventType enumeration members can be different in
module and in server, which obviously causes problems.

Signed-off-by: Adam Tkac <atkac@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 8d53d84485)
2010-01-08 09:03:24 +10:00
Alan Coopersmith 8661189c2c CloseDevice: call XkbRemoveResourceClient before freeing key class struct
XkbRemoveResourceClient() returns immediately if dev->key is NULL.
CloseDevice calls XkbRemoveResourceClient until it removes all resources.

If we free dev->key and NULL it before XkbRemoveResourceClient, then
infinite loop ensues, and the server appears to hang on exit or crash.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 13c8bd3fde)
2010-01-05 09:40:39 -08:00
Peter Hutterer d1320f4f29 xserver 1.7.3.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-26 10:13:46 +10:00
Peter Hutterer c18dd3fd9b xkb: don't assign garbage value to led_return.
As the comment for the function states, led_return is undefined if map is
NULL. We might as well skip writing to it then.

Found by clang.

Reported-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 12fb31815d)
2009-12-26 09:31:06 +10:00
Peter Hutterer 0f71be87b9 xfree86: belately init RandR12 if xinerama fails. (#24627)
On Fri, Dec 11, 2009 at 10:19:01AM -0800, Keith Packard wrote:
> On Wed, 9 Dec 2009 11:55:14 +1000, Peter Hutterer <peter.hutterer@who-t.net> wrote:
> > On Tue, Dec 08, 2009 at 05:24:06PM -0800, Aaron Plattner wrote:
> > > On Tue, Dec 08, 2009 at 03:52:27PM -0800, Peter Hutterer wrote:
> > > > Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
> > > > and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
> > > > only one screen is found, Xinerama is disabled again and RandR12 tries to
> > > > access data it never initialized.
>
> I'd sure like to have RandR get enabled when xinerama doesn't; is there
> an easy way of making that happen here? Perhaps having the RandR12 code
> disable Xinerama when only one screen is found? Or some other kludge?

you know the dependency better than I do so any hints are apreciated.
afaict, the screenInfo.numScreens (the check used by Xinerama) isn't
necessarily initialized at this point so we can't use the same check.
The following seems to work though:

From 670b3ebdb7312a6433a8f093d0820785db2aea20 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 14 Dec 2009 11:00:58 +1000
Subject: [PATCH] xfree86: if only one screen was found, disable Xinerama (#24627)

Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
only one screen is found, Xinerama is disabled again and RandR12 tries to
access data it never initialized.

Dependency chain is:
- ProcessCommandLine sets noPanoramiXExtension to FALSE
- xf86RandR12Init() is a noop
- PanoramiXExtensionInit sets noPanoramiXExtension to TRUE
- xf86RandR12CreateScreenResources tries to use the devPrivates key it never
  initialized.

This hack checks if there's only one screen at the time RandR12 is
initialized. If so, we expect Xinerama to fail anyhow so we disable it
ourselves and proceed as planned.

X.Org Bug 24627 <http://bugs.freedesktop.org/show_bug.cgi?id=24627>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit faca1bc582)
2009-12-26 09:30:35 +10:00
Peter Hutterer b98a07d86d xfree86: remove HistorySize from the xorg.conf man page.
This option isn't parsed by anything anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 190610e0c6)
2009-12-26 09:30:27 +10:00
Peter Hutterer 7812d760e9 xfree86: reword InputDevice man sections, deprecate CorePointer/CoreKeyboard
Reshuffle and reword - InputDevice sections are only necessary if
hotplugging is disabled. Put more emphasis on hotplugging and less on HAL
since we'll switch backends eventually.

CorePointer, CoreKeyboard, and AlwaysCore should be listed as deprecated
since they don't do what they used to since 1.4. These days, only
SendCoreEvents matters and it's enabled for any driver calling
xf86ProcessCommonOptions (== every driver).
It only controls the startup behavior too, so document this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
(cherry picked from commit 094c6b9f97)
2009-12-26 09:30:26 +10:00
Peter Hutterer 93294355a0 xfree86: update man page for special keys handling.
SpecialKeyHandling was removed from the kbd driver with version 1.4.0. Since
this is the only version that will build against server 1.7+ it's not
reasonable to mention it in the man page. Reword, point to XKB instead and
make clear that some key combinations _may_ not be available in any given
config.

Reported-by: Derek Fawcus
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
(cherry picked from commit 801bc8075a)
2009-12-26 09:30:14 +10:00
Peter Hutterer 9941075acb xfree86: DontZap has been disabled for a while now, say so in the man page.
1.7 always shipped with DontZap disabled, it's just the default keymaps that
may not include the symbol to trigger it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
(cherry picked from commit 753310837c)
2009-12-26 09:30:06 +10:00
Julien Cristau 7f6fc40bed test/xi2: fix maximum max_keycode (bug#25492)
The number of keycodes needs to be lower than 0xFFFD so that the length
field of xXIKeyInfo doesn't overflow.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b44c9be244)
2009-12-24 17:55:11 +01:00
Jeremy Huddleston 7cdc00cac8 Xfake: Nuke -Wl,-undefined=InitExtensions from LDFLAGS
This is not portable, and accodring to Paulo should not be required any more.

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit d503195504)
2009-12-24 07:54:46 -08:00
Jeremy Huddleston 6cdb0afc98 dtrace: Add Xserver-dtrace.h to CLEANFILES
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
(cherry picked from commit ed7d252719)
2009-12-24 07:54:41 -08:00
Jeremy Huddleston 01921a2b82 XQuartz: pbproxy: Fix building of standalone xpbproxy executable
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 97a6454ea5)
2009-12-24 07:54:14 -08:00
Alan Coopersmith 2b8ba62f00 Change default xkb model from pc104 to pc105
PC105 is a more useful default for non-American keyboard users,
not harmful for American PC101/PC104 keyboard users.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1df4bd6011)
2009-12-23 16:05:54 -08:00
Alan Coopersmith 0240ad4888 Add platform compatibility defines for Sun Studio compilers
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 48749cc21b)
2009-12-23 16:05:48 -08:00
Alan Coopersmith 17a1587d16 Convert checks for PC98 support from platform #ifdefs to configure flag
Default remains the same - on for most OS'es on i386 (except Solaris),
off for everyone else.   Can be manually toggled via --enable-pc98 or
--disable-pc98.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b63912ed4c)
2009-12-23 16:05:42 -08:00
Dave Airlie 2d6a8f6683 fb: backport fb changes from master for src window operations.
This rolls up the following commits and also keeps the image_from_pict
API compatiblity. It introduces a new image_from_pict_18 API that is
used by the server leaving the old API alone.

I've rolled this up as I don't want to introduce ABI breaks in bisection.

a72c65e917 fb: Adjust transform or composite coordinates for pixman operations
bd567061c8 Split fbGetDrawable into fbGetDrawablePixmap and fbGetPixmapBitsData
6133505297 Revert "Fix clipping when windows are used as sources"
071b3c1810 Revert "Use IncludeInferiors when copying windows before compositing."
8e640d6b13 Revert "Reserve space for two GC values in copy_drawable()."

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-23 14:29:26 +10:00
Alan Coopersmith a2daadf914 Add freetype & type1 to the LoadModules ignore list
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Adam Jackson <ajax@redhat.com>
2009-12-18 17:12:10 -08:00
Alan Coopersmith 4548366c22 Update Sun license notices to current X.Org standard form
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-18 17:12:00 -08:00
Alan Coopersmith 02abf3dab6 COPYING: Update license preamble
Update the comment about "a modification is currently under discussion"
since there hasn't been any such discussion for some time and this is
the consensus agreed upon preferred format.

Also throw in a pointer to the OSI discussion page about the MIT license.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-18 17:11:41 -08:00
Alan Coopersmith 044b374c06 Fix builds with --with-int10=stub
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Adam Jackson <ajax@redhat.com>
2009-12-18 17:11:04 -08:00
Peter Hutterer 1df3321a40 Merge branch 'server-1.7-branch' into server-1.7-nominations 2009-12-14 13:52:08 +10:00
Peter Hutterer df842009a9 Xi: reset device properties to NULL after deleting them. (#25374)
Commit 0e6cee853d introduced cleanup code to
remove the accel properties when switching schemes. The same code is
triggered by the default closedown code but only after unconditionally
removing all device properties (as part of the cleanup). The properties,
although deleted never got reset to NULL.

X.Org Bug 25374 <http://bugs.freedesktop.org/show_bug.cgi?id=25374>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Andy Furniss <lists@andyfurniss.entadsl.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ea14a41821)
2009-12-14 13:36:58 +10:00
Tomas Carnecky d55009f87f Fix possible NULL dereference in XkbFlushLedEvents()
Through some code paths it is possible that NULL is being passed in the
'ed' parameter to XkbFlushLedEvents(). Make sure we don't pass it along
to bzero().

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 8861407878)
2009-12-14 13:36:53 +10:00
Peter Hutterer 601db11ffc xserver 1.7.3.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-11 15:34:05 +10:00
Peter Hutterer 441673906f Merge branch 'server-1.7-branch' into server-1.7-nominations 2009-12-08 11:45:51 +10:00
Peter Hutterer aea5ace1ee xserver 1.7.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-03 11:57:16 +10:00
Gaetan Nadon f41e87f32e configure.ac: error while checking for XDMXCONFIG_DEP
Introduced in commit 9998105a38
The replacement third parameters to PKG_CHECK_MODULES([DMXMODULES]
was not quoted.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 91c1bd78f7)
(cherry picked from commit b8623569a3)
2009-12-03 11:56:33 +10:00
Aaron Plattner c0de621b42 Restore ABI by reintroducing the "is_src" paramter to image_from_pict.
Restores old ABI after 196aff9b18.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 155e61a9f0)
2009-12-03 11:56:26 +10:00
Luc Verhaegen 7ef49cbe70 [PATCH] Xv: Fix AdjustFrame when driver implements ReputImage.
Finally fixes fd.o #4653, filed more than 4 years ago.

Patch can be happily applied to all modular Xorg versions.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 0e084d8c71)
2009-12-03 10:17:34 +10:00
Peter Hutterer 21bf1de28c dix: fix memory leak, free event list on shutdown. (#25028)
X.Org Bug 25028 <http://bugs.freedesktop.org/show_bug.cgi?id=25028>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit c20c889727)
2009-12-03 10:17:29 +10:00
Peter Hutterer e840999ffc dix: remove core devices when shutting down. (#25028)
NewInputDeviceRequest (and RemoveDevice) have checks in place to not allow
removal of the VCP/VCK. When shutting down, they need to be cleaned up
nonetheless to free the memory associated.

X.Org Bug 25028 <http://bugs.freedesktop.org/show_bug.cgi?id=25028>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 66bb8c6fbd)
2009-12-03 10:17:29 +10:00
Peter Hutterer 51aad8bebc Set the source and deviceid for key repeat events (#24785)
X.Org Bug 24785 <http://bugs.freedesktop.org/show_bug.cgi?id=24785>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit b584c224a8)
2009-12-03 10:17:29 +10:00
Peter Hutterer abb0a5c11e xfree86: tell users to disable AutoAddDevices, not AllowEmptyInput.
Technically, disabling AEI is the right suggestion. AEI off forces the
server to init the built-in defaults for input devices (or pick the first
one from the config file). At the same time, hotplugging is still available
with AEI off.

Unfortunatly, in the vast majority of cases users want to simply disable
hotplugging or have a working server while the local HAL configuration is
broken or missing. Disabling AEI will lead to duplicate events, triple
keystrokes, etc. once the configuration works again.
It's not actually required to remove AEI once hotplugging works again,
though it will in many cases lead to a setup that appears broken.

Asking users to disable AutoAddDevices instead means those users disable
hotplugging, can then fix the HAL setup and they _must_ remove the config
line again to test if hotplugging works again. Which doesn't leave them with
a broken config once everything is working nice and dandy. Less bugreports,
everybody wins.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dan Nicholson <dbn.lists@gmail.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: RĂ©mi Cardona <remi@gentoo.org>
Acked-by: James Cloos <cloos@jhcloos.com>
(cherry picked from commit 761ae22f88)
2009-12-03 10:17:28 +10:00
Gaetan Nadon b8623569a3 configure.ac: error while checking for XDMXCONFIG_DEP
Introduced in commit 9998105a38
The replacement third parameters to PKG_CHECK_MODULES([DMXMODULES]
was not quoted.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 91c1bd78f7)
2009-12-03 10:17:28 +10:00
Michel Dänzer dde1f68800 EXA: Don't defragment offscreen memory at allocation time.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24300 .

Offscreen memory allocation can occur from various places, and apparently
doing defragmentation from at least some of them can confuse some driver
acceleration code.

There's still the regular background defragmentation in the WakeupHandler,
which should manage to keep fragmentation at a reasonable level.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 8754db77d8)
2009-12-01 16:45:52 +01:00
Ben Skeggs 17a1614c3b EXA: fix mixed-pixmaps issue where we could do accel with pixmap mapped
The problem occurs in the following situation:

1. Create Pixmap
2. Software fallback on pixmap: pExaPixmap->pDamage created
3. Accel to pixmap: driver pixmap created, exaPixmapIsOffscreen() now true
4. Software fallback on pixmap
4.1: PrepareAccess() from driver succeeds, so no DFS to system memory copy
4.2: Software rendering...
4.3: (pExaPixmap->pDamage && exaPixmapIsOffscreen()) is true, so we try
     to (incorrectly) UTS the data back to the driver pixmap, when we
     should just call the driver's FinishAccess() hook.
4.4: fail

The patch adds an additional check on pExaPixmap->offscreen, which should
(for the cases exaPixmapIsOffscreen() will return true) only be FALSE
when we haven't used PrepareAccess() on the pixmap.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Acked-By: Michel Dänzer <michel@daenzer.net>

[ Michel Dänzer: This is a 'backport' of commit
  647b79f87a from master - actually this patch
  was submitted first but didn't apply to master anymore, so technically the
  other change is a 'forward port' of this one ]
2009-12-01 16:43:09 +01:00
Aaron Plattner 155e61a9f0 Restore ABI by reintroducing the "is_src" paramter to image_from_pict.
Restores old ABI after 196aff9b18.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-11-30 11:17:32 +10:00
Peter Hutterer 1fff1b37a9 xserver 1.7.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-11-27 14:58:58 +10:00
Aaron Plattner 196aff9b18 Bug #25136: Revert "Fix clipping when windows are used as sources"
That change causes lib(w)fb to make accelerated driver calls after the driver
has entered a software fallback.  Most drivers don't expect this, which leads to
corruption or crashes.  A change to make this code do the copy in software is
unacceptably slow.

This reverts commit e9aa61e9f0.

Conflicts:

	configure.ac
	fb/fbpict.c

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-11-26 15:41:46 +10:00
Peter Hutterer 8eca8eaef5 Xi: when deleting all properties, reset property handler to NULL.
Trying to unregister property handlers during the device closure process
leads to invalid memory accesses.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1b127ab842)
2009-11-25 15:26:38 +10:00
Peter Hutterer 9998105a38 Move xdmxconfig modules into DMX conditionals (#25102)
xdmxconfig requires additional modules not checked for if Xdmx build is set
to auto (the default). This may lead to build errors if the Xdmx modules are
installed, but not the extra ones required for xdmxconfig.

X.Org Bug 25102 <http://bugs.freedesktop.org/show_bug.cgi?id=25102>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Remi Cardona <remi@gentoo.org>
Acked-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 8806375ed7)
2009-11-25 15:26:35 +10:00
Rami Ylimaki 18dcc102ac Xext: Fix a memory leak on GE client disconnect.
Add a call to dixRequestPrivate to inform dixFreePrivates that memory
allocated in GEClientCallback should be released when client
disconnects. Otherwise there is a leak of sizeof(GEClientInfoRec) for
every client connect/disconnect.

Also remove the explicit allocation and let GEGetClient /
dixLookupPrivate do it. This makes GEClientCallback similar to the
other extension callbacks.

Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit eb967ca36c)
2009-11-25 15:26:30 +10:00
Peter Hutterer b8904935bb Xi: don't crash when deleting invalid device properties.
Deleting a property that was not set on a device leads to a null-pointer
reference. The protocol allows deleting those properties - it has to be a
noop.

Reproducible:
xinput --set-prop "My device" --type=int --format=8 "my property" 1
xinput --delete-prop "My other device" "my property"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit a30e739a14)
2009-11-25 15:26:11 +10:00
Zhao Yakui a5308ceb12 xfree86: Edid quirk for Philips LCD LP154W01
v1->v2: Make one condition case for one quirk instead of merging them
together. This is based on the Keithp's suggestion.

Move the EDID quirk for Philips LCD LP154W01 as the panel reports the vertical
size in cm.

https://bugs.freedesktop.org/show_bug.cgi?id=24482

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 19f7c15e20)
2009-11-25 15:26:07 +10:00
Jeremy Huddleston b466329c11 XQuartz: Allow better compatability with older versions of xinit
If we are id="org.x" and the launchd socket is ":0", we will claim
the socket to match the old behavior before we prefixed the
socket name with our id.

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 4677b5a800)
2009-11-23 22:31:04 -08:00
Peter Hutterer 19b24f014f xserver 1.7.1.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-11-20 15:29:05 +10:00
Julien Cristau bebf7b1a34 xfree86: set a sane umask before opening the log
Xorg creates its log file following the umask of the user running
startx, which may result in a world-writable log.  Set umask to 022 to
prevent this.

Debian bug#555308 <http://bugs.debian.org/555308>
See also http://thread.gmane.org/gmane.comp.security.oss.general/2299

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 30be7ceaf2)
2009-11-19 16:37:03 +10:00
Chase Douglas e6872c89bc Move FD_CLR above pInfo->read_input
The event fd may be invalidated by the pInfo->read_input call. If it is
invalidated, the subsequent FD_CLR call will segfault. Thus, the FD_CLR
call must precede the pInfo->read_input call.

Signed-off-by: Chase Douglas <chasedouglas@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b5aa2e0a5f)
2009-11-19 16:36:42 +10:00
Peter Hutterer a2e4bcc2a0 dix: increase default number of buttons to 10.
Currently the XTEST device is limited to the same number of buttons the core
device has. This breaks if a user has a mouse with more than 3 buttons
connected and is using a core client to fake button 8+ presses.

Rather than expecting all clients to fix themselves, just increase the
default number of buttons to 10, which is somewhat a compromise. Ideally,
the XTEST devices should adjust themselves to the highest number of buttons
available on the slave devices (like the master pointers already do), but
that's a taks for another day.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 982f6648fd)
2009-11-19 16:36:34 +10:00
Jon TURNEY 2b9ad70196 Avoid a null dereference if IFF_BROADCAST is set but there is no broadcast address
It seems that the getifaddrs() function can return interfaces with
IFF_BROADCAST & IFF_UP set, but no broadcast address (at least
under Cygwin 1.7, this seems to happen for v6 mapped v4 addresses)

Avoid a null dereference if this ever happens

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
(cherry picked from commit 28eb61fc04)
2009-11-19 16:34:19 +10:00
Colin Harrison 71f4b404c0 Xming: Add mouse motion events with flag POINTER_SCREEN in winEnqueueMotion()
Add mouse motion events with flag POINTER_SCREEN in winEnqueueMotion(), as
they are in screen coordindates and may need to be scaled to the axis range
appropriately

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit 019a601de6)
2009-11-19 16:33:52 +10:00
Jon TURNEY f0325c2f60 Cygwin/X: Remove a couple of extraneous '\n' in logged version info
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit 2a38f7c0db)
2009-11-19 16:33:37 +10:00
Adam Jackson 20beb2580f 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>
(cherry picked from commit c7d1319872)
2009-11-19 16:33:26 +10:00
Dave Airlie 2db157924b loader: actually stat something that has some chance of existing. (v2)
FindModuleInSubdir seems to expect a / at the end of the subdir its
finding for, so we add the / early, the stat will fail if its
not a subdir, I'm leaving the S_ISDIR in just in case there is another
reason it could return 0. This does look a bit silly in strace
but it seems to work fine.

I have a very intermittent issue where drivers loses its / that
I've been seeing on/off for a while, this may or may not fix it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit d85ab6b648)
2009-11-19 16:33:16 +10:00
Jeremy Huddleston 7e7e7935ee XQuartz: Explicitly pass a bellProc to make XBell() work again.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 9071b0d697)
2009-11-15 11:03:39 -08:00
Jeremy Huddleston d6495bb272 XQuartz: pbproxy: Wait for the server to finish starting up, so display is valid.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit e87a03fd53)
2009-11-15 11:03:33 -08:00
Jeremy Huddleston 909d04000c XQuartz: Buildfix for Leopard and older
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 15fc56addc)
2009-11-15 11:03:16 -08:00
Jeremy Huddleston afc7663f0d XQuartz: Cleanup X11Controller.m compilation warnings.
Declare X11Controller as implementing NSTableViewDataSource.
Use selectRowIndexes:byExtendingSelection instead of selectRow:byExtendingSelection

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 840a68dc5e)
2009-11-06 11:01:07 -08:00
Jeremy Huddleston 6b70e145b7 XQuartz: Use dixLookupResourceByType instead of LookupIDByType
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 0e3ad44c3b)
2009-11-06 11:00:47 -08:00
Jeremy Huddleston f203963678 XQuartz: Don't weed out duplicates in generated keymap
There seems to be an issue in the 1.5+ server where shift-space does not
produce a space when 'keycode 57 = space' but it does when 'keycode 57 = space
space'

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 069fc6ce0a)
2009-11-06 11:00:38 -08:00
Jeremy Huddleston dfb0c50294 XQuartz: Controller thread launches clients
This avoids a memory leak due to no active auto-release pool on the server thread.

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 6d6e8fb27f)
2009-11-06 11:00:32 -08:00
Peter Hutterer 2d55b842b8 xserver 1.7.1.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-11-06 14:41:19 +10:00
Alan Coopersmith 4fe904f2d5 Enable XF86PM on all Solaris platforms, not just x86/x64
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f7b375bd14)
2009-11-06 14:41:19 +10:00
Alan Coopersmith f0dc842b14 Use $(MAKE) instead of "make" to build Solaris inline assembly
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f77262513e)
2009-11-06 14:41:19 +10:00
Tiago Vignatti 05d6672a1b EXA: Preserve pPixmap->devPrivate.ptr in exaPixmapIsOffscreen_driver
It crash the server when the drawable is 32 bit and the framebuffer is 16.

This is pretty much a copy-past from commit 8e873185.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9640407643)
2009-11-06 14:27:35 +10:00
Rami Ylimaki 269202982d dix: Fixes a memory leak when a cursor resource is released.
Just open and close a client that creates cursors in order to
reproduce. In the problem case bits->refcnt is -1 and therefore
bits->devPrivates is never released.

Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 0573042cdd)
2009-11-06 14:27:02 +10:00
Jeremy Huddleston ade4636c7e dix: Properly detect if the other device is frozen
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 7897b6c2d4)
2009-11-04 11:34:28 -08:00
Jeremy Huddleston ccbf949abb XQuartz: Run xmodmap after programatically updating the keymap.
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
Signed-off-by: Martin Otte <otte@duke.edu>
(cherry picked from commit 5e79976c13)
2009-11-04 11:34:16 -08:00
Maarten Maathuis 9e9ff04320 exa: remove some outdated comment
- This comment is still in exa_driver.c and there it makes sense.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 412c56ef33)
2009-11-03 13:27:37 +10:00
Adam Jackson 30572be7c7 EDID: Extend the HDTV hack to handle "1368x769"
Hate televisions so much.

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit ec98d7fc78)
2009-11-03 13:27:07 +10:00
Adam Jackson 9c87ede1d6 modes: Fix duplicate detection, and do it more consistently
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 7c0803f555)
2009-11-03 13:26:44 +10:00
Adam Jackson f61376b136 modes: De-duplicate a clock range check.
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit ba2d39dd54)
2009-11-03 13:26:37 +10:00
Adam Jackson 263d2b05d6 EDID: Fix interlaced detailed timings to be frame size, not field size
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 25236d19e6)
2009-11-03 13:26:30 +10:00
Jamey Sharp 4caa7982ef Suppress certain GCC warnings in auto-generated code.
- Don't warn for references to deprecated functions in xorg_symbols.
- Ignore functions generated by gl_apitemp.py that are never used.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit fab74d1081)
2009-11-03 13:25:51 +10:00
Jamey Sharp 6ca6283bce Don't cast double to int: use default conversions or explicitly round.
GCC warns about casting a double return value to int.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 239435875d)
2009-11-03 13:25:44 +10:00
Jamey Sharp ebbac19550 Suppress GCC warnings like "the address of `u1' will always evaluate as `true'".
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit e8c48fd8f7)
2009-11-03 13:25:38 +10:00
Mikhail Gusarov 171dc59ec5 kdrive: Grab evdev mouse/keyboard devices when X server is active
Input events are directed to both vt and input devices by default.
Unless input devices are grabbed, keyboard events fill it vt buffers
and cause spontaneous wakeups in kernel tty layer when buffers are full.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 662594aeff)
2009-11-03 13:25:35 +10:00
Tormod Volden 9ed5acec41 xfree86: Fix description of DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE
The message ending up in the log is misleading as to what the quirk
actually does: It ignores the sizes in the detailed timings and
replaces them with the display "Max Image Size".

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 757c11630d)
2009-11-03 13:20:16 +10:00
Hans Nieser 9db4c77956 Xinput: allow non-integer values again for Constant- and AdaptiveDeceleration
This was initially fixed by commit 3932a84857
but then (presumably not intentionally) undone by commit
1d54479cb3 .

Signed-off-by: Hans Nieser <hnsr@xs4all.nl>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 55f4c80a4c)
2009-11-03 13:19:55 +10:00
Jon TURNEY 6e2f5912b6 dmx: Correctly compute DMXGetScreenAttributes reply length
Correctly allow for excess length of DMXGetScreenAttributes reply
over standard 32 byte reply in addition to the displayName string
when computing the length of reply

http://bugs.freedesktop.org/show_bug.cgi?id=24685

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by:  Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 50a5c32430)
2009-11-03 13:19:47 +10:00
Peter Hutterer 48329b2c5c xserver 1.7.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-23 13:24:50 +10:00
Keith Packard da6c66dbc5 DRI2: Report the correct extension minor version
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9a2f6135bf)
2009-10-23 13:24:50 +10:00
Marcin Baczyński fb5db61be2 Kill compilation warnings.
Signed-off-by: Marcin Baczyński <marbacz@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit d886008c96)
2009-10-23 13:24:50 +10:00
Adam Jackson 5085340be6 dix: Fix up colormap fixup.
FindClientResourcesByType() will walk all colormaps on all screens; we
only want to fix up the current screen.  Otherwise, screens > 0 will
have the visual pointers for their colormaps pointing off into space.

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 15b30fde17)
2009-10-23 13:24:49 +10:00
Jon TURNEY 23ca41f4c3 Resolve an inconsistency between libX11 and Xserver over GetModifierMapping
libX11 ModMap.c believes that GetModifierMapping can never return an error

Xserver devices.c believes that GetModifierMapping can return an error if
the ModMap couldn't be generated

According to the protocol document I have, libX11 is right, so adjust the
server to send back an empty modmap if one couldn't be made...

http://bugs.freedesktop.org/show_bug.cgi?id=24621

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 909df9beb3)
2009-10-22 13:31:52 +10:00
Peter Hutterer 4b9979ae19 Merge branch 'server-1.7-branch' of git://anongit.freedesktop.org/~ewalsh/xserver into server-1.7-nominations 2009-10-22 13:31:21 +10:00
Eamon Walsh 4549953327 Don't print a failure message when XACE denies an input event delivery.
A denial is normal and the behavior should be to drop the event.
Having the log message creates excessive log spam.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
(cherry picked from commit d4fe55c98c28055191faeba92f43f30fb47cc43a)
2009-10-21 22:01:59 -04:00
Eamon Walsh 4cf085ce92 xselinux: Note something in the log if disabled by boolean.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-21 20:55:55 -04:00
Eamon Walsh 53c1430377 xselinux: Use the now-exported IsPointerDevice() instead of a copy.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-21 20:54:28 -04:00
Eamon Walsh 951a16c51e dix: Export IsPointerDevice() and IsKeyboardDevice().
Makes the functions available to extmod for extensions to call.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
(cherry picked from commit 0ae1632be0)
2009-10-21 20:52:38 -04:00
Eamon Walsh f874af7a85 xselinux: Allow SetWindowCreateContext to be used for pixmaps as well.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-10-21 19:32:05 -04:00
Eamon Walsh 5560f270c8 xselinux: switch from x_device to separate x_pointer and x_keyboard classes.
This will allow separate controls over pointer and keyboard without having
to relabel the devices to separate types.

[Backport to 1.7]

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
(cherry picked from commit 6c2ae5fec5)
2009-10-21 19:32:05 -04:00
Eamon Walsh 4814532133 xace: Relax permissions on XkbGetState from Read to Getattr.
This request is used to get the current keyboard group and is called from
GTK.  It does not return an actual keymap (aside from modifiers) so it
should be safe to relax the permission on it.  However it does return
button state information which should be controlled through a separate
pointer Read check.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
(cherry picked from commit c4ffce4dc8)
2009-10-21 19:32:05 -04:00
Eamon Walsh c1a861eedf xselinux: Stop special-casing QueryPointer access checks.
XACE has been changed to not return BadAccess on device read failures.
Thus, no need for this workaround code.

[Backport to 1.7]

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
(cherry-picked from commit 0ff2831990)
2009-10-21 19:32:05 -04:00
Eamon Walsh 7d3f8ce505 xace: Fake return values on denials in input polling requests.
Instead of returning BadAccess when "read" permission is denied
on a device, falsify the device state (buttons down, keys pressed).
This is nicer to applications, but may still have undesired side
effects.  The long-term solution is not to use these requests in
event-driven code!

Requests affected: QueryPointer, QueryKeymap, XiQueryDevice.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
(cherry picked from commit 8502c06e19)
2009-10-21 19:32:05 -04:00
Lee Leahu d6d3620faf dmxDestroyWindow() - must call the X's native DetroyWindow()
Don't really know why this section was disabled, but without it,
certain pPicture resources do not get free'd until later in the
FreeClientResources() process after the screen has been free'd -
resulting in seg fault.

With this patch, all resources normally free'd using vanilla X are
now also being freed correctly by Xdmx.

https://bugs.freedesktop.org/show_bug.cgi?id=24576

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f713f447a2)
2009-10-22 07:53:52 +10:00
Lee Leahu d1da013b32 dmx: when setting up device axis, use the correct counter number
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 664a8e37fd)
2009-10-22 07:53:50 +10:00
Peter Hutterer c16f3ae484 kdrive: silence tslib compiler warnings
tslib.c: In function 'TslibInit':
tslib.c:157: warning: unused variable 'tsDev'
tslib.c:156: warning: unused variable 'inputent'
tslib.c:155: warning: unused variable 'inputdir'
tslib.c:154: warning: unused variable 'i'
tslib.c:154: warning: unused variable 'fd'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit e08d8a2b04)
2009-10-22 07:53:39 +10:00
Keith Packard e644e322c7 Fix 'distcheck' to use host xkb files but install to build dir
'make distcheck' needs to read xkb files and write out compiled
versions as a part of the 'make check' phase. This patch passes
suitable options to the configure stage of the distcheck process to
read xkb files from the system location and write them to the
distcheck _inst directory.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 08e7f62faf)
2009-10-22 07:53:35 +10:00
Colin Harrison 55d3a77eb9 Xming: Remove unused X-boxed icon resource
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit 78c87bdad1)

Squashed-into this commit:

Fix make dist after 78c87bdad1

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 63f4bf3917)
2009-10-20 08:53:37 +10:00
Jeremy Huddleston 75e52c777c XQuartz: Fix a possible minor memory leak
(cherry picked from commit 24e640e1fa)
2009-10-19 12:55:32 -07:00
Jeremy Huddleston 31c6fc7673 XQuartz: Remove the redundant xquartz_resetenv_display
unsetenv(DISPLAY) takes care of this for us anyway
(cherry picked from commit d2263645d8)
(cherry picked from commit f3223c71cf)
2009-10-19 12:54:45 -07:00
Peter Hutterer 37b5f41cce xserver 1.7.0.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-19 11:55:03 +10:00
Peter Hutterer 37f857eb4c Revert "Xming: Remove unused X-boxed icon resource"
Breaks make dist.
make[2]: *** No rule to make target `X-boxed.ico', needed by `distdir'.  Stop.

This reverts commit 2969eaa88c.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-19 11:51:54 +10:00
Alan Coopersmith 650ac84a0c Fix segfault when -extension XKEYBOARD is passed on the command line
Users should be told they can't disable XKB or XInput via error messages,
not core dumps.

Reported by T`2 on #xorg irc

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 2bd71a6db2)
2009-10-19 11:20:16 +10:00
Peter Hutterer a8bfbd81b8 kdrive: fix Xfake build by removing the old keysym stuff
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit a32b2420d8)
2009-10-19 11:20:16 +10:00
Yaakov Selkowitz 64faf44f36 Remove duplicates from Xfake_LDADD
KDRIVE_LIBS already contains the libs in XSERVER_LIBS, so linking against
both leads to multiple-definition errors when linking on Cygwin.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit a2f27b9790)
2009-10-19 11:20:16 +10:00
Yaakov Selkowitz 4b419c1651 Fix XWIN_LIBS definition
Move XWIN_LIBS from XWIN=auto conditional to XWIN=yes conditional,
otherwise the build breaks if an explicit --enable-xwin is passed to
configure.

Also remove obsolete library values from the definition.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit ed4c6bc79a)
2009-10-19 11:20:16 +10:00
Yaakov Selkowitz 7d5282dd59 Install SDK pkg-config and aclocal files only if XORG
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit bcd0c02cfd)
2009-10-19 11:20:16 +10:00
Jon TURNEY 1b88e4eb2e Cygwin/X: Make -logverbose affect the verbosity of logging to the log file
Make -logverbose affect the verbosity of logging to the log file, not just the
verbosity of logging to the console

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
(cherry picked from commit 1b0dfd8dee)
2009-10-19 11:18:59 +10:00
Colin Harrison 2969eaa88c Xming: Remove unused X-boxed icon resource
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit 78c87bdad1)
2009-10-19 11:18:59 +10:00
Colin Harrison 92253b0f20 Xming: update .rc file
Remove the obsolete DISCARDABLE flag in the .rc file
Replace the obsolete DIALOG resource with DIALOGEX in the .rc file

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit fdf7f7e95c)
2009-10-19 11:18:59 +10:00
Jon TURNEY 237bc0c255 Cygwin/X: Don't build rootless extension code unless we need it
Only try to build rootless extension code if we really need it (i.e. mwextwm mode is enabled)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit 5ddfd9d089)
2009-10-19 11:18:59 +10:00
Yaakov Selkowitz c163126f06 dolt: add Cygwin to supported platforms
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 25344ba7f7)
2009-10-19 11:18:58 +10:00
Matt Turner 07229cd6da [alpha] assume we have __NR_pciconfig_iobase
The code path if we didn't have support has been broken since before we
switched to git.

The pciconfig_iobase syscall has been supported since 2000.

Signed-off-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 5e762f0e2f)
2009-10-15 13:54:51 +10:00
Matt Turner 13c5e2fe9c [alpha] don't return from void functions
Signed-off-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 46785c04bc)
2009-10-15 13:54:49 +10:00
Michael Cree fff0b2013a Fix undefined symbols on alpha
Signed-off-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 34eddbbb73)
2009-10-15 13:54:48 +10:00
Matt Turner a08186fe59 Fix breakage on alpha caused by c7680befe5
Pinpointed by by Michael Cree.

Commit c7680befe5 removed Jensen support, but at the same time broke
support for dense memory systems.

Signed-off-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 9625f6d328)
2009-10-15 13:54:46 +10:00
Peter Hutterer e116bebb13 dix: extend IsPointerDevice check to valuator-only devices.
A device with valuators but no keys is definitely a pointer device and needs
to be attached to the VCP. Otherwise, the class copying happens on the VCK
and the VCP isn't updated with the events that are to be sent through it.
This addresses the trigger for #24441, not the actual issue.
Jury is still out on valuator+key devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 72f5874434)
2009-10-14 09:52:00 +10:00
Jeremy Huddleston f6cb78e476 Rootless: src drawable window can now be NULL
Fix a possible crash when pSrc->pDrawable is NULL.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 7e178ffbed)
2009-10-13 12:56:04 -07:00
Jeremy Huddleston 496350bd68 Rootless: Abstract some of the Xplugin specific stuff which has crept into rootlessWindow.c
The rootless extension now directly calls some Xplugin functions, and relies
on types defined in Xplugin.h, which isn't very abstracted :-)

This patch is a start at abstracting some of the Xplugin specific stuff which
has crept into rootlessWindow.c.  This has been done in a pretty mindless fashion,
without much thought as to if the additions to the generic rootless interface are
the correct ones

There is some confusion as to if RootlesscolormapCallback() returns a Bool or
xp_error_enum value (not so abstact), but I have no way of checking, of finding
out if Xplugin actually checks the result :-)

Based on patches from Colin Harrison, Jon Turney and Yaakov Selkowitz

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
(cherry picked from commit 6980f77892)
2009-10-13 12:55:59 -07:00
Peter Hutterer 5411e78bd5 xserver 1.7.0.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-12 14:12:45 +10:00
Michel Dänzer b6e723eaeb EXA: Fix exaTryDriverSolidFill() for solid source pictures.
Solid pictures have a NULL pFormat field, but their format is always
PICT_a8r8g8b8.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1088073b11)
2009-10-10 12:19:57 +02:00
Ben Skeggs 2e37bda8d6 EXA: fix exaGetRGBAFromPixel to not loop forever on PICT_a8 picture
Easily reproducible by running "rendercheck -t fill".

It should be safe to just test against rbits for all colour components
as we should always have values for r/g/bbits for PICT_FORMAT_COLOR
formats.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Michel Dänzer <daenzer@vmware
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 55305cf8db)
2009-10-10 12:19:57 +02:00
Michel Dänzer 6d99a7de3f composite: Revert changes from adding support for BGRA picture formats.
They were aimed towards a since abandoned approach for making radeon KMS work
on big endian machines, and Aaron Plattner pointed out that they break the
Composite extension when the X server runs in 16bpp.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b375be9285)
2009-10-10 12:19:55 +02:00
Alan Coopersmith 398b5e01a7 Fix make warning: overriding commands for target `dix.O'
Not only does automake generate unnecessary rules for dix.O on platforms
for which SPECIAL_DTRACE_OBJECTS is false, it generates duplicate sets
when "if SPECIAL_DTRACE_OBJECTS" is nested inside "if XSERVER_DTRACE"

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit c0a1bb511a)
2009-10-09 09:16:44 +10:00
Jeremy Huddleston b916ac74e2 XQuartz: Send mouse location with scroll events.
This fixes the problem where (0, 0) was sent as the mouse location with scroll
button events causing the event to not reach the client.
(cherry picked from commit c4886fbabc)
2009-10-07 18:13:03 -07:00
Alan Coopersmith a4ce2aa634 Add platform tests for Dtrace linker magic
Replaces special handling for Xquartz DDX and scales better to handling
the multiple platforms that now have some level of Dtrace support available.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2009-10-07 17:24:03 -07:00
Alan Coopersmith 22fd21a71d Fix build of unit tests when dtrace probes are enabled
ar loses the dtrace probe magic when building static libraries, so we
have to link with the .O files in order to resolve the dtrace probe symbols.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-10-07 17:23:44 -07:00
Alan Coopersmith 8e3299eee8 Set XQUARTZ to no on non-Darwin OS'es
Fixes build with dtrace probes on Solaris after efacd7bfd0

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2009-10-07 17:23:06 -07:00
Kim Woelders f496e0042b render: Fix clip region translation in miClipPictureSrc().
Signed-off-by: Kim Woelders <kim@woelders.dk>
Reviewed-by:  Soren Sandmann Pedersen <sandmann@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit cbc886a351)
2009-10-06 18:58:48 +10:00
Peter Hutterer 5bc90ffdee xfree86: remove log-spamming DebugF
All input drivers use xf86PostKeyEventP indirectly now and have been since
it exists. I guess that qualifies it as tested - no need to spam the logs.

Reported-by: Felix Wenk
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit bd7430a32e)
2009-10-06 18:58:47 +10:00
Peter Hutterer 5c35d07c3b Require libXtst >= 1.0.99.2 and libdmx >= 1.0.99.1
libXtst requirement is already implicit since we require xextproto 7.1 and
that doesn't go well with pre 1.0.99.2 versions of libXtst. Nonetheless,
list it explicitly.

Since d044027510 we require dmxproto 2.2.99.1.
Complementing that is libdmx 1.0.99.1 with the dmxext.h header file.

Reported-by: Mark Rosenstand
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c629e0fc50)
2009-10-06 18:58:43 +10:00
Jeremy Huddleston b6016134b5 XQuartz: Set the proper bitmap for key repeats...
XkbSetRepeatKeys lies and doesn't do what it says it will...

(cherry picked from commits b9dfed9e88 and
                            873467adad)
2009-10-01 23:34:23 -07:00
Jeremy Huddleston 3808ecc99a XQuartz: Query the BundleIdentifier from the bundle in X11.bin rather than using the configure option.
This lets X11.bin drop into any .app ... the Info.plist and Xquartz binary need to have it hardcoded still.
(cherry picked from commit 9ad16b8e50)
2009-10-01 23:33:18 -07:00
Nirbheek Chauhan 80735dbf56 xkb: check permissions on XKM_OUTPUT_DIR
Checking just for root is insufficient since that does not guarantee write/read
permissions in XKM_OUTPUT_DIR (for example with sandbox).

Check if we can write a file, as well as read it later. Otherwise, invoke the
fallback to /tmp

Signed-off-by: Nirbheek Chauhan <nirbheek@gentoo.org>
Signed-off-by: RĂ©mi Cardona <remi@gentoo.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9bc7cbf9c0)
2009-10-02 16:20:29 +10:00
Jeremy Huddleston 616c7a009d XQuartz: Update version strings to be X11R7.5 and the bundle 2.5.0
Is fink really _still_ relying on this X11R7.x version string?
(cherry picked from commit 3d7cf468df)
2009-10-02 16:20:22 +10:00
Kim Woelders 19592ee774 dix: Fix potential memory corruption in doListFontsWithInfo.
Signed-off-by: Kim Woelders <kim@woelders.dk>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 4970666827)
2009-10-02 16:19:41 +10:00
Peter Hutterer 4257023c1e xserver 1.7.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-02 15:31:23 +10:00
Peter Hutterer 15b4faff28 dix: force a minimum of 0 for screen coordinates.
Currently the root coordinates may fall into ]-1..0] if the subpixel
remainder is less than 0. Screen coordinates mustn't go below 0, so use
miPointerSetPosition to cap off the remainder if the coordinates are below
0.

This is cheating a bit, a more comprehensive solution to deal with subpixels
correctly when crossing screens is needed. For now, this'll do.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Simon Thum <simon.thum@gmx.de>
(cherry picked from commit 45f447dafd)
2009-10-02 13:28:01 +10:00
Peter Hutterer 3788113618 configure: if xnest was requested but modules weren't found, fail.
Tested-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 64fe5784b4)
2009-10-02 13:27:57 +10:00
Dave Airlie c3034dc3af rotate: drop unwrapping inside block handler.
Keith has shown half the block handlers wrappers are wrong, also
dynamic wrapping/unwrapping from what I can see will happen after
the drivers, so its really accidental ABI, that we can't change
now without modifing drivers. So be safe for 1.7.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Declared-as-sane-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3ebb82d61c)
2009-10-02 13:27:56 +10:00
Peter Hutterer 47c0b80915 render: Fix crash in RenderAddGlyphs (#23645)
This patch fixes two bugs:
size is calculated as glyph height * padded_width. If the client submits
garbage, this may get above INT_MAX, resulting in a negative size if size is
unsigned. The sanity checks don't trigger for negative sizes and the server
goes and writes into random memory locations.

If the client submits glyphs with a width or height 0, the destination
pixmap is NULL, causing a null-pointer dereference. Since there's nothing to
composite if the width/height is 0, we might as well skip the whole thing
anyway.

Tested with Xvfb, Xephyr and Xorg.

X.Org Bug 23645 <http://bugs.freedesktop.org/show_bug.cgi?id=23645>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 622fc98fd0)
2009-10-01 16:27:36 +10:00
Peter Hutterer 30ebee3bfc render: set the glyph picture to NULL by default.
In a follow-up patch we may have glyphs with a NULL picture. To cope with
that, always set the pictures for glyphs to NULL at creation time and cope
with cleaning up such glyphs. Also, since compositing a NULL source doesn't
do a lot anyway, skip trying to do so.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 758ab55d2d)
2009-10-01 16:27:36 +10:00
Michel Dänzer 8026c5a085 exa: avoid infinite loops if UTS sw fallbacks.
The upload in finish access can cause an infinite loop if
UTS returns FALSE in here.

Fixes fd.o bug #24246.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b5fcc5553e)
2009-10-01 16:27:36 +10:00
Keith Packard e182c1b436 Re-fix DGA removal.
Removing DGA ended up breaking any drivers calling into the old
xf86DiDGAInit function as it tried to see if DGA was already enabled
and ended up crashing if the VT wasn't completely initialized. Oops.

Also, if the driver initializes DGA itself, have the DiDGA
initialization overwrite that information as the DiDGA code will call
ReInit on mode detect.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit db98b26ee1)
2009-10-01 16:27:36 +10:00
Dave Airlie 369b5d526b dix/glx/composite: consolidate visual resize in one place.
The previous code was copied and in both cases incorrectly fixed
up the colormaps after resizing the visuals, this patch consolidates
the visual resize + colormaps fixups in one place. This version
also consolidates the vid allocation for the DepthPtr inside the
function.

I'm not 100% sure colormap.[ch] is the correct place for this but
visuals are mostly created in fb and I know thats not the place to
be resizing them.

Fixes fd.o bug #19470.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6ffda5aae7)
2009-09-30 10:05:05 +10:00
Michel Dänzer d3ba814884 Fix ShmPutImage non-ZPixmap case.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=23298 .
(cherry picked from commit 11817a881c)
2009-09-30 10:04:55 +10:00
Peter Hutterer 8fc0d54cba ephyr: if -parent is given, check for a trailing -screen. (#24144)
If -parent is given, don't open up a new window if -screen is given as well.
The commandline option -screen allows to set the depth of the embedded
Xephry instance, even though width and height are autoscaled on -parent.

This patch checks for a -screen parameter after -parent and - if one is
found - delays initializing the screen. The parent window id is stored
temporarily but re-set after a -screen argument.
The following command is thus valid:

Xephyr -parent 1234 -screen 640x480@8 -screen 1024x768

It embeds the first 8-bit screen into window 1234 and opens up a new window
for the second screen. Multiple parent arguments are possible, the screens
are embedded in-order.

X.Org Bug 24144 <http://bugs.freedesktop.org/show_bug.cgi?id=24144>

Tested-by: Vic Lee
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 19be992d9d)
2009-09-30 10:04:50 +10:00
Peter Hutterer 857ec3e6ff xfree86: use the DDC size if either width or height of DisplaySize is bogus.
If either width or height of DisplaySize is invalid, assume that the
configuration is invalid and use the DDC-reported values instead.

See Comment 9, Bug 9758.
http://bugs.freedesktop.org/show_bug.cgi?id=9758#c9

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 83023ffd09)
2009-09-30 10:04:45 +10:00
Peter Hutterer 2d4bab18c0 render: Plug a memory leak in AddGlyph. (#23286)
AddGlyph was missing the FreePicture() call that DeleteGlyph used, resulting
in a memory leak when more than one Glyph was added in a RenderAddGlyphs
request.

Since the code in AddGlyph and DeleteGlyph is identical, move into a static
function to avoid such mistakes in the future.

X.Org Bug 23286 <http://bugs.freedesktop.org/show_bug.cgi?id=23286>
(cherry picked from commit f772014c43)
2009-09-30 10:04:28 +10:00
Peter Hutterer 290a9639db xserver 1.6.99.903 (xserver 1.7 RC3)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-28 21:05:11 +10:00
Peter Hutterer 8c83457c60 Merge remote branch 'origin/xorg-server-1.7-apple' into server-1.7-branch 2009-09-28 16:48:46 +10:00
Tilman Sauerbeck 6af44db315 configure: make XNEST default to auto.
When we're checking whether to build Xnest, we're comparing the
variable to auto but before it never was assigned that.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>

[Xnest was enabled to yes to increase build exposure and catch compiler
errors early. The requirements to Xnest are quite low and I expect most
developers have them, so Xnext will be enabled on most boxes. Anyone
missing those requires probably doesn't want to build Xnest anyway.]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3db28f92b0)
2009-09-28 16:47:00 +10:00
Ben Byer b49dba33f9 Add (ok, fix) support for DTrace under OS X
(cherry picked from commit 8428a57184)
2009-09-27 23:34:28 -07:00
Jeremy Huddleston cf2e3312cf Rootless: Correct border rendering on parent-relative windows
Resurected code from the punted RootlessPaintBackground/Border and added it conditionally to miPaintWindow
2009-09-27 23:09:51 -07:00
Jeremy Huddleston dadab5a227 XQuartz: Fix QuartzSetCursor to match the expected prototype. 2009-09-27 23:00:59 -07:00
Jeremy Huddleston 54000bdcbc XQuartz: Fix a bunch of compilation warnings about style 2009-09-27 22:57:25 -07:00
Jeremy Huddleston 29cb904e4d XQuartz: Nuke TSM
It's deprecated in SnowLeopard.  Ben and I both have no idea what it is for.  It says something about unicode input, but urxvt seems fine taking in unicode, so /shrug... bye.
2009-09-27 22:29:49 -07:00
Jeremy Huddleston de6cee11e1 XQuartz: Fix inverse map from mode_switch to alt 2009-09-27 22:26:22 -07:00
Peter Hutterer 7e6640b555 Revert "alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus"
The vesa driver still uses slowbcopy_frombus and slowbcopy_tobus.

This reverts commit 5ef53a94ce.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-28 12:27:35 +10:00
Jeremy Huddleston ceaa5c779c XQuartz: Force a keymap resync on the first keypress to workaround XKB mucking with our keymap.
We need to find a better way to work with XKB on this.
2009-09-27 18:25:57 -07:00
Jeremy Huddleston a3dbde2de8 XQuartz: Transition from xEvent based mieq to InternalEvent 2009-09-27 17:08:12 -07:00
Peter Hutterer 4aeac52c49 Merge remote branch 'origin/xorg-server-1.7-apple' into server-1.7-branch 2009-09-28 09:54:53 +10:00
Samuel Thibault 498135f26e xfree86: Hurd fix
I hadn't paid attention that the parameters order had changed, here is a
trivial patch, please apply.

Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 78ad6ca9a9)
2009-09-28 09:49:21 +10:00
Jeremy Huddleston 77099b933a XQuartz: Stop checking version numbers of the bundle because CFBundleGetVersionNumber is gimpish
(cherry picked from commit 9f5bdd8960)
2009-09-27 13:53:02 -07:00
Jeremy Huddleston 7958f6b75b XQuartz: Add pressure/tilt property labels 2009-09-27 13:53:02 -07:00
Jeremy Huddleston 29b2d9cdf5 XQuartz: Fix a brain-o array indexing problem
/bop Peter
2009-09-27 13:53:01 -07:00
Jeremy Huddleston fd1adc21a9 XQuartz: Nuke duplicate locks that make painful headaches 2009-09-27 13:53:01 -07:00
Jeremy Huddleston 6e4fc5d066 Xi: CopyKeyClass is not static for XQuartz 2009-09-27 13:53:01 -07:00
Jeremy Huddleston e0e2eaf1f3 XQuartz: Use internal xshm header for new xextproto
(cherry picked from commit 1755239330)
(cherry picked from commit 697be460d0)
2009-09-27 13:53:01 -07:00
Jeremy Huddleston 1a0dfde2d1 XQuartz: GLX capabilities: Allow 16bit accumulation buffers
http://xquartz.macosforge.org/trac/ticket/308
(cherry picked from commit e9e63a2118)
2009-09-27 13:53:01 -07:00
Michel Dänzer 0c6423b3d5 EXA: Fix mixed pixmaps crash with missing / failing UploadToScreen hook.
For the recent mixed pixmaps changes, I failed to realize (or hit in my
testing) a problem which can occur if the driver doesn't provide an
UploadToScreen hook or provides one which can fail: There can be a crash
in exaMemcpyBox() because exaCopyDirtyToFb() passes pExaPixmap->fb_ptr to
exaCopyDirty(), but that's normally NULL with driver allocated pixmaps.

The solution is to make exaCopyDirty*() no longer rely on pExaPixmap->fb_ptr
but use pPixmap->devPrivate.ptr after PrepareAccess instead.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24167 .
(cherry picked from commit 73ae547d5e)
2009-09-27 20:18:08 +10:00
Kevin E Martin bb7c26e38c dmx: undefine MITSHM, move undefs to miinitext.c.
This patch undefines MITSHM for dmx - we don't support the required
screen->ModifyPixmapHeaders. All undefines are moved from dmx-config to
miinitext.c, where they belong.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c9ec2bab2f)
2009-09-27 20:18:07 +10:00
Kevin E Martin 72f0194be1 dmx: reshuffle linker order to avoid errors when MITSHM is undefined.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit fc9d733bab)
2009-09-27 20:18:06 +10:00
Peter Hutterer e4edb4f2e6 dmx: core events are always in screen coordinates when passed to GPE.
This fixes input in dmx, the pointer appears at the right positions to the
clients now.

Also mark the spot where we pass in the button state as valuator to GPE
with a FIXME. (??)

Tested-by: Kevin Martin
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit e7c2598f56)
2009-09-27 20:18:01 +10:00
Peter Hutterer 7c9e0b0778 Xi: update axisVals with the right subpixel data.
Subpixel data in data_frac is stored as FP32.32, hence we need to get that
down again before adding it to the current value.

Reported-by: Thomas Jaeger
Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9bd08c690f)
2009-09-27 20:17:58 +10:00
Peter Hutterer 1745808c29 configure: Unify all library defines that require a specific version.
This patch moves all libraries that require a specific version into a single
location instead or duplicating them across the configure.ac file.
Libraries that do not require specific versions are left where they are.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 43a2eb794f)
2009-09-27 20:17:57 +10:00
Michel Dänzer e5371c7fc8 EXA: Extend mixed pixmaps scheme to allow driver PrepareAccess hook to fail.
If the PrepareAccess hook fails, use the DownloadFromScreen hook to retrieve
driver pixmap contents to a system RAM copy, perform software rendering on that
and copy the results back using the UploadToScreen hook. Use the classic
migration logic to minimize transfers (which as a bonus allows slightly
cleaning up some of the existing mixed pixmap code).

This enables things that weren't possible before with driver-allocated pixmap
storage: If some (or all) GPU pixmap storage can't be mapped directly by the
CPU, this can be handled between the PrepareAccess and
DownloadFrom/UploadToScreen hooks, e.g.:

* Radeon KMS on big endian machines can fail PrepareAccess if the pixmap
  requires byte-swapping and swap bytes in DownloadFrom/UploadToScreen.
* Environments where GPU and CPU don't have a shared address space at all.
  Here the driver PrepareAccess hook will always fail and leave all transfers
  between GPU / CPU storage to the Download/From/UploadToScreen hooks.

Drivers which can handle all pixmaps in the PrepareAccess hook should notice
little if any difference.
(cherry picked from commit 1818cbd70f)
2009-09-26 12:38:22 +10:00
Peter Hutterer cecd484fbb Require libXext >= 1.0.99.4
Reported-by: Tilman Sauerbeck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9fa73be9fa)
2009-09-26 12:37:51 +10:00
Peter Hutterer f188fabfe2 kdrive: plug two memory leaks when freeing the KdKeyboard/Pointer.
xkbRules, xkbModel and xkbLayout are strdup'd in KdNewKeyboard, need to be
freed.

The ephyr driver strdups the name on top of the already allocated
kdrive-assigned name. Memory must be freed beforehand.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a9c274df5c)
2009-09-26 12:37:49 +10:00
Peter Hutterer 48ab48a6ce dix: plug memory leak in DeviceEnterLeaveEvents.
'event' must be freed before exiting.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit fd91313673)
2009-09-26 12:37:43 +10:00
Peter Hutterer 9e39491166 Xi: fix length calculation for ValuatorState in QueryDeviceState reply.
The length field needs to include the bytes required for the valuators
(INT32) as well.

The reply length has the right value and since the valuator state is always
last, clients didn't notice the wrong offset.

Tested-by: Thomas Jaeger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6ee796e9bb)
2009-09-26 12:37:37 +10:00
Peter Hutterer a9e2f7ac15 configure: fix up tslib check once again.
This patch addresses two issues:
The check for HAVE_TSLIB = xauto can never be true, the check has been
corrected to TSLIB = xauto.

Pre-pkgconfig versions of tslib fail to be found, this patch restores the
additional AC_CHECK_LIB. However, the pgk-config check must happen before
AC_CHECK_LIB, as AC_CHECK_LIB does not seem to honour the LD_LIBRARY_PATH.
Thus, if tslib is installed outside of the default paths, AC_CHECK_LIB
fails.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked--by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 3b5bbb149d)
2009-09-25 09:14:58 +10:00
Thomas Jaeger 1f74cfdeac dix: report XI1 axis values correctly if first_valuator != 0
Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5402f18d9c)
2009-09-25 09:14:55 +10:00
Michel Dänzer 8867c60782 render: Don't add b8g8r8x8 format for depth 24.
The components are required to be packed in the bottom of the pixel, so this
format can't fit in depth 24.

Also fix up a comment for the addition of BGRA formats.
(cherry picked from commit ce1fe8ddb4)
2009-09-25 09:14:44 +10:00
Michel Dänzer ac1490b651 EXA: Fix some issues pointed out by clang.
Remove dead variables, fix use of uninitialized values, that kind of thing.
(cherry picked from commit 096f21bb7a)
2009-09-25 09:14:40 +10:00
Simon Thum 6b656c3498 dix: move bounds check before access
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 824a09d856)
2009-09-25 09:09:54 +10:00
Peter Hutterer 9c1a18377a xserver 1.6.99.902 (xserver 1.7 RC2)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-22 12:58:34 +10:00
326 changed files with 9889 additions and 6018 deletions

1
.gitignore vendored
View File

@ -45,6 +45,7 @@ xorg-server.pc
xorg-server-*.tar.bz2
xorg-server-*.tar.gz
stamp-h?
dix/Xserver-dtrace.h
do-not-use-config.h
do-not-use-config.h.in
dix/dix.c

42
COPYING
View File

@ -1,10 +1,12 @@
The following is the 'standard copyright' agreed upon by most contributors,
and is currently the canonical license, though a modification is currently
under discussion. Copyright holders of new code should use this license
statement where possible, and append their name to this list. Please sort
by surname for people, and by the full name for other entities (e.g.
Juliusz Chroboczek sorts before Intel Corporation sorts before Daniel
Stone).
and is currently the canonical license preferred by the X.Org Foundation.
This is a slight variant of the common MIT license form published by the
Open Source Initiative at http://www.opensource.org/licenses/mit-license.php
Copyright holders of new code should use this license statement where
possible, and insert their name to this list. Please sort by surname
for people, and by the full name for other entities (e.g. Juliusz
Chroboczek sorts before Intel Corporation sorts before Daniel Stone).
Copyright © 2000-2001 Juliusz Chroboczek
Copyright © 1998 Egbert Eich
@ -17,6 +19,7 @@ Copyright © 1999 Keith Packard
Copyright © 2007-2009 Red Hat, Inc.
Copyright © 2005-2008 Daniel Stone
Copyright © 2006-2009 Simon Thum
Copyright © 1987, 2003-2006, 2008-2009 Sun Microsystems, Inc.
Copyright © 2006 Luc Verhaegen
Permission is hereby granted, free of charge, to any person obtaining a
@ -162,32 +165,6 @@ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
All Rights Reserved
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright no-
tice appear in all copies and that both that copyright no-
tice and this permission notice appear in supporting docu-
mentation, and that the names of Sun or X Consortium
not be used in advertising or publicity pertaining to
distribution of the software without specific prior
written permission. Sun and X Consortium make no
representations about the suitability of this software for
any purpose. It is provided "as is" without any express or
implied warranty.
SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
Copyright 1987-1991, 1993 by Digital Equipment Corporation, Maynard, Massachusetts.
Copyright 1991 Massachusetts Institute of Technology, Cambridge, Massachusetts.
Copyright 1991, 1993 Olivetti Research Limited, Cambridge, England.
@ -1404,7 +1381,6 @@ Copyright 1987, 1998 The Open Group
Copyright © 1998-1999, 2001 The XFree86 Project, Inc.
Copyright © 2000 VA Linux Systems, Inc.
Copyright (c) 2000, 2001 Nokia Home Communications
Copyright 2003-2006, 2008 Sun Microsystems, Inc.
Copyright © 2007, 2008 Red Hat, Inc.
All rights reserved.

View File

@ -41,14 +41,21 @@ SUBDIRS = \
hw \
test
if XORG
aclocaldir = $(datadir)/aclocal
aclocal_DATA = xorg-server.m4
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xorg-server.pc
endif
EXTRA_DIST = xorg-server.pc.in xorg-server.m4 ChangeLog autogen.sh
DISTCHECK_CONFIGURE_FLAGS=\
--with-xkb-path=$(XKB_BASE_DIRECTORY) \
--with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \
--with-xkb-output='$${datadir}/X11/xkb/compiled'
DISTCLEANFILES = doltcompile doltlibtool
MAINTAINERCLEANFILES=ChangeLog

View File

@ -32,6 +32,7 @@ BUILTIN_SRCS = \
# Sources always included in libXextmodule.la & libXext.la. That's right, zero.
MODULE_SRCS =
MODULE_LIBS =
# Optional sources included if extension enabled by configure.ac rules
@ -83,6 +84,7 @@ endif
XSELINUX_SRCS = xselinux.c xselinux.h
if XSELINUX
MODULE_SRCS += $(XSELINUX_SRCS)
MODULE_LIBS += $(SELINUX_LIBS)
endif
# Security extension: multi-level security to protect clients from each other
@ -119,11 +121,13 @@ endif
# Now take all of the above, mix well, bake for 10 minutes and get libXext*.la
libXext_la_SOURCES = $(BUILTIN_SRCS) $(MODULE_SRCS)
libXext_la_LIBADD = $(MODULE_LIBS)
if XORG
libXextbuiltin_la_SOURCES = $(BUILTIN_SRCS)
libXextmodule_la_SOURCES = $(MODULE_SRCS)
libXextmodule_la_LIBADD = $(MODULE_LIBS)
endif
EXTRA_DIST = \

View File

@ -36,11 +36,8 @@
#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
int GEEventBase;
int GEErrorBase;
static int GEClientPrivateKeyIndex;
DevPrivateKey GEClientPrivateKey = &GEClientPrivateKeyIndex;
int GEEventType; /* The opcode for all GenericEvents will have. */
int RT_GECLIENT = 0;
@ -168,12 +165,6 @@ GEClientCallback(CallbackListPtr *list,
ClientPtr pClient = clientinfo->client;
GEClientInfoPtr pGEClient = GEGetClient(pClient);
if (pGEClient == NULL)
{
pGEClient = xcalloc(1, sizeof(GEClientInfoRec));
dixSetPrivate(&pClient->devPrivates, GEClientPrivateKey, pGEClient);
}
pGEClient->major_version = 0;
pGEClient->minor_version = 0;
}
@ -184,10 +175,6 @@ GEResetProc(ExtensionEntry *extEntry)
{
DeleteCallback(&ClientStateCallback, GEClientCallback, 0);
EventSwapVector[GenericEvent] = NotImplemented;
GEEventBase = 0;
GEErrorBase = 0;
GEEventType = 0;
}
/* Calls the registered event swap function for the extension.
@ -222,20 +209,19 @@ GEExtensionInit(void)
{
ExtensionEntry *extEntry;
if (!dixRequestPrivate(GEClientPrivateKey, sizeof(GEClientInfoRec)))
FatalError("GEExtensionInit: GE private request failed.\n");
if(!AddCallback(&ClientStateCallback, GEClientCallback, 0))
{
FatalError("GEExtensionInit: register client callback failed.\n");
}
if((extEntry = AddExtension(GE_NAME,
GENumberEvents, GENumberErrors,
0, GENumberErrors,
ProcGEDispatch, SProcGEDispatch,
GEResetProc, StandardMinorOpcode)) != 0)
{
GEEventBase = extEntry->eventBase;
GEErrorBase = extEntry->errorBase;
GEEventType = GEEventBase;
memset(GEExtensions, 0, sizeof(GEExtensions));
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;

View File

@ -37,9 +37,6 @@
#include "extnsionst.h"
#include <X11/extensions/geproto.h>
extern _X_EXPORT int GEEventType;
extern _X_EXPORT int GEEventBase;
extern _X_EXPORT int GEErrorBase;
extern _X_EXPORT DevPrivateKey GEClientPrivateKey;
typedef struct _GEClientInfo {

View File

@ -618,10 +618,10 @@ CreateSaverWindow (ScreenPtr pScreen)
FreeResource (pWin->drawable.id, RT_NONE);
return FALSE;
}
pAttr->pCursor->refcnt++;
if (pWin->optional->cursor)
FreeCursor (pWin->optional->cursor, (Cursor)0);
pWin->optional->cursor = pAttr->pCursor;
pAttr->pCursor->refcnt++;
pWin->cursorIsNone = FALSE;
CheckWindowOptionalNeed (pWin);
mask |= CWCursor;

View File

@ -497,15 +497,40 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
char *data)
{
PixmapPtr pPixmap;
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth),
PixmapBytePad(w, depth),
data);
if (!pPixmap)
return;
pGC->ops->CopyArea((DrawablePtr)pPixmap, dst, pGC, sx, sy, sw, sh, dx, dy);
FreeScratchPixmapHeader(pPixmap);
if (format == ZPixmap || depth == 1) {
pPixmap = GetScratchPixmapHeader(dst->pScreen, w, h, depth,
BitsPerPixel(depth),
PixmapBytePad(w, depth),
data);
if (!pPixmap)
return;
pGC->ops->CopyArea((DrawablePtr)pPixmap, dst, pGC, sx, sy, sw, sh, dx, dy);
FreeScratchPixmapHeader(pPixmap);
} else {
GCPtr putGC = GetScratchGC(depth, dst->pScreen);
if (!putGC)
return;
pPixmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) {
FreeScratchGC(putGC);
return;
}
ValidateGC(&pPixmap->drawable, putGC);
(*putGC->ops->PutImage)(&pPixmap->drawable, putGC, depth, -sx, -sy, w, h, 0,
(format == XYPixmap) ? XYPixmap : ZPixmap, data);
FreeScratchGC(putGC);
if (format == XYBitmap)
(void)(*pGC->ops->CopyPlane)(&pPixmap->drawable, dst, pGC, 0, 0, sw, sh,
dx, dy, 1L);
else
(void)(*pGC->ops->CopyArea)(&pPixmap->drawable, dst, pGC, 0, 0, sw, sh,
dx, dy);
(*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
}
}
#ifdef PANORAMIX

View File

@ -67,6 +67,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include "opaque.h"
#include <X11/extensions/syncproto.h>
#include "syncsrv.h"
#include "protocol-versions.h"
#include <stdio.h>
#if !defined(WIN32)
@ -1140,8 +1141,8 @@ ProcSyncInitialize(ClientPtr client)
memset(&rep, 0, sizeof(xSyncInitializeReply));
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.majorVersion = SYNC_MAJOR_VERSION;
rep.minorVersion = SYNC_MINOR_VERSION;
rep.majorVersion = SERVER_SYNC_MAJOR_VERSION;
rep.minorVersion = SERVER_SYNC_MINOR_VERSION;
rep.length = 0;
if (client->swapped)

View File

@ -87,7 +87,18 @@ void XaceHookAuditEnd(ClientPtr ptr, int result)
*/
int XaceHook(int hook, ...)
{
pointer calldata; /* data passed to callback */
union {
XaceResourceAccessRec res;
XaceDeviceAccessRec dev;
XaceSendAccessRec send;
XaceReceiveAccessRec recv;
XaceClientAccessRec client;
XaceExtAccessRec ext;
XaceServerAccessRec server;
XaceScreenAccessRec screen;
XaceAuthAvailRec auth;
XaceKeyAvailRec key;
} u;
int *prv = NULL; /* points to return value from callback */
va_list ap; /* argument list */
va_start(ap, hook);
@ -99,117 +110,86 @@ int XaceHook(int hook, ...)
*/
switch (hook)
{
case XACE_RESOURCE_ACCESS: {
XaceResourceAccessRec rec;
rec.client = va_arg(ap, ClientPtr);
rec.id = va_arg(ap, XID);
rec.rtype = va_arg(ap, RESTYPE);
rec.res = va_arg(ap, pointer);
rec.ptype = va_arg(ap, RESTYPE);
rec.parent = va_arg(ap, pointer);
rec.access_mode = va_arg(ap, Mask);
rec.status = Success; /* default allow */
calldata = &rec;
prv = &rec.status;
case XACE_RESOURCE_ACCESS:
u.res.client = va_arg(ap, ClientPtr);
u.res.id = va_arg(ap, XID);
u.res.rtype = va_arg(ap, RESTYPE);
u.res.res = va_arg(ap, pointer);
u.res.ptype = va_arg(ap, RESTYPE);
u.res.parent = va_arg(ap, pointer);
u.res.access_mode = va_arg(ap, Mask);
u.res.status = Success; /* default allow */
prv = &u.res.status;
break;
}
case XACE_DEVICE_ACCESS: {
XaceDeviceAccessRec rec;
rec.client = va_arg(ap, ClientPtr);
rec.dev = va_arg(ap, DeviceIntPtr);
rec.access_mode = va_arg(ap, Mask);
rec.status = Success; /* default allow */
calldata = &rec;
prv = &rec.status;
case XACE_DEVICE_ACCESS:
u.dev.client = va_arg(ap, ClientPtr);
u.dev.dev = va_arg(ap, DeviceIntPtr);
u.dev.access_mode = va_arg(ap, Mask);
u.dev.status = Success; /* default allow */
prv = &u.dev.status;
break;
}
case XACE_SEND_ACCESS: {
XaceSendAccessRec rec;
rec.client = va_arg(ap, ClientPtr);
rec.dev = va_arg(ap, DeviceIntPtr);
rec.pWin = va_arg(ap, WindowPtr);
rec.events = va_arg(ap, xEventPtr);
rec.count = va_arg(ap, int);
rec.status = Success; /* default allow */
calldata = &rec;
prv = &rec.status;
case XACE_SEND_ACCESS:
u.send.client = va_arg(ap, ClientPtr);
u.send.dev = va_arg(ap, DeviceIntPtr);
u.send.pWin = va_arg(ap, WindowPtr);
u.send.events = va_arg(ap, xEventPtr);
u.send.count = va_arg(ap, int);
u.send.status = Success; /* default allow */
prv = &u.send.status;
break;
}
case XACE_RECEIVE_ACCESS: {
XaceReceiveAccessRec rec;
rec.client = va_arg(ap, ClientPtr);
rec.pWin = va_arg(ap, WindowPtr);
rec.events = va_arg(ap, xEventPtr);
rec.count = va_arg(ap, int);
rec.status = Success; /* default allow */
calldata = &rec;
prv = &rec.status;
case XACE_RECEIVE_ACCESS:
u.recv.client = va_arg(ap, ClientPtr);
u.recv.pWin = va_arg(ap, WindowPtr);
u.recv.events = va_arg(ap, xEventPtr);
u.recv.count = va_arg(ap, int);
u.recv.status = Success; /* default allow */
prv = &u.recv.status;
break;
}
case XACE_CLIENT_ACCESS: {
XaceClientAccessRec rec;
rec.client = va_arg(ap, ClientPtr);
rec.target = va_arg(ap, ClientPtr);
rec.access_mode = va_arg(ap, Mask);
rec.status = Success; /* default allow */
calldata = &rec;
prv = &rec.status;
case XACE_CLIENT_ACCESS:
u.client.client = va_arg(ap, ClientPtr);
u.client.target = va_arg(ap, ClientPtr);
u.client.access_mode = va_arg(ap, Mask);
u.client.status = Success; /* default allow */
prv = &u.client.status;
break;
}
case XACE_EXT_ACCESS: {
XaceExtAccessRec rec;
rec.client = va_arg(ap, ClientPtr);
rec.ext = va_arg(ap, ExtensionEntry*);
rec.access_mode = DixGetAttrAccess;
rec.status = Success; /* default allow */
calldata = &rec;
prv = &rec.status;
case XACE_EXT_ACCESS:
u.ext.client = va_arg(ap, ClientPtr);
u.ext.ext = va_arg(ap, ExtensionEntry*);
u.ext.access_mode = DixGetAttrAccess;
u.ext.status = Success; /* default allow */
prv = &u.ext.status;
break;
}
case XACE_SERVER_ACCESS: {
XaceServerAccessRec rec;
rec.client = va_arg(ap, ClientPtr);
rec.access_mode = va_arg(ap, Mask);
rec.status = Success; /* default allow */
calldata = &rec;
prv = &rec.status;
case XACE_SERVER_ACCESS:
u.server.client = va_arg(ap, ClientPtr);
u.server.access_mode = va_arg(ap, Mask);
u.server.status = Success; /* default allow */
prv = &u.server.status;
break;
}
case XACE_SCREEN_ACCESS:
case XACE_SCREENSAVER_ACCESS: {
XaceScreenAccessRec rec;
rec.client = va_arg(ap, ClientPtr);
rec.screen = va_arg(ap, ScreenPtr);
rec.access_mode = va_arg(ap, Mask);
rec.status = Success; /* default allow */
calldata = &rec;
prv = &rec.status;
case XACE_SCREENSAVER_ACCESS:
u.screen.client = va_arg(ap, ClientPtr);
u.screen.screen = va_arg(ap, ScreenPtr);
u.screen.access_mode = va_arg(ap, Mask);
u.screen.status = Success; /* default allow */
prv = &u.screen.status;
break;
}
case XACE_AUTH_AVAIL: {
XaceAuthAvailRec rec;
rec.client = va_arg(ap, ClientPtr);
rec.authId = va_arg(ap, XID);
calldata = &rec;
case XACE_AUTH_AVAIL:
u.auth.client = va_arg(ap, ClientPtr);
u.auth.authId = va_arg(ap, XID);
break;
}
case XACE_KEY_AVAIL: {
XaceKeyAvailRec rec;
rec.event = va_arg(ap, xEventPtr);
rec.keybd = va_arg(ap, DeviceIntPtr);
rec.count = va_arg(ap, int);
calldata = &rec;
case XACE_KEY_AVAIL:
u.key.event = va_arg(ap, xEventPtr);
u.key.keybd = va_arg(ap, DeviceIntPtr);
u.key.count = va_arg(ap, int);
break;
}
default: {
default:
va_end(ap);
return 0; /* unimplemented hook number */
}
}
va_end(ap);
/* call callbacks and return result, if any. */
CallCallbacks(&XaceHooks[hook], calldata);
CallCallbacks(&XaceHooks[hook], &u);
return prv ? *prv : Success;
}

View File

@ -112,9 +112,6 @@ typedef struct {
/* labeling handle */
static struct selabel_handle *label_hnd;
/* whether AVC is active */
static int avc_active;
/* atoms for window label properties */
static Atom atom_ctx;
static Atom atom_client_ctx;
@ -238,20 +235,17 @@ SELinuxSelectionToSID(Atom selection, SELinuxSubjectRec *subj,
/* Check for an override context next */
if (subj->sel_use_sid) {
sidget(tsid = subj->sel_use_sid);
tsid = subj->sel_use_sid;
goto out;
}
sidget(tsid = obj->sid);
tsid = obj->sid;
/* Polyinstantiate if necessary to obtain the final SID */
if (obj->poly) {
sidput(tsid);
if (avc_compute_member(subj->sid, obj->sid,
SECCLASS_X_SELECTION, &tsid) < 0) {
ErrorF("SELinux: a compute_member call failed!\n");
return BadValue;
}
if (obj->poly && avc_compute_member(subj->sid, obj->sid,
SECCLASS_X_SELECTION, &tsid) < 0) {
ErrorF("SELinux: a compute_member call failed!\n");
return BadValue;
}
out:
*sid_rtn = tsid;
@ -278,7 +272,7 @@ SELinuxPropertyToSID(Atom property, SELinuxSubjectRec *subj,
/* Check for an override context next */
if (subj->prp_use_sid) {
sidget(tsid = subj->prp_use_sid);
tsid = subj->prp_use_sid;
goto out;
}
@ -295,10 +289,8 @@ SELinuxPropertyToSID(Atom property, SELinuxSubjectRec *subj,
if (avc_compute_member(subj->sid, tsid2,
SECCLASS_X_PROPERTY, &tsid) < 0) {
ErrorF("SELinux: a compute_member call failed!\n");
sidput(tsid2);
return BadValue;
}
sidput(tsid2);
}
out:
*sid_rtn = tsid;
@ -438,9 +430,7 @@ SELinuxLabelClient(ClientPtr client)
security_context_t ctx;
subj = dixLookupPrivate(&client->devPrivates, subjectKey);
sidput(subj->sid);
obj = dixLookupPrivate(&client->devPrivates, objectKey);
sidput(obj->sid);
/* Try to get a context from the socket */
if (fd < 0 || getpeercon_raw(fd, &ctx) < 0) {
@ -484,7 +474,7 @@ finish:
FatalError("SELinux: client %d: context_to_sid_raw(%s) failed\n",
client->index, ctx);
sidget(obj->sid = subj->sid);
obj->sid = subj->sid;
freecon(ctx);
}
@ -505,7 +495,6 @@ SELinuxLabelInitial(void)
subj = dixLookupPrivate(&serverClient->devPrivates, subjectKey);
obj = dixLookupPrivate(&serverClient->devPrivates, objectKey);
subj->privileged = 1;
sidput(subj->sid);
/* Use the context of the X server process for the serverClient */
if (getcon_raw(&ctx) < 0)
@ -515,7 +504,7 @@ SELinuxLabelInitial(void)
if (avc_context_to_sid_raw(ctx, &subj->sid) < 0)
FatalError("SELinux: serverClient: context_to_sid(%s) failed\n", ctx);
sidget(obj->sid = subj->sid);
obj->sid = subj->sid;
freecon(ctx);
srec.client = serverClient;
@ -544,8 +533,8 @@ SELinuxLabelResource(XaceResourceAccessRec *rec, SELinuxSubjectRec *subj,
security_id_t tsid;
/* Check for a create context */
if (rec->rtype == RT_WINDOW && subj->win_create_sid) {
sidget(obj->sid = subj->win_create_sid);
if (rec->rtype & RC_DRAWABLE && subj->win_create_sid) {
obj->sid = subj->win_create_sid;
return Success;
}
@ -662,6 +651,7 @@ SELinuxDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata)
SELinuxSubjectRec *subj;
SELinuxObjectRec *obj;
SELinuxAuditRec auditdata = { .client = rec->client, .dev = rec->dev };
security_class_t cls;
int rc;
subj = dixLookupPrivate(&rec->client->devPrivates, subjectKey);
@ -672,33 +662,19 @@ SELinuxDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata)
SELinuxSubjectRec *dsubj;
dsubj = dixLookupPrivate(&rec->dev->devPrivates, subjectKey);
sidput(dsubj->sid);
sidput(obj->sid);
if (subj->dev_create_sid) {
/* Label the device with the create context */
sidget(obj->sid = subj->dev_create_sid);
sidget(dsubj->sid = subj->dev_create_sid);
obj->sid = subj->dev_create_sid;
dsubj->sid = subj->dev_create_sid;
} else {
/* Label the device directly with the process SID */
sidget(obj->sid = subj->sid);
sidget(dsubj->sid = subj->sid);
obj->sid = subj->sid;
dsubj->sid = subj->sid;
}
}
/* XXX only check read permission on XQueryKeymap */
/* This is to allow the numerous apps that call XQueryPointer to work */
if (rec->access_mode & DixReadAccess) {
ClientPtr client = rec->client;
REQUEST(xReq);
if (stuff && stuff->reqType != X_QueryKeymap) {
rec->access_mode &= ~DixReadAccess;
rec->access_mode |= DixGetAttrAccess;
}
}
rc = SELinuxDoCheck(subj, obj, SECCLASS_X_DEVICE, rec->access_mode,
&auditdata);
cls = IsPointerDevice(rec->dev) ? SECCLASS_X_POINTER : SECCLASS_X_KEYBOARD;
rc = SELinuxDoCheck(subj, obj, cls, rec->access_mode, &auditdata);
if (rc != Success)
rec->status = rc;
}
@ -817,8 +793,6 @@ SELinuxExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
return;
}
sidput(obj->sid);
/* Perform a transition to obtain the final SID */
if (avc_compute_create(serv->sid, sid, SECCLASS_X_EXTENSION,
&obj->sid) < 0) {
@ -856,7 +830,6 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* If this is a new object that needs labeling, do it now */
if (access_mode & DixCreateAccess) {
sidput(obj->sid);
rc = SELinuxSelectionToSID(name, subj, &obj->sid, &obj->poly);
if (rc != Success)
obj->sid = unlabeled_sid;
@ -874,7 +847,6 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata)
break;
obj = dixLookupPrivate(&pSel->devPrivates, objectKey);
}
sidput(tsid);
if (pSel)
*rec->ppSel = pSel;
@ -893,11 +865,10 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* Label the content (advisory only) */
if (access_mode & DixSetAttrAccess) {
data = dixLookupPrivate(&pSel->devPrivates, dataKey);
sidput(data->sid);
if (subj->sel_create_sid)
sidget(data->sid = subj->sel_create_sid);
data->sid = subj->sel_create_sid;
else
sidget(data->sid = obj->sid);
data->sid = obj->sid;
}
}
@ -922,7 +893,6 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* If this is a new object that needs labeling, do it now */
if (rec->access_mode & DixCreateAccess) {
sidput(obj->sid);
rc = SELinuxPropertyToSID(name, subj, &obj->sid, &obj->poly);
if (rc != Success) {
rec->status = rc;
@ -941,7 +911,6 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
break;
obj = dixLookupPrivate(&pProp->devPrivates, objectKey);
}
sidput(tsid);
if (pProp)
*rec->ppProp = pProp;
@ -960,11 +929,10 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* Label the content (advisory only) */
if (rec->access_mode & DixWriteAccess) {
data = dixLookupPrivate(&pProp->devPrivates, dataKey);
sidput(data->sid);
if (subj->prp_create_sid)
sidget(data->sid = subj->prp_create_sid);
data->sid = subj->prp_create_sid;
else
sidget(data->sid = obj->sid);
data->sid = obj->sid;
}
}
@ -1041,8 +1009,6 @@ SELinuxScreen(CallbackListPtr *pcbl, pointer is_saver, pointer calldata)
/* If this is a new object that needs labeling, do it now */
if (access_mode & DixCreateAccess) {
sidput(obj->sid);
/* Perform a transition to obtain the final SID */
if (avc_compute_create(subj->sid, subj->sid, SECCLASS_X_SCREEN,
&obj->sid) < 0) {
@ -1174,7 +1140,6 @@ SELinuxSubjectInit(CallbackListPtr *pcbl, pointer unused, pointer calldata)
PrivateCallbackRec *rec = calldata;
SELinuxSubjectRec *subj = *rec->value;
sidget(unlabeled_sid);
subj->sid = unlabeled_sid;
avc_entry_ref_init(&subj->aeref);
@ -1187,14 +1152,6 @@ SELinuxSubjectFree(CallbackListPtr *pcbl, pointer unused, pointer calldata)
SELinuxSubjectRec *subj = *rec->value;
xfree(subj->command);
if (avc_active) {
sidput(subj->sid);
sidput(subj->dev_create_sid);
sidput(subj->win_create_sid);
sidput(subj->sel_create_sid);
sidput(subj->prp_create_sid);
}
}
static void
@ -1203,20 +1160,9 @@ SELinuxObjectInit(CallbackListPtr *pcbl, pointer unused, pointer calldata)
PrivateCallbackRec *rec = calldata;
SELinuxObjectRec *obj = *rec->value;
sidget(unlabeled_sid);
obj->sid = unlabeled_sid;
}
static void
SELinuxObjectFree(CallbackListPtr *pcbl, pointer unused, pointer calldata)
{
PrivateCallbackRec *rec = calldata;
SELinuxObjectRec *obj = *rec->value;
if (avc_active)
sidput(obj->sid);
}
/*
* Extension Dispatch
@ -1320,7 +1266,6 @@ ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
ptr = dixLookupPrivate(privPtr, subjectKey);
pSid = (security_id_t *)(ptr + offset);
sidput(*pSid);
*pSid = NULL;
rc = Success;
@ -1381,11 +1326,9 @@ ProcSELinuxSetDeviceContext(ClientPtr client)
}
subj = dixLookupPrivate(&dev->devPrivates, subjectKey);
sidput(subj->sid);
subj->sid = sid;
obj = dixLookupPrivate(&dev->devPrivates, objectKey);
sidput(obj->sid);
sidget(obj->sid = sid);
obj->sid = sid;
rc = Success;
out:
@ -1412,20 +1355,28 @@ ProcSELinuxGetDeviceContext(ClientPtr client)
}
static int
ProcSELinuxGetWindowContext(ClientPtr client)
ProcSELinuxGetDrawableContext(ClientPtr client)
{
WindowPtr pWin;
DrawablePtr pDraw;
PrivateRec **privatePtr;
SELinuxObjectRec *obj;
int rc;
REQUEST(SELinuxGetContextReq);
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
rc = dixLookupDrawable(&pDraw, stuff->id, client,
M_WINDOW | M_DRAWABLE_PIXMAP,
DixGetAttrAccess);
if (rc != Success)
return rc;
obj = dixLookupPrivate(&pWin->devPrivates, objectKey);
if (pDraw->type == M_DRAWABLE_PIXMAP)
privatePtr = &((PixmapPtr)pDraw)->devPrivates;
else
privatePtr = &((WindowPtr)pDraw)->devPrivates;
obj = dixLookupPrivate(privatePtr, objectKey);
return SELinuxSendContextReply(client, obj->sid);
}
@ -1669,12 +1620,12 @@ ProcSELinuxDispatch(ClientPtr client)
return ProcSELinuxSetDeviceContext(client);
case X_SELinuxGetDeviceContext:
return ProcSELinuxGetDeviceContext(client);
case X_SELinuxSetWindowCreateContext:
case X_SELinuxSetDrawableCreateContext:
return ProcSELinuxSetCreateContext(client, CTX_WIN);
case X_SELinuxGetWindowCreateContext:
case X_SELinuxGetDrawableCreateContext:
return ProcSELinuxGetCreateContext(client, CTX_WIN);
case X_SELinuxGetWindowContext:
return ProcSELinuxGetWindowContext(client);
case X_SELinuxGetDrawableContext:
return ProcSELinuxGetDrawableContext(client);
case X_SELinuxSetPropertyCreateContext:
return ProcSELinuxSetCreateContext(client, CTX_PRP);
case X_SELinuxGetPropertyCreateContext:
@ -1757,14 +1708,14 @@ SProcSELinuxGetDeviceContext(ClientPtr client)
}
static int
SProcSELinuxGetWindowContext(ClientPtr client)
SProcSELinuxGetDrawableContext(ClientPtr client)
{
REQUEST(SELinuxGetContextReq);
int n;
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
swapl(&stuff->id, n);
return ProcSELinuxGetWindowContext(client);
return ProcSELinuxGetDrawableContext(client);
}
static int
@ -1831,12 +1782,12 @@ SProcSELinuxDispatch(ClientPtr client)
return SProcSELinuxSetDeviceContext(client);
case X_SELinuxGetDeviceContext:
return SProcSELinuxGetDeviceContext(client);
case X_SELinuxSetWindowCreateContext:
case X_SELinuxSetDrawableCreateContext:
return SProcSELinuxSetCreateContext(client, CTX_WIN);
case X_SELinuxGetWindowCreateContext:
case X_SELinuxGetDrawableCreateContext:
return ProcSELinuxGetCreateContext(client, CTX_WIN);
case X_SELinuxGetWindowContext:
return SProcSELinuxGetWindowContext(client);
case X_SELinuxGetDrawableContext:
return SProcSELinuxGetDrawableContext(client);
case X_SELinuxSetPropertyCreateContext:
return SProcSELinuxSetCreateContext(client, CTX_PRP);
case X_SELinuxGetPropertyCreateContext:
@ -1872,7 +1823,6 @@ SProcSELinuxDispatch(ClientPtr client)
}
}
#ifdef HAVE_AVC_NETLINK_ACQUIRE_FD
static int netlink_fd;
static void
@ -1886,7 +1836,6 @@ SELinuxWakeupHandler(void *data, int err, void *read_mask)
if (FD_ISSET(netlink_fd, (fd_set *)read_mask))
avc_netlink_check_nb();
}
#endif
/*
@ -1918,15 +1867,12 @@ SELinuxResetProc(ExtensionEntry *extEntry)
label_hnd = NULL;
audit_close(audit_fd);
#ifdef HAVE_AVC_NETLINK_ACQUIRE_FD
avc_netlink_release_fd();
RemoveBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
NULL);
RemoveGeneralSocket(netlink_fd);
#endif
avc_destroy();
avc_active = 0;
/* Free local state */
xfree(knownAtoms);
@ -1958,8 +1904,10 @@ SELinuxExtensionInit(INITARGS)
}
/* Don't init unless there's something to do */
if (!security_get_boolean_active("xserver_object_manager"))
if (!security_get_boolean_active("xserver_object_manager")) {
LogMessage(X_INFO, "SELinux: Disabled by boolean\n");
return;
}
/* Check SELinux mode in configuration file */
switch(selinuxEnforcingState) {
@ -1993,7 +1941,6 @@ SELinuxExtensionInit(INITARGS)
if (avc_open(&avc_option, 1) < 0)
FatalError("SELinux: Couldn't initialize SELinux userspace AVC\n");
avc_active = 1;
label_hnd = selabel_open(SELABEL_CTX_X, &selabel_option, 1);
if (!label_hnd)
@ -2024,20 +1971,16 @@ SELinuxExtensionInit(INITARGS)
if (atom_client_ctx == BAD_RESOURCE)
FatalError("SELinux: Failed to create atom\n");
#ifdef HAVE_AVC_NETLINK_ACQUIRE_FD
netlink_fd = avc_netlink_acquire_fd();
AddGeneralSocket(netlink_fd);
RegisterBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
NULL);
#endif
/* Register callbacks */
ret &= dixRegisterPrivateInitFunc(subjectKey, SELinuxSubjectInit, NULL);
ret &= dixRegisterPrivateDeleteFunc(subjectKey, SELinuxSubjectFree, NULL);
ret &= dixRegisterPrivateInitFunc(objectKey, SELinuxObjectInit, NULL);
ret &= dixRegisterPrivateDeleteFunc(objectKey, SELinuxObjectFree, NULL);
ret &= dixRegisterPrivateInitFunc(dataKey, SELinuxObjectInit, NULL);
ret &= dixRegisterPrivateDeleteFunc(dataKey, SELinuxObjectFree, NULL);
ret &= AddCallback(&ClientStateCallback, SELinuxClientState, NULL);
ret &= AddCallback(&ResourceStateCallback, SELinuxResourceState, NULL);

View File

@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* Extension info */
#define SELINUX_EXTENSION_NAME "SELinux"
#define SELINUX_MAJOR_VERSION 1
#define SELINUX_MINOR_VERSION 0
#define SELINUX_MINOR_VERSION 1
#define SELinuxNumberEvents 0
#define SELinuxNumberErrors 0
@ -35,9 +35,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define X_SELinuxGetDeviceCreateContext 2
#define X_SELinuxSetDeviceContext 3
#define X_SELinuxGetDeviceContext 4
#define X_SELinuxSetWindowCreateContext 5
#define X_SELinuxGetWindowCreateContext 6
#define X_SELinuxGetWindowContext 7
#define X_SELinuxSetDrawableCreateContext 5
#define X_SELinuxGetDrawableCreateContext 6
#define X_SELinuxGetDrawableContext 7
#define X_SELinuxSetPropertyCreateContext 8
#define X_SELinuxGetPropertyCreateContext 9
#define X_SELinuxSetPropertyUseContext 10
@ -150,12 +150,13 @@ typedef struct {
#define SECCLASS_X_SELECTION 7
#define SECCLASS_X_CURSOR 8
#define SECCLASS_X_CLIENT 9
#define SECCLASS_X_DEVICE 10
#define SECCLASS_X_SERVER 11
#define SECCLASS_X_EXTENSION 12
#define SECCLASS_X_EVENT 13
#define SECCLASS_X_FAKEEVENT 14
#define SECCLASS_X_RESOURCE 15
#define SECCLASS_X_POINTER 10
#define SECCLASS_X_KEYBOARD 11
#define SECCLASS_X_SERVER 12
#define SECCLASS_X_EXTENSION 13
#define SECCLASS_X_EVENT 14
#define SECCLASS_X_FAKEEVENT 15
#define SECCLASS_X_RESOURCE 16
/* Mapping from DixAccess bits to Flask permissions */
static struct security_class_mapping map[] = {
@ -370,7 +371,37 @@ static struct security_class_mapping map[] = {
"", /* DixUseAccess */
"manage", /* DixManageAccess */
NULL }},
{ "x_device",
{ "x_pointer",
{ "read", /* DixReadAccess */
"write", /* DixWriteAccess */
"destroy", /* DixDestroyAccess */
"create", /* DixCreateAccess */
"getattr", /* DixGetAttrAccess */
"setattr", /* DixSetAttrAccess */
"list_property", /* DixListPropAccess */
"get_property", /* DixGetPropAccess */
"set_property", /* DixSetPropAccess */
"getfocus", /* DixGetFocusAccess */
"setfocus", /* DixSetFocusAccess */
"", /* DixListAccess */
"add", /* DixAddAccess */
"remove", /* DixRemoveAccess */
"", /* DixHideAccess */
"", /* DixShowAccess */
"", /* DixBlendAccess */
"grab", /* DixGrabAccess */
"freeze", /* DixFreezeAccess */
"force_cursor", /* DixForceAccess */
"", /* DixInstallAccess */
"", /* DixUninstallAccess */
"", /* DixSendAccess */
"", /* DixReceiveAccess */
"use", /* DixUseAccess */
"manage", /* DixManageAccess */
"", /* DixDebugAccess */
"bell", /* DixBellAccess */
NULL }},
{ "x_keyboard",
{ "read", /* DixReadAccess */
"write", /* DixWriteAccess */
"destroy", /* DixDestroyAccess */

View File

@ -184,6 +184,7 @@ ProcXTestFakeInput(ClientPtr client)
int i;
int base = 0;
int flags = 0;
int need_ptr_update = 1;
nev = (stuff->length << 2) - sizeof(xReq);
if ((nev % sizeof(xEvent)) || !nev)
@ -387,6 +388,8 @@ ProcXTestFakeInput(ClientPtr client)
client->errorValue = ev->u.u.detail;
return BadValue;
}
need_ptr_update = 0;
break;
case MotionNotify:
if (!dev->valuator)
@ -451,7 +454,8 @@ ProcXTestFakeInput(ClientPtr client)
for (i = 0; i < nevents; i++)
mieqProcessDeviceEvent(dev, (InternalEvent*)(xtest_evlist+i)->event, NULL);
miPointerUpdateSprite(dev);
if (need_ptr_update)
miPointerUpdateSprite(dev);
return client->noClientException;
}

View File

@ -192,20 +192,16 @@ XIGetDevice(xEvent* xE)
* This code is basically the old SwitchCoreKeyboard.
*/
static void
void
CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
{
KeyClassPtr mk = master->key;
KeyClassPtr dk = device->key;
int i;
if (device == master)
return;
mk->sourceid = device->id;
for (i = 0; i < 8; i++)
mk->modifierKeyCount[i] = dk->modifierKeyCount[i];
if (!XkbCopyDeviceKeymap(master, device))
FatalError("Couldn't pivot keymap from device to core!\n");
@ -444,6 +440,26 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
to->key = NULL;
}
/* If a SrvLedInfoPtr's flags are XkbSLI_IsDefault, the names and maps
* pointer point into the xkbInfo->desc struct. XkbCopySrvLedInfo
* didn't update the pointers so we need to do it manually here.
*/
if (to->kbdfeed)
{
KbdFeedbackPtr k;
for (k = to->kbdfeed; k; k = k->next)
{
if (!k->xkb_sli)
continue;
if (k->xkb_sli->flags & XkbSLI_IsDefault)
{
k->xkb_sli->names = to->key->xkbInfo->desc->names->indicators;
k->xkb_sli->maps = to->key->xkbInfo->desc->indicators->maps;
}
}
}
/* We can't just copy over the focus class. When an app sets the focus,
* it'll do so on the master device. Copying the SDs focus means losing
* the focus.
@ -805,7 +821,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event)
{
/* XXX: Relative/Absolute mode */
v->axisVal[i] = event->valuators.data[i];
v->axisVal[i] += event->valuators.data_frac[i];
v->axisVal[i] += (event->valuators.data_frac[i] * 1.0f / (1 << 16) / (1 << 16));
}
}
@ -1031,16 +1047,19 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
break;
}
#if 0
/* FIXME: I'm broken. Please fix me. Thanks */
if (DeviceEventCallback) {
if (DeviceEventCallback && !syncEvents.playingEvents) {
DeviceEventInfoRec eventinfo;
SpritePtr pSprite = device->spriteInfo->sprite;
eventinfo.events = (xEventPtr) xE;
eventinfo.count = count;
/* see comment in EnqueueEvents regarding the next three lines */
if (ev->any.type == ET_Motion)
ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
eventinfo.device = device;
eventinfo.event = ev;
CallCallbacks(&DeviceEventCallback, (pointer) & eventinfo);
}
#endif
grab = device->deviceGrab.grab;
switch(event->type)

View File

@ -1123,7 +1123,6 @@ RestoreExtensionEvents(void)
static void
IResetProc(ExtensionEntry * unused)
{
ReplySwapVector[IReqCode] = ReplyNotSwappd;
EventSwapVector[DeviceValuator] = NotImplemented;
EventSwapVector[DeviceKeyPress] = NotImplemented;
@ -1302,6 +1301,8 @@ XInputExtensionInit(void)
inputInfo.all_devices = &xi_all_devices;
inputInfo.all_master_devices = &xi_all_master_devices;
XIResetProperties();
} else {
FatalError("IExtensionInit: AddExtensions failed\n");
}

View File

@ -96,7 +96,7 @@ ProcXQueryDeviceState(ClientPtr client)
rep.sequenceNumber = client->sequence;
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
if (rc != Success)
if (rc != Success && rc != BadAccess)
return rc;
v = dev->valuator;
@ -130,8 +130,9 @@ ProcXQueryDeviceState(ClientPtr client)
tk->length = sizeof(xKeyState);
tk->num_keys = k->xkbInfo->desc->max_key_code -
k->xkbInfo->desc->min_key_code + 1;
for (i = 0; i < 32; i++)
tk->keys[i] = k->down[i];
if (rc != BadAccess)
for (i = 0; i < 32; i++)
tk->keys[i] = k->down[i];
buf += sizeof(xKeyState);
}
@ -140,19 +141,22 @@ ProcXQueryDeviceState(ClientPtr client)
tb->class = ButtonClass;
tb->length = sizeof(xButtonState);
tb->num_buttons = b->numButtons;
memcpy(tb->buttons, b->down, sizeof(b->down));
if (rc != BadAccess)
memcpy(tb->buttons, b->down, sizeof(b->down));
buf += sizeof(xButtonState);
}
if (v != NULL) {
tv = (xValuatorState *) buf;
tv->class = ValuatorClass;
tv->length = sizeof(xValuatorState);
tv->length = sizeof(xValuatorState) + v->numAxes * 4;
tv->num_valuators = v->numAxes;
tv->mode = v->mode;
buf += sizeof(xValuatorState);
for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
*((int *)buf) = *values++;
if (rc != BadAccess)
*((int *)buf) = *values;
values++;
if (client->swapped) {
swapl((int *)buf, n); /* macro - braces needed */
}

View File

@ -112,7 +112,17 @@ ProcXSetDeviceMode(ClientPtr client)
if (rep.status == Success)
dev->valuator->mode = stuff->mode;
else if (rep.status != AlreadyGrabbed)
{
switch(rep.status) {
case BadMatch:
case BadImplementation:
case BadAlloc:
break;
default:
rep.status = BadMode;
}
return rep.status;
}
WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
return Success;

View File

@ -392,6 +392,15 @@ XIGetKnownProperty(char *name)
return 0;
}
void
XIResetProperties(void)
{
int i;
for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
dev_properties[i].type = None;
}
/**
* Convert the given property's value(s) into @nelem_return integer values and
* store them in @buf_return. If @nelem_return is larger than the number of
@ -622,6 +631,8 @@ XIDeleteAllDeviceProperties (DeviceIntPtr device)
XIDestroyDeviceProperty(prop);
}
device->properties.properties = NULL;
/* Now free all handlers */
curr_handler = device->properties.handlers;
while(curr_handler)
@ -630,6 +641,8 @@ XIDeleteAllDeviceProperties (DeviceIntPtr device)
xfree(curr_handler);
curr_handler = next_handler;
}
device->properties.handlers = NULL;
}
@ -643,6 +656,9 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
if (prop->propertyName == property)
break;
if (!prop)
return Success;
if (fromClient && !prop->deletable)
return BadAccess;

View File

@ -62,4 +62,7 @@ void SRepXIListProperties(ClientPtr client, int size,
xXIListPropertiesReply *rep);
void SRepXIGetProperty(ClientPtr client, int size,
xXIGetPropertyReply *rep);
void XIResetProperties(void);
#endif /* XIPROPERTY_H */

View File

@ -45,7 +45,8 @@
#include "xiquerydevice.h"
static Bool ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr d);
static int ListDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info);
static int
ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo* info);
static int SizeDeviceInfo(DeviceIntPtr dev);
static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info);
int
@ -119,7 +120,7 @@ ProcXIQueryDevice(ClientPtr client)
ptr = info;
if (dev)
{
len = ListDeviceInfo(dev, (xXIDeviceInfo*)info);
len = ListDeviceInfo(client, dev, (xXIDeviceInfo*)info);
if (client->swapped)
SwapDeviceInfo(dev, (xXIDeviceInfo*)info);
info += len;
@ -131,7 +132,7 @@ ProcXIQueryDevice(ClientPtr client)
{
if (!skip[i])
{
len = ListDeviceInfo(dev, (xXIDeviceInfo*)info);
len = ListDeviceInfo(client, dev, (xXIDeviceInfo*)info);
if (client->swapped)
SwapDeviceInfo(dev, (xXIDeviceInfo*)info);
info += len;
@ -143,7 +144,7 @@ ProcXIQueryDevice(ClientPtr client)
{
if (!skip[i])
{
len = ListDeviceInfo(dev, (xXIDeviceInfo*)info);
len = ListDeviceInfo(client, dev, (xXIDeviceInfo*)info);
if (client->swapped)
SwapDeviceInfo(dev, (xXIDeviceInfo*)info);
info += len;
@ -240,7 +241,7 @@ SizeDeviceClasses(DeviceIntPtr dev)
* @return Number of bytes written into info.
*/
int
ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info)
ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState)
{
unsigned char *bits;
int mask_len;
@ -257,9 +258,11 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info)
bits = (unsigned char*)&info[1];
memset(bits, 0, mask_len * 4);
for (i = 0; dev && dev->button && i < dev->button->numButtons; i++)
if (BitIsOn(dev->button->down, i))
SetBit(bits, i);
if (reportState)
for (i = 0; dev && dev->button && i < dev->button->numButtons; i++)
if (BitIsOn(dev->button->down, i))
SetBit(bits, i);
bits += mask_len * 4;
memcpy(bits, dev->button->labels, dev->button->numButtons * sizeof(Atom));
@ -327,7 +330,8 @@ SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
* @return The number of bytes written into info.
*/
int
ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber)
ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber,
Bool reportState)
{
ValuatorClassPtr v = dev->valuator;
@ -345,6 +349,9 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber)
info->mode = v->mode; /* Server doesn't have per-axis mode yet */
info->sourceid = v->sourceid;
if (!reportState)
info->value = info->min;
return info->length * 4;
}
@ -389,7 +396,7 @@ int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
* @return The number of bytes used.
*/
static int
ListDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo* info)
{
char *any = (char*)&info[1];
int len = 0, total_len = 0;
@ -407,7 +414,8 @@ ListDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
any += len;
total_len += len;
return total_len + ListDeviceClasses(dev, any, &info->num_classes);
total_len += ListDeviceClasses(client, dev, any, &info->num_classes);
return total_len;
}
/**
@ -416,16 +424,21 @@ ListDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
* written.
*/
int
ListDeviceClasses(DeviceIntPtr dev, char *any, uint16_t *nclasses)
ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
char *any, uint16_t *nclasses)
{
int total_len = 0;
int len;
int i;
int rc;
/* Check if the current device state should be suppressed */
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess);
if (dev->button)
{
(*nclasses)++;
len = ListButtonInfo(dev, (xXIButtonInfo*)any);
len = ListButtonInfo(dev, (xXIButtonInfo*)any, rc == Success);
any += len;
total_len += len;
}
@ -441,7 +454,7 @@ ListDeviceClasses(DeviceIntPtr dev, char *any, uint16_t *nclasses)
for (i = 0; dev->valuator && i < dev->valuator->numAxes; i++)
{
(*nclasses)++;
len = ListValuatorInfo(dev, (xXIValuatorInfo*)any, i);
len = ListValuatorInfo(dev, (xXIValuatorInfo*)any, i, rc == Success);
any += len;
total_len += len;
}

View File

@ -37,9 +37,11 @@ int SProcXIQueryDevice(ClientPtr client);
int ProcXIQueryDevice(ClientPtr client);
void SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply *rep);
int SizeDeviceClasses(DeviceIntPtr dev);
int ListDeviceClasses(DeviceIntPtr dev, char* any, uint16_t* nclasses);
int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
char* any, uint16_t* nclasses);
int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment);
int ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info);
int ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState);
int ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info);
int ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber);
int ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info,
int axisnumber, Bool reportState);
#endif /* QUERYDEV_H */

View File

@ -2,29 +2,23 @@
* Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright © 2003 Keith Packard
*

View File

@ -2,29 +2,23 @@
* Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright © 2003 Keith Packard
*

View File

@ -2,29 +2,23 @@
* Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright © 2003 Keith Packard
*
@ -238,7 +232,6 @@ static CompAlternateVisual altVisuals[] = {
{ 24, PICT_r8g8b8 },
#endif
{ 32, PICT_a8r8g8b8 },
{ 32, PICT_b8g8r8a8 },
};
static const int NUM_COMP_ALTERNATE_VISUALS = sizeof(altVisuals) /
@ -248,15 +241,9 @@ static Bool
compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs,
CompAlternateVisual *alt)
{
VisualPtr visual, visuals;
int i;
int numVisuals;
XID *installedCmaps;
ColormapPtr installedCmap;
int numInstalledCmaps;
VisualPtr visual;
DepthPtr depth;
PictFormatPtr pPictFormat;
VisualID *vid;
unsigned long alphaMask;
/*
@ -273,58 +260,16 @@ compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs,
return TRUE;
pPictFormat = PictureMatchFormat (pScreen, alt->depth, alt->format);
if (!pPictFormat ||
pPictFormat->direct.red != pScreen->visuals[0].offsetRed)
if (!pPictFormat)
return FALSE;
vid = xalloc(sizeof(VisualID));
if (!vid)
return FALSE;
/* Find the installed colormaps */
installedCmaps = xalloc (pScreen->maxInstalledCmaps * sizeof (XID));
if (!installedCmaps) {
xfree(vid);
return FALSE;
}
numInstalledCmaps = pScreen->ListInstalledColormaps(pScreen,
installedCmaps);
/* realloc the visual array to fit the new one in place */
numVisuals = pScreen->numVisuals;
visuals = xrealloc(pScreen->visuals, (numVisuals + 1) * sizeof(VisualRec));
if (!visuals) {
xfree(vid);
xfree(installedCmaps);
return FALSE;
if (ResizeVisualArray(pScreen, 1, depth) == FALSE) {
return FALSE;
}
/*
* Fix up any existing installed colormaps -- we'll assume that
* the only ones created so far have been installed. If this
* isn't true, we'll have to walk the resource database looking
* for all colormaps.
*/
for (i = 0; i < numInstalledCmaps; i++) {
int j, rc;
rc = dixLookupResourceByType((pointer *)&installedCmap,
installedCmaps[i], RT_COLORMAP,
serverClient, DixReadAccess);
if (rc != Success)
continue;
j = installedCmap->pVisual - pScreen->visuals;
installedCmap->pVisual = &visuals[j];
}
xfree(installedCmaps);
pScreen->visuals = visuals;
visual = visuals + pScreen->numVisuals; /* the new one */
pScreen->numVisuals++;
visual = pScreen->visuals + (pScreen->numVisuals - 1); /* the new one */
/* Initialize the visual */
visual->vid = FakeClientID (0);
visual->bitsPerRGBValue = 8;
if (PICT_FORMAT_TYPE(alt->format) == PICT_TYPE_COLOR) {
visual->class = PseudoColor;
@ -357,10 +302,6 @@ compAddAlternateVisual(ScreenPtr pScreen, CompScreenPtr cs,
/* remember the visual ID to detect auto-update windows */
compRegisterAlternateVisuals(cs, &visual->vid, 1);
/* Fix up the depth */
*vid = visual->vid;
depth->numVids = 1;
depth->vids = vid;
return TRUE;
}

View File

@ -2,29 +2,23 @@
* Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright © 2003 Keith Packard
*

View File

@ -2,29 +2,23 @@
* Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright © 2003 Keith Packard
*

View File

@ -2,29 +2,23 @@
* Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright © 2003 Keith Packard
*

View File

@ -26,8 +26,8 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.57)
AC_INIT([xorg-server], 1.6.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="(unreleased)"
AC_INIT([xorg-server], 1.7.7, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2010-05-04"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
AM_MAINTAINER_MODE
@ -85,12 +85,6 @@ dnl ISDN trace program named dtrace
AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH],
[Enable dtrace probes (default: enabled if dtrace found)]),
[WDTRACE=$withval], [WDTRACE=auto])
dnl Darwin 9 has dtrace, but it doesn't support compilation into ELF...
if test "x$WDTRACE" = xauto; then
case $host_os in
darwin*) WDTRACE="no" ;;
esac
fi
if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin])
if test "x$DTRACE" = "xnot_found" ; then
@ -108,8 +102,20 @@ fi
if test "x$WDTRACE" != "xno" ; then
AC_DEFINE(XSERVER_DTRACE, 1,
[Define to 1 if the DTrace Xserver provider probes should be built in.])
# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into
# object files, and require linking with those as relocatable objects, not .a
# archives. MacOS X handles all this in the normal compiler toolchain, and on
# some releases (like Tiger), will error out on dtrace -G. For now, other
# platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux
# ports appear to, based on my web searches, but have not yet been tested).
case $host_os in
darwin*) SPECIAL_DTRACE_OBJECTS=no ;;
*) SPECIAL_DTRACE_OBJECTS=yes ;;
esac
fi
AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"])
AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"])
AC_HEADER_DIRENT
AC_HEADER_STDC
@ -504,9 +510,9 @@ AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES],
[ XKB_DFLT_RULES="$withval" ],
[ XKB_DFLT_RULES="" ])
AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL],
[Keyboard model (default: pc104)]),
[Keyboard model (default: pc105)]),
[ XKB_DFLT_MODEL="$withval" ],
[ XKB_DFLT_MODEL="pc104" ])
[ XKB_DFLT_MODEL="pc105" ])
AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT],
[Keyboard layout (default: us)]),
[ XKB_DFLT_LAYOUT="$withval" ],
@ -554,6 +560,9 @@ AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use
AC_ARG_ENABLE(visibility, AC_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]),
[SYMBOL_VISIBILITY=$enableval],
[SYMBOL_VISIBILITY=auto])
AC_ARG_ENABLE(pc98, AC_HELP_STRING([--enable-pc98], [Enable PC98 support in Xorg (default: auto)]),
[SUPPORT_PC98=$enableval],
[SUPPORT_PC98=auto])
dnl GLX build options
AC_ARG_WITH(dri-driver-path, AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
@ -604,7 +613,7 @@ dnl DDXes.
AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: yes)]), [XNEST=$enableval], [XNEST=yes])
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no])
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
@ -707,6 +716,7 @@ case $host_os in
XF86VIDMODE=no
fi
;;
*) XQUARTZ=no ;;
esac
dnl ---------------------------------------------------------------------------
@ -738,6 +748,19 @@ dnl Core modules for most extensions, et al.
REQUIRED_MODULES="[randrproto >= 1.2.99.3] [renderproto >= 0.11] [fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xextproto >= 7.0.99.3] [xproto >= 7.0.13] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] fontsproto [inputproto >= 1.9.99.902] [kbproto >= 1.0.3]"
REQUIRED_LIBS="xfont xau [pixman-1 >= 0.15.20]"
dnl List of libraries that require a specific version
LIBAPPLEWM="applewm >= 1.4"
LIBDMX="dmx >= 1.0.99.1"
LIBDRI="dri >= 7.1.0"
LIBDRM="libdrm >= 2.3.0"
LIBGL="gl >= 7.1.0"
LIBXEXT="xext >= 1.0.99.4"
LIBXI="xi >= 1.2.99.1"
LIBXTST="xtst >= 1.0.99.2"
LIBPCIACCESS="pciaccess >= 0.8.0"
LIBGLIB="glib-2.0 >= 2.16"
LIBSELINUX="libselinux >= 2.0.86"
dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config
dnl API.
@ -901,7 +924,7 @@ fi
if test "x$GLX" = xyes; then
PKG_CHECK_MODULES([XLIB], [x11])
PKG_CHECK_MODULES([GL], $GLPROTO [gl >= 7.1.0])
PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/glx/libglx.la'
@ -928,7 +951,7 @@ AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
if test "x$DRI" = xyes; then
AC_DEFINE(XF86DRI, 1, [Build DRI extension])
PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO])
PKG_CHECK_MODULES([DRI], $GLPROTO [dri >= 7.1.0])
PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI)
AC_SUBST(DRIPROTO_CFLAGS)
fi
@ -946,7 +969,7 @@ esac
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
if test "x$DRI" = xyes || test "x$DRI2" = xyes; then
PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.0])
PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
AC_SUBST(LIBDRM_CFLAGS)
AC_SUBST(LIBDRM_LIBS)
fi
@ -990,16 +1013,11 @@ if test "x$XSELINUX" = xyes; then
if test "x$XACE" != xyes; then
AC_MSG_ERROR([cannot build SELinux extension without X-ACE])
fi
AC_CHECK_HEADERS([selinux/selinux.h selinux/avc.h], [], AC_MSG_ERROR([SELinux include files not found]))
AC_CHECK_LIB(selinux, avc_init, [], AC_MSG_ERROR([SELinux library not found]))
AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers]))
AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library]))
AC_CHECK_DECL(avc_netlink_acquire_fd,
[AC_DEFINE(HAVE_AVC_NETLINK_ACQUIRE_FD, 1, "Have avc_netlink_acquire_fd")],
[],
[#include <selinux/avc.h>])
PKG_CHECK_MODULES([SELINUX], $LIBSELINUX)
SELINUX_LIBS="$SELINUX_LIBS -laudit"
AC_DEFINE(XSELINUX, 1, [Build SELinux extension])
SELINUX_LIB="-lselinux -laudit"
fi
AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes])
@ -1060,6 +1078,7 @@ MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
# XINPUT extension is integral part of the server
AC_DEFINE(XINPUT, 1, [Support X Input extension])
XI_LIB='$(top_builddir)/Xi/libXi.la'
XI_INC='-I$(top_srcdir)/Xi'
@ -1072,11 +1091,16 @@ AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes)
AC_DEFINE(SHAPE, 1, [Support SHAPE extension])
AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data])
AC_DEFINE_DIR(XKB_BIN_DIRECTORY, bindir, [Path to XKB bin dir])
AC_ARG_WITH(xkb-bin-directory,
AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program]),
[XKB_BIN_DIRECTORY="$withval"],
[XKB_BIN_DIRECTORY="$bindir"])
AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir])
dnl Make sure XKM_OUTPUT_DIR is an absolute path
XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
if [[ x$XKBOUTPUT_FIRSTCHAR != x/ ]] ; then
if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then
XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
fi
@ -1193,7 +1217,7 @@ AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
# If unittests aren't explicitly disabled, check for required support
if test "x$UNITTESTS" != xno ; then
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16],
PKG_CHECK_MODULES([GLIB], $LIBGLIB,
[HAVE_GLIB=yes], [HAVE_GLIB=no])
# Check if linker supports -wrap, passed via compiler flags
@ -1240,13 +1264,15 @@ AC_DEFINE(XSYNC, 1, [Support XSync extension])
AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
if test "x$WDTRACE" != "xno" ; then
if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
DIX_LIB='$(top_builddir)/dix/dix.O'
OS_LIB='$(top_builddir)/os/os.O'
else
DIX_LIB='$(top_builddir)/dix/libdix.la'
OS_LIB='$(top_builddir)/os/libos.la'
fi
AC_SUBST([DIX_LIB])
AC_SUBST([OS_LIB])
MAIN_LIB='$(top_builddir)/dix/libmain.la'
AC_SUBST([MAIN_LIB])
@ -1360,7 +1386,7 @@ fi
dnl Xnest DDX
PKG_CHECK_MODULES(XNESTMODULES, [xfont xext x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
PKG_CHECK_MODULES(XNESTMODULES, [xfont $LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
AC_MSG_CHECKING([whether to build Xnest DDX])
if test "x$XNEST" = xauto; then
XNEST="$have_xnest"
@ -1369,6 +1395,9 @@ AC_MSG_RESULT([$XNEST])
AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
if test "x$XNEST" = xyes; then
if test "x$have_xnest" = xno; then
AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.])
fi
XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB $CONFIG_LIB"
XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
AC_SUBST([XNEST_LIBS])
@ -1440,7 +1469,7 @@ if test "x$XORG" = xyes; then
AC_SUBST([symbol_visibility])
dnl ===================================================================
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
SAVE_LIBS=$LIBS
SAVE_CFLAGS=$CFLAGS
CFLAGS=$PCIACCESS_CFLAGS
@ -1451,7 +1480,7 @@ if test "x$XORG" = xyes; then
AC_CHECK_FUNCS([pci_device_vgaarb_init])
LIBS=$SAVE_LIBS
CFLAGS=$SAVE_CFLAGS
XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS $SELINUX_LIB"
XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS"
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
case $host_os in
@ -1500,6 +1529,7 @@ if test "x$XORG" = xyes; then
solaris*)
XORG_OS="solaris"
XORG_OS_SUBDIR="solaris"
XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
# Use the same stubs as BSD for old functions, since we now
# use libpciaccess for PCI
xorg_bus_bsdpci="yes"
@ -1532,7 +1562,6 @@ if test "x$XORG" = xyes; then
else
SOLARIS_INOUT_ARCH="ia32"
fi
XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
;;
*)
AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \
@ -1546,6 +1575,9 @@ if test "x$XORG" = xyes; then
XORG_CFLAGS="${XORG_CFLAGS} "'$(SOLARIS_ASM_CFLAGS)'
fi
AC_SUBST([SOLARIS_ASM_CFLAGS])
if test "x$SUPPORT_PC98" = xauto; then
SUPPORT_PC98="no"
fi
;;
gnu*)
XORG_OS="gnu"
@ -1567,8 +1599,19 @@ if test "x$XORG" = xyes; then
sparc*)
xorg_bus_sparc="yes"
;;
i*86)
if test "x$SUPPORT_PC98" = xauto; then
SUPPORT_PC98="yes"
fi
;;
esac
if test "x$SUPPORT_PC98" = xauto; then
SUPPORT_PC98="no"
fi
if test "x$SUPPORT_PC98" = xyes; then
AC_DEFINE(SUPPORT_PC98, 1, [Support PC98])
fi
if test "x$XORG_OS_PCI" = x ; then
XORG_OS_PCI=$XORG_OS
fi
@ -1678,8 +1721,6 @@ if test "x$XWIN" = xauto; then
mingw*) XWIN="yes" ;;
*) XWIN="no" ;;
esac
XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $RANDR_LIB $RENDER_LIB $XTRAP_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $MIEXT_LAYER_LIB $LAYER_LIB $XPSTUBS_LIB $SHADOW_LIB $OS_LIB"
AC_SUBST([XWIN_LIBS])
fi
AC_MSG_RESULT([$XWIN])
@ -1692,8 +1733,14 @@ if test "x$XWIN" = xyes; then
XWIN_SERVER_NAME=XWin
PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfont])
AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages])
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
CFLAGS="$CFLAGS -DFD_SETSIZE=256 -DROOTLESS_WORKAROUND"
dnl if we have windowswmproto, build rootless extension for multwindowextwm mode
if test "x$WINDOWSWM" = xyes ; then
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
CFLAGS="$CFLAGS -DROOTLESS_WORKAROUND"
fi
CFLAGS="$CFLAGS -DFD_SETSIZE=256"
;;
mingw*)
XWIN_SERVER_NAME=Xming
@ -1703,7 +1750,9 @@ if test "x$XWIN" = xyes; then
XWIN_SYS_LIBS=-lwinsock2
;;
esac
XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB"
XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS"
AC_SUBST(XWIN_LIBS)
AC_SUBST(XWIN_SERVER_NAME)
AC_SUBST(XWIN_SYS_LIBS)
@ -1746,7 +1795,7 @@ if test "x$XQUARTZ" = xyes; then
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO [applewm >= 1.4] xfixes x11)
PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
if test "x$XQUARTZ_SPARKLE" = xyes ; then
AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.])
@ -1773,10 +1822,15 @@ AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"])
AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
dnl DMX DDX
PKG_CHECK_MODULES([DMXMODULES],
[xmuu xext x11 xrender xfixes xfont xi >= 1.2.99.1 $DMXPROTO xau $XDMCP_MODULES],
[have_dmx=yes], [have_dmx=no])
PKG_CHECK_MODULES(
[DMXMODULES],
[xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES],
[PKG_CHECK_MODULES(
[XDMXCONFIG_DEP],
[xaw7 xmu xt xpm x11],
[have_dmx=yes],
[have_dmx=no])],
[have_dmx=no])
AC_MSG_CHECKING([whether to build Xdmx DDX])
if test "x$DMX" = xauto; then
DMX="$have_dmx"
@ -1795,7 +1849,7 @@ if test "x$DMX" = xyes; then
fi
DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
XDMX_CFLAGS="$DMXMODULES_CFLAGS"
XDMX_LIBS="$XEXT_LIB $FB_LIB $CONFIG_LIB $FIXES_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB"
XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XEXT_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
XDMX_SYS_LIBS="$DMXMODULES_LIBS"
AC_SUBST([XDMX_CFLAGS])
AC_SUBST([XDMX_LIBS])
@ -1807,20 +1861,19 @@ dnl USB sources in DMX require <linux/input.h>
dnl Linux sources in DMX require <linux/keyboard.h>
AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes",
DMX_BUILD_LNX="no")
PKG_CHECK_MODULES([XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11])
AC_SUBST(XDMXCONFIG_DEP_CFLAGS)
AC_SUBST(XDMXCONFIG_DEP_LIBS)
PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [dmx xext x11])
PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11])
AC_SUBST(DMXEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [dmx xmu xext x11])
PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11])
AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [dmx xi xext x11])
PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11])
AC_SUBST(DMXXIEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [xtst xext x11])
PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11])
AC_SUBST(XTSTEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres xext x11])
PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11])
AC_SUBST(XRESEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([X11EXAMPLES_DEP], [xext x11])
PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11])
AC_SUBST(X11EXAMPLES_DEP_LIBS)
fi
AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes])
@ -1861,7 +1914,11 @@ if test "$KDRIVE" = yes; then
PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"])
if test "x$HAVE_TSLIB" = xauto; then
if test "x$HAVE_TSLIB" = xno; then
AC_CHECK_LIB(ts, ts_open, [HAVE_TSLIB="yes"])
fi
if test "xTSLIB" = xauto; then
TSLIB="$HAVE_TSLIB"
fi
@ -1885,12 +1942,12 @@ if test "$KDRIVE" = yes; then
XSDL_INCS="`sdl-config --cflags` $XSERVER_CFLAGS"
fi
XEPHYR_REQUIRED_LIBS="x11 xext xfont xau xdmcp"
XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xfont xau xdmcp"
if test "x$XV" = xyes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv"
fi
if test "x$DRI" = xyes && test "x$GLX" = xyes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS gl libdrm"
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm"
fi
PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"])
@ -1960,9 +2017,9 @@ AC_TRY_COMPILE([
AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
BUILD_DATE="$(date +'%Y%m%d')"
BUILD_DATE="`date +'%Y%m%d'`"
AC_SUBST([BUILD_DATE])
BUILD_TIME="$(date +'1%H%M%S')"
BUILD_TIME="`date +'1%H%M%S'`"
AC_SUBST([BUILD_TIME])
DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"

View File

@ -54,17 +54,20 @@ Xserver-dtrace.h: $(srcdir)/Xserver.d
$(DTRACE) -C -h -o $@ -s $(srcdir)/Xserver.d \
|| cp Xserver-dtrace.h.in $@
endif
if SPECIAL_DTRACE_OBJECTS
# Generate dtrace object code for probes in libdix
dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS)
$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o
$(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
noinst_PROGRAMS = dix.O
dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS)
ld -r -o $@ .libs/*.o
ld -r -o $@ $(am_libdix_la_OBJECTS:%.lo=.libs/%.o)
endif
dix.c:
touch $@
CLEANFILES = dix.c
CLEANFILES = dix.c Xserver-dtrace.h

View File

@ -1,29 +1,23 @@
/* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/*

View File

@ -1,36 +1,35 @@
/* Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/*
* Xserver dtrace provider definition
*/
#ifdef __APPLE__
#define string char *
#define pid_t uint32_t
#define zoneid_t uint32_t
#else
#include <sys/types.h>
#endif
provider Xserver {
/* reqType, data, length, client id, request buffer */

View File

@ -2690,3 +2690,70 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
xfree(pmaps);
return (found);
}
struct colormap_lookup_data {
ScreenPtr pScreen;
VisualPtr visuals;
};
static void _colormap_find_resource(pointer value, XID id,
pointer cdata)
{
struct colormap_lookup_data *cmap_data = cdata;
VisualPtr visuals = cmap_data->visuals;
ScreenPtr pScreen = cmap_data->pScreen;
ColormapPtr cmap = value;
int j;
if (pScreen != cmap->pScreen)
return;
j = cmap->pVisual - pScreen->visuals;
cmap->pVisual = &visuals[j];
}
/* something has realloced the visuals, instead of breaking
ABI fix it up here - glx and compsite did this wrong */
Bool
ResizeVisualArray(ScreenPtr pScreen, int new_visual_count,
DepthPtr depth)
{
struct colormap_lookup_data cdata;
int numVisuals;
VisualPtr visuals;
XID *vids, vid;
int first_new_vid, first_new_visual, i;
first_new_vid = depth->numVids;
first_new_visual = pScreen->numVisuals;
vids = xrealloc(depth->vids, (depth->numVids + new_visual_count) * sizeof(XID));
if (!vids)
return FALSE;
/* its realloced now no going back if we fail the next one */
depth->vids = vids;
numVisuals = pScreen->numVisuals + new_visual_count;
visuals = xrealloc(pScreen->visuals, numVisuals * sizeof(VisualRec));
if (!visuals) {
return FALSE;
}
cdata.visuals = visuals;
cdata.pScreen = pScreen;
FindClientResourcesByType(serverClient, RT_COLORMAP, _colormap_find_resource, &cdata);
pScreen->visuals = visuals;
for (i = 0; i < new_visual_count; i++) {
vid = FakeClientID(0);
pScreen->visuals[first_new_visual + i].vid = vid;
vids[first_new_vid + i] = vid;
}
depth->numVids += new_visual_count;
pScreen->numVisuals += new_visual_count;
return TRUE;
}

View File

@ -86,6 +86,8 @@ FreeCursorBits(CursorBitsPtr bits)
#ifdef ARGB_CURSOR
xfree(bits->argb);
#endif
dixFreePrivates(bits->devPrivates);
bits->devPrivates = NULL;
if (bits->refcnt == 0)
{
GlyphSharePtr *prev, this;
@ -100,7 +102,6 @@ FreeCursorBits(CursorBitsPtr bits)
CloseFont(this->font, (Font)0);
xfree(this);
}
dixFreePrivates(bits->devPrivates);
xfree(bits);
}
}

View File

@ -539,7 +539,7 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
int
CorePointerProc(DeviceIntPtr pDev, int what)
{
#define NBUTTONS 7
#define NBUTTONS 10
#define NAXES 2
BYTE map[NBUTTONS + 1];
int i = 0;
@ -843,6 +843,9 @@ CloseDevice(DeviceIntPtr dev)
if(dev->valuator && dev->valuator->accelScheme.AccelCleanupProc)
dev->valuator->accelScheme.AccelCleanupProc(dev);
while (dev->xkb_interest)
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
xfree(dev->name);
classes = (ClassesPtr)&dev->key;
@ -854,9 +857,6 @@ CloseDevice(DeviceIntPtr dev)
FreeAllDeviceClasses(classes);
}
while (dev->xkb_interest)
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
xfree(dev->spriteInfo->sprite->spriteTrace);
xfree(dev->spriteInfo->sprite);
@ -877,6 +877,36 @@ CloseDevice(DeviceIntPtr dev)
xfree(dev);
}
/**
* Shut down all devices of one list and free all resources.
*/
static
void
CloseDeviceList(DeviceIntPtr *listHead)
{
/* Used to mark devices that we tried to free */
Bool freedIds[MAXDEVICES];
DeviceIntPtr dev;
int i;
if (listHead == NULL)
return;
for (i = 0; i < MAXDEVICES; i++)
freedIds[i] = FALSE;
dev = *listHead;
while (dev != NULL)
{
freedIds[dev->id] = TRUE;
DeleteInputDeviceRequest(dev);
dev = *listHead;
while (dev != NULL && freedIds[dev->id])
dev = dev->next;
}
}
/**
* Shut down all devices, free all resources, etc.
* Only useful if you're shutting down the server!
@ -884,7 +914,7 @@ CloseDevice(DeviceIntPtr dev)
void
CloseDownDevices(void)
{
DeviceIntPtr dev, next;
DeviceIntPtr dev;
/* Float all SDs before closing them. Note that at this point resources
* (e.g. cursors) have been freed already, so we can't just call
@ -897,16 +927,11 @@ CloseDownDevices(void)
dev->u.master = NULL;
}
for (dev = inputInfo.devices; dev; dev = next)
{
next = dev->next;
DeleteInputDeviceRequest(dev);
}
for (dev = inputInfo.off_devices; dev; dev = next)
{
next = dev->next;
DeleteInputDeviceRequest(dev);
}
CloseDeviceList(&inputInfo.devices);
CloseDeviceList(&inputInfo.off_devices);
CloseDevice(inputInfo.pointer);
CloseDevice(inputInfo.keyboard);
inputInfo.devices = NULL;
inputInfo.off_devices = NULL;
@ -1520,14 +1545,12 @@ int
ProcGetModifierMapping(ClientPtr client)
{
xGetModifierMappingReply rep;
int ret, max_keys_per_mod = 0;
int max_keys_per_mod = 0;
KeyCode *modkeymap = NULL;
REQUEST_SIZE_MATCH(xReq);
ret = generate_modkeymap(client, PickKeyboard(client), &modkeymap,
&max_keys_per_mod);
if (ret != Success)
return ret;
generate_modkeymap(client, PickKeyboard(client), &modkeymap,
&max_keys_per_mod);
memset(&rep, 0, sizeof(xGetModifierMappingReply));
rep.type = X_Reply;
@ -1933,7 +1956,7 @@ ProcChangeKeyboardControl (ClientPtr client)
keyboard = PickKeyboard(client);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if ((pDev == keyboard || (!IsMaster(keyboard) && pDev->u.master == keyboard)) &&
if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
if (ret != Success)
@ -1942,7 +1965,7 @@ ProcChangeKeyboardControl (ClientPtr client)
}
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if ((pDev == keyboard || (!IsMaster(keyboard) && pDev->u.master == keyboard)) &&
if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
ret = DoChangeKeyboardControl(client, pDev, vlist, vmask);
if (ret != Success)
@ -1996,14 +2019,6 @@ ProcBell(ClientPtr client)
return BadValue;
}
/* Seems like no keyboard actually has the BellProc set. Returning
* BadDevice (previous code) will make apps crash badly. The man pages
* doesn't say anything about a BadDevice being returned either.
* So just quietly do nothing and pretend everything has worked.
*/
if (!keybd->kbdfeed->BellProc)
return Success;
newpercent = (base * stuff->percent) / 100;
if (stuff->percent < 0)
newpercent = base + newpercent;
@ -2221,12 +2236,15 @@ ProcQueryKeymap(ClientPtr client)
rep.length = 2;
rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess);
if (rc != Success)
if (rc != Success && rc != BadAccess)
return rc;
for (i = 0; i<32; i++)
rep.map[i] = down[i];
if (rc == BadAccess)
memset(rep.map, 0, 32);
WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep);
return Success;

View File

@ -78,29 +78,23 @@ Equipment Corporation.
* Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/

View File

@ -1046,7 +1046,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
err = AllocError;
break;
}
memset(reply + c->length, 0, length - c->length);
memset((char*)reply + c->length, 0, length - c->length);
c->reply = reply;
c->length = length;
}

View File

@ -119,6 +119,7 @@ EventToCore(InternalEvent *event, xEvent *core)
core->u.keyButtonPointer.rootX = e->root_x;
core->u.keyButtonPointer.rootY = e->root_y;
core->u.keyButtonPointer.state = e->corestate;
core->u.keyButtonPointer.root = e->root;
EventSetKeyRepeatFlag(core, (e->type == ET_KeyPress && e->key_repeat));
}
break;
@ -352,17 +353,17 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
xv->device_state = state;
switch (xv->num_valuators) {
case 6:
xv->valuator5 = ev->valuators.data[i + 5];
xv->valuator5 = ev->valuators.data[xv->first_valuator + 5];
case 5:
xv->valuator4 = ev->valuators.data[i + 4];
xv->valuator4 = ev->valuators.data[xv->first_valuator + 4];
case 4:
xv->valuator3 = ev->valuators.data[i + 3];
xv->valuator3 = ev->valuators.data[xv->first_valuator + 3];
case 3:
xv->valuator2 = ev->valuators.data[i + 2];
xv->valuator2 = ev->valuators.data[xv->first_valuator + 2];
case 2:
xv->valuator1 = ev->valuators.data[i + 1];
xv->valuator1 = ev->valuators.data[xv->first_valuator + 1];
case 1:
xv->valuator0 = ev->valuators.data[i + 0];
xv->valuator0 = ev->valuators.data[xv->first_valuator + 0];
}
if (i + 6 < num_valuators)

View File

@ -74,38 +74,28 @@ Equipment Corporation.
******************************************************************/
/*****************************************************************
Copyright 2003-2005 Sun Microsystems, Inc.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, provided that the above
copyright notice(s) and this permission notice appear in all copies of
the Software and that both the above copyright notice(s) and this
permission notice appear in supporting documentation.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale, use
or other dealings in this Software without prior written authorization
of the copyright holder.
******************************************************************/
/*
* Copyright © 2003-2005 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/** @file events.c
* This file handles event delivery and a big part of the server-side protocol
@ -263,33 +253,7 @@ extern BOOL EventIsKeyRepeat(xEvent *event);
*/
InputInfo inputInfo;
/**
* syncEvents is the global structure for queued events.
*
* Devices can be frozen through GrabModeSync pointer grabs. If this is the
* case, events from these devices are added to "pending" instead of being
* processed normally. When the device is unfrozen, events in "pending" are
* replayed and processed as if they would come from the device directly.
*/
static struct {
QdEventPtr pending, /**< list of queued events */
*pendtail; /**< last event in list */
/** The device to replay events for. Only set in AllowEvents(), in which
* case it is set to the device specified in the request. */
DeviceIntPtr replayDev; /* kludgy rock to put flag for */
/**
* The window the events are supposed to be replayed on.
* This window may be set to the grab's window (but only when
* Replay{Pointer|Keyboard} is given in the XAllowEvents()
* request. */
WindowPtr replayWin; /* ComputeFreezes */
/**
* Flag to indicate whether we're in the process of
* replaying events. Only set in ComputeFreezes(). */
Bool playingEvents;
TimeStamp time;
} syncEvents;
EventSyncInfoRec syncEvents;
/**
* The root window the given device is currently on.
@ -345,7 +309,9 @@ DevHasCursor(DeviceIntPtr pDev)
Bool
IsPointerDevice(DeviceIntPtr dev)
{
return (dev->type == MASTER_POINTER) || (dev->valuator && dev->button);
return (dev->type == MASTER_POINTER) ||
(dev->valuator && dev->button) ||
(dev->valuator && !dev->key);
}
/*
@ -772,7 +738,11 @@ CheckPhysLimits(
new.y = pSprite->physLimits.y2 - 1;
if (pSprite->hotShape)
ConfineToShape(pDev, pSprite->hotShape, &new.x, &new.y);
if ((pScreen != pSprite->hotPhys.pScreen) ||
if ((
#ifdef PANORAMIX
noPanoramiXExtension &&
#endif
(pScreen != pSprite->hotPhys.pScreen)) ||
(new.x != pSprite->hotPhys.x) || (new.y != pSprite->hotPhys.y))
{
#ifdef PANORAMIX
@ -1139,11 +1109,10 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
event->type == ET_KeyRelease)
AccessXCancelRepeatKey(device->key->xkbInfo, event->detail.key);
#if 0
/* FIXME: I'm broken now. Please fix me. */
if (DeviceEventCallback)
{
DeviceEventInfoRec eventinfo;
/* The RECORD spec says that the root window field of motion events
* must be valid. At this point, it hasn't been filled in yet, so
* we do it here. The long expression below is necessary to get
@ -1153,14 +1122,14 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
* the data that GetCurrentRootWindow relies on hasn't been
* updated yet.
*/
if (xE->u.u.type == DeviceMotionNotify)
XE_KBPTR.root =
WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
eventinfo.events = xE;
eventinfo.count = nevents;
if (ev->any.type == ET_Motion)
ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
eventinfo.event = ev;
eventinfo.device = device;
CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
}
#endif
if (event->type == ET_Motion)
{
#ifdef PANORAMIX
@ -1423,11 +1392,6 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
thisDev->deviceGrab.sync.other = NullGrab;
}
/*
XXX: Direct slave grab won't freeze the paired master device.
The correct thing to do would be to freeze all SDs attached to the
paired master device.
*/
if (IsMaster(thisDev))
{
dev = GetPairedDevice(thisDev);
@ -1671,7 +1635,7 @@ AllowSome(ClientPtr client,
thisGrabbed = grabinfo->grab && SameClient(grabinfo->grab, client);
thisSynced = FALSE;
otherGrabbed = FALSE;
othersFrozen = TRUE;
othersFrozen = FALSE;
grabTime = grabinfo->grabTime;
for (dev = inputInfo.devices; dev; dev = dev->next)
{
@ -1687,11 +1651,9 @@ AllowSome(ClientPtr client,
otherGrabbed = TRUE;
if (grabinfo->sync.other == devgrabinfo->grab)
thisSynced = TRUE;
if (devgrabinfo->sync.state < FROZEN)
othersFrozen = FALSE;
if (devgrabinfo->sync.state >= FROZEN)
othersFrozen = TRUE;
}
else if (!devgrabinfo->sync.other || !SameClient(devgrabinfo->sync.other, client))
othersFrozen = FALSE;
}
if (!((thisGrabbed && grabinfo->sync.state >= FROZEN) || thisSynced))
return;
@ -2496,15 +2458,15 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab,
if (mask & XI_MASK)
{
rc = EventToXI(event, &xE, &count);
if (rc == Success &&
XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, xE, count) == Success)
{
filter = GetEventFilter(dev, xE);
FixUpEventFromWindow(dev, xE, pWin, child, FALSE);
deliveries = DeliverEventsToWindow(dev, pWin, xE, count,
filter, grab);
if (deliveries > 0)
goto unwind;
if (rc == Success) {
if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, xE, count) == Success) {
filter = GetEventFilter(dev, xE);
FixUpEventFromWindow(dev, xE, pWin, child, FALSE);
deliveries = DeliverEventsToWindow(dev, pWin, xE, count,
filter, grab);
if (deliveries > 0)
goto unwind;
}
} else if (rc != BadMatch)
ErrorF("[dix] %s: XI conversion failed in DDE (%d, %d). Skipping delivery.\n",
dev->name, event->any.type, rc);
@ -2514,15 +2476,15 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab,
if ((mask & CORE_MASK) && IsMaster(dev) && dev->coreEvents)
{
rc = EventToCore(event, &core);
if (rc == Success &&
XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, &core, 1) == Success)
{
filter = GetEventFilter(dev, &core);
FixUpEventFromWindow(dev, &core, pWin, child, FALSE);
deliveries = DeliverEventsToWindow(dev, pWin, &core, 1,
filter, grab);
if (deliveries > 0)
goto unwind;
if (rc == Success) {
if (XaceHook(XACE_SEND_ACCESS, NULL, dev, pWin, &core, 1) == Success) {
filter = GetEventFilter(dev, &core);
FixUpEventFromWindow(dev, &core, pWin, child, FALSE);
deliveries = DeliverEventsToWindow(dev, pWin, &core, 1,
filter, grab);
if (deliveries > 0)
goto unwind;
}
} else if (rc != BadMatch)
ErrorF("[dix] %s: Core conversion failed in DDE (%d, %d).\n",
dev->name, event->any.type, rc);
@ -3478,7 +3440,6 @@ CheckPassiveGrabsOnWindow(
{
DeviceIntPtr gdev;
XkbSrvInfoPtr xkbi = NULL;
Mask mask = 0;
gdev= grab->modifierDevice;
if (grab->grabtype == GRABTYPE_CORE)
@ -3593,7 +3554,6 @@ CheckPassiveGrabsOnWindow(
}
xE = &core;
count = 1;
mask = grab->eventMask;
} else if (match & XI2_MATCH)
{
rc = EventToXI2((InternalEvent*)event, &xE);
@ -3605,16 +3565,6 @@ CheckPassiveGrabsOnWindow(
continue;
}
count = 1;
/* FIXME: EventToXI2 returns NULL for enter events, so
* dereferencing the event is bad. Internal event types are
* aligned with core events, so the else clause is valid.
* long-term we should use internal events for enter/focus
* as well */
if (xE)
mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
else if (event->type == XI_Enter || event->type == XI_FocusIn)
mask = grab->xi2mask[device->id][event->type/8];
} else
{
rc = EventToXI((InternalEvent*)event, &xE, &count);
@ -3625,7 +3575,6 @@ CheckPassiveGrabsOnWindow(
"(%d, %d).\n", device->name, event->type, rc);
continue;
}
mask = grab->eventMask;
}
(*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
@ -3634,7 +3583,8 @@ CheckPassiveGrabsOnWindow(
{
FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
TryClientEvents(rClient(grab), device, xE, count, mask,
TryClientEvents(rClient(grab), device, xE, count,
GetEventFilter(device, xE),
GetEventFilter(device, xE), grab);
}
@ -3802,13 +3752,13 @@ DeliverFocusedEvent(DeviceIntPtr keybd, InternalEvent *event, WindowPtr window)
if (sendCore)
{
rc = EventToCore(event, &core);
if (rc == Success &&
XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, &core, 1) == Success)
{
FixUpEventFromWindow(keybd, &core, focus, None, FALSE);
deliveries = DeliverEventsToWindow(keybd, focus, &core, 1,
GetEventFilter(keybd, &core),
NullGrab);
if (rc == Success) {
if (XaceHook(XACE_SEND_ACCESS, NULL, keybd, focus, &core, 1) == Success) {
FixUpEventFromWindow(keybd, &core, focus, None, FALSE);
deliveries = DeliverEventsToWindow(keybd, focus, &core, 1,
GetEventFilter(keybd, &core),
NullGrab);
}
} else if (rc != BadMatch)
ErrorF("[dix] %s: core conversion failed DFE (%d, %d). Skipping delivery.\n",
keybd->name, event->any.type, rc);
@ -3982,7 +3932,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
FreezeThaw(dev, TRUE);
if ((dev->deviceGrab.sync.state == FREEZE_BOTH_NEXT_EVENT) &&
(CLIENT_BITS(grab->resource) ==
CLIENT_BITS(dev->deviceGrab.sync.other->resource)))
CLIENT_BITS(dev->deviceGrab.grab->resource)))
dev->deviceGrab.sync.state = FROZEN_NO_EVENT;
else
dev->deviceGrab.sync.other = grab;
@ -4414,10 +4364,12 @@ DeviceEnterLeaveEvent(
filter, grab);
} else {
if (!GetWindowXI2Mask(mouse, pWin, (xEvent*)event))
return;
goto out;
DeliverEventsToWindow(mouse, pWin, (xEvent*)event, 1, filter,
NullGrab);
}
out:
xfree(event);
}
@ -4970,7 +4922,7 @@ ProcQueryPointer(ClientPtr client)
if (rc != Success)
return rc;
rc = XaceHook(XACE_DEVICE_ACCESS, client, mouse, DixReadAccess);
if (rc != Success)
if (rc != Success && rc != BadAccess)
return rc;
keyboard = GetPairedDevice(mouse);
@ -5018,6 +4970,15 @@ ProcQueryPointer(ClientPtr client)
}
#endif
if (rc == BadAccess) {
rep.mask = 0;
rep.child = None;
rep.rootX = 0;
rep.rootY = 0;
rep.winX = 0;
rep.winY = 0;
}
WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep);
return(Success);
@ -5075,12 +5036,9 @@ InitEvents(void)
void
CloseDownEvents(void)
{
int len;
EventListPtr list;
len = GetEventList(&list);
while(len--)
xfree(list[len].event);
FreeEventList(InputEventList, InputEventListLen);
InputEventListLen = 0;
InputEventList = NULL;
}
/**

View File

@ -83,8 +83,11 @@ AddExtension(char *name, int NumEvents, int NumErrors,
if (!MainProc || !SwappedMainProc || !MinorOpcodeProc)
return((ExtensionEntry *) NULL);
if ((lastEvent + NumEvents > LAST_EVENT) ||
(unsigned)(lastError + NumErrors > LAST_ERROR))
(unsigned)(lastError + NumErrors > LAST_ERROR)) {
LogMessage(X_ERROR, "Not enabling extension %s: maximum number of "
"events or errors exceeded.\n", name);
return((ExtensionEntry *) NULL);
}
ext = xalloc(sizeof(ExtensionEntry));
if (!ext)

View File

@ -177,7 +177,7 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, int first_valuator,
}
memcpy(&event->valuators.data[first_valuator],
valuators, num_valuators * sizeof(uint32_t));
valuators, num_valuators * sizeof(int32_t));
}
@ -296,7 +296,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
&pDev->last.remainder[0], NULL, pDev->valuator->axes + 0, scr->width);
if(pDev->valuator->numAxes > 1)
pDev->last.valuators[1] = rescaleValuatorAxis(pDev->last.valuators[1], pDev->last.remainder[1],
&pDev->last.remainder[0], NULL, pDev->valuator->axes + 1, scr->height);
&pDev->last.remainder[1], NULL, pDev->valuator->axes + 1, scr->height);
/* calculate the other axis as well based on info from the old
* slave-device. If the old slave had less axes than this one,
@ -578,12 +578,13 @@ GetMaximumEventsNum(void) {
static void
clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
{
AxisInfoPtr axis = pDev->valuator->axes + axisNum;
/* InitValuatoraAxisStruct ensures that (min < max). */
AxisInfoPtr axis;
if (axisNum >= pDev->valuator->numAxes)
return;
axis = pDev->valuator->axes + axisNum;
/* If a value range is defined, clip. If not, do nothing */
if (axis->max_value <= axis->min_value)
return;
@ -629,9 +630,12 @@ updateFromMaster(EventListPtr events, DeviceIntPtr dev, int type, int *num_event
if (master && master->last.slave != dev)
{
CreateClassesChangedEvent(events, master, dev, type);
updateSlaveDeviceCoords(master, dev);
if (IsPointerDevice(master))
{
updateSlaveDeviceCoords(master, dev);
master->last.numValuators = dev->last.numValuators;
}
master->last.slave = dev;
master->last.numValuators = dev->last.numValuators;
(*num_events)++;
events++;
}
@ -780,6 +784,19 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
*screeny_frac = dev->last.remainder[1];
}
/* Hit the left screen edge? */
if (*screenx <= 0 && *screenx_frac < 0.0f)
{
*screenx_frac = 0.0f;
x_frac = 0.0f;
}
if (*screeny <= 0 && *screeny_frac < 0.0f)
{
*screeny_frac = 0.0f;
y_frac = 0.0f;
}
old_screenx = *screenx;
old_screeny = *screeny;
/* This takes care of crossing screens for us, as well as clipping

View File

@ -159,9 +159,7 @@ int main(int argc, char *argv[], char *envp[])
ScreenSaverBlanking = defaultScreenSaverBlanking;
ScreenSaverAllowExposures = defaultScreenSaverAllowExposures;
#ifdef DPMSExtension
DPMSStandbyTime = DEFAULT_SCREEN_SAVER_TIME;
DPMSSuspendTime = DEFAULT_SCREEN_SAVER_TIME;
DPMSOffTime = DEFAULT_SCREEN_SAVER_TIME;
DPMSStandbyTime = DPMSSuspendTime = DPMSOffTime = ScreenSaverTime;
DPMSEnabled = TRUE;
DPMSPowerLevel = 0;
#endif

View File

@ -76,29 +76,23 @@ Equipment Corporation.
* Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/* Routines to manage various kinds of resources:

View File

@ -3233,8 +3233,13 @@ dixSaveScreens(ClientPtr client, int on, int mode)
}
}
screenIsSaved = what;
if (mode == ScreenSaverReset)
SetScreenSaverTimer();
if (mode == ScreenSaverReset) {
if (on == SCREEN_SAVER_FORCER) {
UpdateCurrentTimeIf();
lastDeviceEventTime = currentTime;
}
SetScreenSaverTimer();
}
return Success;
}

View File

@ -100,12 +100,12 @@ specifies a file which contains a collection of authorization records used
to authenticate access. See also the \fIxdm\fP(1) and
\fIXsecurity\fP(__miscmansuffix__) manual pages.
.TP 8
.B \-bs
disables backing store support on all screens.
.TP 8
.B \-br
sets the default root window to solid black instead of the standard root weave
pattern.
pattern. This is the default unless -retro or -wr is specified.
.TP 8
.B \-bs
disables backing store support on all screens.
.TP 8
.B \-c
turns off key-click.
@ -117,17 +117,6 @@ sets key-click volume (allowable range: 0-100).
sets the visual class for the root window of color screens.
The class numbers are as specified in the X protocol.
Not obeyed by all servers.
.ig
.TP 8
.B \-config \fIfilename\fP
reads more options from the given file. Options in the file may be separated
by newlines if desired. If a '#' character appears on a line, all characters
between it and the next newline are ignored, providing a simple commenting
facility. The \fB\-config\fP option itself may appear in the file.
.BR NOTE :
This option is disabled when the Xserver is run with an effective uid
different from the user's real uid.
..
.TP 8
.B \-core
causes the server to generate a core dump on fatal errors.
@ -184,6 +173,9 @@ sets the maximum big request to
.I size
MB.
.TP 8
.B \-nocursor
disable the display of the pointer cursor.
.TP 8
.B \-nolisten \fItrans-type\fP
disables a transport type. For example, TCP/IP connections can be disabled
with
@ -584,11 +576,11 @@ Security: \fIXsecurity\fP(__miscmansuffix__), \fIxauth\fP(1), \fIXau\fP(1),
Starting the server: \fIstartx\fP(1), \fIxdm\fP(1), \fIxinit\fP(1)
.PP
Controlling the server once started: \fIxset\fP(1), \fIxsetroot\fP(1),
\fIxhost\fP(1)
\fIxhost\fP(1), \fIxinput\fP(1), \fIxrandr\fP(1)
.PP
Server-specific man pages:
\fIXorg\fP(1), \fIXdmx\fP(1), \fIXephyr\fP(1), \fIXnest\fP(1),
\fIXvfb\fP(1), \fIXDarwin\fP(1), \fIXWin\fP(1).
\fIXvfb\fP(1), \fIXquartz\fP(1), \fIXWin\fP(1).
.PP
Server internal documentation:
.I "Definition of the Porting Layer for the X v11 Sample Server"

223
exa/exa.c
View File

@ -286,11 +286,10 @@ exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp)
* Returns TRUE if pixmap can be accessed offscreen.
*/
Bool
ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
{
ScreenPtr pScreen = pDrawable->pScreen;
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv (pScreen);
PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable);
ExaPixmapPriv(pPixmap);
Bool offscreen;
int i;
@ -324,7 +323,7 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
offscreen = exaPixmapIsOffscreen(pPixmap);
if (offscreen)
if (offscreen && pExaPixmap->fb_ptr)
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
else
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
@ -333,20 +332,10 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
pExaScr->access[index].pixmap = pPixmap;
pExaScr->access[index].count = 1;
if (!offscreen) {
/* Do we need to allocate our system buffer? */
if ((pExaScr->info->flags & EXA_HANDLES_PIXMAPS) && (pExaScr->info->flags & EXA_MIXED_PIXMAPS)) {
if (!pExaPixmap->sys_ptr && !exaPixmapIsPinned(pPixmap)) {
pExaPixmap->sys_ptr = malloc(pExaPixmap->sys_pitch * pDrawable->height);
if (!pExaPixmap->sys_ptr)
FatalError("EXA: malloc failed for size %d bytes\n", pExaPixmap->sys_pitch * pDrawable->height);
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
}
}
if (!offscreen)
return FALSE;
}
exaWaitSync (pDrawable->pScreen);
exaWaitSync (pScreen);
if (pExaScr->info->PrepareAccess == NULL)
return TRUE;
@ -360,7 +349,8 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
}
if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) {
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED &&
!(pExaScr->info->flags & EXA_MIXED_PIXMAPS))
FatalError("Driver failed PrepareAccess on a pinned pixmap.\n");
exaMoveOutPixmap (pPixmap);
@ -370,31 +360,6 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
return TRUE;
}
void
exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg)
{
PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable);
ExaScreenPriv(pPixmap->drawable.pScreen);
if (pExaScr->do_migration) {
ExaMigrationRec pixmaps[1];
if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
} else {
pixmaps[0].as_dst = FALSE;
pixmaps[0].as_src = TRUE;
}
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = pReg;
exaDoMigration(pixmaps, 1, FALSE);
}
ExaDoPrepareAccess(pDrawable, index);
}
/**
* exaPrepareAccess() is EXA's wrapper for the driver's PrepareAccess() handler.
*
@ -404,7 +369,13 @@ exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg)
void
exaPrepareAccess(DrawablePtr pDrawable, int index)
{
exaPrepareAccessReg(pDrawable, index, NULL);
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
ExaScreenPriv(pDrawable->pScreen);
if (pExaScr->prepare_access_reg)
pExaScr->prepare_access_reg(pPixmap, index, NULL);
else
(void)ExaDoPrepareAccess(pPixmap, index);
}
/**
@ -432,7 +403,6 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
if (pExaScr->access[i].pixmap == pPixmap) {
if (--pExaScr->access[i].count > 0)
return;
index = i;
break;
}
}
@ -442,25 +412,25 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
EXA_FatalErrorDebug(("EXA bug: FinishAccess called without PrepareAccess for pixmap 0x%p.\n",
pPixmap));
pExaScr->access[index].pixmap = NULL;
pExaScr->access[i].pixmap = NULL;
/* We always hide the devPrivate.ptr. */
pPixmap->devPrivate.ptr = NULL;
if (pExaScr->info->FinishAccess == NULL)
if (pExaScr->finish_access)
pExaScr->finish_access(pPixmap, index);
if (!pExaScr->info->FinishAccess || !exaPixmapIsOffscreen(pPixmap))
return;
if (!exaPixmapIsOffscreen (pPixmap))
return;
if (index >= EXA_PREPARE_AUX_DEST &&
if (i >= EXA_PREPARE_AUX_DEST &&
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
ErrorF("EXA bug: Trying to call driver FinishAccess hook with "
"unsupported index EXA_PREPARE_AUX*\n");
return;
}
(*pExaScr->info->FinishAccess) (pPixmap, index);
(*pExaScr->info->FinishAccess) (pPixmap, i);
}
/**
@ -510,57 +480,6 @@ const GCFuncs exaGCFuncs = {
exaCopyClip
};
/*
* This wrapper exists to allow fbValidateGC to work.
* Note that we no longer assume newly created pixmaps to be in normal ram.
* This assumption is certainly not garuanteed with driver allocated pixmaps.
*/
static PixmapPtr
exaCreatePixmapWithPrepare(ScreenPtr pScreen, int w, int h, int depth,
unsigned usage_hint)
{
PixmapPtr pPixmap;
ExaScreenPriv(pScreen);
/* This swaps between this function and the real upper layer function.
* Normally this would swap to the fb layer pointer, this is a very special case.
*/
swap(pExaScr, pScreen, CreatePixmap);
pPixmap = pScreen->CreatePixmap(pScreen, w, h, depth, usage_hint);
swap(pExaScr, pScreen, CreatePixmap);
if (!pPixmap)
return NULL;
/* Note the usage of ExaDoPrepareAccess, this allowed because:
* The pixmap is new, so not offscreen in the classic exa case.
* For EXA_HANDLES_PIXMAPS the driver will handle whatever is needed.
* We want to signal that the pixmaps will be used as destination.
*/
ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST);
return pPixmap;
}
static Bool
exaDestroyPixmapWithFinish(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv(pScreen);
Bool ret;
exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST);
/* This swaps between this function and the real upper layer function.
* Normally this would swap to the fb layer pointer, this is a very special case.
*/
swap(pExaScr, pScreen, DestroyPixmap);
ret = pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;
}
static void
exaValidateGC(GCPtr pGC,
unsigned long changes,
@ -572,20 +491,9 @@ exaValidateGC(GCPtr pGC,
ScreenPtr pScreen = pDrawable->pScreen;
ExaScreenPriv(pScreen);
CreatePixmapProcPtr old_ptr = NULL;
DestroyPixmapProcPtr old_ptr2 = NULL;
ExaGCPriv(pGC);
PixmapPtr pTile = NULL;
EXA_GC_PROLOGUE(pGC);
/* save the "fb" pointer. */
old_ptr = pExaScr->SavedCreatePixmap;
/* create a new upper layer pointer. */
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmapWithPrepare);
/* save the "fb" pointer. */
old_ptr2 = pExaScr->SavedDestroyPixmap;
/* create a new upper layer pointer. */
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmapWithFinish);
Bool finish_current_tile = FALSE;
/* Either of these conditions is enough to trigger access to a tile pixmap. */
/* With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid tile pixmap pointer. */
@ -599,8 +507,10 @@ exaValidateGC(GCPtr pGC,
*/
if (pTile && pTile->drawable.depth != pDrawable->depth && !(changes & GCTile)) {
PixmapPtr pRotatedTile = fbGetRotatedPixmap(pGC);
if (pRotatedTile->drawable.depth == pDrawable->depth)
if (pRotatedTile && pRotatedTile->drawable.depth == pDrawable->depth)
pTile = pRotatedTile;
else
finish_current_tile = TRUE; /* CreatePixmap will be called. */
}
}
@ -609,42 +519,39 @@ exaValidateGC(GCPtr pGC,
if (pTile)
exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC);
/* Calls to Create/DestroyPixmap have to be identified as special. */
pExaScr->fallback_counter++;
swap(pExaGC, pGC, funcs);
(*pGC->funcs->ValidateGC)(pGC, changes, pDrawable);
swap(pExaGC, pGC, funcs);
pExaScr->fallback_counter--;
if (pTile)
exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
if (finish_current_tile && pGC->tile.pixmap)
exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_AUX_DEST);
if (pGC->stipple)
exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK);
/* switch back to the normal upper layer. */
unwrap(pExaScr, pScreen, CreatePixmap);
/* restore copy of fb layer pointer. */
pExaScr->SavedCreatePixmap = old_ptr;
/* switch back to the normal upper layer. */
unwrap(pExaScr, pScreen, DestroyPixmap);
/* restore copy of fb layer pointer. */
pExaScr->SavedDestroyPixmap = old_ptr2;
EXA_GC_EPILOGUE(pGC);
exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK);
}
/* Is exaPrepareAccessGC() needed? */
static void
exaDestroyGC(GCPtr pGC)
{
EXA_GC_PROLOGUE (pGC);
ExaGCPriv(pGC);
swap(pExaGC, pGC, funcs);
(*pGC->funcs->DestroyGC)(pGC);
EXA_GC_EPILOGUE (pGC);
swap(pExaGC, pGC, funcs);
}
static void
exaChangeGC (GCPtr pGC,
unsigned long mask)
{
EXA_GC_PROLOGUE (pGC);
ExaGCPriv(pGC);
swap(pExaGC, pGC, funcs);
(*pGC->funcs->ChangeGC) (pGC, mask);
EXA_GC_EPILOGUE (pGC);
swap(pExaGC, pGC, funcs);
}
static void
@ -652,9 +559,10 @@ exaCopyGC (GCPtr pGCSrc,
unsigned long mask,
GCPtr pGCDst)
{
EXA_GC_PROLOGUE (pGCDst);
ExaGCPriv(pGCDst);
swap(pExaGC, pGCDst, funcs);
(*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
EXA_GC_EPILOGUE (pGCDst);
swap(pExaGC, pGCDst, funcs);
}
static void
@ -663,25 +571,28 @@ exaChangeClip (GCPtr pGC,
pointer pvalue,
int nrects)
{
EXA_GC_PROLOGUE (pGC);
ExaGCPriv(pGC);
swap(pExaGC, pGC, funcs);
(*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
EXA_GC_EPILOGUE (pGC);
swap(pExaGC, pGC, funcs);
}
static void
exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
{
EXA_GC_PROLOGUE (pGCDst);
ExaGCPriv(pGCDst);
swap(pExaGC, pGCDst, funcs);
(*pGCDst->funcs->CopyClip)(pGCDst, pGCSrc);
EXA_GC_EPILOGUE (pGCDst);
swap(pExaGC, pGCDst, funcs);
}
static void
exaDestroyClip(GCPtr pGC)
{
EXA_GC_PROLOGUE (pGC);
ExaGCPriv(pGC);
swap(pExaGC, pGC, funcs);
(*pGC->funcs->DestroyClip)(pGC);
EXA_GC_EPILOGUE (pGC);
swap(pExaGC, pGC, funcs);
}
/**
@ -712,18 +623,6 @@ exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
Bool ret;
ScreenPtr pScreen = pWin->drawable.pScreen;
ExaScreenPriv(pScreen);
CreatePixmapProcPtr old_ptr = NULL;
DestroyPixmapProcPtr old_ptr2 = NULL;
/* save the "fb" pointer. */
old_ptr = pExaScr->SavedCreatePixmap;
/* create a new upper layer pointer. */
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmapWithPrepare);
/* save the "fb" pointer. */
old_ptr2 = pExaScr->SavedDestroyPixmap;
/* create a new upper layer pointer. */
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmapWithFinish);
if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap)
exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
@ -731,25 +630,17 @@ exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE)
exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK);
pExaScr->fallback_counter++;
swap(pExaScr, pScreen, ChangeWindowAttributes);
ret = pScreen->ChangeWindowAttributes(pWin, mask);
swap(pExaScr, pScreen, ChangeWindowAttributes);
pExaScr->fallback_counter--;
if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap)
exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE)
exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK);
/* switch back to the normal upper layer. */
unwrap(pExaScr, pScreen, CreatePixmap);
/* restore copy of fb layer pointer. */
pExaScr->SavedCreatePixmap = old_ptr;
/* switch back to the normal upper layer. */
unwrap(pExaScr, pScreen, DestroyPixmap);
/* restore copy of fb layer pointer. */
pExaScr->SavedDestroyPixmap = old_ptr2;
return ret;
}
@ -1071,6 +962,8 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_mixed;
pExaScr->do_move_in_pixmap = exaMoveInPixmap_mixed;
pExaScr->do_move_out_pixmap = NULL;
pExaScr->prepare_access_reg = exaPrepareAccessReg_mixed;
pExaScr->finish_access = exaFinishAccess_mixed;
} else {
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_driver);
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_driver);
@ -1079,6 +972,8 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_driver;
pExaScr->do_move_in_pixmap = NULL;
pExaScr->do_move_out_pixmap = NULL;
pExaScr->prepare_access_reg = NULL;
pExaScr->finish_access = NULL;
}
} else {
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_classic);
@ -1088,6 +983,8 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_classic;
pExaScr->do_move_in_pixmap = exaMoveInPixmap_classic;
pExaScr->do_move_out_pixmap = exaMoveOutPixmap_classic;
pExaScr->prepare_access_reg = exaPrepareAccessReg_classic;
pExaScr->finish_access = NULL;
}
if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) {
LogMessage(X_INFO, "EXA(%d): Offscreen pixmap area of %lu bytes\n",

View File

@ -51,7 +51,8 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
int partX1, partX2;
int off_x, off_y;
if (pExaScr->swappedOut ||
if (pExaScr->fallback_counter ||
pExaScr->swappedOut ||
pGC->fillStyle != FillSolid ||
pExaPixmap->accel_blocked)
{
@ -153,7 +154,7 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
int bpp = pDrawable->bitsPerPixel;
Bool ret = TRUE;
if (pExaPixmap->accel_blocked || !pExaScr->info->UploadToScreen)
if (pExaScr->fallback_counter || pExaPixmap->accel_blocked || !pExaScr->info->UploadToScreen)
return FALSE;
/* Don't bother with under 8bpp, XYPixmaps. */
@ -504,7 +505,7 @@ exaHWCopyNtoN (DrawablePtr pSrcDrawable,
(*pExaScr->info->DoneCopy) (pDstPixmap);
exaMarkSync (pDstDrawable->pScreen);
/* UTS: mainly for SHM PutImage's secondary path. */
} else {
} else if (pSrcExaPixmap->sys_ptr) {
int bpp = pSrcDrawable->bitsPerPixel;
int src_stride = exaGetPixmapPitch(pSrcPixmap);
CARD8 *src = NULL;
@ -531,7 +532,8 @@ exaHWCopyNtoN (DrawablePtr pSrcDrawable,
pbox++;
}
}
} else
goto fallback;
} else
goto fallback;
@ -568,7 +570,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
{
ExaScreenPriv(pDstDrawable->pScreen);
if (pExaScr->fallback_flags & EXA_FALLBACK_COPYWINDOW)
if (pExaScr->fallback_counter ||
(pExaScr->fallback_flags & EXA_FALLBACK_COPYWINDOW))
return;
if (exaHWCopyNtoN(pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse, upsidedown))
@ -590,7 +593,7 @@ exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
{
ExaScreenPriv (pDstDrawable->pScreen);
if (pExaScr->swappedOut) {
if (pExaScr->fallback_counter || pExaScr->swappedOut) {
return ExaCheckCopyArea(pSrcDrawable, pDstDrawable, pGC,
srcx, srcy, width, height, dstx, dsty);
}
@ -604,13 +607,14 @@ static void
exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
DDXPointPtr ppt)
{
ExaScreenPriv (pDrawable->pScreen);
int i;
xRectangle *prect;
/* If we can't reuse the current GC as is, don't bother accelerating the
* points.
*/
if (pGC->fillStyle != FillSolid) {
if (pExaScr->fallback_counter || pGC->fillStyle != FillSolid) {
ExaCheckPolyPoint(pDrawable, pGC, mode, npt, ppt);
return;
}
@ -639,10 +643,16 @@ static void
exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
DDXPointPtr ppt)
{
ExaScreenPriv (pDrawable->pScreen);
xRectangle *prect;
int x1, x2, y1, y2;
int i;
if (pExaScr->fallback_counter) {
ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt);
return;
}
/* Don't try to do wide lines or non-solid fill style. */
if (pGC->lineWidth != 0 || pGC->lineStyle != LineSolid ||
pGC->fillStyle != FillSolid) {
@ -700,12 +710,13 @@ static void
exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg,
xSegment *pSeg)
{
ExaScreenPriv (pDrawable->pScreen);
xRectangle *prect;
int i;
/* Don't try to do wide lines or non-solid fill style. */
if (pGC->lineWidth != 0 || pGC->lineStyle != LineSolid ||
pGC->fillStyle != FillSolid)
if (pExaScr->fallback_counter || pGC->lineWidth != 0 ||
pGC->lineStyle != LineSolid || pGC->fillStyle != FillSolid)
{
ExaCheckPolySegment(pDrawable, pGC, nseg, pSeg);
return;
@ -782,7 +793,8 @@ exaPolyFillRect(DrawablePtr pDrawable,
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
if (pExaScr->swappedOut || pExaPixmap->accel_blocked)
if (pExaScr->fallback_counter || pExaScr->swappedOut ||
pExaPixmap->accel_blocked)
{
goto fallback;
}
@ -956,12 +968,18 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
-pPixmap->screen_x, -pPixmap->screen_y);
#endif
if (pExaScr->fallback_counter) {
pExaScr->fallback_flags |= EXA_FALLBACK_COPYWINDOW;
goto fallback;
}
pExaScr->fallback_flags |= EXA_ACCEL_COPYWINDOW;
miCopyRegion (&pPixmap->drawable, &pPixmap->drawable,
NULL,
&rgnDst, dx, dy, exaCopyNtoN, 0, NULL);
pExaScr->fallback_flags &= ~EXA_ACCEL_COPYWINDOW;
fallback:
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
if (pExaScr->fallback_flags & EXA_FALLBACK_COPYWINDOW) {
@ -984,7 +1002,7 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
REGION_TRANSLATE(pScreen, pRegion, xoff, yoff);
if (pExaPixmap->accel_blocked)
if (pExaScr->fallback_counter || pExaPixmap->accel_blocked)
goto out;
if (pExaScr->do_migration) {
@ -1031,6 +1049,8 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
*(CARD16*)pExaPixmap->sys_ptr = pixel;
break;
case 8:
case 4:
case 1:
*(CARD8*)pExaPixmap->sys_ptr = pixel;
}
@ -1080,7 +1100,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
pPixmap = exaGetDrawablePixmap (pDrawable);
pExaPixmap = ExaGetPixmapPriv (pPixmap);
if (pExaPixmap->accel_blocked || pTileExaPixmap->accel_blocked)
if (pExaScr->fallback_counter || pExaPixmap->accel_blocked ||
pTileExaPixmap->accel_blocked)
return FALSE;
if (pExaScr->do_migration) {
@ -1238,7 +1259,7 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
int xoff, yoff;
Bool ok;
if (pExaScr->swappedOut)
if (pExaScr->fallback_counter || pExaScr->swappedOut)
goto fallback;
exaGetDrawableDeltas (pDrawable, pPix, &xoff, &yoff);

View File

@ -137,6 +137,10 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
exaSetAccelBlock(pExaScr, pExaPixmap,
w, h, bpp);
/* During a fallback we must prepare access. */
if (pExaScr->fallback_counter)
exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST);
return pPixmap;
}
@ -216,6 +220,10 @@ exaDestroyPixmap_classic (PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
/* During a fallback we must finish access, but we don't know the index. */
if (pExaScr->fallback_counter)
exaFinishAccess(&pPixmap->drawable, -1);
if (pExaPixmap->area)
{
DBG_PIXMAP(("-- 0x%p (0x%x) (%dx%d)\n",
@ -248,9 +256,10 @@ exaPixmapIsOffscreen_classic(PixmapPtr pPixmap)
Bool ret;
if (pExaScr->info->PixmapIsOffscreen) {
void* old_ptr = pPixmap->devPrivate.ptr;
pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap);
ret = pExaScr->info->PixmapIsOffscreen(pPixmap);
pPixmap->devPrivate.ptr = NULL;
pPixmap->devPrivate.ptr = old_ptr;
} else
ret = (pExaPixmap->offscreen && pExaPixmap->fb_ptr);

View File

@ -115,6 +115,10 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
exaSetAccelBlock(pExaScr, pExaPixmap,
w, h, bpp);
/* During a fallback we must prepare access. */
if (pExaScr->fallback_counter)
exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST);
return pPixmap;
}
@ -187,6 +191,10 @@ exaDestroyPixmap_driver (PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
/* During a fallback we must finish access, but we don't know the index. */
if (pExaScr->fallback_counter)
exaFinishAccess(&pPixmap->drawable, -1);
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
pExaPixmap->driverPriv = NULL;
@ -204,11 +212,13 @@ exaPixmapIsOffscreen_driver(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv(pScreen);
pointer saved_ptr;
Bool ret;
saved_ptr = pPixmap->devPrivate.ptr;
pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap);
ret = pExaScr->info->PixmapIsOffscreen(pPixmap);
pPixmap->devPrivate.ptr = NULL;
pPixmap->devPrivate.ptr = saved_ptr;
return ret;
}

View File

@ -701,7 +701,6 @@ exaGlyphs (CARD8 op,
GlyphListPtr list,
GlyphPtr *glyphs)
{
PicturePtr pPicture;
PixmapPtr pMaskPixmap = 0;
PicturePtr pMask = NULL;
ScreenPtr pScreen = pDst->pDrawable->pScreen;
@ -803,7 +802,6 @@ exaGlyphs (CARD8 op,
while (n--)
{
glyph = *glyphs++;
pPicture = GlyphPicture (glyph)[pScreen->myNum];
if (glyph->info.width > 0 && glyph->info.height > 0)
{

View File

@ -104,9 +104,8 @@ exaPixmapShouldBeInFB (PixmapPtr pPix)
static void
exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
Bool (*transfer) (PixmapPtr pPix, int x, int y, int w, int h,
char *sys, int sys_pitch), CARD8 *fallback_src,
CARD8 *fallback_dst, int fallback_srcpitch, int fallback_dstpitch,
int fallback_index, void (*sync) (ScreenPtr pScreen))
char *sys, int sys_pitch), int fallback_index,
void (*sync) (ScreenPtr pScreen))
{
PixmapPtr pPixmap = migrate->pPix;
ExaPixmapPriv (pPixmap);
@ -120,7 +119,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
Bool need_sync = FALSE;
/* Damaged bits are valid in current copy but invalid in other one */
if (exaPixmapIsOffscreen(pPixmap)) {
if (pExaPixmap->offscreen) {
REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB,
damage);
REGION_SUBTRACT(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys,
@ -225,23 +224,24 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
pExaPixmap->sys_pitch))
{
if (!access_prepared) {
ExaDoPrepareAccess(&pPixmap->drawable, fallback_index);
ExaDoPrepareAccess(pPixmap, fallback_index);
access_prepared = TRUE;
}
exaMemcpyBox (pPixmap, pBox,
fallback_src, fallback_srcpitch,
fallback_dst, fallback_dstpitch);
if (fallback_index == EXA_PREPARE_DEST) {
exaMemcpyBox (pPixmap, pBox,
pExaPixmap->sys_ptr, pExaPixmap->sys_pitch,
pPixmap->devPrivate.ptr, pPixmap->devKind);
} else {
exaMemcpyBox (pPixmap, pBox,
pPixmap->devPrivate.ptr, pPixmap->devKind,
pExaPixmap->sys_ptr, pExaPixmap->sys_pitch);
}
} else
need_sync = TRUE;
pBox++;
}
if (access_prepared)
exaFinishAccess(&pPixmap->drawable, fallback_index);
else if (need_sync && sync)
sync (pPixmap->drawable.pScreen);
pExaPixmap->offscreen = save_offscreen;
pPixmap->devKind = save_pitch;
@ -256,6 +256,11 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg);
REGION_UNINIT(pScreen, &CopyReg);
if (access_prepared)
exaFinishAccess(&pPixmap->drawable, fallback_index);
else if (need_sync && sync)
sync (pPixmap->drawable.pScreen);
}
/**
@ -263,7 +268,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
* the framebuffer memory copy to the system memory copy. Both areas must be
* allocated.
*/
static void
void
exaCopyDirtyToSys (ExaMigrationPtr migrate)
{
PixmapPtr pPixmap = migrate->pPix;
@ -271,9 +276,8 @@ exaCopyDirtyToSys (ExaMigrationPtr migrate)
ExaPixmapPriv (pPixmap);
exaCopyDirty(migrate, &pExaPixmap->validSys, &pExaPixmap->validFB,
pExaScr->info->DownloadFromScreen, pExaPixmap->fb_ptr,
pExaPixmap->sys_ptr, pExaPixmap->fb_pitch,
pExaPixmap->sys_pitch, EXA_PREPARE_SRC, exaWaitSync);
pExaScr->info->DownloadFromScreen, EXA_PREPARE_SRC,
exaWaitSync);
}
/**
@ -281,7 +285,7 @@ exaCopyDirtyToSys (ExaMigrationPtr migrate)
* the system memory copy to the framebuffer memory copy. Both areas must be
* allocated.
*/
static void
void
exaCopyDirtyToFb (ExaMigrationPtr migrate)
{
PixmapPtr pPixmap = migrate->pPix;
@ -289,9 +293,7 @@ exaCopyDirtyToFb (ExaMigrationPtr migrate)
ExaPixmapPriv (pPixmap);
exaCopyDirty(migrate, &pExaPixmap->validFB, &pExaPixmap->validSys,
pExaScr->info->UploadToScreen, pExaPixmap->sys_ptr,
pExaPixmap->fb_ptr, pExaPixmap->sys_pitch,
pExaPixmap->fb_pitch, EXA_PREPARE_DEST, NULL);
pExaScr->info->UploadToScreen, EXA_PREPARE_DEST, NULL);
}
/**
@ -545,7 +547,7 @@ exaAssertNotDirty (PixmapPtr pPixmap)
pExaPixmap->offscreen = TRUE;
pPixmap->devKind = pExaPixmap->fb_pitch;
if (!ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC))
if (!ExaDoPrepareAccess(pPixmap, EXA_PREPARE_SRC))
goto skip;
while (nbox--) {
@ -718,3 +720,23 @@ exaDoMigration_classic (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
}
}
}
void
exaPrepareAccessReg_classic(PixmapPtr pPixmap, int index, RegionPtr pReg)
{
ExaMigrationRec pixmaps[1];
if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
} else {
pixmaps[0].as_dst = FALSE;
pixmaps[0].as_src = TRUE;
}
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = pReg;
exaDoMigration(pixmaps, 1, FALSE);
(void)ExaDoPrepareAccess(pPixmap, index);
}

View File

@ -31,55 +31,16 @@
#include "exa_priv.h"
#include "exa.h"
static void
exaUploadFallback(PixmapPtr pPixmap, CARD8 *src, int src_pitch)
{
ExaPixmapPriv(pPixmap);
RegionPtr damage = DamageRegion (pExaPixmap->pDamage);
GCPtr pGC = GetScratchGC (pPixmap->drawable.depth,
pPixmap->drawable.pScreen);
int nbox, cpp = pPixmap->drawable.bitsPerPixel / 8;
DamagePtr backup = pExaPixmap->pDamage;
BoxPtr pbox;
CARD8 *src2;
/* We don't want damage optimisations. */
pExaPixmap->pDamage = NULL;
ValidateGC (&pPixmap->drawable, pGC);
pbox = REGION_RECTS(damage);
nbox = REGION_NUM_RECTS(damage);
while (nbox--) {
src2 = src + pbox->y1 * src_pitch + pbox->x1 * cpp;
ExaCheckPutImage(&pPixmap->drawable, pGC,
pPixmap->drawable.depth, pbox->x1, pbox->y1,
pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, 0,
ZPixmap, (char*) src2);
pbox++;
}
FreeScratchGC (pGC);
pExaPixmap->pDamage = backup;
}
void
exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv(pScreen);
ExaPixmapPriv(pPixmap);
RegionPtr damage = DamageRegion (pExaPixmap->pDamage);
void *sys_buffer = pExaPixmap->sys_ptr;
int w = pPixmap->drawable.width, h = pPixmap->drawable.height;
int depth = pPixmap->drawable.depth, bpp = pPixmap->drawable.bitsPerPixel;
int usage_hint = pPixmap->usage_hint;
int sys_pitch = pExaPixmap->sys_pitch;
int paddedWidth = sys_pitch;
int nbox;
BoxPtr pbox;
int paddedWidth = pExaPixmap->sys_pitch;
/* Already done. */
if (pExaPixmap->driverPriv)
@ -105,50 +66,8 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
if (!pExaPixmap->driverPriv)
return;
pExaPixmap->offscreen = TRUE;
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr = NULL;
pExaPixmap->sys_pitch = pPixmap->devKind = 0;
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
(*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0,
paddedWidth, NULL);
/* scratch pixmaps */
if (!w || !h)
goto finish;
/* we do not malloc memory by default. */
if (!sys_buffer)
goto finish;
if (!pExaScr->info->UploadToScreen)
goto fallback;
pbox = REGION_RECTS(damage);
nbox = REGION_NUM_RECTS(damage);
while (nbox--) {
if (!pExaScr->info->UploadToScreen(pPixmap, pbox->x1, pbox->y1, pbox->x2 - pbox->x1,
pbox->y2 - pbox->y1, (char *) (sys_buffer) + pbox->y1 * sys_pitch + pbox->x1 * (bpp / 8), sys_pitch))
goto fallback;
pbox++;
}
goto finish;
fallback:
exaUploadFallback(pPixmap, sys_buffer, sys_pitch);
finish:
free(sys_buffer);
/* We no longer need this. */
if (pExaPixmap->pDamage) {
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
DamageDestroy(pExaPixmap->pDamage);
pExaPixmap->pDamage = NULL;
}
}
void
@ -175,8 +94,16 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
for (i = 0; i < npixmaps; i++) {
PixmapPtr pPixmap = pixmaps[i].pPix;
ExaPixmapPriv(pPixmap);
if (!pExaPixmap->driverPriv)
exaCreateDriverPixmap_mixed(pPixmap);
if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap)) {
pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToFb(pixmaps + i);
}
pExaPixmap->offscreen = exaPixmapIsOffscreen(pPixmap);
}
}
@ -192,3 +119,92 @@ exaMoveInPixmap_mixed(PixmapPtr pPixmap)
exaDoMigration(pixmaps, 1, TRUE);
}
/* With mixed pixmaps, if we fail to get direct access to the driver pixmap, we
* use the DownloadFromScreen hook to retrieve contents to a copy in system
* memory, perform software rendering on that and move back the results with the
* UploadToScreen hook (see exaFinishAccess_mixed).
*/
void
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
{
if (!ExaDoPrepareAccess(pPixmap, index)) {
ExaPixmapPriv(pPixmap);
Bool is_offscreen = exaPixmapIsOffscreen(pPixmap);
ExaMigrationRec pixmaps[1];
/* Do we need to allocate our system buffer? */
if (!pExaPixmap->sys_ptr) {
pExaPixmap->sys_ptr = malloc(pExaPixmap->sys_pitch *
pPixmap->drawable.height);
if (!pExaPixmap->sys_ptr)
FatalError("EXA: malloc failed for size %d bytes\n",
pExaPixmap->sys_pitch * pPixmap->drawable.height);
}
if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
pixmaps[0].as_dst = TRUE;
pixmaps[0].as_src = FALSE;
} else {
pixmaps[0].as_dst = FALSE;
pixmaps[0].as_src = TRUE;
}
pixmaps[0].pPix = pPixmap;
pixmaps[0].pReg = pReg;
if (!pExaPixmap->pDamage && (is_offscreen || !exaPixmapIsPinned(pPixmap))) {
Bool as_dst = pixmaps[0].as_dst;
/* Set up damage tracking */
pExaPixmap->pDamage = DamageCreate(NULL, NULL, DamageReportNone,
TRUE, pPixmap->drawable.pScreen,
pPixmap);
DamageRegister(&pPixmap->drawable, pExaPixmap->pDamage);
/* This ensures that pending damage reflects the current operation. */
/* This is used by exa to optimize migration. */
DamageSetReportAfterOp(pExaPixmap->pDamage, TRUE);
if (is_offscreen) {
exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
pPixmap->drawable.height);
/* We don't know which region of the destination will be damaged,
* have to assume all of it
*/
if (as_dst) {
pixmaps[0].as_dst = FALSE;
pixmaps[0].as_src = TRUE;
pixmaps[0].pReg = NULL;
}
pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToSys(pixmaps);
}
if (as_dst)
exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
pPixmap->drawable.height);
} else if (is_offscreen) {
pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToSys(pixmaps);
}
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
pExaPixmap->offscreen = FALSE;
}
}
/* Move back results of software rendering on system memory copy of mixed driver
* pixmap (see exaPrepareAccessReg_mixed).
*/
void exaFinishAccess_mixed(PixmapPtr pPixmap, int index)
{
ExaPixmapPriv(pPixmap);
if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap) &&
!pExaPixmap->offscreen) {
DamageRegionProcessPending(&pPixmap->drawable);
exaMoveInPixmap_mixed(pPixmap);
}
}

View File

@ -32,8 +32,6 @@
#include "exa.h"
/* This file holds the driver allocated pixmaps + better initial placement code.
* A pinned pixmap implies one that is either driver based already or otherwise altered.
* Proper care is taken to free the initially allocated buffer.
*/
static _X_INLINE void*
@ -46,9 +44,6 @@ ExaGetPixmapAddress(PixmapPtr p)
/**
* exaCreatePixmap() creates a new pixmap.
*
* Pixmaps are always marked as pinned, unless the pixmap can still be transfered to a
* driver pixmaps.
*/
PixmapPtr
exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
@ -57,7 +52,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
PixmapPtr pPixmap;
ExaPixmapPrivPtr pExaPixmap;
int bpp;
size_t paddedWidth, datasize;
size_t paddedWidth;
ExaScreenPriv(pScreen);
if (w > 32767 || h > 32767)
@ -79,15 +74,12 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
if (paddedWidth / 4 > 32767 || h > 32767)
return NullPixmap;
datasize = h * paddedWidth;
/* We will allocate the system pixmap later if needed. */
pPixmap->devPrivate.ptr = NULL;
pExaPixmap->sys_ptr = NULL;
pExaPixmap->sys_pitch = paddedWidth;
pExaPixmap->area = NULL;
pExaPixmap->offscreen = FALSE;
pExaPixmap->fb_ptr = NULL;
pExaPixmap->pDamage = NULL;
@ -95,36 +87,19 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
exaSetAccelBlock(pExaScr, pExaPixmap,
w, h, bpp);
/* Avoid freeing sys_ptr. */
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
(*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0,
paddedWidth, NULL);
/* We want to be able to transfer the pixmap to driver memory later on. */
pExaPixmap->score = EXA_PIXMAP_SCORE_INIT;
/* A scratch pixmap will become a driver pixmap right away. */
if (!w || !h) {
exaCreateDriverPixmap_mixed(pPixmap);
} else {
/* Set up damage tracking */
pExaPixmap->pDamage = DamageCreate (NULL, NULL,
DamageReportNone, TRUE,
pScreen, pPixmap);
pExaPixmap->offscreen = exaPixmapIsOffscreen(pPixmap);
} else
pExaPixmap->offscreen = FALSE;
if (pExaPixmap->pDamage == NULL) {
swap(pExaScr, pScreen, DestroyPixmap);
pScreen->DestroyPixmap (pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return NULL;
}
DamageRegister (&pPixmap->drawable, pExaPixmap->pDamage);
/* This ensures that pending damage reflects the current operation. */
/* This is used by exa to optimize migration. */
DamageSetReportAfterOp (pExaPixmap->pDamage, TRUE);
}
/* During a fallback we must prepare access. */
if (pExaScr->fallback_counter)
exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST);
return pPixmap;
}
@ -136,7 +111,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPrivPtr pExaScr;
ExaPixmapPrivPtr pExaPixmap;
Bool ret;
Bool ret, is_offscreen;
if (!pPixmap)
return FALSE;
@ -144,26 +119,23 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
pExaScr = ExaGetScreenPriv(pScreen);
pExaPixmap = ExaGetPixmapPriv(pPixmap);
if (pExaPixmap) {
if (!exaPixmapIsPinned(pPixmap)) {
free(pExaPixmap->sys_ptr);
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr = NULL;
pExaPixmap->sys_pitch = pPixmap->devKind = 0;
/* We no longer need this. */
if (pPixData) {
if (pExaPixmap->driverPriv) {
if (pExaPixmap->pDamage) {
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
DamageDestroy(pExaPixmap->pDamage);
pExaPixmap->pDamage = NULL;
}
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
pExaPixmap->driverPriv = NULL;
}
if (pPixData)
pExaPixmap->sys_ptr = pPixData;
if (devKind > 0)
pExaPixmap->sys_pitch = devKind;
pExaPixmap->offscreen = FALSE;
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
}
if (pExaPixmap->driverPriv) {
if (width > 0 && height > 0 && bitsPerPixel > 0) {
exaSetFbPitch(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
@ -171,23 +143,21 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
exaSetAccelBlock(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
}
}
/* Anything can happen, don't try to predict it all. */
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
is_offscreen = exaPixmapIsOffscreen(pPixmap);
if (is_offscreen) {
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
pPixmap->devKind = pExaPixmap->fb_pitch;
} else {
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
}
/* Only pass driver pixmaps to the driver. */
if (pExaScr->info->ModifyPixmapHeader && pExaPixmap->driverPriv) {
ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth,
bitsPerPixel, devKind, pPixData);
/* For EXA_HANDLES_PIXMAPS, we set pPixData to NULL.
* If pPixmap->devPrivate.ptr is non-NULL, then we've got a non-offscreen pixmap.
* We need to store the pointer, because PrepareAccess won't be called.
*/
if (!pPixData && pPixmap->devPrivate.ptr && pPixmap->devKind) {
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr;
pExaPixmap->sys_pitch = pPixmap->devKind;
}
if (ret == TRUE)
goto out;
}
@ -198,6 +168,13 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
swap(pExaScr, pScreen, ModifyPixmapHeader);
out:
if (is_offscreen) {
pExaPixmap->fb_ptr = pPixmap->devPrivate.ptr;
pExaPixmap->fb_pitch = pPixmap->devKind;
} else {
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr;
pExaPixmap->sys_pitch = pPixmap->devKind;
}
/* Always NULL this, we don't want lingering pointers. */
pPixmap->devPrivate.ptr = NULL;
@ -215,12 +192,20 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
/* During a fallback we must finish access, but we don't know the index. */
if (pExaScr->fallback_counter)
exaFinishAccess(&pPixmap->drawable, -1);
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
else if (pExaPixmap->sys_ptr && !exaPixmapIsPinned(pPixmap))
free(pExaPixmap->sys_ptr);
pExaPixmap->driverPriv = NULL;
pExaPixmap->sys_ptr = NULL;
if (pExaPixmap->pDamage) {
if (pExaPixmap->sys_ptr)
free(pExaPixmap->sys_ptr);
pExaPixmap->sys_ptr = NULL;
pExaPixmap->pDamage = NULL;
}
}
swap(pExaScr, pScreen, DestroyPixmap);

View File

@ -169,7 +169,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
{
ExaOffscreenArea *area;
ExaScreenPriv (pScreen);
int real_size = 0, free_total = 0, largest_avail = 0;
int real_size = 0, largest_avail = 0;
#if DEBUG_OFFSCREEN
static int number = 0;
ErrorF("================= ============ allocating a new pixmap %d\n", ++number);
@ -208,33 +208,10 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
if (real_size <= area->size)
break;
free_total += area->size;
if (area->size > largest_avail)
largest_avail = area->size;
}
if (!area && free_total >= size) {
CARD32 now = GetTimeInMillis();
/* Don't defragment more than once per second, to avoid adding more
* overhead than we're trying to prevent
*/
if (abs((INT32) (now - pExaScr->lastDefragment)) > 1000) {
area = ExaOffscreenDefragment(pScreen);
pExaScr->lastDefragment = now;
if (area) {
/* adjust size to match alignment requirement */
real_size = size + (area->base_offset + area->size - size) % align;
/* does it fit? */
if (real_size > area->size)
area = NULL;
}
}
}
if (!area)
{
area = exaFindAreaToEvict(pExaScr, size, align);

View File

@ -176,6 +176,8 @@ typedef struct {
Bool (*pixmap_is_offscreen) (PixmapPtr pPixmap);
void (*do_move_in_pixmap) (PixmapPtr pPixmap);
void (*do_move_out_pixmap) (PixmapPtr pPixmap);
void (*prepare_access_reg)(PixmapPtr pPixmap, int index, RegionPtr pReg);
void (*finish_access)(PixmapPtr pPixmap, int index);
Bool swappedOut;
enum ExaMigrationHeuristic migration;
@ -195,6 +197,7 @@ typedef struct {
/* Holds information on fallbacks that cannot be relayed otherwise. */
unsigned int fallback_flags;
unsigned int fallback_counter;
ExaGlyphCacheRec glyphCaches[EXA_NUM_GLYPH_CACHES];
} ExaScreenPrivRec, *ExaScreenPrivPtr;
@ -238,13 +241,21 @@ extern DevPrivateKey exaGCPrivateKey;
real->mem = tmp; \
}
#define EXA_GC_PROLOGUE(_gc_) \
#define EXA_PRE_FALLBACK(_screen_) \
ExaScreenPriv(_screen_); \
pExaScr->fallback_counter++;
#define EXA_POST_FALLBACK(_screen_) \
pExaScr->fallback_counter--;
#define EXA_PRE_FALLBACK_GC(_gc_) \
ExaScreenPriv(_gc_->pScreen); \
ExaGCPriv(_gc_); \
swap(pExaGC, _gc_, funcs); \
pExaScr->fallback_counter++; \
swap(pExaGC, _gc_, ops);
#define EXA_GC_EPILOGUE(_gc_) \
swap(pExaGC, _gc_, funcs); \
#define EXA_POST_FALLBACK_GC(_gc_) \
pExaScr->fallback_counter--; \
swap(pExaGC, _gc_, ops);
/** Align an offset to an arbitrary alignment */
@ -511,10 +522,7 @@ ExaOffscreenFini (ScreenPtr pScreen);
/* exa.c */
Bool
ExaDoPrepareAccess(DrawablePtr pDrawable, int index);
void
exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg);
ExaDoPrepareAccess(PixmapPtr pPixmap, int index);
void
exaPrepareAccess(DrawablePtr pDrawable, int index);
@ -609,6 +617,12 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
void
exaMoveInPixmap_mixed(PixmapPtr pPixmap);
void
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg);
void
exaFinishAccess_mixed(PixmapPtr pPixmap, int index);
/* exa_render.c */
Bool
exaOpReadsDestination (CARD8 op);
@ -664,6 +678,12 @@ exaGlyphs (CARD8 op,
GlyphPtr *glyphs);
/* exa_migration_classic.c */
void
exaCopyDirtyToSys (ExaMigrationPtr migrate);
void
exaCopyDirtyToFb (ExaMigrationPtr migrate);
void
exaDoMigration_classic (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
@ -676,4 +696,7 @@ exaMoveOutPixmap_classic (PixmapPtr pPixmap);
void
exaMoveInPixmap_classic (PixmapPtr pPixmap);
void
exaPrepareAccessReg_classic(PixmapPtr pPixmap, int index, RegionPtr pReg);
#endif /* EXAPRIV_H */

View File

@ -185,41 +185,56 @@ exaGetRGBAFromPixel(CARD32 pixel,
CARD16 *green,
CARD16 *blue,
CARD16 *alpha,
PictFormatPtr pFormat)
PictFormatPtr pFormat,
PictFormatShort format)
{
int rbits, bbits, gbits, abits;
int rshift, bshift, gshift, ashift;
if (!PICT_FORMAT_COLOR(pFormat->format) &&
PICT_FORMAT_TYPE(pFormat->format) != PICT_TYPE_A)
if (!PICT_FORMAT_COLOR(format) && PICT_FORMAT_TYPE(format) != PICT_TYPE_A)
return FALSE;
rbits = PICT_FORMAT_R(pFormat->format);
gbits = PICT_FORMAT_G(pFormat->format);
bbits = PICT_FORMAT_B(pFormat->format);
abits = PICT_FORMAT_A(pFormat->format);
rbits = PICT_FORMAT_R(format);
gbits = PICT_FORMAT_G(format);
bbits = PICT_FORMAT_B(format);
abits = PICT_FORMAT_A(format);
rshift = pFormat->direct.red;
gshift = pFormat->direct.green;
bshift = pFormat->direct.blue;
ashift = pFormat->direct.alpha;
if (pFormat) {
rshift = pFormat->direct.red;
gshift = pFormat->direct.green;
bshift = pFormat->direct.blue;
ashift = pFormat->direct.alpha;
} else if (format == PICT_a8r8g8b8) {
rshift = 16;
gshift = 8;
bshift = 0;
ashift = 24;
} else
FatalError("EXA bug: exaGetRGBAFromPixel() doesn't match "
"createSourcePicture()\n");
*red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
while (rbits < 16) {
*red |= *red >> rbits;
rbits <<= 1;
}
if (rbits) {
*red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
while (rbits < 16) {
*red |= *red >> rbits;
rbits <<= 1;
}
*green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits);
while (gbits < 16) {
*green |= *green >> gbits;
gbits <<= 1;
}
*green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits);
while (gbits < 16) {
*green |= *green >> gbits;
gbits <<= 1;
}
*blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits);
while (bbits < 16) {
*blue |= *blue >> bbits;
bbits <<= 1;
*blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits);
while (bbits < 16) {
*blue |= *blue >> bbits;
bbits <<= 1;
}
} else {
*red = 0x0000;
*green = 0x0000;
*blue = 0x0000;
}
if (abits) {
@ -266,6 +281,10 @@ exaTryDriverSolidFill(PicturePtr pSrc,
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;
if (pSrc->pDrawable) {
xSrc += pSrc->pDrawable->x;
ySrc += pSrc->pDrawable->y;
}
if (!miComputeCompositeRegion (&region, pSrc, NULL, pDst,
xSrc, ySrc, 0, 0, xDst, yDst,
@ -277,16 +296,13 @@ exaTryDriverSolidFill(PicturePtr pSrc,
REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
if (pSrc->pDrawable) {
xSrc += pSrc->pDrawable->x;
ySrc += pSrc->pDrawable->y;
pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
pixel = exaGetPixmapFirstPixel (pSrcPix);
} else
pixel = pSrc->pSourcePict->solidFill.color;
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
pSrc->pFormat) ||
pSrc->pFormat, pSrc->format) ||
!exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
pDst->pFormat))
{
@ -340,7 +356,8 @@ exaTryDriverCompositeRects(CARD8 op,
ExaCompositeRectPtr rects)
{
ExaScreenPriv (pDst->pDrawable->pScreen);
int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
int src_off_x = 0, src_off_y = 0, mask_off_x = 0, mask_off_y = 0;
int dst_off_x, dst_off_y;
PixmapPtr pSrcPix = NULL, pMaskPix = NULL, pDstPix;
ExaPixmapPrivPtr pSrcExaPix = NULL, pMaskExaPix = NULL, pDstExaPix;
@ -656,7 +673,7 @@ exaTryDriverComposite(CARD8 op,
*/
if (pDstExaPix->accel_blocked ||
(pSrcExaPix && pSrcExaPix->accel_blocked) ||
(pMask && (pMaskExaPix->accel_blocked)))
(pMaskExaPix && (pMaskExaPix->accel_blocked)))
{
return -1;
}

View File

@ -74,26 +74,26 @@ void
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
DDXPointPtr ppt, int *pwidth, int fSorted)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessGC (pGC);
pGC->ops->FillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
pGC->ops->SetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
@ -101,19 +101,21 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
int x, int y, int w, int h, int leftPad, int format,
char *bits)
{
ExaPixmapPriv(exaGetDrawablePixmap(pDrawable));
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
ExaPixmapPriv(pPixmap);
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
if (!pExaScr->prepare_access_reg || !pExaPixmap->pDamage ||
exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
pGC->alu, pGC->clientClipType))
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
else
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pExaPixmap->pDamage ?
DamagePendingRegion(pExaPixmap->pDamage) : NULL);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST,
DamagePendingRegion(pExaPixmap->pDamage));
pGC->ops->PutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
@ -121,7 +123,7 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
BoxPtr pbox, int nbox, int dx, int dy, Bool reverse,
Bool upsidedown, Pixel bitplane, void *closure)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst,
exaDrawableLocation(pSrc), exaDrawableLocation(pDst)));
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
@ -134,7 +136,7 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
}
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
exaFinishAccess (pDst, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
RegionPtr
@ -143,7 +145,7 @@ ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
{
RegionPtr ret;
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst,
exaDrawableLocation(pSrc), exaDrawableLocation(pDst)));
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
@ -151,7 +153,7 @@ ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
ret = pGC->ops->CopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
exaFinishAccess (pDst, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
return ret;
}
@ -163,7 +165,7 @@ ExaCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
{
RegionPtr ret;
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst,
exaDrawableLocation(pSrc), exaDrawableLocation(pDst)));
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
@ -172,7 +174,7 @@ ExaCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
bitPlane);
exaFinishAccess (pSrc, EXA_PREPARE_SRC);
exaFinishAccess (pDst, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
return ret;
}
@ -181,19 +183,19 @@ void
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
DDXPointPtr pptInit)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
pGC->ops->PolyPoint (pDrawable, pGC, mode, npt, pptInit);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
int mode, int npt, DDXPointPtr ppt)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c), width %d, mode %d, count %d\n",
pDrawable, exaDrawableLocation(pDrawable),
pGC->lineWidth, mode, npt));
@ -203,14 +205,14 @@ ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
pGC->ops->Polylines (pDrawable, pGC, mode, npt, ppt);
exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
int nsegInit, xSegment *pSegInit)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c) width %d, count %d\n", pDrawable,
exaDrawableLocation(pDrawable), pGC->lineWidth, nsegInit));
@ -219,14 +221,14 @@ ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
pGC->ops->PolySegment (pDrawable, pGC, nsegInit, pSegInit);
exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
int narcs, xArc *pArcs)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
@ -234,14 +236,14 @@ ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
pGC->ops->PolyArc (pDrawable, pGC, narcs, pArcs);
exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
int nrect, xRectangle *prect)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
@ -249,7 +251,7 @@ ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
pGC->ops->PolyFillRect (pDrawable, pGC, nrect, prect);
exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
@ -257,7 +259,7 @@ ExaCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable,
exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
@ -265,7 +267,7 @@ ExaCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
pGC->ops->ImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
@ -273,7 +275,7 @@ ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("to %p (%c), style %d alu %d\n", pDrawable,
exaDrawableLocation(pDrawable), pGC->fillStyle, pGC->alu));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
@ -281,7 +283,7 @@ ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
pGC->ops->PolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
@ -289,7 +291,7 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable,
int w, int h, int x, int y)
{
EXA_GC_PROLOGUE(pGC);
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pBitmap, pDrawable,
exaDrawableLocation(&pBitmap->drawable),
exaDrawableLocation(pDrawable)));
@ -300,7 +302,7 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
exaFinishAccessGC (pGC);
exaFinishAccess (&pBitmap->drawable, EXA_PREPARE_SRC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
EXA_POST_FALLBACK_GC(pGC);
}
void
@ -308,7 +310,7 @@ ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
DrawablePtr pDrawable = &pWin->drawable;
ScreenPtr pScreen = pDrawable->pScreen;
ExaScreenPriv(pScreen);
EXA_PRE_FALLBACK(pScreen);
EXA_FALLBACK(("from %p\n", pWin));
/* being both src and dest, src is safest. */
@ -317,36 +319,42 @@ ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
pScreen->CopyWindow (pWin, ptOldOrg, prgnSrc);
swap(pExaScr, pScreen, CopyWindow);
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
EXA_POST_FALLBACK(pScreen);
}
void
ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *d)
{
BoxRec Box;
RegionRec Reg;
int xoff, yoff;
ScreenPtr pScreen = pDrawable->pScreen;
PixmapPtr pPix = exaGetDrawablePixmap (pDrawable);
ExaScreenPriv(pScreen);
EXA_PRE_FALLBACK(pScreen);
EXA_FALLBACK(("from %p (%c)\n", pDrawable,
exaDrawableLocation(pDrawable)));
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
if (pExaScr->prepare_access_reg) {
int xoff, yoff;
BoxRec Box;
RegionRec Reg;
Box.x1 = pDrawable->y + x + xoff;
Box.y1 = pDrawable->y + y + yoff;
Box.x2 = Box.x1 + w;
Box.y2 = Box.y1 + h;
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
REGION_INIT(pScreen, &Reg, &Box, 1);
Box.x1 = pDrawable->y + x + xoff;
Box.y1 = pDrawable->y + y + yoff;
Box.x2 = Box.x1 + w;
Box.y2 = Box.y1 + h;
REGION_INIT(pScreen, &Reg, &Box, 1);
pExaScr->prepare_access_reg(pPix, EXA_PREPARE_SRC, &Reg);
} else
exaPrepareAccess(pDrawable, EXA_PREPARE_SRC);
exaPrepareAccessReg (pDrawable, EXA_PREPARE_SRC, &Reg);
swap(pExaScr, pScreen, GetImage);
pScreen->GetImage (pDrawable, x, y, w, h, format, planeMask, d);
swap(pExaScr, pScreen, GetImage);
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
EXA_POST_FALLBACK(pScreen);
}
void
@ -358,14 +366,15 @@ ExaCheckGetSpans (DrawablePtr pDrawable,
char *pdstStart)
{
ScreenPtr pScreen = pDrawable->pScreen;
ExaScreenPriv(pScreen);
EXA_PRE_FALLBACK(pScreen);
EXA_FALLBACK(("from %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_SRC);
swap(pExaScr, pScreen, GetSpans);
pScreen->GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
swap(pExaScr, pScreen, GetSpans);
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
EXA_POST_FALLBACK(pScreen);
}
void
@ -386,9 +395,9 @@ ExaCheckComposite (CARD8 op,
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreen(pScreen);
#endif /* RENDER */
ExaScreenPriv(pScreen);
RegionRec region;
int xoff, yoff;
EXA_PRE_FALLBACK(pScreen);
REGION_NULL(pScreen, &region);
@ -401,23 +410,23 @@ ExaCheckComposite (CARD8 op,
if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable)
exaPrepareAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX_MASK);
if (!exaOpReadsDestination(op)) {
if (!exaOpReadsDestination(op) && pExaScr->prepare_access_reg) {
PixmapPtr pDstPix;
if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height))
goto skip;
exaGetDrawableDeltas (pDst->pDrawable,
exaGetDrawablePixmap(pDst->pDrawable),
&xoff, &yoff);
pDstPix = exaGetDrawablePixmap(pDst->pDrawable);
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &xoff, &yoff);
REGION_TRANSLATE(pScreen, &region, xoff, yoff);
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
exaPrepareAccessReg(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST,
&region);
pExaScr->prepare_access_reg(exaGetDrawablePixmap(pDst->alphaMap->pDrawable),
EXA_PREPARE_AUX_DEST, &region);
exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, &region);
pExaScr->prepare_access_reg(pDstPix, EXA_PREPARE_DEST, &region);
} else {
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
exaPrepareAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST);
@ -463,6 +472,7 @@ skip:
exaFinishAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX_MASK);
REGION_UNINIT(pScreen, &region);
EXA_POST_FALLBACK(pScreen);
}
void
@ -476,7 +486,7 @@ ExaCheckAddTraps (PicturePtr pPicture,
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreen(pScreen);
#endif /* RENDER */
ExaScreenPriv(pScreen);
EXA_PRE_FALLBACK(pScreen);
EXA_FALLBACK(("to pict %p (%c)\n",
exaDrawableLocation(pPicture->pDrawable)));
@ -487,6 +497,7 @@ ExaCheckAddTraps (PicturePtr pPicture,
swap(pExaScr, ps, AddTraps);
#endif /* RENDER */
exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
EXA_POST_FALLBACK(pScreen);
}
/**
@ -514,6 +525,8 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap)
return pixel;
}
case 8:
case 4:
case 1:
{
CARD8 pixel;

76
fb/fb.h
View File

@ -700,38 +700,41 @@ typedef struct {
#define __fbPixOffXPix(pPix) (__fbPixDrawableX(pPix))
#define __fbPixOffYPix(pPix) (__fbPixDrawableY(pPix))
#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
PixmapPtr _pPix; \
if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
_pPix = fbGetWindowPixmap(pDrawable); \
(xoff) = __fbPixOffXWin(_pPix); \
(yoff) = __fbPixOffYWin(_pPix); \
} else { \
_pPix = (PixmapPtr) (pDrawable); \
(xoff) = __fbPixOffXPix(_pPix); \
(yoff) = __fbPixOffYPix(_pPix); \
} \
fbPrepareAccess(pDrawable); \
(pointer) = (FbBits *) _pPix->devPrivate.ptr; \
(stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
#define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) { \
if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
(pixmap) = fbGetWindowPixmap(pDrawable); \
(xoff) = __fbPixOffXWin(pixmap); \
(yoff) = __fbPixOffYWin(pixmap); \
} else { \
(pixmap) = (PixmapPtr) (pDrawable); \
(xoff) = __fbPixOffXPix(pixmap); \
(yoff) = __fbPixOffYPix(pixmap); \
} \
fbPrepareAccess(pDrawable); \
}
#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
PixmapPtr _pPix; \
if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
_pPix = fbGetWindowPixmap(pDrawable); \
(xoff) = __fbPixOffXWin(_pPix); \
(yoff) = __fbPixOffYWin(_pPix); \
} else { \
_pPix = (PixmapPtr) (pDrawable); \
(xoff) = __fbPixOffXPix(_pPix); \
(yoff) = __fbPixOffYPix(_pPix); \
} \
fbPrepareAccess(pDrawable); \
(pointer) = (FbStip *) _pPix->devPrivate.ptr; \
(stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
#define fbGetPixmapBitsData(pixmap, pointer, stride, bpp) { \
(pointer) = (FbBits *) (pixmap)->devPrivate.ptr; \
(stride) = ((int) (pixmap)->devKind) / sizeof (FbBits); (void)(stride); \
(bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
}
#define fbGetPixmapStipData(pixmap, pointer, stride, bpp) { \
(pointer) = (FbStip *) (pixmap)->devPrivate.ptr; \
(stride) = ((int) (pixmap)->devKind) / sizeof (FbStip); (void)(stride); \
(bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
}
#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
PixmapPtr _pPix; \
fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
fbGetPixmapBitsData(_pPix, pointer, stride, bpp); \
}
#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
PixmapPtr _pPix; \
fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
fbGetPixmapStipData(_pPix, pointer, stride, bpp); \
}
/*
@ -2079,9 +2082,16 @@ fbFillRegionSolid (DrawablePtr pDrawable,
FbBits xor);
extern _X_EXPORT pixman_image_t *
image_from_pict (PicturePtr pict,
Bool has_clip,
Bool is_src);
image_from_pict (PicturePtr pict,
Bool has_clip,
Bool is_src);
extern _X_EXPORT pixman_image_t *
image_from_pict_18 (PicturePtr pict,
Bool has_clip,
int *xoff,
int *yoff);
extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
#endif /* _FB_H_ */

View File

@ -25,7 +25,7 @@
* underlying datatypes instead of masks
*/
#define isClipped(c,ul,lr) ((((c) - (ul)) | ((lr) - (c))) & 0x80008000)
#define isClipped(c,ul,lr) (((c) | ((c) - (ul)) | ((lr) - (c))) & 0x80008000)
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>

View File

@ -1,32 +1,25 @@
/************************************************************
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
All Rights Reserved
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright no-
tice appear in all copies and that both that copyright no-
tice and this permission notice appear in supporting docu-
mentation, and that the names of Sun or X Consortium
not be used in advertising or publicity pertaining to
distribution of the software without specific prior
written permission. Sun and X Consortium make no
representations about the suitability of this software for
any purpose. It is provided "as is" without any express or
implied warranty.
SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/*
* Copyright © 1987 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>

View File

@ -1,32 +1,25 @@
/************************************************************
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
All Rights Reserved
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright no-
tice appear in all copies and that both that copyright no-
tice and this permission notice appear in supporting docu-
mentation, and that the names of Sun or X Consortium
not be used in advertising or publicity pertaining to
distribution of the software without specific prior
written permission. Sun and X Consortium make no
representations about the suitability of this software for
any purpose. It is provided "as is" without any express or
implied warranty.
SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/*
* Copyright © 1987 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/**
* This version of fbcmap.c is implemented in terms of mi functions.

View File

@ -158,19 +158,24 @@ fbComposite (CARD8 op,
CARD16 height)
{
pixman_image_t *src, *mask, *dest;
int src_xoff, src_yoff;
int msk_xoff, msk_yoff;
int dst_xoff, dst_yoff;
miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
miCompositeSourceValidate (pSrc, xSrc - xDst, ySrc - yDst, width, height);
if (pMask)
miCompositeSourceValidate (pMask, xMask, yMask, width, height);
miCompositeSourceValidate (pMask, xMask - xDst, yMask - yDst, width, height);
src = image_from_pict (pSrc, TRUE, TRUE);
mask = image_from_pict (pMask, TRUE, TRUE);
dest = image_from_pict (pDst, TRUE, FALSE);
src = image_from_pict_18 (pSrc, FALSE, &src_xoff, &src_yoff);
mask = image_from_pict_18 (pMask, FALSE, &msk_xoff, &msk_yoff);
dest = image_from_pict_18 (pDst, TRUE, &dst_xoff, &dst_yoff);
if (src && dest && !(pMask && !mask))
{
pixman_image_composite (op, src, mask, dest,
xSrc, ySrc, xMask, yMask, xDst, yDst,
xSrc + src_xoff, ySrc + src_yoff,
xMask + msk_xoff, yMask + msk_yoff,
xDst + dst_xoff, yDst + dst_yoff,
width, height);
}
@ -268,80 +273,24 @@ create_conical_gradient_image (PictGradient *gradient)
gradient->nstops);
}
static DrawablePtr
copy_drawable (DrawablePtr pDraw)
{
ScreenPtr pScreen = pDraw->pScreen;
PixmapPtr pPixmap;
GCPtr pGC;
int width, height;
ChangeGCVal gcv[2];
width = pDraw->width;
height = pDraw->height;
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pDraw->depth, 0);
if (!pPixmap)
return NULL;
pGC = GetScratchGC (pDraw->depth, pScreen);
if (!pGC)
{
(*pScreen->DestroyPixmap) (pPixmap);
return NULL;
}
/* First fill the pixmap with zeros */
gcv[0].val = 0x00000000;
gcv[1].val = IncludeInferiors;
dixChangeGC (NullClient, pGC, GCBackground | GCSubwindowMode, NULL, gcv);
ValidateGC ((DrawablePtr)pPixmap, pGC);
miClearDrawable ((DrawablePtr)pPixmap, pGC);
/* Then copy the window there */
ValidateGC(&pPixmap->drawable, pGC);
(* pGC->ops->CopyArea) (pDraw, &pPixmap->drawable, pGC, 0, 0, width, height, 0, 0);
FreeScratchGC (pGC);
return &pPixmap->drawable;
}
static void
destroy_drawable (pixman_image_t *image, void *data)
{
DrawablePtr pDrawable = data;
ScreenPtr pScreen = pDrawable->pScreen;
pScreen->DestroyPixmap ((PixmapPtr)pDrawable);
}
static pixman_image_t *
create_bits_picture (PicturePtr pict,
Bool has_clip,
Bool is_src)
Bool has_clip,
int *xoff,
int *yoff)
{
PixmapPtr pixmap;
FbBits *bits;
FbStride stride;
int bpp, xoff, yoff;
int bpp;
pixman_image_t *image;
DrawablePtr drawable;
if (is_src && pict->pDrawable->type == DRAWABLE_WINDOW)
drawable = copy_drawable (pict->pDrawable);
else
drawable = pict->pDrawable;
fbGetDrawable (drawable, bits, stride, bpp, xoff, yoff);
bits = (FbBits*)((CARD8*)bits +
(drawable->y + yoff) * stride * sizeof(FbBits) +
(drawable->x + xoff) * (bpp / 8));
fbGetDrawablePixmap (pict->pDrawable, pixmap, *xoff, *yoff);
fbGetPixmapBitsData(pixmap, bits, stride, bpp);
image = pixman_image_create_bits (
pict->format, drawable->width, drawable->height,
pict->format,
pixmap->drawable.width, pixmap->drawable.height,
(uint32_t *)bits, stride * sizeof (FbStride));
@ -359,59 +308,60 @@ create_bits_picture (PicturePtr pict,
#endif
#endif
/* pCompositeClip is undefined for source pictures, so
* only set the clip region for pictures with drawables
*/
if (has_clip)
{
if (is_src)
{
if (pict->clientClipType != CT_NONE)
{
pixman_image_set_has_client_clip (image, TRUE);
if (pict->clientClipType != CT_NONE)
pixman_image_set_has_client_clip (image, TRUE);
pixman_region_translate (pict->clientClip,
pict->clipOrigin.x,
pict->clipOrigin.y);
pixman_image_set_clip_region (image, pict->clientClip);
if (*xoff || *yoff)
pixman_region_translate (pict->pCompositeClip, *xoff, *yoff);
pixman_region_translate (pict->clientClip,
- pict->clipOrigin.x,
- pict->clipOrigin.y);
}
}
else
{
pixman_region_translate (pict->pCompositeClip,
- pict->pDrawable->x,
- pict->pDrawable->y);
pixman_image_set_clip_region (image, pict->pCompositeClip);
pixman_image_set_clip_region (image, pict->pCompositeClip);
pixman_region_translate (pict->pCompositeClip,
pict->pDrawable->x,
pict->pDrawable->y);
}
if (*xoff || *yoff)
pixman_region_translate (pict->pCompositeClip, -*xoff, -*yoff);
}
/* Indexed table */
if (pict->pFormat->index.devPrivate)
pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
if (drawable != pict->pDrawable)
pixman_image_set_destroy_function (image, destroy_drawable, drawable);
/* Add in drawable origin to position within the image */
*xoff += pict->pDrawable->x;
*yoff += pict->pDrawable->y;
return image;
}
static void
set_image_properties (pixman_image_t *image, PicturePtr pict)
set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
{
pixman_repeat_t repeat;
pixman_filter_t filter;
if (pict->transform)
{
pixman_image_set_transform (
image, (pixman_transform_t *)pict->transform);
/* For source images, adjust the transform to account
* for the drawable offset within the pixman image,
* then set the offset to 0 as it will be used
* to compute positions within the transformed image.
*/
if (!has_clip) {
struct pixman_transform adjusted;
adjusted = *pict->transform;
pixman_transform_translate(&adjusted,
NULL,
pixman_int_to_fixed(*xoff),
pixman_int_to_fixed(*yoff));
pixman_image_set_transform (image, &adjusted);
*xoff = 0;
*yoff = 0;
} else
pixman_image_set_transform (image, pict->transform);
}
switch (pict->repeatType)
@ -438,7 +388,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
if (pict->alphaMap)
{
pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, TRUE, TRUE);
int alpha_xoff, alpha_yoff;
pixman_image_t *alpha_map = image_from_pict_18 (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff);
pixman_image_set_alpha_map (
image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@ -470,10 +421,9 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
pixman_image_set_source_clipping (image, TRUE);
}
pixman_image_t *
image_from_pict (PicturePtr pict,
Bool has_clip,
Bool is_src)
image_from_pict_18 (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
{
pixman_image_t *image = NULL;
@ -482,7 +432,7 @@ image_from_pict (PicturePtr pict,
if (pict->pDrawable)
{
image = create_bits_picture (pict, has_clip, is_src);
image = create_bits_picture (pict, has_clip, xoff, yoff);
}
else if (pict->pSourcePict)
{
@ -503,14 +453,22 @@ image_from_pict (PicturePtr pict,
else if (sp->type == SourcePictTypeConical)
image = create_conical_gradient_image (gradient);
}
*xoff = *yoff = 0;
}
if (image)
set_image_properties (image, pict);
set_image_properties (image, pict, has_clip, xoff, yoff);
return image;
}
pixman_image_t *
image_from_pict (PicturePtr pict, Bool has_clip, Bool is_src)
{
int xoff = 0, yoff = 0;
return image_from_pict_18(pict, has_clip, &xoff, &yoff);
}
void
free_pixman_pict (PicturePtr pict, pixman_image_t *image)
{
@ -540,3 +498,4 @@ fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
return TRUE;
}

View File

@ -40,7 +40,8 @@ fbAddTraps (PicturePtr pPicture,
int ntrap,
xTrap *traps)
{
pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
int image_xoff, image_yoff;
pixman_image_t *image = image_from_pict_18 (pPicture, FALSE, &image_xoff, &image_yoff);
if (!image)
return;
@ -56,7 +57,8 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
int x_off,
int y_off)
{
pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
int mask_xoff, mask_yoff;
pixman_image_t *image = image_from_pict_18 (pPicture, FALSE, &mask_xoff, &mask_yoff);
if (!image)
return;

View File

@ -187,4 +187,5 @@
#define fbZeroSegment wfbZeroSegment
#define free_pixman_pict wfb_free_pixman_pict
#define image_from_pict wfb_image_from_pict
#define image_from_pict_18 wfb_image_from_pict_18
#define composeFunctions wfbComposeFunctions

View File

@ -114,10 +114,15 @@ warn(void)
}
}
#if defined(__GNUC__) && (__GNUC__ > 2)
#define possibly_unused __attribute((unused))
#else
#define possibly_unused
#endif
#define KEYWORD1 static
#define KEYWORD1_ALT static
#define KEYWORD2 GLAPIENTRY
#define KEYWORD2 GLAPIENTRY possibly_unused
#define NAME(func) NoOp##func
#define F NULL

View File

@ -58,7 +58,7 @@ validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err)
/*
** Check if screen exists.
*/
if (screen >= screenInfo.numScreens) {
if (screen < 0 || screen >= screenInfo.numScreens) {
client->errorValue = screen;
*err = BadValue;
return FALSE;
@ -312,11 +312,14 @@ DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXCreateContextReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
@ -328,11 +331,14 @@ int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXCreateNewContextReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
@ -344,12 +350,15 @@ int __glXDisp_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateContextWithConfigSGIXReq *req =
(xGLXCreateContextWithConfigSGIXReq *) pc;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
@ -360,10 +369,13 @@ int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
}
int __glXDisp_DestroyContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
__GLXcontext *glxc;
int err;
REQUEST_SIZE_MATCH(xGLXDestroyContextReq);
if (!validGlxContext(cl->client, req->context, DixDestroyAccess,
&glxc, &err))
return err;
@ -675,24 +687,33 @@ DoMakeCurrent(__GLXclientState *cl,
int __glXDisp_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReq);
return DoMakeCurrent( cl, req->drawable, req->drawable,
req->context, req->oldContextTag );
}
int __glXDisp_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq);
return DoMakeCurrent( cl, req->drawable, req->readdrawable,
req->context, req->oldContextTag );
}
int __glXDisp_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq);
return DoMakeCurrent( cl, req->drawable, req->readable,
req->context, req->oldContextTag );
}
@ -705,6 +726,8 @@ int __glXDisp_IsDirect(__GLXclientState *cl, GLbyte *pc)
__GLXcontext *glxc;
int err;
REQUEST_SIZE_MATCH(xGLXIsDirectReq);
if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err))
return err;
@ -729,6 +752,8 @@ int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc)
xGLXQueryVersionReply reply;
GLuint major, minor;
REQUEST_SIZE_MATCH(xGLXQueryVersionReq);
major = req->majorVersion;
minor = req->minorVersion;
(void)major;
@ -755,11 +780,15 @@ int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc;
GLXContextTag tag = req->contextTag;
GLXContextTag tag;
__GLXcontext *glxc = NULL;
int error;
REQUEST_SIZE_MATCH(xGLXWaitGLReq);
tag = req->contextTag;
if (tag) {
glxc = __glXLookupContextByTag(cl, tag);
if (!glxc)
@ -779,11 +808,15 @@ int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_WaitX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXWaitXReq *req = (xGLXWaitXReq *)pc;
GLXContextTag tag = req->contextTag;
GLXContextTag tag;
__GLXcontext *glxc = NULL;
int error;
REQUEST_SIZE_MATCH(xGLXWaitXReq);
tag = req->contextTag;
if (tag) {
glxc = __glXLookupContextByTag(cl, tag);
if (!glxc)
@ -803,13 +836,19 @@ int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
GLXContextID source = req->source;
GLXContextID dest = req->dest;
GLXContextTag tag = req->contextTag;
unsigned long mask = req->mask;
GLXContextID source;
GLXContextID dest;
GLXContextTag tag;
unsigned long mask;
__GLXcontext *src, *dst;
int error;
REQUEST_SIZE_MATCH(xGLXCopyContextReq);
source = req->source;
dest = req->dest;
tag = req->contextTag;
mask = req->mask;
if (!validGlxContext(cl->client, source, DixReadAccess, &src, &error))
return error;
if (!validGlxContext(cl->client, dest, DixWriteAccess, &dst, &error))
@ -892,6 +931,8 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
@ -1071,13 +1112,18 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen)
int __glXDisp_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq);
return DoGetFBConfigs(cl, req->screen);
}
int __glXDisp_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
/* work around mesa bug, don't use REQUEST_SIZE_MATCH */
REQUEST_AT_LEAST_SIZE(xGLXGetFBConfigsSGIXReq);
return DoGetFBConfigs(cl, req->screen);
}
@ -1203,11 +1249,14 @@ determineTextureTarget(ClientPtr client, XID glxDrawableID,
int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
@ -1219,11 +1268,19 @@ int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
@ -1242,12 +1299,15 @@ int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateGLXPixmapWithConfigSGIXReq *req =
(xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
@ -1274,15 +1334,23 @@ static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type)
int __glXDisp_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq);
return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
}
int __glXDisp_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc;
/* should be REQUEST_SIZE_MATCH, but mesa's glXDestroyPixmap used to set
* length to 3 instead of 2 */
REQUEST_AT_LEAST_SIZE(xGLXDestroyPixmapReq);
return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
}
@ -1311,10 +1379,18 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
CARD32 *attrs;
int width, height, i;
REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3);
attrs = (CARD32 *) (req + 1);
width = 0;
height = 0;
@ -1340,23 +1416,32 @@ int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq);
return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
req->width, req->height, req->pbuffer);
}
int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq);
return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
}
int __glXDisp_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq);
return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
}
@ -1387,18 +1472,40 @@ DoChangeDrawableAttributes(ClientPtr client, XID glxdrawable,
int __glXDisp_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXChangeDrawableAttributesReq *req =
(xGLXChangeDrawableAttributesReq *) pc;
REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
#if 0
/* mesa sends an additional 8 bytes */
REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesReq, req->numAttribs << 3);
#else
if (((sizeof(xGLXChangeDrawableAttributesReq) + (req->numAttribs << 3)) >> 2) < client->req_len)
return BadLength;
#endif
return DoChangeDrawableAttributes(cl->client, req->drawable,
req->numAttribs, (CARD32 *) (req + 1));
}
int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXChangeDrawableAttributesSGIXReq *req =
(xGLXChangeDrawableAttributesSGIXReq *)pc;
REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3);
return DoChangeDrawableAttributes(cl->client, req->drawable,
req->numAttribs, (CARD32 *) (req + 1));
}
@ -1412,6 +1519,13 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc)
DrawablePtr pDraw;
int err;
REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3);
if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxFBConfig(client, pGlxScreen, req->fbconfig, &config, &err))
@ -1432,8 +1546,12 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
/* mesa's glXDestroyWindow used to set length to 3 instead of 2 */
REQUEST_AT_LEAST_SIZE(xGLXDestroyWindowReq);
return DoDestroyDrawable(cl, req->glxwindow, GLX_DRAWABLE_WINDOW);
}
@ -1449,12 +1567,16 @@ int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
GLXContextTag tag = req->contextTag;
XID drawId = req->drawable;
GLXContextTag tag;
XID drawId;
__GLXcontext *glxc = NULL;
__GLXdrawable *pGlxDraw;
int error;
REQUEST_SIZE_MATCH(xGLXSwapBuffersReq);
tag = req->contextTag;
drawId = req->drawable;
if (tag) {
glxc = __glXLookupContextByTag(cl, tag);
if (!glxc) {
@ -1535,15 +1657,21 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
int __glXDisp_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq);
return DoQueryContext(cl, req->context);
}
int __glXDisp_QueryContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
REQUEST_SIZE_MATCH(xGLXQueryContextReq);
return DoQueryContext(cl, req->context);
}
@ -1556,11 +1684,21 @@ int __glXDisp_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
GLXDrawable drawId;
int buffer;
int error;
CARD32 num_attribs;
if ((sizeof(xGLXVendorPrivateReq) + 12) >> 2 > client->req_len)
return BadLength;
pc += __GLX_VENDPRIV_HDR_SIZE;
drawId = *((CARD32 *) (pc));
buffer = *((INT32 *) (pc + 4));
num_attribs = *((CARD32 *) (pc + 8));
if (num_attribs > (UINT32_MAX >> 3)) {
client->errorValue = num_attribs;
return BadValue;
}
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 12 + (num_attribs << 3));
if (buffer != GLX_FRONT_LEFT_EXT)
return __glXError(GLXBadPixmap);
@ -1591,6 +1729,8 @@ int __glXDisp_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
int buffer;
int error;
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8);
pc += __GLX_VENDPRIV_HDR_SIZE;
drawId = *((CARD32 *) (pc));
@ -1626,6 +1766,8 @@ int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
(void) client;
(void) req;
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20);
pc += __GLX_VENDPRIV_HDR_SIZE;
drawId = *((CARD32 *) (pc));
@ -1714,16 +1856,23 @@ DoGetDrawableAttributes(__GLXclientState *cl, XID drawId)
int __glXDisp_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
/* this should be REQUEST_SIZE_MATCH, but mesa sends an additional 4 bytes */
REQUEST_AT_LEAST_SIZE(xGLXGetDrawableAttributesReq);
return DoGetDrawableAttributes(cl, req->drawable);
}
int __glXDisp_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetDrawableAttributesSGIXReq *req =
(xGLXGetDrawableAttributesSGIXReq *)pc;
REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq);
return DoGetDrawableAttributes(cl, req->drawable);
}
@ -1748,6 +1897,8 @@ int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc)
__GLXcontext *glxc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXRenderReq);
req = (xGLXRenderReq *) pc;
if (client->swapped) {
__GLX_SWAP_SHORT(&req->length);
@ -1768,6 +1919,9 @@ int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc)
__GLXdispatchRenderProcPtr proc;
int err;
if (left < sizeof(__GLXrenderHeader))
return BadLength;
/*
** Verify that the header length and the overall length agree.
** Also, each command must be word aligned.
@ -2278,10 +2432,12 @@ int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_VendorPrivate(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
GLint vendorcode = req->vendorCode;
__GLXdispatchVendorPrivProcPtr proc;
REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq);
proc = (__GLXdispatchVendorPrivProcPtr)
__glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
@ -2297,10 +2453,12 @@ int __glXDisp_VendorPrivate(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
GLint vendorcode = req->vendorCode;
__GLXdispatchVendorPrivProcPtr proc;
REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq);
proc = (__GLXdispatchVendorPrivProcPtr)
__glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
@ -2323,6 +2481,8 @@ int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
char *buf;
int err;
REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq);
if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
return err;
@ -2361,6 +2521,8 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
return err;
@ -2404,14 +2566,20 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_ClientInfo(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc;
const char *buf;
REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq);
buf = (const char *)(req+1);
if (!memchr(buf, 0, (client->req_len << 2) - sizeof(xGLXClientInfoReq)))
return BadLength;
cl->GLClientmajorVersion = req->major;
cl->GLClientminorVersion = req->minor;
if (cl->GLClientextensions)
xfree(cl->GLClientextensions);
buf = (const char *)(req+1);
cl->GLClientextensions = xstrdup(buf);
return Success;

View File

@ -61,9 +61,12 @@
int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateContextReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->visual);
@ -75,9 +78,12 @@ int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateNewContextReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig);
@ -90,10 +96,13 @@ int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateContextWithConfigSGIXReq *req =
(xGLXCreateContextWithConfigSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig);
@ -106,9 +115,12 @@ int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXDestroyContextReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
@ -117,9 +129,12 @@ int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->context);
@ -130,9 +145,12 @@ int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->readdrawable);
@ -144,9 +162,12 @@ int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->readable);
@ -158,9 +179,12 @@ int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXIsDirectReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
@ -169,9 +193,12 @@ int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_QueryVersion(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryVersionReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->majorVersion);
__GLX_SWAP_INT(&req->minorVersion);
@ -181,9 +208,12 @@ int __glXDispSwap_QueryVersion(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_WaitGL(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXWaitGLReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
@ -192,9 +222,12 @@ int __glXDispSwap_WaitGL(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_WaitX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXWaitXReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
@ -203,9 +236,12 @@ int __glXDispSwap_WaitX(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_CopyContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCopyContextReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->source);
__GLX_SWAP_INT(&req->dest);
@ -216,36 +252,48 @@ int __glXDispSwap_CopyContext(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq);
__GLX_SWAP_INT(&req->screen);
return __glXDisp_GetVisualConfigs(cl, pc);
}
int __glXDispSwap_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq);
__GLX_SWAP_INT(&req->screen);
return __glXDisp_GetFBConfigs(cl, pc);
}
int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXGetFBConfigsSGIXReq);
__GLX_SWAP_INT(&req->screen);
return __glXDisp_GetFBConfigsSGIX(cl, pc);
}
int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->visual);
@ -257,29 +305,41 @@ int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
CARD32 *attribs;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
__GLX_SWAP_INT(&req->numAttribs);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3);
attribs = (CARD32*)(req + 1);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
return __glXDisp_CreatePixmap(cl, pc);
}
int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateGLXPixmapWithConfigSGIXReq *req =
(xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
@ -291,9 +351,12 @@ int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc
int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->glxpixmap);
@ -302,9 +365,12 @@ int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXDestroyGLXPixmapReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->glxpixmap);
@ -313,9 +379,12 @@ int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryContextReq);
__GLX_SWAP_INT(&req->context);
return __glXDisp_QueryContext(cl, pc);
@ -323,26 +392,38 @@ int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
CARD32 *attribs;
REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pbuffer);
__GLX_SWAP_INT(&req->numAttribs);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3);
attribs = (CARD32*)(req + 1);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
return __glXDisp_CreatePbuffer(cl, pc);
}
int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pbuffer);
@ -354,9 +435,12 @@ int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
{
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) req;
ClientPtr client = cl->client;
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq);
__GLX_SWAP_INT(&req->pbuffer);
return __glXDisp_DestroyPbuffer(cl, pc);
@ -364,9 +448,12 @@ int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) req;
ClientPtr client = cl->client;
xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq);
__GLX_SWAP_INT(&req->pbuffer);
return __glXDisp_DestroyGLXPbufferSGIX(cl, pc);
@ -374,16 +461,27 @@ int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXChangeDrawableAttributesReq *req =
(xGLXChangeDrawableAttributesReq *) req;
(xGLXChangeDrawableAttributesReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
CARD32 *attribs;
REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->numAttribs);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
if (((sizeof(xGLXChangeDrawableAttributesReq) + (req->numAttribs << 3)) >> 2) < client->req_len)
return BadLength;
attribs = (CARD32*)(req + 1);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
return __glXDisp_ChangeDrawableAttributes(cl, pc);
}
@ -391,43 +489,64 @@ int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl,
GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXChangeDrawableAttributesSGIXReq *req =
(xGLXChangeDrawableAttributesSGIXReq *) req;
(xGLXChangeDrawableAttributesSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
CARD32 *attribs;
REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->numAttribs);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3);
attribs = (CARD32*)(req + 1);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
return __glXDisp_ChangeDrawableAttributesSGIX(cl, pc);
}
int __glXDispSwap_CreateWindow(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
CARD32 *attribs;
REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->window);
__GLX_SWAP_INT(&req->glxwindow);
__GLX_SWAP_INT(&req->numAttribs);
if (req->numAttribs > (UINT32_MAX >> 3)) {
client->errorValue = req->numAttribs;
return BadValue;
}
REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3);
attribs = (CARD32*)(req + 1);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
__GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
return __glXDisp_CreateWindow(cl, pc);
}
int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXDestroyWindowReq);
__GLX_SWAP_INT(&req->glxwindow);
return __glXDisp_DestroyWindow(cl, pc);
@ -435,9 +554,12 @@ int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXSwapBuffersReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->drawable);
@ -447,9 +569,12 @@ int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_UseXFont(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXUseXFontReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->font);
@ -463,9 +588,12 @@ int __glXDispSwap_UseXFont(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *)pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
@ -474,9 +602,12 @@ int __glXDispSwap_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_QueryServerString(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->name);
@ -486,9 +617,12 @@ int __glXDispSwap_QueryServerString(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_ClientInfo(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->major);
__GLX_SWAP_INT(&req->minor);
@ -499,9 +633,12 @@ int __glXDispSwap_ClientInfo(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
@ -510,33 +647,41 @@ int __glXDispSwap_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
GLXDrawable *drawId;
int *buffer;
CARD32 *num_attribs;
__GLX_DECLARE_SWAP_VARIABLES;
if ((sizeof(xGLXVendorPrivateReq) + 12) >> 2 > client->req_len)
return BadLength;
pc += __GLX_VENDPRIV_HDR_SIZE;
drawId = ((GLXDrawable *) (pc));
buffer = ((int *) (pc + 4));
num_attribs = ((CARD32 *) (pc + 8));
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(drawId);
__GLX_SWAP_INT(buffer);
__GLX_SWAP_INT(num_attribs);
return __glXDisp_BindTexImageEXT(cl, (GLbyte *)pc);
}
int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
GLXDrawable *drawId;
int *buffer;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8);
pc += __GLX_VENDPRIV_HDR_SIZE;
drawId = ((GLXDrawable *) (pc));
@ -552,12 +697,14 @@ int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
GLXDrawable *drawId;
int *buffer;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20);
(void) drawId;
(void) buffer;
@ -577,11 +724,13 @@ int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXVendorPrivateWithReplyReq *req = (xGLXVendorPrivateWithReplyReq *)pc;
CARD32 *data;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq);
data = (CARD32 *) (req + 1);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
@ -592,10 +741,12 @@ int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
int __glXDispSwap_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_AT_LEAST_SIZE(xGLXGetDrawableAttributesReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);

View File

@ -863,12 +863,21 @@ static const char dri_driver_path[] = DRI_DRIVER_PATH;
static Bool
glxDRIEnterVT (int index, int flags)
{
ScrnInfoPtr scrn = xf86Screens[index];
Bool ret;
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
if (!(*screen->enterVT) (index, flags))
scrn->EnterVT = screen->enterVT;
ret = scrn->EnterVT (index, flags);
screen->enterVT = scrn->EnterVT;
scrn->EnterVT = glxDRIEnterVT;
if (!ret)
return FALSE;
glxResumeClients();
@ -879,6 +888,7 @@ glxDRIEnterVT (int index, int flags)
static void
glxDRILeaveVT (int index, int flags)
{
ScrnInfoPtr scrn = xf86Screens[index];
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
@ -886,7 +896,10 @@ glxDRILeaveVT (int index, int flags)
glxSuspendClients();
return (*screen->leaveVT) (index, flags);
scrn->LeaveVT = screen->leaveVT;
(*screen->leaveVT) (index, flags);
screen->leaveVT = scrn->LeaveVT;
scrn->LeaveVT = glxDRILeaveVT;
}
static void

View File

@ -512,12 +512,21 @@ static const char dri_driver_path[] = DRI_DRIVER_PATH;
static Bool
glxDRIEnterVT (int index, int flags)
{
ScrnInfoPtr scrn = xf86Screens[index];
Bool ret;
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
if (!(*screen->enterVT) (index, flags))
scrn->EnterVT = screen->enterVT;
ret = scrn->EnterVT (index, flags);
screen->enterVT = scrn->EnterVT;
scrn->EnterVT = glxDRIEnterVT;
if (!ret)
return FALSE;
glxResumeClients();
@ -528,6 +537,7 @@ glxDRIEnterVT (int index, int flags)
static void
glxDRILeaveVT (int index, int flags)
{
ScrnInfoPtr scrn = xf86Screens[index];
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
@ -535,7 +545,10 @@ glxDRILeaveVT (int index, int flags)
glxSuspendClients();
return (*screen->leaveVT) (index, flags);
scrn->LeaveVT = screen->leaveVT;
(*screen->leaveVT) (index, flags);
screen->leaveVT = scrn->LeaveVT;
scrn->LeaveVT = glxDRILeaveVT;
}
static void

View File

@ -250,12 +250,8 @@ GLint glxConvertToXVisualType(int visualType)
static VisualPtr
AddScreenVisuals(ScreenPtr pScreen, int count, int d)
{
XID *installedCmaps, *vids, vid;
int numInstalledCmaps, numVisuals, i, j;
VisualPtr visuals;
ColormapPtr installedCmap;
int i;
DepthPtr depth;
int rc;
depth = NULL;
for (i = 0; i < pScreen->numDepths; i++) {
@ -267,56 +263,8 @@ AddScreenVisuals(ScreenPtr pScreen, int count, int d)
if (depth == NULL)
return NULL;
/* Find the installed colormaps */
installedCmaps = xalloc (pScreen->maxInstalledCmaps * sizeof (XID));
if (!installedCmaps)
return NULL;
numInstalledCmaps = pScreen->ListInstalledColormaps(pScreen, installedCmaps);
/* realloc the visual array to fit the new one in place */
numVisuals = pScreen->numVisuals;
visuals = xrealloc(pScreen->visuals, (numVisuals + count) * sizeof(VisualRec));
if (!visuals) {
xfree(installedCmaps);
return NULL;
}
vids = xrealloc(depth->vids, (depth->numVids + count) * sizeof(XID));
if (vids == NULL) {
xfree(installedCmaps);
xfree(visuals);
return NULL;
}
/*
* Fix up any existing installed colormaps -- we'll assume that
* the only ones created so far have been installed. If this
* isn't true, we'll have to walk the resource database looking
* for all colormaps.
*/
for (i = 0; i < numInstalledCmaps; i++) {
rc = dixLookupResourceByType((pointer *)&installedCmap,
installedCmaps[i], RT_COLORMAP,
serverClient, DixReadAccess);
if (rc != Success)
continue;
j = installedCmap->pVisual - pScreen->visuals;
installedCmap->pVisual = &visuals[j];
}
xfree(installedCmaps);
for (i = 0; i < count; i++) {
vid = FakeClientID(0);
visuals[pScreen->numVisuals + i].vid = vid;
vids[depth->numVids + i] = vid;
}
pScreen->visuals = visuals;
pScreen->numVisuals += count;
depth->vids = vids;
depth->numVids += count;
if (ResizeVisualArray(pScreen, count, depth) == FALSE)
return NULL;
/* Return a pointer to the first of the added visuals. */
return pScreen->visuals + pScreen->numVisuals - count;

View File

@ -47,7 +47,7 @@
** Fetch a double from potentially unaligned memory.
*/
#ifdef __GLX_ALIGN64
#define __GLX_MEM_COPY(dst,src,n) if (src && dst) memcpy(dst,src,n)
#define __GLX_MEM_COPY(dst,src,n) if (src != NULL && dst != NULL) memcpy(dst,src,n)
#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
#else
#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))

View File

@ -160,6 +160,8 @@ int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc)
__GLXcontext *cx;
int error;
REQUEST_SIZE_MATCH(xGLXUseXFontReq);
req = (xGLXUseXFontReq *) pc;
cx = __glXForceCurrent(cl, req->contextTag, &error);
if (!cx) {

View File

@ -84,10 +84,7 @@ XDMX_LIBS = \
@XDMX_LIBS@ \
$(GLX_LIBS) \
input/libdmxinput.a \
config/libdmxconfig.a \
$(MAIN_LIB) \
$(XSERVER_LIBS) \
$(top_builddir)/xfixes/libxfixes.la
config/libdmxconfig.a
Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
Xdmx_DEPENDENCIES= $(XDMX_LIBS)

View File

@ -72,17 +72,4 @@
/* Enable the DMX extension */
#define DMXEXT
/* Disable the extensions that are not currently supported */
#undef MULTIBUFFER
#undef XV
#undef DBE
#undef XF86VIDMODE
#undef XFreeXDGA
#undef XF86DRI
#undef SCREENSAVER
#undef RANDR
#undef XFIXES
#undef DAMAGE
#undef COMPOSITE
#endif /* DMX_CONFIG_H */

View File

@ -362,7 +362,8 @@ static int ProcDMXGetScreenAttributes(ClientPtr client)
paddedLength = pad_to_int32(length);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.length = bytes_to_int32(paddedLength);
rep.length = bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) - sizeof(xGenericReply))
+ paddedLength);
rep.displayNameLength = length;
if (client->swapped) {

View File

@ -419,10 +419,9 @@ Bool dmxDestroyWindow(WindowPtr pWindow)
pWinPriv->windowDestroyed(pWindow);
#endif
#if 0
if (pScreen->DestroyWindow)
ret = pScreen->DestroyWindow(pWindow);
#endif
DMX_WRAP(DestroyWindow, dmxDestroyWindow, dmxScreen, pScreen);
return ret;

View File

@ -1536,7 +1536,7 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
int i, p;
screen = req->screen;
if (screen > screenInfo.numScreens) {
if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
@ -2685,7 +2685,7 @@ int __glXGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
int numFBConfigs, i, p;
__GLXscreenInfo *pGlxScreen;
if (screen > screenInfo.numScreens) {
if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
@ -3106,7 +3106,7 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
/*
** Look up screen and FBConfig.
*/
if (screen > screenInfo.numScreens) {
if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;

View File

@ -251,7 +251,7 @@ int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->screen);
screen = req->screen;
if (screen > screenInfo.numScreens) {
if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;

View File

@ -183,7 +183,7 @@ static void enqueueMotion(DevicePtr pDev, int x, int y)
GetEventList(&events);
nevents = GetPointerEvents(events, p, MotionNotify, detail,
POINTER_ABSOLUTE, 0, 2, valuators);
POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, (InternalEvent*)(events + i)->event);
return;
@ -688,7 +688,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
detail = dmxGetButtonMapping(dmxLocal, detail);
GetEventList(&events);
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE,
POINTER_ABSOLUTE | POINTER_SCREEN,
0, /* first_valuator = 0 */
0, /* num_valuators = 0 */
valuators);
@ -700,9 +700,9 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
GetEventList(&events);
valuators[0] = e->xmotion.x;
valuators[1] = e->xmotion.y;
valuators[2] = e->xmotion.state;
valuators[2] = e->xmotion.state; /* FIXME: WTF?? */
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE, 0, 3, valuators);
POINTER_ABSOLUTE | POINTER_SCREEN, 0, 3, valuators);
for (i = 0; i < nevents; i++)
mieqEnqueue(p, (InternalEvent*)(events + i)->event);
return;

View File

@ -474,9 +474,9 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
Relative);
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, axis_labels[i],
info.minval[0], info.maxval[0],
info.res[0],
info.minres[0], info.maxres[0]);
info.minval[i], info.maxval[i],
info.res[i],
info.minres[i], info.maxres[i]);
} else if (info.numRelAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
axis_labels,
@ -484,20 +484,20 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
Relative);
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, axis_labels[i],
info.minval[0],
info.maxval[0], info.res[0],
info.minres[0], info.maxres[0]);
info.minval[i],
info.maxval[i], info.res[i],
info.minres[i], info.maxres[i]);
} else if (info.numAbsAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numAbsAxes,
axis_labels,
dmxPointerGetMotionBufferSize(),
Absolute);
for (i = 0; i < info.numAbsAxes; i++)
InitValuatorAxisStruct(pDevice, i+info.numRelAxes,
axis_labels[i + info.numRelAxes],
info.minval[i+1], info.maxval[i+1],
info.res[i+1], info.minres[i+1],
info.maxres[i+1]);
InitValuatorAxisStruct(pDevice, i,
axis_labels[i],
info.minval[i], info.maxval[i],
info.res[i], info.minres[i],
info.maxres[i]);
}
}
if (info.focusClass) InitFocusClassDeviceStruct(pDevice);

View File

@ -46,6 +46,11 @@ sets the screen size.
.BI -parent " id"
uses exiting window
.I id .
If a
.BI -screen
argument follows a
.BI -parent
argument, this screen is embedded into the given window.
.TP 8
.B -host-cursor
set 'cursor acceleration':

View File

@ -1074,6 +1074,8 @@ MouseInit (KdPointerInfo *pi)
((EphyrPointerPrivate *)pi->driverPrivate)->enabled = FALSE;
pi->nAxes = 3;
pi->nButtons = 32;
if (pi->name)
xfree(pi->name);
pi->name = strdup("Xephyr virtual mouse");
ephyrMouse = pi;
return Success;
@ -1123,6 +1125,8 @@ EphyrKeyboardInit (KdKeyboardInfo *ki)
}
ki->minScanCode = ephyrKeySyms.minKeyCode;
ki->maxScanCode = ephyrKeySyms.maxKeyCode;
if (ki->name)
xfree(ki->name);
ki->name = strdup("Xephyr virtual keyboard");
ephyrKbd = ki;
return Success;

View File

@ -470,7 +470,7 @@ EphyrDuplicateVisual (unsigned int a_screen,
int i=0 ;
EPHYR_LOG ("enter\n") ;
if (a_screen > screenInfo.numScreens) {
if (a_screen >= screenInfo.numScreens) {
EPHYR_LOG_ERROR ("bad screen number\n") ;
goto out;
}

View File

@ -148,6 +148,7 @@ processScreenArg (char *screen_size, char *parent_id)
int
ddxProcessArgument (int argc, char **argv, int i)
{
static char* parent = NULL;
EPHYR_DBG("mark argv[%d]='%s'", i, argv[i] );
if (i == 1)
@ -159,6 +160,18 @@ ddxProcessArgument (int argc, char **argv, int i)
{
if(i+1 < argc)
{
int j;
/* If parent is specified and a screen argument follows, don't do
* anything, let the -screen handling init the rest */
for (j = i; j < argc; j++)
{
if (!strcmp(argv[j], "-screen"))
{
parent = argv[i + 1];
return 2;
}
}
processScreenArg ("100x100", argv[i+1]);
return 2;
}
@ -170,7 +183,8 @@ ddxProcessArgument (int argc, char **argv, int i)
{
if ((i+1) < argc)
{
processScreenArg (argv[i+1], NULL);
processScreenArg (argv[i+1], parent);
parent = NULL;
return 2;
}

View File

@ -18,10 +18,9 @@ Xfake_SOURCES = \
Xfake_LDADD = \
libfake.la \
@KDRIVE_LIBS@ \
@XSERVER_LIBS@
@KDRIVE_LIBS@
Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -Wl,-undefined=InitExtensions
Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
Xfake_DEPENDENCIES = \
libfake.la \

View File

@ -28,142 +28,11 @@
#define FAKE_WIDTH 2
KeySym FakeKeymap[] = {
/* 1 8 */ XK_Escape, NoSymbol,
/* 2 9 */ XK_1, XK_exclam,
/* 3 10 */ XK_2, XK_at,
/* 4 11 */ XK_3, XK_numbersign,
/* 5 12 */ XK_4, XK_dollar,
/* 6 13 */ XK_5, XK_percent,
/* 7 14 */ XK_6, XK_asciicircum,
/* 8 15 */ XK_7, XK_ampersand,
/* 9 16 */ XK_8, XK_asterisk,
/* 10 17 */ XK_9, XK_parenleft,
/* 11 18 */ XK_0, XK_parenright,
/* 12 19 */ XK_minus, XK_underscore,
/* 13 20 */ XK_equal, XK_plus,
/* 14 21 */ XK_BackSpace, NoSymbol,
/* 15 22 */ XK_Tab, NoSymbol,
/* 16 23 */ XK_Q, NoSymbol,
/* 17 24 */ XK_W, NoSymbol,
/* 18 25 */ XK_E, NoSymbol,
/* 19 26 */ XK_R, NoSymbol,
/* 20 27 */ XK_T, NoSymbol,
/* 21 28 */ XK_Y, NoSymbol,
/* 22 29 */ XK_U, NoSymbol,
/* 23 30 */ XK_I, NoSymbol,
/* 24 31 */ XK_O, NoSymbol,
/* 25 32 */ XK_P, NoSymbol,
/* 26 33 */ XK_bracketleft, XK_braceleft,
/* 27 34 */ XK_bracketright, XK_braceright,
/* 28 35 */ XK_Return, NoSymbol,
/* 29 36 */ XK_Control_L, NoSymbol,
/* 30 37 */ XK_A, NoSymbol,
/* 31 38 */ XK_S, NoSymbol,
/* 32 39 */ XK_D, NoSymbol,
/* 33 40 */ XK_F, NoSymbol,
/* 34 41 */ XK_G, NoSymbol,
/* 35 42 */ XK_H, NoSymbol,
/* 36 43 */ XK_J, NoSymbol,
/* 37 44 */ XK_K, NoSymbol,
/* 38 45 */ XK_L, NoSymbol,
/* 39 46 */ XK_semicolon, XK_colon,
/* 40 47 */ XK_apostrophe, XK_quotedbl,
/* 41 48 */ XK_grave, XK_asciitilde,
/* 42 49 */ XK_Shift_L, NoSymbol,
/* 43 50 */ XK_backslash, XK_bar,
/* 44 51 */ XK_Z, NoSymbol,
/* 45 52 */ XK_X, NoSymbol,
/* 46 53 */ XK_C, NoSymbol,
/* 47 54 */ XK_V, NoSymbol,
/* 48 55 */ XK_B, NoSymbol,
/* 49 56 */ XK_N, NoSymbol,
/* 50 57 */ XK_M, NoSymbol,
/* 51 58 */ XK_comma, XK_less,
/* 52 59 */ XK_period, XK_greater,
/* 53 60 */ XK_slash, XK_question,
/* 54 61 */ XK_Shift_R, NoSymbol,
/* 55 62 */ XK_KP_Multiply, NoSymbol,
/* 56 63 */ XK_Alt_L, XK_Meta_L,
/* 57 64 */ XK_space, NoSymbol,
/* 58 65 */ XK_Caps_Lock, NoSymbol,
/* 59 66 */ XK_F1, NoSymbol,
/* 60 67 */ XK_F2, NoSymbol,
/* 61 68 */ XK_F3, NoSymbol,
/* 62 69 */ XK_F4, NoSymbol,
/* 63 70 */ XK_F5, NoSymbol,
/* 64 71 */ XK_F6, NoSymbol,
/* 65 72 */ XK_F7, NoSymbol,
/* 66 73 */ XK_F8, NoSymbol,
/* 67 74 */ XK_F9, NoSymbol,
/* 68 75 */ XK_F10, NoSymbol,
/* 69 76 */ XK_Break, XK_Pause,
/* 70 77 */ XK_Scroll_Lock, NoSymbol,
/* 71 78 */ XK_KP_Home, XK_KP_7,
/* 72 79 */ XK_KP_Up, XK_KP_8,
/* 73 80 */ XK_KP_Page_Up, XK_KP_9,
/* 74 81 */ XK_KP_Subtract, NoSymbol,
/* 75 82 */ XK_KP_Left, XK_KP_4,
/* 76 83 */ XK_KP_5, NoSymbol,
/* 77 84 */ XK_KP_Right, XK_KP_6,
/* 78 85 */ XK_KP_Add, NoSymbol,
/* 79 86 */ XK_KP_End, XK_KP_1,
/* 80 87 */ XK_KP_Down, XK_KP_2,
/* 81 88 */ XK_KP_Page_Down, XK_KP_3,
/* 82 89 */ XK_KP_Insert, XK_KP_0,
/* 83 90 */ XK_KP_Delete, XK_KP_Decimal,
/* 84 91 */ NoSymbol, NoSymbol,
/* 85 92 */ NoSymbol, NoSymbol,
/* 86 93 */ NoSymbol, NoSymbol,
/* 87 94 */ XK_F11, NoSymbol,
/* 88 95 */ XK_F12, NoSymbol,
/* These are remapped from the extended set (using ExtendMap) */
/* 89 96 */ XK_Control_R, NoSymbol,
/* 90 97 */ XK_KP_Enter, NoSymbol,
/* 91 98 */ XK_KP_Divide, NoSymbol,
/* 92 99 */ XK_Sys_Req, XK_Print,
/* 93 100 */ XK_Alt_R, XK_Meta_R,
/* 94 101 */ XK_Num_Lock, NoSymbol,
/* 95 102 */ XK_Home, NoSymbol,
/* 96 103 */ XK_Up, NoSymbol,
/* 97 104 */ XK_Page_Up, NoSymbol,
/* 98 105 */ XK_Left, NoSymbol,
/* 99 106 */ XK_Right, NoSymbol,
/* 100 107 */ XK_End, NoSymbol,
/* 101 108 */ XK_Down, NoSymbol,
/* 102 109 */ XK_Page_Down, NoSymbol,
/* 103 110 */ XK_Insert, NoSymbol,
/* 104 111 */ XK_Delete, NoSymbol,
/* 105 112 */ XK_Super_L, NoSymbol,
/* 106 113 */ XK_Super_R, NoSymbol,
/* 107 114 */ XK_Menu, NoSymbol,
/* 108 115 */ XK_Next, NoSymbol, /* right button on side */
/* 109 116 */ XK_Prior, NoSymbol, /* left button on side */
/* 110 117 */ XK_Up, NoSymbol, /* joypad */
/* 111 118 */ XK_Down, NoSymbol,
/* 112 119 */ XK_Left, NoSymbol,
/* 113 120 */ XK_Right, NoSymbol,
/* 114 121 */ NoSymbol, NoSymbol, /* left near speaker */
/* 115 122 */ NoSymbol, NoSymbol, /* right near speaker */
/* 116 123 */ NoSymbol, NoSymbol, /* tiny button */
};
static Status
FakeKeyboardInit (KdKeyboardInfo *ki)
{
ki->keySyms.minKeyCode = 1;
ki->keySyms.maxKeyCode = (sizeof (FakeKeymap) / sizeof (FakeKeymap[0])) / FAKE_WIDTH;
ki->keySyms.mapWidth = FAKE_WIDTH;
if (ki->keySyms.map)
xfree(ki->keySyms.map);
ki->keySyms.map = (KeySym *)xalloc(sizeof(FakeKeymap));
if (!ki->keySyms.map)
return BadAlloc;
memcpy (ki->keySyms.map, FakeKeymap, sizeof (FakeKeymap));
ki->minScanCode = 8;
ki->maxScanCode = 255;
return Success;
}
@ -182,8 +51,6 @@ FakeKeyboardDisable (KdKeyboardInfo *ki)
static void
FakeKeyboardFini (KdKeyboardInfo *ki)
{
xfree(ki->keySyms.map);
ki->keySyms.map = NULL;
}
static void

View File

@ -243,7 +243,9 @@ EvdevPtrEnable (KdPointerInfo *pi)
if (fd < 0)
return BadMatch;
if (ioctl (fd, EVIOCGRAB, 1) < 0)
perror ("Grabbing evdev mouse device failed");
if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0)
{
perror ("EVIOCGBIT 0");
@ -335,6 +337,10 @@ EvdevPtrDisable (KdPointerInfo *pi)
return;
KdUnregisterFd (pi, ke->fd, TRUE);
if (ioctl (ke->fd, EVIOCGRAB, 0) < 0)
perror ("Ungrabbing evdev mouse device failed");
xfree (ke);
pi->driverPrivate = 0;
}
@ -356,7 +362,7 @@ readMapping (KdKeyboardInfo *ki)
return;
ki->minScanCode = 0;
ki->maxScanCode = 193;
ki->maxScanCode = 247;
}
static void
@ -425,6 +431,9 @@ EvdevKbdEnable (KdKeyboardInfo *ki)
if (fd < 0)
return BadMatch;
if (ioctl (fd, EVIOCGRAB, 1) < 0)
perror ("Grabbing evdev keyboard device failed");
if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0) {
perror ("EVIOCGBIT 0");
close (fd);
@ -496,6 +505,10 @@ EvdevKbdDisable (KdKeyboardInfo *ki)
return;
KdUnregisterFd (ki, ke->fd, TRUE);
if (ioctl (ke->fd, EVIOCGRAB, 0) < 0)
perror ("Ungrabbing evdev keyboard device failed");
xfree (ke);
ki->driverPrivate = 0;
}

View File

@ -151,10 +151,6 @@ TslibDisable (KdPointerInfo *pi)
static Status
TslibInit (KdPointerInfo *pi)
{
int fd = 0, i = 0;
DIR *inputdir = NULL;
struct dirent *inputent = NULL;
struct tsdev *tsDev = NULL;
struct TslibPrivate *private = NULL;
if (!pi || !pi->dixdev)

View File

@ -166,6 +166,12 @@ KdFreeKeyboard(KdKeyboardInfo *ki)
xfree(ki->name);
if (ki->path)
xfree(ki->path);
if (ki->xkbRules)
xfree(ki->xkbRules);
if (ki->xkbModel)
xfree(ki->xkbModel);
if (ki->xkbLayout)
xfree(ki->xkbLayout);
ki->next = NULL;
xfree(ki);
}

View File

@ -43,6 +43,7 @@ from The Open Group.
#include <X11/keysym.h>
#include "xserver-properties.h"
#include "exevents.h"
#include "extinit.h"
Bool
LegalModifier(unsigned int key, DeviceIntPtr pDev)
@ -136,9 +137,14 @@ void
InitInput(int argc, char *argv[])
{
DeviceIntPtr p, k;
Atom xiclass;
p = AddInputDevice(serverClient, vfbMouseProc, TRUE);
k = AddInputDevice(serverClient, vfbKeybdProc, TRUE);
RegisterPointerDevice(p);
xiclass = MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE);
AssignTypeAndName(p, xiclass, "Xvfb mouse");
RegisterKeyboardDevice(k);
xiclass = MakeAtom(XI_KEYBOARD, sizeof(XI_KEYBOARD) - 1, TRUE);
AssignTypeAndName(k, xiclass, "Xvfb keyboard");
(void)mieqInit();
}

View File

@ -80,7 +80,7 @@ BUILT_SOURCES = xorg.conf.example
DISTCLEANFILES += xorg.conf.example xorg.conf.example.pre
EXTRA_DIST = xorgconf.cpp
if XSERVER_DTRACE
if SPECIAL_DTRACE_OBJECTS
# Re-add dtrace object code that gets lost when building static libraries
Xorg_LDADD += $(XSERVER_LIBS)
endif
@ -92,7 +92,8 @@ if SOLARIS_ASM_INLINE
BUILT_SOURCES += os-support/solaris/solaris-@SOLARIS_INOUT_ARCH@.il
os-support/solaris/solaris-@SOLARIS_INOUT_ARCH@.il:
cd os-support/solaris ; make solaris-@SOLARIS_INOUT_ARCH@.il
cd os-support/solaris ; \
$(MAKE) $(AM_MAKEFLAGS) solaris-@SOLARIS_INOUT_ARCH@.il
endif
# do not use $(mkdir_p) if you want automake 1.7 to work

View File

@ -55,6 +55,20 @@
# define DO_PROTOTYPES
#endif
/* Map Sun compiler platform defines to gcc-style used in the code */
#if defined(__amd64) && !defined(__amd64__)
# define __amd64__
#endif
#if defined(__i386) && !defined(__i386__)
# define __i386__
#endif
#if defined(__sparc) && !defined(__sparc__)
# define __sparc__
#endif
#if defined(__sparcv9) && !defined(__sparc64__)
# define __sparc64__
#endif
#ifndef _X_EXPORT
# include <X11/Xfuncproto.h>
#endif
@ -1211,6 +1225,8 @@ extern _X_EXPORT void (*xf86WriteMmio32)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB8)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB16)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
/* Some macros to hide the system dependencies for MMIO accesses */
/* Changed to kill noise generated by gcc's -Wcast-align */
@ -1342,4 +1358,18 @@ extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
# define MMIO_MOVE32(base, offset, val) MMIO_OUT32(base, offset, val)
# endif /* __alpha__ */
/*
* With Intel, the version in os-support/misc/SlowBcopy.s is used.
* This avoids port I/O during the copy (which causes problems with
* some hardware).
*/
# ifdef __alpha__
# define slowbcopy_tobus(src,dst,count) xf86SlowBCopyToBus(src,dst,count)
# define slowbcopy_frombus(src,dst,count) xf86SlowBCopyFromBus(src,dst,count)
# else /* __alpha__ */
# define slowbcopy_tobus(src,dst,count) xf86SlowBcopy(src,dst,count)
# define slowbcopy_frombus(src,dst,count) xf86SlowBcopy(src,dst,count)
# endif /* __alpha__ */
#endif /* _COMPILER_H */

View File

@ -71,13 +71,6 @@ extern DeviceAssocRec mouse_assoc;
#include "picture.h"
#endif
#if (defined(__i386__)) && \
(defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
defined(__NetBSD__) || defined(linux) || \
(defined(SVR4) && !defined(sun)) || defined(__GNU__))
#define SUPPORT_PC98
#endif
/*
* These paths define the way the config file search is done. The escape
* sequences are documented in parser/scan.c.
@ -249,7 +242,9 @@ xf86ModulelistFromConfig(pointer **optlist)
{
int count = 0, i = 0;
char **modulearray;
char *ignore[] = { "GLcore", "speedo", "bitmap", "drm", NULL };
char *ignore[] = { "GLcore", "speedo", "bitmap", "drm",
"freetype", "type1",
NULL };
pointer *optarray;
XF86LoadPtr modp;
Bool found;
@ -776,11 +771,10 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
};
#ifdef __i386__
#ifdef SUPPORT_PC98
static Bool
detectPC98(void)
{
#ifdef SUPPORT_PC98
unsigned char buf[2];
if (xf86ReadBIOS(0xf8000, 0xe80, buf, 2) != 2)
@ -789,11 +783,8 @@ detectPC98(void)
return TRUE;
else
return FALSE;
#else
return FALSE;
#endif
}
#endif /* __i386__ */
#endif
static Bool
configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
@ -1052,7 +1043,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
xf86Info.pixmap24 = Pix24DontCare;
xf86Info.pix24From = X_DEFAULT;
}
#ifdef __i386__
#ifdef SUPPORT_PC98
if (xf86GetOptValBool(FlagOptions, FLAG_PC98, &value)) {
xf86Info.pc98 = value;
if (value) {
@ -1456,7 +1447,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
#ifdef CONFIG_HAL
xf86Msg(X_INFO, "The server relies on HAL to provide the list of "
"input devices.\n\tIf no devices become available, "
"reconfigure HAL or disable AllowEmptyInput.\n");
"reconfigure HAL or disable AutoAddDevices.\n");
#else
xf86Msg(X_INFO, "HAL is disabled and no input devices were configured.\n"
"\tTry disabling AllowEmptyInput.\n");

View File

@ -120,8 +120,22 @@ DGAInit(
DGAScreenKey = &DGAScreenKeyIndex;
if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
return FALSE;
pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
if (!pScreenPriv)
{
if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
return FALSE;
dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = DGACloseScreen;
pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
pScreen->DestroyColormap = DGADestroyColormap;
pScreenPriv->InstallColormap = pScreen->InstallColormap;
pScreen->InstallColormap = DGAInstallColormap;
pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
pScreen->UninstallColormap = DGAUninstallColormap;
}
pScreenPriv->pScrn = pScrn;
pScreenPriv->numModes = num;
@ -146,17 +160,6 @@ DGAInit(
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
#endif
dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = DGACloseScreen;
pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
pScreen->DestroyColormap = DGADestroyColormap;
pScreenPriv->InstallColormap = pScreen->InstallColormap;
pScreen->InstallColormap = DGAInstallColormap;
pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
pScreen->UninstallColormap = DGAUninstallColormap;
return TRUE;
}
@ -1085,13 +1088,15 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse)
ButtonClassPtr butc = mouse->button;
DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
DeviceEvent ev;
DeviceIntPtr master = GetMaster(mouse, MASTER_KEYBOARD);
memset(&ev, 0, sizeof(ev));
ev.header = ET_Internal;
ev.length = sizeof(ev);
ev.type = event->subtype;
ev.corestate = butc->state;
ev.corestate |= XkbStateFieldFromRec(&GetPairedDevice(mouse)->key->xkbInfo->state);
if (master && master->key)
ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);
UpdateDeviceState(mouse, &ev);

View File

@ -202,8 +202,16 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
vtno--;
#endif
#if defined(sun)
if (vtno == xf86Info.vtno)
if (vtno == xf86Info.vtno) {
break;
} else {
struct vt_stat state;
if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0)
break;
if ((state.v_state & (1 << vtno)) == 0)
break;
}
xf86Info.vtRequestsPending = TRUE;
xf86Info.vtPendingNum = vtno;
@ -263,13 +271,14 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
(FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
int sigstate = xf86BlockSIGIO();
pInfo->read_input(pInfo);
xf86UnblockSIGIO(sigstate);
/*
* Remove the descriptior from the set because more than one
* device may share the same file descriptor.
*/
FD_CLR(pInfo->fd, &devicesWithInput);
pInfo->read_input(pInfo);
xf86UnblockSIGIO(sigstate);
}
pInfo = pInfo->next;
}

View File

@ -124,7 +124,7 @@ xf86InfoRec xf86Info = {
.miscModInDevAllowNonLocal = FALSE,
.pixmap24 = Pix24DontCare,
.pix24From = X_DEFAULT,
#ifdef __i386__
#ifdef SUPPORT_PC98
.pc98 = FALSE,
#endif
.pmFlag = TRUE,

View File

@ -1446,6 +1446,13 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
if (xf86DoConfigure && xf86DoConfigurePass1) return 1;
/*
* This can happen when running Xorg -showopts and a module like ati
* or vmware tries to load its submodules when xf86ConfigLayout is empty
*/
if (!xf86ConfigLayout.screens)
return 0;
/*
* This is a very important function that matches the device sections
* as they show up in the config file with the drivers that the server
@ -2140,7 +2147,7 @@ xf86GetAllowMouseOpenFail(void)
Bool
xf86IsPc98(void)
{
#ifdef __i386__
#if SUPPORT_PC98
return xf86Info.pc98;
#else
return FALSE;

View File

@ -1142,8 +1142,10 @@ OsVendorInit(void)
signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */
#endif
if (!beenHere)
if (!beenHere) {
umask(022);
xf86LogInit();
}
/* Set stderr to non-blocking. */
#ifndef O_NONBLOCK
@ -1243,7 +1245,9 @@ AbortDDX(void)
* we might not have been wrapped yet. Therefore enable
* screen explicitely.
*/
xf86VGAarbiterLock(xf86Screens[i]);
(xf86Screens[i]->LeaveVT)(i, 0);
xf86VGAarbiterUnlock(xf86Screens[i]);
}
}

View File

@ -249,6 +249,15 @@ xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges)
}
}
static Bool
modeInClockRange(ClockRangePtr cp, DisplayModePtr p)
{
return ((p->Clock >= cp->minClock) &&
(p->Clock <= cp->maxClock) &&
(cp->interlaceAllowed || !(p->Flags & V_INTERLACE)) &&
(cp->doubleScanAllowed ||
((p->VScan <= 1) && !(p->Flags & V_DBLSCAN))));
}
/*
* xf86FindClockRangeForMode() [... like the name says ...]
@ -259,12 +268,7 @@ xf86FindClockRangeForMode(ClockRangePtr clockRanges, DisplayModePtr p)
ClockRangePtr cp;
for (cp = clockRanges; ; cp = cp->next)
if (!cp ||
((p->Clock >= cp->minClock) &&
(p->Clock <= cp->maxClock) &&
(cp->interlaceAllowed || !(p->Flags & V_INTERLACE)) &&
(cp->doubleScanAllowed ||
((p->VScan <= 1) && !(p->Flags & V_DBLSCAN)))))
if (!cp || modeInClockRange(cp, p))
return cp;
}
@ -979,11 +983,7 @@ xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags)
if (scrp->progClock) {
/* Check clock is in range */
for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
if ((cp->minClock <= mode->Clock) &&
(cp->maxClock >= mode->Clock) &&
(cp->interlaceAllowed || !(mode->Flags & V_INTERLACE)) &&
(cp->doubleScanAllowed ||
((!(mode->Flags & V_DBLSCAN)) && (mode->VScan <= 1))))
if (modeInClockRange(cp, mode))
break;
}
if (cp == NULL) {
@ -999,12 +999,7 @@ xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags)
status = MODE_CLOCK_RANGE;
/* Check clock is in range */
for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
if ((cp->minClock <= mode->Clock) &&
(cp->maxClock >= mode->Clock) &&
(cp->interlaceAllowed || !(mode->Flags & V_INTERLACE)) &&
(cp->doubleScanAllowed ||
((!(mode->Flags & V_DBLSCAN)) && (mode->VScan <= 1)))) {
if (modeInClockRange(cp, mode)) {
/*
* Clock is in range, so if it is not a programmable clock,
* find a matching clock.

View File

@ -91,7 +91,7 @@ typedef struct {
input device events */
Pix24Flags pixmap24;
MessageType pix24From;
#ifdef __i386__
#ifdef SUPPORT_PC98
Bool pc98;
#endif
Bool pmFlag;

View File

@ -163,7 +163,7 @@ xf86RandRSetMode (ScreenPtr pScreen,
WindowPtr pRoot = WindowTable[pScreen->myNum];
Bool ret = TRUE;
if (pRoot)
if (pRoot && scrp->vtSema)
(*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
if (useVirtual)
{
@ -229,7 +229,7 @@ xf86RandRSetMode (ScreenPtr pScreen,
*/
xf86SetViewport (pScreen, pScreen->width, pScreen->height);
xf86SetViewport (pScreen, 0, 0);
if (pRoot)
if (pRoot && scrp->vtSema)
(*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE);
return ret;
}

Some files were not shown because too many files have changed in this diff Show More