[Mesa-dev] [Demos] EGLUT Wayland patch

2013-09-11 Thread Tarnyko
Hi folks, 

Could someone review the following patch ? 

https://bugs.freedesktop.org/show_bug.cgi?id=69135 

As of today, the Wayland EGL demo doesn't compile anymore, because of some 
API breakage between 1.0 and 1.2. 

Patch solves this ; some improvement-insight is welcome though. 



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


Re: [Mesa-dev] [Demos] EGLUT Wayland patch

2013-09-11 Thread Armin K.
On 09/11/2013 10:46 AM, Tarnyko wrote:
 Hi folks,
 Could someone review the following patch ?
 https://bugs.freedesktop.org/show_bug.cgi?id=69135
 As of today, the Wayland EGL demo doesn't compile anymore, because of
 some API breakage between 1.0 and 1.2.
 Patch solves this ; some improvement-insight is welcome though.
 
 Regards,
 Tarnyko
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev

http://lists.freedesktop.org/archives/mesa-dev/2013-August/043858.html

a bit of c/p from simple-egl demo and es2gears run on weston just fine.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] radeon/uvd: use more sane defaults for bitstream buffer size

2013-09-11 Thread Christian König
From: Christian König christian.koe...@amd.com

Signed-off-by: Christian König christian.koe...@amd.com
---
 src/gallium/drivers/radeon/radeon_uvd.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/radeon_uvd.c 
b/src/gallium/drivers/radeon/radeon_uvd.c
index 5e7eedb..981d5c5 100644
--- a/src/gallium/drivers/radeon/radeon_uvd.c
+++ b/src/gallium/drivers/radeon/radeon_uvd.c
@@ -823,6 +823,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct 
pipe_context *context,
 {
unsigned dpb_size = calc_dpb_size(templ);
unsigned width = templ-width, height = templ-height;
+   unsigned bs_buf_size;
struct radeon_info info;
struct ruvd_decoder *dec;
struct ruvd_msg msg;
@@ -873,6 +874,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct 
pipe_context *context,
goto error;
}
 
+   bs_buf_size = width * height * 512 / (16 * 16);
for (i = 0; i  NUM_BUFFERS; ++i) {
unsigned msg_fb_size = align(sizeof(struct ruvd_msg), 0x1000) + 
0x1000;
if (!create_buffer(dec, dec-msg_fb_buffers[i], msg_fb_size)) {
@@ -880,7 +882,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct 
pipe_context *context,
goto error;
}
 
-   if (!create_buffer(dec, dec-bs_buffers[i], 4096)) {
+   if (!create_buffer(dec, dec-bs_buffers[i], bs_buf_size)) {
RUVD_ERR(Can't allocated bitstream buffers.\n);
goto error;
}
-- 
1.7.9.5

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


[Mesa-dev] [PATCH 2/2] radeon/uvd: move more logic into the common files

2013-09-11 Thread Christian König
From: Christian König christian.koe...@amd.com

Move the code back into the common UVD files since we now
have base structures for R600 and radeonsi.

Signed-off-by: Christian König christian.koe...@amd.com
---
 src/gallium/drivers/r600/r600_pipe.c|2 +-
 src/gallium/drivers/r600/r600_pipe.h|5 -
 src/gallium/drivers/r600/r600_uvd.c |   30 +--
 src/gallium/drivers/radeon/radeon_uvd.c |   21 ++-
 src/gallium/drivers/radeon/radeon_uvd.h |1 -
 src/gallium/drivers/radeonsi/radeonsi_uvd.c |4 +---
 6 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_pipe.c 
b/src/gallium/drivers/r600/r600_pipe.c
index aa5cadf..f60252a 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -1293,7 +1293,7 @@ struct pipe_screen *r600_screen_create(struct 
radeon_winsys *ws)
rscreen-b.b.get_driver_query_info = r600_get_driver_query_info;
 
if (rscreen-b.info.has_uvd) {
-   rscreen-b.b.get_video_param = r600_uvd_get_video_param;
+   rscreen-b.b.get_video_param = ruvd_get_video_param;
rscreen-b.b.is_video_format_supported = 
ruvd_is_format_supported;
} else {
rscreen-b.b.get_video_param = r600_get_video_param;
diff --git a/src/gallium/drivers/r600/r600_pipe.h 
b/src/gallium/drivers/r600/r600_pipe.h
index 2ba0251..1491975 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -816,11 +816,6 @@ struct pipe_video_codec *r600_uvd_create_decoder(struct 
pipe_context *context,
 struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
   const struct 
pipe_video_buffer *tmpl);
 
-int r600_uvd_get_video_param(struct pipe_screen *screen,
-enum pipe_video_profile profile,
-enum pipe_video_entrypoint entrypoint,
-enum pipe_video_cap param);
-
 /*
  * Helpers for building command buffers
  */
diff --git a/src/gallium/drivers/r600/r600_uvd.c 
b/src/gallium/drivers/r600/r600_uvd.c
index eeac76f..00669fd 100644
--- a/src/gallium/drivers/r600/r600_uvd.c
+++ b/src/gallium/drivers/r600/r600_uvd.c
@@ -167,33 +167,5 @@ static struct radeon_winsys_cs_handle* 
r600_uvd_set_dtb(struct ruvd_msg *msg, st
 struct pipe_video_codec *r600_uvd_create_decoder(struct pipe_context *context,
   const struct 
pipe_video_codec *templat)
 {
-   struct r600_context *ctx = (struct r600_context *)context;
-
-   return ruvd_create_decoder(context, templat, ctx-b.ws, 
r600_uvd_set_dtb);
-}
-
-int r600_uvd_get_video_param(struct pipe_screen *screen,
-enum pipe_video_profile profile,
-enum pipe_video_entrypoint entrypoint,
-enum pipe_video_cap param)
-{
-   struct r600_screen *rscreen = (struct r600_screen *)screen;
-
-   /* UVD 2.x limits */
-   if (rscreen-b.family  CHIP_PALM) {
-   enum pipe_video_format codec = u_reduce_video_profile(profile);
-   switch (param) {
-   case PIPE_VIDEO_CAP_SUPPORTED:
-   /* no support for MPEG4 */
-   return codec != PIPE_VIDEO_FORMAT_MPEG4;
-   case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
-   case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
-   /* and MPEG2 only with shaders */
-   return codec != PIPE_VIDEO_FORMAT_MPEG12;
-   default:
-   break;
-   }
-   }
-
-   return ruvd_get_video_param(screen, profile, entrypoint, param);
+   return ruvd_create_decoder(context, templat, r600_uvd_set_dtb);
 }
diff --git a/src/gallium/drivers/radeon/radeon_uvd.c 
b/src/gallium/drivers/radeon/radeon_uvd.c
index 981d5c5..518978e 100644
--- a/src/gallium/drivers/radeon/radeon_uvd.c
+++ b/src/gallium/drivers/radeon/radeon_uvd.c
@@ -46,6 +46,7 @@
 #include vl/vl_mpeg12_decoder.h
 
 #include ../../winsys/radeon/drm/radeon_winsys.h
+#include r600_pipe_common.h
 #include radeon_uvd.h
 
 #define RUVD_ERR(fmt, args...) \
@@ -818,9 +819,9 @@ static void ruvd_flush(struct pipe_video_codec *decoder)
  */
 struct pipe_video_codec *ruvd_create_decoder(struct pipe_context *context,
 const struct pipe_video_codec 
*templ,
-struct radeon_winsys* ws,
 ruvd_set_dtb set_dtb)
 {
+   struct radeon_winsys* ws = ((struct r600_common_context *)context)-ws;
unsigned dpb_size = calc_dpb_size(templ);
unsigned width = templ-width, height = templ-height;
unsigned bs_buf_size;
@@ -1082,6 +1083,24 @@ int ruvd_get_video_param(struct pipe_screen *screen,

[Mesa-dev] [PATCH] llvmpipe: Remove the special path for TGSI_OPCODE_EXP.

2013-09-11 Thread jfonseca
From: José Fonseca jfons...@vmware.com

It was wrong for EXP.y, as we clamped the source before computing the
fractional part, and this opcode should be rarely used, so it's not
worth the hassle.
---
 src/gallium/auxiliary/gallivm/lp_bld_arit.c| 80 --
 src/gallium/auxiliary/gallivm/lp_bld_arit.h|  7 --
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c | 15 
 3 files changed, 30 insertions(+), 72 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c 
b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index 09107ff..00052ed 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -3001,12 +3001,9 @@ const double lp_build_exp2_polynomial[] = {
 };
 
 
-void
-lp_build_exp2_approx(struct lp_build_context *bld,
- LLVMValueRef x,
- LLVMValueRef *p_exp2_int_part,
- LLVMValueRef *p_frac_part,
- LLVMValueRef *p_exp2)
+LLVMValueRef
+lp_build_exp2(struct lp_build_context *bld,
+  LLVMValueRef x)
 {
LLVMBuilderRef builder = bld-gallivm-builder;
const struct lp_type type = bld-type;
@@ -3019,65 +3016,48 @@ lp_build_exp2_approx(struct lp_build_context *bld,
 
assert(lp_check_value(bld-type, x));
 
-   if(p_exp2_int_part || p_frac_part || p_exp2) {
-  /* TODO: optimize the constant case */
-  if (gallivm_debug  GALLIVM_DEBUG_PERF 
-  LLVMIsConstant(x)) {
- debug_printf(%s: inefficient/imprecise constant arithmetic\n,
-  __FUNCTION__);
-  }
 
-  assert(type.floating  type.width == 32);
+   /* TODO: optimize the constant case */
+   if (gallivm_debug  GALLIVM_DEBUG_PERF 
+   LLVMIsConstant(x)) {
+  debug_printf(%s: inefficient/imprecise constant arithmetic\n,
+   __FUNCTION__);
+   }
 
-  /* We want to preserve NaN and make sure than for exp2 if x  128,
-   * the result is INF  and if it's smaller than -126.9 the result is 0 */
-  x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,  
128.0), x,
-   GALLIVM_NAN_RETURN_SECOND);
-  x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type, 
-126.9), x,
-   GALLIVM_NAN_RETURN_SECOND);
+   assert(type.floating  type.width == 32);
 
-  /* ipart = floor(x) */
-  /* fpart = x - ipart */
-  lp_build_ifloor_fract(bld, x, ipart, fpart);
-   }
+   /* We want to preserve NaN and make sure than for exp2 if x  128,
+* the result is INF  and if it's smaller than -126.9 the result is 0 */
+   x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,  128.0), x,
+GALLIVM_NAN_RETURN_SECOND);
+   x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type, 
-126.9), x,
+GALLIVM_NAN_RETURN_SECOND);
 
-   if(p_exp2_int_part || p_exp2) {
-  /* expipart = (float) (1  ipart) */
-  expipart = LLVMBuildAdd(builder, ipart,
-  lp_build_const_int_vec(bld-gallivm, type, 127), 
);
-  expipart = LLVMBuildShl(builder, expipart,
-  lp_build_const_int_vec(bld-gallivm, type, 23), 
);
-  expipart = LLVMBuildBitCast(builder, expipart, vec_type, );
-   }
+   /* ipart = floor(x) */
+   /* fpart = x - ipart */
+   lp_build_ifloor_fract(bld, x, ipart, fpart);
 
-   if(p_exp2) {
-  expfpart = lp_build_polynomial(bld, fpart, lp_build_exp2_polynomial,
- Elements(lp_build_exp2_polynomial));
 
-  res = LLVMBuildFMul(builder, expipart, expfpart, );
-   }
 
-   if(p_exp2_int_part)
-  *p_exp2_int_part = expipart;
+   /* expipart = (float) (1  ipart) */
+   expipart = LLVMBuildAdd(builder, ipart,
+   lp_build_const_int_vec(bld-gallivm, type, 127), 
);
+   expipart = LLVMBuildShl(builder, expipart,
+   lp_build_const_int_vec(bld-gallivm, type, 23), );
+   expipart = LLVMBuildBitCast(builder, expipart, vec_type, );
 
-   if(p_frac_part)
-  *p_frac_part = fpart;
 
-   if(p_exp2)
-  *p_exp2 = res;
-}
+   expfpart = lp_build_polynomial(bld, fpart, lp_build_exp2_polynomial,
+  Elements(lp_build_exp2_polynomial));
+
+   res = LLVMBuildFMul(builder, expipart, expfpart, );
 
 
-LLVMValueRef
-lp_build_exp2(struct lp_build_context *bld,
-  LLVMValueRef x)
-{
-   LLVMValueRef res;
-   lp_build_exp2_approx(bld, x, NULL, NULL, res);
return res;
 }
 
 
+
 /**
  * Extract the exponent of a IEEE-754 floating point value.
  *
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.h 
b/src/gallium/auxiliary/gallivm/lp_bld_arit.h
index d98025e..49d4e2c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.h
@@ -326,13 +326,6 @@ lp_build_ilog2(struct lp_build_context *bld,
LLVMValueRef x);
 
 void

[Mesa-dev] [PATCH] os: First check for __GLIBC__ and then for PIPE_OS_BSD

2013-09-11 Thread Andreas Boll
Fixes FTBFS on kfreebsd-*

Debian GNU/kFreeBSD doesn't provide getprogname() since it uses stdlib.h
from glibc. Instead it provides program_invocation_short_name from glibc.

You can find the same order in src/mesa/drivers/dri/common/xmlconfig.c

Cc: 9.2 mesa-sta...@lists.freedesktop.org
Tested-by: Julien Cristau jcris...@debian.org
---
 src/gallium/auxiliary/os/os_process.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_process.c 
b/src/gallium/auxiliary/os/os_process.c
index 0557689..ef38e1d 100644
--- a/src/gallium/auxiliary/os/os_process.c
+++ b/src/gallium/auxiliary/os/os_process.c
@@ -32,10 +32,10 @@
 
 #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
 #  include windows.h
-#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
-#  include stdlib.h
 #elif defined(__GLIBC__)
 #  include errno.h
+#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
+#  include stdlib.h
 #else
 #warning unexpected platform in os_process.c
 #endif
@@ -68,11 +68,11 @@ os_get_process_name(char *procname, size_t size)
 
name = lpProcessName;
 
+#elif defined(__GLIBC__)
+   name = program_invocation_short_name;
 #elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
/* *BSD and OS X */
name = getprogname();
-#elif defined(__GLIBC__)
-   name = program_invocation_short_name;
 #else
 #warning unexpected platform in os_process.c
return FALSE;
-- 
1.8.4.rc3

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


Re: [Mesa-dev] [PATCH] os: First check for __GLIBC__ and then for PIPE_OS_BSD

2013-09-11 Thread Brian Paul

On 09/11/2013 07:02 AM, Andreas Boll wrote:

Fixes FTBFS on kfreebsd-*

Debian GNU/kFreeBSD doesn't provide getprogname() since it uses stdlib.h
from glibc. Instead it provides program_invocation_short_name from glibc.

You can find the same order in src/mesa/drivers/dri/common/xmlconfig.c

Cc: 9.2 mesa-sta...@lists.freedesktop.org
Tested-by: Julien Cristau jcris...@debian.org
---
  src/gallium/auxiliary/os/os_process.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_process.c 
b/src/gallium/auxiliary/os/os_process.c
index 0557689..ef38e1d 100644
--- a/src/gallium/auxiliary/os/os_process.c
+++ b/src/gallium/auxiliary/os/os_process.c
@@ -32,10 +32,10 @@

  #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
  #  include windows.h
-#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
-#  include stdlib.h
  #elif defined(__GLIBC__)
  #  include errno.h
+#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
+#  include stdlib.h
  #else
  #warning unexpected platform in os_process.c
  #endif
@@ -68,11 +68,11 @@ os_get_process_name(char *procname, size_t size)

 name = lpProcessName;

+#elif defined(__GLIBC__)
+   name = program_invocation_short_name;
  #elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
 /* *BSD and OS X */
 name = getprogname();
-#elif defined(__GLIBC__)
-   name = program_invocation_short_name;
  #else
  #warning unexpected platform in os_process.c
 return FALSE;



Reviewed-by: Brian Paul bri...@vmware.com

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


[Mesa-dev] [Bug 68953] DispatchSanity_test.GL31_CORE regression

2013-09-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=68953

Brian Paul bri...@vmware.com changed:

   What|Removed |Added

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

--- Comment #1 from Brian Paul bri...@vmware.com ---
Fixed by commit ac8448dd9779478b570ef15f7232cfcf22f2d3db

-- 
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] llvmpipe: Remove the special path for TGSI_OPCODE_EXP.

2013-09-11 Thread Jose Fonseca
Replying privately.

See also http://bugzilla.eng.vmware.com/show_bug.cgi?id=999655#c5


Jose


- Original Message -
 Hmm sure it is rarely used (for arb_vp and d3d9 vs 1.1 (2.0 too maybe
 though the semantics are different there even if the precision required
 is the same)?
 The problem I have with this is that the emulation which will get used
 instead is _extremely_ terrible. EXP should be a cheaper alternative to
 EX2, yet the emulation will make it more than twice as expensive
 (because there are _two_ ex2 calls in exp_emit()).
 Also, since the exp/log functions actually have configurable precision
 (though it is compile-time dependent for now) maybe could exploit that
 and use a polynomial with a lesser degree?
 Otherwise though having less specialized code makes sense.
 
 Roland
 
 
 
 Am 11.09.2013 13:04, schrieb jfons...@vmware.com:
  From: José Fonseca jfons...@vmware.com
  
  It was wrong for EXP.y, as we clamped the source before computing the
  fractional part, and this opcode should be rarely used, so it's not
  worth the hassle.
  ---
   src/gallium/auxiliary/gallivm/lp_bld_arit.c| 80
   --
   src/gallium/auxiliary/gallivm/lp_bld_arit.h|  7 --
   src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c | 15 
   3 files changed, 30 insertions(+), 72 deletions(-)
  
  diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
  b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
  index 09107ff..00052ed 100644
  --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
  +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
  @@ -3001,12 +3001,9 @@ const double lp_build_exp2_polynomial[] = {
   };
   
   
  -void
  -lp_build_exp2_approx(struct lp_build_context *bld,
  - LLVMValueRef x,
  - LLVMValueRef *p_exp2_int_part,
  - LLVMValueRef *p_frac_part,
  - LLVMValueRef *p_exp2)
  +LLVMValueRef
  +lp_build_exp2(struct lp_build_context *bld,
  +  LLVMValueRef x)
   {
  LLVMBuilderRef builder = bld-gallivm-builder;
  const struct lp_type type = bld-type;
  @@ -3019,65 +3016,48 @@ lp_build_exp2_approx(struct lp_build_context *bld,
   
  assert(lp_check_value(bld-type, x));
   
  -   if(p_exp2_int_part || p_frac_part || p_exp2) {
  -  /* TODO: optimize the constant case */
  -  if (gallivm_debug  GALLIVM_DEBUG_PERF 
  -  LLVMIsConstant(x)) {
  - debug_printf(%s: inefficient/imprecise constant arithmetic\n,
  -  __FUNCTION__);
  -  }
   
  -  assert(type.floating  type.width == 32);
  +   /* TODO: optimize the constant case */
  +   if (gallivm_debug  GALLIVM_DEBUG_PERF 
  +   LLVMIsConstant(x)) {
  +  debug_printf(%s: inefficient/imprecise constant arithmetic\n,
  +   __FUNCTION__);
  +   }
   
  -  /* We want to preserve NaN and make sure than for exp2 if x  128,
  -   * the result is INF  and if it's smaller than -126.9 the result is
  0 */
  -  x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,
  128.0), x,
  -   GALLIVM_NAN_RETURN_SECOND);
  -  x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type,
  -126.9), x,
  -   GALLIVM_NAN_RETURN_SECOND);
  +   assert(type.floating  type.width == 32);
   
  -  /* ipart = floor(x) */
  -  /* fpart = x - ipart */
  -  lp_build_ifloor_fract(bld, x, ipart, fpart);
  -   }
  +   /* We want to preserve NaN and make sure than for exp2 if x  128,
  +* the result is INF  and if it's smaller than -126.9 the result is 0
  */
  +   x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,
  128.0), x,
  +GALLIVM_NAN_RETURN_SECOND);
  +   x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type,
  -126.9), x,
  +GALLIVM_NAN_RETURN_SECOND);
   
  -   if(p_exp2_int_part || p_exp2) {
  -  /* expipart = (float) (1  ipart) */
  -  expipart = LLVMBuildAdd(builder, ipart,
  -  lp_build_const_int_vec(bld-gallivm, type,
  127), );
  -  expipart = LLVMBuildShl(builder, expipart,
  -  lp_build_const_int_vec(bld-gallivm, type,
  23), );
  -  expipart = LLVMBuildBitCast(builder, expipart, vec_type, );
  -   }
  +   /* ipart = floor(x) */
  +   /* fpart = x - ipart */
  +   lp_build_ifloor_fract(bld, x, ipart, fpart);
   
  -   if(p_exp2) {
  -  expfpart = lp_build_polynomial(bld, fpart, lp_build_exp2_polynomial,
  - Elements(lp_build_exp2_polynomial));
   
  -  res = LLVMBuildFMul(builder, expipart, expfpart, );
  -   }
   
  -   if(p_exp2_int_part)
  -  *p_exp2_int_part = expipart;
  +   /* expipart = (float) (1  ipart) */
  +   expipart = LLVMBuildAdd(builder, ipart,
  +   lp_build_const_int_vec(bld-gallivm, type,
  127), );
  +   expipart = LLVMBuildShl(builder, expipart,

Re: [Mesa-dev] [PATCH] llvmpipe: Remove the special path for TGSI_OPCODE_EXP.

2013-09-11 Thread Jose Fonseca
GLSL does not use it.

vs_2_0 does not use it either  
http://msdn.microsoft.com/en-us/library/windows/desktop/bb173373(v=vs.85).aspx

D3D10 doesn't have similar thing neither.

It just didn't seem worth to keep this special path. And it seemed hard to fix 
it without breaking NaN/Inf correctness.

Jose

- Original Message -
 Hmm sure it is rarely used (for arb_vp and d3d9 vs 1.1 (2.0 too maybe
 though the semantics are different there even if the precision required
 is the same)?
 The problem I have with this is that the emulation which will get used
 instead is _extremely_ terrible. EXP should be a cheaper alternative to
 EX2, yet the emulation will make it more than twice as expensive
 (because there are _two_ ex2 calls in exp_emit()).
 Also, since the exp/log functions actually have configurable precision
 (though it is compile-time dependent for now) maybe could exploit that
 and use a polynomial with a lesser degree?
 Otherwise though having less specialized code makes sense.
 
 Roland
 
 
 
 Am 11.09.2013 13:04, schrieb jfons...@vmware.com:
  From: José Fonseca jfons...@vmware.com
  
  It was wrong for EXP.y, as we clamped the source before computing the
  fractional part, and this opcode should be rarely used, so it's not
  worth the hassle.
  ---
   src/gallium/auxiliary/gallivm/lp_bld_arit.c| 80
   --
   src/gallium/auxiliary/gallivm/lp_bld_arit.h|  7 --
   src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c | 15 
   3 files changed, 30 insertions(+), 72 deletions(-)
  
  diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
  b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
  index 09107ff..00052ed 100644
  --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
  +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
  @@ -3001,12 +3001,9 @@ const double lp_build_exp2_polynomial[] = {
   };
   
   
  -void
  -lp_build_exp2_approx(struct lp_build_context *bld,
  - LLVMValueRef x,
  - LLVMValueRef *p_exp2_int_part,
  - LLVMValueRef *p_frac_part,
  - LLVMValueRef *p_exp2)
  +LLVMValueRef
  +lp_build_exp2(struct lp_build_context *bld,
  +  LLVMValueRef x)
   {
  LLVMBuilderRef builder = bld-gallivm-builder;
  const struct lp_type type = bld-type;
  @@ -3019,65 +3016,48 @@ lp_build_exp2_approx(struct lp_build_context *bld,
   
  assert(lp_check_value(bld-type, x));
   
  -   if(p_exp2_int_part || p_frac_part || p_exp2) {
  -  /* TODO: optimize the constant case */
  -  if (gallivm_debug  GALLIVM_DEBUG_PERF 
  -  LLVMIsConstant(x)) {
  - debug_printf(%s: inefficient/imprecise constant arithmetic\n,
  -  __FUNCTION__);
  -  }
   
  -  assert(type.floating  type.width == 32);
  +   /* TODO: optimize the constant case */
  +   if (gallivm_debug  GALLIVM_DEBUG_PERF 
  +   LLVMIsConstant(x)) {
  +  debug_printf(%s: inefficient/imprecise constant arithmetic\n,
  +   __FUNCTION__);
  +   }
   
  -  /* We want to preserve NaN and make sure than for exp2 if x  128,
  -   * the result is INF  and if it's smaller than -126.9 the result is
  0 */
  -  x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,
  128.0), x,
  -   GALLIVM_NAN_RETURN_SECOND);
  -  x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type,
  -126.9), x,
  -   GALLIVM_NAN_RETURN_SECOND);
  +   assert(type.floating  type.width == 32);
   
  -  /* ipart = floor(x) */
  -  /* fpart = x - ipart */
  -  lp_build_ifloor_fract(bld, x, ipart, fpart);
  -   }
  +   /* We want to preserve NaN and make sure than for exp2 if x  128,
  +* the result is INF  and if it's smaller than -126.9 the result is 0
  */
  +   x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,
  128.0), x,
  +GALLIVM_NAN_RETURN_SECOND);
  +   x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type,
  -126.9), x,
  +GALLIVM_NAN_RETURN_SECOND);
   
  -   if(p_exp2_int_part || p_exp2) {
  -  /* expipart = (float) (1  ipart) */
  -  expipart = LLVMBuildAdd(builder, ipart,
  -  lp_build_const_int_vec(bld-gallivm, type,
  127), );
  -  expipart = LLVMBuildShl(builder, expipart,
  -  lp_build_const_int_vec(bld-gallivm, type,
  23), );
  -  expipart = LLVMBuildBitCast(builder, expipart, vec_type, );
  -   }
  +   /* ipart = floor(x) */
  +   /* fpart = x - ipart */
  +   lp_build_ifloor_fract(bld, x, ipart, fpart);
   
  -   if(p_exp2) {
  -  expfpart = lp_build_polynomial(bld, fpart, lp_build_exp2_polynomial,
  - Elements(lp_build_exp2_polynomial));
   
  -  res = LLVMBuildFMul(builder, expipart, expfpart, );
  -   }
   
  -   if(p_exp2_int_part)
  -  *p_exp2_int_part = expipart;
  +   /* 

Re: [Mesa-dev] [PATCH] llvmpipe: Remove the special path for TGSI_OPCODE_EXP.

2013-09-11 Thread Roland Scheidegger
Hmm sure it is rarely used (for arb_vp and d3d9 vs 1.1 (2.0 too maybe
though the semantics are different there even if the precision required
is the same)?
The problem I have with this is that the emulation which will get used
instead is _extremely_ terrible. EXP should be a cheaper alternative to
EX2, yet the emulation will make it more than twice as expensive
(because there are _two_ ex2 calls in exp_emit()).
Also, since the exp/log functions actually have configurable precision
(though it is compile-time dependent for now) maybe could exploit that
and use a polynomial with a lesser degree?
Otherwise though having less specialized code makes sense.

Roland



Am 11.09.2013 13:04, schrieb jfons...@vmware.com:
 From: José Fonseca jfons...@vmware.com
 
 It was wrong for EXP.y, as we clamped the source before computing the
 fractional part, and this opcode should be rarely used, so it's not
 worth the hassle.
 ---
  src/gallium/auxiliary/gallivm/lp_bld_arit.c| 80 
 --
  src/gallium/auxiliary/gallivm/lp_bld_arit.h|  7 --
  src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c | 15 
  3 files changed, 30 insertions(+), 72 deletions(-)
 
 diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c 
 b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
 index 09107ff..00052ed 100644
 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
 +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
 @@ -3001,12 +3001,9 @@ const double lp_build_exp2_polynomial[] = {
  };
  
  
 -void
 -lp_build_exp2_approx(struct lp_build_context *bld,
 - LLVMValueRef x,
 - LLVMValueRef *p_exp2_int_part,
 - LLVMValueRef *p_frac_part,
 - LLVMValueRef *p_exp2)
 +LLVMValueRef
 +lp_build_exp2(struct lp_build_context *bld,
 +  LLVMValueRef x)
  {
 LLVMBuilderRef builder = bld-gallivm-builder;
 const struct lp_type type = bld-type;
 @@ -3019,65 +3016,48 @@ lp_build_exp2_approx(struct lp_build_context *bld,
  
 assert(lp_check_value(bld-type, x));
  
 -   if(p_exp2_int_part || p_frac_part || p_exp2) {
 -  /* TODO: optimize the constant case */
 -  if (gallivm_debug  GALLIVM_DEBUG_PERF 
 -  LLVMIsConstant(x)) {
 - debug_printf(%s: inefficient/imprecise constant arithmetic\n,
 -  __FUNCTION__);
 -  }
  
 -  assert(type.floating  type.width == 32);
 +   /* TODO: optimize the constant case */
 +   if (gallivm_debug  GALLIVM_DEBUG_PERF 
 +   LLVMIsConstant(x)) {
 +  debug_printf(%s: inefficient/imprecise constant arithmetic\n,
 +   __FUNCTION__);
 +   }
  
 -  /* We want to preserve NaN and make sure than for exp2 if x  128,
 -   * the result is INF  and if it's smaller than -126.9 the result is 0 
 */
 -  x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,  
 128.0), x,
 -   GALLIVM_NAN_RETURN_SECOND);
 -  x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type, 
 -126.9), x,
 -   GALLIVM_NAN_RETURN_SECOND);
 +   assert(type.floating  type.width == 32);
  
 -  /* ipart = floor(x) */
 -  /* fpart = x - ipart */
 -  lp_build_ifloor_fract(bld, x, ipart, fpart);
 -   }
 +   /* We want to preserve NaN and make sure than for exp2 if x  128,
 +* the result is INF  and if it's smaller than -126.9 the result is 0 */
 +   x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,  128.0), 
 x,
 +GALLIVM_NAN_RETURN_SECOND);
 +   x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type, 
 -126.9), x,
 +GALLIVM_NAN_RETURN_SECOND);
  
 -   if(p_exp2_int_part || p_exp2) {
 -  /* expipart = (float) (1  ipart) */
 -  expipart = LLVMBuildAdd(builder, ipart,
 -  lp_build_const_int_vec(bld-gallivm, type, 
 127), );
 -  expipart = LLVMBuildShl(builder, expipart,
 -  lp_build_const_int_vec(bld-gallivm, type, 
 23), );
 -  expipart = LLVMBuildBitCast(builder, expipart, vec_type, );
 -   }
 +   /* ipart = floor(x) */
 +   /* fpart = x - ipart */
 +   lp_build_ifloor_fract(bld, x, ipart, fpart);
  
 -   if(p_exp2) {
 -  expfpart = lp_build_polynomial(bld, fpart, lp_build_exp2_polynomial,
 - Elements(lp_build_exp2_polynomial));
  
 -  res = LLVMBuildFMul(builder, expipart, expfpart, );
 -   }
  
 -   if(p_exp2_int_part)
 -  *p_exp2_int_part = expipart;
 +   /* expipart = (float) (1  ipart) */
 +   expipart = LLVMBuildAdd(builder, ipart,
 +   lp_build_const_int_vec(bld-gallivm, type, 127), 
 );
 +   expipart = LLVMBuildShl(builder, expipart,
 +   lp_build_const_int_vec(bld-gallivm, type, 23), 
 );
 +   expipart = LLVMBuildBitCast(builder, expipart, vec_type, );
  
 -   if(p_frac_part)
 -  *p_frac_part = fpart;
  
 -   if(p_exp2)
 -  *p_exp2 = 

