platform/upstream/xorg-server.git
10 years agoDepend on latest glproto (1.4.17)
Keith Packard [Tue, 10 Dec 2013 15:09:17 +0000 (07:09 -0800)]
Depend on latest glproto (1.4.17)

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agodamageext: Die if we can't create the Xinerama resource type
Adam Jackson [Mon, 9 Dec 2013 18:16:01 +0000 (13:16 -0500)]
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>
10 years agodamageext: Xineramify (v7)
Adam Jackson [Mon, 16 Sep 2013 19:17:26 +0000 (15:17 -0400)]
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>
10 years agofixes: Fix PanoramiXSetWindowShapeRegion for root windows (v2)
Adam Jackson [Mon, 4 Nov 2013 22:49:34 +0000 (17:49 -0500)]
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>
10 years agofixes: Fix PanoramiXSetPictureClipRegion for root windows (v2)
Adam Jackson [Mon, 4 Nov 2013 22:49:33 +0000 (17:49 -0500)]
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>
10 years agocomposite: Fix COW creation for Xinerama (v2)
Adam Jackson [Thu, 7 Nov 2013 18:59:30 +0000 (13:59 -0500)]
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>
10 years agoxinerama: Export the screen region
Adam Jackson [Tue, 29 Oct 2013 14:44:07 +0000 (10:44 -0400)]
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>
10 years agoxfree86: Prefer fbdev to vesa
Adam Jackson [Fri, 15 Nov 2013 20:13:31 +0000 (15:13 -0500)]
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>
10 years agocomposite: Don't double-redirect if someone asks for backing store twice
Adam Jackson [Tue, 5 Nov 2013 15:12:28 +0000 (10:12 -0500)]
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>
10 years agocomposite: Automatically enable backing store support on the screen
Adam Jackson [Tue, 5 Nov 2013 15:08:17 +0000 (10:08 -0500)]
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>
10 years agobs: Set the screen's bs support level to WhenMapped
Adam Jackson [Tue, 5 Nov 2013 14:58:17 +0000 (09:58 -0500)]
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>
10 years agosmartsched: Tweak the default scheduler intervals
Adam Jackson [Tue, 5 Nov 2013 15:20:04 +0000 (10:20 -0500)]
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>
10 years agodri3: Disable when Xinerama is active
Adam Jackson [Fri, 8 Nov 2013 14:22:37 +0000 (09:22 -0500)]
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>
10 years agodri2: Disable when Xinerama is active
Adam Jackson [Fri, 8 Nov 2013 14:20:29 +0000 (09:20 -0500)]
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>
10 years agopresent: Disable when Xinerama is active
Adam Jackson [Fri, 8 Nov 2013 14:06:59 +0000 (09:06 -0500)]
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>
10 years agoglx: Fix incorrect use of dri_interface.h version defines in driver probing.
Eric Anholt [Fri, 15 Nov 2013 01:40:47 +0000 (17:40 -0800)]
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>
10 years agoglx: Fix incorrect use of dri_interface.h version defines in extensions.
Eric Anholt [Fri, 15 Nov 2013 01:40:46 +0000 (17:40 -0800)]
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>
10 years agoconfigure.ac: Fixup for "Require libpciaccess for int10"
Jon TURNEY [Fri, 29 Nov 2013 12:26:43 +0000 (12:26 +0000)]
configure.ac: Fixup for "Require libpciaccess for int10"

On 16/11/2013 01:00, Connor Behan wrote:
> A --disable-pciaccess build will fail with an int10 module other than
> stub.
>
> Signed-off-by: Connor Behan <connor.behan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  configure.ac | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index 5e621e0..a843770 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1822,6 +1822,9 @@ if test "x$XORG" = xyes; then
>   if test "x$CONFIG_UDEV_KMS" = xyes; then
>   AC_MSG_ERROR([Platform device enumeration requires libpciaccess])
>   fi
> + if test "x$INT10" != xstub; then
> + AC_MSG_ERROR([Cannot build int10 without libpciaccess])
> + fi
>   fi
>   AC_MSG_RESULT([$PCI])
>

This causes my build to fail where --disable-int10-module --disable-pciaccess
is the default (as INT10 still has the default value 'x86emu')

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agopresent: Report damage when flipping
Keith Packard [Tue, 26 Nov 2013 20:18:12 +0000 (12:18 -0800)]
present: Report damage when flipping

Limit damage to the 'update' region.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Also set the root window pixmap when flipping
Keith Packard [Tue, 26 Nov 2013 20:10:48 +0000 (12:10 -0800)]
present: Also set the root window pixmap when flipping

This makes sure that things like software cursors continue to work
while the screen is flipped.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Clear target_crtc if driver lacks Present support
Keith Packard [Tue, 26 Nov 2013 20:06:57 +0000 (12:06 -0800)]
present: Clear target_crtc if driver lacks Present support

