diff --git a/meta-oe/recipes-graphics/x11vnc/files/0001-configure.ac-use-pkg-config-to-detect-libdrm.patch b/meta-oe/recipes-graphics/x11vnc/files/0001-configure.ac-use-pkg-config-to-detect-libdrm.patch
new file mode 100644
index 0000000000..44131e5e9d
--- /dev/null
+++ b/meta-oe/recipes-graphics/x11vnc/files/0001-configure.ac-use-pkg-config-to-detect-libdrm.patch
@@ -0,0 +1,45 @@
+From 69d60935e8b8f6880c02168963c99c10963480f1 Mon Sep 17 00:00:00 2001
+From: Leon Anavi <leon.anavi@konsulko.com>
+Date: Wed, 2 Dec 2026 14:23:28 +0200
+Subject: [PATCH] configure.ac: use pkg-config to detect libdrm
+
+Do not hardcode the host include path /usr/include/drm/ in CPPFLAGS.
+The correct include directory for libdrm is ${includedir}/libdrm, which
+is what pkg-config reports, so use PKG_CHECK_MODULES to obtain both the
+cflags and the libs.
+
+Fixes the following issue when cross-compiling caused because the build
+host headers are used instead of these for the the target build:
+
+  C preprocessor "...gcc -E ..." fails sanity check
+
+Upstream-Status: Submitted [https://github.com/LibVNC/x11vnc/pull/297]
+
+Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
+---
+ configure.ac | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2fd443a..2fab01d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -71,12 +71,9 @@ AC_ARG_WITH(drm,
+ if test "x$with_drm" != "xno"; then
+ 	AC_CHECK_FUNCS([drm], HAVE_LIBC_DRM="true")
+ 	if test -z "$HAVE_LIBC_DRM"; then
+-		AC_CHECK_LIB(drm, drmModeGetResources,
+-			DRM_LIBS="-ldrm"
+-			[AC_DEFINE(HAVE_LIBDRM) HAVE_LIBDRM="true"], ,)
+-
+-
+-		CPPFLAGS="$saved_CPPFLAGS -I/usr/include/drm/"
++		PKG_CHECK_MODULES(DRM, [libdrm],
++			[AC_DEFINE(HAVE_LIBDRM) HAVE_LIBDRM="true"
++			CPPFLAGS="$CPPFLAGS $DRM_CFLAGS"], [:])
+ 	fi
+ fi
+ AC_SUBST(DRM_LIBS)
+-- 
+2.53.0
+
diff --git a/meta-oe/recipes-graphics/x11vnc/files/CVE-2020-29074.patch b/meta-oe/recipes-graphics/x11vnc/files/CVE-2020-29074.patch
deleted file mode 100644
index fbdb9123cc..0000000000
--- a/meta-oe/recipes-graphics/x11vnc/files/CVE-2020-29074.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-CVE: CVE-2020-29074
-Upstream-Status: Backport [https://github.com/LibVNC/x11vnc/commit/69eeb9f7baa14ca03b16c9de821f9876def7a36a ]
-Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
-
-
-From 69eeb9f7baa14ca03b16c9de821f9876def7a36a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Gu=C3=A9nal=20DAVALAN?= <guenal.davalan@uca.fr>
-Date: Wed, 18 Nov 2020 08:40:45 +0100
-Subject: [PATCH] scan: limit access to shared memory segments to current user
-
----
- src/scan.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/scan.c b/src/scan.c
-index 43e00d20..12994d52 100644
---- a/src/scan.c
-+++ b/src/scan.c
-@@ -320,7 +320,7 @@ static int shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
- 
- #if HAVE_XSHM
- 	shm->shmid = shmget(IPC_PRIVATE,
--	    xim->bytes_per_line * xim->height, IPC_CREAT | 0777);
-+	    xim->bytes_per_line * xim->height, IPC_CREAT | 0600);
- 
- 	if (shm->shmid == -1) {
- 		rfbErr("shmget(%s) failed.\n", name);
diff --git a/meta-oe/recipes-graphics/x11vnc/x11vnc_0.9.16.bb b/meta-oe/recipes-graphics/x11vnc/x11vnc_0.9.17.bb
similarity index 85%
rename from meta-oe/recipes-graphics/x11vnc/x11vnc_0.9.16.bb
rename to meta-oe/recipes-graphics/x11vnc/x11vnc_0.9.17.bb
index 1493eed7af..64be41ddcc 100644
--- a/meta-oe/recipes-graphics/x11vnc/x11vnc_0.9.16.bb
+++ b/meta-oe/recipes-graphics/x11vnc/x11vnc_0.9.17.bb
@@ -6,12 +6,12 @@ LICENSE = "GPL-2.0-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://src/x11vnc.h;endline=31;md5=e871a2ad004776794b616822dcab6314"
 
-SRCREV = "87cd0530f438372dda3c70bb491a6fd19f09acc2"
+SRCREV = "e2b726a8c0464051afda01648072af6835aaa5f7"
 PV .= "+git"
 
 SRC_URI = "git://github.com/LibVNC/x11vnc;branch=master;protocol=https \
            file://starting-fix.patch \
-           file://CVE-2020-29074.patch \
+           file://0001-configure.ac-use-pkg-config-to-detect-libdrm.patch \
            "
 
 DEPENDS = "\
@@ -28,10 +28,12 @@ inherit pkgconfig autotools features_check
 ANY_OF_DISTRO_FEATURES = "x11 fbdev"
 
 PACKAGECONFIG ??= "\
+	drm \
 	${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
 	${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
 "
 
+PACKAGECONFIG[drm] = "--with-drm,--without-drm,libdrm"
 PACKAGECONFIG[avahi] = "--with-avahi,--without-avahi,avahi"
 PACKAGECONFIG[xinerama] = "--with-xinerama,--without-xinerama,libxinerama"
 PACKAGECONFIG[x11] = "--with-x,--without-x, libxdamage libxext libxfixes libxrandr libxtst virtual/libx11"
