Commit Graph

19778 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 4a94e4d01e fb: unexport fbSetBits()
Only used within fb/, not by any driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:05 +02:00
Enrico Weigelt, metux IT consult 97e82b3812 fb: unexport fbInitializeDrawable() and make it static
Only used inside fbpixmap.c (where it's defined), so can be static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:40:02 +02:00
Enrico Weigelt, metux IT consult 31548e3705 fb: unexport fbValidateDrawable()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:59 +02:00
Enrico Weigelt, metux IT consult 62d5d4ff83 fb: make fbGCFuncs static
Not used outside fbgc.c, so can be made static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:56 +02:00
Enrico Weigelt, metux IT consult ab6c67e547 fb: make fbGCOps static
Not used anywhere outside fbgc.c, so can be static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:52 +02:00
Enrico Weigelt, metux IT consult 4125712079 fb: drop obsolete fbPolyFillArc and fbPolyRectangle defines
Those aliases haven't been used (outside fb core itself), since XAA removal
back 17 years ago, no no need to carry them in public interface any longer.

See: 703a9645f3
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:49 +02:00
Enrico Weigelt, metux IT consult 879589060c fb: drop obsolete fbGetExpose() macro
Hasn't been used since 15 years so, probably should was forgotten to clean up.

See: bbbf795e6b
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:46 +02:00
Enrico Weigelt, metux IT consult abaf937693 fb: drop obsolete FbLaneCase*() macros
They haven't been used for over a decade now, so no need to keem'em any longer.
(note: xf86-video-intel has it's own copy of them)
2025-06-12 16:39:43 +02:00
Enrico Weigelt, metux IT consult 5504bc42ae fb: drop obsolete FbMaskStip macro
Hasn't been used since 24bpp support was dropped, almost a decade ago.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:41 +02:00
Enrico Weigelt, metux IT consult db2568b834 fb: drop obsolete fbFillPolygon define
Hasn't been used since XAA removal, back 17 years ago. Probably just had been
forgotten to clean up.

See: 703a9645f3
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:38 +02:00
Enrico Weigelt, metux IT consult 7f835330a4 fb: drop FbRotStipLeft, FbRotRight, FbRotStipRight macros
Not used anywhere, so can be dropped. Doesn't seem to be ever used
since added over two decades ago.

See: 9508a382f8
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:35 +02:00
Enrico Weigelt, metux IT consult badafca022 fb: drop commented-out FbLeftBits and FbLeftBits macros
Not used anywhere, so can be dropped. They always have been commented-out
since added over two decades ago.

See: 9508a382f8

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:32 +02:00
Enrico Weigelt, metux IT consult c3fe57f095 fb: drop obsolete FB_STIP_ODDSTRIDE and FB_STIP_ODDPTR macro()
Those haven't been used for over a decade now, so no need to keep
it around any longer.

See: a198373685

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:29 +02:00
Enrico Weigelt, metux IT consult 093b029abf Xext: geext: drop obsolete geext.h
This header has now become obsolete. There're also no external consumers
(drivers, etc) left, so it now finally can be dropped entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:26 +02:00
Enrico Weigelt, metux IT consult b49a585fae Xext: geext: unexport GERegisterExtension() and document it
Not used by any external module (eg drivers), so no need to keep it
exported. Also documenting it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:23 +02:00
Enrico Weigelt, metux IT consult 1295fc3ff5 dri3: unexport VERIFY_DRI3_SYNCOBJ() macro
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:39:18 +02:00
Enrico Weigelt, metux IT consult 30c0dd3734 (!1956) dri3: move dri3_syncobj_type to non-public header
The symbol isn't exported, thus not accessible to modules.
No need to keep it in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:19 +02:00
Enrico Weigelt, metux IT consult a5f8524d69 fb: overlay: drop unused fbOverlaySetupScreen()
Not used anywhere, neither internal nor drivers, so no need to keep
it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:17 +02:00
Enrico Weigelt, metux IT consult 652d350c25 fb: overlay: make fbOverlayWindowExposures() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:12 +02:00
Enrico Weigelt, metux IT consult f5d0c64e8d fb: overlay: make fbOverlayCopyWindow() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:09 +02:00
Enrico Weigelt, metux IT consult 47269bf935 fb: overlay: make fbOverlayUpdateLayerRegion() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:04 +02:00
Enrico Weigelt, metux IT consult b399cf2fe1 fb: overlay: make fbOverlayPaintKey() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:36:02 +02:00
Enrico Weigelt, metux IT consult 097cbc3def fb: overlay: make fbOverlayCreateScreenResources() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:58 +02:00
Enrico Weigelt, metux IT consult 4a1850a3a9 fb: overlay: make fbOverlayWindowLayer() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:56 +02:00
Enrico Weigelt, metux IT consult ae4aa34456 fb: overlay: make fbOverlayCloseScreen() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:53 +02:00
Enrico Weigelt, metux IT consult 1d579528ef fb: overlay: make fbOverlayCreateWindow() static
Not used anywhere outside fboverlay.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:50 +02:00
Enrico Weigelt, metux IT consult fd3d162331 os: xdmcp: handle allocation failure
| ../os/xdmcp.c: In function ‘get_mcast_options’:
| ../os/xdmcp.c:1527:27: warning: dereference of possibly-NULL ‘mcastinfo’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|  1527 |             mcastinfo->ai = firstai;
|       |             ~~~~~~~~~~~~~~^~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:48 +02:00
Enrico Weigelt, metux IT consult c389f28af0 os: util: protect set_font_authorizations() from allocation failure
| ../os/utils.c: In function ‘set_font_authorizations’:
| ../os/utils.c:863:14: warning: dereference of possibly-NULL ‘result’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   863 |         *p++ = sizeof(AUTHORIZATION_NAME) >> 8;
|       |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:45 +02:00
Enrico Weigelt, metux IT consult eb09c17a54 os: ospoll_create(): protect from allocation failure
| ../os/ospoll.c: In function ‘ospoll_create’:
| ../os/ospoll.c:229:22: warning: dereference of possibly-NULL ‘ospoll’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   229 |     ospoll->epoll_fd = epoll_create1(EPOLL_CLOEXEC);
|       |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:42 +02:00
Enrico Weigelt, metux IT consult 1e2842f3e5 composite: silence some warnings on possible NULL dereference
Unlikely to practically happen, but still safer to just check for sure.
A simple zero-value test doesn't cost us much (on modern CPUs perhaps
not even a full clock cycle).

| ../composite/compalloc.c: In function ‘compRedirectWindow’:
| ../composite/compalloc.c:167:35: warning: dereference of NULL ‘pClient’ [CWE-476] [-Wanalyzer-null-dereference]
|   167 |     ccw->id = FakeClientID(pClient->index);
|       |                            ~~~~~~~^~~~~~~

| ../composite/compalloc.c: In function ‘compUnredirectWindow’:
| ../composite/compalloc.c:331:75: warning: dereference of NULL ‘pClient’ [CWE-476] [-Wanalyzer-null-dereference]
|   331 |         if (ccw->update == update && dixClientIdForXID(ccw->id) == pClient->index) {
|       |                                                                    ~~~~~~~^~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:39 +02:00
Enrico Weigelt, metux IT consult 10e9f99fb2 exa: protect against NULL pointer dereference
Since GetPictureScreenIfSet() explicitly can return NULL, better be
prepared for that to happen (instead of hard crash)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:36 +02:00
Enrico Weigelt, metux IT consult 6308fb6bf6 kdrive: protect against allocation failures and NULL pointers
Even if those situations shouldn't practically happen, it's better to have
some sanity checks just in case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:33 +02:00
Enrico Weigelt, metux IT consult 63097cb5c9 fb: pict: make fbGlyphs() static
Not used anywhere outside fbpict.c, so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:29 +02:00
Enrico Weigelt, metux IT consult b0e7326f6d fb: pict: unexport fbTriangles()
Not used by drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:19 +02:00
Enrico Weigelt, metux IT consult 12cb13d1fa fb: pict: unexport fbTrapezoids()
Not used by drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:17 +02:00
Enrico Weigelt, metux IT consult 587fd5c708 fb: pict: unexport fbAddTriangles()
Not used by drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:14 +02:00
Enrico Weigelt, metux IT consult 02e61f15a9 fb: pict: unexport fbRasterizeTrapezoid()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:11 +02:00
Enrico Weigelt, metux IT consult 5def7f3f64 render: NULL-protect SetPicturePictFilter()
Even though it shouldn't practically happen, better adding a trivial check,
just in case. The check is really cheap and possibly optimized-out.

| ../render/filter.c: In function ‘SetPicturePictFilter’:
| ../render/filter.c:388:36: warning: dereference of possibly-NULL ‘new_params’ [CWE-690] [-Wanalyzer-possible-null-dereference]
|   388 |         pPicture->filter_params[i] = params[i];
|       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:08 +02:00
Enrico Weigelt, metux IT consult 67751f6096 render: NULL protect cpAlphaMap()
Even though it practically should never happen, but just in case, and
for silencing the analyzer, add an extra check here (which doesn't
cost us much).

| ../render/picture.c: In function ‘cpAlphaMap’:
| ../render/picture.c:1002:30: warning: dereference of NULL ‘screen’ [CWE-476] [-Wanalyzer-null-dereference]
|  1002 |         id = res->info[screen->myNum].id;
|       |                        ~~~~~~^~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:06 +02:00
Enrico Weigelt, metux IT consult 8a71c7338c render: glyph: extra NULL pointer protection
Even though it's probably never happening, but still better to protect from it,
just in case. The extra cost of it hard to measure on today's machines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:03 +02:00
Enrico Weigelt, metux IT consult 00080db825 test: add assert()s to fix analyzer warnings
Reduce the analyzer spam a bit by adding some extra asserts.
Since it's test code, we can't have enough of them anyways ;-)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:35:00 +02:00
Enrico Weigelt, metux IT consult be4f551d9f test: fix FILE pointer leak
Fix leaking open FILE*.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:58 +02:00
Enrico Weigelt, metux IT consult f1e7e52aa3 record: protect from NULL pointers
Even though the situation probably never happens, but better being extra
cautious, just in case.

| ../record/set.c: In function ‘IntervalListCreateSet’:
| ../record/set.c:364:5: warning: use of NULL ‘stackIntervals’ where non-null expected [CWE-476] [-Wanalyzer-null-argument]
|   364 |     memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval));
|       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:55 +02:00
Enrico Weigelt, metux IT consult 2be4669988 dix: a little bit more startup logging
Adding a little bit more logging to the startup process, eg. telling
when outputs or inputs have been initialized. Serving as a little aid for
debugging driver problems.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:50 +02:00
Enrico Weigelt, metux IT consult 8a5b65529c dix: protect input_option_set_value() from NULL pointer
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:47 +02:00
Enrico Weigelt, metux IT consult 3178018b84 dix: extra NULL safety check in SetClipRects()
Even though it might never be actually hit, it's better to have an
(really cheap) extra check, just in case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:44 +02:00
Enrico Weigelt, metux IT consult 9d13313511 dix: extra NULL protection in UnmapSubwindows()
Even though it probably won't be hit ever, it's still better to be
really sure instead of some remote chance for hard segfault.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:42 +02:00
Enrico Weigelt, metux IT consult ee7e43ab21 dix: clear free()ed pointers on CloseDownExtensions()
As safety precaution, clear the pointers to extion records that just
have been free()ed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:39 +02:00
Enrico Weigelt, metux IT consult 77502c6836 dix: NULL-protect AllocGlyphCursor()
Return error to the client if sourcefont turns out to be NULL for
whatever reason.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:34:37 +02:00
Enrico Weigelt, metux IT consult af71108cd3 dix: devices: refine NULL checks in GetMaster()
The checking / branchin isn't entirely trivial to understand, and the
analyzer also gets confused. So rewrite it in an simpler way that's
easier to understand both the human reader as well as the analyzer.
(and so get rid of yet another false alarm)

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