platform/upstream/xorg-server.git
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 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>
10 years agoglamor: remove disabled code
Markus Wick [Wed, 12 Mar 2014 23:24:04 +0000 (00:24 +0100)]
glamor: remove disabled code

This block was disabled since 2011, so there is likely no need to keep it any more.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoRemove duplicate assignment of repeat_type_uniform_location
Alan Coopersmith [Wed, 12 Mar 2014 00:28:10 +0000 (17:28 -0700)]
Remove duplicate assignment of repeat_type_uniform_location

Flagged by cppcheck 1.64:
[glamor/glamor_gradient.c:987] -> [glamor/glamor_gradient.c:991]:
    (performance) Variable 'repeat_type_uniform_location' is
             reassigned a value before the old one has been used.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Apply debug labels to our shaders.
Eric Anholt [Thu, 20 Feb 2014 23:50:03 +0000 (15:50 -0800)]
glamor: Apply debug labels to our shaders.

This will help tools like fips, apitrace, or INTEL_DEBUG=shader_time
provide useful information about the shaders in use.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Don't forget to unmap our PBOs before using them to upload.
Eric Anholt [Sun, 12 Jan 2014 05:26:01 +0000 (21:26 -0800)]
glamor: Don't forget to unmap our PBOs before using them to upload.

From the GL_ARB_vertex_buffer_object spec:

    After the client has specified the contents of a mapped data store,
    and before the data in that store are dereferenced by any GL commands,
    the mapping must be relinquished by calling

        boolean UnmapBufferARB(enum target);

Our mappings were only getting reaped at PBO destroy time, after the
upload.  If the GL implementation wasn't coherent, it would have used
stale data to do the texture upload.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Add an assert about an invariant the upload code relies on.
Eric Anholt [Sun, 12 Jan 2014 05:11:18 +0000 (21:11 -0800)]
glamor: Add an assert about an invariant the upload code relies on.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Fix ignoring the ALU during SetSpans().
Eric Anholt [Fri, 10 Jan 2014 07:54:25 +0000 (15:54 +0800)]
glamor: Fix ignoring the ALU during SetSpans().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Improve the performance of line fallbacks.
Eric Anholt [Thu, 9 Jan 2014 03:36:30 +0000 (11:36 +0800)]
glamor: Improve the performance of line fallbacks.

If the lines aren't solid-filled vert/horiz solid-filled rectangles,
we fall back.  libreoffice has some diagonal lines, and the
performance of the fallback path was atrocious.  Just fall back to
mi's spans instead, so that we don't do an upload/download.

Improves x11perf -seg100 by 863.652% +/- 9.8968% (n=5)

Signed-off-by: Eric Anholt <eric@anholt.net>
10 years agoglamor: Improve the performance of PolyGlyphBlt.
Eric Anholt [Thu, 9 Jan 2014 02:53:04 +0000 (10:53 +0800)]
glamor: Improve the performance of PolyGlyphBlt.

Using the same idea as the previous PushPixels code, just make points
for each point in the glyph.  This is an advantage over the pushpixels
fallback because we can batch the BO mappings and draw calls across
glyphs.

Improves performance of x11perf -f8text by 773.389% +/- 3.50754% (n=10).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Improve the performance of PushPixels by, well, pushing pixels.
Eric Anholt [Sun, 5 Jan 2014 13:54:48 +0000 (21:54 +0800)]
glamor: Improve the performance of PushPixels by, well, pushing pixels.

Otherwise, mi will fall back to GetSpans()ing the bitmap, walking the
bitmap, computing spans to be filled, and calling FillSpans().

Improves x11perf -f8text by 759.373% +/- 3.33096% (n=166)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Add missing prepares on the GC during fb fallbacks.
Eric Anholt [Fri, 10 Jan 2014 16:06:21 +0000 (00:06 +0800)]
glamor: Add missing prepares on the GC during fb fallbacks.

We had regressions in CopyPlane reported by xts5, because we were
(successfully!) dereferencing the null pixmap->devPrivate.ptr for a
tile or stipple without having done a prepare.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Rely on nested mappings to handle src==dst and !prepare bugs.
Eric Anholt [Fri, 10 Jan 2014 16:00:00 +0000 (00:00 +0800)]
glamor: Rely on nested mappings to handle src==dst and !prepare bugs.

Now that the core deals with that for us, we can avoid all this extra
carefulness.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Allow nested mapping of pixmaps.
Eric Anholt [Fri, 10 Jan 2014 15:43:09 +0000 (23:43 +0800)]
glamor: Allow nested mapping of pixmaps.

The common pattern is to do nested if statements making calls to
prepare_access() and then pop those mappings back off in each set of
braces.  Some cases checked for src == dst to avoid leaking mappings,
but others didn't.  Others didn't even do the nested mappings, so a
failure in the outer map would result in trying to umap the inner and
failing.

