diff --git a/.github/scripts/Cygwin/build.sh b/.github/scripts/Cygwin/build.sh index 92aae0d341..7fb37b5466 100755 --- a/.github/scripts/Cygwin/build.sh +++ b/.github/scripts/Cygwin/build.sh @@ -1,7 +1,7 @@ #!/bin/sh set -x ccache -s -meson setup --prefix=/usr -Dxv=false -Dxf86bigfont=true -Dxephyr=true -Dxnest=true -Dxvfb=true -Dxwin=true -Dxorg=true -Dpciaccess=false -Dint10=false -Dglamor=false build +meson setup --prefix=/usr -Dxv=false -Dxephyr=true -Dxnest=true -Dxvfb=true -Dxwin=true -Dxorg=true -Dpciaccess=false -Dint10=false -Dglamor=false build meson configure build ninja -C build ninja -C build install diff --git a/.github/workflows/build-xserver.yml b/.github/workflows/build-xserver.yml index 57592bd76d..9ae67a5828 100644 --- a/.github/workflows/build-xserver.yml +++ b/.github/workflows/build-xserver.yml @@ -39,7 +39,7 @@ jobs: xserver-build-ubuntu-no-gbm: env: - MESON_ARGS: -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dgbm=false -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=true -Dtest_xephyr_gles=false -Dxf86bigfont=true + MESON_ARGS: -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dgbm=false -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=true -Dtest_xephyr_gles=false LIBGL_ALWAYS_SOFTWARE: 1 GALLIUM_DRIVER: llvmpipe PIGLIT_PLATFORM: x11_egl @@ -82,7 +82,7 @@ jobs: xserver-build-ubuntu: env: - MESON_ARGS: -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=true -Dtest_xephyr_gles=false -Dxf86bigfont=true + MESON_ARGS: -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=true -Dtest_xephyr_gles=false LIBGL_ALWAYS_SOFTWARE: 1 GALLIUM_DRIVER: llvmpipe PIGLIT_PLATFORM: x11_egl @@ -210,7 +210,7 @@ jobs: xserver-build-ubuntu-debug: env: - MESON_ARGS: --buildtype=debug -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=true -Dtest_xephyr_gles=false -Dxf86bigfont=true + MESON_ARGS: --buildtype=debug -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=true -Dtest_xephyr_gles=false LIBGL_ALWAYS_SOFTWARE: 1 GALLIUM_DRIVER: llvmpipe PIGLIT_PLATFORM: x11_egl @@ -462,7 +462,7 @@ jobs: xserver-build-mingw32-ubuntu: runs-on: ubuntu-latest env: - MESON_ARGS: -Dprefix=/home/runner/x11 --cross-file=.github/scripts/mingw32/cross-i686-w64-mingw32.txt -Dwerror=true -Dglx=false -Dlisten_tcp=true -Dxvmc=true -Dxv=true -Dxvfb=true -Dxnest=true -Dxephyr=true -Dxfbdev=false -Dxf86bigfont=true + MESON_ARGS: -Dprefix=/home/runner/x11 --cross-file=.github/scripts/mingw32/cross-i686-w64-mingw32.txt -Dwerror=true -Dglx=false -Dlisten_tcp=true -Dxvmc=true -Dxv=true -Dxvfb=true -Dxnest=true -Dxephyr=true -Dxfbdev=false needs: ubuntu-fetch-pkg steps: - name: Check out repository code @@ -501,7 +501,7 @@ jobs: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository env: - MESON_ARGS: -Dprefix=/tmp -Dglx=false -Dxnest=false -Dxfbdev=false -Dxf86bigfont=true + MESON_ARGS: -Dprefix=/tmp -Dglx=false -Dxnest=false -Dxfbdev=false X11_PREFIX: /Users/runner/x11 X11_BUILD_DIR: /Users/runner/build-deps runs-on: macos-latest @@ -563,7 +563,7 @@ jobs: timeout-minutes: 90 env: MYTOKEN : ${{ secrets.MYTOKEN }} - MESON_ARGS: -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=false -Dxf86bigfont=true + MESON_ARGS: -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=false steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-pkg-cache @@ -619,7 +619,7 @@ jobs: needs: ubuntu-fetch-pkg timeout-minutes: 90 env: - MESON_ARGS: -Dwerror=true -Dxephyr=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=false -Dxf86bigfont=true + MESON_ARGS: -Dwerror=true -Dxephyr=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=false steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-pkg-cache @@ -676,7 +676,7 @@ jobs: needs: ubuntu-fetch-pkg timeout-minutes: 90 env: - MESON_ARGS: -Dwerror=true -Dxephyr=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=false -Dxf86bigfont=true + MESON_ARGS: -Dwerror=true -Dxephyr=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=false steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-pkg-cache @@ -738,7 +738,7 @@ jobs: # libdrm-backed direct-rendering extensions can't work (and OI's # xf86drm.h pulls a drm.h that only exists for Linux). glx stays on # (Mesa is packaged) for indirect/software GLX. - MESON_ARGS: -Dwerror=true -Dxvfb=true -Dxnest=true -Dxorg=false -Dxephyr=false -Dxfbdev=false -Ddri2=false -Ddri3=false -Dxf86bigfont=true + MESON_ARGS: -Dwerror=true -Dxvfb=true -Dxnest=true -Dxorg=false -Dxephyr=false -Dxfbdev=false -Ddri2=false -Ddri3=false steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-pkg-cache @@ -763,7 +763,7 @@ jobs: needs: ubuntu-fetch-pkg timeout-minutes: 90 env: - MESON_ARGS: -Dwerror=true -Dxvfb=true -Dxnest=true -Dxorg=false -Dxephyr=false -Dxfbdev=false -Ddri2=false -Ddri3=false -Dxf86bigfont=true + MESON_ARGS: -Dwerror=true -Dxvfb=true -Dxnest=true -Dxorg=false -Dxephyr=false -Dxfbdev=false -Ddri2=false -Ddri3=false steps: - uses: actions/checkout@v6 - uses: ./.github/actions/ubuntu-pkg-cache @@ -838,7 +838,7 @@ jobs: # deprecated") that -Werror (-Werror=cpp) turns fatal in every TU using # libbsd. That's a musl/libbsd toolchain quirk, not an xserver warning, so # it can't be fixed in-tree (unlike solaris/gentoo/openbsd, now tightened). - MESON_ARGS: -Dprefix=/usr -Dxcsecurity=true -Dxorg=true -Dxephyr=true -Dxvfb=true -Dxnest=true -Dxfbdev=false -Dsystemd_logind=false -Dwerror=false -Dxf86bigfont=true + MESON_ARGS: -Dprefix=/usr -Dxcsecurity=true -Dxorg=true -Dxephyr=true -Dxvfb=true -Dxnest=true -Dxfbdev=false -Dsystemd_logind=false -Dwerror=false steps: # actions/checkout is a JS action; GitHub's bundled Node is # glibc-linked, so musl-based Alpine needs gcompat to run it. @@ -893,7 +893,7 @@ jobs: container: image: ghcr.io/x11libre/xserver-gentoo-deps:${{ needs.gentoo-deps-image.outputs.tag }} env: - MESON_ARGS: -Dprefix=/usr -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxephyr=true -Dxvfb=true -Dxnest=true -Dxfbdev=false -Dsystemd_logind=false -Dxf86bigfont=true + MESON_ARGS: -Dprefix=/usr -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxephyr=true -Dxvfb=true -Dxnest=true -Dxfbdev=false -Dsystemd_logind=false steps: - name: Check out repository code uses: actions/checkout@v6 @@ -913,7 +913,7 @@ jobs: # an entitlement on public runners. image: almalinux:${{ matrix.rhelver }} env: - MESON_ARGS: -Dprefix=/usr -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxephyr=true -Dxvfb=true -Dxnest=true -Dxfbdev=false -Dsystemd_logind=false -Dxf86bigfont=true + MESON_ARGS: -Dprefix=/usr -Dwerror=true -Dxcsecurity=true -Dxorg=true -Dxephyr=true -Dxvfb=true -Dxnest=true -Dxfbdev=false -Dsystemd_logind=false steps: - name: Check out repository code uses: actions/checkout@v6 diff --git a/Xext/meson.build b/Xext/meson.build index 7f8034c14f..62631de060 100644 --- a/Xext/meson.build +++ b/Xext/meson.build @@ -33,7 +33,6 @@ subdir('dpms') subdir('panoramiX') subdir('present') subdir('render') -subdir('xf86bigfont') subdir('composite') if build_xwin or build_xquartz subdir('pseudoramiX') diff --git a/Xext/xf86bigfont/meson.build b/Xext/xf86bigfont/meson.build deleted file mode 100644 index 0051fe20b8..0000000000 --- a/Xext/xf86bigfont/meson.build +++ /dev/null @@ -1,12 +0,0 @@ -srcs_xf86bigfont = [ - 'xf86bigfont.c', -] - -libxserver_xf86bigfont = [] -if build_xf86bigfont - libxserver_xf86bigfont = static_library('xserver_xf86bigfont', - srcs_xf86bigfont, - include_directories: inc, - dependencies: common_dep, - ) -endif diff --git a/Xext/xf86bigfont/xf86bigfont.c b/Xext/xf86bigfont/xf86bigfont.c deleted file mode 100644 index 58f8335652..0000000000 --- a/Xext/xf86bigfont/xf86bigfont.c +++ /dev/null @@ -1,667 +0,0 @@ -/* - * BIGFONT extension for sharing font metrics between clients (if possible) - * and for transmitting font metrics to clients in a compressed form. - * - * Copyright (c) 1999-2000 Bruno Haible - * Copyright (c) 1999-2000 The XFree86 Project, Inc. - */ - -/* THIS IS NOT AN X CONSORTIUM STANDARD */ - -/* - * Big fonts suffer from the following: All clients that have opened a - * font can access the complete glyph metrics array (the XFontStruct member - * `per_char') directly, without going through a macro. Moreover these - * glyph metrics are ink metrics, i.e. are not redundant even for a - * fixed-width font. For a Unicode font, the size of this array is 768 KB. - * - * Problems: 1. It eats a lot of memory in each client. 2. All this glyph - * metrics data is piped through the socket when the font is opened. - * - * This extension addresses these two problems for local clients, by using - * shared memory. It also addresses the second problem for non-local clients, - * by compressing the data before transmit by a factor of nearly 6. - * - * If you use this extension, your OS ought to nicely support shared memory. - * This means: Shared memory should be swappable to the swap, and the limits - * should be high enough (SHMMNI at least 64, SHMMAX at least 768 KB, - * SHMALL at least 48 MB). It is a plus if your OS allows shmat() calls - * on segments that have already been marked "removed", because it permits - * these segments to be cleaned up by the OS if the X server is killed with - * signal SIGKILL. - * - * This extension is transparently exploited by Xlib (functions XQueryFont, - * XLoadQueryFont). - */ - -#include - -#include -#include -#include -#include -#include -#include - -#ifdef CONFIG_MITSHM -# if defined(__CYGWIN__) -# include -# endif -#include -#include -#include -#endif /* CONFIG_MITSHM */ - -#include -#include -#include -#include // libxfont2.h missed to include that -#include - -#include "dix/dix_priv.h" -#include "dix/request_priv.h" -#include "include/misc.h" -#include "miext/extinit_priv.h" -#include "os/osdep.h" - -#include "os.h" -#include "dixstruct.h" -#include "gcstruct.h" -#include "dixfontstr.h" -#include "extnsionst.h" -#include "protocol-versions.h" - -#include "xf86bigfontsrv.h" - -Bool noXFree86BigfontExtension = FALSE; - -static void XF86BigfontResetProc(ExtensionEntry *extEntry ); - -#ifdef CONFIG_MITSHM - -/* A random signature, transmitted to the clients so they can verify that the - shared memory segment they are attaching to was really established by the - X server they are talking to. */ -static CARD32 signature; - -/* Index for additional information stored in a FontRec's devPrivates array. */ -static int FontShmdescIndex; - -static Bool badSysCall = FALSE; - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__) - -static void -SigSysHandler(int signo) -{ - badSysCall = TRUE; -} - -static Bool -CheckForShmSyscall(void) -{ - void (*oldHandler) (int); - int shmid = -1; - - /* If no SHM support in the kernel, the bad syscall will generate SIGSYS */ - oldHandler = OsSignal(SIGSYS, SigSysHandler); - - badSysCall = FALSE; - shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT); - if (shmid != -1) { - /* Successful allocation - clean up */ - shmctl(shmid, IPC_RMID, NULL); - } - else { - /* Allocation failed */ - badSysCall = TRUE; - } - OsSignal(SIGSYS, oldHandler); - return !badSysCall; -} - -#define MUST_CHECK_FOR_SHM_SYSCALL - -/* Set once the SHM syscall probe above has succeeded; gates the - local-client shm optimisation in shmalloc(). */ -static bool shmSupported; - -#endif - -/* ========== Management of shared memory segments ========== */ - -#ifdef __linux__ -/* On Linux, shared memory marked as "removed" can still be attached. - Nice feature, because the kernel will automatically free the associated - storage when the server and all clients are gone. */ -#define EARLY_REMOVE -#endif - -typedef struct _ShmDesc { - struct _ShmDesc *next; - struct _ShmDesc **prev; - int shmid; - char *attach_addr; -} ShmDescRec, *ShmDescPtr; - -static ShmDescPtr ShmList = (ShmDescPtr) NULL; - -static ShmDescPtr -shmalloc(unsigned int size) -{ - int shmid; - char *addr; - -#ifdef MUST_CHECK_FOR_SHM_SYSCALL - if (!shmSupported) { - return (ShmDescPtr) NULL; - } -#endif - - /* On some older Linux systems, the number of shared memory segments - system-wide is 127. In Linux 2.4, it is 4095. - Therefore there is a tradeoff to be made between allocating a - shared memory segment on one hand, and allocating memory and piping - the glyph metrics on the other hand. If the glyph metrics size is - small, we prefer the traditional way. */ - if (size < 3500) { - return (ShmDescPtr) NULL; - } - - ShmDescPtr pDesc = calloc(1, sizeof(ShmDescRec)); - if (!pDesc) { - return (ShmDescPtr) NULL; - } - - shmid = shmget(IPC_PRIVATE, size, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); - if (shmid == -1) { - ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, %s\n", - size, strerror(errno)); - free(pDesc); - return (ShmDescPtr) NULL; - } - - if ((addr = shmat(shmid, 0, 0)) == (char *) -1) { - ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, %s\n", - size, strerror(errno)); - shmctl(shmid, IPC_RMID, (void *) 0); - free(pDesc); - return (ShmDescPtr) NULL; - } - -#ifdef EARLY_REMOVE - shmctl(shmid, IPC_RMID, (void *) 0); -#endif - - pDesc->shmid = shmid; - pDesc->attach_addr = addr; - if (ShmList) { - ShmList->prev = &pDesc->next; - } - pDesc->next = ShmList; - pDesc->prev = &ShmList; - ShmList = pDesc; - - return pDesc; -} - -static void -shmdealloc(ShmDescPtr pDesc) -{ -#ifndef EARLY_REMOVE - shmctl(pDesc->shmid, IPC_RMID, (void *) 0); -#endif - shmdt(pDesc->attach_addr); - - if (pDesc->next) { - pDesc->next->prev = pDesc->prev; - } - *pDesc->prev = pDesc->next; - free(pDesc); -} - -/* Called when a font is closed. */ -void -XF86BigfontFreeFontShm(FontPtr pFont) -{ - ShmDescPtr pDesc; - - /* If during shutdown of the server, XF86BigfontCleanup() has already - * called shmdealloc() for all segments, we don't need to do it here. - */ - if (!ShmList) - return; - - pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex); - if (pDesc) { - shmdealloc(pDesc); - } -} - -/* Called upon fatal signal. */ -void -XF86BigfontCleanup(void) -{ - while (ShmList) { - shmdealloc(ShmList); - } -} - -#else /* CONFIG_MITSHM */ - -void XF86BigfontFreeFontShm(FontPtr pFont) { } -void XF86BigfontCleanup(void) { } - -#endif /* CONFIG_MITSHM */ - -/* Called when a server generation dies. */ -static void -XF86BigfontResetProc(ExtensionEntry * extEntry) -{ - /* This function is normally called from CloseDownExtensions(), called - * from main(). It will be followed by a call to FreeAllResources(), - * which will call XF86BigfontFreeFontShm() for each font. Thus it - * appears that we do not need to do anything in this function. -- - * But I prefer to write robust code, and not keep shared memory lying - * around when it's not needed any more. (Someone might close down the - * extension without calling FreeAllResources()...) - */ - XF86BigfontCleanup(); -} - -/* ========== Handling of extension specific requests ========== */ - -static int -ProcXF86BigfontQueryVersion(ClientPtr client) -{ - X_REQUEST_HEAD_STRUCT(xXF86BigfontQueryVersionReq); - - xXF86BigfontQueryVersionReply reply = { - .majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION, - .minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION, -#if !defined(WIN32) || defined(__CYGWIN__) - .uid = geteuid(), - .gid = getegid(), -#endif -#ifdef CONFIG_MITSHM - .signature = signature, - .capabilities = (client->local && !client->swapped) - ? XF86Bigfont_CAP_LocalShm : 0 -#endif /* CONFIG_MITSHM */ - }; - - X_REPLY_FIELD_CARD16(majorVersion); - X_REPLY_FIELD_CARD16(minorVersion); - X_REPLY_FIELD_CARD32(uid); - X_REPLY_FIELD_CARD32(gid); - X_REPLY_FIELD_CARD32(signature); - - return X_SEND_REPLY_SIMPLE(client, reply); -} - -static void -swapCharInfo(xCharInfo * pCI) -{ - swaps(&pCI->leftSideBearing); - swaps(&pCI->rightSideBearing); - swaps(&pCI->characterWidth); - swaps(&pCI->ascent); - swaps(&pCI->descent); - swaps(&pCI->attributes); -} - -static inline void writeCharInfo(x_rpcbuf_t *rpcbuf, xCharInfo CI) { - x_rpcbuf_write_INT16(rpcbuf, CI.leftSideBearing); - x_rpcbuf_write_INT16(rpcbuf, CI.rightSideBearing); - x_rpcbuf_write_INT16(rpcbuf, CI.characterWidth); - x_rpcbuf_write_INT16(rpcbuf, CI.ascent); - x_rpcbuf_write_INT16(rpcbuf, CI.descent); - x_rpcbuf_write_CARD16(rpcbuf, CI.attributes); -} - -/* static CARD32 hashCI (xCharInfo *p); */ -#define hashCI(p) \ - (CARD32)((((p)->leftSideBearing << 27) + ((p)->leftSideBearing >> 5) + \ - ((p)->rightSideBearing << 23) + ((p)->rightSideBearing >> 9) + \ - ((p)->characterWidth << 16) + \ - ((p)->ascent << 11) + ((p)->descent << 6)) ^ (p)->attributes) - -static int -ProcXF86BigfontQueryFont(ClientPtr client) -{ - X_REQUEST_HEAD_STRUCT(xXF86BigfontQueryFontReq); - X_REQUEST_FIELD_CARD32(id); - - FontPtr pFont; -#ifdef CONFIG_MITSHM - CARD32 stuff_flags; -#endif - xCharInfo *pmax; - xCharInfo *pmin; - int nCharInfos; - int shmid; - -#ifdef CONFIG_MITSHM - ShmDescPtr pDesc = NULL; -#else -#define pDesc 0 -#endif /* CONFIG_MITSHM */ - xCharInfo *pCI; - CARD16 *pIndex2UniqIndex; - CARD16 *pUniqIndex2Index; - CARD32 nUniqCharInfos; - - /* protocol version is decided based on request packet size */ - switch (client->req_len) { - case 2: /* client with version 1.0 libX11 */ -#ifdef CONFIG_MITSHM - stuff_flags = (client->local && - !client->swapped ? XF86Bigfont_FLAGS_Shm : 0); -#endif - break; - case 3: /* client with version 1.1 libX11 */ -#ifdef CONFIG_MITSHM - stuff_flags = stuff->flags; -#endif - break; - default: - return BadLength; - } - - if (dixLookupFontable(&pFont, stuff->id, client, DixGetAttrAccess) != - Success) - return BadFont; /* protocol spec says only error is BadFont */ - - pmax = FONTINKMAX(pFont); - pmin = FONTINKMIN(pFont); - nCharInfos = - (pmax->rightSideBearing == pmin->rightSideBearing - && pmax->leftSideBearing == pmin->leftSideBearing - && pmax->descent == pmin->descent - && pmax->ascent == pmin->ascent - && pmax->characterWidth == pmin->characterWidth) - ? 0 : N2dChars(pFont); - shmid = -1; - pCI = NULL; - pIndex2UniqIndex = NULL; - pUniqIndex2Index = NULL; - nUniqCharInfos = 0; - - if (nCharInfos > 0) { -#ifdef CONFIG_MITSHM - if (!badSysCall) { - pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex); - } - if (pDesc) { - pCI = (xCharInfo *) pDesc->attach_addr; - if (stuff_flags & XF86Bigfont_FLAGS_Shm) { - shmid = pDesc->shmid; - } - } else { - if (stuff_flags & XF86Bigfont_FLAGS_Shm && !badSysCall) { - pDesc = shmalloc(nCharInfos * sizeof(xCharInfo) - + sizeof(CARD32)); - } - if (pDesc) { - pCI = (xCharInfo *) pDesc->attach_addr; - shmid = pDesc->shmid; - } else { -#endif /* CONFIG_MITSHM */ - pCI = calloc(nCharInfos, sizeof(xCharInfo)); - if (!pCI) { - return BadAlloc; - } -#ifdef CONFIG_MITSHM - } -#endif /* CONFIG_MITSHM */ - /* Fill nCharInfos starting at pCI. */ - { - xCharInfo *prCI = pCI; - int ninfos = 0; - int ncols = pFont->info.lastCol - pFont->info.firstCol + 1; - int row; - - for (row = pFont->info.firstRow; - row <= pFont->info.lastRow && ninfos < nCharInfos; row++) { - unsigned char chars[512]; - xCharInfo *tmpCharInfos[256]; - unsigned long count; - int col; - unsigned long i; - - i = 0; - for (col = pFont->info.firstCol; - col <= pFont->info.lastCol; col++) { - chars[i++] = row; - chars[i++] = col; - } - (*pFont->get_metrics) (pFont, ncols, chars, TwoD16Bit, - &count, tmpCharInfos); - for (i = 0; i < count && ninfos < nCharInfos; i++) { - *prCI++ = *tmpCharInfos[i]; - ninfos++; - } - } - } -#ifdef CONFIG_MITSHM - if (pDesc && !badSysCall) { - *(CARD32 *) (pCI + nCharInfos) = signature; - if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) { - shmdealloc(pDesc); - return BadAlloc; - } - } - } -#endif /* CONFIG_MITSHM */ - if (shmid == -1) { - /* Cannot use shared memory, so remove-duplicates the xCharInfos - using a temporary hash table. */ - /* Note that CARD16 is suitable as index type, because - nCharInfos <= 0x10000. */ - CARD32 hashModulus; - CARD16 *pHash2UniqIndex; - CARD16 *pUniqIndex2NextUniqIndex; - CARD32 NextIndex; - CARD32 NextUniqIndex; - CARD16 *tmp; - CARD32 i, j; - - hashModulus = 67; - if (hashModulus > nCharInfos + 1) - hashModulus = nCharInfos + 1; - - tmp = calloc(4 * nCharInfos + 1, sizeof(CARD16)); - if (!tmp) { - if (!pDesc) { - free(pCI); - } - return BadAlloc; - } - pIndex2UniqIndex = tmp; - /* nCharInfos elements */ - pUniqIndex2Index = tmp + nCharInfos; - /* max. nCharInfos elements */ - pUniqIndex2NextUniqIndex = tmp + 2 * nCharInfos; - /* max. nCharInfos elements */ - pHash2UniqIndex = tmp + 3 * nCharInfos; - /* hashModulus (<= nCharInfos+1) elements */ - - /* Note that we can use 0xffff as end-of-list indicator, because - even if nCharInfos = 0x10000, 0xffff can not occur as valid - entry before the last element has been inserted. And once the - last element has been inserted, we don't need the hash table - any more. */ - for (j = 0; j < hashModulus; j++) { - pHash2UniqIndex[j] = (CARD16) (-1); - } - - NextUniqIndex = 0; - for (NextIndex = 0; NextIndex < nCharInfos; NextIndex++) { - xCharInfo *p = &pCI[NextIndex]; - CARD32 hashCode = hashCI(p) % hashModulus; - - for (i = pHash2UniqIndex[hashCode]; - i != (CARD16) (-1); i = pUniqIndex2NextUniqIndex[i]) { - j = pUniqIndex2Index[i]; - if (pCI[j].leftSideBearing == p->leftSideBearing - && pCI[j].rightSideBearing == p->rightSideBearing - && pCI[j].characterWidth == p->characterWidth - && pCI[j].ascent == p->ascent - && pCI[j].descent == p->descent - && pCI[j].attributes == p->attributes) - break; - } - if (i != (CARD16) (-1)) { - /* Found *p at Index j, UniqIndex i */ - pIndex2UniqIndex[NextIndex] = i; - } - else { - /* Allocate a new entry in the Uniq table */ - if (hashModulus <= 2 * NextUniqIndex - && hashModulus < nCharInfos + 1) { - /* Time to increate hash table size */ - hashModulus = 2 * hashModulus + 1; - if (hashModulus > nCharInfos + 1) { - hashModulus = nCharInfos + 1; - } - for (j = 0; j < hashModulus; j++) { - pHash2UniqIndex[j] = (CARD16) (-1); - } - for (i = 0; i < NextUniqIndex; i++) { - pUniqIndex2NextUniqIndex[i] = (CARD16) (-1); - } - for (i = 0; i < NextUniqIndex; i++) { - j = pUniqIndex2Index[i]; - p = &pCI[j]; - hashCode = hashCI(p) % hashModulus; - pUniqIndex2NextUniqIndex[i] = pHash2UniqIndex[hashCode]; - pHash2UniqIndex[hashCode] = i; - } - p = &pCI[NextIndex]; - hashCode = hashCI(p) % hashModulus; - } - i = NextUniqIndex++; - pUniqIndex2NextUniqIndex[i] = pHash2UniqIndex[hashCode]; - pHash2UniqIndex[hashCode] = i; - pUniqIndex2Index[i] = NextIndex; - pIndex2UniqIndex[NextIndex] = i; - } - } - nUniqCharInfos = NextUniqIndex; - /* fprintf(stderr, "font metrics: nCharInfos = %d, nUniqCharInfos = %d, hashModulus = %d\n", nCharInfos, nUniqCharInfos, hashModulus); */ - } - } - - { - int nfontprops = pFont->info.nprops; - xXF86BigfontQueryFontReply reply = { - .minBounds = pFont->info.ink_minbounds, - .maxBounds = pFont->info.ink_maxbounds, - .minCharOrByte2 = pFont->info.firstCol, - .maxCharOrByte2 = pFont->info.lastCol, - .defaultChar = pFont->info.defaultCh, - .nFontProps = pFont->info.nprops, - .drawDirection = pFont->info.drawDirection, - .minByte1 = pFont->info.firstRow, - .maxByte1 = pFont->info.lastRow, - .allCharsExist = pFont->info.allExist, - .fontAscent = pFont->info.fontAscent, - .fontDescent = pFont->info.fontDescent, - .nCharInfos = nCharInfos, - .nUniqCharInfos = nUniqCharInfos, - .shmid = shmid, - }; - - X_REPLY_FIELD_CARD16(minCharOrByte2); - X_REPLY_FIELD_CARD16(maxCharOrByte2); - X_REPLY_FIELD_CARD16(defaultChar); - X_REPLY_FIELD_CARD16(nFontProps); - X_REPLY_FIELD_CARD16(fontAscent); - X_REPLY_FIELD_CARD16(fontDescent); - X_REPLY_FIELD_CARD32(nCharInfos); - X_REPLY_FIELD_CARD32(nUniqCharInfos); - X_REPLY_FIELD_CARD32(shmid); - X_REPLY_FIELD_CARD32(shmsegoffset); - - if (client->swapped) { - swapCharInfo(&reply.minBounds); - swapCharInfo(&reply.maxBounds); - } - - x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; - - for (int i = 0; i < nfontprops; i++) { - x_rpcbuf_write_CARD32(&rpcbuf, pFont->info.props[i].name); - x_rpcbuf_write_CARD32(&rpcbuf, pFont->info.props[i].value); - } - - if (nCharInfos > 0 && shmid == -1) { - for (int i = 0; i < nUniqCharInfos; i++) { - writeCharInfo(&rpcbuf, pCI[pUniqIndex2Index[i]]); - } - x_rpcbuf_write_CARD16s(&rpcbuf, pIndex2UniqIndex, nCharInfos); - } - - int rc = X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); - - if (nCharInfos > 0) { - if (shmid == -1) { - free(pIndex2UniqIndex); - } - if (!pDesc) { - free(pCI); - } - } - return rc; - } -} - -static int -ProcXF86BigfontDispatch(ClientPtr client) -{ - REQUEST(xReq); - - switch (stuff->data) { - case X_XF86BigfontQueryVersion: - return ProcXF86BigfontQueryVersion(client); - case X_XF86BigfontQueryFont: - return ProcXF86BigfontQueryFont(client); - default: - return BadRequest; - } -} - -void -XFree86BigfontExtensionInit(void) -{ - if (AddExtension(XF86BIGFONTNAME, - XF86BigfontNumberEvents, - XF86BigfontNumberErrors, - ProcXF86BigfontDispatch, - ProcXF86BigfontDispatch, - XF86BigfontResetProc, StandardMinorOpcode)) { -#ifdef CONFIG_MITSHM -#ifdef MUST_CHECK_FOR_SHM_SYSCALL - /* - * Note: Local-clients will not be optimized without shared memory - * support. Remote-client optimization does not depend on shared - * memory support. Thus, the extension is still registered even - * when shared memory support is not functional. - */ - if (!CheckForShmSyscall()) { - ErrorF(XF86BIGFONTNAME - " extension local-client optimization disabled due to lack of shared memory support in the kernel\n"); - return; - } - shmSupported = true; -#endif - - srand((unsigned int) time(NULL)); - signature = ((unsigned int) (65536.0 / (RAND_MAX + 1.0) * rand()) << 16) - + (unsigned int) (65536.0 / (RAND_MAX + 1.0) * rand()); - /* fprintf(stderr, "signature = 0x%08X\n", signature); */ - - FontShmdescIndex = xfont2_allocate_font_private_index(); -#endif /* CONFIG_MITSHM */ - } -} diff --git a/Xext/xf86bigfont/xf86bigfontsrv.h b/Xext/xf86bigfont/xf86bigfontsrv.h deleted file mode 100644 index eab5287751..0000000000 --- a/Xext/xf86bigfont/xf86bigfontsrv.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright © 2010 Yaakov Selkowitz - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef _XF86BIGFONTSRV_H_ -#define _XF86BIGFONTSRV_H_ - -#include - -extern void XF86BigfontFreeFontShm(FontPtr); -extern void XF86BigfontCleanup(void); - -#endif diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 0be1a723f3..f2b9ab08e0 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -46,7 +46,6 @@ SOFTWARE. #include "os/io_priv.h" #include "os/log_priv.h" #include "Xext/panoramiX/panoramiX_priv.h" -#include "Xext/xf86bigfont/xf86bigfontsrv.h" #include "scrnintstr.h" #include "resource.h" @@ -510,9 +509,6 @@ CloseFont(void *value, XID fid) }); if (pfont == defaultFont) defaultFont = NULL; -#ifdef XF86BIGFONT - XF86BigfontFreeFontShm(pfont); -#endif fpe = pfont->fpe; (*fpe_functions[fpe->type]->close_font) (fpe, pfont); FreeFPE(fpe); diff --git a/dix/extension.c b/dix/extension.c index 29f5cf768f..c9102ac44d 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -100,7 +100,6 @@ static struct { const char *name; int id; } reservedExt[] = { { "SYNC", EXTENSION_MAJOR_SYNC }, { "Windows-DRI", EXTENSION_MAJOR_WINDOWS_DRI }, { "XFIXES", EXTENSION_MAJOR_XFIXES }, - { "XFree86-Bigfont", EXTENSION_MAJOR_XF86_BIGFONT }, { "XFree86-DGA", EXTENSION_MAJOR_XF86_DGA }, { "XFree86-DRI", EXTENSION_MAJOR_XF86_DRI }, { "XFree86-VidModeExtension", EXTENSION_MAJOR_XF86_VIDMODE }, diff --git a/dix/extension_priv.h b/dix/extension_priv.h index bcd2170501..ca4bf0932d 100644 --- a/dix/extension_priv.h +++ b/dix/extension_priv.h @@ -33,20 +33,19 @@ #define EXTENSION_MAJOR_SYNC (EXTENSION_BASE + 21) #define EXTENSION_MAJOR_WINDOWS_DRI (EXTENSION_BASE + 22) #define EXTENSION_MAJOR_XFIXES (EXTENSION_BASE + 23) -#define EXTENSION_MAJOR_XF86_BIGFONT (EXTENSION_BASE + 24) -#define EXTENSION_MAJOR_XF86_DGA (EXTENSION_BASE + 25) -#define EXTENSION_MAJOR_XF86_DRI (EXTENSION_BASE + 26) -#define EXTENSION_MAJOR_XF86_VIDMODE (EXTENSION_BASE + 27) -#define EXTENSION_MAJOR_XC_MISC (EXTENSION_BASE + 28) -#define EXTENSION_MAJOR_XINPUT (EXTENSION_BASE + 29) -#define EXTENSION_MAJOR_XINERAMA (EXTENSION_BASE + 30) -#define EXTENSION_MAJOR_XKEYBOARD (EXTENSION_BASE + 31) -#define EXTENSION_MAJOR_XRESOURCE (EXTENSION_BASE + 32) -#define EXTENSION_MAJOR_XTEST (EXTENSION_BASE + 33) -#define EXTENSION_MAJOR_XVIDEO (EXTENSION_BASE + 34) -#define EXTENSION_MAJOR_XVMC (EXTENSION_BASE + 35) +#define EXTENSION_MAJOR_XF86_DGA (EXTENSION_BASE + 24) +#define EXTENSION_MAJOR_XF86_DRI (EXTENSION_BASE + 25) +#define EXTENSION_MAJOR_XF86_VIDMODE (EXTENSION_BASE + 26) +#define EXTENSION_MAJOR_XC_MISC (EXTENSION_BASE + 27) +#define EXTENSION_MAJOR_XINPUT (EXTENSION_BASE + 28) +#define EXTENSION_MAJOR_XINERAMA (EXTENSION_BASE + 29) +#define EXTENSION_MAJOR_XKEYBOARD (EXTENSION_BASE + 30) +#define EXTENSION_MAJOR_XRESOURCE (EXTENSION_BASE + 31) +#define EXTENSION_MAJOR_XTEST (EXTENSION_BASE + 32) +#define EXTENSION_MAJOR_XVIDEO (EXTENSION_BASE + 33) +#define EXTENSION_MAJOR_XVMC (EXTENSION_BASE + 34) -#define RESERVED_EXTENSIONS 38 +#define RESERVED_EXTENSIONS 37 typedef struct { ClientPtr client; diff --git a/dix/protocol.txt b/dix/protocol.txt index 189ad5d404..8751f1b676 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -628,8 +628,6 @@ R030 XFIXES:ShowCursor V000 XFIXES:SelectionNotify V001 XFIXES:CursorNotify E000 XFIXES:BadRegion -R000 XFree86-Bigfont:QueryVersion -R001 XFree86-Bigfont:QueryFont R000 XFree86-DGA:QueryVersion R001 XFree86-DGA:GetVideoLL R002 XFree86-DGA:DirectVideo diff --git a/hw/xfree86/xlibre-server.h.meson.in b/hw/xfree86/xlibre-server.h.meson.in index 2ed33e1122..78c1c0c041 100644 --- a/hw/xfree86/xlibre-server.h.meson.in +++ b/hw/xfree86/xlibre-server.h.meson.in @@ -94,9 +94,6 @@ /* Support Xdmcp */ #mesondefine XDMCP -/* Build XFree86 BigFont extension */ -#mesondefine XF86BIGFONT - /* Support XFree86 Video Mode extension */ #mesondefine XF86VIDMODE diff --git a/include/meson.build b/include/meson.build index 17dbe94f24..3a1be76f3e 100644 --- a/include/meson.build +++ b/include/meson.build @@ -256,7 +256,6 @@ conf_data.set('XCMISC', '1') conf_data.set('XCSECURITY', build_xsecurity ? '1' : false) conf_data.set('CONFIG_NAMESPACE', build_namespace ? '1' : false) conf_data.set('XDMCP', build_xdmcp ? '1' : false) -conf_data.set('XF86BIGFONT', build_xf86bigfont ? '1' : false) conf_data.set('XF86DRI', build_dri1 ? '1' : false) conf_data.set('XF86VIDMODE', 1) conf_data.set('XFIXES', '1') diff --git a/include/protocol-versions.h b/include/protocol-versions.h index 7c52473cc0..d153943f8f 100644 --- a/include/protocol-versions.h +++ b/include/protocol-versions.h @@ -128,10 +128,6 @@ #define SERVER_XDGA_MAJOR_VERSION 2 #define SERVER_XDGA_MINOR_VERSION 0 -/* Big Font */ -#define SERVER_XF86BIGFONT_MAJOR_VERSION 1 -#define SERVER_XF86BIGFONT_MINOR_VERSION 1 - /* DRI */ #define SERVER_XF86DRI_MAJOR_VERSION 4 #define SERVER_XF86DRI_MINOR_VERSION 1 diff --git a/meson.build b/meson.build index 833b499cea..7a6bfa5b69 100644 --- a/meson.build +++ b/meson.build @@ -113,7 +113,6 @@ xf86driproto_dep = dependency('xf86driproto', version: '>= 2.1.0', fallback: ['x dri2proto_dep = dependency('dri2proto', version: '>= 2.8', fallback: ['xorgproto', 'ext_xorgproto'], required: get_option('dri2') == 'true') dri3proto_dep = dependency('dri3proto', version: '>= 1.4', fallback: ['xorgproto', 'ext_xorgproto'], required: get_option('dri3') == 'true') xineramaproto_dep = dependency('xineramaproto', fallback: ['xorgproto', 'ext_xorgproto']) -xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0', fallback: ['xorgproto', 'ext_xorgproto'], required: get_option('xf86bigfont')) xf86vidmodeproto_dep = dependency('xf86vidmodeproto', version: '>= 2.2.99.1', fallback: ['xorgproto', 'ext_xorgproto']) applewmproto_dep = dependency('applewmproto', version: '>= 1.4', fallback: ['xorgproto', 'ext_xorgproto'], required: false) xshmfence_dep = dependency('xshmfence', version: xshmfence_req, required: false) @@ -581,7 +580,6 @@ if build_xquartz build_dpms = false endif -build_xf86bigfont = get_option('xf86bigfont') build_screensaver = get_option('screensaver') build_res = get_option('xres') if build_res @@ -664,7 +662,6 @@ common_dep = [ dri2proto_dep, dri3proto_dep, xineramaproto_dep, - xf86bigfontproto_dep, xf86dgaproto_dep, xf86vidmodeproto_dep, applewmproto_dep, @@ -823,7 +820,6 @@ if build_xserver libxserver_dri2, libxserver_dri3, libxserver_xinerama, - libxserver_xf86bigfont, libxserver_shm, libxserver_dpms, libxserver_xv, diff --git a/meson_options.txt b/meson_options.txt index 297f79bf63..d3f56ccf72 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -93,8 +93,6 @@ option('vgahw', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto' description: 'Xorg VGA access module') option('dpms', type: 'boolean', value: true, description: 'Xorg DPMS extension') -option('xf86bigfont', type: 'boolean', value: false, - description: 'XF86 Big Font extension') option('screensaver', type: 'boolean', value: true, description: 'ScreenSaver extension') option('xres', type: 'boolean', value: true, diff --git a/mi/miinitext.c b/mi/miinitext.c index e4fddfa861..f9e1f0b96c 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -120,9 +120,6 @@ static const ExtensionModule staticExtensions[] = { #endif /* XINERAMA */ /* must be before Render to layer DisplayCursor correctly */ {XFixesExtensionInit, "XFIXES", &noXFixesExtension}, -#ifdef XF86BIGFONT - {XFree86BigfontExtensionInit, "XFree86-Bigfont", &noXFree86BigfontExtension}, -#endif {RenderExtensionInit, "RENDER", &noRenderExtension}, #ifdef RANDR {RRExtensionInit, "RANDR", &noRRExtension}, diff --git a/miext/extinit_priv.h b/miext/extinit_priv.h index 2f3eaeca3e..df8e0518cd 100644 --- a/miext/extinit_priv.h +++ b/miext/extinit_priv.h @@ -30,7 +30,6 @@ extern Bool noSELinuxExtension; extern Bool noShapeExtension; extern Bool noTestExtensions; extern Bool noXFixesExtension; -extern Bool noXFree86BigfontExtension; extern Bool noNamespaceExtension; extern Bool PanoramiXExtensionDisabledHack; @@ -56,7 +55,6 @@ void ShmExtensionInit(void); void SyncExtensionInit(void); void XCMiscExtensionInit(void); void SecurityExtensionInit(void); -void XFree86BigfontExtensionInit(void); void BigReqExtensionInit(void); void XFixesExtensionInit(void); void XInputExtensionInit(void); diff --git a/os/log.c b/os/log.c index 93f1ae94ed..5ed112cf51 100644 --- a/os/log.c +++ b/os/log.c @@ -104,10 +104,6 @@ OR PERFORMANCE OF THIS SOFTWARE. #include "opaque.h" -#ifdef XF86BIGFONT -#include "Xext/xf86bigfont/xf86bigfontsrv.h" -#endif - #ifdef __clang__ #pragma clang diagnostic ignored "-Wformat-nonliteral" #endif diff --git a/os/utils.c b/os/utils.c index bbead41aa0..46b2484760 100644 --- a/os/utils.c +++ b/os/utils.c @@ -121,7 +121,6 @@ __stdcall unsigned long GetTickCount(void); #include "os/xhostname.h" #include "Xext/dpms/dpms_priv.h" #include "Xext/present/present_priv.h" -#include "Xext/xf86bigfont/xf86bigfontsrv.h" /* XF86BigfontCleanup() */ #include "Xext/xkeyboard/xkbsrv_priv.h" #include "dixstruct.h" @@ -1497,9 +1496,6 @@ os_move_fd(int fd) void AbortServer(void) { -#ifdef XF86BIGFONT - XF86BigfontCleanup(); -#endif CloseWellKnownConnections(); UnlockServer(); AbortDevices(); diff --git a/test/pyxtest/xclient.py b/test/pyxtest/xclient.py index 8ef1e5e7bf..f75763c3f2 100644 --- a/test/pyxtest/xclient.py +++ b/test/pyxtest/xclient.py @@ -68,7 +68,6 @@ class Extension(StrEnum): SHAPE = "SHAPE" SYNC = "SYNC" XC_MISC = "XC-MISC" - XF86BIGFONT = "XFree86-Bigfont" XF86DGA = "XFree86-DGA" XF86VIDMODE = "XFree86-VidModeExtension" XFIXES = "XFIXES"