Re: [Mesa-dev] [PATCH] llvmpipe: Remove the special path for TGSI_OPCODE_EXP.

2013-09-11 Thread Roland Scheidegger
Am 11.09.2013 16:28, schrieb Jose Fonseca:
 GLSL does not use it.
That's true.

 
 vs_2_0 does not use it either  
 http://msdn.microsoft.com/en-us/library/windows/desktop/bb173373(v=vs.85).aspx
Well technically it could be used for that as a cheaper alternative for
exp2 (with just a result swizzle, getting rid of the unused part)
since the accuracy required is less than with ordinary exp2.


 D3D10 doesn't have similar thing neither.
Sure.

 
 It just didn't seem worth to keep this special path. And it seemed hard to fix
it without breaking NaN/Inf correctness.
Well if that's the only concern that should be trivial to fix, just use
a separate lp_build_fract() (without clamping the input first) for the
result of dst.y - that will still generate way way better code for it
than doing the ex2 twice, not touching the ordinary exp2 path really.
But if it's really mostly unused it may not be worth it, I just don't
like making things twice slower if the code is already there without a
really good reason.

Roland




 
 Jose
 
 - Original Message -
 Hmm sure it is rarely used (for arb_vp and d3d9 vs 1.1 (2.0 too maybe
 though the semantics are different there even if the precision required
 is the same)?
 The problem I have with this is that the emulation which will get used
 instead is _extremely_ terrible. EXP should be a cheaper alternative to
 EX2, yet the emulation will make it more than twice as expensive
 (because there are _two_ ex2 calls in exp_emit()).
 Also, since the exp/log functions actually have configurable precision
 (though it is compile-time dependent for now) maybe could exploit that
 and use a polynomial with a lesser degree?
 Otherwise though having less specialized code makes sense.

 Roland



 Am 11.09.2013 13:04, schrieb jfons...@vmware.com:
 From: José Fonseca jfons...@vmware.com

 It was wrong for EXP.y, as we clamped the source before computing the
 fractional part, and this opcode should be rarely used, so it's not
 worth the hassle.
 ---
  src/gallium/auxiliary/gallivm/lp_bld_arit.c| 80
  --
  src/gallium/auxiliary/gallivm/lp_bld_arit.h|  7 --
  src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c | 15 
  3 files changed, 30 insertions(+), 72 deletions(-)

 diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
 b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
 index 09107ff..00052ed 100644
 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
 +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
 @@ -3001,12 +3001,9 @@ const double lp_build_exp2_polynomial[] = {
  };
  
  
 -void
 -lp_build_exp2_approx(struct lp_build_context *bld,
 - LLVMValueRef x,
 - LLVMValueRef *p_exp2_int_part,
 - LLVMValueRef *p_frac_part,
 - LLVMValueRef *p_exp2)
 +LLVMValueRef
 +lp_build_exp2(struct lp_build_context *bld,
 +  LLVMValueRef x)
  {
 LLVMBuilderRef builder = bld-gallivm-builder;
 const struct lp_type type = bld-type;
 @@ -3019,65 +3016,48 @@ lp_build_exp2_approx(struct lp_build_context *bld,
  
 assert(lp_check_value(bld-type, x));
  
 -   if(p_exp2_int_part || p_frac_part || p_exp2) {
 -  /* TODO: optimize the constant case */
 -  if (gallivm_debug  GALLIVM_DEBUG_PERF 
 -  LLVMIsConstant(x)) {
 - debug_printf(%s: inefficient/imprecise constant arithmetic\n,
 -  __FUNCTION__);
 -  }
  
 -  assert(type.floating  type.width == 32);
 +   /* TODO: optimize the constant case */
 +   if (gallivm_debug  GALLIVM_DEBUG_PERF 
 +   LLVMIsConstant(x)) {
 +  debug_printf(%s: inefficient/imprecise constant arithmetic\n,
 +   __FUNCTION__);
 +   }
  
 -  /* We want to preserve NaN and make sure than for exp2 if x  128,
 -   * the result is INF  and if it's smaller than -126.9 the result is
 0 */
 -  x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,
 128.0), x,
 -   GALLIVM_NAN_RETURN_SECOND);
 -  x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type,
 -126.9), x,
 -   GALLIVM_NAN_RETURN_SECOND);
 +   assert(type.floating  type.width == 32);
  
 -  /* ipart = floor(x) */
 -  /* fpart = x - ipart */
 -  lp_build_ifloor_fract(bld, x, ipart, fpart);
 -   }
 +   /* We want to preserve NaN and make sure than for exp2 if x  128,
 +* the result is INF  and if it's smaller than -126.9 the result is 0
 */
 +   x = lp_build_min_ext(bld, lp_build_const_vec(bld-gallivm, type,
 128.0), x,
 +GALLIVM_NAN_RETURN_SECOND);
 +   x = lp_build_max_ext(bld, lp_build_const_vec(bld-gallivm, type,
 -126.9), x,
 +GALLIVM_NAN_RETURN_SECOND);
  
 -   if(p_exp2_int_part || p_exp2) {
 -  /* expipart = (float) (1  ipart) */
 -  expipart = LLVMBuildAdd(builder, ipart,
 -  lp_build_const_int_vec(bld-gallivm, type,
 127), );
 -  

[Mesa-dev] [Bug 69202] piglit fs-mix-float-float-bool regression

2013-09-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=69202

--- Comment #1 from Matt Turner matts...@gmail.com ---
Well crap, that was a think-o. We should implement these in GLSL-to-TGSI (will
want to do so for ARB_gpu_shader5 builtins anyway) and GLSL-to-Mesa.
Alternatively, we can revert this patch until then, but I suspect both are the
same amount of worth, so probably best to just go ahead and implement it.

Sorry about that.

-- 
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 5/5] glsl: Add frexp signatures and implementation.

