pkgsrc-Changes archive

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

CVS commit: pkgsrc/x11/libdrm



Module Name:    pkgsrc
Committed By:   tnn
Date:           Sun Mar 13 15:20:01 UTC 2022

Modified Files:
        pkgsrc/x11/libdrm: Makefile PLIST distinfo
        pkgsrc/x11/libdrm/patches: patch-xf86drm.c patch-xf86drmMode.c
Added Files:
        pkgsrc/x11/libdrm/patches: patch-amdgpu_amdgpu__cs.c
            patch-etnaviv_etnaviv__device.c patch-exynos_exynos__drm.c
            patch-exynos_exynos__fimg2d.c patch-meson.build
            patch-omap_omap__drm.c patch-tests_exynos_exynos__fimg2d__test.c
            patch-tests_nouveau_threaded.c
Removed Files:
        pkgsrc/x11/libdrm/patches: patch-nouveau_private.h

Log Message:
libdrm: update to 2.4.100

Changes build framework to meson.

[ANNOUNCE] libdrm 2.4.110
misc bug fixes
[ANNOUNCE] libdrm 2.4.109
misc bug fixes
[ANNOUNCE] libdrm 2.4.108
misc bug fixes, build fixes
[ANNOUNCE] libdrm 2.4.107
misc bug fixes, update AMD product names
[ANNOUNCE] libdrm 2.4.106
Some nouveau debug, amdgpu tests, and a regression fix from 105.
Releasing so 105 doesn't end up being used a lot with a regression.
[ANNOUNCE] libdrm 2.4.105
misc bug fixes, update AMD product names
[ANNOUNCE] libdrm 2.4.104
This release brings updated kernel headers and converts man pages to
reStructuredText.
[ANNOUNCE] libdrm 2.4.103
libdrm mostly for new hw and ame names.
[ANNOUNCE] libdrm 2.4.102
lots of FreeBSD and modetest stuff.
[ANNOUNCE] libdrm 2.4.101
misc bug fixes, update AMD product names


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 pkgsrc/x11/libdrm/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/x11/libdrm/PLIST
cvs rdiff -u -r1.99 -r1.100 pkgsrc/x11/libdrm/distinfo
cvs rdiff -u -r0 -r1.3 pkgsrc/x11/libdrm/patches/patch-amdgpu_amdgpu__cs.c
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/x11/libdrm/patches/patch-etnaviv_etnaviv__device.c \
    pkgsrc/x11/libdrm/patches/patch-exynos_exynos__drm.c \
    pkgsrc/x11/libdrm/patches/patch-exynos_exynos__fimg2d.c \
    pkgsrc/x11/libdrm/patches/patch-meson.build \
    pkgsrc/x11/libdrm/patches/patch-omap_omap__drm.c \
    pkgsrc/x11/libdrm/patches/patch-tests_exynos_exynos__fimg2d__test.c \
    pkgsrc/x11/libdrm/patches/patch-tests_nouveau_threaded.c
cvs rdiff -u -r1.1 -r0 pkgsrc/x11/libdrm/patches/patch-nouveau_private.h
cvs rdiff -u -r1.6 -r1.7 pkgsrc/x11/libdrm/patches/patch-xf86drm.c
cvs rdiff -u -r1.5 -r1.6 pkgsrc/x11/libdrm/patches/patch-xf86drmMode.c

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

Modified files:

Index: pkgsrc/x11/libdrm/Makefile
diff -u pkgsrc/x11/libdrm/Makefile:1.97 pkgsrc/x11/libdrm/Makefile:1.98
--- pkgsrc/x11/libdrm/Makefile:1.97     Wed Dec  1 13:01:15 2021
+++ pkgsrc/x11/libdrm/Makefile  Sun Mar 13 15:20:01 2022
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.97 2021/12/01 13:01:15 nia Exp $
+# $NetBSD: Makefile,v 1.98 2022/03/13 15:20:01 tnn Exp $
 
-DISTNAME=              libdrm-2.4.100
+DISTNAME=              libdrm-2.4.110
 CATEGORIES=            x11 graphics
 MASTER_SITES=          https://dri.freedesktop.org/libdrm/
+EXTRACT_SUFX=          .tar.xz
 
 MAINTAINER=            joerg%NetBSD.org@localhost
 HOMEPAGE=              https://dri.freedesktop.org/wiki/DRM
@@ -13,11 +14,20 @@ LICENSE=            mit
 ONLY_FOR_PLATFORM=     NetBSD-*-* DragonFly-*-* FreeBSD-*-* OpenBSD-*-* \
                        Linux-*-* SunOS-*-*
 
