pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

seatd: fix to set busid



Module Name:	pkgsrc-wip
Committed By:	kikadf <kikadf.01%gmail.com@localhost>
Pushed By:	kikadf
Date:		Wed Dec 3 19:10:25 2025 +0100
Changeset:	eaa36095fbef31b2619a81c08f554a39c6f98e92

Modified Files:
	seatd/distinfo
Added Files:
	seatd/patches/patch-common_drm.c

Log Message:
seatd: fix to set busid

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=eaa36095fbef31b2619a81c08f554a39c6f98e92

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 seatd/distinfo                   |  1 +
 seatd/patches/patch-common_drm.c | 50 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diffs:
diff --git a/seatd/distinfo b/seatd/distinfo
index 3da97ad95d..c71aaf8f26 100644
--- a/seatd/distinfo
+++ b/seatd/distinfo
@@ -3,4 +3,5 @@ $NetBSD$
 BLAKE2s (0.9.1.tar.gz) = bfbe38c62913d54849d77d844c0382ee492c319ebba5632e93c6c7b29b07a2d9
 SHA512 (0.9.1.tar.gz) = 15d24a6646fa82a2bcc21d2a99693e1c54e71b9da24a0ba5c847a72c53d803410cbcee31fc847fef468b18d941d9685391bebf745819d4b24d056cd67e08c3fb
 Size (0.9.1.tar.gz) = 41968 bytes
+SHA1 (patch-common_drm.c) = e52424f069d369aed0f4a9cb1332fca81b51eefe
 SHA1 (patch-common_terminal.c) = b397ffaad707f2f62258bcbb3178b8966acd830c
diff --git a/seatd/patches/patch-common_drm.c b/seatd/patches/patch-common_drm.c
new file mode 100644
index 0000000000..ce3f21e71f
--- /dev/null
+++ b/seatd/patches/patch-common_drm.c
@@ -0,0 +1,50 @@
+$NetBSD$
+
+* On NetBSD the setversion ioctl sets the busid, so without
+  setversion getunique will return with empty string, and
+  drmParseSubsystemType fails with -EINVAL 
+
+--- common/drm.c.orig	2024-10-30 19:43:26.000000000 +0000
++++ common/drm.c
+@@ -9,12 +9,41 @@
+ #define DRM_IO(nr)            _IO(DRM_IOCTL_BASE, nr)
+ #define DRM_IOCTL_SET_MASTER  DRM_IO(0x1e)
+ #define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
++#if defined(__NetBSD__)
++#include <errno.h>
++#include "log.h"
++struct drm_set_version {
++	int drm_di_major;
++	int drm_di_minor;
++	int drm_dd_major;
++	int drm_dd_minor;
++};
++#define DRM_IOWR(nr,type)     _IOWR(DRM_IOCTL_BASE,nr,type)
++#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
++#endif
+ 
+ #define STRLEN(s)                 ((sizeof(s) / sizeof(s[0])) - 1)
+ #define STR_HAS_PREFIX(prefix, s) (strncmp(prefix, s, STRLEN(prefix)) == 0)
+ 
+ int drm_set_master(int fd) {
++#if defined(__NetBSD__)
++	int ret;
++	struct drm_set_version sv;
++
++	if ((ret = ioctl(fd, DRM_IOCTL_SET_MASTER, 0)) == 0) {
++		sv.drm_di_major = 1;
++		sv.drm_di_minor = 4;
++		sv.drm_dd_major = -1;
++		sv.drm_dd_minor = -1;
++		if (ioctl(fd, DRM_IOCTL_SET_VERSION, &sv)) {
++			log_errorf("DRM_IOCTL_SET_VERSION failed: %s", strerror(errno));
++		}
++	}
++
++	return ret;
++#else
+ 	return ioctl(fd, DRM_IOCTL_SET_MASTER, 0);
++#endif
+ }
+ 
+ int drm_drop_master(int fd) {


Home | Main Index | Thread Index | Old Index