2013-09-11 Thread Paul Berry
On 9 September 2013 15:14, Matt Turner matts...@gmail.com wrote:

 I initially implemented frexp() as an IR opcode with a lowering pass,
 but since it returns a value and has an out-parameter, it would break
 assumptions our optimization passes make about ir_expressions being pure
 (i.e., having no side effects).

 For example, if opt_tree_grafting encounters this code:

 uniform float u;
 void main()
 {
   int exp;
   float f = frexp(u, out exp);
   float g = float(exp)/256.0;
   float h = float(exp) + 1.0;
   gl_FragColor = vec4(f, g, h, g + h);
 }

 it may try to optimize it to this:

 uniform float u;
 void main()
 {
   int exp;
   float g = float(exp)/256.0;
   float h = float(exp) + 1.0;
   gl_FragColor = vec4(frexp(u, out exp), g, h, g + h);
 }

 Some hardware has an instruction which performs frexp(), but we would
 need some other compiler infrastructure to be able to generate it, such
 as an intrinsics system that would allow backends to emit specific code
 for particular bits of IR.
 ---
  src/glsl/builtin_functions.cpp | 54
 ++
  1 file changed, 54 insertions(+)

 diff --git a/src/glsl/builtin_functions.cpp
 b/src/glsl/builtin_functions.cpp
 index dbd35f2..e9d7b74 100644
 --- a/src/glsl/builtin_functions.cpp
 +++ b/src/glsl/builtin_functions.cpp
 @@ -512,6 +512,7 @@ private:
 B1(findMSB)
 B1(fma)
 B2(ldexp)
 +   B2(frexp)
  #undef B0
  #undef B1
  #undef B2
 @@ -1828,6 +1829,13 @@ builtin_builder::create_builtins()
  _ldexp(glsl_type::vec3_type,  glsl_type::ivec3_type),
  _ldexp(glsl_type::vec4_type,  glsl_type::ivec4_type),
  NULL);
 +
 +   add_function(frexp,
 +_frexp(glsl_type::float_type, glsl_type::int_type),
 +_frexp(glsl_type::vec2_type,  glsl_type::ivec2_type),
 +_frexp(glsl_type::vec3_type,  glsl_type::ivec3_type),
 +_frexp(glsl_type::vec4_type,  glsl_type::ivec4_type),
 +NULL);
  #undef F
  #undef FI
  #undef FIU
 @@ -3524,6 +3532,52 @@ builtin_builder::_ldexp(const glsl_type *x_type,
 const glsl_type *exp_type)
  {
 return binop(ir_binop_ldexp, gpu_shader5, x_type, x_type, exp_type);
  }
 +
 +ir_function_signature *
 +builtin_builder::_frexp(const glsl_type *x_type, const glsl_type
 *exp_type)
 +{
 +   ir_variable *x = in_var(x_type, x);
 +   ir_variable *exponent = out_var(exp_type, exp);
 +   MAKE_SIG(x_type, gpu_shader5, 2, x, exponent);
 +
 +   const unsigned vec_elem = x_type-vector_elements;
 +   const glsl_type *bvec = glsl_type::get_instance(GLSL_TYPE_BOOL,
 vec_elem, 1);
 +   const glsl_type *uvec = glsl_type::get_instance(GLSL_TYPE_UINT,
 vec_elem, 1);
 +
 +   /* Single-precision floating-point values are stored as
 +*   1 sign bit;
 +*   8 exponent bits;
 +*   23 mantissa bits.
 +*
 +* An exponent shift of 23 will shift the mantissa out, leaving only
 the
 +* exponent and sign bit (which itself may be zero, if the absolute
 value
 +* was taken before the bitcast and shift.
 +*/
 +   ir_constant *exponent_shift = imm(23);
 +   ir_constant *exponent_bias = imm(-126, vec_elem);
 +
 +   ir_constant *sign_mantissa_mask = imm(0x807fu, vec_elem);
 +   ir_constant *exponent_mask = imm(0x3f00u, vec_elem);


Actually the exponent mask would be 0x7f80u.  This is the exponent
*value* corresponding to a float in the range [0.5, 1.0).  Fortunately
that's what we use it for :).  I'd propose renaming it to something like
exponent_value, and maybe adding an explanatory comment.


 +
 +   ir_variable *is_not_zero = body.make_temp(bvec, is_not_zero);
 +   body.emit(assign(is_not_zero, nequal(abs(x), imm(0.0f, vec_elem;
 +
 +   /* Since abs(x) ensures that the sign bit is zero, we don't need to
 bitcast
 +* to unsigned integers to ensure that 1 bits aren't shifted in.
 +*/
 +   body.emit(assign(exponent, rshift(bitcast_f2i(abs(x)),
 exponent_shift)));
 +   body.emit(assign(exponent, add(exponent, csel(is_not_zero,
 exponent_bias,
 + imm(0, vec_elem);
 +
 +   ir_variable *bits = body.make_temp(uvec, bits);
 +   body.emit(assign(bits, bitcast_f2u(x)));
 +   body.emit(assign(bits, bit_and(bits, sign_mantissa_mask)));
 +   body.emit(assign(bits, bit_or(bits, csel(is_not_zero, exponent_mask,
 +imm(0u, vec_elem);
 +   body.emit(ret(bitcast_u2f(bits)));


Tiny nit-pick: re-using the temporary variable bits like this places
unnecessary constraints on the register allocator, since it forces every
instance of the variable to be assigned to the same register.  There's a
slight chance that by using three separate temporaries we could reduce
register pressure.  (Of course, if we had SSA, this would happen
automatically).

The potential benefit is very slight though, so I'm fine with it as is.

With exponent_mask renamed, the series is:

Reviewed-by: Paul Berry 

[Mesa-dev] [Bug 69202] piglit fs-mix-float-float-bool regression

2013-09-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=69202

--- Comment #2 from Kenneth Graunke kenn...@whitecape.org ---
Maybe I'm blind, but I don't see a SEL-like opcode in TGSI, so I'm not sure
what to even translate it to.  (Other than looking what gets generated for the
old predicated MOVs and doing that...)

-- 
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 2/2] wayland-egl.pc requires wayland.pc.

2013-09-11 Thread Kenneth Graunke
On 09/11/2013 02:52 AM, Torsten Duwe wrote:
 On Tue, 10 Sep 2013, Kenneth Graunke wrote:
 On 09/10/2013 02:36 PM, Johannes Obermayr wrote:
  Version: @VERSION@
 +Requires: wayland
  Libs: -L${libdir} -lwayland-egl

 I'm a bit confused by this patch.  I don't see a wayland.pc.in file in
 the Wayland sources, and my system doesn't have a wayland.pc file
 installed.

 Instead, I see wayland-server, wayland-client, and a couple others...
 
 Argl, you're right. I had an uglier change there before, and this was
 suggested from a community member and I didn't wait until it got tested.
 
 wayland-client should do the job, I'd say. So far all 3 are the same,
 but who can predict the future... Opinions? Shall we resubmit or will
 you simply fix it on commit?
 
 Thanks,
 Torsten
 

I just made that fix and pushed both of them, since they look reasonable
to me and I doubt anyone else is going to jump in and comment...

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


[Mesa-dev] [Bug 69202] piglit fs-mix-float-float-bool regression

2013-09-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=69202

--- Comment #3 from Roland Scheidegger srol...@vmware.com ---
There's CMP and UCMP. The first wants a float input for comparison though (so
should be used for hw not supporting ints), the latter should be used for hw
which supports true ints/booleans (though it has some unresolved issues wrt
if src2/src3 arguments are floats or not hence if you use src modifiers on them
what happens is anyone's guess).

-- 
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 69053] Account request

2013-09-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=69053

--- Comment #1 from Kenneth Graunke kenn...@whitecape.org ---
It's not my decision, but FWIW, I'm against granting push access at this time.

-- 
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 1/2] glsl: Add a new glsl_type::sampler_coordinate_components() function.

2013-09-11 Thread Kenneth Graunke
This computes the number of components necessary to address a sampler
based on its dimensionality.  It will be useful for texturing built-ins.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
---
 src/glsl/glsl_types.cpp | 35 +++
 src/glsl/glsl_types.h   | 12 
 2 files changed, 47 insertions(+)

diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 0c7e8eb..3c396dd 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -883,3 +883,38 @@ glsl_type::count_attribute_slots() const
 
return 0;
 }
+
+int
+glsl_type::sampler_coordinate_components() const
+{
+   assert(is_sampler());
+
+   int size;
+
+   switch (sampler_dimensionality) {
+   case GLSL_SAMPLER_DIM_1D:
+   case GLSL_SAMPLER_DIM_BUF:
+  size = 1;
+  break;
+   case GLSL_SAMPLER_DIM_2D:
+   case GLSL_SAMPLER_DIM_RECT:
+   case GLSL_SAMPLER_DIM_MS:
+   case GLSL_SAMPLER_DIM_EXTERNAL:
+  size = 2;
+  break;
+   case GLSL_SAMPLER_DIM_3D:
+   case GLSL_SAMPLER_DIM_CUBE:
+  size = 3;
+  break;
+   default:
+  assert(!Should not get here.);
+  size = 1;
+  break;
+   }
+
+   /* Array textures need an additional component for the array index. */
+   if (sampler_array)
+  size += 1;
+
+   return size;
+}
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index 647867a..9f61eee 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -498,6 +498,18 @@ struct glsl_type {
   return is_array() ? length : -1;
}
 
+   /**
+* Return the number of coordinate components needed for this sampler type.
+*
+* This is based purely on the sampler's dimensionality.  For example, this
+* returns 1 for sampler1D, and 3 for sampler2DArray.
+*
+* Note that this is often different than actual coordinate type used in
+* a texturing built-in function, since those pack additional values (such
+* as the shadow comparitor or projector) into the coordinate type.
+*/
+   int sampler_coordinate_components() const;
+
 private:
/**
 * ralloc context for all glsl_type allocations
-- 
1.8.3.4

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


[Mesa-dev] Updates to 9.2 branch

2013-09-11 Thread Ian Romanick
Just an FYI...

The 9.2 branch is falling a bit behind.  I'm going to trickle out
patches to the stable branch over the next few days / week.  My plan is
to do 9.2.1 during the week of XDC.

If your favorite patch hasn't made it out but is listed by
get-pick-list, don't worry.  It will make it out.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] radeon/uvd: use more sane defaults for bitstream buffer size

2013-09-11 Thread Alex Deucher
On Wed, Sep 11, 2013 at 5:41 AM, Christian König
deathsim...@vodafone.de wrote:
 From: Christian König christian.koe...@amd.com

 Signed-off-by: Christian König christian.koe...@amd.com

For the series:

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 ---
  src/gallium/drivers/radeon/radeon_uvd.c |4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

 diff --git a/src/gallium/drivers/radeon/radeon_uvd.c 
 b/src/gallium/drivers/radeon/radeon_uvd.c
 index 5e7eedb..981d5c5 100644
 --- a/src/gallium/drivers/radeon/radeon_uvd.c
 +++ b/src/gallium/drivers/radeon/radeon_uvd.c
 @@ -823,6 +823,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct 
 pipe_context *context,
  {
 unsigned dpb_size = calc_dpb_size(templ);
 unsigned width = templ-width, height = templ-height;
 +   unsigned bs_buf_size;
 struct radeon_info info;
 struct ruvd_decoder *dec;
 struct ruvd_msg msg;
 @@ -873,6 +874,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct 
 pipe_context *context,
 goto error;
 }

 +   bs_buf_size = width * height * 512 / (16 * 16);
 for (i = 0; i  NUM_BUFFERS; ++i) {
 unsigned msg_fb_size = align(sizeof(struct ruvd_msg), 0x1000) 
 + 0x1000;
 if (!create_buffer(dec, dec-msg_fb_buffers[i], 
 msg_fb_size)) {
 @@ -880,7 +882,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct 
 pipe_context *context,
 goto error;
 }

 -   if (!create_buffer(dec, dec-bs_buffers[i], 4096)) {
 +   if (!create_buffer(dec, dec-bs_buffers[i], bs_buf_size)) {
 RUVD_ERR(Can't allocated bitstream buffers.\n);
 goto error;
 }
 --
 1.7.9.5

 ___
 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 03/17] mesa: Use correct data for MAX_{VERTEX, GEOMETRY}_VARYING_COMPONENTS_ARB queries

2013-09-11 Thread Paul Berry
On 10 September 2013 12:10, Ian Romanick i...@freedesktop.org wrote:

 From: Ian Romanick ian.d.roman...@intel.com

 Previously gl_constants::MaxVaryingComponents was used.  Now
 gl_constants::VertexProgram::MaxOutputs and
 gl_constants::GeometryProgram::MaxOutputs are used.

 This means that st_extensions.c had to be updated to set these fields
 instead of o MaxVaryingComponents.  It was previously the only place
 that set MaxVaryingComponents.


To clarify, does that mean that on non-state-tracker-based drivers, these
queries return uninitialized data?  I'm fine with that, since it's the case
both before and after this patch (and it looks like you fix it in patch 5),
but you might want to make a mention of it in the commit message.

Either way, the patch is:

Reviewed-by: Paul Berry stereotype...@gmail.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Mesa (git 20130828) fails to build on MIPS

2013-09-11 Thread Christophe Jarry
On Thu, Sep 5, 2013 at 1:14 PM, Christophe Jarry 
christophe.jarry at ouvaton.org wrote:

 make[2]: Entering directory `/usr/src/mesa/mesa-20130828/src/glsl'
 /usr/lib/pkgusr/mkdir -p ../../src/glsl/glcpp
   LEX  glsl_lexer.cpp
   YACC glsl_parser.cpp
 /usr/lib/pkgusr/mkdir -p ../../src/glsl/glcpp
   YACC glcpp/glcpp-parse.c
   LEX  glcpp/glcpp-lex.c
 /bin/sh: line 1:  5657 Segmentation fault \
  flex -o glsl_lexer.cpp glsl_lexer.ll
 make[2]: *** [glsl_lexer.cpp] Error 139
 make[2]: *** Waiting for unfinished jobs
 /bin/sh: line 1:  5673 Segmentation fault \
  flex -o glcpp/glcpp-lex.c glcpp/glcpp-lex.l
 make[2]: *** [glcpp/glcpp-lex.c] Error 139

GDB indicates that flex (2.5.37 here) entered an infinite loop. The bug has
been reported on http://sourceforge.net/p/flex/bugs/151/ with a fix that worked
for me. Using flex version 2.5.35 does not produce a segmentation fault.

 bison: m4 subprocess failed
 make[2]: *** [glcpp/glcpp-parse.c] Error 1
 bison: m4 subprocess failed
 make[2]: *** [glsl_parser.cpp] Error 1
 make[2]: Leaving directory `/usr/src/mesa/mesa-20130828/src/glsl'

I got rid of this error by using bison 2.4.1 instead of 2.7.

Thank you for your help!

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


Re: [Mesa-dev] [PATCH 1/2] glsl: Add a new glsl_type::sampler_coordinate_components() function.

2013-09-11 Thread Ian Romanick
On 09/11/2013 01:44 PM, Kenneth Graunke wrote:
 This computes the number of components necessary to address a sampler
 based on its dimensionality.  It will be useful for texturing built-ins.

Since the next patch uses this to replace a bunch of explicit
parameters, could we have a unit test that verifies
sampler_coordinate_components gives the values that create_builtins
expects?  That is, something that proves there won't be a change causes
by the two patches together.

I looked at the two patches, and they appear sane... and I like the
reduction in redundant information passed to _texture.  Even without the
test, both patches are

Reviewed-by: Ian Romanick ian.d.roman...@intel.com

 Signed-off-by: Kenneth Graunke kenn...@whitecape.org
 ---
  src/glsl/glsl_types.cpp | 35 +++
  src/glsl/glsl_types.h   | 12 
  2 files changed, 47 insertions(+)
 
 diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
 index 0c7e8eb..3c396dd 100644
 --- a/src/glsl/glsl_types.cpp
 +++ b/src/glsl/glsl_types.cpp
 @@ -883,3 +883,38 @@ glsl_type::count_attribute_slots() const
  
 return 0;
  }
 +
 +int
 +glsl_type::sampler_coordinate_components() const
 +{
 +   assert(is_sampler());
 +
 +   int size;
 +
 +   switch (sampler_dimensionality) {
 +   case GLSL_SAMPLER_DIM_1D:
 +   case GLSL_SAMPLER_DIM_BUF:
 +  size = 1;
 +  break;
 +   case GLSL_SAMPLER_DIM_2D:
 +   case GLSL_SAMPLER_DIM_RECT:
 +   case GLSL_SAMPLER_DIM_MS:
 +   case GLSL_SAMPLER_DIM_EXTERNAL:
 +  size = 2;
 +  break;
 +   case GLSL_SAMPLER_DIM_3D:
 +   case GLSL_SAMPLER_DIM_CUBE:
 +  size = 3;
 +  break;
 +   default:
 +  assert(!Should not get here.);
 +  size = 1;
 +  break;
 +   }
 +
 +   /* Array textures need an additional component for the array index. */
 +   if (sampler_array)
 +  size += 1;
 +
 +   return size;
 +}
 diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
 index 647867a..9f61eee 100644
 --- a/src/glsl/glsl_types.h
 +++ b/src/glsl/glsl_types.h
 @@ -498,6 +498,18 @@ struct glsl_type {
return is_array() ? length : -1;
 }
  
 +   /**
 +* Return the number of coordinate components needed for this sampler 
 type.
 +*
 +* This is based purely on the sampler's dimensionality.  For example, 
 this
 +* returns 1 for sampler1D, and 3 for sampler2DArray.
 +*
 +* Note that this is often different than actual coordinate type used in
 +* a texturing built-in function, since those pack additional values (such
 +* as the shadow comparitor or projector) into the coordinate type.
 +*/
 +   int sampler_coordinate_components() const;
 +
  private:
 /**
  * ralloc context for all glsl_type allocations
 

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


Re: [Mesa-dev] [PATCH 01/17] mesa: Support GL_MAX_VERTEX_OUTPUT_COMPONENTS query with ES3

2013-09-11 Thread Marek Olšák
For the series:

Reviewed-by: Marek Olšák marek.ol...@amd.com

Marek

On Tue, Sep 10, 2013 at 9:10 PM, Ian Romanick i...@freedesktop.org wrote:
 From: Ian Romanick ian.d.roman...@intel.com

 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 Cc: 9.1 9.2 mesa-sta...@lists.freedesktop.org
 ---
  src/mesa/main/get.c  | 1 +
  src/mesa/main/get_hash_params.py | 1 +
  2 files changed, 2 insertions(+)

 diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
 index 4f6f59a..e7c24c7 100644
 --- a/src/mesa/main/get.c
 +++ b/src/mesa/main/get.c
 @@ -714,6 +714,7 @@ find_custom_value(struct gl_context *ctx, const struct 
 value_desc *d, union valu

 case GL_MAX_VARYING_FLOATS_ARB:
 case GL_MAX_FRAGMENT_INPUT_COMPONENTS:
 +   case GL_MAX_VERTEX_OUTPUT_COMPONENTS:
v-value_int = ctx-Const.MaxVarying * 4;
break;

 diff --git a/src/mesa/main/get_hash_params.py 
 b/src/mesa/main/get_hash_params.py
 index 30855c3..ca312ee 100644
 --- a/src/mesa/main/get_hash_params.py
 +++ b/src/mesa/main/get_hash_params.py
 @@ -330,6 +330,7 @@ descriptor=[
[ MINOR_VERSION, LOC_CUSTOM, TYPE_INT, 0, extra_gl30_es3 ],

# GL 3.0 / GLES3
 +  [ MAX_VERTEX_OUTPUT_COMPONENTS, LOC_CUSTOM, TYPE_INT, 0, 
 extra_gl32_es3 ],
[ MAX_FRAGMENT_INPUT_COMPONENTS, LOC_CUSTOM, TYPE_INT, 0, 
 extra_gl32_es3 ],

  # GL_ARB_ES3_compatibility
 --
 1.8.1.4

 ___
 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 11/17] mesa: Get GL_MAX_VARYING_FLOATS_ARB from VertexProgram.MaxOutputComponents

2013-09-11 Thread Paul Berry
On 10 September 2013 12:10, Ian Romanick i...@freedesktop.org wrote:

 From: Ian Romanick ian.d.roman...@intel.com

 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 ---
  src/mesa/main/get.c  | 4 
  src/mesa/main/get_hash_params.py | 2 +-
  2 files changed, 1 insertion(+), 5 deletions(-)

 diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
 index 34eb6be..ae45bf8 100644
 --- a/src/mesa/main/get.c
 +++ b/src/mesa/main/get.c
 @@ -718,10 +718,6 @@ find_custom_value(struct gl_context *ctx, const
 struct value_desc *d, union valu
ASSERT(v-value_int_n.n = ARRAY_SIZE(v-value_int_n.ints));
break;

 -   case GL_MAX_VARYING_FLOATS_ARB:
 -  v-value_int = ctx-Const.MaxVarying * 4;
 -  break;
 -
 /* Various object names */

 case GL_TEXTURE_BINDING_1D:
 diff --git a/src/mesa/main/get_hash_params.py
 b/src/mesa/main/get_hash_params.py
 index c0dbf45..3d47443 100644
 --- a/src/mesa/main/get_hash_params.py
 +++ b/src/mesa/main/get_hash_params.py
 @@ -365,7 +365,7 @@ descriptor=[

  # GL_ARB_vertex_shader
[ MAX_VERTEX_UNIFORM_COMPONENTS_ARB,
 CONTEXT_INT(Const.VertexProgram.MaxUniformComponents),
 extra_ARB_vertex_shader ],
 -  [ MAX_VARYING_FLOATS_ARB, LOC_CUSTOM, TYPE_INT, 0,
 extra_ARB_vertex_shader ],
 +  [ MAX_VARYING_FLOATS_ARB,
 CONTEXT_INT(Const.VertexProgram.MaxOutputComponents),
 extra_ARB_vertex_shader ],

  # GL_EXT_framebuffer_blit
  # NOTE: GL_DRAW_FRAMEBUFFER_BINDING_EXT == GL_FRAMEBUFFER_BINDING_EXT
 --
 1.8.1.4

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



Doesn't MAX_VARYING_FLOATS need to be MIN2(MAX_VERTEX_OUTPUT_COMPONENTS,
MAX_FRAGMENT_INPUT_COMPONENTS)?  I can imagine an implementation where
MAX_FRAGMENT_INPUT_COMPONENTS is the smaller constraint (in fact, ES3's
minimum maximums constitute just such a case).
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 09/17] mesa: Expose MAX_GEOMETRY_{INPUT, OUTPUT}_COMPONENTS on OpenGL 3.2

2013-09-11 Thread Ian Romanick
On 09/11/2013 03:58 PM, Paul Berry wrote:
 On 10 September 2013 12:10, Ian Romanick i...@freedesktop.org
 mailto:i...@freedesktop.org wrote:
 
 From: Ian Romanick ian.d.roman...@intel.com
 mailto:ian.d.roman...@intel.com
 
 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 mailto:ian.d.roman...@intel.com
 Cc: Paul Berry stereotype...@gmail.com
 mailto:stereotype...@gmail.com
 ---
  src/mesa/main/get_hash_params.py | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/src/mesa/main/get_hash_params.py
 b/src/mesa/main/get_hash_params.py
 index 1384134..6681123 100644
 --- a/src/mesa/main/get_hash_params.py
 +++ b/src/mesa/main/get_hash_params.py
 @@ -329,9 +329,11 @@ descriptor=[
[ MAJOR_VERSION, LOC_CUSTOM, TYPE_INT, 0, extra_gl30_es3 ],
[ MINOR_VERSION, LOC_CUSTOM, TYPE_INT, 0, extra_gl30_es3 ],
 
 -  # GL 3.0 / GLES3
 +  # GL 3.2 / GLES3
[ MAX_VERTEX_OUTPUT_COMPONENTS,
 CONTEXT_INT(Const.VertexProgram.MaxOutputComponents),
 extra_gl32_es3 ],
[ MAX_FRAGMENT_INPUT_COMPONENTS,
 CONTEXT_INT(Const.FragmentProgram.MaxInputComponents),
 extra_gl32_es3 ],
 +  [ MAX_GEOMETRY_INPUT_COMPONENTS,
 CONTEXT_INT(Const.GeometryProgram.MaxInputComponents),
 extra_version_32 ],
 +  [ MAX_GEOMETRY_OUTPUT_COMPONENTS,
 CONTEXT_INT(Const.GeometryProgram.MaxOutputComponents),
 extra_version_32 ],
 
 
 It troubles me to see geometry-shader-related constants under a comment
 that says GLES3.  Maybe make a section for GL 3.2 / GLES3 for
 MAX_VERTEX_OUTPUT_COMPONENTS and MAX_FRAGMENT_INPUT_COMPONENTS and a
 section GL 3.2 for MAX_GEOMETRY_{INPUT,OUTPUT}_COMPONENTS?

That's fair.  I can split those out under a # GL 3.2 header.

 Also, was the old GL 3.0 comment just bogus?  It might be worth
 explaining that in the commit message.  It would have saved me a bunch
 of spec digging :)

Yes.  The MAX_VERTEX_OUTPUT_COMPONENTS and MAX_FRAGMENT_INPUT_COMPONENTS
queries were added in OpenGL 3.2 (with geometry shaders) and OpenGL ES 3.0.

 In any case, the patch is:
 
 Reviewed-by: Paul Berry stereotype...@gmail.com
 mailto:stereotype...@gmail.com
  
 
 
  # GL_ARB_ES3_compatibility
[ MAX_ELEMENT_INDEX, CONTEXT_INT64(Const.MaxElementIndex),
 extra_ARB_ES3_compatibility_api_es3],
 --
 1.8.1.4

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


Re: [Mesa-dev] [PATCH 09/17] mesa: Expose MAX_GEOMETRY_{INPUT, OUTPUT}_COMPONENTS on OpenGL 3.2

2013-09-11 Thread Paul Berry
On 10 September 2013 12:10, Ian Romanick i...@freedesktop.org wrote:

 From: Ian Romanick ian.d.roman...@intel.com

 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 Cc: Paul Berry stereotype...@gmail.com
 ---
  src/mesa/main/get_hash_params.py | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

 diff --git a/src/mesa/main/get_hash_params.py
 b/src/mesa/main/get_hash_params.py
 index 1384134..6681123 100644
 --- a/src/mesa/main/get_hash_params.py
 +++ b/src/mesa/main/get_hash_params.py
 @@ -329,9 +329,11 @@ descriptor=[
[ MAJOR_VERSION, LOC_CUSTOM, TYPE_INT, 0, extra_gl30_es3 ],
[ MINOR_VERSION, LOC_CUSTOM, TYPE_INT, 0, extra_gl30_es3 ],

 -  # GL 3.0 / GLES3
 +  # GL 3.2 / GLES3
[ MAX_VERTEX_OUTPUT_COMPONENTS,
 CONTEXT_INT(Const.VertexProgram.MaxOutputComponents), extra_gl32_es3 ],
[ MAX_FRAGMENT_INPUT_COMPONENTS,
 CONTEXT_INT(Const.FragmentProgram.MaxInputComponents), extra_gl32_es3 ],
 +  [ MAX_GEOMETRY_INPUT_COMPONENTS,
 CONTEXT_INT(Const.GeometryProgram.MaxInputComponents), extra_version_32 ],
 +  [ MAX_GEOMETRY_OUTPUT_COMPONENTS,
 CONTEXT_INT(Const.GeometryProgram.MaxOutputComponents), extra_version_32
 ],


It troubles me to see geometry-shader-related constants under a comment
that says GLES3.  Maybe make a section for GL 3.2 / GLES3 for
MAX_VERTEX_OUTPUT_COMPONENTS and MAX_FRAGMENT_INPUT_COMPONENTS and a
section GL 3.2 for MAX_GEOMETRY_{INPUT,OUTPUT}_COMPONENTS?

Also, was the old GL 3.0 comment just bogus?  It might be worth
explaining that in the commit message.  It would have saved me a bunch of
spec digging :)

In any case, the patch is:

Reviewed-by: Paul Berry stereotype...@gmail.com



  # GL_ARB_ES3_compatibility
[ MAX_ELEMENT_INDEX, CONTEXT_INT64(Const.MaxElementIndex),
 extra_ARB_ES3_compatibility_api_es3],
 --
 1.8.1.4


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


Re: [Mesa-dev] [PATCH 03/17] mesa: Use correct data for MAX_{VERTEX, GEOMETRY}_VARYING_COMPONENTS_ARB queries

2013-09-11 Thread Ian Romanick
On 09/11/2013 03:23 PM, Paul Berry wrote:
 On 10 September 2013 12:10, Ian Romanick i...@freedesktop.org
 mailto:i...@freedesktop.org wrote:
 
 From: Ian Romanick ian.d.roman...@intel.com
 mailto:ian.d.roman...@intel.com
 
 Previously gl_constants::MaxVaryingComponents was used.  Now
 gl_constants::VertexProgram::MaxOutputs and
 gl_constants::GeometryProgram::MaxOutputs are used.
 
 This means that st_extensions.c had to be updated to set these fields
 instead of o MaxVaryingComponents.  It was previously the only place
 that set MaxVaryingComponents.
 
 
 To clarify, does that mean that on non-state-tracker-based drivers,
 these queries return uninitialized data?  I'm fine with that, since it's
 the case both before and after this patch (and it looks like you fix it
 in patch 5), but you might want to make a mention of it in the commit
 message.

I believe that the structure is allocated by calloc, so the value should
be initialized to zero before and after my change.  Right now nobody
enables GL_ARB_geometry_shader4, so it's pretty much dead code anyway.

I will add all that information to the commit message.

 Either way, the patch is:
 
 Reviewed-by: Paul Berry stereotype...@gmail.com
 mailto:stereotype...@gmail.com

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


[Mesa-dev] [PATCH 02/21] Suppress clang's warnings about unused CFLAGS and CXXFLAGS.

2013-09-11 Thread Johannes Obermayr
Reviewed-by: Kenneth Graunke kenn...@whitecape.org
---
 configure.ac | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/configure.ac b/configure.ac
index ca9228c..d280e38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1969,6 +1969,12 @@ dnl Restore LDFLAGS and CPPFLAGS
 LDFLAGS=$_SAVE_LDFLAGS
 CPPFLAGS=$_SAVE_CPPFLAGS
 
+dnl Suppress clang's warnings about unused CFLAGS and CXXFLAGS
+if test x$acv_mesa_CLANG = xyes; then
+CFLAGS=$CFLAGS -Qunused-arguments
+CXXFLAGS=$CXXFLAGS -Qunused-arguments
+fi
+
 dnl Add user CFLAGS and CXXFLAGS
 CFLAGS=$CFLAGS $USER_CFLAGS
 CXXFLAGS=$CXXFLAGS $USER_CXXFLAGS
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 03/21] configure.ac: Save user {C, CXX}FLAGS and append them at end.

2013-09-11 Thread Johannes Obermayr
This way the user has the privilege of last decision and so the option to build 
an optimized debug build again.
---
 configure.ac | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index d280e38..e3d323d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,6 +155,12 @@ cygwin*)
 ;;
 esac
 
+dnl Save user {C,CXX}FLAGS
+USER_CFLAGS=$CFLAGS
+USER_CXXFLAGS=$CXXFLAGS
+CFLAGS=
+CXXFLAGS=
+
 dnl Add flags for gcc and g++
 if test x$GCC = xyes; then
 case $host_os in
@@ -1976,6 +1982,8 @@ if test x$acv_mesa_CLANG = xyes; then
 fi
 
 dnl Add user CFLAGS and CXXFLAGS
+cflags=$CFLAGS
+cxxflags=$CXXFLAGS
 CFLAGS=$CFLAGS $USER_CFLAGS
 CXXFLAGS=$CXXFLAGS $USER_CXXFLAGS
 
@@ -,14 +2230,16 @@ echo Shared-glapi:$enable_shared_glapi
 
 dnl Compiler options
 # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
-cflags=`echo $CFLAGS | \
+cflags=`echo $cflags | \
 $SED 's/^ *//;s/  */ /;s/ *$//'`
-cxxflags=`echo $CXXFLAGS | \
+cxxflags=`echo $cxxflags | \
 $SED 's/^ *//;s/  */ /;s/ *$//'`
 defines=`echo $DEFINES | $SED 's/^ *//;s/  */ /;s/ *$//'`
 echo 
 echo CFLAGS:  $cflags
+echo USER_CFLAGS: $USER_CFLAGS
 echo CXXFLAGS:$cxxflags
+echo USER_CXXFLAGS:   $USER_CXXFLAGS
 echo Macros:  $defines
 echo 
 if test x$MESA_LLVM = x1; then
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 01/21] ilo: Fix out-of-tree build.

2013-09-11 Thread Johannes Obermayr
---
 src/gallium/drivers/ilo/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/ilo/Makefile.am 
b/src/gallium/drivers/ilo/Makefile.am
index 10b3da3..33f2045 100644
--- a/src/gallium/drivers/ilo/Makefile.am
+++ b/src/gallium/drivers/ilo/Makefile.am
@@ -27,7 +27,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 noinst_LTLIBRARIES = libilo.la
 
 AM_CPPFLAGS = \
-   -Iinclude \
+   -I$(top_srcdir)/src/gallium/drivers/ilo/include \
-I$(top_srcdir)/src/gallium/winsys/intel \
$(GALLIUM_CFLAGS)
 
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 04/21] radeon: Build and use libradeon the right way.

2013-09-11 Thread Johannes Obermayr
Better build system integration for:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=91a160b
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b2855b

The EGL runtime issue should be fixed now.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64810
---
 configure.ac   |  2 --
 src/gallium/drivers/r600/Makefile.am   |  8 +--
 src/gallium/drivers/radeon/Makefile.am | 31 ++
 src/gallium/drivers/radeonsi/Makefile.am   |  3 ---
 src/gallium/targets/dri-r600/Makefile.am   |  1 +
 src/gallium/targets/dri-radeonsi/Makefile.am   |  1 +
 src/gallium/targets/egl-static/Makefile.am | 20 +
 src/gallium/targets/pipe-loader/Makefile.am|  2 ++
 src/gallium/targets/vdpau-r600/Makefile.am |  1 +
 src/gallium/targets/vdpau-radeonsi/Makefile.am |  1 +
 src/gallium/targets/xorg-r600/Makefile.am  |  1 +
 src/gallium/targets/xorg-radeonsi/Makefile.am  |  1 +
 src/gallium/targets/xvmc-r600/Makefile.am  |  1 +
 13 files changed, 28 insertions(+), 45 deletions(-)

diff --git a/configure.ac b/configure.ac
index e3d323d..6224386 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1779,7 +1779,6 @@ if test x$with_gallium_drivers != x; then
 GALLIUM_DRIVERS_DIRS=$GALLIUM_DRIVERS_DIRS r600
 if test x$enable_r600_llvm = xyes -o x$enable_opencl = xyes; 
then
 radeon_llvm_check
-R600_NEED_RADEON_GALLIUM=yes;
 LLVM_COMPONENTS=${LLVM_COMPONENTS} bitreader asmparser
 fi
 if test x$enable_r600_llvm = xyes; then
@@ -1936,7 +1935,6 @@ AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test 
x$HAVE_GALLIUM_I915 = xyes -o \
  x$HAVE_GALLIUM_SVGA = xyes)
 AM_CONDITIONAL(NEED_WINSYS_XLIB, test x$NEED_WINSYS_XLIB = xyes)
 AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
-AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = 
xyes)
 AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
 AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
 AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = 
xyes)
diff --git a/src/gallium/drivers/r600/Makefile.am 
b/src/gallium/drivers/r600/Makefile.am
index 9203d03..d8dc816 100644
--- a/src/gallium/drivers/r600/Makefile.am
+++ b/src/gallium/drivers/r600/Makefile.am
@@ -22,19 +22,13 @@ libr600_la_SOURCES = \
$(C_SOURCES) \
$(CXX_SOURCES)
 
-libr600_la_LIBADD = ../radeon/libradeon.la
-
-if R600_NEED_RADEON_GALLIUM
-
+if NEED_RADEON_LLVM
 libr600_la_SOURCES += \
$(LLVM_C_SOURCES)
 
-libr600_la_LIBADD += ../radeon/libllvmradeon.la
-
 AM_CFLAGS += \
$(LLVM_CFLAGS) \
-I$(top_srcdir)/src/gallium/drivers/radeon/
-
 endif
 
 if USE_R600_LLVM_COMPILER
diff --git a/src/gallium/drivers/radeon/Makefile.am 
b/src/gallium/drivers/radeon/Makefile.am
index ac8cbd3..1a65a6a 100644
--- a/src/gallium/drivers/radeon/Makefile.am
+++ b/src/gallium/drivers/radeon/Makefile.am
@@ -1,38 +1,21 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-LIBGALLIUM_LIBS=
+libradeon_la_CFLAGS = \
+   $(GALLIUM_CFLAGS) \
+   $(RADEON_CFLAGS) \
+   $(VISIBILTY_CFLAGS) \
+   $(DEFINES)
 
 noinst_LTLIBRARIES = libradeon.la
 
-AM_CFLAGS = $(GALLIUM_CFLAGS) $(RADEON_CFLAGS)
-
 libradeon_la_SOURCES = \
$(C_SOURCES)
 
 if NEED_RADEON_LLVM
-
-libllvmradeon_la_LDFLAGS = \
-   $(LLVM_LDFLAGS)
-
-noinst_LTLIBRARIES += libllvmradeon.la
-
-libllvmradeon_la_CXXFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(DEFINES)
-
-libllvmradeon_la_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
+libradeon_la_CFLAGS += \
$(LLVM_CFLAGS)
 
-libllvmradeon_la_SOURCES = \
-   $(LLVM_CPP_FILES) \
+libradeon_la_SOURCES += \
$(LLVM_C_FILES)
-
-libllvmradeon_la_LIBADD = \
-   $(LIBGALLIUM_LIBS) \
-   $(CLOCK_LIB) \
-   $(LLVM_LIBS) \
-   $(ELF_LIB)
-
 endif
diff --git a/src/gallium/drivers/radeonsi/Makefile.am 
b/src/gallium/drivers/radeonsi/Makefile.am
index 0c27973..ac75231 100644
--- a/src/gallium/drivers/radeonsi/Makefile.am
+++ b/src/gallium/drivers/radeonsi/Makefile.am
@@ -34,6 +34,3 @@ AM_CPPFLAGS = \
 AM_CFLAGS = $(LLVM_CFLAGS)
 
 libradeonsi_la_SOURCES = $(C_SOURCES)
-libradeonsi_la_LIBADD = \
-   ../radeon/libradeon.la \
-   ../radeon/libllvmradeon.la
diff --git a/src/gallium/targets/dri-r600/Makefile.am 
b/src/gallium/targets/dri-r600/Makefile.am
index 2b3524b..d217f0d 100644
--- a/src/gallium/targets/dri-r600/Makefile.am
+++ b/src/gallium/targets/dri-r600/Makefile.am
@@ -51,6 +51,7 @@ r600_dri_la_LIBADD = \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/r600/libr600.la \
+   $(top_builddir)/src/gallium/drivers/radeon/libradeon.la \

[Mesa-dev] [PATCH 05/21] gallium/targets: Make use of prebuilt libdricommon.la.

2013-09-11 Thread Johannes Obermayr
---
 src/gallium/targets/dri-freedreno/Makefile.am | 10 +++---
 src/gallium/targets/dri-i915/Makefile.am  |  7 ++-
 src/gallium/targets/dri-ilo/Makefile.am   |  7 ++-
 src/gallium/targets/dri-nouveau/Makefile.am   |  7 ++-
 src/gallium/targets/dri-r300/Makefile.am  |  7 ++-
 src/gallium/targets/dri-r600/Makefile.am  |  7 ++-
 src/gallium/targets/dri-radeonsi/Makefile.am  |  7 ++-
 src/gallium/targets/dri-vmwgfx/Makefile.am|  6 ++
 8 files changed, 17 insertions(+), 41 deletions(-)

diff --git a/src/gallium/targets/dri-freedreno/Makefile.am 
b/src/gallium/targets/dri-freedreno/Makefile.am
index 615ae6f..ac7460a 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -39,14 +39,10 @@ AM_CPPFLAGS = \
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = kgsl_dri.la msm_dri.la
 
-COMMON_SOURCES = \
-   $(top_srcdir)/src/mesa/drivers/dri/common/utils.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
-
 COMMON_LDFLAGS = -module -avoid-version -shared -no-undefined
 
 COMMON_LIBADD = \
+   $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
@@ -65,12 +61,12 @@ COMMON_LIBADD += $(LLVM_LIBS)
 endif
 
 nodist_EXTRA_kgsl_dri_la_SOURCES = dummy.cpp
-kgsl_dri_la_SOURCES = target-kgsl.c $(COMMON_SOURCES)
+kgsl_dri_la_SOURCES = target-kgsl.c
 kgsl_dri_la_LDFLAGS = $(COMMON_LDFLAGS)
 kgsl_dri_la_LIBADD  = $(COMMON_LIBADD)
 
 nodist_EXTRA_msm_dri_la_SOURCES = dummy.cpp
