Commit Graph

13806 Commits

Author SHA1 Message Date
Hans de Goede
bc9d17fb56 OdevAttribute: Add support for integer attributes
Add a couple of new functions for dealing with storing integer values into
OdevAttributes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 08:13:55 +01:00
Hans de Goede
350559dcdc OdevAttribute: config_odev_add_attribute: replace existing values
If an attribute already exists replace its value rather than adding a
duplicate attribute with the new value to the list.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 08:13:55 +01:00
Hans de Goede
10c64e8056 OdevAttribute: Add config_odev_get_attribute helper
Add a config_odev_get_attribute helper, and replace the diy looping over all
the attributes done in various places with calls to this helper.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 08:13:55 +01:00
Hans de Goede
3346166a65 xf86Xinput: Modify API for server-managed fd support
With systemd-logind support, the xserver, rather than the drivers will be
responsible for opening/closing the fd for input devices.

This commit adds a new capabilities field to the InputDriverRec and a
XI86_DRV_CAP_SERVER_FD flag for drivers to indicate that they support server
managed fds.

This commit adds a new XI86_SERVER_FD flag to indicate to drivers when the
server is managing the fd and they should not open/close it. Note that even
if drivers declare they support server managed fds there is no guarantee they
will actually get them.

Since this changes the input driver ABI, this commit bumps it.

systemd-logind tracks devices by their chardev major + minor numbers, since
we are breaking ABI anyways also add major and minor fields for easy storage /
retrieval of these.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 08:13:54 +01:00
Hans de Goede
6b79f28f5c linux: xf86OpenConsole: Don't detach from controlling tty when it is our vt
Detaching from our controlling tty makes little sense when it is the same
as the vt we're asked to run on. So automatically assume -keeptty in this case.

This is useful to do because when not running as root the server can only make
various VT related ioctls when it does not detach from the tty.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 08:13:54 +01:00
Hans de Goede
701b7ab349 linux: xf86OpenConsole remove root-rights check for keeptty option
There is no reason why keeptty cannot be used without root-rights.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03 08:13:54 +01:00
David Sodman
caf1dec2a7 V2: Add check for link from output to crtc before optimizing out a CrtcSet call
The function RRCrtcSet call checks to see if the config being set is
already configured, but, doesn't check that the selected outputs are
connected to the crtc before skipping.  This means that the following
sequence will omit the final CrtcSet call to the driver:

    CRTC c1 connect to output o
    CRTC c2 connect to output o
    CRTC c1 connect to output o

This change adds the check to ensure that each of the calls are made to
the driver.

Signed-off-by: David Sodman <dsodman@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-24 16:33:35 -08:00
Alan Coopersmith
249565a07d Fix test/os to work on Solaris
Due to bad decisions made decades ago at AT&T, on SVR4 OS'es the signal()
function resets the signal handler before calling the signal handler
(equivalent to sigaction flag SA_RESETHAND).  This is why the X server
has a OsSignal() helper function in os/utils.c that uses the portable
POSIX sigaction function to provide BSD/Linux semantics in a signal()
style API, so we switch to use that in this test case, allowing it to
pass on Solaris.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-24 16:32:04 -08:00
Alan Coopersmith
0031f6b073 Fix test/signal-logging to work on Solaris
For some reason, Solaris libc sprintf() doesn't add "0x" to the %p output
as glibc does, causing the test to fail for not matching the exact output.
Since the 0x is desirable, we add it ourselves to the test string.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-24 16:31:45 -08:00
Matthieu Herrb
e67f2d7e0f gcc 4.2.1 doesn't support #pragma GCC diagnostic ignored
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-24 16:30:07 -08:00
Keith Packard
1940508a4a Merge remote-tracking branch 'herrb/master' 2014-02-24 16:27:52 -08:00
Keith Packard
c85ea92af1 Bump to 1.15.99.901
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-24 09:51:39 -08:00
Keith Packard
0840a303c4 Merge remote-tracking branch 'anholt/glamor-pull-request' 2014-02-24 09:40:23 -08:00
Peter Hutterer
0f10cfd4b9 Xi: check for invalid modifiers for XI2 passive grabs
The other values are checked correctly, but if a modifier was outside the
allowed range, it would go unnoticed and cause a out-of-bounds read error for
any mask equal or larger than 256. The DetailRec where we store the grab masks
is only sized to 8 * sizeof(Mask).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-02-21 10:01:13 +10:00
Gaetan Nadon
ec6a446125 test: remove source file from hashtabletest LDADD
LDADD is for libraries and not for source code.