By allowing nested mappings, we can fix both problems by not requiring
the care from the caller, plus we can allow a simpler nesting of all
the prepares in one if statement.

v2: Add a comment about nested unmap behavior, and just reuse the
    glamor_access_t enum.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Drop unused GLAMOR_ACCESS_WO.
Eric Anholt [Fri, 10 Jan 2014 15:39:02 +0000 (23:39 +0800)]
glamor: Drop unused GLAMOR_ACCESS_WO.

Nothing was using it, and it was going to complicate the
glamor_prepare_access bugfixing I'm going to do next.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Drop stale comment.
Eric Anholt [Thu, 13 Mar 2014 17:09:08 +0000 (10:09 -0700)]
glamor: Drop stale comment.

The old Xephyr codebase was using the GL window system framebuffer for
the screen pixmap, but that meant you couldn't texture from it to do
operations sourcing from the screen, so in the version that landed I
instead had the screen just be a plain texture.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: Replace some goofy enum-likes with a real enum.
Eric Anholt [Fri, 10 Jan 2014 14:42:02 +0000 (22:42 +0800)]
glamor: Replace some goofy enum-likes with a real enum.

This unpacks the bitfield into an int size, but my experience has been
that packing bitfields doesn't matter for performance.

v2: Convert more comparisons against numbers or implicit bool
    comparisons to comparisons against the enum names, and fix up some
    comments.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Fix up doxygen for glamor_fill.c.
Eric Anholt [Sun, 5 Jan 2014 23:22:47 +0000 (07:22 +0800)]
glamor: Fix up doxygen for glamor_fill.c.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Rename more solid fill variables to clean up the code.
Eric Anholt [Sun, 5 Jan 2014 23:05:02 +0000 (07:05 +0800)]
glamor: Rename more solid fill variables to clean up the code.

Now the error path of allocation is more obvious: We leave things in
the a-few-boxes-at-a-time stack memory state.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Rename a variable to be more descriptive.
Eric Anholt [Sun, 5 Jan 2014 23:01:17 +0000 (07:01 +0800)]
glamor: Rename a variable to be more descriptive.

The "valid_" prefix was used above to describe our allocation that
gets reused multiple times, which is totally unrelated.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Fix some integer overflow errors.
Eric Anholt [Sun, 5 Jan 2014 22:55:15 +0000 (06:55 +0800)]
glamor: Fix some integer overflow errors.

Imagine a nbox that was (UINT_MAX + small number) / (4 * 2 *
sizeof(float)).  We'd malloc a few bytes after the integer overflow,
but glamor_set_normalize_vcoords would write over gigabytes of heap.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Drop bogus _X_UNLIKELY.
Eric Anholt [Sun, 5 Jan 2014 22:53:46 +0000 (06:53 +0800)]
glamor: Drop bogus _X_UNLIKELY.

nbox > 4 is actually quite common for spans handling.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Fix stack overflow in glamor_solid vertex handling.
Eric Anholt [Sun, 5 Jan 2014 22:52:32 +0000 (06:52 +0800)]
glamor: Fix stack overflow in glamor_solid vertex handling.

ARRAY_SIZE(vertices) is 32 (floating point values), so we need to
divide by the number of floats in a box like we do in the overflow
case below.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Drop duplicated lines for getting pixmap state in GetImage.
Eric Anholt [Sat, 4 Jan 2014 21:28:52 +0000 (13:28 -0800)]
glamor: Drop duplicated lines for getting pixmap state in GetImage.

No change in generated code size -- apparently the compiler figured it
out.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Return the stride/size for glamor_dri3_name_from_pixmap(), too.
Eric Anholt [Tue, 31 Dec 2013 02:41:57 +0000 (18:41 -0800)]
glamor: Return the stride/size for glamor_dri3_name_from_pixmap(), too.

Just like for a caller of glamor_dri3_fd_from_pixmap(), otherwise the
consumer of that named buffer has no idea what GL chose for the
stride.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Drop the body of the function for enabling DRI3 extensions.
Eric Anholt [Tue, 31 Dec 2013 02:33:09 +0000 (18:33 -0800)]
glamor: Drop the body of the function for enabling DRI3 extensions.

The flag is already being set at glamor_egl_screen_init() time, so no
need for the driver to separately call this.  That said, leave the
function around to keep the ABI compatibility.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agosync: Add a header include necessary to use misyncstr.h
Eric Anholt [Tue, 31 Dec 2013 02:29:50 +0000 (18:29 -0800)]
sync: Add a header include necessary to use misyncstr.h

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: Do glyph private init at screeninit time, and other stuff at CSR.
Eric Anholt [Sat, 28 Dec 2013 21:46:17 +0000 (13:46 -0800)]
glamor: Do glyph private init at screeninit time, and other stuff at CSR.