-msm_dri_la_SOURCES  = target-msm.c $(COMMON_SOURCES)
+msm_dri_la_SOURCES  = target-msm.c
 msm_dri_la_LDFLAGS  = $(COMMON_LDFLAGS)
 msm_dri_la_LIBADD   = $(COMMON_LIBADD)
 
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index ce6be78..e1c6eca 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -40,15 +40,12 @@ AM_CPPFLAGS = \
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = i915_dri.la
 
-i915_dri_la_SOURCES = \
-   target.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/utils.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
+i915_dri_la_SOURCES = target.c
 
 i915_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
 
 i915_dri_la_LIBADD = \
+   $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
diff --git a/src/gallium/targets/dri-ilo/Makefile.am 
b/src/gallium/targets/dri-ilo/Makefile.am
index 7761f33..88233f6 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -39,17 +39,14 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = ilo_dri.la
 
-ilo_dri_la_SOURCES = \
-   target.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/utils.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
+ilo_dri_la_SOURCES = target.c
 
 # need -rpath to create a noinst shared library
 ilo_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
 -rpath $(abs_builddir)
 
 ilo_dri_la_LIBADD = \
+   $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am 
b/src/gallium/targets/dri-nouveau/Makefile.am
index 9cc5455..a02394e 100644
--- a/src/gallium/targets/dri-nouveau/Makefile.am
+++ b/src/gallium/targets/dri-nouveau/Makefile.am
@@ -39,15 +39,12 @@ dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = nouveau_dri.la
 
 nodist_EXTRA_nouveau_dri_la_SOURCES = dummy.cpp
-nouveau_dri_la_SOURCES = \
-   target.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/utils.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
+nouveau_dri_la_SOURCES = target.c
 
 nouveau_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
 
 nouveau_dri_la_LIBADD = \
+   $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
diff --git a/src/gallium/targets/dri-r300/Makefile.am 
b/src/gallium/targets/dri-r300/Makefile.am
index 

[Mesa-dev] The long way to a faster build with shared libs and some fixes ...

2013-09-11 Thread Johannes Obermayr
[PATCH 01/21] ilo: Fix out-of-tree build.

[PATCH 02/21] Suppress clang's warnings about unused CFLAGS and CXXFLAGS.

[PATCH 03/21] configure.ac: Save user {C,CXX}FLAGS and append them at end.

[PATCH 04/21] radeon: Build and use libradeon the right way.
  Link libradeon only once in egl-static

[PATCH 05/21] gallium/targets: Make use of prebuilt libdricommon.la.
  Avoid duplicate build.

[PATCH 06/21] Drop support for --enable-static / --disable-shared.

[PATCH 07/21] gallium/auxiliary: Build libgallium shared.
  Hundreds of symbols to be PUBLIC. But saves on a full build
  19 x ~ 1.8 MB.

[PATCH 08/21] Drop last parts of compatibility for the old Mesa build
  I want it to avoid these stupid symlinks while distro build but
  with more work on follow-up patches it should be possible to keep

[PATCH 09/21] mapi: Build libglapi always shared.
  I assume it could be improved later

[PATCH 10/21] mesa: Build libmesa shared.
  Hundreds of PUBLICs but we can get rid of libdricore and get an
  libmesadri which depends as well as libmesagallium on a 
libmesacore.
  This really speeds up build since duplicate build in libdricore
  with all PUBLIC can be avoided.
  Also dlopen classic drivers should be faster.

[PATCH 11/21] Install all internal shared libs to $(libdir)/mesa-$VERSION.

[PATCH 12/21] Also do it for egl_gallium.so, pipe_*.so and gbm_gallium_drm.

[PATCH 13/21] Makefile.am: s:-no-undefined:-Wl,--no-undefined to make it work.
  libtool will set it back to allow_undefined=yes in func_mode_link 
()
  otherwise.

[PATCH 14/21] gallium/drivers: Build libs -shared.

[PATCH 15/21] vdpau,xvmc: Add install-data-hooks to remove unneccessary 
symlinks.
  libvdpau_*.so.1 and libXvMC*.so libs are dlopened by wrappers.
  Nothing should link them directly.

[PATCH 16/21] glx: Get rid of libglx.la.

[PATCH 17/21] gbm: Get rid of libgbm_dri.la.

[PATCH 18/21] i915: Conditionally build an i915g driver instead of

[PATCH 19/21] freedreno: Make print_sequence a macro to fix clang.

[PATCH 20/21] freedreno: One Makefile.am with a Makefile.sources is

[PATCH 21/21] clover: Force gcc and g++ to fix clang builds.


openSUSE x86_64 binary RPMs will look like this:
$ du -a etc/ usr/
4   etc/drirc
8   etc/
88  usr/lib64/libXvMCr600.so
140 usr/lib64/libEGL.so.1.0.0
0   usr/lib64/libGL.so.1.2
380 usr/lib64/libGL.so.1.2.0
0   usr/lib64/libGLESv1_CM.so.1
88  usr/lib64/libXvMCr300.so
36  usr/lib64/libXvMCsoftpipe.so
212 usr/lib64/mesa-9.2.0/libllvmpipe.so
608 usr/lib64/mesa-9.2.0/libmesadri.so
324 usr/lib64/mesa-9.2.0/libmesagallium.so
1140usr/lib64/mesa-9.2.0/libnouveau.so
60  usr/lib64/mesa-9.2.0/libtrace.so
60  usr/lib64/mesa-9.2.0/pipe_r600.so
308 usr/lib64/mesa-9.2.0/libr300.so
20  usr/lib64/mesa-9.2.0/libgalahad.so
16  usr/lib64/mesa-9.2.0/libnoop.so
32  usr/lib64/mesa-9.2.0/librbug.so
60  usr/lib64/mesa-9.2.0/pipe_r300.so
60  usr/lib64/mesa-9.2.0/pipe_radeonsi.so
164 usr/lib64/mesa-9.2.0/egl_gallium.so
152 usr/lib64/mesa-9.2.0/libglapi.so
136 usr/lib64/mesa-9.2.0/libradeonsi.so
16  usr/lib64/mesa-9.2.0/libr300-helper.so
16  usr/lib64/mesa-9.2.0/libidentity.so
8   usr/lib64/mesa-9.2.0/pipe_nouveau.so
184 usr/lib64/mesa-9.2.0/libsvga.so
1888usr/lib64/mesa-9.2.0/libgallium.so
20  usr/lib64/mesa-9.2.0/gbm_gallium_drm.so
1016usr/lib64/mesa-9.2.0/libr600.so
20  usr/lib64/mesa-9.2.0/pipe_vmwgfx.so
3228usr/lib64/mesa-9.2.0/libmesacore.so
152 usr/lib64/mesa-9.2.0/libsoftpipe.so
8   usr/lib64/mesa-9.2.0/pipe_swrast.so
9912usr/lib64/mesa-9.2.0
0   usr/lib64/libOSMesa.so.8
0   usr/lib64/libxatracker.so.1
64  usr/lib64/dri/swrast_dri.so
184 usr/lib64/dri/nouveau_vieux_dri.so
116 usr/lib64/dri/r600_dri.so
288 usr/lib64/dri/radeon_dri.so
876 usr/lib64/dri/i965_dri.so
320 usr/lib64/dri/r200_dri.so
116 usr/lib64/dri/r300_dri.so
120 usr/lib64/dri/radeonsi_dri.so
72  usr/lib64/dri/nouveau_dri.so
4   usr/lib64/dri/updates/README.updates
8   usr/lib64/dri/updates
324 usr/lib64/dri/i915_dri.so
84  usr/lib64/dri/vmwgfx_dri.so
2576usr/lib64/dri
28  usr/lib64/libgbm.so.1.0.0
0   usr/lib64/libGL.so.1
8   usr/lib64/libwayland-egl.so.1.0.0
116 usr/lib64/libxatracker.so.1.0.0
32  usr/lib64/libOSMesa.so.8.0.0
28  usr/lib64/libGLESv1_CM.so.1.1.0
0   usr/lib64/libGLESv2.so.2
112 usr/lib64/vdpau/libvdpau_radeonsi.so.1
112 usr/lib64/vdpau/libvdpau_r300.so.1
68  usr/lib64/vdpau/libvdpau_softpipe.so.1
68  usr/lib64/vdpau/libvdpau_nouveau.so.1
112 usr/lib64/vdpau/libvdpau_r600.so.1
476 usr/lib64/vdpau
32  usr/lib64/libGLESv2.so.2.0.0
0   usr/lib64/libEGL.so.1
36  usr/lib64/libXvMCnouveau.so
0   

[Mesa-dev] [PATCH 06/21] Drop support for --enable-static / --disable-shared.

2013-09-11 Thread Johannes Obermayr
---
 configure.ac | 100 ++-
 src/egl/main/Makefile.am |   3 +-
 src/gallium/targets/egl-static/Makefile.am   |   2 +-
 src/gallium/targets/gbm/Makefile.am  |   2 +-
 src/gallium/targets/opencl/Makefile.am   |   2 +
 src/gallium/targets/osmesa/Makefile.am   |   2 +-
 src/gallium/targets/pipe-loader/Makefile.am  |  16 ++---
 src/gallium/targets/xvmc-nouveau/Makefile.am |   3 +-
 src/gbm/Makefile.am  |   6 +-
 src/glx/Makefile.am  |   3 +-
 src/mapi/es1api/Makefile.am  |   2 +-
 src/mapi/es2api/Makefile.am  |   2 +-
 src/mapi/vgapi/Makefile.am   |   2 +-
 src/mesa/drivers/osmesa/Makefile.am  |   2 +-
 14 files changed, 62 insertions(+), 85 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6224386..3407c3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,16 @@ AC_PROG_MKDIR_P
 LT_PREREQ([2.2])
 LT_INIT([disable-static])
 
+if test x$enable_static = xyes; then
+AC_MSG_WARN([--enable-static is not supported. Disable building static 
...])
+enable_static=no
+fi
+
+if test x$enable_shared != xyes; then
+AC_MSG_WARN([--disable-shared is not supported. Force building shared ...])
+enable_shared=yes
+fi
+
 AX_PROG_BISON([],
   AS_IF([test ! -f $srcdir/src/glsl/glcpp/glcpp-parse.c],
 [AC_MSG_ERROR([bison not found - unable to compile 
glcpp-parse.y])]))
@@ -272,22 +282,6 @@ if test x$enable_64bit = xyes; then
 fi
 fi
 
-dnl Can't have static and shared libraries, default to static if user
-dnl explicitly requested. If both disabled, set to static since shared
-dnl was explicitly requested.
-case x$enable_static$enable_shared in
-xyesyes )
-AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
-enable_shared=no
-;;
-xnono )
-AC_MSG_WARN([Cannot disable both static and shared libraries, enabling 
static])
-enable_static=yes
-;;
-esac
-
-AM_CONDITIONAL(BUILD_SHARED, test x$enable_shared = xyes)
-
 dnl
 dnl other compiler options
 dnl
@@ -312,23 +306,20 @@ dnl library names
 dnl
 LIB_PREFIX_GLOB='lib'
 LIB_VERSION_SEPARATOR='.'
-if test $enable_static = yes; then
-LIB_EXTENSION='a'
-else
-case $host_os in
-darwin* )
-LIB_EXTENSION='dylib' ;;
-cygwin* )
-dnl prefix can be 'cyg' or 'lib'
-LIB_PREFIX_GLOB='???'
-LIB_VERSION_SEPARATOR='-'
-LIB_EXTENSION='dll' ;;
-aix* )
-LIB_EXTENSION='a' ;;
-* )
-LIB_EXTENSION='so' ;;
-esac
-fi
+case $host_os in
+  darwin* )
+  LIB_EXTENSION='dylib' ;;
+  cygwin* )
+  dnl prefix can be 'cyg' or 'lib'
+  LIB_PREFIX_GLOB='???'
+  LIB_VERSION_SEPARATOR='-'
+  LIB_EXTENSION='dll' ;;
+  aix* )
+  LIB_EXTENSION='a' ;;
+  * )
+  LIB_EXTENSION='so' ;;
+esac
+
 AC_ARG_WITH([gl-lib-name],
   [AS_HELP_STRING([--with-gl-lib-name@:@=NAME@:@],
 [specify GL library name @:@default=GL@:@])],
@@ -767,16 +758,9 @@ AC_SUBST([MESA_LLVM])
 PKG_CHECK_MODULES([LIBDRM], [libdrm = $LIBDRM_REQUIRED],
   [have_libdrm=yes], [have_libdrm=no])
 
-if test x$enable_dri = xyes; then
-# DRI must be shared, I think
-if test $enable_static = yes; then
-AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
-fi
-
-# not a hard requirement as swrast does not depend on it
-if test x$have_libdrm = xyes; then
-DRI_PC_REQ_PRIV=libdrm = $LIBDRM_REQUIRED
-fi
+# not a hard requirement as swrast does not depend on it
+if test x$enable_dri = xyes -a x$have_libdrm = xyes; then
+DRI_PC_REQ_PRIV=libdrm = $LIBDRM_REQUIRED
 fi
 
 dnl Direct rendering or just indirect rendering
@@ -1123,12 +1107,7 @@ x16|x32)
 esac
 
 if test x$enable_osmesa = xyes -o x$enable_gallium_osmesa = xyes; then
-# only link libraries with osmesa if shared
-if test $enable_static = no; then
-OSMESA_LIB_DEPS=-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS
-else
-OSMESA_LIB_DEPS=
-fi
+OSMESA_LIB_DEPS=-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS
 OSMESA_MESA_DEPS=
 OSMESA_PC_LIB_PRIV=-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS
 fi
@@ -1176,18 +1155,14 @@ if test x$enable_egl = xyes; then
 
 AC_CHECK_FUNC(mincore, [DEFINES=$DEFINES -DHAVE_MINCORE])
 
-if test $enable_static != yes; then
-# build egl_glx when libGL is built
-PKG_CHECK_MODULES([LIBUDEV], [libudev  150],
-  [have_libudev=yes],[have_libudev=no])
-if test $have_libudev = yes; then
-DEFINES=$DEFINES -DHAVE_LIBUDEV
-fi
-
-if test x$enable_dri = xyes; then
-   HAVE_EGL_DRIVER_DRI2=1
-   fi
-
+# build egl_glx when libGL is built
+PKG_CHECK_MODULES([LIBUDEV], [libudev  150],
+  [have_libudev=yes],[have_libudev=no])
+if test $have_libudev = yes; then
+

[Mesa-dev] [PATCH 08/21] Drop last parts of compatibility for the old Mesa build system.

2013-09-11 Thread Johannes Obermayr
---
 src/egl/main/Makefile.am   |  7 ---
 src/gallium/targets/dri-freedreno/Makefile.am  |  7 ---
 src/gallium/targets/dri-i915/Makefile.am   |  6 --
 src/gallium/targets/dri-ilo/Makefile.am|  7 ---
 src/gallium/targets/dri-nouveau/Makefile.am|  6 --
 src/gallium/targets/dri-r300/Makefile.am   |  6 --
 src/gallium/targets/dri-r600/Makefile.am   |  6 --
 src/gallium/targets/dri-radeonsi/Makefile.am   |  6 --
 src/gallium/targets/dri-swrast/Makefile.am |  6 --
 src/gallium/targets/dri-vmwgfx/Makefile.am |  6 --
 src/gallium/targets/egl-static/Makefile.am | 20 
 src/gallium/targets/libgl-xlib/Makefile.am |  6 --
 src/gallium/targets/opencl/Makefile.am |  6 --
 src/gallium/targets/vdpau-nouveau/Makefile.am  |  6 --
 src/gallium/targets/vdpau-r300/Makefile.am |  6 --
 src/gallium/targets/vdpau-r600/Makefile.am |  6 --
 src/gallium/targets/vdpau-radeonsi/Makefile.am |  6 --
 src/gallium/targets/vdpau-softpipe/Makefile.am |  6 --
 src/gallium/targets/xa-vmwgfx/Makefile.am  |  6 --
 src/gallium/targets/xorg-i915/Makefile.am  |  6 --
 src/gallium/targets/xorg-nouveau/Makefile.am   |  6 --
 src/gallium/targets/xorg-r600/Makefile.am  |  6 --
 src/gallium/targets/xorg-radeonsi/Makefile.am  |  6 --
 src/gallium/targets/xvmc-nouveau/Makefile.am   |  6 --
 src/gallium/targets/xvmc-r300/Makefile.am  |  6 --
 src/gallium/targets/xvmc-r600/Makefile.am  |  6 --
 src/gallium/targets/xvmc-softpipe/Makefile.am  |  6 --
 src/gbm/Makefile.am|  4 
 src/glx/Makefile.am|  7 ---
 src/mapi/es1api/Makefile.am|  8 
 src/mapi/es2api/Makefile.am|  8 
 src/mapi/shared-glapi/Makefile.am  |  6 --
 src/mapi/vgapi/Makefile.am |  8 
 src/mesa/drivers/dri/i915/Makefile.am  |  6 --
 src/mesa/drivers/dri/i965/Makefile.am  |  6 --
 src/mesa/drivers/dri/nouveau/Makefile.am   |  6 --
 src/mesa/drivers/dri/r200/Makefile.am  |  6 --
 src/mesa/drivers/dri/radeon/Makefile.am|  6 --
 src/mesa/drivers/dri/swrast/Makefile.am|  6 --
 src/mesa/drivers/osmesa/Makefile.am| 10 --
 src/mesa/drivers/x11/Makefile.am   |  9 -
 src/mesa/libdricore/Makefile.am| 13 -
 42 files changed, 288 deletions(-)

diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am
index 87bf999..b81aeb5 100644
--- a/src/egl/main/Makefile.am
+++ b/src/egl/main/Makefile.am
@@ -116,13 +116,6 @@ libEGL_la_LIBADD += ../drivers/dri2/libegl_dri2.la
 libEGL_la_LIBADD += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIBS)
 endif
 
-# 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: libEGL.la
-   $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
-   ln -f .libs/libEGL.so.1.0.0 $(top_builddir)/$(LIB_DIR)/libEGL.so.1
-   ln -sf libEGL.so.1 $(top_builddir)/$(LIB_DIR)/libEGL.so
-
 pkgconfigdir = $(libdir)/pkgconfig
 
 pkgconfig_DATA = egl.pc
diff --git a/src/gallium/targets/dri-freedreno/Makefile.am 
b/src/gallium/targets/dri-freedreno/Makefile.am
index b46e9b0..ac27969 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -67,10 +67,3 @@ kgsl_dri_la_LIBADD  = $(COMMON_LIBADD)
 msm_dri_la_SOURCES  = target-msm.c
 msm_dri_la_LDFLAGS  = $(COMMON_LDFLAGS)
 msm_dri_la_LIBADD   = $(COMMON_LIBADD)
-
-# 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: kgsl_dri.la msm_dri.la
-   $(MKDIR_P) $(top_builddir)/$(LIB_DIR)/gallium
-   ln -f .libs/kgsl_dri.so $(top_builddir)/$(LIB_DIR)/gallium/kgsl_dri.so
-   ln -f .libs/msm_dri.so $(top_builddir)/$(LIB_DIR)/gallium/msm_dri.so
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index d9ac274..4ef587b 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -67,9 +67,3 @@ if HAVE_MESA_LLVM
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 i915_dri_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
 endif
-
-# 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
-   $(MKDIR_P) $(top_builddir)/$(LIB_DIR)/gallium
-   ln -f .libs/i915_dri.so $(top_builddir)/$(LIB_DIR)/gallium/i915_dri.so
diff --git a/src/gallium/targets/dri-ilo/Makefile.am 
b/src/gallium/targets/dri-ilo/Makefile.am
index 8273c3b..45cd928 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ 

[Mesa-dev] [PATCH 12/21] Also do it for egl_gallium.so, pipe_*.so and gbm_gallium_drm.

2013-09-11 Thread Johannes Obermayr
---
 configure.ac  |  7 ---
 src/egl/main/Makefile.am  |  2 +-
 src/gallium/state_trackers/clover/Makefile.am |  2 +-
 src/gallium/targets/egl-static/Makefile.am|  3 +--
 src/gallium/targets/gbm/Makefile.am   |  6 ++
 src/gallium/targets/pipe-loader/Makefile.am   | 19 +--
 src/gbm/Makefile.am   |  2 +-
 7 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/configure.ac b/configure.ac
index a4e11d5..1a98626 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1459,13 +1459,6 @@ if ! echo $egl_platforms | grep -q 'x11'; then
 GL_PC_CFLAGS=$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS
 fi
 
-AC_ARG_WITH([egl-driver-dir],
-[AS_HELP_STRING([--with-egl-driver-dir=DIR],
-[directory for EGL drivers [[default=${libdir}/egl]]])],
-[EGL_DRIVER_INSTALL_DIR=$withval],
-[EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
-AC_SUBST([EGL_DRIVER_INSTALL_DIR])
-
 AC_ARG_WITH([xorg-driver-dir],
 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
 [Default xorg driver 
directory[[default=${libdir}/xorg/modules/drivers]]])],
diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am
index b81aeb5..8dc688e 100644
--- a/src/egl/main/Makefile.am
+++ b/src/egl/main/Makefile.am
@@ -30,7 +30,7 @@ AM_CFLAGS = \
$(VISIBILITY_CFLAGS) \
$(EGL_CFLAGS) \
-D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
-   -D_EGL_DRIVER_SEARCH_DIR=\$(EGL_DRIVER_INSTALL_DIR)\ \
+   -D_EGL_DRIVER_SEARCH_DIR=\$(mesalibdir)\ \
-D_EGL_OS_UNIX=1
 
 lib_LTLIBRARIES = libEGL.la
diff --git a/src/gallium/state_trackers/clover/Makefile.am 
b/src/gallium/state_trackers/clover/Makefile.am
index b4c197a..fd38766 100644
--- a/src/gallium/state_trackers/clover/Makefile.am
+++ b/src/gallium/state_trackers/clover/Makefile.am
@@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = subdir-objects
 
 AM_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-   -DPIPE_SEARCH_DIR=\$(libdir)/gallium-pipe\ \
+   -DPIPE_SEARCH_DIR=\$(mesalibdir)\ \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/drivers \
diff --git a/src/gallium/targets/egl-static/Makefile.am 
b/src/gallium/targets/egl-static/Makefile.am
index 84e9463..5b000f2 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -42,8 +42,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/egl/main \
-D_EGL_MAIN=_eglMain
 
-egldir = $(EGL_DRIVER_INSTALL_DIR)
-egl_LTLIBRARIES = egl_gallium.la
+mesalib_LTLIBRARIES = egl_gallium.la
 
 nodist_EXTRA_egl_gallium_la_SOURCES = dummy.cpp
 egl_gallium_la_SOURCES = \
diff --git a/src/gallium/targets/gbm/Makefile.am 
b/src/gallium/targets/gbm/Makefile.am
index 02ba233..0be49eb 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -22,22 +22,20 @@
 
 include $(top_srcdir)/src/gallium/Automake.inc
 
-gbmdir = $(libdir)/gbm
-
 AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/state_trackers/gbm \
-I$(top_srcdir)/src/gbm/main \
-I$(top_srcdir)/src/gallium/winsys \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-   -DPIPE_SEARCH_DIR=\$(libdir)/gallium-pipe\
+   -DPIPE_SEARCH_DIR=\$(mesalibdir)\
 
 AM_CFLAGS = \
$(GALLIUM_CFLAGS) \
$(LIBUDEV_CFLAGS) \
$(LIBDRM_CFLAGS)
 
-gbm_LTLIBRARIES = gbm_gallium_drm.la
+mesalib_LTLIBRARIES = gbm_gallium_drm.la
 
 gbm_gallium_drm_la_SOURCES = gbm.c
 
diff --git a/src/gallium/targets/pipe-loader/Makefile.am 
b/src/gallium/targets/pipe-loader/Makefile.am
index 5461fc1..af668de 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -32,8 +32,7 @@ AM_CPPFLAGS = \
-DGALLIUM_TRACE \
-DGALLIUM_GALAHAD
 
-pipedir = $(libdir)/gallium-pipe
-pipe_LTLIBRARIES =
+mesalib_LTLIBRARIES =
 
 PIPE_LIBS = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
@@ -46,7 +45,7 @@ PIPE_LIBS = \
-lm
 
 if HAVE_GALLIUM_I915
-pipe_LTLIBRARIES += pipe_i915.la
+mesalib_LTLIBRARIES += pipe_i915.la
 pipe_i915_la_SOURCES = pipe_i915.c
 pipe_i915_la_LIBADD = \
$(PIPE_LIBS) \
@@ -58,7 +57,7 @@ pipe_i915_la_LDFLAGS = -Wl,--no-undefined -shared -module 
-avoid-version
 endif
 
 if HAVE_GALLIUM_NOUVEAU
-pipe_LTLIBRARIES += pipe_nouveau.la
+mesalib_LTLIBRARIES += pipe_nouveau.la
 pipe_nouveau_la_SOURCES = pipe_nouveau.c
 pipe_nouveau_la_LIBADD = \
$(PIPE_LIBS) \
@@ -69,7 +68,7 @@ pipe_nouveau_la_LDFLAGS = -Wl,--no-undefined -shared -module 
-avoid-version
 endif
 
 if HAVE_GALLIUM_R300
-pipe_LTLIBRARIES += pipe_r300.la
+mesalib_LTLIBRARIES += pipe_r300.la
 pipe_r300_la_SOURCES = pipe_r300.c
 pipe_r300_la_LIBADD = \
$(PIPE_LIBS) \
@@ -82,7 +81,7 @@ pipe_r300_la_LDFLAGS = -Wl,--no-undefined -shared -module 
-avoid-version
 endif
 
 if HAVE_GALLIUM_R600

[Mesa-dev] [PATCH 11/21] Install all internal shared libs to $(libdir)/mesa-$VERSION.

2013-09-11 Thread Johannes Obermayr
---
 configure.ac   | 12 +---
 src/egl/drivers/dri2/egl_dri2.c|  4 ---
 src/gallium/auxiliary/Makefile.am  | 14 +-
 src/gallium/drivers/llvmpipe/Makefile.am   |  2 +-
 src/gallium/targets/egl-static/Makefile.am |  6 ++--
 src/gallium/targets/gbm/Makefile.am|  2 +-
 src/gallium/targets/opencl/Makefile.am |  2 +-
 src/gallium/targets/pipe-loader/Makefile.am|  2 +-
 src/gallium/targets/vdpau-nouveau/Makefile.am  |  2 +-
 src/gallium/targets/vdpau-r300/Makefile.am |  2 +-
 src/gallium/targets/vdpau-r600/Makefile.am |  2 +-
 src/gallium/targets/vdpau-radeonsi/Makefile.am |  2 +-
 src/gallium/targets/vdpau-softpipe/Makefile.am |  2 +-
 src/gallium/targets/xa-vmwgfx/Makefile.am  |  2 +-
 src/gallium/targets/xorg-i915/Makefile.am  |  2 +-
 src/gallium/targets/xorg-nouveau/Makefile.am   |  2 +-
 src/gallium/targets/xorg-r600/Makefile.am  |  2 +-
 src/gallium/targets/xorg-radeonsi/Makefile.am  |  2 +-
 src/gallium/targets/xvmc-nouveau/Makefile.am   |  2 +-
 src/gallium/targets/xvmc-r300/Makefile.am  |  2 +-
 src/gallium/targets/xvmc-r600/Makefile.am  |  2 +-
 src/gallium/targets/xvmc-softpipe/Makefile.am  |  2 +-
 src/gallium/tests/trivial/Makefile.am  |  2 +-
 src/gallium/tests/unit/Makefile.am |  2 +-
 src/mapi/shared-glapi/Makefile.am  |  2 +-
 src/mesa/Makefile.am   | 38 +-
 src/mesa/main/tests/Makefile.am|  2 +-
 src/mesa/main/tests/hash_table/Makefile.am |  2 +-
 28 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/configure.ac b/configure.ac
index 94815e6..a4e11d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,6 +146,10 @@ dnl LIB_DIR - library basename
 LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
 AC_SUBST([LIB_DIR])
 
+dnl Where to install internal libraries
+mesalibdir=\$(libdir)/mesa-${VERSION}
+AC_SUBST([mesalibdir])
+
 dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
 _SAVE_LDFLAGS=$LDFLAGS
 _SAVE_CPPFLAGS=$CPPFLAGS
@@ -838,10 +842,10 @@ AC_SUBST([GLESv2_PC_LIB_PRIV])
 
 AC_SUBST([DRICOMMON_LIB], 
\$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la)
 
-LIBGALLIUM_LIB=\$(top_builddir)/src/gallium/auxiliary/libgallium${VERSION}.la
-MESACORE_LIB=\$(top_builddir)/src/mesa/libmesacore${VERSION}.la
-MESADRI_LIB=\$(top_builddir)/src/mesa/libmesadri${VERSION}.la
-MESAGALLIUM_LIB=\$(top_builddir)/src/mesa/libmesagallium${VERSION}.la
+LIBGALLIUM_LIB=\$(top_builddir)/src/gallium/auxiliary/libgallium.la
+MESACORE_LIB=\$(top_builddir)/src/mesa/libmesacore.la
+MESADRI_LIB=\$(top_builddir)/src/mesa/libmesadri.la
+MESAGALLIUM_LIB=\$(top_builddir)/src/mesa/libmesagallium.la
 DRI_LIB_DEPS=${MESACORE_LIB} ${MESADRI_LIB}
 AC_SUBST([LIBMESAGALLIUM_LIBS], ${MESACORE_LIB} ${MESAGALLIUM_LIB} 
${LIBGALLIUM_LIB})
 
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 04ab564..bc7bdc7 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1916,12 +1916,8 @@ dri2_load(_EGLDriver *drv)
 {
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
 #ifdef HAVE_SHARED_GLAPI
-#ifdef HAVE_ANDROID_PLATFORM
const char *libname = libglapi.so;
 #else
-   const char *libname = libglapi.so.0;
-#endif
-#else
/*
 * Both libGL.so and libglapi.so are glapi providers.  There is no way to
 * tell which one to load.
diff --git a/src/gallium/auxiliary/Makefile.am 
b/src/gallium/auxiliary/Makefile.am
index acf1440..2826af9 100644
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -3,11 +3,11 @@ AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-lib_LTLIBRARIES = libgallium@VERSION@.la
+mesalib_LTLIBRARIES = libgallium.la
 
-libgallium@VERSION@_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
+libgallium_la_LDFLAGS = -Wl,--no-undefined -shared -avoid-version
 
-libgallium@VERSION@_la_LIBADD = $(DLOPEN_LIBS) $(CLOCK_LIB)
+libgallium_la_LIBADD = $(DLOPEN_LIBS) $(CLOCK_LIB)
 
 AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/auxiliary/util \
@@ -16,7 +16,7 @@ AM_CFLAGS = \
 
 AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
 
-libgallium@VERSION@_la_SOURCES = \
+libgallium_la_SOURCES = \
$(C_SOURCES) \
$(GENERATED_SOURCES)
 
@@ -32,14 +32,14 @@ if LLVM_NEEDS_FNORTTI
 AM_CXXFLAGS += -fno-rtti
 endif
 
-libgallium@VERSION@_la_SOURCES += \
+libgallium_la_SOURCES += \
$(GALLIVM_SOURCES) \
$(GALLIVM_CPP_SOURCES)
 
-libgallium@VERSION@_la_LDFLAGS += \
+libgallium_la_LDFLAGS += \
$(LLVM_LDFLAGS)
 
-libgallium@VERSION@_la_LIBADD += \
+libgallium_la_LIBADD += \
$(LLVM_GALLIUM_LIBS)
 endif
 
diff --git a/src/gallium/drivers/llvmpipe/Makefile.am 
b/src/gallium/drivers/llvmpipe/Makefile.am
index 1897483..e99a2b8 100644
--- a/src/gallium/drivers/llvmpipe/Makefile.am
+++ 

[Mesa-dev] [PATCH 13/21] Makefile.am: s:-no-undefined:-Wl, --no-undefined to make it work.

2013-09-11 Thread Johannes Obermayr
---
 src/gallium/targets/dri-freedreno/Makefile.am  |  2 +-
 src/gallium/targets/dri-i915/Makefile.am   |  2 +-
 src/gallium/targets/dri-ilo/Makefile.am|  2 +-
 src/gallium/targets/dri-nouveau/Makefile.am|  2 +-
 src/gallium/targets/dri-r300/Makefile.am   |  2 +-
 src/gallium/targets/dri-r600/Makefile.am   |  2 +-
 src/gallium/targets/dri-radeonsi/Makefile.am   |  2 +-
 src/gallium/targets/dri-swrast/Makefile.am |  2 +-
 src/gallium/targets/dri-vmwgfx/Makefile.am |  2 +-
 src/gallium/targets/gbm/Makefile.am|  4 +--
 src/gallium/targets/libgl-xlib/Makefile.am |  2 +-
 src/gallium/targets/opencl/Makefile.am |  2 ++
 src/gallium/targets/vdpau-nouveau/Makefile.am  |  2 +-
 src/gallium/targets/vdpau-r300/Makefile.am |  2 +-
 src/gallium/targets/vdpau-r600/Makefile.am |  2 +-
 src/gallium/targets/vdpau-radeonsi/Makefile.am |  2 +-
 src/gallium/targets/vdpau-softpipe/Makefile.am | 10 +---
 src/gallium/targets/vdpau-softpipe/target.c| 35 ++
 src/gallium/targets/xorg-i915/Makefile.am  |  2 +-
 src/gallium/targets/xorg-nouveau/Makefile.am   |  2 +-
 src/gallium/targets/xorg-r600/Makefile.am  |  2 +-
 src/gallium/targets/xorg-radeonsi/Makefile.am  |  2 +-
 src/gallium/targets/xvmc-nouveau/Makefile.am   |  2 +-
 src/gallium/targets/xvmc-r300/Makefile.am  |  2 +-
 src/gallium/targets/xvmc-r600/Makefile.am  |  2 +-
 src/gallium/targets/xvmc-softpipe/Makefile.am  |  2 +-
 src/glx/Makefile.am|  5 +---
 src/mesa/drivers/x11/Makefile.am   |  5 ++--
 28 files changed, 72 insertions(+), 33 deletions(-)
 create mode 100644 src/gallium/targets/vdpau-softpipe/target.c

diff --git a/src/gallium/targets/dri-freedreno/Makefile.am 
b/src/gallium/targets/dri-freedreno/Makefile.am
index ac27969..b549ec1 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -39,7 +39,7 @@ AM_CPPFLAGS = \
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = kgsl_dri.la msm_dri.la
 
-COMMON_LDFLAGS = -module -avoid-version -shared -no-undefined
+COMMON_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared
 
 COMMON_LIBADD = \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index 113cbbd..7ad3ff5 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -44,7 +44,7 @@ dri_LTLIBRARIES = i915_dri.la
 
 i915_dri_la_SOURCES = target.c
 
-i915_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+i915_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared
 
 i915_dri_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
diff --git a/src/gallium/targets/dri-ilo/Makefile.am 
b/src/gallium/targets/dri-ilo/Makefile.am
index c7ab9bf..89f3a77 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -42,7 +42,7 @@ noinst_LTLIBRARIES = ilo_dri.la
 ilo_dri_la_SOURCES = target.c
 
 # need -rpath to create a noinst shared library
-ilo_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
+ilo_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared \
 -rpath $(abs_builddir)
 
 ilo_dri_la_LIBADD = \
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am 
b/src/gallium/targets/dri-nouveau/Makefile.am
index 1e1487f..8402320 100644
--- a/src/gallium/targets/dri-nouveau/Makefile.am
+++ b/src/gallium/targets/dri-nouveau/Makefile.am
@@ -42,7 +42,7 @@ nodist_EXTRA_nouveau_dri_la_SOURCES = dummy.cpp
 
 nouveau_dri_la_SOURCES = target.c
 
-nouveau_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+nouveau_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared
 
 nouveau_dri_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
diff --git a/src/gallium/targets/dri-r300/Makefile.am 
b/src/gallium/targets/dri-r300/Makefile.am
index 88b6846..691dfb3 100644
--- a/src/gallium/targets/dri-r300/Makefile.am
+++ b/src/gallium/targets/dri-r300/Makefile.am
@@ -42,7 +42,7 @@ dri_LTLIBRARIES = r300_dri.la
 nodist_EXTRA_r300_dri_la_SOURCES = dummy.cpp
 r300_dri_la_SOURCES = target.c
 
-r300_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+r300_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared
 
 r300_dri_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
diff --git a/src/gallium/targets/dri-r600/Makefile.am 
b/src/gallium/targets/dri-r600/Makefile.am
index 1e3e4d2..2ad460f 100644
--- a/src/gallium/targets/dri-r600/Makefile.am
+++ b/src/gallium/targets/dri-r600/Makefile.am
@@ -42,7 +42,7 @@ dri_LTLIBRARIES = r600_dri.la
 
 r600_dri_la_SOURCES = target.c
 
-r600_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+r600_dri_la_LDFLAGS = 

[Mesa-dev] [PATCH 16/21] glx: Get rid of libglx.la.

2013-09-11 Thread Johannes Obermayr
---
 src/glx/Makefile.am   | 15 ---
 src/glx/tests/Makefile.am |  2 +-
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
index b855be9..1914467 100644
--- a/src/glx/Makefile.am
+++ b/src/glx/Makefile.am
@@ -19,7 +19,7 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
 
-SUBDIRS=. tests
+SUBDIRS= . tests
 
 AM_CFLAGS = \
-I$(top_srcdir)/include \
@@ -46,9 +46,7 @@ endif
 
 lib_LTLIBRARIES = lib@GL_LIB@.la
 
-noinst_LTLIBRARIES = libglx.la
-
-libglx_la_SOURCES = \
+lib@GL_LIB@_la_SOURCES = \
  clientattrib.c \
  clientinfo.c \
  compsize.c \
@@ -88,14 +86,9 @@ libglx_la_SOURCES = \
  dri2.c \
  applegl_glx.c
 
-GL_LIBS = \
-   libglx.la \
+lib@GL_LIB@_la_LIBADD = \
$(top_builddir)/src/mapi/glapi/libglapi.la \
$(GLAPI_LIB) \
$(GL_LIB_DEPS)
 
-GL_LDFLAGS = -Wl,--no-undefined -Wl,-Bsymbolic -shared -version-number 1:2
-
-lib@GL_LIB@_la_SOURCES =
-lib@GL_LIB@_la_LIBADD = $(GL_LIBS)
-lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
+lib@GL_LIB@_la_LDFLAGS = -Wl,--no-undefined -Wl,-Bsymbolic -shared 
-version-number 1:2
diff --git a/src/glx/tests/Makefile.am b/src/glx/tests/Makefile.am
index 494b50a..11f6b25 100644
--- a/src/glx/tests/Makefile.am
+++ b/src/glx/tests/Makefile.am
@@ -18,7 +18,7 @@ glx_test_SOURCES =\
indirect_api.cpp
 
 glx_test_LDADD = \
-   $(top_builddir)/src/glx/libglx.la \
+   $(top_builddir)/src/glx/lib@GL_LIB@.la \
$(top_builddir)/src/gtest/libgtest.la \
$(GLAPI_LIB) \
$(PTHREAD_LIBS)
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 15/21] vdpau, xvmc: Add install-data-hooks to remove unneccessary symlinks.

2013-09-11 Thread Johannes Obermayr
libvdpau_*.so.1 and libXvMC*.so libs are dlopened by wrappers.
So only those libs should be installed.
---
 src/gallium/targets/vdpau-nouveau/Makefile.am  | 5 +
 src/gallium/targets/vdpau-r300/Makefile.am | 5 +
 src/gallium/targets/vdpau-r600/Makefile.am | 5 +
 src/gallium/targets/vdpau-radeonsi/Makefile.am | 5 +
 src/gallium/targets/vdpau-softpipe/Makefile.am | 5 +
 src/gallium/targets/xvmc-nouveau/Makefile.am   | 5 +
 src/gallium/targets/xvmc-r300/Makefile.am  | 5 +
 src/gallium/targets/xvmc-r600/Makefile.am  | 5 +
 src/gallium/targets/xvmc-softpipe/Makefile.am  | 5 +
 9 files changed, 45 insertions(+)

diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index e9c4d33..e6ac32d 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -54,3 +54,8 @@ libvdpau_nouveau_la_LIBADD = \
$(VDPAU_LIBS) \
$(LIBDRM_LIBS) \
$(NOUVEAU_LIBS)
+
+install-data-hook:
+   mv 
$(DESTDIR)$(vdpaudir)/libvdpau_nouveau.so.$(VDPAU_MAJOR).$(VDPAU_MINOR).0 \
+   $(DESTDIR)$(vdpaudir)/libvdpau_nouveau.so.$(VDPAU_MAJOR)  \
+   rm -f $(DESTDIR)$(vdpaudir)/libvdpau_nouveau.so
diff --git a/src/gallium/targets/vdpau-r300/Makefile.am 
b/src/gallium/targets/vdpau-r300/Makefile.am
index 5e124b0..c220da0 100644
--- a/src/gallium/targets/vdpau-r300/Makefile.am
+++ b/src/gallium/targets/vdpau-r300/Makefile.am
@@ -54,3 +54,8 @@ libvdpau_r300_la_LIBADD = \
$(VDPAU_LIBS) \
$(LIBDRM_LIBS) \
$(RADEON_LIBS)
+
+install-data-hook:
+   mv 
$(DESTDIR)$(vdpaudir)/libvdpau_r300.so.$(VDPAU_MAJOR).$(VDPAU_MINOR).0 \
+   $(DESTDIR)$(vdpaudir)/libvdpau_r300.so.$(VDPAU_MAJOR)  \
+   rm -f $(DESTDIR)$(vdpaudir)/libvdpau_r300.so
diff --git a/src/gallium/targets/vdpau-r600/Makefile.am 
b/src/gallium/targets/vdpau-r600/Makefile.am
index 527edd6..949c686 100644
--- a/src/gallium/targets/vdpau-r600/Makefile.am
+++ b/src/gallium/targets/vdpau-r600/Makefile.am
@@ -52,3 +52,8 @@ libvdpau_r600_la_LIBADD = \
$(VDPAU_LIBS) \
$(LIBDRM_LIBS) \
$(RADEON_LIBS)
+
+install-data-hook:
+   mv 
$(DESTDIR)$(vdpaudir)/libvdpau_r600.so.$(VDPAU_MAJOR).$(VDPAU_MINOR).0 \
+   $(DESTDIR)$(vdpaudir)/libvdpau_r600.so.$(VDPAU_MAJOR)  \
+   rm -f $(DESTDIR)$(vdpaudir)/libvdpau_r600.so
diff --git a/src/gallium/targets/vdpau-radeonsi/Makefile.am 
b/src/gallium/targets/vdpau-radeonsi/Makefile.am
index 073c885..fb135f3 100644
--- a/src/gallium/targets/vdpau-radeonsi/Makefile.am
+++ b/src/gallium/targets/vdpau-radeonsi/Makefile.am
@@ -53,3 +53,8 @@ libvdpau_radeonsi_la_LIBADD = \
$(VDPAU_LIBS) \
$(LIBDRM_LIBS) \
$(RADEON_LIBS)
+
+install-data-hook:
+   mv 
$(DESTDIR)$(vdpaudir)/libvdpau_radeonsi.so.$(VDPAU_MAJOR).$(VDPAU_MINOR).0 \
+   $(DESTDIR)$(vdpaudir)/libvdpau_radeonsi.so.$(VDPAU_MAJOR)  \
+   rm -f $(DESTDIR)$(vdpaudir)/libvdpau_radeonsi.so
diff --git a/src/gallium/targets/vdpau-softpipe/Makefile.am 
b/src/gallium/targets/vdpau-softpipe/Makefile.am
index 20ffb6e..2d772d3 100644
--- a/src/gallium/targets/vdpau-softpipe/Makefile.am
+++ b/src/gallium/targets/vdpau-softpipe/Makefile.am
@@ -62,3 +62,8 @@ if HAVE_MESA_LLVM
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 libvdpau_softpipe_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
 endif
+
+install-data-hook:
+   mv 
$(DESTDIR)$(vdpaudir)/libvdpau_softpipe.so.$(VDPAU_MAJOR).$(VDPAU_MINOR).0 \
+   $(DESTDIR)$(vdpaudir)/libvdpau_softpipe.so.$(VDPAU_MAJOR)  \
+   rm -f $(DESTDIR)$(vdpaudir)/libvdpau_softpipe.so
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index 0d5ebe3..0a97d8a 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -52,3 +52,8 @@ libXvMCnouveau_la_LIBADD = \
$(XVMC_LIBS) \
$(LIBDRM_LIBS) \
$(NOUVEAU_LIBS)
+
+install-data-hook:
+   mv $(DESTDIR)$(xvmcdir)/libXvMCnouveau.so.$(XVMC_MAJOR).$(XVMC_MINOR).0 
\
+   $(DESTDIR)$(xvmcdir)/libXvMCnouveau.so  \
+   rm -f $(DESTDIR)$(xvmcdir)/libXvMCnouveau.so.$(XVMC_MAJOR)
diff --git a/src/gallium/targets/xvmc-r300/Makefile.am 
b/src/gallium/targets/xvmc-r300/Makefile.am
index b7dc95a..b662d10 100644
--- a/src/gallium/targets/xvmc-r300/Makefile.am
+++ b/src/gallium/targets/xvmc-r300/Makefile.am
@@ -60,3 +60,8 @@ libXvMCr300_la_LIBADD = \
 if HAVE_MESA_LLVM
 libXvMCr300_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif
+
+install-data-hook:
+   mv $(DESTDIR)$(xvmcdir)/libXvMCr300.so.$(XVMC_MAJOR).$(XVMC_MINOR).0 \
+   $(DESTDIR)$(xvmcdir)/libXvMCr300.so  \
+   rm -f $(DESTDIR)$(xvmcdir)/libXvMCr300.so.$(XVMC_MAJOR)
diff --git a/src/gallium/targets/xvmc-r600/Makefile.am 
b/src/gallium/targets/xvmc-r600/Makefile.am
index 15526d8..86eb72a 100644
--- a/src/gallium/targets/xvmc-r600/Makefile.am
+++ 

[Mesa-dev] [PATCH 18/21] i915: Conditionally build an i915g driver instead of two i915 drivers.

2013-09-11 Thread Johannes Obermayr
---
 configure.ac |  5 +
 src/gallium/targets/dri-i915/Makefile.am | 15 +++
 src/gallium/targets/dri-i915/target.c|  2 +-
 src/gallium/targets/egl-static/Makefile.am   |  4 +++-
 src/gallium/targets/egl-static/egl.c |  2 +-
 src/gallium/targets/egl-static/egl_pipe.c|  2 +-
 src/gallium/targets/pipe-loader/Makefile.am  | 11 ++-
 src/gallium/targets/pipe-loader/pipe_i915.c  |  2 +-
 src/gallium/targets/xorg-i915/Makefile.am| 16 +---
 src/gallium/targets/xorg-i915/intel_target.c |  2 +-
 src/gallium/targets/xorg-i915/intel_xorg.c   |  4 ++--
 11 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/configure.ac b/configure.ac
index 383150a..c600051 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1702,6 +1702,7 @@ fi
 AM_CONDITIONAL(NEED_NONNULL_WINSYS, test x$NEED_NONNULL_WINSYS = xyes)
 
 dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this 
block
+GALLIUM_I915_NAME=i915
 if test x$with_gallium_drivers != x; then
 gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
 for driver in $gallium_drivers; do
@@ -1712,6 +1713,9 @@ if test x$with_gallium_drivers != x; then
 gallium_check_st svga/drm dri-vmwgfx  xa-vmwgfx
 ;;
 xi915)
+if test x$HAVE_I915_DRI = xyes; then
+GALLIUM_I915_NAME=i915g
+fi
 HAVE_GALLIUM_I915=yes
 PKG_CHECK_MODULES([INTEL], [libdrm_intel = 
$LIBDRM_INTEL_REQUIRED])
 GALLIUM_DRIVERS_DIRS=$GALLIUM_DRIVERS_DIRS i915 softpipe
@@ -1804,6 +1808,7 @@ if test x$with_gallium_drivers != x; then
 esac
 done
 fi
+AC_SUBST([GALLIUM_I915_NAME])
 
 function strip_llvm_libs() {
 _libs=`$2`
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index 7ad3ff5..5f54bf3 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -25,7 +25,8 @@ include $(top_srcdir)/src/gallium/Automake.inc
 AM_CFLAGS = \
$(GALLIUM_CFLAGS) \
$(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
+   $(LIBDRM_CFLAGS) \
+   -DI915_NAME=\@GALLIUM_I915_NAME@\
 
 AM_CPPFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
@@ -40,13 +41,13 @@ AM_CPPFLAGS = \
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 
-dri_LTLIBRARIES = i915_dri.la
+dri_LTLIBRARIES = @GALLIUM_I915_NAME@_dri.la
 
-i915_dri_la_SOURCES = target.c
+@GALLIUM_I915_NAME@_dri_la_SOURCES = target.c
 
-i915_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version -shared
+@GALLIUM_I915_NAME@_dri_la_LDFLAGS = -Wl,--no-undefined -module -avoid-version 
-shared
 
-i915_dri_la_LIBADD = \
+@GALLIUM_I915_NAME@_dri_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
$(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \
$(top_builddir)/src/gallium/winsys/sw/wrapper/libwsw.la \
@@ -60,9 +61,7 @@ i915_dri_la_LIBADD = \
$(GALLIUM_DRI_LIB_DEPS) \
$(INTEL_LIBS)
 
-nodist_EXTRA_i915_dri_la_SOURCES = dummy.cpp
-
 if HAVE_MESA_LLVM
 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
-i915_dri_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
+@GALLIUM_I915_NAME@_dri_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
 endif
diff --git a/src/gallium/targets/dri-i915/target.c 
b/src/gallium/targets/dri-i915/target.c
index 935eb0e..05dc254 100644
--- a/src/gallium/targets/dri-i915/target.c
+++ b/src/gallium/targets/dri-i915/target.c
@@ -26,4 +26,4 @@ create_screen(int fd)
return screen;
 }
 
-DRM_DRIVER_DESCRIPTOR(i915, i915, create_screen, NULL)
+DRM_DRIVER_DESCRIPTOR(I915_NAME, i915, create_screen, NULL)
diff --git a/src/gallium/targets/egl-static/Makefile.am 
b/src/gallium/targets/egl-static/Makefile.am
index 015133c..daec14c 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -30,7 +30,9 @@
 #
 include $(top_srcdir)/src/gallium/Automake.inc
 
-AM_CFLAGS = $(PTHREAD_CFLAGS)
+AM_CFLAGS = $(PTHREAD_CFLAGS) \
+   -DI915_NAME=\@GALLIUM_I915_NAME@\
+
 AM_CPPFLAGS = \
$(GALLIUM_CFLAGS) \
-I$(top_srcdir)/include \
diff --git a/src/gallium/targets/egl-static/egl.c 
b/src/gallium/targets/egl-static/egl.c
index 0b59bdb..1af7c43 100644
--- a/src/gallium/targets/egl-static/egl.c
+++ b/src/gallium/targets/egl-static/egl.c
@@ -136,7 +136,7 @@ drm_fd_get_pci_id(int fd, int *vendor_id, int *chip_id)
   return FALSE;
}
 
-   if (util_strcmp(version-name, i915) == 0) {
+   if (util_strcmp(version-name, I915_NAME) == 0) {
   struct drm_i915_getparam gp;
   int ret;
 
diff --git a/src/gallium/targets/egl-static/egl_pipe.c 
b/src/gallium/targets/egl-static/egl_pipe.c
index e5100c1..f6bc188 100644
--- a/src/gallium/targets/egl-static/egl_pipe.c
+++ b/src/gallium/targets/egl-static/egl_pipe.c
@@ -227,7 +227,7 @@ pipe_freedreno_create_screen(int fd)
 struct 

[Mesa-dev] [PATCH 14/21] gallium/drivers: Build libs -shared.

2013-09-11 Thread Johannes Obermayr
---
 configure.ac | 20 +
 src/gallium/drivers/Makefile.am  | 28 +++-
 src/gallium/drivers/freedreno/Makefile.am| 10 ++---
 src/gallium/drivers/freedreno/freedreno_screen.c |  2 ++
 src/gallium/drivers/galahad/glhd_screen.c|  2 ++
 src/gallium/drivers/i915/Makefile.am |  8 ++-
 src/gallium/drivers/i915/i915_debug.c|  3 ++-
 src/gallium/drivers/i915/i915_screen.c   |  3 +++
 src/gallium/drivers/identity/id_screen.c |  2 ++
 src/gallium/drivers/ilo/Makefile.am  | 22 +++
 src/gallium/drivers/ilo/ilo_screen.c |  3 +++
 src/gallium/drivers/llvmpipe/Makefile.am | 10 +++--
 src/gallium/drivers/noop/noop_pipe.c |  2 ++
 src/gallium/drivers/nouveau/Makefile.am  |  8 ++-
 src/gallium/drivers/nouveau/nv30/nv30_screen.c   |  3 +++
 src/gallium/drivers/nouveau/nv50/nv50_screen.c   |  2 ++
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   |  2 ++
 src/gallium/drivers/r300/Makefile.am | 13 ++-
 src/gallium/drivers/r300/r300_screen.c   |  4 
 src/gallium/drivers/r600/Makefile.am | 17 --
 src/gallium/drivers/r600/r600_pipe.c |  2 ++
 src/gallium/drivers/radeonsi/Makefile.am | 16 --
 src/gallium/drivers/radeonsi/radeonsi_pipe.c |  2 ++
 src/gallium/drivers/rbug/Makefile.am | 13 ---
 src/gallium/drivers/rbug/rbug_screen.c   |  2 ++
 src/gallium/drivers/softpipe/Makefile.am |  8 ++-
 src/gallium/drivers/svga/Makefile.am |  9 +---
 src/gallium/drivers/svga/svga_screen.c   |  4 
 src/gallium/drivers/trace/Makefile.am| 11 +++---
 src/gallium/drivers/trace/tr_screen.c|  3 +++
 src/gallium/targets/dri-freedreno/Makefile.am|  7 ++
 src/gallium/targets/dri-r600/Makefile.am |  2 --
 src/gallium/targets/dri-radeonsi/Makefile.am |  2 --
 src/gallium/targets/dri-swrast/Makefile.am   |  4 +++-
 src/gallium/targets/egl-static/Makefile.am   |  9 +---
 src/gallium/targets/pipe-loader/Makefile.am  |  4 
 src/gallium/targets/vdpau-r300/Makefile.am   |  3 ---
 src/gallium/targets/vdpau-r600/Makefile.am   |  3 ---
 src/gallium/targets/vdpau-radeonsi/Makefile.am   |  5 -
 src/gallium/targets/vdpau-softpipe/Makefile.am   |  6 ++---
 src/gallium/targets/xorg-r600/Makefile.am|  2 --
 src/gallium/targets/xorg-radeonsi/Makefile.am|  2 --
 src/gallium/targets/xvmc-r600/Makefile.am|  2 --
 src/gallium/targets/xvmc-softpipe/Makefile.am|  3 ++-
 44 files changed, 216 insertions(+), 72 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1a98626..383150a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1838,6 +1838,16 @@ if test x$ac_cv_lib__llvm_one_shared_lib = xyes; then
 if test -n $LLVM_GALLIUM_COMPONENTS; then
 LLVM_GALLIUM_LIBS=-l$LLVM_SO_NAME
 fi
+if test -n $LLVM_OPENCL_COMPONENTS; then
+LLVM_OPENCL_LIBS=-l$LLVM_SO_NAME
+fi
+if test -n $LLVM_RADEON_COMPONENTS; then
+LLVM_RADEON_LIBS=-l$LLVM_SO_NAME
+fi
+if test -n $LLVM_R600_COMPONENTS; then
+LLVM_R600_LIBS=-l$LLVM_SO_NAME
+fi
+LLVM_LLVMPIPE_LIBS=-l$LLVM_SO_NAME
 else
 if test -n $LLVM_GALLIUM_COMPONENTS; then
 LLVM_GALLIUM_LIBS=`$LLVM_CONFIG --libs $LLVM_GALLIUM_COMPONENTS`
@@ -1855,6 +1865,7 @@ else
 LLVM_R600_LIBS=`strip_llvm_libs $LLVM_GALLIUM_LIBS $LLVM_CONFIG 
--libs $LLVM_R600_COMPONENTS`
 fi
 fi
+LLVM_LLVMPIPE_LIBS=`$LLVM_CONFIG --libs core`
 fi
 fi
 
@@ -1862,6 +1873,7 @@ AC_SUBST([LLVM_GALLIUM_LIBS])
 AC_SUBST([LLVM_OPENCL_LIBS])
 AC_SUBST([LLVM_RADEON_LIBS])
 AC_SUBST([LLVM_R600_LIBS])
+AC_SUBST([LLVM_LLVMPIPE_LIBS])
 
 AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test x$HAVE_GALLIUM_SVGA = xyes)
 AM_CONDITIONAL(HAVE_GALLIUM_I915, test x$HAVE_GALLIUM_I915 = xyes)
@@ -1914,6 +1926,14 @@ AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test 
x$HAVE_GALLIUM_I915 = xyes -o \
  x$HAVE_GALLIUM_SVGA = xyes)
 AM_CONDITIONAL(NEED_WINSYS_XLIB, test x$NEED_WINSYS_XLIB = xyes)
 AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
+dnl Whether libr300-helper must be built
+NEED_R300_HELPER=no
+if test true  (echo $GALLIUM_TARGET_DIRS | \
+   grep -e pipe-loader -e vdpau-r300 -e xorg-r300 -e xvmc-r300); 
then
+NEED_R300_HELPER=yes
+fi
+AM_CONDITIONAL(NEED_R300_HELPER, test x$NEED_R300_HELPER = xyes)
+
 AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
 AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
 AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = 
xyes)
diff --git a/src/gallium/drivers/Makefile.am b/src/gallium/drivers/Makefile.am
index 171d102..7b0808b 100644
--- 

[Mesa-dev] [PATCH 19/21] freedreno: Make print_sequence a macro to fix clang.

2013-09-11 Thread Johannes Obermayr
---
 src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c 
b/src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c
index 4db095f..ed76a78 100644
--- a/src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c
+++ b/src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c
@@ -154,28 +154,26 @@ static struct {
regmask_t cnst; /* used consts */
 } regs;
 
+#define fd_print_sequence \
+   if (first != MAX_REG) { \
+   if (first == last) { \
+   printf( %d, first); \
+   } else { \
+   printf( %d-%d, first, last); \
+   } \
+   }
+
 static void print_regs(regmask_t *regmask, bool full)
 {
int num, max = 0, cnt = 0;
int first, last;
 
-   void print_sequence(void)
-   {
-   if (first != MAX_REG) {
-   if (first == last) {
-   printf( %d, first);
-   } else {
-   printf( %d-%d, first, last);
-   }
-   }
-   }
-
first = last = MAX_REG;
 
for (num = 0; num  MAX_REG; num++) {
if (regmask_get(regmask, num, full)) {
if (num != (last + 1)) {
-   print_sequence();
+   fd_print_sequence;
first = num;
}
last = num;
@@ -184,7 +182,7 @@ static void print_regs(regmask_t *regmask, bool full)
}
}
 
-   print_sequence();
+   fd_print_sequence;
 
printf( (cnt=%d, max=%d), cnt, max);
 }
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 17/21] gbm: Get rid of libgbm_dri.la.

