Re: [Mesa-dev] [PATCH 1/2] gallium: add texture gather support to gallium

2014-02-08 Thread Christoph Bumiller
On 07.02.2014 23:25, Dave Airlie wrote:
>>> Doh, yes because GL has ARB_texture_gather then has stuff hidden away
>>> in ARB_gpu_shader5 I forgot to add the extra bits which I suppose we should 
>>> do.
>>>
>>> So I've reposted with the component selection in src1 now.
>> Hmm seems a bit excessive to use an extra reg for that (gather4 but only
>> in d3d11 form uses a src_sel on the sampler reg, but that might not work).
>> I realize this is actually more messy than I thought, since the initial
>> ARB_texture_gather had the ability to query if multi-channel formats are
>> allowed, but had no way to select the channel (somewhat relying on
>> ARB_texture_swizzle to do it, though of course you can't issue multiple
>> gathers with the same texture to get different channels that way).
>> But glsl 4.00 version could select the channel.
>> Is the ARB_texture_gather version actually all that useful or could you
>> merge the two caps? That is, if you have the ability to fetch from
>> multi-channel textures, assume you can also select the channel. The sm4
>> version of gather4 also has the single-channel format restriction - I
>> guess though some hw really can do 4 channels without channel selection.
> Yeah I think I'll rethink this stuff, it looks like two caps, one for
> MAX_COMPONENTS for ARB_texture_gather4, and just one cap for
> TEXTURE_GATHER_SM5 support which would denote support for all the
> ARB_GPU_shader5 bits.
>
>> Other than that, what about shadow samplers? Gather4 of course can't do
>> it (because the d3d10-style opcodes have different opcodes for shadow
>> comparisons), but the GL style opcodes are usually the same if shadow
>> samplers or not are used. Maybe you don't want to handle that right now,
>> just saying that if you'd want to use the same opcode you'd be missing a
>> component in case of texture cube arrays... Since this can't be used for
>> fixed function though I'd guess nothing would stop you from using a
>> different opcode for shadow samplers.
>
> I've gotten shadow samplers to work with the current opcodes, though I
> have to see about cube arrays if we have the running out of space to
> put everything.
>
> Also the GPU_shader5 spec has a few more oddities, so you have
> textureGatherOffset which can take a non-constant set of offset values
> to apply to all 4 texels, then you have textureGatherOffsets which
> only takes constants again, but 4 of them, one per texel. Looking at
> radeon hw it appears fglrx decomposes textureGatherOffsets into
> multiple gather instructions at the hw level but using the
> non-constant hw support to do this. So I'm not sure if the gallium
> interface should just support non-constant for all offsets and just
> restrict the GL.

Fwiw Fermi+ support 4 different non-constant offsets, since they're
passed in a register anyway.

> I've reworked the state tracker code already,
>  
> http://cgit.freedesktop.org/~airlied/mesa/commit/?h=r600g-texture-gather&id=444bc1c8118d51600a58af8a84088e94d0800b22
>
> but I suspect I've a bit further down the rabbit hole to go.
>
> Dave.
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] gallium: add geometry shader output limits

2014-02-08 Thread Grigori Goronzy

On 06.02.2014 02:46, Michel Dänzer wrote:

+   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+   return 16384;


radeonsi currently can't handle more than 4095 total output components,
as the buffer resource for writing to the GSVS ring only has 14 bits for
the stride in bytes. This limit could be lifted in the future by falling
back to the pre-SI (supposedly slower) organization of the GSVS buffer
for larger numbers of total output components.



OK. It probably was a bit naive to assume the limits are similar to r600g.



Also, might it make more sense for these to be shader caps than screen
caps?



shader caps are for capabilities not specific to a single shader stage.

Grigori
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] gallium: add geometry shader output limits

2014-02-08 Thread Grigori Goronzy
v2: adjust limits for radeonsi and llvmpipe
---
 src/gallium/drivers/freedreno/freedreno_screen.c | 5 +
 src/gallium/drivers/i915/i915_screen.c   | 5 +
 src/gallium/drivers/ilo/ilo_screen.c | 3 +++
 src/gallium/drivers/llvmpipe/lp_screen.c | 3 +++
 src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 2 ++
 src/gallium/drivers/nouveau/nv50/nv50_screen.c   | 3 +++
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   | 3 +++
 src/gallium/drivers/r300/r300_screen.c   | 2 ++
 src/gallium/drivers/r600/r600_pipe.c | 6 ++
 src/gallium/drivers/radeonsi/si_pipe.c   | 6 ++
 src/gallium/drivers/softpipe/sp_screen.c | 3 +++
 src/gallium/drivers/svga/svga_screen.c   | 2 ++
 src/gallium/include/pipe/p_defines.h | 4 +++-
 src/mesa/state_tracker/st_extensions.c   | 2 ++
 14 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
b/src/gallium/drivers/freedreno/freedreno_screen.c
index aa294b3..e1b5dae 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -212,6 +212,11 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
return 0;
 
+   /* Geometry shader output, unsupported. */
+   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
+   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+   return 0;
+
/* Texturing. */
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index a658b1b..9f08f86 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -257,6 +257,11 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
case PIPE_CAP_MAX_RENDER_TARGETS:
   return 1;
 
+   /* Geometry shader output, unsupported. */
+   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
+   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+  return 0;
+
/* Fragment coordinate conventions. */
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
diff --git a/src/gallium/drivers/ilo/ilo_screen.c 
b/src/gallium/drivers/ilo/ilo_screen.c
index bc8f62d..9c363ac 100644
--- a/src/gallium/drivers/ilo/ilo_screen.c
+++ b/src/gallium/drivers/ilo/ilo_screen.c
@@ -372,6 +372,9 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
   return ILO_MAX_SO_BINDINGS / ILO_MAX_SO_BUFFERS;
case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
   return ILO_MAX_SO_BINDINGS;
+   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
+   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+  return 0;
case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
   if (is->dev.gen >= ILO_GEN(7))
  return is->dev.has_gen7_sol_reset;
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
b/src/gallium/drivers/llvmpipe/lp_screen.c
index 3f84d74..43142e7 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -187,6 +187,9 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
   return 16*4;
+   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
+   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+  return 1024;
case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
   return 1;
case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c 
b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 787802d..9e2a90c 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -106,6 +106,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_MAX_TEXEL_OFFSET:
case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
+   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
+   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
case PIPE_CAP_TEXTURE_BARRIER:
case PIPE_CAP_SEAMLESS_CUBE_MAP:
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c 
b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index 2b6ec3a..a740adf 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -141,6 +141,9 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
   return 64;
+   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
+   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPON

[Mesa-dev] [PATCH 1/2] configure: error out when building radeonsi without gallium-llvm

2014-02-08 Thread Emil Velikov
--enable-gallium-llvm is required by radeonsi. Currently we
check only for LLVM_VERSION_INT which is 0, whenever gallium-llvm
is disabled explicitly.

./configure --with-gallium-drivers=r600,radeonsi --disable-gallium-llvm

Signed-off-by: Emil Velikov 
---
 configure.ac | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8bf9b94..56d5c8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1731,10 +1731,13 @@ gallium_require_drm_loader() {
 }
 
 radeon_llvm_check() {
+if test "x$enable_gallium_llvm" != "xyes"; then
+AC_MSG_ERROR([--enable_gallium_llvm is required when building $1])
+fi
 LLVM_REQUIRED_VERSION_MAJOR="3"
 LLVM_REQUIRED_VERSION_MINOR="3"
 if test "$LLVM_VERSION_INT" -lt 
"${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
-AC_MSG_ERROR([LLVM 
$LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required 
for r600g and radeonsi.])
+AC_MSG_ERROR([LLVM 
$LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required 
for $1])
 fi
 if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then
 AC_MSG_ERROR([LLVM R600 Target not enabled.  You can enable it when 
building the LLVM
@@ -1744,7 +1747,7 @@ radeon_llvm_check() {
 LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo"
 NEED_RADEON_LLVM=yes
 AC_CHECK_LIB([elf], [elf_memory], [ELF_LIB=-lelf],
- [AC_MSG_ERROR([radeonsi and r600g require 
libelf when using LLVM])])
+ [AC_MSG_ERROR([$1 requires libelf when using 
LLVM])])
 }
 
 dnl Gallium drivers
@@ -1797,7 +1800,7 @@ if test "x$with_gallium_drivers" != x; then
 gallium_require_drm_loader
 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
 if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; 
then
-radeon_llvm_check
+radeon_llvm_check "r600g"
 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
 fi
 if test "x$enable_r600_llvm" = xyes; then
@@ -1814,7 +1817,7 @@ if test "x$with_gallium_drivers" != x; then
 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= 
$LIBDRM_RADEON_REQUIRED])
 gallium_require_drm_loader
 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
-radeon_llvm_check
+radeon_llvm_check "radeonsi"
 gallium_check_st "radeon/drm" "radeonsi/dri" "" "" 
"radeonsi/vdpau" "radeonsi/omx"
 DRICOMMON_NEED_LIBDRM=yes
 ;;
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] winsys/nouveau: make nouveau_drm_screen_create public

2014-02-08 Thread Emil Velikov
One step towards vdpau-interop to work.

Signed-off-by: Emil Velikov 
---
 src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c 
b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
index e4f27f6..71c23f8 100644
--- a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
+++ b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
@@ -9,7 +9,7 @@
 #include "nouveau/nouveau_winsys.h"
 #include "nouveau/nouveau_screen.h"
 
-struct pipe_screen *
+PUBLIC struct pipe_screen *
 nouveau_drm_screen_create(int fd)
 {
struct nouveau_device *dev = NULL;
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 00/22] Exported symbols cleanup and tests

2014-02-08 Thread Emil Velikov
Hello list,

Continuing with another not so interesting area of mesa - cleaning up
the exported symbols and adding make check tests.

Note: Most of these patches are rather dull and may cause boredom or
sleepiness :-)

Before proceeding make sure that with-llvm-shared-libs is set, otherwise
the modules will export every llvm symbol imaginable and make check will
fail. The above option will default to enabled/with with mesa 10.1 and
later once patch is commited.

Brief/highlights:
 - Cleans up symbols that has been incorrectly marked as PUBLIC.
 - Adds VISIBILITY_CFLAGS on a handful of places within automake.
 - Adds tests so that make check shouts loudly if we're exporting too
many symbols.
 - Mainly T symbols are checked, due to the reasons listed in the next
 point.
 - Drivers using stl (r600 and nouveau I'm looking at you), provide a
handfull of exported weak symbols due to gcc design feature [1]. Those
have been left as is.
 - Finally VISIBILITY_CFLAGS has been compacted into DEFINES. The cases
that break (if any) should be fixed approapriately.
 - There is a few more places that could use similar treatment. To be
continued ...

As usual a branch cleanup-exported-symbols-v2 can be found over at 
https://github.com/evelikov/Mesa/


Runtime tested on my rusty old nv96 (nouveau), using the dri and vdpau
state-trackers.
make check tested for every possible test, with swrast, nouveau and r600.

Feel free to take a look and more importantly _please_ give them a test.

Thanks
Emil

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36022

Emil Velikov (22):
  auxiliary/pipe-loader: automake: avoid exporting all symbols
  targets/pipe-loader: automake: drop obsolete version-script
  st/gbm: automake: do not export gbm_gallium_drm_device_create
  gbm: automake: add VISIBILITY_CFLAGS
  gbm: do not export _gbm_mesa_get_device
  targets/gbm: automake: do not export internal symbols
  gbm: automake: add symbol tests
  targets/egl-static: automake: don't export local symbols
  st/egl: automake: avoid exporting all symbols
  wayland-egl: automake: add symbol test
  egl: automake: add symbol test
  targets/egl-static: automake: drop obsolete version-script
  st/vdpau: do not export VdpPresentationQueueTargetCreateX11
  st/vdpau: automake: export only PUBLIC symbols
  targets/vdpau: automake: add exported symbol tests
  targets/dri: automake: add test for exported symbols
  targets/xvmc: add automake test to check for exported symbols
  osmesa: drop obsolete AM_CXXFLAGS
  omx: use VISIBILITY_CFLAGS to control exported symbols
  st/clover: use VISIBILITY_CXXFLAGS where approapriate
  automake: fold VISIBILITY_CFLAGS within DEFINES
  targets/omx: automake: add symbol test

  59 files changed, 369 insertions(+), 70 deletions(-)

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 02/22] targets/pipe-loader: automake: drop obsolete version-script

2014-02-08 Thread Emil Velikov
With all the symbols resolved, there is no need to use
version-script to restrict exported symbols.

Signed-off-by: Emil Velikov 
---
 src/gallium/targets/pipe-loader/Makefile.am | 2 --
 src/gallium/targets/pipe-loader/pipe.link   | 3 ---
 2 files changed, 5 deletions(-)
 delete mode 100644 src/gallium/targets/pipe-loader/pipe.link

diff --git a/src/gallium/targets/pipe-loader/Makefile.am 
b/src/gallium/targets/pipe-loader/Makefile.am
index 97733c1..8033860 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -22,8 +22,6 @@
 
 include $(top_srcdir)/src/gallium/Automake.inc
 
-LDFLAGS += 
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/pipe-loader/pipe.link
-
 AM_CPPFLAGS = \
$(GALLIUM_CFLAGS) \
-I$(top_srcdir)/include \
diff --git a/src/gallium/targets/pipe-loader/pipe.link 
b/src/gallium/targets/pipe-loader/pipe.link
deleted file mode 100644
index d6dd2af..000
--- a/src/gallium/targets/pipe-loader/pipe.link
+++ /dev/null
@@ -1,3 +0,0 @@
-VERSION {
-   global: driver_descriptor; local: *;
-};
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 16/22] targets/dri: automake: add test for exported symbols

2014-02-08 Thread Emil Velikov
dri targets should export the following
 - __driDriverExtensions
 - __dri2ConfigOptions
and
 - *winsys_create > for gl-vdpau interop

Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc |  1 -
 src/gallium/targets/dri-i915/Makefile.am |  5 +
 src/gallium/targets/dri-ilo/Makefile.am  |  5 +
 src/gallium/targets/dri-nouveau/Makefile.am  |  6 ++
 src/gallium/targets/dri-swrast/Makefile.am   |  5 +
 src/gallium/targets/dri-symbols-check| 15 +++
 src/gallium/targets/dri-vmwgfx/Makefile.am   |  5 +
 src/gallium/targets/r300/dri/Makefile.am |  6 ++
 src/gallium/targets/r600/dri/Makefile.am |  6 ++
 src/gallium/targets/radeonsi/dri/Makefile.am |  6 ++
 10 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100755 src/gallium/targets/dri-symbols-check

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 57ac9fd..0ba7e57 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -51,7 +51,6 @@ GALLIUM_VIDEO_CFLAGS = \
$(VISIBILITY_CFLAGS)
 
 
-# TODO: add -export-symbols-regex
 GALLIUM_DRI_LINKER_FLAGS = \