Introduced in commit: 	ccb3e78124

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-20 11:38:56 +10:00
Thierry Reding
31b0be69e5 test/input: Fix alignment assertion for doubles
The code previously tried to compute the offset of a field in the
valuator by subtracting the address of the valuator from the _value_ of
the field (rather than the field's address). The correct way to do it
would have been (note the &'s):

	assert(((void *) &v->axisVal - (void *) v) % sizeof(double) == 0);
	assert(((void *) &v->axes - (void *) v) % sizeof(double) == 0);

That's essentially what the offsetof() macro does. Using offsetof() has
the added benefit of not using void pointer arithmetic and therefore
silencing a warning on some compilers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-20 11:38:56 +10:00
Laércio de Sousa
9368bdec1d Get rid of config/non-seat0.conf.multi-seat
This file is deprecated by commits c73c36b53 and 46cf2a6093.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-17 08:44:33 +10:00
Eric Anholt
3d71df48e7 glamor: Move the EGL DRI3 code to GLAMOR_HAS_GBM.
There's nothing dependent on the presence of DRI3 code in the server
for this, but it does rely on GBM.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
80cdbb20f9 glamor: Fix linking of the gradient shaders on GLES2.
GLES2 sensibly doesn't allow you to attach multiple shaders for the
same stage to a single program.  This means we have to attach the
whole thing in one glShaderSource call.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
76bd0f9949 glamor: Don't bother keeping references to shader stages for gradients.
They never get reattached to any other program, so saving them to
unreference later is a waste of code.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
6e62cdf66d glamor: Fix typo in setting v_position's attrib location.
Assuming it was the first attribute assigned by the GL, it would have
ended up with location 0 anyway.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
f8d384fa8f glamor: Move shader precision stuff from build time to shader compile time.
This is the last desktop-versus-ES2 build ifdef in core glamor.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
1adac62a7d glamor: Unifdef the picture-format-to-format-and-type functions.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
3747c26081 glamor: Move glamor_get_tex_format_type_from_pictformat to a .c file.
A pair of 150 lines of inlined switch statements in a header file is
crazy.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
0e4f341418 glamor: Unifdef the cache format indices.
We only ask for GL_RGB on desktop GL as far as I can see, but now if
GLES2 did happen to ask for GL_RGB it would return a cache index
instead of -1.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
d63283860a glamor: Pass pixmaps around to unifdef glamor_iformat_for_depth().
v2: Just pass in the PicturePtr to glamor_pict_format_is_compatible()
    (suggestion by keithp)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
f3f4fc7a65 glamor: Add a screen argument to drop an ifdef from glamor_set_alu().
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
9553020b71 glamor: Drop a bunch of GLES2 ifdefs.
Now that we're using epoxy, we can write code using both desktop and
ES symbols and decide what to use at runtime.

v2: Fix a spelling mistake (latter), since the lines were moved
    anyway (noticed by Rémi Cardona).  Fix condition invert in
    glamor_set_composite_texture (caught by Michel Dänzer).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com> (v1)
Reviewed-by: Adam Jackson <ajax@redhat.com> (v1)
2014-02-14 18:30:01 -08:00
Eric Anholt
c3c8a5f360 glamor: yInverted is a boolean value, so use the Bool type.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
12cbfeed81 glamor: Drop fixed function transformation matrix setup.
gl_ModelViewProjection and friends aren't used in our shaders, so this
setup didn't do anything.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
62965d278c glamor: Drop useless glEnable/glDisable(GL_TEXTURE_2D) calls.
Those calls are only for enabling texture handling in the fixed
function pipeline, while everything we do is with shaders.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
4afe15d8bf glamor: Put in a pluggable context switcher for GLX versus EGL.
The GLX side just gets the context from the current state.  That's
also something I want to do for EGL, so that the making a context is
separate from initializing glamor, but I think I need the modesetting
driver in the server before I think about hacking on that more.

The previous code was rather incestuous, along with pulling in xf86
dependencies to our dix code.  The new code just initializes itself
from the current state.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-14 18:30:01 -08:00
Eric Anholt
781c692cf9 glamor: Rename glamor_get/put_dispatch to glamor_get/put_context.
It used to be the thing that returned your dispatch table and happeend
to set up the context, but now it just sets up the context.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-14 18:29:56 -08:00
Eric Anholt
0373b3f4f7 glamor: Convert to using libepoxy.
Libepoxy hides all the GL versus GLES2 dispatch handling for us, with
higher performance.

v2: Squash in the later patch to drop the later of two repeated
    glamor_get_dispatch()es instead (caught by keithp)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-14 18:28:56 -08:00
Jeremy Huddleston Sequoia
f34dc7fa96 XQuartz: pointer -> void *
Fix build regression from 60014a4a98

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-02-14 00:33:38 -08:00
Keith Packard
72237e0908 DIST_SUBDIRS needs to include glamor, even if it isn't built
Otherwise, glamor won't get cleaned for 'make distclean'

Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-13 15:25:56 -08:00
Gaetan Nadon
783991b1be config: fails to create tarball as xorg-server.conf file removed
Just need to update EXTRA_DIST

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-13 15:03:56 -08:00
Alan Coopersmith
30c3852bda Delete stray ; in struct _DeviceChangedEvent
Caused Solaris Studio cc to complain in every file which included it:
 "../include/eventstr.h", line 179: warning: syntax error:
  empty member declaration

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-09 17:21:20 -08:00
Keith Packard
5300212ce8 Merge remote-tracking branch 'whot/for-keith' 2014-02-09 16:05:42 -08:00
Peter Hutterer
0b193b3ac9 xfree86: use xnfstrdup in the Xorg -configure code
Just for consistency, I'm pretty sure the code is generally not happy for
malloc failures anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-10 07:02:38 +10:00
Peter Hutterer
7b1b7fb3be mi: fix printf warning about size_t format specifier
mieq.c:290:26: warning: format '%u' expects argument of type 'unsigned int',
but argument 2 has type 'size_t' [-Wformat=]

pnprintf supports size_t since 5ea21560dd

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-10 07:02:34 +10:00
Mark Kettenis
ddeca92749 sync: Avoid ridiculously long timeouts
On OpenBSD, passing a timeout longer than 100000000 seconds to select(2) will
make it fail with EINVAL.  As this is original 4.4BSD behaviour it is not
inconceivable that other systems suffer from the same problem.  And Linux,
though not suffering from any 4.4BSD heritage, briefly did something similar:

<https://lkml.org/lkml/2012/8/31/263>

So avoid calling AdjustWaitForDelay() instead of setting the timeout to
(effectively) ULONG_MAX milliseconds.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-02-09 10:41:18 +01:00
Keith Packard
ae796d43c9 ephyr: Repaint entire screen when colormap is updated
Any time the colormap is changed, the entire screen needs to be
repainted to match.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-07 16:34:18 -08:00
David Heidelberger
9eecc9ac73 configure.ac: add missing "test"
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-02-07 16:18:32 -08:00
Alan Coopersmith
08c7df9b08 __glGetProcAddress: explictly cast function pointers to void *
Fixes Solaris Studio compiler warning & error:

"glxext.c", line 557: warning: assignment type mismatch:
	    pointer to void "=" pointer to function(void) returning void
"glxext.c", line 559: error: operands have incompatible types:
	     pointer to void ":" pointer to function(void) returning void

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-07 16:14:58 -08:00
Eric Anholt
76eedb039f xfree86: Fix a compiler warning on 64-bit.
asm/mtrr.h makes this an unsigned long on 32, but a u64 on 64.  Cast
it to a long to win.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-07 16:03:48 -08:00
Eric Anholt
9f8f6657cd glx: Delete dead NV program string functions.
These have been throwing a compiler warning about missing prototypes,
since the generated code to define the prototypes stopped being
generated (possibly because the code was dead).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-07 16:03:38 -08:00
Eric Anholt
0c774d53c5 glx: Reduce compiler warnings by not requesting GL extension prototypes.
They're not officially in the ABI, so you shouldn't use them anyway.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-07 16:02:52 -08:00
Eric Anholt
87c4551c9c glx: Stop relying on libGL ABI bugs for glGetCompressedTexImage().
In theory, the linux libGL ABI exposes just GL 1.2 plus GLX 1.3.  But,
thanks to libglapi, we're letting glGetCompressedTexImageARB() be
exposed too.  The GLX code was inappropriately relying on it by using
GL_GLEXT_PROTOTYPES.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-07 16:00:26 -08:00
Jon TURNEY
bf4f02337c glx: Remove left-over glthread.c
Commit be668096 "glx: convert to direct GL dispatch (v2)" removes glthread.c
from Makefile.am along with the rest of the dispatch table code, but doesn't
remove glthread.c itself.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-02-07 15:54:39 -08:00