Commit Graph

12863 Commits

Author SHA1 Message Date
Keith Packard
5c5c1b7798 present: Add Present extension
Provides both a software implementation using timers and driver hooks
to base everything on vblank intervals.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:59:18 -07:00
Keith Packard
5631382988 dri3: Add DRI3 extension
Adds DRM compatible fences using futexes.
Uses FD passing to get pixmaps from DRM applications.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:30 -07:00
Keith Packard
fdec793cdc Add support for MIT-SHM AttachFd request
This passes a file descriptor from the client to the server, which is
then mmap'd

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:28 -07:00
Keith Packard
9fd35daa31 Add interfaces to get FDs from clients over the socket
This adds two interfaces:

    void SetReqFds(ClientPtr client, int req_fds)

	Marks the number of file descriptors expected for this
	request. Call this before any request processing so that
	any un-retrieved file descriptors will be closed
	automatically.

    int ReadFdFromClient(ClientPtr client)

	Reads the next queued file descriptor from the connection. If
	this request is not expecting any more file descriptors, or
	if there are no more file descriptors available from the
	connection, then this will return -1.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:25 -07:00
Keith Packard
264fc3abe5 misync: Don't smash custom screen sync functions
There was a check to avoid smashing custom functions, but the sense
was backwards causing it to always smash them, and also not set them otherwise.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:23 -07:00
Keith Packard
2d96948ab5 os: Add GetTimeInMicros
64-bit higher resolution current time value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:21 -07:00
Keith Packard
0c33f47281 Add swapll to byte swap 64-bit datatypes
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:18 -07:00
Keith Packard
26f013ba45 Add a RegionDuplicate function
This allocates a new region structure and copies a source region into
it in a single API rather than forcing the caller to do both steps themselves.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:16 -07:00
Keith Packard
d25c217964 Clean up a couple of warnings in os/
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:12 -07:00
Keith Packard
7710f2b927 Xext: Move MIT-SHM 'ShmDesc' to shmint.h
This data structure is required to use shared memory objects in any
extension. That includes the Xv extension, which (before this patch)
duplicated the definition of this structure in its own code.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:57:57 -07:00
Adam Jackson
2eedf42c22 dri: Fix GLX_Y_INVERTED_EXT fbconfig attribute
We're Y-inverted from GL's coordinates, so this is correct.  gnome-shell
doesn't seem to check this - somewhat reasonable since the only server
that answered the other way around was Xglx - but kwin does, and
upside-down hilarity ensues.

Tested-by: maelcum on #xorg-devel
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31 08:13:26 -07:00
Adam Jackson
902ff0b349 xfree86: Bump video/input/extension ABIs for 1.15
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-30 14:02:59 -07:00
Keith Packard
899451ae59 kdrive/ephyr: Don't discard one-time driver structure at server reset
KdScreenInfo is constructed at server startup time, and not
re-generated at server reset time. Freeing the 'driver' element at
reset time means this information is lost, and the server crashes
pretty quickly afterwards.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-30 09:11:56 -07:00
Michal Srb
85ae44f07f randr: deliver Output and Crtc events of attached output providers.
Consider all attached output providers when looking for changed outputs and
crtcs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-30 08:09:31 -07:00
Michal Srb
a9ca93dcf9 randr: send RRResourceChangeNotify event
Send RRResourceChangeNotify event when provider, output or crtc was created or
destroyed. I.e. when the list of resources returned by RRGetScreenResources and
RRGetProviders changes.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-30 08:09:27 -07:00
Michal Srb
4b39ea8a91 randr: send RRProviderChangeNotify event
Send RRProviderChangeNotify event when a provider becomes output source or
offload sink.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-30 08:09:25 -07:00
Keith Packard
1470c0a132 Merge remote-tracking branch 'whot/for-keith' 2013-10-29 21:00:13 -07:00
Gaetan Nadon
9f4afe7e83 config: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES
Fix Automake warning: AC_OUTPUT should be used without arguments.
www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Files

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-30 07:41:26 +10:00
Peter Hutterer
e16dea72d6 dmx: queue button events with a flags of 0
Setting POINTER_SCREEN with a unset valuator mask causes a jump to 0/0. Set
the flags to 0 so we don't generate any motion on a button event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-30 07:41:20 +10:00
Connor Behan
04ab07ca19 xfree86: Find primary entity when bus types are nominally different
As of server 1.13, systems with DRM and Udev will have BUS_PLATFORM as
their primary bus type. However, drivers not implementing a
platformProbe function will still create entities of type BUS_PCI. We
need to account for this when checking for the primary entity.

