Sun Sep 13 12:32:14 2015 UTC ()
Allow building Mesalib with option llvm on arm.
This requires disabling nouveau and radeon drivers.

The performance boost is appreciable, glxgears is twice as fast on
a cubieboard 2:

cubiem:/>/usr/X11R7/bin/glxgears
76 frames in 5.1 seconds = 15.022 FPS
75 frames in 5.0 seconds = 14.889 FPS
75 frames in 5.0 seconds = 14.979 FPS
69 frames in 5.1 seconds = 13.653 FPS
80 frames in 5.1 seconds = 15.831 FPS
78 frames in 5.0 seconds = 15.529 FPS
cubiem:/>/usr/pkg/bin/glxgears
121 frames in 5.0 seconds = 24.076 FPS
184 frames in 5.0 seconds = 36.595 FPS
182 frames in 5.0 seconds = 36.072 FPS
175 frames in 5.0 seconds = 34.718 FPS
171 frames in 5.0 seconds = 34.053 FPS
169 frames in 5.0 seconds = 33.734 FPS

on the beaglebone the boost is nearly 2x too:
beagle:~> /usr/X11R7/bin/glxgears
47 frames in 5.0 seconds =  9.343 FPS
47 frames in 5.1 seconds =  9.246 FPS
47 frames in 5.1 seconds =  9.210 FPS
47 frames in 5.1 seconds =  9.253 FPS
47 frames in 5.1 seconds =  9.252 FPS
47 frames in 5.1 seconds =  9.236 FPS
beagle:~> /usr/pkg/bin/glxgears
2 frames in 7.3 seconds =  0.275 FPS
84 frames in 5.1 seconds = 16.613 FPS
84 frames in 5.0 seconds = 16.641 FPS
83 frames in 5.0 seconds = 16.482 FPS
83 frames in 5.0 seconds = 16.480 FPS
83 frames in 5.0 seconds = 16.436 FPS


(bouyer)
diff -r1.37 -r1.38 pkgsrc/graphics/MesaLib/options.mk

cvs diff -r1.37 -r1.38 pkgsrc/graphics/MesaLib/options.mk (expand / switch to unified diff)

--- pkgsrc/graphics/MesaLib/options.mk 2015/09/13 01:20:05 1.37
+++ pkgsrc/graphics/MesaLib/options.mk 2015/09/13 12:32:14 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: options.mk,v 1.37 2015/09/13 01:20:05 tnn Exp $ 1# $NetBSD: options.mk,v 1.38 2015/09/13 12:32:14 bouyer Exp $
2 2
3PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib 3PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib
4PKG_SUPPORTED_OPTIONS= llvm dri 4PKG_SUPPORTED_OPTIONS= llvm dri
5PKG_SUGGESTED_OPTIONS= 5PKG_SUGGESTED_OPTIONS=
6 6
7# The LLVM option enables JIT accelerated software rendering and 7# The LLVM option enables JIT accelerated software rendering and
8# is also required to support the latest RADEON GPUs, so enable it 8# is also required to support the latest RADEON GPUs, so enable it
9# by default on platforms where such GPUs might be encountered. 9# by default on platforms where such GPUs might be encountered.
10.if \ 10.if \
11 !empty(MACHINE_PLATFORM:MNetBSD-[789].*-i386) || \ 11 !empty(MACHINE_PLATFORM:MNetBSD-[789].*-i386) || \
12 !empty(MACHINE_PLATFORM:MNetBSD-[789].*-x86_64) || \ 12 !empty(MACHINE_PLATFORM:MNetBSD-[789].*-x86_64) || \
13 !empty(MACHINE_PLATFORM:MNetBSD-[789].*-sparc64) || \ 13 !empty(MACHINE_PLATFORM:MNetBSD-[789].*-sparc64) || \
14 !empty(MACHINE_PLATFORM:MLinux-*-i386) || \ 14 !empty(MACHINE_PLATFORM:MLinux-*-i386) || \
@@ -82,51 +82,55 @@ GALLIUM_DRIVERS+= svga @@ -82,51 +82,55 @@ GALLIUM_DRIVERS+= svga
82PLIST.i915= yes 82PLIST.i915= yes
83GALLIUM_DRIVERS+= i915 83GALLIUM_DRIVERS+= i915
84PLIST.i915_dri= yes 84PLIST.i915_dri= yes
85DRI_DRIVERS+= i915 85DRI_DRIVERS+= i915
86 86
87# Experimental Intel driver 87# Experimental Intel driver
88PLIST.ilo= yes 88PLIST.ilo= yes
89GALLIUM_DRIVERS+= ilo 89GALLIUM_DRIVERS+= ilo
90 90
91PLIST.i965_dri= yes 91PLIST.i965_dri= yes
92DRI_DRIVERS+= i965 92DRI_DRIVERS+= i965
93.endif 93.endif
94 94
95# AMD Radeon r600 95.if !empty(MACHINE_PLATFORM:MNetBSD-*-*arm*)
96PLIST.r600= yes 
97GALLIUM_DRIVERS+= r600 
98 
99# Qualcomm SnapDragon, libdrm_freedreno.pc 96# Qualcomm SnapDragon, libdrm_freedreno.pc
100# GALLIUM_DRIVERS+= freedreno 97# GALLIUM_DRIVERS+= freedreno
101 98
102# Broadcom VideoCore 4 99# Broadcom VideoCore 4
103# GALLIUM_DRIVERS+= vc4 100# GALLIUM_DRIVERS+= vc4
104 101
 102.else
 103
 104# AMD Radeon r600
 105PLIST.r600= yes
 106GALLIUM_DRIVERS+= r600
 107
