Commit Graph

414 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
56cd66d147 render: ProcRenderQueryPictIndexValues(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and X_SEND_REPLY_WITH_RPCBUF()
for sending it all out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:09:32 +02:00
Enrico Weigelt, metux IT consult
81f93d19a0 render: ProcRenderQueryFilters(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and X_SEND_REPLY_WITH_RPCBUF()
for sending it all out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 11:08:32 +02:00
Enrico Weigelt, metux IT consult
6e2d5d3ddf render: use X_SEND_REPLY_SIMPLE() for simple replies
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 14:26:59 +02:00
Enrico Weigelt, metux IT consult
e29c0454ce render: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
34c3a9c7e2 treewide: fix serverGeneration int type mismatch
The global (exported) serverGeneration field is `unsigned long`, while
many other places copy it and compare it two other integer types, eg.
plain `int` (which is signed). Even if it's unlikely ever reaching such
high number of generations that it will ever make trouble, it's still
a good idea to clean this up and use the same type everywhere.

For clearity, introducing a typedef `x_server_generation_t` which is
used everywhere, instead of raw `unsigned long`.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:52:03 +02:00
Enrico Weigelt, metux IT consult
dbe4339fd7 treewide: replace PICT_a4b4g4r4 by PIXMAN_a4b4g4r4
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
5d96eba31b treewide: replace PICT_x4b4g4r4 by PIXMAN_x4b4g4r4
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
c2a4f0033c treewide: replace PICT_a4r4g4b4 by PIXMAN_a4r4g4b4
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
4295cf6817 treewide: replace PICT_x4r4g4b4 by PIXMAN_x4r4g4b4
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
840a4ceabe treewide: replace PICT_a1r5g5b5 by PIXMAN_a1r5g5b5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
889ded74be treewide: replace PICT_a1b5g5r5 by PIXMAN_a1b5g5r5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
a23fdf9d2f treewide: replace PICT_x1b5g5r5 by PIXMAN_x1b5g5r5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
19df33aa7a treewide: replace PICT_b5g6r5 by PIXMAN_b5g6r5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
cadf94d6c8 treewide: replace PICT_a2b10g10r10 by PIXMAN_a2b10g10r10
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
1687c9a20f treewide: replace PICT_a2r10g10b10 by PIXMAN_a2r10g10b10
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
fea686a1fc treewide: replace PICT_x8b8g8r8 by PIXMAN_x8b8g8r8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
522a2d4280 treewide: replace PICT_x2r10g10b10 by PIXMAN_x2r10g10b10
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
aba79cbfca treewide: replace PICT_x2b10g10r10 by PIXMAN_x2b10g10r10
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
8cb07602ff treewide: replace PICT_x1r5g5b5 by PIXMAN_x1r5g5b5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
c113bc77ae treewide: replace PICT_a1 by PIXMAN_a1
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
b736739892 treewide: replace PICT_r5g6b5 by PIXMAN_r5g6b5
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
3786a77ed3 treewide: replace PICT_b8g8r8x8 by PIXMAN_b8g8r8x8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
7939ec278d treewide: replace PICT_b8g8r8a8 by PIXMAN_b8g8r8a8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
314540a597 treewide: replace PICT_x8r8g8b8 by PIXMAN_x8r8g8b8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
35a43252ca treewide: replace PICT_a8r8g8b8 by PIXMAN_a8r8g8b8
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-11 20:23:43 +02:00
Enrico Weigelt, metux IT consult
cd4e80da8d treewide: replace PICT_TYPE_OTHER by PIXMAN_TYPE_OTHER
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
6948c15499 treewide: replace PICT_TYPE_GRAY by PIXMAN_TYPE_GRAY
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
d8a06a2f9f treewide: replace PICT_TYPE_COLOR by PIXMAN_TYPE_COLOR
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
9f4391203f treewide: replace PICT_TYPE_A by PIXMAN_TYPE_A
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
71e2b20fe0 treewide: replace PICT_TYPE_BGRA by PIXMAN_TYPE_BGRA
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
ba06904f10 treewide: replace PICT_TYPE_ABGR by PIXMAN_TYPE_ABGR
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
900c893246 treewide: replace PICT_TYPE_ARGB by PIXMAN_TYPE_ARGB
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 15:35:38 +02:00
Enrico Weigelt, metux IT consult
600b46c7c1 treewide: replace PICT_FORMAT_B by PIXMAN_FORMAT_B
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 12:45:37 +02:00
Enrico Weigelt, metux IT consult
ca118c9793 treewide: replace PICT_FORMAT_G by PICT_FORMAT_G
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 12:45:37 +02:00
Enrico Weigelt, metux IT consult
414d5c7654 treewide: replace PICT_FORMAT_R by PIXMAN_FORMAT_R
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 12:45:37 +02:00
Enrico Weigelt, metux IT consult
f104c96091 treewide: replace PICT_FORMAT_COLOR by PIXMAN_FORMAT_COLOR
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 12:45:37 +02:00
Enrico Weigelt, metux IT consult
3cd02f4245 treewide: replace PICT_FORMAT_VIS by PIXMAN_FORMAT_VIS
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 12:45:37 +02:00
Enrico Weigelt, metux IT consult
803355e874 treewide: replace PICT_FORMAT_TYPE by PIXMAN_FORMAT_TYPE
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 12:45:37 +02:00
Enrico Weigelt, metux IT consult
c2c19fc7fe treewide: replace PICT_FORMAT_RGB by PIXMAN_FORMAT_RGB
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 12:45:37 +02:00
Enrico Weigelt, metux IT consult
7783ae7723 treewide: replace PICT_FORMAT_BPP by PIXMAN_FORMAT_BPP
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 12:45:37 +02:00
Enrico Weigelt, metux IT consult
ae1b649587 treewide: replace PICT_FORMAT_A by PIXMAN_FORMAT_A
Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-07 12:45:37 +02:00
Enrico Weigelt, metux IT consult
325c403b5f render: picture: make PictFormatShort equal to pixman_format_code_t
Both types are already binary equal: both are enums using the same bit values,
but from compiler's perspective they're still different types, so it's warning.

>   ../glamor/glamor_trapezoid.c:123:47: warning: implicit conversion from
>   enumeration type 'PictFormatShort' (aka 'enum _PictFormatShort') to different
>   enumeration type 'pixman_format_code_t' [-Wenum-conversion]
>     123 |     image = pixman_image_create_bits(picture->format,
>          |             ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~^~~~~~
>    1 warning generated.

The PICT_* fields, values and macros are relics from pre-pixman days (pixman,
historically, essentially is the PICT_* stuff moved out to separate library)
This has been a practical way for doing the transition from the old internal
PICT_* code to pixman. Now it's time to finish it all up and drop the extra
glue layer.

In order to make it smooth, and also providing backwards compatibility for
drivers (until they all keep up), just aliasing the types and adding #define's
for the enum values.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-06 13:49:13 +02:00
Oleh Nykyforchyn
3f6e1bef3b render: picture.c.: move PictureScreenClose to post-hooks
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>
2025-07-23 15:25:37 +02:00
Enrico Weigelt, metux IT consult
e575fb0f1a render: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
dasha_uwu
7c64a06ba4 treewide: remove "lib" prefix in static_library names (meson)
this was producing static libraries named "liblibsomething.a"

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-07-03 12:01:52 +02:00
Enrico Weigelt, metux IT consult
c430c829d5 render: fix CVE-2025-49175
Protect against clients sending a series of zero cursors.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:01:25 +02:00
dasha_uwu
a776156b54 treewide: preemptively revert !1714 where it affects ABI compatibility
this adds dummy pointers in place of removed fields in some structs, only for
SDK headers, to preserve ABI
some of these fix segfaults for nvidia driver, some are preemptive

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
Enrico Weigelt, metux IT consult
e6467895f9 dix: add dixAllocServerXID()
Adding a separate function for allocating server-client's XIDs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult
3c028a8cc0 miext: move over extinit_priv.h from include
Since most of the extension init logic (and on/off switches for them)
is driven from miext, this seems the appropriate place for the header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult
037a595ad7 render: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00