From 90afa1f0057fe75eb008db6482db9324bb597412 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Mon, 16 Jan 2023 14:34:40 +0200 Subject: [PATCH 01/25] Save xorg .gitignore --- unix/xserver/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 unix/xserver/.gitignore diff --git a/unix/xserver/.gitignore b/unix/xserver/.gitignore new file mode 100644 index 0000000..9bfed6b --- /dev/null +++ b/unix/xserver/.gitignore @@ -0,0 +1,4 @@ +/* +!/hw +/hw/* +!/hw/vnc From 895b6b56977e9345babf0de74435824283d0c75a Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Mon, 16 Jan 2023 15:01:57 +0200 Subject: [PATCH 02/25] Complain about missing read permissions once, as it's a typical config mistake --- common/rfb/VNCSConnectionST.cxx | 10 ++++++++-- common/rfb/VNCSConnectionST.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx index 5629ed6..542d7c7 100644 --- a/common/rfb/VNCSConnectionST.cxx +++ b/common/rfb/VNCSConnectionST.cxx @@ -64,7 +64,7 @@ VNCSConnectionST::VNCSConnectionST(VNCServerST* server_, network::Socket *s, needsPermCheck(false), pointerEventTime(0), clientHasCursor(false), accessRights(AccessDefault), startTime(time(0)), frameTracking(false), - udpFramesSinceFull(0) + udpFramesSinceFull(0), complainedAboutNoViewRights(false) { setStreams(&sock->inStream(), &sock->outStream()); peerEndpoint.buf = sock->getPeerEndpoint(); @@ -1308,8 +1308,14 @@ void VNCSConnectionST::writeFramebufferUpdate() } } - if (!(accessRights & AccessView)) + if (!(accessRights & AccessView)) { + if (!complainedAboutNoViewRights) { + complainedAboutNoViewRights = true; + vlog.error("User %s has no read permissions. If this is not intended, grant them permissions with kasmvncpasswd or via the API", + user); + } return; + } // Updates often consists of many small writes, and in continuous // mode, we will also have small fence messages around the update. We diff --git a/common/rfb/VNCSConnectionST.h b/common/rfb/VNCSConnectionST.h index 51826b4..8d71ddd 100644 --- a/common/rfb/VNCSConnectionST.h +++ b/common/rfb/VNCSConnectionST.h @@ -324,6 +324,7 @@ namespace rfb { bool frameTracking; uint32_t udpFramesSinceFull; + bool complainedAboutNoViewRights; }; } #endif From 7760ec2d8481b92e8ec0a596ef21f75ef4407983 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Wed, 18 Jan 2023 12:45:35 +0200 Subject: [PATCH 03/25] Clear a warning --- unix/xserver/hw/vnc/xvnc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c index 5f293f9..5dac75c 100644 --- a/unix/xserver/hw/vnc/xvnc.c +++ b/unix/xserver/hw/vnc/xvnc.c @@ -1783,8 +1783,8 @@ static void vfbClientStateChange(CallbackListPtr *a, void *b, void *c) { dispatchException &= ~DE_RESET; } } - -#if XORG >= 113 + +#if XORG >= 113 && XORG < 120 #ifdef GLXEXT extern void GlxExtensionInit(void); From 4b898682197217a85c69202a4fccde44b647ee25 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Wed, 18 Jan 2023 13:36:25 +0200 Subject: [PATCH 04/25] Some warning fixes --- unix/xserver/hw/vnc/vncExtInit.h | 4 ++-- unix/xserver/hw/vnc/xvnc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/unix/xserver/hw/vnc/vncExtInit.h b/unix/xserver/hw/vnc/vncExtInit.h index 0b4abfd..c363f19 100644 --- a/unix/xserver/hw/vnc/vncExtInit.h +++ b/unix/xserver/hw/vnc/vncExtInit.h @@ -49,7 +49,7 @@ struct dlp_mimetype_t { char mime[32]; }; -unsigned dlp_num_mimetypes(); +unsigned dlp_num_mimetypes(void); const char *dlp_get_mimetype(const unsigned i); extern int vncInetdSock; @@ -68,7 +68,7 @@ int vncGetSendPrimary(void); void vncUpdateDesktopName(void); void vncAnnounceClipboard(int available); -void vncClearBinaryClipboardData(); +void vncClearBinaryClipboardData(void); void vncSendBinaryClipboardData(const char* mime, const unsigned char *data, const unsigned len); void vncGetBinaryClipboardData(const char *mime, const unsigned char **ptr, diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c index 5dac75c..d2c2b63 100644 --- a/unix/xserver/hw/vnc/xvnc.c +++ b/unix/xserver/hw/vnc/xvnc.c @@ -1475,7 +1475,7 @@ int vncRandRCreateScreenOutputs(int scrIdx, int extraOutputs) /* Creating and modifying modes, used by XserverDesktop and init here */ -int vncRandRCanCreateModes() +int vncRandRCanCreateModes(void) { return 1; } From d04982125a04962ca4a6d9829b0cdad5793db324 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Mon, 16 Jan 2023 15:45:59 +0200 Subject: [PATCH 05/25] Initial DRI3 support --- unix/xserver/hw/vnc/Makefile.am | 9 +- unix/xserver/hw/vnc/Xvnc.man | 9 + unix/xserver/hw/vnc/dri3.c | 284 ++++++++++++++++++++++++++++++++ unix/xserver/hw/vnc/xvnc.c | 45 +++++ unix/xserver120.patch | 11 ++ 5 files changed, 356 insertions(+), 2 deletions(-) create mode 100644 unix/xserver/hw/vnc/dri3.c diff --git a/unix/xserver/hw/vnc/Makefile.am b/unix/xserver/hw/vnc/Makefile.am index 4a4958e..0a2f93d 100644 --- a/unix/xserver/hw/vnc/Makefile.am +++ b/unix/xserver/hw/vnc/Makefile.am @@ -30,10 +30,14 @@ bin_PROGRAMS = Xvnc man1_MANS = Xvnc.man -Xvnc_SOURCES = xvnc.c \ +Xvnc_SOURCES = xvnc.c dri3.c \ $(top_srcdir)/Xi/stubs.c $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/fb/fbcmap_mi.c buildtime.c +if DRI3 +XVNC_SYS_LIBS += -lgbm +endif + # Xvnc contains no C++ sources so automake doesn't understand that we # need to use the C++ compiler to link things. This is the upstream # recommendation for coaxing automake. @@ -44,7 +48,8 @@ Xvnc_CPPFLAGS = $(XVNC_CPPFLAGS) -DKASMVNC -DNO_MODULE_EXTS \ -DXVNCEXTRAVERSION="\".$(KASMVNC_COMMIT_ID)\"" \ -DXFree86Server -DVENDOR_RELEASE="$(VENDOR_RELEASE)" \ -DVENDOR_STRING="\"$(VENDOR_STRING)\"" -I$(KASMVNC_SRCDIR)/common -I$(KASMVNC_SRCDIR)/unix/common \ - -I$(top_srcdir)/include ${XSERVERLIBS_CFLAGS} -I$(includedir) + -I$(top_srcdir)/include ${XSERVERLIBS_CFLAGS} -I$(includedir) \ + -I$(top_srcdir)/dri3 @LIBDRM_CFLAGS@ Xvnc_LDADD = $(XVNC_LIBS) libvnccommon.la $(COMMON_LIBS) \ $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XVNC_SYS_LIBS) -lX11 -lwebp -lssl -lcrypto -lcrypt diff --git a/unix/xserver/hw/vnc/Xvnc.man b/unix/xserver/hw/vnc/Xvnc.man index 16ba11d..a82f8e5 100644 --- a/unix/xserver/hw/vnc/Xvnc.man +++ b/unix/xserver/hw/vnc/Xvnc.man @@ -281,6 +281,15 @@ be either \fB0\fP (off), \fB1\fP (always) or \fB2\fP (auto). Default is \fB2\fP. . .TP +.B \-hw3d +Enable hardware 3d acceleration. Default is software (llvmpipe usually). +. +.TP +.B \-drinode \fIpath\fP +Use another path instead of /dev/dri/renderD128. You may need this if you have +more than one GPU. +. +.TP .B \-ZlibLevel \fIlevel\fP Zlib compression level for ZRLE encoding (it does not affect Tight encoding). Acceptable values are between 0 and 9. Default is to use the standard diff --git a/unix/xserver/hw/vnc/dri3.c b/unix/xserver/hw/vnc/dri3.c new file mode 100644 index 0000000..e758915 --- /dev/null +++ b/unix/xserver/hw/vnc/dri3.c @@ -0,0 +1,284 @@ +/* Copyright (c) 2023 Kasm + +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 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 X CONSORTIUM 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. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#ifdef DRI3 + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +extern const char *driNode; + +static struct priv_t { + struct gbm_device *gbm; + int fd; +} priv; + +struct gbm_pixmap { + struct gbm_bo *bo; +}; + +typedef struct gbm_pixmap gbm_pixmap; + +static DevPrivateKeyRec dri3_pixmap_private_key; +static struct timeval start; + + + +static int +xvnc_dri3_open_client(ClientPtr client, + ScreenPtr screen, + RRProviderPtr provider, + int *pfd) +{ + int fd = open(driNode, O_RDWR | O_CLOEXEC); + if (fd < 0) + return BadAlloc; + *pfd = fd; + return Success; +} + +static uint32_t +gbm_format_for_depth(CARD8 depth) +{ + switch (depth) { + case 16: + return GBM_FORMAT_RGB565; + case 24: + return GBM_FORMAT_XRGB8888; + case 30: + return GBM_FORMAT_ARGB2101010; + default: + ErrorF("unexpected depth: %d\n", depth); + /* fallthrough */ + case 32: + return GBM_FORMAT_ARGB8888; + } + +} + +static void dri3_pixmap_set_private(PixmapPtr pixmap, gbm_pixmap *gp) +{ + dixSetPrivate(&pixmap->devPrivates, &dri3_pixmap_private_key, gp); +} + +static gbm_pixmap *gbm_pixmap_get(PixmapPtr pixmap) +{ + return dixLookupPrivate(&pixmap->devPrivates, &dri3_pixmap_private_key); +} + +static PixmapPtr +create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo, CARD8 depth) +{ + PixmapPtr pixmap; + + gbm_pixmap *gp = calloc(1, sizeof(gbm_pixmap)); + if (!gp) + return NULL; + + pixmap = screen->CreatePixmap(screen, gbm_bo_get_width(bo), gbm_bo_get_height(bo), + depth, CREATE_PIXMAP_USAGE_SCRATCH); + if (!pixmap) + return NULL; + + gp->bo = bo; + dri3_pixmap_set_private(pixmap, gp); + + return pixmap; +} + +static PixmapPtr +xvnc_pixmap_from_fds(ScreenPtr screen, CARD8 num_fds, const int *fds, + CARD16 width, CARD16 height, + const CARD32 *strides, const CARD32 *offsets, + CARD8 depth, CARD8 bpp, uint64_t modifier) +{ + struct gbm_bo *bo = NULL; + PixmapPtr pixmap; + + if (width == 0 || height == 0 || num_fds == 0 || + depth < 15 || bpp != BitsPerPixel(depth) || + strides[0] < width * bpp / 8) + return NULL; + + if (num_fds == 1) { + struct gbm_import_fd_data data; + + data.fd = fds[0]; + data.width = width; + data.height = height; + data.stride = strides[0]; + data.format = gbm_format_for_depth(depth); + bo = gbm_bo_import(priv.gbm, GBM_BO_IMPORT_FD, &data, + GBM_BO_USE_RENDERING); + if (!bo) + return NULL; + } else { + return NULL; + } + + pixmap = create_pixmap_for_bo(screen, bo, depth); + if (pixmap == NULL) { + gbm_bo_destroy(bo); + return NULL; + } + + return pixmap; +} + +static int +xvnc_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, + uint32_t *strides, uint32_t *offsets, + uint64_t *modifier) +{ + gbm_pixmap *gp = gbm_pixmap_get(pixmap); + if (!gp) + return 0; + + fds[0] = gbm_bo_get_fd(gp->bo); + strides[0] = gbm_bo_get_stride(gp->bo); + offsets[0] = 0; + *modifier = DRM_FORMAT_MOD_INVALID; + + return 1; +} + +static Bool +xvnc_get_formats(ScreenPtr screen, + CARD32 *num_formats, CARD32 **formats) +{ + ErrorF("xvnc_get_formats\n"); + return FALSE; +} + +static Bool +xvnc_get_modifiers(ScreenPtr screen, uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers) +{ + ErrorF("xvnc_get_modifiers\n"); + return FALSE; +} + +static Bool +xvnc_get_drawable_modifiers(DrawablePtr draw, uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers) +{ + ErrorF("xvnc_get_drawable_modifiers\n"); + return FALSE; +} + +static const dri3_screen_info_rec xvnc_dri3_info = { + .version = 2, + .open = NULL, + .pixmap_from_fds = xvnc_pixmap_from_fds, + .fds_from_pixmap = xvnc_fds_from_pixmap, + .open_client = xvnc_dri3_open_client, + .get_formats = xvnc_get_formats, + .get_modifiers = xvnc_get_modifiers, + .get_drawable_modifiers = xvnc_get_drawable_modifiers, +}; + +void xvnc_sync_dri3_pixmap(PixmapPtr pixmap) +{ + // There doesn't seem to be a good hook or sync point, so we do it manually + // here, right before Present copies from the pixmap + DrawablePtr pDraw; + GCPtr gc; + void *ptr; + uint32_t stride, w, h; + void *opaque = NULL; + gbm_pixmap *gp = gbm_pixmap_get(pixmap); + if (!gp) { + ErrorF("Present tried to copy from a non-dri3 pixmap\n"); + return; + } + + w = gbm_bo_get_width(gp->bo); + h = gbm_bo_get_height(gp->bo); + + ptr = gbm_bo_map(gp->bo, 0, 0, w, h, + GBM_BO_TRANSFER_READ, &stride, &opaque); + if (!ptr) { + ErrorF("gbm map failed, errno %d\n", errno); + return; + } + + pDraw = &pixmap->drawable; + if ((gc = GetScratchGC(pDraw->depth, pDraw->pScreen))) { + ValidateGC(pDraw, gc); + //gc->ops->PutImage(pDraw, gc, pDraw->depth, 0, 0, w, h, 0, ZPixmap, data); + fbPutZImage(pDraw, fbGetCompositeClip(gc), gc->alu, fbGetGCPrivate(gc)->pm, + 0, 0, w, h, ptr, stride / sizeof(FbStip)); + FreeScratchGC(gc); + } + + gbm_bo_unmap(gp->bo, opaque); +} + +void xvnc_init_dri3(void) +{ + memset(&priv, 0, sizeof(priv)); + + gettimeofday(&start, NULL); + + if (!dixRegisterPrivateKey(&dri3_pixmap_private_key, PRIVATE_PIXMAP, 0)) + FatalError("dix\n"); + + if (!driNode) + driNode = "/dev/dri/renderD128"; + + priv.fd = open(driNode, O_RDWR | O_CLOEXEC); + if (!priv.fd) + FatalError("Failed to open %s\n", driNode); + + priv.gbm = gbm_create_device(priv.fd); + if (!priv.gbm) + FatalError("Failed to create gbm\n"); + + if (!dri3_screen_init(screenInfo.screens[0], &xvnc_dri3_info)) + FatalError("Couldn't init dri3\n"); +} + +#endif // DRI3 diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c index d2c2b63..89cf387 100644 --- a/unix/xserver/hw/vnc/xvnc.c +++ b/unix/xserver/hw/vnc/xvnc.c @@ -72,6 +72,12 @@ from the X Consortium. #include #include #endif /* HAS_SHM */ +#ifdef MITSHM +#include "shmint.h" +#endif +#ifdef HAVE_XSHMFENCE +#include +#endif #include "dix.h" #include "os.h" #include "miline.h" @@ -149,6 +155,8 @@ typedef enum { NORMAL_MEMORY_FB, SHARED_MEMORY_FB } fbMemType; static fbMemType fbmemtype = NORMAL_MEMORY_FB; static int lastScreen = -1; static Bool Render = TRUE; +static Bool hw3d = FALSE; +const char *driNode = NULL; static Bool displaySpecified = FALSE; static char displayNumStr[16]; @@ -350,6 +358,8 @@ void ddxUseMsg(void) ErrorF("+/-render turn on/off RENDER extension support" "(default on)\n"); #endif + ErrorF("-hw3d enable hardware 3d acceleration\n"); + ErrorF("-drinode path use another card than /dev/dri/renderD128\n"); ErrorF("-linebias n adjust thin line pixelization\n"); ErrorF("-blackpixel n pixel value for black\n"); ErrorF("-whitepixel n pixel value for white\n"); @@ -482,6 +492,20 @@ ddxProcessArgument(int argc, char *argv[], int i) return 1; } + if (strcmp (argv[i], "-hw3d") == 0) + { + hw3d = TRUE; + return 1; + } + + if (strcmp (argv[i], "-drinode") == 0) + { + fail_unless_args(argc, i, 1); + ++i; + driNode = argv[i]; + return 2; + } + if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */ { Pixel pix; @@ -1684,6 +1708,15 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) ret = fbPictureInit (pScreen, 0, 0); #endif +#ifdef MITSHM + ShmRegisterFbFuncs(pScreen); +#endif + +#ifdef HAVE_XSHMFENCE + if (!miSyncShmScreenInit(pScreen)) + return FALSE; +#endif + if (!ret) return FALSE; #if XORG < 110 @@ -1796,6 +1829,10 @@ static ExtensionModule glxExt = { #endif #endif +#ifdef DRI3 +extern void xvnc_init_dri3(void); +#endif + void InitOutput(ScreenInfo *scrInfo, int argc, char **argv) { @@ -1872,6 +1909,14 @@ InitOutput(ScreenInfo *scrInfo, int argc, char **argv) if (!AddCallback(&ClientStateCallback, vfbClientStateChange, 0)) { FatalError("AddCallback failed\n"); } + + if (hw3d) { +#ifdef DRI3 + xvnc_init_dri3(); +#else + FatalError("DRI3 disabled at compile time\n"); +#endif + } } /* end InitOutput */ /* this is just to get the server to link on AIX */ diff --git a/unix/xserver120.patch b/unix/xserver120.patch index 237e1e3..d4fcb77 100644 --- a/unix/xserver120.patch +++ b/unix/xserver120.patch @@ -80,3 +80,14 @@ Index: xserver/mi/miinitext.c {GEExtensionInit, "Generic Event Extension", &noGEExtension}, {ShapeExtensionInit, "SHAPE", NULL}, #ifdef MITSHM +--- xserver.orig/dri3/Makefile.am 2019-02-26 21:28:50.000000000 +0200 ++++ xserver/dri3/Makefile.am 2023-01-18 11:55:45.315851638 +0200 +@@ -1,7 +1,7 @@ + noinst_LTLIBRARIES = libdri3.la + AM_CFLAGS = \ + -DHAVE_XORG_CONFIG_H \ +- @DIX_CFLAGS@ @XORG_CFLAGS@ ++ @DIX_CFLAGS@ @XORG_CFLAGS@ @LIBDRM_CFLAGS@ + + libdri3_la_SOURCES = \ + dri3.h \ From 38ac84149008c715ef4c0717fe169a40539e7b13 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Fri, 20 Jan 2023 13:23:54 +0200 Subject: [PATCH 06/25] Update xserver120.patch with present change --- unix/xserver120.patch | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/unix/xserver120.patch b/unix/xserver120.patch index d4fcb77..bd9f3ea 100644 --- a/unix/xserver120.patch +++ b/unix/xserver120.patch @@ -91,3 +91,23 @@ Index: xserver/mi/miinitext.c libdri3_la_SOURCES = \ dri3.h \ +--- xserver.orig/present/present.c 2019-02-26 21:28:50.000000000 +0200 ++++ xserver/present/present.c 2023-01-20 11:32:27.175493594 +0200 +@@ -27,6 +27,8 @@ + #include "present_priv.h" + #include + ++void xvnc_sync_dri3_pixmap(PixmapPtr pixmap); ++ + /* + * Returns: + * TRUE if the first MSC value is equal to or after the second one +@@ -79,6 +81,8 @@ + ScreenPtr screen = drawable->pScreen; + GCPtr gc; + ++ xvnc_sync_dri3_pixmap(pixmap); ++ + gc = GetScratchGC(drawable->depth, screen); + if (update) { + ChangeGCVal changes[2]; From 9f5fbae24422b6434d00f741bef27eb7a3c2e98c Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Fri, 20 Jan 2023 13:28:07 +0200 Subject: [PATCH 07/25] Enable dri3 in builder --- builder/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/build.sh b/builder/build.sh index 52d80c0..4198078 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -100,7 +100,7 @@ fi --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \ --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \ --disable-config-hal --disable-config-udev \ - --disable-dri2 --enable-glx --disable-xwayland --disable-dri3 + --disable-dri2 --enable-glx --disable-xwayland make -j5 # modifications for the servertarball From a2d2e48bd41ae0c09e64f5988300d8bf47887399 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Fri, 27 Jan 2023 08:18:39 +0200 Subject: [PATCH 08/25] Debian changes from Matt --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 55bba16..fb506b4 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: x11 Priority: optional Maintainer: Kasm Technologies LLC Build-Depends: debhelper (>= 11), rsync, libjpeg-dev, libjpeg-dev, libpng-dev, - libtiff-dev, libgif-dev, libavcodec-dev, libssl-dev, libgl1, libxfont2, libsm6, libxext-dev, libxrandr-dev, libxtst-dev, libxcursor-dev, libunwind8 + libtiff-dev, libgif-dev, libavcodec-dev, libssl-dev, libgl1, libxfont2, libsm6, libxext-dev, libxrandr-dev, libxtst-dev, libxcursor-dev, libunwind8, libgbm-dev Standards-Version: 4.1.3 Homepage: https://github.com/kasmtech/KasmVNC #Vcs-Browser: https://salsa.debian.org/debian/kasmvnc @@ -14,7 +14,7 @@ Architecture: amd64 arm64 Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, ssl-cert, xauth, x11-xkb-utils, xkb-data, procps, libswitch-perl, libyaml-tiny-perl, libhash-merge-simple-perl, libscalar-list-utils-perl, liblist-moreutils-perl, - libtry-tiny-perl + libtry-tiny-perl, libgbm1 Provides: vnc-server Description: KasmVNC provides remote web-based access to a Desktop or application. While VNC is in the name, KasmVNC differs from other VNC variants such From 22ec1c6dbdbabdb233a9434e37776c93285e527d Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Thu, 16 Feb 2023 16:01:11 -0800 Subject: [PATCH 09/25] KASM-4038 add yaml config options for new CLI params --- spec/fixtures/defaults_config.yaml | 3 +++ unix/vncserver | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/spec/fixtures/defaults_config.yaml b/spec/fixtures/defaults_config.yaml index 71b57fe..992c51e 100644 --- a/spec/fixtures/defaults_config.yaml +++ b/spec/fixtures/defaults_config.yaml @@ -4,6 +4,9 @@ desktop: height: 768 allow_resize: true pixel_depth: 24 + gpu: + hw3d: false + drinode: /dev/dri/renderD128 network: protocol: http diff --git a/unix/vncserver b/unix/vncserver index cae50ac..c4e3b7d 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -2242,6 +2242,24 @@ sub DefineConfigToCLIConversion { isPresent($value) && $value ne 'auto'; } }), + KasmVNC::CliOption->new({ + name => 'hw3d', + configKeys => [ + KasmVNC::ConfigKey->new({ + name => "desktop.gpu.hw3d", + type => KasmVNC::ConfigKey::BOOLEAN + }) + ] + }), + KasmVNC::CliOption->new({ + name => 'drinode', + configKeys => [ + KasmVNC::ConfigKey->new({ + name => "desktop.gpu.drinode", + type => KasmVNC::ConfigKey::ANY + }) + ] + }), ); %cliArgMap = map { ("-" . $_->{name}) => $_ } @xvncOptions; From cdf21ea6fd021368f4c303643ba9930a768b230f Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Thu, 16 Feb 2023 18:48:42 -0800 Subject: [PATCH 10/25] KASM-4038 fix yaml processor to now pass a bool value for hw3d --- unix/kasmvnc_defaults.yaml | 3 +++ unix/vncserver | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/unix/kasmvnc_defaults.yaml b/unix/kasmvnc_defaults.yaml index a4997e2..f086178 100644 --- a/unix/kasmvnc_defaults.yaml +++ b/unix/kasmvnc_defaults.yaml @@ -5,6 +5,9 @@ desktop: height: 768 allow_resize: true pixel_depth: 24 + gpu: + hw3d: false + drinode: /dev/dri/renderD128 network: protocol: http diff --git a/unix/vncserver b/unix/vncserver index c4e3b7d..0fcbdb3 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -2249,7 +2249,22 @@ sub DefineConfigToCLIConversion { name => "desktop.gpu.hw3d", type => KasmVNC::ConfigKey::BOOLEAN }) - ] + ], + toStringSub => sub { + $self = shift; + my $value = $self->configValue(); + + switch($value) { + case 'true' { + $valuesStr = '-hw3d '; + } + case 'false' { + $valuesStr = ' '; + } + } + + return $valuesStr; + } }), KasmVNC::CliOption->new({ name => 'drinode', From bbfbcc5af86d8c741f219db6a06955c7d7799238 Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Thu, 23 Feb 2023 12:27:41 -0800 Subject: [PATCH 11/25] KASM-4038 add current options in readme and add note to changelog --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cec0a57..2be7842 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,9 @@ desktop: height: 768 allow_resize: true pixel_depth: 24 + gpu: + hw3d: false + drinode: /dev/dri/renderD128 network: protocol: http @@ -255,6 +258,7 @@ command_line: - Cursor lock - IME support for languages with extended characters - Better mobile support + - DRI3 GPU acceleration with open source drivers (AMDGPU,Intel,ATI,ARM) Future Goals: From 1b7ebc2a966153f552c9f45960a5f6c12f511118 Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Fri, 24 Feb 2023 07:21:51 -0800 Subject: [PATCH 12/25] KASM-4038 update var to be inside scope instead of global --- unix/vncserver | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/vncserver b/unix/vncserver index 0fcbdb3..e0cf9b8 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -2256,10 +2256,10 @@ sub DefineConfigToCLIConversion { switch($value) { case 'true' { - $valuesStr = '-hw3d '; + my $valuesStr = '-hw3d '; } case 'false' { - $valuesStr = ' '; + my $valuesStr = ' '; } } From 60cfd52bcfc1f0b26adb0cbca192b9ec7be9fca1 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Tue, 28 Feb 2023 23:31:00 +1300 Subject: [PATCH 13/25] Refactor --- unix/vncserver | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/unix/vncserver b/unix/vncserver index e0cf9b8..0984458 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -1979,7 +1979,7 @@ sub DefineConfigToCLIConversion { $self = shift; my @values = @{ listify($self->configValues()) }; - + my $valuesStr = ""; foreach $value (@values) { $valuesStr = $valuesStr . "-http-header '$value' " @@ -2250,20 +2250,13 @@ sub DefineConfigToCLIConversion { type => KasmVNC::ConfigKey::BOOLEAN }) ], - toStringSub => sub { - $self = shift; - my $value = $self->configValue(); + deriveValueSub => sub { + undef; + }, + isActiveSub => sub { + my $self = shift; - switch($value) { - case 'true' { - my $valuesStr = '-hw3d '; - } - case 'false' { - my $valuesStr = ' '; - } - } - - return $valuesStr; + $self->configValue() eq 'true'; } }), KasmVNC::CliOption->new({ From 099211c281e506d6409ba38b21a90ddcfeafdd59 Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Thu, 2 Mar 2023 11:44:47 -0800 Subject: [PATCH 14/25] KASM-3806 fix builds and deps for oracle and opensuse --- builder/build.sh | 34 +++++++++++++------- builder/dockerfile.opensuse_15.build | 2 ++ builder/dockerfile.oracle_8.build | 46 +++++++++++++++------------- opensuse/kasmvncserver.spec | 2 +- oracle/kasmvncserver.spec | 2 +- 5 files changed, 52 insertions(+), 34 deletions(-) diff --git a/builder/build.sh b/builder/build.sh index 4198078..ad16d0a 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -89,18 +89,30 @@ ensure_crashpad_can_fetch_line_number_by_address if [ "${KASMVNC_BUILD_OS}" == "opensuse" ]; then sed -i 's/LIBGL="gl >= 7.1.0"/LIBGL="gl >= 1.1"/g' configure fi -./configure --prefix=/opt/kasmweb \ - --with-xkb-path=/usr/share/X11/xkb \ - --with-xkb-output=/var/lib/xkb \ - --with-xkb-bin-directory=/usr/bin \ - --with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \ - --with-sha1=libcrypto \ - --without-dtrace --disable-dri \ +./configure \ + --disable-config-hal \ + --disable-config-udev \ + --disable-dmx \ + --disable-dri \ + --disable-dri2 \ + --disable-kdrive \ --disable-static \ - --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \ - --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \ - --disable-config-hal --disable-config-udev \ - --disable-dri2 --enable-glx --disable-xwayland + --disable-xephyr \ + --disable-xinerama \ + --disable-xnest \ + --disable-xorg \ + --disable-xvfb \ + --disable-xwayland \ + --disable-xwin \ + --enable-dri3 \ + --enable-glx \ + --prefix=/opt/kasmweb \ + --with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \ + --without-dtrace \ + --with-sha1=libcrypto \ + --with-xkb-bin-directory=/usr/bin \ + --with-xkb-output=/var/lib/xkb \ + --with-xkb-path=/usr/share/X11/xkb make -j5 # modifications for the servertarball diff --git a/builder/dockerfile.opensuse_15.build b/builder/dockerfile.opensuse_15.build index b3d5e56..6576dc8 100644 --- a/builder/dockerfile.opensuse_15.build +++ b/builder/dockerfile.opensuse_15.build @@ -19,6 +19,7 @@ RUN zypper install -ny \ gzip \ lbzip2 \ libbz2-devel \ + libgbm-devel \ libGLw-devel \ libgnutls-devel \ libjpeg8-devel \ @@ -27,6 +28,7 @@ RUN zypper install -ny \ libtiff-devel \ libXfont2-devel \ libxkbcommon-x11-devel \ + libxshmfence-devel \ make \ Mesa-dri \ Mesa-libglapi-devel \ diff --git a/builder/dockerfile.oracle_8.build b/builder/dockerfile.oracle_8.build index 60fc801..a0527d3 100644 --- a/builder/dockerfile.oracle_8.build +++ b/builder/dockerfile.oracle_8.build @@ -5,27 +5,31 @@ ENV KASMVNC_BUILD_OS_CODENAME 8 ENV XORG_VER 1.20.10 # Install from stock repos -RUN dnf install -y \ - bzip2-devel \ - ca-certificates \ - cmake \ - dnf-plugins-core \ - gcc \ - gcc-c++ \ - git \ - gnutls-devel \ - libjpeg-turbo-devel \ - libpng-devel \ - libtiff-devel \ - make \ - mesa-dri-drivers \ - openssl-devel \ - openssl-devel \ - patch \ - tigervnc-server \ - wget \ - xorg-x11-font-utils \ - zlib-devel +RUN \ + dnf install -y 'dnf-command(config-manager)' && \ + dnf config-manager --set-enabled ol8_codeready_builder && \ + dnf install -y \ + bzip2-devel \ + ca-certificates \ + cmake \ + dnf-plugins-core \ + gcc \ + gcc-c++ \ + git \ + gnutls-devel \ + libjpeg-turbo-devel \ + libpng-devel \ + libtiff-devel \ + libxshmfence-devel \ + make \ + mesa-dri-drivers \ + mesa-libgbm-devel \ + openssl-devel \ + patch \ + tigervnc-server \ + wget \ + xorg-x11-font-utils \ + zlib-devel # Enable additional repos (epel, powertools, and fusion) RUN dnf config-manager --set-enabled ol8_codeready_builder diff --git a/opensuse/kasmvncserver.spec b/opensuse/kasmvncserver.spec index 97bcaac..871753f 100644 --- a/opensuse/kasmvncserver.spec +++ b/opensuse/kasmvncserver.spec @@ -7,7 +7,7 @@ License: GPLv2+ URL: https://github.com/kasmtech/KasmVNC BuildRequires: rsync -Requires: xauth, hostname, libxkbcommon-x11-0, xkeyboard-config, x11-tools, openssl, perl, libpixman-1-0, libjpeg8, libgomp1, libXfont2-2, libXdmcp6, libglvnd, xkbcomp, perl-Switch, perl-YAML-Tiny, perl-Hash-Merge-Simple, perl-Scalar-List-Utils, perl-List-MoreUtils, perl-Try-Tiny +Requires: xauth, hostname, libxkbcommon-x11-0, xkeyboard-config, x11-tools, openssl, perl, libpixman-1-0, libjpeg8, libgomp1, libXfont2-2, libXdmcp6, libglvnd, xkbcomp, perl-Switch, perl-YAML-Tiny, perl-Hash-Merge-Simple, perl-Scalar-List-Utils, perl-List-MoreUtils, perl-Try-Tiny, libgbm1, libxshmfence1 Conflicts: tigervnc, tigervnc-x11vnc %description diff --git a/oracle/kasmvncserver.spec b/oracle/kasmvncserver.spec index ac8484b..f4eb7e9 100644 --- a/oracle/kasmvncserver.spec +++ b/oracle/kasmvncserver.spec @@ -7,7 +7,7 @@ License: GPLv2+ URL: https://github.com/kasmtech/KasmVNC BuildRequires: rsync -Requires: xorg-x11-xauth, xorg-x11-xkb-utils, xkeyboard-config, xorg-x11-server-utils, openssl, perl, perl-Switch, perl-YAML-Tiny, perl-Hash-Merge-Simple, perl-Scalar-List-Utils, perl-List-MoreUtils, perl-Try-Tiny, hostname +Requires: xorg-x11-xauth, xorg-x11-xkb-utils, xkeyboard-config, xorg-x11-server-utils, openssl, perl, perl-Switch, perl-YAML-Tiny, perl-Hash-Merge-Simple, perl-Scalar-List-Utils, perl-List-MoreUtils, perl-Try-Tiny, hostname, mesa-libgbm, libxshmfence Conflicts: tigervnc-server, tigervnc-server-minimal %description From d1492bd0c06b352be8e6696fb5902cd7558a2c7e Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Thu, 2 Mar 2023 12:00:16 -0800 Subject: [PATCH 15/25] KASM-3806 update fedora build logic for dri3 --- builder/dockerfile.fedora_thirtyseven.build | 1 + fedora/kasmvncserver.spec | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/builder/dockerfile.fedora_thirtyseven.build b/builder/dockerfile.fedora_thirtyseven.build index b83db05..489c33e 100644 --- a/builder/dockerfile.fedora_thirtyseven.build +++ b/builder/dockerfile.fedora_thirtyseven.build @@ -34,6 +34,7 @@ RUN \ libxshmfence-devel \ libXtst-devel \ mesa-libEGL-devel \ + mesa-libgbm-devel \ mesa-libGL-devel \ meson \ nettle-devel \ diff --git a/fedora/kasmvncserver.spec b/fedora/kasmvncserver.spec index 412cbf4..92f76a1 100644 --- a/fedora/kasmvncserver.spec +++ b/fedora/kasmvncserver.spec @@ -7,7 +7,7 @@ License: GPLv2+ URL: https://github.com/kasmtech/KasmVNC BuildRequires: rsync -Requires: xorg-x11-xauth, xkeyboard-config, openssl, perl, perl-Switch, perl-YAML-Tiny, perl-Hash-Merge-Simple, perl-Scalar-List-Utils, perl-List-MoreUtils, perl-Try-Tiny +Requires: xorg-x11-xauth, xkeyboard-config, openssl, perl, perl-Switch, perl-YAML-Tiny, perl-Hash-Merge-Simple, perl-Scalar-List-Utils, perl-List-MoreUtils, perl-Try-Tiny, mesa-libgbm, libxshmfence Conflicts: tigervnc-server, tigervnc-server-minimal %description From ea7568b240ea2f50edfca3538d459ea2c962fde5 Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Thu, 2 Mar 2023 12:29:03 -0800 Subject: [PATCH 16/25] KASM-3806 centos 7 is too old to build dri3 --- builder/build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builder/build.sh b/builder/build.sh index 86965d0..60539f5 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -85,6 +85,10 @@ autoreconf -i # everything after that is based on BUILDING.txt to remove unneeded # components. ensure_crashpad_can_fetch_line_number_by_address +# Centos7 is too old for dri3 +if [ ! "${KASMVNC_BUILD_OS}" == "centos" ]; then + CONFIG_OPTIONS="--enable-dri3" +fi # remove gl check for opensuse if [ "${KASMVNC_BUILD_OS}" == "opensuse" ]; then sed -i 's/LIBGL="gl >= 7.1.0"/LIBGL="gl >= 1.1"/g' configure @@ -104,7 +108,6 @@ fi --disable-xvfb \ --disable-xwayland \ --disable-xwin \ - --enable-dri3 \ --enable-glx \ --prefix=/opt/kasmweb \ --with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \ @@ -112,7 +115,7 @@ fi --with-sha1=libcrypto \ --with-xkb-bin-directory=/usr/bin \ --with-xkb-output=/var/lib/xkb \ - --with-xkb-path=/usr/share/X11/xkb + --with-xkb-path=/usr/share/X11/xkb ${CONFIG_OPTIONS} # remove array bounds errors for new versions of GCC find . -name "Makefile" -exec sed -i 's/-Werror=array-bounds//g' {} \; make -j5 From ee10b81eef3f0bb21c02f4052d53f48e44ea52cc Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Thu, 2 Mar 2023 13:06:29 -0800 Subject: [PATCH 17/25] KASM-3806 revert yaml changes to working ones --- unix/vncserver | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/unix/vncserver b/unix/vncserver index 0984458..b5301a4 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -2250,13 +2250,20 @@ sub DefineConfigToCLIConversion { type => KasmVNC::ConfigKey::BOOLEAN }) ], - deriveValueSub => sub { - undef; - }, - isActiveSub => sub { - my $self = shift; + toStringSub => sub { + $self = shift; + my $value = $self->configValue(); - $self->configValue() eq 'true'; + switch($value) { + case 'true' { + $valuesStr = '-hw3d '; + } + case 'false' { + $valuesStr = ' '; + } + } + + return $valuesStr; } }), KasmVNC::CliOption->new({ From d15492fa328e6cd974e9e78f11ab1fb03dcd9a7e Mon Sep 17 00:00:00 2001 From: mattmcclaskey Date: Fri, 3 Mar 2023 06:53:36 -0500 Subject: [PATCH 18/25] add missing dependency for oracle 9 --- builder/dockerfile.oracle_9.build | 1 + 1 file changed, 1 insertion(+) diff --git a/builder/dockerfile.oracle_9.build b/builder/dockerfile.oracle_9.build index a7bc22d..1ffffe1 100644 --- a/builder/dockerfile.oracle_9.build +++ b/builder/dockerfile.oracle_9.build @@ -18,6 +18,7 @@ RUN dnf install -y \ libjpeg-turbo-devel \ libpng-devel \ libtiff-devel \ + libxshmfence-devel \ make \ mesa-dri-drivers \ mesa-libGL-devel \ From 13458a0a8886a77552273402a741951ce87eff6c Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Fri, 3 Mar 2023 09:36:53 -0800 Subject: [PATCH 19/25] KASM-3806 update deps for oracle 9 --- builder/dockerfile.oracle_9.build | 52 ++++++++++++++++--------------- oracle/kasmvncserver9.spec | 2 +- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/builder/dockerfile.oracle_9.build b/builder/dockerfile.oracle_9.build index 1ffffe1..9c3c544 100644 --- a/builder/dockerfile.oracle_9.build +++ b/builder/dockerfile.oracle_9.build @@ -5,33 +5,35 @@ ENV KASMVNC_BUILD_OS_CODENAME 9 ENV XORG_VER 1.20.10 # Install from stock repos -RUN dnf config-manager --set-enabled ol9_distro_builder -RUN dnf install -y \ - bzip2-devel \ - ca-certificates \ - cmake \ - dnf-plugins-core \ - gcc \ - gcc-c++ \ - git \ - gnutls-devel \ - libjpeg-turbo-devel \ - libpng-devel \ - libtiff-devel \ - libxshmfence-devel \ - make \ - mesa-dri-drivers \ - mesa-libGL-devel \ - openssl-devel \ - openssl-devel \ - patch \ - tigervnc-server \ - wget \ - xorg-x11-font-utils \ - zlib-devel +RUN \ + dnf config-manager --set-enabled ol9_codeready_builder && \ + dnf config-manager --set-enabled ol9_distro_builder && \ + dnf install -y \ + bzip2-devel \ + ca-certificates \ + cmake \ + dnf-plugins-core \ + gcc \ + gcc-c++ \ + git \ + gnutls-devel \ + libjpeg-turbo-devel \ + libpng-devel \ + libtiff-devel \ + libxshmfence-devel \ + make \ + mesa-dri-drivers \ + mesa-libGL-devel \ + mesa-libgbm-devel \ + openssl-devel \ + openssl-devel \ + patch \ + tigervnc-server \ + wget \ + xorg-x11-font-utils \ + zlib-devel # Enable additional repos (epel, powertools, and fusion) -RUN dnf config-manager --set-enabled ol9_codeready_builder RUN dnf install -y oracle-epel-release-el9 RUN dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm diff --git a/oracle/kasmvncserver9.spec b/oracle/kasmvncserver9.spec index a74285e..64e6beb 100644 --- a/oracle/kasmvncserver9.spec +++ b/oracle/kasmvncserver9.spec @@ -7,7 +7,7 @@ License: GPLv2+ URL: https://github.com/kasmtech/KasmVNC BuildRequires: rsync -Requires: xorg-x11-xauth, xkeyboard-config, xorg-x11-server-utils, openssl, perl, perl-Switch, perl-YAML-Tiny, perl-Hash-Merge-Simple, perl-Scalar-List-Utils, perl-List-MoreUtils, perl-Try-Tiny, hostname +Requires: xorg-x11-xauth, xkeyboard-config, xorg-x11-server-utils, openssl, perl, perl-Switch, perl-YAML-Tiny, perl-Hash-Merge-Simple, perl-Scalar-List-Utils, perl-List-MoreUtils, perl-Try-Tiny, hostname, mesa-libgbm, libxshmfence Conflicts: tigervnc-server, tigervnc-server-minimal %description From e77d6693b3dd09854b2de0e313f04f1c46306a6d Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Fri, 3 Mar 2023 09:57:42 -0800 Subject: [PATCH 20/25] KASM-3806 cross deps from ol9 epel --- builder/dockerfile.oracle_9.build | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/builder/dockerfile.oracle_9.build b/builder/dockerfile.oracle_9.build index 9c3c544..2be9e40 100644 --- a/builder/dockerfile.oracle_9.build +++ b/builder/dockerfile.oracle_9.build @@ -8,6 +8,7 @@ ENV XORG_VER 1.20.10 RUN \ dnf config-manager --set-enabled ol9_codeready_builder && \ dnf config-manager --set-enabled ol9_distro_builder && \ + dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm && \ dnf install -y \ bzip2-devel \ ca-certificates \ @@ -15,40 +16,33 @@ RUN \ dnf-plugins-core \ gcc \ gcc-c++ \ + giflib-devel \ git \ gnutls-devel \ + lbzip2 \ libjpeg-turbo-devel \ libpng-devel \ libtiff-devel \ + libXcursor-devel \ + libXfont2-devel \ + libxkbfile-devel \ + libXrandr-devel \ libxshmfence-devel \ + libXtst-devel \ make \ mesa-dri-drivers \ - mesa-libGL-devel \ mesa-libgbm-devel \ + mesa-libGL-devel \ openssl-devel \ openssl-devel \ patch \ tigervnc-server \ wget \ xorg-x11-font-utils \ + xorg-x11-server-devel \ + xorg-x11-xtrans-devel \ zlib-devel -# Enable additional repos (epel, powertools, and fusion) -RUN dnf install -y oracle-epel-release-el9 -RUN dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm - -# Install from new repos -RUN dnf install -y \ - giflib-devel \ - lbzip2 \ - libXfont2-devel \ - libxkbfile-devel \ - xorg-x11-server-devel \ - xorg-x11-xtrans-devel \ - libXrandr-devel \ - libXtst-devel \ - libXcursor-devel - # Additions for webp RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz RUN cd /tmp && tar -xzf /tmp/libwebp-* From 90fd90b948e0f2bbe5d291a49aa5368a2be1648e Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Fri, 3 Mar 2023 10:09:03 -0800 Subject: [PATCH 21/25] KASM-3806 revert changes for build issue --- builder/dockerfile.oracle_9.build | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/builder/dockerfile.oracle_9.build b/builder/dockerfile.oracle_9.build index 2be9e40..9c3c544 100644 --- a/builder/dockerfile.oracle_9.build +++ b/builder/dockerfile.oracle_9.build @@ -8,7 +8,6 @@ ENV XORG_VER 1.20.10 RUN \ dnf config-manager --set-enabled ol9_codeready_builder && \ dnf config-manager --set-enabled ol9_distro_builder && \ - dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm && \ dnf install -y \ bzip2-devel \ ca-certificates \ @@ -16,33 +15,40 @@ RUN \ dnf-plugins-core \ gcc \ gcc-c++ \ - giflib-devel \ git \ gnutls-devel \ - lbzip2 \ libjpeg-turbo-devel \ libpng-devel \ libtiff-devel \ - libXcursor-devel \ - libXfont2-devel \ - libxkbfile-devel \ - libXrandr-devel \ libxshmfence-devel \ - libXtst-devel \ make \ mesa-dri-drivers \ - mesa-libgbm-devel \ mesa-libGL-devel \ + mesa-libgbm-devel \ openssl-devel \ openssl-devel \ patch \ tigervnc-server \ wget \ xorg-x11-font-utils \ - xorg-x11-server-devel \ - xorg-x11-xtrans-devel \ zlib-devel +# Enable additional repos (epel, powertools, and fusion) +RUN dnf install -y oracle-epel-release-el9 +RUN dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm + +# Install from new repos +RUN dnf install -y \ + giflib-devel \ + lbzip2 \ + libXfont2-devel \ + libxkbfile-devel \ + xorg-x11-server-devel \ + xorg-x11-xtrans-devel \ + libXrandr-devel \ + libXtst-devel \ + libXcursor-devel + # Additions for webp RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz RUN cd /tmp && tar -xzf /tmp/libwebp-* From 8b9ef1bc15a22ca85b3d30b2575dbc4b537bef9d Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Sat, 4 Mar 2023 14:16:05 -0800 Subject: [PATCH 22/25] KASM-3806 bump fedora and alpine xorg versions --- builder/build.sh | 8 ++++---- builder/dockerfile.alpine_317.build | 2 +- builder/dockerfile.fedora_thirtyseven.build | 21 +++++++++++++++++++-- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/builder/build.sh b/builder/build.sh index eb92158..b20f7a3 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -47,7 +47,7 @@ cd /tmp # default to the version of x in Ubuntu 18.04, otherwise caller will need to specify XORG_VER=${XORG_VER:-"1.19.6"} XORG_PATCH=$(echo "$XORG_VER" | grep -Po '^\d.\d+' | sed 's#\.##') -wget --no-check-certificate https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.bz2 +wget --no-check-certificate https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.gz #git clone https://kasmweb@bitbucket.org/kasmtech/kasmvnc.git #cd kasmvnc @@ -64,7 +64,7 @@ cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo . -DBUILD_VIEWER:BOOL=OFF \ -DENABLE_GNUTLS:BOOL=OFF make -j5 -tar -C unix/xserver -xf /tmp/xorg-server-${XORG_VER}.tar.bz2 --strip-components=1 +tar -C unix/xserver -xf /tmp/xorg-server-${XORG_VER}.tar.gz --strip-components=1 cd unix/xserver patch -Np1 -i ../xserver${XORG_PATCH}.patch @@ -99,8 +99,8 @@ fi --disable-config-hal \ --disable-config-udev \ --disable-dmx \ - --disable-dri \ - --disable-dri2 \ + --enable-dri \ + --enable-dri2 \ --disable-kdrive \ --disable-static \ --disable-xephyr \ diff --git a/builder/dockerfile.alpine_317.build b/builder/dockerfile.alpine_317.build index 5450db9..6e44049 100644 --- a/builder/dockerfile.alpine_317.build +++ b/builder/dockerfile.alpine_317.build @@ -2,7 +2,7 @@ FROM alpine:3.17 ENV KASMVNC_BUILD_OS alpine ENV KASMVNC_BUILD_OS_CODENAME 317 -ENV XORG_VER 1.20.7 +ENV XORG_VER 1.20.14 RUN \ echo "**** install build deps ****" && \ diff --git a/builder/dockerfile.fedora_thirtyseven.build b/builder/dockerfile.fedora_thirtyseven.build index 489c33e..e3c75b4 100644 --- a/builder/dockerfile.fedora_thirtyseven.build +++ b/builder/dockerfile.fedora_thirtyseven.build @@ -2,22 +2,34 @@ FROM fedora:37 ENV KASMVNC_BUILD_OS fedora ENV KASMVNC_BUILD_OS_CODENAME thirtyseven -ENV XORG_VER 1.20.7 +ENV XORG_VER 1.20.14 RUN \ echo "**** install build deps ****" && \ + dnf group install -y \ + "C Development Tools and Libraries" \ + "Development Tools" && \ dnf install -y \ autoconf \ automake \ + bison \ + byacc \ bzip2 \ cmake \ + diffutils \ + doxygen \ + file \ + flex \ + fop \ gcc \ gcc-c++ \ git \ + glibc-devel \ libdrm-devel \ libepoxy-devel \ libjpeg-turbo-devel \ libjpeg-turbo-static \ + libmd-devel \ libpciaccess-devel \ libtool \ libwebp-devel \ @@ -37,12 +49,15 @@ RUN \ mesa-libgbm-devel \ mesa-libGL-devel \ meson \ + mingw64-binutils \ + mt-st \ nettle-devel \ openssl-devel \ patch \ pixman-devel \ wayland-devel \ wget \ + which \ xcb-util-devel \ xcb-util-image-devel \ xcb-util-keysyms-devel \ @@ -52,11 +67,13 @@ RUN \ xkbcomp \ xkbcomp-devel \ xkeyboard-config \ + xmlto \ xorg-x11-font-utils \ xorg-x11-proto-devel \ xorg-x11-server-common \ xorg-x11-server-devel \ - xorg-x11-xtrans-devel + xorg-x11-xtrans-devel \ + xsltproc RUN useradd -m docker && echo "docker:docker" | chpasswd From 3070de6d106c2164f68feede73336d05e8759abf Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Sat, 4 Mar 2023 15:47:29 -0800 Subject: [PATCH 23/25] KASM-3806 remove panic assert from Fedora and fix Opensuse builds --- builder/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builder/build.sh b/builder/build.sh index b20f7a3..e5d99d0 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -67,6 +67,11 @@ make -j5 tar -C unix/xserver -xf /tmp/xorg-server-${XORG_VER}.tar.gz --strip-components=1 cd unix/xserver +# Remove assertion that breaks stock Fedora +if [ "${KASMVNC_BUILD_OS}" == "fedora" ]; then + sed -i '/assert(key->initialized)/d' include/privates.h +fi +# Apply patches patch -Np1 -i ../xserver${XORG_PATCH}.patch case "$XORG_VER" in 1.20.*) @@ -91,7 +96,7 @@ if [ ! "${KASMVNC_BUILD_OS}" == "centos" ]; then fi # remove gl check for opensuse if [ "${KASMVNC_BUILD_OS}" == "opensuse" ] || ([ "${KASMVNC_BUILD_OS}" == "oracle" ] && [ "${KASMVNC_BUILD_OS_CODENAME}" == 9 ]); then - sed -i 's/LIBGL="gl >= 7.1.0"/LIBGL="gl >= 1.1"/g' configure + sed -i 's/LIBGL="gl >= 9.2.0"/LIBGL="gl >= 1.1"/g' configure fi # build X11 From 178dd8e7ae4af7c0dd8efe07252c5d7971d88b9c Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Sun, 5 Mar 2023 12:13:42 -0800 Subject: [PATCH 24/25] KASM-3806 remove testing logic from MR branch --- builder/build.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/builder/build.sh b/builder/build.sh index e5d99d0..cafdb50 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -67,10 +67,6 @@ make -j5 tar -C unix/xserver -xf /tmp/xorg-server-${XORG_VER}.tar.gz --strip-components=1 cd unix/xserver -# Remove assertion that breaks stock Fedora -if [ "${KASMVNC_BUILD_OS}" == "fedora" ]; then - sed -i '/assert(key->initialized)/d' include/privates.h -fi # Apply patches patch -Np1 -i ../xserver${XORG_PATCH}.patch case "$XORG_VER" in @@ -104,8 +100,8 @@ fi --disable-config-hal \ --disable-config-udev \ --disable-dmx \ - --enable-dri \ - --enable-dri2 \ + --disable-dri \ + --disable-dri2 \ --disable-kdrive \ --disable-static \ --disable-xephyr \ From f0786fa3d41fa9680d35bf23191434215baabf18 Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Sun, 5 Mar 2023 12:30:08 -0800 Subject: [PATCH 25/25] KASM-3806 update OpenSUSE gl version sub --- builder/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/build.sh b/builder/build.sh index cafdb50..9cee060 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -92,7 +92,7 @@ if [ ! "${KASMVNC_BUILD_OS}" == "centos" ]; then fi # remove gl check for opensuse if [ "${KASMVNC_BUILD_OS}" == "opensuse" ] || ([ "${KASMVNC_BUILD_OS}" == "oracle" ] && [ "${KASMVNC_BUILD_OS_CODENAME}" == 9 ]); then - sed -i 's/LIBGL="gl >= 9.2.0"/LIBGL="gl >= 1.1"/g' configure + sed -i 's/LIBGL="gl >= 7.1.0"/LIBGL="gl >= 1.1"/g' configure fi # build X11