If the driver doesn't have the necessary hooks for Present, then the
target_crtc needs to be set to NULL to make sure the extension uses
the present_fake code.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Send GLX_BufferSwapComplete events from present extension
Keith Packard [Fri, 22 Nov 2013 06:48:31 +0000 (22:48 -0800)]
present: Send GLX_BufferSwapComplete events from present extension

This allows GL to support the GLX_INTEL_swap_event extension.

v2: Return GLX_BLIT_COMPLETE_INTEL for unknown swap types

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Set window pixmap to flipped pixmap
Keith Packard [Tue, 26 Nov 2013 07:06:08 +0000 (23:06 -0800)]
present: Set window pixmap to flipped pixmap

This makes other drawing to the window appear on the screen.

Note that no child windows can be affected because only full-screen
windows are eligible for flipping, and so we only need to set pixmap
for the window itself.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Leave vblank on window list until flip complete
Keith Packard [Tue, 26 Nov 2013 07:10:17 +0000 (23:10 -0800)]
present: Leave vblank on window list until flip complete

If the window is destroyed, then we've got cleanup work to do, even if
the vblank has already been executed -- we need to clear the window
pointer so that we don't try to deliver events to it.

Leaving it on the window list meant that when walking that list, we
need to know whether the vblank is waiting to be executed or waiting
for the flip to complete, so a new 'queued' flag was added to the
vblank to distinguish between the two states.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Add a debug output line when skipping a pending present
Keith Packard [Tue, 26 Nov 2013 11:07:55 +0000 (03:07 -0800)]
present: Add a debug output line when skipping a pending present

When an application provides two pixmaps for the same MSC, the
previous one is skipped. This just dumps out some information at that point

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agomiext/sync: Handle libxshmfence API change
Keith Packard [Fri, 22 Nov 2013 06:45:18 +0000 (22:45 -0800)]
miext/sync: Handle libxshmfence API change

libxshmfence had an unfortunate 'int32_t' type for the mapped fence.
That changed to exposing a 'struct shmfence' instead, which is nice
and opaque and offers fine type checking across the API.

This patch requires the newer version of the library and uses
the new interface type.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
10 years agomiext: Move SyncShm FDs out of the way of clients
Keith Packard [Fri, 22 Nov 2013 06:12:34 +0000 (22:12 -0800)]
miext: Move SyncShm FDs out of the way of clients

Applications may end up allocating a bunch of shmfence objects, each
of which uses a file descriptor, which must be kept open lest some
other client ask for a copy of it later on.

Lacking an API that can turn a memory mapping back into a file
descriptor, about the best we can do is push the file descriptors out
of the way of other X clients so that we don't run out of the ability
to accept new connections.

This uses fcntl F_GETFD to push the FD up above MAXCLIENTS.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
10 years agoXext: Use SHMDIR and O_TMPFILE when creating mapping files
Keith Packard [Wed, 13 Nov 2013 05:16:33 +0000 (14:16 +0900)]
Xext: Use SHMDIR and O_TMPFILE when creating mapping files

ShmCreateSegment asks for a file descriptor for a memory mapped file
created by the X server. This patch uses O_TMPFILE where available,
and also uses the SHMDIR directory to store the files, both for the
O_TMPFILE and mkstemp cases.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
10 years agoSelect directory for MIT-SHM temp files at configure time
Keith Packard [Wed, 13 Nov 2013 03:17:10 +0000 (12:17 +0900)]
Select directory for MIT-SHM temp files at configure time

By default, this looks through a list of directories to find one which
exists, but can be overridden with --with-shared-memory-dir=PATH

This patch doesn't actually do anything with this directory, just
makes it available in the configuration

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
10 years agoXdmx: Initialize DMX extension even if not built with GLX support
Alan Coopersmith [Tue, 26 Nov 2013 06:19:34 +0000 (22:19 -0800)]
Xdmx: Initialize DMX extension even if not built with GLX support

dmxAddExtensions takes an argument to determine if it should just
initialize the DMX extension, or both DMX & GLX, but if GLX wasn't
compiled in, the entire call was #ifdef'ed out, leaving the DMX
extension unavailable.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoconfigure.ac: Require libpciaccess for int10
Connor Behan [Sat, 16 Nov 2013 01:00:40 +0000 (17:00 -0800)]
configure.ac: Require libpciaccess for int10

A --disable-pciaccess build will fail with an int10 module other than
stub.

Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoconfigure.ac: Require libpciaccess for platform bus support
Connor Behan [Sat, 16 Nov 2013 01:00:20 +0000 (17:00 -0800)]
configure.ac: Require libpciaccess for platform bus support

