path: root/hw/xfree86/common
AgeCommit message (Collapse)AuthorFilesLines
2020-09-24Bump input minor ABI due to addition of input event drain callbackPovilas Kanapickas1-1/+1
Signed-off-by: Povilas Kanapickas <>
2020-09-24mi: Add a callback to notify driver about input event submissionPovilas Kanapickas2-0/+19
This is useful for mock input drivers that control the server in integration tests. Given that input submission happens on a different thread than processing, it's otherwise impossible for the driver to synchronize with the completion of the processing of submitted events. Signed-off-by: Povilas Kanapickas <>
2020-09-15Consolidate fourcc.hMichel Dänzer3-182/+1
Move the copy in hw/xfree86/common to include/, and remove the one in hw/kdrive/src/. Fixes DIX glamor code including an xfree86 DDX header.
2020-07-13xfree86: Bump ABI_VIDEODRV_VERSION to 25.2Michel Dänzer1-1/+1
This gives out of tree drivers a fighting chance to build against both sides of . Reviewed-by: Dave Airlie <>
2020-07-05Fix spelling/wording issuesAlan Coopersmith13-21/+21
Most (but not all) of these were found by using codespell --builtin clear,rare,usage,informal,code,names but not everything reported by that was fixed. Signed-off-by: Alan Coopersmith <>
2020-04-10Xorg: honor AutoRepeat optionMichael Stapelberg1-0/+28
This option was implemented before the drivers were split in ≈2006, and e.g. XWin still supports it. With this commit, Xorg regains support, so that the following configuration can be used to set the repeat rate for all keyboard devices without having to modify Xorg command-line flags or having to automate xset(1): Section "InputClass" Identifier "system-keyboard" MatchIsKeyboard "on" Option "XkbLayout" "de" Option "XkbVariant" "neo" Option "AutoRepeat" "250 30" EndSection Signed-off-by: Michael Stapelberg <>
2020-02-12Fix modesetting device matching through kmsdev device pathZoltán Böszörményi1-1/+9
xf86platformProbeDev didn't check the device path, fix it. This is a problem when trying to set up a non-PCI device via explicit xorg.conf.d configuration. An USB DisplayLink device, being non-PCI was always set up as a GPU device assigned to screen 0 instead of a regular framebuffer, potentially having its own dedicated screen, despite such configuration as below. Only the relevant parts of the configuration are quoted, it's part of a larger context with an Intel chip that has 3 outputs: * DP1 connected to an LCD panel, * VGA1 connected to an external monitor, * HDMI1 unconnected and having no user visible connector Section "ServerFlags" Option "AutoBindGPU" "false" EndSection ... Section "Device" Identifier "Intel2" Driver "intel" BusID "PCI:0:2:0" Screen 2 Option "Monitor-HDMI1" "HDMI1" Option "ZaphodHeads" "HDMI1" EndSection Section "Device" Identifier "UDL" Driver "modesetting" Option "kmsdev" "/dev/dri/card0" #BusID "usb:0:1.2:1.0" Option "Monitor-DVI-I-1" "DVI-I-1" Option "ShadowFB" "on" Option "DoubleShadow" "on" EndSection ... Section "Screen" Identifier "SCREEN2" Option "AutoServerLayout" "on" Device "UDL" GPUDevice "Intel2" Monitor "Monitor-DVI-I-1" SubSection "Display" Modes "1024x768" Depth 24 EndSubSection EndSection Section "ServerLayout" Identifier "LAYOUT" Option "AutoServerLayout" "on" Screen 0 "SCREEN" Screen 1 "SCREEN1" RightOf "SCREEN" Screen 2 "SCREEN2" RightOf "SCREEN1" EndSection On the particular machine I was trying to set up an UDL device, I found the following structure was being used to match the device to a platform device while I was debugging the issue: xf86_platform_devices[0] == Intel, /dev/dri/card1, primary platform device xf86_platform_devices[1] == UDL, /dev/dri/card0 devList[0] == "Intel0", ZaphodHeads: DP1 devList[1] == "Intel1", ZaphodHeads: VGA1 devList[2] == "UDL" devList[3] == "Intel2", ZaphodHeads: HDMI1 (intended GPU device to UDL) When xf86platformProbeDev() matched the UDL device, the BusID check failed in both cases of: * BusID "usb:0:1.2:1.0" was specified * Option "kmsdev" "/dev/dri/card0" was specified As a result, xf86platformProbeDev() went on to call probeSingleDevice() with xf86_platform_devices[0] and devList[2], resulting in the UDL device being set up as a GPU device assigned to the first screen instead of as a framebuffer on the third screen as the configuration specified. Checking Option "kmsdev" in code code may be a layering violation. But the modesetting driver is actually part of the Xorg sources instead of being an external driver, so he "kmsdev" path knowledge may be used here. Signed-off-by: Böszörményi Zoltán <>
2020-01-08hw/xfree86/common/xf86Init.c: fix build without glxFabrice Fontaine1-1/+0
Since commit d8ec33fe0542141aed1d9016d2ecaf52da944b4b, an include on glxvndabi.h has been added to hw/xfree86/common/xf86Init.c However, if glx is disabled through --disable-glx and GLX headers are not installed in the build's environment, build fails on: In file included from xf86Init.c:81: ../../../include/glxvndabi.h:64:10: fatal error: GL/glxproto.h: No such file or directory 64 | #include <GL/glxproto.h> | ^~~~~~~~~~~~~~~ Fix this failure by removing this include which does not seem to be needed (an other option would have been to keep it under an ifdef GLXEXT block) Fixes: - Signed-off-by: Fabrice Fontaine <>
2019-11-26modesetting: Use EGL_MESA_query_driver to select DRI driver if possibleKenneth Graunke1-1/+1
New now ask Glamor to use EGL_MESA_query_driver to obtain the DRI driver name; if successful, we use that as the DRI driver name. Following the existing dri2.c logic, we also use the same name for the VDPAU driver, except for i965 (and now iris), where we switch to the "va_gl" fallback. This allows us to bypass the PCI ID lists in xserver and centralize the driver selection mechanism inside Mesa. The hope is that we no longer have to update these lists for any future hardware.
2019-11-13loader: Move LoaderSymbolFromModule() to public APIAdam Jackson1-0/+1
Bare LoaderSymbol() isn't really a great API, this is more of a direct map to dlsym like you want. Gitlab:
2019-11-13xfree86: Call ScreenInit for protocol screens before GPU screensAaron Plattner1-25/+25
During startup, the xfree86 DDX's InitOutput() calls PreInit for protocol screens first, and then GPU screens. On teardown, dix_main() calls CloseScreen in the reverse order: GPU screens first starting with the last one and then working backwards, and then protocol screens also in reverse order. InitOutput() calls ScreenInit in the wrong order: for GPU screens first and then for protocol screens. This causes a problem for drivers that have global state that is tied to the first screen that calls ScreenInit. Fix this by simply re-ordering the for loops to call PreInit for protocol screens first and then for GPU screens second.
2019-10-30mi: Add a default no-op miSourceValidateAdam Jackson1-3/+2
Slightly simplifies the callers since they don't need to check for non-NULL anymore. I do extremely hate the workarounds here to suppress misprite taking the cursor down though. Surely there's a better way. Reviewed-by: Michel Dänzer <>
2019-10-30include: Remove now-empty site.hAdam Jackson1-1/+0
2019-08-15global: Remove BUILD_DATE and BUILD_TIMEAdam Jackson1-23/+0
All this does is make reproducible builds impossible.
2019-08-07xf86: autobind GPUs to the screenDave Airlie6-0/+47
This is a modified version of a patch we've been carry-ing in Fedora and RHEL for years now. This patch automatically adds secondary GPUs to the master as output sink / offload source making e.g. the use of slave-outputs just work, with requiring the user to manually run "xrandr --setprovideroutputsource" before he can hookup an external monitor to his hybrid graphics laptop. There is one problem with this patch, which is why it was not upstreamed before. What to do when a secondary GPU gets detected really is a policy decission (e.g. one may want to autobind PCI GPUs but not USB ones) and as such should be under control of the Desktop Environment. Unconditionally adding autobinding support to the xserver will result in races between the DE dealing with the hotplug of a secondary GPU and the server itself dealing with it. However we've waited for years for any Desktop Environments to actually start doing some sort of autoconfiguration of secondary GPUs and there is still not a single DE dealing with this, so I believe that it is time to upstream this now. To avoid potential future problems if any DEs get support for doing secondary GPU configuration themselves, the new autobind functionality is made optional. Since no DEs currently support doing this themselves it is enabled by default. When DEs grow support for doing this themselves they can disable the servers autobinding through the servers cmdline or a xorg.conf snippet. Signed-off-by: Dave Airlie <> [ Make configurable, fix with nvidia, submit upstream] Signed-off-by: Hans de Goede <> Reviewed-by: Eric Anholt <> Reviewed-by: Emil Velikov <> --- Changes in v2: -Make the default enabled instead of installing a xorg.conf snippet which enables it unconditionally Changes in v3: -Handle GPUScreen autoconfig in randr/rrprovider.c, looking at rrScrPriv->provider, rather then in hw/xfree86/modes/xf86Crtc.c looking at xf86CrtcConfig->provider. This fixes the autoconfig not working with the nvidia binary driver
2019-07-22hw: Rename boolean config value field from bool to booleanAdam Jackson2-6/+6
"bool" conflicts with C++ (meh) and stdbool.h (ngh alright fine). This is a driver-visible change and will likely break the build for mach64, but it can be fixed by simply using xf86ReturnOptValBool like every other driver. Signed-off-by: Adam Jackson <>
2019-07-15compiler.h: Do not include sys/io.h on ARM with glibcOlivier Fourdan1-30/+0
<sys/io.h> on ARM hasn't worked for a long, long time, so it was removed it from glibc upstream. Remove the include to avoid a compilation failure on ARM with glibc. Signed-off-by: Olivier Fourdan <> Closes:
2019-05-02Promote file containing date & time build was configured to top-levelJon Turney5-25/+5
Promote the generated file containing the date & time build was configured to top-level. Rename it from xf86Build.h to buildDateTIme.h. Use it as well in XQuartz, stringize BUILD_DATE when needed.
2019-04-17Fix maybe-uninitialized warning in xf86NewInputDevice()Jon Turney1-1/+1
If SYSTEMD_LOGIND is not defined, systemd_logind_take_fd is defined as a macro evaluating to -1 by systemd-logind.h, leaving paused uninitialized. ../hw/xfree86/common/xf86Xinput.c: In function ‘xf86NewInputDevice’: ../hw/xfree86/common/xf86Xinput.c:919:16: warning: ‘paused’ may be used uninitialized in this function [-Wmaybe-uninitialized] ../hw/xfree86/common/xf86Xinput.c:877:10: note: ‘paused’ was declared here
2019-04-12xfree86: Export xf86GPUScreens and xf86NumGPUScreensAaron Plattner1-2/+2
Drivers may need to loop over the allocated screens during PreInit, for example to consolidate xorg.conf options that apply to a GPU device as a whole. Currently, this works for protocol screens becuase x86Screens is exported, but does not work for GPU screens. Export xf86GPUScreens and xf86NumGPUScreens for consistency with xf86Screens and xf86NumScreens. Signed-off-by: Aaron Plattner <>
2019-02-25Add xf86OSInputThreadInit call from common layer into os-support layerAlan Coopersmith1-0/+1
Allows os backends to run additional code as necessary to set up the input thread. Signed-off-by: Alan Coopersmith <>
2019-02-25Add ddxInputThread call from os layer into ddx layerAlan Coopersmith1-0/+9
Allows ddx's to run additional code as necessary to set up the input thread. Signed-off-by: Alan Coopersmith <>
2019-01-10xfree86: Try nouveau on NetBSD as well.Maya Rashish1-1/+1
2018-10-29Fix segfault on probing a non-PCI platform device on a system with PCI.Eric Anholt1-1/+1
Some Broadcom set-top-box boards have PCI busses, but the GPU is still probed through DT. We would dereference a null busid here in that case. Signed-off-by: Eric Anholt <>
2018-10-25os: Factor out CHECK_FOR_REQUIRED_ARGUMENTSAdam Jackson1-20/+13
Lifted from vfb. xfree86 had almost the same thing but unparameterized, port it to the vfb style. Signed-off-by: Adam Jackson <> Reviewed-by: Alan Coopersmith <>
2018-10-25Disable -logfile and -modulepath when running with elevated privilegesMatthieu Herrb1-2/+6
Could cause privilege elevation and/or arbitrary files overwrite, when the X server is running with elevated privileges (ie when Xorg is installed with the setuid bit set and started by a non-root user). CVE-2018-14665 Issue reported by Narendra Shinde and Red Hat. Signed-off-by: Matthieu Herrb <> Reviewed-by: Alan Coopersmith <> Reviewed-by: Peter Hutterer <> Reviewed-by: Adam Jackson <>
2018-10-24xfree86: bump video ABI version to 25.0Adam Jackson1-1/+1
Signed-off-by: Adam Jackson <>
2018-09-28dix: Remove LegalModifier()Adam Jackson1-6/+0
This hasn't done anything besides return TRUE in a long long time. Reviewed-by: Eric Anholt <> Signed-off-by: Adam Jackson <>
2018-09-28dix: Merge AbortDDX into ddxGiveUpAdam Jackson2-44/+25
These are so close to identical that most DDXes implement one in terms of the other. All the relevant cases can be distinguished by the error code, so merge the functions together to make things simpler. Reviewed-by: Eric Anholt <> Signed-off-by: Adam Jackson <>
2018-09-27xfree86: Remove -flippixelsAdam Jackson6-32/+2
No supported driver supports 1bpp anymore, nor has in a very long time. This option only worked with vgahw anyway. Signed-off-by: Adam Jackson <>
2018-09-25compiler.h: only use inx/outx on ARM with glibcRoss Burton1-2/+2
musl only implements inx/outx on x86, so check for __GLIBC__ instead of __linux__. Signed-off-by: Ross Burton <>
2018-09-19xorg: Don't log "Build Operating System: Linux 4.9.0-5-amd64 x86_64 Debian"Eric Anholt1-7/+0
I don't think this is useful information to have in the log, and it's a bunch of autotools and meson logic to produce it. Signed-off-by: Eric Anholt <>
2018-09-12include: Remove now-dead declarationsAdam Jackson1-1/+0
60ec8ead broke the autotools build: sdksyms.o:(.data+0x58): undefined reference to `InitConnectionLimits' sdksyms.o:(.data+0x2ec8): undefined reference to `xf86ServerName' collect2: error: ld returned 1 exit status Makefile:811: recipe for target 'Xorg' failed Likewise 3a4d7c79 for InitConnectionLimits. Signed-off-by: Adam Jackson <>
2018-09-12xfree86: Remove vestigial lastScrnFlagAdam Jackson3-22/+2
Only the mga XAA code ever set this (hence the compat macro), since XAA is long gone this can go too. Signed-off-by: Adam Jackson <>
2018-09-12xfree86: Remove NoTrapSignalsAdam Jackson4-26/+0
This was dangerous on UMS and largely pointless on KMS.
2018-09-12xfree86: Remove a fallback path we never hitAdam Jackson1-11/+0
If it's really this important we should just do it and not complain. We never do it so it must not matter. Signed-off-by: Adam Jackson <>
2018-09-12xfree86: Remove some not-terribly-useful debuggingAdam Jackson1-5/+0
I'm sure printing the address of function pointers in modules you'd loaded might have made sense back when we rolled our own dlopen, but we got better. Signed-off-by: Adam Jackson <>
2018-09-12xfree86: Remove some redundant zero-fill for ScrnInfoRecAdam Jackson1-10/+0
xf86AllocateScreen() callocs these for us. Signed-off-by: Adam Jackson <>
2018-09-12xfree86: Remove unused xf86GetServerName()Adam Jackson4-14/+0
Signed-off-by: Adam Jackson <>
2018-09-12xfree86: Fix Option "MaxClients" validationAdam Jackson1-4/+6
The old code would not in fact validate the option value, though it might complain about it in the log. It also didn't let you set some legal values that the -maxclients command line option would. Signed-off-by: Adam Jackson <>
2018-09-12dga: Make shutdown less magical and/or terrifyingAdam Jackson4-33/+1
DGAShutdown() walks every screen and attempts to reset the mode. That's maybe a reasonable thing to do, although the explicit loop is certainly a bad smell. In ddxGiveUp it's called after we've torn down the vga arbiter - and in fact most of the rest of screen state - which is... very very bad. The other place it's called is from the Control-Alt-BackSpace handler, where we don't even attempt to do vga arb setup, and where in any case we're going to escape the main loop eventually anyway. Move all that cleanup work inside DGACloseScreen. This means it happens earlier in server teardown than previously, but not in a way you're ever going to be upset about. Signed-off-by: Adam Jackson <>
2018-09-12dga: Simplify mieq handler registrationAdam Jackson1-13/+3
Signed-off-by: Adam Jackson <>
2018-09-11xfree86: define FOURCC_NV12 and XVIMAGE_NV12Julien Isorce1-0/+20
Useful for glamor. Signed-off-by: Julien Isorce <> Tested-by: Olivier Fourdan <> Reviewed-by: Alex Deucher <>
2018-08-09meson: Make FALLBACK_INPUT_DRIVER configurable in meson.Eric Anholt1-1/+13
This makes us match the featureset of autotools, and also fixes the non-Linux default value to match. Signed-off-by: Eric Anholt <> Reviewed-by: Peter Hutterer <>
2018-08-02xorg: Remove the XF86PM define.Eric Anholt2-14/+0
We already have pm_noop.c being built most of the time for the no-OS-PM case, so just switch to always using it. Signed-off-by: Eric Anholt <> Reviewed-by: Peter Hutterer <>
2018-06-28modesetting: Allow a DRM fd to be passed on command line with -masterfd [v2]Keith Packard2-0/+3
This lets an application open a suitable DRM device and pass the file descriptor to the mode setting driver through an X server command line option, '-masterfd'. There's a companion application, xlease, which creates a DRM master by leasing an output from another X server. That is available at git clone git:// v2: Always print usage, but note that it can't be used if setuid/gid Suggested-by: Lyude Paul <> Signed-off-by: Keith Packard <> Reviewed-by: Lyude Paul <>
2018-06-11xfree86: Inline xf86{Read,Write}Mmio{8,16,32} on alphaMatt Turner1-18/+49
In commit 9db2af6f757e (xfree86: Remove xf86{Map,Unmap}VidMem) we somehow stopped exporting xf86{Read,Write}Mmio{8,16,32}. Since the function pointer indirection was intended to support dense vs sparse and sparse support is now gone, we can just make the functions static inline in compiler.h and avoid all of this. Bugzilla: Tested-by: Christopher May-Townsend <> Reviewed-by: Adam Jackson <> Signed-off-by: Matt Turner <>
2018-04-03xfree86: Restore newline before "X Protocol Version" stringAaron Plattner1-1/+1
The newline before the protocl version got lost in commit 6cbefc3e0a33b380c147c533914437c7798d9b93. Prior to that commit, the release date printed a newline at the end: X.Org X Server 1.19.6 Release Date: 2017-12-20 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.14.12-1-ARCH x86_64 Now, that string gets run together with the version: X.Org X Server (1.20.0 RC 3)X Protocol Version 11, Revision 0 Build Operating System: Linux Since the version string printing has a variety of #ifdefs in it, just add the newline to the begining of the protocol version string. Signed-off-by: Aaron Plattner <> Reviewed-by: Peter Hutterer <> Signed-off-by: Peter Hutterer <>
2018-03-28xfree86: Add Option "Debug" to ServerFlagsAdam Jackson2-0/+6
This provides a generic way to control obscure runtime behavior knobs without making interface promises. Signed-off-by: Adam Jackson <>
2018-03-27meson: Add libdrm to hw/xfree86/common's dependenciesAdam Jackson1-0/+1
Signed-off-by: Adam Jackson <> Acked-by: Keith Packard <>