Commit Graph

9051 Commits

Author SHA1 Message Date
Jesse Barnes
165a4a9c7d GLX/DRI2: expose swap control extensions if DDX support is present
Export DDX swap control status from the DRI2 module and check for it in
GLX when initializing extensions.

Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:03:12 -07:00
Jesse Barnes
5933b0abc6 DRI2: prevent swap wakes from waking MSC waiters
If a few swaps were queued leading to a throttle related block on the
client, and then the client submitted an MSC wait, one of the previous
swap wakeups could have caused the MSC wait to complete early.  Add a
flag for this to prevent a swap wake from prematurely waking an MSC
waiter.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:02:57 -07:00
Jesse Barnes
b00d435ddf DRI2: handle swapsPending better
Avoid a potential swapsPending underflow by incrementing it before
ScheduleSwap, which may complete it immediately.  And be sure to
decrement it again in case the schedule failed.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:02:51 -07:00
Jesse Barnes
0294ff2a5c DRI2: throttle swaps at submission time too
We need to throttle swaps here in addition to when the context is made
current to avoid causing problems with clients that just swap.
Throttling here also ensures our swaps get ordered as long as we block
the client occasionally.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:02:45 -07:00
Jesse Barnes
db1c7cb604 DRI2: advertise lowest supported DRI2 protocol version
Update our supported DRI2 protocol version as each driver does
DRI2ScreenInit, since depending on available kernel features, each DDX
may support different callbacks and therefore protocol.

Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:02:37 -07:00
Jesse Barnes
87ca6320f2 DRI2: handle swap_interval of 0 correctly
A 0 swap interval means that swaps shouldn't be sync'd to vblank, so
just complete the swap immediately in that case.

Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:02:30 -07:00
Jesse Barnes
8476d99231 DRI2: drawable lifetime fixes
Handle drawable destruction and lifetime correctly.

Check whether the drawable priv is valid in DRI2SwapInterval(),
DRI2WaitSBC() and DRI2WaitMSC(); it may have gone away, so be sure to
check it before using it.

If more than 1 outstanding swap is queued, we may complete several after
an app has exited.  If we free it after the first one completes and the
refcount reaches 0, we'll crash the server on subsequent completions.
So delay freeing until all swaps complete and remove the error message
as this is a normal occurence.  To do this properly, we must also avoid
destroying drawables in DRI2DestroyDrawable() if a swap or wait event is
pending.

And finally, make sure we free drawables in DRI2WaitMSCComplete() if
necessary (i.e. if the refcount has reached 0 and this MSC was the last
pending event on the object).

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:02:22 -07:00
Jesse Barnes
b180e43977 DRI2: fix swapbuffers handling of SBC and target MSC
Returns expected SBC after completion of swap to caller, as required by
OML_sync_control spec, instead of the last_swap_target value.

Passes target_msc, divisor, remainder, correctly for
glXSwapBuffersMscOML() call, while retaining old behaviour for simple
glXSwapBuffers() call.

An OML swap can have a 0 target_msc, which just means it needs to
satisfy the divisor/remainder equation.  Pass this down to the driver as
needed so we can support it.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-03-29 10:02:17 -07:00
Mario Kleiner
751e8c09d3 DRI2WaitSbc(): Fixes for correct semantic of glXWaitForSbcOML()
Added implementation for case target_sbc == 0. In that case, the
function shall schedule a wait until all pending swaps for the drawable
have completed.

Fix for non-blocking case. Old implementation returned random,
uninitialized values for (ust,msc,sbc) if it returned immediately
without scheduling a wait due to sbc >= target_sbc.

Now if function doesn't schedule a wait, but returns immediately,
it returns the (ust,msc,sbc) of the most recently completed swap,
i.e., the UST and MSC corresponding to the time when the returned
current SBC was reached.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-03-29 10:02:13 -07:00
Mario Kleiner
0de4974b90 DRI2: Fix glitches in DRI2SwapComplete() and DRI2WakeupClient()
DRI2SwapComplete(): Increment pPriv->swap_count++; before calling
into callback for INTEL_swap_events extension, so the swap event
contains the current SBC after swap completion instead of the
previous one.