There is currently no reason to build with --enable-config-udev-kms and
--disable-pciaccess but anyone who tries this should know that the build
will fail.

Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoconfigure.ac: Add whitespace near PCI configuration
Connor Behan [Sat, 16 Nov 2013 01:00:00 +0000 (17:00 -0800)]
configure.ac: Add whitespace near PCI configuration

Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoBump release to 1.14.99.903 (1.15 RC3) xorg-server-1.14.99.903
Keith Packard [Sun, 24 Nov 2013 06:22:37 +0000 (22:22 -0800)]
Bump release to 1.14.99.903 (1.15 RC3)

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agomiext: Ensure xshmfence is only called when driver supports it
Keith Packard [Tue, 19 Nov 2013 06:36:17 +0000 (22:36 -0800)]
miext: Ensure xshmfence is only called when driver supports it

This provides a place for drivers to insert their own FD-based
SyncFence implementations, and prevents applications from using DRI3
SyncFence creation functions unless the driver has some support for
them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Fredrik Höglund <fredrik@kde.org>
10 years agoXext: Recover from miSyncInitFenceFromFD failure without crashing
Keith Packard [Tue, 19 Nov 2013 06:33:27 +0000 (22:33 -0800)]
Xext: Recover from miSyncInitFenceFromFD failure without crashing

miSyncDestroyFence must not be called unless miSyncInitFence has been
invoked, so if miSyncInitFenceFromFD fails, we must free the fence
manually.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Fredrik Höglund <fredrik@kde.org>
10 years agoglx/glxdri2: Unwrap EnterVT/LeaveVT upon CloseScreen
Chris Wilson [Sat, 5 Oct 2013 07:47:03 +0000 (08:47 +0100)]
glx/glxdri2: Unwrap EnterVT/LeaveVT upon CloseScreen

In a similar spirit to

commit d75e8146c414bfd512ba5dbd4a83acb334bbe19b
Author: Keith Packard <keithp@keithp.com>
Date:   Mon Jul 12 16:01:34 2010 -0700

    Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998

we need to unwrap our pScrn->EnterVT/LeaveVT hooks around server
regeneration or else we cause an infinite recursion on the next VT
switch afterwards.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1235516
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoxnest: Ignore GetImage() error in xnestGetImage() (v3)
Keith Packard [Sun, 24 Nov 2013 00:19:46 +0000 (16:19 -0800)]
xnest: Ignore GetImage() error in xnestGetImage() (v3)

(I found an amended version of this patch and applied the difference
here - keithp)

v3: Don't call Xsync before restoring error handler as any errors
    generated by XGetImage() should be processed when this call
    returns as suggested by Jamey Sharp <jamey@minilop.net>

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
10 years agopresent: When unflipping, copy to flip window rather than screen
Keith Packard [Wed, 20 Nov 2013 06:13:54 +0000 (22:13 -0800)]
present: When unflipping, copy to flip window rather than screen

unflip happens after the clip lists have been updated, so instead of
smashing the whole screen and drawing over other windows, just draw to
the original flip window; it'll have the right clip list and so the
copy will work just fine.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Block for wait_fence in present_execute
Keith Packard [Tue, 12 Nov 2013 02:03:42 +0000 (18:03 -0800)]
present: Block for wait_fence in present_execute

Pend presentation until wait_fence is also triggered by having the
SyncFence trigger invoke present_execute once triggered.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Signal destroyed flip window with vblank->window == NULL
Keith Packard [Sat, 9 Nov 2013 20:36:47 +0000 (12:36 -0800)]
present: Signal destroyed flip window with vblank->window == NULL

This eliminates dereferencing freed window pointers when there is a
flip for that window in progress. The flip will complete, and then
immediately get undone (as we can't stop an in-progress flip).

Remove the vblank->window_destroyed field as we can signal this with
vblank->window == NULL instead.

Change check to vblank->window == NULL in:

present_flip_notify

Add check for vblank->window == NULL in:
present_vblank_notify
present_execute

present_flip_notify was also using vblank->window->drawable.pScreen,
so stop doing that and use vblank->screen instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Ignore event_id 0 from driver vblank notify
Keith Packard [Sat, 9 Nov 2013 20:33:02 +0000 (12:33 -0800)]
present: Ignore event_id 0 from driver vblank notify

We use event_id 0 to mean 'no such event'; if a driver sends us that
event_id, make sure we don't accidentally match it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agopresent: Round fake MSC computations intead of truncating
Keith Packard [Thu, 7 Nov 2013 22:17:12 +0000 (14:17 -0800)]
present: Round fake MSC computations intead of truncating

If the timer fired too early, we'd sometimes mis-compute the MSC for
fake vblanks. Rounding the computation to the nearest MSC fixes this nicely.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoconfigure: allow for --enable-libunwind and --disable-libunwind
Peter Hutterer [Mon, 18 Nov 2013 22:07:09 +0000 (08:07 +1000)]
configure: allow for --enable-libunwind and --disable-libunwind

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>
10 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Thu, 14 Nov 2013 08:02:04 +0000 (17:02 +0900)]
Merge remote-tracking branch 'whot/for-keith'

