Commit Graph

8740 Commits

Author SHA1 Message Date
Olivier Fourdan 1209a1bb57 xwayland: Fix uninitialised value created by a stack allocation
Commit 3c07a01c4 (xwayland: Use xdg-output name for XRandR) changed the
logic to use a fixed sized buffer allocated on the stack to pass to
RROutputCreate() which would then copy it.

Valgrind complains about this:

  == Conditional jump or move depends on uninitialised value(s)
  ==    at 0x49954B: MakeAtom (atom.c:87)
  ==    by 0x5108B3: RRMonitorCrtcName (rrmonitor.c:33)
  ==    by 0x510BBB: RRMonitorSetFromServer (rrmonitor.c:92)
  ==    by 0x511882: RRMonitorMakeList (rrmonitor.c:373)
  ==    by 0x512175: ProcRRGetMonitors (rrmonitor.c:634)
  ==    by 0x508091: ProcRRDispatch (randr.c:748)
  ==    by 0x4A860E: Dispatch (dispatch.c:546)
  ==    by 0x4B692F: dix_main (main.c:271)
  ==    by 0x431C90: main (stubmain.c:34)
  ==  Uninitialised value was created by a stack allocation
  ==    at 0x42122C: xwl_output_create (xwayland-output.c:816)

This is actually harmless, but also simple to avoid by just initializing
the content of the array with zeros, so let's just fix that.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Fixes: commit 3c07a01c4 - xwayland: Use xdg-output name for XRandR
2023-03-08 17:05:59 +00:00
Jonas Ådahl 4e20d96e8d xwayland/glamor: Track if a xwl_pixmap uses explicit modifiers
If we allocated with implicit modifiers, then we shouldn't use the
modifier returned by gbm_bo when checking whether the modifier is
supported or not, since it won't be if the compositor only advertises
implicit modifiers, nor should we use the modifier when creating the
Wayland buffer object, as it wasn't explicitly advertised.

Fixes: c6f2598a4 ("xwayland: don't fall back to wl_drm with explicit modifier")
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2023-03-08 16:54:50 +01:00
Jonas Ådahl 9bd83c02a8 xwayland/glamor/gbm: Use helper for implicit buffer params too
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2023-03-08 16:54:47 +01:00
Jonas Ådahl af255b1651 xwayland/glamor/gbm: Initialize explicit buffer params in helper
This is preparing for cleaning up the macro mess.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2023-03-08 16:53:32 +01:00
Jonas Ådahl 08b0ea09de xwayland/glamor/gbm: Only use modifier gbm API if explicit
If we're using implicit modifiers, we'll pass NULL and zero modifiers.
Lets just use the legacy API directly instead.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2023-03-08 16:26:41 +01:00
Simon Ser 6f0b9deed6 xwayland: use drmDevice to compare DRM devices
The linux_dmabuf_v1 protocol doesn't guarantee any DRM node type:
the compositor may send a primary node or a render node. Use
drmDevice so that device comparisons are node-type-insensitive.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1447
2023-03-03 14:18:49 +00:00
Olivier Fourdan d5dd3f3cee xwayland: Use MAP_PRIVATE for keymaps
With wl_pointer.axis_v120 support, the wl_seat supported version has
been bumped to 8, but Xwayland is still using MAP_SHARED which is
prohibited, wl_seat version 7 and above enforces the use of MAP_PRIVATE
for keymaps.

Use MAP_PRIVATE for the keymaps mmap().

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1512
Fixes: 3a02f56b4 - hook up wl_pointer.axis_v120 events
2023-03-03 08:44:04 +00:00
Simon Ser c6f2598a4e xwayland: don't fall back to wl_drm with explicit modifier
It's incorrect to strip an explicit modifier. Daniels' docs [1]
states:

> when importing a buffer, the user may supply `DRM_FORMAT_MOD_INVALID` as the
> buffer modifier (or not supply a modifier) to indicate that the modifier is
> unknown for whatever reason; this is only acceptable when the buffer has
> not been allocated with an explicit modifier

