Recent Linux kernels reworked the linux/input.h header file, which is
now part of the "user-space API". The include guard therefore has an
additional additional _UAPI prefix.
Instead of adding another case to the #ifdef, drop any include guard
checks and instead always undefine the BUS_* definitions on Linux.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
winclipboardthread.c: In function ‘winClipboardProc’:
winclipboardthread.c:415:9: warning: ‘return’ with no value, in function returning non-void
winclipboardthread.c:424:13: warning: ‘return’ with no value, in function returning non-void
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
winmultiwindowwm.c: In function ‘UpdateName’:
winmultiwindowwm.c:522:14: warning: unused variable ‘pszName’ [-Wunused-variable]
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
winwindow.c: In function ‘winCreateWindowNativeGDI’:
winwindow.c:62:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winDestroyWindowNativeGDI’:
winwindow.c:85:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winPositionWindowNativeGDI’:
winwindow.c:108:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winChangeWindowAttributesNativeGDI’:
winwindow.c:213:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winUnmapWindowNativeGDI’:
winwindow.c:241:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winMapWindowNativeGDI’:
winwindow.c:265:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
winvalargs.c: In function ‘winValidateArgs’:
winvalargs.c:62:10: warning: unused variable ‘fImplicitScreenFound’ [-Wunused-variable]
winvalargs.c:60:9: warning: unused variable ‘iMaxConsecutiveScreen’ [-Wunused-variable]
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
winwindowswm.c: In function ‘ProcWindowsWMQueryVersion’:
winwindowswm.c:85:9: warning: unused variable ‘n’ [-Wunused-variable]
winwindowswm.c: In function ‘SProcWindowsWMQueryVersion’:
winwindowswm.c:565:9: warning: unused variable ‘n’ [-Wunused-variable]
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
winmsg.c: In function ‘winVMsg’:
winmsg.c:47:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winDrvMsg’:
winmsg.c:56:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winMsg’:
winmsg.c:66:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winDrvMsgVerb’:
winmsg.c:77:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winMsgVerb’:
winmsg.c:87:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winErrorFVerb’:
winmsg.c:97:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winDebug’:
winmsg.c:107:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winTrace’:
winmsg.c:117:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Also, fix the typoed name OsVenderVErrorF (sic), so it actually gets prototyped
and remove redundant declarations of it's prototype.
winerror.c: In function ‘OsVendorVErrorF’:
winerror.c:56:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winerror.c: In function ‘winMessageBoxF’:
winerror.c:104:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
winclipboardxevents.c: In function ‘winClipboardFlushXEvents’:
winclipboardxevents.c:575:13: warning: passing argument 1 of ‘winClipboardUNIXtoDOS’ from incompatible pointer type
winclipboard.h:102:2: note: expected ‘unsigned char **’ but argument is of type ‘char **’
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
[repeated for each layout]
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Fix some of the warnings in generated gl wrapper code:
- glWinResolveHelper takes a const char * argument
- ensure formal parameter names don't collide with reserved names or shadow
global declarations (e.g. near, far, index (from string.h), remainder (from
math.h), pointer (from Xdefs.h) by postpending a '_'.
generated_gl_wrappers.c:13:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
glwrap.c:70:1: note: expected 'char *' but argument is of type 'const char *'
[repeated many times]
generated_gl_wrappers.c: In function 'glVertexAttrib1dARBWrapper': generated_gl_wrappers.c:6884:47: warning: declaration of 'index' shadows a global declaration [-Wshadow]
generated_gl_wrappers.c:6886:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
[repeated many times]
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
winwindowswm.c: In function ‘ProcWindowsWMFrameSetTitle’:
winwindowswm.c:514: error: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness
If you're going to stick random casts into your code, at least use the goddammed
right ones. :-)
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Fix shadowed local variable i in HandleCustomWM_COMMAND()
Also, fds are meant to be representable as an int
winprefs.c: In function ‘HandleCustomWM_COMMAND’:
winprefs.c:346:23: error: declaration of ‘i’ shadows a previous local
winprefs.c:322:7: error: shadowed declaration is here
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Move shadowed local variables x and y to the places they are used
wincursor.c: In function ‘winLoadCursor’:
wincursor.c:212:11: error: declaration of ‘x’ shadows a previous local
wincursor.c:166:7: error: shadowed declaration is here
wincursor.c:212:14: error: declaration of ‘y’ shadows a previous local
wincursor.c:166:10: error: shadowed declaration is here
wincursor.c:228:11: error: declaration of ‘x’ shadows a previous local
wincursor.c:166:7: error: shadowed declaration is here
wincursor.c:228:14: error: declaration of ‘y’ shadows a previous local
wincursor.c:166:10: error: shadowed declaration is here
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Fix using Mask as a formal parameter shadows the typedef of the same name from X.h
indirect.c: In function 'GetShift':
indirect.c:1629:14: warning: declaration of 'Mask' shadows a global declaration [-Wshadow]
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Using screenInfo as a formal parameter to InitOutput() shadows a global declaration of screenInfo.
Change the formal parameter name from screenInfo to pScreenInfo, as everywhere else uses.
InitOutput.c: In function ‘InitOutput’:
InitOutput.c:891:25: error: declaration of ‘screenInfo’ shadows a global declaration
../../include/scrnintstr.h:570:19: error: shadowed declaration is here
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Using menu as a formal parameter shadows a global variable of the same name
winprefsyacc.y: In function ‘SetRootMenu’:
winprefsyacc.y:286:20: error: declaration of ‘menu’ shadows a global declaration
winprefsyacc.y:55:19: error: shadowed declaration is here
winprefsyacc.y: In function ‘SetDefaultSysMenu’:
winprefsyacc.y:293:26: error: declaration of ‘menu’ shadows a global declaration
winprefsyacc.y:55:19: error: shadowed declaration is here
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Using index as a formal parameter shadows index() from strings.h
winallpriv.c: In function ‘winInitCmapPrivates’:
winallpriv.c:119:45: error: declaration of ‘index’ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Using index as a local variable shadows index() from strings.h
winscrinit.c: In function ‘winFinishScreenInitFB’:
winscrinit.c:274:28: error: declaration of ‘index’ shadows a global declaration
winscrinit.c: In function ‘winFinishScreenInitNativeGDI’:
winscrinit.c:623:35: error: declaration of ‘index’ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Using index as a local variable shadows index() from strings.h
winprefs.c: In function ‘LoadImageComma’:
winprefs.c:574:7: error: declaration of ‘index’ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Fix using index as a local variable shadows global declaration of index() from strings.h
winmonitors.c: In function ‘QueryMonitor’:
winmonitors.c:59:23: error: declaration of ‘index’ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Using system as local variable in winCheckMount() shadows the global declaration of system() from stdlib.h
InitOutput.c: In function ‘winCheckMount’:
InitOutput.c:296:10: error: declaration of ‘system’ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
winPushPixels() and winpushpxl.c was removed in it's entirety in commit
f31bd087e8 "Death to mfb"
wingc.c:37:1: error: redundant redeclaration of ‘winPushPixels’
win.h:1104:1: note: previous declaration of ‘winPushPixels’ was here
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
winmultiwindowwm.c:139:14: error: redundant redeclaration of ‘display’
../../include/opaque.h:52:14: note: previous declaration of ‘display’ was here
winmultiwindowwm.c:140:13: error: redundant redeclaration of ‘ErrorF’
../../include/os.h:558:13: note: previous declaration of ‘ErrorF’ was here
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Fix redundant declarations in winclipboardwrappers.c.
Also remove obsolete winProcQueryTree() prototype.
winclipboardwrappers.c:64:12: error: redundant redeclaration of ‘g_iNumScreens’
winglobals.h:33:12: note: previous declaration of ‘g_iNumScreens’ was here
winclipboardwrappers.c:67:13: error: redundant redeclaration of ‘g_fXdmcpEnabled’
winglobals.h:45:13: note: previous declaration of ‘g_fXdmcpEnabled’ was here
winclipboardwrappers.c:75:27: error: redundant redeclaration of ‘winProcEstablishConnectionOrig’
winglobals.h:66:27: note: previous declaration of ‘winProcEstablishConnectionOrig’ was here
winclipboardwrappers.c:76:27: error: redundant redeclaration of ‘winProcQueryTreeOrig’
winglobals.h:67:27: note: previous declaration of ‘winProcQueryTreeOrig’ was here
winclipboardwrappers.c:77:27: error: redundant redeclaration of ‘winProcSetSelectionOwnerOrig’
winglobals.h:68:27: note: previous declaration of ‘winProcSetSelectionOwnerOrig’ was here
winclipboardwrappers.c:56:5: warning: redundant redeclaration of ‘winProcEstablishConnection’ [-Wredundant-decls]
winclipboardwrappers.c:52:5: note: previous declaration of ‘winProcEstablishConnection’ was here
winclipboardwrappers.c:57:5: warning: redundant redeclaration of ‘winProcSetSelectionOwner’ [-Wredundant-decls]
winclipboardwrappers.c:54:5: note: previous declaration of ‘winProcSetSelectionOwner’ was here
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
winclipboardthread.c:51:22: error: redundant redeclaration of ‘serverGeneration’
../../include/misc.h:362:22: note: previous declaration of ‘serverGeneration’ was here
winclipboardthread.c: In function ‘winClipboardProc’:
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
In file included from winclipboardinit.c:35:0:
winclipboard.h:81:13: error: redundant redeclaration of ‘ErrorF’
../../include/os.h:558:13: note: previous declaration of ‘ErrorF’ was here
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Remove various redundant declarations.
Instruct lex not to generate code which isn't going to be used, thus avoiding
some unused function warnings.
Note that bison <2.5 expects stdlib.h to define _STDLIB_H if it's been included,
and avoids prototyping free/malloc in that case. Some stdlib.h (e.g. newlib) may
not match precisely (e.g. defining _STDLIB_H_), so we define it after including
stdlib.h to be sure, and avoid a redudant declaration warning for those symbols.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
winprefs.c:63:14: error: redundant redeclaration of ‘display’
../../include/opaque.h:52:14: note: previous declaration of ‘display’ was here
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Include xwin-config.h so HAVE_STRLCPY and HAVE_STRNDUP are defined, so
duplicate declarations of strlcpy(), strlcat() and strndup() aren't made
by os.h
In file included from ../../include/misc.h:111:0,
from ../../include/screenint.h:51,
from ../../include/scrnintstr.h:51,
from win.h:157,
from winmonitors.c:31:
../../include/os.h:491:15: error: redundant redeclaration of ‘strlcpy’
/usr/include/string.h:86:35: note: previous declaration of ‘strlcpy’ was here
../../include/os.h:492:15: error: redundant redeclaration of ‘strlcat’
/usr/include/string.h:85:35: note: previous declaration of ‘strlcat’ was here
../../include/os.h:496:15: error: redundant redeclaration of ‘strndup’
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Add some missing header files to _SOURCES so they get distributed properly
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Fix compilation of Xorg DDX without XF86VIDMODE since 6e74fdda, by putting
xf86vmode.c back under the XF86VIDMODE automake conditional it was accidentally
taken out of.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Using of LoadExtension() to add GLX onto to the end of the list of extensions on
every server regeneration leads to hilarious consequences (i.e. crashing) after
the first regeneration :-)
Possibly xf86ExtensionInit() and QuartzExtensionInit() need a similar fix.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tested-by: Colin Harrison <colin.harrison@virgin.net>
This call is required for external drivers (specifically NVIDIA) that do
not share the xfree86 infrastructure to update the desktop dimensions.
Without it, the driver would update the ScreenRecs but not update the total
dimensions the input code relies on for transformation.
This call is a thin wrapper around the already-existing internal call and
should be backported to all stable series servers, with the minor ABI bump.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
CC: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
This reverts commit 531785dd74.
The above commit breaks Xephyr option parsing. Andrzej writes:
Xephyr -retro -keybd evdev,,device=/dev/input/event2,xkbrules=evdev,xkbmodel=evdev,xkblayout=pl -mouse evdev,,device=/dev/input/event1 :3
results in:
<snip>
Pointer option key (device=) of value (/dev/input/event1) not assigned!
Kbd option key (device=) of value (/dev/input/event2) not assigned!
Kbd option key (xkbrules=) of value (evdev) not assigned!
Kbd option key (xkbmodel=) of value (evdev) not assigned!
Kbd option key (xkblayout=) of value (pl) not assigned!
<snip>
The effect of the patch is that the "key=value" pairs are parsed in such
a way that the key is added an "equals" sign to it and we end up with
keys like "device=" instead of "device". This in turn has effect on
KdParsePointerOptions and KdParseKbdOptions: the key does not match
any choice presented in the "switch" statement, and so "Pointer/Kbd
option key (...) of value (...) not assigned!" happens, making all
"key=value" options inaccessible to the user. Reverting the patch makes
them available again.
Reference: http://bugs.debian.org/689246
Reported-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Søren Sandmann <ssp@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
I noticed that the build-in int10 driver always reports
"Unable to retrieve all of segment 0x0C0000."
even though the entire BIOS data is retrieved with success.
The associated code is in hw/xfree86/int10/generic.c, in the function
xf86ExtendedInitInt10():
if (pci_device_read_rom(pInt->dev, vbiosMem) < V_BIOS_SIZE) {
xf86DrvMsg(screen, X_WARNING,
"Unable to retrieve all of segment 0x0C0000.\n");
}
The function pci_device_read_rom() is from libpciaccess; its return
value is not a size but an error status code: 0 means success.
If pci_device_read_rom() returns 0 for success, the warning is generated.
The proposed patch corrects the evaluation of the return value of
pci_device_read_rom() and of the supplied BIOS size.
Debian bug#686153
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Commit 09e4b78f missed a case.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Similar to how we intercept and pass through CreateContext, also pass
through newer CreateNewContext requests.
Fixes Clutter → Xephyr → VirtualBox.
Signed-off-by: Frederic Plourde <frederic.plourde@collabora.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
We need to pass these requests through to the host server in the same
way we do glXMakeCurrent. Generalise the existing MakeCurrent
submission into once that will send MakeCurrent, MakeContextCurrent or
MakeCurrentReadSGI, depending on the request and the host server's
capabilities, and add decoding/hijack support for incoming
MakeContextCurrent and MakeCurrentReadSGI requests.
Fixes Clutter → Xephyr → VirtualBox.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Remove any reference to mibstore.h and miInitializeBackingStore() from
the documentation.
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Remove more backing store leftovers.
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This is a really awkward interface, since we're calling it well before
the driver knows what device it's going to drive. Drivers with both KMS
and UMS support therefore don't know whether to say they need I/O port
access or not, and have to assume they do.
With this change we now call it only to query whether port access might
be needed; we don't use that to determine whether to call a driver's
probe function or not, instead we call them unconditionally. If the
driver doesn't check whether port access was enabled, they might crash
ungracefully. To accomodate this, we move xorgHWAccess to be explicitly
intentionally exported (sigh xf86Priv.h) so that drivers can check that
before they attempt port access.
v2: Move initial xf86EnableIO() nearer the logic that determines whether
to call it, suggested by Simon Farnsworth.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
We load the driver list, then enable I/O, then call driver probe based
on whether I/O enable succeeded. That's bad, because the loaded
security policy might forbid port access. We happen to treat that as
fatal for some reason, which means even drivers that don't need I/O
access (like kms and fbdev) don't get the chance to run. Facepalm.
How about we just make that non-fatal instead, that sounds like a much
better plan.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Pull platform methods into their own sections for legibility, and
rewrite the ifdefs to be more concise.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
If we are not seat 0 the following apply:
don't probe any bus other than platform
don't probe any drivers other than platform
assume the first platform device we match on the bus is the primary GPU.
This just adds checks in the correct places to ensure this, and
with this X can now start on a secondary seat for an output device.
v2: fix Seat0 macros
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This solves a race if we are trying to dynamically power off
secondary GPUs. Its not the greatest fix ever but it probably
as good as we can do for now.
The GPU probing causes the devices to be powered up, then when
we scan the PCI bus we get the correct information from the kernel,
rather than a bunch of 0xff due to the device being powered off.
drop gratuitous '&'.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
After we share the pixmap, the backing storage may have changed,
and we need to invalidate and buffers pointing at it.
This fixes GL compositors and prime windows lacking contents initially.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Otherwise we can't do fast user switch properly for multiple GPUs.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This is set by pre_init not screen init, so if we free it here
and then recycle the server, we lose all the providers.
I think we need to wrap FreeScreen here to do this properly,
will investigate for 1.14 most likely, safer to just leak this
on server exit for now.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Commit 9d457f9c55 added an array of
DevPrivateSetRec structures in the middle of the ScreenRec, which throws off
extension modules trying to call things like pScreen->DestroyPixmap.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This change is #if'd out due to a bug in asl_log_descriptor, but
it is left here as reference to be enabled in the future.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Prior to this change, it was possible that a large message would have some
of its data prepended to subsequent messages due to our not incorrectly
setting the location to write into the buffer.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
quartz.c:153:6: error: use of undeclared identifier 'GlxExtensionInit'; did you mean 'GEExtensionInit'? [Semantic Issue]
{GlxExtensionInit, "GLX", &noGlxExtension},
Regression-from: aad428b8e2
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
The core RandR screen cleanup now involves cleaning up any GPU screen
associations, and those call down into DDX to clean up the driver. If
the pointers from the xf86 structures back to the core randr
structures are set to NULL at that point, bad things happen.
This patch "knows" that the core RandR close screen is underneath the
xf86 randr close screen function, and so makes sure it gets called
first.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
These are two minor changes, one to reset the pointer to NULL,
after freeing the pixmaps, one to make sure we use the right API for
the master pixmap, though I doubt it'll ever really matter.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
When the drawable disappears we need to free the prime master/slave combos.
This fixes a leak after a prime app is run.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The indenter seems to have gotten confused by initializing arrays of
structs with the struct defined inline - for predefined structs it did
a better job, so match that.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
The RandR CRTC structures are freed when their resource IDs are
destroyed during server shut down, which is before the screen is
closed. Calling back into RandR with stale pointers just segfaults the
server.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Knut Petersen <knut_petersen@t-online.de>
Panning is at odds with CRTC cursor confinement. This disables CRTC cursor
confinement as long as panning is enabled.
Fixes regression introduced in 56c90e29f0.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Let's say - purely for the sake of argument, mind you - that you had a
server GPU with anemic memory bandwidth, and you walked up to it and
plugged in a monitor that was 1920x1080 because that's what happened to
be on the crash cart. Say the memory bandwidth is such that anything
larger than 1280x1024 gets filtered away. Now you're in trouble,
because the established timings section includes a 720x400 mode because
that's what DOS 80x25 is, and that happens to just about match the
physical aspect ratio.
Instead let's reuse the logic from the existing aspect-match path: pick
the larger mode of either the physical aspect ratio or 4:3.
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This code wasn't allocating enough space and was assigning the NULL
one past the end.
Pointed out by coverity.
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Bugzilla: https://bugs.freedesktop.org/25804
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Vic Lee <llyzs@163.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Fix FIXME in fbConfigToPixelFormat() to correctly populate RGBA-mask shift
parameters. Also request colourindex pixelFormats correctly.
Now that they are requested correctly, don't skip colorindex visuals when
converting pixelFormats to fbConfigs.
Populate transparent colour information when converting pixelFormat from
DescribePixelFormats() to a fbConfig.
Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Oh this is terrible.
Currently we only compute the select timeout in whole seconds. This means if we
have less than 1 second remaining, we select with a timeout of 0 (i.e. poll)
which causes the task to spin, burning 100% CPU for the remaining timeout (and
possibly preventing the process we are waiting for from running :S)
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
winOverrideIcon() is called from the internal WM client thread.
Accessing server-internal data structures to get icon data or window hints is
not safe, as there is no lock to ensure we do not collide with these data
structures being updated in the server thread.
Rewrite so the internal client thread uses X client calls to obtain this data
safely
We used to also set the icon inside the server when the window was initially
created. For simplicity, we simply send a message to the internal WM to update
the icon when the window is created (rather than writing different icon update
code which can work in the server thread for that one case...)
extwm mode used to do the icon update in the server. I'm not sure that actually
made much sense. Let's assume the external WM client can do it instead...
v2
Make sure that WM_WM_ICON_EVENT does nothing for override-redirect windows
v3
Reinstate check that native window actually has expected properties for an X
window before trying to update it's icon; some auxiliary windows owned by the
XWin process don't, which would cause a crash
v4
Various fixes to pixmap icon conversion:
- remove left-over malloc in winScaleXimageToWindowsIcon causing a memory leak
- don't recalculate DDBitmap stride in winScaleXimageToWindowsIcon, when we already have worked it out
- properly check that XGetWindowProperty(NET_WM_ICON) returned some data
- don't try to retrieve WM_HINTS icon_mask if it isn't set
- restore accidentally dropped calculation of effBpp, stride, maskStride of output DDBitmap
- make sure imageMask is zero-initalized before we use it to mask the DDBitmap
v5
Remove a left-over unused variable
v6
Avoid XDestroyImage(NULL) crash if XGetImage failed for icon_pixmap
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
_NET_WM_ICON property is also considered to decide on the window icon, so also
send a WM_WM_ICON_EVENT message to the WM if the PropertyNotify event is for
_NET_WM_ICON property
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
WM_WM_HINTS_EVENT only updates the icon, so rename it to WM_WM_ICON_EVENT
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Simplify GetWindowName() by moving UTF-8 to wchar conversion out to it's call
site. This allows us to do extra processing on the window name in future.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
x-selection.m:1502:1: warning: method has no return type specified; defaults to 'id'
[-Wmissing-method-return-type,Semantic Issue]
- init
^
(id)
1 warning generated.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Various fixes, applied to panoramiX.c in commit 2b266eda, also need applying to pseudoramiX.c:
Fix panoramiX request and reply swapping
Set window and screen values in panoramix replies
Prevent buffer overrun in ProcPanoramiXGetScreenSize
These fixes seem to be necessary in order to compile pseudoramiX.c with gcc
pseudoramiX.c: In function 'ProcPseudoramiXGetState':
pseudoramiX.c:221:56: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap
pseudoramiX.c: In function 'ProcPseudoramiXGetScreenCount':
pseudoramiX.c:250:62: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap
pseudoramiX.c: In function 'ProcPseudoramiXGetScreenSize':
pseudoramiX.c:283:56: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap
pseudoramiX.c:284:57: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
We've had reports of two copies of the GLX bits, one in the server
and one in libglx.so causing problems, I didn't understand why the
X server needed a copy so drop it, however then we have to fix a missing
GlxExtensionInit that comes from sdksyms, so work around it by moving
that one declaration into a header that sdksyms doesn't scan.
Thanks to Jon Turney for debugging the actual problem.
(copyright header from extinit.h that seems most appropriate put on top).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52402
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
* GLX is now loaded
* PseudoramiX loading is back in miinitext. It needs to be loaded
before RandR.
Regression-from: 27a624bee6
Regression-from: 5f5bbbe543
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
DRI2GetParam was going through review in parallel with main batch of
C99 initialization changes - sync up now that both have landed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
These flags were unexported by commit a1d41e311c,
which moved the declarations around and lost the _X_EXPORT attributes in the
process. Since drivers need these and it's late in the release cycle, just
re-export them for now.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Also polish the keyboard configuration text a bit
Include man section number in references to setxkbmap
Consistently refer to 'manual page' rather using both that and 'man page'
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Moving Xwin to a certain monitor using "-screen 0 @2" would fail,
printing "ddxProcessArgument - screen - Querying monitors failed".
This happened since commit 3ead1d810b,
because EnumDisplayMonitor() returns FALSE if its callback function
returns FALSE (which is not clearly documented), and QueryMonitor()
would then also return FALSE.
Moving back to the old behaviour, where the return value of
EnumDisplayMonitors() is ignored.
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
We don't wrap the WindowExposures screen function
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Checking for OS later than NT4 SP3 (which we didn't do correctly anyhow,
just checking for NT) is pointless when other code in hw/xwin assumes at
least NT 5.0
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This code for detecting if the Windows clipboard can support unicode
is long obsolete.
All NT versions of Windows support unicode clipboard, so any version
of Windows we can run on must support unicode clipboard.
The -nounicodeclipboard flag to disable use of unicode on the clipboard
is retained.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Consolidate code to find the native HWND of an X window, stored in the _WINDOWSWM_NATIVE_HWND
property, duplicated in UpdateName() and PreserveWin32Stack() as getHwnd()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Correct function name in log message winInitializeDefaultScreens -> winInitializeScreenDefaults
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
It's not very useful to log lines like the below when the About.. dialog is used
winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL
winAboutDlgProc - WM_CLOSE
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
In windowed mode, with option -resize, RANDR resize was missing when the screen
window was maximized or restored.
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
There is a bug that when the -screen option is used to specify a monitor for
the screen window to be located on, but no explicit size is specified
(and the -multiplemonitors option isn't specified), the screen
window size is always constrained to fit the work area of the primary
monitor (rather than the work area of the specified monitor)
This gives incorrect results if you want a screen the same size as your
non-primary monitor (e.g. by using -screen 0 @2) and your non-primary
monitor is larger than your primary monitor.
(This can be worked around by specifying -multiplemonitors and an explicit
screen size the same size as the monitor (e.g. -multiplemonitors -screen 0
1600x1200@2))
Fix to use work area for the monitor specified for the screen, rather than the
primary monitor work area (unless -multiplemonitors is used, in which case we
continue to use the virtual desktop work area instead)
Also fix the adjustment for an autohide taskbar, so that it is only done if the
taskbar is on the same monitor as the screen (or -multiplemonitors is used)
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Don't bother reporting XORG_VERSION_CURRENT, when we also
report the version number broken down into it's components
XORG_VERSION_MAJOR, XORG_VERSION_MINOR, etc. as well.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This fixes an implicit declaration,
xf86AutoConfig.c:202:5: error: implicit declaration of function 'xf86PlatformMatchDriver' [-Werror=implicit-function-declaration]
xf86AutoConfig.c:202:5: warning: nested extern declaration of 'xf86PlatformMatchDriver' [-Wnested-externs]
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Same as DRI2CreateDrawable, except it can return the DRI2 specific XID of the
DRI2 drawable reference to the base drawable.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
- Add an XwinExtensionInit(), similar in spirit to QuartzExtensionInit()
and xf86ExtensionInit()
- Load the GLX extension (I'm guessing XQuartz needs this adding somewhere
as well)
- Also, since we now have a proper place to install the native GL provider
where it will take priority over the the swrast provider, do so
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
I hate this [redacted] script.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Based on the original patch by Chris Wilson, which was a better fix than mine.
We stash a copy of the desiredMode on the crtc so that we can restore it
after a vt switch. This copy is a simple memcpy and so also stashes a
references to the pointers contained within the desiredMode. Those
pointers are freed the next time the outputs are probed and mode list
rebuilt, resulting in us chasing those dangling pointers on the next
mode switch.
==22787== Invalid read of size 1
==22787== at 0x40293C2: __GI_strlen (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22787== by 0x668F875: strdup (strdup.c:42)
==22787== by 0x5DBA00: XNFstrdup (utils.c:1124)
==22787== by 0x4D72ED: xf86DuplicateMode (xf86Modes.c:209)
==22787== by 0x4CA848: xf86CrtcSetModeTransform (xf86Crtc.c:276)
==22787== by 0x4D05B4: xf86SetDesiredModes (xf86Crtc.c:2677)
==22787== by 0xA7479D0: sna_create_screen_resources
(sna_driver.c:220)
==22787== by 0x4CB914: xf86CrtcCreateScreenResources (xf86Crtc.c:725)
==22787== by 0x425498: main (main.c:216)
==22787== Address 0x72c60e0 is 0 bytes inside a block of size 9 free'd
==22787== at 0x4027AAE: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22787== by 0x4A547E: xf86DeleteMode (xf86Mode.c:1984)
==22787== by 0x4CD84F: xf86ProbeOutputModes (xf86Crtc.c:1578)
==22787== by 0x4DC405: xf86RandR12GetInfo12 (xf86RandR12.c:1537)
==22787== by 0x518119: RRGetInfo (rrinfo.c:202)
==22787== by 0x51D997: rrGetScreenResources (rrscreen.c:335)
==22787== by 0x51E0D0: ProcRRGetScreenResources (rrscreen.c:475)
==22787== by 0x513852: ProcRRDispatch (randr.c:493)
==22787== by 0x4346DB: Dispatch (dispatch.c:439)
==22787== by 0x4256E4: main (main.c:287)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36108
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
No drivers used this, so it got unexported, and now it's so unused it
got culled during the link. Take the poor function out behind the shed
and put it out of its misery.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
No-one ever did anything with this variable except assign its default
value to it.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Commit 0c6987df in June 2008 disabled XAA offscreen pixmaps per default,
as they were broken, leaving XAA only able to accelerate operations
directly on the screen pixmap and nowhere else, eliminating acceleration
for basically every modern toolkit, and any composited environment.
So, it hasn't worked for over four years. No-one's even come close to
fixing it.
RIP.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Not to be confused with XFree86Loader or XorgLoader. Which are both now
dead too.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
setupFunc was used as an early callback for half-modular extensions such
as Xv, XvMC and DGA to set up hooks between the core server and the
modular component. Now we've rid ourselves of that, we can also bin
setupFunc.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Turns out the only thing we use NO_HW_ONLY_EXTS for is to check whether
or not we're building inside the Xorg DDX. Replace it with an
XorgLoader test instead, and remove all its users.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Rather than having a non-Xorg and an Xorg-specific path which basically
just duplicated each other for no reason, we could ... just have one.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
As PseudoramiX is a DDX-specific extension, move its loading and
initialisation to hw/xquartz. This creates a QuartzExtensionInit()
similar in spirit to xf86ExtensionInit.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
There was nothing XFree86-specific or loader-specific about this, aside
from using xf86MsgVerb instead of ErrorF.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
In preparation for gutting loadext.c, move the ExtensionModule struct to
the DIX, and unexport ExtensionModuleList (why, why, why, why was this
ever exported in the first place, tbqh).
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Extensions could previously declare initialisation dependencies on other
extensions, which would then get nicely sorted by the loader. We only
had one user for this, GLX, which had one pointless (Composite) and one
possibly useful dependency (DBE). As DBE is now a built-in, it will
always be sorted by GLX, so we no longer have any users for it.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
GLX was the only user of extension init order dependencies, using them
to depend on Composite, which has always been built-in anyway, and DBE,
which is now built-in.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Make sure we add static extensions before anything in a module. This is
more or less a no-op at the moment, but will come in handy later when
extension dependency sorting is removed.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Instead of keeping a tiny amount of code in an external module, just man
up and build it into the core server.
v2: Fix test/Makefile.am to only link libdri2.la if DRI2 is set
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
DRI2DestroyDrawable() was still being _X_EXPORTed, but hasn't existed
since 1da1f33f last year.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
AM_CFLAGS will suffice, given we only have one target in this directory.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Rather than building the tiny amount of code required for XFree86-DRI as
an external module, build it in if it's enabled at configure time.
v2: Fix test/Makefile.am to only link libdri.la if DRI is set
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
fixup for DRI1 move
Signed-off-by: Keith Packard <keithp@keithp.com>
extmod was originally a big pointless module. Now it's an empty,
pointless module. This commit makes it unexist.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
As with DGA, move VidMode from being part of extmod to a built-in part
of the server, if compiled as such. This is initialised from
xf86ExtensionInit rather than miinitext because it's wholly dependent on
the Xorg DDX.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The DGA event base used to have to be passed through a function pointer,
as the code was cleaved in two with half in a module, and half in the
core server. Now that's not the case, just access DGAEventBase
directly.
v2: Deal with Alan's event initialization cleanups
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Rather than leave DGA languishing in extmod, move it to be a built-in
extension. As it's quite specific to the Xorg DDX, just move it
sideways to the rest of the DGA code in hw/xfree86/common, and
initialise it from xf86ExtensionInit, rather than miinitext.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Instead of letting it languish in extmod just because we want to
configure bits of it from xf86, move XSELinux to the builtin part of
Xext, and do its configuration from xf86ExtensionInit.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Xv used to call XvScreenInit and co. through function pointers, as
XvScreenInit may have been sitting on the other side of a module
boundary from xf86XvScreenInit. Why this was so is a mystery, but make
it not so any more.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
We no longer have anything in the tree that checks for XorgLoader. This
was a fairly monumental hack: xvdi.h used to hide all its functions
behind #ifndef XorgLoader, solely to avoid sdksyms.sh picking up its
symbols, as it was previously a module rather than built-in.
This is no longer the case, so we can remove the define.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Always build these extensions into the core server, rather than letting
them languish in extmod.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Always build XRes support into the core server, rather than letting it
languish in extmod.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Always build DPMS support into the core server, rather than letting it
languish in extmod.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
If we've built MIT-SCREEN-SAVER support, then just build it into the
main binary, rather than leaving it in extmod.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Rather than languishing in its own special module, move RECORD into the
core server.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
If DBE support is compiled in the server, just man up and build it into
the server, rather than having it as an external module.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
When the array gets down to size zero (which it does in later patches),
gcc complains that the index is out of bounds. Avoid this by using
ARRAY_SIZE on extensionModules instead.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Stéphane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
xf86ExtensionInit is called after configuration file parsing, so it can
perform the two parts of extension initialisation currently done by
extmod: enabling and disabling of extensions through an 'omit' option,
and SELinux configuration.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
EXTERN_MODULE was used to specify that we shouldn't worry about modules
lacking a ModuleData object. It was also completely unused. *shrug*
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Create extinit.h (and xf86Extensions.h, for Xorg-specific extensions) to
hold all our extension initialisation prototypes, rather than
duplicating them everywhere.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Rather than making poor old miinitext.c do it, including making DMX
have fake symbols just to keep it happy.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Stéphane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
INITARGS was a hardcoded define to void. Since knowing the function
signature for your extensions is kinda useful, just replace it with a
hardcoded void, but leave the define there for API compatibility.
Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Huh, so I guess INITARGS used to be int argc, char *argv then. Either
way, it's now void, so fix that ...
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
libxorgxkb.a contains a number of libraries which are used by XKB action
code to call back into the DDX, e.g. for VT switching, termination, grab
breaking, et al. Make sure libxkb.a comes first in the link order, so
it can mark XkbDDX* as used in order for the linker to not discard them.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
ephyrGLXQueryServerString() carefully allocated a buffer padded to the
word-aligned string length for sending to the client, copied the string
to it, and then forgot to use it, potentially reading a few bytes of
garbage past the end of the server_string buffer.
Since WriteToClient already handles the necessary padding, just send
it the actual length of the original server_string, and don't bother
making a padded copy.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
v2: fix in __glXGetVisualConfigs to not re-declare local 'reply' variable
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Fixup for Use C99 designated initializeres in dmx Replies
Signed-off-by: Keith Packard <keithp@keithp.com>
Ensures padding bytes are zero-filled
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Seems silly waiting to check if the client failed to send us enough bytes
until after we've already tried using them.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
When passing variable pointers to functions or otherwise doing long
sequences to compute values for replies, create & use some new
temporary variables, to allow for simpler initialization of reply
structures in the following patches.
Move memsets & other initializations to group with the rest of the
filling in of the reply structure, now that they're not needed so
early in the code path.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Casting return to (void) was used to tell lint that you intended
to ignore the return value, so it didn't warn you about it.
Casting the third argument to (char *) was used as the most generic
pointer type in the days before compilers supported C89 (void *)
(except for a couple places it's used for byte-sized pointer math).
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Each DDX currently calls OsReleaseSIGIO in case it was suspended when
the server regen started. This causes a BUG to occur if SIGIO was
*not* blocked at that time. Instead of relying on each DDX, make the
OS layer reliably reset all signal state at server init time, ensuring
that signals are suitably unblocked and that the various signal state
counting variables are set back to zero.
Signed-off-by: Keith Packard <keithp@keithp.com>
Otherwise, OsReleaseSIGIO will complain, or perhaps something worse
will happen (if SIGIO actually needs to be blocked here).
Signed-off-by: Keith Packard <keithp@keithp.com>
Add a static mask of prime id and allocate them at screen time,
if the driver supports the prime interfaces and is a gpu screen.
This is instead of them changing due to user controlled randr commands,
as suggested by Keith.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This adds the initial prime support for dri2 offload. The main thing is
when we get a connection from a prime client, we stored the information
and mark all drawables from that client as prime. We then create all
buffers for that drawable on the prime device dri2screen.
Then DRI2UpdatePrime is provided which drivers can call to get a shared
pixmap which they can use as the front buffer. The driver is then
responsible for doing the back->front copy to the shared buffer.
prime requires a compositing manager be run, but it handles the case where
a window get un-redirected by allocating a new pixmap and pointing the crtc
at it while the client is in that state.
Currently prime can't handle pageflipping, so always does straight copy swap,
v1.1: renumber on top of master.
v1.2: fix auth on top of master.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This adds support for setting the offload sink to the xf86 ddx.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This is so we can tell the scanout pixmap has changed between calls
to the crtc set function.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This fixes a segfault where this code believes we are outside the screen
boundaries on a slave device, but we aren't.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Current USB devices have no hw rendered cursors, so we need the
master GPU to render the cursor, so whenever we plug in a
slave device, fallback to sw rendered cursors.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This adds support for the randr callback for setting the output source
for a device.
v2: drop root clip change on detach
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This will detach any scanout pixmaps attached to slave crtcs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Add the simple passthrough interface for drivers to use,
so they can set scanout pixmaps.
v2: detach scanout pixmap properly.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
v2: Split out DGAAvailable into two interfaces, one for calls from protocol
decoding and one for internal usage, after discussion with ajax and keithp.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This is the default attachment, unbound gpu screens get
attached to the 0 protocol screen.
detach on hotunplug.
v2: detach after tearing down crtc/outputs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This adds the framework for DDX provider support.
v2: as per keithp's suggestion remove the xf86 provider object
and just store it in the toplevel object.
v3: update for new protocol
v4: drop devPrivate, free name
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This adds the initial provider object and provider property
support to the randr dix code.
v2: destroy provider in screen close
v2.1: fix whitespace
v3: update for latest rev of protocol + renumber after 1.4 tearout.
v4: fix logic issue, thanks Samsagax on irc
v5: keithp's review: fix current_role, fix copyrights, fix master
reporting crtc/outputs.
v6: port to new randr interface, drop all set role bits for now
v7: drop devPrivate in provider, not needed, add BadMatch returns
for NULL SetProviderOffloadSink and SetProviderOutputSource, drop
the old typedef.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This loop needs to count from 7 to 0, not only from 7 to 1.
The current code always skips the modes {1152, 864, 75, 0}, {1280, 1024, 85, 0},
{1400, 1050, 75, 0}, {1600, 1200, 70, 0} and {1920, 1200, 60, 0}.
Signed-off-by: Torsten Kaiser <x11@ariolc.dyndns.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Using -O3 gcc notes that m could reach beyound the end of the EstIIIModes array,
if the last bits of the 11s byte where set.
Fix this, by extending the array to cover all possible bits from est.
https://bugs.freedesktop.org/show_bug.cgi?id=45623
Signed-off-by: Torsten Kaiser <x11@ariolc.dyndns.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This option is to stop the X server adding non-primary devices as
gpu screens.
v2: fix per Keith's suggestion.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This provides add/remove support for platform devices at xfree86 ddx level.
v2: cleanup properly if no driver found.
v3: load the modesetting driver before checking driver list.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This just adds the structures and interfaces required for adding/deleteing
gpu screens at the DDX level. The platform probe can pass a new flag
to the driver, so they can call xf86AllocateScreen and pass back the new
gpu screen flag.
It also calls the gpu screens preinit and screeninit routines at
startup.
v2: fix delete screen use after free.
v3: split out pScrn into separate patch
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This is in preparation for gpu screens in here, just use
a pScrn pointer to point at the new screen.
suggested by Keith.
v1.1: fix spacing as suggested by Aaron.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
On Linux in order for future hotplug work, we are required to interface
to udev to detect device creation/removal. In order to try and get
some earlier testing on this, this patch adds the ability to use
udev for device enumeration on Linux.
At startup the list of drm/kms devices is probed and this info is
used to load drivers.
A new driver probing method is introduced that passes the udev
device info to the driver for probing.
The probing integrates with the pci probing code and will fallback
to the pci probe and old school probe functions in turn.
The flags parameter to the probe function will be used later
to provide hotplug and gpu screen flags for the driver to behave
in a different way.
This patch changes the driver ABI, all drivers should at least
be set with a NULL udev probe function after this commit.
v2: rename to platform bus, now with 100% less udev specific,
this version passes config_odev_attribs around which are an array
of id/string pairs, then the udev code can attach the set of attribs
it understands, the OS specific code can attach its attrib, and then
the core/drivers can lookup the required attribs.
also add MATCH_PCI_DEVICES macro.
This version is mainly to address concerns raised by ajax.
v3: Address comments from Peter.
fix whitespace that snuck in.
rework to use a linked list with some core functions that
xf86 wraps.
v4: add free list, fix struct whitespace.
ajax this address most of your issues?
v5: drop probe ifdef, fix logic issue
v6: some overhaul after more testing.
Implement primaryBus for platform devices.
document hotplug.h dev attribs - drop sysname attrib
fix build with udev kms disabled
make probing work like the PCI probe code,
match against bus id if one exists, or primary device.
RFC: add new bus id support "PLAT:syspath". we probably
want to match on this a bit different, or use a different
property maybe. I was mainly wanting this for use with
specifying usb devices in xorg.conf directly, but PLAT:path
could also work I suppose.
v6.1: add missing noop platform function
v7: fix two interactions with pci probing and slot claiming, prevents
pci and platform trying to load two drivers for same slot.
v8: test with zaphod mode on -ati driver, fixup resulting issue
clean up common probe code into another function, change busid
matching to allow dropping end of strings.
v9: fix platform probing logic so it actually works.
v9.1: fix pdev init to NULL properly.
v10: address most of Keith's concerns.
v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com>
v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This fixes some really ugly code that got mangled by the indenting.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
LoaderSymbol calls dlsym with RTLD_DEFAULT pseudo handle making it search in
every loaded library. In addition glibc adds NODELETE flag to the library
containing the symbol.
It's used in doLoadModule to locate <modulename>ModuleData symbol, the
module's library gets the flag and is kept in memory even after it is
unloaded.
This patch adds LoaderSymbolFromModule function that looks for symbol only in
library specified by handle. That way the NODELETE flag isn't added.
This glibc behavior doesn't seem to be documented, but even if other
implementations differ, there is no reason to search ModuleData symbol outside
the module's library.
Signed-off-by: Michal Srb <msrb@suse.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
v2: Switch LoaderSymbolFromModule arguments order.
Correct description.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>