platform/upstream/xorg-server.git
10 years agoBump to version 1.15.99.902. Closing the 1.16 merge window. upstream/1.15.99.902 xorg-server-1.15.99.902
Keith Packard [Tue, 8 Apr 2014 21:25:18 +0000 (14:25 -0700)]
Bump to version 1.15.99.902. Closing the 1.16 merge window.

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agodri3: Fix dri3_open API change by adding new dri3_open_client
Keith Packard [Fri, 4 Apr 2014 23:28:43 +0000 (16:28 -0700)]
dri3: Fix dri3_open API change by adding new dri3_open_client

Xwayland will eventually need the current client in dri3_open. Simply
changing that API is not an option though as other drivers that
implement DRI3 will not have a matching function signature and will
crash when called.

Add a new dri3_open_client function pointer and bump
DRI3_SCREEN_INFO_VERSION so that drivers can be aware of the new
function which will be used in preference to the old function when
available.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anhole <eric@anholt.net>
10 years agoAdd a return value to load_cursor_argb() to allow it to report failure
Michael Thayer [Mon, 31 Mar 2014 09:21:42 +0000 (11:21 +0200)]
Add a return value to load_cursor_argb() to allow it to report failure

load_cursor_argb() may need to be able to fail and have the server fall back
to a software cursor in at least the following circumstances.
1) The hardware can only support some ARGB cursors and this does not just
depend on cursor size.
2) Virtual hardware may not wish to pass through a cursor to the host at a
particular time but may wish to accept the same cursor at another time.
This patch adds a return value to the API and makes the server do the
software fall-back on failure.

Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoSet a flag property on the root window to say if the X server VT is active
Michael Thayer [Mon, 31 Mar 2014 09:19:16 +0000 (11:19 +0200)]
Set a flag property on the root window to say if the X server VT is active

An X11 client may need to know whether the X server virtual terminal is
currently the active one.  This change adds a root window property which
provides that information.  Intended interface user: the VirtualBox Guest
Additions.

Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoAdd pScreen->NameWindowPixmap hook
Daniel Stone [Thu, 3 Apr 2014 17:22:50 +0000 (18:22 +0100)]
Add pScreen->NameWindowPixmap hook

This hook allows drivers to be notified when a pixmap gains a new ID.

(ABI break.)

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'krh/xwayland-for-keithp'
Keith Packard [Thu, 3 Apr 2014 22:35:01 +0000 (15:35 -0700)]
Merge remote-tracking branch 'krh/xwayland-for-keithp'

10 years agoXwayland DDX
Kristian Høgsberg [Tue, 11 Mar 2014 23:11:39 +0000 (16:11 -0700)]
Xwayland DDX

Started out as an Xorg module to be used from Xorg drivers to let
Xorg run under a wayland server.  The idea was to be able to reuse the
2D acceleration from the Xorg driver.  Now with glamor being credible,
a better plan is to just make Xwayland its own DDX, similar to Xwin
and Xquartz.  This is a much better fit, as much of the code in the
original approach had to hack around Xorg doing Xorg things like take
over the VT, probe input devices and read config files.  Another big win
is that Xwayland dosn't need to be setuid root.

The Xwayland support for DRI3, Glamor and render nodes was done by
Axel Davy <axel.davy@ens.fr>, who also did a lot of work on the rebase
to the Xwayland DDX.

Contributions from:

  Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
  Corentin Chary <corentin.chary@gmail.com>
  Daniel Stone <daniel@fooishbar.org>
  Kristian Høgsberg <krh@bitplanet.net>
  Robert Bragg <robert@linux.intel.com>
  Scott Moreau <oreaus@gmail.com>
  Tiago Vignatti <tiago.vignatti@intel.com>
  Giovanni Campagna <gcampagn@redhat.com>
  Jonas Ådahl <jadahl@gmail.com>
  Ray Strode <rstrode@redhat.com>
  Trevor McCort <tjmccort@gmail.com>
  Rui Matos <tiagomatos@gmail.com>
  Axel Davy <axel.davy@ens.fr>
  Jasper St. Pierre <jstpierre@mecheye.net>

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
10 years agoglamor: Add glamor_program based poly_text and image_text
Keith Packard [Wed, 2 Apr 2014 04:15:48 +0000 (21:15 -0700)]
glamor: Add glamor_program based poly_text and image_text

Accelerates text painting with GPU-based geometry computation and stippling

v2: Simplify get_glyphs, expand single character variable names to
    more descriptive ones. (Markus Wick)
v3: Rebase against the glamor_prepare_* un-renaming (changes by anholt).

Improves x11perf -f8text by 417.908% +/- 11.0144% (n=10)

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Use glamor_program for glamor_glyphblt
Keith Packard [Wed, 2 Apr 2014 04:15:47 +0000 (21:15 -0700)]
glamor: Use glamor_program for glamor_glyphblt

This constructs suitable shaders using the glamor_program
infrastructure for poly glyph blt, and then gets rid of the no-op
wrapper of miImageGlyphBlt.

Improves x11perf -f8text by 11.6221% +/- 1.04585% (n=10)

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Add glamor_program based poly_fill_rect
Keith Packard [Wed, 2 Apr 2014 04:15:46 +0000 (21:15 -0700)]
glamor: Add glamor_program based poly_fill_rect

This accelerates poly_fill_rect using GPU-based geometry computation

Improves x11perf -rect100 by 41.5127% +/- 7.63888% (n=10)
Improves x11perf -rect10 by 3745.72% +/- 94.7503% (n=6)

