Commit graph

19598 commits

Author SHA1 Message Date
Alan Coopersmith
cc7b0b7681 modesetting: fix modesetting symbol test when glx is disabled
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
48acd1ae78 xwayland: fix builds with xace disabled
CI meson-disable-options builds were failing with:
../hw/xwayland/xwayland-screen.c: In function ‘xwl_close_screen’:
../hw/xwayland/xwayland-screen.c:246:5: error: implicit declaration of
 function ‘XaceDeleteCallback’; did you mean ‘DeleteCallback’?
 [-Werror=implicit-function-declaration]
  246 |     XaceDeleteCallback(XACE_PROPERTY_ACCESS, xwl_access_property_callback, screen);
      |     ^~~~~~~~~~~~~~~~~~
      |     DeleteCallback

../hw/xwayland/xwayland-screen.c:246:24: error: ‘XACE_PROPERTY_ACCESS’
 undeclared (first use in this function)
  246 |     XaceDeleteCallback(XACE_PROPERTY_ACCESS, xwl_access_property_callback, screen);
      |                        ^~~~~~~~~~~~~~~~~~~~

../hw/xwayland/xwayland-screen.c: In function ‘xwl_screen_init’:
../hw/xwayland/xwayland-screen.c:1174:5: error: implicit declaration of
 function ‘XaceRegisterCallback’ [-Werror=implicit-function-declaration]
 1174 |     XaceRegisterCallback(XACE_PROPERTY_ACCESS, xwl_access_property_callback, pScreen);
      |     ^~~~~~~~~~~~~~~~~~~~

../hw/xwayland/xwayland-screen.c:1174:26: error: ‘XACE_PROPERTY_ACCESS’
 undeclared (first use in this function)
 1174 |     XaceRegisterCallback(XACE_PROPERTY_ACCESS, xwl_access_property_callback, pScreen);
      |                          ^~~~~~~~~~~~~~~~~~~~

Fixes: a07c2cda9 ("xwayland: Add an XACE property access handler")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
ec14ecf751 modesetting: Fix builds with pciaccess or udev_kms disabled
CI meson-disable-options builds were failing with:
../hw/xfree86/drivers/modesetting/driver.c:127:5: error: ‘ms_device_match’
 undeclared here (not in a function)
  127 |     ms_device_match,
      |     ^~~~~~~~~~~~~~~
../hw/xfree86/drivers/modesetting/driver.c: In function ‘ms_get_drm_master_fd’:
../hw/xfree86/drivers/modesetting/driver.c:1179:19: error: variable ‘pEnt’
 set but not used [-Werror=unused-but-set-variable]
 1179 |     EntityInfoPtr pEnt;
      |                   ^~~~
