Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jul 2012 05:01:23 GMT
From:      Mark Linimon <linimon@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/169874: [patch] fix graphics/dri, graphics/libGL, graphics/libdrm on tier-2 archs
Message-ID:  <201207150501.q6F51NFX025850@freefall.freebsd.org>
Resent-Message-ID: <201207150510.q6F5A8Kg026551@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         169874
>Category:       ports
>Synopsis:       [patch] fix graphics/dri, graphics/libGL, graphics/libdrm on tier-2 archs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 15 05:10:07 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Mark Linimon
>Release:        FreeBSD 9.0-STABLE i386
>Organization:
FreeBSD
>Environment:
System: FreeBSD freefall.freebsd.org 9.0-STABLE FreeBSD 9.0-STABLE #6 r235139: Tue May 8 21:19:03 UTC 2012 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386
>Description:
libGL and friends have become broken on the various tier-2 architectures
since the latest X11 update.  marius@ worked up a patch to try to fix up
sparc64 (and possibly powerpc).  However, I had already noticed a failure
on arm in one of my test builds, for the same reason.

I am going to test the below patch on pointyhat-west/amd64 to make sure
there are no regressions.  I would appreciate other testers.

While based on marius' patch, this removes some code that is getting hard
to read and replaces it with some code that is, if not perfect, at least
more obvious to understand.
>How-To-Repeat:
>Fix:
Index: graphics/dri/Makefile
===================================================================
RCS file: /home/FreeBSD/pcvs/ports/graphics/dri/Makefile,v
retrieving revision 1.37
diff -u -r1.37 Makefile
--- graphics/dri/Makefile	21 Apr 2012 17:03:16 -0000	1.37
+++ graphics/dri/Makefile	15 Jul 2012 04:39:03 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	dri
 PORTVERSION=	${MESAVERSION}
+PORTREVISION=	1
 PORTEPOCH=	2
 CATEGORIES=	graphics
 
@@ -28,4 +29,92 @@
 BROKEN=		Does not install on ia64
 .endif
 