-module \
-avoid-version \
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index 3f8468f..1155b8b 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -59,6 +59,11 @@ AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 i915_dri_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+   export TARGET=i915;
+
+TESTS = ../dri-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: i915_dri.la
diff --git a/src/gallium/targets/dri-ilo/Makefile.am 
b/src/gallium/targets/dri-ilo/Makefile.am
index 418e2ea..d24228e 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -59,6 +59,11 @@ ilo_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 ilo_dri_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+   export TARGET=ilo;
+
+TESTS = ../dri-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: ilo_dri.la
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am 
b/src/gallium/targets/dri-nouveau/Makefile.am
index 1988067..79a839b 100644
--- a/src/gallium/targets/dri-nouveau/Makefile.am
+++ b/src/gallium/targets/dri-nouveau/Makefile.am
@@ -54,6 +54,12 @@ nouveau_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 nouveau_dri_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+   export TARGET=nouveau; \
+   export WINSYS_FUNC=nouveau_drm_screen_create;
+
+TESTS = ../dri-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: nouveau_dri.la
diff --git a/src/gallium/targets/dri-swrast/Makefile.am 
b/src/gallium/targets/dri-swrast/Makefile.am
index ec1576b..3635edf 100644
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ b/src/gallium/targets/dri-swrast/Makefile.am
@@ -62,6 +62,11 @@ swrast_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 swrast_dri_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+   export TARGET=swrast;
+
+TESTS = ../dri-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: swrast_dri.la
diff --git a/src/gallium/targets/dri-symbols-check 
b/src/gallium/targets/dri-symbols-check
new file mode 100755
index 000..1100421
--- /dev/null
+++ b/src/gallium/targets/dri-symbols-check
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/${TARGET}_dri.so} | egrep -o "T .*|D 
.*|R .*" | cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func )  

[Mesa-dev] [PATCH 03/22] st/gbm: automake: do not export gbm_gallium_drm_device_create

2014-02-08 Thread Emil Velikov
Symbol is internal and was never meant to be exported.

Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/gbm/Makefile.am | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/gbm/Makefile.am 
b/src/gallium/state_trackers/gbm/Makefile.am
index 16f58d8..0e532fd 100644
--- a/src/gallium/state_trackers/gbm/Makefile.am
+++ b/src/gallium/state_trackers/gbm/Makefile.am
@@ -23,7 +23,9 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-AM_CFLAGS = $(GALLIUM_CFLAGS)
+AM_CFLAGS = \
+   $(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS)
 AM_CPPFLAGS = \
-I$(top_srcdir)/src/gbm/main \
-I$(top_srcdir)/include
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 01/22] auxiliary/pipe-loader: automake: avoid exporting all symbols

2014-02-08 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/auxiliary/pipe-loader/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/auxiliary/pipe-loader/Makefile.am 
b/src/gallium/auxiliary/pipe-loader/Makefile.am
index 8e4d034..74a61a3 100644
--- a/src/gallium/auxiliary/pipe-loader/Makefile.am
+++ b/src/gallium/auxiliary/pipe-loader/Makefile.am
@@ -1,6 +1,7 @@
 AUTOMAKE_OPTIONS = subdir-objects
 
 AM_CPPFLAGS = $(DEFINES) \
+   $(VISIBILITY_CFLAGS) \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/loader \
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 05/22] gbm: do not export _gbm_mesa_get_device

2014-02-08 Thread Emil Velikov
This symbol is internal and was never part of the API.
Unused by any of the gbm backends, it makes sense to
simply not export it.

Cc: Kristian Høgsberg 
Signed-off-by: Emil Velikov 
---
 src/gbm/main/gbm.c| 2 +-
 src/gbm/main/gbmint.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c
index 72eeabf..7a4e406 100644
--- a/src/gbm/main/gbm.c
+++ b/src/gbm/main/gbm.c
@@ -100,7 +100,7 @@ gbm_device_destroy(struct gbm_device *gbm)
   gbm->destroy(gbm);
 }
 
-GBM_EXPORT struct gbm_device *
+struct gbm_device *
 _gbm_mesa_get_device(int fd)
 {
struct gbm_device *gbm = NULL;
diff --git a/src/gbm/main/gbmint.h b/src/gbm/main/gbmint.h
index a467bea..4baf8e3 100644
--- a/src/gbm/main/gbmint.h
+++ b/src/gbm/main/gbmint.h
@@ -110,7 +110,7 @@ struct gbm_backend {
struct gbm_device *(*create_device)(int fd);
 };
 
-GBM_EXPORT struct gbm_device *
+struct gbm_device *
 _gbm_mesa_get_device(int fd);
 
 #endif
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 08/22] targets/egl-static: automake: don't export local symbols

2014-02-08 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/targets/egl-static/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/targets/egl-static/Makefile.am 
b/src/gallium/targets/egl-static/Makefile.am
index 73bb795..7559bcd 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -35,6 +35,7 @@ LDFLAGS += 
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl
 AM_CFLAGS = $(PTHREAD_CFLAGS)
 AM_CPPFLAGS = \
$(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/loader \
-I$(top_srcdir)/src/gallium/drivers \
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 21/22] automake: fold VISIBILITY_CFLAGS within DEFINES

2014-02-08 Thread Emil Velikov
Most places in mesa requires explicit VISIBILITY_CFLAGS causing
some headache when introducing new build components and managing
existing ones. Move to inconditionally hide all symbols and make
sure we explicitly set the ones that need to be public.

XXX: The following needs to be checked/tested
 src/gtest/
 src/mapi/glapi
 src/mapi/shared-glapi/
 src/gallium/state_trackers/vega/

Signed-off-by: Emil Velikov 
---
 configure.ac   |  2 ++
 src/egl/drivers/dri2/Makefile.am   |  1 -
 src/egl/main/Makefile.am   |  1 -
 src/egl/wayland/wayland-drm/Makefile.am|  1 -
 src/egl/wayland/wayland-egl/Makefile.am|  1 -
 src/gallium/Automake.inc   | 15 +--
 src/gallium/auxiliary/Makefile.am  |  3 +--
 src/gallium/auxiliary/pipe-loader/Makefile.am  |  1 -
 src/gallium/state_trackers/dri/drm/Makefile.am |  3 +--
 src/gallium/state_trackers/dri/sw/Makefile.am  |  1 -
 src/gallium/state_trackers/egl/Makefile.am |  1 -
 src/gallium/state_trackers/gbm/Makefile.am |  3 +--
 src/gallium/state_trackers/omx/Makefile.am |  1 -
 src/gallium/state_trackers/vdpau/Makefile.am   |  1 -
 src/gallium/state_trackers/xa/Makefile.am  |  3 +--
 src/gallium/targets/egl-static/Makefile.am |  1 -
 src/gallium/targets/gbm/Makefile.am|  1 -
 src/gallium/targets/r600/omx/Makefile.am   |  1 -
 src/gallium/targets/radeonsi/omx/Makefile.am   |  1 -
 src/gbm/Makefile.am|  3 +--
 src/glx/Makefile.am|  1 -
 src/loader/Makefile.am |  1 -
 src/mapi/es1api/Makefile.am|  2 --
 src/mapi/es2api/Makefile.am|  2 --
 src/mapi/vgapi/Makefile.am |  2 --
 src/mesa/drivers/dri/common/Makefile.am|  3 +--
 src/mesa/drivers/dri/i915/Makefile.am  |  1 -
 src/mesa/drivers/dri/i965/Makefile.am  |  1 -
 src/mesa/drivers/dri/nouveau/Makefile.am   |  1 -
 src/mesa/drivers/dri/r200/Makefile.am  |  1 -
 src/mesa/drivers/dri/radeon/Makefile.am|  1 -
 src/mesa/drivers/dri/swrast/Makefile.am|  3 +--
 src/mesa/drivers/osmesa/Makefile.am|  2 --
 33 files changed, 14 insertions(+), 52 deletions(-)

diff --git a/configure.ac b/configure.ac
index 56d5c8e..02a8699 100644
--- a/configure.ac
+++ b/configure.ac
@@ -227,6 +227,8 @@ cygwin*)
 ;;
 esac
 
+DEFINES="$DEFINES $VISIBILITY_CFLAGS"
+
 AC_SUBST([VISIBILITY_CFLAGS])
 AC_SUBST([VISIBILITY_CXXFLAGS])
 
diff --git a/src/egl/drivers/dri2/Makefile.am b/src/egl/drivers/dri2/Makefile.am
index 6a9ae50..89be47b 100644
--- a/src/egl/drivers/dri2/Makefile.am
+++ b/src/egl/drivers/dri2/Makefile.am
@@ -29,7 +29,6 @@ AM_CFLAGS = \
-I$(top_srcdir)/src/egl/wayland/wayland-drm \
-I$(top_builddir)/src/egl/wayland/wayland-drm \
$(DEFINES) \
-   $(VISIBILITY_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(LIBUDEV_CFLAGS) \
$(LIBKMS_CFLAGS) \
diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am
index 7d9748f..a0b9e8f 100644
--- a/src/egl/main/Makefile.am
+++ b/src/egl/main/Makefile.am
@@ -27,7 +27,6 @@ AM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gbm/main \
$(DEFINES) \
-   $(VISIBILITY_CFLAGS) \
$(EGL_CFLAGS) \
-D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
-D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\" \
diff --git a/src/egl/wayland/wayland-drm/Makefile.am 
b/src/egl/wayland/wayland-drm/Makefile.am
index 08ee497..4b2aeb3 100644
--- a/src/egl/wayland/wayland-drm/Makefile.am
+++ b/src/egl/wayland/wayland-drm/Makefile.am
@@ -1,7 +1,6 @@
 AM_CFLAGS = -I$(top_srcdir)/src/egl/main \
-I$(top_srcdir)/include \
$(DEFINES) \
-   $(VISIBILITY_CFLAGS) \
$(WAYLAND_CFLAGS) 
 
 noinst_LTLIBRARIES = libwayland-drm.la
diff --git a/src/egl/wayland/wayland-egl/Makefile.am 
b/src/egl/wayland/wayland-egl/Makefile.am
index 6e92b29..5164950 100644
--- a/src/egl/wayland/wayland-egl/Makefile.am
+++ b/src/egl/wayland/wayland-egl/Makefile.am
@@ -2,7 +2,6 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = wayland-egl.pc
 
 AM_CFLAGS = $(DEFINES) \
-   $(VISIBILITY_CFLAGS) \
$(WAYLAND_CFLAGS)
 
 lib_LTLIBRARIES = libwayland-egl.la
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index c67b612..4c4bf58 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -14,8 +14,7 @@ GALLIUM_DRIVER_CFLAGS = \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/drivers \
-   $(DEFINES) \
-   $(VISIBILITY_CFLAGS)
+   $(DEFINES)
 
 GALLIUM_DRIVER_CXXFLAGS = \
-I$(srcdir)/include \
@@ -23,8 +22,7 @@ GALLIUM_DRIVER_CXXFLAGS = \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
 

[Mesa-dev] [PATCH 19/22] omx: use VISIBILITY_CFLAGS to control exported symbols

2014-02-08 Thread Emil Velikov
Initial step of cleaning the exported symbols from targets/omx

 - Mark omx_component_library_Setup as public
 - Drop export-symbols-regex

Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/omx/Makefile.am   | 1 +
 src/gallium/state_trackers/omx/entrypoint.h  | 2 +-
 src/gallium/targets/r600/omx/Makefile.am | 4 +---
 src/gallium/targets/radeonsi/omx/Makefile.am | 4 +---
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/gallium/state_trackers/omx/Makefile.am 
b/src/gallium/state_trackers/omx/Makefile.am
index 1983248..7972d79 100644
--- a/src/gallium/state_trackers/omx/Makefile.am
+++ b/src/gallium/state_trackers/omx/Makefile.am
@@ -24,6 +24,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
$(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS) \
$(OMX_CFLAGS)
 
 noinst_LTLIBRARIES = libomxtracker.la
diff --git a/src/gallium/state_trackers/omx/entrypoint.h 
b/src/gallium/state_trackers/omx/entrypoint.h
index af7c337..7625d7a 100644
--- a/src/gallium/state_trackers/omx/entrypoint.h
+++ b/src/gallium/state_trackers/omx/entrypoint.h
@@ -38,7 +38,7 @@
 
 #include "vl/vl_winsys.h"
 
-extern int omx_component_library_Setup(stLoaderComponentType **stComponents);
+PUBLIC extern int omx_component_library_Setup(stLoaderComponentType 
**stComponents);
 
 struct vl_screen *omx_get_screen(void);
 void omx_put_screen(void);
diff --git a/src/gallium/targets/r600/omx/Makefile.am 
b/src/gallium/targets/r600/omx/Makefile.am
index 7660a8d..3a1e22b 100644
--- a/src/gallium/targets/r600/omx/Makefile.am
+++ b/src/gallium/targets/r600/omx/Makefile.am
@@ -24,6 +24,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
$(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS) \
$(PTHREAD_CFLAGS) \
$(LIBDRM_CFLAGS)
 AM_CPPFLAGS = \
@@ -33,15 +34,12 @@ AM_CPPFLAGS = \
 omxdir = $(OMX_LIB_INSTALL_DIR)
 omx_LTLIBRARIES = libomx_r600.la
 
-EXPORTS = '^(omx_component_library_Setup|radeon_drm_winsys_create)$$'
-
 libomx_r600_la_SOURCES = \
drm_target.c \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libomx_r600_la_LDFLAGS = \
-module \
-   -export-symbols-regex $(EXPORTS) \
-shared \
-no-undefined
 
diff --git a/src/gallium/targets/radeonsi/omx/Makefile.am 
b/src/gallium/targets/radeonsi/omx/Makefile.am
index 5eea303..79ed287 100644
--- a/src/gallium/targets/radeonsi/omx/Makefile.am
+++ b/src/gallium/targets/radeonsi/omx/Makefile.am
@@ -24,6 +24,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
$(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS) \
$(PTHREAD_CFLAGS) \
$(LIBDRM_CFLAGS)
 AM_CPPFLAGS = \
@@ -33,15 +34,12 @@ AM_CPPFLAGS = \
 omxdir = $(OMX_LIB_INSTALL_DIR)
 omx_LTLIBRARIES = libomx_radeonsi.la
 
-EXPORTS = '^(omx_component_library_Setup|radeon_drm_winsys_create)$$'
-
 libomx_radeonsi_la_SOURCES = \
drm_target.c \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libomx_radeonsi_la_LDFLAGS = \
-module \
-   -export-symbols-regex $(EXPORTS) \
-shared \
-no-undefined
 
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 22/22] targets/omx: automake: add symbol test