DRI2WakeupClient: Check for pPriv->target_sbc <= pPriv->swap_count,
had wrong comparison pPriv->target_sbc >= pPriv->swap_count for
unblocking of clients of DRI2WaitSBC().

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-03-29 10:01:53 -07:00
Jesse Barnes
4c8ec49826 DRI2: make target_sbc signed
We need to track invalid targets as well as 0 targets, so just make it
signed so our comparisons work like they should.

Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reported-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:01:46 -07:00
Jesse Barnes
c4d54816f2 DRI2: fixup handling of last_swap_target
We need to initialize the swap target, which is passed to the driver to
schedule events.  Rather than using -1 to indicate that the field is
uninitialized, just make sure we initialize it at drawable creation
time.

Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:01:07 -07:00
Michel Dänzer
3083c5d0c4 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>
2010-03-22 10:34:35 -07:00
Keith Packard
b29220dc76 Merge remote branch 'jeremyhu/master' 2010-03-21 23:01:58 -07:00
Yaakov Selkowitz
c3da76643a Cygwin/X: Make X -> XWin symlink during install
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-03-22 00:48:33 -05:00
Yaakov Selkowitz
abf4e0b7e3 New header for XF86Bigfont server functions
Xext/xf86bigfont.c contains three non-static functions which are called
elsewhere in the server.  This creates a new header containing these
declarations in order to fix several warnings:

xf86bigfont.c:285: warning: no previous prototype for `XF86BigfontFreeFontShm'
dixfonts.c:502: warning: implicit declaration of function `XF86BigfontFreeFontS$
dixfonts.c:502: warning: nested extern declaration of `XF86BigfontFreeFontShm'
log.c:436: warning: implicit declaration of function `XF86BigfontCleanup'
log.c:436: warning: nested extern declaration of `XF86BigfontCleanup'

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:48:04 -05:00
Yaakov Selkowitz
57a049ea89 Xext: fix old-style function definitions in xf86bigfont.c
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:47:55 -05:00
Yaakov Selkowitz
822b9f9a3e mi: remove deprecated #include <X11/extensions/xf86bigfstr.h> in miinitext.c
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:47:09 -05:00
Yaakov Selkowitz
946b49ebcb Catch errors in recursive relink targets
If make relink fails in a subdirectory, we need to catch the error
otherwise make will continue iterating the 'for' loop.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-03-22 00:45:57 -05:00
Yaakov Selkowitz
0820a6e2fb Fix .man.N targets for AM_SILENT_RULES
Add $(AM_V_GEN) for sed-based rules so they appear as expected with
automake silent rules, and $(AM_V_at) to completely hide cp/ln/rm
commands which are not prone to fail.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:45:55 -05:00
Yaakov Selkowitz
9be4157391 Respect value of SED from configure
We now use libtool, which calls AC_PROG_SED and sets SED as the path to
a fully-functional 'sed' (which may also be called 'gsed' if GNU sed is
installed alongside a proprietary version).  Therefore we should respect
the value of SED so we are sure to use the correct one.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:45:54 -05:00
Yaakov Selkowitz
5e00f464c5 Fix relink targets for silent rules
Add $(AM_V_at) to all relink make targets to silence them when automake
silent rules are in use.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:45:52 -05:00
Yaakov Selkowitz
fa7e062962 Use EXEEXT in relink rules for portable DDXs
On Cygwin and MinGW, executables use the .exe suffix.  Autoconf and
automake set EXEEXT on these platforms, and leave it empty on others
where no suffix is used.  $(EXEEXT) must be appended to executable names
in custom rules for portability:

http://www.gnu.org/software/automake/manual/html_node/EXEEXT.html

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:45:51 -05:00
Yaakov Selkowitz
037869d7b8 kdrive: Use $(MAKE) in relink rules
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-22 00:45:49 -05:00
Yaakov Selkowitz
8e5de45513 Use libtool -export-dynamic flag for portability
The linker flag required for exporting symbols in executables varies
by platform.  libtool handles this with a single -export-dynamic
flag (not to be confused with the similarly-named ELF linker flag)
which tells it to use the correct platform-specific flag at link time.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-03-22 00:45:48 -05:00
Yaakov Selkowitz
2a11ffa977 Rename xdmx client to dmxinfo
The DMX Xdmx server and xdmx client cannot both be installed on
case-insensitive file systems.  The client is undocumented and
so renaming it is the best option.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-03-22 00:45:46 -05:00
Yaakov Selkowitz
fbb4903eaa Cygwin/X: Fix windres rule for automake silent rules
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Rémi Cardona <rem@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-03-22 00:45:45 -05:00
Yaakov Selkowitz
8db8946909 Cygwin/X: Fix make dist after 11252ed82e
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Acked-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-03-22 00:45:43 -05:00
Jeremy Huddleston
ed31d50b5f XQuartz: Constrain the pointer to the updated display bounds on display reconfigure.
http://xquartz.macosforge.org/trac/ticket/346
2010-03-21 21:56:39 -07:00
Jeremy Huddleston
927480be12 XQuartz: pbproxy: Make standalone xpbproxy respect the launchd prefix
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-03-21 21:56:39 -07:00
Jeremy Huddleston
d16bc8a3cd XQuartz: xpbproxy: Cleanup xpbproxy threading
Confine xpbproxy to a single thread
Runs inside its own CFRunLoop

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-03-21 21:56:39 -07:00
Jeremy Huddleston
9c9c3a85b0 XQuartz: Minor cleanup
Move RandRInit to where it will need to be (not yet implemented)

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-03-21 21:56:39 -07:00
Jeremy Huddleston
bb75d0df8b XQuartz: GLX: Fix Availability for Tiger ppc workaround
Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2010-03-21 21:56:39 -07:00
Jeremy Huddleston
eac7cdabec 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 9071b0d697.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-03-21 21:56:39 -07:00
Keith Packard
13c007f922 Bump to 1.7.99.902 -- 1.8 RC2 2010-03-21 17:23:46 -07:00
Keith Packard
235fa50304 Merge commit 'fa5103a02bd509e4a102afdad2ab26cb22210367' 2010-03-21 15:38:40 -07:00
Peter Hutterer
1c612acca8 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>
2010-03-21 15:26:28 -07:00
Keith Packard
95ca39b981 Merge remote branch 'jturney/master' 2010-03-21 15:24:06 -07:00
Oliver McFadden
e7ff956638 common: xf86Configure: alloc_strlen: Allocated memory does not have space for the terminating NUL of the string
buffer_alloc: Called allocating function "realloc" which allocated memory dictated by parameter "len + strlen(displaySize_string)"
alloc_strlen: Allocated memory does not have space for the terminating NUL of the string
var_assign: Assigned "ptr->mon_comment" to storage allocated by "realloc(ptr->mon_comment, len + strlen(displaySize_string))"

Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-21 15:20:53 -07:00
Oliver McFadden
aeae6637b5 fb: fbFinishScreenInit: leaked_storage: Variable "(visuals|depths)" goes out of scope
Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-21 15:20:27 -07:00
Oliver McFadden
d9ee31ab05 exa: exaFinishAccess: Overrun of static array "pExaScr->access" of size 6 at position 6 with index variable "i"
Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-21 15:20:07 -07:00
Yaakov Selkowitz
bf181915e1 Cygwin/X: Allow the default log location to be configurable
Allow the default log location to be configurable (e.g. /var/log),
and use separate logs for each display instance (e.g. XWin.0.log).

Make the type of g_pszLogFile const char*, per os/log.c:LogInit().

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-03-16 14:02:17 +00:00
Colin Harrison
cca4952d75 Xming: Warning fixes
Fix warnings due to prototypes not specifying function arguments
Fix warning with RegQueryValueEx()
Tidy up an include

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-03-16 13:56:58 +00:00
Colin Harrison
b8cf4153f8 Xming: Dead code removal
Remove some dead code, mostly code made obsolete by mandatory XKB

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-03-16 13:55:51 +00:00
Jon TURNEY
9b18f7ac0b Cygwin/X: Tidy up some cosmetic issues in log strings
Tidy up some cosmetic issues in log strings:
- Add missing '\n'
- Fix some strings starting with '\n'
- Remove '\f' from some log strings

These all just look daft in a log with timestamps.

Also clarify log message about screen origin coordinates

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-03-16 13:55:20 +00:00
Jon TURNEY
178e830378 Cygwin/X: Fix thinko in mount option checking
Fix a thinko in mount option checking.
Use symbolic names for values assigned to binary flag for clarity.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-03-16 13:54:55 +00:00
Francisco Jerez
fa5103a02b dri2: No need to blit from front on DRI2GetBuffers if they're just being reused.
It can be quite an expensive operation, so we're better off not doing
it unless it's totally required.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-03-16 09:51:08 -04:00
Francisco Jerez
e38e01081a Import linked list helpers from the intel DDX.
Borrowed from i830.h, except for list_for_each_entry().

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-03-16 09:51:08 -04:00
Francisco Jerez
b8a3be5f34 Add a ConfigNotify hook.
Executed from the ConfigureWindow request, right before sending
ConfigureNotify to the clients.

This commit breaks the ScreenRec ABI.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-03-16 09:51:08 -04:00
Roland Scheidegger
67a8c659f2 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>
2010-03-15 08:37:53 -07:00