Signed-off-by: Connor Behan <connor.behan@gmail.com>
Acked-by: Tormod Volden <debian.tormod@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-29 09:49:01 -07:00
Keith Packard
b32a4c91cc Merge remote-tracking branch 'idr/glx-float-fbconfig' 2013-10-29 09:37:30 -07:00
Adam Jackson
be6680967a glx: convert to direct GL dispatch (v2)
We now expect to be linked against something that provides the GL API,
instead of manually grubbing about in the DRI driver's dispatch table.
Since the GLX we expose calls GL functions that are meant to be looked
up dynamically, also add a way to thunk through to GetProcAddress.

This includes a refresh of the generated sources, which requires a
correspondingly new Mesa.

The GetProcAddress stubs are at the moment merely enough to make this
link against Mesa 9.2, but should really be provided for everything not
in the OpenGL 1.2 ABI.

v2: Explicitly hide the GetProcAddress stubs so we can't conflict with
libGL symbols; fix leading tab/space issues [anholt]

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 12:29:16 -04:00
Adam Jackson
8aacf47e17 glx: Remove DRI1 AIGLX (v2)
Mesa doesn't ship DRI1 drivers as of 8.0, which is about 18 months and
three releases ago.  The main reason to have wanted DRI1 AIGLX was to
get a GLX compositor working, but DRI1's (lack of) memory management API
meant that the cost of a GLX compositor was breaking direct GLX apps,
which isn't a great tradeoff.

Of the DRI1 drivers Mesa has dropped, I believe only mga stands to lose
some functionality here, since it and only it has support for
NV_texture_rectangle.  Since that's required for every extant GLX
compositor I know of, I conclude that anybody with a savage, say, would
probably not notice AIGLX going away, since they wouldn't be running a
GLX compositor in the first place.