../hw/xfree86/drivers/modesetting/driver.c: At top level:
../hw/xfree86/drivers/modesetting/driver.c:84:13: error: ‘ms_pci_probe’
 used but never defined [-Werror]
   84 | static Bool ms_pci_probe(DriverPtr driver,
      |             ^~~~~~~~~~~~
../hw/xfree86/drivers/modesetting/driver.c:313:1: error: ‘probe_hw_pci’
 defined but not used [-Werror=unused-function]
  313 | probe_hw_pci(const char *dev, struct pci_device *pdev)
      | ^~~~~~~~~~~~

Fixes: a72bdf170 ("modesetting: rewrite probing based on fbdev.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
7b15321b3b meson: don't build xselinux if xace is disabled
xselinux requires xace to build

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
6611caf828 dix: Fix builds with meson -Dxace=false -Dwerror=true
CI meson-disable-options builds were failing with:
../dix/events.c: In function ‘CoreEnterLeaveEvent’:
../dix/events.c:4723:19: error: unused variable ‘client’
 [-Werror=unused-variable]
 4723 |         ClientPtr client = grab ? rClient(grab) : wClient(pWin);
      |                   ^~~~~~
../dix/events.c: In function ‘CoreFocusEvent’:
../dix/events.c:4834:19: error: unused variable ‘client’
 [-Werror=unused-variable]
 4834 |         ClientPtr client = wClient(pWin);
      |                   ^~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
8bbf497e22 Xace: provide definitions of new hook functions when xace is disabled
Building with -Dxace=false was generating many failures of the form:

../dix/cursor.c: In function ‘AllocARGBCursor’:
../dix/cursor.c:281:10: error: implicit declaration of function
 ‘XaceHookResourceAccess’; did you mean ‘XaceHookPropertyAccess’?
 [-Werror=implicit-function-declaration]
  281 |     rc = XaceHookResourceAccess(client, cid, X11_RESTYPE_CURSOR,
      |          ^~~~~~~~~~~~~~~~~~~~~~
      |          XaceHookPropertyAccess

Fixes: ae3c57333 ("xace: typesafe hook function for XACE_RESOURCE_ACCESS")
Fixes: 9524ffee8 ("xace: typesafe hook function for XACE_DEVICE_ACCESS")
Fixes: 67e468c8b ("xace: typesafe hook function for XACE_SEND_ACCESS")
Fixes: 3dfe00d5e ("xace: typesafe hook function for XACE_RECEIVE_ACCESS")
Fixes: 922b7685d ("xace: typesafe hook function for XACE_CLIENT_ACCESS")
Fixes: 0f6bb23bc ("xace: typesafe hook function for XACE_EXT_ACCESS")
Fixes: 47d6c3ad7 ("xace: typesafe hook function for XACE_SERVER_ACCESS")
Fixes: 51d8bcfc0 ("xace: typesafe hook function for XACE_SCREEN_ACCESS")
Fixes: 305f2d59d ("xace: typesafe hook function for XACE_SCREENSAVER_ACCESS")
Fixes: 591d95c79 ("xace: typesafe hook function for XACE_AUTH_AVAIL")
Fixes: facdaae4e ("xace: typesafe hook function for XACE_KEY_AVAIL")

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
6f6a635363 ci: run builds with most options enabled and most options disabled
We have too many options to run an exhaustive matrix of the combinations,
but this should at least help us catch code that won't compile in many
of the ifdef paths we don't go down in the default configs.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
d03c84b57f xfree86: Fix builds with gcc -Wpedantic
../hw/xfree86/loader/loadmod.c:85:33: warning: ISO C forbids empty
 initializer braces before C23 [-Wpedantic]
   85 | static int ModuleDuplicated[] = { };
      |                                 ^
../hw/xfree86/loader/loadmod.c:85:12: error: zero or negative size array
 ‘ModuleDuplicated’
   85 | static int ModuleDuplicated[] = { };
      |            ^~~~~~~~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2054>
2025-08-23 15:38:40 +00:00
Alan Coopersmith
dcd1ffa0c2 Revert "Xext: shape: clean up Xinerama dispatch"
This reverts commit a57db845bb.

It breaks when building with -Dxinerama=false:

../Xext/shape.c: In function ‘ProcShapeRectangles’:
../Xext/shape.c:318:12: error: too few arguments to function
 ‘ShapeRectangles’; expected 2, have 1
  318 |     return ShapeRectangles(client);
      |            ^~~~~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2055>
2025-08-19 23:56:27 +00:00
Alan Coopersmith
e6ec0bfde8 xf86bigfont: fix -Werror=unused-variable build failure
../Xext/xf86bigfont.c: In function ‘SProcXF86BigfontQueryVersion’:
../include/dix.h:65:12: error: unused variable ‘stuff’
 [-Werror=unused-variable]
   65 |     type * stuff = (type *)client->requestBuffer;
      |            ^~~~~
../Xext/xf86bigfont.c:654:5: note: in expansion of macro ‘REQUEST’
  654 |     REQUEST(xXF86BigfontQueryVersionReq);
      |     ^~~~~~~

Fixes: 776efd3cf ("Xext: xf86bigfont: drop swapping request length fields")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2053>
2025-08-10 10:09:14 -07:00
Alan Coopersmith
d56c848523 xf86bigfont: Fix -Werror=missing-prototypes build failure
../Xext/xf86bigfont.c: At top level:
../Xext/xf86bigfont.c:683:1: error: no previous prototype for
 ‘XFree86BigfontExtensionInit’ [-Werror=missing-prototypes]
  683 | XFree86BigfontExtensionInit(void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 33350ef8f ("include: move private definitions out of extinit.h")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2053>
2025-08-10 10:01:54 -07:00
Alan Coopersmith
4ca8b9a474 ci: enable xf86bigfont in one set of builds
Hopefully this will avoid us accepting more changesets that break it

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2053>
2025-08-10 09:54:08 -07:00
Alan Coopersmith
0617f6075b xf86bigfont: fix -Wimplicit-function-declaration error
Build breaks with gcc 14 & later when xf86bigfont is enabled:

../Xext/xf86bigfont.c: In function ‘XFree86BigfontExtensionInit’:
../Xext/xf86bigfont.c:709:28: error: implicit declaration of function
 ‘xfont2_allocate_font_private_index’;
 did you mean ‘AllocateFontPrivateIndex’? [-Wimplicit-function-declaration]
  709 |         FontShmdescIndex = xfont2_allocate_font_private_index();
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            AllocateFontPrivateIndex

Fixes: 05a793f5b ("dix: Switch to the libXfont2 API (v2)")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2053>
2025-08-10 09:48:49 -07:00
Alan Coopersmith
faa511117d Revert "os: move AbortServer() to os/utils.c"
This reverts commit 8e8bf63908.

It failed to build if xf86bigfont was enabled:
../os/utils.c: In function ‘AbortServer’:
../os/utils.c:1555:5: error: implicit declaration of function
 ‘XF86BigfontCleanup’ [-Wimplicit-function-declaration]
 1555 |     XF86BigfontCleanup();
      |     ^~~~~~~~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2053>
2025-08-10 09:38:57 -07:00
Alan Coopersmith
cbe118373d Revert "Xext: xf86bigfont: split reply header and payload"
This commit doesn't compile, but wasn't noticed since xf86bigfont
isn't enabled by default, so wasn't being built in our CI builds.
(The ".type = X_Reply;" line needs to end with a , not a ;)

This reverts commit b5a3ac9527.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2053>
2025-08-10 09:08:03 -07:00
Alan Coopersmith
061690c2e6 Re-export Ones()
It's used by the nvidia driver

Fixes: 1642adec3 ("dix: unexport Ones()")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2051>
2025-08-02 17:21:00 -07:00
Alan Coopersmith
bf867b4658 Revert "os: unexport Os*() functions"
OsBlockSignals & OsReleaseSignals are required by libint10.so

This reverts commit be4c8444eb.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2049>
2025-07-20 12:41:06 -07:00
Twaik Yont
5568b0f83f os: use close-on-exec for X server socket to prevent fd leaks
In most typical Linux X servers (like Xvfb, Xephyr, or Xwayland), no child process outlives the server, so this issue rarely arises. However, in embedded X servers (based on Xvfb or Kdrive) or in custom Xorg modules, the server might launch a long-running command with regular fork+exec calls. If the X server crashes or exits while that command is still running (for example, it spawns a tombstone generator or any process that hangs or turns to zombie), the file descriptor associated with the abstract socket can remain open in the child process. This leads to the kernel refusing to allow another X server to bind the same socket until the child process terminates (because there is no explicit way to unlink abstract socket, unlike Unix socket). By marking the file descriptor as close-on-exec, we ensure it is automatically closed in child processes, preserving the ability of a new X server process to bind the socket immediately.

Signed-off-by: Twaik Yont <9674930+twaik@users.noreply.github.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1906>
2025-07-19 21:42:37 +00:00
liuheng
9b6f72395a config: Preserve section data when parsing duplicate files
Previously, when parsing multiple configuration files containing the same
section names, only the last occurrence of each section would be retained.
Earlier definitions were silently discarded due to unconditional memory
allocation and overwriting of pointers during parsing.

This resulted in incomplete or incorrect configuration state when users
intended to merge or extend configuration through multiple files.

The section parsing functions in Files.c, Flags.c, and Module.c now
accept existing section pointers. These functions allocate new memory only
if the input pointer is NULL, preserving earlier data when re-parsing.

read.c has been updated to detect and pass existing section pointers when
encountering duplicate sections across files, preventing loss of prior content.

With these changes, the parser properly accumulates and merges configuration
data across multiple files, ensuring that all relevant settings are preserved.

Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/467
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2045>
2025-07-19 20:58:11 +00:00
Martin von Gagern
0d39d7a8f3 modesetting: Check for NULL mode_output before printing warning message
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1816
Signed-off-by: Martin von Gagern <gagern@google.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1938>
2025-07-19 20:52:27 +00:00
Michel Dänzer
010c00828a xwayland/present: Only flip if the window pixmap dimensions match
If they don't, attaching the new buffer changes the dimensions of the
wl_surface representing the window, which can break stuff as described
in https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2044 .

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2047>
2025-07-18 14:33:08 +00:00
Alan Coopersmith
94e01f7d5c Revert "dix: generate MakePredeclaredAtoms() from BuiltInAtoms file"
This reverts commit 44e6558934.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2048>
2025-07-16 17:14:51 -07:00
Alan Coopersmith
e923310d2f Revert "dix: unexport MakePredeclaredAtoms()"
This reverts commit b3ec0bf58a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2048>
2025-07-16 17:14:21 -07:00
Alan Coopersmith
122345d484 Revert "xkb: move XkbConvertGetByNameComponents and make it static"
This reverts commit 114c1c84b1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
d0d62a791b Revert "xkb: unexport functions from xkbfmisc.c"
This reverts commit 5d98664ec1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
f508575818 Revert "xkb: unexport functions from xkbout.c"
This reverts commit 660657a2c3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
f666efd73a Revert "xkb: unexport remaining internal declarations"
This reverts commit 3f8a5475c9.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
8540bda07a Revert "include: drop now empty xkbfile.h"
This reverts commit f8fc46cbbf.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
d8aedc5cfc Revert "xkb: drop unused XkbRF_LoadRulesByName()"
This reverts commit e38eeb4718.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
f21c9b9fc3 Revert "xkb: drop unused _XKB_RF_NAMES_PROP_MAXLEN define"
This reverts commit 975aed300e.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
d74398ef1d Revert "xkb: drop unused XkbRF_Invalid define from xkbrules.h"
This reverts commit 5030f23f94.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
9cac71e660 Revert "xkb: move _XKB_RF_NAMES_PROP_ATOM define into xkbInit.c"
This reverts commit 1a9592ea4b.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
adf0fa5b19 Revert "xkb: move XkbRF_* defines into xkb/maprules.c"
This reverts commit b535fd7a4c.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
ef329d6a5c Revert "xkb: unexport XkbRF_GetComponents()"
This reverts commit d3b328ba4a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
fef268f680 Revert "xkb: unexport XkbRF_LoadRules()"
This reverts commit c376cd2c3d.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
cb285e18c0 Revert "xkb: unexport XkbRF_Create()"
This reverts commit 89475cbed4.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
dafa74fa1b Revert "xkb: unexport XkbRF_Free()"
This reverts commit 34372cb3da.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
01fa00fb90 Revert "xkb: unexport XkbRF_RulesRec struct"
This reverts commit 043dc8041c.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
396e3e7a54 Revert "xkb: unexport XkbRF_GroupRec struct"
This reverts commit 83c8a90a61.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
033936539b Revert "xkb: unexport XkbRF_RuleRec struct"
This reverts commit a82fa00835.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
950462f6e6 Revert "xkb: make XkbRF_Create() static inline"
This reverts commit 60d37d0158.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
03b1d94dc3 Revert "xkb: maprules: put some loop counters into local scope"
This reverts commit ffd7ca8af2.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
1598978df2 Revert "xkb: maprules: use static struct init instead of memset()"
This reverts commit a88b17565b.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
8f184bb6ca Revert "xkb: drop obsolete parameter from XkbRF_Free()"
This reverts commit abfbc76824.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Alan Coopersmith
239b212c65 Revert "xkb: simplify loops in XkbRF_Free()"
This reverts commit a0c1eeea98.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Faith Ekstrand
376cef6710 glamor: Enable dma-buf on Zink
Zink badly needs dma-buf and modifiers as it can't handle BO import of
tiled buffers without modifiers.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1857>
2025-07-03 10:29:33 +00:00
Nathan Kidd
a4df686888 glx: Don't blindly write 8 bytes in GLX single replies
Previously we leaked stack when invalid enum parameters were
specified and caused __glGet*_size functions to return a 0 size.

Further, we read out-of-bounds (and leaked) when the input data was less
than 8 bytes (__glXDispSwap_GetFramebufferAttachmentParameteriv and
__glXDisp_GetRenderbufferParameteriv).

Now we only write a single element in the reply padding, and only when there
is a single element. This is what the Mesa client-side libGL expects, and
restores original GLX server behaviour, matching both pre-public (1996) SGI GLX
and XFree86 4.

The main risk of this change is if we have any error in element count or size;
previously it may not have mattered but now it does.

There are no piglit result changes from this modification using either mesa
libGLX or NVIDIA libGLX.

For performance considerations, an extra conditional and variable-length
memcpy has no meaningful impact on the indirect rendering pipeline cost.

There is still the possiblity to leak if our size checks allow an enum that
the GL implemention does not. Guarding against that requires zero-initializing
all temp storage, which wants re-evaluation of the blind 200-byte buffers
used for many calls and thus is a much bigger change.

Signed-off-by: Nathan Kidd <nkidd@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1647>
2025-07-02 13:00:47 -04:00
Nathan Kidd
29cfcf5259 glx: Fix out-of-bounds reads from negative return
The callers of these functions were casting -1 to unsigned and then
using 4GB indexes. By returning 0 we match all the other size functions.

GLX size functions return -1 to indicate error, but GL size functions return 0.

Signed-off-by: Nathan Kidd <nkidd@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1647>
2025-07-02 12:54:39 -04:00
Icenowy Zheng
eba15f1ba7 glamor: Fix dual blend on GLES3
The EXT_blend_func_extended extension on ESSL always requires explicit
request to allow two FS out variables because of limitations of the ESSL
language, which is mentioned as the No.6 issue of the extension's
specification.

Fix this by adding the extension request.

The original behavior on GLES3 is slightly against the specification of
GL_EXT_blend_func_extended extension, however Mesa and older version of
PowerVR closed drivers will just ignore this issue. Newest PowerVR
closed driver will bail out on this problem, so it deems a fix now.

Fixes: ee107cd491 ("glamor: support GLES3 shaders")
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1750>
2025-06-25 17:24:43 +00:00
Vlad Zahorodnii
60f0bfe852 xwayland: Dispatch tablet tool tip events after frame events
Xwayland dispatches tablet tool tip events immediately when they arrive.

With compositors such as mutter and sway, it is not an issue because
their libinput backends synthetize axis events before tip events. In
other words, axis data and the tip status belong to different frames.

On the other hand, kwin sends axis and tip events in a single frame
(its libinput backend generates a single tip event with axis data
attached to it). Since the tip events are dispatched immediately,
they can have wrong information associated with them, for example tool
position or pressure. It results in undesired "streaks" when the user
presses the tablet tool against the tablet.

See also https://bugs.kde.org/show_bug.cgi?id=479856.

Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2032>
2025-06-25 11:44:07 +00:00