-USE_PKGLOCALEDIR=      yes
-USE_TOOLS+=            gmake pkg-config
-USE_LIBTOOL=           yes
+USE_TOOLS+=            pkg-config
+
+PKGCONFIG_OVERRIDE+=   amdgpu/libdrm_amdgpu.pc.in
+PKGCONFIG_OVERRIDE+=   etnaviv/libdrm_etnaviv.pc.in
+PKGCONFIG_OVERRIDE+=   exynos/libdrm_exynos.pc.in
+PKGCONFIG_OVERRIDE+=   freedreno/libdrm_freedreno.pc.in
+PKGCONFIG_OVERRIDE+=   intel/libdrm_intel.pc.in
+PKGCONFIG_OVERRIDE+=   libkms/libkms.pc.in
+PKGCONFIG_OVERRIDE+=   nouveau/libdrm_nouveau.pc.in
+PKGCONFIG_OVERRIDE+=   omap/libdrm_omap.pc.in
+PKGCONFIG_OVERRIDE+=   radeon/libdrm_radeon.pc.in
+PKGCONFIG_OVERRIDE+=   tegra/libdrm_tegra.pc.in
+PKGCONFIG_OVERRIDE+=   vc4/libdrm_vc4.pc.in
 PKGCONFIG_OVERRIDE+=   libdrm.pc.in
-GNU_CONFIGURE=         yes
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -32,34 +42,57 @@ ATOMIC_OPS_CHECK=   0
 ATOMIC_OPS_CHECK=      1
 .else
 .  include "../../devel/libatomic_ops/buildlink3.mk"
-CONFIGURE_ENV+=                drm_cv_atomic_primitives=libatomic-ops
 .endif
 
-CONFIGURE_ARGS+=       PTHREADSTUBS_CFLAGS=-I${PREFIX}/include \
-                       PTHREADSTUBS_LIBS=-L${PREFIX}/lib
-CONFIGURE_ARGS+=       --disable-manpages
-CONFIGURE_ARGS+=       --disable-valgrind
+PLIST_VARS+=   intel arm kms
 
-LDFLAGS.NetBSD+=       -lpci
+.if ${OPSYS} == "Linux" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" || ${OPSYS} == "NetBSD"
+MESON_ARGS+=   -Dlibkms=true
+PLIST.kms=     yes
+.else
+MESON_ARGS+=   -Dlibkms=false
+.endif
 
 PLIST_VARS+=   intel arm kms
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
-# libpciaccess is needed to build support for the intel KMS API,
-# libdrm_intel.so.
+MESON_ARGS+=   -Dintel=true
+MESON_ARGS+=   -Dvmwgfx=true
 .include "../../sysutils/libpciaccess/buildlink3.mk"
 PLIST.intel=   yes
-.elif !empty(MACHINE_ARCH:Marm*) || \
+.else
+MESON_ARGS+=   -Dintel=false
+MESON_ARGS+=   -Dvmwgfx=false
+.endif
+
+MESON_ARGS+=   -Dradeon=true
+MESON_ARGS+=   -Damdgpu=true
+MESON_ARGS+=   -Dnouveau=true
+
+.if !empty(MACHINE_ARCH:Marm*) || \
       !empty(MACHINE_ARCH:Mearm*) || \
       ${MACHINE_ARCH} == "aarch64"
+MESON_ARGS+=   -Detnaviv=true
+MESON_ARGS+=   -Dexynos=true
+MESON_ARGS+=   -Dfreedreno=true
+MESON_ARGS+=   -Dvc4=true
+MESON_ARGS+=   -Domap=true
+MESON_ARGS+=   -Dtegra=true
 PLIST.arm=     yes
-#.else
-#CONFIGURE_ARGS+=      --disable-intel
+.else
+MESON_ARGS+=   -Detnaviv=false
+MESON_ARGS+=   -Dexynos=false
+MESON_ARGS+=   -Dfreedreno=false
+MESON_ARGS+=   -Domap=false
+MESON_ARGS+=   -Dtegra=false
+MESON_ARGS+=   -Dvc4=false
 .endif
 
-.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux"
-PLIST.kms=     yes
-.endif
+MESON_ARGS+=   -Dman-pages=false
+MESON_ARGS+=   -Dvalgrind=false
+
+LDFLAGS.NetBSD+=       -lpci
 
 X11_BUILTIN_NAME?=             libdrm
 .include "../../meta-pkgs/modular-xorg/avoid-duplicate.mk"
