platform/upstream/xorg-server.git
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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'

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

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

11 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>
11 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>
11 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>
11 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>
11 years agoAdd interfaces to get FDs from clients over the socket
Keith Packard [Thu, 17 Jan 2013 21:43:02 +0000 (13:43 -0800)]
Add interfaces to get FDs from clients over the socket

This adds two interfaces:

    void SetReqFds(ClientPtr client, int req_fds)

Marks the number of file descriptors expected for this
request. Call this before any request processing so that
any un-retrieved file descriptors will be closed
automatically.

    int ReadFdFromClient(ClientPtr client)

Reads the next queued file descriptor from the connection. If
this request is not expecting any more file descriptors, or
if there are no more file descriptors available from the
connection, then this will return -1.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agomisync: Don't smash custom screen sync functions
Keith Packard [Thu, 31 Oct 2013 20:01:46 +0000 (13:01 -0700)]
misync: Don't smash custom screen sync functions

There was a check to avoid smashing custom functions, but the sense
was backwards causing it to always smash them, and also not set them otherwise.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoos: Add GetTimeInMicros
Keith Packard [Thu, 11 Jul 2013 23:10:34 +0000 (16:10 -0700)]
os: Add GetTimeInMicros

64-bit higher resolution current time value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoAdd swapll to byte swap 64-bit datatypes
Keith Packard [Thu, 11 Jul 2013 23:09:34 +0000 (16:09 -0700)]
Add swapll to byte swap 64-bit datatypes

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoAdd a RegionDuplicate function
Keith Packard [Thu, 11 Jul 2013 23:08:41 +0000 (16:08 -0700)]
Add a RegionDuplicate function

This allocates a new region structure and copies a source region into
it in a single API rather than forcing the caller to do both steps themselves.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoClean up a couple of warnings in os/
Keith Packard [Mon, 14 Jan 2013 22:24:36 +0000 (14:24 -0800)]
Clean up a couple of warnings in os/

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoXext: Move MIT-SHM 'ShmDesc' to shmint.h
Keith Packard [Sat, 19 Jan 2013 05:43:40 +0000 (21:43 -0800)]
Xext: Move MIT-SHM 'ShmDesc' to shmint.h

This data structure is required to use shared memory objects in any
extension. That includes the Xv extension, which (before this patch)
duplicated the definition of this structure in its own code.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoos: use a constant for backtrace array size
Peter Hutterer [Tue, 22 Oct 2013 04:24:52 +0000 (14:24 +1000)]
os: use a constant for backtrace array size

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoconfigure: remove a comment
Peter Hutterer [Tue, 29 Oct 2013 05:24:11 +0000 (15:24 +1000)]
configure: remove a comment

94ed0ba1b5043ad9fc33b42756af447d5ab15bbd moved backtracing into the DIX, so
this comment is outdated. since no-one noticed and it's easier to just grep
than update file references, remove the comment.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoXQuartz: Bump bundle version to 2.7.6
Jeremy Huddleston Sequoia [Thu, 31 Oct 2013 15:50:57 +0000 (08:50 -0700)]
XQuartz: Bump bundle version to 2.7.6

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
11 years agodri: Fix GLX_Y_INVERTED_EXT fbconfig attribute
Adam Jackson [Thu, 31 Oct 2013 13:23:52 +0000 (09:23 -0400)]
dri: Fix GLX_Y_INVERTED_EXT fbconfig attribute

We're Y-inverted from GL's coordinates, so this is correct.  gnome-shell
doesn't seem to check this - somewhat reasonable since the only server
that answered the other way around was Xglx - but kwin does, and
upside-down hilarity ensues.

Tested-by: maelcum on #xorg-devel
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoxfree86: Bump video/input/extension ABIs for 1.15
Adam Jackson [Tue, 29 Oct 2013 16:58:14 +0000 (12:58 -0400)]
xfree86: Bump video/input/extension ABIs for 1.15

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agokdrive/ephyr: Don't discard one-time driver structure at server reset
Keith Packard [Wed, 30 Oct 2013 15:54:24 +0000 (08:54 -0700)]
kdrive/ephyr: Don't discard one-time driver structure at server reset

KdScreenInfo is constructed at server startup time, and not
re-generated at server reset time. Freeing the 'driver' element at
reset time means this information is lost, and the server crashes
pretty quickly afterwards.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agorandr: deliver Output and Crtc events of attached output providers.
Michal Srb [Wed, 30 Oct 2013 11:33:51 +0000 (13:33 +0200)]
randr: deliver Output and Crtc events of attached output providers.

Consider all attached output providers when looking for changed outputs and
crtcs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agorandr: send RRResourceChangeNotify event
Michal Srb [Wed, 30 Oct 2013 11:33:50 +0000 (13:33 +0200)]
randr: send RRResourceChangeNotify event

Send RRResourceChangeNotify event when provider, output or crtc was created or
destroyed. I.e. when the list of resources returned by RRGetScreenResources and
RRGetProviders changes.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agorandr: send RRProviderChangeNotify event
Michal Srb [Wed, 30 Oct 2013 11:33:49 +0000 (13:33 +0200)]
randr: send RRProviderChangeNotify event

Send RRProviderChangeNotify event when a provider becomes output source or
offload sink.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Wed, 30 Oct 2013 04:00:13 +0000 (21:00 -0700)]
Merge remote-tracking branch 'whot/for-keith'

11 years agoconfig: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES
Gaetan Nadon [Mon, 28 Oct 2013 22:32:36 +0000 (18:32 -0400)]
config: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES

Fix Automake warning: AC_OUTPUT should be used without arguments.
www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Files

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodmx: queue button events with a flags of 0
Peter Hutterer [Wed, 23 Oct 2013 05:16:25 +0000 (15:16 +1000)]
dmx: queue button events with a flags of 0

Setting POINTER_SCREEN with a unset valuator mask causes a jump to 0/0. Set
the flags to 0 so we don't generate any motion on a button event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agoxfree86: Find primary entity when bus types are nominally different
Connor Behan [Fri, 18 Oct 2013 01:26:28 +0000 (18:26 -0700)]
xfree86: Find primary entity when bus types are nominally different

As of server 1.13, systems with DRM and Udev will have BUS_PLATFORM as
their primary bus type. However, drivers not implementing a
platformProbe function will still create entities of type BUS_PCI. We
need to account for this when checking for the primary entity.

Signed-off-by: Connor Behan <connor.behan@gmail.com>
Acked-by: Tormod Volden <debian.tormod@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge remote-tracking branch 'idr/glx-float-fbconfig'
Keith Packard [Tue, 29 Oct 2013 16:37:30 +0000 (09:37 -0700)]
Merge remote-tracking branch 'idr/glx-float-fbconfig'

11 years agoglx: convert to direct GL dispatch (v2)
Adam Jackson [Wed, 10 Jul 2013 14:00:46 +0000 (10:00 -0400)]
glx: convert to direct GL dispatch (v2)

We now expect to be linked against something that provides the GL API,
instead of manually grubbing about in the DRI driver's dispatch table.
Since the GLX we expose calls GL functions that are meant to be looked
up dynamically, also add a way to thunk through to GetProcAddress.

This includes a refresh of the generated sources, which requires a
correspondingly new Mesa.

The GetProcAddress stubs are at the moment merely enough to make this
link against Mesa 9.2, but should really be provided for everything not
in the OpenGL 1.2 ABI.

v2: Explicitly hide the GetProcAddress stubs so we can't conflict with
libGL symbols; fix leading tab/space issues [anholt]

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agoglx: Remove DRI1 AIGLX (v2)
Adam Jackson [Fri, 4 Oct 2013 16:58:19 +0000 (12:58 -0400)]
glx: Remove DRI1 AIGLX (v2)

Mesa doesn't ship DRI1 drivers as of 8.0, which is about 18 months and
three releases ago.  The main reason to have wanted DRI1 AIGLX was to
get a GLX compositor working, but DRI1's (lack of) memory management API
meant that the cost of a GLX compositor was breaking direct GLX apps,
which isn't a great tradeoff.

Of the DRI1 drivers Mesa has dropped, I believe only mga stands to lose
some functionality here, since it and only it has support for
NV_texture_rectangle.  Since that's required for every extant GLX
compositor I know of, I conclude that anybody with a savage, say, would
probably not notice AIGLX going away, since they wouldn't be running a
GLX compositor in the first place.

In the future we'd like to use GL in the server in a more natural way,
as just another EGL client, including in the GLX implementation itself.
Since there's no EGL implemented for DRI1 drivers, this would already
doom AIGLX on DRI1 (short of entirely forking the GLX implementation,
which I'm not enthusiastic about).

v2: Remove DRI1 from AIGLX conditionals in configure.ac [anholt]

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agoglx: Simplify glXDestroyContext
Adam Jackson [Wed, 2 Oct 2013 21:38:05 +0000 (17:38 -0400)]
glx: Simplify glXDestroyContext

We can just free the resource unconditionally here.  ContextGone (which
FreeResourceByType will call) already does:

    cx->idExists = GL_FALSE;
    if (!cx->currentClient) {
        __glXFreeContext(cx);
    }

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agoglx: Fix a corner case in DrawableGone
Adam Jackson [Mon, 5 Aug 2013 19:46:11 +0000 (15:46 -0400)]
glx: Fix a corner case in DrawableGone

Losing the drawable does not change our notion of current client.  Since
the GL under us doesn't understand having a current context without
current drawables (sigh), we do still need to loseCurrent so that we
re-bind the context on the next request.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65030
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agoglx: Fix memory leak in context garbage collection (v2)
Adam Jackson [Sat, 3 Aug 2013 13:47:55 +0000 (09:47 -0400)]
glx: Fix memory leak in context garbage collection (v2)

I broke this, back in:

    commit a48dadc98a28c969741979b70b7a639f24f4cbbd
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Mon Mar 21 11:59:29 2011 -0400

glx: Reimplement context tags

In that, I changed the glx client state to not explicitly track the list
of current contexts for the client (since that was what we were deriving
tags from).  The bug was that I removed the code for same from
glxClientCallback without noticing that it had the side effect of
effectively de-currenting those contexts, so that ContextGone could free
them.  So, if you had a client exit with a context still current, the
context's memory would leak.  Not a huge deal for direct clients, but
viciously bad for indirect, since the swrast context state at the bottom
of Mesa is like 15M.

Fix this by promoting Bool isCurrent to ClientPtr currentClient, so that
we have a back-pointer to chase when walking the list of contexts when
ClientStateGone happens.

v2: Explicitly call __glXFreeContext on the ClientStateGone path.  Our
current context might be one we got from EXT_import_context and whose
creating client has since died.  Without the explicit call, the creating
client's FreeClientResources would not free the context because it's
still current, and the using client's FreeClientResources would not free
the context because it's not an XID it created.  This matches the logic
from a48dadc.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agoglx: Only take a Pixmap reference if creating the GLXPixmap succeeded
Adam Jackson [Tue, 8 Oct 2013 19:02:44 +0000 (15:02 -0400)]
glx: Only take a Pixmap reference if creating the GLXPixmap succeeded

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agoXi: fix logic error when calculating emulated motion events
Peter Hutterer [Mon, 28 Oct 2013 02:10:10 +0000 (12:10 +1000)]
Xi: fix logic error when calculating emulated motion events

gcc -Wlogical-op
exevents.c: In function 'DeliverEmulatedMotionEvent':
exevents.c:1480:13: warning: logical 'or' of collectively exhaustive
tests is always true [-Wlogical-op]

The relevant snippet of exevents.c:

1479         if (ti->listeners[0].type != LISTENER_POINTER_REGULAR ||
1480             ti->listeners[0].type != LISTENER_POINTER_GRAB)
1481             return;

This condition was always true, causing dropped motion events.

Reported-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoglx: Enable GLX_ARB_fbconfig_float for DRI2 drivers
Daniel Czarnowski [Mon, 21 Oct 2013 17:48:38 +0000 (19:48 +0200)]
glx: Enable GLX_ARB_fbconfig_float for DRI2 drivers

v2 (idr): Maintain sort order of extension list.  Fixed rebase error
(comment header for initializeExtensions was in front of
__glXDRIinvalidateBuffers).  Re-write commit message.

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglx: Handle float config types in glxConvertConfigs
Daniel Czarnowski [Wed, 23 Oct 2013 10:53:59 +0000 (12:53 +0200)]
glx: Handle float config types in glxConvertConfigs

Replaces old use of floatMode attribute with new, extended range of
values in __DRI_ATTRIB_RENDER_TYPE. Also adds new conditions, where the
float modes support requires it. Enables support for not only float
configs, but packed float configs as well.

v2 (idr): Whitespace and formatting fixes.  Refactor render type
vs. pbuffer checking to a separate function that includes a quote from
the spec.  Re-write commit message.  Fix compiler warnings:

glxdricommon.c: In function 'glxConvertConfigs':
glxdricommon.c:212:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:212:35: note: expected 'unsigned int *' but argument is of type 'int *'
glxdricommon.c:230:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:230:35: note: expected 'unsigned int *' but argument is of type 'int *'

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglx: Correctly set render type enum
Daniel Czarnowski [Mon, 21 Oct 2013 17:57:53 +0000 (19:57 +0200)]
glx: Correctly set render type enum

The type specified is bits, but the context wants an enum.

v2 (idr): Fix various whitespace and formatting problems.  Rename
convFBconfRenderTypeBits2CtxRenderType to
renderTypeBitsToRenderTypeEnum.  Re-write commit message.

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglx: Allow float renderType in glXCreateContextAttribsARB
Daniel Czarnowski [Mon, 21 Oct 2013 17:45:35 +0000 (19:45 +0200)]
glx: Allow float renderType in glXCreateContextAttribsARB

This enables GLX_RGBA_FLOAT_TYPE_ARB and
GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT as valid renderType parameters to
glXCreateContextAttribsARB.

v2 (idr) : Use C-style comments and fix word wrapping.  Re-write commit
message.

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglx: Add support for the new DRI loader entrypoint.
Eric Anholt [Tue, 22 Oct 2013 21:22:04 +0000 (14:22 -0700)]
glx: Add support for the new DRI loader entrypoint.

This is going to be exposed (and not the old entrypoint) for some DRI
drivers once the megadrivers series lands, and the plan is to
eventually transition all drivers to that.  Hopefully this is
unobtrusive enough to merge to stable X servers so that they can be
compatible with new Mesa versions.

v2: typo fix in the comment

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agounbreak KdEnableInput
Strake [Fri, 18 Oct 2013 04:20:20 +0000 (23:20 -0500)]
unbreak KdEnableInput

pi = ki = 0 here, so not follow them.

Signed-off-by: Strake <strake888@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoUpdate to version 1.14.99.3 xorg-server-1.14.99.3
Keith Packard [Sat, 19 Oct 2013 00:31:01 +0000 (17:31 -0700)]
Update to version 1.14.99.3

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge commit '2523a445a09a75a8baf642608d099a5e12d5437f'
Keith Packard [Sat, 19 Oct 2013 00:22:52 +0000 (17:22 -0700)]
Merge commit '2523a445a09a75a8baf642608d099a5e12d5437f'

This is merging the commits along Peter's for-keith branch, without
also merging in the spurious merge at the top of that branch.

11 years agoMerge branch 'xsync-transition-bug-59644' into for-keith
Peter Hutterer [Fri, 18 Oct 2013 06:50:12 +0000 (16:50 +1000)]
Merge branch 'xsync-transition-bug-59644' into for-keith

11 years agosync: split updating and triggering a counter up
Peter Hutterer [Thu, 17 Oct 2013 02:02:27 +0000 (12:02 +1000)]
sync: split updating and triggering a counter up

Now that the brackets are always the nearest change points (regardless of
transition) we need to update the counters whenever we check for any updates.

Otherwise we end up with a situation where counter->value is out of date and
an alarm doesn't trigger because we're still using the value from last time
something actually triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agosync: always set the brackets (#59644)
Peter Hutterer [Wed, 16 Oct 2013 06:31:15 +0000 (16:31 +1000)]
sync: always set the brackets (#59644)

The current code sets bracket_greater to the first trigger after the current
value, and bracket_less to the last trigger before the current value.

For example, the idle timer with three negative and three positive transitions
would set this:

         nt1       nt2                 nt3
|--------|------|--|------- idle --|---|--|-----> t
               pt1                pt2    pt3
bracket_less == nt2
bracket_greater == pt2

This is an optimization so we can skip code paths in the block/wakeup handlers
if the current value doesn't meet any of the trigger requirements. Those
handlers largely do a
   if (bracket_less is less than current value &&
       bracket_greater is greater than current value)
        return, nothing to do

However, unless the bracket values are updated at the correct time, the
following may happen:

                                      nt
|--------------|---------- idle ------|--------> t
               pt

In this case, neither bracket is set, we're past the pos transition and not
yet at the neg transition. idle may now go past nt, but the brackets are not
updated. If idle is then reset to 0, no alarm is triggered for nt. Likewise,
idle may now go past pt and no alarm is triggered.

Changing an alarm or triggering an alarm will re-calculate the brackets, so
this bug is somewhat random. If any other client triggers an alarm when the
brackets are wrongly NULL, the recalculation will set them this bug may not
appear.

This patch changes the behavior, so that the brackets are always the nearest
positive or negative transitions to the current counter value. In the example
above, nt will trigger a wakeup and a re-calculation of the brackets, so that
going past it in the negative direction will then cause the proper alarm
triggers.

Or, in Keith's words:

  Timer currently past a positive trigger
      No bracket values, because no trigger in range

  Timer moves backwards before the positive trigger
      Brackets not reset, even though there is now a trigger in range

  Timer moves forward past the positive trigger
      Trigger doesn't fire because brackets not set

Setting the LT bracket in this case will cause everything to get
re-evaluated when the sync value moves backwards before the trigger
value.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agosync: if the idle time was reset, force alarms to trigger (#70476)
Peter Hutterer [Wed, 16 Oct 2013 00:08:46 +0000 (10:08 +1000)]
sync: if the idle time was reset, force alarms to trigger (#70476)

The time between the idle reset and the IdleTimeWakeupHandler to be called is
indeterminate. Clients with an PositiveTransition or NegativeTransition alarm
on a low threshold may miss an alarm.

Work around this by keeping a reset flag for each device. When the
WakeupHandler triggers and the reset flag is set, we force a re-calculation of
everything and pretend the current idle time is zero. Immediately after is the
next calculation with the real idle time.

Relatively reproducible test case: Set up a XSyncNegativeTransition alarm for
a threshold of 1 ms. May trigger, may not.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agodix: provide accessor methods for the last device event time
Peter Hutterer [Tue, 15 Oct 2013 23:36:01 +0000 (09:36 +1000)]
dix: provide accessor methods for the last device event time

And now that we have the accessors, localize it. No functional changes, just
preparing for a future change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agosync: supply the counter from IdleTimeBlockHandler
Peter Hutterer [Tue, 15 Oct 2013 23:21:47 +0000 (09:21 +1000)]
sync: supply the counter from IdleTimeBlockHandler

The main idletime counter has an initialized deviceid, might as well be
supplying it properly. Without this, we'd only ever check the XIAllDevices
counter, so the wait would never be adjusted for the device-specific triggers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agosync: always call BracketValues when recalculating upper/lower brackets
Peter Hutterer [Wed, 16 Oct 2013 03:01:01 +0000 (13:01 +1000)]
sync: always call BracketValues when recalculating upper/lower brackets

Both ServertimeBracketValues and IdleTimeBracketValues copy the value into
there SysCounter privates. Call it for a NULL set as well, so we don't end up
with stale pointers and we can remove the block/wakeup handlers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agosync: compress two if statements
Peter Hutterer [Tue, 15 Oct 2013 00:11:20 +0000 (10:11 +1000)]
sync: compress two if statements

No functional changes, just merges a > and == condition into a >= condition.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agoAvoid use-after-free in dix/dixfonts.c: doImageText() [CVE-2013-4396]
Alan Coopersmith [Tue, 17 Sep 2013 04:47:16 +0000 (21:47 -0700)]
Avoid use-after-free in dix/dixfonts.c: doImageText() [CVE-2013-4396]

Save a pointer to the passed in closure structure before copying it
and overwriting the *c pointer to point to our copy instead of the
original.  If we hit an error, once we free(c), reset c to point to
the original structure before jumping to the cleanup code that
references *c.

Since one of the errors being checked for is whether the server was
able to malloc(c->nChars * itemSize), the client can potentially pass
a number of characters chosen to cause the malloc to fail and the
error path to be taken, resulting in the read from freed memory.

Since the memory is accessed almost immediately afterwards, and the
X server is mostly single threaded, the odds of the free memory having
invalid contents are low with most malloc implementations when not using
memory debugging features, but some allocators will definitely overwrite
the memory there, leading to a likely crash.

Reported-by: Pedro Ribeiro <pedrib@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoUpdate GLX dependencies now that DRI & DRI2 are builtins, not modules
Alan Coopersmith [Tue, 17 Sep 2013 04:45:29 +0000 (21:45 -0700)]
Update GLX dependencies now that DRI & DRI2 are builtins, not modules

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoDMX glxproxy: Don't allocate & copy data just to free it unused
Alan Coopersmith [Wed, 4 Sep 2013 05:53:28 +0000 (22:53 -0700)]
DMX glxproxy: Don't allocate & copy data just to free it unused

Two functions in the DMX glxproxy code loop over all the backend
screens, starting at the highest numbered and counting down to
the lowest.

Previously, for each screen, the code would allocate a buffer
large enough to read the reply from the backend, copy that reply
into the buffer, and then if it wasn't the final screen, free it.
Only the buffer from the final screen is used, to pass on to the
client in the reply.

This modifies it to just immediately discard the responses from
the screens as we loop through it, only doing the allocate & copy
work for the one buffer we pass back to the client.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Alex Deucher <aleander.deucher@amd.com>
11 years agoSkip damage calls if DamageCreate fails in exa functions
Alan Coopersmith [Mon, 19 Aug 2013 01:02:49 +0000 (18:02 -0700)]
Skip damage calls if DamageCreate fails in exa functions

Fixes parfait errors such as:
   Null pointer dereference (CWE 476): Write to null pointer pDamage
        at line 1833 of miext/damage/damage.c in function 'DamageRegister'.
          Function DamageCreate may return constant 'NULL' at line 1775,
              called at line 232 of exa/exa_migration_mixed.c
              in function 'exaPrepareAccessReg_mixed'.
          Constant 'NULL' passed into function DamageRegister,
              argument pDamage, from call at line 237.
          Null pointer introduced at line 1775 of miext/damage/damage.c
              in function 'DamageCreate'.
   Null pointer dereference (CWE 476): Write to null pointer pDamage
        at line 1833 of miext/damage/damage.c in function 'DamageRegister'.
          Function DamageCreate may return constant 'NULL' at line 1775,
              called at line 104 of exa/exa_mixed.c
              in function 'exaCreatePixmap_mixed'.
          Constant 'NULL' passed into function DamageRegister,
              argument pDamage, from call at line 109.
          Null pointer introduced at line 1775 of miext/damage/damage.c
              in function 'DamageCreate'.

Checks are similar to handling results of other calls to DamageCreate.

[ This bug was found by the Parfait 1.3.0 bug checking tool.
  http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agodix: only deliver for the current grab type
Peter Hutterer [Wed, 4 Sep 2013 05:34:29 +0000 (15:34 +1000)]
dix: only deliver for the current grab type

Use the grabtype to determine which type of event to send - all other events
are pointless and may result in erroneous events being delivered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: don't attempt to deliver an event for a different grabtype
Peter Hutterer [Wed, 4 Sep 2013 05:34:28 +0000 (15:34 +1000)]
dix: don't attempt to deliver an event for a different grabtype

For an active grab, grab->eventMask can be either the core or the XI1 mask.
With the overlap of event filters, calling DeliverOneGrabbedEvent(XI1) for a
ProximityOut event will trigger if the client has selected for enter events -
the filter is the same for both.

Thus, we end up delivering a proximity event to a client not expecting one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoinclude: change grabtypes to start at 1
Peter Hutterer [Wed, 4 Sep 2013 05:34:27 +0000 (15:34 +1000)]
include: change grabtypes to start at 1

Avoid erroneous detection of an unset grabtype as CORE

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: only allow button and key events to freeze a sync'd pointer
Peter Hutterer [Wed, 4 Sep 2013 05:34:26 +0000 (15:34 +1000)]
dix: only allow button and key events to freeze a sync'd pointer

If a client calls XAllowEvents(SyncPointer) it expects events as normal until
the next button press or release event - that freezes the device. An e.g.
proximity event must thus not freeze the pointer.

As per the spec, only button and key events may do so, so narrow it to these
cases.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoXephyr: restore cursor visibility
Michele Baldessari [Sun, 15 Sep 2013 18:30:38 +0000 (19:30 +0100)]
Xephyr: restore cursor visibility

  Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69388

Commit c100211034ab69ce453a1644fb61c6808d7e3eda (dix: only show the cursor
if a window defines one (#58398)) broke the default cursor behaviour in
Xephyr (unless run with -retro). Restore the default cursor visibility
so that '-retro' or '-host-cursor' are not needed to have a visible
cursor.

Signed-off-by: Michele Baldessari <michele@acksyn.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
as of ba387cf21f7d95987211f75d8024601e7d64e322 "ephyr: Use host (HW) cursors
by default." this only applies if -sw-cursor is given on the cmdline.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoFix Xephyr compilation when DEBUG is enabled
Michele Baldessari [Sun, 15 Sep 2013 18:56:34 +0000 (19:56 +0100)]
Fix Xephyr compilation when DEBUG is enabled

When DEBUG is enabled Xephyr compilation fails:
ephyrdriext.c:343:133: error: 'is_ok' undeclared (first use in this
function)
     EPHYR_LOG("leave. is_ok:%d\n", is_ok);

Just reemove bogus is_ok variable.

Signed-off-by: Michele Baldessari <michele@acksyn.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoinput: calloc minimization for xi2mask_new
Adam Jackson [Tue, 10 Sep 2013 18:18:18 +0000 (14:18 -0400)]
input: calloc minimization for xi2mask_new

There's no reason to do this as (nmasks + 2) callocs, and it's a
surprisingly hot path.  Turns out you hit this ~once per passive grab,
and you do a few bajillion passive grab changes every time you enter or
leave the overview in gnome-shell.  According to a callgrind of Xorg
with gnome-shell-perf-tool run against it:

Ir before: 721437275
Ir after:  454227086

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agohw/xwin: Fix for "glx: Remove screen number from __GLXconfig"
Jon TURNEY [Sun, 6 Oct 2013 15:45:52 +0000 (16:45 +0100)]
hw/xwin: Fix for "glx: Remove screen number from __GLXconfig"

Fix compilation after commit c3c976f54c3c282d6fa6c8360688e036bc43d210 "glx:
Remove screen number from __GLXconfig"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoMerge remote-tracking branch 'jeremyhu/master'
Keith Packard [Tue, 8 Oct 2013 00:29:38 +0000 (17:29 -0700)]
Merge remote-tracking branch 'jeremyhu/master'

11 years agoconfigure.ac: Include missing proto declarations in SDK_REQUIRED_MODULES
Emil Velikov [Mon, 7 Oct 2013 17:29:25 +0000 (18:29 +0100)]
configure.ac: Include missing proto declarations in SDK_REQUIRED_MODULES

Commits a1d41e311c21e7d859bd87834d & 3ed2c6e11298c made extinit.h require
the XF86 Big Font, XRes & ScrnSaver proto headers, but failed to add them
to the SDK_REQUIRED_MODULES so pkg-config would find them for driver builds.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoXQuartz: Dont't set screen on __GLXConfig
Jeremy Huddleston Sequoia [Sun, 6 Oct 2013 16:20:45 +0000 (09:20 -0700)]
XQuartz: Dont't set screen on __GLXConfig

Fixes regression introduced by c3c976f54c3c282d6fa6c8360688e036bc43d210

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
11 years agorootless: Use miCopyRegion instead of fbCopyRegion
Jeremy Huddleston Sequoia [Sun, 6 Oct 2013 16:18:15 +0000 (09:18 -0700)]
rootless: Use miCopyRegion instead of fbCopyRegion

Fixes regression introduced by e657635dbe6b92875b0e88370557c2cbab673a49

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
11 years agoos: move <arpa/inet.h> for any !win32 system
Pino Toscano [Wed, 28 Aug 2013 15:15:03 +0000 (17:15 +0200)]
os: move <arpa/inet.h> for any !win32 system

It is needed in IPv6 configurations (for inet_pton) also when
SIOCGIFCONF is not defined.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoxfree86/hurd: include <hurd.h>
Pino Toscano [Wed, 28 Aug 2013 15:04:48 +0000 (17:04 +0200)]
xfree86/hurd: include <hurd.h>

Needed for using get_privileged_port.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoBump version to 1.14.99.2 xorg-server-1.14.99.2
Keith Packard [Fri, 4 Oct 2013 23:44:46 +0000 (16:44 -0700)]
Bump version to 1.14.99.2

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agokdrive/ephyr: Remove duplicate ephyrExtensions and ephyrExtensionInit decls
Keith Packard [Fri, 4 Oct 2013 23:43:41 +0000 (16:43 -0700)]
kdrive/ephyr: Remove duplicate ephyrExtensions and ephyrExtensionInit decls

These were duplicated when GLX support was re-added on two different branches.

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoxfree86: add a comment as to why the logdir is created
Gaetan Nadon [Sat, 28 Sep 2013 19:26:38 +0000 (15:26 -0400)]
xfree86: add a comment as to why the logdir is created

Without the logdir, the xserver will write the content of the log file on the
terminal stating that it cannot be written and will stop.

Refer to https://bugs.freedesktop.org/show_bug.cgi?id=3889

Reviewed-By: Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoxfree86: Use $(MKDIR_P) for better code portability
Gaetan Nadon [Sat, 28 Sep 2013 19:26:37 +0000 (15:26 -0400)]
xfree86: Use $(MKDIR_P) for better code portability

Still true that we should not use the lower case $(mkdir_p) version.
However, remove the 2005 comment as the MKDIR_P is widely used now.

Reviewed-By: Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoUninstall X link and CYGWIN libXorg.exe.a in local install targets
Gaetan Nadon [Sat, 28 Sep 2013 19:26:36 +0000 (15:26 -0400)]
Uninstall X link and CYGWIN libXorg.exe.a in local install targets

It is our duty to uninstall any files and/or directories that we installed
through install-data-local and install-exec-hook.

Currently the X symbolic link to Xorg remains on disk after running
make uninstall.

Note the exception for logdir which is usually shared by other modules.

Reviewed-By: Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoXorg binary: use install-exec-hook rather than install-exec-local
Gaetan Nadon [Sat, 28 Sep 2013 19:26:35 +0000 (15:26 -0400)]
Xorg binary: use install-exec-hook rather than install-exec-local

The former was explicitly designed to execute additional code after the binary
has been installed. The latter can be executed in any order, hence it's
current dependency on install-binPROGRAMS as a workaround.

The CYGWIN libXorg.exe.a target is an installation target rather than
a post-installation one, so it should not be done as a hook. It does not depend
on the Xorg executable being installed.

Automake:
"These hooks are run after all other install rules of the appropriate type,
exec or data, have completed. So, for instance, it is possible to perform
post-installation modifications using an install hook".

"With the -local targets, there is no particular guarantee of execution order;
typically, they are run early, but with parallel make, there is no way
to be sure of that".

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoUse $(LN_S) provided by AC_PROG_LN_S macro to create links
Gaetan Nadon [Sat, 28 Sep 2013 19:26:34 +0000 (15:26 -0400)]
Use $(LN_S) provided by AC_PROG_LN_S macro to create links

For better code portability.

Reviewed-By: Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoThe Xorg binary is missing the extension $(EXEEXT) in the makefile
Gaetan Nadon [Sat, 28 Sep 2013 19:26:33 +0000 (15:26 -0400)]
The Xorg binary is missing the extension $(EXEEXT) in the makefile

This is not a problem on UNIX platforms, but on CYGWIN it creates a broken
link to Xorg rather than a link to Xorg.exe.

From the CYGWIN log on tinderbox, we can see that the executable Xorg.exe is
installed correctly. We can see the command used to create the link:

(cd /jhbuild/install/[...]/install/bin && rm -f X && ln -s Xorg X)

Note that the "relink" makefile target correctly appends $(EXEEXT) to Xorg.

Reviewed-By: Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>