2013-09-11 Thread Johannes Obermayr
---
 src/gbm/Makefile.am | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
index 440d4e0..4859e7c 100644
--- a/src/gbm/Makefile.am
+++ b/src/gbm/Makefile.am
@@ -28,18 +28,15 @@ libgbm_la_LIBADD += 
$(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.l
 endif
 
 if HAVE_DRI
-noinst_LTLIBRARIES = libgbm_dri.la
-libgbm_dri_la_SOURCES = \
+libgbm_la_SOURCES += \
backends/dri/gbm_dri.c \
backends/dri/driver_name.c
 
-libgbm_dri_la_CFLAGS = \
-   $(AM_CFLAGS) \
+AM_CFLAGS += \
-DDEFAULT_DRIVER_DIR='$(DRI_DRIVER_SEARCH_DIR)' \
$(LIBDRM_CFLAGS)
 
 libgbm_la_LIBADD += \
-   libgbm_dri.la \
$(GLAPI_LIB) \
$(LIBDRM_LIBS)
 endif
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 20/21] freedreno: One Makefile.am with a Makefile.sources is enough.

2013-09-11 Thread Johannes Obermayr
---
 configure.ac   |  2 --
 src/gallium/drivers/freedreno/Makefile.am  | 18 +++
 src/gallium/drivers/freedreno/Makefile.sources | 43 ++
 src/gallium/drivers/freedreno/a2xx/Makefile.am | 27 
 src/gallium/drivers/freedreno/a3xx/Makefile.am | 27 
 5 files changed, 47 insertions(+), 70 deletions(-)
 create mode 100644 src/gallium/drivers/freedreno/Makefile.sources
 delete mode 100644 src/gallium/drivers/freedreno/a2xx/Makefile.am
 delete mode 100644 src/gallium/drivers/freedreno/a3xx/Makefile.am