+.include "../../devel/meson/build.mk"
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/x11/libdrm/PLIST
diff -u pkgsrc/x11/libdrm/PLIST:1.22 pkgsrc/x11/libdrm/PLIST:1.23
--- pkgsrc/x11/libdrm/PLIST:1.22        Tue Jul 20 09:43:22 2021
+++ pkgsrc/x11/libdrm/PLIST     Sun Mar 13 15:20:01 2022
@@ -1,4 +1,6 @@
-@comment $NetBSD: PLIST,v 1.22 2021/07/20 09:43:22 tnn Exp $
+@comment $NetBSD: PLIST,v 1.23 2022/03/13 15:20:01 tnn Exp $
+${PLIST.arm}include/exynos/exynos_drm.h
+${PLIST.arm}include/exynos/exynos_fimg2d.h
 ${PLIST.arm}include/freedreno/freedreno_drmif.h
 ${PLIST.arm}include/freedreno/freedreno_ringbuffer.h
 include/libdrm/amdgpu.h
@@ -7,6 +9,8 @@ include/libdrm/drm.h
 include/libdrm/drm_fourcc.h
 include/libdrm/drm_mode.h
 include/libdrm/drm_sarea.h
+${PLIST.arm}include/libdrm/etnaviv_drmif.h
+${PLIST.arm}include/libdrm/exynos_drmif.h
 include/libdrm/i915_drm.h
 ${PLIST.intel}include/libdrm/intel_aub.h
 ${PLIST.intel}include/libdrm/intel_bufmgr.h
@@ -23,6 +27,7 @@ include/libdrm/nouveau/nvif/if0003.h
 include/libdrm/nouveau/nvif/ioctl.h
 include/libdrm/nouveau/nvif/unpack.h
 include/libdrm/nouveau_drm.h
+${PLIST.arm}include/libdrm/omap_drmif.h
 include/libdrm/qxl_drm.h
 include/libdrm/r128_drm.h
 include/libdrm/r600_pci_ids.h
@@ -36,30 +41,62 @@ include/libdrm/radeon_drm.h
 include/libdrm/radeon_surface.h
 include/libdrm/savage_drm.h
 include/libdrm/sis_drm.h
+${PLIST.arm}include/libdrm/tegra.h
 include/libdrm/tegra_drm.h
 include/libdrm/vc4_drm.h
 ${PLIST.arm}include/libdrm/vc4_packet.h
 ${PLIST.arm}include/libdrm/vc4_qpu_defines.h
 include/libdrm/via_drm.h
 include/libdrm/virtgpu_drm.h
-include/libdrm/vmwgfx_drm.h
+${PLIST.intel}include/libdrm/vmwgfx_drm.h
 ${PLIST.kms}include/libkms/libkms.h
 include/libsync.h
+${PLIST.arm}include/omap/omap_drm.h
 include/xf86drm.h
 include/xf86drmMode.h
-lib/libdrm.la
-lib/libdrm_amdgpu.la
-${PLIST.arm}lib/libdrm_freedreno.la
-${PLIST.intel}lib/libdrm_intel.la
-lib/libdrm_nouveau.la
-lib/libdrm_radeon.la
-${PLIST.kms}lib/libkms.la
+lib/libdrm.so
+lib/libdrm.so.2
+lib/libdrm.so.2.4.0
+lib/libdrm_amdgpu.so
+lib/libdrm_amdgpu.so.1
+lib/libdrm_amdgpu.so.1.0.0
+${PLIST.arm}lib/libdrm_etnaviv.so
+${PLIST.arm}lib/libdrm_etnaviv.so.1
+${PLIST.arm}lib/libdrm_etnaviv.so.1.0.0
+${PLIST.arm}lib/libdrm_exynos.so
+${PLIST.arm}lib/libdrm_exynos.so.1
+${PLIST.arm}lib/libdrm_exynos.so.1.0.0
+${PLIST.arm}lib/libdrm_freedreno.so
+${PLIST.arm}lib/libdrm_freedreno.so.1
+${PLIST.arm}lib/libdrm_freedreno.so.1.0.0
+${PLIST.intel}lib/libdrm_intel.so
+${PLIST.intel}lib/libdrm_intel.so.1
+${PLIST.intel}lib/libdrm_intel.so.1.0.0
+lib/libdrm_nouveau.so
+lib/libdrm_nouveau.so.2
+lib/libdrm_nouveau.so.2.0.0
+${PLIST.arm}lib/libdrm_omap.so
+${PLIST.arm}lib/libdrm_omap.so.1
+${PLIST.arm}lib/libdrm_omap.so.1.0.0
+lib/libdrm_radeon.so
+lib/libdrm_radeon.so.1
+lib/libdrm_radeon.so.1.0.1
+${PLIST.arm}lib/libdrm_tegra.so
+${PLIST.arm}lib/libdrm_tegra.so.0
+${PLIST.arm}lib/libdrm_tegra.so.0.0.0
+${PLIST.kms}lib/libkms.so
+${PLIST.kms}lib/libkms.so.1
+${PLIST.kms}lib/libkms.so.1.0.0
 lib/pkgconfig/libdrm.pc
 lib/pkgconfig/libdrm_amdgpu.pc