[1]: https://lore.kernel.org/dri-devel/20210905122742.86029-1-daniels@collabora.com/

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-03-03 08:39:54 +00:00
Simon Ser 76a329e55c xwayland: fix error path when modifier is not supported
When the modifier is not supported by the compositor, and the
DMA-BUF contains multiple planes, xwl_pixmap->buffer is NULL.
Avoid crashing when calling wl_buffer_add_listener().

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-03-03 08:35:54 +00:00
Olivier Fourdan 24171bb710 xwayland: Include <sys/type.h> where needed
With the addition of linux_dmabuf v4, the code adds dev_t in various
places but did not include <sys/types.h>.

While that works on glibc, it may fail to build on other libc
implementations such as musl libc.

Make sure to explicitly include <sys/types.h> where we use dev_t.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1445
Fixes: bddfe190de - Implement linux_dmabuf_feedback event handlers
2023-03-03 08:15:18 +00:00
Sultan Alsawaf 53b02054f3 modesetting: Support accurate DRI presentation timing with TearFree
When using TearFree, DRI clients have no way of accurately knowing when
their copied pixmaps appear on the display without utilizing the kernel
driver's notification indicating that the TearFree flip containing their
pixmap is complete. This is because the target CRTC's MSC can change while
the predicted completion MSC is calculated and even while the page flip
IOCTL is sent to the kernel due to scheduling delays and/or unfortunate
timing. Even worse, a page flip isn't actually guaranteed to be finished
after one vblank; it may be several MSCs until a flip actually finishes
depending on delays and load in hardware.

As a result, DRI clients may be off by one or more MSCs when they naively
expect their pixmaps to be visible at MSC+1 with TearFree enabled. This,
for example, makes it impossible for DRI clients to achieve precise A/V
synchronization when TearFree is enabled.

This change therefore adds a way for DRI clients to receive a notification
straight from the TearFree flip-done handler to know exactly when their
pixmaps appear on the display. This is done by checking for a NULL pixmap
pointer to modesetting's DRI flip routine, which indicates that the DRI
client has copied its pixmap and wants TearFree to send a notification when
the copied pixmap appears on the display as part of a TearFree flip. The
existing PageFlip scaffolding is reused to achieve this with minimal churn.

The Present extension will be updated in an upcoming change to utilize this
new mechanism for DRI clients' presentations.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28 22:43:37 -08:00
Sultan Alsawaf 9d1997f72a modesetting: Ensure vblank events always run in sequential order
It is possible for vblank events to run out of order with respect to one
another because the event which was queued to the kernel has the privilege
of running before all other events are handled. This allows kernel-queued
events to run before other, older events which should've run first.

Although this isn't a huge problem now, it will become more problematic
after the next change which ties DRI client notifications to TearFree page
flips. This increases the likelihood of DRI clients erroneously receiving
presentation-completion notifications out of order; i.e., a client could
receive a notification for a newer pixmap it submitted *before* receiving a
notification for an older pixmap.

Ensure vblank events always run in sequential order by removing the bias
towards kernel-queued events, and therefore forcing them to run at their
sequential position in the queue like other events.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28 22:43:37 -08:00
Sultan Alsawaf 18b14ea1f6 modesetting: Introduce ms_tearfree_is_active_on_crtc helper
There is more than one place with the confusing TearFree state check for a
CRTC. Instead of open-coding the TearFree check everywhere, introduce a
helper, ms_tearfree_is_active_on_crtc, to cover the TearFree state checks.

Suggested-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28 22:43:37 -08:00
Sultan Alsawaf 8b5fd55658 modesetting: Improve TearFree state check in ms_present_check_flip
Check that the VT is owned and that the CRTC is on before exporting info to
Present stating that TearFree is available. Also, since `trf->buf[0].px` is
checked, the `ms->drmmode.tearfree_enable` check is redundant and can
therefore be removed.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28 22:43:37 -08:00
Sultan Alsawaf 35975d9054 modesetting: Fix memory leak on ms_do_pageflip error
The event allocation for ms_do_pageflip is leaked on error because callers
of ms_do_pageflip have no way of knowing whether or not a page flip
succeeded for any CRTCs. If a page flip succeeded for at least one CRTC,
then it's not safe for the caller to free the event allocation, and the
allocation won't be leaked. The event allocation is only leaked when not a
single CRTC's page flip succeeded.