2014-02-08 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/targets/omx-symbols-check| 13 +
 src/gallium/targets/r600/omx/Makefile.am |  6 ++
 src/gallium/targets/radeonsi/omx/Makefile.am |  6 ++
 3 files changed, 25 insertions(+)
 create mode 100755 src/gallium/targets/omx-symbols-check

diff --git a/src/gallium/targets/omx-symbols-check 
b/src/gallium/targets/omx-symbols-check
new file mode 100755
index 000..84616f4
--- /dev/null
+++ b/src/gallium/targets/omx-symbols-check
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/libomx_${TARGET}.so} | grep -o "T .*" | 
cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func )  

[Mesa-dev] [PATCH 10/22] wayland-egl: automake: add symbol test

2014-02-08 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/egl/wayland/wayland-egl/Makefile.am   |  2 ++
 src/egl/wayland/wayland-egl/wayland-egl-symbols-check | 16 
 2 files changed, 18 insertions(+)
 create mode 100755 src/egl/wayland/wayland-egl/wayland-egl-symbols-check

diff --git a/src/egl/wayland/wayland-egl/Makefile.am 
b/src/egl/wayland/wayland-egl/Makefile.am
index 138c170..6e92b29 100644
--- a/src/egl/wayland/wayland-egl/Makefile.am
+++ b/src/egl/wayland/wayland-egl/Makefile.am
@@ -9,3 +9,5 @@ lib_LTLIBRARIES = libwayland-egl.la
 noinst_HEADERS = wayland-egl-priv.h
 libwayland_egl_la_SOURCES = wayland-egl.c
 libwayland_egl_la_LDFLAGS = -version-info 1
+
+TESTS = wayland-egl-symbols-check
diff --git a/src/egl/wayland/wayland-egl/wayland-egl-symbols-check 
b/src/egl/wayland/wayland-egl/wayland-egl-symbols-check
new file mode 100755
index 000..0c5fd09
--- /dev/null
+++ b/src/egl/wayland/wayland-egl/wayland-egl-symbols-check
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/libwayland-egl.so} | grep -o "T .*" | 
cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func )  

[Mesa-dev] [PATCH 18/22] osmesa: drop obsolete AM_CXXFLAGS

2014-02-08 Thread Emil Velikov
There is no cpp files during the build process, thus we
can safely drop the unused cxxflags.

Signed-off-by: Emil Velikov 
---
 src/mesa/drivers/osmesa/Makefile.am | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/mesa/drivers/osmesa/Makefile.am 
b/src/mesa/drivers/osmesa/Makefile.am
index d09c18e..4935335 100644
--- a/src/mesa/drivers/osmesa/Makefile.am
+++ b/src/mesa/drivers/osmesa/Makefile.am
@@ -29,8 +29,6 @@ AM_CPPFLAGS = \
$(DEFINES)
 AM_CFLAGS = $(PTHREAD_CFLAGS) \
$(VISIBILITY_CFLAGS)
-AM_CXXFLAGS = $(PTHREAD_CFLAGS) \
-   $(VISIBILITY_CXXFLAGS)
 
 lib_LTLIBRARIES = lib@OSMESA_LIB@.la
 
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 17/22] targets/xvmc: add automake test to check for exported symbols

2014-02-08 Thread Emil Velikov
Drop the use of -export-symbols-regex now that xvmc drivers/backends
export only the required functions. Add a test to capture future
problems via make check.

Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc |  1 -
 src/gallium/targets/r600/xvmc/Makefile.am|  6 +
 src/gallium/targets/xvmc-nouveau/Makefile.am |  6 +
 src/gallium/targets/xvmc-symbols-check   | 39 
 4 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100755 src/gallium/targets/xvmc-symbols-check

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 0ba7e57..c67b612 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -67,7 +67,6 @@ GALLIUM_XVMC_LINKER_FLAGS = \
-module \
-version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
-shared \
-   -export-symbols-regex '^XvMC' \
-no-undefined
 
 GALLIUM_VDPAU_LIB_DEPS = \
diff --git a/src/gallium/targets/r600/xvmc/Makefile.am 
b/src/gallium/targets/r600/xvmc/Makefile.am
index 7fe9b1a..016517e 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -55,6 +55,12 @@ libXvMCr600_la_LINK = $(LINK) $(libXvMCr600_la_LDFLAGS)
 nodist_EXTRA_libXvMCr600_la_SOURCES = dummy-c.c
 endif
 
+AM_TESTS_ENVIRONMENT = \
+   export TARGET=r600; \
+   export WINSYS_FUNC=radeon_drm_winsys_create;
+
+TESTS = ../../xvmc-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: libXvMCr600.la
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index 4a45f41..55924a4 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -48,6 +48,12 @@ libXvMCnouveau_la_LDFLAGS += $(LLVM_LDFLAGS)
 libXvMCnouveau_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+   export TARGET=nouveau; \
+   export WINSYS_FUNC=nouveau_drm_screen_create;
+
+TESTS = ../xvmc-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: libXvMCnouveau.la
diff --git a/src/gallium/targets/xvmc-symbols-check 
b/src/gallium/targets/xvmc-symbols-check
new file mode 100755
index 000..c6aeb02
--- /dev/null
+++ b/src/gallium/targets/xvmc-symbols-check
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/libXvMC${TARGET}.so} | grep -o "T .*" | 
cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func )  

[Mesa-dev] [PATCH 04/22] gbm: automake: add VISIBILITY_CFLAGS

2014-02-08 Thread Emil Velikov
Currently the library exports every symbol imaginable,
rather than the ones defined by the API.

Note: This may cause issues for libraries that are linking
agaist libgbm's internals.

Cc: Kristian Høgsberg 
Signed-off-by: Emil Velikov 
---
 src/gbm/Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
index eacb96a..b144b17 100644
--- a/src/gbm/Makefile.am
+++ b/src/gbm/Makefile.am
@@ -12,7 +12,8 @@ AM_CFLAGS = \
$(LIBUDEV_CFLAGS) \
$(LIBKMS_CFLAGS) \
$(DLOPEN_CFLAGS) \
-   $(DEFINES)
+   $(DEFINES) \
+   $(VISIBILITY_CFLAGS)
 
 lib_LTLIBRARIES = libgbm.la
 include_HEADERS = main/gbm.h
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 07/22] gbm: automake: add symbol tests

2014-02-08 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/targets/gbm/Makefile.am   |  2 ++
 src/gallium/targets/gbm/gallium-gbm-symbols-check | 13 +
 src/gbm/Makefile.am   |  2 ++
 src/gbm/gbm-symbols-check | 33 +++
 4 files changed, 50 insertions(+)
 create mode 100755 src/gallium/targets/gbm/gallium-gbm-symbols-check
 create mode 100755 src/gbm/gbm-symbols-check

diff --git a/src/gallium/targets/gbm/Makefile.am 
b/src/gallium/targets/gbm/Makefile.am
index 5398f11..89e1023 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -67,3 +67,5 @@ gbm_gallium_drm_la_LINK = $(CXXLINK) 
$(gbm_gallium_drm_la_LDFLAGS)
 # Mention a dummy pure C file to trigger generation of the $(LINK) variable
 nodist_EXTRA_gbm_gallium_drm_la_SOURCES = dummy-c.c
 endif
+
+TESTS = gallium-gbm-symbols-check
diff --git a/src/gallium/targets/gbm/gallium-gbm-symbols-check 
b/src/gallium/targets/gbm/gallium-gbm-symbols-check
new file mode 100755
index 000..52b20ab
--- /dev/null
+++ b/src/gallium/targets/gbm/gallium-gbm-symbols-check
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/gbm_gallium_drm.so} | egrep -o "T .*|D 
.*" | cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func )  

[Mesa-dev] [PATCH 14/22] st/vdpau: automake: export only PUBLIC symbols

2014-02-08 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/vdpau/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/state_trackers/vdpau/Makefile.am 
b/src/gallium/state_trackers/vdpau/Makefile.am
index a2fa366..a74b5bf 100644
--- a/src/gallium/state_trackers/vdpau/Makefile.am
+++ b/src/gallium/state_trackers/vdpau/Makefile.am
@@ -28,6 +28,7 @@ VDPAU_MINOR = 0
 
 AM_CFLAGS = \
$(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS) \
$(VDPAU_CFLAGS)
 AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 12/22] targets/egl-static: automake: drop obsolete version-script

2014-02-08 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/targets/egl-static/Makefile.am | 2 --
 src/gallium/targets/egl-static/egl.link| 3 ---
 2 files changed, 5 deletions(-)
 delete mode 100644 src/gallium/targets/egl-static/egl.link

diff --git a/src/gallium/targets/egl-static/Makefile.am 
b/src/gallium/targets/egl-static/Makefile.am
index 7559bcd..273d364 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -30,8 +30,6 @@
 #
 include $(top_srcdir)/src/gallium/Automake.inc
 
-LDFLAGS += 
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/egl-static/egl.link
-
 AM_CFLAGS = $(PTHREAD_CFLAGS)
 AM_CPPFLAGS = \
$(GALLIUM_CFLAGS) \
diff --git a/src/gallium/targets/egl-static/egl.link 
b/src/gallium/targets/egl-static/egl.link
deleted file mode 100644
index 5be917f..000
--- a/src/gallium/targets/egl-static/egl.link
+++ /dev/null
@@ -1,3 +0,0 @@
-VERSION {
-   global: _eglMain; local: *;
-};
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 06/22] targets/gbm: automake: do not export internal symbols

2014-02-08 Thread Emil Velikov
Add VISIBILITY_CFLAGS to automake build, so that
only required symbols are exported.

Signed-off-by: Emil Velikov 
---
 src/gallium/targets/gbm/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/targets/gbm/Makefile.am 
b/src/gallium/targets/gbm/Makefile.am
index 4299d07..5398f11 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -34,6 +34,7 @@ AM_CPPFLAGS = \
 
 AM_CFLAGS = \
$(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS) \
$(LIBUDEV_CFLAGS) \
$(LIBDRM_CFLAGS)
 
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 09/22] st/egl: automake: avoid exporting all symbols

2014-02-08 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/egl/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/state_trackers/egl/Makefile.am 
b/src/gallium/state_trackers/egl/Makefile.am
index bad14fe..9c00f06 100644
--- a/src/gallium/state_trackers/egl/Makefile.am
+++ b/src/gallium/state_trackers/egl/Makefile.am
@@ -27,6 +27,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = $(GALLIUM_CFLAGS)
 AM_CPPFLAGS = \
+   $(VISIBILITY_CFLAGS) \
-I$(top_srcdir)/src/egl/main \
-I$(top_builddir)/src/egl/wayland/wayland-drm/ \
-I$(top_srcdir)/include
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 13/22] st/vdpau: do not export VdpPresentationQueueTargetCreateX11

2014-02-08 Thread Emil Velikov
The function pointer is retrieved via VdpGetProcAddress just
like all the other vdpau functions and should not be exported.

Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/vdpau/device.c| 2 +-
 src/gallium/state_trackers/vdpau/vdpau_private.h | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/vdpau/device.c 
b/src/gallium/state_trackers/vdpau/device.c
index def1e2a..0cdda73 100644
--- a/src/gallium/state_trackers/vdpau/device.c
+++ b/src/gallium/state_trackers/vdpau/device.c
@@ -106,7 +106,7 @@ no_htab:
 /**
  * Create a VdpPresentationQueueTarget for use with X11.
  */
-PUBLIC VdpStatus
+VdpStatus
 vlVdpPresentationQueueTargetCreateX11(VdpDevice device, Drawable drawable,
   VdpPresentationQueueTarget *target)
 {
diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h 
b/src/gallium/state_trackers/vdpau/vdpau_private.h
index 08afe60..2f4d651 100644
--- a/src/gallium/state_trackers/vdpau/vdpau_private.h
+++ b/src/gallium/state_trackers/vdpau/vdpau_private.h
@@ -436,7 +436,6 @@ boolean vlGetFuncFTAB(VdpFuncId function_id, void **func);
 
 /* Public functions */
 VdpDeviceCreateX11 vdp_imp_device_create_x11;
-VdpPresentationQueueTargetCreateX11 vlVdpPresentationQueueTargetCreateX11;
 
 void vlVdpDefaultSamplerViewTemplate(struct pipe_sampler_view *templ, struct 
pipe_resource *res);
 
@@ -507,6 +506,9 @@ VdpVideoMixerGetParameterValues 
vlVdpVideoMixerGetParameterValues;
 VdpVideoMixerGetAttributeValues vlVdpVideoMixerGetAttributeValues;
 VdpVideoMixerDestroy vlVdpVideoMixerDestroy;
 VdpGenerateCSCMatrix vlVdpGenerateCSCMatrix;
+/* Winsys specific internal function pointers */
+VdpPresentationQueueTargetCreateX11 vlVdpPresentationQueueTargetCreateX11;
+
 
 /* interop to mesa state tracker */
 VdpVideoSurfaceGallium vlVdpVideoSurfaceGallium;
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 20/22] st/clover: use VISIBILITY_CXXFLAGS where approapriate

2014-02-08 Thread Emil Velikov
Use the c++ visibility flags when building cpp files.

Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/clover/Makefile.am | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/clover/Makefile.am 
b/src/gallium/state_trackers/clover/Makefile.am
index c79fd37..ece2b38 100644
--- a/src/gallium/state_trackers/clover/Makefile.am
+++ b/src/gallium/state_trackers/clover/Makefile.am
@@ -31,14 +31,14 @@ noinst_LTLIBRARIES = libclover.la libcltgsi.la libclllvm.la
 
 libcltgsi_la_CXXFLAGS = \
-std=c++0x \
-   $(VISIBILITY_CFLAGS)
+   $(VISIBILITY_CXXFLAGS)
 
 libcltgsi_la_SOURCES = \
tgsi/compiler.cpp
 
 libclllvm_la_CXXFLAGS = \
-std=c++98 \
-   $(VISIBILITY_CFLAGS) \
+   $(VISIBILITY_CXXFLAGS) \
$(LLVM_CPPFLAGS) \
$(DEFINES) \
-DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \
@@ -50,7 +50,7 @@ libclllvm_la_SOURCES = \
 
 libclover_la_CXXFLAGS = \
-std=c++0x \
-   $(VISIBILITY_CFLAGS)
+   $(VISIBILITY_CXXFLAGS)
 
 libclover_la_LIBADD = \
libcltgsi.la libclllvm.la
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 11/22] egl: automake: add symbol test

2014-02-08 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/egl/main/Makefile.am   |   2 +
 src/egl/main/egl-symbols-check | 109 +
 2 files changed, 111 insertions(+)
 create mode 100755 src/egl/main/egl-symbols-check

diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am
index 46e890a..7d9748f 100644
--- a/src/egl/main/Makefile.am
+++ b/src/egl/main/Makefile.am
@@ -124,3 +124,5 @@ egl_HEADERS = \
$(top_srcdir)/include/EGL/egl.h \
$(top_srcdir)/include/EGL/eglmesaext.h \
$(top_srcdir)/include/EGL/eglplatform.h
+
+TESTS = egl-symbols-check
\ No newline at end of file
diff --git a/src/egl/main/egl-symbols-check b/src/egl/main/egl-symbols-check
new file mode 100755
index 000..fc69369
--- /dev/null
+++ b/src/egl/main/egl-symbols-check
@@ -0,0 +1,109 @@
+#!/bin/bash
+
+# XXX: the private _egl* symbols are exported for egl backends like egl_gallium
+
+FUNCS=$(nm -D --defined-only ${1-.libs/libEGL.so} | grep -o "T .*" | cut -c 3- 
| while read func; do
+( grep -q "^$func$" || echo $func )  

[Mesa-dev] [PATCH 15/22] targets/vdpau: automake: add exported symbol tests

2014-02-08 Thread Emil Velikov
And drop the obsolete export-symbol-regex from the linker.

Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc   |  1 -
 src/gallium/targets/r600/vdpau/Makefile.am |  6 ++
 src/gallium/targets/radeonsi/vdpau/Makefile.am |  6 ++
 src/gallium/targets/vdpau-nouveau/Makefile.am  |  6 ++
 src/gallium/targets/vdpau-symbols-check| 13 +
 5 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100755 src/gallium/targets/vdpau-symbols-check

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 1e4a34f..57ac9fd 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -61,7 +61,6 @@ GALLIUM_DRI_LINKER_FLAGS = \
 GALLIUM_VDPAU_LINKER_FLAGS = \
-module \
-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-   -export-symbols-regex $(VDPAU_EXPORTS) \
-shared \
-no-undefined
 
diff --git a/src/gallium/targets/r600/vdpau/Makefile.am 
b/src/gallium/targets/r600/vdpau/Makefile.am
index 7f43fbb..ad6d1c8 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -57,6 +57,12 @@ libvdpau_r600_la_LINK = $(LINK) $(libvdpau_r600_la_LDFLAGS)
 nodist_EXTRA_libvdpau_r600_la_SOURCES = dummy-c.c
 endif
 
+AM_TESTS_ENVIRONMENT = \
+   export TARGET=r600; \
+   export WINSYS_FUNC=radeon_drm_winsys_create;
+
+TESTS = ../../vdpau-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: libvdpau_r600.la
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am 
b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index 0292b2b..876e1ba 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -50,6 +50,12 @@ libvdpau_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS)
 libvdpau_radeonsi_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+   export TARGET=radeonsi; \
+   export WINSYS_FUNC=radeon_drm_winsys_create;
+
+TESTS = ../../vdpau-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: libvdpau_radeonsi.la
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index fbaad03..97c1952 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -50,6 +50,12 @@ libvdpau_nouveau_la_LDFLAGS += $(LLVM_LDFLAGS)
 libvdpau_nouveau_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+   export TARGET=nouveau; \
+   export WINSYS_FUNC=nouveau_drm_screen_create;
+
+TESTS = ../vdpau-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: libvdpau_nouveau.la
diff --git a/src/gallium/targets/vdpau-symbols-check 
b/src/gallium/targets/vdpau-symbols-check
new file mode 100755
index 000..79e6263
--- /dev/null
+++ b/src/gallium/targets/vdpau-symbols-check
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/libvdpau_${TARGET}.so} | grep -o "T .*" 
| cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func )  

Re: [Mesa-dev] [PATCH] R600/SI: Custom select 64-bit ADD

2014-02-08 Thread Matt Arsenault

I didn't think to try this. Where is the address folding happening?

On 02/07/2014 07:46 AM, Tom Stellard wrote:

From: Tom Stellard 

---
  lib/Target/R600/AMDGPUISelDAGToDAG.cpp | 48 ++
  lib/Target/R600/SIISelLowering.cpp | 29 
  lib/Target/R600/SIISelLowering.h   |  1 -
  test/CodeGen/R600/add.ll   | 10 +++
  test/CodeGen/R600/add_i64.ll   | 23 +++-
  5 files changed, 75 insertions(+), 36 deletions(-)

diff --git a/lib/Target/R600/AMDGPUISelDAGToDAG.cpp 
b/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
index a989135..fea875c 100644
--- a/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
+++ b/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
@@ -200,6 +200,54 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
}
switch (Opc) {
default: break;
+  // We are selecting i64 ADD here instead of custom lower it during
+  // DAG legalization, so we can fold some i64 ADDs used for address
+  // calculation into the LOAD and STORE instructions.
+  case ISD::ADD: {
+const AMDGPUSubtarget &ST = TM.getSubtarget();
+if (N->getValueType(0) != MVT::i64 ||
+ST.getGeneration() < AMDGPUSubtarget::SOUTHERN_ISLANDS)
+  break;
+
+SDLoc DL(N);
+SDValue LHS = N->getOperand(0);
+SDValue RHS = N->getOperand(1);
+
+SDValue Sub0 = CurDAG->getTargetConstant(AMDGPU::sub0, MVT::i32);
+SDValue Sub1 = CurDAG->getTargetConstant(AMDGPU::sub1, MVT::i32);
+
+SDNode *Lo0 = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
+ DL, MVT::i32, LHS, Sub0);
+SDNode *Hi0 = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
+ DL, MVT::i32, LHS, Sub1);
+
+SDNode *Lo1 = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
+ DL, MVT::i32, RHS, Sub0);
+SDNode *Hi1 = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
+ DL, MVT::i32, RHS, Sub1);
+
+SDVTList VTList = CurDAG->getVTList(MVT::i32, MVT::Glue);
+
+SmallVector AddLoArgs;
+AddLoArgs.push_back(SDValue(Lo0, 0));
+AddLoArgs.push_back(SDValue(Lo1, 0));
+
+SDNode *AddLo = CurDAG->getMachineNode(AMDGPU::S_ADD_I32, DL,
+   VTList, AddLoArgs);
+SDValue Carry = SDValue(AddLo, 1);
+SDNode *AddHi = CurDAG->getMachineNode(AMDGPU::S_ADDC_U32, DL,
+   MVT::i32, SDValue(Hi0, 0),
+   SDValue(Hi1, 0), Carry);
+
+SDValue Args[5] = {
+  CurDAG->getTargetConstant(AMDGPU::SReg_64RegClassID, MVT::i32),
+  SDValue(AddLo,0),
+  Sub0,
+  SDValue(AddHi,0),
+  Sub1,
+};
+return CurDAG->SelectNodeTo(N, AMDGPU::REG_SEQUENCE, MVT::i64, Args, 5);
+  }
case ISD::BUILD_VECTOR: {
  unsigned RegClassID;
  const AMDGPUSubtarget &ST = TM.getSubtarget();
diff --git a/lib/Target/R600/SIISelLowering.cpp 
b/lib/Target/R600/SIISelLowering.cpp
index 0a22d16..4d2f370 100644
--- a/lib/Target/R600/SIISelLowering.cpp
+++ b/lib/Target/R600/SIISelLowering.cpp
@@ -76,7 +76,6 @@ SITargetLowering::SITargetLowering(TargetMachine &TM) :
setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v16i32, Expand);
setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v16f32, Expand);
  
-  setOperationAction(ISD::ADD, MVT::i64, Legal);