10 years agomieq: Bump default queue size to 512
Adam Jackson [Tue, 29 Oct 2013 16:09:27 +0000 (12:09 -0400)]
mieq: Bump default queue size to 512

Based on some bugzilla scraping I did around November 2012.  Of xserver
bugs in Red Hat bugzilla with an EQ size message in the log, the
distribution looked like:

String                      | Matches
-------------------------------------
Increasing EQ size to 512   | 460
Increasing EQ size to 1024  | 52
Increasing EQ size to 2048  | 6
Increasing EQ size to 4096  | 0

Most of the "512" ones appear to be mostly harmless, some relatively
expensive path in either rendering or resource destruction simply taking
too long due to external pressures like paging or CPU contention.  So
let's raise the initial queue size, both to reduce the number of
spurious abrt reports and to drop fewer events in all but the most
pathological cases.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoxfree86: return NULL for compat output if no outputs.
Dave Airlie [Tue, 29 Oct 2013 16:09:26 +0000 (12:09 -0400)]
xfree86: return NULL for compat output if no outputs.

With outputless GPUs showing up we crash here if there are not outputs
try and recover with a bit of grace.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agotest: build the touch test only when building Xorg
Dan Horák [Tue, 29 Oct 2013 16:09:25 +0000 (12:09 -0400)]
test: build the touch test only when building Xorg

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dan Horák <dan@danny.cz>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoinclude: export key_is_down and friends
Peter Hutterer [Wed, 13 Nov 2013 07:14:11 +0000 (17:14 +1000)]
include: export key_is_down and friends

VNC needs key_is_down to check if a key is processed as down before it
simulates various key releases. Make it available, because I seriously can't
be bothered thinking about how to rewrite VNC to not need that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Keith Packard <keithp@keithp.com>
10 years agoStop including inline assembly .il file for Solaris Studio builds
Alan Coopersmith [Tue, 12 Nov 2013 22:46:04 +0000 (14:46 -0800)]
Stop including inline assembly .il file for Solaris Studio builds

Since all the inb/outb/etc. use in the X server itself (except for
xf86SlowBcopy) has been replaced by calls to libpciaccess, we no
longer need to pass inline assembly files to replace the gcc inline
assembly from hw/xfree86/common/compiler.h when building Xorg itself.

The .il files are still generated and installed in the SDK for the
benefit of drivers who may use them.

Binary diff of before and after showed that xf86SlowBcopy was the
only function changed across the Xorg binary and all modules built
in the Xserver build, it just calls the outb() function now instead
of having the outb instructions inlined, making it a slightly slower
bcopy.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agokdrive: fix cursor jumps on CursorOffScreen behavior
Peter Hutterer [Fri, 4 Oct 2013 00:55:52 +0000 (10:55 +1000)]
kdrive: fix cursor jumps on CursorOffScreen behavior

This patch fixes cursor jumps when there is a grab on the Xephyr window and
the pointer moves outside the window.

So on two side-by-side 640x480 screens, a coordinate of 0/481
triggers KdCursorOffscreen.

If the delta between two screens is 0, they share the same offset for
that dimension. When searching for the new screen, the loop always rules out
the current screen. So we get to the second screen, trigger the conditions
where dy <= 0 and decide that this new screen is the correct one. The result
is that whenever KdCursorOffScreen is called, the pointer jumps to the other
screen.

Change to check for dy < 0 etc. so that the cursor stays on the same screen if
there is no other screen at the target location.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agokdrive: modify ephyr events to use POINTER_DESKTOP and scale them to that
Peter Hutterer [Tue, 29 Oct 2013 04:24:41 +0000 (14:24 +1000)]
kdrive: modify ephyr events to use POINTER_DESKTOP and scale them to that

A multi-head Xephyr instance has the pointer stuck on one screen
because of bad coordinate calculation. The coordinates passed to
GetPointerEvents are per-screen, so the cursor gets stuck on the left-most
screen by default.

Adjust and mark the events as POINTER_DESKTOP, so the DIX
can adjust them accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agokdrive: handle WxH as valid geometry spec
Keith Packard [Thu, 14 Nov 2013 03:21:54 +0000 (13:21 +1000)]
kdrive: handle WxH as valid geometry spec

If a screen size was specified as WxH, the loop returned early and kdOrigin
was never advanced. Thus, screen->origin was always 0 (or whatever was given
at the -origin commandline flag).

