From 70639db527db2e14634670cc204d7f71f0d1c840 Mon Sep 17 00:00:00 2001 From: David Shao Date: Mon, 22 Jul 2019 22:13:45 -0700 Subject: [PATCH] modular-xorg-server-dfbsd: Update wip/modular-xorg-server-dfbsd to 1.20.5 Changes: * Meson build * Knobs for patches for NetBSD xsrc * There doesn't seem to be a reason for any difference between xsrc and pkgsrc on NetBSD except possibly for the -noretro flag --- modular-xorg-server-dfbsd/Makefile | 14 +- modular-xorg-server-dfbsd/Makefile.common | 66 +++++-- modular-xorg-server-dfbsd/PLIST | 39 ++-- modular-xorg-server-dfbsd/TODO | 18 ++ modular-xorg-server-dfbsd/distinfo | 47 +++-- modular-xorg-server-dfbsd/options.mk | 183 ++++++++++++++---- .../patches/patch-Xext_xf86bigfont.c | 16 ++ .../patches/patch-config_devd.c | 15 +- .../patches/patch-config_meson.build | 27 +++ .../patches/patch-config_wscons.c | 145 ++++++++++++++ .../patches/patch-configure | 48 ----- .../patches/patch-glx_glxscreens.h | 21 ++ .../patch-hw_xfree86_common_xf86AutoConfig.c | 111 ++++++++++- .../patch-hw_xfree86_common_xf86Config.c | 45 ++++- .../patch-hw_xfree86_common_xf86Configure.c | 45 +++++ .../patch-hw_xfree86_common_xf86Helper.c | 23 +++ .../patch-hw_xfree86_common_xf86pciBus.c | 53 +++-- .../patches/patch-hw_xfree86_common_xf86str.h | 14 ++ .../patches/patch-hw_xfree86_common_xf86xv.h | 16 ++ ...e86_drivers_modesetting_drmmode__display.c | 54 +++++- .../patch-hw_xfree86_int10_helper__exec.c | 33 ++++ ...atch-hw_xfree86_os-support_bsd_bsd__VTsw.c | 6 +- ...atch-hw_xfree86_os-support_bsd_bsd__init.c | 25 ++- .../patch-hw_xfree86_os-support_meson.build | 22 +++ .../patches/patch-hw_xfree86_parser_Device.c | 29 +++ .../patch-hw_xfree86_parser_xf86Parser.h | 23 +++ .../patches/patch-hw_xfree86_vgahw_vgaHW.h | 27 +++ .../patches/patch-include_displaymode.h | 17 ++ .../patches/patch-include_glx__extinit.h | 25 +++ .../patches/patch-include_meson.build | 46 +++++ .../patches/patch-include_os.h | 23 +++ .../patches/patch-meson.build | 14 ++ .../patches/patch-meson__options.txt | 13 ++ .../patches/patch-os_utils.c | 55 ++++++ .../patches/patch-randr_randrstr.h | 50 +++++ .../patches/patch-test_xtest.c | 15 ++ 36 files changed, 1258 insertions(+), 165 deletions(-) create mode 100644 modular-xorg-server-dfbsd/patches/patch-Xext_xf86bigfont.c create mode 100644 modular-xorg-server-dfbsd/patches/patch-config_meson.build create mode 100644 modular-xorg-server-dfbsd/patches/patch-config_wscons.c delete mode 100644 modular-xorg-server-dfbsd/patches/patch-configure create mode 100644 modular-xorg-server-dfbsd/patches/patch-glx_glxscreens.h create mode 100644 modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Configure.c create mode 100644 modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Helper.c create mode 100644 modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86str.h create mode 100644 modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86xv.h create mode 100644 modular-xorg-server-dfbsd/patches/patch-hw_xfree86_int10_helper__exec.c create mode 100644 modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_meson.build create mode 100644 modular-xorg-server-dfbsd/patches/patch-hw_xfree86_parser_Device.c create mode 100644 modular-xorg-server-dfbsd/patches/patch-hw_xfree86_parser_xf86Parser.h create mode 100644 modular-xorg-server-dfbsd/patches/patch-hw_xfree86_vgahw_vgaHW.h create mode 100644 modular-xorg-server-dfbsd/patches/patch-include_displaymode.h create mode 100644 modular-xorg-server-dfbsd/patches/patch-include_glx__extinit.h create mode 100644 modular-xorg-server-dfbsd/patches/patch-include_meson.build create mode 100644 modular-xorg-server-dfbsd/patches/patch-include_os.h create mode 100644 modular-xorg-server-dfbsd/patches/patch-meson.build create mode 100644 modular-xorg-server-dfbsd/patches/patch-meson__options.txt create mode 100644 modular-xorg-server-dfbsd/patches/patch-os_utils.c create mode 100644 modular-xorg-server-dfbsd/patches/patch-randr_randrstr.h create mode 100644 modular-xorg-server-dfbsd/patches/patch-test_xtest.c diff --git a/modular-xorg-server-dfbsd/Makefile b/modular-xorg-server-dfbsd/Makefile index 754cabc14e..b81d996339 100644 --- a/modular-xorg-server-dfbsd/Makefile +++ b/modular-xorg-server-dfbsd/Makefile @@ -1,14 +1,19 @@ -# $NetBSD: Makefile,v 1.117 2018/10/26 10:20:12 maya Exp $ +# $NetBSD: Makefile,v 1.119 2019/07/20 22:46:57 wiz Exp $ DISTNAME= xorg-server-${XORG_VERSION} PKGNAME= modular-${DISTNAME} -PKGREVISION= 1 +# DISTNAME= xorg-server-${XORG_VERSION} +# PKGNAME= modular-xorg-server-${XORG_VERSION} +# PKGREVISION= 1 MAINTAINER= pkgsrc-users@NetBSD.org COMMENT= Modular X11 server from modular X.org SPECIAL_PERMS+= bin/Xorg ${SETUID_ROOT_PERMS} +post-install: + ${LN} -sf ${PREFIX}/bin/Xorg ${DESTDIR}${PREFIX}/bin/X + NOT_FOR_PLATFORM= Darwin-*-* .include "Makefile.common" @@ -17,6 +22,11 @@ CONFIGURE_ARGS+= --enable-xorg CONFIGURE_ARGS+= --disable-xephyr CONFIGURE_ARGS+= --disable-kdrive CONFIGURE_ARGS.SunOS+= --disable-input-thread +MESON_ARGS+= -Dxorg=true +MESON_ARGS+= -Dxephyr=false +.if ${OPSYS} == "SunOS" +MESON_ARGS+= -Dinput_thread=false +.endif .include "options.mk" diff --git a/modular-xorg-server-dfbsd/Makefile.common b/modular-xorg-server-dfbsd/Makefile.common index 54379a1ad4..912ac1cf07 100644 --- a/modular-xorg-server-dfbsd/Makefile.common +++ b/modular-xorg-server-dfbsd/Makefile.common @@ -1,17 +1,27 @@ -# $NetBSD: Makefile.common,v 1.26 2018/10/25 22:40:57 maya Exp $ +# $NetBSD: Makefile.common,v 1.27 2019/02/27 16:32:58 wiz Exp $ # used by x11/modular-xorg-server/Makefile # used by x11/modular-xorg-xephyr/Makefile -XORG_VERSION= 1.20.3 +# 2019-03-05 meson: Bump required meson version to 0.46 +# COMMIT_ID= 7e046b9467784451769af3a03db46e3c690063b0 + +# PORTNAME= xserver + +# DISTNAME= ${PORTNAME}-${COMMIT_ID} + +XORG_VERSION= 1.20.5 CATEGORIES= x11 MASTER_SITES= ${MASTER_SITE_XORG:=xserver/} EXTRACT_SUFX= .tar.bz2 +# MASTER_SITES= http://cgit.freedesktop.org/xorg/${PORTNAME}/snapshot/ +# EXTRACT_SUFX= .tar.xz HOMEPAGE= http://xorg.freedesktop.org/ LICENSE= mit AND modified-bsd AND x11 # with no-advertising clause -GNU_CONFIGURE= yes -USE_LIBTOOL= yes +# GNU_CONFIGURE= yes +# USE_LIBTOOL= yes +# USE_TOOLS+= gmake pkg-config autoconf automake autoreconf USE_TOOLS+= gmake pkg-config USE_LANGUAGES+= c99 @@ -27,6 +37,9 @@ XKB_OUTPUT_DIR?= ${VARBASE}/db/xkb # XXX sync with xkeyboard-config CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q} CONFIGURE_ARGS+= --with-xkb-output=${XKB_OUTPUT_DIR:Q} +# MESON_ARGS+= -Dlog_dir=${VARBASE:Q}/log +MESON_ARGS+= -Dlocalstatedir=${VARBASE:Q} +MESON_ARGS+= -Dxkb_output_dir=${XKB_OUTPUT_DIR:Q} .if !empty(USE_TOOLS:Mauto*) TOOLS_DEPENDS+= xorg-util-macros>=1.1.5:../../devel/xorg-util-macros @@ -41,6 +54,8 @@ DEPENDS+= xkeyboard-config-[0-9]*:../../x11/xkeyboard-config CPPFLAGS+= -D_OPENBSD_SOURCE # for reallocarray(3) CONFIGURE_ARGS+= --with-builder-addr="tech-x11@NetBSD.org" CONFIGURE_ARGS+= --with-os-vendor="The NetBSD Foundation" +MESON_ARGS+= -Dbuilder_addr="tech-x11@NetBSD.org" +MESON_ARGS+= -Dbuilder_string="The NetBSD Foundation" # TLS is not supported by NetBSD<6 . if !empty(OS_VERSION:M[0-5].*) CONFIGURE_ENV+= ac_cv_tls=no @@ -60,20 +75,27 @@ LEGACY_FONT_PATHS+= ${PREFIX}/lib/X11/fonts/${f} FONT_PATHS= ${DEFAULT_FONT_PATHS} ${LEGACY_FONT_PATHS} CONFIGURE_ARGS+= --with-default-font-path=${FONT_PATHS:ts,:Q} +MESON_ARGS+= -Ddefault_font_path=${FONT_PATHS:ts,:Q} CONFIGURE_ARGS+= --disable-config-hal CONFIGURE_ARGS+= --disable-dmx -.if ${OPSYS} != "FreeBSD" && ${OPSYS} != "DragonFly" +MESON_ARGS+= -Dhal=false +MESON_ARGS+= -Ddmx=false CONFIGURE_ARGS+= --disable-xwin -.endif +MESON_ARGS+= -Dxwin=false CONFIGURE_ARGS+= --disable-xephyr +MESON_ARGS+= -Dxephyr=false -.if ${OPSYS} != "FreeBSD" && ${OPSYS} != "DragonFly" CONFIGURE_ARGS+= --disable-kdrive #CONFIGURE_ARGS+= --disable-kdrive-vesa CONFIGURE_ARGS+= --enable-xtrans-send-fds CONFIGURE_ARGS+= --with-int10=x86emu +MESON_ARGS+= -Dint10=x86emu + +.if ${OPSYS} != "Linux" +MESON_ARGS+= -Dudev=false +MESON_ARGS+= -Dxwayland=false .endif # From FreeBSD ports @@ -86,6 +108,9 @@ CONFIGURE_ARGS+= --disable-config-udev-kms # CONFIGURE_ARGS+= --disable-xvfb CONFIGURE_ARGS+= --disable-xwayland CONFIGURE_ARGS+= --enable-xcsecurity +# MESON_ARGS+= -Dudev=false +# MESON_ARGS+= -Dxwayland=false +MESON_ARGS+= -Dxcsecurity=true .endif # FreeBSD ports devel/libunwind not ported to pkgsrc @@ -125,6 +150,15 @@ CONFIGURE_ENV.SunOS+= ac_cv_func_epoll_create1=no # Only available in newer releases CONFIGURE_ENV.SunOS+= ac_cv_func_mkostemp=no +# Avoid secure-rpc on NetBSD +.if ${OPSYS} == "NetBSD" +MESON_ARGS+= -Dsecure-rpc=false +.endif + +# .if ${OPSYS} == "FreeBSD" +# CFLAGS+= -Wno-missing-braces +# .endif + .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" # Workaround glamor lockups when drm-devel-kmod (4.15-4.17) is installed # with partial reverting of commit @@ -147,12 +181,19 @@ BUILDLINK_API_DEPENDS.pixman+= pixman>=0.21.8 BUILD_DEPENDS+= tradcpp-[0-9]*:../../devel/tradcpp CONFIGURE_ENV+= ac_cv_path_RAWCPP="${PREFIX}/bin/tradcpp -Uunix" -.if ${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD" || ${OPSYS} == "Bitrig" || ${OPSYS} == "MirBSD" -CONFIGURE_ARGS+= --with-sha1=libc -.else +# .if ${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD" || ${OPSYS} == "Bitrig" || ${OPSYS} == "MirBSD" +# CONFIGURE_ARGS+= --with-sha1=libc +# .else .include "../../security/nettle/buildlink3.mk" CONFIGURE_ARGS+= --with-sha1=libnettle -.endif +# .endif + +# Autotools +# pre-configure: +# cd ${WRKSRC} && autoreconf -vif + +# Meson +.include "../../devel/py-meson/build.mk" .include "../../devel/ncurses/buildlink3.mk" .include "../../devel/zlib/buildlink3.mk" @@ -179,4 +220,7 @@ BUILDLINK_API_DEPENDS.libXext+= libXext>=1.1.1 .include "../../x11/pixman/buildlink3.mk" .include "../../x11/xcb-util-keysyms/buildlink3.mk" .include "../../x11/xtrans/buildlink3.mk" +.include "../../fonts/font-util/buildlink3.mk" .include "../../mk/pthread.buildlink3.mk" +.include "../../sysutils/dbus/buildlink3.mk" +.include "../../x11/xkbcomp/buildlink3.mk" diff --git a/modular-xorg-server-dfbsd/PLIST b/modular-xorg-server-dfbsd/PLIST index 7fb292a14e..37e2f55139 100644 --- a/modular-xorg-server-dfbsd/PLIST +++ b/modular-xorg-server-dfbsd/PLIST @@ -34,7 +34,7 @@ include/xorg/dixgrabs.h include/xorg/dixstruct.h ${PLIST.dri}include/xorg/dri.h ${PLIST.dri}include/xorg/dri2.h -${PLIST.dri3}include/xorg/dri3.h +${PLIST.dri}include/xorg/dri3.h ${PLIST.dri}include/xorg/dristruct.h include/xorg/edid.h include/xorg/events.h @@ -169,18 +169,30 @@ include/xorg/xserver_poll.h include/xorg/xvdix.h include/xorg/xvmcext.h lib/pkgconfig/xorg-server.pc -${PLIST.dri}lib/xorg/modules/drivers/modesetting_drv.la -${PLIST.dri}lib/xorg/modules/extensions/libglx.la -lib/xorg/modules/libexa.la -lib/xorg/modules/libfb.la -lib/xorg/modules/libfbdevhw.la -${PLIST.dri}lib/xorg/modules/libglamoregl.la -lib/xorg/modules/libint10.la -lib/xorg/modules/libshadow.la -lib/xorg/modules/libshadowfb.la -lib/xorg/modules/libvbe.la -lib/xorg/modules/libvgahw.la -lib/xorg/modules/libwfb.la +@comment ${PLIST.dri}lib/xorg/modules/drivers/modesetting_drv.la +@comment ${PLIST.dri}lib/xorg/modules/extensions/libglx.la +@comment lib/xorg/modules/libexa.la +@comment lib/xorg/modules/libfb.la +@comment lib/xorg/modules/libfbdevhw.la +@comment ${PLIST.dri}lib/xorg/modules/libglamoregl.la +@comment lib/xorg/modules/libint10.la +@comment lib/xorg/modules/libshadow.la +@comment lib/xorg/modules/libshadowfb.la +@comment lib/xorg/modules/libvbe.la +@comment lib/xorg/modules/libvgahw.la +@comment lib/xorg/modules/libwfb.la +${PLIST.dri}lib/xorg/modules/drivers/modesetting_drv.so +${PLIST.dri}lib/xorg/modules/extensions/libglx.so +lib/xorg/modules/libexa.so +lib/xorg/modules/libfb.so +lib/xorg/modules/libfbdevhw.so +${PLIST.dri}lib/xorg/modules/libglamoregl.so +lib/xorg/modules/libint10.so +lib/xorg/modules/libshadow.so +lib/xorg/modules/libshadowfb.so +lib/xorg/modules/libvbe.so +lib/xorg/modules/libvgahw.so +lib/xorg/modules/libwfb.so lib/xorg/protocol.txt man/man1/Xnest.1 man/man1/Xorg.1 @@ -193,6 +205,7 @@ man/man4/fbdevhw.4 ${PLIST.dri}man/man4/modesetting.4 man/man5/xorg.conf.5 man/man5/xorg.conf.d.5 +share/X11/xorg.conf.d/10-quirks.conf share/aclocal/xorg-server.m4 ${PLIST.dtrace}share/doc/xorg-server/Xserver-DTrace.xml @pkgdir lib/xorg/modules/input diff --git a/modular-xorg-server-dfbsd/TODO b/modular-xorg-server-dfbsd/TODO index ff35145371..1dcee4e566 100644 --- a/modular-xorg-server-dfbsd/TODO +++ b/modular-xorg-server-dfbsd/TODO @@ -7,3 +7,21 @@ to be accepted. Port devd patches for 1.19.6 that have not been merged into FreeBSD ports, supports evdev. + +Get modular-xorg-xephyr to build again. + +Get xf86-video-nv, xf86-video-vmware to build again. + +See what needs to be ported for hw/xfree86/common/compiler.h for arm +on NetBSD + +In hw/xfree86/common/xf86AutoConfig.c, does NetBSD or any non-linux +use fbdev + +Can wskbd be used on NetBSD modesetting like it can be for OpenBSD + +Does NetBSD still need the old Xpoll.h fixes + +Does NetBSD need -noretro options + +RRSetChanged in randr/randrstr.h does not seem to need to be exported diff --git a/modular-xorg-server-dfbsd/distinfo b/modular-xorg-server-dfbsd/distinfo index c614b80fe2..83ac45038f 100644 --- a/modular-xorg-server-dfbsd/distinfo +++ b/modular-xorg-server-dfbsd/distinfo @@ -1,32 +1,53 @@ -$NetBSD: distinfo,v 1.92 2018/10/26 10:20:12 maya Exp $ +$NetBSD: distinfo,v 1.94 2019/02/28 12:32:39 tnn Exp $ -SHA1 (xorg-server-1.20.3.tar.bz2) = a522cd543606b4d0509d821b8061904951171c50 -RMD160 (xorg-server-1.20.3.tar.bz2) = a57a7e3d0d2e3c84f4743de6890c7d26b502e7a1 -SHA512 (xorg-server-1.20.3.tar.bz2) = ee44554f86df4297f54c5871fe7a18954eeef4338775a25f36d6577b279c4775f61128da71b86cfaeadcc080838d6749dede138d4db178866579da2056543fba -Size (xorg-server-1.20.3.tar.bz2) = 6205000 bytes +SHA1 (xorg-server-1.20.5.tar.bz2) = fea6fd34c7f48b3c69fbecd8fb294eaa1498e69c +RMD160 (xorg-server-1.20.5.tar.bz2) = 4b8c60978045bff8974524180e59b070fb1f1dec +SHA512 (xorg-server-1.20.5.tar.bz2) = 625f0626b122cf95600abe382c3217348999357a0e2d2443092f1b67cff1c98d7ef09303884ceaeac181e0555dc56b0d4d44bda45cc464dac2d9a50c5b32d631 +Size (xorg-server-1.20.5.tar.bz2) = 6126757 bytes +SHA1 (patch-Xext_xf86bigfont.c) = 0d8b9f84f3441764d990c0d7ee41dc34e5430cde SHA1 (patch-config_config-backends.h) = f44868caa51e972a76949f73ac6083640af2c351 SHA1 (patch-config_config.c) = 5a3fe4cb6c2170335ab547f438386cff77a9c152 -SHA1 (patch-config_devd.c) = f90ca44c3ebfab5a848ab027d90101451a0f4042 -SHA1 (patch-configure) = 88707ff2b12acd81b1ec1a183a71b1141273f7b5 +SHA1 (patch-config_devd.c) = 6d29e3ecc0e31401a9eff88c56c7a961ca76bc65 +SHA1 (patch-config_meson.build) = 3d70b7c70994245a4527a51d0a0e00bcb0476422 +SHA1 (patch-config_wscons.c) = 7e513be454f5f1ad2ecd89fc1a6413a6b463fe5b SHA1 (patch-glamor_glamor__egl.c) = 8057778a5f0fd03c3ecd1191cff9123310396a1f -SHA1 (patch-hw_xfree86_common_xf86AutoConfig.c) = 61c72780a65d423965225a2dd2206bcf2264c89f -SHA1 (patch-hw_xfree86_common_xf86Config.c) = bcb413a2211ddcde0728a368e313bea841e03828 +SHA1 (patch-glx_glxscreens.h) = 209411cda660c1a84b7b4f6e40c93cced4d3a8d7 +SHA1 (patch-hw_xfree86_common_xf86AutoConfig.c) = 308e9d76f43aaa9181dcebd6108b01b42dd1bd37 +SHA1 (patch-hw_xfree86_common_xf86Config.c) = 1d81213fa85ad5f429337510bdccaf5cd2100814 +SHA1 (patch-hw_xfree86_common_xf86Configure.c) = a59985ee7075f25378bb62b590e73f4537743f8c SHA1 (patch-hw_xfree86_common_xf86Globals.c) = da35eb1c437eaffce0b8f8a3964e3a75631d8a73 +SHA1 (patch-hw_xfree86_common_xf86Helper.c) = 52a30f00fb95ee433ed6ba3b72073f3fc32259bd SHA1 (patch-hw_xfree86_common_xf86Xinput.c) = 5ad0c36fe68f87c853ac084640269e3b8f9370c9 -SHA1 (patch-hw_xfree86_common_xf86pciBus.c) = 896825ba12646431cba603938d118acbdde305dd +SHA1 (patch-hw_xfree86_common_xf86pciBus.c) = 912d0f6a89e6123b12346b38bb15c520aa9751e7 SHA1 (patch-hw_xfree86_common_xf86sbusBus.h) = f56f87336b2f669413ebb1005a2b64568a111f92 +SHA1 (patch-hw_xfree86_common_xf86str.h) = 651752e7367fd3440879239a044b45dbb94870cb +SHA1 (patch-hw_xfree86_common_xf86xv.h) = e96f7085d6f0a6f6735b87dbb7b3bfaabb5e49f3 SHA1 (patch-hw_xfree86_dri2_dri2.c) = 475ea1956f2e71d684cf1e5a8a68b30279959a04 -SHA1 (patch-hw_xfree86_drivers_modesetting_drmmode__display.c) = 61735de44b0579d0a3d2bfb0d91c72c365d1b93f +SHA1 (patch-hw_xfree86_drivers_modesetting_drmmode__display.c) = c7ef32165328addf6360f9482b6fd0e2ae041b98 +SHA1 (patch-hw_xfree86_int10_helper__exec.c) = cad89a98a29ab2a97b6ed81f65a9deb71db94455 SHA1 (patch-hw_xfree86_modes_xf86Cursors.c) = bd9870edb1196a4d2eab49b2d13fbe6eefbe4c09 SHA1 (patch-hw_xfree86_os-support_bsd_arm__video.c) = 9c03b24f44eafc5fabe27e9d6cc6c54b607e47c3 -SHA1 (patch-hw_xfree86_os-support_bsd_bsd__VTsw.c) = 90343f694c27a6fdd5070e1167687943bd056a99 -SHA1 (patch-hw_xfree86_os-support_bsd_bsd__init.c) = 0180a25df158ce3716071882fbb55cff9fe8e5ff +SHA1 (patch-hw_xfree86_os-support_bsd_bsd__VTsw.c) = 1c0e8c67885397e1b41da5a2ba10a29e1e5175f3 +SHA1 (patch-hw_xfree86_os-support_bsd_bsd__init.c) = 6355e00bbfdb3ac92ee1c65d6a5308aa623aa076 SHA1 (patch-hw_xfree86_os-support_bsd_i386__video.c) = 68889e3ae80b9536d82909855ec7156caa928374 SHA1 (patch-hw_xfree86_os-support_bsd_ppc__video.c) = 2f5126ee47cbd66c0241e8fbf66c8af363e01fd7 SHA1 (patch-hw_xfree86_os-support_bus_Sbus.c) = 0035b970bdae1bab51b8ca6bfeed060ec4df3a60 +SHA1 (patch-hw_xfree86_os-support_meson.build) = b91dfc27341c1816f4e529d311a7d1cf56387db6 SHA1 (patch-hw_xfree86_os-support_solaris_solaris-amd64.S) = 088a3118deb7567194e08dd46e34cb6edba38400 SHA1 (patch-hw_xfree86_os-support_xf86_OSproc.h) = e1c049857893d2f050d5fb297a3e8ef86f0b1d7e SHA1 (patch-hw_xfree86_os_support_bus_xf86Sbus.h) = 0e0a243b737f8f762c9f8f24a2265d1b6aefb544 +SHA1 (patch-hw_xfree86_parser_Device.c) = ad2f60aa97e649937e7071164d8911c351dc040c +SHA1 (patch-hw_xfree86_parser_xf86Parser.h) = 64993ddaaaaebcff4d67c0257043eea343d4c8a0 +SHA1 (patch-hw_xfree86_vgahw_vgaHW.h) = a95ca014029bbdb47a561c21530509e38e2b8bf4 SHA1 (patch-hw_xfree86_xorg-wrapper.c) = d1178c088307cd3781f8989522bab570b551ff55 +SHA1 (patch-include_displaymode.h) = a9b26c7074652d0cc4b5b8000cf184148872db45 +SHA1 (patch-include_glx__extinit.h) = 15c2ffd9a029b31bcff879d978fd161b293780fd +SHA1 (patch-include_meson.build) = e95975e01ebb56d74a5dcb421e54545c1a3a29be +SHA1 (patch-include_os.h) = a91e911f3cc1f6374d61cd83033a6d5bef102e6d +SHA1 (patch-meson.build) = ca054971f140966189952da69621da919c167da9 +SHA1 (patch-meson__options.txt) = 1ad0114a7a7944a388184560bb9330747e457d7b +SHA1 (patch-os_utils.c) = b5e456e640671e191165957e83a4c31f4ce790c4 SHA1 (patch-randr_randr.c) = eb44a07770ca7308d706aa2324408bb8c6c6b7ba +SHA1 (patch-randr_randrstr.h) = 1f6642c0494f5c23c9c20b99f2bd574986323d35 SHA1 (patch-randr_rrlease.c) = 82ace923fe7b65f4cf1be2ff243eabd886f3109e +SHA1 (patch-test_xtest.c) = 77622ef481e91e64b3a6dd64b8579404f33ec88f diff --git a/modular-xorg-server-dfbsd/options.mk b/modular-xorg-server-dfbsd/options.mk index 633a0be575..20e4011e42 100644 --- a/modular-xorg-server-dfbsd/options.mk +++ b/modular-xorg-server-dfbsd/options.mk @@ -2,49 +2,92 @@ PKG_OPTIONS_VAR= PKG_OPTIONS.modular-xorg-server PKG_SUPPORTED_OPTIONS= inet6 debug dtrace -PKG_SUPPORTED_OPTIONS+= revert_flink -PKG_SUPPORTED_OPTIONS+= revert_randr_lease -PKG_SUPPORTED_OPTIONS+= allow_unprivileged PKG_SUGGESTED_OPTIONS= inet6 +.if ${X11_TYPE} == "modular" +PKG_SUPPORTED_OPTIONS+= dri +PKG_SUGGESTED_OPTIONS+= dri +.endif + +PKG_SUPPORTED_OPTIONS+= devd +PKG_SUPPORTED_OPTIONS+= xkb_evdev + +PKG_SUPPORTED_OPTIONS+= revert_flink +PKG_SUPPORTED_OPTIONS+= revert_randr_lease +PKG_SUPPORTED_OPTIONS+= add_scfb_driver +PKG_SUPPORTED_OPTIONS+= add_modesetting_driver + +PKG_SUPPORTED_OPTIONS+= allow_unprivileged +PKG_SUPPORTED_OPTIONS+= vtsw_kdsetmode_xsrc +PKG_SUPPORTED_OPTIONS+= always_add_wsfb +PKG_SUPPORTED_OPTIONS+= sharevts_xsrc_netbsd +PKG_SUPPORTED_OPTIONS+= strict_xsrc_netbsd + +PKG_SUPPORTED_OPTIONS+= modesetting_on_intel +PKG_SUPPORTED_OPTIONS+= try_dev_wskbd + +PKG_SUPPORTED_OPTIONS+= ws_drivers_openbsd + +.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" +PKG_SUGGESTED_OPTIONS+= devd +.endif .if ${OPSYS} == "DragonFly" PKG_SUGGESTED_OPTIONS+= revert_flink PKG_SUGGESTED_OPTIONS+= revert_randr_lease .endif +# Add scfb driver in xf86AutoConfig.c +.if ${OPSYS} == "FreeBSD" +PKG_SUGGESTED_OPTIONS+= add_scfb_driver +.endif + +# Add modesetting driver in xf86AutoConfig.c +.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" +PKG_SUGGESTED_OPTIONS+= add_modesetting_driver +.endif + .if ${OPSYS} == "NetBSD" PKG_SUGGESTED_OPTIONS+= allow_unprivileged .endif -PKG_SUPPORTED_OPTIONS+= devd -.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" -PKG_SUGGESTED_OPTIONS+= devd +.if ${OPSYS} == "NetBSD" +PKG_SUGGESTED_OPTIONS+= vtsw_kdsetmode_xsrc .endif -.if ${X11_TYPE} == "modular" -PKG_SUPPORTED_OPTIONS+= dri -PKG_SUGGESTED_OPTIONS+= dri -PKG_SUPPORTED_OPTIONS+= dri3 -# dri3 requires kernel support for dma_buf -. if ${OPSYS} == "Linux" -PKG_SUGGESTED_OPTIONS+= dri3 -. endif +.if ${OPSYS} == "NetBSD" +PKG_SUGGESTED_OPTIONS+= always_add_wsfb +.endif + +.if ${OPSYS} == "NetBSD" +PKG_SUGGESTED_OPTIONS+= sharevts_xsrc_netbsd +.endif + +.if ${OPSYS} == "NetBSD" +PKG_SUGGESTED_OPTIONS+= strict_xsrc_netbsd +.endif + +# Patch from OpenBSD to aggressively use the modesetting driver on intel integrated graphics +# .if ${OPSYS} == "OpenBSD" || ${OPSYS} == "NetBSD" +.if ${OPSYS} == "OpenBSD" +PKG_SUGGESTED_OPTIONS+= modesetting_on_intel +.endif + +# From NetBSD 1.20.4 but extended to amd64 and i386 +# .if ${OPSYS} == "NetBSD" +# PKG_SUGGESTED_OPTIONS+= try_dev_wskbd +# .endif + +# From OpenBSD 6.5 xenocara xserver 1.19.7 +# .if ${OPSYS} == "OpenBSD" || ${OPSYS} == "NetBSD" +.if ${OPSYS} == "OpenBSD" +PKG_SUGGESTED_OPTIONS+= ws_drivers_openbsd .endif .include "../../mk/bsd.options.mk" PLIST_VARS+= dri dtrace -PLIST_VARS+= dri3 .if !empty(PKG_OPTIONS:Mdri) - -. if !empty(PKG_OPTIONS:Mdri3) -CONFIGURE_ARGS+= --enable-dri3 -PLIST.dri3= yes -. else -CONFIGURE_ARGS+= --disable-dri3 -. endif - .include "../../graphics/libepoxy/buildlink3.mk" BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=11 .include "../../graphics/MesaLib/buildlink3.mk" @@ -54,9 +97,15 @@ BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=11 PLIST.dri= yes CONFIGURE_ARGS+= --enable-dri CONFIGURE_ARGS+= --enable-dri2 +CONFIGURE_ARGS+= --enable-dri3 CONFIGURE_ARGS+= --enable-glx CONFIGURE_ARGS+= --enable-glamor CONFIGURE_ARGS+= --enable-present +MESON_ARGS+= -Ddri1=true +MESON_ARGS+= -Ddri2=true +MESON_ARGS+= -Ddri3=true +MESON_ARGS+= -Dglx=true +MESON_ARGS+= -Dglamor=true .else ### ### XXX Perhaps we should allow for a built-in glx without dri enabled? @@ -67,6 +116,11 @@ CONFIGURE_ARGS+= --disable-dri3 CONFIGURE_ARGS+= --disable-glx CONFIGURE_ARGS+= --disable-glamor CONFIGURE_ARGS+= --disable-present +MESON_ARGS+= -Ddri1=false +MESON_ARGS+= -Ddri2=false +MESON_ARGS+= -Ddri3=false +MESON_ARGS+= -Dglx=false +MESON_ARGS+= -Dglamor=false pre-build: disable-modesetting .PHONY: disable-modesetting disable-modesetting: @@ -75,13 +129,16 @@ disable-modesetting: .if !empty(PKG_OPTIONS:Minet6) CONFIGURE_ARGS+= --enable-ipv6 +MESON_ARGS+= -Dipv6=true .else CONFIGURE_ARGS+= --disable-ipv6 +MESON_ARGS+= -Dipv6=false .endif .if !empty(PKG_OPTIONS:Mdebug) CONFIGURE_ARGS+= --enable-debug -# Debug flags -O0 -g3 recommended by: +MESON_ARGS+= --buildtype=debug +# Debug flags -O0 -g3 recommended by: # https://www.x.org/wiki/Development/Documentation/ServerDebugging/ # CFLAGS+= -ggdb CFLAGS+= -O0 -g3 @@ -95,17 +152,25 @@ CONFIGURE_ARGS+= --without-dtrace .endif .if !empty(PKG_OPTIONS:Mdevd) -SUBST_CLASSES+= devd_config -SUBST_STAGE.devd_config= post-configure -SUBST_MESSAGE.devd_config= Patching config/Makefile for devd -SUBST_FILES.devd_config+= config/Makefile -SUBST_SED.devd_config+= -e 's|config\.c|config.c devd.c|g' -SUBST_SED.devd_config+= -e 's|config\.lo|config.lo devd.lo|g' -SUBST_CLASSES+= devd_dix -SUBST_STAGE.devd_dix= post-configure -SUBST_MESSAGE.devd_dix= Patching include/dix-config.h for devd -SUBST_FILES.devd_dix+= include/dix-config.h -SUBST_SED.devd_dix+= -e 's|/\* \#undef CONFIG_UDEV \*/|\#define CONFIG_DEVD 1 |' +# SUBST_CLASSES+= devd_config +# SUBST_STAGE.devd_config= post-configure +# SUBST_MESSAGE.devd_config= Patching config/Makefile for devd +# SUBST_FILES.devd_config+= config/Makefile +# SUBST_SED.devd_config+= -e 's|config\.c|config.c devd.c|g' +# SUBST_SED.devd_config+= -e 's|config\.lo|config.lo devd.lo|g' +# SUBST_CLASSES+= devd_dix +# SUBST_STAGE.devd_dix= post-configure +# SUBST_MESSAGE.devd_dix= Patching include/dix-config.h for devd +# SUBST_FILES.devd_dix+= include/dix-config.h +# SUBST_SED.devd_dix+= -e 's|/\* \#undef CONFIG_UDEV \*/|\#define CONFIG_DEVD 1 |' +CPPFLAGS+= -DCONFIG_DEVD=1 +MESON_ARGS+= -Ddevd=true +.endif + +.if !empty(PKG_OPTIONS:Mxkb_evdev) +MESON_ARGS+= -Dxkb_default_rules=evdev +.else +MESON_ARGS+= -Dxkb_default_rules=base .endif .if !empty(PKG_OPTIONS:Mrevert_flink) @@ -115,13 +180,51 @@ CPPFLAGS+= -DREVERT_FLINK .if !empty(PKG_OPTIONS:Mrevert_randr_lease) CPPFLAGS+= -DREVERT_RANDR_LEASE -SUBST_CLASSES+= lease -SUBST_STAGE.lease= post-configure -SUBST_MESSAGE.lease= Removing definition of XF86_LEASE_VERSION -SUBST_FILES.lease+= hw/xfree86/modes/xf86Crtc.h -SUBST_SED.lease+= -e 's|XF86_LEASE_VERSION|REVERT_XF86_LEASE_VERSION|g' +SUBST_CLASSES+= lease +SUBST_STAGE.lease= post-configure +SUBST_MESSAGE.lease= Removing definition of XF86_LEASE_VERSION +SUBST_FILES.lease+= hw/xfree86/modes/xf86Crtc.h +SUBST_SED.lease+= -e 's|XF86_LEASE_VERSION|REVERT_XF86_LEASE_VERSION|g' +.endif + +.if !empty(PKG_OPTIONS:Madd_scfb_driver) +CPPFLAGS+= -DADD_SCFB_DRIVER +.endif + +.if !empty(PKG_OPTIONS:Madd_modesetting_driver) +CPPFLAGS+= -DADD_MODESETTING_DRIVER .endif .if !empty(PKG_OPTIONS:Mallow_unprivileged) CPPFLAGS+= -DALLOW_UNPRIVILEGED .endif + +.if !empty(PKG_OPTIONS:Mvtsw_kdsetmode_xsrc) +CPPFLAGS+= -DVTSW_KDSETMODE_XSRC +.endif + +.if !empty(PKG_OPTIONS:Malways_add_wsfb) +CPPFLAGS+= -DALWAYS_ADD_WSFB +.endif + +.if !empty(PKG_OPTIONS:Msharevts_xsrc_netbsd) +CPPFLAGS+= -DSHAREVTS_XSRC_NETBSD +.endif + +.if !empty(PKG_OPTIONS:Mstrict_xsrc_netbsd) +CPPFLAGS+= -DSTRICT_XSRC_NETBSD +.endif + +.if !empty(PKG_OPTIONS:Mmodesetting_on_intel) +CPPFLAGS+= -DMODESETTING_ON_INTEL +.endif + +.if !empty(PKG_OPTIONS:Mtry_dev_wskbd) +CPPFLAGS+= -DTRY_DEV_WSKBD +CPPFLAGS+= -DCONFIG_WSCONS=1 +MESON_ARGS+= -Dwscons=true +.endif + +.if !empty(PKG_OPTIONS:Mws_drivers_openbsd) +CPPFLAGS+= -DWS_DRIVERS_OPENBSD +.endif diff --git a/modular-xorg-server-dfbsd/patches/patch-Xext_xf86bigfont.c b/modular-xorg-server-dfbsd/patches/patch-Xext_xf86bigfont.c new file mode 100644 index 0000000000..280f544a0b --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-Xext_xf86bigfont.c @@ -0,0 +1,16 @@ +$NetBSD$ + +--- Xext/xf86bigfont.c.orig 2019-03-05 16:34:21.000000000 +0000 ++++ Xext/xf86bigfont.c +@@ -377,7 +377,11 @@ ProcXF86BigfontQueryFont(ClientPtr clien + #ifdef HAS_SHM + if (!badSysCall) + pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex); ++#if defined(STRICT_XSRC_NETBSD) ++ if (pDesc && pDesc->attach_addr) { ++#else + if (pDesc) { ++#endif + pCI = (xCharInfo *) pDesc->attach_addr; + if (stuff_flags & XF86Bigfont_FLAGS_Shm) + shmid = pDesc->shmid; diff --git a/modular-xorg-server-dfbsd/patches/patch-config_devd.c b/modular-xorg-server-dfbsd/patches/patch-config_devd.c index 2320749070..54dfc47224 100644 --- a/modular-xorg-server-dfbsd/patches/patch-config_devd.c +++ b/modular-xorg-server-dfbsd/patches/patch-config_devd.c @@ -5,11 +5,13 @@ x11-servers/xorg-server 1.18.4. Added many debugging statements with DebugF. +Allow socket to return fd 0 + Adjust for update to 1.19.6 API. ---- config/devd.c.orig 2018-08-04 04:32:13.580868000 +0000 +--- config/devd.c.orig 2019-07-20 17:30:44.230844000 +0000 +++ config/devd.c -@@ -0,0 +1,613 @@ +@@ -0,0 +1,616 @@ +/* + * Copyright (c) 2012 Baptiste Daroussin + * Copyright (c) 2013, 2014 Alex Kozlov @@ -140,10 +142,13 @@ Adjust for update to 1.19.6 API. + return false; + + ret = stat(devpath, &st); ++ if (ret == 0) { ++ DebugF("[config/devd]: devpath_exists true for devpath (%s)\n", devpath); ++ } ++ + free(devpath); + + if (ret == 0) { -+ DebugF("[config/devd]: devpath_exists true for devpath (%s)\n", devpath); + strncpy(devname, device->driver, devname_len); + return true; + } @@ -522,13 +527,13 @@ Adjust for update to 1.19.6 API. + char *walk; + ssize_t sz; + -+ DebugF("[config/devd]: wakeup_handler: sock_devd (%d), sock (%d), ready (%d)\n", sock_devd, sock, ready); ++/* DebugF("[config/devd]: wakeup_handler: sock_devd (%d), sock (%d), ready (%d)\n", sock_devd, sock, ready); */ + + sz = socket_getline(sock_devd, &line); + if (sz < 0) + return; + if (sz == 0) { -+ DebugF("[config/devd]: WARNING wakeup_handler: socket_getline returned zero length line\n", line); ++ DebugF("[config/devd]: WARNING wakeup_handler: socket_getline returned zero length line\n"); + free(line); + return; + } diff --git a/modular-xorg-server-dfbsd/patches/patch-config_meson.build b/modular-xorg-server-dfbsd/patches/patch-config_meson.build new file mode 100644 index 0000000000..170ba8fb84 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-config_meson.build @@ -0,0 +1,27 @@ +$NetBSD$ + +--- config/meson.build.orig 2019-03-13 16:07:36.000000000 +0000 ++++ config/meson.build +@@ -19,10 +19,22 @@ if build_udev + config_dep += udev_dep + endif + ++if host_machine.system() == 'netbsd' ++ srcs_config += 'wscons.c' ++endif ++ + if host_machine.system() == 'openbsd' + srcs_config += 'wscons.c' + endif + ++if host_machine.system() == 'dragonfly' ++ srcs_config += 'devd.c' ++endif ++ ++if host_machine.system() == 'freebsd' ++ srcs_config += 'devd.c' ++endif ++ + if build_xorg + install_data('10-quirks.conf', + install_dir: join_paths(get_option('datadir'), 'X11/xorg.conf.d')) diff --git a/modular-xorg-server-dfbsd/patches/patch-config_wscons.c b/modular-xorg-server-dfbsd/patches/patch-config_wscons.c new file mode 100644 index 0000000000..c5b0e92b74 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-config_wscons.c @@ -0,0 +1,145 @@ +$NetBSD$ + +Changes from NetBSD xsrc xorg-server 1.20.5. + +Patch from OpenBSD xenocara for "ws" driver. + +--- config/wscons.c.orig 2019-05-30 18:27:34.000000000 +0000 ++++ config/wscons.c +@@ -25,14 +25,17 @@ + #include + #endif + +-#include +-#include +- ++#include + #include ++#include ++#include + #include + #include + #include + ++#include ++#include ++ + #include "input.h" + #include "inputstr.h" + #include "os.h" +@@ -41,6 +44,7 @@ + #define WSCONS_KBD_DEVICE "/dev/wskbd" + #define WSCONS_MOUSE_PREFIX "/dev/wsmouse" + ++#if defined(KB_LA) && defined(KB_CF) + #define KB_OVRENC \ + { KB_UK, "gb" }, \ + { KB_SV, "se" }, \ +@@ -48,13 +52,27 @@ + { KB_SF, "ch" }, \ + { KB_LA, "latam" }, \ + { KB_CF, "ca" } ++#else ++#define KB_OVRENC \ ++ { KB_UK, "gb" }, \ ++ { KB_SV, "se" }, \ ++ { KB_SG, "ch" }, \ ++ { KB_SF, "ch" } ++#endif + + struct nameint { + int val; + char *name; + } kbdenc[] = { + KB_OVRENC, ++#if defined(STRICT_XSRC_NETBSD) ++ KB_ENCTAB ++#ifndef __NetBSD__ ++ , ++#endif ++#else /* !STRICT_XSRC_NETBSD */ + KB_ENCTAB, ++#endif /* STRICT_XSRC_NETBSD */ + {0} + }; + +@@ -62,10 +80,14 @@ struct nameint kbdvar[] = { + {KB_NODEAD | KB_SG, "de_nodeadkeys"}, + {KB_NODEAD | KB_SF, "fr_nodeadkeys"}, + {KB_SF, "fr"}, ++#if defined(KB_CF) + {KB_DVORAK | KB_CF, "fr-dvorak"}, ++#endif + {KB_DVORAK | KB_FR, "bepo"}, + {KB_DVORAK, "dvorak"}, ++#if defined(KB_CF) + {KB_CF, "fr-legacy"}, ++#endif + {KB_NODEAD, "nodeadkeys"}, + {0} + }; +@@ -121,8 +143,12 @@ wscons_add_keyboard(void) + input_options = input_option_new(input_options, "name", WSCONS_KBD_DEVICE); + input_options = input_option_new(input_options, "driver", "kbd"); + ++#if defined(STRICT_XSRC_NETBSD) ++ if (asprintf(&config_info, "wscons:%s", WSCONS_KBD_DEVICE) != -1) ++#else + config_info = Xprintf("wscons:%s", WSCONS_KBD_DEVICE); + if (!config_info) ++#endif + goto unwind; + if (KB_ENCODING(wsenc) == KB_USER) { + /* Ignore wscons "user" layout */ +@@ -185,8 +211,12 @@ wscons_add_pointer(const char *path, con + char *config_info = NULL; + int rc; + ++#if defined(STRICT_XSRC_NETBSD) ++ if (asprintf(&config_info, "wscons:%s", path) == -1) ++#else + config_info = Xprintf("wscons:%s", path); + if (!config_info) ++#endif + return; + + input_options = input_option_new(input_options, "_source", "server/wscons"); +@@ -220,7 +250,11 @@ wscons_add_pointers(void) + for (i = 0; i < 4; i++) { + snprintf(devname, sizeof(devname), "%s%d", WSCONS_MOUSE_PREFIX, i); + LogMessageVerb(X_INFO, 10, "wsmouse: checking %s\n", devname); +- fd = open_device(devnamem O_RDWR | O_NONBLOCK | O_EXCL); ++#ifdef __NetBSD__ ++ fd = open(devname, O_RDWR | O_NONBLOCK | O_EXCL); ++#else ++ fd = open_device(devname, O_RDWR | O_NONBLOCK | O_EXCL); ++#endif + if (fd == -1) { + LogMessageVerb(X_WARNING, 10, "%s: %s\n", devname, strerror(errno)); + continue; +@@ -233,9 +267,11 @@ wscons_add_pointers(void) + } + close(fd); + switch (wsmouse_type) { ++#if defined(WSMOUSE_TYPE_SYNAPTICS) + case WSMOUSE_TYPE_SYNAPTICS: + wscons_add_pointer(devname, "synaptics", ATTR_TOUCHPAD); + break; ++#endif + case WSMOUSE_TYPE_TPANEL: + wscons_add_pointer(devname, "ws", ATTR_TOUCHSCREEN); + break; +@@ -243,8 +279,13 @@ wscons_add_pointers(void) + break; + } + } ++#if defined(WS_DRIVERS_OPENBSD) ++ /* Add a default entry catching all other mux elements as "ws" */ ++ wscons_add_pointer(WSCONS_MOUSE_PREFIX, "ws", ATTR_POINTER); ++#else + /* Add a default entry catching all other mux elements as "mouse" */ + wscons_add_pointer(WSCONS_MOUSE_PREFIX, "mouse", ATTR_POINTER); ++#endif + } + + int diff --git a/modular-xorg-server-dfbsd/patches/patch-configure b/modular-xorg-server-dfbsd/patches/patch-configure deleted file mode 100644 index df8532fe83..0000000000 --- a/modular-xorg-server-dfbsd/patches/patch-configure +++ /dev/null @@ -1,48 +0,0 @@ -$NetBSD: patch-configure,v 1.4 2017/01/28 21:47:55 maya Exp $ - -Use USE_AMD64_IOPL (actually x86_64_iopl) on NetBSD/amd64. -(c.f. patch-hw_xfree86_os-support_bsd_i386.c) - -for netbsd, force pass pthread configure checks (pthread not needed) - -Patches from FreeBSD ports x11-servers/xorg-server 1.18.4: - -* Fix xorg-server build on arm64. - ---- configure.orig 2015-02-10 22:49:52.000000000 +0000 -+++ configure -@@ -23098,9 +23098,14 @@ $as_echo "#define USE_ALPHA_PIO 1" >>con - esac - GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee" - ;; -- arm*) -+ arm*|aarch64*) - ARM_VIDEO=yes - DEFAULT_INT10="stub" -+ case $host_os in -+ *freebsd*) -+ $as_echo "#define USE_DEV_IO 1" >>confdefs.h -+ ;; -+ esac - ;; - i*86) - I386_VIDEO=yes -@@ -23140,7 +23145,7 @@ $as_echo "#define USE_DEV_IO 1" >>confde - $as_echo "#define USE_DEV_IO 1" >>confdefs.h - ;; - *netbsd*) --$as_echo "#define USE_I386_IOPL 1" >>confdefs.h -+$as_echo "#define USE_AMD64_IOPL 1" >>confdefs.h - - SYS_LIBS=-lx86_64 - ;; -@@ -24948,7 +24953,8 @@ case ${host_os} in - netbsd*) - # use libc stubs, don't link against libpthread, to allow - # dynamic loading -- ax_pthread_flags="" -+ ax_pthread_flags="none" -+ ax_pthread_ok="yes" - ;; - esac - diff --git a/modular-xorg-server-dfbsd/patches/patch-glx_glxscreens.h b/modular-xorg-server-dfbsd/patches/patch-glx_glxscreens.h new file mode 100644 index 0000000000..2dce18e9d4 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-glx_glxscreens.h @@ -0,0 +1,21 @@ +$NetBSD$ + +From NetBSD xsrc 1.20.5 + +--- glx/glxscreens.h.orig 2019-05-30 18:27:34.000000000 +0000 ++++ glx/glxscreens.h +@@ -116,7 +116,14 @@ GLint glxConvertToXVisualType(int visual + ** and DDX layers of the GLX server extension. The methods provide an + ** interface for context management on a screen. + */ ++#if defined(__NetBSD__) ++#ifndef __GLXscreen ++#define __GLXscreen __GLXscreen + typedef struct __GLXscreen __GLXscreen; ++#endif ++#else ++typedef struct __GLXscreen __GLXscreen; ++#endif + struct __GLXscreen { + void (*destroy) (__GLXscreen * screen); + diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86AutoConfig.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86AutoConfig.c index a019dacd4c..16e4991ecf 100644 --- a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86AutoConfig.c +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86AutoConfig.c @@ -1,39 +1,130 @@ $NetBSD: patch-hw_xfree86_common_xf86AutoConfig.c,v 1.3 2018/10/26 10:20:12 maya Exp $ +Patches from NetBSD xsrc 1.20.5: + +Apr 13 16:00:38 2011 UTC + +- get platform #ifdefs in a slightly more sane order +- look for SBus and UPA devices on sparc(64) +- add default drivers for shark and sgimips +- only try wsfb if we can't find any other usable device +With this Xorg without config file works fine on shark, sparc(74) and amd64 +should work on other archs as well. + +Jan 28 11:50:00 2019 + +Try the modesetting driver before wsfb on NetBSD arm and aarch64 + Patches from FreeBSD ports /DragonFly dports for x11-servers/xorg-server 1.18.4. +Add option for modesetting driver. + +Add option for scfb driver. + +NetBSD pkgsrc: Look for wsfb on netbsd (needed by genfb) ---- hw/xfree86/common/xf86AutoConfig.c.orig 2018-10-25 14:13:21.000000000 +0000 +--- hw/xfree86/common/xf86AutoConfig.c.orig 2019-05-30 18:27:34.000000000 +0000 +++ hw/xfree86/common/xf86AutoConfig.c -@@ -294,7 +294,7 @@ listPossibleVideoDrivers(XF86MatchedDriv +@@ -51,6 +51,13 @@ + #include + #endif + ++#ifdef __NetBSD__ ++#if defined(__sparc__) || defined(__sparc64__) ++#include ++extern struct sbus_devtable sbusDeviceTable[]; ++#endif /* sparc / sparc64 */ ++#endif /* NetBSD */ ++ + /* Sections for the default built-in configuration. */ + + #define BUILTIN_DEVICE_NAME \ +@@ -229,6 +236,46 @@ listPossibleVideoDrivers(XF86MatchedDriv + { + md->nmatches = 0; + ++/* XXXMRG: xorg-server 1.10/1.18 -- merge into xf86PlatformMatchDriver()? */ ++#ifdef __NetBSD__ ++#if defined(__shark) ++ xf86AddMatchedDriver(md, "chips"); ++ xf86AddMatchedDriver(md, "igs"); ++#elif defined(__sgimips) ++ xf86AddMatchedDriver(md, "crime"); ++ xf86AddMatchedDriver(md, "newport"); ++#elif defined(__sparc) || defined(__sparc64) ++ /* dig through /dev/fb* */ ++ { ++ struct fbtype fbt; ++ int j = 0, fd = 0, dev; ++ char fbpath[32]; ++ ++ for (j = 0; j < 10; j++) { ++ snprintf(fbpath, 31, "/dev/fb%d", j); ++ xf86Msg(X_ERROR,"%s: trying %s\n", __func__, fbpath); ++ fd = open(fbpath, O_RDONLY, 0); ++ if (fd == -1) continue; ++ memset(&fbt, 0, sizeof(fbt)); ++ if (ioctl(fd, FBIOGTYPE, &fbt) == -1) { ++ close(fd); ++ continue; ++ } ++ close(fd); ++ dev = 0; ++ while ((sbusDeviceTable[dev].fbType != 0) && ++ (sbusDeviceTable[dev].fbType != fbt.fb_type)) ++ dev++; ++ if (sbusDeviceTable[dev].fbType == fbt.fb_type) { ++ xf86Msg(X_ERROR,"%s: found %s\n", __func__, ++ sbusDeviceTable[dev].driverName); ++ xf86AddMatchedDriver(md, sbusDeviceTable[dev].driverName); ++ } ++ } ++ } ++#endif ++ ++#else /* !NetBSD */ + #ifdef XSERVER_PLATFORM_BUS + xf86PlatformMatchDriver(md); + #endif +@@ -290,20 +337,27 @@ listPossibleVideoDrivers(XF86MatchedDriv + if (sbusDriver) + xf86AddMatchedDriver(md, sbusDriver); + #endif ++#endif /* NetBSD */ + #ifdef XSERVER_LIBPCIACCESS xf86PciMatchDriver(md); #endif --#if defined(__linux__) -+#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) + #if defined(__linux__) xf86AddMatchedDriver(md, "modesetting"); ++#elif defined(__NetBSD__) && (defined(__aarch64__) || defined(__arm__)) ++ xf86AddMatchedDriver(md, "modesetting"); ++#elif defined(ADD_MODESETTING_DRIVER) ++ xf86AddMatchedDriver(md, "modesetting"); #endif -@@ -302,8 +302,10 @@ listPossibleVideoDrivers(XF86MatchedDriv + #if !defined(__sun) /* Fallback to platform default frame buffer driver */ #if !defined(__linux__) && defined(__sparc__) xf86AddMatchedDriver(md, "wsfb"); -#else +#elif defined(__linux__) xf86AddMatchedDriver(md, "fbdev"); -+#elif defined(__FreeBSD__) ++#elif defined(ADD_SCFB_DRIVER) + xf86AddMatchedDriver(md, "scfb"); #endif #endif /* !__sun */ -@@ -313,6 +315,9 @@ listPossibleVideoDrivers(XF86MatchedDriv +@@ -312,6 +366,11 @@ listPossibleVideoDrivers(XF86MatchedDriv + xf86AddMatchedDriver(md, "vesa"); #elif defined(__sparc__) && !defined(__sun) xf86AddMatchedDriver(md, "sunffb"); - #endif -+#if defined(__NetBSD__) ++#elif defined(__NetBSD__) && !defined(ALWAYS_ADD_WSFB) + xf86AddMatchedDriver(md, "wsfb"); +#endif ++#if defined(__NetBSD__) && defined(ALWAYS_ADD_WSFB) ++ xf86AddMatchedDriver(md, "wsfb"); + #endif } - /* copy a screen section and enter the desired driver diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Config.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Config.c index b888c06b04..4bf21d4499 100644 --- a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Config.c +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Config.c @@ -1,11 +1,52 @@ $NetBSD$ +Option for "ws" from openbsd xenocara 1.19.7 + +From NetBSD xsrc: + +Oct 22 15:00:40 2011 + +if the video driver is "vmware" or "vmwlegacy" and no mouse section exists, +use the "vmmouse" input driver instead of "mouse" -- no xorg works properly +in vmware without a config file + devd support to detect devices from FreeBSD ports / DragonFly dports x11-servers/xorg-server 1.18.4. ---- hw/xfree86/common/xf86Config.c.orig 2017-01-05 21:19:31.000000000 +0000 +--- hw/xfree86/common/xf86Config.c.orig 2019-05-30 18:27:34.000000000 +0000 +++ hw/xfree86/common/xf86Config.c -@@ -1375,13 +1375,16 @@ checkCoreInputDevices(serverLayoutPtr se +@@ -1024,7 +1024,11 @@ checkCoreInputDevices(serverLayoutPtr se + MessageType from = X_DEFAULT; + + const char *mousedrivers[] = { "mouse", "synaptics", "evdev", "vmmouse", ++#if defined(WS_DRIVERS_OPENBSD) ++ "ws", "void", NULL ++#else + "void", NULL ++#endif + }; + + /* +@@ -1115,7 +1119,18 @@ checkCoreInputDevices(serverLayoutPtr se + if (!foundPointer && xf86Info.forceInputDevices) { + memset(&defPtr, 0, sizeof(defPtr)); + defPtr.inp_identifier = strdup(""); ++#if defined(__NetBSD__) && (defined(__i386__) || defined(__amd64__)) ++ if (xf86findDeviceByDriver("vmware", xf86configptr->conf_device_lst) || ++ xf86findDeviceByDriver("vmwlegacy", xf86configptr->conf_device_lst)) { ++ defPtr.inp_driver = strdup("vmmouse"); ++ defPtr.inp_option_lst = xf86addNewOption(defPtr.inp_option_lst, strdup("Protocol"), "wsmouse"); ++ defPtr.inp_option_lst = xf86addNewOption(defPtr.inp_option_lst, strdup("Device"), "/dev/wsmouse"); ++ } else { ++#endif + defPtr.inp_driver = strdup("mouse"); ++#if defined(__NetBSD__) && (defined(__i386__) || defined(__amd64__)) ++ } ++#endif + confInput = &defPtr; + foundPointer = TRUE; + from = X_DEFAULT; +@@ -1264,13 +1279,16 @@ checkCoreInputDevices(serverLayoutPtr se } if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) { diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Configure.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Configure.c new file mode 100644 index 0000000000..dbe5f5b691 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Configure.c @@ -0,0 +1,45 @@ +$NetBSD$ + +Patches from NetBSD xsrc 1.20.5 + +Option for wskbd. + +--- hw/xfree86/common/xf86Configure.c.orig 2019-05-30 18:27:34.000000000 +0000 ++++ hw/xfree86/common/xf86Configure.c +@@ -100,6 +100,10 @@ xf86AddBusDeviceToConfigure(const char * + ret = xf86SbusConfigure(busData, DevToConfig[i].sVideo); + break; + #endif ++#if (defined(__arm32__) || defined(__arm__)) && defined(__NetBSD__) ++ case BUS_ISA: ++ break; ++#endif + default: + return NULL; + } +@@ -138,6 +142,12 @@ xf86AddBusDeviceToConfigure(const char * + &DevToConfig[i].GDev); + break; + #endif ++#if (defined(__arm32__) || defined(__arm__)) && defined(__NetBSD__) ++ case BUS_ISA: ++ DevToConfig[i].GDev.busID = xnfalloc(6); ++ strcpy((char *)DevToConfig[i].GDev.busID, "ISA"); ++ break; ++#endif + default: + break; + } +@@ -163,6 +173,12 @@ configureInputSection(void) + ptr->inp_identifier = xnfstrdup("Keyboard0"); + ptr->inp_driver = xnfstrdup("kbd"); + ptr->list.next = NULL; ++#if defined(WSCONS_SUPPORT) && ((!defined(__i386__) && !defined(__amd64__) && defined(__NetBSD__)) || defined(TRY_DEV_WSKBD)) ++ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, ++ xstrdup("Protocol"), "wskbd"); ++ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, ++ xstrdup("Device"), "/dev/wskbd"); ++#endif + + /* Crude mechanism to auto-detect mouse (os dependent) */ + { diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Helper.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Helper.c new file mode 100644 index 0000000000..83b92b297f --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86Helper.c @@ -0,0 +1,23 @@ +$NetBSD$ + +--- hw/xfree86/common/xf86Helper.c.orig 2019-03-05 16:34:21.000000000 +0000 ++++ hw/xfree86/common/xf86Helper.c +@@ -1281,6 +1281,18 @@ xf86MatchDevice(const char *drivername, + if (sectlist) + *sectlist = NULL; + ++#if defined(STRICT_XSRC_NETBSD) ++ /* ++ * 20111009 jmcneill: This line was removed with the following commit upstream: ++ * http://cgit.freedesktop.org/xorg/xserver/commit/hw/xfree86/common/xf86Helper.c?id=0ceac6f64f5ad9bc2ac4b19be2dd245ffba78b05 ++ * ++ * However, the log message is inaccurate: xf86MatchDevice will get called at ++ * configuration time by drivers who still implement the legacy probing ++ * API. ++ */ ++ if (xf86DoConfigure && xf86DoConfigurePass1) return 1; ++#endif ++ + /* + * This can happen when running Xorg -showopts and a module like ati + * or vmware tries to load its submodules when xf86ConfigLayout is empty diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86pciBus.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86pciBus.c index 4ec8433d68..6bf95c00e9 100644 --- a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86pciBus.c +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86pciBus.c @@ -1,15 +1,46 @@ $NetBSD: patch-hw_xfree86_common_xf86pciBus.c,v 1.1 2016/11/04 01:12:51 maya Exp $ -NetBSD also has nouveau, try to autoload it +From OpenBSD 6.5 xenocara, +experiment using modesetting on Intel integrated graphics ---- hw/xfree86/common/xf86pciBus.c.orig 2016-07-15 16:18:11.000000000 +0000 +--- hw/xfree86/common/xf86pciBus.c.orig 2019-03-05 16:34:21.000000000 +0000 +++ hw/xfree86/common/xf86pciBus.c -@@ -1189,7 +1189,7 @@ xf86VideoPtrToDriverList(struct pci_devi - { - int idx = 0; - --#ifdef __linux__ -+#if defined(__linux__) || defined(__NetBSD__) - driverList[idx++] = "nouveau"; - #endif - driverList[idx++] = "nv"; +@@ -1174,9 +1174,38 @@ xf86VideoPtrToDriverList(struct pci_devi + case 0x0bef: + /* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */ + break; ++#if defined(MODESETTING_ON_INTEL) ++ case 0x3577: ++ case 0x2562: ++ case 0x3582: ++ case 0x358e: /* 854 */ ++ case 0x2572: ++ case 0x2582: ++ case 0x258a: ++ case 0x2592: ++ case 0x2772: ++ case 0x27a2: ++ case 0x27ae: ++ case 0x2972: ++ case 0x29b2: ++ case 0x29c2: ++ case 0x29d2: ++ case 0xa001: ++ case 0xa011: ++ case 0x0042: /* XXX Ironlake is unstable with modesetting */ ++ case 0x0046: ++ /* Use intel driver on 2nd and 3rd generation */ ++ driverList[0] = "intel"; ++ break; ++ default: ++ /* Use modesetting driver on 4th generation and up */ ++ driverList[0] = "modesetting"; ++ break; ++#else + default: + driverList[0] = "intel"; + break; ++#endif + } + break; + case 0x102b: diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86str.h b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86str.h new file mode 100644 index 0000000000..d01d93c101 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86str.h @@ -0,0 +1,14 @@ +$NetBSD$ + +--- hw/xfree86/common/xf86str.h.orig 2019-05-30 18:27:34.000000000 +0000 ++++ hw/xfree86/common/xf86str.h +@@ -261,6 +261,9 @@ typedef enum { + BUS_NONE, + BUS_PCI, + BUS_SBUS, ++#if defined(__NetBSD__) ++ BUS_ISA, ++#endif + BUS_PLATFORM, + BUS_last /* Keep last */ + } BusType; diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86xv.h b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86xv.h new file mode 100644 index 0000000000..2a26f480cf --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_common_xf86xv.h @@ -0,0 +1,16 @@ +$NetBSD$ + +--- hw/xfree86/common/xf86xv.h.orig 2019-05-30 18:27:34.000000000 +0000 ++++ hw/xfree86/common/xf86xv.h +@@ -106,7 +106,11 @@ typedef enum { + + typedef struct { + int id; ++#if defined(__NetBSD__) ++ /*const*/ char *name; /* dozens of drivers write to this value */ ++#else + const char *name; ++#endif + unsigned short width, height; + XvRationalRec rate; + } XF86VideoEncodingRec, *XF86VideoEncodingPtr; diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_drivers_modesetting_drmmode__display.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_drivers_modesetting_drmmode__display.c index 0bea7afcea..816e2f3d06 100644 --- a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_drivers_modesetting_drmmode__display.c +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_drivers_modesetting_drmmode__display.c @@ -1,14 +1,58 @@ $NetBSD$ +Patches from NetBSD xsrc: + +Oct 7 15:43:38 2016 UTC + +CID 1373515: check return value + +Oct 7 15:55:36 2016 UTC + +CID 1373518: Memory corruption (off-by-one) + Option to revert effects of upstream: 2018-02-27 Add RandR leases with modesetting driver support [v6] commit e4e3447603b5fd3a38a92c3f972396d1f81168ad ---- hw/xfree86/drivers/modesetting/drmmode_display.c.orig 2018-10-15 15:59:33.000000000 +0000 +--- hw/xfree86/drivers/modesetting/drmmode_display.c.orig 2019-05-30 18:27:34.000000000 +0000 +++ hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -3196,6 +3196,7 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn +@@ -1754,11 +1754,21 @@ drmmode_set_target_scanout_pixmap_cpu(xf + DamageRegister(&ppix->drawable, ppriv->slave_damage); + + if (ppriv->fb_id == 0) { ++#if defined(STRICT_XSRC_NETBSD) ++ int ret = drmModeAddFB(drmmode->fd, ppix->drawable.width, ++#else + drmModeAddFB(drmmode->fd, ppix->drawable.width, ++#endif + ppix->drawable.height, + ppix->drawable.depth, + ppix->drawable.bitsPerPixel, + ppix->devKind, ppriv->backing_bo->handle, &ppriv->fb_id); ++#if defined(STRICT_XSRC_NETBSD) ++ if (ret) { ++ ErrorF("failed to set scanout pixmap cpu\n"); ++ return FALSE; ++ } ++#endif + } + *target = ppix; + return TRUE; +@@ -2837,7 +2847,11 @@ static int parse_path_blob(drmModeProper + if (!conn) + return -1; + len = conn - (blob_data + 4); ++#if defined(STRICT_XSRC_NETBSD) ++ if (len + 1 >= sizeof(conn_id)) ++#else + if (len + 1> 5) ++#endif + return -1; + memcpy(conn_id, blob_data + 4, len); + conn_id[len] = '\0'; +@@ -3202,6 +3216,7 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn return FALSE; } @@ -16,7 +60,7 @@ commit e4e3447603b5fd3a38a92c3f972396d1f81168ad static void drmmode_validate_leases(ScrnInfoPtr scrn) { -@@ -3233,6 +3234,7 @@ drmmode_validate_leases(ScrnInfoPtr scrn +@@ -3239,6 +3254,7 @@ drmmode_validate_leases(ScrnInfoPtr scrn free(lessees); } @@ -24,7 +68,7 @@ commit e4e3447603b5fd3a38a92c3f972396d1f81168ad static int drmmode_create_lease(RRLeasePtr lease, int *fd) -@@ -3485,8 +3487,10 @@ drmmode_set_desired_modes(ScrnInfoPtr pS +@@ -3491,8 +3507,10 @@ drmmode_set_desired_modes(ScrnInfoPtr pS } } @@ -35,7 +79,7 @@ commit e4e3447603b5fd3a38a92c3f972396d1f81168ad return TRUE; } -@@ -3693,8 +3697,10 @@ drmmode_handle_uevents(int fd, void *clo +@@ -3699,8 +3717,10 @@ drmmode_handle_uevents(int fd, void *clo drmmode_output_init(scrn, drmmode, mode_res, i, TRUE, 0); } diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_int10_helper__exec.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_int10_helper__exec.c new file mode 100644 index 0000000000..cd9430132f --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_int10_helper__exec.c @@ -0,0 +1,33 @@ +$NetBSD$ + +--- hw/xfree86/int10/helper_exec.c.orig 2019-03-05 16:34:21.000000000 +0000 ++++ hw/xfree86/int10/helper_exec.c +@@ -676,6 +676,7 @@ bios_checksum(const uint8_t *start, int + void + LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga) + { ++#if !defined(NO_LEGACY_VGA) || !defined(STRICT_XSRC_NETBSD) + vga->save_msr = pci_io_read8(pInt->io, 0x03CC); + vga->save_vse = pci_io_read8(pInt->io, 0x03C3); + #ifndef __ia64__ +@@ -688,17 +689,20 @@ LockLegacyVGA(xf86Int10InfoPtr pInt, leg + pci_io_write8(pInt->io, 0x46E8, ~(uint8_t) 0x08 & vga->save_46e8); + #endif + pci_io_write8(pInt->io, 0x0102, ~(uint8_t) 0x01 & vga->save_pos102); ++#endif /* NO_LEGACY_VGA */ + } + + void + UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga) + { ++#if !defined(NO_LEGACY_VGA) || !defined(STRICT_XSRC_NETBSD) + pci_io_write8(pInt->io, 0x0102, vga->save_pos102); + #ifndef __ia64__ + pci_io_write8(pInt->io, 0x46E8, vga->save_46e8); + #endif + pci_io_write8(pInt->io, 0x03C3, vga->save_vse); + pci_io_write8(pInt->io, 0x03C2, vga->save_msr); ++#endif /* NO_LEGACY_VGA */ + } + + #if defined (_PC) diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_bsd_bsd__VTsw.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_bsd_bsd__VTsw.c index b2053bec7e..d267617fb4 100644 --- a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_bsd_bsd__VTsw.c +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_bsd_bsd__VTsw.c @@ -2,13 +2,13 @@ $NetBSD: patch-hw_xfree86_os-support_bsd_bsd__VTsw.c,v 1.1 2015/10/11 18:28:53 t VT switching support. From xsrc. ---- hw/xfree86/os-support/bsd/bsd_VTsw.c.orig 2015-05-21 14:21:39.000000000 +0000 +--- hw/xfree86/os-support/bsd/bsd_VTsw.c.orig 2019-05-30 18:27:34.000000000 +0000 +++ hw/xfree86/os-support/bsd/bsd_VTsw.c @@ -68,6 +68,9 @@ xf86VTSwitchAway() { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { -+#ifdef WSCONS_SUPPORT ++#if defined(WSCONS_SUPPORT) && defined(VTSW_KDSETMODE_XSRC) + ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); +#endif xf86Info.vtRequestsPending = FALSE; @@ -18,7 +18,7 @@ VT switching support. From xsrc. { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { -+#ifdef WSCONS_SUPPORT ++#if defined(WSCONS_SUPPORT) && defined(VTSW_KDSETMODE_XSRC) + ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS); +#endif xf86Info.vtRequestsPending = FALSE; diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c index 588e43728c..e461b8bcbb 100644 --- a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c @@ -16,7 +16,7 @@ for bug #196678 https://bugs.freebsd.org/bugzilla/attachment.cgi?id=191592&action=diff ---- hw/xfree86/os-support/bsd/bsd_init.c.orig 2018-10-25 14:13:21.000000000 +0000 +--- hw/xfree86/os-support/bsd/bsd_init.c.orig 2019-05-30 18:27:34.000000000 +0000 +++ hw/xfree86/os-support/bsd/bsd_init.c @@ -48,6 +48,10 @@ static int devConsoleFd = -1; #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) @@ -90,7 +90,28 @@ https://bugs.freebsd.org/bugzilla/attachment.cgi?id=191592&action=diff } else { /* xf86Info.ShareVTs */ close(xf86Info.consoleFd); -@@ -594,6 +627,10 @@ xf86CloseConsole() +@@ -529,6 +562,9 @@ xf86OpenPcvt() + xf86Msg(X_PROBED, "Using pcvt driver (version %d.%d)\n", + pcvt_version.rmajor, pcvt_version.rminor); + #endif ++#if defined(STRICT_XSRC_NETBSD) ++ xf86Msg(X_PROBED, "using VT number %d\n", xf86Info.vtno); ++#endif + } + else { + /* Not pcvt */ +@@ -581,8 +617,10 @@ xf86CloseConsole() + struct vt_mode VT; + #endif + ++#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) || !defined(SHAREVTS_XSRC_NETBSD) + if (xf86Info.ShareVTs) + return; ++#endif + + switch (xf86Info.consType) { + #ifdef PCCONS_SUPPORT +@@ -594,6 +632,10 @@ xf86CloseConsole() case SYSCONS: case PCVT: ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode */ diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_meson.build b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_meson.build new file mode 100644 index 0000000000..21329179eb --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_os-support_meson.build @@ -0,0 +1,22 @@ +$NetBSD$ + +--- hw/xfree86/os-support/meson.build.orig 2019-02-26 19:28:50.000000000 +0000 ++++ hw/xfree86/os-support/meson.build +@@ -78,7 +78,7 @@ elif host_machine.system() == 'solaris' + error('Unknown CPU family for Solaris build') + endif + +-elif host_machine.system().endswith('bsd') ++elif host_machine.system().endswith('bsd') or host_machine.system() == 'dragonfly' + srcs_xorg_os_support += [ + 'bsd/bsd_VTsw.c', + 'bsd/bsd_bell.c', +@@ -102,7 +102,7 @@ elif host_machine.system().endswith('bsd + srcs_xorg_os_support += 'bsd/alpha_video.c' + endif + +- if host_machine.system() == 'freebsd' ++ if host_machine.system() == 'freebsd' or host_machine.system() == 'dragonfly' + srcs_xorg_os_support += 'bsd/bsd_kmod.c' + else + srcs_xorg_os_support += 'shared/kmod_noop.c' diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_parser_Device.c b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_parser_Device.c new file mode 100644 index 0000000000..e03b30cd22 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_parser_Device.c @@ -0,0 +1,29 @@ +$NetBSD$ + +From NetBSD xsrc: + +Oct 22 15:00:40 2011 UTC + +if the video driver is "vmware" or "vmwlegacy" and no mouse section exists, +use the "vmmouse" input driver instead of "mouse" -- now xorg works properly +in vmware without a config file + +--- hw/xfree86/parser/Device.c.orig 2019-05-30 18:27:34.000000000 +0000 ++++ hw/xfree86/parser/Device.c +@@ -348,3 +348,16 @@ xf86findDevice(const char *ident, XF86Co + } + return NULL; + } ++ ++XF86ConfDevicePtr ++xf86findDeviceByDriver (const char *driver, XF86ConfDevicePtr p) ++{ ++ while (p) ++ { ++ if (xf86nameCompare (driver, p->dev_driver) == 0) ++ return p; ++ ++ p = p->list.next; ++ } ++ return NULL; ++} diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_parser_xf86Parser.h b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_parser_xf86Parser.h new file mode 100644 index 0000000000..b1d31873ba --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_parser_xf86Parser.h @@ -0,0 +1,23 @@ +$NetBSD$ + +From NetBSD xsrc: + +Oct 22 15:00:40 2011 UTC + +if the video driver is "vmware" or "vmwlegacy" and no mouse section exists, +use the "vmmouse" input driver instead of "mouse" -- now xorg works properly +in vmware without a config file + +--- hw/xfree86/parser/xf86Parser.h.orig 2019-05-30 18:27:34.000000000 +0000 ++++ hw/xfree86/parser/xf86Parser.h +@@ -455,6 +455,10 @@ extern void xf86freeConfig(XF86ConfigPtr + extern int xf86writeConfigFile(const char *, XF86ConfigPtr); + extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident, + XF86ConfDevicePtr p); ++#if defined(__NetBSD__) ++extern _X_EXPORT XF86ConfDevicePtr xf86findDeviceByDriver(const char *driver, ++ XF86ConfDevicePtr p); ++#endif + extern _X_EXPORT XF86ConfLayoutPtr xf86findLayout(const char *name, + XF86ConfLayoutPtr list); + extern _X_EXPORT XF86ConfMonitorPtr xf86findMonitor(const char *ident, diff --git a/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_vgahw_vgaHW.h b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_vgahw_vgaHW.h new file mode 100644 index 0000000000..28c252ec81 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-hw_xfree86_vgahw_vgaHW.h @@ -0,0 +1,27 @@ +$NetBSD$ + +From NetBSD xsrc: + +Jul 9 22:19:34 2016 UTC + +Avoid legacy VGA I/O port access on MIPS. Xorg converts the I/O port +address to a pointer and dereferences it, and then seg faults. + +--- hw/xfree86/vgahw/vgaHW.h.orig 2019-05-30 18:27:34.000000000 +0000 ++++ hw/xfree86/vgahw/vgaHW.h +@@ -168,11 +168,15 @@ typedef struct _vgaHWRec { + #define BITS_PER_GUN 6 + #define COLORMAP_SIZE 256 + ++#if defined(__NetBSD__) && (defined(__powerpc__) || defined(__arm__) || defined(__mips__) || defined(__s390__) || defined(__nds32__)) ++#define DACDelay(hw) /* No legacy VGA support */ ++#else + #define DACDelay(hw) \ + do { \ + (hw)->readST01((hw)); \ + (hw)->readST01((hw)); \ + } while (0) ++#endif + + /* Function Prototypes */ + diff --git a/modular-xorg-server-dfbsd/patches/patch-include_displaymode.h b/modular-xorg-server-dfbsd/patches/patch-include_displaymode.h new file mode 100644 index 0000000000..454a817bc8 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-include_displaymode.h @@ -0,0 +1,17 @@ +$NetBSD$ + +--- include/displaymode.h.orig 2019-05-30 18:27:34.000000000 +0000 ++++ include/displaymode.h +@@ -55,7 +55,12 @@ typedef enum { + typedef struct _DisplayModeRec { + struct _DisplayModeRec *prev; + struct _DisplayModeRec *next; ++#if defined(__NetBSD__) ++ /* dozens of drivers write to this value */ ++ /*const*/ char *name; /* identifier for the mode */ ++#else + const char *name; /* identifier for the mode */ ++#endif + ModeStatus status; + int type; + diff --git a/modular-xorg-server-dfbsd/patches/patch-include_glx__extinit.h b/modular-xorg-server-dfbsd/patches/patch-include_glx__extinit.h new file mode 100644 index 0000000000..7cc0f8e66a --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-include_glx__extinit.h @@ -0,0 +1,25 @@ +$NetBSD$ + +Patch from NetBSD xsrc: + +Jan 22 20:25:45 2019 + +protect dup typedef. + +--- include/glx_extinit.h.orig 2019-05-30 18:27:34.000000000 +0000 ++++ include/glx_extinit.h +@@ -30,7 +30,14 @@ + /* XXX this comment no longer makes sense i think */ + #ifdef GLXEXT + typedef struct __GLXprovider __GLXprovider; ++#if defined(__NetBSD__) ++#ifndef __GLXscreen ++#define __GLXscreen __GLXscreen + typedef struct __GLXscreen __GLXscreen; ++#endif ++#else ++typedef struct __GLXscreen __GLXscreen; ++#endif + struct __GLXprovider { + __GLXscreen *(*screenProbe) (ScreenPtr pScreen); + const char *name; diff --git a/modular-xorg-server-dfbsd/patches/patch-include_meson.build b/modular-xorg-server-dfbsd/patches/patch-include_meson.build new file mode 100644 index 0000000000..a4de9360c2 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-include_meson.build @@ -0,0 +1,46 @@ +$NetBSD$ + +--- include/meson.build.orig 2019-02-26 19:28:50.000000000 +0000 ++++ include/meson.build +@@ -68,7 +68,8 @@ conf_data.set('HAVE_DBUS', build_dbus) + conf_data.set('CONFIG_HAL', build_hal) + conf_data.set('SYSTEMD_LOGIND', build_systemd_logind) + conf_data.set('NEED_DBUS', build_systemd_logind or build_hal) +-conf_data.set('CONFIG_WSCONS', host_machine.system() == 'openbsd') ++conf_data.set('CONFIG_WSCONS', host_machine.system() == 'openbsd' or build_wscons) ++conf_data.set('CONFIG_DEVD', build_devd) + + # XXX: SHMDIR is weird in autoconf, probing the build system for + # various tmp directories. Could we replace it with C code at runtime +@@ -232,7 +233,7 @@ supports_syscons = false + supports_wscons = false + csrg_based = false + +-if host_machine.system() == 'freebsd' or host_machine.system() == 'dragonflybsd' ++if host_machine.system() == 'freebsd' or host_machine.system() == 'dragonfly' + supports_pccons = true + supports_pcvt = true + supports_syscons = true +@@ -324,7 +325,7 @@ xorg_data.set('XSERVER_PLATFORM_BUS', bu + xorg_data.set('WSCONS_SUPPORT', host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd') + xorg_data.set('XF86PM', build_apm or build_acpi) + +-if host_machine.system() == 'freebsd' or host_machine.system() == 'dragonflybsd' ++if host_machine.system() == 'freebsd' or host_machine.system() == 'dragonfly' + if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64' + xorg_data.set('USE_DEV_IO', true) + endif +@@ -332,9 +333,12 @@ if host_machine.system() == 'freebsd' or + elif host_machine.system() == 'netbsd' + # XXX: USE_ALPHA_PIO + # XXX: Add link to libi386 +- if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64' ++ if host_machine.cpu_family() == 'x86' + xorg_data.set('USE_I386_IOPL', true) + endif ++ if host_machine.cpu_family() == 'x86_64' ++ xorg_data.set('USE_AMD64_IOPL', true) ++ endif + elif host_machine.system() == 'openbsd' + # XXX: Add link to libi386, libamd64 + if host_machine.cpu_family() == 'x86' diff --git a/modular-xorg-server-dfbsd/patches/patch-include_os.h b/modular-xorg-server-dfbsd/patches/patch-include_os.h new file mode 100644 index 0000000000..0bbb5053da --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-include_os.h @@ -0,0 +1,23 @@ +$NetBSD$ + +From NetBSD xsrc: + +Oct 24 19:37:39 2008 UTC + +include string.h and strings.h - for some reason they're missing on sparc64 +XXX: need to figure out where the other archs include them so we can get +rid of this + +--- include/os.h.orig 2019-05-30 18:27:34.000000000 +0000 ++++ include/os.h +@@ -91,6 +91,10 @@ typedef struct _NewClientRec *NewClientP + + #include + #include ++#if defined(__NetBSD__) ++#include ++#include ++#endif + + #ifdef DDXBEFORERESET + extern void ddxBeforeReset(void); diff --git a/modular-xorg-server-dfbsd/patches/patch-meson.build b/modular-xorg-server-dfbsd/patches/patch-meson.build new file mode 100644 index 0000000000..88c63c1ce1 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-meson.build @@ -0,0 +1,14 @@ +$NetBSD$ + +--- meson.build.orig 2019-03-20 23:09:22.000000000 +0000 ++++ meson.build +@@ -155,6 +155,9 @@ if host_machine.system() == 'windows' + hal_option = 'false' + endif + ++build_wscons = get_option('wscons') ++build_devd = get_option('devd') ++ + if get_option('systemd_logind') == 'auto' + build_systemd_logind = build_udev and dbus_dep.found() + else diff --git a/modular-xorg-server-dfbsd/patches/patch-meson__options.txt b/modular-xorg-server-dfbsd/patches/patch-meson__options.txt new file mode 100644 index 0000000000..212550061d --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-meson__options.txt @@ -0,0 +1,13 @@ +$NetBSD$ + +--- meson_options.txt.orig 2019-03-20 23:09:22.000000000 +0000 ++++ meson_options.txt +@@ -64,6 +64,8 @@ option('pciaccess', type: 'boolean', val + option('udev', type: 'boolean', value: 'true') + option('hal', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Enable HAL integration') ++option('wscons', type: 'boolean', value: 'false') ++option('devd', type: 'boolean', value: 'false') + option('systemd_logind', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'Enable systemd-logind integration') + option('vbe', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', diff --git a/modular-xorg-server-dfbsd/patches/patch-os_utils.c b/modular-xorg-server-dfbsd/patches/patch-os_utils.c new file mode 100644 index 0000000000..cae8518800 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-os_utils.c @@ -0,0 +1,55 @@ +$NetBSD$ + +Patches from NetBSD xsrc: + +Sat May 9 15:07:49 2015 + +CID 1225080: check getrlimit return + +Sep 21 23:40:14 2009 + +Add a "-noretro" option to get the new (black background +and no cursor) behavior. + +Addresses part of PR xsrc/41870 + +--- os/utils.c.orig 2019-05-30 18:27:34.000000000 +0000 ++++ os/utils.c +@@ -558,6 +558,9 @@ UseMsg(void) + ErrorF("r turns on auto-repeat \n"); + ErrorF("-render [default|mono|gray|color] set render color alloc policy\n"); + ErrorF("-retro start with classic stipple and cursor\n"); ++#if defined(__NetBSD__) ++ ErrorF("-noretro start with black background and no cursor\n"); ++#endif + ErrorF("-s # screen-saver timeout (minutes)\n"); + ErrorF("-seat string seat to run on\n"); + ErrorF("-t # default pointer threshold (pixels/t)\n"); +@@ -735,9 +738,16 @@ ProcessCommandLine(int argc, char *argv[ + #if !defined(WIN32) || !defined(__MINGW32__) + struct rlimit core_limit; + ++#if defined(STRICT_XSRC_NETBSD) ++ if (getrlimit(RLIMIT_CORE, &core_limit) != -1) { ++ core_limit.rlim_cur = core_limit.rlim_max; ++ setrlimit(RLIMIT_CORE, &core_limit); ++ } ++#else + getrlimit(RLIMIT_CORE, &core_limit); + core_limit.rlim_cur = core_limit.rlim_max; + setrlimit(RLIMIT_CORE, &core_limit); ++#endif /* STRICT_XSRC_NETBSD */ + #endif + CoreDump = TRUE; + } +@@ -909,6 +919,10 @@ ProcessCommandLine(int argc, char *argv[ + defaultKeyboardControl.autoRepeat = FALSE; + else if (strcmp(argv[i], "-retro") == 0) + party_like_its_1989 = TRUE; ++#if defined(__NetBSD__) ++ else if (strcmp(argv[i], "-noretro") == 0) ++ party_like_its_1989 = FALSE; ++#endif + else if (strcmp(argv[i], "-s") == 0) { + if (++i < argc) + defaultScreenSaverTime = ((CARD32) atoi(argv[i])) * diff --git a/modular-xorg-server-dfbsd/patches/patch-randr_randrstr.h b/modular-xorg-server-dfbsd/patches/patch-randr_randrstr.h new file mode 100644 index 0000000000..e2ab867d39 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-randr_randrstr.h @@ -0,0 +1,50 @@ +$NetBSD$ + +Patches from NetBSD xsrc + +Jan 23 16:57:01 2019 UTC + +Avoid dup inconsistent definitions + +Nov 5 17:51:14 2014 UTC + +Add RRSetChanged from more recent versions of xorg-server + +--- randr/randrstr.h.orig 2019-05-30 18:27:34.000000000 +0000 ++++ randr/randrstr.h +@@ -59,11 +59,23 @@ + + #define RANDR_INTERFACE_VERSION 0x0104 + ++#if defined(__NetBSD__) ++/* All also defined in */ ++#ifndef RROutput ++#define RROutput CARD32 ++#define RRMode CARD32 ++#define RRCrtc CARD32 ++#define RRProvider CARD32 ++#define RRModeFlags CARD32 ++#define RRLease CARD32 ++#endif ++#else /* !__NetBSD__ */ + typedef XID RRMode; + typedef XID RROutput; + typedef XID RRCrtc; + typedef XID RRProvider; + typedef XID RRLease; ++#endif /* __NetBSD__ */ + + extern int RREventBase, RRErrorBase; + +@@ -581,6 +593,11 @@ RRSetChanged(ScreenPtr pScreen); + extern _X_EXPORT void + RRTellChanged(ScreenPtr pScreen); + ++#if defined(__NetBSD__) && 0 ++extern _X_EXPORT void ++RRSetChanged (ScreenPtr pScreen); ++#endif ++ + /* + * Poll the driver for changed information + */ diff --git a/modular-xorg-server-dfbsd/patches/patch-test_xtest.c b/modular-xorg-server-dfbsd/patches/patch-test_xtest.c new file mode 100644 index 0000000000..63b68d28d3 --- /dev/null +++ b/modular-xorg-server-dfbsd/patches/patch-test_xtest.c @@ -0,0 +1,15 @@ +$NetBSD: patch-test_xtest.c,v 1.1 2019/02/28 12:32:39 tnn Exp $ + +xtest.c:64:23: error: suggest braces around initialization of subobject + +--- test/xtest.c.orig 2019-02-26 19:28:50.000000000 +0000 ++++ test/xtest.c +@@ -61,7 +61,7 @@ xtest_init_devices(void) + { + ScreenRec screen = {0}; + ClientRec server_client = {0}; +- WindowRec root = {0}; ++ WindowRec root = {{0}}; + WindowOptRec optional = {0}; + + /* random stuff that needs initialization */