setOperationAction(ISD::ADD, MVT::i32, Legal);
setOperationAction(ISD::ADDC, MVT::i32, Legal);
setOperationAction(ISD::ADDE, MVT::i32, Legal);
@@ -475,7 +474,6 @@ SDValue SITargetLowering::LowerOperation(SDValue Op, 
SelectionDAG &DAG) const {
SIMachineFunctionInfo *MFI = MF.getInfo();
switch (Op.getOpcode()) {
default: return AMDGPUTargetLowering::LowerOperation(Op, DAG);
-  case ISD::ADD: return LowerADD(Op, DAG);
case ISD::BRCOND: return LowerBRCOND(Op, DAG);
case ISD::LOAD: {
  LoadSDNode *Load = dyn_cast(Op);
@@ -613,33 +611,6 @@ SDValue SITargetLowering::LowerOperation(SDValue Op, 
SelectionDAG &DAG) const {
return SDValue();
  }
  
-SDValue SITargetLowering::LowerADD(SDValue Op,

-   SelectionDAG &DAG) const {
-  if (Op.getValueType() != MVT::i64)
-return SDValue();
-
-  SDLoc DL(Op);
-  SDValue LHS = Op.getOperand(0);
-  SDValue RHS = Op.getOperand(1);
-
-  SDValue Zero = DAG.getConstant(0, MVT::i32);
-  SDValue One = DAG.getConstant(1, MVT::i32);
-
-  SDValue Lo0 = DAG.getNode(ISD::EXTRACT_ELEMENT, DL, MVT::i32, LHS, Zero);
-  SDValue Hi0 = DAG.getNode(ISD::EXTRACT_ELEMENT, DL, MVT::i32, LHS, One);
-
-  SDValue Lo1 = DAG.getNode(ISD::EXTRACT_ELEMENT, DL, MVT::i32, RHS, Zero);
-  SDValue Hi1 = DAG.getNode(ISD::EXTRACT_ELEMENT, DL, MVT::i32, RHS, One);
-
-  SDVTList VTList = DAG.getVTList(MVT::i32, MVT::Glue);
-
-  SDValue AddLo = DAG.getNode(ISD::ADDC, DL, VTList, Lo0, Lo1);
-  SDValue Carry = AddLo.getValue(1);
-  SDValue AddHi = DAG.getNode(ISD::ADDE, DL, VTList, Hi0

[Mesa-dev] [PATCH] glsl: Add locking to builtin_builder singleton

2014-02-08 Thread Daniel Kurtz
Consider a multithreaded program with two contexts A and B, and the
following scenario:

1. Context A calls initialize(), which allocates mem_ctx and starts
   building built-ins.
2. Context B calls initialize(), which sees mem_ctx != NULL and assumes
   everything is already set up.  It returns.
3. Context B calls find(), which fails to find the built-in since it
   hasn't been created yet.
4. Context A finally finishes initializing the built-ins.

This will break at step 3.  Adding a lock ensures that subsequent
callers of initialize() will wait until initialization is actually
complete.

Similarly, if any thread calls release while another thread is still
initializing, or calling find(), the mem_ctx/shader would get free'd while
from under it, leading to corruption or use-after-free crashes.

Fixes sporadic failures in Piglit's glx-multithread-shader-compile as
reported in:
https://bugs.freedesktop.org/69200

Signed-off-by: Kenneth Graunke 
Signed-off-by: Daniel Kurtz 
---
 src/glsl/builtin_functions.cpp | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index aeb8e5d..2162baa 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -4100,6 +4100,7 @@ builtin_builder::_mid3(const glsl_type *type)
 
 /* The singleton instance of builtin_builder. */
 static builtin_builder builtins;
+_glthread_DECLARE_STATIC_MUTEX(builtins_lock);
 
 /**
  * External API (exposing the built-in module to the rest of the compiler):
@@ -4108,20 +4109,28 @@ static builtin_builder builtins;
 void
 _mesa_glsl_initialize_builtin_functions()
 {
+   _glthread_LOCK_MUTEX(builtins_lock);
builtins.initialize();
+   _glthread_UNLOCK_MUTEX(builtins_lock);
 }
 
 void
 _mesa_glsl_release_builtin_functions()
 {
+   _glthread_LOCK_MUTEX(builtins_lock);
builtins.release();
+   _glthread_UNLOCK_MUTEX(builtins_lock);
 }
 
 ir_function_signature *
 _mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state,
  const char *name, exec_list 
*actual_parameters)
 {
-   return builtins.find(state, name, actual_parameters);
+   ir_function_signature * s;
+   _glthread_LOCK_MUTEX(builtins_lock);
+   s = builtins.find(state, name, actual_parameters);
+   _glthread_UNLOCK_MUTEX(builtins_lock);
+   return s;
 }
 
 gl_shader *
-- 
1.9.0.rc1.175.g0b1dcb5

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] "glsl: Vectorize multiple scalar assignments" (mesa 4bd6e0d) breaks League of Legends on wine

2014-02-08 Thread Andrew Guertin

On 02/08/2014 02:41 AM, Matt Turner wrote:

On Fri, Feb 7, 2014 at 10:22 PM, Andrew Guertin  wrote:

Hi,

I updated mesa and started getting some bad behavior in League of Legends
(played through wine). After starting a game, upon hovering any of the skill
buttons, instead of an info tooltip appearing, the whole screen is covered
in grey. Some other problems are visible too, like the options menu missing
most of its text.

I bisected down to

4bd6e0d7c69b304be88996a6c2b96ce7d996e627 is the first bad commit
commit 4bd6e0d7c69b304be88996a6c2b96ce7d996e627
Author: Matt Turner 
Date:   Sat Dec 21 11:28:05 2013 -0800

 glsl: Vectorize multiple scalar assignments

 Reduces vertex shader instruction counts in DOTA2 by 6.42%, L4D2 by
 4.61%, and CS:GO by 5.71%.

 total instructions in shared programs: 1500153 -> 1498191 (-0.13%)
 instructions in affected programs: 59919 -> 57957 (-3.27%)

 Reviewed-by: Ian Romanick 


System info:
CPU: i7-3770
GPU: HD 4000
Kernel: 3.12

I am not subscribed to this mailing list, so please keep me cc'd.

Thanks,
--Andrew


Presumably you have the following commits on top of that, and none of
them affect it?

8e2b8bd0
37f1903e
60654421


Yes, I was up to date with master when I first noticed this, probably 
882e98e5, so all of those were included.



Could you send me (privately) or file a bug report with the output of
the game running with MESA_GLSL=dump ?


I've just spent about an hour trying to do this and failing. I get none 
of the output when running League of Legends. I get output when running 
glxgears, and when running FurMark through wine, but none with LoL. I 
also tried MESA_GLSL=log, which again worked with FurMark but had no 
result with LoL.


--Andrew
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] "glsl: Vectorize multiple scalar assignments" (mesa 4bd6e0d) breaks League of Legends on wine

2014-02-08 Thread Andrew Guertin

Hi,

I updated mesa and started getting some bad behavior in League of 
Legends (played through wine). After starting a game, upon hovering any 
of the skill buttons, instead of an info tooltip appearing, the whole 
screen is covered in grey. Some other problems are visible too, like the 
options menu missing most of its text.


I bisected down to

4bd6e0d7c69b304be88996a6c2b96ce7d996e627 is the first bad commit
commit 4bd6e0d7c69b304be88996a6c2b96ce7d996e627
Author: Matt Turner 
Date:   Sat Dec 21 11:28:05 2013 -0800

glsl: Vectorize multiple scalar assignments

Reduces vertex shader instruction counts in DOTA2 by 6.42%, L4D2 by
4.61%, and CS:GO by 5.71%.

total instructions in shared programs: 1500153 -> 1498191 (-0.13%)
instructions in affected programs: 59919 -> 57957 (-3.27%)

Reviewed-by: Ian Romanick 


System info:
CPU: i7-3770
GPU: HD 4000
Kernel: 3.12

I am not subscribed to this mailing list, so please keep me cc'd.

Thanks,
--Andrew
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 06/13] mesa: allow buffers mapped with the persistent flag to be used by the GPU

2014-02-08 Thread Fredrik Höglund
On Thursday 30 January 2014, Marek Olšák wrote:
> From: Marek Olšák 
> 
> ---
>  src/mesa/main/api_validate.c  |  2 +-
>  src/mesa/main/bufferobj.c | 12 
>  src/mesa/main/bufferobj.h |  8 
>  src/mesa/main/drawpix.c   |  4 ++--
>  src/mesa/main/pbo.c   |  4 ++--
>  src/mesa/main/readpix.c   |  2 +-
>  src/mesa/main/texgetimage.c   |  4 ++--
>  src/mesa/vbo/vbo_exec_array.c |  4 ++--
>  8 files changed, 26 insertions(+), 14 deletions(-)
> 
> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> index 6945584..50fd757 100644
> --- a/src/mesa/main/api_validate.c
> +++ b/src/mesa/main/api_validate.c
> @@ -865,7 +865,7 @@ valid_draw_indirect(struct gl_context *ctx,
>return GL_FALSE;
> }
>  
> -   if (_mesa_bufferobj_mapped(ctx->DrawIndirectBuffer)) {
> +   if (_mesa_check_disallowed_mapping(ctx->DrawIndirectBuffer)) {
>_mesa_error(ctx, GL_INVALID_OPERATION,
>"%s(DRAW_INDIRECT_BUFFER is mapped)", name);
>return GL_FALSE;
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index ca0b5dd..2a642fe 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -269,6 +269,9 @@ buffer_object_subdata_range_good(struct gl_context * ctx, 
> GLenum target,
>return NULL;
> }
>  
> +   if (bufObj->AccessFlags & GL_MAP_PERSISTENT_BIT)
> +  return bufObj;
> +
> if (mappedRange) {
>if (bufferobj_range_mapped(bufObj, offset, size)) {
>   _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
> @@ -1452,7 +1455,7 @@ _mesa_ClearBufferData(GLenum target, GLenum 
> internalformat, GLenum format,
>return;
> }
>  
> -   if (_mesa_bufferobj_mapped(bufObj)) {
> +   if (_mesa_check_disallowed_mapping(bufObj)) {
>_mesa_error(ctx, GL_INVALID_OPERATION,
>"glClearBufferData(buffer currently mapped)");
>return;
> @@ -1861,13 +1864,13 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum 
> writeTarget,
> if (!dst)
>return;
>  
> -   if (_mesa_bufferobj_mapped(src)) {
> +   if (_mesa_check_disallowed_mapping(src)) {
>_mesa_error(ctx, GL_INVALID_OPERATION,
>"glCopyBufferSubData(readBuffer is mapped)");
>return;
> }
>  
> -   if (_mesa_bufferobj_mapped(dst)) {
> +   if (_mesa_check_disallowed_mapping(dst)) {
>_mesa_error(ctx, GL_INVALID_OPERATION,
>"glCopyBufferSubData(writeBuffer is mapped)");
>return;
> @@ -2793,7 +2796,8 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr 
> offset,
>  * mapped by MapBuffer, or if the invalidate range intersects the 
> range
>  * currently mapped by MapBufferRange."
>  */
> -   if (bufferobj_range_mapped(bufObj, offset, length)) {
> +   if (!(bufObj->AccessFlags & GL_MAP_PERSISTENT_BIT) &&
> +   bufferobj_range_mapped(bufObj, offset, length)) {
>_mesa_error(ctx, GL_INVALID_OPERATION,
>"glInvalidateBufferSubData(intersection with mapped "
>"range)");

The mesa_bufferobj_mapped() call in _mesa_InvalidateBufferData() should
also be changed to _mesa_check_disallowed_mapping().

I would also replace the ARB_invalidate_subdata quotations with quotations
from the GL 4.4 specification.

> diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
> index 174fd60..43795a9 100644
> --- a/src/mesa/main/bufferobj.h
> +++ b/src/mesa/main/bufferobj.h
> @@ -44,6 +44,14 @@ _mesa_bufferobj_mapped(const struct gl_buffer_object *obj)
> return obj->Pointer != NULL;
>  }
>  
> +/** Cannot we use this buffer while mapped? */

"Can we not"

> +static inline GLboolean
> +_mesa_check_disallowed_mapping(const struct gl_buffer_object *obj)
> +{
> +   return _mesa_bufferobj_mapped(obj) &&
> +  !(obj->AccessFlags & GL_MAP_PERSISTENT_BIT);
> +}
> +
>  /**
>   * Is the given buffer object a user-created buffer object?
>   * Mesa uses default buffer objects in several places.  Default buffers
> diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
> index 096615c..63e5870 100644
> --- a/src/mesa/main/drawpix.c
> +++ b/src/mesa/main/drawpix.c
> @@ -151,7 +151,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
> "glDrawPixels(invalid PBO access)");
> goto end;
>  }
> -if (_mesa_bufferobj_mapped(ctx->Unpack.BufferObj)) {
> +if (_mesa_check_disallowed_mapping(ctx->Unpack.BufferObj)) {
> /* buffer is mapped - that's an error */
> _mesa_error(ctx, GL_INVALID_OPERATION,
> "glDrawPixels(PBO is mapped)");
> @@ -335,7 +335,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
> "glBitmap(invalid PBO access)");
> return;
>  }
> -if (_mesa_bufferobj_mapped(ctx->Unpack.BufferObj)) {
> +if (_mesa_check_disallowed_mapping

Re: [Mesa-dev] [PATCH 3/3] mesa: allocate gl_debug_state on demand

2014-02-08 Thread Kenneth Graunke
On 02/07/2014 04:43 PM, Brian Paul wrote:
> We don't need to allocate all the state related to GL_ARB_debug_output
> until some aspect of that extension is actually needed.
> 
> The sizeof(gl_debug_state) is huge (~285KB on 64-bit systems), not even
> counting the 54(!) hash tables and lists that it contains.  This change
> reduces the size of gl_context alone from 431KB bytes to 145KB bytes on
> 64-bit systems and from 277KB bytes to 78KB bytes on 32-bit systems.
> ---
>  src/mesa/drivers/dri/common/dri_util.c |6 +-
>  src/mesa/main/enable.c |   33 +++-
>  src/mesa/main/errors.c |  331 
> +++-
>  src/mesa/main/errors.h |3 +
>  src/mesa/main/get.c|   21 ++
>  src/mesa/main/get_hash_params.py   |6 +-
>  src/mesa/main/getstring.c  |   16 +-
>  src/mesa/main/mtypes.h |2 +-
>  src/mesa/state_tracker/st_manager.c|9 +-
>  9 files changed, 274 insertions(+), 153 deletions(-)

This looks okay to me.  Thanks for doing this!

All three patches are:
Reviewed-by: Kenneth Graunke 




signature.asc
Description: OpenPGP digital signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 02/22] targets/pipe-loader: automake: drop obsolete version-script

2014-02-08 Thread Matt Turner
The purpose of this version script looks to be related to static
builds, but in your cover letter you said  you were building with
shared LLVM libraries. Does this affect static builds?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 12/22] targets/egl-static: automake: drop obsolete version-script

2014-02-08 Thread Matt Turner
Same question as before about static builds.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 16/22] targets/dri: automake: add test for exported symbols

2014-02-08 Thread Matt Turner
On Sat, Feb 8, 2014 at 8:04 AM, Emil Velikov  wrote:
> dri targets should export the following
>  - __driDriverExtensions
>  - __dri2ConfigOptions
> and
>  - *winsys_create > for gl-vdpau interop
>
> Signed-off-by: Emil Velikov 
> ---
>  src/gallium/Automake.inc |  1 -
>  src/gallium/targets/dri-i915/Makefile.am |  5 +
>  src/gallium/targets/dri-ilo/Makefile.am  |  5 +
>  src/gallium/targets/dri-nouveau/Makefile.am  |  6 ++
>  src/gallium/targets/dri-swrast/Makefile.am   |  5 +
>  src/gallium/targets/dri-symbols-check| 15 +++
>  src/gallium/targets/dri-vmwgfx/Makefile.am   |  5 +
>  src/gallium/targets/r300/dri/Makefile.am |  6 ++
>  src/gallium/targets/r600/dri/Makefile.am |  6 ++
>  src/gallium/targets/radeonsi/dri/Makefile.am |  6 ++
>  10 files changed, 59 insertions(+), 1 deletion(-)
>  create mode 100755 src/gallium/targets/dri-symbols-check
>
> diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
> index 57ac9fd..0ba7e57 100644
> --- a/src/gallium/Automake.inc
> +++ b/src/gallium/Automake.inc
> @@ -51,7 +51,6 @@ GALLIUM_VIDEO_CFLAGS = \
> $(VISIBILITY_CFLAGS)
>
>
> -# TODO: add -export-symbols-regex
>  GALLIUM_DRI_LINKER_FLAGS = \
> -module \
> -avoid-version \
> diff --git a/src/gallium/targets/dri-i915/Makefile.am 
> b/src/gallium/targets/dri-i915/Makefile.am
> index 3f8468f..1155b8b 100644
> --- a/src/gallium/targets/dri-i915/Makefile.am
> +++ b/src/gallium/targets/dri-i915/Makefile.am
> @@ -59,6 +59,11 @@ AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
>  i915_dri_la_LIBADD += 
> $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
>  endif
>
> +AM_TESTS_ENVIRONMENT = \
> +   export TARGET=i915;
> +
> +TESTS = ../dri-symbols-check

Does this work for out of tree builds?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 21/22] automake: fold VISIBILITY_CFLAGS within DEFINES

2014-02-08 Thread Matt Turner
On Sat, Feb 8, 2014 at 8:04 AM, Emil Velikov  wrote:
> Most places in mesa requires explicit VISIBILITY_CFLAGS causing
> some headache when introducing new build components and managing
> existing ones. Move to inconditionally hide all symbols and make
> sure we explicitly set the ones that need to be public.

DEFINES currently consists of only, well, -D... defines. I don't think
we should repurpose it for this and start adding CFLAGS/CXXFLAGS to
it.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/22] Exported symbols cleanup and tests

2014-02-08 Thread Matt Turner
On Sat, Feb 8, 2014 at 8:03 AM, Emil Velikov  wrote:
>

I sent questions about patches 2, 12, 16 (which also applies to 17,
and maybe some others). I don't think we should do patch 20, and I
barely know what OpenMAX is for 21 and 22.

1, 3-11, 13-19 are (assuming in and out of tree builds work)

Reviewed-by: Matt Turner 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 74717] r600g: 'invalid read' linking geometry shader

2014-02-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=74717

Andreas Boll  changed:

   What|Removed |Added

 CC||andreas.boll@gmail.com,
   ||mesa-dev@lists.freedesktop.
   ||org

--- Comment #1 from Andreas Boll  ---
I have replayed your trace and I get the following failing assertion. (mesa is
compiled with --enable-debug)

glretrace: ../../src/glsl/ir.cpp:170:
ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*, unsigned
int): Assertion `lhs_components == this->rhs->type->vector_elements' failed.



OpenGL renderer string: Gallium 0.4 on AMD BARTS
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.2.0-devel
(git-6e8d04a)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.2.0-devel (git-6e8d04a)
OpenGL shading language version string: 1.30

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 74723] New: main/shaderapi.c:407: detach_shader: Assertion `shProg->Shaders[j]->Type == 0x8B31 || shProg->Shaders[j]->Type == 0x8B30' failed.

2014-02-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=74723

  Priority: medium
Bug ID: 74723
  Assignee: mesa-dev@lists.freedesktop.org
   Summary: main/shaderapi.c:407: detach_shader: Assertion
