Commit Graph

14902 Commits

Author SHA1 Message Date
Dave Airlie
afd18bce6a xf86Crtc: setup tiled monitors correctly in right of
This puts the tiles of the monitor in the right place at
X server startup.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-27 13:40:41 +10:00
Adam Jackson
e472dd8942 xf86Crtc: right-of placement by default.
Change the X server default to do right-of placement
at startup. This gives an option to allow drivers to
override this placement, which has been used for server
drivers where both heads are not in the same physical
place.

Been in Fedora for a few years, but for tiled monitors
we really want something along these lines.

This is an ABI break.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-27 13:40:40 +10:00
Dave Airlie
69e4b8e602 xfree86: attempt to autoconfig gpu slave devices (v3)
This allows us to skip the screen section, the first
Device section will get assigned to the screen,
any remaining ones will get assigned to the GPUDevice
sections for the screen.

v2: fix the skipping unsuitable screen logic (Aaron)
v3: fix segfault if not conf file (me, 5s after sending v2)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-27 13:40:40 +10:00
Dave Airlie
3b6930c5d0 xserver: add xorg.conf support for gpu devices. (v2.1)
This allows gpu devices to be specified in xorg.conf Screen sections.

Section "Device"
        Driver "intel"
        Identifier "intel0"
        Option "AccelMethod" "uxa"
EndSection

Section "Device"
        Driver "modesetting"
        Identifier "usb0"
EndSection

Section "Screen"
        Identifier "screen"
        Device "intel0"
        GPUDevice "usb0"
EndSection

This should allow for easier tweaking of driver options which
currently mess up the GPU device discovery process.

v2: add error handling for more than 4 devices, (Emil)
fixup CONF_ defines to consistency
add MAX_GPUDEVICES define
(yes there is two defines, this is consistent
with everywhere else).
remove braces around slp (Mark Kettenis)
man page fixups (Aaron)
v2.1: fixup whitespace (Aaron)

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-27 13:40:40 +10:00
Colin Harrison
c7b49bdbb9 os/utils.c: Fix prototype for Win32TempDir()
xorg/xserver/os/utils.c: In function ‘Win32TempDir’:
xorg/xserver/os/utils.c:1643:1: warning: old-style function definition [-Wold-style-definition]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-04-22 12:55:32 +01:00
Colin Harrison
a9b4b7b796 os/utils.c: Don't try to build os_move_fd() for WIN32
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-04-22 12:55:29 +01:00
Jon TURNEY
2b114d6a51 hw/xnest: Fix build for MinGW
Include the wrapped windows.h via X11/Xwindows.h before xcb_keysyms.h to avoid
type clashes caused by the unwrapped windows.h that includes.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-04-22 12:55:27 +01:00
Jon TURNEY
5bf3e5c832 hw/xwin/winclipboard: Link xwinclip with -lpthread
Link xwinclip with -lpthread to fix build for MinGW

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-04-22 12:55:25 +01:00
Colin Harrison
8363ef2764 os/xdmcp.c: Include Xtrans.h when building for WIN32
Xtrans.h must be included on WIN32 to prototype _XSERVTransWSAStartup()