If a screen size was given with a bit depth (WxHxD), kdOrigin would always
advance by the current screen, offsetting the next screen.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoephyr: xcb_connect returns an error, not NULL
Peter Hutterer [Tue, 29 Oct 2013 04:33:56 +0000 (14:33 +1000)]
ephyr: xcb_connect returns an error, not NULL

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoUpdate to version 1.14.99.902 xorg-server-1.14.99.902
Keith Packard [Thu, 14 Nov 2013 01:26:20 +0000 (10:26 +0900)]
Update to version 1.14.99.902

1.15 RC2

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoxext: Fix shmint.h to not use headers outside of sdk_HEADERS
Keith Packard [Tue, 12 Nov 2013 22:01:45 +0000 (07:01 +0900)]
xext: Fix shmint.h to not use headers outside of sdk_HEADERS

shmint.h is part of sdk_HEADERS, and so can't use anything not
included in sdk_HEADERS.

busfault.h includes dix-config.h which is not. Leave the use of
struct busfault in shmint.h and move the include of busfault.h to
shm.c.

protocol-versions.h is not part of sdk_HEADERS, so instead of using
that, just use XTRANS_SEND_FDS to choose whether to expose the fd
passing requests directly.

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Knut Petersen <Knut_Petersen@t-online.de>
Reviewed-by: Julien Cristau <jcristau@debian.org>
v2: also avoid using protocol-versions.h

10 years agoxfree86: Fix build without libpciaccess
Jeremy Huddleston Sequoia [Fri, 8 Nov 2013 22:55:33 +0000 (14:55 -0800)]
xfree86: Fix build without libpciaccess

Regression fix from commit 04ab07ca19236d6c9a947e065fb69b0dd0d16639

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Connor Behan <connor.behan@gmail.com>
10 years agoEnable XTRANS_SEND_FDS on Solaris too.
Alan Coopersmith [Fri, 8 Nov 2013 05:08:56 +0000 (21:08 -0800)]
Enable XTRANS_SEND_FDS on Solaris too.

Requires passing through the __EXTENSIONS__ and _XOPEN_SOURCE defines
in order to expose the msg_control members in struct msghdr.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoAvoid conflicts with Solaris <sys/regset.h> defines that clash with our names
Alan Coopersmith [Fri, 8 Nov 2013 05:05:33 +0000 (21:05 -0800)]
Avoid conflicts with Solaris <sys/regset.h> defines that clash with our names

When building on Solaris with _XOPEN_SOURCE set to a recent XPG release,
<stdlib.h> and other core headers start including <sys/regset.h>, which
has a bunch of unfortunately named macros such as "CS", "ES", etc. for
x86 & x64 registers which clash with existing variable & struct member
names in Xorg - so #undef these so they don't interfere with our use.

(Yes, have filed a bug against the system headers for exposing these,
 but this solves the problem for building on existing releases.)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoProper spelling of MAP_ANONYMOUS is MAP_ANON.
Keith Packard [Mon, 11 Nov 2013 23:48:41 +0000 (15:48 -0800)]
Proper spelling of MAP_ANONYMOUS is MAP_ANON.

The former doesn't exist on BSD and the latter is available everywhere
AFAIK (checked Solaris and Linux).

You also might want to wrap that line ;).

Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoGet rid of the rest of the FD passing code when XTRANS_SEND_FDS isn't set
Keith Packard [Thu, 7 Nov 2013 23:18:28 +0000 (15:18 -0800)]
Get rid of the rest of the FD passing code when XTRANS_SEND_FDS isn't set

req_fds and SetReqFds in include/dixstruct.h

ReadFdFromClient, WriteFdToClient and the FD flushing in os/io.c

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'jeremyhu/master'
Keith Packard [Mon, 11 Nov 2013 23:26:12 +0000 (15:26 -0800)]
Merge remote-tracking branch 'jeremyhu/master'

10 years agopresent: Don't try to initialize when building without present support
Adam Jackson [Thu, 7 Nov 2013 17:01:41 +0000 (12:01 -0500)]
present: Don't try to initialize when building without present support

There's a --disable-present, so it'd be nice if it worked.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agopresent: Change debug output a bit to help diagnose missing vblank signals
Keith Packard [Thu, 7 Nov 2013 11:19:42 +0000 (03:19 -0800)]
present: Change debug output a bit to help diagnose missing vblank signals

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoPresent: Check for window/fence destroyed when idling pixmaps
Keith Packard [Thu, 7 Nov 2013 07:56:26 +0000 (23:56 -0800)]
Present: Check for window/fence destroyed when idling pixmaps