`shProg->Shaders[j]->Type == 0x8B31 ||
shProg->Shaders[j]->Type == 0x8B30' failed.
  Severity: normal
Classification: Unclassified
OS: All
  Reporter: andreas.boll@gmail.com
  Hardware: Other
Status: NEW
   Version: git
 Component: Mesa core
   Product: Mesa

I get this failing assertion when replaying the trace file (attachment 93670)
from bug 74718

mesa is compiled with --enable-debug


Tested with:
llvmpipe with MESA_GLSL_VERSION_OVERRIDE=330 MESA_GL_VERSION_OVERRIDE=3.3

and with r600g
OpenGL renderer string: Gallium 0.4 on AMD BARTS
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.2.0-devel
(git-6e8d04a)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.2.0-devel (git-6e8d04a)
OpenGL shading language version string: 1.30

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 02/22] targets/pipe-loader: automake: drop obsolete version-script

2014-02-08 Thread Emil Velikov
On 08/02/14 17:53, Matt Turner wrote:
> The purpose of this version script looks to be related to static
> builds, but in your cover letter you said  you were building with
> shared LLVM libraries. Does this affect static builds?
> 
Unfortunately it does. For static builds the version script prevents us
to export _all_ of llvm api.

This rule applies to pretty much everything that is linked with llvm,
and it's not confined within part of mesa. Other projects are
experiencing the same problem when static linking.

I'm assuming that your idea is to keep the version scripts until the
whole mess is resolved. I kind of which that we drop the build option
and always use shared libraries/build.


Tom, Francisco
Considering that you guys are the primary people working with
llvm<>mesa would you have any comments on dropping mesa support for
static linking against llvm ?

Thanks
-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 16/22] targets/dri: automake: add test for exported symbols

2014-02-08 Thread Emil Velikov
On 08/02/14 19:13, Matt Turner wrote:
> On Sat, Feb 8, 2014 at 8:04 AM, Emil Velikov  wrote:
>> dri targets should export the following
>>  - __driDriverExtensions
>>  - __dri2ConfigOptions
>> and
>>  - *winsys_create > for gl-vdpau interop
>>
>> Signed-off-by: Emil Velikov 
>> ---
>>  src/gallium/Automake.inc |  1 -
>>  src/gallium/targets/dri-i915/Makefile.am |  5 +
>>  src/gallium/targets/dri-ilo/Makefile.am  |  5 +
>>  src/gallium/targets/dri-nouveau/Makefile.am  |  6 ++
>>  src/gallium/targets/dri-swrast/Makefile.am   |  5 +
>>  src/gallium/targets/dri-symbols-check| 15 +++
>>  src/gallium/targets/dri-vmwgfx/Makefile.am   |  5 +
>>  src/gallium/targets/r300/dri/Makefile.am |  6 ++
>>  src/gallium/targets/r600/dri/Makefile.am |  6 ++
>>  src/gallium/targets/radeonsi/dri/Makefile.am |  6 ++
>>  10 files changed, 59 insertions(+), 1 deletion(-)
>>  create mode 100755 src/gallium/targets/dri-symbols-check
>>
>> diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
>> index 57ac9fd..0ba7e57 100644
>> --- a/src/gallium/Automake.inc
>> +++ b/src/gallium/Automake.inc
>> @@ -51,7 +51,6 @@ GALLIUM_VIDEO_CFLAGS = \
>> $(VISIBILITY_CFLAGS)
>>
>>
>> -# TODO: add -export-symbols-regex
>>  GALLIUM_DRI_LINKER_FLAGS = \
>> -module \
>> -avoid-version \
>> diff --git a/src/gallium/targets/dri-i915/Makefile.am 
>> b/src/gallium/targets/dri-i915/Makefile.am
>> index 3f8468f..1155b8b 100644
>> --- a/src/gallium/targets/dri-i915/Makefile.am
>> +++ b/src/gallium/targets/dri-i915/Makefile.am
>> @@ -59,6 +59,11 @@ AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
>>  i915_dri_la_LIBADD += 
>> $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
>>  endif
>>
>> +AM_TESTS_ENVIRONMENT = \
>> +   export TARGET=i915;
>> +
>> +TESTS = ../dri-symbols-check
> 
> Does this work for out of tree builds?
> 
Initially I used ${top_srcdir}, but it seems like automake does not like
it wrt tests. And yes, all of the tests pass (apart from two st/xvmc
tests unrelated to this series) and are conducted on a OOT build.

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 21/22] automake: fold VISIBILITY_CFLAGS within DEFINES

2014-02-08 Thread Emil Velikov
On 08/02/14 19:22, Matt Turner wrote:
> On Sat, Feb 8, 2014 at 8:04 AM, Emil Velikov  wrote:
>> Most places in mesa requires explicit VISIBILITY_CFLAGS causing
>> some headache when introducing new build components and managing
>> existing ones. Move to inconditionally hide all symbols and make
>> sure we explicitly set the ones that need to be public.
> 
> DEFINES currently consists of only, well, -D... defines. I don't think
> we should repurpose it for this and start adding CFLAGS/CXXFLAGS to
> it.
> 
Fair enough. I was hoping that we can kill all the silly symbols in
glapi (amongst others) quick and easy. Oh well, that will be done some
other day.

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] nouveau/video: make sure that firmware is present when checking caps

2014-02-08 Thread Ilia Mirkin
Apparently some players are ill-prepared for us claiming that a decoder
exists only to have creating it fail, and express this poor preparation
with crashes (e.g. flash). Check that firmware is there to increase the
chances of there being a high correlation between reported capabilities
and ability to create a decoder.

Signed-off-by: Ilia Mirkin 
Cc: 10.0 10.1 
Tested-by: Emil Velikov 
---

Have to create a new channel on kepler, otherwise it doesn't work... Emil, I'm
keeping your tested-by since you tested the nv84_video bits which haven't
changed.

 src/gallium/drivers/nouveau/nouveau_screen.h|  5 ++
 src/gallium/drivers/nouveau/nouveau_vp3_video.c | 78 -
 src/gallium/drivers/nouveau/nv50/nv84_video.c   | 68 -
 3 files changed, 147 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_screen.h 
b/src/gallium/drivers/nouveau/nouveau_screen.h
index 7f15d10..51e24fa 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.h
+++ b/src/gallium/drivers/nouveau/nouveau_screen.h
@@ -49,6 +49,11 @@ struct nouveau_screen {
 
boolean hint_buf_keep_sysmem_copy;
 
+   struct {
+   unsigned profiles_checked;
+   unsigned profiles_present;
+   } firmware_info;
+
 #ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
union {
   uint64_t v[29];
diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.c 
b/src/gallium/drivers/nouveau/nouveau_vp3_video.c
index ff00b37..11cf729 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video.c
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.c
@@ -21,6 +21,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
@@ -350,6 +351,77 @@ nouveau_vp3_load_firmware(struct nouveau_vp3_decoder *dec,
return 0;
 }
 
+static int
+firmware_present(struct pipe_screen *pscreen, enum pipe_video_profile profile)
+{
+   struct nouveau_screen *screen = nouveau_screen(pscreen);
+   int chipset = screen->device->chipset;
+   int vp3 = chipset < 0xa3 || chipset == 0xaa || chipset == 0xac;
+   int vp5 = chipset >= 0xd0;
+   int ret;
+
+   /* For all chipsets, try to create a BSP objects. Assume that if firmware
+* is present for it, firmware is also present for VP/PPP */
+   if (!(screen->firmware_info.profiles_checked & 1)) {
+  struct nouveau_object *channel = NULL, *bsp = NULL;
+  struct nv04_fifo nv04_data = {.vram = 0xbeef0201, .gart = 0xbeef0202};
+  struct nvc0_fifo nvc0_args = {};
+  struct nve0_fifo nve0_args = {.engine = NVE0_FIFO_ENGINE_BSP};
+  void *data = NULL;
+  int size, oclass;
+  if (chipset < 0xc0)
+ oclass = 0x85b1;
+  else if (vp5)
+ oclass = 0x95b1;
+  else
+ oclass = 0x90b1;
+
+  if (chipset < 0xc0) {
+ data = &nv04_data;
+ size = sizeof(nv04_data);
+  } else if (chipset < 0xe0) {
+ data = &nvc0_args;
+ size = sizeof(nvc0_args);
+  } else {
+ data = &nve0_args;
+ size = sizeof(nve0_args);
+  }
+
+  /* kepler must have its own channel, so just do this for everyone */
+  nouveau_object_new(&screen->device->object, 0,
+ NOUVEAU_FIFO_CHANNEL_CLASS,
+ data, size, &channel);
+
+  if (channel) {
+ nouveau_object_new(channel, 0, oclass, NULL, 0, &bsp);
+ if (bsp)
+screen->firmware_info.profiles_present |= 1;
+ nouveau_object_del(&bsp);
+ nouveau_object_del(&channel);
+  }
+  screen->firmware_info.profiles_checked |= 1;
+   }
+
+   if (!(screen->firmware_info.profiles_present & 1))
+  return 0;
+
+   /* For vp3/vp4 chipsets, make sure that the relevant firmware is present */
+   if (!vp5 && !(screen->firmware_info.profiles_checked & (1 << profile))) {
+  char path[PATH_MAX];
+  struct stat s;
+  if (vp3)
+ vp3_getpath(profile, path);
+  else
+ vp4_getpath(profile, path);
+  ret = stat(path, &s);
+  if (!ret && s.st_size > 1000)
+ screen->firmware_info.profiles_present |= (1 << profile);
+  screen->firmware_info.profiles_checked |= (1 << profile);
+   }
+
+   return vp5 || (screen->firmware_info.profiles_present & (1 << profile));
+}
+
 int
 nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen,
enum pipe_video_profile profile,
@@ -363,8 +435,10 @@ nouveau_vp3_screen_get_video_param(struct pipe_screen 
*pscreen,
switch (param) {
case PIPE_VIDEO_CAP_SUPPORTED:
   /* VP3 does not support MPEG4, VP4+ do. */
-  return profile >= PIPE_VIDEO_PROFILE_MPEG1 && (
-!vp3 || codec != PIPE_VIDEO_FORMAT_MPEG4);
+  return entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM &&
+ profile >= PIPE_VIDEO_PROFILE_MPEG1 &&
+ (!vp3 || codec != PIPE_VIDEO_FORMAT_MPEG4) &&
+ firmware_present(pscreen, profile);
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
   return 1;
case PIPE_VIDEO_CAP_MAX_WIDTH:
diff --git a/s

Re: [Mesa-dev] [PATCH 00/22] Exported symbols cleanup and tests

2014-02-08 Thread Emil Velikov
On 08/02/14 19:24, Matt Turner wrote:
> On Sat, Feb 8, 2014 at 8:03 AM, Emil Velikov  wrote:
>>
> 
> I sent questions about patches 2, 12, 16 (which also applies to 17,
> and maybe some others). I don't think we should do patch 20, and I
> barely know what OpenMAX is for 21 and 22.
> 
> 1, 3-11, 13-19 are (assuming in and out of tree builds work)
> 
> Reviewed-by: Matt Turner 
> 
Thanks for the quick review Matt, I'm assuming that you mean 19 and 22
wrt omx, but I guess Christian will be able to check those out.

I'll hold on these until consensus is made on the "building mesa
statically with llvm" topic, as some of these depend on the outcome.

Cheers
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 74723] main/shaderapi.c:407: detach_shader: Assertion `shProg->Shaders[j]->Type == 0x8B31 || shProg->Shaders[j]->Type == 0x8B30' failed.

2014-02-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=74723

--- Comment #1 from Andreas Boll  ---
Created attachment 93675
  --> https://bugs.freedesktop.org/attachment.cgi?id=93675&action=edit
bt full

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] gallium: add geometry shader output limits

2014-02-08 Thread Andreas Boll
Candidate for 10.1 ?

2014-02-08 14:02 GMT+01:00 Grigori Goronzy :
> v2: adjust limits for radeonsi and llvmpipe
> ---
>  src/gallium/drivers/freedreno/freedreno_screen.c | 5 +
>  src/gallium/drivers/i915/i915_screen.c   | 5 +
>  src/gallium/drivers/ilo/ilo_screen.c | 3 +++
>  src/gallium/drivers/llvmpipe/lp_screen.c | 3 +++
>  src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 2 ++
>  src/gallium/drivers/nouveau/nv50/nv50_screen.c   | 3 +++
>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   | 3 +++
>  src/gallium/drivers/r300/r300_screen.c   | 2 ++
>  src/gallium/drivers/r600/r600_pipe.c | 6 ++
>  src/gallium/drivers/radeonsi/si_pipe.c   | 6 ++
>  src/gallium/drivers/softpipe/sp_screen.c | 3 +++
>  src/gallium/drivers/svga/svga_screen.c   | 2 ++
>  src/gallium/include/pipe/p_defines.h | 4 +++-
>  src/mesa/state_tracker/st_extensions.c   | 2 ++
>  14 files changed, 48 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
> b/src/gallium/drivers/freedreno/freedreno_screen.c
> index aa294b3..e1b5dae 100644
> --- a/src/gallium/drivers/freedreno/freedreno_screen.c
> +++ b/src/gallium/drivers/freedreno/freedreno_screen.c
> @@ -212,6 +212,11 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum 
> pipe_cap param)
> case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
> return 0;
>
> +   /* Geometry shader output, unsupported. */
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> +   return 0;
> +
> /* Texturing. */
> case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
> case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
> diff --git a/src/gallium/drivers/i915/i915_screen.c 
> b/src/gallium/drivers/i915/i915_screen.c
> index a658b1b..9f08f86 100644
> --- a/src/gallium/drivers/i915/i915_screen.c
> +++ b/src/gallium/drivers/i915/i915_screen.c
> @@ -257,6 +257,11 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
> cap)
> case PIPE_CAP_MAX_RENDER_TARGETS:
>return 1;
>
> +   /* Geometry shader output, unsupported. */
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> +  return 0;
> +
> /* Fragment coordinate conventions. */
> case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
> case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
> diff --git a/src/gallium/drivers/ilo/ilo_screen.c 
> b/src/gallium/drivers/ilo/ilo_screen.c
> index bc8f62d..9c363ac 100644
> --- a/src/gallium/drivers/ilo/ilo_screen.c
> +++ b/src/gallium/drivers/ilo/ilo_screen.c
> @@ -372,6 +372,9 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap 
> param)
>return ILO_MAX_SO_BINDINGS / ILO_MAX_SO_BUFFERS;
> case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
>return ILO_MAX_SO_BINDINGS;
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> +  return 0;
> case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>if (is->dev.gen >= ILO_GEN(7))
>   return is->dev.has_gen7_sol_reset;
> diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
> b/src/gallium/drivers/llvmpipe/lp_screen.c
> index 3f84d74..43142e7 100644
> --- a/src/gallium/drivers/llvmpipe/lp_screen.c
> +++ b/src/gallium/drivers/llvmpipe/lp_screen.c
> @@ -187,6 +187,9 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
> pipe_cap param)
> case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
> case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
>return 16*4;
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> +  return 1024;
> case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>return 1;
> case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c 
> b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> index 787802d..9e2a90c 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> @@ -106,6 +106,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum 
> pipe_cap param)
> case PIPE_CAP_MAX_TEXEL_OFFSET:
> case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
> case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
> case PIPE_CAP_TEXTURE_BARRIER:
> case PIPE_CAP_SEAMLESS_CUBE_MAP:
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c 
> b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> index 2b6ec3a..a740adf 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> @@ -141,6 +141,9 @@ nv50_screen_get_param(struct p

[Mesa-dev] [Bug 74723] main/shaderapi.c:407: detach_shader: Assertion `shProg->Shaders[j]->Type == 0x8B31 || shProg->Shaders[j]->Type == 0x8B30' failed.

2014-02-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=74723

--- Comment #2 from Brian Paul  ---
Created attachment 93676
  --> https://bugs.freedesktop.org/attachment.cgi?id=93676&action=edit
update assertion for GS

Can you try this patch?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 74723] main/shaderapi.c:407: detach_shader: Assertion `shProg->Shaders[j]->Type == 0x8B31 || shProg->Shaders[j]->Type == 0x8B30' failed.

2014-02-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=74723

--- Comment #3 from Andreas Boll  ---
Tested-by: Andreas Boll 

Candidate for stable?

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 74723] main/shaderapi.c:407: detach_shader: Assertion `shProg->Shaders[j]->Type == 0x8B31 || shProg->Shaders[j]->Type == 0x8B30' failed.

2014-02-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=74723

--- Comment #4 from Brian Paul  ---
(In reply to comment #3)
> Tested-by: Andreas Boll 
> 
> Candidate for stable?
> 
> Thanks!

Yes, I'll tag it for 10.0 and 10.1

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 74723] main/shaderapi.c:407: detach_shader: Assertion `shProg->Shaders[j]->Type == 0x8B31 || shProg->Shaders[j]->Type == 0x8B30' failed.

2014-02-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=74723

Brian Paul  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Brian Paul  ---
Fixed in commit c325ec896545cc909f2f0e359f0bb0513a8a53b5

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] gallium: add geometry shader output limits

