Commit Graph

15661 Commits

Author SHA1 Message Date
Keith Packard
3caf671ed2 config/dbus: Initialize dbus fd to -1 so teardown doesn't use fd 0
The dbus teardown code is called when the server fatal errors even if
that is before dbus has ever been initialized.  By statically
initializing the value of bus_info.fd, we avoid calling RemoveNotifyFd
on stdin.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-15 21:30:38 -07:00
Keith Packard
52d6a1e832 Hold input lock for deviceProc
This ensures that the deviceProc is never called while the input
thread is processing data from the device.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-15 07:50:38 +10:00
Keith Packard
dfc91f0f63 Hold input lock while calling input device SetProperty callback
This keeps the input driver SetProperty function from being called
while input events are being processed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-15 07:50:34 +10:00
Alan Coopersmith
c4799f186b os: Use pthread_setname_np to set thread names if available
Autoconf logic borrowed from glib

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-09-13 16:55:26 -04:00
Alan Coopersmith
75c1d04650 os: OsSigHandler should not show rtld errors for unrelated signals
If RTLD_DI_SETSIGNAL is set to let us turn runtime linker/loader errors
into catchable signals, then we should only show the errors when catching
that signal, instead of tossing out red herrings to distract people with
unrelated crashes long after their last failed symbol lookup (especially
when using drivers built to support multiple API's by checking which
symbols are available before calling them).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2016-09-13 16:16:40 -04:00
Jeremy Huddleston Sequoia
065eb66124 os/inputthread: Fix setting of cloexec on file descriptors
O_CLOEXEC is not a file bit.  It is not setable with F_SETFL.  One must
use it when calling open(2).  To set it cloexec on an existing fd,
F_SETFD and FD_CLOEXEC must be used.

This also fixes a build failure regression on configurations that don't
have O_CLOEXEC defined.

cf: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
Regressed-in: 30ac756798

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2016-09-13 16:10:56 -04:00
Jeremy Huddleston Sequoia
a5769de0f5 Xext/shm: Fix usage of F_GETFD to match standard
flags = fcntl(fd, F_GETFD) is compliant.

fcntl(fd, F_GETFD, &flags) is non-compliant (Linux extension?)

cf: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2016-09-13 10:00:51 -07:00
Jeremy Huddleston Sequoia
7def2fea30 Xquartz: Update for removal of AddEnabledDevice and RemoveEnabledDevice
Regressed-in: be5a513fee
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-09-13 10:00:51 -07:00
Jeremy Huddleston Sequoia
4f4ecd0f41 XQuartz: Cleanup CPPFLAGS that are no longer necessary on darwin
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-09-13 10:00:51 -07:00
Jeremy Huddleston Sequoia
33d595255d XQuartz: Fix the issue where the h key could be come "stuck" after hiding XQuartz with cmd-h
The issue was that we set a flag to ignore the k key's up event when sent
the cmd-h down event, but because the cmd-h keycode hides XQuartz, we
became !_x_active by the time the event is delivered which caused us to
go down a differnet codepath rather than getting a chance to ignore it.
We then incorrectly ignored the next h up key.

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

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-09-13 10:00:51 -07:00
Hans de Goede
d8e05c0475 modesetting: Fall back to primary crtc for vblank for drawables on slave outputs
This fixes glxgears running at 1 fps when fully covering a slave-output
and the modesetting driver is used for the master gpu.

Reported-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-09-13 11:18:43 -04:00
Hans de Goede
7ade8ba10e modesetting: ms_covering_crtc: Allow calling on non modesetting Screens
99% of the code in ms_covering_crtc is video-driver agnostic. Add a
screen_is_ms parameter when when FALSE skips the one ms specific check,
this will allow calling ms_covering_crtc on slave GPUs.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-09-13 11:18:41 -04:00
Hans de Goede
238248d67e modesetting: Implement DRI2InfoRec version 9 callbacks
Implement the CreateBuffer2 / DestroyBuffer2 / CopyRegion2 DRI2InfoRec
version 9 callbacks, this is necessary for being an offload source
provider with DRI2.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-09-13 11:18:38 -04:00
Hans de Goede
03a7c50202 modesetting: ms_dri2_create_buffer: check screen of existing front buffers
If a frontbuffer drawable already has a pixmap, make sure it was created
on the right screen.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-09-13 11:18:28 -04:00
Hans de Goede
35c4e96ed1 randr: Fix crtc_bounds when using rotation combined with reflection
Before this commit crtc_bounds() did not take reflection into account,
when using reflection with 0 / 180 degree rotation this was not an
issue because of the default in the switch-case doing the right thing.

But when using 90 / 270 degree rotation we would also end up in the
default which is wrong in this case. This would lead to the cursor
being constrained to a height x height area of the monitor.

This commit masks out the reflection bits for the switch-case,
making crtc_bounds return the correct bounds and fixing the
problematic cursor constraining.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-13 10:27:30 +02:00
Dave Airlie
7b634067c1 xf86Cursor: Add hw cursor support for prime
Currently with PRIME if we detect a secondary GPU,
we switch to using SW cursors, this isn't optimal,
esp for the intel/nvidia combinations, we have
no choice for the USB offload devices.

This patch checks on each slave screen if hw
cursors are enabled, and also calls set cursor
and move cursor on all screens.

Cc: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-09-13 10:27:19 +02:00
Hans de Goede
df88008f92 xf86Cursor: Deal with rotation on GPU screens using a hw-cursor
When a slave-output is rotated the transformation is done on the blit
from master to slave GPU, so crtc->transform_in_use is not set, but we
still need to adjust the mouse position for things to work.

This commit modifies xf86_crtc_transform_cursor_position to not rely
on crtc->f_framebuffer_to_crtc, so that it can be used with GPU screens
too and always calls it for crtcs with any form of rotation.

Note not using crtc->f_framebuffer_to_crtc means that crtc->transform
will not be taken into account, that is ok, because when we've a transform
active hw-cursors are not used and xf86_crtc_transform_cursor_position
will never get called.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-13 10:27:12 +02:00
Hans de Goede
f82fd47016 xf86Cursor: Fix xf86_crtc_rotate_coord using width/height wrongly
xf86_crtc_rotate_coord should be the exact inverse operation of
xf86_crtc_rotate_coord_back, but when calculating x / y for 90 / 270
degrees rotation it was using height to calculate x / width to calculate y,
instead of the otherway around.

This was likely not noticed before since xf86_crtc_rotate_coord
until now was only used with cursor_info->MaxWidth and
cursor_info->MaxHeight, which are usally the same.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-13 10:27:07 +02:00
Hans de Goede
b0b04cb266 xf86Cursor: Fix xf86CurrentCursor to work on slave GPU Screens
The CurrentCursor is always attached to the master GPU.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-13 10:27:05 +02:00
Dave Airlie
71fecc84e9 xf86Cursor: Add xf86CheckHWCursor() helper function
This is a preparation patch for adding prime hw-cursor support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-13 10:26:58 +02:00
Hans de Goede
2eefb53f58 randr: Add RRHasScanoutPixmap helper function
This is a preparation patch for adding prime hw-cursor support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-13 10:26:47 +02:00
Dave Airlie
a52530a655 dix: Add dixPrivatesCreated helper function
This is a preparation patch for adding prime hw-cursor support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-13 10:26:40 +02:00
Hans de Goede
3fe4107643 glamor: Fix crash when master gpu is using glamor and another gpu is hotplugged
When a GPU gets hotplugged while X is already running, glamor_egl_init()
gets called and changes the current egl context, without updating
lastGLContext, potentially causing the next glamor call on another GPU to
run in the wrong context.

This causes glamor to e.g. crash in the next glamor_create_pixmap() call
(called through the master's screen->CreatePixmap), note this is not the
only troublesome entry point I've seen other backtraces when using a
compositing window manager.

Set lastGLContext to NULL to force the next glamor_make_current() call
to set the right context.

Note that we cannot use glamor_make_current() here to replace the
eglMakeCurrent() call and update lastGLContext for us because
glamor_make_current takes a glamor_priv struct as argument and that
has not been created yet when glamor_egl_init() gets called.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-09-13 10:26:35 +02:00
Hans de Goede
1075af8a6c modesetting: Remove some dead code
The "if (pixmap) ..." block this commit removes is inside an
"if (pixmap == NULL) ..." block, so it will never execute.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2016-09-13 10:26:32 +02:00
Hans de Goede
dfa295b29c modesetting: ms_covering_crtc: Remove unused arguments, make static
Remove unused arguments from ms_covering_crtc, make it static as it is
only used in vblank.c.

While at it also change its first argument from a ScrnInfoPtr to a
ScreenPtr, this makes the next patch in this patch-set cleaner.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-09-13 10:26:27 +02:00
Hans de Goede
cb7b145a25 modesetting: Fix msSharePixmapBacking returning a non-linear bo
glamor_fd_from_pixmap() may return a tiled bo, which is not suitable
for sharing with another GPU as tiling usually is GPU specific.

Switch to glamor_shareable_fd_from_pixmap(), which always returns a
linear bo. This fixes mis-rendering when running the mode setting
driver on the master gpu in a dual-gpu setup and running an opengl
app with DRI_PRIME=1.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-09-13 10:26:25 +02:00
Hans de Goede
a74d553cb9 glamor: Add glamor_shareable_fd_from_pixmap()
Add glamor_shareable_fd_from_pixmap function to get dma-buf fds suitable
for sharing across GPUs (not using GPU specific tiling).

This is necessary for the modesetting driver to correctly implement
the DRI2 SharePixmapBacking callback.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-09-13 10:26:21 +02:00
Ran Benita
527c6baa29 xkb: fix check for appending '|' character when applying rules
There are two ways to separate multiple files in XKB include statements:
'+' will cause the later file to override the first in case of conflict,
while '|' will cause it augment it (this is done by xkbcomp). '!' is
unrelated here.
Currently, if someone tries to use '|' in a rule instead of '+', it
won't have any effect. Since '|' is practically never used, this wasn't
noticed.

Signed-off-by: Ran Benita <ran234@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-07 15:16:13 +10:00
Adam Jackson
392da389d7 glx: Fix computation of GLX_X_RENDERABLE fbconfig attribute
>From the GLX spec:

    "GLX_X_RENDERABLE is a boolean indicating whether X can be used to
    render into a drawable created with the GLXFBConfig. This attribute
    is True if the GLXFBConfig supports GLX windows and/or pixmaps."

Every backend was setting this to true unconditionally, and then the
core ignored that value and sent true unconditionally on its own. This
is broken for ARB_fbconfig_float and EXT_fbconfig_packed_float, which
only apply to pbuffers, which are not renderable from non-GLX APIs.

Instead compute GLX_X_RENDERABLE from the supported drawable types. The
dri backends were getting _that_ wrong too, so fix that as well.

This is not a functional change, as there are no mesa drivers that claim
to support __DRI_ATTRIB_{UNSIGNED_,}FLOAT_BIT yet.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-09-06 10:29:14 -04:00
Rui Matos
589f42e983 xwayland: Process queued events before making wayland mods effective
Since xwayland's initial commit we have had a check to not process
wayland modifier events while one of our surfaces has keyboard focus
since the normal xkb event processing keeps our internal modifier
state up to date and if we use the modifiers we get from the
compositor we mess up that state.

This was slightly changed in commit
10e9116b3f to allow the xkb group to be
set from the wayland event while we have focus in case the compositor
triggers a group switch.

There's a better solution to the original problem though. Processing
queued events before overriding the xkb state with the compositor's
allows those events to be sent properly modified to X clients while
any further events will be modified with the wayland modifiers as
intended.

This allows us to fully take in the wayland modifiers, including
depressed ones, which fixes an issue where we wouldn't be aware of
already pressed modifiers on enter.

Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-06 13:05:42 +10:00
Eric Anholt
deae9c7e84 test: Run some XTS5 integration tests against Xvfb if possible.
By default the tests will be skipped.  However, if you set XTEST_DIR
to the repo of a built X Test Suite and PIGLIT_DIR to a piglit repo
(no build necessary), make check will run piglit's xts-render tests
against Xvfb.

We could run more of XTS5, but I haven't spent the time identifying
what additional subset would be worth running, since much of it is
only really testing the client libraries.  We want to make sure that
we keep the runtime down, and this subset of the test suite took 92
seconds according to piglit.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-09-02 16:24:32 -04:00
Qiang Yu
f06aef31c0 modesetting: add DRI2 page flip support
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-02 13:58:09 -04:00
Qiang Yu
4a839da627 modesetting: move common page flip handle to pageflip.c
The common page flip handle framework can be shared with DRI2
page flip.

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-02 13:57:42 -04:00
Qiang Yu
4f1eb7864b modesetting: move ms_do_pageflip to pageflip.c
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-02 13:56:10 -04:00
Qiang Yu
a586bf9ccf modesetting: make ms_do_pageflip generic for share with DRI2
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-09-02 13:46:42 -04:00
Adam Jackson
7d33ab0f8c dri2: Don't make reference to noClientException
noClientException is now never filled in with a meaningful value, it's
always -1. The sole caller of this function disregards the error value
in any case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-09-02 13:41:32 -04:00
Adam Jackson
dff435568b dri3: Don't do return client->noClientException
Hasn't been necessary since:

    commit 92ed75ac59
    Author: Jamey Sharp <jamey@minilop.net>
    Date:   Mon May 10 20:22:05 2010 -0700

        Eliminate boilerplate around client->noClientException.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-09-02 13:41:24 -04:00
Adam Jackson
65493c0b73 sync: Don't do return client->noClientException
Hasn't been necessary since:

    commit 92ed75ac59
    Author: Jamey Sharp <jamey@minilop.net>
    Date:   Mon May 10 20:22:05 2010 -0700

        Eliminate boilerplate around client->noClientException.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-09-02 13:41:05 -04:00
Hans De Goede
bc3eed379e modesetting: Hide cursor when initializing crtc
When Xorg gets started directly from a wayland-gdm the crtc still has the
wayland hw cursor set. Combine this with Xorg immediately falling back to
a sw cursor because a slave-output has a monitor attached at startup; and
we end up with the wayland hardware cursor overlay fixed in its last
position + the Xorg sw cursor resulting in 2 cursors.

This commit fixes this by hiding any left-over cursors when initializing
the crtc.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-09-02 13:09:40 -04:00
Hans De Goede
6c984ac9a7 modesetting: Do not use function local static variables
The modesetting driver may be driving 2 screens (slave and master
gpu), which may have different behavior wrt hardware cursor support.

So stop using static variables and instead store the hw-cursor support
related data in a per screen struct. While at it actually make it per
crtc data as in theory different crtc's could have different hw-cursor
support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-09-02 13:04:00 -04:00
Michael Thayer
d8c288ec37 xi2: fix FocusIn grabs
Fix a couple of copy-and-paste errors preventing FocusIn grabs from working.
Perhaps the extension version should be bumped though to distinguish between
working and non-working extension versions.

Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-02 12:57:42 -04:00
Peter Hutterer
25e4f9ee68 xfree86: print the module name together with the load failure message
We're happily printing the error to stdout but not which module caused it...
That's in the Xorg.log but that's at least one click away.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-24 08:30:10 +10:00
Michel Dänzer
be334f42a1 glamor: Declare "pos" in the composite glyph GLSL 1.20 vertex shader
Fixes shader compile failure:

 Failed to compile VS: 0:13(43): error: `pos' undeclared
0:13(14): error: operands to arithmetic operators must be numeric
0:13(13): error: operands to arithmetic operators must be numeric

 Program source:
#define ATLAS_DIM_INV 0.000976562500000000
attribute vec2 primitive;
attribute vec2 source;
varying vec2 glyph_pos;
uniform vec2 fill_offset;
uniform vec2 fill_size_inv;
varying vec2 fill_pos;
uniform vec4 v_matrix;
void main() {
       gl_Position.xy = primitive.xy * v_matrix.xz + v_matrix.yw;
       gl_Position.zw = vec2(0.0,1.0);
       glyph_pos = source.xy * ATLAS_DIM_INV;
       fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;
}
 (EE) Fatal server error:
 (EE) GLSL compile failure

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97300
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-08-23 12:59:55 +09:00
Michel Dänzer
cba28d572a glamor: Handle bitplane in glamor_copy_fbo_cpu
This can significantly speed up at least some CopyPlane cases, e.g.
indirectly for stippled fills.

v2:
* Make temporary pixmap the same size as the destination pixmap
  (instead of the destination drawable size), and fix coordinate
  parameters passed to fbCopyXtoX and glamor_upload_boxes. Fixes
  incorrect rendering with x11perf -copyplane* and crashes with the
  xscreensaver phosphor hack.
v3:
* Make the change a bit more compact and hopefully more readable by
  re-using the existing src_* locals in the bitplane case as well.

Reported-by: Keith Raghubar <keith.raghubar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Eric Anholt <eric@anholt.net>
2016-08-22 10:15:32 +09:00
Olivier Fourdan
6e5bec261c wayland: Emulate crossing for native window
Emitting a LeaveNotify event every time the pointer leaves an X11 window
may confuse focus follow mouse mode in window managers such as
mutter/gnome-shell.

Keep the previously found X window and compare against the new one, and
if they match then it means the pointer has left an Xwayland window for
a native Wayland surface, only in this case fake the crossing to the
root window.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-19 11:04:25 +10:00
Hans De Goede
48c5c23a1b Fix Xorg -configure not working anymore
Xorg -configure relies on the bus implementation, e.g.
xf86pciBus.c to call xf86AddBusDeviceToConfigure(). The new
xf86platformBus code does not have support for this.

Almost all drivers support both the xf86platformBus and xf86pciBus
nowadays, and the generic xf86Bus xf86CallDriverProbe() function
prefers the new xf86platformBus probe method when available.

Since the platformBus paths do not call xf86AddBusDeviceToConfigure()
this results in Xorg -configure failing with the following error:
"No devices to configure.  Configuration failed.".

Adding support for the xf86Configure code to xf86platformBus.c
is non trivial and since we advise users to normally run without
any Xorg.conf at all not worth the trouble.

However some users still want to use Xorg -configure to generate a
template config file, this commit implements a minimal fix to make
things work again for PCI devices by skipping the platform
probe method when xf86DoConfigure is set.

This has been tested on a system with integrated intel graphics,
with both the intel and modesetting drivers and restores Xorg -configure
functionality on both cases.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-08-18 14:29:53 -04:00
Adam Jackson
6acd0d098a test: Remember to swap the window argument to XIQueryPointer
Before 5c69cb60 this wouldn't matter, because ProcXIQueryPointer
manually emitted its own error before (bogusly) returning Success to the
main loop. Since these tests only look at the return value of the
dispatch function we'd think things succeeded even when we'd generated
an error.

With that fixed, the test code's failure to swap the window id would
make dixLookupWindow (rightly) throw BadWindow.

Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-08-17 11:04:13 -04:00
Adam Jackson
5c69cb604a xinput: Let top-level dispatch generate the error
... instead of calling SendErrorToClient ourselves.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-08-16 15:56:24 -04:00
Adam Jackson
2f981c06a5 xv: Remove some dumb calls SendErrorToClient
We already generate errors from the top level when non-Success is
returned from a dispatch function, so really we were emitting errors
twice.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-08-16 15:56:22 -04:00
Adam Jackson
0bfa6bf9de xwayland: Fix relinking when dix changes
Without this a change in eg Xext/ wouldn't relink Xwayland, making you
wonder why your changes didn't have any effect.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-08-16 15:56:18 -04:00