+.if ${ARCH} != "amd64" || ${ARCH} != "i386"
+CONFIGURE_ARGS+=--disable-gallium-intel
+.endif
+
+.if ${ARCH} == "amd64"
+PLIST_SUB+=	I810_DRIVER="@comment "
+PLIST_SUB+=	I9X5_DRIVER=""
+PLIST_SUB+=	MACH64_DRIVER=""
+PLIST_SUB+=	MGA_DRIVER=""
+PLIST_SUB+=	NOUVEAU_DRIVER=""
+PLIST_SUB+=	RADEON_DRIVERS=""
+PLIST_SUB+=	SAVAGE_DRIVER=""
+PLIST_SUB+=	SIS_DRIVER=""
+PLIST_SUB+=	SWRAST_DRIVER=""
+PLIST_SUB+=	TDFX_DRIVER=""
+PLIST_SUB+=	UNICHROME_DRIVER=""
+.endif
+
+.if ${ARCH} == "arm"
+PLIST_SUB+=	I810_DRIVER="@comment "
+PLIST_SUB+=	I9X5_DRIVER="@comment "
+PLIST_SUB+=	MACH64_DRIVER="@comment "
+PLIST_SUB+=	MGA_DRIVER="@comment "
+PLIST_SUB+=	NOUVEAU_DRIVER="@comment "
+PLIST_SUB+=	RADEON_DRIVERS="@comment "
+PLIST_SUB+=	SAVAGE_DRIVER="@comment "
+PLIST_SUB+=	SIS_DRIVER="@comment "
+PLIST_SUB+=	SWRAST_DRIVER="@comment "
+PLIST_SUB+=	TDFX_DRIVER="@comment "
+PLIST_SUB+=	UNICHROME_DRIVER="@comment "
+.endif
+
+.if ${ARCH} == "i386"
+PLIST_SUB+=	I810_DRIVER=""
+PLIST_SUB+=	I9X5_DRIVER=""
+PLIST_SUB+=	MACH64_DRIVER=""
+PLIST_SUB+=	MGA_DRIVER=""
+PLIST_SUB+=	NOUVEAU_DRIVER=""
+PLIST_SUB+=	RADEON_DRIVERS=""
+PLIST_SUB+=	SAVAGE_DRIVER=""
+PLIST_SUB+=	SIS_DRIVER=""
+PLIST_SUB+=	SWRAST_DRIVER=""
+PLIST_SUB+=	TDFX_DRIVER=""
+PLIST_SUB+=	UNICHROME_DRIVER=""
+.endif
+
+.if ${ARCH} == "mips"
+PLIST_SUB+=	I810_DRIVER="@comment "
+PLIST_SUB+=	I9X5_DRIVER="@comment "
+PLIST_SUB+=	MACH64_DRIVER="@comment "
+PLIST_SUB+=	MGA_DRIVER="@comment "
+PLIST_SUB+=	NOUVEAU_DRIVER="@comment "
+PLIST_SUB+=	RADEON_DRIVERS="@comment "
+PLIST_SUB+=	SAVAGE_DRIVER="@comment "
+PLIST_SUB+=	SIS_DRIVER="@comment "
+PLIST_SUB+=	SWRAST_DRIVER="@comment "
+PLIST_SUB+=	TDFX_DRIVER="@comment "
+PLIST_SUB+=	UNICHROME_DRIVER="@comment "
+.endif
+
+.if ${ARCH} == "powerpc"
+PLIST_SUB+=	I810_DRIVER="@comment "
+PLIST_SUB+=	I9X5_DRIVER="@comment "
+PLIST_SUB+=	MACH64_DRIVER=""
+PLIST_SUB+=	MGA_DRIVER="@comment "
+PLIST_SUB+=	NOUVEAU_DRIVER="@comment "
+PLIST_SUB+=	RADEON_DRIVERS=""
+PLIST_SUB+=	SAVAGE_DRIVER="@comment "
+PLIST_SUB+=	SIS_DRIVER="@comment "
+PLIST_SUB+=	SWRAST_DRIVER=""
+PLIST_SUB+=	TDFX_DRIVER=""
+PLIST_SUB+=	UNICHROME_DRIVER="@comment "
+.endif
+
+.if ${ARCH} == "sparc64"
+PLIST_SUB+=	I810_DRIVER="@comment "
+PLIST_SUB+=	I9X5_DRIVER="@comment "
+PLIST_SUB+=	MACH64_DRIVER=""
+PLIST_SUB+=	MGA_DRIVER="@comment "
+PLIST_SUB+=	NOUVEAU_DRIVER="@comment "
+PLIST_SUB+=	RADEON_DRIVERS=""
+PLIST_SUB+=	SAVAGE_DRIVER="@comment "
+PLIST_SUB+=	SIS_DRIVER="@comment "
+PLIST_SUB+=	SWRAST_DRIVER=""
+PLIST_SUB+=	TDFX_DRIVER="@comment "
+PLIST_SUB+=	UNICHROME_DRIVER="@comment "
+.endif
+
 .include <bsd.port.post.mk>
Index: graphics/dri/pkg-plist
===================================================================
RCS file: /home/FreeBSD/pcvs/ports/graphics/dri/pkg-plist,v
retrieving revision 1.13
diff -u -r1.13 pkg-plist
--- graphics/dri/pkg-plist	21 Apr 2012 17:03:16 -0000	1.13
+++ graphics/dri/pkg-plist	15 Jul 2012 04:40:55 -0000
@@ -1,20 +1,20 @@
 include/GL/internal/dri_interface.h