2014-02-08 Thread Marek Olšák
Please document the new caps in gallium/docs/../screen.rst.

Thank you.

Marek

On Sat, Feb 8, 2014 at 2:02 PM, Grigori Goronzy  wrote:
> v2: adjust limits for radeonsi and llvmpipe
> ---
>  src/gallium/drivers/freedreno/freedreno_screen.c | 5 +
>  src/gallium/drivers/i915/i915_screen.c   | 5 +
>  src/gallium/drivers/ilo/ilo_screen.c | 3 +++
>  src/gallium/drivers/llvmpipe/lp_screen.c | 3 +++
>  src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 2 ++
>  src/gallium/drivers/nouveau/nv50/nv50_screen.c   | 3 +++
>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   | 3 +++
>  src/gallium/drivers/r300/r300_screen.c   | 2 ++
>  src/gallium/drivers/r600/r600_pipe.c | 6 ++
>  src/gallium/drivers/radeonsi/si_pipe.c   | 6 ++
>  src/gallium/drivers/softpipe/sp_screen.c | 3 +++
>  src/gallium/drivers/svga/svga_screen.c   | 2 ++
>  src/gallium/include/pipe/p_defines.h | 4 +++-
>  src/mesa/state_tracker/st_extensions.c   | 2 ++
>  14 files changed, 48 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
> b/src/gallium/drivers/freedreno/freedreno_screen.c
> index aa294b3..e1b5dae 100644
> --- a/src/gallium/drivers/freedreno/freedreno_screen.c
> +++ b/src/gallium/drivers/freedreno/freedreno_screen.c
> @@ -212,6 +212,11 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum 
> pipe_cap param)
> case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
> return 0;
>
> +   /* Geometry shader output, unsupported. */
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> +   return 0;
> +
> /* Texturing. */
> case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
> case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
> diff --git a/src/gallium/drivers/i915/i915_screen.c 
> b/src/gallium/drivers/i915/i915_screen.c
> index a658b1b..9f08f86 100644
> --- a/src/gallium/drivers/i915/i915_screen.c
> +++ b/src/gallium/drivers/i915/i915_screen.c
> @@ -257,6 +257,11 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
> cap)
> case PIPE_CAP_MAX_RENDER_TARGETS:
>return 1;
>
> +   /* Geometry shader output, unsupported. */
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> +  return 0;
> +
> /* Fragment coordinate conventions. */
> case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
> case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
> diff --git a/src/gallium/drivers/ilo/ilo_screen.c 
> b/src/gallium/drivers/ilo/ilo_screen.c
> index bc8f62d..9c363ac 100644
> --- a/src/gallium/drivers/ilo/ilo_screen.c
> +++ b/src/gallium/drivers/ilo/ilo_screen.c
> @@ -372,6 +372,9 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap 
> param)
>return ILO_MAX_SO_BINDINGS / ILO_MAX_SO_BUFFERS;
> case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
>return ILO_MAX_SO_BINDINGS;
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> +  return 0;
> case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>if (is->dev.gen >= ILO_GEN(7))
>   return is->dev.has_gen7_sol_reset;
> diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
> b/src/gallium/drivers/llvmpipe/lp_screen.c
> index 3f84d74..43142e7 100644
> --- a/src/gallium/drivers/llvmpipe/lp_screen.c
> +++ b/src/gallium/drivers/llvmpipe/lp_screen.c
> @@ -187,6 +187,9 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
> pipe_cap param)
> case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
> case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
>return 16*4;
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> +  return 1024;
> case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>return 1;
> case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c 
> b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> index 787802d..9e2a90c 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> @@ -106,6 +106,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum 
> pipe_cap param)
> case PIPE_CAP_MAX_TEXEL_OFFSET:
> case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
> case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
> +   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> +   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
> case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
> case PIPE_CAP_TEXTURE_BARRIER:
> case PIPE_CAP_SEAMLESS_CUBE_MAP:
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c 
> b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> index 2b6ec3a..a740adf 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> +++ b/src/gallium/drivers/nouveau/nv

[Mesa-dev] [Bug 74717] r600g: 'invalid read' linking geometry shader

2014-02-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=74717

--- Comment #2 from Török Edwin  ---
(In reply to comment #1)
> I have replayed your trace and I get the following failing assertion. (mesa
> is compiled with --enable-debug)
> 
> glretrace: ../../src/glsl/ir.cpp:170:
> ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*,
> unsigned int): Assertion `lhs_components ==
> this->rhs->type->vector_elements' failed.

I can confirm that I get the same assertion when running the original program,
see backtrace below:

OpenGL Version Needed 3.2 ( 3.3 Found )
Compiling shader
gl-320/primitive-shading.vert...

Compiling shader
gl-320/primitive-shading.geom...

Compiling shader
gl-320/primitive-shading.frag...

gl-320-primitive-shading: ../../src/glsl/ir.cpp:170:
ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*, unsigned
int): Assertion `lhs_components == this->rhs->type->vector_elements' failed.

Program received signal SIGABRT, Aborted.
0x00382c4351d5 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00382c4351d5 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00382c438388 in __GI_abort () at abort.c:90
#2  0x00382c42e252 in __assert_fail_base (fmt=0x382c56c080 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", 
assertion=assertion@entry=0x770d6cb8 "lhs_components ==
this->rhs->type->vector_elements", 
file=file@entry=0x770d6c57 "../../src/glsl/ir.cpp",
line=line@entry=170, 
function=function@entry=0x770d7960
 "ir_assignment::ir_assignment(ir_dereference*,
ir_rvalue*, ir_rvalue*, unsigned int)") at assert.c:92
#3  0x00382c42e302 in __GI___assert_fail (assertion=0x770d6cb8
"lhs_components == this->rhs->type->vector_elements", 
file=0x770d6c57 "../../src/glsl/ir.cpp", line=170, 
function=0x770d7960 
"ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*, unsigned
int)") at assert.c:101
#4  0x765950c1 in ir_assignment::ir_assignment (this=0xa4f8f0,
lhs=0xa4f250, rhs=0xa4f3a0, condition=0x0, write_mask=15)
at ../../src/glsl/ir.cpp:170
#5  0x7659b9b7 in ir_assignment::clone (this=0xa42880,
mem_ctx=0x79f4e0, ht=0xa4ef50) at ../../src/glsl/ir_clone.cpp:271
#6  0x7659bfcf in clone_ir_list (mem_ctx=0x79f4e0, out=0x7fffd8e0,
in=0xa41f60) at ../../src/glsl/ir_clone.cpp:432
#7  0x765bffe5 in (anonymous
namespace)::loop_unroll_visitor::simple_unroll (this=0x7fffdba0,
ir=0xa41f40, 
iterations=3) at ../../src/glsl/loop_unroll.cpp:112
#8  0x765c03ae in (anonymous
namespace)::loop_unroll_visitor::visit_leave (this=0x7fffdba0, ir=0xa41f40)
at ../../src/glsl/loop_unroll.cpp:270
#9  0x765a5633 in ir_loop::accept (this=0xa41f40, v=0x7fffdba0) at
../../src/glsl/ir_hv_accept.cpp:94
#10 0x765a5505 in visit_list_elements (v=0x7fffdba0, l=0xa41b38,
statement_list=true)
at ../../src/glsl/ir_hv_accept.cpp:56
#11 0x765a56f5 in ir_function_signature::accept (this=0xa41af0,
v=0x7fffdba0) at ../../src/glsl/ir_hv_accept.cpp:116
#12 0x765a5505 in visit_list_elements (v=0x7fffdba0, l=0xa41a58,
statement_list=false)
at ../../src/glsl/ir_hv_accept.cpp:56
#13 0x765a5789 in ir_function::accept (this=0xa41a30, v=0x7fffdba0)
at ../../src/glsl/ir_hv_accept.cpp:128
#14 0x765a5505 in visit_list_elements (v=0x7fffdba0, l=0xa3d400,
statement_list=true)
at ../../src/glsl/ir_hv_accept.cpp:56
#15 0x765a5426 in ir_hierarchical_visitor::run (this=0x7fffdba0,
instructions=0xa3d400)
at ../../src/glsl/ir_hierarchical_visitor.cpp:309
#16 0x765c065d in unroll_loops (instructions=0xa3d400, ls=0xa4f3f0,
max_iterations=255)
at ../../src/glsl/loop_unroll.cpp:345
#17 0x76591377 in do_common_optimization (ir=0xa3d400, linked=true,
uniform_locations_assigned=false, 
max_unroll_iterations=255, options=0x753a6eec) at
../../src/glsl/glsl_parser_extras.cpp:1507
#18 0x765bd46b in link_shaders (ctx=0x75385010, prog=0xa30aa0) at
../../src/glsl/linker.cpp:2172
#19 0x764f37b7 in _mesa_glsl_link_shader (ctx=0x75385010,
prog=0xa30aa0) at program/ir_to_mesa.cpp:3087
#20 0x763f97c0 in link_program (ctx=0x75385010, program=4) at
main/shaderapi.c:873
#21 0x763fa592 in _mesa_LinkProgram (programObj=4) at
main/shaderapi.c:1333
#22 0x00436ea4 in initProgram() ()
#23 0x004372f1 in begin() ()
#24 0x00438ecb in glf::run(int, char**, glm::detail::tvec2 const&, int, int, int) ()

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 74727] New: Mesa 10.1: doesn't build with DRI3 enabled

2014-02-08 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=74727

  Priority: medium
Bug ID: 74727
  Assignee: mesa-dev@lists.freedesktop.org
   Summary: Mesa 10.1: doesn't build with DRI3 enabled
  Severity: normal
Classification: Unclassified
OS: All
  Reporter: edwin+m...@etorok.net
  Hardware: Other
Status: NEW
   Version: git
 Component: GLX
   Product: Mesa

If I want to build Mesa 10.1 branch with DRI3 enabled (the default), it fails.
I have to use --disable-dri3 to be able to build Mesa.

I have the following package versions installed, are they too old?
ii  libxcb-dri3-0:amd641.10-2 amd64
   X C Binding, dri3 extension
ii  libxcb-dri3-dev:amd64  1.10-2 amd64
   X C Binding, dri3 extension, development files
ii  x11proto-dri3-dev  1.0-1  all  
   X11 DRI3 extension wire protocol


$ ./configure --enable-dri --enable-glx-tls --enable-shared-glapi
--enable-texture-float --enable-xa --disable-xvmc --disable-vdpau
--with-gallium-drivers=r600,swrast LLVM_CONFIG=/usr/bin/llvm-config-3.4 
--enable-debug
[... this succeeds]
prefix:  /usr/local
exec_prefix: ${prefix}
libdir:  ${exec_prefix}/lib
includedir:  ${prefix}/include

OpenGL:  yes (ES1: no ES2: no)
OpenVG:  no

OSMesa:  no
DRI drivers: i915 i965 nouveau r200 radeon swrast
DRI driver dir:  ${libdir}/dri
GLX: DRI-based

EGL: yes
EGL platforms:   x11
EGL drivers: builtin:egl_glx builtin:egl_dri2

llvm:yes
llvm-config: /usr/bin/llvm-config-3.4
llvm-version:3.4

Gallium: yes
Target dirs: dri-swrast r600/dri 
Winsys dirs: radeon/drm sw sw/dri 
Driver dirs: galahad identity llvmpipe noop r600 rbug softpipe
trace 
Trackers dirs:   dri xa 

Shared libs: yes
Static libs: no
Shared-glapi:yes

CFLAGS:  -g -O2 -Wall -std=c99
-Werror=implicit-function-declaration -Werror=missing-prototypes
-fno-strict-aliasing -fno-builtin-memcmp -g -O0
CXXFLAGS:-g -O2 -Wall -fno-strict-aliasing -fno-builtin-memcmp
-g -O0
Macros:  -D_GNU_SOURCE -DHAVE_PTHREAD -DDEBUG
-DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN
-DHAVE_LIBDRM -DHAVE_LIBUDEV -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING
-DGLX_USE_TLS -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1 -DHAVE_ALIAS -DHAVE_DRI3
-DHAVE_MINCORE -DHAVE_LLVM=0x0304

LLVM_CFLAGS: -I/usr/lib/llvm-3.4/include  -D_GNU_SOURCE
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
LLVM_CXXFLAGS:   -I/usr/lib/llvm-3.4/include  -D_GNU_SOURCE
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS   
-fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual
-Wcast-qual
LLVM_CPPFLAGS:   -I/usr/lib/llvm-3.4/include  -D_GNU_SOURCE
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

PYTHON2: python2

Run 'make' to build Mesa
$ make 
[...]

make[3]: Entering directory `/home/edwin/HDD/me/language/C++/mesa/src/glx'
  CC   dri3_glx.lo
In file included from dri3_glx.c:66:0:
/usr/include/xcb/present.h:18:19: fatal error: randr.h: No such file or
directory
 #include "randr.h"
   ^
compilation terminated.
make[3]: *** [dri3_glx.lo] Error 1

FWIW randr.h is in /usr/include/X11/extensions/randr.h.

If I add a CPPFLAGS=-I/usr/include/X11/extensions I get a different error:
make[3]: Entering directory `/home/edwin/HDD/me/language/C++/mesa/src/glx'
  CC   dri3_glx.lo
In file included from dri3_glx.c:66:0:
/usr/include/xcb/present.h:139:5: error: unknown type name 'xcb_randr_crtc_t'
 xcb_randr_crtc_ttarget_crtc; /**<  */
 ^
/usr/include/xcb/present.h:336:5: error: unknown type name 'xcb_randr_crtc_t'
 xcb_randr_crtc_ttarget_crtc; /**<  */

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/3] st/xa: use pipe-loader to get screen

2014-02-08 Thread Rob Clark
From: Rob Clark 

This lets multiple gallium drivers use XA.

Signed-off-by: Rob Clark 
---
 configure.ac  |  8 ++--
 src/gallium/state_trackers/xa/Makefile.am | 11 -
 src/gallium/state_trackers/xa/xa_priv.h   |  1 +
 src/gallium/state_trackers/xa/xa_tracker.c|  6 ++-
 src/gallium/state_trackers/xa/xatracker.pc.in |  9 
 src/gallium/targets/Makefile.am   |  4 --
 src/gallium/targets/xa-vmwgfx/Makefile.am | 61 ---
 src/gallium/targets/xa-vmwgfx/vmw_target.c| 26 
 src/gallium/targets/xa-vmwgfx/xatracker.pc.in |  9 
 9 files changed, 29 insertions(+), 106 deletions(-)
 create mode 100644 src/gallium/state_trackers/xa/xatracker.pc.in
 delete mode 100644 src/gallium/targets/xa-vmwgfx/Makefile.am
 delete mode 100644 src/gallium/targets/xa-vmwgfx/vmw_target.c
 delete mode 100644 src/gallium/targets/xa-vmwgfx/xatracker.pc.in