+${PLIST.arm}lib/pkgconfig/libdrm_etnaviv.pc
+${PLIST.arm}lib/pkgconfig/libdrm_exynos.pc
 ${PLIST.arm}lib/pkgconfig/libdrm_freedreno.pc
 ${PLIST.intel}lib/pkgconfig/libdrm_intel.pc
 lib/pkgconfig/libdrm_nouveau.pc
+${PLIST.arm}lib/pkgconfig/libdrm_omap.pc
 lib/pkgconfig/libdrm_radeon.pc
-${PLIST.kms}lib/pkgconfig/libkms.pc
+${PLIST.arm}lib/pkgconfig/libdrm_tegra.pc
 ${PLIST.arm}lib/pkgconfig/libdrm_vc4.pc
+${PLIST.kms}lib/pkgconfig/libkms.pc
 share/libdrm/amdgpu.ids

Index: pkgsrc/x11/libdrm/distinfo
diff -u pkgsrc/x11/libdrm/distinfo:1.99 pkgsrc/x11/libdrm/distinfo:1.100
--- pkgsrc/x11/libdrm/distinfo:1.99     Tue Oct 26 11:34:08 2021
+++ pkgsrc/x11/libdrm/distinfo  Sun Mar 13 15:20:01 2022
@@ -1,13 +1,20 @@
-$NetBSD: distinfo,v 1.99 2021/10/26 11:34:08 nia Exp $
+$NetBSD: distinfo,v 1.100 2022/03/13 15:20:01 tnn Exp $
 
-BLAKE2s (libdrm-2.4.100.tar.gz) = 1cfd02d9d2ec59d0a32ba5287908d7056aa262e45c186f35b5fc327e99afb69a
-SHA512 (libdrm-2.4.100.tar.gz) = b61835473c77691c4a8e67b32b9df420661e8bf8700507334b58bde5e6a402dee4aea2bec1e5b83343dd28fcb6cf9fd084064d437332f178df81c4780552595b
-Size (libdrm-2.4.100.tar.gz) = 1149132 bytes
+BLAKE2s (libdrm-2.4.110.tar.xz) = 3f45410c126cfb5ad5d8166270faa108751c1476c5f3926cc9b471b341147d0b
+SHA512 (libdrm-2.4.110.tar.xz) = 52f92ef1fe4c218a1d7dba53ef43334dbfca80e3209afe59f3a32c4bf67473126534e990df07a931a12d46a3b997c21ef17c1c4d8a0c88d44d5c6c040e3b6be3
+Size (libdrm-2.4.110.tar.xz) = 436372 bytes
 SHA1 (patch-ac) = 67c998df7dfc0dabc86320ea6d015cede3e464ea
+SHA1 (patch-amdgpu_amdgpu__cs.c) = 125eca62cd3e00a6e039066152780174dcde0705
+SHA1 (patch-etnaviv_etnaviv__device.c) = 236b2df05a918c35c4decfee416ff5bfe9c073d4
+SHA1 (patch-exynos_exynos__drm.c) = 3fa4c8a592a5f4e0c4001eb6fa1bc7811e398605
+SHA1 (patch-exynos_exynos__fimg2d.c) = 298438b128bdb4ff57a8c0d7d6a081485e64e49a
 SHA1 (patch-include_drm_drm.h) = 48a912f40bf2b2a1c23edbe4446fa7869212f17b
 SHA1 (patch-libkms_vmwgfx.c) = d2204c0b79098c6c36b7f282b486c58c6354bd1d
 SHA1 (patch-libsync.h) = 1e0603e72a54a069fc9d2ab2c9559d22381a69d3