v2: Rebase on skipping the prepare rewrite for now, and fix the GLSL
    1.20 and GLES2 cases (changes by anholt).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Add glamor_program based fill/set/get spans
Keith Packard [Wed, 2 Apr 2014 04:15:45 +0000 (21:15 -0700)]
glamor: Add glamor_program based fill/set/get spans

This accelerates spans operations using GPU-based geometry computation

-wellipse500 goes from about 4k/sec before the patch, to ~8k/sec in
the GLES2 fallback loop, to ~100k/sec in desktop mode.

v2: Rebase on skipping the prepare rewrite for now, and fix the GLSL
    1.20 and GLES2 cases (changes by anholt).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Add simple upload/download functions in glamor_transfer
Keith Packard [Wed, 2 Apr 2014 04:15:43 +0000 (21:15 -0700)]
glamor: Add simple upload/download functions in glamor_transfer

These use glTexSubimage2D for upload and glReadPixels for
download. There are a variety of interfaces to the basic function as
needed by the callers.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Use plain GLSL 1.20 features for fill code.
Keith Packard [Wed, 2 Apr 2014 04:15:42 +0000 (21:15 -0700)]
glamor: Use plain GLSL 1.20 features for fill code.

This prevents performance regressions from losing acceleration support
on older hardware as we transition to using glamor_program.c for
acceleration.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Compute supported GLSL version and save in screen private
Keith Packard [Wed, 2 Apr 2014 04:15:42 +0000 (21:15 -0700)]
glamor: Compute supported GLSL version and save in screen private

This currently computes the GLSL version in a fairly naïve fashion,
and leaves that in the screen private for other users. This will let
us update the version computation in one place later on.

v2: Drop an accidental rebase-squashed hunk (change by anholt).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agofb: Publish fbGlyphs and fbUnrealizeGlyph
Keith Packard [Wed, 2 Apr 2014 04:15:41 +0000 (21:15 -0700)]
fb: Publish fbGlyphs and fbUnrealizeGlyph

This lets other code jump directly into the fb code for fallbacks

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Bail from composite when pixmap cannot be uploaded
Keith Packard [Wed, 2 Apr 2014 03:54:22 +0000 (20:54 -0700)]
glamor: Bail from composite when pixmap cannot be uploaded

I think the sense of the return value was just flipped here; if you
return TRUE, then the calling code assumes that the pixmap *has* been
uploaded and that an FBO is available. When it tries to use it, it
crashes though. Returning false makes the caller bail back to software.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Remove warning message when pixmap cannot be stored in a texture
Keith Packard [Wed, 2 Apr 2014 03:54:21 +0000 (20:54 -0700)]
glamor: Remove warning message when pixmap cannot be stored in a texture

This happens when you have 4bpp pixmaps; it's not an error, so stop
flooding the log file when it happens.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Public polyLines function is glamor_poly_lines_nf
Keith Packard [Wed, 2 Apr 2014 03:54:20 +0000 (20:54 -0700)]
glamor: Public polyLines function is glamor_poly_lines_nf

There was a spurious declaratoin in glamor.h for glamor_poly_line_nf

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Initialize XV shaders from glamor_xv_init instead of glamor_init
Keith Packard [Wed, 2 Apr 2014 03:54:19 +0000 (20:54 -0700)]
glamor: Initialize XV shaders from glamor_xv_init instead of glamor_init

The glamor_init calls to glamor_init_xv_shader were never getting run
because GLAMOR_XV was never defined. Instead of trying to make that
work, fix glamor_xv_init to make the call instead.

Further, just get rid of the glamor_fini_xv_shader function entirely
as the shader program will be destroyed when the context is destroyed
at server reset time.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: SetWindowPixmap is not related to RENDER
Keith Packard [Wed, 2 Apr 2014 03:54:18 +0000 (20:54 -0700)]
glamor: SetWindowPixmap is not related to RENDER

Move the configuration of screen->SetWindowPixmap out from under it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: glamor_poly_point_nf cannot fail for non-DDX pixmaps
Keith Packard [Wed, 2 Apr 2014 03:54:15 +0000 (20:54 -0700)]
glamor: glamor_poly_point_nf cannot fail for non-DDX pixmaps

All of the glamor _nf functions must check to see if the DDX can
access the pixmap directly before returning failure back to the
driver; this restructures the point code to split out the _nf checking
from the _gl code.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoRevert "glx: Make sure we get an FBConfig the root window's visual."
Eric Anholt [Fri, 21 Mar 2014 20:13:27 +0000 (13:13 -0700)]
Revert "glx: Make sure we get an FBConfig the root window's visual."

This reverts commit b5a61239e2fef167c229154d7919ff862503e3f3.

Not only did I screw up and introduce a warning, it turns out
glXChooseFBConfig() explicitly ignores this attribute.  Thanks, GLX.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
10 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Thu, 3 Apr 2014 17:44:28 +0000 (10:44 -0700)]
Merge remote-tracking branch 'whot/for-keith'

10 years agoRevert "xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP"
Peter Hutterer [Wed, 2 Apr 2014 03:55:10 +0000 (13:55 +1000)]
Revert "xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP"

This was the wrong fix to the problem, and it triggered a change in XKB
behavior: previously a button event would unlock a latched modifier, now it
doesn't anymore.
https://bugs.freedesktop.org/show_bug.cgi?id=73155

Note that the new behavior is is strictly spec compliant but we've had the
other behavior for a long time so we shouldn't break it.

The bug this patch originally fixed was a null-pointer dereference when
releasing button events on server shutdown. This was addressed by the commit
below, so the need for this patch has gone away anyway.