diff --git a/configure.ac b/configure.ac
index 2424dde..6f490fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1270,6 +1270,7 @@ dnl XA configuration
 dnl
 if test "x$enable_xa" = xyes; then
 GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
+enable_gallium_loader=yes
 fi
 AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
 
@@ -1743,7 +1744,7 @@ if test "x$with_gallium_drivers" != x; then
 xsvga)
 HAVE_GALLIUM_SVGA=yes
 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
-gallium_check_st "svga/drm" "dri-vmwgfx" "xa-vmwgfx"
+gallium_check_st "svga/drm" "dri-vmwgfx" ""
 ;;
 xi915)
 HAVE_GALLIUM_I915=yes
@@ -1959,7 +1960,7 @@ AC_SUBST([XVMC_MAJOR], 1)
 AC_SUBST([XVMC_MINOR], 0)
 
 AC_SUBST([XA_MAJOR], 2)
-AC_SUBST([XA_MINOR], 1)
+AC_SUBST([XA_MINOR], 2)
 AC_SUBST([XA_TINY], 0)
 AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
 
@@ -2021,6 +2022,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/state_trackers/vdpau/Makefile
src/gallium/state_trackers/vega/Makefile
src/gallium/state_trackers/xa/Makefile
+   src/gallium/state_trackers/xa/xatracker.pc
src/gallium/state_trackers/xvmc/Makefile
src/gallium/targets/Makefile
src/gallium/targets/dri-freedreno/Makefile
@@ -2043,8 +2045,6 @@ AC_CONFIG_FILES([Makefile
src/gallium/targets/r600/xvmc/Makefile
src/gallium/targets/libgl-xlib/Makefile
src/gallium/targets/vdpau-nouveau/Makefile
-   src/gallium/targets/xa-vmwgfx/Makefile
-   src/gallium/targets/xa-vmwgfx/xatracker.pc
src/gallium/targets/xvmc-nouveau/Makefile
src/gallium/tests/trivial/Makefile
src/gallium/tests/unit/Makefile
diff --git a/src/gallium/state_trackers/xa/Makefile.am 
b/src/gallium/state_trackers/xa/Makefile.am
index 7d0b366..37ec0c4 100644
--- a/src/gallium/state_trackers/xa/Makefile.am
+++ b/src/gallium/state_trackers/xa/Makefile.am
@@ -25,6 +25,8 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-Wall -pedantic \
+   $(GALLIUM_PIPE_LOADER_DEFINES) \
+   -DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\" \
$(GALLIUM_CFLAGS) \
$(VISIBILITY_CFLAGS)
 
@@ -33,12 +35,19 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/gallium/winsys \
-I$(top_srcdir)/src/gallium/drivers
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xatracker.pc
+
 xa_includedir = $(includedir)
 xa_include_HEADERS = \
xa_composite.h \
xa_context.h \
xa_tracker.h
 
-noinst_LTLIBRARIES = libxatracker.la
+lib_LTLIBRARIES = libxatracker.la
 
 libxatracker_la_SOURCES = $(C_SOURCES)
+libxatracker_la_LIBADD = \
+   $(GALLIUM_PIPE_LOADER_LIBS) \
+   $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
+   $(top_builddir)/src/gallium/auxiliary/libgallium.la
diff --git a/src/gallium/state_trackers/xa/xa_priv.h 
b/src/gallium/state_trackers/xa/xa_priv.h
index ee182e7..b99c214 100644
--- a/src/gallium/state_trackers/xa/xa_priv.h
+++ b/src/gallium/state_trackers/xa/xa_priv.h
@@ -74,6 +74,7 @@ struct xa_tracker {
 unsigned int format_map[XA_LAST_SURFACE_TYPE][2];
 int d_depth_bits_last;
 int ds_depth_bits_last;
+struct pipe_loader_device *dev;
 struct pipe_screen *screen;
 struct xa_context *default_ctx;
 };
diff --git a/src/gallium/state_trackers/xa/xa_tracker.c 
b/src/gallium/state_trackers/xa/xa_tracker.c
index cda6501..840c361 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.c
+++ b/src/gallium/state_trackers/xa/xa_tracker.c
@@ -30,6 +30,7 @@
 #include "xa_priv.h"
 #include "pipe/p_state.h"
 #include "pipe/p_format.h"
+#include "pipe-loader/pipe_loader.h"
 #include "state_tracker/drm_driver.h"
 #include "util/u_inlines.h"
 
@@ -143,7 +144,8 @@ xa_tracker_create(int drm_fd)
 if (!xa)
return NULL;
 
-xa->screen = driver_descriptor.

[Mesa-dev] [PATCH 0/3] enable XA for freedreno

2014-02-08 Thread Rob Clark
From: Rob Clark 

Now that the rendering corruption issues from the very early days of
a3xx gallium are solved it is time to return to freedreno XA support,
so that presentation blit for windowed apps (and post-sub-buffer) !=
stall + memcpy().  With basic XA working now in xf86-video-freedreno,
it is pretty much a 2x boost for es2gears, glmark2, etc.  (es2gears:
900+fps, or 1200fps on apq8074/a330 :-P)

This patchset makes a single libxatracker.so able to load any gallium
driver (that pipe-loader can load), so that it can be used by more
than just vmwgfx ddx.

The first patch makes pipe-loader usable within xserver, by splitting
pipe-loader into two builds (of the same code).  The "client" version
continues to link in client side libs (for dri authentication, etc).

The second patch converts XA state tracker over to use pipe-loader.

And the third patch adds pipe loader support for freedreno, which I
somehow forgot to add before.

Rob Clark (3):
  pipe-loader: split out "client" version
  st/xa: use pipe-loader to get screen
  pipe-loader: add pipe loader for freedreno/msm

 configure.ac   | 19 ---
 src/gallium/auxiliary/pipe-loader/Makefile.am  | 19 +--
 src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c |  2 +
 src/gallium/state_trackers/xa/Makefile.am  | 11 +++-
 src/gallium/state_trackers/xa/xa_priv.h|  1 +
 src/gallium/state_trackers/xa/xa_tracker.c |  6 ++-
 src/gallium/state_trackers/xa/xatracker.pc.in  |  9 
 src/gallium/targets/Makefile.am|  4 --
 src/gallium/targets/gbm/Makefile.am|  4 +-
 src/gallium/targets/opencl/Makefile.am |  4 +-
 src/gallium/targets/pipe-loader/Makefile.am| 16 ++
 src/gallium/targets/pipe-loader/pipe_msm.c | 20 +++
 src/gallium/targets/xa-vmwgfx/Makefile.am  | 61 --
 src/gallium/targets/xa-vmwgfx/vmw_target.c | 26 -
 src/gallium/targets/xa-vmwgfx/xatracker.pc.in  |  9 
 src/gallium/tests/trivial/Makefile.am  |  4 +-
 16 files changed, 98 insertions(+), 117 deletions(-)
 create mode 100644 src/gallium/state_trackers/xa/xatracker.pc.in
 create mode 100644 src/gallium/targets/pipe-loader/pipe_msm.c
 delete mode 100644 src/gallium/targets/xa-vmwgfx/Makefile.am
 delete mode 100644 src/gallium/targets/xa-vmwgfx/vmw_target.c
 delete mode 100644 src/gallium/targets/xa-vmwgfx/xatracker.pc.in

-- 
1.8.5.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/3] pipe-loader: split out "client" version

2014-02-08 Thread Rob Clark
From: Rob Clark 

Build two versions of pipe-loader, with only the client version linking
in x11 client side dependencies.  This will allow the XA state tracker
to use pipe-loader.

Signed-off-by: Rob Clark 
---
 configure.ac   | 11 +--
 src/gallium/auxiliary/pipe-loader/Makefile.am  | 19 ---
 src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c |  2 ++
 src/gallium/targets/gbm/Makefile.am|  4 ++--
 src/gallium/targets/opencl/Makefile.am |  4 ++--
 src/gallium/tests/trivial/Makefile.am  |  4 ++--
 6 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index ba158e8..2424dde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1895,6 +1895,11 @@ AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test 
"x$HAVE_GALLIUM_I915" = xyes -
   "x$HAVE_GALLIUM_SOFTPIPE" = 
xyes \
   && test "x$MESA_LLVM" = x1)
 
+# NOTE: anything using xcb or other client side libs ends up in separate
+#   _CLIENT variables.  The pipe loader is built in two variants,
+#   one that is standalone and does not link any x client libs (for
+#   use by XA tracker in particular, but could be used in any case
+#   where communication with xserver is not desired).
 if test "x$enable_gallium_loader" = xyes; then
 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
 
@@ -1903,13 +1908,15 @@ if test "x$enable_gallium_loader" = xyes; then
 PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
   pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
 if test "x$pipe_loader_have_xcb" = xyes; then
-GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES 
-DHAVE_PIPE_LOADER_XCB"
-GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS 
$GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
+
GALLIUM_PIPE_LOADER_CLIENT_DEFINES="$GALLIUM_PIPE_LOADER_CLIENT_DEFINES 
-DHAVE_PIPE_LOADER_XCB"
+GALLIUM_PIPE_LOADER_CLIENT_LIBS="$GALLIUM_PIPE_LOADER_CLIENT_LIBS 
$GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
 fi
 fi
 
 AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
 AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
+AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_DEFINES])
+AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_LIBS])
 fi
 
 AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
diff --git a/src/gallium/auxiliary/pipe-loader/Makefile.am 
b/src/gallium/auxiliary/pipe-loader/Makefile.am
index 8e4d034..4d8e264 100644
--- a/src/gallium/auxiliary/pipe-loader/Makefile.am
+++ b/src/gallium/auxiliary/pipe-loader/Makefile.am
@@ -12,8 +12,9 @@ noinst_LTLIBRARIES =
 
 if HAVE_LOADER_GALLIUM
 noinst_LTLIBRARIES += libpipe_loader.la
+noinst_LTLIBRARIES += libpipe_loader_client.la
 
-libpipe_loader_la_SOURCES = \
+COMMON_SOURCES = \
pipe_loader.h \
pipe_loader_priv.h \
pipe_loader.c \
@@ -22,10 +23,22 @@ libpipe_loader_la_SOURCES = \
 if HAVE_DRM_LOADER_GALLIUM
 AM_CFLAGS = $(LIBDRM_CFLAGS)
 
-libpipe_loader_la_SOURCES += pipe_loader_drm.c
+COMMON_SOURCES += pipe_loader_drm.c
 
-libpipe_loader_la_LIBADD = \
+COMMON_LIBADD = \
$(top_builddir)/src/loader/libloader.la
 
 endif
+
+libpipe_loader_la_CFLAGS  = -DSTANDALONE_LOADER \
+   $(AM_CFLAGS) $(AM_CPPFLAGS)
+libpipe_loader_la_SOURCES = $(COMMON_SOURCES)
+libpipe_loader_la_LIBADD  = $(COMMON_LIBADD)
+
+libpipe_loader_client_la_CFLAGS  = $(GALLIUM_PIPE_LOADER_CLIENT_DEFINES) \
+   $(AM_CFLAGS) $(AM_CPPFLAGS)
+libpipe_loader_client_la_SOURCES = $(COMMON_SOURCES)
+libpipe_loader_client_la_LIBADD  = $(COMMON_LIBADD) \
+   $(GALLIUM_PIPE_LOADER_CLIENT_LIBS)
+
 endif
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c 
b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
index 95a4f84..e53e8af 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
@@ -47,7 +47,9 @@ static struct sw_winsys *(*backends[])() = {
 #ifdef HAVE_WINSYS_XLIB
x11_sw_create,
 #endif
+#ifndef STANDALONE_LOADER
null_sw_create
+#endif
 };
 
 int
diff --git a/src/gallium/targets/gbm/Makefile.am 
b/src/gallium/targets/gbm/Makefile.am
index 4299d07..30a3427 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -42,8 +42,8 @@ gbm_LTLIBRARIES = gbm_gallium_drm.la
 gbm_gallium_drm_la_SOURCES = gbm.c
 
 gbm_gallium_drm_la_LIBADD = \
-   $(GALLIUM_PIPE_LOADER_LIBS) \
-   $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
+   $(GALLIUM_PIPE_LOADER_CLIENT_LIBS) \
+   
$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_client.la \
$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
$(top_builddir)/src/gallium/state_trackers/gbm/libgbm.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
diff --git a/src/

[Mesa-dev] [PATCH 3/3] pipe-loader: add pipe loader for freedreno/msm

2014-02-08 Thread Rob Clark
From: Rob Clark 

Signed-off-by: Rob Clark 
---
 src/gallium/targets/pipe-loader/Makefile.am | 16 
 src/gallium/targets/pipe-loader/pipe_msm.c  | 20 
 2 files changed, 36 insertions(+)
 create mode 100644 src/gallium/targets/pipe-loader/pipe_msm.c

diff --git a/src/gallium/targets/pipe-loader/Makefile.am 
b/src/gallium/targets/pipe-loader/Makefile.am
index 97733c1..8a0f254 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -132,6 +132,22 @@ pipe_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif
 endif
 
+if HAVE_GALLIUM_FREEDRENO
+pipe_LTLIBRARIES += pipe_msm.la
+pipe_msm_la_SOURCES = pipe_msm.c
+nodist_EXTRA_pipe_msm_la_SOURCES = dummy.cpp
+pipe_msm_la_LIBADD = \
+   $(PIPE_LIBS) \
+   $(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
+   $(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
+   $(LIBDRM_LIBS)
+pipe_msm_la_LDFLAGS = -no-undefined -avoid-version -module
+if HAVE_MESA_LLVM
+pipe_msm_la_LIBADD += $(LLVM_LIBS)
+pipe_msm_la_LDFLAGS += $(LLVM_LDFLAGS)
+endif
+endif
+
 if HAVE_GALLIUM_SVGA
 pipe_LTLIBRARIES += pipe_vmwgfx.la
 pipe_vmwgfx_la_SOURCES = pipe_vmwgfx.c
diff --git a/src/gallium/targets/pipe-loader/pipe_msm.c 
b/src/gallium/targets/pipe-loader/pipe_msm.c
new file mode 100644
index 000..509e94c
--- /dev/null
+++ b/src/gallium/targets/pipe-loader/pipe_msm.c
@@ -0,0 +1,20 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "freedreno/drm/freedreno_drm_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+   struct pipe_screen *screen;
+
+   screen = fd_drm_screen_create(fd);
+   if (!screen)
+  return NULL;
+
+   screen = debug_screen_wrap(screen);
+
+   return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("msm", "freedreno", create_screen, NULL)
-- 
1.8.5.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev