summaryrefslogtreecommitdiff
path: root/x11-drivers
diff options
context:
space:
mode:
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/Makefile21
-rw-r--r--x11-drivers/xf86-input-egalax/Makefile16
-rw-r--r--x11-drivers/xlibre-drivers/Makefile85
-rw-r--r--x11-drivers/xlibre-drivers/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-input-elographics/Makefile18
-rw-r--r--x11-drivers/xlibre-xf86-input-elographics/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-elographics/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-input-elographics/pkg-plist2
-rw-r--r--x11-drivers/xlibre-xf86-input-evdev/Makefile23
-rw-r--r--x11-drivers/xlibre-xf86-input-evdev/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-evdev/pkg-descr3
-rw-r--r--x11-drivers/xlibre-xf86-input-evdev/pkg-plist5
-rw-r--r--x11-drivers/xlibre-xf86-input-joystick/Makefile19
-rw-r--r--x11-drivers/xlibre-xf86-input-joystick/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-joystick/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-input-joystick/pkg-plist4
-rw-r--r--x11-drivers/xlibre-xf86-input-keyboard/Makefile18
-rw-r--r--x11-drivers/xlibre-xf86-input-keyboard/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-keyboard/files/patch-at_scancode.c31
-rw-r--r--x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__bsd_KbdMap.c229
-rw-r--r--x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__bsd_kbd.c14
-rw-r--r--x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__kbd.c24
-rw-r--r--x11-drivers/xlibre-xf86-input-keyboard/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-input-keyboard/pkg-plist2
-rw-r--r--x11-drivers/xlibre-xf86-input-libinput/Makefile21
-rw-r--r--x11-drivers/xlibre-xf86-input-libinput/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-libinput/pkg-descr3
-rw-r--r--x11-drivers/xlibre-xf86-input-libinput/pkg-plist5
-rw-r--r--x11-drivers/xlibre-xf86-input-mouse/Makefile18
-rw-r--r--x11-drivers/xlibre-xf86-input-mouse/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-mouse/files/patch-src-bsd_mouse.c1039
-rw-r--r--x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mouse.c196
-rw-r--r--x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mouse.h25
-rw-r--r--x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mousePriv.h11
-rw-r--r--x11-drivers/xlibre-xf86-input-mouse/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-input-mouse/pkg-plist4
-rw-r--r--x11-drivers/xlibre-xf86-input-synaptics/Makefile27
-rw-r--r--x11-drivers/xlibre-xf86-input-synaptics/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-synaptics/files/patch-Makefile.am7
-rw-r--r--x11-drivers/xlibre-xf86-input-synaptics/files/patch-configure.ac10
-rw-r--r--x11-drivers/xlibre-xf86-input-synaptics/files/patch-src_eventcomm.h18
-rw-r--r--x11-drivers/xlibre-xf86-input-synaptics/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-input-synaptics/pkg-plist9
-rw-r--r--x11-drivers/xlibre-xf86-input-vmmouse/Makefile23
-rw-r--r--x11-drivers/xlibre-xf86-input-vmmouse/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-vmmouse/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-input-vmmouse/pkg-plist8
-rw-r--r--x11-drivers/xlibre-xf86-input-void/Makefile18
-rw-r--r--x11-drivers/xlibre-xf86-input-void/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-void/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-input-void/pkg-plist2
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/Makefile41
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/fixpatch-src-wcmValidateDevice.c64
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/patch-src-wcmConfig.c19
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/patch-src-wcmUSB.c29
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/patch-src-xf86WacomDefs.h12
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-isdv4-serial-debugger.c10
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-isdv4-serial-inputattach.c71
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-tools-shared.c34
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/pkg-message.in15
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/wacom.conf.sample33
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/files/wacom.in44
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/pkg-descr2
-rw-r--r--x11-drivers/xlibre-xf86-input-wacom/pkg-plist14
-rw-r--r--x11-drivers/xlibre-xf86-video-amdgpu/Makefile32
-rw-r--r--x11-drivers/xlibre-xf86-video-amdgpu/distinfo5
-rw-r--r--x11-drivers/xlibre-xf86-video-amdgpu/pkg-descr7
-rw-r--r--x11-drivers/xlibre-xf86-video-ast/Makefile19
-rw-r--r--x11-drivers/xlibre-xf86-video-ast/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-video-ast/files/patch-src_ast__driver.c19
-rw-r--r--x11-drivers/xlibre-xf86-video-ast/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-video-ati/Makefile28
-rw-r--r--x11-drivers/xlibre-xf86-video-ati/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-video-ati/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-video-ati/pkg-plist5
-rw-r--r--x11-drivers/xlibre-xf86-video-dummy/Makefile16
-rw-r--r--x11-drivers/xlibre-xf86-video-dummy/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-video-dummy/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-video-dummy/pkg-plist1
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/Makefile54
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-benchmarks_dri3-swap.c25
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-hyphen24
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-man_meson.build9
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-meson.build35
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-meson__options.txt13
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-prefer-iris31
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-src_intel__device.c13
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-src_intel__list.h145
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-src_meson.build38
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-src_sna_kgem.c24
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-src_sna_meson.build11
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-test_present-speed.c99
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/files/patch-tools_meson.build11
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/pkg-descr14
-rw-r--r--x11-drivers/xlibre-xf86-video-intel/pkg-plist10
-rw-r--r--x11-drivers/xlibre-xf86-video-mga/Makefile19
-rw-r--r--x11-drivers/xlibre-xf86-video-mga/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__dac3026.c15
-rw-r--r--x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__dri.c22
-rw-r--r--x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__driver.c19
-rw-r--r--x11-drivers/xlibre-xf86-video-mga/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-video-mga/pkg-plist2
-rw-r--r--x11-drivers/xlibre-xf86-video-nv/Makefile19
-rw-r--r--x11-drivers/xlibre-xf86-video-nv/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-video-nv/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-video-nv/pkg-plist2
-rw-r--r--x11-drivers/xlibre-xf86-video-qxl/Makefile39
-rw-r--r--x11-drivers/xlibre-xf86-video-qxl/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-video-qxl/files/patch-spiceqxl_audio.c14
-rw-r--r--x11-drivers/xlibre-xf86-video-qxl/files/patch-src-mspace.h11
-rw-r--r--x11-drivers/xlibre-xf86-video-qxl/pkg-descr3
-rw-r--r--x11-drivers/xlibre-xf86-video-qxl/pkg-plist5
-rw-r--r--x11-drivers/xlibre-xf86-video-vesa/Makefile19
-rw-r--r--x11-drivers/xlibre-xf86-video-vesa/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-video-vesa/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-video-vesa/pkg-plist2
-rw-r--r--x11-drivers/xlibre-xf86-video-vmware/Makefile25
-rw-r--r--x11-drivers/xlibre-xf86-video-vmware/distinfo3
-rw-r--r--x11-drivers/xlibre-xf86-video-vmware/files/patch-saa_saa.h10
-rw-r--r--x11-drivers/xlibre-xf86-video-vmware/files/patch-src_vmware.c11
-rw-r--r--x11-drivers/xlibre-xf86-video-vmware/files/patch-vmwgfx_vmwgfx__driver.h10
-rw-r--r--x11-drivers/xlibre-xf86-video-vmware/pkg-descr1
-rw-r--r--x11-drivers/xlibre-xf86-video-vmware/pkg-plist2
125 files changed, 3352 insertions, 3 deletions
diff --git a/x11-drivers/Makefile b/x11-drivers/Makefile
index a3c59c418859..981a770111b8 100644
--- a/x11-drivers/Makefile
+++ b/x11-drivers/Makefile
@@ -22,6 +22,27 @@
SUBDIR += xf86-video-scfb
SUBDIR += xf86-video-vesa
SUBDIR += xf86-video-vmware
+ SUBDIR += xlibre-drivers
+ SUBDIR += xlibre-xf86-input-elographics
+ SUBDIR += xlibre-xf86-input-evdev
+ SUBDIR += xlibre-xf86-input-joystick
+ SUBDIR += xlibre-xf86-input-keyboard
+ SUBDIR += xlibre-xf86-input-libinput
+ SUBDIR += xlibre-xf86-input-mouse
+ SUBDIR += xlibre-xf86-input-synaptics
+ SUBDIR += xlibre-xf86-input-vmmouse
+ SUBDIR += xlibre-xf86-input-void
+ SUBDIR += xlibre-xf86-input-wacom
+ SUBDIR += xlibre-xf86-video-amdgpu
+ SUBDIR += xlibre-xf86-video-ast
+ SUBDIR += xlibre-xf86-video-ati
+ SUBDIR += xlibre-xf86-video-dummy
+ SUBDIR += xlibre-xf86-video-intel
+ SUBDIR += xlibre-xf86-video-mga
+ SUBDIR += xlibre-xf86-video-nv
+ SUBDIR += xlibre-xf86-video-qxl
+ SUBDIR += xlibre-xf86-video-vesa
+ SUBDIR += xlibre-xf86-video-vmware
SUBDIR += xorg-drivers
SUBDIR += xorgxrdp
SUBDIR += xorgxrdp-devel
diff --git a/x11-drivers/xf86-input-egalax/Makefile b/x11-drivers/xf86-input-egalax/Makefile
index 413e9cf3ce3d..b231e898e595 100644
--- a/x11-drivers/xf86-input-egalax/Makefile
+++ b/x11-drivers/xf86-input-egalax/Makefile
@@ -6,13 +6,23 @@ CATEGORIES= x11-drivers
MAINTAINER= glebius@FreeBSD.org
COMMENT= eGalax touch screen input driver for X.Org
+LICENSE= BSD2CLAUSE
+
+FLAVORS= xorg xlibre
+FLAVOR?= ${FLAVORS:[1]}
+
+.if ${FLAVOR} == xlibre
+PKGNAMEPREFIX= xlibre-
+USES= xlibre-cat:driver
+.else
+USES= xorg-cat:driver
+.endif
+
USE_GITHUB= yes
GH_ACCOUNT= glebius
GH_TAGNAME= 7f1e4ac
-LICENSE= BSD2CLAUSE
-
-USES= autoreconf xorg-cat:driver
+USES+= autoreconf
GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
diff --git a/x11-drivers/xlibre-drivers/Makefile b/x11-drivers/xlibre-drivers/Makefile
new file mode 100644
index 000000000000..6882b419a964
--- /dev/null
+++ b/x11-drivers/xlibre-drivers/Makefile
@@ -0,0 +1,85 @@
+PORTNAME= xlibre-drivers
+PORTVERSION= 0.1
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre drivers meta-port
+WWW= https://github.com/X11Libre/
+
+LICENSE= none
+
+USES= metaport
+
+.include "../../x11-servers/xlibre-server/Makefile.version"
+MODULEDIR= ${PREFIX}/lib/xorg/modules/xlibre-${XLIBRE_MJR_VER}/
+XORG_MODULEDIR= ${PREFIX}/lib/xorg/modules/
+VIDEODIR= ${MODULEDIR}/drivers
+INPUTDIR= ${MODULEDIR}/input
+XORG_VIDEODIR= ${XORG_MODULEDIR}/drivers
+XORG_INPUTDIR= ${XORG_MODULEDIR}/input
+
+INPUT_DRIVERS= elographics \
+ evdev \
+ joystick \
+ keyboard \
+ libinput \
+ mouse \
+ synaptics \
+ void \
+ egalax \
+ wacom
+
+VIDEO_DRIVERS= ast \
+ dummy \
+ nv \
+ scfb \
+ vesa
+
+OPTIONS_DEFAULT= KEYBOARD \
+ LIBINPUT \
+ MOUSE \
+ SCFB
+
+.for type in input video
+. for a in ${${type:tu}_DRIVERS}
+OPTIONS_DEFINE+= ${a:tu}
+${a:tu}_DESC= Install ${a} ${type} driver
+. endfor
+.endfor
+
+OPTIONS_DEFINE_amd64= AMDGPU ATI INTEL VMMOUSE VMWARE
+OPTIONS_DEFAULT_amd64= VESA
+
+AMDGPU_DESC= Install amdgpu video driver
+ATI_DESC= Install ati (radeon) video driver
+INTEL_DESC= Install intel video driver
+VMMOUSE_DESC= Install vmmouse input driver
+VMWARE_DESC= Install vmware video driver
+
+# these drivers have a different module name compared to the plugin they install
+QUIRKS= keyboard:kbd
+NONXLIBRE= scfb egalax
+
+.include <bsd.port.options.mk>
+
+# Manual add arch specific drivers so they be added to depend lines.
+.if ${ARCH}==i386 || ${ARCH}==amd64
+INPUT_DRIVERS+= vmmouse
+VIDEO_DRIVERS+= amdgpu ati intel vmware
+.endif
+
+.for type in input video
+. for i in ${${type:tu}_DRIVERS}
+. if ${PORT_OPTIONS:M${i:tu}} != ""
+. if ${QUIRKS:M${i}\:*:C/.*://} != ""
+RUN_DEPENDS+= ${${type:tu}DIR}/${QUIRKS:M${i}\:*:C/.*://}_drv.so:x11-drivers/xlibre-xf86-${type}-${i}
+. elif ${NONXLIBRE:M${i}}
+# RUN_DEPENDS+= ${XORG_${type:tu}DIR}/${i}_drv.so:x11-drivers/xf86-${type}-${i}@xlibre
+. else
+RUN_DEPENDS+= ${${type:tu}DIR}/${i}_drv.so:x11-drivers/xlibre-xf86-${type}-${i}
+. endif
+. endif
+. endfor
+.endfor
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-drivers/pkg-descr b/x11-drivers/xlibre-drivers/pkg-descr
new file mode 100644
index 000000000000..5eb8e024f47f
--- /dev/null
+++ b/x11-drivers/xlibre-drivers/pkg-descr
@@ -0,0 +1 @@
+This is a meta-port that contains various XLibre drivers for the XLibre server.
diff --git a/x11-drivers/xlibre-xf86-input-elographics/Makefile b/x11-drivers/xlibre-xf86-input-elographics/Makefile
new file mode 100644
index 000000000000..6645f3394c96
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-elographics/Makefile
@@ -0,0 +1,18 @@
+PORTNAME= xlibre-xf86-input-elographics
+PORTVERSION= 1.4.4.2
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre elographics input driver
+WWW= https://github.com/X11Libre/xf86-input-elographics/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-input-elographics
+
+USES= xlibre-cat:driver
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-elographics/distinfo b/x11-drivers/xlibre-xf86-input-elographics/distinfo
new file mode 100644
index 000000000000..6cf0513762fe
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-elographics/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760816138
+SHA256 (xlibre/driver/X11Libre-xf86-input-elographics-1.4.4.2-xlibre-xf86-input-elographics-1.4.4.2_GH0.tar.gz) = 704388429ec78b0a38b77c8598e15b6855383f4f1b49c0d7978a29fd18767bf9
+SIZE (xlibre/driver/X11Libre-xf86-input-elographics-1.4.4.2-xlibre-xf86-input-elographics-1.4.4.2_GH0.tar.gz) = 18960
diff --git a/x11-drivers/xlibre-xf86-input-elographics/pkg-descr b/x11-drivers/xlibre-xf86-input-elographics/pkg-descr
new file mode 100644
index 000000000000..fabf8a56636a
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-elographics/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-input-elographics driver.
diff --git a/x11-drivers/xlibre-xf86-input-elographics/pkg-plist b/x11-drivers/xlibre-xf86-input-elographics/pkg-plist
new file mode 100644
index 000000000000..b2d5859882be
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-elographics/pkg-plist
@@ -0,0 +1,2 @@
+lib/xorg/modules/xlibre-25.0/input/elographics_drv.so
+share/man/man4/elographics.4x.gz
diff --git a/x11-drivers/xlibre-xf86-input-evdev/Makefile b/x11-drivers/xlibre-xf86-input-evdev/Makefile
new file mode 100644
index 000000000000..a2a935e3161a
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-evdev/Makefile
@@ -0,0 +1,23 @@
+PORTNAME= xlibre-xf86-input-evdev
+PORTVERSION= 2.11.0.2
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre event device input driver
+WWW= https://github.com/X11Libre/xf86-input-evdev/
+
+LICENSE= MIT # various styles
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-input-evdev
+
+BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto
+LIB_DEPENDS= libevdev.so:devel/libevdev \
+ libmtdev.so:devel/libmtdev
+RUN_DEPENDS= webcamd>=3.1.0.1:multimedia/webcamd
+
+USES= pathfix xlibre-cat:driver
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+CONFIGURE_ENV= UDEV_CFLAGS=" " UDEV_LIBS=" "
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-evdev/distinfo b/x11-drivers/xlibre-xf86-input-evdev/distinfo
new file mode 100644
index 000000000000..384c203d2940
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-evdev/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760816207
+SHA256 (xlibre/driver/X11Libre-xf86-input-evdev-2.11.0.2-xlibre-xf86-input-evdev-2.11.0.2_GH0.tar.gz) = 70a8a65ec56cce7057b8491f68744c6883debe8750948bb290ae7b1c3ec28dfc
+SIZE (xlibre/driver/X11Libre-xf86-input-evdev-2.11.0.2-xlibre-xf86-input-evdev-2.11.0.2_GH0.tar.gz) = 50815
diff --git a/x11-drivers/xlibre-xf86-input-evdev/pkg-descr b/x11-drivers/xlibre-xf86-input-evdev/pkg-descr
new file mode 100644
index 000000000000..0517dd586a1c
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-evdev/pkg-descr
@@ -0,0 +1,3 @@
+This package contains the XLibre xf86-input-evdev driver. It supports
+all input devices that webcamd knows about, including tablets,
+touchscreens, joysticks and HIDs.
diff --git a/x11-drivers/xlibre-xf86-input-evdev/pkg-plist b/x11-drivers/xlibre-xf86-input-evdev/pkg-plist
new file mode 100644
index 000000000000..8f0ebe5df126
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-evdev/pkg-plist
@@ -0,0 +1,5 @@
+include/xorg/evdev-properties.h
+lib/xorg/modules/xlibre-25.0/input/evdev_drv.so
+libdata/pkgconfig/xorg-evdev.pc
+share/man/man4/evdev.4x.gz
+share/X11/xorg.conf.d/10-evdev.conf
diff --git a/x11-drivers/xlibre-xf86-input-joystick/Makefile b/x11-drivers/xlibre-xf86-input-joystick/Makefile
new file mode 100644
index 000000000000..49bbb337c1bd
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-joystick/Makefile
@@ -0,0 +1,19 @@
+PORTNAME= xlibre-xf86-input-joystick
+PORTVERSION= 1.6.4.1
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre joystick input driver
+WWW= https://github.com/X11Libre/xf86-input-joystick/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-input-joystick
+
+GH_TAGNAME= 931dbdb
+USES= pathfix xlibre-cat:driver
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-joystick/distinfo b/x11-drivers/xlibre-xf86-input-joystick/distinfo
new file mode 100644
index 000000000000..a4f30057988e
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-joystick/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760819782
+SHA256 (xlibre/driver/X11Libre-xf86-input-joystick-1.6.4.1-931dbdb_GH0.tar.gz) = 166c8156dd50bbe4fa2b0406de48caa6a6af84109356814a0644eade8dba0a75
+SIZE (xlibre/driver/X11Libre-xf86-input-joystick-1.6.4.1-931dbdb_GH0.tar.gz) = 38524
diff --git a/x11-drivers/xlibre-xf86-input-joystick/pkg-descr b/x11-drivers/xlibre-xf86-input-joystick/pkg-descr
new file mode 100644
index 000000000000..b773a83901b5
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-joystick/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-input-joystick driver.
diff --git a/x11-drivers/xlibre-xf86-input-joystick/pkg-plist b/x11-drivers/xlibre-xf86-input-joystick/pkg-plist
new file mode 100644
index 000000000000..db8fa1093e82
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-joystick/pkg-plist
@@ -0,0 +1,4 @@
+include/xorg/joystick-properties.h
+lib/xorg/modules/xlibre-25.0/input/joystick_drv.so
+libdata/pkgconfig/xorg-joystick.pc
+share/man/man4/joystick.4x.gz
diff --git a/x11-drivers/xlibre-xf86-input-keyboard/Makefile b/x11-drivers/xlibre-xf86-input-keyboard/Makefile
new file mode 100644
index 000000000000..82220fefad03
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-keyboard/Makefile
@@ -0,0 +1,18 @@
+PORTNAME= xlibre-xf86-input-keyboard
+PORTVERSION= 2.1.0.2
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre keyboard input driver
+WWW= https://github.com/X11Libre/xf86-input-keyboard/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-input-keyboard
+
+USES= xlibre-cat:driver
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-keyboard/distinfo b/x11-drivers/xlibre-xf86-input-keyboard/distinfo
new file mode 100644
index 000000000000..3f95207b8ae2
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-keyboard/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760816300
+SHA256 (xlibre/driver/X11Libre-xf86-input-keyboard-2.1.0.2-xlibre-xf86-input-keyboard-2.1.0.2_GH0.tar.gz) = 6e72dc5bde6215d1daa6970367caac27a7b8f491c1ea6b3030960a4736169110
+SIZE (xlibre/driver/X11Libre-xf86-input-keyboard-2.1.0.2-xlibre-xf86-input-keyboard-2.1.0.2_GH0.tar.gz) = 49451
diff --git a/x11-drivers/xlibre-xf86-input-keyboard/files/patch-at_scancode.c b/x11-drivers/xlibre-xf86-input-keyboard/files/patch-at_scancode.c
new file mode 100644
index 000000000000..4a24423e4f33
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-keyboard/files/patch-at_scancode.c
@@ -0,0 +1,31 @@
+--- src/at_scancode.c.orig Sun Jul 3 09:01:35 2005
++++ src/at_scancode.c Sat Oct 7 21:27:29 2006
+@@ -84,6 +84,10 @@
+ case KEY_Prefix0:
+ pKbd->scanPrefix = 0;
+ switch (*scanCode) {
++ case 0x1e: *scanCode = KEY_AudioRaise;break;
++ case 0x1f: *scanCode = KEY_AudioLower;break;
++ case 0x20: *scanCode = KEY_Power; break;
++ case 0x25: *scanCode = KEY_Mute; break;
+ case KEY_KP_7: *scanCode = KEY_Home; break; /* curs home */
+ case KEY_KP_8: *scanCode = KEY_Up; break; /* curs up */
+ case KEY_KP_9: *scanCode = KEY_PgUp; break; /* curs pgup */
+@@ -103,6 +107,17 @@
+ case 0x5b: *scanCode = KEY_LMeta; break;
+ case 0x5c: *scanCode = KEY_RMeta; break;
+ case 0x5d: *scanCode = KEY_Menu; break;
++ case 0x5e: *scanCode = KEY_L1; break; /* stop */
++ case 0x5f: *scanCode = KEY_L2; break; /* again */
++ case 0x60: *scanCode = KEY_L3; break; /* props */
++ case 0x61: *scanCode = KEY_L4; break; /* undo */
++ case 0x62: *scanCode = KEY_L5; break; /* front */
++ case 0x63: *scanCode = KEY_L6; break; /* copy */
++ case 0x64: *scanCode = KEY_L7; break; /* open */
++ case 0x65: *scanCode = KEY_L8; break; /* paste */
++ case 0x66: *scanCode = KEY_L9; break; /* find */
++ case 0x67: *scanCode = KEY_L10; break; /* cut */
++ case 0x68: *scanCode = KEY_Help; break;
+ case KEY_F3: *scanCode = KEY_F13; break;
+ case KEY_F4: *scanCode = KEY_F14; break;
+ case KEY_F5: *scanCode = KEY_F15; break;
diff --git a/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__bsd_KbdMap.c b/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__bsd_KbdMap.c
new file mode 100644
index 000000000000..add495f1ee74
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__bsd_KbdMap.c
@@ -0,0 +1,229 @@
+Don't query console keymap
+
+This seems to be useless and doesn't work anymore with vt(4), due to the
+use of Unicode codepoints in vt(4). So remove the related code. This fixes
+a segmentation fault during X.Org server startup.
+
+PR: 191459
+Submitted by: Claude Buisson <clbuisson@orange.fr> (earlier version)
+
+--- src/bsd_KbdMap.c.orig 2013-10-28 01:44:15.000000000 +0100
++++ src/bsd_KbdMap.c 2014-09-08 19:22:28.000000000 +0200
+@@ -27,168 +27,6 @@
+ #include "xf86Keymap.h"
+ #include "bsd_kbd.h"
+
+-#if (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)) && defined(GIO_KEYMAP)
+-#define KD_GET_ENTRY(i,n) \
+- eascii_to_x[((keymap.key[i].spcl << (n+1)) & 0x100) + keymap.key[i].map[n]]
+-
+-static unsigned char remap[NUM_KEYCODES] = {
+- 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */
+- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */
+- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */
+- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */
+- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */
+- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */
+- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */
+- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */
+- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */
+- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */
+- 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */
+- 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */
+- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */
+- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */
+- 0, 0, 0x69, 0x65, 0, 0, 0, 0, /* 0x70 - 0x77 */
+- 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */
+-};
+-
+-/* This table assumes the ibm code page 437 coding for characters
+- * > 0x80. They are returned in this form by PCVT */
+-static KeySym eascii_to_x[512] = {
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
+- NoSymbol, XK_Return, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
+- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
+- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
+- XK_comma, XK_minus, XK_period, XK_slash,
+- XK_0, XK_1, XK_2, XK_3,
+- XK_4, XK_5, XK_6, XK_7,
+- XK_8, XK_9, XK_colon, XK_semicolon,
+- XK_less, XK_equal, XK_greater, XK_question,
+- XK_at, XK_A, XK_B, XK_C,
+- XK_D, XK_E, XK_F, XK_G,
+- XK_H, XK_I, XK_J, XK_K,
+- XK_L, XK_M, XK_N, XK_O,
+- XK_P, XK_Q, XK_R, XK_S,
+- XK_T, XK_U, XK_V, XK_W,
+- XK_X, XK_Y, XK_Z, XK_bracketleft,
+- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
+- XK_grave, XK_a, XK_b, XK_c,
+- XK_d, XK_e, XK_f, XK_g,
+- XK_h, XK_i, XK_j, XK_k,
+- XK_l, XK_m, XK_n, XK_o,
+- XK_p, XK_q, XK_r, XK_s,
+- XK_t, XK_u, XK_v, XK_w,
+- XK_x, XK_y, XK_z, XK_braceleft,
+- XK_bar, XK_braceright, XK_asciitilde, XK_Delete,
+- XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex,
+- XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla,
+- XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis,
+- XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring,
+- XK_Eacute, XK_ae, XK_AE, XK_ocircumflex,
+- XK_odiaeresis, XK_ograve, XK_ucircumflex, XK_ugrave,
+- XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent,
+- XK_sterling, XK_yen, XK_paragraph, XK_section,
+- XK_aacute, XK_iacute, XK_oacute, XK_uacute,
+- XK_ntilde, XK_Ntilde, XK_ordfeminine, XK_masculine,
+- XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf,
+- XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi,
+- XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau,
+- XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta,
+- XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection,
+- XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal,
+- XK_topintegral, XK_botintegral, XK_division, XK_similarequal,
+- XK_degree, NoSymbol, NoSymbol, XK_radical,
+- XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol,
+-
+- /*
+- * special marked entries (256 + x)
+- */
+-
+- /* This has been checked against what syscons actually does */
+- NoSymbol, NoSymbol, XK_Shift_L, XK_Shift_R,
+- XK_Caps_Lock, XK_Num_Lock, XK_Scroll_Lock, XK_Alt_L,
+- XK_ISO_Left_Tab,XK_Control_L, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, XK_F1,
+- XK_F2, XK_F3, XK_F4, XK_F5,
+- XK_F6, XK_F7, XK_F8, XK_F9,
+- XK_F10, XK_F11, XK_F12, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- XK_Control_R, XK_Alt_R, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+- NoSymbol, NoSymbol, NoSymbol, NoSymbol
+-};
+-
+ #ifdef SYSCONS_SUPPORT
+ static
+ unsigned char sysconsCODEMap[] = {
+@@ -205,7 +43,6 @@
+ sysconsCODEMap
+ };
+ #endif
+-#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
+
+ #ifdef WSCONS_SUPPORT
+
+@@ -1245,40 +1082,6 @@
+ KeySym *k;
+ int i;
+
+-#ifndef __bsdi__
+- switch (pKbd->consType) {
+-
+-/*
+- * XXX wscons has no GIO_KEYMAP
+- */
+-#if (defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)) && defined(GIO_KEYMAP)
+- case SYSCONS:
+- case PCVT:
+- {
+- keymap_t keymap;
+-
+- if (ioctl(pInfo->fd, GIO_KEYMAP, &keymap) != -1) {
+- for (i = 0; i < keymap.n_keys && i < NUM_KEYCODES; i++)
+- if (remap[i]) {
+- k = map + (remap[i] << 2);
+- k[0] = KD_GET_ENTRY(i,0); /* non-shifed */
+- k[1] = KD_GET_ENTRY(i,1); /* shifted */
+- k[2] = KD_GET_ENTRY(i,4); /* alt */
+- k[3] = KD_GET_ENTRY(i,5); /* alt - shifted */
+- if (k[3] == k[2]) k[3] = NoSymbol;
+- if (k[2] == k[1]) k[2] = NoSymbol;
+- if (k[1] == k[0]) k[1] = NoSymbol;
+- if (k[0] == k[2] && k[1] == k[3])
+- k[2] = k[3] = NoSymbol;
+- }
+- }
+- }
+- break;
+-#endif /* SYSCONS || PCVT */
+-
+- }
+-#endif /* !bsdi */
+-
+ /*
+ * compute the modifier map
+ */
diff --git a/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__bsd_kbd.c b/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__bsd_kbd.c
new file mode 100644
index 000000000000..984a73680601
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__bsd_kbd.c
@@ -0,0 +1,14 @@
+Index: src/bsd_kbd.c
+@@ -237,6 +237,12 @@
+ #endif
+ }
+ }
++/*
++ * Switch keyboards which are not attached to console in RAW mode
++ */
++#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
++ ioctl(pInfo->fd, KDSKBMODE, K_RAW);
++#endif
+ return Success;
+ }
+
diff --git a/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__kbd.c b/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__kbd.c
new file mode 100644
index 000000000000..e9b0397baea7
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__kbd.c
@@ -0,0 +1,24 @@
+Index: src/kbd.c
+@@ -25,6 +25,7 @@
+
+ #include "xf86.h"
+ #include "atKeynames.h"
++#include "xf86Priv.h"
+ #include "xf86Privstr.h"
+
+ #include <X11/extensions/XI.h>
+@@ -392,6 +393,14 @@
+ RemoveEnabledDevice(pInfo->fd);
+ pKbd->KbdOff(pInfo, what);
+ device->public.on = FALSE;
++ /*
++ * Close device file for keyboards which are not attached
++ * to console, otherwise they can't be opened again after
++ * relogin when using session manager like xdm.
++ * X server will take care about console attached keyboards.
++ */
++ if (pInfo->fd != xf86Info.consoleFd)
++ close(pInfo->fd);
+ break;
+
+ default:
diff --git a/x11-drivers/xlibre-xf86-input-keyboard/pkg-descr b/x11-drivers/xlibre-xf86-input-keyboard/pkg-descr
new file mode 100644
index 000000000000..e31af508c95d
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-keyboard/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-input-keyboard driver.
diff --git a/x11-drivers/xlibre-xf86-input-keyboard/pkg-plist b/x11-drivers/xlibre-xf86-input-keyboard/pkg-plist
new file mode 100644
index 000000000000..e76fe16577a9
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-keyboard/pkg-plist
@@ -0,0 +1,2 @@
+lib/xorg/modules/xlibre-25.0/input/kbd_drv.so
+share/man/man4/kbd.4x.gz
diff --git a/x11-drivers/xlibre-xf86-input-libinput/Makefile b/x11-drivers/xlibre-xf86-input-libinput/Makefile
new file mode 100644
index 000000000000..63673db15bcc
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-libinput/Makefile
@@ -0,0 +1,21 @@
+PORTNAME= xlibre-xf86-input-libinput
+PORTVERSION= 1.5.1.0
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre libinput input driver
+WWW= https://github.com/X11Libre/xf86-input-libinput/
+
+LICENSE= MIT # various styles
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-input-libinput
+
+BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto
+LIB_DEPENDS= libinput.so:x11/libinput
+
+USES= pathfix tar:xz xlibre-cat:driver
+
+GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-libinput/distinfo b/x11-drivers/xlibre-xf86-input-libinput/distinfo
new file mode 100644
index 000000000000..9a71a804f755
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-libinput/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760812277
+SHA256 (xlibre/driver/X11Libre-xf86-input-libinput-1.5.1.0-xlibre-xf86-input-libinput-1.5.1.0_GH0.tar.gz) = f1be5a443af78307af18103a6bb614021fe163380b0eb43dec820a2389fbd6c8
+SIZE (xlibre/driver/X11Libre-xf86-input-libinput-1.5.1.0-xlibre-xf86-input-libinput-1.5.1.0_GH0.tar.gz) = 65498
diff --git a/x11-drivers/xlibre-xf86-input-libinput/pkg-descr b/x11-drivers/xlibre-xf86-input-libinput/pkg-descr
new file mode 100644
index 000000000000..d8b3784285c7
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-libinput/pkg-descr
@@ -0,0 +1,3 @@
+This package contains the XLibre xf86-input-libinput driver. It is a thin
+wrapper around libinput, so while it does provide all features that libinput
+supports it does little beyond.
diff --git a/x11-drivers/xlibre-xf86-input-libinput/pkg-plist b/x11-drivers/xlibre-xf86-input-libinput/pkg-plist
new file mode 100644
index 000000000000..52e536d56563
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-libinput/pkg-plist
@@ -0,0 +1,5 @@
+include/xorg/libinput-properties.h
+lib/xorg/modules/xlibre-25.0/input/libinput_drv.so
+libdata/pkgconfig/xorg-libinput.pc
+share/man/man4/libinput.4x.gz
+share/X11/xorg.conf.d/40-libinput.conf
diff --git a/x11-drivers/xlibre-xf86-input-mouse/Makefile b/x11-drivers/xlibre-xf86-input-mouse/Makefile
new file mode 100644
index 000000000000..fdc9c28efa6b
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-mouse/Makefile
@@ -0,0 +1,18 @@
+PORTNAME= xlibre-xf86-input-mouse
+PORTVERSION= 1.9.5.4
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre mouse input driver
+WWW= https://github.com/X11Libre/xf86-input-mouse/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-input-mouse
+
+USES= pathfix xlibre-cat:driver
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-mouse/distinfo b/x11-drivers/xlibre-xf86-input-mouse/distinfo
new file mode 100644
index 000000000000..1d9fa8b9738d
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-mouse/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1764440351
+SHA256 (xlibre/driver/X11Libre-xf86-input-mouse-1.9.5.4-xlibre-xf86-input-mouse-1.9.5.4_GH0.tar.gz) = 9f2108e435d52dc5b373f4fa2a7503a53738ae911a899ce3bf351cd2b912e6e9
+SIZE (xlibre/driver/X11Libre-xf86-input-mouse-1.9.5.4-xlibre-xf86-input-mouse-1.9.5.4_GH0.tar.gz) = 78830
diff --git a/x11-drivers/xlibre-xf86-input-mouse/files/patch-src-bsd_mouse.c b/x11-drivers/xlibre-xf86-input-mouse/files/patch-src-bsd_mouse.c
new file mode 100644
index 000000000000..8f542a60af12
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-mouse/files/patch-src-bsd_mouse.c
@@ -0,0 +1,1039 @@
+--- src/bsd_mouse.c.orig 2018-06-19 04:36:21 UTC
++++ src/bsd_mouse.c
+@@ -26,6 +26,24 @@
+ * authorization from the copyright holder(s) and author(s).
+ */
+
++
++/*
++ * XXX - Should this be autoconf'd instead?
++ */
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
++
++#if !defined(USBMOUSE_SUPPORT)
++#define USBMOUSE_SUPPORT
++#endif
++#if !defined(HAS_LIB_USB_HID)
++#define HAS_LIB_USB_HID
++#endif
++#if !defined(XPS2_SUPPORT)
++#define XPS2_SUPPORT
++#endif
++
++#endif /* defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) */
++
+ #include <xorg-server.h>
+
+ #include <X11/X.h>
+@@ -33,9 +51,23 @@
+ #include "xf86Priv.h"
+ #include "xf86_OSlib.h"
+ #include "xf86Xinput.h"
++#include <exevents.h>
+ #include "mouse.h"
+ #include "xisb.h"
+ #include "mipointer.h"
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
++#define HAVE_PROPERTIES 1
++#endif
++#ifdef HAVE_PROPERTIES
++#include <X11/Xatom.h>
++#include <xserver-properties.h>
++/* 1.6 has properties, but no labels */
++#ifdef AXIS_LABEL_PROP
++#define HAVE_LABELS
++#else
++#undef HAVE_LABELS
++#endif
++#endif
+ #ifdef WSCONS_SUPPORT
+ #include <dev/wscons/wsconsio.h>
+ #endif
+@@ -47,9 +79,6 @@
+ #else
+ # include <dev/usb/usb.h>
+ #endif
+-#ifdef USB_GET_REPORT_ID
+-#define USB_NEW_HID
+-#endif
+
+ #define HUP_GENERIC_DESKTOP 0x0001
+ #define HUP_BUTTON 0x0009
+@@ -75,11 +104,13 @@ static const char *FindDevice(InputInfoPtr, const char
+ #define DEFAULT_MOUSE_DEV "/dev/mouse"
+ #define DEFAULT_SYSMOUSE_DEV "/dev/sysmouse"
+ #define DEFAULT_PS2_DEV "/dev/psm0"
++#define DEFAULT_USB_DEV "/dev/ums0"
+
+ static const char *mouseDevs[] = {
+ DEFAULT_MOUSE_DEV,
+ DEFAULT_SYSMOUSE_DEV,
+ DEFAULT_PS2_DEV,
++ DEFAULT_USB_DEV,
+ NULL
+ };
+ #elif (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
+@@ -97,7 +128,7 @@ static const char *mouseDevs[] = {
+ static int
+ SupportedInterfaces(void)
+ {
+-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__NetBSD__)
++#if defined(__NetBSD__)
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC;
+ #else
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO | MSE_MISC;
+@@ -178,9 +209,30 @@ static struct {
+ { MOUSE_PROTO_SYSMOUSE, "SysMouse" }
+ };
+
++#ifdef XPS2_SUPPORT
++static struct {
++ int dmodel;
++ const char *name;
++} ps2proto[] = {
++ { MOUSE_MODEL_NETSCROLL, "NetScrollPS/2" },
++ { MOUSE_MODEL_NET, "NetMousePS/2" },
++ { MOUSE_MODEL_GLIDEPOINT, "GlidePointPS/2" },
++ { MOUSE_MODEL_THINK, "ThinkingMousePS/2" },
++ { MOUSE_MODEL_INTELLI, "IMPS/2" },
++ { MOUSE_MODEL_MOUSEMANPLUS, "MouseManPlusPS/2" },
++ { MOUSE_MODEL_EXPLORER, "ExplorerPS/2" },
++ { MOUSE_MODEL_4D, "IMPS/2" },
++ { MOUSE_MODEL_4DPLUS, "IMPS/2" },
++};
++#endif
++
+ static const char *
+ SetupAuto(InputInfoPtr pInfo, int *protoPara)
+ {
++#ifdef XPS2_SUPPORT
++ const char *dev;
++#endif
++ const char *proto;
+ int i;
+ mousehw_t hw;
+ mousemode_t mode;
+@@ -188,7 +240,13 @@ SetupAuto(InputInfoPtr pInfo, int *protoPara)
+ if (pInfo->fd == -1)
+ return NULL;
+
++#ifdef XPS2_SUPPORT
+ /* set the driver operation level, if applicable */
++ dev = xf86FindOptionValue(pInfo->options, "Device");
++ if (dev != NULL && !strncmp(dev, DEFAULT_PS2_DEV, 8))
++ i = 2;
++ else
++#endif
+ i = 1;
+ ioctl(pInfo->fd, MOUSE_SETLEVEL, &i);
+
+@@ -207,9 +265,18 @@ SetupAuto(InputInfoPtr pInfo, int *protoPara)
+ protoPara[0] = mode.syncmask[0];
+ protoPara[1] = mode.syncmask[1];
+ }
++ proto = devproto[i].name;
++#ifdef XPS2_SUPPORT
++ if (mode.protocol == MOUSE_PROTO_PS2)
++ for (i = 0; i < sizeof(ps2proto)/sizeof(ps2proto[0]); ++i)
++ if (hw.model == ps2proto[i].dmodel) {
++ proto = ps2proto[i].name;
++ break;
++ }
++#endif
+ xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
+- pInfo->name, devproto[i].name);
+- return devproto[i].name;
++ pInfo->name, proto);
++ return proto;
+ }
+ }
+ }
+@@ -235,41 +302,41 @@
+ (protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
+ /*
+ * As the FreeBSD sysmouse driver defaults to protocol level 0
+- * every time it is opened we enforce protocol level 1 again at
++ * every time it is closed we enforce protocol level 1 again at
+ * this point.
+ */
+ mode.level = 1;
+ } else
+- mode.level = -1;
+-#else
+- mode.level = -1;
+ #endif
++ mode.level = -1;
+ ioctl(pInfo->fd, MOUSE_SETMODE, &mode);
+ }
+ #endif
+
+ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+-
+-#define MOUSED_PID_FILE "/var/run/moused.pid"
+-
+ /*
+ * Try to check if moused is running. DEFAULT_SYSMOUSE_DEV is useless without
+- * it. There doesn't seem to be a better way of checking.
++ * it. Also, try to check if the device is used by moused. If it is opened
++ * by moused, we do not want to use it directly. There doesn't seem to be
++ * a better way of checking.
+ */
+ static Bool
+-MousedRunning(void)
++MousedRunning(const char *dev)
+ {
++ char cmd[128];
+ FILE *f = NULL;
+- unsigned int pid;
++ unsigned int i;
+
+- if ((f = fopen(MOUSED_PID_FILE, "r")) != NULL) {
+- if (fscanf(f, "%u", &pid) == 1 && pid > 0) {
+- if (kill(pid, 0) == 0) {
+- fclose(f);
+- return TRUE;
+- }
++ if (dev)
++ sprintf(cmd, "sh -c 'fstat %s | grep -c moused' 2>/dev/null", dev);
++ else
++ sprintf(cmd, "sh -c 'pgrep -nx moused' 2>/dev/null");
++ if ((f = popen(cmd, "r")) != NULL) {
++ if (fscanf(f, "%u", &i) == 1 && i > 0) {
++ pclose(f);
++ return TRUE;
+ }
+- fclose(f);
++ pclose(f);
+ }
+ return FALSE;
+ }
+@@ -274,17 +341,17 @@ MousedRunning(void)
+ static const char *
+ FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
+ {
+- int fd = -1;
++ int ret = -1;
+ const char **pdev, *dev = NULL;
+ Bool devMouse = FALSE;
+ struct stat devMouseStat;
+ struct stat sb;
+
+ for (pdev = mouseDevs; *pdev; pdev++) {
+- SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
+- if (fd == -1) {
++ SYSCALL (ret = stat(*pdev, &sb));
++ if (ret == -1) {
+ #ifdef DEBUG
+- ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
++ ErrorF("Cannot stat %s (%s)\n", *pdev, strerror(errno));
+ #endif
+ } else {
+ /*
+@@ -293,28 +360,32 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, i
+ * the test for whether /dev/sysmouse is usable can be made.
+ */
+ if (!strcmp(*pdev, DEFAULT_MOUSE_DEV)) {
+- if (fstat(fd, &devMouseStat) == 0)
+- devMouse = TRUE;
+- close(fd);
++ memcpy(&devMouseStat, &sb, sizeof(devMouseStat));
++ devMouse = TRUE;
+ continue;
+ } else if (!strcmp(*pdev, DEFAULT_SYSMOUSE_DEV)) {
+ /* Check if /dev/mouse is the same as /dev/sysmouse. */
+- if (devMouse && fstat(fd, &sb) == 0 &&
+- devMouseStat.st_dev == sb.st_dev &&
++ if (devMouse && devMouseStat.st_dev == sb.st_dev &&
+ devMouseStat.st_ino == sb.st_ino) {
+ /* If the same, use /dev/sysmouse. */
+ devMouse = FALSE;
+ }
+- close(fd);
+- if (MousedRunning())
++ if (MousedRunning(NULL))
+ break;
+- else {
+-#ifdef DEBUG
+- ErrorF("moused isn't running\n");
+-#endif
+- }
+ } else {
+- close(fd);
++ /* Check if /dev/mouse is the same as this device. */
++ if (devMouse && devMouseStat.st_dev == sb.st_dev &&
++ devMouseStat.st_ino == sb.st_ino) {
++ /* If the same, use this device. */
++ devMouse = FALSE;
++ }
++ if (MousedRunning(*pdev))
++ continue;
++ /* ums(4) does not support anything but SysMouse protocol. */
++ if (!strncmp(*pdev, DEFAULT_USB_DEV, 8) && protocol &&
++ xf86NameCmp(protocol, "auto") != 0 &&
++ xf86NameCmp(protocol, "sysmouse") != 0)
++ continue;
+ break;
+ }
+ }
+@@ -486,30 +557,78 @@ wsconsPreInit(InputInfoPtr pInfo, const char *protocol
+
+ #if defined(USBMOUSE_SUPPORT)
+
++#define MAXRIDS 64
++#define MAXACOLS 8
++#define MAXLCOLS 16
+ typedef struct _UsbMseRec {
+ int packetSize;
+- int iid;
+- hid_item_t loc_x; /* x locator item */
+- hid_item_t loc_y; /* y locator item */
+- hid_item_t loc_z; /* z (wheel) locator item */
+- hid_item_t loc_w; /* z (wheel) locator item */
+- hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
+- unsigned char *buffer;
++ int iid, nrids, nacols, opened;
++ struct {
++ int32_t rid;
++ int size;
++ } rids[MAXRIDS];
++ struct UsbMseAcol {
++ InputInfoPtr pInfo;
++ int nlcols, nbuttons, hasZ, hasW;
++ int xmin, xmax, ymin, ymax, pmin, pmax, px, py;
++ int cxmin, cxmax, cymin, cymax, cpmin, cpmax;
++ struct UsbMseLcol {
++ hid_item_t loc_x; /* x locator item */
++ hid_item_t loc_y; /* y locator item */
++ hid_item_t loc_z; /* z (wheel) locator item */
++ hid_item_t loc_w; /* w (hwheel) locator item */
++ hid_item_t loc_p; /* Tip Pressure */
++ hid_item_t loc_valid; /* Touch Valid */
++ hid_item_t loc_in_range; /* In Range */
++ hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
++ } lcols[MAXLCOLS];
++ hid_item_t loc_cc; /* contact count */
++ } acols[MAXACOLS];
++ unsigned char *buffer;
+ } UsbMseRec, *UsbMsePtr;
+
++static int *
++usbGetReportSizePtr(UsbMsePtr pUsbMse, int32_t rid)
++{
++ int i;
++
++ for (i = 0; i < pUsbMse->nrids; i++) {
++ if (pUsbMse->rids[i].rid == rid)
++ return (&pUsbMse->rids[i].size);
++ }
++ for (i = 0; i < MAXRIDS; i++) {
++ if (pUsbMse->rids[i].size == 0) {
++ pUsbMse->rids[i].rid = rid;
++ pUsbMse->nrids = max(pUsbMse->nrids, i + 1);
++ return (&pUsbMse->rids[i].size);
++ }
++ }
++ return (NULL);
++}
++
+ static int
+ usbMouseProc(DeviceIntPtr pPointer, int what)
+ {
+ InputInfoPtr pInfo;
+ MouseDevPtr pMse;
+ UsbMsePtr pUsbMse;
++ struct UsbMseAcol *acol;
+ unsigned char map[MSE_MAXBUTTONS + 1];
+- int nbuttons;
++ int nacol, nbuttons;
++#ifdef HAVE_LABELS
++ Atom btn_labels[MSE_MAXBUTTONS] = {0};
++ Atom axes_labels[3] = { 0, 0, 0 };
++#endif
+
+ pInfo = pPointer->public.devicePrivate;
+ pMse = pInfo->private;
+ pMse->device = pPointer;
+ pUsbMse = pMse->mousePriv;
++ for (nacol = 0; nacol < (pUsbMse->nacols - 1); nacol++) {
++ if (pUsbMse->acols[nacol].pInfo == pInfo)
++ break;
++ }
++ acol = &pUsbMse->acols[nacol];
+
+ switch (what) {
+ case DEVICE_INIT:
+@@ -518,40 +637,96 @@ usbMouseProc(DeviceIntPtr pPointer, int what)
+ for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
+ map[nbuttons + 1] = nbuttons + 1;
+
+- InitPointerDeviceStruct((DevicePtr)pPointer,
+- map,
+- min(pMse->buttons, MSE_MAXBUTTONS),
+- miPointerGetMotionEvents,
+- pMse->Ctrl,
+- miPointerGetMotionBufferSize());
++#ifdef HAVE_LABELS
++ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
++ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
++ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
++ axes_labels[0] = XIGetKnownProperty((acol->xmin != acol->xmax)
++ ? AXIS_LABEL_PROP_ABS_X : AXIS_LABEL_PROP_REL_X);
++ axes_labels[1] = XIGetKnownProperty((acol->xmin != acol->xmax)
++ ? AXIS_LABEL_PROP_ABS_Y : AXIS_LABEL_PROP_REL_Y);
++ axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE);
++#endif
+
++ InitButtonClassDeviceStruct(pPointer, min(pMse->buttons, MSE_MAXBUTTONS),
++#ifdef HAVE_LABELS
++ btn_labels,
++#endif
++ map);
++ InitValuatorClassDeviceStruct(pPointer, (acol->pmin != acol->pmax) ? 3 : 2,
++#ifdef HAVE_LABELS
++ axes_labels,
++#endif
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
++ miPointerGetMotionEvents,
++#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
++ GetMotionHistory,
++#endif
++ GetMotionHistorySize(),
++ (acol->xmin != acol->xmax || acol->ymin != acol->ymax) ?
++ Absolute : Relative);
++ InitPtrFeedbackClassDeviceStruct(pPointer, pMse->Ctrl);
++
+ /* X valuator */
+- xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
++ xf86InitValuatorAxisStruct(pPointer, 0,
++#ifdef HAVE_LABELS
++ axes_labels[0],
++#endif
++ (acol->xmin != acol->xmax) ? acol->xmin : -1,
++ (acol->xmin != acol->xmax) ? acol->xmax : -1,
++ 1, 0, 1
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ , (acol->xmin != acol->xmax) ? Absolute : Relative
++#endif
++ );
+ xf86InitValuatorDefaults(pPointer, 0);
+ /* Y valuator */
+- xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
++ xf86InitValuatorAxisStruct(pPointer, 1,
++#ifdef HAVE_LABELS
++ axes_labels[1],
++#endif
++ (acol->ymin != acol->ymax) ? acol->ymin : -1,
++ (acol->ymin != acol->ymax) ? acol->ymax : -1,
++ 1, 0, 1
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ , (acol->ymin != acol->ymax) ? Absolute : Relative
++#endif
++ );
+ xf86InitValuatorDefaults(pPointer, 1);
++ /* Pressure valuator */
++ if (acol->pmin != acol->pmax) {
++ xf86InitValuatorAxisStruct(pPointer, 2,
++#ifdef HAVE_LABELS
++ axes_labels[2],
++#endif
++ acol->pmin, acol->pmax, 1, 0, 1
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ , Absolute
++#endif
++ );
++ xf86InitValuatorDefaults(pPointer, 2);
++ }
+ xf86MotionHistoryAllocate(pInfo);
+ break;
+
+ case DEVICE_ON:
+- pInfo->fd = xf86OpenSerial(pInfo->options);
+- if (pInfo->fd == -1)
+- xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+- else {
+- pMse->buffer = XisbNew(pInfo->fd, pUsbMse->packetSize);
+- if (!pMse->buffer) {
+- free(pMse);
+- xf86CloseSerial(pInfo->fd);
+- pInfo->fd = -1;
+- } else {
+- xf86FlushInput(pInfo->fd);
+-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 23
+- if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput,
+- pInfo))
+-#endif
+- AddEnabledDevice(pInfo->fd);
+- }
++ if (pUsbMse->opened++ == 0) {
++ pInfo->fd = xf86OpenSerial(pInfo->options);
++ if (pInfo->fd == -1)
++ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
++ else {
++ pMse->buffer = XisbNew(pInfo->fd, pUsbMse->packetSize);
++ if (!pMse->buffer) {
++ free(pMse);
++ xf86CloseSerial(pInfo->fd);
++ pInfo->fd = -1;
++ } else {
++ xf86FlushInput(pInfo->fd);
++ if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput,
++ pInfo))
++ xf86AddEnabledDevice(pInfo);
++ }
++ }
+ }
+ pMse->lastButtons = 0;
+ pMse->lastMappedButtons = 0;
+@@ -562,7 +737,7 @@ usbMouseProc(DeviceIntPtr pPointer, int what)
+ case DEVICE_OFF:
+ case DEVICE_CLOSE:
+ if (pInfo->fd != -1) {
+- RemoveEnabledDevice(pInfo->fd);
++ xf86RemoveEnabledDevice(pInfo);
+ if (pUsbMse->packetSize > 8 && pUsbMse->buffer) {
+ free(pUsbMse->buffer);
+ }
+@@ -573,6 +748,7 @@ usbMouseProc(DeviceIntPtr pPointer, int what)
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ }
++ pUsbMse->opened--;
+ pPointer->public.on = FALSE;
+ usleep(300000);
+ break;
+@@ -588,45 +764,154 @@ usbReadInput(InputInfoPtr pInfo)
+ {
+ MouseDevPtr pMse;
+ UsbMsePtr pUsbMse;
+- int buttons = pMse->lastButtons;
+- int dx = 0, dy = 0, dz = 0, dw = 0;
+- int n, c;
++ int buttons, cc;
++ int dx, dy, dz, dw, dp, upd, v, nx, ny, np, in_range;
++ int n, c, rid, *sizep, nacol, nlcol;
+ unsigned char *pBuf;
++ struct UsbMseAcol *acol;
++ struct UsbMseLcol *lcol;
+
+ pMse = pInfo->private;
+ pUsbMse = pMse->mousePriv;
+
+ XisbBlockDuration(pMse->buffer, -1);
++next:
+ pBuf = pUsbMse->buffer;
+ n = 0;
+- while ((c = XisbRead(pMse->buffer)) >= 0 && n < pUsbMse->packetSize) {
++ if (pUsbMse->iid) {
++ rid = XisbRead(pMse->buffer);
++ if (rid < 0)
++ return;
++ pBuf[n++] = (unsigned char)rid;
++ } else
++ rid = 0;
++ sizep = usbGetReportSizePtr(pUsbMse, rid);
++ if (sizep == NULL || *sizep == 0) {
++ xf86Msg(X_WARNING, "%s: unknown report ID %d\n", pInfo->name, rid);
++ goto next;
++ }
++ while (n < *sizep && (c = XisbRead(pMse->buffer)) >= 0) {
+ pBuf[n++] = (unsigned char)c;
+ }
+ if (n == 0)
+ return;
+- if (n != pUsbMse->packetSize) {
++// xf86MsgVerb(X_INFO, 3, "pkt: %d %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
++// n, pBuf[0], pBuf[1], pBuf[2], pBuf[3], pBuf[4], pBuf[5], pBuf[6], pBuf[7], pBuf[8], pBuf[9]);
++ if (n != *sizep) {
+ LogMessageVerbSigSafe(X_WARNING, -1,
+ "%s: incomplete packet, size %d\n",
+ pInfo->name, n);
+ }
+- /* discard packets with an id that don't match the mouse */
+- /* XXX this is probably not the right thing */
+- if (pUsbMse->iid != 0) {
+- if (*pBuf++ != pUsbMse->iid)
+- return;
+- }
+- dx = hid_get_data(pBuf, &pUsbMse->loc_x);
+- dy = hid_get_data(pBuf, &pUsbMse->loc_y);
+- dz = hid_get_data(pBuf, &pUsbMse->loc_z);
+- dw = hid_get_data(pBuf, &pUsbMse->loc_w);
++ for (nacol = 0; nacol < pUsbMse->nacols; nacol++) {
++ acol = &pUsbMse->acols[nacol];
++ if (acol->pInfo == NULL)
++ continue;
++ nx = ny = np = upd = 0;
++ buttons = cc = 0;
++ dx = dy = dz = dw = dp = 0;
++ for (nlcol = 0; nlcol < pUsbMse->acols[nacol].nlcols; nlcol++) {
++ lcol = &acol->lcols[nlcol];
+
+- buttons = 0;
+- for (n = 0; n < pMse->buttons; n++) {
+- if (hid_get_data(pBuf, &pUsbMse->loc_btn[n]))
+- buttons |= (1 << UMS_BUT(n));
++ if (lcol->loc_valid.usage != 0 && rid == lcol->loc_valid.report_ID &&
++ hid_get_data(pBuf, &lcol->loc_valid) == 0)
++ continue;
++ if (lcol->loc_in_range.usage != 0 && rid == lcol->loc_in_range.report_ID)
++ in_range = hid_get_data(pBuf, &lcol->loc_in_range);
++ else
++ in_range = 1;
++ if (in_range && lcol->loc_x.usage != 0 && rid == lcol->loc_x.report_ID && nx == 0) {
++ v = hid_get_data(pBuf, &lcol->loc_x);
++ if (acol->xmin != acol->xmax) {
++ v = xf86ScaleAxis(v, acol->xmax, acol->xmin,
++ lcol->loc_x.logical_maximum, lcol->loc_x.logical_minimum);
++ if (acol->cxmin != acol->cxmax)
++ v = xf86ScaleAxis(v, acol->xmax, acol->xmin,
++ acol->cxmax, acol->cxmin);
++ }
++ dx += v;
++ nx++;
++ }
++ if (in_range && lcol->loc_y.usage != 0 && rid == lcol->loc_y.report_ID && ny == 0) {
++ v = hid_get_data(pBuf, &lcol->loc_y);
++ if (acol->xmin != acol->xmax) {
++ v = xf86ScaleAxis(v, acol->ymax, acol->ymin,
++ lcol->loc_y.logical_maximum, lcol->loc_y.logical_minimum);
++ if (acol->cymin != acol->cymax)
++ v = xf86ScaleAxis(v, acol->ymax, acol->ymin,
++ acol->cymax, acol->cymin);
++ }
++ dy += v;
++ ny++;
++ }
++ if (lcol->loc_z.usage != 0 && rid == lcol->loc_z.report_ID) {
++ dz -= hid_get_data(pBuf, &lcol->loc_z);
++ upd = 1;
++ }
++ if (lcol->loc_w.usage != 0 && rid == lcol->loc_w.report_ID) {
++ dw += hid_get_data(pBuf, &lcol->loc_w);
++ upd = 1;
++ }
++ if (lcol->loc_p.usage != 0 && rid == lcol->loc_p.report_ID && np == 0) {
++ v = hid_get_data(pBuf, &lcol->loc_p);
++ v = xf86ScaleAxis(v, acol->pmax, acol->pmin,
++ lcol->loc_p.logical_maximum, lcol->loc_p.logical_minimum);
++ if (acol->cpmin != acol->cpmax)
++ v = xf86ScaleAxis(v, acol->pmax, acol->pmin,
++ acol->cpmax, acol->cpmin);
++ dp += v;
++ np++;
++ }
++
++ for (n = 0; n < acol->nbuttons; n++) {
++ if (lcol->loc_btn[n].usage != 0 && rid == lcol->loc_btn[n].report_ID) {
++ if (hid_get_data(pBuf, &lcol->loc_btn[n]))
++ buttons |= (1 << UMS_BUT(n));
++ upd = 1;
++ }
++ }
++ }
++ if (acol->loc_cc.usage != 0 && rid == acol->loc_cc.report_ID)
++ cc = hid_get_data(pBuf, &acol->loc_cc);
++ else
++ cc = (nx || ny) ? 1 : 0;
++ if (cc > 1)
++ buttons = (1 << UMS_BUT(1));
++ if (nx != 0 && acol->xmin != acol->xmax)
++ dx /= nx;
++ if (ny != 0 && acol->ymin != acol->ymax)
++ dy /= ny;
++ if (np != 0 && acol->pmin != acol->pmax)
++ dp /= np;
++// if (upd || nx || ny || np)
++// xf86MsgVerb(X_INFO, 3, "%d cc %d dx %d dy %d dz %d dw %d press %d buttons %02x\n",
++// nacol, cc, dx, dy, dz, dw, dp, buttons);
++ if (nx != 0 || ny != 0) {
++ if (acol->pmin != acol->pmax) {
++ xf86PostMotionEvent(acol->pInfo->dev,
++ /* is_absolute: */ TRUE,
++ /* first_valuator: */ 0,
++ /* num_valuators: */ 3,
++ dx, dy, dp);
++ } else if (acol->xmin != acol->xmax || acol->ymin != acol->ymax) {
++ xf86PostMotionEvent(acol->pInfo->dev,
++ /* is_absolute: */ TRUE,
++ /* first_valuator: */ 0,
++ /* num_valuators: */ 2,
++ dx, dy);
++ }
++ }
++ if (upd || (nx != 0) || (ny != 0)) {
++ ((MouseDevPtr)acol->pInfo->private)->PostEvent(acol->pInfo, buttons,
++ ((acol->xmin != acol->xmax) ? dx - acol->px : dx),
++ ((acol->ymin != acol->ymax) ? dy - acol->py : dy),
++ dz, dw);
++ }
++ if (nx > 0)
++ acol->px = dx;
++ if (ny > 0)
++ acol->py = dy;
+ }
+- pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
+- return;
++ goto next;
+ }
+
+ static void
+@@ -635,14 +920,17 @@ usbSigioReadInput (int fd, void *closure)
+ usbReadInput ((InputInfoPtr) closure);
+ }
+
+-/* This function is called when the protocol is "usb". */
+ static Bool
+-usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
++usbInitFirst(InputInfoPtr pInfo)
+ {
+ MouseDevPtr pMse = pInfo->private;
+ UsbMsePtr pUsbMse;
+ report_desc_t reportDesc;
+- int i;
++ hid_data_t d;
++ hid_item_t h;
++ struct UsbMseAcol *acol;
++ struct UsbMseLcol *lcol;
++ int mdepth, rsize, *rsizep, acolused, lcolused, used;
+
+ pUsbMse = malloc(sizeof(UsbMseRec));
+ if (pUsbMse == NULL) {
+@@ -654,13 +942,8 @@
+ return FALSE;
+ }
+
+- pMse->protocol = protocol;
+- xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
++ bzero(pUsbMse, sizeof(UsbMseRec));
+
+- /* Collect the options, and process the common options. */
+- xf86CollectInputOptions(pInfo, NULL);
+- xf86ProcessCommonOptions(pInfo, pInfo->options);
+-
+ /* Check if the device can be opened. */
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1) {
+@@ -672,19 +955,134 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, i
+ }
+ /* Get USB informations */
+ reportDesc = hid_get_report_desc(pInfo->fd);
+- /* Get packet size & iid */
+-#ifdef USB_NEW_HID
+- if (ioctl(pInfo->fd, USB_GET_REPORT_ID, &pUsbMse->iid) == -1) {
+- xf86Msg(X_ERROR, "Error ioctl USB_GET_REPORT_ID on %s : %s\n",
+- pInfo->name, strerror(errno));
+- return FALSE;
++ mdepth = 0;
++ pUsbMse->nacols = 0;
++ acol = &pUsbMse->acols[pUsbMse->nacols];
++ lcol = &acol->lcols[acol->nlcols];
++ acolused = 0;
++ lcolused = 0;
++ d = hid_start_parse(reportDesc, (1 << hid_input) |
++ (1 << hid_collection) | (1 << hid_endcollection), -1);
++ while (hid_get_item(d, &h)) {
++ switch (h.kind) {
++ case hid_collection:
++ if (mdepth != 0)
++ mdepth++;
++ else if (h.collection == 1 &&
++ (h.usage == 0x00010001 || h.usage == 0x00010002 ||
++ (h.usage >= 0x000d0001 && h.usage <= 0x000d000d))) {
++ mdepth++;
++ if (acolused) {
++ if (lcolused) {
++ acol->nlcols++;
++ lcolused = 0;
++ }
++ pUsbMse->nacols++;
++ acolused = 0;
++ acol = &pUsbMse->acols[pUsbMse->nacols];
++ lcol = &acol->lcols[acol->nlcols];
++ }
++ }
++ if (lcolused && (h.collection == 0 ||
++ h.collection == 2 || h.collection == 3)) {
++ acol->nlcols++;
++ lcolused = 0;
++ lcol = &acol->lcols[acol->nlcols];
++ }
++ break;
++ case hid_endcollection:
++ if (mdepth != 0)
++ mdepth--;
++ break;
++ case hid_input:
++ if (h.report_ID != 0)
++ pUsbMse->iid = 1;
++ rsize = pUsbMse->iid +
++ (h.pos + (h.report_size * h.report_count) + 7) / 8;
++ if ((rsizep = usbGetReportSizePtr(pUsbMse, h.report_ID)) != NULL)
++ *rsizep = max(*rsizep, rsize);
++ pUsbMse->packetSize = max(pUsbMse->packetSize, rsize);
++ if (mdepth == 0)
++ break;
++ used = 1;
++ if (h.usage == 0x00010030) { /* X */
++ lcol->loc_x = h;
++ if ((h.flags & 0x04) == 0) {
++ if (acol->xmin == acol->xmax) {
++ acol->xmin = h.logical_minimum;
++ acol->xmax = h.logical_maximum;
++ } else {
++ acol->xmin = min(acol->xmin, h.logical_minimum);
++ acol->xmax = max(acol->xmax, h.logical_maximum);
++ }
++ }
++ } else if (h.usage == 0x00010031) { /* Y */
++ lcol->loc_y = h;
++ if ((h.flags & 0x04) == 0) {
++ if (acol->ymin == acol->ymax) {
++ acol->ymin = h.logical_minimum;
++ acol->ymax = h.logical_maximum;
++ } else {
++ acol->ymin = min(acol->ymin, h.logical_minimum);
++ acol->ymax = max(acol->ymax, h.logical_maximum);
++ }
++ }
++ } else if (h.usage == 0x00010038) { /* Z */
++ lcol->loc_z = h;
++ acol->hasZ = 1;
++ } else if (h.usage == 0x000c0238) { /* W */
++ lcol->loc_w = h;
++ acol->hasW = 1;
++ } else if (h.usage == 0x000d0030) { /* Press */
++ lcol->loc_p = h;
++ if ((h.flags & 0x04) == 0) {
++ if (acol->pmin == acol->pmax) {
++ acol->pmin = h.logical_minimum;
++ acol->pmax = h.logical_maximum;
++ } else {
++ acol->pmin = min(acol->pmin, h.logical_minimum);
++ acol->pmax = max(acol->pmax, h.logical_maximum);
++ }
++ }
++ } else if (h.usage == 0x000d0032) /* In Range */
++ lcol->loc_in_range = h;
++ else if (h.usage == 0x000d0047) /* Valid */
++ lcol->loc_valid = h;
++ else if (h.usage > 0x00090000 &&
++ h.usage <= 0x00090000 + MSE_MAXBUTTONS) { /* Buttons */
++ lcol->loc_btn[(h.usage & 0xffff) - 1] = h;
++ acol->nbuttons = max(acol->nbuttons, h.usage & 0xffff);
++ } else if (h.usage == 0x000d0042) { /* Tip Switch */
++ lcol->loc_btn[0] = h;
++ acol->nbuttons = max(acol->nbuttons, 1);
++ } else if (h.usage == 0x000d0044) { /* Barrel Switch */
++ lcol->loc_btn[1] = h;
++ acol->nbuttons = max(acol->nbuttons, 2);
++ } else if (h.usage == 0x000d0045) { /* Eraser */
++ lcol->loc_btn[3] = h;
++ acol->nbuttons = max(acol->nbuttons, 4);
++ } else if (h.usage == 0x000d0046) { /* Tablet Pick */
++ lcol->loc_btn[2] = h;
++ acol->nbuttons = max(acol->nbuttons, 3);
++ } else if (h.usage == 0x000d0054) /* Contact Count */
++ acol->loc_cc = h;
++ else
++ used = 0;
++ lcolused += used;
++ acolused += used;
++ break;
++ default:
++ break;
++ }
+ }
+- pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
+- pUsbMse->iid);
+-#else
+- pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
+- &pUsbMse->iid);
+-#endif
++ if (lcolused)
++ acol->nlcols++;
++ if (acolused)
++ pUsbMse->nacols++;
++ hid_end_parse(d);
++ xf86Msg(X_DEFAULT, "%s: Found %d usable logical collections\n",
++ pInfo->name, pUsbMse->nacols);
++
+ /* Allocate buffer */
+ if (pUsbMse->packetSize <= 8) {
+ pUsbMse->buffer = pMse->protoBuf;
+@@ -694,56 +1092,129 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, i
+ if (pUsbMse->buffer == NULL) {
+ xf86Msg(X_ERROR, "%s: cannot allocate buffer\n", pInfo->name);
+ free(pUsbMse);
+- free(pMse);
+ xf86CloseSerial(pInfo->fd);
+ return FALSE;
+ }
+-#ifdef USB_NEW_HID
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
+- hid_input, &pUsbMse->loc_x, pUsbMse->iid) < 0) {
+- xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
+- }
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
+- hid_input, &pUsbMse->loc_y, pUsbMse->iid) < 0) {
+- xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
+- }
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
+- hid_input, &pUsbMse->loc_z, pUsbMse->iid) < 0) {
+- }
+-#else
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
+- hid_input, &pUsbMse->loc_x) < 0) {
+- xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
+- }
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
+- hid_input, &pUsbMse->loc_y) < 0) {
+- xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
+- }
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
+- hid_input, &pUsbMse->loc_z) < 0) {
+- }
+-#endif
+- /* Probe for number of buttons */
+- for (i = 1; i <= MSE_MAXBUTTONS; i++) {
+- if (!hid_locate(reportDesc, HID_USAGE2(HUP_BUTTON, i),
+- hid_input, &pUsbMse->loc_btn[i-1]
+-#ifdef USB_NEW_HID
+- , pUsbMse->iid
+-#endif
+- ))
+- break;
+- }
+- pMse->buttons = i-1;
+
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+
+ /* Private structure */
+ pMse->mousePriv = pUsbMse;
++ return TRUE;
++}
+
++/* This function is called when the protocol is "usb". */
++static Bool
++usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
++{
++ InputInfoPtr pMatch;
++ MouseDevPtr pMse = pInfo->private;
++ UsbMsePtr pUsbMse;
++ struct UsbMseAcol *acol;
++ char *str;
++ int i, colopt;
++
++ pMse->protocol = protocol;
++ xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
++
++ /* Collect the options, and process the common options. */
++ xf86CollectInputOptions(pInfo, NULL);
++ xf86ProcessCommonOptions(pInfo, pInfo->options);
++
++ /* Check if this HID device is already opened. */
++ for (pMatch = xf86FirstLocalDevice(); pMatch != NULL; pMatch = pMatch->next) {
++ if ((pInfo != pMatch) && strstr(pMatch->drv->driverName, "mouse")) {
++ char *dev1, *dev2;
++
++ dev1 = xf86SetStrOption(pInfo->options, "Device", NULL);
++ dev2 = xf86SetStrOption(pMatch->options, "Device", NULL);
++ if (strcmp(dev1, dev2) == 0) {
++ free(dev1);
++ free(dev2);
++ break;
++ }
++ free(dev1);
++ free(dev2);
++ }
++ }
++ if (pMatch == NULL) {
++ xf86Msg(X_DEFAULT, "%s: Opening new HID device\n", pInfo->name);
++ if (!usbInitFirst(pInfo)) {
++ free(pMse);
++ return FALSE;
++ }
++ } else {
++ pMse->mousePriv = ((MouseDevPtr)pMatch->private)->mousePriv;
++ xf86Msg(X_DEFAULT, "%s: Attaching to already opened HID device\n",
++ pInfo->name);
++ }
++ pUsbMse = pMse->mousePriv;
++
++ /* Attach to collection, respecting "Collection" option. */
++ colopt = xf86SetIntOption(pInfo->options, "Collection", 0);
++ for (i = 0; i < pUsbMse->nacols; i++) {
++ if (pUsbMse->acols[i].pInfo == NULL &&
++ (colopt == 0 || i == colopt - 1)) {
++ pUsbMse->acols[i].pInfo = pInfo;
++ break;
++ }
++ }
++ xf86Msg(colopt == 0 ? X_DEFAULT : X_CONFIG,
++ "%s: Collection: %d\n", pInfo->name,
++ i == pUsbMse->nacols ? colopt : i + 1);
++ if (i == pUsbMse->nacols) {
++ xf86Msg(X_ERROR,
++ "%s: Application collection not found or already handled\n",
++ pInfo->name);
++ free(pMse);
++ return FALSE;
++ }
++
++ acol = &pUsbMse->acols[i];
++ pMse->buttons = acol->nbuttons;
++ if (pMse->buttons == 2)
++ pMse->buttons = 3;
++ if (acol->xmin != acol->xmax || acol->ymin != acol->ymax)
++ pMse->disableXY = TRUE;
++ pMse->hasZ = acol->hasZ;
++ pMse->hasW = acol->hasW;
++
+ /* Process common mouse options (like Emulate3Buttons, etc). */
+ pMse->CommonOptions(pInfo);
+
++ /* Process "Calibration" option. */
++ str = xf86CheckStrOption(pInfo->options, "Calibration", NULL);
++ if (str != NULL && (acol->xmin != acol->xmax || acol->ymin != acol->ymax)) {
++ int j, xmin, xmax, ymin, ymax, pmin, pmax;
++
++ j = sscanf(str, "%d %d %d %d %d %d", &xmin, &xmax, &ymin, &ymax, &pmin, &pmax);
++ if (j == 4) {
++ xf86Msg(X_CONFIG, "%s: Calibration: %d %d %d %d\n",
++ pInfo->name, xmin, xmax, ymin, ymax);
++ acol->cxmin = xmin;
++ acol->cxmax = xmax;
++ acol->cymin = ymin;
++ acol->cymax = ymax;
++ } else if (j == 6) {
++ xf86Msg(X_CONFIG, "%s: Calibration: %d %d %d %d %d %d\n",
++ pInfo->name, xmin, xmax, ymin, ymax, pmin, pmax);
++ acol->cxmin = xmin;
++ acol->cxmax = xmax;
++ acol->cymin = ymin;
++ acol->cymax = ymax;
++ acol->cpmin = pmin;
++ acol->cpmax = pmax;
++ } else
++ xf86Msg(X_WARNING, "%s: Calibration: Invalid arguments\n",
++ pInfo->name);
++ free(str);
++ } else if (acol->xmin != acol->xmax || acol->ymin != acol->ymax) {
++ xf86Msg(X_DEFAULT, "%s: Calibration: %d %d %d %d %d %d\n",
++ pInfo->name, acol->xmin, acol->xmax, acol->ymin, acol->ymax,
++ acol->pmin, acol->pmax);
++ }
++
+ /* Setup the local procs. */
+ pInfo->device_control = usbMouseProc;
+ pInfo->read_input = usbReadInput;
+@@ -786,7 +1257,9 @@ OSMouseInit(int flags)
+ p->CheckProtocol = CheckProtocol;
+ #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)) && defined(MOUSE_PROTO_SYSMOUSE)
+ p->SetupAuto = SetupAuto;
++#ifndef XPS2_SUPPORT
+ p->SetPS2Res = SetSysMouseRes;
++#endif
+ p->SetBMRes = SetSysMouseRes;
+ p->SetMiscRes = SetSysMouseRes;
+ #endif
diff --git a/x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mouse.c b/x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mouse.c
new file mode 100644
index 000000000000..a8732cae08f5
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mouse.c
@@ -0,0 +1,196 @@
+--- src/mouse.c.orig 2018-06-19 04:36:21 UTC
++++ src/mouse.c
+@@ -304,13 +304,39 @@ MouseCommonOptions(InputInfoPtr pInfo)
+
+ pMse = pInfo->private;
+
+- pMse->buttons = xf86SetIntOption(pInfo->options, "Buttons", 0);
++ i = xf86SetIntOption(pInfo->options, "Buttons", 0);
++ if (i != 0)
++ pMse->buttons = i;
+ if (!pMse->buttons) {
+ pMse->buttons = MSE_DFLTBUTTONS;
+ buttons_from = X_DEFAULT;
+ }
+ origButtons = pMse->buttons;
+
++ s = xf86SetStrOption(pInfo->options, "ButtonMapping", NULL);
++ if (s) {
++ int b, n = 0;
++ char *s1 = s;
++ /* keep getting numbers which are buttons */
++ while (s1 && n < MSE_MAXBUTTONS && (b = strtol(s1, &s1, 10)) != 0) {
++ /* check sanity for a button */
++ if (b < 0 || b > MSE_MAXBUTTONS) {
++ xf86Msg(X_WARNING,
++ "ButtonMapping: Invalid button number = %d\n", b);
++ break;
++ }
++ pMse->buttonMap[n++] = 1 << (b-1);
++ if (b > pMse->buttons) pMse->buttons = b;
++ }
++ free(s);
++ }
++ /* get maximum of mapped buttons */
++ for (i = pMse->buttons-1; i >= 0; i--) {
++ int f = ffs (pMse->buttonMap[i]);
++ if (f > pMse->buttons)
++ pMse->buttons = f;
++ }
++
+ pMse->emulate3Buttons = xf86SetBoolOption(pInfo->options,
+ "Emulate3Buttons", FALSE);
+ if (!xf86FindOptionValue(pInfo->options,"Emulate3Buttons")) {
+@@ -322,6 +348,8 @@ MouseCommonOptions(InputInfoPtr pInfo)
+ "Emulate3Timeout", 50);
+ if (pMse->emulate3Buttons || pMse->emulate3ButtonsSoft) {
+ MessageType from = X_CONFIG;
++ if (pMse->buttons < 3)
++ pMse->buttons = 3;
+ if (pMse->emulate3ButtonsSoft)
+ from = X_DEFAULT;
+ xf86Msg(from, "%s: Emulate3Buttons, Emulate3Timeout: %d\n",
+@@ -329,6 +357,8 @@ MouseCommonOptions(InputInfoPtr pInfo)
+ }
+
+ pMse->chordMiddle = xf86SetBoolOption(pInfo->options, "ChordMiddle", FALSE);
++ if (pMse->chordMiddle && pMse->buttons < 3)
++ pMse->buttons = 3;
+ pMse->flipXY = xf86SetBoolOption(pInfo->options, "FlipXY", FALSE);
+ if (xf86SetBoolOption(pInfo->options, "InvX", FALSE)) {
+ pMse->invX = -1;
+@@ -339,8 +369,8 @@ MouseCommonOptions(InputInfoPtr pInfo)
+ } else
+ pMse->invY = 1;
+ pMse->angleOffset = xf86SetIntOption(pInfo->options, "AngleOffset", 0);
++ pMse->sensitivity = xf86SetRealOption(pInfo->options, "Sensitivity", 1.0);
+
+-
+ if (pMse->pDragLock)
+ free(pMse->pDragLock);
+ pMse->pDragLock = NULL;
+@@ -449,14 +479,17 @@ MouseCommonOptions(InputInfoPtr pInfo)
+ free(s);
+ }
+
+- s = xf86SetStrOption(pInfo->options, "ZAxisMapping", "4 5");
++ s = xf86SetStrOption(pInfo->options, "ZAxisMapping",
++ pMse->hasZ ? ( pMse->hasW ? "4 5 6 7" : "4 5" ) : "off");
+ if (s) {
+ int b1 = 0, b2 = 0, b3 = 0, b4 = 0;
+ char *msg = NULL;
+
+ pMse->negativeZ = pMse->positiveZ = MSE_NOAXISMAP;
+ pMse->negativeW = pMse->positiveW = MSE_NOAXISMAP;
+- if (!xf86NameCmp(s, "x")) {
++ if (!xf86NameCmp(s, "off")) {
++ msg = xstrdup("off");
++ } else if (!xf86NameCmp(s, "x")) {
+ pMse->negativeZ = pMse->positiveZ = MSE_MAPTOX;
+ msg = xstrdup("X axis");
+ } else if (!xf86NameCmp(s, "y")) {
+@@ -605,29 +638,6 @@ MouseCommonOptions(InputInfoPtr pInfo)
+ pInfo->name, wheelButton, pMse->wheelInertia,
+ pMse->wheelButtonTimeout);
+ }
+- s = xf86SetStrOption(pInfo->options, "ButtonMapping", NULL);
+- if (s) {
+- int b, n = 0;
+- char *s1 = s;
+- /* keep getting numbers which are buttons */
+- while (s1 && n < MSE_MAXBUTTONS && (b = strtol(s1, &s1, 10)) != 0) {
+- /* check sanity for a button */
+- if (b < 0 || b > MSE_MAXBUTTONS) {
+- xf86Msg(X_WARNING,
+- "ButtonMapping: Invalid button number = %d\n", b);
+- break;
+- }
+- pMse->buttonMap[n++] = 1 << (b-1);
+- if (b > pMse->buttons) pMse->buttons = b;
+- }
+- free(s);
+- }
+- /* get maximum of mapped buttons */
+- for (i = pMse->buttons-1; i >= 0; i--) {
+- int f = ffs (pMse->buttonMap[i]);
+- if (f > pMse->buttons)
+- pMse->buttons = f;
+- }
+ if (origButtons != pMse->buttons)
+ buttons_from = X_CONFIG;
+ xf86Msg(buttons_from, "%s: Buttons: %d\n", pInfo->name, pMse->buttons);
+@@ -709,7 +719,6 @@ MouseHWOptions(InputInfoPtr pInfo)
+ }
+ pMse->sampleRate = xf86SetIntOption(pInfo->options, "SampleRate", 0);
+ pMse->resolution = xf86SetIntOption(pInfo->options, "Resolution", 0);
+- mPriv->sensitivity = xf86SetRealOption(pInfo->options, "Sensitivity", 1.0);
+ }
+
+ static void
+@@ -996,6 +1005,8 @@ MousePreInit(InputDriverPtr drv, InputInfoPtr pInfo, i
+ /* Default Mapping: 1 2 3 8 9 10 11 ... */
+ for (i = 0; i < MSE_MAXBUTTONS; i++)
+ pMse->buttonMap[i] = 1 << (i > 2 && i < MSE_MAXBUTTONS-4 ? i+4 : i);
++ pMse->hasZ = 1;
++ pMse->hasW = 0;
+
+ protocol = MousePickProtocol(pInfo, device, protocol, &protocolID);
+
+@@ -2197,7 +2208,7 @@ MouseDoPostEvent(InputInfoPtr pInfo, int buttons, int
+
+ if (pMse->emulateWheel) {
+ /* Emulate wheel button handling */
+- if(pMse->wheelButton == 0)
++ if (pMse->wheelButton == 0)
+ wheelButtonMask = 0;
+ else
+ wheelButtonMask = 1 << (pMse->wheelButton - 1);
+@@ -2287,6 +2298,9 @@ MouseDoPostEvent(InputInfoPtr pInfo, int buttons, int
+ }
+ }
+ }
++ } else {
++ pMse->wheelXDistance = 0;
++ pMse->wheelYDistance = 0;
+ }
+
+ /* Absorb the mouse movement while the wheel button is pressed. */
+@@ -2304,7 +2318,7 @@ MouseDoPostEvent(InputInfoPtr pInfo, int buttons, int
+ if (pMse->emulate3ButtonsSoft && pMse->emulate3Pending && (dx || dy))
+ buttonTimer(pInfo);
+
+- if (dx || dy)
++ if ((dx || dy) && !pMse->disableXY)
+ xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
+
+ if (change) {
+@@ -2417,12 +2431,10 @@ MousePostEvent(InputInfoPtr pInfo, int truebuttons,
+ int dx, int dy, int dz, int dw)
+ {
+ MouseDevPtr pMse;
+- mousePrivPtr mousepriv;
+ int zbutton = 0, wbutton = 0, zbuttoncount = 0, wbuttoncount = 0;
+ int i, b, buttons = 0;
+
+ pMse = pInfo->private;
+- mousepriv = (mousePrivPtr)pMse->mousePriv;
+
+ if (pMse->protocolID == PROT_MMHIT)
+ b = reverseBits(hitachMap, truebuttons);
+@@ -2515,11 +2527,11 @@ MousePostEvent(InputInfoPtr pInfo, int truebuttons,
+
+ /* Accumulate the scaled dx, dy in the private variables
+ fracdx,fracdy and return the integer number part */
+- if (mousepriv) {
+- mousepriv->fracdx += mousepriv->sensitivity*dx;
+- mousepriv->fracdy += mousepriv->sensitivity*dy;
+- mousepriv->fracdx -= ( dx=(int)(mousepriv->fracdx) );
+- mousepriv->fracdy -= ( dy=(int)(mousepriv->fracdy) );
++ if (pMse->sensitivity != 0) {
++ pMse->fracdx += pMse->sensitivity*dx;
++ pMse->fracdy += pMse->sensitivity*dy;
++ pMse->fracdx -= ( dx=(int)(pMse->fracdx) );
++ pMse->fracdy -= ( dy=(int)(pMse->fracdy) );
+ }
+
+ /* If mouse wheel movement has to be mapped on a button, we need to
diff --git a/x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mouse.h b/x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mouse.h
new file mode 100644
index 000000000000..7bd620564018
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mouse.h
@@ -0,0 +1,25 @@
+--- src/mouse.h.orig 2012-10-08 01:40:07 UTC
++++ src/mouse.h
+@@ -220,10 +220,13 @@ typedef struct _MouseDevRec {
+ Bool emulate3ButtonsSoft;
+ int emulate3Timeout;/* Timeout for 3 button emulation */
+ Bool chordMiddle;
++ Bool disableXY;
+ Bool flipXY;
+ int invX;
+ int invY;
+ int resolution;
++ Bool hasW;
++ Bool hasZ;
+ int negativeZ; /* button mask */
+ int positiveZ; /* button mask */
+ int negativeW; /* button mask */
+@@ -262,6 +265,8 @@ typedef struct _MouseDevRec {
+ int doubleClickOldSourceState;
+ int lastMappedButtons;
+ int buttonMap[MSE_MAXBUTTONS];
++ float fracdx,fracdy;
++ float sensitivity;
+ } MouseDevRec, *MouseDevPtr;
+
+ #endif /* _XF86OSMOUSE_H_ */
diff --git a/x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mousePriv.h b/x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mousePriv.h
new file mode 100644
index 000000000000..91e92858dbec
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-mouse/files/patch-src_mousePriv.h
@@ -0,0 +1,11 @@
+--- src/mousePriv.h.orig 2012-05-28 00:01:45 UTC
++++ src/mousePriv.h
+@@ -63,8 +63,6 @@ typedef struct {
+ int acc;
+ CARD32 pnpLast;
+ Bool disablePnPauto;
+- float fracdx,fracdy;
+- float sensitivity;
+ } mousePrivRec, *mousePrivPtr;
+
+ /* mouse proto flags */
diff --git a/x11-drivers/xlibre-xf86-input-mouse/pkg-descr b/x11-drivers/xlibre-xf86-input-mouse/pkg-descr
new file mode 100644
index 000000000000..bceb5d2c8d0a
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-mouse/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-input-mouse driver.
diff --git a/x11-drivers/xlibre-xf86-input-mouse/pkg-plist b/x11-drivers/xlibre-xf86-input-mouse/pkg-plist
new file mode 100644
index 000000000000..2f621f71c03b
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-mouse/pkg-plist
@@ -0,0 +1,4 @@
+include/xorg/xf86-mouse-properties.h
+lib/xorg/modules/xlibre-25.0/input/mouse_drv.so
+libdata/pkgconfig/xorg-mouse.pc
+share/man/man4/mousedrv.4x.gz
diff --git a/x11-drivers/xlibre-xf86-input-synaptics/Makefile b/x11-drivers/xlibre-xf86-input-synaptics/Makefile
new file mode 100644
index 000000000000..dae33618f9e2
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-synaptics/Makefile
@@ -0,0 +1,27 @@
+PORTNAME= xlibre-xf86-input-synaptics
+PORTVERSION= 1.10.0.2
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre synaptics input driver
+WWW= https://github.com/X11Libre/xf86-input-synaptics/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-input-synaptics
+
+USES= pathfix xorg xlibre-cat:driver
+USE_XORG= x11 xtst
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+OPTIONS_DEFINE= EVDEV
+OPTIONS_DEFAULT=EVDEV
+EVDEV_DESC= Use evdev for input events (requires kernel support)
+
+EVDEV_CONFIGURE_ENV= BUILD_EVENTCOMM=yes
+EVDEV_BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto
+EVDEV_LIB_DEPENDS= libevdev.so:devel/libevdev
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-synaptics/distinfo b/x11-drivers/xlibre-xf86-input-synaptics/distinfo
new file mode 100644
index 000000000000..43ea1e486a6b
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-synaptics/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760813265
+SHA256 (xlibre/driver/X11Libre-xf86-input-synaptics-1.10.0.2-xlibre-xf86-input-synaptics-1.10.0.2_GH0.tar.gz) = 3e6bc8453f5f957074db28b12e4826ef65ab017e0dd5e34a29d57692ce0c7fe5
+SIZE (xlibre/driver/X11Libre-xf86-input-synaptics-1.10.0.2-xlibre-xf86-input-synaptics-1.10.0.2_GH0.tar.gz) = 95014
diff --git a/x11-drivers/xlibre-xf86-input-synaptics/files/patch-Makefile.am b/x11-drivers/xlibre-xf86-input-synaptics/files/patch-Makefile.am
new file mode 100644
index 000000000000..823c7b2a2343
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-synaptics/files/patch-Makefile.am
@@ -0,0 +1,7 @@
+--- Makefile.am.orig 2025-07-09 13:10:04 UTC
++++ Makefile.am
+@@ -41,4 +41,3 @@ EXTRA_DIST = README.md
+ dist-hook: ChangeLog INSTALL
+
+ EXTRA_DIST = README.md
+-ACLOCAL_AMFLAGS = -I m4
diff --git a/x11-drivers/xlibre-xf86-input-synaptics/files/patch-configure.ac b/x11-drivers/xlibre-xf86-input-synaptics/files/patch-configure.ac
new file mode 100644
index 000000000000..358e5109bd27
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-synaptics/files/patch-configure.ac
@@ -0,0 +1,10 @@
+--- configure.ac.orig 2025-07-09 13:13:09 UTC
++++ configure.ac
+@@ -28,7 +28,6 @@ AC_CONFIG_HEADERS([config.h])
+ [xf86-input-synaptics])
+ AC_CONFIG_SRCDIR([Makefile.am])
+ AC_CONFIG_HEADERS([config.h])
+-AC_CONFIG_MACRO_DIRS([m4])
+ AC_CONFIG_AUX_DIR(.)
+
+ # Initialize Automake
diff --git a/x11-drivers/xlibre-xf86-input-synaptics/files/patch-src_eventcomm.h b/x11-drivers/xlibre-xf86-input-synaptics/files/patch-src_eventcomm.h
new file mode 100644
index 000000000000..0da0434c6f0b
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-synaptics/files/patch-src_eventcomm.h
@@ -0,0 +1,18 @@
+--- src/eventcomm.h.orig 2015-11-24 23:47:05 UTC
++++ src/eventcomm.h
+@@ -30,7 +30,15 @@
+ #include <xorg-server.h>
+
+ #include <linux/input.h>
++#ifdef __linux__
+ #include <linux/version.h>
++#else
++#undef BUS_NONE
++#undef BUS_PCI
++#undef BUS_SBUS
++#undef BUS_PLATFORM
++#undef BUS_last
++#endif
+ #include <xf86Xinput.h>
+ #include "synproto.h"
+
diff --git a/x11-drivers/xlibre-xf86-input-synaptics/pkg-descr b/x11-drivers/xlibre-xf86-input-synaptics/pkg-descr
new file mode 100644
index 000000000000..f08c8cc85134
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-synaptics/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-input-synaptics driver.
diff --git a/x11-drivers/xlibre-xf86-input-synaptics/pkg-plist b/x11-drivers/xlibre-xf86-input-synaptics/pkg-plist
new file mode 100644
index 000000000000..49e0399af895
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-synaptics/pkg-plist
@@ -0,0 +1,9 @@
+bin/synclient
+bin/syndaemon
+include/xorg/synaptics-properties.h
+lib/xorg/modules/xlibre-25.0/input/synaptics_drv.so
+libdata/pkgconfig/xorg-synaptics.pc
+share/man/man1/synclient.1.gz
+share/man/man1/syndaemon.1.gz
+share/man/man4/synaptics.4x.gz
+share/X11/xorg.conf.d/70-synaptics.conf
diff --git a/x11-drivers/xlibre-xf86-input-vmmouse/Makefile b/x11-drivers/xlibre-xf86-input-vmmouse/Makefile
new file mode 100644
index 000000000000..c4b2afc66179
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-vmmouse/Makefile
@@ -0,0 +1,23 @@
+PORTNAME= xlibre-xf86-input-vmmouse
+PORTVERSION= 13.2.0.2
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre vmmouse input driver
+WWW= https://github.com/X11Libre/xf86-input-vmmouse/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-input-vmmouse
+
+USES= gmake xlibre-cat:driver
+
+GH_TAGNAME= fa6a064
+
+ONLY_FOR_ARCHS= amd64 i386
+ONLY_FOR_ARCHS_REASON= vmmouse protocol is only supported on x86-compatible architectures
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-vmmouse/distinfo b/x11-drivers/xlibre-xf86-input-vmmouse/distinfo
new file mode 100644
index 000000000000..9b23c80b8b43
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-vmmouse/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760830348
+SHA256 (xlibre/driver/X11Libre-xf86-input-vmmouse-13.2.0.2-fa6a064_GH0.tar.gz) = dbbdf597b70dec88143c1c22c98579053c2c782b6f20e4fb276a27dfa874f158
+SIZE (xlibre/driver/X11Libre-xf86-input-vmmouse-13.2.0.2-fa6a064_GH0.tar.gz) = 31247
diff --git a/x11-drivers/xlibre-xf86-input-vmmouse/pkg-descr b/x11-drivers/xlibre-xf86-input-vmmouse/pkg-descr
new file mode 100644
index 000000000000..2fd773ceabc5
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-vmmouse/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-input-vmmouse driver.
diff --git a/x11-drivers/xlibre-xf86-input-vmmouse/pkg-plist b/x11-drivers/xlibre-xf86-input-vmmouse/pkg-plist
new file mode 100644
index 000000000000..d7614b19a4ba
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-vmmouse/pkg-plist
@@ -0,0 +1,8 @@
+bin/vmmouse_detect
+@comment lib/hal/hal-probe-vmmouse
+@comment lib/udev/rules.d/69-xorg-vmmouse.rules
+lib/xorg/modules/xlibre-25.0/input/vmmouse_drv.so
+share/man/man1/vmmouse_detect.1.gz
+share/man/man4/vmmouse.4x.gz
+share/X11/xorg.conf.d/50-vmmouse.conf
+@comment share/hal/fdi/policy/20thirdparty/11-x11-vmmouse.fdi
diff --git a/x11-drivers/xlibre-xf86-input-void/Makefile b/x11-drivers/xlibre-xf86-input-void/Makefile
new file mode 100644
index 000000000000..6aac52ca8e6f
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-void/Makefile
@@ -0,0 +1,18 @@
+PORTNAME= xlibre-xf86-input-void
+PORTVERSION= 1.4.2.2
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre void input driver
+WWW= https://github.com/X11Libre/xf86-input-void/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-input-void
+
+USES= xlibre-cat:driver
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-void/distinfo b/x11-drivers/xlibre-xf86-input-void/distinfo
new file mode 100644
index 000000000000..b9fa89245cb4
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-void/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760813884
+SHA256 (xlibre/driver/X11Libre-xf86-input-void-1.4.2.2-xlibre-xf86-input-void-1.4.2.2_GH0.tar.gz) = f551a1d295a798dca3ad6d9daf45c6d19dc7ed60525f71f090d087152c5b3f7b
+SIZE (xlibre/driver/X11Libre-xf86-input-void-1.4.2.2-xlibre-xf86-input-void-1.4.2.2_GH0.tar.gz) = 11941
diff --git a/x11-drivers/xlibre-xf86-input-void/pkg-descr b/x11-drivers/xlibre-xf86-input-void/pkg-descr
new file mode 100644
index 000000000000..f91860b84dcc
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-void/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-input-void driver.
diff --git a/x11-drivers/xlibre-xf86-input-void/pkg-plist b/x11-drivers/xlibre-xf86-input-void/pkg-plist
new file mode 100644
index 000000000000..ad0c4ddd7a48
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-void/pkg-plist
@@ -0,0 +1,2 @@
+lib/xorg/modules/xlibre-25.0/input/void_drv.so
+share/man/man4/void.4x.gz
diff --git a/x11-drivers/xlibre-xf86-input-wacom/Makefile b/x11-drivers/xlibre-xf86-input-wacom/Makefile
new file mode 100644
index 000000000000..dc52f0102815
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/Makefile
@@ -0,0 +1,41 @@
+PORTNAME= xlibre-xf86-input-wacom
+PORTVERSION= 1.2.3.2
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre legacy Wacom tablet driver
+WWW= https://github.com/X11Libre/xf86-input-wacom/ \
+ https://linuxwacom.github.io/
+
+LICENSE= GPLv2+
+LICENSE_FILE= ${WRKSRC}/GPL
+
+BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto
+RUN_DEPENDS= webcamd>=3.1.0.1:multimedia/webcamd
+
+CONFLICTS_INSTALL= xf86-input-wacom
+
+USES= gmake pathfix xorg xlibre-cat:driver
+USE_XORG= x11 xext xinerama xrandr
+LDFLAGS+= -Wl,--as-needed # Xext
+USE_RC_SUBR= wacom
+SUB_FILES= pkg-message
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+CONFIGURE_ENV= UDEV_CFLAGS=" " UDEV_LIBS=" "
+CONFIGURE_ARGS= --without-systemd-unit-dir \
+ --without-udev-rules-dir \
+ --without-doxygen
+
+OPTIONS_DEFINE= DEBUG TEST
+
+DEBUG_CONFIGURE_ENABLE=debug
+
+TEST_CONFIGURE_ENABLE=unit-tests
+TEST_ALL_TARGET=check
+
+post-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
+ ${INSTALL_DATA} ${FILESDIR}/wacom.conf.sample \
+ ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-input-wacom/distinfo b/x11-drivers/xlibre-xf86-input-wacom/distinfo
new file mode 100644
index 000000000000..d1d5f49dc5fd
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760814180
+SHA256 (xlibre/driver/X11Libre-xf86-input-wacom-1.2.3.2-xlibre-xf86-input-wacom-1.2.3.2_GH0.tar.gz) = 8c1942cbf90ee80d6505d115bab27461680c623d7acddf6be931224ea8176c36
+SIZE (xlibre/driver/X11Libre-xf86-input-wacom-1.2.3.2-xlibre-xf86-input-wacom-1.2.3.2_GH0.tar.gz) = 175090
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/fixpatch-src-wcmValidateDevice.c b/x11-drivers/xlibre-xf86-input-wacom/files/fixpatch-src-wcmValidateDevice.c
new file mode 100644
index 000000000000..1b8ebfd5f6d3
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/fixpatch-src-wcmValidateDevice.c
@@ -0,0 +1,64 @@
+--- src/wcmValidateDevice.c.orig 2018-02-13 17:35:29 UTC
++++ src/wcmValidateDevice.c
+@@ -34,6 +34,7 @@ static Bool wcmCheckSource(InputInfoPtr pInfo, dev_t m
+ {
+ int match = 0;
+ InputInfoPtr pDevices = xf86FirstLocalDevice();
++ char* fsource = xf86CheckStrOption(pInfo->options, "_source", "");
+
+ for (; !match && pDevices != NULL; pDevices = pDevices->next)
+ {
+@@ -51,7 +52,6 @@ static Bool wcmCheckSource(InputInfoPtr pInfo, dev_t m
+ if (pInfo != pDevices)
+ {
+ WacomCommonPtr pCommon = ((WacomDevicePtr)pDevices->private)->common;
+- char* fsource = xf86CheckStrOption(pInfo->options, "_source", "");
+ char* psource = xf86CheckStrOption(pDevices->options, "_source", "");
+
+ if (pCommon->min_maj &&
+@@ -62,10 +62,11 @@ static Bool wcmCheckSource(InputInfoPtr pInfo, dev_t m
+ if (strcmp(fsource, psource))
+ match = 1;
+ }
+- free(fsource);
+ free(psource);
+ }
+ }
++ free(fsource);
++
+ if (match)
+ xf86Msg(X_WARNING, "%s: device file already in use by %s. "
+ "Ignoring.\n", pInfo->name, pDevices->name);
+@@ -123,7 +124,7 @@ ret:
+ static struct
+ {
+ const char* type;
+- __u16 tool[3]; /* tool array is terminated by 0 */
++ uint16_t tool[3]; /* tool array is terminated by 0 */
+ } wcmType [] =
+ {
+ { "stylus", { BTN_TOOL_PEN, 0 } },
+@@ -212,6 +213,10 @@ int wcmDeviceTypeKeys(InputInfoPtr pInfo)
+ case 0x314: /* Intuos Pro S */
+ case 0x315: /* Intuos Pro M */
+ case 0x317: /* Intuos Pro L */
++ case 0x33B: /* Intuos Draw small */
++ case 0x33C: /* Intuos Art/Photo/Comic small */
++ case 0x33D: /* Intuos Draw medium */
++ case 0x33E: /* Intuos Art medium */
+ case 0x26: /* I5 */
+ case 0x27: /* I5 */
+ case 0x28: /* I5 */
+@@ -659,8 +664,10 @@ int wcmNeedAutoHotplug(InputInfoPtr pInfo, char **type
+
+ if (!source) /* xorg.conf device, don't auto-pick type */
+ goto out;
+-
+- if (source && strcmp(source, "server/hal") && strcmp(source, "server/udev"))
++ if (strcmp(source, "server/hal") &&
++ strcmp(source, "server/udev") &&
++ strcmp(source, "server/devd") &&
++ strcmp(source, "server/wscons"))
+ goto out;
+
+ /* no type specified, so we need to pick the first one applicable
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/patch-src-wcmConfig.c b/x11-drivers/xlibre-xf86-input-wacom/files/patch-src-wcmConfig.c
new file mode 100644
index 000000000000..ab0067c1f7b9
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/patch-src-wcmConfig.c
@@ -0,0 +1,19 @@
+--- src/wcmConfig.c.orig 2018-02-12 16:43:12 UTC
++++ src/wcmConfig.c
+@@ -298,7 +298,7 @@ out:
+ */
+ static void wcmSplitName(char* devicename, char *basename, char *subdevice, char *tool, size_t len)
+ {
+- char *name = strdupa(devicename);
++ char *name = strdup(devicename);
+ char *a, *b;
+
+ *basename = *subdevice = *tool = '\0';
+@@ -325,6 +325,7 @@ static void wcmSplitName(char* devicename, char *basen
+ strncat(tool, a+1, len-1);
+ }
+ strncat(basename, name, len-1);
++ free(name);
+ }
+
+ /**
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/patch-src-wcmUSB.c b/x11-drivers/xlibre-xf86-input-wacom/files/patch-src-wcmUSB.c
new file mode 100644
index 000000000000..77177f1f1c2e
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/patch-src-wcmUSB.c
@@ -0,0 +1,29 @@
+--- src/wcmUSB.c.orig 2018-03-12 16:31:49 UTC
++++ src/wcmUSB.c
+@@ -27,8 +27,14 @@
+
+ #include <math.h>
++#ifdef __linux__
+ #include <asm/types.h>
++/* Not sure if these 2 lines are necessary: */
++#else
++#define LINUX_VERSION_CODE 1
++#define KERNEL_VERSION(a,b,c) 0
++#endif
+ #include <linux/input.h>
+ #include <sys/utsname.h>
+
+ #define MAX_USB_EVENTS 128
+
+@@ -304,6 +304,11 @@ static struct WacomModelDesc
+ { WACOM_VENDOR_ID, 0x314,200000, 200000, &usbIntuosPro, "Intuos Pro S" },
+ { WACOM_VENDOR_ID, 0x315,200000, 200000, &usbIntuosPro, "Intuos Pro M" },
+ { WACOM_VENDOR_ID, 0x317,200000, 200000, &usbIntuosPro, "Intuos Pro L" },
++
++ { WACOM_VENDOR_ID, 0x33B,200000, 200000, &usbIntuos5, "Intuos Draw small" },
++ { WACOM_VENDOR_ID, 0x33C,200000, 200000, &usbIntuos5, "Intuos Art/Photo/Comic small"},
++ { WACOM_VENDOR_ID, 0x33D,200000, 200000, &usbIntuos5, "Intuos Draw medium" },
++ { WACOM_VENDOR_ID, 0x33E,200000, 200000, &usbIntuos5, "Intuos Art medium" },
+
+ { WACOM_VENDOR_ID, 0x3F, 200000, 200000, &usbCintiqV5, "Cintiq 21UX" },
+ { WACOM_VENDOR_ID, 0xC5, 200000, 200000, &usbCintiqV5, "Cintiq 20WSX" },
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/patch-src-xf86WacomDefs.h b/x11-drivers/xlibre-xf86-input-wacom/files/patch-src-xf86WacomDefs.h
new file mode 100644
index 000000000000..ddef2cf9ca88
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/patch-src-xf86WacomDefs.h
@@ -0,0 +1,12 @@
+--- src/xf86WacomDefs.h~
++++ src/xf86WacomDefs.h
+@@ -24,7 +24,9 @@
+ * General Defines
+ ****************************************************************************/
+ #include <wacom-util.h>
++#ifdef __linux__
+ #include <asm/types.h>
++#endif
+ #include <linux/input.h>
+ #define MAX_USB_EVENTS 32
+
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-isdv4-serial-debugger.c b/x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-isdv4-serial-debugger.c
new file mode 100644
index 000000000000..67924d646360
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-isdv4-serial-debugger.c
@@ -0,0 +1,10 @@
+--- tools/isdv4-serial-debugger.c~
++++ tools/isdv4-serial-debugger.c
+@@ -25,7 +25,6 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <linux/serial.h>
+ #include <getopt.h>
+ #include <poll.h>
+ #include <stdio.h>
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-isdv4-serial-inputattach.c b/x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-isdv4-serial-inputattach.c
new file mode 100644
index 000000000000..3b9d89e1865b
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-isdv4-serial-inputattach.c
@@ -0,0 +1,71 @@
+--- tools/isdv4-serial-inputattach.c~
++++ tools/isdv4-serial-inputattach.c
+@@ -23,8 +23,10 @@
+ #include "config.h"
+ #endif
+
++#ifdef __linux__
+ #include <linux/serio.h>
+ #include <libudev.h>
++#endif
+
+ #include <getopt.h>
+ #include <stdio.h>
+@@ -49,7 +52,11 @@ static void usage(void)
+ "--verbose - verbose output\n"
+ "--version - version info\n"
+ "--baudrate <19200|38400> - set baudrate\n",
++#ifdef __GLIBC__
+ program_invocation_short_name
++#else
++ getprogname()
++#endif
+ );
+ }
+
+@@ -64,6 +71,7 @@ static int set_line_discipline(int fd, i
+ return rc;
+ }
+
++#ifdef __linux
+ static int bind_kernel_driver(int fd)
+ {
+ unsigned long devt;
+@@ -77,9 +84,11 @@ static int bind_kernel_driver(int fd)
+
+ return 0;
+ }
++#endif
+
+ static unsigned int get_baud_rate(int fd)
+ {
++#ifdef __linux__
+ struct stat st;
+ unsigned int baudrate = 19200;
+ int id;
+@@ -112,6 +122,9 @@ int get_baud_rate(int fd)
+ udev_unref(udev);
+
+ return baudrate;
++#else
++ return 19200;
++#endif
+ }
+
+ void sighandler(int signum)
+@@ -194,6 +207,7 @@ int main(int argc, char **argv)
+ return 1;
+ }
+
++#ifdef __linux__
+ /* some of the 19200 tablets can't set the line discipline */
+ set_line_discipline(fd, N_MOUSE);
+
+@@ -201,6 +215,7 @@ int main(int argc, char **argv)
+ fprintf(stderr, "Failed to bind the kernel driver.\n");
+ goto out;
+ }
++#endif
+
+ signal(SIGINT, sighandler);
+ signal(SIGHUP, sighandler);
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-tools-shared.c b/x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-tools-shared.c
new file mode 100644
index 000000000000..0be5b371c9a5
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/patch-tools-tools-shared.c
@@ -0,0 +1,34 @@
+--- tools/tools-shared.c~
++++ tools/tools-shared.c
+@@ -23,7 +23,9 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
++#ifdef __linux__
+ #include <linux/serial.h>
++#endif
+ #include <getopt.h>
+ #include <poll.h>
+ #include <stdio.h>
+@@ -51,7 +53,6 @@ void version(void)
+ int open_device(const char *path)
+ {
+ int fd;
+- struct serial_struct ser;
+
+ TRACE("Opening device '%s'.\n", path);
+ fd = open(path, O_RDWR | O_NOCTTY);
+@@ -59,7 +60,13 @@ int open_device(const char *path)
+ if (fd < 1)
+ perror("Failed to open device file");
+
++#ifdef __linux__
++ struct serial_struct ser;
+ if (ioctl(fd, TIOCGSERIAL, &ser) == -1)
++#else
++ struct termios termAttr;
++ if (tcgetattr(fd, &termAttr) == -1)
++#endif
+ {
+ perror("Not a serial device?");
+ close(fd);
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/pkg-message.in b/x11-drivers/xlibre-xf86-input-wacom/files/pkg-message.in
new file mode 100644
index 000000000000..5ec8de9fabf8
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/pkg-message.in
@@ -0,0 +1,15 @@
+[
+{ type: install
+ message: <<EOM
+wacom(4x) is configured automatically via devd or HAL. However, if you
+prefer to do so manually copy and edit the sample:
+
+ $ cd %%PREFIX%%/etc/X11/xorg.conf.d/
+ $ cp wacom.conf.sample wacom.conf
+
+moused(8) may interfere with tablet input by attaching to fake /dev/ums*.
+To prevent that add a usb_quirk(4) then detach and attach the tablet.
+%%PREFIX%%/etc/rc.d/wacom is an example how preserve quirks across reboot.
+EOM
+}
+]
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/wacom.conf.sample b/x11-drivers/xlibre-xf86-input-wacom/files/wacom.conf.sample
new file mode 100644
index 000000000000..36f2512d3868
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/wacom.conf.sample
@@ -0,0 +1,33 @@
+# Manual configuration example for Bamboo Pen & Touch for use without devd or HAL.
+
+Section "InputDevice"
+ Identifier "wacom stylus"
+ Driver "wacom"
+ Option "Type" "stylus"
+ Option "Device" "/dev/input/event0"
+ Option "AutoServerLayout" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "wacom eraser"
+ Driver "wacom"
+ Option "Type" "eraser"
+ Option "Device" "/dev/input/event0"
+ Option "AutoServerLayout" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "wacom touch"
+ Driver "wacom"
+ Option "Type" "touch"
+ Option "Device" "/dev/input/event1"
+ Option "AutoServerLayout" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "wacom pad"
+ Driver "wacom"
+ Option "Type" "pad"
+ Option "Device" "/dev/input/event1"
+ Option "AutoServerLayout" "true"
+EndSection
diff --git a/x11-drivers/xlibre-xf86-input-wacom/files/wacom.in b/x11-drivers/xlibre-xf86-input-wacom/files/wacom.in
new file mode 100644
index 000000000000..3a0f4ce1c0ec
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/files/wacom.in
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# PROVIDE: wacom
+# REQUIRE: mountcritlocal
+# BEFORE: devd
+# KEYWORD: nojail
+#
+# Add the following lines to /etc/rc.conf to enable this service:
+#
+# wacom_enable (bool): Set it to YES to add Wacom USB quirks on startup.
+# Default: NO
+
+. /etc/rc.subr
+
+name="wacom"
+rcvar="wacom_enable"
+
+load_rc_config "$name"
+
+: ${wacom_enable:="NO"}
+
+start_precmd="wacom_prepare"
+start_cmd="wacom_start"
+stop_cmd="wacom_stop"
+
+wacom_prepare()
+{
+ kldload -n usb_quirk
+}
+
+wacom_start()
+{
+ # Prevent moused(8) from picking up bogus /dev/umsN
+ usbconfig add_dev_quirk_vplh 0x056a 0 0 0xffff UQ_MATCH_VENDOR_ONLY
+ usbconfig add_dev_quirk_vplh 0x056a 0 0 0xffff UQ_UMS_IGNORE
+}
+
+wacom_stop()
+{
+ usbconfig remove_dev_quirk_vplh 0x056a 0 0 0xffff UQ_MATCH_VENDOR_ONLY
+ usbconfig remove_dev_quirk_vplh 0x056a 0 0 0xffff UQ_UMS_IGNORE
+}
+
+run_rc_command "$1"
diff --git a/x11-drivers/xlibre-xf86-input-wacom/pkg-descr b/x11-drivers/xlibre-xf86-input-wacom/pkg-descr
new file mode 100644
index 000000000000..9a2a88edb3e4
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/pkg-descr
@@ -0,0 +1,2 @@
+An XLibre driver for Wacom tablets. It communicates with a character
+device provided by Linux kernel driver in webcamd.
diff --git a/x11-drivers/xlibre-xf86-input-wacom/pkg-plist b/x11-drivers/xlibre-xf86-input-wacom/pkg-plist
new file mode 100644
index 000000000000..537715529c33
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-input-wacom/pkg-plist
@@ -0,0 +1,14 @@
+bin/isdv4-serial-debugger
+bin/isdv4-serial-inputattach
+bin/xsetwacom
+@comment Not marked @sample due to conflict with devd and HAL
+etc/X11/xorg.conf.d/wacom.conf.sample
+include/xorg/Xwacom.h
+include/xorg/isdv4.h
+include/xorg/wacom-properties.h
+include/xorg/wacom-util.h
+lib/xorg/modules/xlibre-25.0/input/wacom_drv.so
+libdata/pkgconfig/xorg-wacom.pc
+share/man/man1/xsetwacom.1.gz
+share/man/man4/wacom.4x.gz
+share/X11/xorg.conf.d/70-wacom.conf
diff --git a/x11-drivers/xlibre-xf86-video-amdgpu/Makefile b/x11-drivers/xlibre-xf86-video-amdgpu/Makefile
new file mode 100644
index 000000000000..68c24005887a
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-amdgpu/Makefile
@@ -0,0 +1,32 @@
+PORTNAME= xlibre-xf86-video-amdgpu
+PORTVERSION= 23.0.0.5
+CATEGORIES= x11-drivers
+
+PATCH_SITES= https://gitlab.freedesktop.org/xorg/driver/${PORTNAME:C/xlibre-//}/-/commit/
+PATCHFILES+= 77b13493.patch:-p1 # https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/merge_requests/77
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre amdgpu display driver
+WWW= https://github.com/X11Libre/xf86-video-amdgpu/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-video-amdgpu
+
+# No amdgpu kernel driver on non-x86 and PC98.
+ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64le
+ONLY_FOR_ARCHS_REASON= KMS is required and currently only available on x86/arm64/powerpc64le
+
+LIB_DEPENDS= libdrm_amdgpu.so:graphics/libdrm
+
+USES= gl tar:xz xlibre-cat:driver
+USE_GL= gbm
+
+CONFIGURE_ARGS+=--disable-udev
+
+PLIST_FILES= lib/xorg/modules/xlibre-25.0/drivers/amdgpu_drv.so \
+ share/man/man4/amdgpu.4x.gz \
+ share/X11/xorg.conf.d/10-amdgpu.conf
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-amdgpu/distinfo b/x11-drivers/xlibre-xf86-video-amdgpu/distinfo
new file mode 100644
index 000000000000..0e1f962adbd8
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-amdgpu/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1760814301
+SHA256 (xlibre/driver/X11Libre-xf86-video-amdgpu-23.0.0.5-xlibre-xf86-video-amdgpu-23.0.0.5_GH0.tar.gz) = a255bf446272a87907ea0a13274536dcc65898c223fa42aa9afd52007ad23209
+SIZE (xlibre/driver/X11Libre-xf86-video-amdgpu-23.0.0.5-xlibre-xf86-video-amdgpu-23.0.0.5_GH0.tar.gz) = 98771
+SHA256 (xlibre/driver/77b13493.patch) = 1e76bb36f7fd69e0556ae6b5a7d2331a711367b6a7421adc221f2fcae1aff82b
+SIZE (xlibre/driver/77b13493.patch) = 1269
diff --git a/x11-drivers/xlibre-xf86-video-amdgpu/pkg-descr b/x11-drivers/xlibre-xf86-video-amdgpu/pkg-descr
new file mode 100644
index 000000000000..9316584bc259
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-amdgpu/pkg-descr
@@ -0,0 +1,7 @@
+This package contains the XLibre xf86-video-amdgpu driver.
+
+The amdgpu driver supports AMD Radeon chipsets: OLAND, HAINAN, TAHITI, PITCAIRN,
+VERDE, BONAIRE, KABINI, MULLINS, KAVERI, HAWAII, TOPAZ, TONGA, CARRIZO, FIJI,
+STONEY, POLARIS11, POLARIS10
+
+On FreeBSD requires amdgpu KMS driver from graphics/drm-kmod.
diff --git a/x11-drivers/xlibre-xf86-video-ast/Makefile b/x11-drivers/xlibre-xf86-video-ast/Makefile
new file mode 100644
index 000000000000..bb84ff52e9fc
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-ast/Makefile
@@ -0,0 +1,19 @@
+PORTNAME= xlibre-xf86-video-ast
+PORTVERSION= 1.2.0.1
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre ASPEED display driver
+WWW= https://github.com/X11Libre/xf86-video-ast/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-video-ast
+
+USES= xlibre-cat:driver
+INSTALL_TARGET= install-strip
+
+PLIST_FILES= ${MODULEDIR}/drivers/ast_drv.so
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-ast/distinfo b/x11-drivers/xlibre-xf86-video-ast/distinfo
new file mode 100644
index 000000000000..0732e295fc6f
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-ast/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760814358
+SHA256 (xlibre/driver/X11Libre-xf86-video-ast-1.2.0.1-xlibre-xf86-video-ast-1.2.0.1_GH0.tar.gz) = 14f2c2e9b8c95a6163ab4004959fbbb690bce53abf4b2254271cfa1f722182f0
+SIZE (xlibre/driver/X11Libre-xf86-video-ast-1.2.0.1-xlibre-xf86-video-ast-1.2.0.1_GH0.tar.gz) = 83706
diff --git a/x11-drivers/xlibre-xf86-video-ast/files/patch-src_ast__driver.c b/x11-drivers/xlibre-xf86-video-ast/files/patch-src_ast__driver.c
new file mode 100644
index 000000000000..172e8a4ed7a3
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-ast/files/patch-src_ast__driver.c
@@ -0,0 +1,19 @@
+--- src/ast_driver.c.orig 2024-08-01 13:20:24 UTC
++++ src/ast_driver.c
+@@ -273,6 +273,8 @@ ASTProbe(DriverPtr drv, int flags)
+
+ #ifdef XSERVER_LIBPCIACCESS
+ {
++#ifndef __FreeBSD__
++ /* FreeBSD always has vgapci driver attached. */
+ struct pci_device *pPci = xf86GetPciInfoForEntity(usedChips[i]);
+
+ if (pci_device_has_kernel_driver(pPci)) {
+@@ -289,6 +291,7 @@ ASTProbe(DriverPtr drv, int flags)
+ free(devSections);
+ return FALSE;
+ }
++#endif
+ }
+ #endif
+
diff --git a/x11-drivers/xlibre-xf86-video-ast/pkg-descr b/x11-drivers/xlibre-xf86-video-ast/pkg-descr
new file mode 100644
index 000000000000..4a2593f9d969
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-ast/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-video-ast driver.
diff --git a/x11-drivers/xlibre-xf86-video-ati/Makefile b/x11-drivers/xlibre-xf86-video-ati/Makefile
new file mode 100644
index 000000000000..93b21b408424
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-ati/Makefile
@@ -0,0 +1,28 @@
+PORTNAME= xlibre-xf86-video-ati
+PORTVERSION= 22.0.0.4
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre ati display driver
+WWW= https://github.com/X11Libre/xf86-video-ati/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+# No Radeon kernel driver on non-x86.
+ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64 powerpc64le
+ONLY_FOR_ARCHS_REASON= KMS is required and currently only available on x86/arm64/powerpc64
+
+LIB_DEPENDS= libpciaccess.so:devel/libpciaccess \
+ libdrm_radeon.so:graphics/libdrm
+
+CONFLICTS_INSTALL= xf86-video-ati
+
+USES= gl xlibre xlibre-cat:driver
+USE_GL= gbm
+USE_XORG= pciaccess
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+CONFIGURE_ARGS+=--disable-udev
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-ati/distinfo b/x11-drivers/xlibre-xf86-video-ati/distinfo
new file mode 100644
index 000000000000..d7c57fc20df2
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-ati/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1764443944
+SHA256 (xlibre/driver/X11Libre-xf86-video-ati-22.0.0.4-xlibre-xf86-video-ati-22.0.0.4_GH0.tar.gz) = f23bff5f9a299e4b227c1ed46124679592af25eacb268b858632272d2816f4eb
+SIZE (xlibre/driver/X11Libre-xf86-video-ati-22.0.0.4-xlibre-xf86-video-ati-22.0.0.4_GH0.tar.gz) = 446616
diff --git a/x11-drivers/xlibre-xf86-video-ati/pkg-descr b/x11-drivers/xlibre-xf86-video-ati/pkg-descr
new file mode 100644
index 000000000000..b7b2273d4a7b
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-ati/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-video-ati driver.
diff --git a/x11-drivers/xlibre-xf86-video-ati/pkg-plist b/x11-drivers/xlibre-xf86-video-ati/pkg-plist
new file mode 100644
index 000000000000..e202a47059bb
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-ati/pkg-plist
@@ -0,0 +1,5 @@
+lib/xorg/modules/xlibre-25.0/drivers/ati_drv.so
+lib/xorg/modules/xlibre-25.0/drivers/radeon_drv.so
+share/man/man4/ati.4x.gz
+share/man/man4/radeon.4x.gz
+share/X11/xorg.conf.d/10-radeon.conf
diff --git a/x11-drivers/xlibre-xf86-video-dummy/Makefile b/x11-drivers/xlibre-xf86-video-dummy/Makefile
new file mode 100644
index 000000000000..8009fcfd3baf
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-dummy/Makefile
@@ -0,0 +1,16 @@
+PORTNAME= xlibre-xf86-video-dummy
+PORTVERSION= 0.4.1.4
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre dummy display driver
+WWW= https://github.com/X11Libre/xf86-video-dummy/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-video-dummy
+
+USES= xlibre-cat:driver
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-dummy/distinfo b/x11-drivers/xlibre-xf86-video-dummy/distinfo
new file mode 100644
index 000000000000..3303f0c9c51e
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-dummy/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1764444333
+SHA256 (xlibre/driver/X11Libre-xf86-video-dummy-0.4.1.4-xlibre-xf86-video-dummy-0.4.1.4_GH0.tar.gz) = 61c9835845b11c8000fb6a3e6907513a8c6594ba5944b758872a72416bc5788b
+SIZE (xlibre/driver/X11Libre-xf86-video-dummy-0.4.1.4-xlibre-xf86-video-dummy-0.4.1.4_GH0.tar.gz) = 17345
diff --git a/x11-drivers/xlibre-xf86-video-dummy/pkg-descr b/x11-drivers/xlibre-xf86-video-dummy/pkg-descr
new file mode 100644
index 000000000000..d6d466f8869e
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-dummy/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-video-dummy driver.
diff --git a/x11-drivers/xlibre-xf86-video-dummy/pkg-plist b/x11-drivers/xlibre-xf86-video-dummy/pkg-plist
new file mode 100644
index 000000000000..230d1d40de8a
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-dummy/pkg-plist
@@ -0,0 +1 @@
+lib/xorg/modules/xlibre-25.0/drivers/dummy_drv.so
diff --git a/x11-drivers/xlibre-xf86-video-intel/Makefile b/x11-drivers/xlibre-xf86-video-intel/Makefile
new file mode 100644
index 000000000000..7c137bd7897c
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/Makefile
@@ -0,0 +1,54 @@
+PORTNAME= xlibre-xf86-video-intel
+PORTVERSION= 3.0.0.5
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre legacy driver for Intel integrated graphics chipsets
+WWW= https://01.org/linuxgraphics/xf86-video-intel/
+
+LICENSE= MIT # various
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+ONLY_FOR_ARCHS= amd64 i386
+ONLY_FOR_ARCHS_REASON= only Intel integrated GPUs on x86 are supported
+
+LIB_DEPENDS= libdrm_intel.so:graphics/libdrm \
+ libxcb-util.so:x11/xcb-util libXvMC.so:x11/libXvMC
+
+CONFLICTS_INSTALL= xf86-video-intel
+
+USES= localbase xlibre xlibre-cat:driver,meson
+USE_XORG= pciaccess pixman x11 xcb xinerama xrandr xdamage xcursor xtst xfixes xrender xscrnsaver xext xv
+CONFIGURE_ENV= ac_cv_header_sys_sysinfo_h=no # XXX ports/242236
+TEST_TARGET= check
+
+# XXX bug 214593: SNA crashes on pre-SandyBridge hardware
+MESON_ARGS+=-Ddefault-accel=uxa -Dbacklight-helper=false
+
+OPTIONS_DEFINE= TOOLS UDEV UMS VALGRIND XVMC
+OPTIONS_DEFAULT=UDEV XVMC UMS
+OPTIONS_SUB= yes
+
+TOOLS_DESC= Enables misc tools
+TOOLS_MESON_TRUE= tools
+
+UDEV_DESC= udev-based monitor hotplug detection
+UDEV_LIB_DEPENDS= libudev.so:devel/libudev-devd
+UDEV_MESON_TRUE= udev
+
+XVMC_MESON_ENABLE= xvmc
+
+UMS_DESC= Userspace Mode Setting for old chips.
+UMS_LIB_DEPENDS= libxcb-util.so:x11/xcb-util libXvMC.so:x11/libXvMC
+UMS_MESON_TRUE= ums
+
+VALGRIND_DESC= Enable valgrindified ioctls for debugging
+VALGRIND_BUILD_DEPENDS= valgrind:devel/valgrind
+VALGRIND_MESON_TRUE= valgrind
+
+post-patch:
+.if ${MESON_ARGS:M-Ddefault-accel=uxa}
+ @${REINPLACE_CMD} '/^Default/s/SNA/UXA/' ${WRKSRC}/man/intel.man
+.endif
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-intel/distinfo b/x11-drivers/xlibre-xf86-video-intel/distinfo
new file mode 100644
index 000000000000..d485a2157b67
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1764444419
+SHA256 (xlibre/driver/X11Libre-xf86-video-intel-3.0.0.5-xlibre-xf86-video-intel-3.0.0.5_GH0.tar.gz) = b153bc013e4af0fe67fbe9761636b80d51356df22623f415f111ef8b78d55321
+SIZE (xlibre/driver/X11Libre-xf86-video-intel-3.0.0.5-xlibre-xf86-video-intel-3.0.0.5_GH0.tar.gz) = 1700129
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-benchmarks_dri3-swap.c b/x11-drivers/xlibre-xf86-video-intel/files/patch-benchmarks_dri3-swap.c
new file mode 100644
index 000000000000..aa73975103ff
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-benchmarks_dri3-swap.c
@@ -0,0 +1,25 @@
+dri3-swap.c:237:24: error: variable 'tmp' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry(tmp, &mru, link) {
+ ^~~
+dri3-swap.c:117:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+dri3-swap.c:114:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+dri3-swap.c:236:22: note: initialize the variable 'tmp' to silence this warning
+ struct buffer *tmp, *b = NULL;
+ ^
+ = NULL
+
+--- benchmarks/dri3-swap.c.orig 2019-02-21 22:26:50 UTC
++++ benchmarks/dri3-swap.c
+@@ -233,7 +233,7 @@ static void run(Display *dpy, Window win)
+ clock_gettime(CLOCK_MONOTONIC, &start);
+ do {
+ for (n = 0; n < 1000; n++) {
+- struct buffer *tmp, *b = NULL;
++ struct buffer *tmp = NULL, *b = NULL;
+ list_for_each_entry(tmp, &mru, link) {
+ if (!tmp->busy) {
+ b = tmp;
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-hyphen b/x11-drivers/xlibre-xf86-video-intel/files/patch-hyphen
new file mode 100644
index 000000000000..3ea709848058
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-hyphen
@@ -0,0 +1,24 @@
+Add hyphen to RANDR output names for consistency with modesetting(4x)
+
+--- src/sna/sna_display.c.orig 2018-12-03 09:01:25 UTC
++++ src/sna/sna_display.c
+@@ -5126,7 +5126,7 @@ sna_output_add(struct sna *sna, unsigned id, unsigned
+ output_name = output_names[compat_conn.conn.connector_type];
+ else
+ output_name = "UNKNOWN";
+- len = snprintf(name, 32, "%s%d", output_name, compat_conn.conn.connector_type_id);
++ len = snprintf(name, 32, "%s-%d", output_name, compat_conn.conn.connector_type_id);
+ if (output_ignored(scrn, name))
+ return 0;
+
+--- src/uxa/intel_display.c.orig 2018-12-03 09:01:25 UTC
++++ src/uxa/intel_display.c
+@@ -1484,7 +1484,7 @@ drmmode_create_name(ScrnInfoPtr pScrn, drmModeConnecto
+ else
+ output_name = "UNKNOWN";
+
+- snprintf(name, 32, "%s%d",
++ snprintf(name, 32, "%s-%d",
+ output_name, koutput->connector_type_id);
+ }
+ }
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-man_meson.build b/x11-drivers/xlibre-xf86-video-intel/files/patch-man_meson.build
new file mode 100644
index 000000000000..b2b3eea17965
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-man_meson.build
@@ -0,0 +1,9 @@
+--- man/meson.build.orig 2025-08-15 11:35:35 UTC
++++ man/meson.build
+@@ -1,5 +1,5 @@ configure_file(input : 'intel.man',
+ configure_file(input : 'intel.man',
+- output : 'intel.4',
++ output : 'intel.4x',
+ command : [
+ 'sed',
+ '-e',
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-meson.build b/x11-drivers/xlibre-xf86-video-intel/files/patch-meson.build
new file mode 100644
index 000000000000..05b017ccad5f
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-meson.build
@@ -0,0 +1,35 @@
+--- meson.build.orig 2025-08-15 11:23:59 UTC
++++ meson.build
+@@ -91,9 +91,19 @@ endif
+ error('xf86-video-intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.')
+ endif
+
+-libudev = dependency('libudev', required : false)
++libudev = dependency('libudev', required : get_option('udev') == 'true')
+-if libudev.found()
+- config.set('HAVE_UDEV', 1)
+-endif
++with_udev = false
++if get_option('udev') == 'auto'
++ if libudev.found()
++ with_udev = true
++ else
++ with_udev = false
++ endif
++else
++ with_udev = get_option('udev') == 'true'
++endif
++if with_udev
++ config.set('HAVE_UDEV', 1)
++endif
+
+ cpuid_code = '''
+@@ -183,7 +183,7 @@ man_config.set('filemansuffix', '5')
+ man_config = configuration_data()
+ man_config.set('appmansuffix', '1')
+ man_config.set('filemansuffix', '5')
+-man_config.set('drivermansuffix', '4')
++man_config.set('drivermansuffix', '4x')
+ man_config.set('miscmansuffix', '7')
+ man_config.set('xservername',
+ cc.get_define('__XSERVERNAME__',
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-meson__options.txt b/x11-drivers/xlibre-xf86-video-intel/files/patch-meson__options.txt
new file mode 100644
index 000000000000..bb947fd37d64
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-meson__options.txt
@@ -0,0 +1,13 @@
+--- meson_options.txt.orig 2025-08-14 09:55:22 UTC
++++ meson_options.txt
+@@ -40,5 +40,8 @@ option('xorg-module-dir', type : 'string', value : '@l
+ description : 'Enable use of asynchronous swaps (experimental)')
+ option('internal-debug', type : 'combo', value : 'no', choices : [ 'no', 'sync', 'memory', 'pixmap', 'full' ],
+ description : 'Enable internal debugging')
+-option('xorg-module-dir', type : 'string', value : '@libdir@/xorg/modules',
+- description : 'Default xorg module directory')
++option('xorg-module-dir', type: 'string', value: '',
++ description: 'Directory to install the driver in [default=from xorg-server pkgconf]'
++)
++option('udev', type : 'combo', choices:['true','false','auto'], value : 'true',
++ description : 'Enable udev support.')
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-prefer-iris b/x11-drivers/xlibre-xf86-video-intel/files/patch-prefer-iris
new file mode 100644
index 000000000000..753bd029eb3e
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-prefer-iris
@@ -0,0 +1,31 @@
+Chase https://gitlab.freedesktop.org/mesa/mesa/-/commit/adaa3583f507
+Chase https://gitlab.freedesktop.org/mesa/mesa/-/commit/cdde031ac2c8
+
+--- src/sna/sna_dri2.c.orig 2021-01-15 20:59:05 UTC
++++ src/sna/sna_dri2.c
+@@ -3707,8 +3707,10 @@ static const char *dri_driver_name(struct sna *sna)
+ return has_i830_dri() ? "i830" : "i915";
+ else if (sna->kgem.gen < 040)
+ return "i915";
++ else if (sna->kgem.gen < 0100)
++ return "crocus";
+ else
+- return "i965";
++ return "iris";
+ }
+
+ return s;
+--- src/uxa/intel_dri.c.orig 2021-01-15 20:59:05 UTC
++++ src/uxa/intel_dri.c
+@@ -1540,8 +1540,10 @@ static const char *dri_driver_name(intel_screen_privat
+ return has_i830_dri() ? "i830" : "i915";
+ else if (INTEL_INFO(intel)->gen < 040)
+ return "i915";
++ else if (INTEL_INFO(intel)->gen < 0100)
++ return "crocus";
+ else
+- return "i965";
++ return "iris";
+ }
+
+ return s;
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-src_intel__device.c b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_intel__device.c
new file mode 100644
index 000000000000..03b9df8e74b7
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_intel__device.c
@@ -0,0 +1,13 @@
+i915 requires KMS, so FreeBSD uses suffix to distinguish drm1 and drm2 drivers.
+drm-kmod kept the same name at the cost of conflict with in-base drm2.
+
+--- src/intel_device.c.orig 2019-02-21 22:26:50 UTC
++++ src/intel_device.c
+@@ -204,6 +204,7 @@ static inline struct intel_device *intel_device(ScrnIn
+ }
+
+ static const char *kernel_module_names[] ={
++ "i915kms",
+ "i915",
+ NULL,
+ };
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-src_intel__list.h b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_intel__list.h
new file mode 100644
index 000000000000..d2f18cc8c9ba
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_intel__list.h
@@ -0,0 +1,145 @@
+kgem.c:2864:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry(bo, &kgem->snoop, list) {
+ ^~
+../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+kgem.c:2849:20: note: initialize the variable 'bo' to silence this warning
+ struct kgem_bo *bo, *first = NULL;
+ ^
+ = NULL
+kgem.c:3118:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry_safe(bo, next, &kgem->flushing, request) {
+ ^~
+../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
+ for (pos = __container_of((head)->next, pos, member), \
+ ^~~
+../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+kgem.c:3115:20: note: initialize the variable 'bo' to silence this warning
+ struct kgem_bo *bo, *next;
+ ^
+ = NULL
+kgem.c:3429:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry_safe(bo, next, &rq->buffers, request) {
+ ^~
+../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
+ for (pos = __container_of((head)->next, pos, member), \
+ ^~~
+../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+kgem.c:3425:20: note: initialize the variable 'bo' to silence this warning
+ struct kgem_bo *bo, *next;
+ ^
+ = NULL
+kgem.c:3541:27: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry_safe(bo, next, &kgem->batch_buffers, base.list) {
+ ^~
+../../src/intel_list.h:345:45: note: expanded from macro 'list_for_each_entry_safe'
+ for (pos = __container_of((head)->next, pos, member), \
+ ^~~
+../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+kgem.c:3539:24: note: initialize the variable 'bo' to silence this warning
+ struct kgem_buffer *bo, *next;
+ ^
+ = NULL
+kgem.c:3930:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry(bo, list, list) {
+ ^~
+../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+kgem.c:3928:20: note: initialize the variable 'bo' to silence this warning
+ struct kgem_bo *bo;
+ ^
+ = NULL
+kgem.c:4670:23: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry(bo, cache, vma) {
+ ^~
+../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+kgem.c:4576:20: note: initialize the variable 'bo' to silence this warning
+ struct kgem_bo *bo, *first = NULL;
+ ^
+ = NULL
+kgem.c:5411:31: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry_reverse(bo, &kgem->scanout, list) {
+ ^~
+../../src/intel_list.h:333:45: note: expanded from macro 'list_for_each_entry_reverse'
+ for (pos = __container_of((head)->prev, pos, member); \
+ ^~~
+../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+kgem.c:5380:20: note: initialize the variable 'bo' to silence this warning
+ struct kgem_bo *bo;
+ ^
+ = NULL
+kgem.c:7225:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry(bo, buffers, request) {
+ ^~
+../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+kgem.c:7223:20: note: initialize the variable 'bo' to silence this warning
+ struct kgem_bo *bo;
+ ^
+ = NULL
+kgem.c:7517:22: error: variable 'bo' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry(bo, &kgem->batch_buffers, base.list) {
+ ^~
+../../src/intel_list.h:328:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+../../src/intel_list.h:309:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+kgem.c:7503:24: note: initialize the variable 'bo' to silence this warning
+ struct kgem_buffer *bo;
+ ^
+ = NULL
+
+--- src/intel_list.h.orig 2019-02-21 22:26:50 UTC
++++ src/intel_list.h
+@@ -325,12 +325,12 @@ list_is_empty(const struct list *head)
+ *
+ */
+ #define list_for_each_entry(pos, head, member) \
+- for (pos = __container_of((head)->next, pos, member); \
++ for (pos = NULL, pos = __container_of((head)->next, pos, member); \
+ &pos->member != (head); \
+ pos = __container_of(pos->member.next, pos, member))
+
+-#define list_for_each_entry_reverse(pos, head, member) \
+- for (pos = __container_of((head)->prev, pos, member); \
++#define list_for_each_entry_reverse(pos, head, member) \
++ for (pos = NULL, pos = __container_of((head)->prev, pos, member); \
+ &pos->member != (head); \
+ pos = __container_of(pos->member.prev, pos, member))
+
+@@ -342,7 +342,7 @@ list_is_empty(const struct list *head)
+ * See list_for_each_entry for more details.
+ */
+ #define list_for_each_entry_safe(pos, tmp, head, member) \
+- for (pos = __container_of((head)->next, pos, member), \
++ for (pos = NULL, pos = __container_of((head)->next, pos, member), \
+ tmp = __container_of(pos->member.next, pos, member); \
+ &pos->member != (head); \
+ pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-src_meson.build b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_meson.build
new file mode 100644
index 000000000000..a0ff1a356056
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_meson.build
@@ -0,0 +1,38 @@
+--- src/meson.build.orig 2025-08-13 22:04:23 UTC
++++ src/meson.build
+@@ -147,7 +147,6 @@ shared_module('intel_drv',
+ dependencies : intel_drv_deps,
+ link_with : intel_drv_libs,
+ c_args : [
+- '-DMAJOR_IN_SYSMACROS',
+ '-Wno-unused-parameter',
+ '-Wno-sign-compare',
+ ],
+--- src/meson.build.orig 2025-08-13 22:04:23 UTC
++++ src/meson.build
+@@ -133,14 +133,10 @@
+ intel_drv_deps += valgrind
+ endif
+
+-xorg_moduledir = get_option('xorg-module-dir')
+-moduledir = ''
+-foreach dir : xorg_moduledir.split('/')
+- if dir == '@libdir@'
+- dir = get_option('libdir')
+- endif
+- moduledir = join_paths(moduledir, dir)
+-endforeach
++dir_xorg_modules = get_option('xorg-module-dir')
++if dir_xorg_modules == ''
++ dir_xorg_modules = xorg.get_variable(pkgconfig: 'moduledir')
++endif
+
+ shared_module('intel_drv',
+ sources : intel_drv_sources,
+@@ -151,5 +147,5 @@
+ '-Wno-sign-compare',
+ ],
+ name_prefix : '',
+- install_dir : join_paths(moduledir, 'drivers'),
++ install_dir : join_paths(dir_xorg_modules, 'drivers'),
+ install : true)
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-src_sna_kgem.c b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_sna_kgem.c
new file mode 100644
index 000000000000..f71962e56a63
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_sna_kgem.c
@@ -0,0 +1,24 @@
+--- src/sna/kgem.c.orig 2021-01-15 20:59:05 UTC
++++ src/sna/kgem.c
+@@ -1189,13 +1189,18 @@ static int gem_param(struct kgem *kgem, int name)
+ static bool test_has_execbuffer2(struct kgem *kgem)
+ {
+ struct drm_i915_gem_execbuffer2 execbuf;
++ int ret;
+
+ memset(&execbuf, 0, sizeof(execbuf));
+ execbuf.buffer_count = 1;
+
+- return do_ioctl(kgem->fd,
+- DRM_IOCTL_I915_GEM_EXECBUFFER2,
+- &execbuf) == -EFAULT;
++ ret = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf);
++#ifdef __FreeBSD__
++ /* XXX FreeBSD returns ENOENT instead of EFAULT. */
++ if (ret == -ENOENT)
++ return true;
++#endif
++ return ret == -EFAULT;
+ }
+
+ static bool test_has_no_reloc(struct kgem *kgem)
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-src_sna_meson.build b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_sna_meson.build
new file mode 100644
index 000000000000..860c9a3dd81b
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-src_sna_meson.build
@@ -0,0 +1,11 @@
+--- src/sna/meson.build.orig 2025-08-14 09:53:17 UTC
++++ src/sna/meson.build
+@@ -68,7 +68,7 @@ sna_sources = [
+ 'gen9_render.c',
+ ]
+
+-if libudev.found()
++if with_udev
+ sna_deps += libudev
+ endif
+
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-test_present-speed.c b/x11-drivers/xlibre-xf86-video-intel/files/patch-test_present-speed.c
new file mode 100644
index 000000000000..f35735bc9d9a
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-test_present-speed.c
@@ -0,0 +1,99 @@
+present-speed.c:317:23: error: variable 'b' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry(b, &mru, link)
+ ^
+present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+present-speed.c:112:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+present-speed.c:297:19: note: initialize the variable 'b' to silence this warning
+ struct buffer *b;
+ ^
+ = NULL
+present-speed.c:229:19: error: variable 'tmp' is used uninitialized whenever its declaration is reached
+ [-Werror,-Wsometimes-uninitialized]
+ struct buffer *tmp, *b = NULL;
+ ~~~~~~~~~~~~~~~^~~
+present-speed.c:231:24: note: uninitialized use occurs here
+ list_for_each_entry(tmp, &mru, link) {
+ ^~~
+present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+present-speed.c:112:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+present-speed.c:229:22: note: initialize the variable 'tmp' to silence this warning
+ struct buffer *tmp, *b = NULL;
+ ^
+ = NULL
+present-speed.c:557:24: error: variable 'b' is uninitialized when used here [-Werror,-Wuninitialized]
+ list_for_each_entry(b, &pp[i].mru, link)
+ ^
+present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+present-speed.c:112:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+present-speed.c:537:20: note: initialize the variable 'b' to silence this warning
+ struct buffer *b;
+ ^
+ = NULL
+present-speed.c:467:19: error: variable 'tmp' is used uninitialized whenever its declaration is reached
+ [-Werror,-Wsometimes-uninitialized]
+ struct buffer *tmp, *b = NULL;
+ ~~~~~~~~~~~~~~~^~~
+present-speed.c:469:24: note: uninitialized use occurs here
+ list_for_each_entry(tmp, &pp[i].mru, link) {
+ ^~~
+present-speed.c:115:45: note: expanded from macro 'list_for_each_entry'
+ for (pos = __container_of((head)->next, pos, member); \
+ ^~~
+present-speed.c:112:41: note: expanded from macro '__container_of'
+ (void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
+ ^~~~~~
+present-speed.c:467:22: note: initialize the variable 'tmp' to silence this warning
+ struct buffer *tmp, *b = NULL;
+ ^
+ = NULL
+
+--- test/present-speed.c.orig 2019-02-21 22:26:50 UTC
++++ test/present-speed.c
+@@ -226,7 +226,7 @@ static void run(Display *dpy, Window win, const char *
+ clock_gettime(CLOCK_MONOTONIC, &start);
+ do {
+ for (n = 0; n < 1000; n++) {
+- struct buffer *tmp, *b = NULL;
++ struct buffer *tmp = NULL, *b = NULL;
+ retry:
+ list_for_each_entry(tmp, &mru, link) {
+ if (tmp->fence.xid)
+@@ -294,7 +294,7 @@ retry:
+ } while (end.tv_sec < start.tv_sec + 10);
+
+ if (options & DRI3) {
+- struct buffer *b;
++ struct buffer *b = NULL;
+ XID pixmap;
+
+ pixmap = xcb_generate_id(c);
+@@ -464,7 +464,7 @@ static void perpixel(Display *dpy,
+ clock_gettime(CLOCK_MONOTONIC, &start);
+ do {
+ for (i = 0; i < sz; i++) {
+- struct buffer *tmp, *b = NULL;
++ struct buffer *tmp = NULL, *b = NULL;
+ retry:
+ list_for_each_entry(tmp, &pp[i].mru, link) {
+ if (tmp->fence.xid)
+@@ -534,7 +534,7 @@ retry:
+ for (i = 0; i < sz; i++) {
+ if (options & DRI3) {
+ int depth = DefaultDepth(dpy, DefaultScreen(dpy));
+- struct buffer *b;
++ struct buffer *b = NULL;
+ XID pixmap;
+
+ pixmap = xcb_generate_id(c);
diff --git a/x11-drivers/xlibre-xf86-video-intel/files/patch-tools_meson.build b/x11-drivers/xlibre-xf86-video-intel/files/patch-tools_meson.build
new file mode 100644
index 000000000000..2b299bd5af6a
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/files/patch-tools_meson.build
@@ -0,0 +1,11 @@
+--- tools/meson.build.orig 2025-08-15 11:34:41 UTC
++++ tools/meson.build
+@@ -21,7 +21,7 @@ if with_tools
+ install : true)
+
+ configure_file(input : 'intel-virtual-output.man',
+- output : 'intel-virtual-output.4',
++ output : 'intel-virtual-output.4x',
+ command : [
+ 'sed',
+ '-e',
diff --git a/x11-drivers/xlibre-xf86-video-intel/pkg-descr b/x11-drivers/xlibre-xf86-video-intel/pkg-descr
new file mode 100644
index 000000000000..eafc2db8fa10
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/pkg-descr
@@ -0,0 +1,14 @@
+The xf86-video-intel module is an open-source 2D graphics driver for
+the X Window System as implemented by XLibre. It supports a variety of
+Intel graphics chipsets including:
+
+ i810/i810e/i810-dc100,i815,
+ i830M,845G,852GM,855GM,865G,
+ 915G/GM,945G/GM/GME,946GZ
+ G/GM/GME/Q965,
+ G/Q33,G/Q35,G41,G/Q43,G/GM/Q45
+ PineView-M (Atom N400 series)
+ PineView-D (Atom D400/D500 series)
+ Intel(R) HD Graphics,
+ Intel(R) Iris(TM) Graphics,
+ Intel(R) Iris(TM) Pro Graphics.
diff --git a/x11-drivers/xlibre-xf86-video-intel/pkg-plist b/x11-drivers/xlibre-xf86-video-intel/pkg-plist
new file mode 100644
index 000000000000..0073a55ea463
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-intel/pkg-plist
@@ -0,0 +1,10 @@
+%%TOOLS%%bin/intel-virtual-output
+%%TOOLS%%share/man/man4/intel-virtual-output.4x.gz
+%%UMS%%lib/libI810XvMC.so
+%%UMS%%lib/libI810XvMC.so.1
+%%UMS%%lib/libI810XvMC.so.1.0.0
+%%UMS%%lib/libIntelXvMC.so.1
+%%UMS%%lib/libIntelXvMC.so
+%%UMS%%lib/libIntelXvMC.so.1.0.0
+lib/xorg/modules/xlibre-25.0/drivers/intel_drv.so
+share/man/man4/intel.4x.gz
diff --git a/x11-drivers/xlibre-xf86-video-mga/Makefile b/x11-drivers/xlibre-xf86-video-mga/Makefile
new file mode 100644
index 000000000000..cd0cde029608
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-mga/Makefile
@@ -0,0 +1,19 @@
+PORTNAME= xlibre-xf86-video-mga
+PORTVERSION= 2.1.0.1
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre mga display driver
+WWW= https://github.com/X11Libre/xf86-video-mga/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-video-mga
+
+GH_TAGNAME= 368f2e8
+USES= xlibre-cat:driver
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-mga/distinfo b/x11-drivers/xlibre-xf86-video-mga/distinfo
new file mode 100644
index 000000000000..16268ff9085f
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-mga/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760818379
+SHA256 (xlibre/driver/X11Libre-xf86-video-mga-2.1.0.1-368f2e8_GH0.tar.gz) = 24b96158a4dd6c48d5beb87bcb2ab9d3af7aced6285629af2a9c7786eed42dba
+SIZE (xlibre/driver/X11Libre-xf86-video-mga-2.1.0.1-368f2e8_GH0.tar.gz) = 158294
diff --git a/x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__dac3026.c b/x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__dac3026.c
new file mode 100644
index 000000000000..4a225c085a78
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__dac3026.c
@@ -0,0 +1,15 @@
+# Fix a style warning
+#
+--- src/mga_dac3026.c.orig 2017-01-17 22:40:29 UTC
++++ src/mga_dac3026.c
+@@ -886,8 +886,8 @@ MGA3026LoadCursorImage(
+ outTi3026dreg(TVP3026_WADR_PAL, 0x00);
+
+ while(i--) {
+- while (INREG8(0x1FDA) & 0x01);
+- while (!(INREG8(0x1FDA) & 0x01));
++ while (INREG8(0x1FDA) & 0x01) {}
++ while (!(INREG8(0x1FDA) & 0x01)) {}
+ outTi3026dreg(TVP3026_CUR_RAM, *(src++));
+ }
+ }
diff --git a/x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__dri.c b/x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__dri.c
new file mode 100644
index 000000000000..1c4114bc5920
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__dri.c
@@ -0,0 +1,22 @@
+# Use the correct constants for this type
+#
+--- src/mga_dri.c.orig 2017-01-17 22:40:29 UTC
++++ src/mga_dri.c
+@@ -316,7 +316,7 @@ static void MGAWaitForIdleDMA( ScrnInfoP
+ for (;;) {
+ do {
+ /* first ask for quiescent and flush */
+- lock.flags = DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH;
++ lock.flags = _DRM_LOCK_QUIESCENT | _DRM_LOCK_FLUSH;
+ do {
+ ret = drmCommandWrite( pMga->drmFD, DRM_MGA_FLUSH,
+ &lock, sizeof( drm_lock_t ) );
+@@ -324,7 +324,7 @@ static void MGAWaitForIdleDMA( ScrnInfoP
+
+ /* if it's still busy just try quiescent */
+ if ( ret == -EBUSY ) {
+- lock.flags = DRM_LOCK_QUIESCENT;
++ lock.flags = _DRM_LOCK_QUIESCENT;
+ do {
+ ret = drmCommandWrite( pMga->drmFD, DRM_MGA_FLUSH,
+ &lock, sizeof( drm_lock_t ) );
diff --git a/x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__driver.c b/x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__driver.c
new file mode 100644
index 000000000000..7f54cb869b32
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-mga/files/patch-src_mga__driver.c
@@ -0,0 +1,19 @@
+--- src/mga_driver.c.orig 2024-08-01 13:23:52 UTC
++++ src/mga_driver.c
+@@ -702,6 +702,8 @@ MGAPciProbe(DriverPtr drv, int entity_num, struct pci_
+ ScrnInfoPtr pScrn = NULL;
+ MGAPtr pMga;
+
++#ifndef __FreeBSD__
++ /* FreeBSD always has vgapci driver attached. */
+ if (pci_device_has_kernel_driver(dev)) {
+ /* If it's a G200 server chip, it's probably on KMS, so bail; if not,
+ * it might be using matroxfb, which is ok. */
+@@ -721,6 +723,7 @@ MGAPciProbe(DriverPtr drv, int entity_num, struct pci_
+ return FALSE;
+ }
+ }
++#endif
+
+ /* Allocate a ScrnInfoRec and claim the slot */
+ pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, MGAPciChipsets,
diff --git a/x11-drivers/xlibre-xf86-video-mga/pkg-descr b/x11-drivers/xlibre-xf86-video-mga/pkg-descr
new file mode 100644
index 000000000000..e37f95f1524c
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-mga/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-video-mga driver.
diff --git a/x11-drivers/xlibre-xf86-video-mga/pkg-plist b/x11-drivers/xlibre-xf86-video-mga/pkg-plist
new file mode 100644
index 000000000000..8b7a3276b562
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-mga/pkg-plist
@@ -0,0 +1,2 @@
+lib/xorg/modules/xlibre-25.0/drivers/mga_drv.so
+share/man/man4/mga.4x.gz
diff --git a/x11-drivers/xlibre-xf86-video-nv/Makefile b/x11-drivers/xlibre-xf86-video-nv/Makefile
new file mode 100644
index 000000000000..30f32c31408c
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-nv/Makefile
@@ -0,0 +1,19 @@
+PORTNAME= xlibre-xf86-video-nv
+PORTVERSION= 2.1.23.1
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre nv display driver
+WWW= https://github.com/X11Libre/xf86-video-nv/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-video-nv
+
+GH_TAGNAME= bcdaee5
+USES= tar:xz xlibre-cat:driver
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-nv/distinfo b/x11-drivers/xlibre-xf86-video-nv/distinfo
new file mode 100644
index 000000000000..afe808f4d407
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-nv/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760818136
+SHA256 (xlibre/driver/X11Libre-xf86-video-nv-2.1.23.1-bcdaee5_GH0.tar.gz) = c28600f17fce5b70c1568a5471b8ddfa3e861b9d283f57b7afcba16d16ff83d1
+SIZE (xlibre/driver/X11Libre-xf86-video-nv-2.1.23.1-bcdaee5_GH0.tar.gz) = 132141
diff --git a/x11-drivers/xlibre-xf86-video-nv/pkg-descr b/x11-drivers/xlibre-xf86-video-nv/pkg-descr
new file mode 100644
index 000000000000..f4ff5433a419
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-nv/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-video-nv driver.
diff --git a/x11-drivers/xlibre-xf86-video-nv/pkg-plist b/x11-drivers/xlibre-xf86-video-nv/pkg-plist
new file mode 100644
index 000000000000..96ee6de65c7c
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-nv/pkg-plist
@@ -0,0 +1,2 @@
+lib/xorg/modules/xlibre-25.0/drivers/nv_drv.so
+share/man/man4/nv.4x.gz
diff --git a/x11-drivers/xlibre-xf86-video-qxl/Makefile b/x11-drivers/xlibre-xf86-video-qxl/Makefile
new file mode 100644
index 000000000000..7ffaf4a5997e
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-qxl/Makefile
@@ -0,0 +1,39 @@
+PORTNAME= xlibre-xf86-video-qxl
+DISTVERSION= 0.1.6.3
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre X server -- QXL display driver
+WWW= https://github.com/X11Libre/xf86-video-qxl/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-video-qxl
+
+BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto \
+ spice-protocol>=0.12.10:devel/spice-protocol
+LIB_DEPENDS= libspice-server.so:devel/libspice-server \
+ libudev.so:devel/libudev-devd
+
+USES= localbase:ldflags pkgconfig python shebangfix tar:xz xorg \
+ xlibre-cat:driver
+USE_XORG= xfont2
+
+python_OLD_CMD= /usr/bin/python
+SHEBANG_FILES= scripts/Xspice
+
+CONFIGURE_ARGS+= --enable-xspice
+
+OPTIONS_DEFINE= DOCS
+
+DOCSDIR= ${PREFIX}/share/doc/${PORTNAME:C/xlibre-//}
+
+pre-install:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/examples/spiceqxl.xorg.conf.example \
+ ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d/spiceqxl.xorg.conf.example
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-qxl/distinfo b/x11-drivers/xlibre-xf86-video-qxl/distinfo
new file mode 100644
index 000000000000..f74d916eb859
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-qxl/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1764444676
+SHA256 (xlibre/driver/X11Libre-xf86-video-qxl-0.1.6.3-xlibre-xf86-video-qxl-0.1.6.3_GH0.tar.gz) = 3e02f822510f135048e14d424dc969c7245be381c39847d092aea2360348b4ea
+SIZE (xlibre/driver/X11Libre-xf86-video-qxl-0.1.6.3-xlibre-xf86-video-qxl-0.1.6.3_GH0.tar.gz) = 177285
diff --git a/x11-drivers/xlibre-xf86-video-qxl/files/patch-spiceqxl_audio.c b/x11-drivers/xlibre-xf86-video-qxl/files/patch-spiceqxl_audio.c
new file mode 100644
index 000000000000..9ba92890929e
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-qxl/files/patch-spiceqxl_audio.c
@@ -0,0 +1,14 @@
+--- src/spiceqxl_audio.c.bak 2017-09-12 12:00:11 UTC
++++ src/spiceqxl_audio.c
+@@ -410,7 +410,10 @@
+ strcat(fname, "/");
+ strcat(fname, e->name);
+
+- f->fd = open(fname, O_RDONLY | O_RSYNC | O_NONBLOCK);
++// f->fd = open(fname, O_RDONLY | O_RSYNC | O_NONBLOCK);
++ // POSIX specifies three different flavors for synchronous I/O: O_SYNC, O_DSYNC, and O_RSYNC.
++ // In BSD, these are all equivalent.
++ f->fd = open(fname, O_RDONLY | O_SYNC | O_NONBLOCK);
+ free(fname);
+ if (f->fd < 0) {
+ ErrorF("playback: open FIFO '%s' failed: %s\n", e->name, strerror(errno));
diff --git a/x11-drivers/xlibre-xf86-video-qxl/files/patch-src-mspace.h b/x11-drivers/xlibre-xf86-video-qxl/files/patch-src-mspace.h
new file mode 100644
index 000000000000..11a5a9dc55ea
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-qxl/files/patch-src-mspace.h
@@ -0,0 +1,11 @@
+--- src/mspace.h.orig 2023-01-07 19:53:51 UTC
++++ src/mspace.h
+@@ -9,7 +9,7 @@ extern "C" {
+
+ //typedef unsigned long size_t;
+ typedef void (*mspace_abort_t)(void *user_data);
+-typedef void (*mspace_print_t)(void *user_data, const char *format, ...) __attribute__((format(gnu_printf, 2, 3)));
++typedef void (*mspace_print_t)(void *user_data, const char *format, ...) __attribute__((__format__(__printf__, 2, 3)));
+
+ void mspace_set_abort_func(mspace_abort_t f);
+ void mspace_set_print_func(mspace_print_t f);
diff --git a/x11-drivers/xlibre-xf86-video-qxl/pkg-descr b/x11-drivers/xlibre-xf86-video-qxl/pkg-descr
new file mode 100644
index 000000000000..7ba76d6cb929
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-qxl/pkg-descr
@@ -0,0 +1,3 @@
+XLibre xf86-video-qxl driver, which supports the QXL virtual GPU
+found in the RedHat Enterprise Virtualisation system, and also in
+the spice project.
diff --git a/x11-drivers/xlibre-xf86-video-qxl/pkg-plist b/x11-drivers/xlibre-xf86-video-qxl/pkg-plist
new file mode 100644
index 000000000000..bdac314c9909
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-qxl/pkg-plist
@@ -0,0 +1,5 @@
+lib/xorg/modules/xlibre-25.0/drivers/spiceqxl_drv.so
+lib/xorg/modules/xlibre-25.0/drivers/qxl_drv.so
+bin/Xspice
+%%PORTDOCS%%%%DOCSDIR%%/spiceqxl.xorg.conf.example
+@sample etc/X11/xorg.conf.d/spiceqxl.xorg.conf.example etc/X11/xorg.conf.d/spiceqxl.xorg.conf
diff --git a/x11-drivers/xlibre-xf86-video-vesa/Makefile b/x11-drivers/xlibre-xf86-video-vesa/Makefile
new file mode 100644
index 000000000000..98bf102d49e1
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vesa/Makefile
@@ -0,0 +1,19 @@
+PORTNAME= xlibre-xf86-video-vesa
+PORTVERSION= 2.6.0.3
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre vesa display driver
+WWW= https://githhub.com/X11Libre/xf86-video-vesa
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+CONFLICTS_INSTALL= xf86-video-vesa
+
+GH_TAGNAME= 243d986
+USES= xlibre-cat:driver
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-vesa/distinfo b/x11-drivers/xlibre-xf86-video-vesa/distinfo
new file mode 100644
index 000000000000..7565354b3670
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vesa/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760815702
+SHA256 (xlibre/driver/X11Libre-xf86-video-vesa-2.6.0.3-243d986_GH0.tar.gz) = f2d1de80df9421236806023e035fe78f3ae3a4f0d47ca0a8fcf05505d6e132cc
+SIZE (xlibre/driver/X11Libre-xf86-video-vesa-2.6.0.3-243d986_GH0.tar.gz) = 25528
diff --git a/x11-drivers/xlibre-xf86-video-vesa/pkg-descr b/x11-drivers/xlibre-xf86-video-vesa/pkg-descr
new file mode 100644
index 000000000000..d0be3a719b72
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vesa/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-video-vesa driver.
diff --git a/x11-drivers/xlibre-xf86-video-vesa/pkg-plist b/x11-drivers/xlibre-xf86-video-vesa/pkg-plist
new file mode 100644
index 000000000000..2ee5cc94b87b
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vesa/pkg-plist
@@ -0,0 +1,2 @@
+lib/xorg/modules/xlibre-25.0/drivers/vesa_drv.so
+share/man/man4/vesa.4x.gz
diff --git a/x11-drivers/xlibre-xf86-video-vmware/Makefile b/x11-drivers/xlibre-xf86-video-vmware/Makefile
new file mode 100644
index 000000000000..862b9ace5de2
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vmware/Makefile
@@ -0,0 +1,25 @@
+PORTNAME= xlibre-xf86-video-vmware
+PORTVERSION= 13.4.0.3
+CATEGORIES= x11-drivers
+
+MAINTAINER= b-aazbsd@proton.me
+COMMENT= XLibre vmware display driver
+WWW= https://github.com/X11Libre/xf86-video-vmware/
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+ONLY_FOR_ARCHS= amd64
+ONLY_FOR_ARCHS_REASON= vmware gfx protocol is only supported on x86-compatible architectures
+
+CONFLICTS_INSTALL= xf86-video-vmware
+
+USES= xlibre-cat:driver
+
+LIB_DEPENDS+= libdrm.so:graphics/libdrm \
+ libxatracker.so:graphics/mesa-gallium-xa
+
+GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
+CONFIGURE_ARGS= --without-libudev
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xlibre-xf86-video-vmware/distinfo b/x11-drivers/xlibre-xf86-video-vmware/distinfo
new file mode 100644
index 000000000000..f3e476455d04
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vmware/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760815979
+SHA256 (xlibre/driver/X11Libre-xf86-video-vmware-13.4.0.3-xlibre-xf86-video-vmware-13.4.0.3_GH0.tar.gz) = 1773016119fc0e7d5992ad95e1e7ad26a103b5f0198516389447bed5dd9d963d
+SIZE (xlibre/driver/X11Libre-xf86-video-vmware-13.4.0.3-xlibre-xf86-video-vmware-13.4.0.3_GH0.tar.gz) = 178336
diff --git a/x11-drivers/xlibre-xf86-video-vmware/files/patch-saa_saa.h b/x11-drivers/xlibre-xf86-video-vmware/files/patch-saa_saa.h
new file mode 100644
index 000000000000..f730407cefcf
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vmware/files/patch-saa_saa.h
@@ -0,0 +1,10 @@
+--- saa/saa.h.orig 2021-12-02 13:55:48 UTC
++++ saa/saa.h
+@@ -40,6 +40,7 @@
+ #else
+ #include <xorg-server.h>
+ #endif
++#undef bool
+ #include <xf86.h>
+ #include <damage.h>
+ #include <picturestr.h>
diff --git a/x11-drivers/xlibre-xf86-video-vmware/files/patch-src_vmware.c b/x11-drivers/xlibre-xf86-video-vmware/files/patch-src_vmware.c
new file mode 100644
index 000000000000..97c083a207d7
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vmware/files/patch-src_vmware.c
@@ -0,0 +1,11 @@
+--- src/vmware.c.orig 2018-05-17 07:42:24 UTC
++++ src/vmware.c
+@@ -381,7 +381,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int fla
+ "No supported VMware SVGA found (read ID 0x%08x).\n", id);
+ return FALSE;
+ }
+- pVMWARE->suspensionSavedRegId = id;
++ pVMWARE->SavedReg.svga_reg_id = id;
+
+ #if !XSERVER_LIBPCIACCESS
+ pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device,
diff --git a/x11-drivers/xlibre-xf86-video-vmware/files/patch-vmwgfx_vmwgfx__driver.h b/x11-drivers/xlibre-xf86-video-vmware/files/patch-vmwgfx_vmwgfx__driver.h
new file mode 100644
index 000000000000..36a748b34756
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vmware/files/patch-vmwgfx_vmwgfx__driver.h
@@ -0,0 +1,10 @@
+--- vmwgfx/vmwgfx_driver.h.orig 2021-12-02 13:55:36 UTC
++++ vmwgfx/vmwgfx_driver.h
+@@ -40,6 +40,7 @@
+ #include <xf86drm.h>
+ #include <xf86drmMode.h>
+ #include <xorg-server.h>
++#undef bool
+ #include <xf86.h>
+ #include <xf86Crtc.h>
+ #include <xf86xv.h>
diff --git a/x11-drivers/xlibre-xf86-video-vmware/pkg-descr b/x11-drivers/xlibre-xf86-video-vmware/pkg-descr
new file mode 100644
index 000000000000..695beb9c08f5
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vmware/pkg-descr
@@ -0,0 +1 @@
+This package contains the XLibre xf86-video-vmware driver.
diff --git a/x11-drivers/xlibre-xf86-video-vmware/pkg-plist b/x11-drivers/xlibre-xf86-video-vmware/pkg-plist
new file mode 100644
index 000000000000..c1d79d69dd6f
--- /dev/null
+++ b/x11-drivers/xlibre-xf86-video-vmware/pkg-plist
@@ -0,0 +1,2 @@
+lib/xorg/modules/xlibre-25.0/drivers/vmware_drv.so
+share/man/man4/vmware.4x.gz