In the future we'd like to use GL in the server in a more natural way,
as just another EGL client, including in the GLX implementation itself.
Since there's no EGL implemented for DRI1 drivers, this would already
doom AIGLX on DRI1 (short of entirely forking the GLX implementation,
which I'm not enthusiastic about).

v2: Remove DRI1 from AIGLX conditionals in configure.ac [anholt]

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Adam Jackson
7f5adf73a0 glx: Simplify glXDestroyContext
We can just free the resource unconditionally here.  ContextGone (which
FreeResourceByType will call) already does:

    cx->idExists = GL_FALSE;
    if (!cx->currentClient) {
        __glXFreeContext(cx);
    }

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Adam Jackson
53653f4889 glx: Fix a corner case in DrawableGone
Losing the drawable does not change our notion of current client.  Since
the GL under us doesn't understand having a current context without
current drawables (sigh), we do still need to loseCurrent so that we
re-bind the context on the next request.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65030
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Adam Jackson
276d8057aa glx: Fix memory leak in context garbage collection (v2)
I broke this, back in:

    commit a48dadc98a
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Mon Mar 21 11:59:29 2011 -0400

	glx: Reimplement context tags

In that, I changed the glx client state to not explicitly track the list
of current contexts for the client (since that was what we were deriving
tags from).  The bug was that I removed the code for same from
glxClientCallback without noticing that it had the side effect of
effectively de-currenting those contexts, so that ContextGone could free
them.  So, if you had a client exit with a context still current, the
context's memory would leak.  Not a huge deal for direct clients, but
viciously bad for indirect, since the swrast context state at the bottom
of Mesa is like 15M.

Fix this by promoting Bool isCurrent to ClientPtr currentClient, so that
we have a back-pointer to chase when walking the list of contexts when
ClientStateGone happens.

v2: Explicitly call __glXFreeContext on the ClientStateGone path.  Our
current context might be one we got from EXT_import_context and whose
creating client has since died.  Without the explicit call, the creating
client's FreeClientResources would not free the context because it's
still current, and the using client's FreeClientResources would not free
the context because it's not an XID it created.  This matches the logic
from a48dadc.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Adam Jackson
75b362763c glx: Only take a Pixmap reference if creating the GLXPixmap succeeded
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Peter Hutterer
4292a39c80 Xi: fix logic error when calculating emulated motion events
gcc -Wlogical-op
exevents.c: In function 'DeliverEmulatedMotionEvent':
exevents.c:1480:13: warning: logical 'or' of collectively exhaustive
tests is always true [-Wlogical-op]

The relevant snippet of exevents.c:

1479         if (ti->listeners[0].type != LISTENER_POINTER_REGULAR ||
1480             ti->listeners[0].type != LISTENER_POINTER_GRAB)
1481             return;

This condition was always true, causing dropped motion events.

Reported-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-10-29 13:40:52 +10:00
Daniel Czarnowski
c671e935e7 glx: Enable GLX_ARB_fbconfig_float for DRI2 drivers
v2 (idr): Maintain sort order of extension list.  Fixed rebase error
(comment header for initializeExtensions was in front of
__glXDRIinvalidateBuffers).  Re-write commit message.

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-24 11:48:04 -07:00
Daniel Czarnowski
ccc8bb1153 glx: Handle float config types in glxConvertConfigs
Replaces old use of floatMode attribute with new, extended range of
values in __DRI_ATTRIB_RENDER_TYPE. Also adds new conditions, where the
float modes support requires it. Enables support for not only float
configs, but packed float configs as well.

v2 (idr): Whitespace and formatting fixes.  Refactor render type
vs. pbuffer checking to a separate function that includes a quote from
the spec.  Re-write commit message.  Fix compiler warnings:

glxdricommon.c: In function 'glxConvertConfigs':
glxdricommon.c:212:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:212:35: note: expected 'unsigned int *' but argument is of type 'int *'
glxdricommon.c:230:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:230:35: note: expected 'unsigned int *' but argument is of type 'int *'

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-24 11:47:42 -07:00
Daniel Czarnowski
4e5eb15b4c glx: Correctly set render type enum
The type specified is bits, but the context wants an enum.

v2 (idr): Fix various whitespace and formatting problems.  Rename
convFBconfRenderTypeBits2CtxRenderType to
renderTypeBitsToRenderTypeEnum.  Re-write commit message.

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-24 11:16:30 -07:00
Daniel Czarnowski
eabb523aa4 glx: Allow float renderType in glXCreateContextAttribsARB
This enables GLX_RGBA_FLOAT_TYPE_ARB and
GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT as valid renderType parameters to
glXCreateContextAttribsARB.

v2 (idr) : Use C-style comments and fix word wrapping.  Re-write commit
message.

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-24 11:16:27 -07:00
Eric Anholt
7ecfab47eb glx: Add support for the new DRI loader entrypoint.
This is going to be exposed (and not the old entrypoint) for some DRI
drivers once the megadrivers series lands, and the plan is to
eventually transition all drivers to that.  Hopefully this is
unobtrusive enough to merge to stable X servers so that they can be
compatible with new Mesa versions.

v2: typo fix in the comment

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-23 08:12:28 +08:00
Strake
83bb366e71 unbreak KdEnableInput
pi = ki = 0 here, so not follow them.

Signed-off-by: Strake <strake888@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-21 14:08:06 +10:00
Keith Packard
8db4121a3c Update to version 1.14.99.3
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-18 17:31:01 -07:00
Keith Packard
e3220d7bae Merge commit '2523a445a09a75a8baf642608d099a5e12d5437f'
This is merging the commits along Peter's for-keith branch, without
also merging in the spurious merge at the top of that branch.
2013-10-18 17:22:52 -07:00
Peter Hutterer
f8662a1336 Merge branch 'xsync-transition-bug-59644' into for-keith 2013-10-18 16:50:12 +10:00
Peter Hutterer
2523a445a0 sync: split updating and triggering a counter up
Now that the brackets are always the nearest change points (regardless of
transition) we need to update the counters whenever we check for any updates.

Otherwise we end up with a situation where counter->value is out of date and
an alarm doesn't trigger because we're still using the value from last time
something actually triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-18 16:48:25 +10:00
Peter Hutterer
e57ec99b03 sync: always set the brackets (#59644)
The current code sets bracket_greater to the first trigger after the current
value, and bracket_less to the last trigger before the current value.

For example, the idle timer with three negative and three positive transitions
would set this:

         nt1       nt2                 nt3
|--------|------|--|------- idle --|---|--|-----> t
               pt1                pt2    pt3
bracket_less == nt2
bracket_greater == pt2

This is an optimization so we can skip code paths in the block/wakeup handlers
if the current value doesn't meet any of the trigger requirements. Those
handlers largely do a
   if (bracket_less is less than current value &&
       bracket_greater is greater than current value)
        return, nothing to do

However, unless the bracket values are updated at the correct time, the
following may happen:

                                      nt
|--------------|---------- idle ------|--------> t
               pt

In this case, neither bracket is set, we're past the pos transition and not
yet at the neg transition. idle may now go past nt, but the brackets are not
updated. If idle is then reset to 0, no alarm is triggered for nt. Likewise,
idle may now go past pt and no alarm is triggered.

Changing an alarm or triggering an alarm will re-calculate the brackets, so
this bug is somewhat random. If any other client triggers an alarm when the
brackets are wrongly NULL, the recalculation will set them this bug may not
appear.

This patch changes the behavior, so that the brackets are always the nearest
positive or negative transitions to the current counter value. In the example
above, nt will trigger a wakeup and a re-calculation of the brackets, so that
going past it in the negative direction will then cause the proper alarm
triggers.

Or, in Keith's words:

  Timer currently past a positive trigger
      No bracket values, because no trigger in range

  Timer moves backwards before the positive trigger
      Brackets not reset, even though there is now a trigger in range

  Timer moves forward past the positive trigger
      Trigger doesn't fire because brackets not set

Setting the LT bracket in this case will cause everything to get
re-evaluated when the sync value moves backwards before the trigger
value.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-18 16:46:33 +10:00
Peter Hutterer
06b87aa528 sync: if the idle time was reset, force alarms to trigger (#70476)
The time between the idle reset and the IdleTimeWakeupHandler to be called is
indeterminate. Clients with an PositiveTransition or NegativeTransition alarm
on a low threshold may miss an alarm.

Work around this by keeping a reset flag for each device. When the
WakeupHandler triggers and the reset flag is set, we force a re-calculation of
everything and pretend the current idle time is zero. Immediately after is the
next calculation with the real idle time.

Relatively reproducible test case: Set up a XSyncNegativeTransition alarm for
a threshold of 1 ms. May trigger, may not.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-18 16:44:32 +10:00
Peter Hutterer
efc1035ca9 dix: provide accessor methods for the last device event time
And now that we have the accessors, localize it. No functional changes, just
preparing for a future change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-18 16:44:32 +10:00
Peter Hutterer
b7c9bd9cf2 sync: supply the counter from IdleTimeBlockHandler
The main idletime counter has an initialized deviceid, might as well be
supplying it properly. Without this, we'd only ever check the XIAllDevices
counter, so the wait would never be adjusted for the device-specific triggers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-18 16:43:00 +10:00
Peter Hutterer
2efe49c102 sync: always call BracketValues when recalculating upper/lower brackets
Both ServertimeBracketValues and IdleTimeBracketValues copy the value into
there SysCounter privates. Call it for a NULL set as well, so we don't end up
with stale pointers and we can remove the block/wakeup handlers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-18 13:42:20 +10:00
Peter Hutterer
5c7cfd4c69 sync: compress two if statements
No functional changes, just merges a > and == condition into a >= condition.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-18 13:42:15 +10:00
Alan Coopersmith
73b2660d72 Avoid use-after-free in dix/dixfonts.c: doImageText() [CVE-2013-4396]
Save a pointer to the passed in closure structure before copying it
and overwriting the *c pointer to point to our copy instead of the
original.  If we hit an error, once we free(c), reset c to point to
the original structure before jumping to the cleanup code that
references *c.

Since one of the errors being checked for is whether the server was
able to malloc(c->nChars * itemSize), the client can potentially pass
a number of characters chosen to cause the malloc to fail and the
error path to be taken, resulting in the read from freed memory.

Since the memory is accessed almost immediately afterwards, and the
X server is mostly single threaded, the odds of the free memory having
invalid contents are low with most malloc implementations when not using
memory debugging features, but some allocators will definitely overwrite
the memory there, leading to a likely crash.

Reported-by: Pedro Ribeiro <pedrib@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-10-14 17:56:44 -07:00
Alan Coopersmith
8afe20d4e3 Update GLX dependencies now that DRI & DRI2 are builtins, not modules
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-10-14 17:56:44 -07:00
Alan Coopersmith
2704bdb24a DMX glxproxy: Don't allocate & copy data just to free it unused
Two functions in the DMX glxproxy code loop over all the backend
screens, starting at the highest numbered and counting down to
the lowest.

Previously, for each screen, the code would allocate a buffer
large enough to read the reply from the backend, copy that reply
into the buffer, and then if it wasn't the final screen, free it.
Only the buffer from the final screen is used, to pass on to the
client in the reply.

This modifies it to just immediately discard the responses from
the screens as we loop through it, only doing the allocate & copy
work for the one buffer we pass back to the client.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Alex Deucher <aleander.deucher@amd.com>
2013-10-14 17:56:44 -07:00
Alan Coopersmith
6c06c268ad Skip damage calls if DamageCreate fails in exa functions
Fixes parfait errors such as:
   Null pointer dereference (CWE 476): Write to null pointer pDamage
        at line 1833 of miext/damage/damage.c in function 'DamageRegister'.
          Function DamageCreate may return constant 'NULL' at line 1775,
              called at line 232 of exa/exa_migration_mixed.c
              in function 'exaPrepareAccessReg_mixed'.
          Constant 'NULL' passed into function DamageRegister,
              argument pDamage, from call at line 237.
          Null pointer introduced at line 1775 of miext/damage/damage.c
              in function 'DamageCreate'.
   Null pointer dereference (CWE 476): Write to null pointer pDamage
        at line 1833 of miext/damage/damage.c in function 'DamageRegister'.
          Function DamageCreate may return constant 'NULL' at line 1775,
              called at line 104 of exa/exa_mixed.c
              in function 'exaCreatePixmap_mixed'.
          Constant 'NULL' passed into function DamageRegister,
              argument pDamage, from call at line 109.
          Null pointer introduced at line 1775 of miext/damage/damage.c
              in function 'DamageCreate'.

Checks are similar to handling results of other calls to DamageCreate.

[ This bug was found by the Parfait 1.3.0 bug checking tool.
  http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-10-14 17:56:44 -07:00
Peter Hutterer
7cf1b595c8 dix: only deliver for the current grab type
Use the grabtype to determine which type of event to send - all other events
are pointless and may result in erroneous events being delivered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-14 11:07:38 +10:00
Peter Hutterer
78944d62ff dix: don't attempt to deliver an event for a different grabtype
For an active grab, grab->eventMask can be either the core or the XI1 mask.
With the overlap of event filters, calling DeliverOneGrabbedEvent(XI1) for a
ProximityOut event will trigger if the client has selected for enter events -
the filter is the same for both.

Thus, we end up delivering a proximity event to a client not expecting one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-14 11:07:38 +10:00