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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
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>
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>
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>
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>
Functions were removed in commit cad9b053d5
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>