A client destroying objects in the middle of an unflip can end up
having the screen flip window or fence set to NULL in the unflip
notify path. Check for these and don't try to use those objects.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoTrap SIGBUS to handle truncated shared memory segments
Keith Packard [Sun, 3 Nov 2013 21:12:40 +0000 (13:12 -0800)]
Trap SIGBUS to handle truncated shared memory segments

If a client passes a section of memory via file descriptor and then
subsequently truncates that file, the underlying pages will be freed
and the addresses invalidated. Subsequent accesses to the page will
fail with a SIGBUS error.

Trap that SIGBUS, figure out which segment was causing the error and
then allocate new pages to fill in for that region. Mark the offending
shared segment as invalid and free the resource ID so that the client
will be able to tell when subsequently attempting to use the segment.

Signed-off-by: Keith Packard <keithp@keithp.com>
v2: Use MAP_FIXED to simplify the recovery logic (Mark Kettenis)
v3: Also catch errors in ShmCreateSegment

Conflicts:
include/dix-config.h.in
include/xorg-config.h.in

10 years agoRequire libXtrans version 1.3.2
Keith Packard [Thu, 7 Nov 2013 07:22:51 +0000 (23:22 -0800)]
Require libXtrans version 1.3.2

This has the FD passing support included

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoXext: Enable MIT-SHM FD-passing request definitions only when possible
Keith Packard [Sun, 3 Nov 2013 18:08:15 +0000 (10:08 -0800)]
Xext: Enable MIT-SHM FD-passing request definitions only when possible

Check to see if xtrans FD passing is available and use that to
advertise the appropriate version of the SHM extension

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
10 years agoRequire xextproto version 7.2.99.901
Keith Packard [Thu, 7 Nov 2013 07:06:28 +0000 (23:06 -0800)]
Require xextproto version 7.2.99.901

This includes the MIT-SHM FD passing requests

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
10 years agoRemove dix-config.h config variables from xorg-config.h
Keith Packard [Thu, 7 Nov 2013 22:20:26 +0000 (14:20 -0800)]
Remove dix-config.h config variables from xorg-config.h

xorg-config.h includes dix-config, so there's no need to duplicate.

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMake XTrans FD passing support optional. Define only on Linux
Keith Packard [Thu, 7 Nov 2013 07:05:46 +0000 (23:05 -0800)]
Make XTrans FD passing support optional. Define only on Linux

Until other operating systems have a libXtrans port for FD passing,
disable this on non-Linux systems.

Note that this define affects how libXtrans gets built into the X
server, which is why it need only define the symbol

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoXQuartz: Don't sleep forever on exit if usleep() returns an error
Jeremy Huddleston Sequoia [Sun, 10 Nov 2013 19:40:27 +0000 (11:40 -0800)]
XQuartz: Don't sleep forever on exit if usleep() returns an error

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoXQuartz: Update Info.plist copyright years
Jeremy Huddleston Sequoia [Sun, 10 Nov 2013 19:26:49 +0000 (11:26 -0800)]
XQuartz: Update Info.plist copyright years

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoconfigure.ac: Move GLX section after DRI
Jeremy Huddleston Sequoia [Mon, 4 Nov 2013 20:13:45 +0000 (12:13 -0800)]
configure.ac: Move GLX section after DRI

The GLX section of configura.ac checks the state of DRI2, so it
needs to be after DRI2=auto is resolved.

Also reset libgl requirement to 7.1.0 in non-dri2 case.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoARM64: Add support for aarch64
Andreas Schwab [Thu, 15 Aug 2013 10:03:42 +0000 (12:03 +0200)]
ARM64: Add support for aarch64

Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoUse $GL_LIBS instead of -lGL for linking
Keith Packard [Wed, 6 Nov 2013 02:39:11 +0000 (18:39 -0800)]
Use $GL_LIBS instead of -lGL for linking

-lGL presumes that the GL library is in the system path, while
 $GL_LIBS is auto-detected.

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoLink with xshmfence, reference miSyncShmScreenInit in sdksyms
Keith Packard [Wed, 6 Nov 2013 02:37:12 +0000 (18:37 -0800)]
Link with xshmfence, reference miSyncShmScreenInit in sdksyms

This gets the server to link with xshmfence again, and also ensures
that the miSyncShm code is linked into the server with the reference
from sdksyms.

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoos: Actually use the computed clockid in GetTimeInMicros
Julien Cristau [Tue, 5 Nov 2013 15:08:21 +0000 (07:08 -0800)]
os: Actually use the computed clockid in GetTimeInMicros

The selection of which clock to use for this function was not actually
getting used when fetching the final clock value.

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agohw/xfree86: Link libdri3 only when DRI3 is defined
Keith Packard [Tue, 5 Nov 2013 03:01:26 +0000 (19:01 -0800)]
hw/xfree86: Link libdri3 only when DRI3 is defined