Since all callers of ms_do_pageflip allocate the event pointer, and all of
them intentionally leak the event allocation when ms_do_pageflip returns an
error, just free the event pointer inside ms_do_pageflip when a page flip
doesn't succeed for any CRTC.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28 22:43:37 -08:00
Sultan Alsawaf be864d8e18 modesetting: Pass CRTC pointer to TearFree flip handlers
The CRTC pointer will soon be needed in the TearFree flip handlers, so pass
it in instead of passing in drmmode_tearfree_ptr.

No functional change.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28 22:43:37 -08:00
Sultan Alsawaf 1fd9d79ae0 modesetting: Pass reference CRTC pointer to ms_do_pageflip
Rather than passing the reference CRTC's vblank pipe to ms_do_pageflip,
just pass the pointer to the reference CRTC directly instead. This is
clearer and more useful than the vblank pipe, since the vblank pipe is only
used to identify whether or not a given CRTC is the reference CRTC.

No functional change.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28 22:43:37 -08:00
Sultan Alsawaf 7288b4d105 modesetting: Remove redundant GLAMOR_HAS_GBM #ifdef from ms_do_pageflip
This #ifdef is redundant since ms_do_pageflip is already enclosed within a
larger GLAMOR_HAS_GBM #ifdef.

No functional change.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28 22:43:37 -08:00
Alan Coopersmith d6b20f5e36 Remove "All rights reserved" from Oracle copyright notices
Oracle no longer includes this term in our copyright & license notices.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-25 09:40:41 -08:00
Austin Shafer 5468123822 Add DRM platform for BSD
This moves lnx_platform.c to the shared directory and adds it to
the BSD build. This is needed for PRIME render offload.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2023-02-23 15:47:19 +00:00
Simon Ser 098fcedf57 xwayland: override Meson dependency
This allows developers to setup Xwayland as a subproject of a
Wayland compositor, and have it correctly pick up the features
advertised in the dependency variables.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-13 16:14:19 +00:00
Simon Ser c06ba33280 xwayland: generate pkg-config file from Meson
Remove the xwayland.pc.in file:

- This avoids writing down each pkg-config variable twice: once in
  the Meson files to set the configuration data, once in the .pc.in
  file to print it.
- We'll be able to re-use the same variables for use as a
  subproject.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-13 16:14:19 +00:00
Olivier Fourdan 0c93394d72 xwayland: Use wl_output.name for XRandR
If wl_output provides us with an output name, use that as well.

If we have both xdg_output.name and wl_output.name (from version >= 4),
prefer the latter.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>#
See-also: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/189
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-02-13 14:41:05 +01:00
Olivier Fourdan b63ef10f18 xwayland: Pass the wl_output version
With the wl_output protocol, the actual bind to the interface is done in
xwl_output_create().

Pass the version number from the registry so we can bind to the minimum
version.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-02-13 14:41:05 +01:00
Olivier Fourdan 3c07a01c42 xwayland: Use xdg-output name for XRandR
Currently, Xwayland assigns sequential output names for XRandR. When an
output is hotplugged, a new name is assigned sequentially (XWAYLAND0,
XWAYLAND1, etc.). This is a problem because if a monitor is unplugged
and plugged again, it will get a new name each time.

Luckily, xdg-output provides us with a name for the outputs.

Even though the protocol states that the name is not a reflection of the
underlying DRM connector name, it is to remain consistent across
sessions with the same hardware and software configuration.

So we could use the xdg-output name for the XRandR reported name for the
output.

Doing so is a bit tricky though, because the output name is set at
creation and is not supposed to change. The xdg-output event that
provides us with the name will come at a later time.

So we just allocate a default fixed size for the output name at creation
and just replace the default output name with the xdg-output name when
that is known.

Also, historically, some X11 clients were expecting output names in
Xwayland to be named XWAYLAND<x> and used that to check whether they
were running on Xwayland. Those clients should now use the Xwayland X11
extension which is designed specifically for that purpose.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1353
See-also: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/954
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-02-13 14:41:05 +01:00
Olivier Fourdan ddcbb46f97 xwayland: Tell RR has changed only when done
Since commit 204f10c2, we notify XRandR clients that the randr
configuration has changes as soon as an new output is created.