This hasn't actually been a problem, since the server hasn't allocated
any glyphs before our glyph private initialization during
CreateScreenResources.  But it's generally not X Server style to do
things this way.

Now that glamor itself drives both parts of glyphs setup, DDX drivers
no longer need to tell glamor to initialize glyphs.  We do retain the
old public symbol so they can keep running with no changes.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Move the EGL image to the normal pixmap private.
Eric Anholt [Sat, 28 Dec 2013 02:45:44 +0000 (18:45 -0800)]
glamor: Move the EGL image to the normal pixmap private.

There's no reason to hide EGL from the rest of glamor, now that we
have epoxy.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Use epoxy_has_egl_extension() instead of rolling our own.
Eric Anholt [Sat, 28 Dec 2013 02:27:56 +0000 (18:27 -0800)]
glamor: Use epoxy_has_egl_extension() instead of rolling our own.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
10 years agoglamor: Drop the set of the context to NULL at the end of glamor ops.
Eric Anholt [Sun, 5 Jan 2014 10:45:05 +0000 (02:45 -0800)]
glamor: Drop the set of the context to NULL at the end of glamor ops.

The theory here was that it (which I copied from EGL) existed to fix
up context switching with indirect GLX.  But indirect GLX won't even
try to set the context again unless its lastContext field is cleared,
so we need to solve this a different way.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoxephyr: Don't forget to glViewport() before drawing the screen.
Eric Anholt [Fri, 28 Feb 2014 01:55:50 +0000 (17:55 -0800)]
xephyr: Don't forget to glViewport() before drawing the screen.

Fixes misrendering with cairogears.  I had noticed the failure while
trying to figure out what was going on with traps.  Cairogears was
apparently putting its results on the screen through putimage, which
is a texture upload, so the last GL drawing was done to the size of
the cairogears window, not the size of the xephyr screen.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoxkb: add KeymapOrDefault
Kristian Høgsberg [Wed, 12 Mar 2014 07:20:17 +0000 (17:20 +1000)]
xkb: add KeymapOrDefault

Helper function to return a default map if the keymap compilation failed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoxkb: factor out xkb loading to LoadXkm
Kristian Høgsberg [Wed, 12 Mar 2014 07:18:22 +0000 (17:18 +1000)]
xkb: factor out xkb loading to LoadXkm

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoxkb: add a callback to xkbcomp
Peter Hutterer [Wed, 12 Mar 2014 06:08:15 +0000 (16:08 +1000)]
xkb: add a callback to xkbcomp

This provides a callback to write to xkbcomp's buffer once everything is
prepared.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoxkb: constify XkbDDXOpenConfigFile
Peter Hutterer [Wed, 12 Mar 2014 07:17:25 +0000 (17:17 +1000)]
xkb: constify XkbDDXOpenConfigFile

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoxf86Xinput: release server managed fd before removing the device from the list
Hans de Goede [Wed, 12 Mar 2014 15:00:23 +0000 (16:00 +0100)]
xf86Xinput: release server managed fd before removing the device from the list

So that the fd in use test in systemd_logind_release_fd works properly.

Note we cannot change the test inside systemd_logind_release_fd as it must
work for devices which were never added to the xf86InputDevs too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosystemd-logind: Correctly deal with InputDevs sharing a device-node
Hans de Goede [Wed, 12 Mar 2014 13:57:24 +0000 (14:57 +0100)]
systemd-logind: Correctly deal with InputDevs sharing a device-node

InputDevices may share a single device-node, this happens ie with Wacom
tablets.

This patch makes take_fd and release_fd properly deal with this, together
with the earlier patch for updating the fd in all matching xf86InputDevs
on pause / resume this completes support for such shared device-nodes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosystemd-logind: Add a systemd_logind_set_input_fd_for_all_devs helper
Hans de Goede [Wed, 12 Mar 2014 11:58:22 +0000 (12:58 +0100)]
systemd-logind: Add a systemd_logind_set_input_fd_for_all_devs helper

And use it where appropriate.

Setting the fd for all matching InputDevices is necessary when we've
multiple InputDevices sharing a single device-node, such as happens with
Wacom tablets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosystemd_logind_find_info_ptr_by_devnum: Move to higher inside the file
Hans de Goede [Wed, 12 Mar 2014 12:19:32 +0000 (13:19 +0100)]
systemd_logind_find_info_ptr_by_devnum: Move to higher inside the file

This is a preparation patch for adding support for server managed fds
for InputDevices where multiple input devices share the same device node (and
thus also their major and minor).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosystemd_logind_find_info_ptr_by_devnum: Add a start argument
Hans de Goede [Wed, 12 Mar 2014 11:45:40 +0000 (12:45 +0100)]
systemd_logind_find_info_ptr_by_devnum: Add a start argument