Don't attempt to link non-existant libraries...

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoDisable DRI3 and sync fence FD functions if xshmfence isn't available
Keith Packard [Sun, 3 Nov 2013 17:56:02 +0000 (09:56 -0800)]
Disable DRI3 and sync fence FD functions if xshmfence isn't available

Make sure the server can build when the xshmfence library isn't present

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoSet version to 1.14.99.901 (1.15 RC1) xorg-server-1.14.99.901
Keith Packard [Fri, 1 Nov 2013 08:01:58 +0000 (01:01 -0700)]
Set version to 1.14.99.901 (1.15 RC1)

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoAdd dri3 and present directorys to distribution
Keith Packard [Fri, 1 Nov 2013 08:43:59 +0000 (01:43 -0700)]
Add dri3 and present directorys to distribution

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Fri, 1 Nov 2013 07:34:18 +0000 (00:34 -0700)]
Merge remote-tracking branch 'whot/for-keith'

10 years agoconfig/APM: Add option to disable building of APM support on Linux
Egbert Eich [Wed, 14 Aug 2013 16:18:56 +0000 (18:18 +0200)]
config/APM: Add option to disable building of APM support on Linux

    APM support in the Xserver was used to restore the console mode
    prior to a power management event. This was to ensure the mode
    upon suspend/resume was one that the system firmware or kernel
    could deal with.
    APM support is now largely obsolete, KMS drivers don't require a
    mode restoration anyhow. Therefore it should be possible to disable
    this feature.

(small modification by keithp - move test for XF86PM flag after check
for APM, then move XF86PM flag to xorg-config.h.in)

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agosync: fix corner-case in triggering idle alarms
Peter Hutterer [Wed, 30 Oct 2013 05:40:58 +0000 (15:40 +1000)]
sync: fix corner-case in triggering idle alarms

ProcessInputEvent() resets the device idle times. If idle time was higher than
the lower bracket, this should trigger an event in the idle time wakeup
handler.

If processing is slow, the idle time may advance past the lower bracket
between the reset and the time the BlockHandler is called. In that case, we'd
never schedule a wakeup to handle the event, causing us to randomly miss
events.

Ran tests with a neg transition trigger on 5ms with 200 repeats of the test
and it succeeded. Anything below that gets a bit tricky to make sure the
server sees the same idle time as the client usleeps for.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoconfig/ACPI: Add option to disable building of ACPI support on Linux
Egbert Eich [Wed, 14 Aug 2013 16:18:39 +0000 (18:18 +0200)]
config/ACPI: Add option to disable building of ACPI support on Linux

ACPI support in the Xserver was used to restore the console mode
prior to a power management event. This was to ensure the mode
upon suspend/resume was one that the system firmware or kernel
could deal with.
The feature depended on acpid to be running. Most of this functionality
is now take over by systemd, KMS drivers don't require a mode restoration
anyhow. Therefore it should be possible to disable this feature under
some circumstances.

Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoDDX/Randr: Avoid server crash when xrandr SetConfig is called while switched away
Egbert Eich [Mon, 12 Aug 2013 16:21:33 +0000 (18:21 +0200)]
DDX/Randr: Avoid server crash when xrandr SetConfig is called while switched away

A call to Xrandr SetScreenConfig (for randr 1.1) causes the Xserver to
crash when xf86SetViewport() which does not check if the hardware is
accessible.
Wrap accesses to xf86SetViewport() with if (vtSema) { ... } to avoid that.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoDDX/Events: Distinguish between Input- and GeneralHandlers in xf86VTSwitch()
Egbert Eich [Mon, 12 Aug 2013 16:20:36 +0000 (18:20 +0200)]
DDX/Events: Distinguish between Input- and GeneralHandlers in xf86VTSwitch()

When enabling/disabling input handlers in xf86VTSwitch() we treat Input-
and GeneralHandlers equally. The result is that after a VT switch the
masks for EnabledDevices and AllSockets are equal and the distiction
between both types is lost.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoDDX/modes: Add a sanity check when using screen sizes from EDID
Egbert Eich [Sat, 5 Oct 2013 06:02:28 +0000 (08:02 +0200)]
DDX/modes: Add a sanity check when using screen sizes from EDID

EDID sometimes lies about screen sizes. Since the screen size is used
by clients to determine the DPI a wrong ration will lead to terrible
looking fonts.
Add a sanity check for the h/v ratio cutting off at 2.4. This would
still accept the cinemascope aspect ratio as valid.
Also add message suggesting to add a quirk table entry.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoDDX/DPMS: Call dixSaveScreens() also when screen is turned on
Egbert Eich [Wed, 14 Aug 2013 09:50:26 +0000 (11:50 +0200)]
DDX/DPMS: Call dixSaveScreens() also when screen is turned on

