-
Historical legacy: the LED ID defines have/had different naming across various platforms - for better portability of the keyboard driver, those have been aliased to BSD's naming scheme. Meanwhile, lots of ancient platforms have been died or moved to other drivers (eg. Linux went to either evdev or libinput and not supported by the xf86-input-keyboard driver anymore). The only remaining possible consumer is Solaris. But it has it's own dedicated code (sun_kbd.c in xf86-input-keyboard), which already using the Solaris' naming. Therefore, there's no actual consumer of them left, so we can drop them. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1418>
0cb8a76a -
This #define is local within a .c file, but became unused about a decade ago (commit 8686463d). Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1410>
d8758cdd -
We've got three #define's that are all set at once, on enable_debugging. A comment in meson.build already asks for consolidating them into one, so just do it now. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1409>
2003adfd -
Commit 0d4a7ed6 put the definition of pcvt_version inside #ifdef __NetBSD__ but left one use of it outside of the ifdefs, resulting in a build failure on FreeBSD 14.0 in the gitlab CI for xf86-input-keyboard. ../hw/xfree86/os-support/bsd/bsd_init.c:540:21: error: use of undeclared identifier 'pcvt_version' pcvt_version.rmajor, pcvt_version.rminor); ^ ../hw/xfree86/os-support/bsd/bsd_init.c:540:42: error: use of undeclared identifier 'pcvt_version' pcvt_version.rmajor, pcvt_version.rminor); ^ Fixes: 0d4a7ed6 ("bsd_init.c: fix build on OpenBSD") Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <!1424>
e1c5be12 -
Olivier Fourdan authored
Use double precision floating point for the screen size to reduce the rounding issues when using fractional scaling. Introduce a couple of simple convenient functions that round the floating point value into an integer and use it in place of directly accessing the xwl_screen width/height for integer computation. This is preparation work for the introduction of fractional scaling, there should be no functional change at this point. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
32dad240 -
Olivier Fourdan authored
The mode size can be different from the actual output size when a transformation is at play. Store the actual mode width/height as well in preparation for adding support for transforms. No functional change. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
8c54f906 -
Olivier Fourdan authored
Add a scale factor to the Xwayland output and take the scale into account when computing the screen size. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
6a09cd2d -
Olivier Fourdan authored
Advertise the scaling factor applied to the Xwayland output using the mechanism of CRTC transforms. That allows for X11 clients to query the scale factor using XRandR. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
5b05a299 -
Olivier Fourdan authored
Keep track of the output scales as advertised by the wl_output protocol. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
2bdf594c -
Olivier Fourdan authored
For now, the global surface scale is always 1, no functional change. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
b678297c -
Olivier Fourdan authored
Apply the scale factor to the root window and adjust the coordinates and hotspot location for cursors. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
54f8fc40 -
Olivier Fourdan authored
The scale_x/y factor applies when a viewport is in use, rename the fields to reflect that and distinguish these from the other scale factors such as the core protocol surface scale and the fractional scaling. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
96fd7cc8 -
Olivier Fourdan authored
When the viewport is disabled, set the scale x/y back to 1.0 so that we can apply the scale factor regardless of the viewport being enabled. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
3ea36e52 -
Olivier Fourdan authored
The viewport's scale_x/y is currently applied to the motion event only. Apply the same viewport_scale_x/y to all relevant input coordinates. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
d7f31fe8 -
Olivier Fourdan authored
By using a sensible scale factor for input even when there is no viewport enabled, no need to have xwl_window_has_viewport_enabled() public anymore. Small cleanup, no functional change. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
cd0c43df -
Olivier Fourdan authored
Add a list of outputs a window is placed on, adding an output whenever the surface enters the output and removing it once it leaves the output. Note that not all Wayland compositors actually send a leave surface event on output removal, so we need to make sure to remove the output from the list for each window, otherwise we might end up pointing to freed memory. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
4248bfb0 -
Olivier Fourdan authored
Recompute the window scale each time the window enters or leaves an output. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
290ae87c -
Olivier Fourdan authored
Recompute and update the global screen scale based on the different outputs the root window is placed on. For backward compatibility, this functionality is however disabled by default and can be enabled using a new command line option "-hidpi". That option has no effect if Xwayland is running rootless. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
4003b1f9 -
Olivier Fourdan authored
To support the fractional scale protocol, we need a viewport. Rename the existing function xwl_window_enable_viewport() to avoid confusion with the viewport we use for fullscreen XRandR emulation in rootless mode. No functional change. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
da84b470 -
Olivier Fourdan authored
This is needed to support the "wp-fractional-scale-v1" protocol. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
98692300 -
Olivier Fourdan authored
Add support for wp_fractional_scale_v1 protocol. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
7a78756d -
Olivier Fourdan authored
Fractional scaling may not be available, or not suitable for the current configuration (e.g. if running rootless). Add a helper function to tell whether fractional scaling should be used. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
3e77c169 -
Olivier Fourdan authored
Implement fractional scale with Xwayland rootful by scaling the content to the desired fractional scale using a viewport. For now this applies to Xwayland rootful only. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-By:
Kenny Levinsen <kl@kl.wtf> Acked-by:
Peter Hutterer <peter.hutterer@who-t.net> Part-of: <!1197>
821d3d57 -
Enrico Weigelt, metux IT consult . authored
It's much cleaner to always include directly what one needs, instead of relying on very indirect including. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1435>
d66acae5 -
Enrico Weigelt, metux IT consult . authored
It's much cleaner to always include directly what one needs, instead of relying on very indirect including. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1435>
dfa606d5 -
Enrico Weigelt, metux IT consult . authored
It's much cleaner to always include directly what one needs, instead of relying on very indirect including. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1435>
94e52523 -
Enrico Weigelt, metux IT consult . authored
It's much cleaner to always include directly what one needs, instead of relying on very indirect including. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1435>
b2fd7432 -
Enrico Weigelt, metux IT consult . authored
It's much cleaner to always include directly what one needs, instead of relying on very indirect including. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1435>
d91098ef -
Enrico Weigelt, metux IT consult . authored
It's much cleaner to always include directly what one needs, instead of relying on very indirect including. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1435>
9fc6e0d3 -
Enrico Weigelt, metux IT consult . authored
It's much cleaner to always include directly what one needs, instead of relying on very indirect including. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1435>
cd84b3ea -
Enrico Weigelt, metux IT consult . authored
It's much cleaner to always include directly what one needs, instead of relying on very indirect including. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1435>
f3619310 -
fix warning: > ../os/rpcauth.c:159:16: warning: result of comparison of constant -1 with expression of type 'XID' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare] > if (rpc_id == ~0L) > ~~~~~~ ^ ~~~ Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1431>
8dc82a13 -
Tidy up the huge file a little bit. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1433>
58117a0c -
fix warning: > ../test/simple-xinit.c:58:1: warning: function 'usage' could be declared with attribute 'noreturn' [-Wmissing-noreturn] Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1429>
f7a97a7a -
fix warning: > ../test/xi2/protocol-eventconvert.c:276:9: warning: variable 'buttons' set but not used [-Wunused-but-set-variable] > int buttons, valuators; > ^ Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1429>
4e536123 -
Alan Coopersmith authored
Otherwise it causes the server to return BadDrawable giving a byte-swapped resource id instead of the real id the client sent. Reported-by: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69762 Fixes: 397dfd9f ("Create/Destroy/Trigger/Reset/Query Fence Sync objs") Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <xorg/xserver!1437>
e6573baa -
Alan Coopersmith authored
Fixes: 41277766 ("Disallow byte-swapped clients by default") Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <!1439>
3385449c -
Alan Coopersmith authored
Was previously being shown as part of previous entry. Fixes: 41277766 ("Disallow byte-swapped clients by default") Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <!1439>
bb2e2eba -
Those fields are better off in the extension instead of the OS layer. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1328>
537293ff -
globals.h shouldn't be cluttered with extension specific things, that aren't even used by external modules/drivers. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1328>
a57b4494 -
Enrico Weigelt, metux IT consult . authored
The Xprintf() function is deprecated. Most of it's call sites had been moved to asprintf(), so also do it for the remaining two ones. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1449>
2d4fa740 -
Fix meson warning: > WARNING: Project targeting '>= 0.56.0' but tried to use feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1448>
c187c540 -
Fix warning: ../config/wscons.c:47:11: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 47 | { KB_UK, "gb" }, \ | ^~~~ ../config/wscons.c:58:5: note: in expansion of macro ‘KB_OVRENC’ 58 | KB_OVRENC, | ^~~~~~~~~ ../config/wscons.c:48:11: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 48 | { KB_SV, "se" }, \ | ^~~~ [...] Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1444>
bcf55bde -
Fix warning: ../hw/xfree86/drivers/modesetting/driver.c:1612:19: warning: unused variable ‘pEnt’ [-Wunused-variable] 1612 | EntityInfoPtr pEnt = ms->pEnt; | ^~~~ Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1443>
0663bb11 -
When X11 isn't installed directly at /usr hierarchy (eg. NetBSD uses /usr/X11R7/), build breaks: ../test/list.c:31:10: fatal error: X11/Xlib.h: No such file or directory 31 | #include <X11/Xlib.h> | ^~~~~~~~~~~~ Needs explicitly dependency on libX11, so the include path is added. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1442>
e3d391b9 -
Enrico Weigelt, metux IT consult . authored
Compiler gives warning: ../config/wscons.c: At top level: ../config/wscons.c:262:1: warning: no previous prototype for ‘config_wscons_init’ [-Wmissing-prototypes] 262 | config_wscons_init(void) | ^~~~~~~~~~~~~~~~~~ ../config/wscons.c:270:1: warning: no previous prototype for ‘config_wscons_fini’ [-Wmissing-prototypes] 270 | config_wscons_fini(void) | ^~~~~~~~~~~~~~~~~~ Problem is: commit bcee84c3 wanted to enable wscons support on NetBSD, but only added compiling config/wscons.c, but didn't enable setting the CONFIG_WSCONS symbol, so it won't be called at all. Fixes: bcee84c3 Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1450>
272e2915 -
Alan Coopersmith authored
CVE-2024-31080 Reported-by: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69762 Fixes: 53e821ab ("Xi: add request processing for XIGetSelectedEvents.") Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <!1463>
96798fc1 -
Alan Coopersmith authored
CVE-2024-31081 Fixes: d220d690 ("Xi: add GrabButton and GrabKeysym code.") Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <!1463>
3e77295f -
Alan Coopersmith authored
CVE-2024-31082 Fixes: 14205ade ("XQuartz: appledri: Fix byte swapping in replies") Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <xorg/xserver!1463>
6c684d03 -
Previously, AllocateGlyph would return a new glyph with refcount=0 and a re-used glyph would end up not changing the refcount at all. The resulting glyph_new array would thus have multiple entries pointing to the same non-refcounted glyphs. AddGlyph may free a glyph, resulting in a UAF when the same glyph pointer is then later used. Fix this by returning a refcount of 1 for a new glyph and always incrementing the refcount for a re-used glyph, followed by dropping that refcount back down again when we're done with it. CVE-2024-31083, ZDI-CAN-22880 This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Part-of: <xorg/xserver!1463>
bdca6c3d -
Enrico Weigelt, metux IT consult . authored
This function is only used inside the same .c file where it's defined, no outside users, also not in drivers. Thus no need to keep it exported. Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1468>
95faea88 -
Fixes: #577 This patch replaces the instances of trunc in miPointerSetPosition by floor, thereby removing the incorrect behaviour with subpixel pointer locations between -1 and 0. This is the relevant code fragment: /* In the event we actually change screen or we get confined, we just * drop the float component on the floor * FIXME: only drop remainder for ConstrainCursorHarder, not for screen * crossings */ if (x != trunc(*screenx)) *screenx = x; if (y != trunc(*screeny)) *screeny = y; The behaviour of this code does not match its comment for subpixel coordinates between -1 and 0. For example, if *screenx is -0.5, the preceding code would (correctly) clamp x to 0, but this would not be detected by this condition, since 0 == trunc(-0.5), leaving *screenx at -0.5, out of bounds. This causes undesirable behaviour in GTK3 code using xi2, where negative subpixel coordinates like this would (to all appearances randomly) remove the focus from windows aligned with the zero boundary when the mouse hits the left or top screen boundaries. The other occurences of trunc in miPointerSetPosition have a more subtle effect which would prevent proper clamping if there is a pointer limit at a negative integer rather than at 0. This patch changes these to floor for consistency. Signed-off-by:
Willem Jan Palenstijn <wjp@usecode.org> Part-of: <!1451>
0ee4ed28 -
These aren't used anywhere, neither in Xserver nor drivers, for about 11 years now. Fallout of removing component listing support. Fixes: 710065da Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1458>
c5e88238 -
Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <!967>
89c327f2 -
Without either implicit or explicit synchronization, the result of rendering is pretty much undefined, and many glitches can appear. This still doesn't synchronize buffer release, but it works around most glitches until explicit sync is supported. Signed-off-by:
Xaver Hugl <xaver.hugl@kde.org> Part-of: <!967>
d411a8b6 -
Explicit sync support for Xwayland requires several updates to the Debian CI image. These include... xorgproto 2024.1 for DRI3 1.4 and Present 1.4 wayland-protocols 1.34 for wp-linux-drm-syncobj-v1 libdrm 2.4.116 for drmSyncobjEventfd linux-libc-dev from bullseye-backports for DMA_BUF_IOCTL_IMPORT/EXPORT_SYNC_FD Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <xorg/xserver!967>
e00e7205 -
DRI3 version 1.3 introduced a new request which allows clients to provide a hint to the server about which DRM device they are using, so that the server might return DRM format modifiers specific to that device. However, implementing such functionality, for Xwayland in particular, will require fairly significant architectural changes. To avoid blocking future versions of the DRI3 extension, we provide here a stub implementation for the request in question. The spec explicitly states that it is only a hint that the server is free to ignore, so strictly speaking this implementation is still correct. Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <xorg/xserver!967>
f051a244 -
Adds the required infrastructure in the core DRI3 code to support importing DRM synchronization objects from clients. This includes support for the two new protocol requests from DRI3 version 1.4, an internal representation of these objects in the form of the dri3_syncobj structure, and an import_syncobj screen info callback. The following operations are defined for dri3_syncobj objects * free - release any server-side resources associated with the object * has_fence - check if the fence for a timeline point is submitted * is_signaled - check if a timeline point is signaled * export_fence - return a sync fd corresponding to a timeline point * import_fence - submit a sync fd as the fence for a timeline point * signal - immediately signal a timeline point * submitted_eventfd and signaled_eventfd - register an eventfd to be signaled when the given timeline point is either submitted or signaled Implementations will be responsible for populating these function pointers when importing a syncobj. Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <xorg/xserver!967>
613dcb6a -
Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <!967>
3df236a3 -
If a presentation request is delayed while waiting for a fence, the original target msc may no longer be correct. Instead, we should compute a new target msc in xwl_present_re_execute. Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <!967>
0a7b09a0 -
Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <xorg/xserver!967>
ac0bc0b3 -
Together, DRI3 1.4 and Present 1.4 allow clients to explicitly synchronize GPU rendering with presentation using DRM syncobjs. Here we add the necessary support to Xwayland's glamor and Present infrastructure to enable this functionality. Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <xorg/xserver!967>
6f85ce4d -
This protocol allows for explicit synchronization of GPU operations by Wayland clients and the compositor. Xwayland can make use of this to ensure any rendering it initiates has completed before the target image is accessed by the compositor, without having to rely on kernel-level implicit synchronization. Furthermore, for X11 clients that also support explicit synchronization using the mechanisms exposed in the DRI3 and Present extensions, this Wayland protocol allows us to simply forward the timeline, acquire, and release points directly to the compositor, ideally avoiding any premature stalls in the presentation pipeline. Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <!967>
87bf2caf -
When a present request is received, Xwayland will check if there is an existing request targeting the same window and msc and scrap the older request if so. Alas, this does not interact well the older fence-based or newer syncobj-based synchronization features of the Present extension. Since execution of a request may be delayed for an unknown length of time while waiting for a fence to be signaled, the target msc computed upon receiving a request may not match the actual msc at which the request is executed. Therefore, we cannot determine in advance whether a more recently received request will make an older request redundant. This change removes the code to scrap pending present requests. We must also ensure requests are executed in the correct order even if their fences are signaled out of order. To achieve this, whenever execution of a request needs to wait for a fence, execution of any later-received requests will be blocked until the earlier request is ready. The blocked requests will be added to a list tracked in the xwl_present_window struct. Once the earlier request's fence is signaled, any blocked requests will be re-executed. Signed-off-by:
Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <!967>
e1f16fb1 -
This function was (accidentally ?) added back in 2008, but never used. Fixes: 68bd7ac1 Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <!1472>
fdea3670 -
This tests override WriteToClient() with their own custom function to check for validity. Unfortunately they also papered over bugs - to compare values we had to swap back thus modifying the original reply. This doesn't really have an effect on most reply handling but for those with extra data it may affect how they are processed. Fix this by copying the reply so any of the fields within that we swap is left as-is and put some basic sanity checks in for the length we pass in. Part-of: <xorg/xserver!1469>
11c92ffc -
xkbstr.h uses types from Xdefs.h (eg. Bool) but doesn't include it. If somebody includes it, w/o including Xdefs.h first, compile breaks: ../include/xkbstr.h:84:5: error: unknown type name ‘Bool’ 84 | Bool active; | ^~~~ ../include/xkbstr.h:517:5: error: unknown type name ‘Bool’ 517 | Bool num_groups_changed; | ^~~~ ../include/xkbstr.h:608:5: error: unknown type name ‘Bool’ 608 | Bool has_own_state; | ^~~~ Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1474>
992aba3c -
Not used anywhere, also not in drivers, so we can drop it. Probably never been used, just added accidentially back in 2008. Fixes: 68bd7ac1 Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1477>
beb07381 -
ProcRenderAddGlyphs() adds the glyph to the glyphset using AddGlyph() and then frees it using FreeGlyph() to decrease the reference count, after AddGlyph() has increased it. AddGlyph() however may chose to reuse an existing glyph if it's already in the glyphSet, and free the glyph that was given, in which case the caller function, ProcRenderAddGlyphs() will call FreeGlyph() on an already freed glyph, as reported by ASan: READ of size 4 thread T0 #0 in FreeGlyph xserver/render/glyph.c:252 #1 in ProcRenderAddGlyphs xserver/render/render.c:1174 #2 in Dispatch xserver/dix/dispatch.c:546 #3 in dix_main xserver/dix/main.c:271 #4 in main xserver/dix/stubmain.c:34 #5 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #6 in __libc_start_main_impl ../csu/libc-start.c:360 #7 (/usr/bin/Xwayland+0x44fe4) Address is located 0 bytes inside of 64-byte region freed by thread T0 here: #0 in __interceptor_free libsanitizer/asan/asan_malloc_linux.cpp:52 #1 in _dixFreeObjectWithPrivates xserver/dix/privates.c:538 #2 in AddGlyph xserver/render/glyph.c:295 #3 in ProcRenderAddGlyphs xserver/render/render.c:1173 #4 in Dispatch xserver/dix/dispatch.c:546 #5 in dix_main xserver/dix/main.c:271 #6 in main xserver/dix/stubmain.c:34 #7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 previously allocated by thread T0 here: #0 in __interceptor_malloc libsanitizer/asan/asan_malloc_linux.cpp:69 #1 in AllocateGlyph xserver/render/glyph.c:355 #2 in ProcRenderAddGlyphs xserver/render/render.c:1085 #3 in Dispatch xserver/dix/dispatch.c:546 #4 in dix_main xserver/dix/main.c:271 #5 in main xserver/dix/stubmain.c:34 #6 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 SUMMARY: AddressSanitizer: heap-use-after-free xserver/render/glyph.c:252 in FreeGlyph To avoid that, make sure not to free the given glyph in AddGlyph(). v2: Simplify the test using the boolean returned from AddGlyph() (Michel) v3: Simplify even more by not freeing the glyph in AddGlyph() (Peter) Fixes: bdca6c3d - render: fix refcounting of glyphs during ProcRenderAddGlyphs Closes: xorg/xserver#1659 Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Part-of: <xorg/xserver!1476>
337d8d48 -
Fix compiler warnings: ../hw/xfree86/os-support/bsd/bsd_VTsw.c: In function ‘xf86VTSwitchPending’: ../hw/xfree86/os-support/bsd/bsd_VTsw.c:56:1: warning: old-style function definition [-Wold-style-definition] 56 | xf86VTSwitchPending() | ^~~~~~~~~~~~~~~~~~~ ./hw/xfree86/os-support/bsd/bsd_VTsw.c: In function ‘xf86VTSwitchAway’: ./hw/xfree86/os-support/bsd/bsd_VTsw.c:67:1: warning: old-style function definition [-Wold-style-definition] 67 | xf86VTSwitchAway() | ^~~~~~~~~~~~~~~~ ../hw/xfree86/os-support/bsd/bsd_VTsw.c: In function ‘xf86VTSwitchTo’: ../hw/xfree86/os-support/bsd/bsd_VTsw.c:82:1: warning: old-style function definition [-Wold-style-definition] 82 | xf86VTSwitchTo() | ^~~~~~~~~~~~~~ ../hw/xfree86/os-support/bsd/bsd_init.c: In function ‘xf86OpenConsole’: ../hw/xfree86/os-support/bsd/bsd_init.c:153:1: warning: old-style function definition [-Wold-style-definition] 153 | xf86OpenConsole() | ^~~~~~~~~~~~~~~ ../hw/xfree86/os-support/bsd/bsd_init.c: In function ‘xf86OpenPccons’: ../hw/xfree86/os-support/bsd/bsd_init.c:320:1: warning: old-style function definition [-Wold-style-definition] 320 | xf86OpenPccons() | ^~~~~~~~~~~~~~ ../hw/xfree86/os-support/bsd/bsd_init.c: In function ‘xf86OpenPcvt’: ../hw/xfree86/os-support/bsd/bsd_init.c:451:1: warning: old-style function definition [-Wold-style-definition] 451 | xf86OpenPcvt() | ^~~~~~~~~~~~ ../hw/xfree86/os-support/bsd/bsd_init.c: In function ‘xf86OpenWScons’: ../hw/xfree86/os-support/bsd/bsd_init.c:563:1: warning: old-style function definition [-Wold-style-definition] 563 | xf86OpenWScons() | ^~~~~~~~~~~~~~ ../hw/xfree86/os-support/bsd/bsd_init.c: In function ‘xf86CloseConsole’: ../hw/xfree86/os-support/bsd/bsd_init.c:594:1: warning: old-style function definition [-Wold-style-definition] 594 | xf86CloseConsole() | ^~~~~~~~~~~~~~~~ ../hw/xfree86/os-support/bsd/bsd_init.c: In function ‘xf86UseMsg’: ../hw/xfree86/os-support/bsd/bsd_init.c:671:1: warning: old-style function definition [-Wold-style-definition] 671 | xf86UseMsg() | ^~~~~~~~~~ Signed-off-by:
Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <xorg/xserver!1445>
0db30946 -
Slightly simpler, and might work better in some cases when X windows get reparented. Part-of: <!1300>
59a02591 -
It's always the toplevel window, i.e. either the root window or a child of it. Preparation for later commits, no functional change. v2: (Olivier Fourdan) * Fix debug build. * Add comment describing ::toplevel. Part-of: <xorg/xserver!1300>
972d5af5 -
Preparation for later commits, no functional change intended. v2: * Leave register_damage call unchanged in this commit. (Olivier Fourdan) Part-of: <!1300>
a562d01a -
Preparation for next commit. This might change behaviour for non-InputOutput top-level windows. ensure_surface_for_window getting called and returning non-NULL for those would seem like a pre-existing bug though. Part-of: <!1300>
07f60326 -
Preparation for later commits, no functional change intended. Part-of: <!1300>
d3448f7a -
Preparation for later changes, no functional change intended. Part-of: <!1300>
db248682 -
It may track a non-toplevel window which fully covers the area of the window pixmap / Wayland surface. It is now used instead of xwl_window::toplevel for updating the Wayland surface contents. The surface_window can now hit the Present page flip path while it's automatically redirected. v2: * Use "surface_window" instead of "surf_win". (Olivier Fourdan) * Add comment describing surface_window, and describe what surface_window/toplevel are useful for respectively. (Olivier Fourdan) * Use surface_window in xwl_realize_window. v3: * Backtrack up to the closest opaque ancestor in xwl_window_update_surface_window. (Olivier Fourdan) v4: * Clean up logic for determining the surface window in xwl_window_update_surface_window, and document it better. * Handle window_get_damage(xwl_window->surface_window) returning NULL in xwl_window_update_surface_window. * Call xwl_window_update_surface_window after xwl_window_buffers_init in ensure_surface_for_window, since the former may call xwl_window_buffers_dispose. * Rename surf/win_pix to surface/window_pixmap in xwl_window_update_surface_window. Part-of: <!1300>
3a0fc268 -
Preparation for later commits, no functional change intended. Part-of: <xorg/xserver!1300>
fa7b1c20 -
A later commit will use these to (un)redirect the surface window on demand. Not used yet, so no functional change intended. v2: * Use "surface_window_damage" instead of "surf_win_damage". (Olivier Fourdan) * Slightly simplify logic in xwl_unrealize_window. v3: * Add comment in xwl_present_maybe_unredirect_window explaining why we use a timer. (Olivier Fourdan) v4: * Rename unredir_timer field to unredirect_timer. Part-of: <xorg/xserver!1300>
fca63f8f -
A later commit will use it to ensure the toplevel window pixmap has valid contents. It's hooked up only while any xwl_window->surface_window_damage points to a non-empty region. So far it's always NULL, so no functional change intended. v2: * Fix trailing whitespace. (Olivier Fourdan) v3: * Use toplevel local variable more in xwl_window_update_surface_window. Part-of: <!1300>
aa05f38f -
Preparation for next commit, no functional change intended. Part-of: <xorg/xserver!1300>
4495c696 -
It's needed when the surface window is a depth 24 descendant of a depth 32 toplevel window. xwl_source_validate ensures the toplevel window pixmap has valid contents when a client reads from it, or when the window hierarchy / geometry changes. It's never called in the normal fullscreen application case, so there's no GPU copy overhead with that. v2: * Don't try to redirect a depth 32 descendant of different-depth ancestors, the alpha channel wouldn't be handled correctly. (Olivier Fourdan) Part-of: <xorg/xserver!1300>
c7d56b0e
- .gitlab-ci.yml 1 addition, 1 deletion.gitlab-ci.yml
- .gitlab-ci/cross-prereqs-build.sh 1 addition, 1 deletion.gitlab-ci/cross-prereqs-build.sh
- .gitlab-ci/debian-install.sh 11 additions, 6 deletions.gitlab-ci/debian-install.sh
- Xext/sync.c 1 addition, 0 deletionsXext/sync.c
- Xext/xselinux.h 8 additions, 0 deletionsXext/xselinux.h
- Xext/xselinux_ext.c 3 additions, 0 deletionsXext/xselinux_ext.c
- Xext/xselinux_hooks.c 1 addition, 0 deletionsXext/xselinux_hooks.c
- Xi/xipassivegrab.c 4 additions, 1 deletionXi/xipassivegrab.c
- Xi/xiselectev.c 4 additions, 1 deletionXi/xiselectev.c
- config/wscons.c 3 additions, 5 deletionsconfig/wscons.c
- dri3/dri3.c 15 additions, 0 deletionsdri3/dri3.c
- dri3/dri3.h 37 additions, 1 deletiondri3/dri3.h
- dri3/dri3_priv.h 3 additions, 0 deletionsdri3/dri3_priv.h
- dri3/dri3_request.c 125 additions, 0 deletionsdri3/dri3_request.c
- dri3/dri3_screen.c 20 additions, 0 deletionsdri3/dri3_screen.c
- hw/xfree86/common/xf86Configure.c 2 additions, 0 deletionshw/xfree86/common/xf86Configure.c
- hw/xfree86/common/xf86Events.c 2 additions, 0 deletionshw/xfree86/common/xf86Events.c
- hw/xfree86/common/xf86Module.h 1 addition, 1 deletionhw/xfree86/common/xf86Module.h
- hw/xfree86/drivers/modesetting/dri2.c 2 additions, 0 deletionshw/xfree86/drivers/modesetting/dri2.c
- hw/xfree86/drivers/modesetting/driver.c 5 additions, 4 deletionshw/xfree86/drivers/modesetting/driver.c