Modify systemd_logind_find_info_ptr_by_devnum to take a start argument, so
that it can be used to find all occurences of a devnum in an InputInfo list,
rather then just the first.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoRemove config_odev_add_*attribute checks in various places
Hans de Goede [Tue, 11 Mar 2014 10:38:09 +0000 (11:38 +0100)]
Remove config_odev_add_*attribute checks in various places

Note that there are more callers but those were already not doing any
error checking.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoconfig_odev*: Use XNF alloc functions
Hans de Goede [Tue, 11 Mar 2014 10:28:15 +0000 (11:28 +0100)]
config_odev*: Use XNF alloc functions

config_odev* functions are called in code-paths were we already use
XNF* functions in other places, so which are not oom safe already.

Besides that oom is something which should simply never happen, so aborting
when it does is as good a response as any other.

While switching to XNF functions also fixup an unchecked strdup case.

Note the function prototypes are kept unchanged, as they are part of the
server ABI.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoXorg: Add a suid root wrapper
Hans de Goede [Wed, 5 Mar 2014 15:41:14 +0000 (16:41 +0100)]
Xorg: Add a suid root wrapper

With the recent systemd-logind changes it is possible to install the Xorg
binary without suid root rights and still have everything working as it
should *if* the user only has cards which are supported by kms.

This commit adds a little suid root wrapper, which is a bit weird, first we
strip the suid-root bit of the Xorg binary, and then we add a wrapper ?

The function of this wrapper is to see if a system still needs root-rights,
if it does not (it supports kms and the kms drivers are properly loaded),
then it will immediately drop all elevated rights before executing the real
Xorg binary. If it finds (some) cards which don't support kms, or no cards
at all, then it will execute the Xorg server with elevated rights so that
ie the nvidia binary driver and the vesa driver can keep working normally.

To make it possible for security concious users who don't need the root
rights to completely remove the wrapper, Xorg is started in a 3 step process
when the wrapper is enabled during build time:

1) A simple shell script which checks if the wrapper is there, if it is
  it executes the wrapper, if not it directly executes the real Xorg binary

2) The wrapper gets executed, does its checks, normally drops all elevated
  rights and then executes the real Xorg binary

3) The real Xorg binary does its thing

This allows distributions to put the wrapper binary in a separate package, and
will allow users to remove this package. IE the plan with Fedora is to make
"legacy" drivers depend on the wrapper pkg, and since our default install
contains some legacy drivers it will be part of the default install, but
users can later yum remove it (which will also automatically remove the
legacy driver packages as those won't work without it anyways).

The wrapper is loosely modelled after the existing Debian Xwrapper, it
uses the same config-file + config-file format, and also allows restricting
Xserver execution (through the wrapper) to console users only.

There also is a new needs_root_rights config file directive, which can
be used to override the auto-detection the wrapper does.

Hopefully this will allow Debian to replace their own wrapper with this
upstream one.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoxkb: Repurpose XkbCopyDeviceKeymap to apply a given keymap to a device
Rui Matos [Fri, 7 Mar 2014 22:32:27 +0000 (14:32 -0800)]
xkb: Repurpose XkbCopyDeviceKeymap to apply a given keymap to a device

This will also make it useful for cases when we have a new keymap to
apply to a device but don't have a source device.

Reviewed-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 agoxkb: Factor out a function to copy a keymap's controls onto another
Rui Matos [Fri, 7 Mar 2014 22:32:28 +0000 (14:32 -0800)]
xkb: Factor out a function to copy a keymap's controls onto another

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Wed, 12 Mar 2014 05:04:36 +0000 (22:04 -0700)]
Merge remote-tracking branch 'whot/for-keith'