-SHA1 (patch-nouveau_private.h) = fe347abfaed3b37ef8fee645a388e19ca1e97552
-SHA1 (patch-xf86drm.c) = 02ef5f5ec351b7f52a97ab80d3d469e854ac957a
-SHA1 (patch-xf86drmMode.c) = 5f66d45a63b0915f22d0abe115aace13c53823a8
+SHA1 (patch-meson.build) = b9ebb763a807da931f83f4d5c02925ab5498ef69
+SHA1 (patch-omap_omap__drm.c) = a23eefa9a57315d3ae77e528fd29de70ff9b2648
+SHA1 (patch-tests_exynos_exynos__fimg2d__test.c) = 9fc874ecc9a42db75327f736d04038f7cf8f00ff
+SHA1 (patch-tests_nouveau_threaded.c) = 82b566666e77898c209d66ce804c913b53e53a50
+SHA1 (patch-xf86drm.c) = 6e4b3ee406666b37cc0b923ad49b945055919c83
+SHA1 (patch-xf86drmMode.c) = 078b1ecaa4fedd74992d682433701245ee51785b
 SHA1 (patch-xf86drmMode.h) = a28b02887389be8670193c119f711901af61a6b2

Index: pkgsrc/x11/libdrm/patches/patch-xf86drm.c
diff -u pkgsrc/x11/libdrm/patches/patch-xf86drm.c:1.6 pkgsrc/x11/libdrm/patches/patch-xf86drm.c:1.7
--- pkgsrc/x11/libdrm/patches/patch-xf86drm.c:1.6       Sun Sep  8 15:55:04 2019
+++ pkgsrc/x11/libdrm/patches/patch-xf86drm.c   Sun Mar 13 15:20:01 2022
@@ -1,8 +1,8 @@
-$NetBSD: patch-xf86drm.c,v 1.6 2019/09/08 15:55:04 maya Exp $
+$NetBSD: patch-xf86drm.c,v 1.7 2022/03/13 15:20:01 tnn Exp $
 
 Implement drmParseSubsystemType, drmParsePciBusInfo for NetBSD
 
---- xf86drm.c.orig     2019-04-19 15:52:29.000000000 +0000
+--- xf86drm.c.orig     2021-07-02 12:49:05.459105300 +0000
 +++ xf86drm.c
 @@ -86,7 +86,10 @@
  #endif
@@ -16,10 +16,10 @@ Implement drmParseSubsystemType, drmPars
  #endif
  
  #ifdef __OpenBSD__
-@@ -3032,6 +3035,65 @@ static int drmParseSubsystemType(int maj
-     }
- 
-     return -EINVAL;
+@@ -3499,6 +3502,65 @@ static int drmParseSubsystemType(int maj
+             return DRM_BUS_VIRTIO;
+      }
+     return subsystem_type;
 +#elif defined(__NetBSD__)
 +    int type, fd;
 +    drmSetVersion sv;
@@ -29,7 +29,7 @@ Implement drmParseSubsystemType, drmPars
 +    int ret;
 +
 +    /* Get the type of device we're looking for to pick the right pathname.  */
-+    type = drmGetMinorType(min);
++    type = drmGetMinorType(maj, min);
 +    if (type == -1)
 +      return -ENODEV;
 +
@@ -79,10 +79,10 @@ Implement drmParseSubsystemType, drmPars
 +
 +    /* Success or not, we're done.  */
 +    return ret;
- #elif defined(__OpenBSD__) || defined(__DragonFly__)
+ #elif defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
      return DRM_BUS_PCI;
  #else
-@@ -3081,6 +3143,73 @@ static int drmParsePciBusInfo(int maj, i
+@@ -3610,6 +3672,73 @@ static int drmParsePciBusInfo(int maj, i
      info->func = func;
  
      return 0;
@@ -95,7 +95,7 @@ Implement drmParseSubsystemType, drmPars
 +    int ret;
 +
 +    /* Get the type of device we're looking for to pick the right pathname.  */
-+    type = drmGetMinorType(min);
++    type = drmGetMinorType(maj, min);
 +    if (type == -1)
 +      return -ENODEV;
 +
@@ -156,7 +156,7 @@ Implement drmParseSubsystemType, drmPars
  #elif defined(__OpenBSD__) || defined(__DragonFly__)
      struct drm_pciinfo pinfo;
      int fd, type;
-@@ -3247,6 +3376,48 @@ static int drmParsePciDeviceInfo(int maj
+@@ -3778,6 +3907,48 @@ static int drmParsePciDeviceInfo(int maj
          return parse_config_sysfs_file(maj, min, device);
  
      return 0;

Index: pkgsrc/x11/libdrm/patches/patch-xf86drmMode.c
diff -u pkgsrc/x11/libdrm/patches/patch-xf86drmMode.c:1.5 pkgsrc/x11/libdrm/patches/patch-xf86drmMode.c:1.6
--- pkgsrc/x11/libdrm/patches/patch-xf86drmMode.c:1.5   Sat Jan 19 13:21:29 2019
+++ pkgsrc/x11/libdrm/patches/patch-xf86drmMode.c       Sun Mar 13 15:20:01 2022
@@ -1,28 +1,37 @@
-$NetBSD: patch-xf86drmMode.c,v 1.5 2019/01/19 13:21:29 tnn Exp $
+$NetBSD: patch-xf86drmMode.c,v 1.6 2022/03/13 15:20:01 tnn Exp $
 
 FreeBSD/DragonFly/NetBSD support. From FreeBSD ports and NetBSD xsrc
 
---- xf86drmMode.c.orig 2018-10-16 14:49:03.000000000 +0000
+--- xf86drmMode.c.orig 2021-07-02 12:49:05.459105300 +0000
 +++ xf86drmMode.c
-@@ -43,6 +43,7 @@
+@@ -38,9 +38,7 @@
  #include <stdlib.h>
  #include <sys/ioctl.h>
- #ifdef HAVE_SYS_SYSCTL_H
-+#include <sys/types.h>
+ #if HAVE_SYS_SYSCTL_H
+-#ifdef __FreeBSD__
+ #include <sys/types.h>
+-#endif
  #include <sys/sysctl.h>
  #endif
  #include <stdio.h>
-@@ -799,42 +800,60 @@ drm_public int drmCheckModesettingSuppor
+@@ -808,34 +806,59 @@ drm_public int drmCheckModesettingSuppor
        closedir(sysdir);
        if (found)
                return 0;
 -#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
--      char kbusid[1024], sbusid[1024];
+-      char sbusid[1024];
 -      char oid[128];
--      int domain, bus, dev, func;
 -      int i, modesetting, ret;
 -      size_t len;
-+#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__DragonFly__)
+-
+-      /* How many GPUs do we expect in the machine ? */
+-      for (i = 0; i < 10; i++) {
+-              snprintf(oid, sizeof(oid), "hw.dri.%d.busid", i);
+-              len = sizeof(sbusid);
+-              ret = sysctlbyname(oid, sbusid, &len, NULL, 0);
+-              if (ret == -1) {
+-                      if (errno == ENOENT)
++#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined(__DragonFly__)
 +      #define bus_fmt "pci:%04x:%02x:%02x.%u"
 +      #define name_fmt "%*s %*s " bus_fmt
 +      unsigned int d1 = 0, b1 = 0, s1 = 0, f1 = 0;
@@ -38,13 +47,7 @@ FreeBSD/DragonFly/NetBSD support. From F
 +              snprintf(name, sizeof(name), "hw.dri.%i.name", i);
 +              if (sysctlbyname(name, value, &length, NULL, 0))
 +                      continue;
- 
--      ret = sscanf(busid, "pci:%04x:%02x:%02x.%d", &domain, &bus, &dev,
--          &func);
--      if (ret != 4)
--              return -EINVAL;
--      snprintf(kbusid, sizeof(kbusid), "pci:%04x:%02x:%02x.%d", domain, bus,
--          dev, func);
++
 +              value[length] = '\0';
 +              unsigned int d2 = 0, b2 = 0, s2 = 0, f2 = 0;
 +              switch (sscanf(value, name_fmt, &d2, &b2, &s2, &f2)) {
@@ -53,14 +56,6 @@ FreeBSD/DragonFly/NetBSD support. From F
 +                      snprintf(name, sizeof(name), "hw.dri.%i.busid", i);
 +                      if (sysctlbyname(name, value, &length, NULL, 0))
 +                              continue;
- 
--      /* How many GPUs do we expect in the machine ? */
--      for (i = 0; i < 16; i++) {
--              snprintf(oid, sizeof(oid), "hw.dri.%d.busid", i);
--              len = sizeof(sbusid);
--              ret = sysctlbyname(oid, sbusid, &len, NULL, 0);
--              if (ret == -1) {
--                      if (errno == ENOENT)
 +                      value[length] = '\0';
 +                      if (sscanf(value, bus_fmt, &d2, &b2, &s2, &f2) != 4)
                                continue;
@@ -88,7 +83,7 @@ FreeBSD/DragonFly/NetBSD support. From F
 +              default:
 +                      break;
                }
--              if (strcmp(sbusid, kbusid) != 0)
+-              if (strcmp(sbusid, busid) != 0)
 -                      continue;
 -              snprintf(oid, sizeof(oid), "hw.dri.%d.modesetting", i);
 -              len = sizeof(modesetting);
@@ -104,7 +99,7 @@ FreeBSD/DragonFly/NetBSD support. From F
        int     fd;
        struct drm_mode_card_res res;
        drmModeResPtr r = 0;
-@@ -987,7 +1006,7 @@ drm_public int drmModePageFlipTarget(int
+@@ -988,7 +1011,7 @@ drm_public int drmModePageFlipTarget(int
  
  drm_public int drmModeSetPlane(int fd, uint32_t plane_id, uint32_t crtc_id,
                    uint32_t fb_id, uint32_t flags,

Added files:

Index: pkgsrc/x11/libdrm/patches/patch-amdgpu_amdgpu__cs.c
diff -u /dev/null pkgsrc/x11/libdrm/patches/patch-amdgpu_amdgpu__cs.c:1.3
--- /dev/null   Sun Mar 13 15:20:01 2022
+++ pkgsrc/x11/libdrm/patches/patch-amdgpu_amdgpu__cs.c Sun Mar 13 15:20:01 2022
@@ -0,0 +1,17 @@
+$NetBSD: patch-amdgpu_amdgpu__cs.c,v 1.3 2022/03/13 15:20:01 tnn Exp $
+
+libc-supplied compat alloca(3) should not be used
+
+--- amdgpu/amdgpu_cs.c.orig    2022-02-16 10:00:13.000000000 +0000
++++ amdgpu/amdgpu_cs.c
+@@ -28,9 +28,7 @@
+ #include <pthread.h>
+ #include <sched.h>
+ #include <sys/ioctl.h>
+-#if HAVE_ALLOCA_H
+-# include <alloca.h>
+-#endif
++#define alloca(size) __builtin_alloca(size)
+ 
+ #include "xf86drm.h"
+ #include "amdgpu_drm.h"

Index: pkgsrc/x11/libdrm/patches/patch-etnaviv_etnaviv__device.c
diff -u /dev/null pkgsrc/x11/libdrm/patches/patch-etnaviv_etnaviv__device.c:1.1
--- /dev/null   Sun Mar 13 15:20:01 2022
+++ pkgsrc/x11/libdrm/patches/patch-etnaviv_etnaviv__device.c   Sun Mar 13 15:20:01 2022
@@ -0,0 +1,17 @@
+$NetBSD: patch-etnaviv_etnaviv__device.c,v 1.1 2022/03/13 15:20:01 tnn Exp $
+
+Fix Linuxisms.
+
+--- etnaviv/etnaviv_device.c.orig      2021-07-02 12:49:05.425771700 +0000
++++ etnaviv/etnaviv_device.c
+@@ -25,8 +25,10 @@
+  */
+ 
+ #include <stdlib.h>
++#ifdef __linux__
+ #include <linux/stddef.h>
+ #include <linux/types.h>
++#endif
+ #include <errno.h>
+ #include <sys/mman.h>
+ #include <fcntl.h>
Index: pkgsrc/x11/libdrm/patches/patch-exynos_exynos__drm.c
diff -u /dev/null pkgsrc/x11/libdrm/patches/patch-exynos_exynos__drm.c:1.1
--- /dev/null   Sun Mar 13 15:20:01 2022
+++ pkgsrc/x11/libdrm/patches/patch-exynos_exynos__drm.c        Sun Mar 13 15:20:01 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-exynos_exynos__drm.c,v 1.1 2022/03/13 15:20:01 tnn Exp $
+
+Fix Linuxisms.
+
+--- exynos/exynos_drm.c.orig   2022-02-16 10:00:13.000000000 +0000
++++ exynos/exynos_drm.c
+@@ -31,7 +31,9 @@
+ #include <unistd.h>
+ 
+ #include <sys/mman.h>
++#ifdef __linux__
+ #include <linux/stddef.h>
++#endif
+ 
+ #include <xf86drm.h>
+ 
Index: pkgsrc/x11/libdrm/patches/patch-exynos_exynos__fimg2d.c
diff -u /dev/null pkgsrc/x11/libdrm/patches/patch-exynos_exynos__fimg2d.c:1.1
--- /dev/null   Sun Mar 13 15:20:01 2022
+++ pkgsrc/x11/libdrm/patches/patch-exynos_exynos__fimg2d.c     Sun Mar 13 15:20:01 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-exynos_exynos__fimg2d.c,v 1.1 2022/03/13 15:20:01 tnn Exp $
+
+Fix Linuxisms.
+
+--- exynos/exynos_fimg2d.c.orig        2022-02-16 10:00:13.000000000 +0000
++++ exynos/exynos_fimg2d.c
+@@ -30,7 +30,9 @@
+ #include <assert.h>
+ 
+ #include <sys/mman.h>
++#ifdef __linux__
+ #include <linux/stddef.h>
++#endif
+ 
+ #include <xf86drm.h>
+ 
Index: pkgsrc/x11/libdrm/patches/patch-meson.build
diff -u /dev/null pkgsrc/x11/libdrm/patches/patch-meson.build:1.1
--- /dev/null   Sun Mar 13 15:20:01 2022
+++ pkgsrc/x11/libdrm/patches/patch-meson.build Sun Mar 13 15:20:01 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-meson.build,v 1.1 2022/03/13 15:20:01 tnn Exp $
+
+xxx how to deal with this properly?
+
+--- meson.build.orig   2021-07-02 12:49:05.442438400 +0000
++++ meson.build
+@@ -35,7 +35,7 @@ config.set10('UDEV', get_option('udev'))
+ with_freedreno_kgsl = get_option('freedreno-kgsl')
+ with_install_tests = get_option('install-test-programs')
+ 
+-if ['freebsd', 'dragonfly', 'netbsd'].contains(host_machine.system())
++if ['freebsd', 'dragonfly'].contains(host_machine.system())
+   dep_pthread_stubs = dependency('pthread-stubs', version : '>= 0.4')
+ else
+   dep_pthread_stubs = []
Index: pkgsrc/x11/libdrm/patches/patch-omap_omap__drm.c
diff -u /dev/null pkgsrc/x11/libdrm/patches/patch-omap_omap__drm.c:1.1
--- /dev/null   Sun Mar 13 15:20:01 2022
+++ pkgsrc/x11/libdrm/patches/patch-omap_omap__drm.c    Sun Mar 13 15:20:01 2022
@@ -0,0 +1,17 @@
+$NetBSD: patch-omap_omap__drm.c,v 1.1 2022/03/13 15:20:01 tnn Exp $
+
+Fix Linuxisms.
+
+--- omap/omap_drm.c.orig       2022-02-16 10:00:13.000000000 +0000
++++ omap/omap_drm.c
+@@ -27,8 +27,10 @@
+  */
+ 
+ #include <stdlib.h>
++#ifdef __linux__
+ #include <linux/stddef.h>
+ #include <linux/types.h>
++#endif
+ #include <errno.h>
+ #include <sys/mman.h>
+ #include <fcntl.h>
Index: pkgsrc/x11/libdrm/patches/patch-tests_exynos_exynos__fimg2d__test.c
diff -u /dev/null pkgsrc/x11/libdrm/patches/patch-tests_exynos_exynos__fimg2d__test.c:1.1
--- /dev/null   Sun Mar 13 15:20:01 2022
+++ pkgsrc/x11/libdrm/patches/patch-tests_exynos_exynos__fimg2d__test.c Sun Mar 13 15:20:01 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-tests_exynos_exynos__fimg2d__test.c,v 1.1 2022/03/13 15:20:01 tnn Exp $
+
+Fix Linuxisms.
+
+--- tests/exynos/exynos_fimg2d_test.c.orig     2022-02-16 10:00:13.000000000 +0000
++++ tests/exynos/exynos_fimg2d_test.c
+@@ -31,7 +31,9 @@
+ #include <unistd.h>
+ 
+ #include <sys/mman.h>
++#ifdef __linux__
+ #include <linux/stddef.h>
++#endif
+ 
+ #include <xf86drm.h>
+ #include <xf86drmMode.h>
Index: pkgsrc/x11/libdrm/patches/patch-tests_nouveau_threaded.c
diff -u /dev/null pkgsrc/x11/libdrm/patches/patch-tests_nouveau_threaded.c:1.1
--- /dev/null   Sun Mar 13 15:20:01 2022
+++ pkgsrc/x11/libdrm/patches/patch-tests_nouveau_threaded.c    Sun Mar 13 15:20:01 2022
@@ -0,0 +1,13 @@
+$NetBSD: patch-tests_nouveau_threaded.c,v 1.1 2022/03/13 15:20:01 tnn Exp $
+
+--- tests/nouveau/threaded.c.orig      2021-07-02 12:49:05.455772000 +0000
++++ tests/nouveau/threaded.c
+@@ -36,7 +36,7 @@ static int failed;
+ 
+ static int import_fd;
+ 
+-#if defined(__GLIBC__) || defined(__FreeBSD__)
++#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ int ioctl(int fd, unsigned long request, ...)
+ #else
+ int ioctl(int fd, int request, ...)



Home | Main Index | Thread Index | Old Index