-lib/dri/i810_dri.so
-lib/dri/i915_dri.so
-lib/dri/i965_dri.so
-lib/dri/mach64_dri.so
-lib/dri/mga_dri.so
-%%NEW%%lib/dri/nouveau_vieux_dri.so
-lib/dri/r128_dri.so
-lib/dri/r200_dri.so
-lib/dri/r300_dri.so
-lib/dri/r600_dri.so
-lib/dri/radeon_dri.so
-lib/dri/savage_dri.so
-lib/dri/sis_dri.so
-lib/dri/swrast_dri.so
-lib/dri/tdfx_dri.so
-lib/dri/unichrome_dri.so
+%%I810_DRIVER%%lib/dri/i810_dri.so
+%%I9X5_DRIVER%%lib/dri/i915_dri.so
+%%I9X5_DRIVER%%lib/dri/i965_dri.so
+%%MACH64_DRIVER%%lib/dri/mach64_dri.so
+%%MGA_DRIVER%%ib/dri/mga_dri.so
+%%NEW%%%%NOUVEAU_DRIVER%%lib/dri/nouveau_vieux_dri.so
+%%RADEON_DRIVERS%%lib/dri/r128_dri.so
+%%RADEON_DRIVERS%%lib/dri/r200_dri.so
+%%RADEON_DRIVERS%%lib/dri/r300_dri.so
+%%RADEON_DRIVERS%%lib/dri/r600_dri.so
+%%RADEON_DRIVERS%%lib/dri/radeon_dri.so
+%%SAVAGE_DRIVER%%lib/dri/savage_dri.so
+%%SIS_DRIVER%%lib/dri/sis_dri.so
+%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
+%%TDFX_DRIVER%%lib/dri/tdfx_dri.so
+%%UNICHROME_DRIVER%%lib/dri/unichrome_dri.so
 libdata/pkgconfig/dri.pc
 @dirrm lib/dri
 @dirrmtry include/GL/internal
Index: graphics/libGL/Makefile
===================================================================
RCS file: /home/FreeBSD/pcvs/ports/graphics/libGL/Makefile,v
retrieving revision 1.18
diff -u -r1.18 Makefile
--- graphics/libGL/Makefile	21 Apr 2012 17:03:16 -0000	1.18
+++ graphics/libGL/Makefile	15 Jul 2012 04:00:14 -0000
@@ -21,4 +21,11 @@
 	cd ${WRKSRC}/src/mesa; ${GMAKE} install-libgl
 
 .include "${.CURDIR}/bsd.mesalib.mk"
-.include <bsd.port.mk>
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} != "amd64" || ${ARCH} != "i386"
+CONFIGURE_ARGS+=--disable-gallium-intel
+.endif
+
+.include <bsd.port.post.mk>
Index: graphics/libGL/bsd.mesalib.mk
===================================================================
RCS file: /home/FreeBSD/pcvs/ports/graphics/libGL/bsd.mesalib.mk,v
retrieving revision 1.20
diff -u -r1.20 bsd.mesalib.mk
--- graphics/libGL/bsd.mesalib.mk	10 Jun 2012 05:47:43 -0000	1.20
+++ graphics/libGL/bsd.mesalib.mk	15 Jul 2012 04:00:14 -0000
@@ -53,13 +53,18 @@
 		--disable-egl
 
 .if defined(WITH_NEW_XORG)
-EXTRA_PATCHES+=	${PATCHDIR}/extra-mach64_context.h \
+EXTRA_PATCHES+=	${PATCHDIR}/extra-configure \
+		${PATCHDIR}/extra-mach64_context.h \
 		${PATCHDIR}/extra-sis_context.h \
 		${PATCHDIR}/extra-src-glsl_ir_constant_expression.cpp \