commit 3e4be4033aed78b2bb3a18d51f0963989efd1af3
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jan 25 11:47:32 2013 +1000

    dix: when shutting down slave devices, shut down xtest devices last

This reverts commit 2decff6393a44b56d80d53570718f95354fde454.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
10 years agoxf86LogInit: log to XDG_DATA_HOME when not running as root
Hans de Goede [Tue, 1 Apr 2014 09:24:17 +0000 (11:24 +0200)]
xf86LogInit: log to XDG_DATA_HOME when not running as root

When no logfile was specified (xf86LogFileFrom == X_DEFAULT) and we're not
running as root log to $XDG_DATA_HOME/xorg/Xorg.#.log as Xorg won't be able to
log to the default /var/log/... when it is not running as root.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoglamor: Expose glamor_destroy_pixmap()
Kristian Høgsberg [Tue, 1 Apr 2014 01:04:07 +0000 (18:04 -0700)]
glamor: Expose glamor_destroy_pixmap()

When we create a glamor pixmap by calling glamor_create_pixmap()
directly, we need to call glamor_destroy_pixmap() to destroy it.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: Add new GLAMOR_CREATE_PIXMAP_NO_TEXTURE pixmap create flag
Kristian Høgsberg [Tue, 1 Apr 2014 01:00:54 +0000 (18:00 -0700)]
glamor: Add new GLAMOR_CREATE_PIXMAP_NO_TEXTURE pixmap create flag

This flag lets a DDX allocate a glamor pixmap without allocating the
texture that backs it.  The DDX can then allocate the texture itself
and then set it later.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: Move glamor_egl_screen_init() prototype to glamor.h
Kristian Høgsberg [Tue, 1 Apr 2014 00:59:18 +0000 (17:59 -0700)]
glamor: Move glamor_egl_screen_init() prototype to glamor.h

A DDX that implements the glamor EGL functions need to pull in this
prototype but shouldn't need to pull in glamor_priv.h

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agodri3: Allow asynchronous implementation for dri3_open
Kristian Høgsberg [Fri, 28 Mar 2014 06:47:59 +0000 (23:47 -0700)]
dri3: Allow asynchronous implementation for dri3_open

By passing the client pointer to the dri3_open implementation, we allow
the clients to implement the open callback asynchronously.  If the
client ignore count is positive after returning from dri3_open, we
assume that authentication is in progress and doesn't send the reply.
The code to send the reply is moved into a helper function, which the
implementation can call upon receiving its authenticaion reply.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agocomposite: Add exception mechanism for implicit redirection policy
Kristian Høgsberg [Fri, 28 Mar 2014 05:15:28 +0000 (22:15 -0700)]
composite: Add exception mechanism for implicit redirection policy

Normally composite will decide to add implicit redirection when a
window with an alternate visual is a parent of a window with a regular
visual or vice versa.  This uses extra pixmap memory and incurs an extra
copy.  This exception mechanism provides a way for a DDX to override this
if the DDX knows that its acceleration architecture will render correctly.

The relevant case is that of an RGB window reparented into a ARGB parent
frame window.  If the DDX knows that the acceleration architecture in use
will pad the alpha channel to opaque when rendering to the RGB window,
the implicit redirection can be avoided.

This patch adds a new composite function:

  CompositeRegisterImplicitRedirectionException()

which lets a DDX register a pair of parent and child window visuals, that
will not be implicitly redirected even if the normal policy would have
made that choice.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoMake XYToWindow a screen function
Keith Packard [Tue, 1 Apr 2014 06:55:25 +0000 (23:55 -0700)]
Make XYToWindow a screen function

This allows DDXen to override the window picking to account for
native windows not seen by the X server.  The bulk of the picking logic
is exposed as a new helper function, miSpriteTrace().  This function
completes the sprite trace filled out by the caller, and can be set up
to start the search from a given toplevel window.

v2: Leave existing XYToWindow API in place for API compatibility

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoconfigure: Change DEFAULT_LOGPREFIX to really be a filename prefix
Hans de Goede [Wed, 26 Mar 2014 11:24:49 +0000 (12:24 +0100)]
configure: Change DEFAULT_LOGPREFIX to really be a filename prefix

Rather then a full path prefix, this is a preparation patch for adding
support for logging to another location when not running as root.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoMerge remote-tracking branch 'jturney/master'
Keith Packard [Tue, 1 Apr 2014 06:24:56 +0000 (23:24 -0700)]
Merge remote-tracking branch 'jturney/master'

10 years agomi: Hush extension initialization (#75870)
Adam Jackson [Thu, 27 Mar 2014 15:48:39 +0000 (11:48 -0400)]
mi: Hush extension initialization (#75870)

Printing these as ErrorF is fairly obnoxious, since it means the
non-hardware servers now spew stuff to the console for entirely routine
events.  And actually, printing these at all is fairly obnoxious, since
a) we're printing a line for every extension, whether it's enabled or
not, and b) we're not actually initializing the extension at this point.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agofb: fix fast-path blt detection
Keith Packard [Tue, 25 Mar 2014 15:21:16 +0000 (08:21 -0700)]
fb: fix fast-path blt detection

The width parameter is used to disable the blit fast-path (memcpy) when
source and destination rows overlap in memory. This check was added in [0].

Unfortunately, the calculation to determine if source and destination
lines overlapped was incorrect:
  (1) it converts width from pixels to bytes, but width is actually in
      bits, not pixels.
  (2) it adds this byte offset to dst/srcLine, which implicitly converts
      the offset from bytes to sizeof(FbBits).

Fix both of these by converting addresses to byte pointers and width
to bytes and doing comparisons on the resulting byte address.

For example:
A 32-bpp 1366 pixel-wide row will have
  width = 1366 * 32 = 43712 bits
  bpp = 32
  (bpp >> 3) = 4
  width * (bpp >> 3) = 174848 FbBits
  (FbBits *)width => 699392 bytes

So, "careful" was true if the destination line was within 699392 bytes,
instead of just within its 1366 * 4 = 5464 byte row.

This bug causes us to take the slow path for large non-overlapping rows
that are "close" in memory.  As a data point, XGetImage(1366x768) on my
ARM chromebook was taking ~140 ms, but with this fixed, it now takes
about 60 ms.
  XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt()

[0] commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Apr 21 16:37:11 2011 -0400

    fb: Fix memcpy abuse

    The memcpy fast path implicitly assumes that the copy walks
    left-to-right.  That's not something memcpy guarantees, and newer glibc
    on some processors will indeed break that assumption.  Since we walk a
    line at a time, check the source and destination against the width of
    the blit to determine whether we can be sloppy enough to allow memcpy.
    (Having done this, we can remove the check for !reverse as well.)

v3: Convert to byte units

This first checks to make sure the blt is byte aligned, converts all
of the data to byte units and then compares for byte address range
overlap between source and dest.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
10 years agoHandle -displayfd and an explicit display number sensibly
Jon TURNEY [Mon, 11 Mar 2013 14:34:32 +0000 (14:34 +0000)]
Handle -displayfd and an explicit display number sensibly

Handle -displayfd and an explicit display number sensibly, e.g. use the
explicitly specified display number, and write it to the displayfd

v2: displayfd might be 0, so use -1 as invalid value
v3: Rebase for addition of NoListenAll flag

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoFix build when configured --enable-debug
Jon TURNEY [Mon, 24 Mar 2014 17:32:10 +0000 (17:32 +0000)]
Fix build when configured --enable-debug

Include os.h for ErrorF() to fix implicit-function-declaration warnings when
configured with --enable-debug.

hw/xfree86/parser/DRI.c: In function 'xf86parseDRISection':
hw/xfree86/parser/DRI.c:87:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration]
hw/xfree86/parser/Extensions.c: In function 'xf86parseExtensionsSection':
hw/xfree86/parser/Extensions.c:77:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
10 years agoFix ephyr build with --disable-glamor
Jon TURNEY [Mon, 24 Mar 2014 17:32:09 +0000 (17:32 +0000)]
Fix ephyr build with --disable-glamor

See http://tinderbox.x.org/builds/2014-03-23-0010/logs/xserver/#build

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Julien Cristau <jcristau@debian.org>
10 years agoBuild fbcmap_mi.c once, rather than once for each DDX
Jon TURNEY [Mon, 24 Feb 2014 20:45:51 +0000 (20:45 +0000)]
Build fbcmap_mi.c once, rather than once for each DDX

Build fbcmap_mi.c once, rather than once for each DDX, and make it part of libfb
or libwfb convenience library.

Since 84e8de1271bb11b5b4b9747ae4647f47333a8ab7 we don't have fbcmap.c

This is a sort of revert of 17d85387d1e6851d35474b65929e268ca64ef65b

v2: Remove libkdrivestubs.la from configure.ac

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
10 years agoBuild Xi/stubs.c once as a convenience library, rather than once for each DDX which...
Jon TURNEY [Fri, 21 Feb 2014 18:11:33 +0000 (18:11 +0000)]
Build Xi/stubs.c once as a convenience library, rather than once for each DDX which wants to use it

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
10 years agoBuild dpmsstubs.c once as a convenience library, rather than once for each DDX which...
Jon TURNEY [Wed, 7 Sep 2011 11:50:20 +0000 (12:50 +0100)]
Build dpmsstubs.c once as a convenience library, rather than once for each DDX which wants to use it

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
10 years agoXephyr: restore initial window resize lost in xcb conversion
Julien Cristau [Wed, 26 Mar 2014 22:24:20 +0000 (23:24 +0100)]
Xephyr: restore initial window resize lost in xcb conversion

The XResizeWindow call wasn't replaced by the xcb equivalent, so we
were no longer setting the initial window size, only wm size hints.

Regression from commit a2b73da "Xephyr: start converting hostx.c over to
xcb"

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74849

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reported-by: Laércio de Sousa <lbsousajr@gmail.com>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: Add glamor_program PolyPoint implementation
Keith Packard [Wed, 12 Mar 2014 21:35:27 +0000 (14:35 -0700)]
glamor: Add glamor_program PolyPoint implementation

This accelerates poly point when possible by off-loading all geometry
computation to the GPU.

Improves x11perf -dot performance by 28109.5% +/- 1022.01% (n=3)

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Move glamor_poly_segment to separate glamor_segment.c file
Keith Packard [Sat, 22 Mar 2014 22:20:49 +0000 (15:20 -0700)]
glamor: Move glamor_poly_segment to separate glamor_segment.c file

There's no reason to mix PolyPoint and PolySegment in the same file.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-off-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Add infrastructure for generating shaders on the fly
Keith Packard [Wed, 12 Mar 2014 21:27:59 +0000 (14:27 -0700)]
glamor: Add infrastructure for generating shaders on the fly

This just adds a bunch of support code to construct shaders from
'facets', which bundle attributes needed for each layer of the
rendering system. At this point, that includes only the primitive and
the fill stuff.

v2: Correct comment in glamor transform about 1/2 pixel correction needed
    for GL_POINT. (Eric Anholt)
v3: Rebase on Markus's cleanups (change by anholt)

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Add helper functions to walk pixmap tiling
Keith Packard [Fri, 14 Mar 2014 06:12:27 +0000 (23:12 -0700)]
glamor: Add helper functions to walk pixmap tiling

This adds a few helper functions to make pixmap fbo access symmetrical
between the single fbo and tiled cases.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Add bounding box to one-fbo pixmaps
Keith Packard [Fri, 14 Mar 2014 06:11:40 +0000 (23:11 -0700)]
glamor: Add bounding box to one-fbo pixmaps

This lets code treat the one-fbo pixmaps more symmetrically with the
tiled pixmaps.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Get testing code using small FBOs working again
Keith Packard [Wed, 19 Mar 2014 04:23:24 +0000 (21:23 -0700)]
glamor: Get testing code using small FBOs working again

Glamor has a mode where pixmaps will be constructed from numerous
small FBOs. This allows testing of the tiled pixmap code without
needing to create huge pixmaps.

However, the render glyph code assumed that it could create a pixmap
large enough for the glyph atlas. Instead of attempting to fix that
(which would be disruptive and not helpful), I've added a new pixmap
creation usage, GLAMOR_CREATE_NO_LARGE which forces allocation of a
single large FBO.

Now that we have pixmaps with varying FBO sizes, I then went around
and fixed the few places using the global FBO max size and replaced
that with the per-pixmap FBO tiling sizes, which were already present
in each large pixmap.

Xephyr has been changed to pass GLAMOR_CREATE_NO_LARGE when it creates
the screen pixmap as it doesn't want to deal with tiling either.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomi: miPutImage with XYPixmap failed at depth 32 on 64-bit machines
Keith Packard [Wed, 19 Mar 2014 04:35:41 +0000 (21:35 -0700)]
mi: miPutImage with XYPixmap failed at depth 32 on 64-bit machines

The X server still has 'unsigned long' in a few places to hold 32 bit
values. One of those is in miPutImage where it's holding the temporary
planemask for XYPixmap format images.

It computed the highest plane in the source image with 1 << (depth -
1). On 64-bit machines, taking that value and storing it in an
unsigned long promotes it to a signed 64-bit value
(0xffffffff80000000).

Then, it loops over that value, shifting one bit right each time,
waiting for it to go to zero.. That takes 64 iterations, and ends up
with some mystic planemask values *and* walking off the end of the
source image data and out into space.

A simple cast is all that is required to compute the correct initial
plane mask (0x0000000080000000), at which point the loop operates
correctly once again.

Checking the fbPutImage code, I note that this same bug was fixed
in 2006 by Aaron Plattner in commit
f39fd4242902eaa862321d39337f429dd14ebacf

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
10 years agodix: Allow NULL stipple in ChangeGC
Keith Packard [Sun, 16 Mar 2014 06:53:53 +0000 (23:53 -0700)]
dix: Allow NULL stipple in ChangeGC

miOpqStipDrawable resets the stipple after painting. When that stipple
was NULL, ChangeGC needs to handle that and not crash.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-off-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Drop feature dependent optimization on startup.
Markus Wick [Tue, 18 Mar 2014 08:42:55 +0000 (09:42 +0100)]
glamor: Drop feature dependent optimization on startup.

We don't care that much about startup time to write different code paths...

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Remove unneeded unbindings.
Markus Wick [Tue, 18 Mar 2014 08:42:54 +0000 (09:42 +0100)]
glamor: Remove unneeded unbindings.

They are already cleared in glamor_put_vbo_space.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Always keep GL_ELEMENT_ARRAY_BUFFER bound to the same IB.
Markus Wick [Tue, 18 Mar 2014 08:42:53 +0000 (09:42 +0100)]
glamor: Always keep GL_ELEMENT_ARRAY_BUFFER bound to the same IB.

We never used glDrawElements() with a different index buffer.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Select VBO path by ARB_mbr extension.
Markus Wick [Tue, 18 Mar 2014 08:42:52 +0000 (09:42 +0100)]
glamor: Select VBO path by ARB_mbr extension.

The mbr path was hard coded enabled for desktop gl and disabled for
gles.  But there are both desktop without mbr and GLES with mbr.

v2: Don't forget to update the fini path, too (change by anholt)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Update GL requirements to 2.1.
Markus Wick [Tue, 18 Mar 2014 08:42:51 +0000 (09:42 +0100)]
glamor: Update GL requirements to 2.1.

We will never ever run on OpenGL 1.2 as we use shaders everywhere.
2.0 may be enough, but we also often use PBOs and our big shaders
won't fit into the first GLSL limits.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Use epoxy_gl_version() instead of rolling our own.
Markus Wick [Tue, 18 Mar 2014 08:42:50 +0000 (09:42 +0100)]
glamor: Use epoxy_gl_version() instead of rolling our own.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Use epoxy_has_gl_extension() instead of rolling our own.
Markus Wick [Tue, 18 Mar 2014 08:42:49 +0000 (09:42 +0100)]
glamor: Use epoxy_has_gl_extension() instead of rolling our own.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Use glsl "fract/mod" instead of "while" in gradient shaders.
Markus Wick [Tue, 18 Mar 2014 08:42:48 +0000 (09:42 +0100)]
glamor: Use glsl "fract/mod" instead of "while" in gradient shaders.

This fixes gtkperf. It seemed to hang forever.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agokdrive: Remove duplicated definitions of some XV-related structs.
Eric Anholt [Tue, 18 Mar 2014 08:42:47 +0000 (09:42 +0100)]
kdrive: Remove duplicated definitions of some XV-related structs.