10 years agoconfig: search for PnPID on all parents (#75513)
Peter Hutterer [Tue, 25 Feb 2014 21:54:56 +0000 (07:54 +1000)]
config: search for PnPID on all parents (#75513)

The PnPID for a device may not be on the immediate parent, so search up the
device tree until we find one.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
10 years agoxkb: push locked modifier state down to attached slave devices
Peter Hutterer [Wed, 26 Feb 2014 06:20:08 +0000 (16:20 +1000)]
xkb: push locked modifier state down to attached slave devices

Whenever the master changes, push the locked modifier state to the attached
slave devices, then update the indicators. This way, when NumLock or CapsLock
are hit on any device, the LED will light up on all devices. Likewise, a new
keyboard attached to a master device will light up with the correct
indicators.

The indicators are handled per-keyboard, depending on the layout, i.e. if one
keyboard has grp_led:num set, the NumLock LED won't light up on that keyboard.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agoxkb: factor out state update into a function
Peter Hutterer [Wed, 26 Feb 2014 06:16:10 +0000 (16:16 +1000)]
xkb: factor out state update into a function

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agoxkb: factor out the StateNotify flag check
Peter Hutterer [Wed, 26 Feb 2014 06:03:19 +0000 (16:03 +1000)]
xkb: factor out the StateNotify flag check

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agoxfree86: handle xorg.conf devices with logind
Peter Hutterer [Tue, 11 Mar 2014 04:21:27 +0000 (14:21 +1000)]
xfree86: handle xorg.conf devices with logind

Only devices from the config backend have their attributes set, devices from
the xorg.conf only have Option "Device". That option is also set by the
config backend, so use it.

And since the config backend sets our major/minor but xorg.conf devices don't
have that set, make sure we try to stat it first where needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
10 years agoconfig: only free odev->attrib_name for string types
Peter Hutterer [Tue, 11 Mar 2014 04:20:51 +0000 (14:20 +1000)]
config: only free odev->attrib_name for string types

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
10 years agoglx: Clear new FBConfig attributes to 0 by default.
Eric Anholt [Fri, 7 Mar 2014 02:50:07 +0000 (18:50 -0800)]
glx: Clear new FBConfig attributes to 0 by default.

The visualSelectGroup wasn't getting set (since our DRI drivers don't
use it), and and since it's the top priority in the sort order, you
got random sorting of your visuals unless malloc really returned you
new memory.  This manifested as Xephyr -glamor rendering to a
multisampled window on my system, which as you might guess was
slightly lower performance than expected.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoglamor: Use buffer_storage
Eric Anholt [Wed, 26 Feb 2014 00:56:54 +0000 (16:56 -0800)]
glamor: Use buffer_storage

v2:
  - Make the default buffer size a #define. (by Markus Wick)
  - Fix the return offset for mapping with buffer_storage.  (oops!)
v3:
  - Avoid GL error at first rendering from unmapping no buffer.
  - Rebase on the glBindBuffer(GL_ARRAY_BUFFER, 0) change.
v4: Rebase on Markus's vbo init changes.
v5: Fix missing put_context() in the buffer_storage fallback path.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Fix requested composite VBO size.
Eric Anholt [Sun, 12 Jan 2014 15:54:51 +0000 (07:54 -0800)]
glamor: Fix requested composite VBO size.

The argument to setup_composte_vbo is the number of verts.

v2: Drop the now-unused vert_stride value.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Extract the streamed vertex data code used by Render.
Eric Anholt [Mon, 6 Jan 2014 01:29:57 +0000 (09:29 +0800)]
glamor: Extract the streamed vertex data code used by Render.

We should be uploading any vertex data using this kind of upload
style, since it saves a bunch of extra copies of our vertex data.

v2:
  - Add a simple comment about what the function does.
  - Use get_vbo_space()'s return in trapezoids, instead of dereffing
    glamor_priv->vb (by Markus Wick).
  - Fix the double-unmapping by moving put_vbo_space() outside of
    flush_composite_rects().
  - Remove the rest of the composite_vbo_offset usage, and just always
    use get_vbo_space()'s return value.
v3:
  - Fix failure to put_vbo_space in traps when no prims were
    generated.
  - Unbind the VBO from put_vbo_space().  Keeps callers from
    forgetting to do so.
v4:
  - Split out some changes into the previous 3 commits while trying to
    track down a regression.
  - Fix regression due to rebase fail where glamor_priv->vbo_offset
    wasn't incremented.
v5:
  - Fix GLES2 VBO sizing.
  - Add a comment about resize behavior.
  - Move glamor_vbo.c init code to glamor_vbo.c from
    glamor_render.c. (Derived from Markus's changes, but the GLES2 fix
    dropped almost all of the code in the functions).
v6:
  - Drop the initial BufferData on GLES2 (it happens at put() time).
  - Don't forget to set vbo_offset to the size on GLES2.
  - Use char * instead of void * in the cast to return the vbo_offset.
  - Resize the default FBO to 512kb, to be similar to previous
    behavior.  +1.66124% +/- 0.284223% (n=679) on aa10text.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Track the next vertex offset as we go for AA traps.
Eric Anholt [Fri, 7 Mar 2014 01:05:31 +0000 (17:05 -0800)]
glamor: Track the next vertex offset as we go for AA traps.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Track the next vertex offset as we go for non-AA traps.
Eric Anholt [Fri, 7 Mar 2014 01:03:14 +0000 (17:03 -0800)]
glamor: Track the next vertex offset as we go for non-AA traps.

v2: Use sizeof(float) instead of 4.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Track the next vertex offset as we go in render accel.
Eric Anholt [Fri, 7 Mar 2014 00:57:46 +0000 (16:57 -0800)]
glamor: Track the next vertex offset as we go in render accel.

I want to extract the VBO mapping code, and as part of that I need to
get the global vbo_offset munging to stop.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Move glamor_emit_composite_vert() to traps, where it's used.
Eric Anholt [Thu, 6 Mar 2014 21:29:08 +0000 (13:29 -0800)]
glamor: Move glamor_emit_composite_vert() to traps, where it's used.

It's only used in the nonantialiased, triangle-based trapezoids path.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Don't forget to set GL_INVALIDATE_RANGE_BIT on GL_ARB_mbr.
Eric Anholt [Tue, 24 Dec 2013 20:14:04 +0000 (12:14 -0800)]
glamor: Don't forget to set GL_INVALIDATE_RANGE_BIT on GL_ARB_mbr.

We don't need any current contents of the buffer, and this allows an
implementation to make a temporary BO for a streamed upload if it
wants to.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Fix a mismatched glamor_get/put_context().
Eric Anholt [Sat, 11 Jan 2014 23:18:50 +0000 (07:18 +0800)]
glamor: Fix a mismatched glamor_get/put_context().

We don't call GL in this function any more, so we can just drop the
get.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Add a note about the state of GL_ARB_map_buffer_range.
Eric Anholt [Fri, 27 Dec 2013 22:03:26 +0000 (14:03 -0800)]
glamor: Add a note about the state of GL_ARB_map_buffer_range.

GLES2 Xephyr is failing due to lack of glMapBuffer() with the read
bits set, and I decided to see if we can just switch everything to
glMapBufferRange().  I'm undecided, and it largely depends on whether
we find people are interested in using glamor for the windows X server.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: Fix a spelling mistake in GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE.
Eric Anholt [Wed, 25 Dec 2013 00:07:12 +0000 (16:07 -0800)]
glamor: Fix a spelling mistake in GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoglamor: remove dead global variable.
Eric Anholt [Tue, 24 Dec 2013 02:16:01 +0000 (18:16 -0800)]
glamor: remove dead global variable.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
10 years agoRequire video drivers to report that they support server managed fds
Hans de Goede [Mon, 3 Mar 2014 15:58:54 +0000 (16:58 +0100)]
Require video drivers to report that they support server managed fds

This makes how we handle video drivers identical to what we do for input
drivers, and this should make live easier for old non kms drivers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
10 years agoxf86platformBus: Make doPlatformProbe accept a NULL gdev argument
Hans de Goede [Mon, 3 Mar 2014 15:07:16 +0000 (16:07 +0100)]
xf86platformBus: Make doPlatformProbe accept a NULL gdev argument

And use it from xf86platformAddDevice too, instead of directly calling
drvp->platformProbe.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
10 years agosystemd-logind: Fix vt-enter not working when using a legacy video driver
Hans de Goede [Fri, 7 Mar 2014 09:59:47 +0000 (04:59 -0500)]
systemd-logind: Fix vt-enter not working when using a legacy video driver

If there is only a single non kms video device (tested with the vesa driver),
then we will never get a resume signal for a drm node, so also call vtenter
when we get a resume for an input device.

Notes:
1) vtenter checks if it is ok to do the vtenter, so if there are kms video
devices the calls for input device resumes are a nop
2) This assumes that there will always be at least one server event fd
supporting input device. Since all non legacy input-drivers will be patched
to supported server fds this seems a safe assumption.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoconfig_odev_add*_attribute: Don't add the attribute to the list twice
Hans de Goede [Mon, 3 Mar 2014 16:00:57 +0000 (17:00 +0100)]
config_odev_add*_attribute: Don't add the attribute to the list twice