DMPS calls dixSaveScreens() when turned off but not when turned
on. In most cases this is irrelevant as DPMS is done when a
key is hit in which case dixSaveScreens() will be called to
unblank anyhow. This isn't the case if we use xset (or the
DPMS extension directly) to unblank.
Check screenIsSaved to make sure the state needs to be changed
before calling dixSaveScreens().

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoephyr: Ensure stride of private framebuffer is multiple of 4
Søren Sandmann Pedersen [Mon, 21 Oct 2013 21:11:56 +0000 (17:11 -0400)]
ephyr: Ensure stride of private framebuffer is multiple of 4

The fb layer of X can't deal with strides that are not a multiple of
4, so when Xephyr allocates its own framebuffer it should make sure to
align it.

This fixes crashes and rendering corruption when Xephyr runs in a
depth that is different from the host X server and its screen size is
not a multiple of 4 / depth. (This is particularly easy to trigger if
you use the -resizeable option).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoephyr: hostx_screen_init(): Fix bits_per_pixel and bytes_per_line
Søren Sandmann Pedersen [Mon, 21 Oct 2013 20:58:54 +0000 (16:58 -0400)]
ephyr: hostx_screen_init(): Fix bits_per_pixel and bytes_per_line

When the depth of the Xephyr server matches that of the host X server,
Xephyr simply uses the buffer associated with the XImage as its
framebuffer. In this case, it is correct to get the bits_per_pixel and
bytes_per_line values returned from hostx_screen_init() from the XImage.

However, when the depth doesn't match the host, Xephyr uses a private
framebuffer that is periodically copied to the XImage. In this case,
the returned values of bits_per_pixel and bytes_per_line should be
those of the private framebuffer, not those of the XImage.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxf86AddBusDeviceToConfigure(): Store device in DevToConfig[i].pVideo
Søren Sandmann Pedersen [Tue, 8 Oct 2013 21:45:40 +0000 (17:45 -0400)]
xf86AddBusDeviceToConfigure(): Store device in DevToConfig[i].pVideo

After fc3ab84d the pVideo field in DevToConfig[i] is no longer
initialized, so it's always NULL. This causes the duplicate finding
algorithm in the beginning of the function to not work anymore as it
is based on this field.

The symptom of this bug is that X -configure reports

    Number of created screens does not match number of detected devices.
      Configuration failed.
    Server terminated with error (2). Closing log file.

rather than producing a working config file.

This patch fixes that bug by initializing the field before calling
xf86PciConfigureNewDev().

Cc: tvignatti@gmail.com
Signed-off-by: Soren Sandmann <ssp@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoMerge remote-tracking branch 'jeremyhu/master'
Keith Packard [Fri, 1 Nov 2013 01:18:19 +0000 (18:18 -0700)]
Merge remote-tracking branch 'jeremyhu/master'

10 years agomiext/damage: Partial revert of "Only wrap into the GC ops chain if there's a listene...
Jeremy Huddleston Sequoia [Thu, 31 Oct 2013 15:57:56 +0000 (08:57 -0700)]
miext/damage: Partial revert of "Only wrap into the GC ops chain if there's a listener (v3)"

Fixes regression from: 4dc2a76740d921c824a4d8193f39dd373475f02a

http://lists.x.org/archives/xorg-devel/2013-May/036241.html
https://trac.macports.org/ticket/38993

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'keithp/dri3'
Keith Packard [Fri, 1 Nov 2013 00:05:48 +0000 (17:05 -0700)]
Merge remote-tracking branch 'keithp/dri3'

10 years agoglx: Lie about GLX_Y_INVERTED_EXT
Adam Jackson [Thu, 31 Oct 2013 22:39:22 +0000 (18:39 -0400)]
glx: Lie about GLX_Y_INVERTED_EXT

Well, that was lame.  The problem with reporting y inversion honestly is
that libGL asks the driver _its_ opinion of Y inversion, which it just
fabricates from whole cloth.  So then when libGL goes to compare the
driver's idea of fbconfigs with that of the server - a fairly dumb idea
to begin with - nothing matches, and direct rendering fails, and
sadness.

So until the DRI drivers are fixed we should just continue to lie about
Y inversion.  GLX_DONT_CARE is what libGL would make up for that
attribute if we hadn't sent it, so just send that instead.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agopresent: Add Present extension
Keith Packard [Thu, 11 Jul 2013 23:11:57 +0000 (16:11 -0700)]
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>
10 years agodri3: Add DRI3 extension
Keith Packard [Wed, 10 Apr 2013 02:59:39 +0000 (19:59 -0700)]
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>
10 years agoAdd support for MIT-SHM AttachFd request
Keith Packard [Thu, 17 Jan 2013 21:46:55 +0000 (13:46 -0800)]
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>