Yet, this might be premature, considering that at that point, we are
still to receive the wl_output and xdg-output events that will most
likely change the setup.

So instead of calling RRTellChanged() from xwl_output_create(), wait
until we get to call apply_output_change(), which occurs after the done
events from both xdg-output and wl_output are received.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-02-13 14:41:05 +01:00
Simon Ser 5aebc01096 xwayland: fix GBM on driver without explicit modifiers
Some drivers (e.g. AMD GFX8-) don't support explicit format
modifiers. On these drivers, gbm_bo_create_with_modifiers()
will fail. This results in "Error getting buffer" in the logs
later on with all X11 windows staying invisible.

Fallback to the modifier-less API gbm_bo_create() in that case.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-13 13:26:59 +00:00
Michel Dänzer d01a075d59 xwayland: Do not use "XWayland" spelling in code identifiers
Let's not give people any excuse for this spelling.
2023-02-13 13:02:55 +00:00
Michel Dänzer b5aa70503a xwayland: Spell XWAYLAND consistently in debug messages 2023-02-13 13:02:55 +00:00
Michel Dänzer df75d90a2c xwayland: Spell Xwayland consistently in error messages 2023-02-13 13:02:55 +00:00
Minh Phan ba644a64a4 xwayland/window: Do not double add window to damage list
The window might be retained in the damage list after
`xwl_screen_post_damage` in certain conditions. This means we need to
check if the window is already in the list to avoid adding the same
window twice which will lead to list corruption resulting in server freeze
in `xwl_screen_post_damage`.

Signed-off-by: Minh Phan <phanquangminh217@gmail.com>
2023-02-10 14:57:59 +00:00
Olivier Fourdan 2f8778ca68 xwayland: wl_pointer.axis_v120 is no longer optional
With Wayland 1.21 being our baseline, we do not need to compile
wl_pointer.axis_v120 conditionally.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2023-02-09 22:57:00 +00:00
Olivier Fourdan a7ee25f67d xwayland: Commit surface changes with libdecor configure
With libdecor, when the state changes (in the configure handler), we
need to commit the libdecor frame but also the wl_surface, otherwise
the surface is left in a uncommitted state until a wl_surface commit
eventually occurs later.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Fixes: c74c6add3e - xwayland: add optional support for libdecor
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2023-02-03 11:06:55 +01:00
Tamura Dai f33962966f Xephyr: fix help output.
"-mouse" require two commas before options.

Signed-off-by: Tamura Dai <kirinode0@gmail.com>
2023-01-22 22:35:59 +00:00
Austin Shafer d67383a695 xwayland: Send PresentCompleteModeSuboptimalCopy if dmabuf feedback was resent
If the dmabuf protocol's feedback object gave us a new list of
modifiers, send PresentCompleteModeSuboptimalCopy to the client
to inform them that they need to call GetSupportedModifiers.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-01-20 17:56:54 +00:00
Austin Shafer f0415beb9f xwayland: Add proper support for telling if a format/mod is supported
This adds to xwl_glamor_is_modifier_supported, where if feedback
is in use we will check that the format/mod is allowed in any
device advertised by the compositor.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>

[ Michel Dänzer:
* Move dev_formats declaration to where it's used in
  xwl_feedback_is_modifier_supported
* Add curly braces around multi-line statement in
  xwl_glamor_is_modifier_supported ]
2023-01-20 17:56:54 +00:00
Austin Shafer d61eb4dd98 xwayland: Return default feedback in xwl_screen
If protocol version 4 of linux_dmabuf is in use, then the compositor
may not return anything with the modifiers event. We instead
will return the formats/mods reported for the main device.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>

[ Michel Dänzer:
* Move main_dev declaration to where it's used in
  xwl_glamor_get_formats
* Add empty line between variable declaration and comment ]
2023-01-20 17:56:54 +00:00
Austin Shafer 43b35b4efe xwayland: Make helper for returning a list of formats
This adds xwl_get_formats

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>

[ Michel Dänzer:
* Remove unused variable i from xwl_glamor_get_formats ]
2023-01-20 17:56:54 +00:00
Austin Shafer d2e107b260 xwayland: Add get_drawable_modifiers implementation
This reads from the format list, which is not yet filled in.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-01-20 17:56:54 +00:00
Austin Shafer 9f34807752 xwayland: Add get_main_device helper to GBM
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-01-20 17:56:54 +00:00
Austin Shafer bddfe190de xwayland: Implement linux_dmabuf_feedback event handlers
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>