v2: Fix crash because of removed strdup. (by Markus Wick)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
10 years agoxfree86: glamor_egl subdir must be distributed - breaks distcheck
Gaetan Nadon [Wed, 19 Mar 2014 15:28:57 +0000 (11:28 -0400)]
xfree86: glamor_egl subdir must be distributed - breaks distcheck

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoephyr: typo where "()" should be "$()" in the Makefile - breaks make dist
Gaetan Nadon [Wed, 19 Mar 2014 18:17:15 +0000 (14:17 -0400)]
ephyr: typo where "()" should be "$()" in the Makefile - breaks make dist

make[3]: Entering directory `/home/nadon/xorg/src/xserver/hw/kdrive/ephyr'
make[3]: *** No rule to make target `()', needed by `distdir'.  Stop.
make[3]: Leaving directory `/home/nadon/xorg/src/xserver/hw/kdrive/ephyr'
make[2]: *** [distdir] Error 1

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agosystemd-logind: Monitor systemd-logind going away
Hans de Goede [Mon, 24 Mar 2014 15:32:01 +0000 (16:32 +0100)]
systemd-logind: Monitor systemd-logind going away

When we're using server managed-fds through systemd-logind, systemd-logind
*must* keep running while we are using it, as it does things like drmSetMaster
and drmDropMaster for us on vt-switch.

On a systemd-logind restart, we cannot simply re-connect since we will then
get a different fd for the /dev/dri/card# node, and we've tied a lot of
state to the old fd. I've discussed this with the systemd people, and in the
future there may be a restart mechanism were systemd-logind passed fds from
the old logind to the new logind. But for now there answer is simply:
"Don't restart systemd-logind", and there never really is a good reason to
restart it.

So to ensure unpleasentness if people do decide to restart systemd-logind
anyways (or when it crashes), monitor logind going away and make this a fatal
error. This avoids getting a hard-hung machine on the next vt-switch and will
hopefully quickly educate users to not restart systemd-logind while they have
an X session using it active.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoBuildsys: Create SUID_WRAPPER_DIR before using it
Hans de Goede [Mon, 24 Mar 2014 15:31:59 +0000 (16:31 +0100)]
Buildsys: Create SUID_WRAPPER_DIR before using it

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosuid: adding Xorg.sh.in to EXTRA_DIST is redundant
Gaetan Nadon [Tue, 25 Mar 2014 18:00:13 +0000 (14:00 -0400)]
suid: adding Xorg.sh.in to EXTRA_DIST is redundant

All files specified in AC_CONFIG_FILES get distributed automatically.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosuid: add generated Xorg.sh to hw/xfree86/.gitignore
Gaetan Nadon [Tue, 25 Mar 2014 17:49:02 +0000 (13:49 -0400)]
suid: add generated Xorg.sh to hw/xfree86/.gitignore

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosuid: replace deprecated AC_HELP_STRING with AS_HELP_STRING
Gaetan Nadon [Tue, 25 Mar 2014 17:48:52 +0000 (13:48 -0400)]
suid: replace deprecated AC_HELP_STRING with AS_HELP_STRING

Fixes automake warning.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Tue, 25 Mar 2014 23:06:03 +0000 (16:06 -0700)]
Merge remote-tracking branch 'whot/for-keith'

10 years agomiinitext: introduce LoadExtensionList() to replace over LoadExtension()
Emil Velikov [Thu, 26 Sep 2013 19:28:37 +0000 (20:28 +0100)]
miinitext: introduce LoadExtensionList() to replace over LoadExtension()

Looping around LoadExtension() meant that ExtensionModuleList was reallocated
on every extension. Using LoadExtensionList() we pass an array thus the
function can do the reallocation in one go, and then loop and setup the
ExtensionModuleList.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
v2: Update ephyr [Keith Packard]
v3: Eliminate const warnings in LoadExtensionList [Keith Packard]

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoxkb: Restore XkbCopyDeviceKeymap
Adam Jackson [Fri, 8 Nov 2013 14:44:24 +0000 (09:44 -0500)]
xkb: Restore XkbCopyDeviceKeymap

Removed in d35a02a767017f13db4bd4742eef49293d5a30ea, tigervnc 1.2.80 and
xf86-video-nested need it for now.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoos: Add AddClientOnOpenFD() to create a new client for an file descriptor
Kristian Høgsberg [Thu, 20 Mar 2014 03:46:41 +0000 (20:46 -0700)]
os: Add AddClientOnOpenFD() to create a new client for an file descriptor

When the Xwayland server is socket-activated, we need to connect and
initialize the window manager before the activating client gets to
proceed with connecting.  We do this by passing a socket file
descriptor for the window manager connection to the Xwayland server,
which then uses this new function to set it up as an X client.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agomiinitext: avoid allocating a sentinel ExtensionModule
Emil Velikov [Thu, 26 Sep 2013 19:16:31 +0000 (20:16 +0100)]
miinitext: avoid allocating a sentinel ExtensionModule

With all the logic now in place there is no need to allocate a separate
ExtensionModule to be used as a sentinel.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agomiinitext: constify staticExtensions
Emil Velikov [Thu, 26 Sep 2013 19:11:40 +0000 (20:11 +0100)]
miinitext: constify staticExtensions

The array is readonly and should not be tampered with.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agomiinitext: drop sentinel detection during LoadExtension
Emil Velikov [Thu, 26 Sep 2013 19:08:56 +0000 (20:08 +0100)]
miinitext: drop sentinel detection during LoadExtension

All the sentinels from the extension lists were removed, thus the only
case were this would trigger is when the code is broken badly.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agomiinitext: move AddStaticExtensions() to LoadExtension()
Emil Velikov [Thu, 26 Sep 2013 19:08:16 +0000 (20:08 +0100)]
miinitext: move AddStaticExtensions() to LoadExtension()

Separate the function from NewExtensionModule() as the former does
only memory reallocation. No functional change.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoAdd necessary headers for major()/minor() on Solaris to xf86Xinput.c
Alan Coopersmith [Sat, 22 Mar 2014 21:30:04 +0000 (14:30 -0700)]
Add necessary headers for major()/minor() on Solaris to xf86Xinput.c

Without these, after commit fdb4ec86c29d85c, it fails to build on Solaris,
with errors of:
xf86Xinput.c: In function 'xf86stat':
xf86Xinput.c:816:5: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration]
xf86Xinput.c:817:5: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'jturney/master'
Keith Packard [Sat, 22 Mar 2014 21:09:00 +0000 (14:09 -0700)]
Merge remote-tracking branch 'jturney/master'

10 years agoDefault font path: remove the check for ${sysconfdir}/X11/fontpath.d
Gaetan Nadon [Fri, 17 Jan 2014 14:54:01 +0000 (09:54 -0500)]
Default font path: remove the check for ${sysconfdir}/X11/fontpath.d

The location ${sysconfdir}/X11/fontpath.d is unknown at configuration time
(only at make time) as evidenced by the configuration output:

    checking for ${prefix}/etc/X11/fontpath.d... no

Unlike font-util for the X fonts, there is no mechanism to query where
fontpath.d is. Fedora have chosen /etc/X11 and others have followed, but this
is not a standard. It might also be installed at another location, it may or may
not be under the xserver installation prefix. We just don't know. Debian does
not use this at all.

Distros are using --with-default-path when they support fontpath.d, so they
never relied on the server default as it never worked.

The patch essentially is a noop, which leaves the door open for anyone who
could potentially provide a reliable implementation of choosing fontpath.d
when applicable.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'jwrdecoede/for-keith'
Keith Packard [Sat, 22 Mar 2014 20:46:15 +0000 (13:46 -0700)]
Merge remote-tracking branch 'jwrdecoede/for-keith'

10 years agohw/xwin: Fix WM_ENDSESSION crash on x86_64
Jon TURNEY [Wed, 11 Sep 2013 12:36:18 +0000 (13:36 +0100)]
hw/xwin: Fix WM_ENDSESSION crash on x86_64

We need to include xwin-config.h into winmsgwindow.c, so that _XSERVER64 is
defined, so that the layout of ScreenRec type is correct, so that it's privates
can be accessed correctly, so that the WM_GIVEUP message can be sent to the
screen window.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agohw/xwin: Improve NET_WM_ICON validation
Jon TURNEY [Sun, 16 Jun 2013 12:55:51 +0000 (13:55 +0100)]
hw/xwin: Improve NET_WM_ICON validation

Check that we don't overrun the end of the property data while converting icons

See http://cygwin.com/ml/cygwin-xfree/2013-06/msg00040.html for testcase.

Also, some warning fixes in winXIconToHICON()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agohw/xwin: Remove obsolete control handling for About dialog
Jon TURNEY [Sun, 31 Mar 2013 17:29:07 +0000 (18:29 +0100)]
hw/xwin: Remove obsolete control handling for About dialog

Remove the unused, cygwin-specific handling for ChangeLog, UG and CG buttons in
the About... Dialog.  The buttons themselves were removed in commmit
34269a90ea2087f883f5dc8805894fc4998e4b81.

Also remove those window control IDs which are now obsolete.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agohw/xwin: Minimize redraw events after resizing/moving windows in multiwindow mode
Oliver Schmidt [Wed, 7 Sep 2011 13:00:56 +0000 (14:00 +0100)]
hw/xwin: Minimize redraw events after resizing/moving windows in multiwindow mode

In multiwindow mode the modal moving/resizing of windows causes a lot of redraw
events to be sent to the X clients after the user releases the mouse button.
During the moving/resizing client windows are not redrawn as long as the mouse
button is pressed, but all redraw/resizing events are queued and executed step
after step after the moving/resizing ends.

Some clients collect and combine multiple redraw or resizing events, other
clients (e.g. xterm) simply execute each redraw or sizing event.

The enclosed patch minimizes the events for clients to only one event after the
user releases the mouse button to end the moving/resizing. This improves the
user experience and reduces strange screen flickerings, especially on slow
platforms.

The enclosed patch modifies winmultiwindowwndproc.c such that the windows events
WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE that are sent by Windows when the modal
window resizing/moving begins or ends are considered. Only after WM_EXITSIZEMOVE
is the redraw/resizing executed.

Signed-off-by: Oliver Schmidt <oschmidt-mailinglists@gmx.de>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agohw/xwin: Add '@<WM_CLIENT_MACHINE>' to window name when it's useful to do so
Jon TURNEY [Mon, 7 Nov 2011 20:54:10 +0000 (20:54 +0000)]
hw/xwin: Add '@<WM_CLIENT_MACHINE>' to window name when it's useful to do so

Enhance GetWindowName() so it appends the result of XGetWMClientMachine() when
it is available and useful to do so

Add -hostintitle option to control this behaviour.  Add documentation for this
option to man page and -help text.

Also, fix warning in UpdateName()

v2: Provide a HOST_NAME_MAX definition for MinGW
v3: Use '@host' rather than ' (on host)'. Don't add host if it's already in the
title.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agohw/xwin: Remove prototype for non-existent winMWExtWMUpdateIcon()
Colin Harrison [Fri, 14 Mar 2014 15:44:54 +0000 (15:44 +0000)]
hw/xwin: Remove prototype for non-existent winMWExtWMUpdateIcon()

winMWExtWMUpdateIcon() was removed in commit 527cf13135cfd279733060e0028bbfbe02be5167

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Use AllocDevicePair()
Colin Harrison [Fri, 14 Mar 2014 15:40:43 +0000 (15:40 +0000)]
hw/xwin: Use AllocDevicePair()

Use AllocDevicePair() rather than allocating Windows keyboard and pointer
devices individually.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Consistently use 'L' for long int constants
Colin Harrison [Fri, 14 Mar 2014 15:36:59 +0000 (15:36 +0000)]
hw/xwin: Consistently use 'L' for long int constants

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Remove an unneeded include
Colin Harrison [Fri, 14 Mar 2014 15:36:24 +0000 (15:36 +0000)]
hw/xwin: Remove an unneeded include

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Use boolean AND rather than bitwise AND in WIN_POLLING_MOUSE_TIMER_ID
Colin Harrison [Fri, 14 Mar 2014 15:34:04 +0000 (15:34 +0000)]
hw/xwin: Use boolean AND rather than bitwise AND in WIN_POLLING_MOUSE_TIMER_ID

For clarity, use boolean AND rather than bitwise AND in
WIN_POLLING_MOUSE_TIMER_ID processing.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Fix declaration after statement warning in ddxGiveUp()
Colin Harrison [Fri, 14 Mar 2014 15:23:16 +0000 (15:23 +0000)]
hw/xwin: Fix declaration after statement warning in ddxGiveUp()

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Fix typo in comment
Colin Harrison [Fri, 14 Mar 2014 15:09:24 +0000 (15:09 +0000)]
hw/xwin: Fix typo in comment

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Fix const discarded warning in winGenerateAuthorization()
Jon TURNEY [Thu, 13 Mar 2014 22:38:43 +0000 (22:38 +0000)]
hw/xwin: Fix const discarded warning in winGenerateAuthorization()

Fix const discarded warning in winGenerateAuthorization() in !XCSECURITY case

In function ‘winGenerateAuthorization’:
hw/xwin/winauth.c:123:38: warning: passing argument 2 of ‘GenerateAuthorization’ discards ‘const’ qualifier from pointer target type [enabled by default]
hw/xwin/winauth.c:99:1: note: expected ‘char *’ but argument is of type ‘const char *’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agoos: Add a mechanism to prevent creating any listen sockets
Kristian Høgsberg [Wed, 19 Mar 2014 21:03:13 +0000 (14:03 -0700)]
os: Add a mechanism to prevent creating any listen sockets

A socket-activated server will receive its listening sockets from the
parent process and should not create its own sockets.  This patch
introduces a NoListen flag that can be set by a DDX to prevent
the server from creating the sockets.  When NoListen is enabled, we
also disable the server lock checking, since the parent process is
responsible for checking the lock before picking the display name and
creating the sockets.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agoos: Always compile ListenOnOpenFD() and export it
Kristian Høgsberg [Wed, 19 Mar 2014 05:05:58 +0000 (22:05 -0700)]
os: Always compile ListenOnOpenFD() and export it

This function was written to allow the X server to inherit the listen
socket from launchd on OS X.  The code is not specific to OS X though
and will be useful for on-demand launched Xwayland servers.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agotest: Don't add TEST_LDADD to list test
Kristian Høgsberg [Wed, 19 Mar 2014 17:27:39 +0000 (10:27 -0700)]
test: Don't add TEST_LDADD to list test

The list test case is always enabled, even if Xorg is disabled.
TEST_LDADD pulls in Xorg files which breaks linking when Xorg is disabled.
The list test doesn't need any libraries, so just remove list_LDADD.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Wed, 19 Mar 2014 13:43:14 +0000 (06:43 -0700)]
Merge remote-tracking branch 'whot/for-keith'

10 years agoxkb: add XkbLoadKeymapFromString
Kristian Høgsberg [Wed, 12 Mar 2014 06:31:25 +0000 (16:31 +1000)]
xkb: add XkbLoadKeymapFromString

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoMerge remote-tracking branch 'anholt/glamor-megaseries'
Keith Packard [Tue, 18 Mar 2014 00:29:56 +0000 (17:29 -0700)]
Merge remote-tracking branch 'anholt/glamor-megaseries'

10 years agoglamor: Move up glamor_priv->flags assignment in glamor_init()
Michel Dänzer [Mon, 17 Mar 2014 04:16:48 +0000 (13:16 +0900)]
glamor: Move up glamor_priv->flags assignment in glamor_init()

It wasn't assigned yet when it was tested for GLAMOR_NO_DRI3.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglx: Make sure we get an FBConfig the root window's visual.
Eric Anholt [Fri, 14 Mar 2014 20:10:04 +0000 (13:10 -0700)]
glx: Make sure we get an FBConfig the root window's visual.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: don't reset the GLSL program
Markus Wick [Thu, 13 Mar 2014 10:17:39 +0000 (11:17 +0100)]
glamor: don't reset the GLSL program

We don't use fixed function rendering, so there is no need to reset
the program at all.  This lets the driver avoid checking for state
changes between draw calls when we rebind the same program.

Improves xephyr x11perf -f8text performance by 6.03062% +/- 1.64928%
(n=20)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>