+		${PATCHDIR}/extra-src__gallium__include__pipe__p_config.h \
 		${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_array.c \
-		${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c
+		${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c \
+		${PATCHDIR}/extra-src__mesa__drivers__dri__radeon__radeon_span.c
 .else
-EXTRA_PATCHES+=	${PATCHDIR}/extra-src__mesa__x86-64__glapi_x86-64.S \
+EXTRA_PATCHES+=	${PATCHDIR}/extra-configure-old \
+		${PATCHDIR}/extra-mach64_context.h-old \
+		${PATCHDIR}/extra-src__mesa__x86-64__glapi_x86-64.S \
 		${PATCHDIR}/extra-src__mesa__x86-64__xform4.S \
 		${PATCHDIR}/extra-src__mesa__x86__glapi_x86.S \
 		${PATCHDIR}/extra-src__mesa__x86__read_rgba_span_x86.S
@@ -110,6 +115,13 @@
 		${WRKSRC}/src/glw/Makefile \
 		${WRKSRC}/src/mesa/Makefile \
 		${WRKSRC}/src/mesa/drivers/dri/Makefile
+.if defined(WITH_NEW_XORG)
+# replace hardlinks with patched radeon_span.c
+.for i in r200 r300 r600
+	@${CP} -fp ${WRKSRC}/src/mesa/drivers/dri/radeon/radeon_span.c \
+		${WRKSRC}/src/mesa/drivers/dri/${i}/
+.endfor
+.endif
 .if ${COMPONENT:Mglut} != ""
 	@${REINPLACE_CMD} -e 's|[$$](INSTALL_LIB_DIR)/pkgconfig|${PREFIX}/libdata/pkgconfig|' \
 		${WRKSRC}/src/glut/glx/Makefile
Index: graphics/libdrm/pkg-plist
===================================================================
RCS file: /home/FreeBSD/pcvs/ports/graphics/libdrm/pkg-plist,v
retrieving revision 1.12
diff -u -r1.12 pkg-plist
--- graphics/libdrm/pkg-plist	24 Jun 2012 17:30:00 -0000	1.12
+++ graphics/libdrm/pkg-plist	15 Jul 2012 04:00:14 -0000
@@ -18,21 +18,21 @@
 %%NEW%%include/libdrm/drm_sarea.h
 %%NEW%%include/libdrm/i915_drm.h
 %%NEW%%%%X86%%include/libdrm/intel_bufmgr.h
-%%NEW%%include/libdrm/intel_debug.h
+%%NEW%%%%X86%%include/libdrm/intel_debug.h
 %%NEW%%include/libdrm/mach64_drm.h
 %%NEW%%include/libdrm/mga_drm.h
 %%NEW%%include/libdrm/nouveau_drm.h
 %%NEW%%include/libdrm/nouveau_drmif.h
 %%NEW%%include/libdrm/r128_drm.h
-%%NEW%%include/libdrm/r600_pci_ids.h
-%%NEW%%include/libdrm/radeon_bo.h
-%%NEW%%include/libdrm/radeon_bo_gem.h
-%%NEW%%include/libdrm/radeon_bo_int.h
-%%NEW%%include/libdrm/radeon_cs.h
-%%NEW%%include/libdrm/radeon_cs_gem.h
-%%NEW%%include/libdrm/radeon_cs_int.h
+%%NEW%%%%X86%%include/libdrm/r600_pci_ids.h
+%%NEW%%%%X86%%include/libdrm/radeon_bo.h
+%%NEW%%%%X86%%include/libdrm/radeon_bo_gem.h
+%%NEW%%%%X86%%include/libdrm/radeon_bo_int.h
+%%NEW%%%%X86%%include/libdrm/radeon_cs.h
+%%NEW%%%%X86%%include/libdrm/radeon_cs_gem.h
+%%NEW%%%%X86%%include/libdrm/radeon_cs_int.h
 %%NEW%%include/libdrm/radeon_drm.h
-%%NEW%%include/libdrm/radeon_surface.h
+%%NEW%%%%X86%%include/libdrm/radeon_surface.h
 %%NEW%%include/libdrm/savage_drm.h
 %%NEW%%include/libdrm/sis_drm.h
 %%NEW%%include/libdrm/via_drm.h
@@ -59,16 +59,16 @@
 lib/libdrm_nouveau.la
 lib/libdrm_nouveau.so
 lib/libdrm_nouveau.so.1
-%%NEW%%lib/libdrm_radeon.la
-%%NEW%%lib/libdrm_radeon.so
-%%NEW%%lib/libdrm_radeon.so.1
+%%NEW%%%%X86%%lib/libdrm_radeon.la
+%%NEW%%%%X86%%lib/libdrm_radeon.so
+%%NEW%%%%X86%%lib/libdrm_radeon.so.1
 %%NEW%%%%KMS%%lib/libkms.la
 %%NEW%%%%KMS%%lib/libkms.so
 %%NEW%%%%KMS%%lib/libkms.so.1
 libdata/pkgconfig/libdrm.pc
 %%X86%%libdata/pkgconfig/libdrm_intel.pc
 libdata/pkgconfig/libdrm_nouveau.pc
-%%NEW%%libdata/pkgconfig/libdrm_radeon.pc
+%%NEW%%%%X86%%libdata/pkgconfig/libdrm_radeon.pc
 %%NEW%%%%KMS%%libdata/pkgconfig/libkms.pc
 @dirrm include/nouveau
 %%NEW%%%%KMS%%@dirrm include/libkms
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207150501.q6F51NFX025850>