105# nVidia 108# nVidia
106PLIST.nouveau= yes 109PLIST.nouveau= yes
107GALLIUM_DRIVERS+= nouveau 110GALLIUM_DRIVERS+= nouveau
108 111
109# classic DRI radeon 112# classic DRI radeon
110PLIST.radeon_dri= yes 113PLIST.radeon_dri= yes
111DRI_DRIVERS+= radeon 114DRI_DRIVERS+= radeon
112 115
113# classic DRI r200 116# classic DRI r200
114PLIST.r200_dri= yes 117PLIST.r200_dri= yes
115DRI_DRIVERS+= r200 118DRI_DRIVERS+= r200
116 119
117# classic DRI nouveau 120# classic DRI nouveau
118PLIST.nouveau_dri= yes 121PLIST.nouveau_dri= yes
119DRI_DRIVERS+= nouveau 122DRI_DRIVERS+= nouveau
 123.endif
120 124
121CONFIGURE_ARGS+= --with-egl-platforms=x11,drm 125CONFIGURE_ARGS+= --with-egl-platforms=x11,drm
122CONFIGURE_ARGS+= --with-gallium-drivers=${GALLIUM_DRIVERS:ts,} 126CONFIGURE_ARGS+= --with-gallium-drivers=${GALLIUM_DRIVERS:ts,}
123CONFIGURE_ARGS+= --with-dri-drivers=${DRI_DRIVERS:ts,} 127CONFIGURE_ARGS+= --with-dri-drivers=${DRI_DRIVERS:ts,}
124 128
125.if !empty(PKG_OPTIONS:Mllvm) 129.if !empty(PKG_OPTIONS:Mllvm)
126# AMD Radeon r300 130# AMD Radeon r300
127PLIST.r300= yes 131PLIST.r300= yes
128GALLIUM_DRIVERS+= r300 132GALLIUM_DRIVERS+= r300
129# AMD Canary Islands GPUs 133# AMD Canary Islands GPUs
130PLIST.radeonsi= yes 134PLIST.radeonsi= yes
131GALLIUM_DRIVERS+= radeonsi 135GALLIUM_DRIVERS+= radeonsi
132CONFIGURE_ARGS+= --enable-gallium-llvm 136CONFIGURE_ARGS+= --enable-gallium-llvm