xserver/os/xdmcp.c: In function ‘get_addr_by_name’:
xserver/os/xdmcp.c:1483:5: error: implicit declaration of function ‘_XSERVTransWSAStartup’ [-Werror=implicit-function-declaration]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-04-22 12:55:15 +01:00
Alan Coopersmith
28ff661e73 Remove empty stub of $host_cpu case statement in configure.ac
Left behind when commit 5c12399b6c moved the xorg_bus_* settings
elsewhere.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Thomas Klausner <wiz@NetBSD.org>
2015-04-21 16:58:08 -07:00
Alan Coopersmith
d4e85afac6 Accept x86_64 as well as i*86 for $host_cpu in Solaris on x86
Needed when using a compiler that defaults to 64-bit output when
configure is checking for $host_cpu.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Thomas Klausner <wiz@NetBSD.org>
2015-04-21 16:58:08 -07:00
Alan Coopersmith
0018784cdd Convert hw/dmx to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:58:08 -07:00
Alan Coopersmith
dc5acaa28a Convert hw/kdrive to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:58:08 -07:00
Alan Coopersmith
ae2dc01cf1 Convert hw/xnest & hw/vfb to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:58:08 -07:00
Alan Coopersmith
4cb1034906 Convert hw/xfree86 to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:58:08 -07:00
Alan Coopersmith
f59236c286 Convert glamor & glx to new *allocarray functions
v2: fixup whitespace

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-04-21 16:58:08 -07:00
Alan Coopersmith
7ac2802874 Convert mi & miext to new *allocarray functions
v2: remove now useless parentheses

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:58:08 -07:00
Alan Coopersmith
70f4a0e6bd Convert exa & fb to new *allocarray functions
v2: fixup whitespace

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-04-21 16:58:07 -07:00
Alan Coopersmith
4fe6b03b97 Convert XKB to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
2015-04-21 16:57:54 -07:00
Alan Coopersmith
1c56ac63c0 Convert top level extensions to new *allocarray functions
v2: remove now useless parentheses

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:08 -07:00
Alan Coopersmith
b9e665c8b2 Convert dix/* to new *allocarray functions
v2: remove now useless parentheses

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:08 -07:00
Alan Coopersmith
df4e41fdb4 Convert os/* to new *allocarray functions
v2: remove now useless parentheses

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:08 -07:00
Alan Coopersmith
ae75d50395 Add no-fail equivalents of allocarray & reallocarray
v2: Remove extra 's' from comment

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:08 -07:00
Alan Coopersmith
c213b29d14 Add xallocarray() helper macro
Uses reallocarray to perform integer overflow detection when allocating
an array, using NULL as the previous pointer to force a new allocation.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:08 -07:00
Alan Coopersmith
0887c9463f Import reallocarray() from OpenBSD
Wrapper for realloc() that checks for overflow when multiplying
arguments together, so we don't have to add overflow checks to
every single call.  For documentation on usage, see:
http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/calloc.3

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:08 -07:00
Alan Coopersmith
b96dc99996 Add XNFcallocarray() to allow xnfcalloc() to check for overflow
The xnfcalloc() macro took two arguments but simply multiplied them
together without checking for overflow and defeating any overflow
checking that calloc() might have done.  Let's not do that.

The original XNFcalloc() function is left for now to preserve driver
ABI, but is marked as deprecated so it can be removed in a future round
of ABI break/cleanup.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:07 -07:00
Alan Coopersmith
f3ba909753 Let calloc handle multiplication
It's going to multiply anyway, so if we have non-constant values, might
as well let it do the multiplication instead of adding another multiply,
and good versions of calloc will check for & avoid overflow in the process.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:07 -07:00
Alan Coopersmith
a28202a148 Remove remaining doc references to Xalloc, Xrealloc, and Xfree
Functions were removed in commit cad9b053d5

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:07 -07:00
Alan Coopersmith
2a6d253b3f Remove apSolaris.shar (old "aperture" kernel driver for Solaris)
Modern Solaris releases provide this functionality in the OS via the
xsvc driver.   Since the move to libpciaccess, nothing in Xorg uses
this aperture driver any more.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-04-21 16:57:07 -07:00
Ray Strode
b1029716e4 systemd-logind: don't second guess D-Bus default timeout
At the moment, the X server uses a non-default timeout for D-Bus
messages to systemd-logind. The only timeouts normally used with
D-Bus are:

1) Infinite
2) Default

Anything else is just as arbitrary as Default, and so rarely makes
sense to use instead of Default.

Put another way, there's little reason to be fault tolerant against
a local root running daemon (logind), that in some configurations, the
X server already depends on for proper functionality.

This commit changes systemd-logind to just use the default timeouts.

Downstream-bug: https://bugzilla.redhat.com/show_bug.cgi?id=1209347
Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-04-17 10:57:48 -07:00
Ray Strode
792e925167 systemd-logind: filter out non-signal messages from message filter
It's possible to receive a message reply in the message filter if a
previous message call timed out locally before the reply arrived.

The message_filter function only handles signals, at the moment, and
does not properly handle message replies.

This commit changes the message_filter function to filter out all
non-signal messages, including spurious message replies.

Downstream-bug: https://bugzilla.redhat.com/show_bug.cgi?id=1209347
Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-04-17 10:57:31 -07:00
Keith Packard
41932dfbc8 mi: Partial pie-slice filled arcs may need more space for spans
The mi filled arc code estimates that a filled arc will produce no
more spans than the arc is tall. This is true for most arcs except
for pie-slice arcs strictly between 180 and 360 degrees where the missing
portion of the arc faces up or down such that we get two spans on some
scanlines.

For those, we need to reserve room for another height/2 spans. This
patch just does it for all partial pie-sliced arcs to make the test
easier to understand; it's just over-allocating a bit of memory, so
that's safe.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2015-04-13 18:41:26 -07:00
Hans de Goede
21e7d2bb5c Re-enable non serverfd input devices immediately on vtenter
Non serverfd input devices will never get a systemd-logind dbus resume signal,
causing them to never get re-enabled.

This commit changes xf86VTEnter() to enable them immediately, fixing this.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89756
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-04-13 10:22:24 -07:00
Keith Packard
f1da6bf5d9 Require randrproto version 1.5.0 or newer
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-03-31 17:07:43 -07:00
Aaron Plattner
e36236eade xfree86: Add GPU screens even if there are no active GDevs
xf86platformProbeDev creates GPU screens for any platform devices that were not
matched by a GDev in the loop above, but only if there was at least one device.
This means that it's impossible to configure a device as a GPU screen if there
is only one platform device that matches that driver.

Instead, create a GPU screen (if possible) for any platform device that was not
claimed by the GDev loop.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-31 14:36:11 -07:00
Aaron Plattner
4ecda36259 xfree86: Fix xf86_check_platform_slot's handling of PCI
If a PCI entity is found, xf86_check_platform_slot performs a device ID check
against the xf86_platform_device passed in.  However, it just returns
immediately without checking the rest of the entities first.  This leads to this
situation happening:

1. The nvidia driver creates an entity 0 with bus.type == BUS_PCI
2. The intel driver creates entity 1 for its platform device, opening
   /dev/dri/card0
3. xf86platformProbeDev calls probeSingleDevice on the Intel platform device,
   which calls doPlatformProbe, which calls xf86_check_platform_slot.
4. xf86_check_platform_slot compares the Intel platform device against the
   NVIDIA PCI entity.  Since they don't have the same device ID, it returns
   TRUE.
5. doPlatformProbe calls xf86ClaimPlatformSlot, which creates a duplicate entity
   for the Intel one.

Fix this by only returning FALSE if the PCI ID matches, and continuing the loop
otherwise.  In the scenario above, this allows it to continue on to find the
Intel platform device that matches the second entity.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-31 14:36:00 -07:00
Keith Packard
e608f3521e Merge remote-tracking branch 'airlied/for-keithp' 2015-03-31 09:06:08 -07:00
Jon Turney
d3b9c47c84 Fix XQuartz build
Fix XQuartz build since commit e036cbfc "Make PseudoramiXExtensionInit()
prototype more generally available"

Add #include "nonsdk_extinit.h" to xprScreen.c

Add #include "nonsdk_extinit.h" to miinitext.c under INXQUARTZ to provide
declarations used under INXQUARTZ

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-03-31 09:02:28 -07:00
Keith Packard
5de1383070 randr: Use Monitor list for Xinerama
This replaces the CRTC-based Xinerama implementation with one which
uses Monitors instead, allowing clients to manipulate the Xinerama
configuration through the RandR Monitor list.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-03-31 12:32:04 +10:00
Keith Packard
7e1f86d42b randr: Add Monitor support (v1.1)
Store the user-defined monitors in the RandR screen private.

Generate a list of monitors from both the user-defined ones and from
any outputs not mentioned in one of the user-defined monitors. This list
covers both the outputs in the main screen as well as any slaves.

v1.1: airlied: fix up primary skipping bug,
fix wrong height initialiser
add get_active flag from updated protocol.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-03-31 12:32:04 +10:00
Dave Airlie
9c2b4f8e0e xf86Crtc: add tile prop setting
Add support for drivers to set the tiling
property. This is used by clients to
work out the monitor tiles for DisplayID
monitors.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-03-31 12:31:51 +10:00
Keith Packard
7088816fee Merge remote-tracking branch 'anholt/glamor-next' 2015-03-27 06:45:56 -07:00
Keith Packard
e977b404d7 glamor: * 1/size is faster than / size in VS
Pass the inverse of the texture size to glamor vertex shaders so that
we multiply by that instead of dividing by the size as multiplication
is generally faster than division.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-24 12:43:35 -07:00
Jon TURNEY
82634d2b69 ephyr: Avoid a segfault with 'DISPLAY= Xephyr -glamor'
ephyr_glamor_connect() returns NULL if we failed, but applying
xcb_connection_has_error() to NULL is not permitted.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
2015-03-24 12:43:34 -07:00
Adam Jackson
391bcf77db glamor: Fix up indentation
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-03-24 12:43:34 -07:00
Matt Turner
0669babf2b glamor: Perform texture2D() separately from swizzle.
The texture2D() happens in each branch, so we may as well do it as early
as possible and hide some of its latency in the branching instructions.
Moving it outside the (uniform) control flow reduces the number of
instructions in the fs_source shader from 64 to 46 and in the
set_alpha_source shader from 69 to 47 on Haswell.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24 12:43:34 -07:00
Eric Anholt
9e9fcf5780 glamor: Add a helper function for the common GL_QUADS fallback pattern.
We should do better than this with an index buffer, but for now at
least make it so that we don't have to copy the same code to new
places.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-03-24 12:43:34 -07:00
Eric Anholt
909a406aa2 glamor: Don't optimize out scissor updates in CopyArea.
This possibly is a minor hit for immediate mode renderers (no
difference on copypixin100 on my hsw, n=12), but it gives important
information about drawing bounds to a deferred renderer (3.1x
improvement in copypixwin100 on vc4).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-03-24 12:43:34 -07:00
Eric Anholt
6ba6cc57e1 glamor: Just set the logic op to what we want at the start of all rendering.
By dropping the unconditional logic op disable at the end of
rendering, this fixes GL errors being thrown in GLES2 contexts (which
don't have logic ops).  On desktop, this also means a little less
overhead per draw call from taking one less trip through the
glEnable/glDisable switch statement of doom in Mesa.

The exchange here is that we end up taking a trip through it in the
XV, Render, and gradient-generation paths.  If the glEnable() is
actually costly, we should probably cache our logic op state in our
screen, since there's no way the GL could make that switch statement
as cheap as the caller caching it would be.

v2: Don't forget to set the logic op in Xephyr's drawing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-03-24 12:43:34 -07:00
Jon TURNEY
8102927282 glamor: Fix build when configured --enable-glamor --disable-xshmfence
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>
2015-03-24 12:43:34 -07:00