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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>