pkgsrc-Bugs archive

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

pkg/50172: modular-xorg needs some glamor



>Number:         50172
>Category:       pkg
>Synopsis:       modular-xorg needs some glamor
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 26 05:05:00 +0000 2015
>Originator:     David Shao
>Release:        pkgsrc current
>Organization:
>Environment:
DragonFly  4.3-DEVELOPMENT DragonFly v4.3.1.340.g01e30f-DEVELOPMENT #4: Tue Aug 25 14:11:21 PDT 2015     xxxxx@:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64
>Description:
Uncommenting out the options for glamor and llvm in pkgsrc MesaLib, modular-xorg-server, and xf86-video-ati has led to successful use of glamor / llvm / radeonsi for a Gigabyte Radeon R7 240 (Southern Islands OLAND) on DragonFly 4.3-DEVELOPMENT.  Starting with Southern Islands the old EXA driver is no longer supported for 2D acceleration according to

http://xorg.freedesktop.org/wiki/RadeonFeature/

As this worked for a version of DragonFly that had its Radeon drivers the rough equivalent of Linux 3.12, it seems reasonable to expect the same pkgsrc stack can work for recent NetBSD if one workaround is found for:

# (EE) Failed to load /usr/pkg/lib/xorg/modules/extensions/libglx.so:
# /usr/pkg/lib/libGL.so.1: Use of initialized Thread Local Storage with model initial-exec and dlopen is not supported

There are problems waiting for native NetBSD support for this and subsequent generations of AMD Radeon graphics cards.  It seems the radeonsi driver depends on LLVM, and as Mesa drivers get further developed, it is possible that further features will require more recent LLVM.  This link suggests for MesaLib 10.6.5 that LLVM 3.6.2 might be required.  So there is the question of building LLVM in base and also the question of whether base wishes to update LLVM at the speed the Mesa3D project does.

http://www.linuxfromscratch.org/blfs/view/svn/x/mesalib.html

As far as I am aware, FreeBSD for example does not use its base LLVM but requires building LLVM from ports to support its xorg.

In addition the glamor driver with a hint from
/usr/pkg/share/X11/xorg.conf.d/20-radeon.conf
similar to

Section "Device"
	Identifier	"Radeon Graphics Card"
	Driver		"radeon"
	Option		"AccelMethod"	"Glamor"
EndSection

works with Dragonfly 4-3 DEVELOPMENT, FreeBSD 10.2 RELEASE, FreeBSD 10 Stable, and FreeBSD 11 current using a Sapphire Radeon HD5570 graphics card, and it also works with FreeBSD 11 current using a Sapphire Radeon HD 6450 graphics card (CAICOS).  (The latter graphics card used to work with DragonFly 4.3 before the recent update to Linux 3.17 equivalent Radeon kernel drivers, but now there is some sort of glyph corruption.)


>How-To-Repeat:

>Fix:
Might as well update to MesaLib 10.6.5 as the 10.5 series probably received its last update in July.  There are no patches needed to be added, just a couple to subtract that have been incorporated into the code.

diff -Nur MesaLib.orig/options.mk MesaLib/options.mk
--- MesaLib.orig/options.mk	2015-05-28 14:09:07.000000000 -0700
+++ MesaLib/options.mk	2015-08-23 11:48:48.398817000 -0700
@@ -2,6 +2,7 @@
 
 PKG_OPTIONS_VAR=		PKG_OPTIONS.MesaLib
 PKG_SUPPORTED_OPTIONS=		llvm dri