[ Michel Dänzer:
* Sort protocol #includes lexically.
* memcpy to &xwl_feedback->main_dev directly in
  xwl_dmabuf_feedback_main_device. ]
2023-01-20 17:56:54 +00:00
Austin Shafer 2930eb113b xwayland: Move xwl_format array management to its own function
This creates xwl_add_format_and_mod_to_list, which is a helper
that adds a format/mod combo to a xwl_format* list. This will
be used by both the modifier event handling and the tranche
format handling.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-01-20 17:56:54 +00:00
Ivan A. Melnikov 711d491729 glamor: Don't initialize on softpipe
There are systems where softpipe is the default renderer,
e.g. when llvmpipe is not is not available. Using glamor
on such systems is never a good idea.

This mirrors what commit 0a9415cf79
did for llvmpipe.

Closes: #1417

Signed-off-by: Ivan A. Melnikov <iv@altlinux.org>
2023-01-19 20:06:04 +00:00
Peter Hutterer 3a02f56b43 xwayland: hook up wl_pointer.axis_v120 events
For details on the protocol itself see the Wayland merge request:
https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72

The v120 event has a value base of 120, so one wheel detent is 120, half a
wheel is 60, etc. This is the API Windows has been using since Vista but it
requires HW support from the device. Logitech mice and many Microsoft mice of
the last decade or so have support and it's enabled in the kernel since v5.0.

The new events replace wl_pointer.axis_discrete events, once you bind to
wl_pointer >= 8 you only get the v120 events. So backwards compatibility
is simple, we just multiply the discrete events if we get them and
treat everything as 120 event internally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-01-18 13:33:54 +10:00
Peter Hutterer 2f0d39e1f1 xwayland: use a define for the horiz/vert scroll valuators
Slightly more readable and less prone to copy/paste errors.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-01-18 12:49:08 +10:00
Jeremy Huddleston Sequoia 2567388a29 xquartz: Disable COMPOSITE at runtime
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2023-01-17 15:17:45 -08:00
Jeremy Huddleston Sequoia 15077090d3 xquartz: Update the about box copyright to 2023
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2023-01-17 07:33:38 -08:00
Joshua Ashton 0abb577075 xwayland: Don't expose XRandR emulated modes for leaseable displays
Leasable displays do not have any actual associated Wayland output and
are not available to regular X11 clients and left entirely to the
application who requests the lease.

As these are not actually managed by the Wayland compositor and left
entirely to the "lessee" application, the viewporter protocol required
for the XRandR emulation is not usable on such devices.

We should therefore not advertise the XRandR emulated modes for those
leasable displays.

This also solves a problem with implementations of glXGetMscRateOML()
which is used notably by Chromium/Electron. Applications using this
which will begin lagging/stuttering exponentially over
time, trying to look up a non-existent mode with 0x0 as returned by
XF86VidModeGetModeLine() with XRandR emulation for such devices.

See-also: https://github.com/labwc/labwc/issues/553
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2023-01-12 14:34:20 +00:00
Jocelyn Falempe 6969782b69 x86/logind fix suspend/resume when there are no input devices
Make sure info->active and info->vt_active are false after
dropping drm master.
Normally, this is done when pausing the first input device, so it
breaks when there are no input device at all.

Fixes: da9d012a9 ("xf86/logind: Fix drm_drop_master before vt_reldisp")
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1387
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
2023-01-09 13:38:25 +00:00
Peter Hutterer 412777664a Disallow byte-swapped clients by default
The X server swapping code is a huge attack surface, much of this code
is untested and prone to security issues. The use-case of byte-swapped
clients is very niche, so let's disable this by default and allow it
only when the respective config option or commandline flag is given.

For Xorg, this adds the ServerFlag "AllowByteSwappedClients" "on".
For all DDX, this adds the commandline options +byteswappedclients and
-byteswappedclients to enable or disable, respectively.

Fixes #1201

https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1029

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-01-06 11:59:37 +10:00