While at it also replace a tab by four spaces for consistency.
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-By: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Use the OutputClass configuration to determine what drivers to autoload
for a given device.
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-By: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
The OutputClass section provides a way to match output devices to a set
of given attributes and configure them. For now, only matching by kernel
driver name is supported. This can be used to determine what DDX module
to load for non-PCI output devices. DDX modules can ship an xorg.conf.d
snippet (e.g. in /usr/share/X11/xorg.conf.d) that looks like this:
Section "OutputClass"
Identifer "NVIDIA Tegra open-source driver"
MatchDriver "tegra"
Driver "opentegra"
EndSection
This will cause any device that's driven by the kernel driver named
"tegra" to use the "opentegra" DDX module.
See the OUTPUTCLASS section in xorg.conf(5) for more details.
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-By: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
When opening a DRM device, query the version and store the driver name
as a new attribute for future reference.
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-By: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Most of the driver enumeration functions take an array and a maximum
number of entries that they are allowed to fill in. Upon success, they
return the number of entries filled in. This allows them to be easily
used to consecutively.
One exception is the xf86MatchDriverFromFiles() function, which doesn't
return a value, so callers have to manually search the array for the
first empty entry.
This commit modifies the xf86MatchDriverFromFiles() to behave the same
way as others, which makes it easier to deal with.
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-By: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Rob Clark <robdclark@gmail.com> (on arm / platform device)
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
With my patch to fix shared libXfont to work correctly on Cygwin/Win32,
there is no need for -static anymore. But, XWin.exe must export its
symbols in order for them to override libXfont's stubs.
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
When transitioning to a redirected or unredirected Window, the Composite
layer modifies the Window's Pixmap. However, the DRI2Buffer for the
Drawable is still pointing to the backing bo of the old Pixmap with the
result that rendering goes astray.
This now also effects DRI2 Drawables that are touched by PresentPixmap.
v2: Fixup the function name after rebasing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Reinis Danne <reinis.danne@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This fixes a segfault when we attempt to call ds->ReuseBufferNotify()
passing a Prime DRI2BufferPtr to the master backend.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80001
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This is so that drivers can do a runtime check that Present is available,
similar to existing runtime checks performed by the drivers for DRI.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
This is so that drivers can do a runtime check that DRI3 is available,
similar to existing runtime checks performed by the drivers for DRI and
DRI2.
v2: Only add DRI3 to the list if the module was actually built into the
server (Mark Kettenis).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Keith Packard <keithp@keithp.com>
To make X -configure work properly, the output of fixup_video_driver_list()
should be in order of preference. Otherwise, the config file may use
the incorrect driver for some devices.
In particular, the drivers that work for all (or many) devices need to be
last in the list. Since the modesetting driver works for many devices,
it needs to be considered a fallback driver.
Signed-off-by: Søren Sandmann <ssp@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Update for __glXLastContext -> lastGLContext.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This has to run at initial CreateWindow time, at CreateScreenResources
the root window doesn't actually exist yet.
Tested-by: Michael Thayer <michael.thayer@oracle.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michael Thayer <michael.thayer@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
v2: Fix another path spotted by keithp
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Checking the iterating variable ("slave") against null can not detect if the
xorg_list_for_each_entry finished without break being invoked - slave variable
will be always non-null. This caused segfault whenever someone tried to use
DRI_PRIME with incorrect id while having at least one render offloading slave
configured.
Restructurize the GetScreenPrime to work as expected.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Xorg server could be built for and run on Synopsys DesignWare ARC cores.
These changes are required for successful building and execution of the server.
Both little-endian and big-endian flavors of ARC cores are supported.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Egbert Eich <eich@freedesktop.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
This patch fixes some compile warnings that arise after
commit 7070ebeeba
(xfree86: add new key MatchSeat to xorg.conf sections "Device", "Screen", and "ServerLayout")
available at git repository
git://people.freedesktop.org/~whot/xserver for-keith
Signed-off-by: Keith Packard <keithp@keithp.com>
We can only request one fd per device from systemd-logind. If a fd is re-used
by the same device, releasing the fd from one device doesn't mean we can close
it. The systemd code knows when it's really released, so let it close the fd.
Test case: xorg.conf section for an input device with hotplugging enabled.
evdev detects the duplicate and closes the hotplugged device, which closes the
fd. The other instance of evdev thinks the fd is still valid so now you're
playing a double lottery. First, which client(s) will get the evdev fd?
Second, which requests will be picked up by evdev and which ones will be
picked up by the client? You'll never know, but the fun is in finding out.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
With the change in the cursor interface in
4c3932620c, we need to bump the video
driver ABI number to ensure that drivers are rebuilt to match the new
interface.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Laércio de Sousa <lbsousajr@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This patch introduces a new key MatchSeat in xorg.conf (also applies to
any .conf file in xorg.conf.d). It will allow targeting a given
"Device", "Screen", and/or "ServerLayout" section to a particular
seat only (specified by option "-seat" in X server command line),
so that other seats won't be affected.
Without this patch, one needs to write a separate xorg.conf.custom
file and pass it to X server via "-config" option, if one wants that
these settings only apply for the right seat. However, in some cases,
this solution is undesirable or even impossible (e.g. when using GDM,
which doesn't allow X server command line customization).
Example file (/etc/X11/xorg.conf.d/seat1.conf), which would be ignored
by X server unless it was started with "-seat seat1" option:
Section "Device"
Identifier "card0"
Driver "nvidia"
Option "NoLogo" "True"
MatchSeat "seat1"
EndSection
Signed-off-by: Oleg Samarin <osamarin68@gmail.com>
Signed-off-by: Laércio de Sousa <lbsousajr@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Currently non-seat0 X servers only probe platform bus for graphics devices,
which is OK for most KMS-compliant drivers. However, for non-KMS drivers
(like NVIDIA proprietary ones), graphics devices can't be reached
by platform bus probe, resulting in a "No devices detected" error.
This patch allows a fallback to PCI bus probe for non-seat0 X servers
in case no platform bus graphics device is found.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66851
Signed-off-by: Laércio de Sousa <lbsousajr@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Commit 7353ec7cb6 "xfree86: Switch int10
code to stdint types" uses designated initializers to setup the fields
of the X86EMU_pioFuncs.
This breaks compilation on ARM, since out{b,w,l}() are redefined using
the preprocessor and therefore cause the compiler to complain about
non-existent fields being assigned to.
It seems like the compiler.h header that contains these redefinitions
isn't actually needed in xf86x86emu.c, so the easiest "fix" is to not
include it.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Fixes:
stub.c:66:1: error: conflicting types for 'xf86int10Addr'
In file included from stub.c:14:0:
xf86int10.h:72:53: note: previous declaration of 'xf86int10Addr' was here
Signed-off-by: Rob Clark <robdclark@gmail.com>
Create load_cursor_image_check, load_cursor_argb_check,
LoadCursorImageCheck and LoadCursorARGBCheck that can return failure
and use them in preference to the old unchecked variants.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Michael Thayer <michael.thayer@oracle.com>
When setting crtc->gamma_size to randr_crtc->gammaSize we should
use randr_crtc->gammaSize to allocate new gamma table in crtc.
Currently, if randr_crtc->gammaSize > crtc->gammaSize the subsequent
memcpy will overwrite memory beyond the end of gamma table.
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Mark mips64 as 64bit
Use long as PORT_SIZE
Signed-off-by: YunQiang Su <wzssyqa@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Ok, that's embarassing -- I didn't even make sure Adam's patch
compiled. These are minimal fixes to make it build.
Signed-off-by: Keith Packard <keithp@keithp.com>
Somewhat shocking how much simpler this is, isn't it? We no longer need
to wrap the screen or GC or Picture, because damage does it for us,
which is doubly great since the old shadowfb code didn't wrap _enough_
things (border updates and Render glyphs, at least). The only real
difference now between this and shadow is a) shadow will let you track
arbitrary pixmaps, and b) shadow's update hook runs off the BlockHandler
whereas shadowfb is immediate.
Tested on nouveau.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Flagged by cppcheck 1.64:
[hw/dmx/config/xdmxconfig.c:306] -> [hw/dmx/config/xdmxconfig.c:323]:
(warning) Possible null pointer dereference: fs - otherwise
it is redundant to check it against null.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Fixes Piglit test "swapbuffersmsc-return swap_interval 0".
Ensure that *swap_target gets initialized on any 'return Success' path,
even if the swap request can't be completed by the driver and the server
falls back to a simple blit. That path can also be triggered by setting
swap_interval to 0, which disables sync to vertical retrace.
We originally found this bug because for some reason SDL2 automatically
sets swap_interval to 0, when we were trying to test OML_sync_control in
an SDL2 test application. We then discovered that the above-mentioned
Piglit test has been failing for the same reason since it was
introduced.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Theo Hill <Theo0x48@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
swap_target is an out-parameter that needs to be set to the value that
SBC will take on after this SwapBuffers request completes.
However, it was also being used as a temporary variable to hold the MSC
at which the SwapBuffers request got scheduled to occur. This confusion
makes it harder to reason about whether swap_target is being set
correctly for its out-parameter usage. (Hint: It isn't.)
For the latter use, it makes more sense to use the existing target_msc
variable, which already has the right value unless target_msc, divisor,
and remainder are all 0, in which case we can set it using swap_interval
as usual.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Theo Hill <Theo0x48@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
I'm not sure what we'd do in this case anyways, other than fatal
error.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Make it clear that we intentionally ignore the -switchCmd return
value. This keeps GCC from emitting a warning when the server is
compiled with -D_FORTIFY_SOURCE=2.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>