+PKG_SUPPORTED_OPTIONS+=		glamor debug
 PKG_SUGGESTED_OPTIONS=
 
 .if !empty(MACHINE_PLATFORM:MNetBSD-[789].*-*) && (	\
@@ -28,10 +29,25 @@
 
 .if !empty(PKG_OPTIONS:Mdri)
 
+.if !empty(PKG_OPTIONS:Mglamor)
+# Recommended by
+# http://www.freedesktop.org/wiki/Software/Glamor/
+CONFIGURE_ARGS+=	--enable-gbm
+CONFIGURE_ARGS+=	--enable-shared-glapi
+CONFIGURE_ARGS+=	--enable-glx-tls
+
+.else
+
 # (EE) Failed to load /usr/pkg/lib/xorg/modules/extensions/libglx.so:
 # /usr/pkg/lib/libGL.so.1: Use of initialized Thread Local Storage with model initial-exec and dlopen is not supported
 CONFIGURE_ARGS+=	--disable-glx-tls
 
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+CFLAGS+=	-DDEBUG -O0 -g3
+.endif
+
 PLIST.dri=	yes
 
 BUILDLINK_DEPMETHOD.libpciaccess=      full
@@ -114,6 +130,7 @@
 GALLIUM_DRIVERS+=	radeonsi
 CONFIGURE_ARGS+=	--enable-gallium-llvm
 CONFIGURE_ARGS+=	--enable-r600-llvm-compiler
+.include "../../devel/libelf/buildlink3.mk"
 .include "../../lang/libLLVM/buildlink3.mk"
 CONFIGURE_ENV+=		ac_cv_path_ac_pt_LLVM_CONFIG=${LLVM_CONFIG_PATH}
 .else # !llvm

For modular-xorg-server something like this (ignore the devd stuff for now, it is DragonFly and FreeBSD specific):

diff -Nur modular-xorg-server.orig/options.mk modular-xorg-server/options.mk
--- modular-xorg-server.orig/options.mk	2015-04-29 08:11:02.000000000 -0700
+++ modular-xorg-server/options.mk	2015-08-15 05:38:07.911535000 -0700
@@ -1,9 +1,17 @@
 # $NetBSD: options.mk,v 1.11 2015/04/29 15:11:02 tnn Exp $
 
 PKG_OPTIONS_VAR=	PKG_OPTIONS.modular-xorg-server
-PKG_SUPPORTED_OPTIONS=	dri inet6 debug dtrace
+PKG_SUPPORTED_OPTIONS=	dri inet6 debug dtrace devd
+PKG_SUPPORTED_OPTIONS+= glamor	
 PKG_SUGGESTED_OPTIONS=	dri inet6
 
+.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
+PKG_SUGGESTED_OPTIONS+= devd
+# CONFIGURE_ARGS+=	--disable-xvfb
+# CONFIGURE_ARGS+=	--disable-xnest 
+CONFIGURE_ARGS+=	--enable-record=yes
+.endif
+
 .include "../../mk/bsd.options.mk"
 
 PLIST_VARS+=		dri dri3 dtrace
@@ -41,13 +49,17 @@
 	(echo "all:"; echo "install:") > ${WRKSRC}/hw/xfree86/drivers/modesetting/Makefile
 .endif
 
-#.if !empty(PKG_OPTIONS:Mglamor)
-#.include "../../x11/dri3proto/buildlink3.mk"
-#.include "../../x11/libxshmfence/buildlink3.mk"
-#CONFIGURE_ARGS+=	--enable-xtrans-send-fds
-#CONFIGURE_ARGS+=	--enable-dri3
-#CONFIGURE_ARGS+=	--enable-glamor
-#.endif
+PLIST_VARS+=		glamor
+.if !empty(PKG_OPTIONS:Mglamor)
+# .include "../../x11/dri3proto/buildlink3.mk"
+.if ${OPSYS} == "DragonFly" || ${OPSYS} == "FreeBSD"
+.include "../../x11/libxshmfence/buildlink3.mk"
+.endif
+# CONFIGURE_ARGS+=	--enable-xtrans-send-fds
+# CONFIGURE_ARGS+=	--enable-dri3
+CONFIGURE_ARGS+=	--enable-glamor
+PLIST.glamor=		yes
+.endif
 
 .if !empty(PKG_OPTIONS:Minet6)
 CONFIGURE_ARGS+=	--enable-ipv6
@@ -57,7 +69,8 @@
 
 .if !empty(PKG_OPTIONS:Mdebug)
 CONFIGURE_ARGS+=	--enable-debug
-CFLAGS+=		-ggdb
+#CFLAGS+=		-ggdb
+CFLAGS+=		-O0 -g3
 .endif
 
 .if !empty(PKG_OPTIONS:Mdtrace)
@@ -66,3 +79,17 @@
 .else
 CONFIGURE_ARGS+=	--without-dtrace
 .endif
+
+.if !empty(PKG_OPTIONS:Mdevd)
+SUBST_CLASSES+=			devd_config
+SUBST_STAGE.devd_config=	pre-build
+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 |'
+.endif

diff -Nur modular-xorg-server.orig/PLIST modular-xorg-server/PLIST
--- modular-xorg-server.orig/PLIST	2015-06-08 22:05:37.000000000 -0700
+++ modular-xorg-server/PLIST	2015-08-14 20:40:36.464378000 -0700
@@ -52,6 +52,7 @@
 include/xorg/gcstruct.h
 include/xorg/geext.h
 include/xorg/geint.h
+${PLIST.glamor}include/xorg/glamor.h
 include/xorg/globals.h
 include/xorg/glx_extinit.h
 include/xorg/glyphstr.h
@@ -171,6 +172,7 @@
 lib/xorg/modules/libexa.la
 lib/xorg/modules/libfb.la
 lib/xorg/modules/libfbdevhw.la
+${PLIST.glamor}lib/xorg/modules/libglamoregl.la
 lib/xorg/modules/libint10.la
 lib/xorg/modules/libshadow.la
 lib/xorg/modules/libshadowfb.la

And for xf86-video-ati:

diff -Nur xf86-video-ati.orig/Makefile xf86-video-ati/Makefile
--- xf86-video-ati.orig/Makefile	2015-04-25 07:25:21.000000000 -0700
+++ xf86-video-ati/Makefile	2015-08-18 15:53:47.164717000 -0700
@@ -10,9 +10,9 @@
 HOMEPAGE=	http://xorg.freedesktop.org/
 COMMENT=	Modular Xorg ATI Radeon video driver
 
-CONFIGURE_ARGS+=	--enable-dri
+# CONFIGURE_ARGS+=	--enable-dri
 # not packaged yet as of 20140125
-CONFIGURE_ARGS+=	--disable-glamor
+# CONFIGURE_ARGS+=	--disable-glamor
 
 CONFLICTS+=	xf86-video-ati6-[0-9]*
 
@@ -20,12 +20,31 @@
 GNU_CONFIGURE=	YES
 USE_TOOLS+=	gmake pkg-config
 
+CONFIGURE_ARGS+=--disable-udev
+
 .include "../../mk/bsd.prefs.mk"
 
+PKG_OPTIONS_VAR=	PKG_OPTIONS.xf86-video-ati
+PKG_SUPPORTED_OPTIONS= glamor debug	
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mglamor)
+CONFIGURE_ARGS+=	--enable-glamor
+.else
+CONFIGURE_ARGS+=	--disable-glamor
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+CFLAGS+=		-O0 -g3
+.endif
+
 .if ${OPSYS} == "SunOS"
 CONFIGURE_ENV+=	DRIVER_MAN_SUFFIX=4
 .endif
 
+.include "../../devel/xorg-util-macros/buildlink3.mk"
+
 .include "../../x11/modular-xorg-server/buildlink3.mk"
 
 .include "../../devel/zlib/buildlink3.mk"





Home | Main Index | Thread Index | Old Index