diff --git a/configure.ac b/configure.ac
index c600051..2381cf0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2006,8 +2006,6 @@ AC_CONFIG_FILES([Makefile
src/gallium/auxiliary/pipe-loader/Makefile
src/gallium/drivers/Makefile
src/gallium/drivers/freedreno/Makefile
-   src/gallium/drivers/freedreno/a2xx/Makefile
-   src/gallium/drivers/freedreno/a3xx/Makefile
src/gallium/drivers/i915/Makefile
src/gallium/drivers/ilo/Makefile
src/gallium/drivers/llvmpipe/Makefile
diff --git a/src/gallium/drivers/freedreno/Makefile.am 
b/src/gallium/drivers/freedreno/Makefile.am
index 414eed5..7ce3620 100644
--- a/src/gallium/drivers/freedreno/Makefile.am
+++ b/src/gallium/drivers/freedreno/Makefile.am
@@ -1,3 +1,4 @@
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 mesalib_LTLIBRARIES = libfreedreno.la
@@ -11,25 +12,14 @@ AM_CFLAGS = \
$(FREEDRENO_CFLAGS) \
$(VISIBILITY_CFLAGS)
 
-SUBDIRS = a2xx a3xx
-
 libfreedreno_la_LDFLAGS = \
-Wl,--no-undefined -shared -avoid-version
 
 libfreedreno_la_SOURCES = \
-   freedreno_util.c \
-   freedreno_fence.c \
-   freedreno_resource.c \
-   freedreno_surface.c \
-   freedreno_draw.c \
-   freedreno_state.c \
-   freedreno_texture.c \
-   freedreno_context.c \
-   freedreno_screen.c \
-   freedreno_gmem.c
+   $(C_SOURCES) \
+   $(A2XX_SOURCES) \
+   $(A3XX_SOURCES)
 
 libfreedreno_la_LIBADD = \
-   a3xx/libfd3xx.la \
-   a2xx/libfd2xx.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(FREEDRENO_LIBS)
diff --git a/src/gallium/drivers/freedreno/Makefile.sources 
b/src/gallium/drivers/freedreno/Makefile.sources
new file mode 100644
index 000..b287740
--- /dev/null
+++ b/src/gallium/drivers/freedreno/Makefile.sources
@@ -0,0 +1,43 @@
+C_SOURCES = \
+   freedreno_util.c \
+   freedreno_fence.c \
+   freedreno_resource.c \
+   freedreno_surface.c \
+   freedreno_draw.c \
+   freedreno_state.c \
+   freedreno_texture.c \
+   freedreno_context.c \
+   freedreno_screen.c \
+   freedreno_gmem.c
+
+A2XX_SOURCES = \
+   a2xx/fd2_blend.c \
+   a2xx/fd2_compiler.c \
+   a2xx/fd2_context.c \
+   a2xx/fd2_draw.c \
+   a2xx/fd2_emit.c \
+   a2xx/fd2_gmem.c \
+   a2xx/fd2_program.c \
+   a2xx/fd2_rasterizer.c \
+   a2xx/fd2_screen.c \
+   a2xx/fd2_texture.c \
+   a2xx/fd2_util.c \
+   a2xx/fd2_zsa.c \
+   a2xx/disasm-a2xx.c \
+   a2xx/ir-a2xx.c
+
+A3XX_SOURCES = \
+   a3xx/fd3_blend.c \
+   a3xx/fd3_compiler.c \
+   a3xx/fd3_context.c \
+   a3xx/fd3_draw.c \
+   a3xx/fd3_emit.c \
+   a3xx/fd3_gmem.c \
+   a3xx/fd3_program.c \
+   a3xx/fd3_rasterizer.c \
+   a3xx/fd3_screen.c \
+   a3xx/fd3_texture.c \
+   a3xx/fd3_util.c \
+   a3xx/fd3_zsa.c \
+   a3xx/disasm-a3xx.c \
+   a3xx/ir-a3xx.c
diff --git a/src/gallium/drivers/freedreno/a2xx/Makefile.am 
b/src/gallium/drivers/freedreno/a2xx/Makefile.am
deleted file mode 100644
index 8ab0f76..000
--- a/src/gallium/drivers/freedreno/a2xx/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-include $(top_srcdir)/src/gallium/Automake.inc
-
-noinst_LTLIBRARIES = libfd2xx.la
-
-AM_CFLAGS = \
-   -Wno-packed-bitfield-compat \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/drivers/freedreno \
-   $(GALLIUM_CFLAGS) \
-   $(FREEDRENO_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
-
-libfd2xx_la_SOURCES = \
-   fd2_blend.c \
-   fd2_compiler.c \
-   fd2_context.c \
-   fd2_draw.c \
-   fd2_emit.c \
-   fd2_gmem.c \
-   fd2_program.c \
-   fd2_rasterizer.c \
-   fd2_screen.c \
-   fd2_texture.c \
-   fd2_util.c \
-   fd2_zsa.c \
-   disasm-a2xx.c \
-   ir-a2xx.c
diff --git a/src/gallium/drivers/freedreno/a3xx/Makefile.am 
b/src/gallium/drivers/freedreno/a3xx/Makefile.am
deleted file mode 100644
index a7e415f..000
--- a/src/gallium/drivers/freedreno/a3xx/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-include $(top_srcdir)/src/gallium/Automake.inc
-
-noinst_LTLIBRARIES = libfd3xx.la
-
-AM_CFLAGS = \
-   -Wno-packed-bitfield-compat \
-   -I$(top_srcdir)/src/gallium/drivers \
-   

[Mesa-dev] [PATCH 21/21] clover: Force gcc and g++ to fix clang builds.

2013-09-11 Thread Johannes Obermayr
---
 configure.ac  | 6 ++
 src/gallium/state_trackers/clover/Makefile.am | 8 
 2 files changed, 14 insertions(+)

diff --git a/configure.ac b/configure.ac
index 2381cf0..491b8c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1989,6 +1989,12 @@ cxxflags=$CXXFLAGS
 CFLAGS=$CFLAGS $USER_CFLAGS
 CXXFLAGS=$CXXFLAGS $USER_CXXFLAGS
 
+dnl Filter-out clang specific switches for clover
+CLOVER_CFLAGS=$(echo $CFLAGS | sed -e s:-mllvm -\w*\::g -e 
s:-Qunused-arguments\::g)
+CLOVER_CXXFLAGS=$(echo $CXXFLAGS | sed -e s:-mllvm -\w*\::g -e 
s:-Qunused-arguments\::g)
+AC_SUBST([CLOVER_CFLAGS])
+AC_SUBST([CLOVER_CXXFLAGS])
+
 dnl Substitute the config
 AC_CONFIG_FILES([Makefile
src/Makefile
diff --git a/src/gallium/state_trackers/clover/Makefile.am 
b/src/gallium/state_trackers/clover/Makefile.am
index fd38766..7d4de00 100644
--- a/src/gallium/state_trackers/clover/Makefile.am
+++ b/src/gallium/state_trackers/clover/Makefile.am
@@ -1,5 +1,13 @@
 AUTOMAKE_OPTIONS = subdir-objects
 
+CC = gcc
+CPP = gcc -E
+CXX = g++
+CXXCPP = g++ -E
+
+CFLAGS = $(CLOVER_CFLAGS)
+CXXFLAGS = $(CLOVER_CXXFLAGS)
+
 AM_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\$(mesalibdir)\ \
-- 
1.8.1.4

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


Re: [Mesa-dev] [PATCH v2 1/3] gallium: add flush_resource context function

2013-09-11 Thread Marek Olšák
The series looks good. I'll commit this in a few days if there are no concerns.

I expect non-DRI window system backends and DDX state trackers to
break with r600g because of missing flush_resource calls, but that's
expected and can be fixed later if we find out those gallium
components are important to our users.

Marek

On Wed, Sep 11, 2013 at 1:41 AM, Grigori Goronzy g...@chown.ath.cx wrote:
 From: Marek Olšák mar...@gmail.com

 r600g needs explicit flushing before DRI2 buffers are presented on the screen.

 v2: add (stub) implementations for all drivers, fix frontbuffer flushing
 v3: fix galahad
 ---
  src/gallium/docs/source/context.rst | 13 +
  src/gallium/drivers/freedreno/freedreno_resource.c  |  6 ++
  src/gallium/drivers/galahad/glhd_context.c  | 13 +
  src/gallium/drivers/i915/i915_surface.c |  6 ++
  src/gallium/drivers/identity/id_context.c   | 11 +++
  src/gallium/drivers/ilo/ilo_blit.c  |  6 ++
  src/gallium/drivers/llvmpipe/lp_surface.c   |  7 +++
  src/gallium/drivers/noop/noop_pipe.c|  8 
  src/gallium/drivers/nv30/nv30_miptree.c |  6 ++
  src/gallium/drivers/nv30/nv30_resource.c|  1 +
  src/gallium/drivers/nv30/nv30_resource.h|  4 
  src/gallium/drivers/nv50/nv50_surface.c |  7 +++
  src/gallium/drivers/nvc0/nvc0_surface.c |  7 +++
  src/gallium/drivers/r300/r300_blit.c|  6 ++
  src/gallium/drivers/r600/r600_blit.c|  6 ++
  src/gallium/drivers/radeonsi/r600_blit.c|  6 ++
  src/gallium/drivers/rbug/rbug_context.c | 15 +++
  src/gallium/drivers/softpipe/sp_surface.c   |  7 +++
  src/gallium/drivers/svga/svga_pipe_blit.c   |  8 
  src/gallium/drivers/trace/tr_context.c  | 21 
 +
  src/gallium/include/pipe/p_context.h| 13 +
  .../state_trackers/dri/common/dri_drawable.c|  4 
  src/gallium/state_trackers/dri/drm/dri2.c   | 10 +++---
  23 files changed, 188 insertions(+), 3 deletions(-)

 diff --git a/src/gallium/docs/source/context.rst 
 b/src/gallium/docs/source/context.rst
 index 95f6b22..d5b4d77 100644
 --- a/src/gallium/docs/source/context.rst
 +++ b/src/gallium/docs/source/context.rst
 @@ -423,6 +423,19 @@ Flushing
  ``flush``


 +``flush_resource``
 +
 +Flush the resource cache, so that the resource can be used
 +by an external client. Possible usage:
 +- flushing a resource before presenting it on the screen
 +- flushing a resource if some other process or device wants to use it
 +This shouldn't be used to flush caches if the resource is only managed
 +by a single pipe_screen and is not shared with another process.
 +(i.e. you shouldn't use it to flush caches explicitly if you want to e.g.
 +use the resource for texturing)
 +
 +
 +
  Resource Busy Queries
  ^

 diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c 
 b/src/gallium/drivers/freedreno/freedreno_resource.c
 index 3e051ea..3a7e31c 100644
 --- a/src/gallium/drivers/freedreno/freedreno_resource.c
 +++ b/src/gallium/drivers/freedreno/freedreno_resource.c
 @@ -337,6 +337,11 @@ render_blit(struct pipe_context *pctx, struct 
 pipe_blit_info *info)
 return true;
  }

 +static void
 +fd_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
 +{
 +}
 +
  void
  fd_resource_screen_init(struct pipe_screen *pscreen)
  {
 @@ -357,4 +362,5 @@ fd_resource_context_init(struct pipe_context *pctx)
 pctx-surface_destroy = fd_surface_destroy;
 pctx-resource_copy_region = fd_resource_copy_region;
 pctx-blit = fd_blit;
 +   pctx-flush_resource = fd_flush_resource;
  }
 diff --git a/src/gallium/drivers/galahad/glhd_context.c 
 b/src/gallium/drivers/galahad/glhd_context.c
 index ee9de05..3df22ce 100644
 --- a/src/gallium/drivers/galahad/glhd_context.c
 +++ b/src/gallium/drivers/galahad/glhd_context.c
 @@ -783,6 +783,18 @@ galahad_context_blit(struct pipe_context *_pipe,
  }

  static void
 +galahad_context_flush_resource(struct pipe_context *_pipe,
 +   struct pipe_resource *_res)
 +{
 +   struct galahad_context *glhd_pipe = galahad_context(_pipe);
 +   struct galahad_resource *glhd_resource_res = galahad_resource(_res);
 +   struct pipe_context *pipe = glhd_pipe-pipe;
 +   struct pipe_resource *res = glhd_resource_res-resource;
 +
 +   pipe-flush_resource(pipe, res);
 +}
 +
 +static void
  galahad_context_clear(struct pipe_context *_pipe,
 unsigned buffers,
 const union pipe_color_union *color,
 @@ -1096,6 +1108,7 @@ galahad_context_create(struct pipe_screen *_screen, 
 struct pipe_context *pipe)
 GLHD_PIPE_INIT(set_stream_output_targets);
 GLHD_PIPE_INIT(resource_copy_region);
 

Re: [Mesa-dev] The long way to a faster build with shared libs and some fixes ...

2013-09-11 Thread Tom Stellard
Hi Johannes,

Could explain how you tested these patches:  The configure flags you
used to build as well as the applications/hardware you used for testing.

Thanks,
Tom

On Thu, Sep 12, 2013 at 12:32:38AM +0200, Johannes Obermayr wrote:
 [PATCH 01/21] ilo: Fix out-of-tree build.
 
 [PATCH 02/21] Suppress clang's warnings about unused CFLAGS and CXXFLAGS.
 
 [PATCH 03/21] configure.ac: Save user {C,CXX}FLAGS and append them at end.
 
 [PATCH 04/21] radeon: Build and use libradeon the right way.
   Link libradeon only once in egl-static
 
 [PATCH 05/21] gallium/targets: Make use of prebuilt libdricommon.la.
   Avoid duplicate build.
 
 [PATCH 06/21] Drop support for --enable-static / --disable-shared.
 
 [PATCH 07/21] gallium/auxiliary: Build libgallium shared.
   Hundreds of symbols to be PUBLIC. But saves on a full build
   19 x ~ 1.8 MB.
 
 [PATCH 08/21] Drop last parts of compatibility for the old Mesa build
   I want it to avoid these stupid symlinks while distro build but
   with more work on follow-up patches it should be possible to 
 keep
 
 [PATCH 09/21] mapi: Build libglapi always shared.
   I assume it could be improved later
 
 [PATCH 10/21] mesa: Build libmesa shared.
   Hundreds of PUBLICs but we can get rid of libdricore and get an
   libmesadri which depends as well as libmesagallium on a 
 libmesacore.
   This really speeds up build since duplicate build in libdricore
   with all PUBLIC can be avoided.
   Also dlopen classic drivers should be faster.
 
 [PATCH 11/21] Install all internal shared libs to $(libdir)/mesa-$VERSION.
 
 [PATCH 12/21] Also do it for egl_gallium.so, pipe_*.so and gbm_gallium_drm.
 
 [PATCH 13/21] Makefile.am: s:-no-undefined:-Wl,--no-undefined to make it work.
   libtool will set it back to allow_undefined=yes in 
 func_mode_link ()
   otherwise.
 
 [PATCH 14/21] gallium/drivers: Build libs -shared.
 
 [PATCH 15/21] vdpau,xvmc: Add install-data-hooks to remove unneccessary 
 symlinks.
   libvdpau_*.so.1 and libXvMC*.so libs are dlopened by wrappers.
   Nothing should link them directly.
 
 [PATCH 16/21] glx: Get rid of libglx.la.
 
 [PATCH 17/21] gbm: Get rid of libgbm_dri.la.
 
 [PATCH 18/21] i915: Conditionally build an i915g driver instead of
 
 [PATCH 19/21] freedreno: Make print_sequence a macro to fix clang.
 
 [PATCH 20/21] freedreno: One Makefile.am with a Makefile.sources is
 
 [PATCH 21/21] clover: Force gcc and g++ to fix clang builds.
 
 
 openSUSE x86_64 binary RPMs will look like this:
 $ du -a etc/ usr/
 4   etc/drirc
 8   etc/
 88  usr/lib64/libXvMCr600.so
 140 usr/lib64/libEGL.so.1.0.0
 0   usr/lib64/libGL.so.1.2
 380 usr/lib64/libGL.so.1.2.0
 0   usr/lib64/libGLESv1_CM.so.1
 88  usr/lib64/libXvMCr300.so
 36  usr/lib64/libXvMCsoftpipe.so
 212 usr/lib64/mesa-9.2.0/libllvmpipe.so
 608 usr/lib64/mesa-9.2.0/libmesadri.so
 324 usr/lib64/mesa-9.2.0/libmesagallium.so
 1140usr/lib64/mesa-9.2.0/libnouveau.so
 60  usr/lib64/mesa-9.2.0/libtrace.so
 60  usr/lib64/mesa-9.2.0/pipe_r600.so
 308 usr/lib64/mesa-9.2.0/libr300.so
 20  usr/lib64/mesa-9.2.0/libgalahad.so
 16  usr/lib64/mesa-9.2.0/libnoop.so
 32  usr/lib64/mesa-9.2.0/librbug.so
 60  usr/lib64/mesa-9.2.0/pipe_r300.so
 60  usr/lib64/mesa-9.2.0/pipe_radeonsi.so
 164 usr/lib64/mesa-9.2.0/egl_gallium.so
 152 usr/lib64/mesa-9.2.0/libglapi.so
 136 usr/lib64/mesa-9.2.0/libradeonsi.so
 16  usr/lib64/mesa-9.2.0/libr300-helper.so
 16  usr/lib64/mesa-9.2.0/libidentity.so
 8   usr/lib64/mesa-9.2.0/pipe_nouveau.so
 184 usr/lib64/mesa-9.2.0/libsvga.so
 1888usr/lib64/mesa-9.2.0/libgallium.so
 20  usr/lib64/mesa-9.2.0/gbm_gallium_drm.so
 1016usr/lib64/mesa-9.2.0/libr600.so
 20  usr/lib64/mesa-9.2.0/pipe_vmwgfx.so
 3228usr/lib64/mesa-9.2.0/libmesacore.so
 152 usr/lib64/mesa-9.2.0/libsoftpipe.so
 8   usr/lib64/mesa-9.2.0/pipe_swrast.so
 9912usr/lib64/mesa-9.2.0
 0   usr/lib64/libOSMesa.so.8
 0   usr/lib64/libxatracker.so.1
 64  usr/lib64/dri/swrast_dri.so
 184 usr/lib64/dri/nouveau_vieux_dri.so
 116 usr/lib64/dri/r600_dri.so
 288 usr/lib64/dri/radeon_dri.so
 876 usr/lib64/dri/i965_dri.so
 320 usr/lib64/dri/r200_dri.so
 116 usr/lib64/dri/r300_dri.so
 120 usr/lib64/dri/radeonsi_dri.so
 72  usr/lib64/dri/nouveau_dri.so
 4   usr/lib64/dri/updates/README.updates
 8   usr/lib64/dri/updates
 324 usr/lib64/dri/i915_dri.so
 84  usr/lib64/dri/vmwgfx_dri.so
 2576usr/lib64/dri
 28  usr/lib64/libgbm.so.1.0.0
 0   usr/lib64/libGL.so.1
 8   usr/lib64/libwayland-egl.so.1.0.0
 116 usr/lib64/libxatracker.so.1.0.0
 32  usr/lib64/libOSMesa.so.8.0.0
 28  usr/lib64/libGLESv1_CM.so.1.1.0
 0   usr/lib64/libGLESv2.so.2
 112

Re: [Mesa-dev] [PATCH 11/17] mesa: Get GL_MAX_VARYING_FLOATS_ARB from VertexProgram.MaxOutputComponents

2013-09-11 Thread Ian Romanick
On 09/11/2013 04:05 PM, Paul Berry wrote:
 On 10 September 2013 12:10, Ian Romanick i...@freedesktop.org
 mailto:i...@freedesktop.org wrote:
 
 From: Ian Romanick ian.d.roman...@intel.com
 mailto:ian.d.roman...@intel.com
 
 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 mailto:ian.d.roman...@intel.com
 ---
  src/mesa/main/get.c  | 4 
  src/mesa/main/get_hash_params.py | 2 +-
  2 files changed, 1 insertion(+), 5 deletions(-)
 
 diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
 index 34eb6be..ae45bf8 100644
 --- a/src/mesa/main/get.c
 +++ b/src/mesa/main/get.c
 @@ -718,10 +718,6 @@ find_custom_value(struct gl_context *ctx, const
 struct value_desc *d, union valu
ASSERT(v-value_int_n.n = ARRAY_SIZE(v-value_int_n.ints));
break;
 
 -   case GL_MAX_VARYING_FLOATS_ARB:
 -  v-value_int = ctx-Const.MaxVarying * 4;
 -  break;
 -
 /* Various object names */
 
 case GL_TEXTURE_BINDING_1D:
 diff --git a/src/mesa/main/get_hash_params.py
 b/src/mesa/main/get_hash_params.py
 index c0dbf45..3d47443 100644
 --- a/src/mesa/main/get_hash_params.py
 +++ b/src/mesa/main/get_hash_params.py
 @@ -365,7 +365,7 @@ descriptor=[
 
  # GL_ARB_vertex_shader
[ MAX_VERTEX_UNIFORM_COMPONENTS_ARB,
 CONTEXT_INT(Const.VertexProgram.MaxUniformComponents),
 extra_ARB_vertex_shader ],
 -  [ MAX_VARYING_FLOATS_ARB, LOC_CUSTOM, TYPE_INT, 0,
 extra_ARB_vertex_shader ],
 +  [ MAX_VARYING_FLOATS_ARB,
 CONTEXT_INT(Const.VertexProgram.MaxOutputComponents),
 extra_ARB_vertex_shader ],
 
  # GL_EXT_framebuffer_blit
  # NOTE: GL_DRAW_FRAMEBUFFER_BINDING_EXT == GL_FRAMEBUFFER_BINDING_EXT
 --
 1.8.1.4
 
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org mailto:mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
 
 Doesn't MAX_VARYING_FLOATS need to be MIN2(MAX_VERTEX_OUTPUT_COMPONENTS,
 MAX_FRAGMENT_INPUT_COMPONENTS)?  I can imagine an implementation where
 MAX_FRAGMENT_INPUT_COMPONENTS is the smaller constraint (in fact, ES3's
 minimum maximums constitute just such a case).

It's all so much more horrible than you think. :)

OpenGL 3.2 sets:

MAX_VARYING_COMPONENTS: 60
MAX_VERTEX_OUTPUT_COMPONENTS: 64
MAX_FRAGMENT_INPUT_COMPONENTS: 128

OpenGL ES 3.0 sets:

MAX_VARYING_COMPONENTS: 60
MAX_VARYING_VECTORS: 15
MAX_VERTEX_OUTPUT_VECTORS: 16
MAX_VERTEX_OUTPUT_COMPONENTS: 64
MAX_FRAGMENT_INPUT_VECTORS: 15
MAX_FRAGMENT_INPUT_COMPONENTS: 60

BUT the description of MAX_VARYING_COMPONENTS in GLES3 says:

Number of components for output variables.

So... OpenGL 3.2 makes no sense, and OpenGL ES 3.0 seems self
contradictory.  The core problem seems to be the way that each API (and
each driver) counts gl_Position and gl_FragCoord.  Some say it's
counted, some say it's not counted, and some say it might be counted.
Our existing infrastructure may not be sufficient to handle all
combinations of those cases.

In the end, I opted to use VertexProgram.MaxOutputComponents because
MAX_VARYING_FLOATS was added by GL_ARB_vertex_shader.

I guess I'm not sure what the right answer actually is now. :(
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] The long way to a faster build with shared libs and some fixes ...

2013-09-11 Thread Marek Olšák
I don't like this. I prefer to have one big blob for whole Mesa as
discussed on Eric's blog:

http://anholt.livejournal.com/43652.html

I have no problem with longer compile times for release builds if I
get a little bit higher CPU performance with link-time optimizations.
And for debug builds, we can stick to standard -O2 -g or -O0 -g.

Marek

On Thu, Sep 12, 2013 at 12:32 AM, Johannes Obermayr
johannesoberm...@gmx.de wrote:
 [PATCH 01/21] ilo: Fix out-of-tree build.

 [PATCH 02/21] Suppress clang's warnings about unused CFLAGS and CXXFLAGS.

 [PATCH 03/21] configure.ac: Save user {C,CXX}FLAGS and append them at end.

 [PATCH 04/21] radeon: Build and use libradeon the right way.
   Link libradeon only once in egl-static

 [PATCH 05/21] gallium/targets: Make use of prebuilt libdricommon.la.
   Avoid duplicate build.

 [PATCH 06/21] Drop support for --enable-static / --disable-shared.

 [PATCH 07/21] gallium/auxiliary: Build libgallium shared.
   Hundreds of symbols to be PUBLIC. But saves on a full build
   19 x ~ 1.8 MB.

 [PATCH 08/21] Drop last parts of compatibility for the old Mesa build
   I want it to avoid these stupid symlinks while distro build but
   with more work on follow-up patches it should be possible to 
 keep

 [PATCH 09/21] mapi: Build libglapi always shared.
   I assume it could be improved later

 [PATCH 10/21] mesa: Build libmesa shared.
   Hundreds of PUBLICs but we can get rid of libdricore and get an
   libmesadri which depends as well as libmesagallium on a 
 libmesacore.
   This really speeds up build since duplicate build in libdricore
   with all PUBLIC can be avoided.
   Also dlopen classic drivers should be faster.

 [PATCH 11/21] Install all internal shared libs to $(libdir)/mesa-$VERSION.

 [PATCH 12/21] Also do it for egl_gallium.so, pipe_*.so and gbm_gallium_drm.

 [PATCH 13/21] Makefile.am: s:-no-undefined:-Wl,--no-undefined to make it work.
   libtool will set it back to allow_undefined=yes in 
 func_mode_link ()
   otherwise.

 [PATCH 14/21] gallium/drivers: Build libs -shared.

 [PATCH 15/21] vdpau,xvmc: Add install-data-hooks to remove unneccessary 
 symlinks.
   libvdpau_*.so.1 and libXvMC*.so libs are dlopened by wrappers.
   Nothing should link them directly.

 [PATCH 16/21] glx: Get rid of libglx.la.

 [PATCH 17/21] gbm: Get rid of libgbm_dri.la.

 [PATCH 18/21] i915: Conditionally build an i915g driver instead of

 [PATCH 19/21] freedreno: Make print_sequence a macro to fix clang.

 [PATCH 20/21] freedreno: One Makefile.am with a Makefile.sources is

 [PATCH 21/21] clover: Force gcc and g++ to fix clang builds.


 openSUSE x86_64 binary RPMs will look like this:
 $ du -a etc/ usr/
 4   etc/drirc
 8   etc/
 88  usr/lib64/libXvMCr600.so
 140 usr/lib64/libEGL.so.1.0.0
 0   usr/lib64/libGL.so.1.2
 380 usr/lib64/libGL.so.1.2.0
 0   usr/lib64/libGLESv1_CM.so.1
 88  usr/lib64/libXvMCr300.so
 36  usr/lib64/libXvMCsoftpipe.so
 212 usr/lib64/mesa-9.2.0/libllvmpipe.so
 608 usr/lib64/mesa-9.2.0/libmesadri.so
 324 usr/lib64/mesa-9.2.0/libmesagallium.so
 1140usr/lib64/mesa-9.2.0/libnouveau.so
 60  usr/lib64/mesa-9.2.0/libtrace.so
 60  usr/lib64/mesa-9.2.0/pipe_r600.so
 308 usr/lib64/mesa-9.2.0/libr300.so
 20  usr/lib64/mesa-9.2.0/libgalahad.so
 16  usr/lib64/mesa-9.2.0/libnoop.so
 32  usr/lib64/mesa-9.2.0/librbug.so
 60  usr/lib64/mesa-9.2.0/pipe_r300.so
 60  usr/lib64/mesa-9.2.0/pipe_radeonsi.so
 164 usr/lib64/mesa-9.2.0/egl_gallium.so
 152 usr/lib64/mesa-9.2.0/libglapi.so
 136 usr/lib64/mesa-9.2.0/libradeonsi.so
 16  usr/lib64/mesa-9.2.0/libr300-helper.so
 16  usr/lib64/mesa-9.2.0/libidentity.so
 8   usr/lib64/mesa-9.2.0/pipe_nouveau.so
 184 usr/lib64/mesa-9.2.0/libsvga.so
 1888usr/lib64/mesa-9.2.0/libgallium.so
 20  usr/lib64/mesa-9.2.0/gbm_gallium_drm.so
 1016usr/lib64/mesa-9.2.0/libr600.so
 20  usr/lib64/mesa-9.2.0/pipe_vmwgfx.so
 3228usr/lib64/mesa-9.2.0/libmesacore.so
 152 usr/lib64/mesa-9.2.0/libsoftpipe.so
 8   usr/lib64/mesa-9.2.0/pipe_swrast.so
 9912usr/lib64/mesa-9.2.0
 0   usr/lib64/libOSMesa.so.8
 0   usr/lib64/libxatracker.so.1
 64  usr/lib64/dri/swrast_dri.so
 184 usr/lib64/dri/nouveau_vieux_dri.so
 116 usr/lib64/dri/r600_dri.so
 288 usr/lib64/dri/radeon_dri.so
 876 usr/lib64/dri/i965_dri.so
 320 usr/lib64/dri/r200_dri.so
 116 usr/lib64/dri/r300_dri.so
 120 usr/lib64/dri/radeonsi_dri.so
 72  usr/lib64/dri/nouveau_dri.so
 4   usr/lib64/dri/updates/README.updates
 8   usr/lib64/dri/updates
 324 usr/lib64/dri/i915_dri.so
 84  usr/lib64/dri/vmwgfx_dri.so
 2576usr/lib64/dri
 28  usr/lib64/libgbm.so.1.0.0
 0   usr/lib64/libGL.so.1
 8   

Re: [Mesa-dev] The long way to a faster build with shared libs and some fixes ...

2013-09-11 Thread Marek Olšák
BTW, the build system fixes would be good to have anyway, but I'm not
an expert on the Mesa build system.

Marek

On Thu, Sep 12, 2013 at 1:51 AM, Marek Olšák mar...@gmail.com wrote:
 I don't like this. I prefer to have one big blob for whole Mesa as
 discussed on Eric's blog:

 http://anholt.livejournal.com/43652.html

 I have no problem with longer compile times for release builds if I
 get a little bit higher CPU performance with link-time optimizations.
 And for debug builds, we can stick to standard -O2 -g or -O0 -g.

 Marek

 On Thu, Sep 12, 2013 at 12:32 AM, Johannes Obermayr
 johannesoberm...@gmx.de wrote:
 [PATCH 01/21] ilo: Fix out-of-tree build.

 [PATCH 02/21] Suppress clang's warnings about unused CFLAGS and CXXFLAGS.

 [PATCH 03/21] configure.ac: Save user {C,CXX}FLAGS and append them at end.

 [PATCH 04/21] radeon: Build and use libradeon the right way.
   Link libradeon only once in egl-static

 [PATCH 05/21] gallium/targets: Make use of prebuilt libdricommon.la.
   Avoid duplicate build.

 [PATCH 06/21] Drop support for --enable-static / --disable-shared.

 [PATCH 07/21] gallium/auxiliary: Build libgallium shared.
   Hundreds of symbols to be PUBLIC. But saves on a full build
   19 x ~ 1.8 MB.

 [PATCH 08/21] Drop last parts of compatibility for the old Mesa build
   I want it to avoid these stupid symlinks while distro build but
   with more work on follow-up patches it should be possible to 
 keep

 [PATCH 09/21] mapi: Build libglapi always shared.
   I assume it could be improved later

 [PATCH 10/21] mesa: Build libmesa shared.
   Hundreds of PUBLICs but we can get rid of libdricore and get an
   libmesadri which depends as well as libmesagallium on a 
 libmesacore.
   This really speeds up build since duplicate build in libdricore
   with all PUBLIC can be avoided.
   Also dlopen classic drivers should be faster.

 [PATCH 11/21] Install all internal shared libs to $(libdir)/mesa-$VERSION.

 [PATCH 12/21] Also do it for egl_gallium.so, pipe_*.so and gbm_gallium_drm.

 [PATCH 13/21] Makefile.am: s:-no-undefined:-Wl,--no-undefined to make it 
 work.
   libtool will set it back to allow_undefined=yes in 
 func_mode_link ()
   otherwise.

 [PATCH 14/21] gallium/drivers: Build libs -shared.

 [PATCH 15/21] vdpau,xvmc: Add install-data-hooks to remove unneccessary 
 symlinks.
   libvdpau_*.so.1 and libXvMC*.so libs are dlopened by wrappers.
   Nothing should link them directly.

 [PATCH 16/21] glx: Get rid of libglx.la.

 [PATCH 17/21] gbm: Get rid of libgbm_dri.la.

 [PATCH 18/21] i915: Conditionally build an i915g driver instead of

 [PATCH 19/21] freedreno: Make print_sequence a macro to fix clang.

 [PATCH 20/21] freedreno: One Makefile.am with a Makefile.sources is

 [PATCH 21/21] clover: Force gcc and g++ to fix clang builds.


 openSUSE x86_64 binary RPMs will look like this:
 $ du -a etc/ usr/
 4   etc/drirc
 8   etc/
 88  usr/lib64/libXvMCr600.so
 140 usr/lib64/libEGL.so.1.0.0
 0   usr/lib64/libGL.so.1.2
 380 usr/lib64/libGL.so.1.2.0
 0   usr/lib64/libGLESv1_CM.so.1
 88  usr/lib64/libXvMCr300.so
 36  usr/lib64/libXvMCsoftpipe.so
 212 usr/lib64/mesa-9.2.0/libllvmpipe.so
 608 usr/lib64/mesa-9.2.0/libmesadri.so
 324 usr/lib64/mesa-9.2.0/libmesagallium.so
 1140usr/lib64/mesa-9.2.0/libnouveau.so
 60  usr/lib64/mesa-9.2.0/libtrace.so
 60  usr/lib64/mesa-9.2.0/pipe_r600.so
 308 usr/lib64/mesa-9.2.0/libr300.so
 20  usr/lib64/mesa-9.2.0/libgalahad.so
 16  usr/lib64/mesa-9.2.0/libnoop.so
 32  usr/lib64/mesa-9.2.0/librbug.so
 60  usr/lib64/mesa-9.2.0/pipe_r300.so
 60  usr/lib64/mesa-9.2.0/pipe_radeonsi.so
 164 usr/lib64/mesa-9.2.0/egl_gallium.so
 152 usr/lib64/mesa-9.2.0/libglapi.so
 136 usr/lib64/mesa-9.2.0/libradeonsi.so
 16  usr/lib64/mesa-9.2.0/libr300-helper.so
 16  usr/lib64/mesa-9.2.0/libidentity.so
 8   usr/lib64/mesa-9.2.0/pipe_nouveau.so
 184 usr/lib64/mesa-9.2.0/libsvga.so
 1888usr/lib64/mesa-9.2.0/libgallium.so
 20  usr/lib64/mesa-9.2.0/gbm_gallium_drm.so
 1016usr/lib64/mesa-9.2.0/libr600.so
 20  usr/lib64/mesa-9.2.0/pipe_vmwgfx.so
 3228usr/lib64/mesa-9.2.0/libmesacore.so
 152 usr/lib64/mesa-9.2.0/libsoftpipe.so
 8   usr/lib64/mesa-9.2.0/pipe_swrast.so
 9912usr/lib64/mesa-9.2.0
 0   usr/lib64/libOSMesa.so.8
 0   usr/lib64/libxatracker.so.1
 64  usr/lib64/dri/swrast_dri.so
 184 usr/lib64/dri/nouveau_vieux_dri.so
 116 usr/lib64/dri/r600_dri.so
 288 usr/lib64/dri/radeon_dri.so
 876 usr/lib64/dri/i965_dri.so
 320 usr/lib64/dri/r200_dri.so
 116 usr/lib64/dri/r300_dri.so
 120 usr/lib64/dri/radeonsi_dri.so
 72  usr/lib64/dri/nouveau_dri.so
 4   usr/lib64/dri/updates/README.updates
 8   usr/lib64/dri/updates

Re: [Mesa-dev] The long way to a faster build with shared libs and some fixes ...

2013-09-11 Thread Johannes Obermayr
I am preferring a full build:
../configure --libdir=/usr/lib64 --includedir=/usr/include --bindir=/usr/bin 
--prefix=/usr --sysconfdir=/etc --enable-xvmc --enable-vdpau 
--enable-texture-float --enable-debug 
--with-dri-drivers=i915,i965,nouveau,r200,radeon,swrast 
--with-gallium-drivers=freedreno,i915,ilo,nouveau,r300,r600,radeonsi,svga,swrast
 --enable-dri --enable-glx --enable-osmesa --enable-gles1 --enable-gles2 
--enable-openvg --enable-gbm --enable-xa --enable-gallium-egl 
--enable-gallium-llvm --enable-gallium-gbm --enable-r600-llvm-compiler 
--enable-opencl --enable-gallium-g3dvl --enable-glx-tls

Most of other build tests were done by aboll - kudo to Andreas for this.

Required libs and PUBLICs were detected in hundreds of builds - you don't 
believe but linkers want to play and don't report all missing symbols in one 
library at once ;)

My last was --enable-osmesa --with-dri-drivers= --with-gallium-drivers=...:
I decided not to build additionally the required libmesadri for this but use a 
fallback to the more reasonable --enable-osmesa-gallium which uses 
libmesagallium (see in [PATCH 10/21]).

I have used/tested them heavily on nouveau (Nvidia ION), r600 (AMD Fusion) and 
r200 (Mobility Radeon 9000) for a longer time. I bet also other 
hardware/drivers will not make problems.
IMHO it is not a change in functionality but a rightsizing of existing code.

Maybe it is an already-to-use alternative to megadrivers project. Sorry Eric 
but your LiveJournal message inspired me to hurry up! ;)

Johannes

Am Mittwoch, 11. September 2013, 16:01:55 schrieb Tom Stellard:
 Hi Johannes,
 
 Could explain how you tested these patches:  The configure flags you
 used to build as well as the applications/hardware you used for testing.
 
 Thanks,
 Tom
 
 On Thu, Sep 12, 2013 at 12:32:38AM +0200, Johannes Obermayr wrote:
  [PATCH 01/21] ilo: Fix out-of-tree build.
  
  [PATCH 02/21] Suppress clang's warnings about unused CFLAGS and CXXFLAGS.
  
  [PATCH 03/21] configure.ac: Save user {C,CXX}FLAGS and append them at end.
  
  [PATCH 04/21] radeon: Build and use libradeon the right way.
Link libradeon only once in egl-static
  
  [PATCH 05/21] gallium/targets: Make use of prebuilt libdricommon.la.
Avoid duplicate build.
  
  [PATCH 06/21] Drop support for --enable-static / --disable-shared.
  
  [PATCH 07/21] gallium/auxiliary: Build libgallium shared.
Hundreds of symbols to be PUBLIC. But saves on a full build
19 x ~ 1.8 MB.
  
  [PATCH 08/21] Drop last parts of compatibility for the old Mesa build
I want it to avoid these stupid symlinks while distro build 
  but
with more work on follow-up patches it should be possible to 
  keep
  
  [PATCH 09/21] mapi: Build libglapi always shared.
I assume it could be improved later
  
  [PATCH 10/21] mesa: Build libmesa shared.
Hundreds of PUBLICs but we can get rid of libdricore and get 
  an
libmesadri which depends as well as libmesagallium on a 
  libmesacore.
This really speeds up build since duplicate build in 
  libdricore
with all PUBLIC can be avoided.
Also dlopen classic drivers should be faster.
  
  [PATCH 11/21] Install all internal shared libs to $(libdir)/mesa-$VERSION.
  
  [PATCH 12/21] Also do it for egl_gallium.so, pipe_*.so and gbm_gallium_drm.
  
  [PATCH 13/21] Makefile.am: s:-no-undefined:-Wl,--no-undefined to make it 
  work.
libtool will set it back to allow_undefined=yes in 
  func_mode_link ()
otherwise.
  
  [PATCH 14/21] gallium/drivers: Build libs -shared.
  
  [PATCH 15/21] vdpau,xvmc: Add install-data-hooks to remove unneccessary 
  symlinks.
libvdpau_*.so.1 and libXvMC*.so libs are dlopened by wrappers.
Nothing should link them directly.
  
  [PATCH 16/21] glx: Get rid of libglx.la.
  
  [PATCH 17/21] gbm: Get rid of libgbm_dri.la.
  
  [PATCH 18/21] i915: Conditionally build an i915g driver instead of
  
  [PATCH 19/21] freedreno: Make print_sequence a macro to fix clang.
  
  [PATCH 20/21] freedreno: One Makefile.am with a Makefile.sources is
  
  [PATCH 21/21] clover: Force gcc and g++ to fix clang builds.
  
  
  openSUSE x86_64 binary RPMs will look like this:
  $ du -a etc/ usr/
  4   etc/drirc
  8   etc/
  88  usr/lib64/libXvMCr600.so
  140 usr/lib64/libEGL.so.1.0.0
  0   usr/lib64/libGL.so.1.2
  380 usr/lib64/libGL.so.1.2.0
  0   usr/lib64/libGLESv1_CM.so.1
  88  usr/lib64/libXvMCr300.so
  36  usr/lib64/libXvMCsoftpipe.so
  212 usr/lib64/mesa-9.2.0/libllvmpipe.so
  608 usr/lib64/mesa-9.2.0/libmesadri.so
  324 usr/lib64/mesa-9.2.0/libmesagallium.so
  1140usr/lib64/mesa-9.2.0/libnouveau.so
  60  usr/lib64/mesa-9.2.0/libtrace.so
  60  usr/lib64/mesa-9.2.0/pipe_r600.so
  308 usr/lib64/mesa-9.2.0/libr300.so
  20  

[Mesa-dev] [PATCH] mesa: Return nonzero length only if memcpy occurs.

2013-09-11 Thread Vinson Lee
Fixes Dereference after null check reported by Coverity.

Signed-off-by: Vinson Lee v...@freedesktop.org
---
 src/mesa/main/objectlabel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mesa/main/objectlabel.c b/src/mesa/main/objectlabel.c
index 90d9e09..e34df13 100644
--- a/src/mesa/main/objectlabel.c
+++ b/src/mesa/main/objectlabel.c
@@ -92,10 +92,9 @@ copy_label(char **labelPtr, char *label, int *length, int 
bufSize)
 {
int labelLen = 0;
 
-   if (*labelPtr)
+   if (label  *labelPtr) {
   labelLen = strlen(*labelPtr);
 
-   if (label) {
   if (bufSize = labelLen)
  labelLen =  bufSize-1;
 
-- 
1.8.3.2

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


Re: [Mesa-dev] regression on nvc0 since floating point compare instructions

2013-09-11 Thread Dave Airlie

 Maybe the type isn't set correctly? Looks to me like these instructions
 end up in mkCmp, which will set both src and dst type but ignore src
 type and set both according to the same type (which was the dst type).

 Roland

Okay I've attached my next attempt at fixing it, fixes the two testcases I had.

Dave.


0001-nouveau-fix-regression-since-float-comparison-instru.patch
Description: Binary data
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] R600: add a test for SI.tbuffer.store

2013-09-11 Thread Tom Stellard
Hi Marek,

I've pushed this along with the other original tbuffer patch.

-Tom

On Mon, Sep 09, 2013 at 10:36:12PM +0200, Marek Olšák wrote:
 Signed-off-by: Marek Olšák marek.ol...@amd.com
 ---
  test/CodeGen/R600/llvm.SI.tbuffer.store.ll | 40 
 ++
  1 file changed, 40 insertions(+)
  create mode 100644 test/CodeGen/R600/llvm.SI.tbuffer.store.ll
 
 diff --git a/test/CodeGen/R600/llvm.SI.tbuffer.store.ll 
 b/test/CodeGen/R600/llvm.SI.tbuffer.store.ll
 new file mode 100644
 index 000..80b246c
 --- /dev/null
 +++ b/test/CodeGen/R600/llvm.SI.tbuffer.store.ll
 @@ -0,0 +1,40 @@
 +;RUN: llc  %s -march=r600 -mcpu=verde | FileCheck %s
 +
 +;CHECK: TBUFFER_STORE_FORMAT_XYZW 
 {{VGPR[0-9]+_VGPR[0-9]+_VGPR[0-9]+_VGPR[0-9]+}}, 32, -1, 0, -1, 0, 14, 4, 
 {{VGPR[0-9]+}}, {{SGPR[0-9]+_SGPR[0-9]+_SGPR[0-9]+_SGPR[0-9]+}}, -1, 0, 0
 +define void @test1(i32 %a1, i32 %vaddr) {
 +%vdata = insertelement 4 x i32 undef, i32 %a1, i32 0
 +call void @llvm.SI.tbuffer.store.v4i32(16 x i8 undef, 4 x i32 %vdata,
 +i32 4, i32 %vaddr, i32 0, i32 32, i32 14, i32 4, i32 1, i32 0, i32 1,
 +i32 1, i32 0)
 +ret void
 +}
 +
 +;CHECK: TBUFFER_STORE_FORMAT_XYZ 
 {{VGPR[0-9]+_VGPR[0-9]+_VGPR[0-9]+_VGPR[0-9]+}}, 24, -1, 0, -1, 0, 13, 4, 
 {{VGPR[0-9]+}}, {{SGPR[0-9]+_SGPR[0-9]+_SGPR[0-9]+_SGPR[0-9]+}}, -1, 0, 0
 +define void @test2(i32 %a1, i32 %vaddr) {
 +%vdata = insertelement 4 x i32 undef, i32 %a1, i32 0
 +call void @llvm.SI.tbuffer.store.v4i32(16 x i8 undef, 4 x i32 %vdata,
 +i32 3, i32 %vaddr, i32 0, i32 24, i32 13, i32 4, i32 1, i32 0, i32 1,
 +i32 1, i32 0)
 +ret void
 +}
 +
 +;CHECK: TBUFFER_STORE_FORMAT_XY {{VGPR[0-9]+_VGPR[0-9]+}}, 16, -1, 0, -1, 0, 
 11, 4, {{VGPR[0-9]+}}, {{SGPR[0-9]+_SGPR[0-9]+_SGPR[0-9]+_SGPR[0-9]+}}, -1, 
 0, 0
 +define void @test3(i32 %a1, i32 %vaddr) {
 +%vdata = insertelement 2 x i32 undef, i32 %a1, i32 0
 +call void @llvm.SI.tbuffer.store.v2i32(16 x i8 undef, 2 x i32 %vdata,
 +i32 2, i32 %vaddr, i32 0, i32 16, i32 11, i32 4, i32 1, i32 0, i32 1,
 +i32 1, i32 0)
 +ret void
 +}
 +
 +;CHECK: TBUFFER_STORE_FORMAT_X {{VGPR[0-9]+}}, 8, -1, 0, -1, 0, 4, 4, 
 {{VGPR[0-9]+}}, {{SGPR[0-9]+_SGPR[0-9]+_SGPR[0-9]+_SGPR[0-9]+}}, -1, 0, 0
 +define void @test4(i32 %vdata, i32 %vaddr) {
 +call void @llvm.SI.tbuffer.store.i32(16 x i8 undef, i32 %vdata,
 +i32 1, i32 %vaddr, i32 0, i32 8, i32 4, i32 4, i32 1, i32 0, i32 1,
 +i32 1, i32 0)
 +ret void
 +}
 +
 +declare void @llvm.SI.tbuffer.store.i32(16 x i8, i32, i32, i32, i32, i32, 
 i32, i32, i32, i32, i32, i32, i32)
 +declare void @llvm.SI.tbuffer.store.v2i32(16 x i8, 2 x i32, i32, i32, 
 i32, i32, i32, i32, i32, i32, i32, i32, i32)
 +declare void @llvm.SI.tbuffer.store.v4i32(16 x i8, 4 x i32, i32, i32, 
 i32, i32, i32, i32, i32, i32, i32, i32, i32)
 -- 
 1.8.1.2
 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] mesa-dev Digest, Vol 42, Issue 98

2013-09-11 Thread Timothy Arceri


Date: Wed, 11 Sep 2013 18:27:43 -0700

From: Vinson Lee v...@freedesktop.org
To: mesa-dev@lists.freedesktop.org
Subject: [Mesa-dev] [PATCH] mesa: Return nonzero length only if memcpy
   occurs.
Message-ID: 1378949263-18169-1-git-send-email-v...@freedesktop.org

Fixes Dereference after null check reported by Coverity.

Signed-off-by: Vinson Lee v...@freedesktop.org
---
src/mesa/main/objectlabel.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mesa/main/objectlabel.c b/src/mesa/main/objectlabel.c
index 90d9e09..e34df13 100644
--- a/src/mesa/main/objectlabel.c
+++ b/src/mesa/main/objectlabel.c
@@ -92,10 +92,9 @@ copy_label(char **labelPtr, char *label, int *length, int 
bufSize)
{
    int labelLen = 0;

-   if (*labelPtr)
+   if (label  *labelPtr) {
       labelLen = strlen(*labelPtr);

-   if (label) {
       if (bufSize = labelLen)
          labelLen =  bufSize-1;

-- 
1.8.3.2


Hi Vinson,

Maybe you might want to also add the below quotes from the spec but I think you 
need to leave the two if statements (I thought I had fixed up this NULL check 
but obviously I didnt).

I think the correct code is (although I can't test this just yet):

if (label) {
+ if (*labelPtr) { 
if (bufSize = labelLen)
labelLen =  bufSize-1; memcpy(label, *labelPtr, labelLen);
+  }
label[labelLen] = '\0';
If no debug label was specified for the object then label  will contain a 
null-terminated empty string, and zero will be returned in length. If label 
is NULL and length is non-NULL then no string  will be returned and the 
length of the label will be returned in length.

Thanks,
Tim

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


Re: [Mesa-dev] [PATCH 01/21] ilo: Fix out-of-tree build.

2013-09-11 Thread Chia-I Wu
On Thu, Sep 12, 2013 at 6:32 AM, Johannes Obermayr
johannesoberm...@gmx.de wrote:
 ---
  src/gallium/drivers/ilo/Makefile.am | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/src/gallium/drivers/ilo/Makefile.am 
 b/src/gallium/drivers/ilo/Makefile.am
 index 10b3da3..33f2045 100644
 --- a/src/gallium/drivers/ilo/Makefile.am
 +++ b/src/gallium/drivers/ilo/Makefile.am
 @@ -27,7 +27,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
  noinst_LTLIBRARIES = libilo.la

  AM_CPPFLAGS = \
 -   -Iinclude \
 +   -I$(top_srcdir)/src/gallium/drivers/ilo/include \
Is -I$(srcdir)/include better?  I am not familiar with automake enough
to know which is preferred.  Either way, the patch looks to me.

 -I$(top_srcdir)/src/gallium/winsys/intel \
 $(GALLIUM_CFLAGS)

 --
 1.8.1.4

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



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


Re: [Mesa-dev] [PATCH 5/5] glsl: Add frexp signatures and implementation.

2013-09-11 Thread Matt Turner
On Wed, Sep 11, 2013 at 10:03 AM, Paul Berry stereotype...@gmail.com wrote:
 On 9 September 2013 15:14, Matt Turner matts...@gmail.com wrote:

 I initially implemented frexp() as an IR opcode with a lowering pass,
 but since it returns a value and has an out-parameter, it would break
 assumptions our optimization passes make about ir_expressions being pure
 (i.e., having no side effects).

 For example, if opt_tree_grafting encounters this code:

 uniform float u;
 void main()
 {
   int exp;
   float f = frexp(u, out exp);
   float g = float(exp)/256.0;
   float h = float(exp) + 1.0;
   gl_FragColor = vec4(f, g, h, g + h);
 }

 it may try to optimize it to this:

 uniform float u;
 void main()
 {
   int exp;
   float g = float(exp)/256.0;
   float h = float(exp) + 1.0;
   gl_FragColor = vec4(frexp(u, out exp), g, h, g + h);
 }

 Some hardware has an instruction which performs frexp(), but we would
 need some other compiler infrastructure to be able to generate it, such
 as an intrinsics system that would allow backends to emit specific code
 for particular bits of IR.
 ---
  src/glsl/builtin_functions.cpp | 54
 ++
  1 file changed, 54 insertions(+)

 diff --git a/src/glsl/builtin_functions.cpp
 b/src/glsl/builtin_functions.cpp
 index dbd35f2..e9d7b74 100644
 --- a/src/glsl/builtin_functions.cpp
 +++ b/src/glsl/builtin_functions.cpp
 @@ -512,6 +512,7 @@ private:
 B1(findMSB)
 B1(fma)
 B2(ldexp)
 +   B2(frexp)
  #undef B0
  #undef B1
  #undef B2
 @@ -1828,6 +1829,13 @@ builtin_builder::create_builtins()
  _ldexp(glsl_type::vec3_type,  glsl_type::ivec3_type),
  _ldexp(glsl_type::vec4_type,  glsl_type::ivec4_type),
  NULL);
 +
 +   add_function(frexp,
 +_frexp(glsl_type::float_type, glsl_type::int_type),
 +_frexp(glsl_type::vec2_type,  glsl_type::ivec2_type),
 +_frexp(glsl_type::vec3_type,  glsl_type::ivec3_type),
 +_frexp(glsl_type::vec4_type,  glsl_type::ivec4_type),
 +NULL);
  #undef F
  #undef FI
  #undef FIU
 @@ -3524,6 +3532,52 @@ builtin_builder::_ldexp(const glsl_type *x_type,
 const glsl_type *exp_type)
  {
 return binop(ir_binop_ldexp, gpu_shader5, x_type, x_type, exp_type);
  }
 +
 +ir_function_signature *
 +builtin_builder::_frexp(const glsl_type *x_type, const glsl_type
 *exp_type)
 +{
 +   ir_variable *x = in_var(x_type, x);
 +   ir_variable *exponent = out_var(exp_type, exp);
 +   MAKE_SIG(x_type, gpu_shader5, 2, x, exponent);
 +
 +   const unsigned vec_elem = x_type-vector_elements;
 +   const glsl_type *bvec = glsl_type::get_instance(GLSL_TYPE_BOOL,
 vec_elem, 1);
 +   const glsl_type *uvec = glsl_type::get_instance(GLSL_TYPE_UINT,
 vec_elem, 1);
 +
 +   /* Single-precision floating-point values are stored as
 +*   1 sign bit;
 +*   8 exponent bits;
 +*   23 mantissa bits.
 +*
 +* An exponent shift of 23 will shift the mantissa out, leaving only
 the
 +* exponent and sign bit (which itself may be zero, if the absolute
 value
 +* was taken before the bitcast and shift.
 +*/
 +   ir_constant *exponent_shift = imm(23);
 +   ir_constant *exponent_bias = imm(-126, vec_elem);
 +
 +   ir_constant *sign_mantissa_mask = imm(0x807fu, vec_elem);
 +   ir_constant *exponent_mask = imm(0x3f00u, vec_elem);


 Actually the exponent mask would be 0x7f80u.  This is the exponent
 *value* corresponding to a float in the range [0.5, 1.0).  Fortunately
 that's what we use it for :).  I'd propose renaming it to something like
 exponent_value, and maybe adding an explanatory comment.

Indeed you are correct. Thanks for catching this, I'll rename it and
add a comment.

Thanks for the review, and sorry I'm not around this week to do the same.
Matt
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 01/21] ilo: Fix out-of-tree build.

2013-09-11 Thread Matt Turner
On Wed, Sep 11, 2013 at 9:53 PM, Chia-I Wu olva...@gmail.com wrote:
 On Thu, Sep 12, 2013 at 6:32 AM, Johannes Obermayr
 johannesoberm...@gmx.de wrote:
 ---
  src/gallium/drivers/ilo/Makefile.am | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/src/gallium/drivers/ilo/Makefile.am 
 b/src/gallium/drivers/ilo/Makefile.am
 index 10b3da3..33f2045 100644
 --- a/src/gallium/drivers/ilo/Makefile.am
 +++ b/src/gallium/drivers/ilo/Makefile.am
 @@ -27,7 +27,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
  noinst_LTLIBRARIES = libilo.la

  AM_CPPFLAGS = \
 -   -Iinclude \
 +   -I$(top_srcdir)/src/gallium/drivers/ilo/include \
 Is -I$(srcdir)/include better?  I am not familiar with automake enough
 to know which is preferred.  Either way, the patch looks to me.

Yes, I think -I$(srcdir)/include is better.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965/hsw: approximate DDX with a uniform value across a subspan

2013-09-11 Thread Chia-I Wu
From: Chia-I Wu o...@lunarg.com

Replicate the gradient of the top-left pixel to the other three pixels in the
subspan, as how DDY is implemented.  Before, different graidents were used for
pixels in the top row and pixels in the bottom row.

This change results in a less accurate approximation.  However, it improves
the performance of Xonotic with Ultra settings by 24.3879% +/- 0.832202% (at
95.0% confidence) on Haswell.  No noticeable image quality difference
observed.

No piglit gpu.tests regressions.

I failed to come up with an explanation for the performance difference.  The
change does not make a difference on Ivy Bridge either.  If anyone has the
insight, please kindly enlighten me.  Performance differences may also be
observed on other games that call textureGrad and dFdx.

Signed-off-by: Chia-I Wu o...@lunarg.com
---
 src/mesa/drivers/dri/i965/brw_fs_emit.cpp | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
index bfb3d33..c0d24a0 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
@@ -564,16 +564,25 @@ fs_generator::generate_tex(fs_inst *inst, struct brw_reg 
dst, struct brw_reg src
 void
 fs_generator::generate_ddx(fs_inst *inst, struct brw_reg dst, struct brw_reg 
src)
 {
+   /* approximate with ((ss0.tr - ss0.tl)x4 (ss1.tr - ss1.tl)x4) on Haswell,
+* which gives much better performance when the result is used with
+* sample_d
+*/
+   unsigned vstride = (brw-is_haswell) ? BRW_VERTICAL_STRIDE_4 :
+  BRW_VERTICAL_STRIDE_2;
+   unsigned width = (brw-is_haswell) ? BRW_WIDTH_4 :
+BRW_WIDTH_2;
+
struct brw_reg src0 = brw_reg(src.file, src.nr, 1,
 BRW_REGISTER_TYPE_F,
-BRW_VERTICAL_STRIDE_2,
-BRW_WIDTH_2,
+vstride,
+width,
 BRW_HORIZONTAL_STRIDE_0,
 BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);
struct brw_reg src1 = brw_reg(src.file, src.nr, 0,
 BRW_REGISTER_TYPE_F,
-BRW_VERTICAL_STRIDE_2,
-BRW_WIDTH_2,
+vstride,
+width,
 BRW_HORIZONTAL_STRIDE_0,
 BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);
brw_ADD(p, dst, src0, negate(src1));
-- 
1.8.3.1

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


Re: [Mesa-dev] [PATCH 03/21] configure.ac: Save user {C, CXX}FLAGS and append them at end.

2013-09-11 Thread Matt Turner
Is this really better than just building with CFLAGS=-g -O2 -DDEBUG?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965/gen7: always lower textureGrad() on gen7

2013-09-11 Thread Chia-I Wu
On Tue, Sep 10, 2013 at 2:01 PM, Chia-I Wu olva...@gmail.com wrote:
 On Tue, Sep 10, 2013 at 4:05 AM, Ian Romanick i...@freedesktop.org wrote:
 On 09/05/2013 03:35 AM, Chia-I Wu wrote:
 sample_d is slower than the lowered version on gen7.  For gen7, this 
 improves
 Xonotic benchmark with Ultimate effects by as much as 25%:

  before the change:  40.06 fps
  after the change:   51.10 fps
  after the change with INTEL_DEBUG=no16: 44.46 fps

 As sample_d is not allowed in SIMD16 mode, I firstly thought the difference
 was from SIMD8 versus SIMD16.  If that was the case, we would want to apply
 brw_lower_texture_gradients() only on fragment shaders in SIMD16 mode.

 But, as the numbers show, there is still 10% improvement when SIMD16 is 
 forced
 off after the change.  Thus textureGrad() is lowered unconditionally for 
 now.
 Due to this and that I haven't tried it on Haswell, this is still RFC.

 A lot of this code depends on the texture targets being used.  What
 texture targets is Xonotic using with textureGrad?
 Only sampler2D.

 No piglit regressions.

 Signed-off-by: Chia-I Wu olva...@gmail.com
 ---
  .../dri/i965/brw_lower_texture_gradients.cpp   | 54 
 ++
  1 file changed, 36 insertions(+), 18 deletions(-)

 diff --git a/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp 
 b/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
 index 1589a20..f3fcb56 100644
 --- a/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
 +++ b/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
 @@ -34,8 +34,8 @@ using namespace ir_builder;

  class lower_texture_grad_visitor : public ir_hierarchical_visitor {
  public:
 -   lower_texture_grad_visitor(bool has_sample_d_c)
 -  : has_sample_d_c(has_sample_d_c)
 +   lower_texture_grad_visitor(bool has_sample_d, bool has_sample_d_c)
 +  : has_sample_d(has_sample_d), has_sample_d_c(has_sample_d_c)
 {
progress = false;
 }
 @@ -44,6 +44,7 @@ public:


 bool progress;
 +   bool has_sample_d;
 bool has_sample_d_c;

  private:
 @@ -90,22 +91,33 @@ txs_type(const glsl_type *type)
  ir_visitor_status
  lower_texture_grad_visitor::visit_leave(ir_texture *ir)
  {
 -   /* Only lower textureGrad with shadow samplers */
 -   if (ir-op != ir_txd || !ir-shadow_comparitor)
 +   if (ir-op != ir_txd)
return visit_continue;

 -   /* Lower textureGrad() with samplerCubeShadow even if we have the 
 sample_d_c
 -* message.  GLSL provides gradients for the 'r' coordinate.  
 Unfortunately:
 -*
 -* From the Ivybridge PRM, Volume 4, Part 1, sample_d message 
 description:
 -* The r coordinate contains the faceid, and the r gradients are 
 ignored
 -*  by hardware.
 -*
 -* We likely need to do a similar treatment for samplerCube and
 -* samplerCubeArray, but we have insufficient testing for that at the 
 moment.
 -*/
 -   bool need_lowering = !has_sample_d_c ||
 -  ir-sampler-type-sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE;
 +   bool need_lowering = false;
 +
 +   if (ir-shadow_comparitor) {
 +  /* Lower textureGrad() with samplerCubeShadow even if we have the
 +   * sample_d_c message.  GLSL provides gradients for the 'r' 
 coordinate.
 +   * Unfortunately:
 +   *
 +   * From the Ivybridge PRM, Volume 4, Part 1, sample_d message
 +   * description: The r coordinate contains the faceid, and the r
 +   * gradients are ignored by hardware.
 +   */
 +  if (ir-sampler-type-sampler_dimensionality == 
 GLSL_SAMPLER_DIM_CUBE)
 + need_lowering = true;
 +  else if (!has_sample_d_c)
 + need_lowering = true;

 This should look like the old code:

 need_lowering = !has_sample_d_c ||
ir-sampler-type-sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE;
 Sure.  I moved it so that it is clear the comments are for the first if-block.
 +   }
 +   else {
 +  /* We likely need to do a similar treatment for samplerCube and
 +   * samplerCubeArray, but we have insufficient testing for that at the
 +   * moment.
 +   */
 +  if (!has_sample_d)
 + need_lowering = true;

 need_lowering = !has_sample_d;
 Will do.

 +   }

 if (!need_lowering)
return visit_continue;
 @@ -154,7 +166,9 @@ lower_texture_grad_visitor::visit_leave(ir_texture *ir)
  expr(ir_unop_sqrt, dot(dPdy, dPdy)));
 }

 -   /* lambda_base = log2(rho).  We're ignoring GL state biases for now. */
 +   /* lambda_base = log2(rho).  It will be biased and clamped by values
 +* defined in SAMPLER_STATE to get the final lambda.
 +*/
 ir-op = ir_txl;
 ir-lod_info.lod = expr(ir_unop_log2, rho);

 @@ -168,8 +182,12 @@ bool
  brw_lower_texture_gradients(struct brw_context *brw,
  struct exec_list *instructions)
  {
 +   /* sample_d is slower than the lowered version on gen7, and is not 
 allowed
 +* in SIMD16 mode.  

Re: [Mesa-dev] [PATCH] i965/gen7: always lower textureGrad() on gen7

2013-09-11 Thread Chia-I Wu
On Tue, Sep 10, 2013 at 1:37 PM, Chia-I Wu olva...@gmail.com wrote:
 On Tue, Sep 10, 2013 at 4:01 AM, Ian Romanick i...@freedesktop.org wrote:
 On 09/06/2013 05:05 AM, Chia-I Wu wrote:
 On Thu, Sep 5, 2013 at 9:57 PM, Chia-I Wu olva...@gmail.com wrote:
 On Thu, Sep 5, 2013 at 5:12 PM, Chris Forbes chr...@ijw.co.nz wrote:
 A possible explanation for the perf change is that Xonotic uses
 anisotropic filtering at this quality level. Lowering to txl defeats
 it.
 I had a look at that.  gl_sampler-MaxAnisotropy is never greater than
 1.0 in gen7_update_sampler_state() so there is no anisotropic
 filtering in this case.

 It makes sense to me that avoiding punting to SIMD8 helps the
 performance.  But it is not clear to me why 10% performance change
 can still be observed when INTEL_DEBUG=no16 is specified.  A
 reasonable explanation is that the image quality is degraded in some
 way, which is why I am still nervous about the change.
 With INTEL_DEBUG=no16 set, the same trick hurts the performance on
 Haswell by about 5%.  That is, sample_d on Haswell is faster than the
 one emulated with sample_l.

 What is the delta if sample_d is used for just SIMD8 shaders on HSW?
 Even when the shader can go SIMD16, some fragments will use the SIMD8 path.
 brw_lower_texture_gradients applies on the IR so it is hard to
 selectively apply it only for SIMD16 fs.  I will see if I can work
 something out here to get the numbers you need.
I could clone the original IR list, run all but
brw_lower_texture_gradients passes on it, and use the cloned list to
generate SIMD8 code.  This is to get the numbers, not for the final
code.

But I sent another patch that should speed up sample_d.  With it, we
do not want to lower sample_d to sample_l at all.  I will see how the
patch goes first.



 But since the trick makes SIMD16 possible, it gains 5% more fps when
 INTEL_DEBUG=no16 is not set.

 An alternative approach to avoid punting seems to emulate SIMD16
 sample_d with two SIMD8 sample_d.  It will take longer to implement
 given my familiarity with the code, and may be less performant.  BUt
 that would allow things like anisotropic filtering to be honored.
And we will need to do this to enable SIMD16.


 It would be worth doing an image quality comparison before and after the 
 change.
 Yeah, that is worth doing.  I will do that.


 -- Chris

 On Thu, Sep 5, 2013 at 8:35 PM, Chia-I Wu olva...@gmail.com wrote:
 sample_d is slower than the lowered version on gen7.  For gen7, this 
 improves
 Xonotic benchmark with Ultimate effects by as much as 25%:

  before the change:  40.06 fps
  after the change:   51.10 fps
  after the change with INTEL_DEBUG=no16: 44.46 fps

 As sample_d is not allowed in SIMD16 mode, I firstly thought the 
 difference
 was from SIMD8 versus SIMD16.  If that was the case, we would want to 
 apply
 brw_lower_texture_gradients() only on fragment shaders in SIMD16 mode.

 But, as the numbers show, there is still 10% improvement when SIMD16 is 
 forced
 off after the change.  Thus textureGrad() is lowered unconditionally for 
 now.
 Due to this and that I haven't tried it on Haswell, this is still RFC.

 No piglit regressions.

 Signed-off-by: Chia-I Wu olva...@gmail.com
 ---
  .../dri/i965/brw_lower_texture_gradients.cpp   | 54 
 ++
  1 file changed, 36 insertions(+), 18 deletions(-)

 diff --git a/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp 
 b/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
 index 1589a20..f3fcb56 100644
 --- a/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
 +++ b/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
 @@ -34,8 +34,8 @@ using namespace ir_builder;

  class lower_texture_grad_visitor : public ir_hierarchical_visitor {
  public:
 -   lower_texture_grad_visitor(bool has_sample_d_c)
 -  : has_sample_d_c(has_sample_d_c)
 +   lower_texture_grad_visitor(bool has_sample_d, bool has_sample_d_c)
 +  : has_sample_d(has_sample_d), has_sample_d_c(has_sample_d_c)
 {
progress = false;
 }
 @@ -44,6 +44,7 @@ public:


 bool progress;
 +   bool has_sample_d;
 bool has_sample_d_c;

  private:
 @@ -90,22 +91,33 @@ txs_type(const glsl_type *type)
  ir_visitor_status
  lower_texture_grad_visitor::visit_leave(ir_texture *ir)
  {
 -   /* Only lower textureGrad with shadow samplers */
 -   if (ir-op != ir_txd || !ir-shadow_comparitor)
 +   if (ir-op != ir_txd)
return visit_continue;

 -   /* Lower textureGrad() with samplerCubeShadow even if we have the 
 sample_d_c
 -* message.  GLSL provides gradients for the 'r' coordinate.  
 Unfortunately:
 -*
 -* From the Ivybridge PRM, Volume 4, Part 1, sample_d message 
 description:
 -* The r coordinate contains the faceid, and the r gradients are 
 ignored
 -*  by hardware.
 -*
 -* We likely need to do a similar treatment for samplerCube and
 -* samplerCubeArray, but we have insufficient