Don't do the xorg_list_append a 2nd time when updating existing attributes,
while at it add a helper function for this to avoid code duplication.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agohashtabletest: Fix warning: format ‘%ld’ expects argument of type ...
Hans de Goede [Mon, 3 Mar 2014 08:51:36 +0000 (09:51 +0100)]
hashtabletest: Fix warning: format ‘%ld’ expects argument of type ...

This fixes the following compiler warning:

hashtabletest.c: In function ‘print_xid’:
hashtabletest.c:15:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘XID’ [-Wformat=]
     printf("%ld", *x);
     ^

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoxserver: fix build since system-logind.h
Dave Airlie [Sun, 9 Mar 2014 22:58:37 +0000 (08:58 +1000)]
xserver: fix build since system-logind.h

on tinderbox and irc

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'jwrdecoede/for-keith'
Keith Packard [Sat, 8 Mar 2014 06:07:19 +0000 (22:07 -0800)]
Merge remote-tracking branch 'jwrdecoede/for-keith'

10 years agoFix xephyr build in --disable-glamor case
Jon TURNEY [Fri, 7 Mar 2014 15:59:10 +0000 (15:59 +0000)]
Fix xephyr build in --disable-glamor case

It broke after commit 9fe052d90cca90fdf750d3a45b151be2ac7f0ebd
"xephyr: Build support for rendering with glamor using a -glamor
option."

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

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agodix: Clear any existing selections before initializing privates
Andrew Eikum [Mon, 30 Dec 2013 15:15:41 +0000 (09:15 -0600)]
dix: Clear any existing selections before initializing privates

If there is a selection left over from a previous execution of the
main loop, and that selection has privates allocated for it, the X
server will crash. This is because dixResetPrivates() resets the
privates refcounts to zero without accounting for the reference held
by the selection object. When the selection is then deleted in
InitSelections() after the call to dixResetPrivates(), the refcount
for its privates type goes negative and bad things happen.

To fix this, we should delete any existing selections before calling
dixResetPrivates(). This will properly release the selection's
privates and avoid the crash.

A more thorough description of the problem and a test case to
reproduce the crash is available at a previous mail:
  "Negative Selection devPrivates refcount?"
  By Andrew Eikum to xorg-devel on 10 Dec 2013
  http://lists.freedesktop.org/archives/xorg-devel/2013-December/039492.html

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: Add support for DRI3.
Eric Anholt [Tue, 31 Dec 2013 08:07:42 +0000 (00:07 -0800)]
glamor: Add support for DRI3.

The render-nodes case is untested.

v2: Add a flag for wayland to suppress the native DRI3 support.
    Wayland isn't running as a master itself, so it can't do the auth
    on its own and has to ask the compositor to do it for us.  Dropped
    XXX about randr provider -- the conclusion from discussion with
    keithp was that if the driver's dri3_open for a provider on a
    different screen, that's a core dri3 bug.
v3: Don't put quite so much under GLAMOR_NO_DRI3, and add a comment
    explaining what this is about.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Rename the DRI-related pixmap functions.
Eric Anholt [Tue, 31 Dec 2013 02:49:46 +0000 (18:49 -0800)]
glamor: Rename the DRI-related pixmap functions.

There was confusion over whether they should have egl in the name, and
they had DRI3 in the name even though they're useful to have without
DRI3.

v2: Just rename glamor_name_from_pixmap for now -- I'd accidentally
    conflict-resolved in adding new parameters from a later commit.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxorg: Connect up the glamor XV code, xorg DDX-only for now.
Eric Anholt [Sat, 28 Dec 2013 06:19:07 +0000 (22:19 -0800)]
xorg: Connect up the glamor XV code, xorg DDX-only for now.

Porting this code to be non-xorg-dependent is going to take
significant hacking, so just dump it in the glamoregl module for the
moment, so I can hack on it while regression testing.

v2: Fix compiler warnings by adding #include dix-config.h at the top,
    don't try to auto-init (I'll try to fix the xv ABI later).
v3: Fix last minute breakage of having reintroduced xf86ScrnToScreen
    (one of the compat macros).  Just use the drawable's pScreen instead.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxorg: Build a glamor_egl module.
Eric Anholt [Sat, 28 Dec 2013 00:44:15 +0000 (16:44 -0800)]
xorg: Build a glamor_egl module.

This is not exposing the API we want long term, but it should get
existing DDX drivers up and running while we massage the API into
shape.

v2: Use LIBADD instead of LDFLAGS to fix deps on libglamor.la, and use
    version 0.5.1 (the point it was forked from the external repo).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxephyr: Pass incoming XCB events to the Xlib event filter.
Eric Anholt [Fri, 20 Dec 2013 18:41:43 +0000 (10:41 -0800)]
xephyr: Pass incoming XCB events to the Xlib event filter.

This is the same thing that Qt ended up doing to get DRI2's event
mangling to happen despite using an XCB event loop.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxephyr: Build support for rendering with glamor using a -glamor option.
Eric Anholt [Wed, 18 Dec 2013 21:24:14 +0000 (13:24 -0800)]
xephyr: Build support for rendering with glamor using a -glamor option.

v2: Avoid making the Ximage for the screen that we'll never use, and
    drive the screen pixmap creation for glamor ourselves.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com> (v1)
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agohw/xwin: More closely follow ICCCM for setting input focus
Jon TURNEY [Thu, 27 Jun 2013 22:56:23 +0000 (23:56 +0100)]
hw/xwin: More closely follow ICCCM for setting input focus

In multiwindow mode, more closely follow ICCCM section 4.1.7 when setting X
input focus to a window when the native Windows window acquires input focus:

- If InputHint is FALSE, don't use XSetInputFocus()
- If the window supports the WM_TAKE_FOCUS protocol, send a WM_TAKE_FOCUS message

This helps JDK 1.7 clients acquire the focus correctly.

Also, factor out checking client support for a given WM_PROTOCOLS protocol as a
separate function.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agohw/xwin: Remove unnecessary casts from malloc/realloc/calloc calls
Colin Harrison [Fri, 28 Feb 2014 15:02:14 +0000 (15:02 +0000)]
hw/xwin: Remove unnecessary casts from malloc/realloc/calloc calls

Remove unnecessary casts from malloc/realloc/calloc calls. This is the style
used for the majority of X server code.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Add missing FORCEEXIT token to XWin configuration file lexer
Colin Harrison [Fri, 28 Feb 2014 14:23:00 +0000 (14:23 +0000)]
hw/xwin: Add missing FORCEEXIT token to XWin configuration file lexer

Somehow this was left out of commmit f3fad371cce0f3836514ad5b29e59fa1ca0627a7

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Silence bell when volume is zero
Colin Harrison [Fri, 28 Feb 2014 14:21:46 +0000 (14:21 +0000)]
hw/xwin: Silence bell when volume is zero

Allow the bell to be turned off with X server option '-f 0', or by 'xset b off'.

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, 28 Feb 2014 14:21:06 +0000 (14:21 +0000)]
hw/xwin: Fix typo in comment

'i' before 'e' except after 'c'

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Align parameter names in prototypes with definition
Colin Harrison [Fri, 28 Feb 2014 14:20:48 +0000 (14:20 +0000)]
hw/xwin: Align parameter names in prototypes with definition

A follow up to commits 2d9123fd451c5d91 and efe96a17, which changed the
parameter name in the definition from index to i, to fix shadowing index() but
didn't adjust the prototype declaration.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Just generate the WGL wrappers we need
Jon TURNEY [Wed, 1 Jan 2014 16:43:38 +0000 (16:43 +0000)]
hw/xwin: Just generate the WGL wrappers we need

Just generate the WGL wrappers we need, rather than for everything in wgl.xml

This avoids generating a lot of unused wrappers, and also avoids compilation
requiring a wglext.h at least as new as wgl.xml

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agohw/xwin: Fix implicit-function-declaration warning in XwinExtensionInit() when compil...
Yaakov Selkowitz [Wed, 10 Apr 2013 17:04:17 +0000 (18:04 +0100)]
hw/xwin: Fix implicit-function-declaration warning in XwinExtensionInit() when compiled with XWIN_GLX_WINDOWS defined

InitOutput.c: In function ‘XwinExtensionInit’:
InitOutput.c:170:9: error: implicit declaration of function ‘glxWinPushNativeProvider’ [-Werror=implicit-function-declaration]
         glxWinPushNativeProvider();
         ^
InitOutput.c:170:9: warning: nested extern declaration of ‘glxWinPushNativeProvider’ [-Wnested-externs]

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agoxf86OpenSerial: Add support server managed fds
Hans de Goede [Sat, 1 Feb 2014 12:21:15 +0000 (13:21 +0100)]
xf86OpenSerial: Add support server managed fds

Try to get a server managed fd from the Options before trying to open the
device node ourselves.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoconfig-udev: Don't try to add drm devices twice
Hans de Goede [Tue, 14 Jan 2014 14:47:48 +0000 (15:47 +0100)]
config-udev: Don't try to add drm devices twice

Before this commit we were trying to add most drm devices twice, once
from xf86platformProbe() and once from config_udev_init().

This results in somewhat confusing messages in Xorg.log, ie:

(II) xfree86: Adding drm device (/dev/dri/card0)
Later followed by:
(II) config/udev: Adding drm device (/dev/dri/card0)

By filtering out duplicate drm devices we avoid these confusing messages.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosystemd-logind: Add delayed input device probing
Hans de Goede [Fri, 31 Jan 2014 14:21:38 +0000 (15:21 +0100)]
systemd-logind: Add delayed input device probing

With systemd-logind we cannot probe input devices while switched away, so
if we're switched away, put the pInfo on a list, and probe everything on
that list on VT-Enter.

This is using an array grown by re-alloc, rather than a xorg_list since
creating a new data-type to store a pInfo + list-entry just for this seems
overkill.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosystemd-logind: Hookup systemd-logind integration
Hans de Goede [Tue, 14 Jan 2014 14:37:33 +0000 (15:37 +0100)]
systemd-logind: Hookup systemd-logind integration

This commits makes the changes necessary outside of the systemd-logind core
to make the server use systemd-logind managed fds for input devices and drm
nodes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agosystemd-logind: Add systemd-logind "core"
Hans de Goede [Tue, 7 Jan 2014 11:15:12 +0000 (12:15 +0100)]
systemd-logind: Add systemd-logind "core"

This commits add the bulk of the systemd-logind integration code, but does
not hook it up yet other then calling its init and fini functions, which
don't do that much.

Note the configure bits check for udev since systemd-logind use will only be
supported in combination with udev. Besides that it only checks for dbus
since all communication with systemd-logind is happening over dbus, so
no further libs are needed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>