It's better coding style to include the header with prototypes for
our own functions directly, instead of relying on it being included
indirectly.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
mingw's printf() doesn't understand it yet, and it's not really
important here, so just use `%hx` instead.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The X protocol types from xorgproto all have corresponding sz_<typename>
defines with their actual network payload size (this can be checked via
SIZEOF() macro).
In theory, this should always be the same as sizeof(), but just to be sure,
adding a macro for a static assert on that.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
On FreeBSD the ALIGN macro already exists in the standard headers,
so we sholdn't redefine it here.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
For strange reaons, nanosleep() is in libpthread on mingw platform,
so we have to link it here.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
../glx/indirect_table.c
In file included from ../glx/indirect_table.c:28:
In file included from ../glx/glxserver.h:66:
../include/glx_extinit.h:33:28: warning: redefinition of typedef '__GLXscreen' is a C11 feature [-Wtypedef-redefinition]
33 | typedef struct __GLXscreen __GLXscreen;
| ^
../glx/glxscreens.h:113:28: note: previous definition is here
113 | typedef struct __GLXscreen __GLXscreen;
| ^
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
We don't need it at all (and even shouldn't use it), and this breaks
the win32/mingw build.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Yet one more clash between <windows.h> and Xserver on `CreateWindow` symbol:
The windows header has a `#define CreateWindow CreateWindowA`, so we need
to #undef it everywhere we're using `CreateWindow` - until we've got that
ugly header out of the way completely.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This patch fixes Xserver crashes when evdev or synaptics input drivers are used.
These (and maybe other) driver use alternate forms "%#..." in formats for
xf86IDrvLogVerb() function, which in turn uses signal-safe vpnprintf().
The last function does not recognize alternate forms and exits abnormally, which
causes Xserver to crash. The patch make vpnprintf() to ignore alternate forms.
Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
Implement what was discussed in X11Libre#478
Use dependency() instead of cc.check_header(), as the former is the
intended way to check for dependencies.
cc.check_headers would turn udev on on systems where libudev.h
is present, but libudev.pc isn't.
Thos would do the wrong thing on systems where the admin wants to
have that header for some reason, but doesn't want programs to use
libudev.
We also keep udev and udev_kms a tristate, so we try to do
the right thing when the user doesn't explicitly pass
values for udev and udev_kms.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
FreeBSD uses libudev-devd for a libudev compatible interface.
So the udev options should be available for it.
Signed-off-by: b-aaz <b-aazbsd.proton.me>
xdmcp.h is using types from <X11/Xdmcp.h>, but forgot to include it.
This just popped up with building w/ -Dxdmcp=false, because that file was
included in the wrong place (osdep.h) and only conditionally.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Nvidia needs dma-buf for glamor acceleration to work
when using the modesetting ddx driver.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Port https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/751
to xlibre
Fixes glamor with modesetting on nvidia
This is needed for glamor to work with modesetting
on nvidia, according to the nvidia docs:
https://download.nvidia.com/XFree86/Linux-x86_64/510.39.01/README/gbm.html
From the mr above:
The X server was passing GBM bos directly to
eglCreateImageKHR using the EGL_NATIVE_PIXMAP_KHR
target. Given the EGL GBM platform spec claims it
is invalid to create a EGLSurface from a native
pixmap on the GBM platform, implying there is no
mapping between GBM objects and EGL's concept of
native pixmaps, this seems a bit questionable.
This change modifies the bo import function to
extract all the required data from the bo and then
imports it as a dma-buf instead when the dma-buf +
modifiers path is available.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This change is necessary to fix a segfault in intel driver at CloseScreen.
sna_early_close_screen() releases the cursor using FreeCursor(), which needs
miDCScreen private of pScreen. It has already been released by miDCCloseScreen(),
which is a pre-hook, and segfault occurs. Hence it is necessary to move
miDCCloseScreen() to post-hooks.
Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
This change is necessary to fix a segfault in intel driver at CloseScreen.
sna_early_close_screen() releases the glyph cache using FreePicture(), which needs
PictureScreen private of pScreen. It has already been released by PictureScreenClose(),
which is a pre-hook, and segfault occurs. Hence it is necessary to move
PictureScreenClose() to post-hooks.
Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
The `types` variable is never used, just assigned NULL - and that NULL
value is passed to free(). This code is really doing nothing, never did so
since introduced in 2009.
Fixes: 8b6a370058
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not neccessary to have entirely separate workflow for it - that's
just spamming the workflow list.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Some display drivers might cause p->atoms to be null if the display is
disabled. This will cause segfault when checking
if p->atoms[0] != property .
Some display drivers owned by qualcomm is known to cause this bug.
Signed-off-by: fish4terrisa-MSDSM <flyingfish.msdsm@gmail.com>
If ApplyPointerMapping() returns `MappingBusy`, this value needs to be
returned in the `success` reply field. On `Success` the returned value
needs to be `MappingSuccess`.
Closes: https://github.com/X11Libre/xserver/issues/353
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since Xwayland is long gone, we don't need to install it's build-time
dependencies anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The assert(iclients) was in a place where the iclients variable could
not have been initialized ever - the first assignment is done *after* that.
Since we already have a BUG_RETURN_VAL() right be before it's actually
dereferenced, there's no need for that assert() at all - so drop it.
See https://github.com/X11Libre/xserver/issues/330
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This struct (and associated functions) needs to be part of public driver ABI,
so video drivers can get notifications on damage certain operations, but
there hasn't been any documentation on it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This symbol is always defined, and the header is always present,
so no need to check for it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Directly calling abort() doesn't print a stack trace, nor any useful message.
Instead FatalError() should be used in cases, where there's really no other
way than terminating the Xserver. The FatalError function also tries to make
a smooth shutdown (eg. resetting video mode), so console doesn't end up locked.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The passed name buffer isn't changed by those functions ever
(it would be a bug if they did so), therefore it should be const.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>