Commit Graph

12996 Commits

Author SHA1 Message Date
Eric Anholt
295d41fa2a glx: unifdef swrast dri_interface.h values from Mesa 7.1.
We can't remove all the ifdefs (__DRI_TEX_BUFFER_VERSION) because
configure.ac is only checking for that version of Mesa in the absence
of dri2.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-30 23:10:34 -08:00
Eric Anholt
4ab1a2797b glx: unifdef for DRI2 dri_interface.h things in mesa 9.2.
Thanks to configure.ac's check, we know that we have a new enough
dri_interface.h that we don't need to conditionalize all this code.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-30 23:10:21 -08:00
Keith Packard
2ea973e12f Bump version to 1.15.0
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-27 09:50:55 -08:00
Keith Packard
2eb9915eea present: Set complete notify mode to Skip as needed
Skipped present pixmap calls were not setting the mode to
PresentCompleteModeSkip for skipped operations.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-20 12:28:00 -08:00
Keith Packard
e487babd52 present: Don't abandon presents which are already queued for flip
Presents which are not marked 'queued' and are in the window present
list are waiting for the flip event; discarding those won't work very
well (it'll end up trashing displayed content for the next frame), so
skip over those when looking for duplicate frame presents

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-20 12:28:00 -08:00
Keith Packard
ca3a5b2a8f present: Handle PresentOptionAsync for copy mode
Check for Async flag and execute immediately if set, otherwise wait
for the next appropriate vblank before copying.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-20 12:28:00 -08:00
Keith Packard
a68df14742 Bump version to 1.14.99.905 (1.15 RC5)
Another week, another RC. This should be the last before 1.15 final

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-19 14:31:07 -08:00
Keith Packard
4b1ead9d34 Merge remote-tracking branch 'whot/for-keith' 2013-12-19 14:14:59 -08:00
Keith Packard
4d62646142 Merge remote-tracking branch 'jeremyhu/master' 2013-12-16 09:27:57 -08:00
Adam Jackson
f4bfb14f53 configure: Fix a typo near dri3/shmfence detection
" is not the mate of ].

Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-13 15:08:44 -05:00
Adam Jackson
8248b4af31 glx: Add null pointer protection to __glGetProcAddress
This can't happen when GLX is the backing window system, but can
elsewhere.  We may as well protect against it at a high level.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-13 15:07:48 -05:00
Adam Jackson
128449dd64 present: Don't use the major/minor version from the protocol headers
We want to advertise the version we implement, not the version the
protocol headers happen to describe.

Reviewed-by: Jasper St. Pierre <<jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-13 14:59:04 -05:00
Adam Jackson
ec6087bf07 dri3: Don't use the major/minor version from the protocol headers
We want to advertise the version we implement, not the version the
protocol headers happen to describe.

Reviewed-by: Jasper St. Pierre <<jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-13 14:59:03 -05:00
Adam Jackson
e6fafd3de7 dri3: Guard against buggy clients
There's nothing to stop a client from sending these requests to screens
without DRI3 support, and if they do, we'll crash.  Let's not do that.

Reviewed-by: Jasper St. Pierre <<jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-13 14:58:40 -05:00
Jeremy Huddleston Sequoia
81ba89d670 configure.ac: Add PRESENT_LIB to XQUARTZ_LIBS
Undefined symbols for architecture x86_64:
  "_present_extension_init", referenced from:
      _staticExtensions in libXquartz.a(miinitext.o)
  "_present_register_complete_notify", referenced from:
      ___glXregisterPresentCompleteNotify in libglx.a(glxcmds.o)

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-12-13 01:39:44 -08:00
Jeremy Huddleston Sequoia
d7c9235ee2 XQuartz: Use asl_log_descriptor to log stdout/stderr of child processes
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-12-12 01:30:04 -08:00
Jeremy Huddleston Sequoia
ad8111d7c9 darwin: Don't leave stdin/stdout closed
<rdar://problem/15609419>

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-12-12 01:30:04 -08:00
Peter Hutterer
929795d50d dix: fix check for grab type
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-11 14:00:50 +10:00
Peter Hutterer
23394c7fea Xi: ungrab device when releasing a passive grab without ButtonReleaseMask (#71878)
If an touch triggers an async button grab and that grab does not have the
ButtonReleaseMask set, the TouchEnd is never delivered, deliveries is 0  and
the grab is never deactivated.

If the grab is pointer async and keyboard sync, the keyboard events are stuck
in EnqueueEvent until some other pointer event terminates the grab.

Change this to check for the number of listeners. If we're about to deliver a
TouchEnd to a passive pointer grab, the number of listeners is already 1 -
pointer grabs always accept so other listeners were removed.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-11 14:00:50 +10:00
Ben Gamari
c1d30b5bd7 Xi: Don't ActivateEarlyAccept POINTER_REGULAR listeners
Bug #71878 describes a bug resulting in the server ceasing to respond to
keyboard input after a touch event. The problem might be the following:

DeliverTouchBeginEvent tries to deliver an event to a listener of type
LISTENER_POINTER_REGULAR, taking the following if branch,

    if (listener->type == LISTENER_POINTER_REGULAR ||
        listener->type == LISTENER_POINTER_GRAB) {
        rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
                                       grab, xi2mask);
        if (rc == Success) {
            listener->state = LISTENER_IS_OWNER;
            /* async grabs cannot replay, so automatically accept this touch */
            if (dev->deviceGrab.grab &&
                dev->deviceGrab.fromPassiveGrab &&
                dev->deviceGrab.grab->pointerMode == GrabModeAsync)
                ActivateEarlyAccept(dev, ti);
        }
        goto out;
    }

DeliverTouchEmulatedEvent succeeds.  The deviceGrab meets all
three of the conditions of the inner if, enters
ActivateEarlyAccept which then fails due to,

    BUG_RETURN(ti->listeners[0].type != LISTENER_GRAB &&
               ti->listeners[0].type != LISTENER_POINTER_GRAB);

That is, despite listener->type == LISTENER_POINTER_REGULAR. With my
non-existent knowledge of XINPUT, it seems like the solution here
might be to only ActivateEarlyAccept when listener->type ==
LISTENER_POINTER_GRAB.

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-11 14:00:50 +10:00
Keith Packard
fe07ec19e2 present: recursively set window pixmaps on flip
Newly created windows inherit the pixmap of their parent, similarly,
reparenting a tree inherits the pixmap of the destination tree.

Making present preserve the invariant that unredirected windows always
have the same pixmap as their parent ensures that the above cases work
correctly.

v2: name the recursive function to 'set_tree_pixmap' instead of 'set_window_pixmap'

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-10 14:16:42 -08:00
Keith Packard
b3533d0b21 Bump version to 1.14.99.904 (1.15 RC4)
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-10 10:29:11 -08:00
Jon TURNEY
9a4d7572fe hw/xwin/glx: Rewrite WGL wrappers after Xserver conversion to direct GL dispatch
v1: Rewrite by Marc Haesen of the WGL wrapper function generation script to use
Khronos group XML.

v2: Remove -dispatchheader option, since dispatch.h doesn't exist anymore, use
the private glapi interface to construct the GL dispatch table for the native
WGL thunks.

v3:
Rewrite to generate shims for the OpenGL 1.2.1 (GL 1.2 + GL_ARB_imaging
+GL_ARB_multitexture + GL_ARB_texture_compression(?)) functions the server links
directly with rather than libGL.

These shims dispatch to either the mesa GL DLL, or a thunking DLL containing
cdecl-to-stcall wrapper functions for the native GL DLL.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-10 17:00:06 +00:00
Jon TURNEY
cb48877a3c glx: Consistently use ARB-suffixed names for ARB_multitexture functions
At the moment we have a mix of ARB and non-ARB suffixed forms for ARB_multitexture functions
e.g. glMultiTexCoord1fvARB and glMultiTexCoord1dv

Consistently use the ARB-suffixed form, assuming that is present in all libGL
which provide the OpenGL 1.2.1 ABI we expect to be able to directly link with.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-10 16:59:53 +00:00
Jon TURNEY
1a021f57a1 ephyr: Fix compilation when ./configure'd with --enable-debug
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessMouseMotion’:
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:946:188: error: ‘ephyrCurScreen’ undeclared (first use in this function)
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessButtonPress’:
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:980:186: error: ‘ephyrCurScreen’ undeclared (first use in this function)
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessButtonRelease’:
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:1007:186: error: ‘ephyrCurScreen’ undeclared (first use in this function)

Fix ephyr compilation when ./configure'd with --enable-debug after commit
46cf6bf569, some instances of ephyrCurScreen were
not converted to screen->pScreen->myNum.

v2: Don't use a trivial local variable which will be unused when ./configure'd
with --disable-debug

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-10 16:59:40 +00:00
Jon TURNEY
875dbcef5b configure.ac: Link XWin with present extension if we are building with it enabled
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-10 16:59:26 +00:00
Adam Jackson
e61e19959d xquartz/glx: Convert to non-glapi dispatch
CGL doesn't have anything like glXGetProcAddress, and the old code just
called down to dlsym in any case.  It's a little mind-warping since
dlopening a framework actually loads multiple dylibs, but that's just
how OSX rolls.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-12-10 08:04:30 -08:00
Adam Jackson
a668aa0e41 drisw: Wire up GetProcAddress
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-12-10 08:04:19 -08:00
Adam Jackson
4fcdfeb7bc dri2: wire up GetProcAddress
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-12-10 08:04:04 -08:00
Adam Jackson
47f00b3920 glx: Untangle the prototypes around the GetProcAddress thunk
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-12-10 08:03:50 -08:00
Adam Jackson
c1fd143f28 glx: Remove function stubs
Now that we're calling non-1.2 ABI things by function pointer this is no
longer needed.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-12-10 08:03:22 -08:00
Adam Jackson
6b93e1f5ff glx: Convert non-generated function pointer thunking
Same concept as the generated code conversion.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-12-10 08:02:42 -08:00
Adam Jackson
c4567a3760 glx: Convert generated code function pointer thunking
We're meant not to call these by name due to ABI.  Rather than try to
generate a bunch of little stub functions that do the lookup, just
inline it all directly into the calling function.

This does not cache results.  That's fine, this is not a performance
path, and if we're atop WGL then we effectively have to do this every
time anyway because wglGetProcAddress results are context-dependent.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Jon TURNEY <jon.turney@dronecode.org.uk>
2013-12-10 08:01:37 -08:00
Keith Packard
f69f4f417c Depend on latest glproto (1.4.17)
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-10 07:09:55 -08:00
Adam Jackson
576f3d36dd damageext: Die if we can't create the Xinerama resource type
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:37 -05:00
Adam Jackson
f10f36d91d damageext: Xineramify (v7)
v7: Don't bother making resources for the backing listeners. [keithp]

This is now slightly unlike how other resources are xineramified.  We
create N+1 internal damage listeners, one that's a real resource and
reflects the protocol view, and then one per backend screen where the
report function piles onto the protocol view.  The internal listeners
are not stored in the resource database directly, they just hang off the
xinerama resource. We don't wrap Subtract at the dispatch level, but we
do extend it for the Xinerama case to clip to the root window geometry.

As a result of the N+1 design here, the damage reports we generate are
not quite minimal.  However they are indistinguishable from sequential
rendering events happening before the client hears damage, and we don't
need to add a post-dispatch callback just for this one extension.

Add is probably (still) somewhat broken since it will only hit screen 0,
but Add really only exists for DRI1's sake, and DRI1 disables itself
with Xinerama enabled anyway.  In the absence of a use case, I'm leaving
it unwrapped under Xinerama; if someone wants to define how it ought to
work, be my guest.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:37 -05:00
Adam Jackson
808303fe52 fixes: Fix PanoramiXSetWindowShapeRegion for root windows (v2)
Root windows in Xinerama are in the coordinate space of their root window
pixmap, not in protocol space.

v2: Only translate for root windows, sice the window shape is
drawable-relative.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:37 -05:00
Adam Jackson
5c10c7ea21 fixes: Fix PanoramiXSetPictureClipRegion for root windows (v2)
Root windows in Xinerama are in the coordinate space of their root
window pixmap, not in protocol space.  This fixes 'xcompmgr -n' when
Xinerama is active.

v2: Only translate for root windows, since the clip origin is
drawable-relative.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
1dd839a425 composite: Fix COW creation for Xinerama (v2)
Say you have two 800x600 screens left/right of each other.  A window
that's 200x200 at +700+0 in protocol coordinate space will appear to be
at -100+0 in the coordinate space of the right hand screen.  Put another
way: windows are in the coordinate space of their root window pixmap.

We weren't doing this translation for the COW, so when rendering came in
to it you'd see the top-left chunk of the COW on all screens.  Cool
effect and all, but wrong.

v2: Only translate when Xinerama is active [keithp]

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
8dbe456aba xinerama: Export the screen region
damageext wants this so it can intersect subtract requests against the
root window geometry.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
c6d4c2a241 xfree86: Prefer fbdev to vesa
On UEFI machines you'd prefer fbdev to grab efifb instead of vesa trying
to initialize and failing in a way we can't unwind from.  On BIOS
machines this is harmless: either there is an fbdev driver and it'll
probably be more capable, or there's not and vesa will kick in anyway.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
7b5d4f147f composite: Don't double-redirect if someone asks for backing store twice
v2: Belt-and-suspenders the unredirection path [vsyrjala]

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
a2b2c271e0 composite: Automatically enable backing store support on the screen
... unless you explicitly disabled it with -bs on the command line, or
with the corresponding thing in xorg.conf.

v2: Drop a bogus hunk from compChangeWindowAttributes [vsyrjala]
v3: s/TRUE/WhenMapped/ [jcristau]

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
e0cac00560 bs: Set the screen's bs support level to WhenMapped
Since we're using RedirectAutomatic to do this, we don't actually
preserve contents when unmapped.

v2: Don't say WhenMapped if Composite didn't initialize [vsyrjala]

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
b61ccd5d9d smartsched: Tweak the default scheduler intervals
A default timeslice of 20ms means a pathological client can ruin up to
two frames per scheduler tick.  And a fifth of a second is just insane.

Pick two different numbers out of the hat.  A 5ms slice means you can
probably keep up with two or three abusive clients, and letting it burst
to 15ms should give you about all the timeslice you need for a
fullscreen game (that's doing server-side rendering for some reason).

If you're running on a system with a 10ms granularity on SIGALRM, then
this effectively changes the intervals to 10ms and 30ms.  Which is still
better, just not as better.

I suspect this is about as good as we can do without actually going
preemptive, which is an entire other nightmare.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
66310ea289 dri3: Disable when Xinerama is active
Pretty sure this can't work.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
793fd5eefb dri2: Disable when Xinerama is active
Would only work on ScreenRec 0, which means it's broken.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
2bf9210829 present: Disable when Xinerama is active
Among much else Present depends on RANDR types, and RANDR isn't properly
Xinerama-aware yet anyway.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Eric Anholt
ac772cb187 glx: Fix incorrect use of dri_interface.h version defines in driver probing.
If we extend __DRI_CORE or __DRI_SWRAST in dri_interface.h to allow a
new version, it shouldn't make old server code retroactively require
the new version from swrast drivers.

Notably, new Mesa defines __DRI_SWRAST version 4, but we still want to
be able to probe version 1 drivers, since we don't use any features
beyond version 1 of the struct.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-05 10:51:01 -08:00
Eric Anholt
6e926b18ca glx: Fix incorrect use of dri_interface.h version defines in extensions.
Those defines are so you can compile-time check "do I have a
dri_interface.h that defines this new field of the struct?"  You don't
want the server to claim it implements the new struct just because you
installed a new copy of Mesa.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-05 10:50:53 -08:00