Re: [Mesa-dev] [PATCH] gallivm: fix lp_build_compare_ext

2015-07-03 Thread Vinson Lee
On Fri, Jul 3, 2015 at 6:05 PM,   wrote:
> From: Roland Scheidegger 
>
> The expansion should always be to the same width as the input arguments
> no matter what, since these functions should work with any bit width of
> the arguments (the sext is a no-op on any sane simd architecture).
> Thus, fix the caller expecting differently.
>
> This fixes https://bugs.freedesktop.org/show_bug.cgi?id=91222 (not tested
> otherwise)
> ---
>  src/gallium/auxiliary/gallivm/lp_bld_logic.c   | 2 +-
>  src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c 
> b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
> index f724cfa..80b53e5 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
> @@ -81,7 +81,7 @@ lp_build_compare_ext(struct gallivm_state *gallivm,
>   boolean ordered)
>  {
> LLVMBuilderRef builder = gallivm->builder;
> -   LLVMTypeRef int_vec_type = lp_build_int_vec_type(gallivm, 
> lp_type_int_vec(32, 32 * type.length));
> +   LLVMTypeRef int_vec_type = lp_build_int_vec_type(gallivm, type);
> LLVMValueRef zeros = LLVMConstNull(int_vec_type);
> LLVMValueRef ones = LLVMConstAllOnes(int_vec_type);
> LLVMValueRef cond;
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c 
> b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
> index 1f2af85..0ad78b0 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
> @@ -1961,8 +1961,11 @@ dset_emit_cpu(
> struct lp_build_emit_data * emit_data,
> unsigned pipe_func)
>  {
> +   LLVMBuilderRef builder = bld_base->base.gallivm->builder;
> LLVMValueRef cond = lp_build_cmp(&bld_base->dbl_bld, pipe_func,
>  emit_data->args[0], emit_data->args[1]);
> +   /* arguments were 64 bit but store as 32 bit */
> +   cond = LLVMBuildTrunc(builder, cond, bld_base->int_bld.int_vec_type, "");
> emit_data->output[emit_data->chan] = cond;
>  }
>
> --
> 1.9.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


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


[Mesa-dev] [PATCH] scons: Add additional GCC function attribute macros.

2015-07-20 Thread Vinson Lee
Match the attributes currently checked in configure.ac.

Signed-off-by: Vinson Lee 
---
 scons/gallium.py | 5 +
 1 file changed, 5 insertions(+)

diff --git a/scons/gallium.py b/scons/gallium.py
index 51b84d7..af30c09 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -380,11 +380,16 @@ def generate(env):
 'HAVE___BUILTIN_EXPECT',
 'HAVE___BUILTIN_FFS',
 'HAVE___BUILTIN_FFSLL',
+'HAVE_FUNC_ATTRIBUTE_CONST',
 'HAVE_FUNC_ATTRIBUTE_FLATTEN',
+'HAVE_FUNC_ATTRIBUTE_PURE',
 'HAVE_FUNC_ATTRIBUTE_UNUSED',
 # GCC 3.0
 'HAVE_FUNC_ATTRIBUTE_FORMAT',
+'HAVE_FUNC_ATTRIBUTE_MALLOC',
 'HAVE_FUNC_ATTRIBUTE_PACKED',
+# GCC 3.3
+'HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT',
 # GCC 3.4
 'HAVE___BUILTIN_CTZ',
 'HAVE___BUILTIN_POPCOUNT',
-- 
2.1.4

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


Re: [Mesa-dev] [PATCH 1/2] mesa: Detect and provide macros for function attributes pure and const.

2015-07-20 Thread Vinson Lee
On Tue, Jul 14, 2015 at 11:45 AM, Eric Anholt  wrote:
> These are really useful hints to the compiler in the absence of link-time
> optimization, and I'm going to use them in VC4.
>
> I've made the const attribute be ATTRIBUTE_CONST unlike other function
> attributes, because we have other things in the tree #defining CONST for
> their own unrelated purposes.
> ---
>  configure.ac  |  2 ++
>  src/util/macros.h | 20 
>  2 files changed, 22 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index bdfd134..38ad398 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -210,6 +210,8 @@ AX_GCC_FUNC_ATTRIBUTE([format])
>  AX_GCC_FUNC_ATTRIBUTE([malloc])
>  AX_GCC_FUNC_ATTRIBUTE([packed])
>  AX_GCC_FUNC_ATTRIBUTE([unused])
> +AX_GCC_FUNC_ATTRIBUTE([const])
> +AX_GCC_FUNC_ATTRIBUTE([pure])
>  AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
>
>  AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
> diff --git a/src/util/macros.h b/src/util/macros.h
> index 66698e7..4d16183 100644
> --- a/src/util/macros.h
> +++ b/src/util/macros.h
> @@ -130,6 +130,26 @@ do {   \
>  #define PACKED
>  #endif
>
> +/* Attribute pure is used for functions that have no effects other than their
> + * return value.  As a result, calls to it can be dead code eliminated.
> + */
> +#ifdef HAVE_FUNC_ATTRIBUTE_PURE
> +#define PURE __attribute__((__pure__))
> +#else
> +#define PURE
> +#endif
> +
> +/* Attribute const is used for functions that have no effects other than 
> their
> + * return value, and only rely on the argument values to compute the return
> + * value.  As a result, calls to it can be CSEed.  Note that using memory
> + * pointed to by the arguments is not allowed for const functions.
> + */
> +#ifdef HAVE_FUNC_ATTRIBUTE_CONST
> +#define ATTRIBUTE_CONST __attribute__((__const__))
> +#else
> +#define ATTRIBUTE_CONST
> +#endif
> +
>  #ifdef __cplusplus
>  /**
>   * Macro function that evaluates to true if T is a trivially
> --
> 2.1.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


This patch introduced new compiler warnings.

indirect_size.h:42:0: warning: "PURE" redefined
 #define PURE __attribute__((pure))
 ^
In file included from glxclient.h:55:0,
 from indirect.h:52,
 from indirect.c:30:
../../src/util/macros.h:148:0: note: this is the location of the
previous definition
 #define PURE __attribute__((__pure__))
 ^
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] st/mesa: Silence GCC unused-variable warning.

2015-07-20 Thread Vinson Lee
Silence a release build warning.

st_glsl_to_tgsi.cpp: In function 'pipe_error st_translate_program(gl_context*, 
uint, ureg_program*, glsl_to_tgsi_visitor*, const gl_program*, GLuint, const 
GLuint*, const GLuint*, const ubyte*, const ubyte*, const GLuint*, const 
GLuint*, GLuint, const GLuint*, const GLuint*, const ubyte*, const ubyte*, 
boolean, boolean)':
st_glsl_to_tgsi.cpp:5461:36: warning: unused variable 'pscreen' 
[-Wunused-variable]
struct pipe_screen *pscreen = st->pipe->screen;
    ^

Signed-off-by: Vinson Lee 
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 25e30c7..c9d40c5 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5461,6 +5461,7 @@ st_translate_program(
struct pipe_screen *pscreen = st->pipe->screen;
assert(procType == TGSI_PROCESSOR_VERTEX);
assert(pscreen->get_shader_param(pscreen, PIPE_SHADER_VERTEX, 
PIPE_SHADER_CAP_INTEGERS));
+   (void) pscreen;
if (!ctx->Const.NativeIntegers) {
   struct ureg_dst temp = ureg_DECL_local_temporary(t->ureg);
   ureg_U2F( t->ureg, ureg_writemask(temp, TGSI_WRITEMASK_X), 
t->systemValues[i]);
-- 
2.1.4

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


[Mesa-dev] [PATCH] ABI-check: Use more portable bash invocation.

2015-07-21 Thread Vinson Lee
Fixes 'make check' on FreeBSD.

Signed-off-by: Vinson Lee 
---
 src/mapi/es1api/ABI-check | 2 +-
 src/mapi/es2api/ABI-check | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mapi/es1api/ABI-check b/src/mapi/es1api/ABI-check
index 44654cd..819568f 100755
--- a/src/mapi/es1api/ABI-check
+++ b/src/mapi/es1api/ABI-check
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Print defined gl.* functions not in GL ES 1.1 or in
 # (FIXME, none of these should be part of the ABI)
diff --git a/src/mapi/es2api/ABI-check b/src/mapi/es2api/ABI-check
index abbb55c..e0bf3c8 100755
--- a/src/mapi/es2api/ABI-check
+++ b/src/mapi/es2api/ABI-check
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Print defined gl.* functions not in GL ES 3.0 or in
 # (FIXME, none of these should be part of the ABI)
-- 
2.1.4

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


[Mesa-dev] [PATCH] radeon: Silence GCC unused-but-set-variable warnings.

2015-07-21 Thread Vinson Lee
radeon_fbo.c: In function 'radeon_map_renderbuffer_s8z24':
radeon_fbo.c:162:9: warning: variable 'ret' set but not used 
[-Wunused-but-set-variable]
 int ret;
 ^
radeon_fbo.c: In function 'radeon_map_renderbuffer_z16':
radeon_fbo.c:200:9: warning: variable 'ret' set but not used 
[-Wunused-but-set-variable]
 int ret;
 ^
radeon_fbo.c: In function 'radeon_map_renderbuffer':
radeon_fbo.c:242:8: warning: variable 'ret' set but not used 
[-Wunused-but-set-variable]
int ret;
^
radeon_fbo.c: In function 'radeon_unmap_renderbuffer':
radeon_fbo.c:419:14: warning: variable 'ok' set but not used 
[-Wunused-but-set-variable]
GLboolean ok;
  ^

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/radeon/radeon_fbo.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c 
b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 5e4aaca..5eece51 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -169,6 +169,7 @@ radeon_map_renderbuffer_s8z24(struct gl_context *ctx,
 rrb->map_buffer = malloc(w * h * 4);
 ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
 assert(!ret);
+(void) ret;
 untiled_s8z24_map = rrb->map_buffer;
 tiled_s8z24_map = rrb->bo->ptr;
 
@@ -207,6 +208,7 @@ radeon_map_renderbuffer_z16(struct gl_context *ctx,
 rrb->map_buffer = malloc(w * h * 2);
 ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
 assert(!ret);
+(void) ret;
 
 untiled_z16_map = rrb->map_buffer;
 tiled_z16_map = rrb->bo->ptr;
@@ -324,6 +326,7 @@ radeon_map_renderbuffer(struct gl_context *ctx,
 
ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
assert(!ret);
+   (void) ret;
 
map = rrb->bo->ptr;
stride = rrb->map_pitch;
@@ -416,7 +419,6 @@ radeon_unmap_renderbuffer(struct gl_context *ctx,
 {
struct radeon_context *const rmesa = RADEON_CONTEXT(ctx);
struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
-   GLboolean ok;
 
if ((rmesa->radeonScreen->chip_flags & RADEON_CHIPSET_DEPTH_ALWAYS_TILED) 
&& !rrb->has_surface) {
if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT || rb->Format == 
MESA_FORMAT_Z24_UNORM_X8_UINT) {
@@ -438,6 +440,7 @@ radeon_unmap_renderbuffer(struct gl_context *ctx,
radeon_bo_unmap(rrb->map_bo);
 
if (rrb->map_mode & GL_MAP_WRITE_BIT) {
+  GLboolean ok;
   ok = rmesa->vtbl.blit(ctx, rrb->map_bo, 0,
rb->Format, rrb->map_pitch / rrb->cpp,
rrb->map_w, rrb->map_h,
@@ -449,6 +452,7 @@ radeon_unmap_renderbuffer(struct gl_context *ctx,
rrb->map_w, rrb->map_h,
GL_FALSE);
   assert(ok);
+  (void) ok;
}
 
radeon_bo_unref(rrb->map_bo);
-- 
2.1.4

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


[Mesa-dev] [PATCH] nir: Silence GCC maybe-uninitialized warnings.

2015-11-02 Thread Vinson Lee
nir/nir_control_flow.c: In function ‘split_block_cursor.isra.11’:
nir/nir_control_flow.c:460:15: warning: ‘after’ may be used uninitialized in 
this function [-Wmaybe-uninitialized]
   *_after = after;
   ^
nir/nir_control_flow.c:458:16: warning: ‘before’ may be used uninitialized in 
this function [-Wmaybe-uninitialized]
   *_before = before;
^

Signed-off-by: Vinson Lee 
---
 src/glsl/nir/nir_control_flow.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c
index 7f51c4f..96395a4 100644
--- a/src/glsl/nir/nir_control_flow.c
+++ b/src/glsl/nir/nir_control_flow.c
@@ -452,6 +452,9 @@ split_block_cursor(nir_cursor cursor,
  before = split_block_before_instr(nir_instr_next(cursor.instr));
   }
   break;
+
+   default:
+  unreachable("not reached");
}
 
if (_before)
-- 
2.6.2

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


[Mesa-dev] [PATCH] glapi: Do not use backtrace on FreeBSD.

2015-01-23 Thread Vinson Lee
Fix build error.

  CCLD libGL.la
libglapi.a(glapi_libglapi_la-glapi_gentable.o): In function 
`__glapi_gentable_NoOp':
glapi_gentable.c:76: undefined reference to `backtrace'

Signed-off-by: Vinson Lee 
---
 src/mapi/glapi/gen/gl_gentable.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/gl_gentable.py 
b/src/mapi/glapi/gen/gl_gentable.py
index 06a5ebf..fb578e3 100644
--- a/src/mapi/glapi/gen/gl_gentable.py
+++ b/src/mapi/glapi/gen/gl_gentable.py
@@ -42,7 +42,7 @@ header = """/* GLXEXT is the define used in the xserver when 
the GLX extension i
 #endif
 
 #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
-   || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && 
!defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && 
!defined(__DragonFly__))
+   || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && 
!defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && 
!defined(__DragonFly__) && !defined(__FreeBSD__))
 #define USE_BACKTRACE
 #endif
 
-- 
2.2.1

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


Re: [Mesa-dev] [PATCH] glapi: Do not use backtrace on FreeBSD.

2015-02-19 Thread Vinson Lee
On Thu, Feb 5, 2015 at 4:02 AM, Ian Romanick  wrote:
> On 01/24/2015 05:46 AM, Vinson Lee wrote:
>> Fix build error.
>>
>>   CCLD libGL.la
>> libglapi.a(glapi_libglapi_la-glapi_gentable.o): In function 
>> `__glapi_gentable_NoOp':
>> glapi_gentable.c:76: undefined reference to `backtrace'
>>
>> Signed-off-by: Vinson Lee 
>> ---
>>  src/mapi/glapi/gen/gl_gentable.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/mapi/glapi/gen/gl_gentable.py 
>> b/src/mapi/glapi/gen/gl_gentable.py
>> index 06a5ebf..fb578e3 100644
>> --- a/src/mapi/glapi/gen/gl_gentable.py
>> +++ b/src/mapi/glapi/gen/gl_gentable.py
>> @@ -42,7 +42,7 @@ header = """/* GLXEXT is the define used in the xserver 
>> when the GLX extension i
>>  #endif
>>
>>  #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
>> - || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && 
>> !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && 
>> !defined(__DragonFly__))
>> + || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && 
>> !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && 
>> !defined(__DragonFly__) && !defined(__FreeBSD__))
>>  #define USE_BACKTRACE
>>  #endif
>
> It seems weird that we need all the BSDs in this check.  Is configure
> setting HAVE_BACKTRACE mistakenly?  Or is this logic just broken?  Does
>
> #if defined(HAVE_BACKTRACE) && (defined(GLXEXT) || defined(DEBUG))
>
> work everywhere?
>


Yes, it works. I tested FreeBSD and MinGW builds.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] scons: Define _DEFAULT_SOURCE.

2015-03-01 Thread Vinson Lee
Fix GCC cpp warnings with glibc >= 2.19.

/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE 
are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^

Signed-off-by: Vinson Lee 
---
 scons/gallium.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scons/gallium.py b/scons/gallium.py
index 5195508..2908257 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -283,6 +283,7 @@ def generate(env):
 '_SVID_SOURCE',
 '_BSD_SOURCE',
 '_GNU_SOURCE',
+'_DEFAULT_SOURCE',
 'HAVE_PTHREAD',
 'HAVE_POSIX_MEMALIGN',
 ]
-- 
2.3.1

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


Re: [Mesa-dev] [PATCH] scons: Define _DEFAULT_SOURCE.

2015-03-01 Thread Vinson Lee
On Sun, Mar 1, 2015 at 8:52 AM, Emil Velikov  wrote:
> On 01/03/15 08:49, Vinson Lee wrote:
>> Fix GCC cpp warnings with glibc >= 2.19.
>>
>> /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and 
>> _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
>>  # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
>>^
>>
> Any ideas if this has any side effects when building for non-linux
> platforms - freebsd/darwin ?
> It's nice to see that I wasn't the only person getting all this spam :-)
>
> -Emil
>

This patch does not affect the Mac OS X SCons build. The FreeBSD SCons
build has not worked for years.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] c99_alloca.h: Include stdlib.h on all non-Windows.

2015-03-01 Thread Vinson Lee
Fix build on FreeBSD.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89364
Signed-off-by: Vinson Lee 
---
 include/c99_alloca.h | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/include/c99_alloca.h b/include/c99_alloca.h
index 7a81c50..575f719 100644
--- a/include/c99_alloca.h
+++ b/include/c99_alloca.h
@@ -35,13 +35,9 @@
 
 #  define alloca _alloca
 
-#elif defined(__MINGW32__)
-
-#  include 
-
 #else /* !defined(_MSC_VER) */
 
-#  include 
+#  include 
 
 #endif /* !defined(_MSC_VER) */
 
-- 
2.1.0

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


[Mesa-dev] [PATCH] glsl: Fix GCC unused-variable warning in release build.

2015-03-03 Thread Vinson Lee
  CXX  ast_array_index.lo
ast_array_index.cpp: In function ‘void update_max_array_access(ir_rvalue*, int, 
YYLTYPE*, _mesa_glsl_parse_state*)’:
ast_array_index.cpp:86:30: warning: unused variable ‘interface_type’ 
[-Wunused-variable]
 const glsl_type *interface_type =
  ^

Signed-off-by: Vinson Lee 
---
 src/glsl/ast_array_index.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp
index ff0c757..ecef651 100644
--- a/src/glsl/ast_array_index.cpp
+++ b/src/glsl/ast_array_index.cpp
@@ -83,11 +83,9 @@ update_max_array_access(ir_rvalue *ir, int idx, YYLTYPE *loc,
 
   if (deref_var != NULL) {
  if (deref_var->var->is_interface_instance()) {
-const glsl_type *interface_type =
-   deref_var->var->get_interface_type();
 unsigned field_index =
deref_record->record->type->field_index(deref_record->field);
-assert(field_index < interface_type->length);
+assert(field_index < deref_var->var->get_interface_type()->length);
 
 unsigned *const max_ifc_array_access =
deref_var->var->get_max_ifc_array_access();
-- 
2.3.1

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


[Mesa-dev] [PATCH] i915: Fix GCC unused-variable warning in release build.

2015-03-03 Thread Vinson Lee
i915_debug_fp.c: In function ‘i915_disassemble_program’:
i915_debug_fp.c:302:11: warning: unused variable ‘size’ [-Wunused-variable]
GLuint size = program[0] & 0x1ff;
   ^

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i915/i915_debug_fp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_debug_fp.c 
b/src/mesa/drivers/dri/i915/i915_debug_fp.c
index 9b4bc76..3f09902 100644
--- a/src/mesa/drivers/dri/i915/i915_debug_fp.c
+++ b/src/mesa/drivers/dri/i915/i915_debug_fp.c
@@ -299,12 +299,11 @@ print_dcl_op(GLuint opcode, const GLuint * program)
 void
 i915_disassemble_program(const GLuint * program, GLuint sz)
 {
-   GLuint size = program[0] & 0x1ff;
GLint i;
 
printf("\t\tBEGIN\n");
 
-   assert(size + 2 == sz);
+   assert(program[0] & 0x1ff + 2 == sz);
 
program++;
for (i = 1; i < sz; i += 3, program += 3) {
-- 
2.3.1

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


[Mesa-dev] [PATCH] i915: Fix GCC unused-but-set-variable warning in release build.

2015-03-06 Thread Vinson Lee
i915_fragprog.c: In function ‘i915ValidateFragmentProgram’:
i915_fragprog.c:1453:11: warning: variable ‘k’ set but not used 
[-Wunused-but-set-variable]
   int k;
   ^

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i915/i915_fragprog.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c 
b/src/mesa/drivers/dri/i915/i915_fragprog.c
index d42da5a..9b00223 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -1450,8 +1450,6 @@ i915ValidateFragmentProgram(struct i915_context *i915)
 
if (s2 != i915->state.Ctx[I915_CTXREG_LIS2] ||
s4 != i915->state.Ctx[I915_CTXREG_LIS4]) {
-  int k;
-
   I915_STATECHANGE(i915, I915_UPLOAD_CTX);
 
   /* Must do this *after* statechange, so as not to affect
@@ -1471,8 +1469,7 @@ i915ValidateFragmentProgram(struct i915_context *i915)
   i915->state.Ctx[I915_CTXREG_LIS2] = s2;
   i915->state.Ctx[I915_CTXREG_LIS4] = s4;
 
-  k = intel->vtbl.check_vertex_size(intel, intel->vertex_size);
-  assert(k);
+  assert(intel->vtbl.check_vertex_size(intel, intel->vertex_size));
}
 
if (!p->params_uptodate)
-- 
2.3.1

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


[Mesa-dev] [PATCH] i965: Silence GCC maybe-uninitialized warning.

2015-03-06 Thread Vinson Lee
brw_shader.cpp: In function ‘bool brw_saturate_immediate(brw_reg_type, 
brw_reg*)’:
brw_shader.cpp:618:31: warning: ‘sat_imm.brw_saturate_immediate(brw_reg_type, 
brw_reg*)ud’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
   reg->dw1.ud = sat_imm.ud;
   ^

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i965/brw_shader.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp 
b/src/mesa/drivers/dri/i965/brw_shader.cpp
index f2b4d82..ff0ef4b 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -584,7 +584,7 @@ brw_saturate_immediate(enum brw_reg_type type, struct 
brw_reg *reg)
   unsigned ud;
   int d;
   float f;
-   } imm = { reg->dw1.ud }, sat_imm;
+   } imm = { reg->dw1.ud }, sat_imm = { 0 };
 
switch (type) {
case BRW_REGISTER_TYPE_UD:
-- 
2.3.1

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


[Mesa-dev] [PATCH] radeon: Fix GCC unused-but-set-variable warnings.

2015-03-06 Thread Vinson Lee
radeon_fbo.c: In function ‘radeon_map_renderbuffer_s8z24’:
radeon_fbo.c:162:9: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
 int ret;
 ^
radeon_fbo.c: In function ‘radeon_map_renderbuffer_z16’:
radeon_fbo.c:200:9: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
 int ret;
 ^
radeon_fbo.c: In function ‘radeon_map_renderbuffer’:
radeon_fbo.c:242:8: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]
int ret;
^
radeon_fbo.c: In function ‘radeon_unmap_renderbuffer’:
radeon_fbo.c:419:14: warning: variable ‘ok’ set but not used 
[-Wunused-but-set-variable]
GLboolean ok;
  ^

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/radeon/radeon_fbo.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c 
b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 110b030..2e3cb2b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -169,6 +169,9 @@ radeon_map_renderbuffer_s8z24(struct gl_context *ctx,
 rrb->map_buffer = malloc(w * h * 4);
 ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
 assert(!ret);
+if (!ret) {
+   return;
+}
 untiled_s8z24_map = rrb->map_buffer;
 tiled_s8z24_map = rrb->bo->ptr;
 
@@ -207,6 +210,9 @@ radeon_map_renderbuffer_z16(struct gl_context *ctx,
 rrb->map_buffer = malloc(w * h * 2);
 ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
 assert(!ret);
+if (!ret) {
+return;
+}
 
 untiled_z16_map = rrb->map_buffer;
 tiled_z16_map = rrb->bo->ptr;
@@ -291,6 +297,9 @@ radeon_map_renderbuffer(struct gl_context *ctx,
 
ret = radeon_bo_map(rrb->map_bo, !!(mode & GL_MAP_WRITE_BIT));
assert(!ret);
+   if (!ret) {
+  return;
+   }
 
map = rrb->map_bo->ptr;
 
@@ -449,6 +458,7 @@ radeon_unmap_renderbuffer(struct gl_context *ctx,
rrb->map_w, rrb->map_h,
GL_FALSE);
   assert(ok);
+  (void) ok;
}
 
radeon_bo_unref(rrb->map_bo);
-- 
2.3.1

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


[Mesa-dev] [PATCH] egl/dri2: Fix GCC maybe-uninitialized warning.

2015-03-06 Thread Vinson Lee
egl_dri2.c: In function ‘dri2_bind_tex_image’:
egl_dri2.c:1240:4: warning: ‘format’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
(*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
^

Signed-off-by: Vinson Lee 
---
 src/egl/drivers/dri2/egl_dri2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index d503196..88022e0 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1227,6 +1227,7 @@ dri2_bind_tex_image(_EGLDriver *drv,
   break;
default:
   assert(0);
+  format = 0;
}
 
switch (dri2_surf->base.TextureTarget) {
-- 
2.3.1

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


[Mesa-dev] [PATCH] nv30: Remove unused function nv40_fp_bra.

2015-03-06 Thread Vinson Lee
Fix GCC unused-function warning.

nv30/nvfx_fragprog.c:333:1: warning: ‘nv40_fp_bra’ defined but not used 
[-Wunused-function]
 nv40_fp_bra(struct nvfx_fpc *fpc, unsigned target)
 ^

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c | 26 
 1 file changed, 26 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c 
b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
index 6600997..e843ab8 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
@@ -328,32 +328,6 @@ nv40_fp_rep(struct nvfx_fpc *fpc, unsigned count, unsigned 
target)
 //util_dynarray_append(&fpc->loop_stack, unsigned, target);
 }
 
-/* warning: this only works forward, and probably only if not inside any IF */
-static void
-nv40_fp_bra(struct nvfx_fpc *fpc, unsigned target)
-{
-struct nvfx_relocation reloc;
-uint32_t *hw;
-fpc->inst_offset = fpc->fp->insn_len;
-grow_insns(fpc, 4);
-hw = &fpc->fp->insn[fpc->inst_offset];
-/* I really wonder why fp16 precision is used. Presumably the hardware 
ignores it? */
-hw[0] = (NV40_FP_OP_BRA_OPCODE_IF << NVFX_FP_OP_OPCODE_SHIFT) |
-NV40_FP_OP_OUT_NONE |
-(NVFX_FP_PRECISION_FP16 << NVFX_FP_OP_PRECISION_SHIFT);
-/* Use . swizzle so that we check only src[0].x*/
-hw[1] = (NVFX_SWZ_IDENTITY << NVFX_FP_OP_COND_SWZ_X_SHIFT) |
-(NVFX_FP_OP_COND_FL << NVFX_FP_OP_COND_SHIFT);
-hw[2] = NV40_FP_OP_OPCODE_IS_BRANCH; /* | else_offset */
-hw[3] = 0; /* | endif_offset */
-reloc.target = target;
-reloc.location = fpc->inst_offset + 2;
-util_dynarray_append(&fpc->label_relocs, struct nvfx_relocation, 
reloc);
-reloc.target = target;
-reloc.location = fpc->inst_offset + 3;
-util_dynarray_append(&fpc->label_relocs, struct nvfx_relocation, 
reloc);
-}
-
 static void
 nv40_fp_brk(struct nvfx_fpc *fpc)
 {
-- 
2.3.1

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


[Mesa-dev] [PATCH] nouveau: Silence GCC maybe-uninitialized warnings.

2015-03-06 Thread Vinson Lee
nouveau_compiler.c: In function ‘main’:
nouveau_compiler.c:216:27: warning: ‘code’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]
   printf("%08x ", code[i / 4]);
   ^
nouveau_compiler.c:215:4: warning: ‘size’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]
for (i = 0; i < size; i += 4) {
^

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/nouveau_compiler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_compiler.c 
b/src/gallium/drivers/nouveau/nouveau_compiler.c
index 8660498..ca128b5 100644
--- a/src/gallium/drivers/nouveau/nouveau_compiler.c
+++ b/src/gallium/drivers/nouveau/nouveau_compiler.c
@@ -144,7 +144,7 @@ main(int argc, char *argv[])
const char *filename = NULL;
FILE *f;
char text[65536] = {0};
-   unsigned size, *code;
+   unsigned size = 0, *code = NULL;
 
for (i = 1; i < argc; i++) {
   if (!strcmp(argv[i], "-a"))
-- 
2.3.1

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


[Mesa-dev] [PATCH v2] nv30: Add unused attribute to function nv40_fp_bra.

2015-03-06 Thread Vinson Lee
Silences GCC unused-function warning.

nv30/nvfx_fragprog.c:333:1: warning: ‘nv40_fp_bra’ defined but not used 
[-Wunused-function]
 nv40_fp_bra(struct nvfx_fpc *fpc, unsigned target)
 ^

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c 
b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
index 6600997..abd51c8 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
@@ -329,7 +329,7 @@ nv40_fp_rep(struct nvfx_fpc *fpc, unsigned count, unsigned 
target)
 }
 
 /* warning: this only works forward, and probably only if not inside any IF */
-static void
+static __attribute__((unused)) void
 nv40_fp_bra(struct nvfx_fpc *fpc, unsigned target)
 {
 struct nvfx_relocation reloc;
-- 
2.3.1

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


[Mesa-dev] [PATCH v2] egl/dri2: Fix GCC maybe-uninitialized warning.

2015-03-06 Thread Vinson Lee
egl_dri2.c: In function ‘dri2_bind_tex_image’:
egl_dri2.c:1240:4: warning: ‘format’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
(*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
^

Suggested-by: Ilia Mirkin 
Signed-off-by: Vinson Lee 
---
 src/egl/drivers/dri2/egl_dri2.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index d503196..c5c475d 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1226,7 +1226,8 @@ dri2_bind_tex_image(_EGLDriver *drv,
   format = __DRI_TEXTURE_FORMAT_RGBA;
   break;
default:
-  assert(0);
+  _eglError(EGL_BAD_SURFACE, "unrecognized format");
+  return EGL_FALSE;
}
 
switch (dri2_surf->base.TextureTarget) {
@@ -1234,7 +1235,8 @@ dri2_bind_tex_image(_EGLDriver *drv,
   target = GL_TEXTURE_2D;
   break;
default:
-  assert(0);
+  _eglError(EGL_BAD_SURFACE, "unrecognized target");
+  return EGL_FALSE;
}
 
(*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
-- 
2.3.1

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


[Mesa-dev] [PATCH v2] nouveau: Silence GCC maybe-uninitialized warnings.

2015-03-07 Thread Vinson Lee
nouveau_compiler.c: In function ‘main’:
nouveau_compiler.c:216:27: warning: ‘code’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]
   printf("%08x ", code[i / 4]);
   ^
nouveau_compiler.c:215:4: warning: ‘size’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]
for (i = 0; i < size; i += 4) {
^

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/nouveau_compiler.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nouveau_compiler.c 
b/src/gallium/drivers/nouveau/nouveau_compiler.c
index 8660498..c31885f 100644
--- a/src/gallium/drivers/nouveau/nouveau_compiler.c
+++ b/src/gallium/drivers/nouveau/nouveau_compiler.c
@@ -128,6 +128,8 @@ nouveau_codegen(int chipset, int type, struct tgsi_token 
tokens[],
ret = nv50_ir_generate_code(&info);
if (ret) {
   _debug_printf("Error compiling program: %d\n", ret);
+  *size = 0;
+  *code = NULL;
   return ret;
}
 
-- 
2.3.1

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


[Mesa-dev] [PATCH v2] nouveau: Silence GCC maybe-uninitialized warnings.

2015-03-07 Thread Vinson Lee
nouveau_compiler.c: In function ‘main’:
nouveau_compiler.c:216:27: warning: ‘code’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]
   printf("%08x ", code[i / 4]);
   ^
nouveau_compiler.c:215:4: warning: ‘size’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]
for (i = 0; i < size; i += 4) {
^

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/nouveau_compiler.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nouveau_compiler.c 
b/src/gallium/drivers/nouveau/nouveau_compiler.c
index 8660498..c31885f 100644
--- a/src/gallium/drivers/nouveau/nouveau_compiler.c
+++ b/src/gallium/drivers/nouveau/nouveau_compiler.c
@@ -128,6 +128,8 @@ nouveau_codegen(int chipset, int type, struct tgsi_token 
tokens[],
ret = nv50_ir_generate_code(&info);
if (ret) {
   _debug_printf("Error compiling program: %d\n", ret);
+  *size = 0;
+  *code = NULL;
   return ret;
}
 
-- 
2.3.1

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


[Mesa-dev] [PATCH] Add macro for unused function attribute.

2015-03-07 Thread Vinson Lee
Suggested-by: Emil Velikov 
Signed-off-by: Vinson Lee 
---
 configure.ac  | 1 +
 scons/gallium.py  | 1 +
 src/util/macros.h | 6 ++
 3 files changed, 8 insertions(+)

diff --git a/configure.ac b/configure.ac
index 90c7737..2954f80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -195,6 +195,7 @@ AX_GCC_FUNC_ATTRIBUTE([flatten])
 AX_GCC_FUNC_ATTRIBUTE([format])
 AX_GCC_FUNC_ATTRIBUTE([malloc])
 AX_GCC_FUNC_ATTRIBUTE([packed])
+AX_GCC_FUNC_ATTRIBUTE([unused])
 
 AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
 
diff --git a/scons/gallium.py b/scons/gallium.py
index 7533f06..b162089 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -369,6 +369,7 @@ def generate(env):
 'HAVE___BUILTIN_FFS',
 'HAVE___BUILTIN_FFSLL',
 'HAVE_FUNC_ATTRIBUTE_FLATTEN',
+'HAVE_FUNC_ATTRIBUTE_UNUSED',
 # GCC 3.0
 'HAVE_FUNC_ATTRIBUTE_FORMAT',
 'HAVE_FUNC_ATTRIBUTE_PACKED',
diff --git a/src/util/macros.h b/src/util/macros.h
index 63daba3..6c7bda7 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -176,5 +176,11 @@ do {   \
 #  endif
 #endif
 
+#ifdef HAVE_FUNC_ATTRIBUTE_UNUSED
+#define UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#endif
+
 
 #endif /* UTIL_MACROS_H */
-- 
2.3.1

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


[Mesa-dev] [PATCH] configure: Only require libdrm 2.4.75 for intel.

2017-02-01 Thread Vinson Lee
Fixes: b8acb6b17981 ("configure: Require libdrm >= 2.4.75")
Signed-off-by: Vinson Lee 
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 92339b4..d4302bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,10 +67,10 @@ OPENCL_VERSION=1
 AC_SUBST([OPENCL_VERSION])
 
 dnl Versions for external dependencies
-LIBDRM_REQUIRED=2.4.75
+LIBDRM_REQUIRED=2.4.66
 LIBDRM_RADEON_REQUIRED=2.4.56
 LIBDRM_AMDGPU_REQUIRED=2.4.63
-LIBDRM_INTEL_REQUIRED=2.4.61
+LIBDRM_INTEL_REQUIRED=2.4.75
 LIBDRM_NVVIEUX_REQUIRED=2.4.66
 LIBDRM_NOUVEAU_REQUIRED=2.4.66
 LIBDRM_FREEDRENO_REQUIRED=2.4.74
-- 
2.10.2

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


Re: [Mesa-dev] [PATCH] configure: Only require libdrm 2.4.75 for intel.

2017-02-01 Thread Vinson Lee
On Wed, Feb 1, 2017 at 4:10 PM, Emil Velikov  wrote:
> On 1 February 2017 at 23:28, Vinson Lee  wrote:
>> Fixes: b8acb6b17981 ("configure: Require libdrm >= 2.4.75")
>> Signed-off-by: Vinson Lee 
> Are you sure that's correct ?
>
> Afaict the follow-up commits make use of updated i915_drm.h which
> should be provided by your distro's libdrm-dev package.
> Or perhaps it used some new libdrm_intel functionality - can you list
> what flags up on your end ?
>
> -Emil

Yes, this allows me to build non-Intel drivers again with older
libdrm. Do any drivers other than Intel drivers need libdrm 2.4.75?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] swr: [rasterizer core] Remove dead code Clipper::ClipScalar()

2017-02-04 Thread Vinson Lee
Tested-by: Vinson Lee 

On Thu, Feb 2, 2017 at 12:42 PM, Cherniak, Bruce
 wrote:
> I followed up with a v2 that includes the bugzilla reference.
>
> Good point, I’ll look into following up with a patch to remove Clip().
>
> Thanks for the quick review.
>
>> On Feb 2, 2017, at 2:26 PM, Ilia Mirkin  wrote:
>>
>> Reviewed-by: Ilia Mirkin 
>>
>> I got confused by this code as well when I was trying to understand
>> the clipper. I think the Clip() function can go too now in the .cpp
>> file (as well as the fwd decl in the header)?
>>
>> On Thu, Feb 2, 2017 at 3:15 PM, Bruce Cherniak  
>> wrote:
>>> Clipper::ClipScalar() is dead code and should be removed.  It is causing
>>> an error with gcc-7 because it references a now defunct member.
>>>
>>> CC: "13.0 17.0" 
>>> ---
>>> src/gallium/drivers/swr/rasterizer/core/clip.h | 39 
>>> --
>>> 1 file changed, 39 deletions(-)
>>>
>>> diff --git a/src/gallium/drivers/swr/rasterizer/core/clip.h 
>>> b/src/gallium/drivers/swr/rasterizer/core/clip.h
>>> index 085e4a9..f19858f 100644
>>> --- a/src/gallium/drivers/swr/rasterizer/core/clip.h
>>> +++ b/src/gallium/drivers/swr/rasterizer/core/clip.h
>>> @@ -262,45 +262,6 @@ public:
>>> return _simd_movemask_ps(vClipCullMask);
>>> }
>>>
>>> -// clip a single primitive
>>> -int ClipScalar(PA_STATE& pa, uint32_t primIndex, float* pOutPos, 
>>> float* pOutAttribs)
>>> -{
>>> -OSALIGNSIMD(float) inVerts[3 * 4];
>>> -OSALIGNSIMD(float) inAttribs[3 * KNOB_NUM_ATTRIBUTES * 4];
>>> -
>>> -// transpose primitive position
>>> -__m128 verts[3];
>>> -pa.AssembleSingle(VERTEX_POSITION_SLOT, primIndex, verts);
>>> -_mm_store_ps(&inVerts[0], verts[0]);
>>> -_mm_store_ps(&inVerts[4], verts[1]);
>>> -_mm_store_ps(&inVerts[8], verts[2]);
>>> -
>>> -// transpose attribs
>>> -uint32_t numScalarAttribs = this->state.linkageCount * 4;
>>> -
>>> -int idx = 0;
>>> -DWORD slot = 0;
>>> -uint32_t mapIdx = 0;
>>> -uint32_t tmpLinkage = uint32_t(this->state.linkageMask);
>>> -while (_BitScanForward(&slot, tmpLinkage))
>>> -{
>>> -tmpLinkage &= ~(1 << slot);
>>> -// Compute absolute attrib slot in vertex array
>>> -uint32_t inputSlot = VERTEX_ATTRIB_START_SLOT + 
>>> this->state.linkageMap[mapIdx++];
>>> -__m128 attrib[3];// triangle attribs (always 4 wide)
>>> -pa.AssembleSingle(inputSlot, primIndex, attrib);
>>> -_mm_store_ps(&inAttribs[idx], attrib[0]);
>>> -_mm_store_ps(&inAttribs[idx + numScalarAttribs], attrib[1]);
>>> -_mm_store_ps(&inAttribs[idx + numScalarAttribs * 2], 
>>> attrib[2]);
>>> -idx += 4;
>>> -}
>>> -
>>> -int numVerts;
>>> -Clip(inVerts, inAttribs, numScalarAttribs, pOutPos, &numVerts, 
>>> pOutAttribs);
>>> -
>>> -return numVerts;
>>> -}
>>> -
>>> // clip SIMD primitives
>>> void ClipSimd(const simdscalar& vPrimMask, const simdscalar& vClipMask, 
>>> PA_STATE& pa, const simdscalari& vPrimId, const simdscalari& vViewportIdx)
>>> {
>>> --
>>> 2.7.4
>>>
>>> ___
>>> mesa-dev mailing list
>>> mesa-dev@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] glsl: Fix missing-braces warning.

2017-02-13 Thread Vinson Lee
  CXXglsl/ast_to_hir.lo
glsl/ast_to_hir.cpp: In member function 'virtual ir_rvalue* 
ast_declarator_list::hir(exec_list*, _mesa_glsl_parse_state*)':
glsl/ast_to_hir.cpp:4846:42: warning: missing braces around initializer for 
'unsigned int [16]' [-Wmissing-braces]

Signed-off-by: Vinson Lee 
---
 src/compiler/glsl/ast_to_hir.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index b90ad97b1de4..f148db8617d6 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4843,7 +4843,7 @@ ast_declarator_list::hir(exec_list *instructions,
   if ((var->data.mode == ir_var_auto || var->data.mode == ir_var_temporary)
   && (var->type->is_numeric() || var->type->is_boolean())
   && state->zero_init) {
- const ir_constant_data data = {0};
+ const ir_constant_data data = { { 0 } };
  var->data.has_initializer = true;
  var->constant_initializer = new(var) ir_constant(var->type, &data);
   }
-- 
1.7.9.5

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


[Mesa-dev] [PATCH] util/disk_cache: Use backward compatible st_mtime.

2017-02-23 Thread Vinson Lee
Fix Mac OS X build error.

  CC   libmesautil_la-disk_cache.lo
In file included from disk_cache.c:46:
./disk_cache.h:57:20: error: no member named 'st_mtim' in 'struct stat'
   *timestamp = st.st_mtim.tv_sec;
~~ ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99918
Fixes: 207e3a6e4b ("util/radv: move *_get_function_timestamp() to utils")
Signed-off-by: Vinson Lee 
---
 src/util/disk_cache.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/disk_cache.h b/src/util/disk_cache.h
index 7f4da809cc..b7c0df25dd 100644
--- a/src/util/disk_cache.h
+++ b/src/util/disk_cache.h
@@ -54,7 +54,7 @@ disk_cache_get_function_timestamp(void *ptr, uint32_t* 
timestamp)
if (stat(info.dli_fname, &st)) {
   return false;
}
-   *timestamp = st.st_mtim.tv_sec;
+   *timestamp = st.st_mtime;
return true;
 #else
return false;
-- 
2.11.1

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


[Mesa-dev] [PATCH] glsl: Fix missing-braces warning.

2017-02-23 Thread Vinson Lee
  CXXglsl/ast_to_hir.lo
glsl/ast_to_hir.cpp: In member function 'virtual ir_rvalue* 
ast_declarator_list::hir(exec_list*, _mesa_glsl_parse_state*)':
glsl/ast_to_hir.cpp:4846:42: warning: missing braces around initializer for 
'unsigned int [16]' [-Wmissing-braces]

Signed-off-by: Vinson Lee 
---
 src/compiler/glsl/ast_to_hir.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index b90ad97b1de4..f148db8617d6 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4843,7 +4843,7 @@ ast_declarator_list::hir(exec_list *instructions,
   if ((var->data.mode == ir_var_auto || var->data.mode == ir_var_temporary)
   && (var->type->is_numeric() || var->type->is_boolean())
   && state->zero_init) {
- const ir_constant_data data = {0};
+ const ir_constant_data data = { { 0 } };
  var->data.has_initializer = true;
  var->constant_initializer = new(var) ir_constant(var->type, &data);
   }
-- 
1.7.9.5

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


Re: [Mesa-dev] [PATCH] st/nine: Remove code for no USER_INDEX_BUFFERS as these are always on

2017-02-24 Thread Vinson Lee
On Fri, Feb 24, 2017 at 9:23 PM, Mike Lothian  wrote:
> This fixes 4a883966c1f74f43afc145d2c3d27af7b8c5e01a where the pipe cap
> was removed
>
> Now USER_INDEX_BUFFERS are always enabled remove code that checks for
> them and works around them not being available
>
> Signed-off-by: Mike Lothian 
> Cc: Marek Olšák 
> Cc: Axel Davy 
> ---
>  src/gallium/state_trackers/nine/device9.c | 17 -
>  1 file changed, 17 deletions(-)
>
> diff --git a/src/gallium/state_trackers/nine/device9.c 
> b/src/gallium/state_trackers/nine/device9.c
> index b9b7a637d7..2217cc9d0c 100644
> --- a/src/gallium/state_trackers/nine/device9.c
> +++ b/src/gallium/state_trackers/nine/device9.c
> @@ -473,7 +473,6 @@ NineDevice9_ctor( struct NineDevice9 *This,
>  /* Allocate upload helper for drivers that suck (from st pov ;). */
>
>  This->driver_caps.user_vbufs = GET_PCAP(USER_VERTEX_BUFFERS) && 
> !This->csmt_active;
> -This->driver_caps.user_ibufs = GET_PCAP(USER_INDEX_BUFFERS) && 
> !This->csmt_active;
>  This->driver_caps.user_cbufs = GET_PCAP(USER_CONSTANT_BUFFERS);
>  This->driver_caps.user_sw_vbufs = 
> This->screen_sw->get_param(This->screen_sw, PIPE_CAP_USER_VERTEX_BUFFERS);
>  This->driver_caps.user_sw_cbufs = 
> This->screen_sw->get_param(This->screen_sw, PIPE_CAP_USER_CONSTANT_BUFFERS);
> @@ -488,11 +487,6 @@ NineDevice9_ctor( struct NineDevice9 *This,
>  PIPE_BIND_VERTEX_BUFFER, 
> PIPE_USAGE_STREAM);
>  This->vertex_sw_uploader = u_upload_create(This->pipe_sw, 65536,
>  PIPE_BIND_VERTEX_BUFFER, 
> PIPE_USAGE_STREAM);
> -if (!This->driver_caps.user_ibufs)
> -This->index_uploader = u_upload_create(This->csmt_active ?
> -This->pipe_secondary : 
> This->context.pipe,
> -   128 * 1024,
> -   PIPE_BIND_INDEX_BUFFER, 
> PIPE_USAGE_STREAM);
>  if (!This->driver_caps.user_cbufs) {
>  This->constbuf_alignment = 
> GET_PCAP(CONSTANT_BUFFER_OFFSET_ALIGNMENT);
>  This->constbuf_uploader = u_upload_create(This->context.pipe, 
> This->vs_const_size,
> @@ -2928,17 +2922,6 @@ NineDevice9_DrawIndexedPrimitiveUP( struct NineDevice9 
> *This,
>  vbuf.buffer_offset -= base;
>  vbuf.user_buffer = NULL;
>  }
> -if (!This->driver_caps.user_ibufs) {
> -u_upload_data(This->index_uploader,
> -  0,
> -  (prim_count_to_vertex_count(PrimitiveType, 
> PrimitiveCount)) * ibuf.index_size,
> -  4,
> -  ibuf.user_buffer,
> -  &ibuf.offset,
> -  &ibuf.buffer);
> -u_upload_unmap(This->index_uploader);
> -ibuf.user_buffer = NULL;
> -}
>
>  NineBeforeDraw(This);
>  nine_context_draw_indexed_primitive_from_vtxbuf_idxbuf(This, 
> PrimitiveType,
> --
> 2.11.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99953
Fixes: 4a883966c1f7 ("gallium: remove PIPE_CAP_USER_INDEX_BUFFERS")

Tested-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glx/tests: Fix bash-specific code in dispatch-index-check

2017-02-24 Thread Vinson Lee
On Fri, Feb 24, 2017 at 8:03 PM, Aaron Watry  wrote:
> Using <<< for variable redirection is bash-specific behavior.
> Ubuntu redirects sh -> dash, so this was erroring out.
>
> Also, the initial error that led me to this was that srcdir is null when 
> running make check
> so I just copied something similar to what the optimization-test script does.
> ---
>  src/glx/tests/dispatch-index-check | 21 ++---
>  1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/src/glx/tests/dispatch-index-check 
> b/src/glx/tests/dispatch-index-check
> index 78464b8..ee1b9ee 100755
> --- a/src/glx/tests/dispatch-index-check
> +++ b/src/glx/tests/dispatch-index-check
> @@ -1,24 +1,31 @@
>  #!/bin/sh
>
> +if [ -z "$srcdir" ]; then
> +   scriptdir=`dirname "$0"`
> +else
> +   scriptdir=$srcdir
> +fi
> +
> +
>  # extract enum definition
>  dispatch_list=$(sed '/__GLXdispatchIndex/,/__GLXdispatchIndex/!d' \
> -  "$srcdir"/../g_glxglvnddispatchindices.h)
> +  "$scriptdir"/../g_glxglvnddispatchindices.h)
>
>  # extract values inside of enum
> -dispatch_list=$(sed '1d;$d' <<< "$dispatch_list")
> +dispatch_list=$(printf "$dispatch_list" | sed '1d;$d')
>
>  # remove indentation
> -dispatch_list=$(sed 's/^\s\+//' <<< "$dispatch_list")
> +dispatch_list=$(printf "$dispatch_list" | sed 's/^\s\+//')
>
>  # extract function names
> -dispatch_list=$(sed 's/DI_//;s/,//' <<< "$dispatch_list")
> +dispatch_list=$(printf "$dispatch_list" | sed 's/DI_//;s/,//')
>
>  # same for commented functions, we want to keep them sorted too
> -dispatch_list=$(sed 's#// ##;s/ implemented by [a-z]\+//' <<< 
> "$dispatch_list")
> +dispatch_list=$(printf "$dispatch_list" | sed 's#// ##;s/ implemented by 
> [a-z]\+//')
>
>  # remove LAST_INDEX, as it will not be in alphabetical order
> -dispatch_list=$(sed '/LAST_INDEX/d' <<< "$dispatch_list")
> +dispatch_list=$(printf "$dispatch_list" | sed '/LAST_INDEX/d')
>
> -sorted=$(LC_ALL=C sort <<< "$dispatch_list")
> +sorted=$(LC_ALL=C printf "$dispatch_list" | sort)
>
>  test "$dispatch_list" = "$sorted"
> --
> 2.9.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Fixes: 3cc33e764011 ("glx: add GLXdispatchIndex sort check")

Tested-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] pipebuffer: Silence GCC unused-but-set-variable warning.

2015-07-29 Thread Vinson Lee
pb_buffer_fenced.c: In function 'fenced_buffer_fence':
pb_buffer_fenced.c:849:18: warning: variable 'destroyed' set but not used 
[-Wunused-but-set-variable]
  boolean destroyed;
  ^

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c 
b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index 08935b4..f6608b3 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -849,6 +849,7 @@ fenced_buffer_fence(struct pb_buffer *buf,
  boolean destroyed;
  destroyed = fenced_buffer_remove_locked(fenced_mgr, fenced_buf);
  assert(!destroyed);
+ (void) destroyed;
   }
   if (fence) {
  ops->fence_reference(ops, &fenced_buf->fence, fence);
-- 
2.1.4

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


[Mesa-dev] [PATCH] gallium/util: Silence GCC unused-but-set-variable warning.

2015-07-29 Thread Vinson Lee
u_surface.c: In function 'util_resource_copy_region':
u_surface.c:257:21: warning: variable 'src_format' set but not used 
[-Wunused-but-set-variable]
enum pipe_format src_format, dst_format;
     ^

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/util/u_surface.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/auxiliary/util/u_surface.c 
b/src/gallium/auxiliary/util/u_surface.c
index 654b5bb..e362471 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -270,6 +270,7 @@ util_resource_copy_region(struct pipe_context *pipe,
assert(util_format_get_blocksize(dst_format) == 
util_format_get_blocksize(src_format));
assert(util_format_get_blockwidth(dst_format) == 
util_format_get_blockwidth(src_format));
assert(util_format_get_blockheight(dst_format) == 
util_format_get_blockheight(src_format));
+   (void) src_format;
 
src_map = pipe->transfer_map(pipe,
 src,
-- 
2.1.4

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


[Mesa-dev] [PATCH] gallivm: Fix GCC unused-variable warning.

2015-07-29 Thread Vinson Lee
lp_bld_tgsi_soa.c: In function 'lp_emit_immediate_soa':
lp_bld_tgsi_soa.c:3065:18: warning: unused variable 'size' [-Wunused-variable]
   const uint size = imm->Immediate.NrTokens - 1;
  ^

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 55f606f..fae604e 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -3062,8 +3062,7 @@ void lp_emit_immediate_soa(
} else {
   /* simply copy the immediate values into the next immediates[] slot */
   unsigned i;
-  const uint size = imm->Immediate.NrTokens - 1;
-  assert(size <= 4);
+  assert(imm->Immediate.NrTokens - 1 <= 4);
   assert(bld->num_immediates < LP_MAX_INLINED_IMMEDIATES);
 
   for(i = 0; i < 4; ++i )
-- 
2.1.4

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


[Mesa-dev] [PATCH] draw: Silence GCC unused-variable warnings.

2015-07-29 Thread Vinson Lee
draw/draw_llvm.c: In function 'create_jit_sampler_type':
draw/draw_llvm.c:178:22: warning: unused variable 'target' [-Wunused-variable]
LLVMTargetDataRef target = gallivm->target;
  ^
draw/draw_llvm.c: In function 'create_jit_context_type':
draw/draw_llvm.c:218:22: warning: unused variable 'target' [-Wunused-variable]
LLVMTargetDataRef target = gallivm->target;
  ^
draw/draw_llvm.c: In function 'create_jit_vertex_header':
draw/draw_llvm.c:377:22: warning: unused variable 'target' [-Wunused-variable]
LLVMTargetDataRef target = gallivm->target;
  ^

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/draw/draw_llvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/draw/draw_llvm.c 
b/src/gallium/auxiliary/draw/draw_llvm.c
index b1e1bcb..26580e0 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -202,6 +202,7 @@ create_jit_sampler_type(struct gallivm_state *gallivm, 
const char *struct_name)
   DRAW_JIT_SAMPLER_BORDER_COLOR);
 
LP_CHECK_STRUCT_SIZE(struct draw_jit_sampler, target, sampler_type);
+   (void) target;
 
return sampler_type;
 }
@@ -250,6 +251,7 @@ create_jit_context_type(struct gallivm_state *gallivm,
   DRAW_JIT_CTX_SAMPLERS);
LP_CHECK_STRUCT_SIZE(struct draw_jit_context,
 target, context_type);
+   (void) target;
 
return context_type;
 }
@@ -415,6 +417,7 @@ create_jit_vertex_header(struct gallivm_state *gallivm, int 
data_elems)
 
assert(LLVMABISizeOfType(target, vertex_header) ==
   offsetof(struct vertex_header, data[data_elems]));
+   (void) target;
 
return vertex_header;
 }
-- 
2.1.4

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


Re: [Mesa-dev] [PATCH] gallium/util: Silence GCC unused-but-set-variable warning.

2015-07-29 Thread Vinson Lee
On Wed, Jul 29, 2015 at 8:33 PM, Matt Turner  wrote:
> On Wed, Jul 29, 2015 at 8:12 PM, Vinson Lee  wrote:
>> u_surface.c: In function 'util_resource_copy_region':
>> u_surface.c:257:21: warning: variable 'src_format' set but not used 
>> [-Wunused-but-set-variable]
>> enum pipe_format src_format, dst_format;
>>  ^
>>
>> Signed-off-by: Vinson Lee 
>> ---
>>  src/gallium/auxiliary/util/u_surface.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/src/gallium/auxiliary/util/u_surface.c 
>> b/src/gallium/auxiliary/util/u_surface.c
>> index 654b5bb..e362471 100644
>> --- a/src/gallium/auxiliary/util/u_surface.c
>> +++ b/src/gallium/auxiliary/util/u_surface.c
>> @@ -270,6 +270,7 @@ util_resource_copy_region(struct pipe_context *pipe,
>> assert(util_format_get_blocksize(dst_format) == 
>> util_format_get_blocksize(src_format));
>> assert(util_format_get_blockwidth(dst_format) == 
>> util_format_get_blockwidth(src_format));
>> assert(util_format_get_blockheight(dst_format) == 
>> util_format_get_blockheight(src_format));
>> +   (void) src_format;
>
> We've recently begun using gcc's __attribute__((unused)) -- There's a
> macro named UNUSED. I might suggest using it. I've seen some case
> where the (void) trick wasn't sufficient.

The variable is definitely used though in debug builds. Would unused
still be the appropriate annotation in these cases?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] vl/mpeg12: Silence GCC unused-variable warning.

2015-08-01 Thread Vinson Lee
vl/vl_mpeg12_bitstream.c: In function 'decode_slice':
vl/vl_mpeg12_bitstream.c:928:19: warning: unused variable 'extra' 
[-Wunused-variable]
  unsigned extra = vl_vlc_get_uimsbf(&bs->vlc, 1);
       ^

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c 
b/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
index 539a991..52ce6c4 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c
@@ -929,6 +929,7 @@ decode_slice(struct vl_mpg12_bs *bs, struct 
pipe_video_buffer *target)
  mb.PMV[1][0][0] = mb.PMV[0][0][0];
  mb.PMV[1][0][1] = mb.PMV[0][0][1];
  assert(extra);
+ (void) extra;
   } else if (mb.macroblock_type & PIPE_MPEG12_MB_TYPE_INTRA ||
 !(mb.macroblock_type & (PIPE_MPEG12_MB_TYPE_MOTION_FORWARD |
 PIPE_MPEG12_MB_TYPE_MOTION_BACKWARD))) 
{
-- 
2.1.4

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


[Mesa-dev] [PATCH] scons: Always define __STDC_LIMIT_MACROS.

2015-08-14 Thread Vinson Lee
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91591
Signed-off-by: Vinson Lee 
---
 scons/gallium.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scons/gallium.py b/scons/gallium.py
index 51b84d7..46dbf0e 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -300,6 +300,7 @@ def generate(env):
 
 # C preprocessor options
 cppdefines = []
+cppdefines += ['__STDC_LIMIT_MACROS']
 if env['build'] in ('debug', 'checked'):
 cppdefines += ['DEBUG']
 else:
-- 
2.1.4

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


[Mesa-dev] [PATCH] ABI-check: Use more portable bash invocation.

2015-08-17 Thread Vinson Lee
Fixes 'make check' on FreeBSD.

Signed-off-by: Vinson Lee 
---
 src/mapi/es1api/ABI-check | 2 +-
 src/mapi/es2api/ABI-check | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mapi/es1api/ABI-check b/src/mapi/es1api/ABI-check
index 44654cd..819568f 100755
--- a/src/mapi/es1api/ABI-check
+++ b/src/mapi/es1api/ABI-check
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Print defined gl.* functions not in GL ES 1.1 or in
 # (FIXME, none of these should be part of the ABI)
diff --git a/src/mapi/es2api/ABI-check b/src/mapi/es2api/ABI-check
index abbb55c..e0bf3c8 100755
--- a/src/mapi/es2api/ABI-check
+++ b/src/mapi/es2api/ABI-check
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Print defined gl.* functions not in GL ES 3.0 or in
 # (FIXME, none of these should be part of the ABI)
-- 
2.1.4

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


[Mesa-dev] [PATCH] Revert "mesa_glinterop: remove inclusion of GLX header"

2016-10-03 Thread Vinson Lee
This reverts commit 8472045b16b3e4621553fe451a20a9ba9f0d44b6.

Conflicts:

include/GL/mesa_glinterop.h

This patch fixes this build error with GCC 4.4.

  Compiling src/glx/dri_common_interop.c ...
In file included from src/glx/dri_common_interop.c:33:
include/GL/mesa_glinterop.h:62: error: redefinition of typedef ‘GLXContext’
include/GL/glx.h:165: note: previous declaration of ‘GLXContext’ was here

Fixes: 8472045b16b3 ("mesa_glinterop: remove inclusion of GLX header")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96770
Signed-off-by: Vinson Lee 
---
 include/GL/mesa_glinterop.h |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/include/GL/mesa_glinterop.h b/include/GL/mesa_glinterop.h
index 383d7f9..c6a967e 100644
--- a/include/GL/mesa_glinterop.h
+++ b/include/GL/mesa_glinterop.h
@@ -52,15 +52,12 @@
 
 #include 
 #include 
+#include 
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/* Forward declarations to avoid inclusion of GL/glx.h */
-typedef struct _XDisplay Display;
-typedef struct __GLXcontextRec *GLXContext;
-
 /* Forward declarations to avoid inclusion of EGL/egl.h */
 typedef void *EGLDisplay;
 typedef void *EGLContext;
-- 
1.7.1

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


[Mesa-dev] [PATCH] glsl: Add missing cache_destroy stub function.

2016-10-07 Thread Vinson Lee
  CC   glsl/tests/cache_test.o
glsl/tests/cache_test.c: In function ‘test_cache_create’:
glsl/tests/cache_test.c:160:4: error: implicit declaration of function 
‘cache_destroy’ [-Werror=implicit-function-declaration]
cache_destroy(cache);
^

Fixes: 87ab26b2ab35 ("glsl: Add initial functions to implement an on-disk 
cache")
Signed-off-by: Vinson Lee 
---
 src/compiler/glsl/cache.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/compiler/glsl/cache.h b/src/compiler/glsl/cache.h
index 78df32b6c54e..d804169c6561 100644
--- a/src/compiler/glsl/cache.h
+++ b/src/compiler/glsl/cache.h
@@ -139,6 +139,11 @@ cache_create(void)
 }
 
 static inline void
+cache_destroy(struct program_cache *cache) {
+   return;
+}
+
+static inline void
 cache_put(struct program_cache *cache, cache_key key,
   const void *data, size_t size)
 {
-- 
2.7.4

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


Re: [Mesa-dev] [PATCH] mesa_glinterop: allow building without X and related headers

2016-10-12 Thread Vinson Lee
On Wed, Oct 12, 2016 at 10:49 AM, Emil Velikov  wrote:
> This commit effectively reverts c10dcb2ce837922c6ee4e191e6d6202098a5ee10
> and fixes the typedef redefinition which inspired it.
>
> In order to prevent requiring X packages at build time earlier commit
> forward declared the required X/GLX typedefs. Since that approach
> introduced typedef redefinition (a C11 feature) it was reverted.
>
> To avoid the redefinition while _not_ mandating X and related headers
> forward declare the structs and use those through the header.
>
> As anyone uses the mesa interop header they ensure that the X (or others
> in terms of EGL) headers are included, which ensures that everything is
> resolved within the compilation unit.
>
> Cc: Vinson Lee 
> Cc: "12.0" 
> Cc: Tapani Pälli 
> Cc: Chih-Wei Huang 
> Fixes: c10dcb2ce837 ("Revert "mesa_glinterop: remove inclusion of GLX
> header"")
> Fixes: 8472045b16b3 ("mesa_glinterop: remove inclusion of GLX header")
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96770
> Signed-off-by: Emil Velikov 
> ---
> TL;DR; Yay typedefs, because they make things so much better ;-)
>
> Tapani/Chih-Wei, this should fix the breakage that you are seing. Please
> let me know if it sorts things on your end.
>
> Vison, this should resolve things on your end as well. A confirmation
> would be great.
> ---
>  include/GL/mesa_glinterop.h | 13 -
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/include/GL/mesa_glinterop.h b/include/GL/mesa_glinterop.h
> index c6a967e..173476a 100644
> --- a/include/GL/mesa_glinterop.h
> +++ b/include/GL/mesa_glinterop.h
> @@ -52,12 +52,15 @@
>
>  #include 
>  #include 
> -#include 
>
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
>
> +/* Forward declarations to avoid inclusion of GL/glx.h */
> +struct _XDisplay;
> +struct __GLXcontextRec;
> +
>  /* Forward declarations to avoid inclusion of EGL/egl.h */
>  typedef void *EGLDisplay;
>  typedef void *EGLContext;
> @@ -243,7 +246,7 @@ struct mesa_glinterop_export_out {
>   * \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
>   */
>  int
> -MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
> +MesaGLInteropGLXQueryDeviceInfo(struct _XDisplay *dpy, struct 
> __GLXcontextRec *context,
>  struct mesa_glinterop_device_info *out);
>
>
> @@ -268,7 +271,7 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, 
> EGLContext context,
>   * \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
>   */
>  int
> -MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
> +MesaGLInteropGLXExportObject(struct _XDisplay *dpy, struct __GLXcontextRec 
> *context,
>   struct mesa_glinterop_export_in *in,
>   struct mesa_glinterop_export_out *out);
>
> @@ -283,11 +286,11 @@ MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext 
> context,
>   struct mesa_glinterop_export_out *out);
>
>
> -typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(Display *dpy, 
> GLXContext context,
> +typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(struct _XDisplay *dpy, 
> struct __GLXcontextRec *context,
>   struct 
> mesa_glinterop_device_info *out);
>  typedef int (PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, 
> EGLContext context,
>   struct 
> mesa_glinterop_device_info *out);
> -typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(Display *dpy, GLXContext 
> context,
> +typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(struct _XDisplay *dpy, 
> struct __GLXcontextRec *context,
>        struct 
> mesa_glinterop_export_in *in,
>struct 
> mesa_glinterop_export_out *out);
>  typedef int (PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, EGLContext 
> context,
> --
> 2.10.0
>

Builds okay with this patch for me.

Tested-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glcpp: Update tests for new #undef of built-in macro rules.

2016-08-15 Thread Vinson Lee
On Sun, Aug 14, 2016 at 9:07 PM, Kenneth Graunke  wrote:
> Ian recently changed the preprocessor to allow this in most GLSL
> versions, but not GLSL ES 3.00+.  This patch converts the existing
> test that expects a failure to a #version 300 es shader, and adds
> a #version 110 shader to make sure that it's allowed.
>
> Fixes 'make check'.
>
> Cc: i...@freedesktop.org
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97307
> Signed-off-by: Kenneth Graunke 
> ---
>  src/compiler/glsl/glcpp/tests/120-undef-builtin.c  | 1 +
>  src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected | 3 ++-
>  src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c  | 4 
>  src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected | 4 
>  4 files changed, 11 insertions(+), 1 deletion(-)
>  create mode 100644 src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c
>  create mode 100644 
> src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected
>
> diff --git a/src/compiler/glsl/glcpp/tests/120-undef-builtin.c 
> b/src/compiler/glsl/glcpp/tests/120-undef-builtin.c
> index 49e7696..f8ade19 100644
> --- a/src/compiler/glsl/glcpp/tests/120-undef-builtin.c
> +++ b/src/compiler/glsl/glcpp/tests/120-undef-builtin.c
> @@ -1,3 +1,4 @@
> +#version 300 es
>  #undef __LINE__
>  #undef __FILE__
>  #undef __VERSION__
> diff --git a/src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected 
> b/src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected
> index 3b736df..498dc0f 100644
> --- a/src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected
> +++ b/src/compiler/glsl/glcpp/tests/120-undef-builtin.c.expected
> @@ -1,6 +1,7 @@
> -0:1(1): preprocessor error: Built-in (pre-defined) macro names cannot be 
> undefined.
>  0:2(1): preprocessor error: Built-in (pre-defined) macro names cannot be 
> undefined.
>  0:3(1): preprocessor error: Built-in (pre-defined) macro names cannot be 
> undefined.
> +0:4(1): preprocessor error: Built-in (pre-defined) macro names cannot be 
> undefined.
> +#version 300 es
>
>
>
> diff --git a/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c 
> b/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c
> new file mode 100644
> index 000..e3af10d
> --- /dev/null
> +++ b/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c
> @@ -0,0 +1,4 @@
> +#version 110
> +#undef __LINE__
> +#undef __FILE__
> +#undef __VERSION__
> diff --git 
> a/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected 
> b/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected
> new file mode 100644
> index 000..cd0071f
> --- /dev/null
> +++ b/src/compiler/glsl/glcpp/tests/147-undef-builtin-allowed.c.expected
> @@ -0,0 +1,4 @@
> +#version 110
> +
> +
> +
> --
> 2.9.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Tested-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] glsl: Add positional argument specifiers.

2016-09-01 Thread Vinson Lee
Fix build with Python < 2.7.

  File "./glsl/ir_expression_operation.py", line 360, in get_enum_name
return "ir_{}op_{}".format(("un", "bin", "tri", 
"quad")[self.num_operands-1], self.name)
ValueError: zero length field name in format

Fixes: e31c72a331b1 ("glsl: Convert tuple into a class")
Signed-off-by: Vinson Lee 
---
 src/compiler/glsl/ir_expression_operation.py |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/compiler/glsl/ir_expression_operation.py 
b/src/compiler/glsl/ir_expression_operation.py
index 43ba46e..9aa08d3 100644
--- a/src/compiler/glsl/ir_expression_operation.py
+++ b/src/compiler/glsl/ir_expression_operation.py
@@ -357,7 +357,7 @@ class operation(object):
 
 
def get_enum_name(self):
-  return "ir_{}op_{}".format(("un", "bin", "tri", 
"quad")[self.num_operands-1], self.name)
+  return "ir_{0}op_{1}".format(("un", "bin", "tri", 
"quad")[self.num_operands-1], self.name)
 
 
def get_template(self):
@@ -394,10 +394,10 @@ class operation(object):
 
 
def get_c_expression(self, types, indices=("c", "c", "c")):
-  src0 = "op[0]->value.{}[{}]".format(types[0].union_field, indices[0])
-  src1 = "op[1]->value.{}[{}]".format(types[1].union_field, indices[1]) if 
len(types) >= 2 else "ERROR"
-  src2 = "op[2]->value.{}[{}]".format(types[2].union_field, indices[2]) if 
len(types) >= 3 else "ERROR"
-  src3 = "op[3]->value.{}[c]".format(types[3].union_field) if len(types) 
>= 4 else "ERROR"
+  src0 = "op[0]->value.{0}[{1}]".format(types[0].union_field, indices[0])
+  src1 = "op[1]->value.{0}[{1}]".format(types[1].union_field, indices[1]) 
if len(types) >= 2 else "ERROR"
+  src2 = "op[2]->value.{0}[{1}]".format(types[2].union_field, indices[2]) 
if len(types) >= 3 else "ERROR"
+  src3 = "op[3]->value.{0}[c]".format(types[3].union_field) if len(types) 
>= 4 else "ERROR"
 
   expr = self.c_expression[types[0].union_field] if types[0].union_field 
in self.c_expression else self.c_expression['default']
 
-- 
1.7.1

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


[Mesa-dev] [PATCH] util: Include string.h in bitscan.h.

2016-10-19 Thread Vinson Lee
Fix build error with clang.

  Compiling src/compiler/glsl/link_varyings.cpp ...
In file included from src/compiler/glsl/link_varyings.cpp:33:
In file included from src/compiler/glsl/glsl_symbol_table.h:34:
In file included from src/compiler/glsl/ir.h:33:
In file included from src/compiler/glsl_types.h:29:
/usr/include/string.h:518:12: error: exception specification in declaration 
does not match previous declaration
extern int ffs (int __i) __THROW __attribute__ ((__const__));
   ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
^
src/util/bitscan.h:96:18: note: previous declaration is here
   const int i = ffs(*mask) - 1;
 ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97952
Signed-off-by: Vinson Lee 
---
 src/util/bitscan.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/bitscan.h b/src/util/bitscan.h
index 8afef81a990a..a5dfa1f9e3bf 100644
--- a/src/util/bitscan.h
+++ b/src/util/bitscan.h
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include 
 
 #if defined(_MSC_VER)
 #include 
-- 
2.7.4

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


[Mesa-dev] [PATCH] scons: Require libdrm >= 2.4.65 for DRM.

2016-10-24 Thread Vinson Lee
Fix SCons build. drmDevicePtr is not available until libdrm 2.4.65.

  Compiling src/loader/loader.c ...
src/loader/loader.c:111:40: error: unknown type name ‘drmDevicePtr’
 static char *drm_construct_id_path_tag(drmDevicePtr device)
^

Fixes: 4a183f4d06f8 ("scons: loader: use libdrm when available")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98421
Signed-off-by: Vinson Lee 
---
 scons/gallium.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index 9f7555cf8bce..8cf6cc732cdc 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -651,7 +651,7 @@ def generate(env):
 env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes', 'glproto 
>= 1.4.13'])
 env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1', 'xcb-dri2 >= 
1.8'])
 env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
-env.PkgCheckModules('DRM', ['libdrm >= 2.4.38'])
+env.PkgCheckModules('DRM', ['libdrm >= 2.4.65'])
 
 if env['x11']:
 env.Append(CPPPATH = env['X11_CPPPATH'])
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] util: Fix Clang trivial destructor check.

2016-11-13 Thread Vinson Lee
Check for Clang before GCC.

Clang defines __GNUC__ == 4 and __GNUC_MINOR__ == 2 and matches the GCC
check but not the GCC version for trivial destructor.

Fixes: 98ab905af0e0 ("mesa: Define introspection macro to determine
whether a type is trivially destructible.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98526
Signed-off-by: Vinson Lee 
---
 src/util/macros.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/util/macros.h b/src/util/macros.h
index 0563fa59b595..733bf42c 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -167,12 +167,12 @@ do {   \
  * performs no action and all member variables and base classes are
  * trivially destructible themselves.
  */
-#   if defined(__GNUC__)
-#  if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
+#   if (defined(__clang__) && defined(__has_feature))
+#  if __has_feature(has_trivial_destructor)
 # define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
 #  endif
-#   elif (defined(__clang__) && defined(__has_feature))
-#  if __has_feature(has_trivial_destructor)
+#   elif defined(__GNUC__)
+#  if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
 # define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
 #  endif
 #   elif defined(_MSC_VER) && !defined(__INTEL_COMPILER)
-- 
2.10.2

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


Re: [Mesa-dev] [PATCH v2] clover: restore support for LLVM <= 3.9

2016-11-16 Thread Vinson Lee
On Wed, Nov 16, 2016 at 10:10 AM, Jan Vesely  wrote:
> On Wed, 2016-11-16 at 12:29 +0100, Vedran Miletić wrote:
>> The commit 8e430ff8b060b4e8e922bae24b3c57837da6ea77 support for LLVM
>> 3.9 and older versionsin  Clover. This patch restores it and refactors
>> the support using Clover compatibility layer for LLVM.
>>
>> Signed-off-by: Vedran Miletić 
>
> LGTM.
> Reviewed-by: Jan Vesely 
>
> Jan
>

With this patch, I get this build error with llvm-3.8.

In file included from llvm/codegen/bitcode.cpp:35:
./llvm/compat.hpp:42:10: fatal error: 'llvm/Support/Error.h' file not found
#include 
 ^


>> ---
>>  .../state_trackers/clover/llvm/codegen/bitcode.cpp |  9 ++-
>>  src/gallium/state_trackers/clover/llvm/compat.hpp  | 28 
>> ++
>>  2 files changed, 30 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp 
>> b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
>> index 5dcc4f8..4b4ae41 100644
>> --- a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
>> +++ b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
>> @@ -32,6 +32,7 @@
>>  ///
>>
>>  #include "llvm/codegen.hpp"
>> +#include "llvm/compat.hpp"
>>  #include "llvm/metadata.hpp"
>>  #include "core/error.hpp"
>>  #include "util/algorithm.hpp"
>> @@ -99,13 +100,7 @@ clover::llvm::parse_module_library(const module &m, 
>> ::llvm::LLVMContext &ctx,
>> auto mod = ::llvm::parseBitcodeFile(::llvm::MemoryBufferRef(
>>  as_string(m.secs[0].data), " "), 
>> ctx);
>>
>> -   if (::llvm::Error err = mod.takeError()) {
>> -  std::string msg;
>> -  ::llvm::handleAllErrors(std::move(err), [&](::llvm::ErrorInfoBase 
>> &EIB) {
>> - msg = EIB.message();
>> - fail(r_log, error(CL_INVALID_PROGRAM), msg.c_str());
>> -  });
>> -   }
>> +   compat::handle_module_error(mod, r_log);
>>
>> return std::unique_ptr<::llvm::Module>(std::move(*mod));
>>  }
>> diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp 
>> b/src/gallium/state_trackers/clover/llvm/compat.hpp
>> index a963cff..987d074 100644
>> --- a/src/gallium/state_trackers/clover/llvm/compat.hpp
>> +++ b/src/gallium/state_trackers/clover/llvm/compat.hpp
>> @@ -39,6 +39,10 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>> +#if HAVE_LLVM < 0x0400
>> +#include 
>> +#endif
>>
>>  #if HAVE_LLVM >= 0x0307
>>  #include 
>> @@ -53,6 +57,12 @@
>>  #include 
>>  #include 
>>
>> +#include 
>> +
>> +namespace llvm {
>> +   class Module;
>> +}
>> +
>>  namespace clover {
>> namespace llvm {
>>namespace compat {
>> @@ -158,6 +168,24 @@ namespace clover {
>>  #else
>>   const auto default_reloc_model = ::llvm::Reloc::Default;
>>  #endif
>> +
>> + inline void
>> +#if HAVE_LLVM >= 0x0400
>> + 
>> handle_module_error(::llvm::Expected> &mod,
>> + std::string &r_log) {
>> +if (::llvm::Error err = mod.takeError()) {
>> +   ::llvm::handleAllErrors(std::move(err), 
>> [&](::llvm::ErrorInfoBase &EIB) {
>> +  fail(r_log, error(CL_INVALID_PROGRAM), 
>> EIB.message().c_str());
>> +   });
>> +}
>> + }
>> +#else
>> + 
>> handle_module_error(::llvm::ErrorOr> &mod,
>> + std::string &r_log) {
>> +if (!mod)
>> +   fail(r_log, error(CL_INVALID_PROGRAM), 
>> mod.getError().message());
>> + }
>> +#endif
>>}
>> }
>>  }
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v4] clover: restore support for LLVM <= 3.9

2016-11-18 Thread Vinson Lee
On Fri, Nov 18, 2016 at 10:57 AM, Vedran Miletić  wrote:
> The commit 8e430ff8b060b4e8e922bae24b3c57837da6ea77 support for LLVM
> 3.9 and older versionsin  Clover. This patch restores it and refactors
> the support using Clover compatibility layer for LLVM.
>
> Signed-off-by: Vedran Miletić 
> ---
>  .../state_trackers/clover/llvm/codegen/bitcode.cpp |  9 ++
>  src/gallium/state_trackers/clover/llvm/compat.hpp  | 35 
> ++
>  2 files changed, 37 insertions(+), 7 deletions(-)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp 
> b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> index 5dcc4f8..4b4ae41 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> @@ -32,6 +32,7 @@
>  ///
>
>  #include "llvm/codegen.hpp"
> +#include "llvm/compat.hpp"
>  #include "llvm/metadata.hpp"
>  #include "core/error.hpp"
>  #include "util/algorithm.hpp"
> @@ -99,13 +100,7 @@ clover::llvm::parse_module_library(const module &m, 
> ::llvm::LLVMContext &ctx,
> auto mod = ::llvm::parseBitcodeFile(::llvm::MemoryBufferRef(
>  as_string(m.secs[0].data), " "), 
> ctx);
>
> -   if (::llvm::Error err = mod.takeError()) {
> -  std::string msg;
> -  ::llvm::handleAllErrors(std::move(err), [&](::llvm::ErrorInfoBase 
> &EIB) {
> - msg = EIB.message();
> - fail(r_log, error(CL_INVALID_PROGRAM), msg.c_str());
> -  });
> -   }
> +   compat::handle_module_error(mod, r_log);
>
> return std::unique_ptr<::llvm::Module>(std::move(*mod));
>  }
> diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp 
> b/src/gallium/state_trackers/clover/llvm/compat.hpp
> index a963cff..b29100f 100644
> --- a/src/gallium/state_trackers/clover/llvm/compat.hpp
> +++ b/src/gallium/state_trackers/clover/llvm/compat.hpp
> @@ -39,6 +39,11 @@
>  #include 
>  #include 
>  #include 
> +#if HAVE_LLVM >= 0x0400
> +#include 
> +#else
> +#include 
> +#endif
>
>  #if HAVE_LLVM >= 0x0307
>  #include 
> @@ -53,6 +58,14 @@
>  #include 
>  #include 
>
> +#if HAVE_LLVM >= 0x0307
> +#include 
> +#endif
> +
> +namespace llvm {
> +   class Module;
> +}
> +
>  namespace clover {
> namespace llvm {
>namespace compat {
> @@ -158,6 +171,28 @@ namespace clover {
>  #else
>   const auto default_reloc_model = ::llvm::Reloc::Default;
>  #endif
> +
> +#if HAVE_LLVM >= 0x0400
> + typedef ::llvm::Expected> 
> bitcode_module;
> +#elif HAVE_LLVM >= 0x0307
> + typedef ::llvm::ErrorOr> 
> bitcode_module;
> +#else
> + typedef ::llvm::ErrorOr<::llvm::Module *> bitcode_module;
> +#endif
> +
> + inline void
> + handle_module_error(bitcode_module &mod, std::string &r_log) {
> +#if HAVE_LLVM >= 0x0400
> +if (::llvm::Error err = mod.takeError()) {
> +   ::llvm::handleAllErrors(std::move(err), 
> [&](::llvm::ErrorInfoBase &EIB) {
> +  fail(r_log, error(CL_INVALID_PROGRAM), 
> EIB.message().c_str());
> +   });
> +}
> +#else
> +if (!mod)
> +   fail(r_log, error(CL_INVALID_PROGRAM), 
> mod.getError().message());
> +#endif
> + }
>}
> }
>  }
> --
> 2.7.4
>

This patch fixes builds with llvm-3.8.

Tested-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/6] mesa: remove trailing whitespace in errors.c

2016-11-19 Thread Vinson Lee
On Sat, Nov 19, 2016 at 6:26 PM, Brian Paul  wrote:
> ---
>  src/mesa/main/errors.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
> index 9932b4a..654343d 100644
> --- a/src/mesa/main/errors.c
> +++ b/src/mesa/main/errors.c
> @@ -122,7 +122,7 @@ flush_delayed_errors( struct gl_context *ctx )
> char s[MAX_DEBUG_MESSAGE_LENGTH];
>
> if (ctx->ErrorDebugCount) {
> -  _mesa_snprintf(s, MAX_DEBUG_MESSAGE_LENGTH, "%d similar %s errors",
> +  _mesa_snprintf(s, MAX_DEBUG_MESSAGE_LENGTH, "%d similar %s errors",
>   ctx->ErrorDebugCount,
>   _mesa_enum_to_string(ctx->ErrorValue));
>
> @@ -145,10 +145,10 @@ _mesa_warning( struct gl_context *ctx, const char 
> *fmtString, ... )
>  {
> char str[MAX_DEBUG_MESSAGE_LENGTH];
> va_list args;
> -   va_start( args, fmtString );
> +   va_start( args, fmtString );
> (void) _mesa_vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args );
> va_end( args );
> -
> +
> if (ctx)
>flush_delayed_errors( ctx );
>
> @@ -175,7 +175,7 @@ _mesa_problem( const struct gl_context *ctx, const char 
> *fmtString, ... )
> if (numCalls < 50) {
>numCalls++;
>
> -  va_start( args, fmtString );
> +  va_start( args, fmtString );
>_mesa_vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args );
>va_end( args );
>fprintf(stderr, "Mesa %s implementation error: %s\n",
> @@ -264,7 +264,7 @@ _mesa_gl_debug(struct gl_context *ctx,
>   * If debugging is enabled (either at compile-time via the DEBUG macro, or
>   * run-time via the MESA_DEBUG environment variable), report the error with
>   * _mesa_debug().
> - *
> + *
>   * \param ctx the GL context.
>   * \param error the error value.
>   * \param fmtString printf() style format string, followed by optional args
> @@ -346,7 +346,7 @@ _mesa_error_no_memory(const char *caller)
>  /**
>   * Report debug information.  Print error message to stderr via fprintf().
>   * No-op if DEBUG mode not enabled.
> - *
> + *
>   * \param ctx GL context.
>   * \param fmtString printf()-style format string, followed by optional args.
>   */
> --
> 1.9.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/6] mesa: remove unneeded #includes in errors.c

2016-11-19 Thread Vinson Lee
On Sat, Nov 19, 2016 at 6:26 PM, Brian Paul  wrote:
> ---
>  src/mesa/main/errors.c | 6 --
>  1 file changed, 6 deletions(-)
>
> diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
> index 654343d..3a40c74 100644
> --- a/src/mesa/main/errors.c
> +++ b/src/mesa/main/errors.c
> @@ -35,12 +35,6 @@
>  #include "imports.h"
>  #include "context.h"
>  #include "debug_output.h"
> -#include "dispatch.h"
> -#include "hash.h"
> -#include "mtypes.h"
> -#include "version.h"
> -#include "util/hash_table.h"
> -#include "util/simple_list.h"
>
>
>  static FILE *LogFile = NULL;
> --
> 1.9.1
>
> _______
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/6] i915: remove unneeded #include "util/simple_list.h"

2016-11-19 Thread Vinson Lee
On Sat, Nov 19, 2016 at 6:26 PM, Brian Paul  wrote:
> Compile tested only.
> ---
>  src/mesa/drivers/dri/i915/i830_texblend.c | 1 -
>  src/mesa/drivers/dri/i915/intel_syncobj.c | 1 -
>  2 files changed, 2 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i915/i830_texblend.c 
> b/src/mesa/drivers/dri/i915/i830_texblend.c
> index 661e424..c29b572 100644
> --- a/src/mesa/drivers/dri/i915/i830_texblend.c
> +++ b/src/mesa/drivers/dri/i915/i830_texblend.c
> @@ -28,7 +28,6 @@
>  #include "main/glheader.h"
>  #include "main/macros.h"
>  #include "main/mtypes.h"
> -#include "util/simple_list.h"
>  #include "main/enums.h"
>  #include "main/mm.h"
>
> diff --git a/src/mesa/drivers/dri/i915/intel_syncobj.c 
> b/src/mesa/drivers/dri/i915/intel_syncobj.c
> index d0a99aa..0766a16 100644
> --- a/src/mesa/drivers/dri/i915/intel_syncobj.c
> +++ b/src/mesa/drivers/dri/i915/intel_syncobj.c
> @@ -38,7 +38,6 @@
>   * performance bottleneck, though.
>   */
>
> -#include "util/simple_list.h"
>  #include "main/imports.h"
>
>  #include "intel_context.h"
> --
> 1.9.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 4/6] r200: remove unneeded #include "util/simple_list.h"

2016-11-19 Thread Vinson Lee
On Sat, Nov 19, 2016 at 6:26 PM, Brian Paul  wrote:
> And include "util/simple_list.h" where it is needed in r200_state.c
> Compile tested only.
> ---
>  src/mesa/drivers/dri/r200/r200_context.c | 1 -
>  src/mesa/drivers/dri/r200/r200_ioctl.h   | 2 --
>  src/mesa/drivers/dri/r200/r200_state.c   | 1 +
>  src/mesa/drivers/dri/r200/r200_swtcl.c   | 1 -
>  src/mesa/drivers/dri/r200/r200_tex.c | 1 -
>  5 files changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/r200/r200_context.c 
> b/src/mesa/drivers/dri/r200/r200_context.c
> index 2a42ab3..8f354c1 100644
> --- a/src/mesa/drivers/dri/r200/r200_context.c
> +++ b/src/mesa/drivers/dri/r200/r200_context.c
> @@ -37,7 +37,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
> SOFTWARE.
>  #include "main/api_arrayelt.h"
>  #include "main/api_exec.h"
>  #include "main/context.h"
> -#include "util/simple_list.h"
>  #include "main/imports.h"
>  #include "main/extensions.h"
>  #include "main/version.h"
> diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.h 
> b/src/mesa/drivers/dri/r200/r200_ioctl.h
> index 25a9dd3..42feec7 100644
> --- a/src/mesa/drivers/dri/r200/r200_ioctl.h
> +++ b/src/mesa/drivers/dri/r200/r200_ioctl.h
> @@ -35,8 +35,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
> SOFTWARE.
>  #ifndef __R200_IOCTL_H__
>  #define __R200_IOCTL_H__
>
> -#include "util/simple_list.h"
> -
>  #include "radeon_bo_gem.h"
>  #include "radeon_cs_gem.h"
>
> diff --git a/src/mesa/drivers/dri/r200/r200_state.c 
> b/src/mesa/drivers/dri/r200/r200_state.c
> index 3671231..4a248d2 100644
> --- a/src/mesa/drivers/dri/r200/r200_state.c
> +++ b/src/mesa/drivers/dri/r200/r200_state.c
> @@ -61,6 +61,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
> SOFTWARE.
>  #include "r200_swtcl.h"
>  #include "r200_vertprog.h"
>
> +#include "util/simple_list.h"
>
>  /* =
>   * Alpha blending
> diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c 
> b/src/mesa/drivers/dri/r200/r200_swtcl.c
> index 72f09ae..6ca85f5 100644
> --- a/src/mesa/drivers/dri/r200/r200_swtcl.c
> +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c
> @@ -38,7 +38,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
> SOFTWARE.
>  #include "main/image.h"
>  #include "main/imports.h"
>  #include "main/macros.h"
> -#include "util/simple_list.h"
>
>  #include "swrast/s_context.h"
>  #include "swrast/s_fog.h"
> diff --git a/src/mesa/drivers/dri/r200/r200_tex.c 
> b/src/mesa/drivers/dri/r200/r200_tex.c
> index 2a95f2d..0ddb686 100644
> --- a/src/mesa/drivers/dri/r200/r200_tex.c
> +++ b/src/mesa/drivers/dri/r200/r200_tex.c
> @@ -36,7 +36,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
> SOFTWARE.
>  #include "main/context.h"
>  #include "main/enums.h"
>  #include "main/image.h"
> -#include "util/simple_list.h"
>  #include "main/teximage.h"
>  #include "main/texobj.h"
>  #include "main/samplerobj.h"
> --
> 1.9.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 5/6] radeon: remove unneeded #include "util/simple_list.h"

2016-11-19 Thread Vinson Lee
On Sat, Nov 19, 2016 at 6:26 PM, Brian Paul  wrote:
> Compile tested only.
> ---
>  src/mesa/drivers/dri/radeon/radeon_ioctl.h   | 1 -
>  src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 1 -
>  src/mesa/drivers/dri/radeon/radeon_queryobj.c| 1 -
>  src/mesa/drivers/dri/radeon/radeon_swtcl.c   | 1 -
>  src/mesa/drivers/dri/radeon/radeon_tex.c | 1 -
>  5 files changed, 5 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.h 
> b/src/mesa/drivers/dri/radeon/radeon_ioctl.h
> index 2fe0e57..701dcdd 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.h
> +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.h
> @@ -36,7 +36,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
> SOFTWARE.
>  #ifndef __RADEON_IOCTL_H__
>  #define __RADEON_IOCTL_H__
>
> -#include "util/simple_list.h"
>  #include "radeon_bo_gem.h"
>  #include "radeon_cs_gem.h"
>
> diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c 
> b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
> index c71766d..19e6296 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
> @@ -31,7 +31,6 @@
>  #include 
>  #include 
>
> -#include "util/simple_list.h"
>  #include "main/teximage.h"
>  #include "main/texobj.h"
>  #include "main/enums.h"
> diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c 
> b/src/mesa/drivers/dri/radeon/radeon_queryobj.c
> index c5fbc60..cd0075a 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c
> @@ -29,7 +29,6 @@
>  #include "radeon_debug.h"
>
>  #include "main/imports.h"
> -#include "util/simple_list.h"
>
>  #include 
>
> diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c 
> b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
> index adc1468..f2bc462 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
> @@ -37,7 +37,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
> SOFTWARE.
>  #include "main/enums.h"
>  #include "main/imports.h"
>  #include "main/macros.h"
> -#include "util/simple_list.h"
>
>  #include "math/m_xform.h"
>
> diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c 
> b/src/mesa/drivers/dri/radeon/radeon_tex.c
> index 083a5e1..c3b83fa 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_tex.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c
> @@ -36,7 +36,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
> SOFTWARE.
>  #include "main/context.h"
>  #include "main/enums.h"
>  #include "main/image.h"
> -#include "util/simple_list.h"
>  #include "main/teximage.h"
>  #include "main/texobj.h"
>
> --
> 1.9.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 6/6] tnl: remove unneeded #include "util/simple_list.h"

2016-11-19 Thread Vinson Lee
On Sat, Nov 19, 2016 at 6:26 PM, Brian Paul  wrote:
> ---
>  src/mesa/tnl/t_vertex_generic.c | 1 -
>  src/mesa/tnl/t_vertex_sse.c | 1 -
>  2 files changed, 2 deletions(-)
>
> diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c
> index 6c40c86..7f871a4 100644
> --- a/src/mesa/tnl/t_vertex_generic.c
> +++ b/src/mesa/tnl/t_vertex_generic.c
> @@ -29,7 +29,6 @@
>  #include "main/glheader.h"
>  #include "main/context.h"
>  #include "main/macros.h"
> -#include "util/simple_list.h"
>  #include "swrast/s_chan.h"
>  #include "t_context.h"
>  #include "t_vertex.h"
> diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c
> index 14e7812..191a68d 100644
> --- a/src/mesa/tnl/t_vertex_sse.c
> +++ b/src/mesa/tnl/t_vertex_sse.c
> @@ -29,7 +29,6 @@
>
>  #include "main/glheader.h"
>  #include "main/context.h"
> -#include "util/simple_list.h"
>  #include "main/enums.h"
>  #include "swrast/s_chan.h"
>  #include "t_context.h"
> --
> 1.9.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v5] clover: restore support for LLVM <= 3.9

2016-11-22 Thread Vinson Lee
On Tue, Nov 22, 2016 at 11:25 AM, Vedran Miletić  wrote:
> The commit 8e430ff8b060b4e8e922bae24b3c57837da6ea77 support for LLVM
> 3.9 and older versionsin  Clover. This patch restores it and refactors
> the support using Clover compatibility layer for LLVM.
>
> v2: merged #ifdef blocks
> v3: added support for LLVM 3.6-3.8
> v4: add missing #ifdef around 
> v5: simplify using templates and lambda
>
> Signed-off-by: Vedran Miletić 
> Reviewed-by[v2]: Jan Vesely 
> Tested-by[v4]: Vinson Lee 
> Tested-by[v4]: Pierre Moreau 
> Reviewed-by: Francisco Jerez 
> ---
>  .../state_trackers/clover/llvm/codegen/bitcode.cpp |  9 +++--
>  src/gallium/state_trackers/clover/llvm/compat.hpp  | 18 
> ++
>  2 files changed, 21 insertions(+), 6 deletions(-)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp 
> b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> index 5dcc4f8..d09207b 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
> @@ -32,6 +32,7 @@
>  ///
>
>  #include "llvm/codegen.hpp"
> +#include "llvm/compat.hpp"
>  #include "llvm/metadata.hpp"
>  #include "core/error.hpp"
>  #include "util/algorithm.hpp"
> @@ -99,13 +100,9 @@ clover::llvm::parse_module_library(const module &m, 
> ::llvm::LLVMContext &ctx,
> auto mod = ::llvm::parseBitcodeFile(::llvm::MemoryBufferRef(
>  as_string(m.secs[0].data), " "), 
> ctx);
>
> -   if (::llvm::Error err = mod.takeError()) {
> -  std::string msg;
> -  ::llvm::handleAllErrors(std::move(err), [&](::llvm::ErrorInfoBase 
> &EIB) {
> - msg = EIB.message();
> - fail(r_log, error(CL_INVALID_PROGRAM), msg.c_str());
> +   compat::handle_module_error(mod, [&](const std::string &s) {
> + fail(r_log, error(CL_INVALID_PROGRAM), s);
>});
> -   }
>
> return std::unique_ptr<::llvm::Module>(std::move(*mod));
>  }
> diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp 
> b/src/gallium/state_trackers/clover/llvm/compat.hpp
> index a963cff..fc257ec 100644
> --- a/src/gallium/state_trackers/clover/llvm/compat.hpp
> +++ b/src/gallium/state_trackers/clover/llvm/compat.hpp
> @@ -39,6 +39,11 @@
>  #include 
>  #include 
>  #include 
> +#if HAVE_LLVM >= 0x0400
> +#include 
> +#else
> +#include 
> +#endif
>
>  #if HAVE_LLVM >= 0x0307
>  #include 
> @@ -158,6 +163,19 @@ namespace clover {
>  #else
>   const auto default_reloc_model = ::llvm::Reloc::Default;
>  #endif
> +
> + template inline void
> + handle_module_error(M &mod, const F &f) {
> +#if HAVE_LLVM >= 0x0400
> +if (::llvm::Error err = mod.takeError())
> +   ::llvm::handleAllErrors(std::move(err), 
> [&](::llvm::ErrorInfoBase &eib) {
> + f(eib.message());
> +  });
> +#else
> +if (!mod)
> +   f(mod.getError().message());
> +#endif
> + }
>}
> }
>  }
> --
> 2.7.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Tested that this patch fixes build with llvm-3.8.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98740
Tested-by: Vinson Lee 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] scons: Recognize LLVM_CONFIG environment variable.

2016-11-22 Thread Vinson Lee
Signed-off-by: Vinson Lee 
---
 scons/llvm.py | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/scons/llvm.py b/scons/llvm.py
index 977e47a..a27bf00 100644
--- a/scons/llvm.py
+++ b/scons/llvm.py
@@ -194,11 +194,16 @@ def generate(env):
 # that.
 env.Append(LINKFLAGS = ['/nodefaultlib:LIBCMT'])
 else:
-if not env.Detect('llvm-config'):
+if os.environ.has_key('LLVM_CONFIG'):
+env['LLVM_CONFIG'] = os.environ['LLVM_CONFIG']
+else:
+env['LLVM_CONFIG'] = 'llvm-config'
+
+if not env.Detect(env['LLVM_CONFIG']):
 print 'scons: llvm-config script not found'
 return
 
-llvm_version = env.backtick('llvm-config --version').rstrip()
+llvm_version = env.backtick('%s --version' % 
env['LLVM_CONFIG']).rstrip()
 llvm_version = distutils.version.LooseVersion(llvm_version)
 
 if llvm_version < 
distutils.version.LooseVersion(required_llvm_version):
@@ -208,7 +213,7 @@ def generate(env):
 try:
 # Treat --cppflags specially to prevent NDEBUG from disabling
 # assertion failures in debug builds.
-cppflags = env.ParseFlags('!llvm-config --cppflags')
+cppflags = env.ParseFlags('!%s --cppflags' % env['LLVM_CONFIG'])
 try:
 cppflags['CPPDEFINES'].remove('NDEBUG')
 except ValueError:
@@ -216,16 +221,16 @@ def generate(env):
 env.MergeFlags(cppflags)
 
 # Match llvm --fno-rtti flag
-cxxflags = env.backtick('llvm-config --cxxflags').split()
+cxxflags = env.backtick('%s --cxxflags' % 
env['LLVM_CONFIG']).split()
 if '-fno-rtti' in cxxflags:
 env.Append(CXXFLAGS = ['-fno-rtti'])
 
 components = ['engine', 'mcjit', 'bitwriter', 'x86asmprinter', 
'mcdisassembler', 'irreader']
 
-env.ParseConfig('llvm-config --libs ' + ' '.join(components))
-env.ParseConfig('llvm-config --ldflags')
+env.ParseConfig('%s --libs ' % env['LLVM_CONFIG'] + ' 
'.join(components))
+env.ParseConfig('%s --ldflags' % env['LLVM_CONFIG'])
 if llvm_version >= distutils.version.LooseVersion('3.5'):
-env.ParseConfig('llvm-config --system-libs')
+env.ParseConfig('%s --system-libs' % env['LLVM_CONFIG'])
 env.Append(CXXFLAGS = ['-std=c++11'])
 except OSError:
 print 'scons: llvm-config version %s failed' % llvm_version
-- 
2.10.2

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


[Mesa-dev] [PATCH v2] scons: Recognize LLVM_CONFIG environment variable.

2016-11-23 Thread Vinson Lee
Signed-off-by: Vinson Lee 
Reviewed-by: Emil Velikov 
---
v2
Use LLVM_CONFIG for swr too.
Update common.py.
Use local variable llvm_config instead of env['LLVM_CONFIG'].

 common.py  |  2 +-
 scons/llvm.py  | 17 +
 src/gallium/drivers/swr/SConscript |  3 ++-
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/common.py b/common.py
index 704ad2e..24a7e8a 100644
--- a/common.py
+++ b/common.py
@@ -59,7 +59,7 @@ if target_platform == 'windows' and host_platform != 
'windows':
 
 
 # find default_llvm value
-if 'LLVM' in os.environ:
+if 'LLVM' in os.environ or 'LLVM_CONFIG' in os.environ:
 default_llvm = 'yes'
 else:
 default_llvm = 'no'
diff --git a/scons/llvm.py b/scons/llvm.py
index 977e47a..2d0f05b 100644
--- a/scons/llvm.py
+++ b/scons/llvm.py
@@ -194,11 +194,12 @@ def generate(env):
 # that.
 env.Append(LINKFLAGS = ['/nodefaultlib:LIBCMT'])
 else:
-if not env.Detect('llvm-config'):
-print 'scons: llvm-config script not found'
+llvm_config = os.environ.get('LLVM_CONFIG', 'llvm-config')
+if not env.Detect(llvm_config):
+print 'scons: %s script not found' % llvm_config
 return
 
-llvm_version = env.backtick('llvm-config --version').rstrip()
+llvm_version = env.backtick('%s --version' % llvm_config).rstrip()
 llvm_version = distutils.version.LooseVersion(llvm_version)
 
 if llvm_version < 
distutils.version.LooseVersion(required_llvm_version):
@@ -208,7 +209,7 @@ def generate(env):
 try:
 # Treat --cppflags specially to prevent NDEBUG from disabling
 # assertion failures in debug builds.
-cppflags = env.ParseFlags('!llvm-config --cppflags')
+cppflags = env.ParseFlags('!%s --cppflags' % llvm_config)
 try:
 cppflags['CPPDEFINES'].remove('NDEBUG')
 except ValueError:
@@ -216,16 +217,16 @@ def generate(env):
 env.MergeFlags(cppflags)
 
 # Match llvm --fno-rtti flag
-cxxflags = env.backtick('llvm-config --cxxflags').split()
+cxxflags = env.backtick('%s --cxxflags' % llvm_config).split()
 if '-fno-rtti' in cxxflags:
 env.Append(CXXFLAGS = ['-fno-rtti'])
 
 components = ['engine', 'mcjit', 'bitwriter', 'x86asmprinter', 
'mcdisassembler', 'irreader']
 
-env.ParseConfig('llvm-config --libs ' + ' '.join(components))
-env.ParseConfig('llvm-config --ldflags')
+env.ParseConfig('%s --libs ' % llvm_config + ' '.join(components))
+env.ParseConfig('%s --ldflags' % llvm_config)
 if llvm_version >= distutils.version.LooseVersion('3.5'):
-env.ParseConfig('llvm-config --system-libs')
+env.ParseConfig('%s --system-libs' % llvm_config)
 env.Append(CXXFLAGS = ['-std=c++11'])
 except OSError:
 print 'scons: llvm-config version %s failed' % llvm_version
diff --git a/src/gallium/drivers/swr/SConscript 
b/src/gallium/drivers/swr/SConscript
index 0de51a7..3f0517b 100644
--- a/src/gallium/drivers/swr/SConscript
+++ b/src/gallium/drivers/swr/SConscript
@@ -31,7 +31,8 @@ if env['platform'] == 'windows':
 # on windows there is no llvm-config, so LLVM is defined
 llvm_includedir = os.path.join(os.environ['LLVM'], 'include')
 else:
-llvm_includedir = env.backtick('llvm-config --includedir').rstrip()
+llvm_config = os.environ.get('LLVM_CONFIG', 'llvm-config')
+llvm_includedir = env.backtick('%s --includedir' % llvm_config).rstrip()
 print "llvm include dir %s" % llvm_includedir
 
 # the loader is included in the mesa lib itself
-- 
2.10.2

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


[Mesa-dev] [PATCH] configure.ac: Strip patch version from LLVM version.

2016-12-02 Thread Vinson Lee
HAVE_LLVM variable included the patch version if the LLVM version had a
patch version.

For LLVM version '4.0.0', HAVE_LLVM would be '0x0400.0'.

Fixes: 45574ab2e92f ("configure.ac: better detection of LLVM version")
Signed-off-by: Vinson Lee 
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index f62bc61e5025..3b8b32485ae1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2195,7 +2195,7 @@ if test "x$enable_gallium_llvm" = xyes || test 
"x$HAVE_RADEON_VULKAN" = xyes; th
 if test -n "${LLVM_VERSION_MAJOR}"; then
 LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
 else
-LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 
's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
+LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 
's/\([[0-9]]\)\.\([[0-9]]\).*/\10\2/g'`
 fi
 
 LLVM_REQUIRED_VERSION_MAJOR="3"
-- 
2.7.4

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


[Mesa-dev] [PATCH] llvmpipe: Link tests with CLOCK_LIB.

2016-12-02 Thread Vinson Lee
Fix linking error with 'make check'.

  CXXLD  lp_test_format
../../../../src/gallium/auxiliary/.libs/libgallium.a(os_time.o): In function 
`os_time_get_nano':
/home/jenkins/workspace/mesa/src/gallium/auxiliary/os/os_time.c:59: undefined 
reference to `clock_gettime'

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/llvmpipe/Makefile.am |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/llvmpipe/Makefile.am 
b/src/gallium/drivers/llvmpipe/Makefile.am
index 85ae0ae13d89..562c2d6321c5 100644
--- a/src/gallium/drivers/llvmpipe/Makefile.am
+++ b/src/gallium/drivers/llvmpipe/Makefile.am
@@ -54,7 +54,8 @@ TEST_LIBS = \
$(top_builddir)/src/util/libmesautil.la \
$(LLVM_LIBS) \
$(DLOPEN_LIBS) \
-   $(PTHREAD_LIBS)
+   $(PTHREAD_LIBS) \
+   $(CLOCK_LIB)
 
 lp_test_format_SOURCES = lp_test_format.c lp_test_main.c
 lp_test_format_LDADD = $(TEST_LIBS)
-- 
1.7.9.5

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


Re: [Mesa-dev] [PATCH] configure.ac: Strip patch version from LLVM version.

2016-12-03 Thread Vinson Lee
Hi, Tobias.

I actually need this when using LLVM from a build tree and the header
files are not found. LLVM_INCLUDEDIR is /include and the
header files are in /include.

Cheers,
Vinson

On Sat, Dec 3, 2016 at 4:55 AM, Tobias Droste  wrote:
> Hi Vinson,
>
> this should not be needed and is obsolete as soon as this gets merged (Emil?):
> https://lists.freedesktop.org/archives/mesa-dev/2016-November/135840.html
>
> Did you actually need this or were you just seeing that the code is wrong?
> Because LLVM >=3.1 has the header files and this code should never execute!
>
> Tobias
>
> Am Samstag, 3. Dezember 2016, 01:20:42 CET schrieb Vinson Lee:
>> HAVE_LLVM variable included the patch version if the LLVM version had a
>> patch version.
>>
>> For LLVM version '4.0.0', HAVE_LLVM would be '0x0400.0'.
>>
>> Fixes: 45574ab2e92f ("configure.ac: better detection of LLVM version")
>> Signed-off-by: Vinson Lee 
>> ---
>>  configure.ac | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index f62bc61e5025..3b8b32485ae1 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -2195,7 +2195,7 @@ if test "x$enable_gallium_llvm" = xyes || test
>> "x$HAVE_RADEON_VULKAN" = xyes; th if test -n "${LLVM_VERSION_MAJOR}"; then
>>  LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
>>  else
>> -LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e
>> 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'` +LLVM_VERSION_INT=`echo
>> $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\).*/\10\2/g'` fi
>>
>>  LLVM_REQUIRED_VERSION_MAJOR="3"
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] configure.ac: Strip patch version from LLVM version.

2016-12-03 Thread Vinson Lee
Hi, Tobias.

/bin/llvm-config --includedir returns /include. I am
not setting the "--with-llvm-prefix" configure option.

Cheers,
Vinson


On Sat, Dec 3, 2016 at 1:46 PM, Tobias Droste  wrote:
> Hi Vinson,
>
>
>
> why is LLVM_INCLUDEDIR not /include? How does this happen?
>
> Do you set "--with-llvm-prefix=" when building mesa?
>
>
>
> Tobias
>
>
>
> Am Samstag, 3. Dezember 2016, 11:53:53 CET schrieb Vinson Lee:
>
>> Hi, Tobias.
>
>>
>
>> I actually need this when using LLVM from a build tree and the header
>
>> files are not found. LLVM_INCLUDEDIR is /include and the
>
>> header files are in /include.
>
>>
>
>> Cheers,
>
>> Vinson
>
>>
>
>> On Sat, Dec 3, 2016 at 4:55 AM, Tobias Droste  wrote:
>
>> > Hi Vinson,
>
>> >
>
>> > this should not be needed and is obsolete as soon as this gets merged
>
>> > (Emil?):
>
>> >
>> > https://lists.freedesktop.org/archives/mesa-dev/2016-November/135840.html
>
>> >
>
>> > Did you actually need this or were you just seeing that the code is
>> > wrong?
>
>> > Because LLVM >=3.1 has the header files and this code should never
>
>> > execute!
>
>> >
>
>> > Tobias
>
>> >
>
>> > Am Samstag, 3. Dezember 2016, 01:20:42 CET schrieb Vinson Lee:
>
>> >> HAVE_LLVM variable included the patch version if the LLVM version had a
>
>> >> patch version.
>
>> >>
>
>> >> For LLVM version '4.0.0', HAVE_LLVM would be '0x0400.0'.
>
>> >>
>
>> >> Fixes: 45574ab2e92f ("configure.ac: better detection of LLVM version")
>
>> >> Signed-off-by: Vinson Lee 
>
>> >> ---
>
>> >>
>
>> >> configure.ac | 2 +-
>
>> >> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>> >>
>
>> >> diff --git a/configure.ac b/configure.ac
>
>> >> index f62bc61e5025..3b8b32485ae1 100644
>
>> >> --- a/configure.ac
>
>> >> +++ b/configure.ac
>
>> >> @@ -2195,7 +2195,7 @@ if test "x$enable_gallium_llvm" = xyes || test
>
>> >> "x$HAVE_RADEON_VULKAN" = xyes; th if test -n "${LLVM_VERSION_MAJOR}";
>
>> >> then
>
>> >>
>
>> >> LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR
>
>> >> }"
>
>> >>
>
>> >> else
>
>> >>
>
>> >> - LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e
>
>> >> 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'` + LLVM_VERSION_INT=`echo
>
>> >> $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\).*/\10\2/g'` fi
>
>> >>
>
>> >> LLVM_REQUIRED_VERSION_MAJOR="3"
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa/st: Use 'struct nir_shader' instead of 'nir_shader'.

2016-06-29 Thread Vinson Lee
Fix this build error with GCC 4.4.

  CC state_tracker/st_nir_lower_builtin.lo
In file included from state_tracker/st_nir_lower_builtin.c:61:
state_tracker/st_nir.h:34: error: redefinition of typedef ‘nir_shader’
../../src/compiler/nir/nir.h:1830: note: previous declaration of ‘nir_shader’ 
was here

Suggested-by: Rob Clark 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96235
Signed-off-by: Vinson Lee 
---
 src/mesa/state_tracker/st_nir.h   |   12 ++--
 src/mesa/state_tracker/st_nir_lower_builtin.c |6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mesa/state_tracker/st_nir.h b/src/mesa/state_tracker/st_nir.h
index 49ba573..4f3c606 100644
--- a/src/mesa/state_tracker/st_nir.h
+++ b/src/mesa/state_tracker/st_nir.h
@@ -31,14 +31,14 @@
 extern "C" {
 #endif
 
-typedef struct nir_shader nir_shader;
+struct nir_shader;
 
-void st_nir_lower_builtin(nir_shader *shader);
-nir_shader * st_glsl_to_nir(struct st_context *st, struct gl_program *prog,
-struct gl_shader_program *shader_program,
-gl_shader_stage stage);
+void st_nir_lower_builtin(struct nir_shader *shader);
+struct nir_shader * st_glsl_to_nir(struct st_context *st, struct gl_program 
*prog,
+  struct gl_shader_program *shader_program,
+  gl_shader_stage stage);
 
-void st_finalize_nir(struct st_context *st, struct gl_program *prog, 
nir_shader *nir);
+void st_finalize_nir(struct st_context *st, struct gl_program *prog, struct 
nir_shader *nir);
 
 struct gl_program *
 st_nir_get_mesa_program(struct gl_context *ctx,
diff --git a/src/mesa/state_tracker/st_nir_lower_builtin.c 
b/src/mesa/state_tracker/st_nir_lower_builtin.c
index 20b04d1..e71262a 100644
--- a/src/mesa/state_tracker/st_nir_lower_builtin.c
+++ b/src/mesa/state_tracker/st_nir_lower_builtin.c
@@ -64,7 +64,7 @@
 #include "program/prog_instruction.h"
 
 typedef struct {
-   nir_shader *shader;
+   struct nir_shader *shader;
nir_builder builder;
void *mem_ctx;
 } lower_builtin_state;
@@ -99,7 +99,7 @@ static nir_variable *
 get_variable(lower_builtin_state *state, nir_deref_var *deref,
  const struct gl_builtin_uniform_element *element)
 {
-   nir_shader *shader = state->shader;
+   struct nir_shader *shader = state->shader;
int tokens[STATE_LENGTH];
 
memcpy(tokens, element->tokens, sizeof(tokens));
@@ -237,7 +237,7 @@ lower_builtin_impl(lower_builtin_state *state, 
nir_function_impl *impl)
 }
 
 void
-st_nir_lower_builtin(nir_shader *shader)
+st_nir_lower_builtin(struct nir_shader *shader)
 {
lower_builtin_state state;
state.shader = shader;
-- 
1.7.1

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


[Mesa-dev] [PATCH v3] mesa/st: Use 'struct nir_shader' instead of 'nir_shader'.

2016-06-29 Thread Vinson Lee
Fix this build error with GCC 4.4.

  CC state_tracker/st_nir_lower_builtin.lo
In file included from state_tracker/st_nir_lower_builtin.c:61:
state_tracker/st_nir.h:34: error: redefinition of typedef ‘nir_shader’
../../src/compiler/nir/nir.h:1830: note: previous declaration of ‘nir_shader’ 
was here

Suggested-by: Rob Clark 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96235
Signed-off-by: Vinson Lee 
Reviewed-by: Jason Ekstrand 
---
v3 - Removed st_nir_lower_builtin.c changes.

 src/mesa/state_tracker/st_nir.h |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/state_tracker/st_nir.h b/src/mesa/state_tracker/st_nir.h
index 49ba573..4f3c606 100644
--- a/src/mesa/state_tracker/st_nir.h
+++ b/src/mesa/state_tracker/st_nir.h
@@ -31,14 +31,14 @@
 extern "C" {
 #endif
 
-typedef struct nir_shader nir_shader;
+struct nir_shader;
 
-void st_nir_lower_builtin(nir_shader *shader);
-nir_shader * st_glsl_to_nir(struct st_context *st, struct gl_program *prog,
-struct gl_shader_program *shader_program,
-gl_shader_stage stage);
+void st_nir_lower_builtin(struct nir_shader *shader);
+struct nir_shader * st_glsl_to_nir(struct st_context *st, struct gl_program 
*prog,
+  struct gl_shader_program *shader_program,
+  gl_shader_stage stage);
 
-void st_finalize_nir(struct st_context *st, struct gl_program *prog, 
nir_shader *nir);
+void st_finalize_nir(struct st_context *st, struct gl_program *prog, struct 
nir_shader *nir);
 
 struct gl_program *
 st_nir_get_mesa_program(struct gl_context *ctx,
-- 
1.7.1

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


[Mesa-dev] [PATCH] nouveau/codegen: Initialize dst0 array in Converter::handleInstruction.

2013-09-27 Thread Vinson Lee
dst0 is not initialized if tgsi.dstCount() is false.

Fixes "Uninitialized pointer read" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index 49a45f8..5eb6a7e 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -2091,7 +2091,8 @@ Converter::handleInstruction(const struct 
tgsi_full_instruction *insn)
 {
Instruction *geni;
 
-   Value *dst0[4], *rDst0[4];
+   Value *dst0[4] = { 0 };
+   Value *rDst0[4];
Value *src0, *src1, *src2;
Value *val0, *val1;
int c;
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] nouveau: Explicitly upcast operands so mulitplication is 64-bit.

2013-09-27 Thread Vinson Lee
Fixes "Unintentional integer overflow" defects reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/nouveau_vp3_video.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.h 
b/src/gallium/drivers/nouveau/nouveau_vp3_video.h
index 0193ed0..700d619 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video.h
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.h
@@ -152,9 +152,9 @@ nouveau_vp3_video_addr(struct nouveau_vp3_decoder *dec, 
struct nouveau_vp3_video
 {
uint64_t ret;
if (target)
-  ret = dec->ref_stride * target->valid_ref;
+  ret = (uint64_t)dec->ref_stride * target->valid_ref;
else
-  ret = dec->ref_stride * (dec->base.max_references+1);
+  ret = (uint64_t)dec->ref_stride * (dec->base.max_references+1);
return dec->ref_bo->offset + ret;
 }
 
-- 
1.8.3.1

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


[Mesa-dev] [PATCH v2] nv30: Clear dirty bit for processed samplers.

2013-09-27 Thread Vinson Lee
Otherwise, the while(dirty) loop will never exit.

Fixes "Infinite loop" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/nv30/nv40_verttex.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nv30/nv40_verttex.c 
b/src/gallium/drivers/nouveau/nv30/nv40_verttex.c
index 9a7163c..d244e7f 100644
--- a/src/gallium/drivers/nouveau/nv30/nv40_verttex.c
+++ b/src/gallium/drivers/nouveau/nv30/nv40_verttex.c
@@ -42,6 +42,8 @@ nv40_verttex_validate(struct nv30_context *nv30)
  BEGIN_NV04(push, NV40_3D(VTXTEX_ENABLE(unit)), 1);
  PUSH_DATA (push, 0);
   }
+
+  dirty &= ~(1 << unit);
}
 
nv30->vertprog.dirty_samplers = 0;
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] llvmpipe: Remove unnecessary null check of shader.

2013-09-27 Thread Vinson Lee
shader has already been dereferenced earlier so cannot be null here.

Fixes "Dereference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c 
b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 875a3cf..8223d2a 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -2435,7 +2435,7 @@ generate_variant(struct llvmpipe_context *lp,
  !shader->info.base.uses_kill
   ? TRUE : FALSE;
 
-   if ((!shader || shader->info.base.num_tokens <= 1) &&
+   if ((shader->info.base.num_tokens <= 1) &&
!key->depth.enabled && !key->stencil[0].enabled) {
   variant->ps_inv_multiplier = 0;
} else {
-- 
1.8.3.2

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


[Mesa-dev] [PATCH] nvc0: Remove unused pointer value cfg.

2013-09-27 Thread Vinson Lee
cfg is only used inside for loop so also move declaration there.

Fixes "Unused pointer value" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index 21aa358..4f83f57 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -1155,9 +1155,6 @@ nvc0_mp_pm_query_end(struct nvc0_context *nvc0, struct 
nvc0_query *q)
const uint block[3] = { 32, is_nve4 ? 4 : 1, 1 };
const uint grid[3] = { screen->mp_count, 1, 1 };
unsigned c;
-   const struct nvc0_mp_pm_query_cfg *cfg;
-
-   cfg = nvc0_mp_pm_query_get_cfg(nvc0, q);
 
if (unlikely(!screen->pm.prog)) {
   struct nvc0_program *prog = CALLOC_STRUCT(nvc0_program);
@@ -1212,6 +1209,7 @@ nvc0_mp_pm_query_end(struct nvc0_context *nvc0, struct 
nvc0_query *q)
mask = 0;
for (c = 0; c < 8; ++c) {
   unsigned i;
+  const struct nvc0_mp_pm_query_cfg *cfg;
   q = nvc0_query(screen->pm.mp_counter[c]);
   if (!q)
  continue;
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] draw: Add a null check for draw.

2013-09-27 Thread Vinson Lee
There is an earlier null check for draw so draw could be null here as
well.

Fixes "Dereference after null check" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/draw/draw_pipe_unfilled.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c 
b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
index 7a88ce0..8cba07c 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
@@ -237,7 +237,7 @@ draw_unfilled_prepare_outputs( struct draw_context *draw,
boolean is_unfilled = (rast &&
   (rast->fill_front != PIPE_POLYGON_MODE_FILL ||
rast->fill_back != PIPE_POLYGON_MODE_FILL));
-   const struct draw_fragment_shader *fs = draw->fs.fragment_shader;
+   const struct draw_fragment_shader *fs = draw ? draw->fs.fragment_shader : 0;
 
if (is_unfilled && fs && fs->info.uses_frontface)  {
   unfilled->face_slot = draw_alloc_extra_vertex_attrib(
-- 
1.8.3.2

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


[Mesa-dev] [PATCH] i915: Fix memory leak in do_blit_readpixels.

2013-09-27 Thread Vinson Lee
Fixes "Resource leak" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i915/intel_pixel_read.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i915/intel_pixel_read.c 
b/src/mesa/drivers/dri/i915/intel_pixel_read.c
index 26eb496..8fd1c8d 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel_read.c
@@ -148,6 +148,7 @@ do_blit_readpixels(struct gl_context * ctx,
pbo_mt, 0, 0,
0, 0, dst_flip,
width, height, GL_COPY)) {
+  intel_miptree_release(&pbo_mt);
   return false;
}
 
-- 
1.8.3.1

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


[Mesa-dev] [PATCH v2] i915, i965: Fix memory leak in intel_miptree_create_for_bo.

2013-09-27 Thread Vinson Lee
Fixes "Resource leak" defects reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i915/intel_mipmap_tree.c | 4 +++-
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
index 8432b6d..984eeaa 100644
--- a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
@@ -264,8 +264,10 @@ intel_miptree_create_for_bo(struct intel_context *intel,
 0, 0,
 width, height, 1,
 true);
-   if (!mt)
+   if (!mt) {
+  free(region);
   return mt;
+   }
 
region->cpp = mt->cpp;
region->width = width;
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 36a080f..6cdd6b5 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -626,8 +626,10 @@ intel_miptree_create_for_bo(struct brw_context *brw,
 0, 0,
 width, height, 1,
 true, 0 /* num_samples */);
-   if (!mt)
+   if (!mt) {
+  free(region);
   return mt;
+   }
 
region->cpp = mt->cpp;
region->width = width;
-- 
1.8.3.1

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


[Mesa-dev] [PATCH v2] i965: Initialize brw_blorp_const_color_program::prog_data.

2013-09-27 Thread Vinson Lee
Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp 
b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
index f26f39d..a40b58a 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
@@ -127,6 +127,8 @@ 
brw_blorp_const_color_program::brw_blorp_const_color_program(
  clear_rgba(),
  base_mrf(0)
 {
+   prog_data.first_curbe_grf = 0;
+   prog_data.persample_msaa_dispatch = false;
brw_init_compile(brw, &func, mem_ctx);
 }
 
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] util/u_format: Assert that format block size is at least 1 byte.

2013-09-27 Thread Vinson Lee
The block size for all formats is currently at least 1 byte. Add an
assertion for this.

This should silence several Coverity "Division or modulo by zero"
defects.

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/util/u_format.h | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_format.h 
b/src/gallium/auxiliary/util/u_format.h
index 28527f5..84f16d5 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -716,10 +716,15 @@ static INLINE uint
 util_format_get_blocksize(enum pipe_format format)
 {
uint bits = util_format_get_blocksizebits(format);
+   uint bytes = bits / 8;
 
assert(bits % 8 == 0);
+   assert(bytes > 0);
+   if (bytes == 0) {
+  bytes = 1;
+   }
 
-   return bits / 8;
+   return bytes;
 }
 
 static INLINE uint
-- 
1.8.3.2

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


[Mesa-dev] [PATCH] r600g/sb: Move variable dereference after null check.

2013-09-27 Thread Vinson Lee
Fixes "Deference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/r600/sb/sb_ra_init.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r600/sb/sb_ra_init.cpp 
b/src/gallium/drivers/r600/sb/sb_ra_init.cpp
index 0b332a9..e53aba5 100644
--- a/src/gallium/drivers/r600/sb/sb_ra_init.cpp
+++ b/src/gallium/drivers/r600/sb/sb_ra_init.cpp
@@ -395,11 +395,12 @@ void ra_init::color_bs_constraint(ra_constraint* c) {
 
for (vvec::iterator I = vv.begin(), E = vv.end(); I != E; ++I) {
value *v = *I;
-   sel_chan gpr = v->get_final_gpr();
 
if (!v || v->is_dead())
continue;
 
+   sel_chan gpr = v->get_final_gpr();
+
val_set interf;
 
if (v->chunk)
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] r600g: Prevent by invalid op overflows in release builds.

2013-09-27 Thread Vinson Lee
Fixes "Overflowed return value" defects reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/r600/r600_isa.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/gallium/drivers/r600/r600_isa.h 
b/src/gallium/drivers/r600/r600_isa.h
index c6bb869..5b9c3d0 100644
--- a/src/gallium/drivers/r600/r600_isa.h
+++ b/src/gallium/drivers/r600/r600_isa.h
@@ -1210,6 +1210,9 @@ r600_isa_alu_by_opcode(struct r600_isa* isa, unsigned 
opcode, unsigned is_op3) {
op = isa->alu_op2_map[opcode];
}
assert(op);
+   if (!op) {
+   return 0;
+   }
return op - 1;
 }
 
@@ -1219,6 +1222,9 @@ r600_isa_fetch_by_opcode(struct r600_isa* isa, unsigned 
opcode) {
assert(isa->fetch_map);
op = isa->fetch_map[opcode];
assert(op);
+   if (!op) {
+   return 0;
+   }
return op - 1;
 }
 
@@ -1230,6 +1236,9 @@ r600_isa_cf_by_opcode(struct r600_isa* isa, unsigned 
opcode, unsigned is_alu) {
 * CF opcodes (they use different encoding in hw) */
op = isa->cf_map[is_alu ? opcode + 0x80 : opcode];
assert(op);
+   if (!op) {
+   return 0;
+   }
return op - 1;
 }
 
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] r600g: Add missing break for callstack_push FC_PUSH_WQM case.

2013-09-28 Thread Vinson Lee
Fixes "Missing break in switch" reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/r600/r600_shader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/r600/r600_shader.c 
b/src/gallium/drivers/r600/r600_shader.c
index ce15cd7..d6cbfd7 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -5337,6 +5337,7 @@ static inline void callstack_push(struct r600_shader_ctx 
*ctx, unsigned reason)
break;
case FC_PUSH_WQM:
++ctx->bc->stack.push_wqm;
+   break;
case FC_LOOP:
++ctx->bc->stack.loop;
break;
-- 
1.8.3.2

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


Re: [Mesa-dev] Janitorial work: no more intel_context.[ch]; tidying

2013-10-01 Thread Vinson Lee
On Mon, Sep 30, 2013 at 10:21 PM, Kenneth Graunke  wrote:
> On 09/27/2013 06:24 PM, Emil Velikov wrote:
>> On 28/09/13 00:45, Kenneth Graunke wrote:
>>> This series combines brw_context.[ch] and intel_context.[ch],
>>> and cleans up our context creation code quite a bit.  A bunch of
>>> functionality was awkwardly split between the two sets of files;
>>> now it's all in one place.
>>>
>>> While this series is large, it should be fairly easy reading.
>>> Patch 28 does have one functional change on 32-bit systems - it removes
>>> a handcoded assembly version of memcpy.  This has not been tested.
>>>
>> Hi Kenneth
>>
>> Hope you can bare with me and a couple of silly questions :)
>>
>> * With the recent split of the intel driver codebase, the new i965
>> headers has been getting a bunch of #pragma once over the standard
>> #ifndef _HEADER_H_... Are those intentional ?
>
> Yup, that's intentional.  "#pragma once" doesn't require inventing a
> unique #define name, is less typing, and is faster on some compilers.
>
> I actually forgot that it wasn't standard.  It's supported basically
> everywhere, though, so I'd be really shocked if it caused problems.
>

Oracle Solaris Studio does not support "#pragma once".


>> * In patch 29 the drm* headers are included quoted, over angle brackets.
>> I realise that's a very pedantic point, just curious is it just a
>> copy'n'paste thing or was it planned.
>
> Not intentional - I actually just copied those #include lines from
> intel_context.h, just like they were before.  But you're right, angle
> brackets make a lot more sense.  I've updated the patch to use ,
> , and .  Thanks!
>
>> * The inline function is_power_of_two() in patch 29 is used by both
>> intel drivers. Possibly move it to macros.h ? Gallium has it's
>> equivalent in auxiliary/util/u_math.h - util_is_power_of_two()
>
> That's not a bad idea; it'd at least share it between the classic
> drivers.  It'd be nice to share a couple of these with Gallium, but I
> don't think we use the same includes for whatever reason.
>
>> Thanks
>> Emil
> ___
> 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] [PATCHv2] configure: set HAVE_COMMON_DRI when building only swrast

2013-10-03 Thread Vinson Lee
On Wed, Oct 2, 2013 at 3:45 PM, Emil Velikov  wrote:
> With commit cb1febb07, I have incorrectly removed HAVE_COMMON_DRI
> assuming that swrast does not need to build the translations for
> driconf options, as effectively swrast/drisw does not use them.
>
> With the incoming unification work of dri and drisw, it makes
> sense just to revert the offending hunk.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70057
> Reported-by: Vinson Lee 
> Signed-off-by: Emil Velikov 
> ---
> v2: resolve typos in the commit message. Thanks Ian
>
>  configure.ac | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/configure.ac b/configure.ac
> index e7c8223..9546163 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1823,6 +1823,7 @@ if test "x$with_gallium_drivers" != x; then
>
>  if test "x$enable_dri" = xyes; then
>  GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
> +HAVE_COMMON_DRI=yes
>  fi
>  if test "x$enable_vdpau" = xyes; then
>  GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
> --
> 1.8.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


This patch fixes the build for me.

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


[Mesa-dev] [PATCH] glsl: Link glcpp with math library.

2013-10-09 Thread Vinson Lee
This patch fixes this build error with Oracle Solaris Studio.

libtool: link: /opt/solarisstudio12.3/bin/cc -g -o glcpp/glcpp glcpp.o 
prog_hash_table.o  ./.libs/libglcpp.a
Undefined   first referenced
 symbol in file
sqrtprog_hash_table.o

Signed-off-by: Vinson Lee 
---
 src/glsl/Makefile.am |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index cbf253c..05b6759 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -93,7 +93,9 @@ libglcpp_la_SOURCES = \
 glcpp_glcpp_SOURCES =  \
glcpp/glcpp.c   \
$(top_srcdir)/src/mesa/program/prog_hash_table.c
-glcpp_glcpp_LDADD = libglcpp.la
+glcpp_glcpp_LDADD =\
+   libglcpp.la \
+   -lm
 
 libglsl_la_LIBADD = libglcpp.la
 libglsl_la_SOURCES =   \
-- 
1.7.9.2

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


[Mesa-dev] [PATCH] glapi: Do not include dlfcn.h on Windows.

2013-10-10 Thread Vinson Lee
This patch fixes this MinGW build error.

  CC glapi_gentable.lo
glapi_gentable.c:47:19: fatal error: dlfcn.h: No such file or directory

Signed-off-by: Vinson Lee 
---
 src/mapi/glapi/gen/gl_gentable.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mapi/glapi/gen/gl_gentable.py 
b/src/mapi/glapi/gen/gl_gentable.py
index 5c35271..20bfc34 100644
--- a/src/mapi/glapi/gen/gl_gentable.py
+++ b/src/mapi/glapi/gen/gl_gentable.py
@@ -50,7 +50,9 @@ header = """/* GLXEXT is the define used in the xserver when 
the GLX extension i
 #include 
 #endif
 
+#ifndef _WIN32
 #include 
+#endif
 #include 
 #include 
 
-- 
1.8.1.2

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


[Mesa-dev] [PATCH] glsl: Use more portable bash invocation construct.

2013-10-11 Thread Vinson Lee
Fixes 'make check' on distros where bash is not at /bin/bash.

Signed-off-by: Vinson Lee 
---
 src/glsl/tests/lower_jumps/create_test_cases.py | 2 +-
 src/glsl/tests/lower_jumps/lower_breaks_1.opt_test  | 2 +-
 src/glsl/tests/lower_jumps/lower_breaks_2.opt_test  | 2 +-
 src/glsl/tests/lower_jumps/lower_breaks_3.opt_test  | 2 +-
 src/glsl/tests/lower_jumps/lower_breaks_4.opt_test  | 2 +-
 src/glsl/tests/lower_jumps/lower_breaks_5.opt_test  | 2 +-
 src/glsl/tests/lower_jumps/lower_breaks_6.opt_test  | 2 +-
 src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test | 2 +-
 src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test   | 2 +-
 src/glsl/tests/lower_jumps/lower_returns_1.opt_test | 2 +-
 src/glsl/tests/lower_jumps/lower_returns_2.opt_test | 2 +-
 src/glsl/tests/lower_jumps/lower_returns_3.opt_test | 2 +-
 src/glsl/tests/lower_jumps/lower_returns_4.opt_test | 2 +-
 src/glsl/tests/lower_jumps/lower_returns_main_false.opt_test| 2 +-
 src/glsl/tests/lower_jumps/lower_returns_main_true.opt_test | 2 +-
 src/glsl/tests/lower_jumps/lower_returns_sub_false.opt_test | 2 +-
 src/glsl/tests/lower_jumps/lower_returns_sub_true.opt_test  | 2 +-
 src/glsl/tests/lower_jumps/lower_unified_returns.opt_test   | 2 +-
 src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test  | 2 +-
 .../lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test   | 2 +-
 .../lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test| 2 +-
 .../return_non_void_at_end_of_loop_lower_return_and_break.opt_test  | 2 +-
 .../tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test | 2 +-
 .../tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test  | 2 +-
 .../return_void_at_end_of_loop_lower_return_and_break.opt_test  | 2 +-
 src/glsl/tests/optimization-test| 2 +-
 26 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/src/glsl/tests/lower_jumps/create_test_cases.py 
b/src/glsl/tests/lower_jumps/create_test_cases.py
index fbc6f0a..9974681 100644
--- a/src/glsl/tests/lower_jumps/create_test_cases.py
+++ b/src/glsl/tests/lower_jumps/create_test_cases.py
@@ -291,7 +291,7 @@ def create_test_case(doc_string, input_sexp, expected_sexp, 
test_name,
 args = ['../../glsl_test', 'optpass', '--quiet', '--input-ir', 
optimization]
 test_file = '{0}.opt_test'.format(test_name)
 with open(test_file, 'w') as f:
-f.write('#!/bin/bash\n#\n# This file was generated by 
create_test_cases.py.\n#\n')
+f.write('#!/usr/bin/env bash\n#\n# This file was generated by 
create_test_cases.py.\n#\n')
 f.write(doc_string)
 f.write('{0} <http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] glsl: Initialize per_vertex_accumluator::fields.

2013-10-12 Thread Vinson Lee
Fixes "Uninitialized pointer field" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/glsl/builtin_variables.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index ae0a03f..3f87502 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -311,7 +311,8 @@ private:
 
 
 per_vertex_accumulator::per_vertex_accumulator()
-   : num_fields(0)
+   : fields(),
+ num_fields(0)
 {
 }
 
-- 
1.8.3.2

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


Re: [Mesa-dev] [PATCH] scons: Simplified fix of llvm cxxflags

2013-10-16 Thread Vinson Lee
On Wed, Oct 16, 2013 at 6:26 PM, Alexander von Gluck IV
 wrote:
> * Based on ideas of Jose Fonseca
> * A rework of ce8eadb6e8
> ---
>  scons/llvm.py | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/scons/llvm.py b/scons/llvm.py
> index c1c3736..8388d8e 100644
> --- a/scons/llvm.py
> +++ b/scons/llvm.py
> @@ -190,6 +190,11 @@ def generate(env):
>  pass
>  env.MergeFlags(cppflags)
>
> +# Match llvm --fno-rtti flag
> +cxxflags = env.backtick('llvm-config --cxxflags').split()
> +if '-fno-rtti' in cxxflags:
> +env.Append(CXXFLAGS = ['-fno-rtti'])
> +
>  components = ['engine', 'bitwriter', 'x86asmprinter']
>
>  if llvm_version >= distutils.version.LooseVersion('3.1'):
> --
> 1.8.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Fixes the build failure again for me.

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


[Mesa-dev] [PATCH] r600g/sb: Initialize shader::dce_flags.

2013-10-18 Thread Vinson Lee
Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/r600/sb/sb_shader.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r600/sb/sb_shader.cpp 
b/src/gallium/drivers/r600/sb/sb_shader.cpp
index 98e52b1..38617a8 100644
--- a/src/gallium/drivers/r600/sb/sb_shader.cpp
+++ b/src/gallium/drivers/r600/sb/sb_shader.cpp
@@ -39,7 +39,8 @@ shader::shader(sb_context &sctx, shader_target t, unsigned id)
   coal(*this), bbs(),
   target(t), vt(ex), ex(*this), root(),
   compute_interferences(),
-  has_alu_predication(), uses_gradients(), safe_math(), ngpr(), nstack() {}
+  has_alu_predication(),
+  uses_gradients(), safe_math(), ngpr(), nstack(), dce_flags() {}
 
 bool shader::assign_slot(alu_node* n, alu_node *slots[5]) {
 
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] i965: Initialize vec4_visitor member variables.

2013-10-26 Thread Vinson Lee
Fixes "Uninitialized pointer field" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index c163c94..c9cdf65 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -3145,7 +3145,12 @@ vec4_visitor::vec4_visitor(struct brw_context *brw,
   void *mem_ctx,
bool debug_flag,
bool no_spills)
-   : debug_flag(debug_flag), no_spills(no_spills)
+   : sanity_param_count(0),
+ fail_msg(NULL),
+ first_non_payload_grf(0),
+ need_all_constants_in_pull_buffer(false),
+ debug_flag(debug_flag),
+ no_spills(no_spills)
 {
this->brw = brw;
this->ctx = &brw->ctx;
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] radeon: Reference miptree after checking if it is null.

2013-10-26 Thread Vinson Lee
Fixes "Dereference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/radeon/radeon_texture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c 
b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 52cf95d..1ce6d28 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -560,8 +560,6 @@ void radeon_image_target_texture_2d(struct gl_context *ctx, 
GLenum target,
 
radeon_try_alloc_miptree(radeon, t);
 
-   radeon_miptree_reference(t->mt, &radeonImage->mt);
-
if (t->mt == NULL)
{
radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
@@ -569,6 +567,8 @@ void radeon_image_target_texture_2d(struct gl_context *ctx, 
GLenum target,
return;
}
 
+   radeon_miptree_reference(t->mt, &radeonImage->mt);
+
/* Particularly ugly: this is guaranteed to break, if image->bo is
   not of the required size for a miptree. */
radeon_bo_unref(t->mt->bo);
-- 
1.8.3.1

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


[Mesa-dev] [PATCH v2] i915, i965: Fix memory leak in intel_miptree_create_for_bo.

2013-10-26 Thread Vinson Lee
Fixes "Resource leak" defects reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i915/intel_mipmap_tree.c | 4 +++-
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
index 8432b6d..984eeaa 100644
--- a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
@@ -264,8 +264,10 @@ intel_miptree_create_for_bo(struct intel_context *intel,
 0, 0,
 width, height, 1,
 true);
-   if (!mt)
+   if (!mt) {
+  free(region);
   return mt;
+   }
 
region->cpp = mt->cpp;
region->width = width;
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 36a080f..6cdd6b5 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -626,8 +626,10 @@ intel_miptree_create_for_bo(struct brw_context *brw,
 0, 0,
 width, height, 1,
 true, 0 /* num_samples */);
-   if (!mt)
+   if (!mt) {
+  free(region);
   return mt;
+   }
 
region->cpp = mt->cpp;
region->width = width;
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] i915: Fix logic_op check.

2013-10-26 Thread Vinson Lee
logic_op is of type GLenum (unsigned int).

Fixes "Macro compares unsigned to 0" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i915/intel_blit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i915/intel_blit.c 
b/src/mesa/drivers/dri/i915/intel_blit.c
index 7b59708..9a66736 100644
--- a/src/mesa/drivers/dri/i915/intel_blit.c
+++ b/src/mesa/drivers/dri/i915/intel_blit.c
@@ -534,7 +534,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context 
*intel,
 return false;
}
 
-   assert( logic_op - GL_CLEAR >= 0 );
+   assert( logic_op >= GL_CLEAR );
assert( logic_op - GL_CLEAR < 0x10 );
assert(dst_pitch > 0);
 
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] svga: Remove svga_hwtnl_simple_draw_range_elements dead code.

2013-10-26 Thread Vinson Lee
Remove dead code left behind by commit
8d7b913e4e089cc8b0b800cbcf80737d0be0a0f7.

Fixes "Logically dead code" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/svga/svga_draw_elements.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_draw_elements.c 
b/src/gallium/drivers/svga/svga_draw_elements.c
index c52ca2d..f9ba66f 100644
--- a/src/gallium/drivers/svga/svga_draw_elements.c
+++ b/src/gallium/drivers/svga/svga_draw_elements.c
@@ -105,7 +105,6 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl 
*hwtnl,
unsigned start,
unsigned count )
 {
-   struct pipe_resource *upload_buffer = NULL;
SVGA3dPrimitiveRange range;
unsigned hw_prim;
unsigned hw_count;
@@ -130,13 +129,8 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl 
*hwtnl,
range.indexBias = index_bias;
 
ret = svga_hwtnl_prim( hwtnl, &range, min_index, max_index, index_buffer );
-   if (ret != PIPE_OK)
-  goto done;
 
 done:
-   if (upload_buffer)
-  pipe_resource_reference( &upload_buffer, NULL );
-
return ret;
 }
 
-- 
1.8.3.2

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


[Mesa-dev] [PATCH] i965: Initialize schedule_node::delay.

2013-11-03 Thread Vinson Lee
Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp 
b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
index 5dcd0e8..2833e20 100644
--- a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
+++ b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
@@ -69,6 +69,7 @@ public:
   this->parent_count = 0;
   this->unblocked_time = 0;
   this->cand_generation = 0;
+  this->delay = 0;
 
   /* We can't measure Gen6 timings directly but expect them to be much
* closer to Gen7 than Gen4.
-- 
1.8.3.2

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


[Mesa-dev] [PATCH] r600g: Add missing break for callstack_push FC_PUSH_WQM case.

2013-11-03 Thread Vinson Lee
Fixes "Missing break in switch" reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/r600/r600_shader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/r600/r600_shader.c 
b/src/gallium/drivers/r600/r600_shader.c
index ce15cd7..d6cbfd7 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -5337,6 +5337,7 @@ static inline void callstack_push(struct r600_shader_ctx 
*ctx, unsigned reason)
break;
case FC_PUSH_WQM:
++ctx->bc->stack.push_wqm;
+   break;
case FC_LOOP:
++ctx->bc->stack.loop;
break;
-- 
1.8.3.2

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


[Mesa-dev] [PATCH] r600g: Prevent invalid op overflows in release builds.

2013-11-03 Thread Vinson Lee
Fixes "Overflowed return value" defects reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/r600/r600_isa.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/gallium/drivers/r600/r600_isa.h 
b/src/gallium/drivers/r600/r600_isa.h
index c6bb869..5b9c3d0 100644
--- a/src/gallium/drivers/r600/r600_isa.h
+++ b/src/gallium/drivers/r600/r600_isa.h
@@ -1210,6 +1210,9 @@ r600_isa_alu_by_opcode(struct r600_isa* isa, unsigned 
opcode, unsigned is_op3) {
op = isa->alu_op2_map[opcode];
}
assert(op);
+   if (!op) {
+   return 0;
+   }
return op - 1;
 }
 
@@ -1219,6 +1222,9 @@ r600_isa_fetch_by_opcode(struct r600_isa* isa, unsigned 
opcode) {
assert(isa->fetch_map);
op = isa->fetch_map[opcode];
assert(op);
+   if (!op) {
+   return 0;
+   }
return op - 1;
 }
 
@@ -1230,6 +1236,9 @@ r600_isa_cf_by_opcode(struct r600_isa* isa, unsigned 
opcode, unsigned is_alu) {
 * CF opcodes (they use different encoding in hw) */
op = isa->cf_map[is_alu ? opcode + 0x80 : opcode];
assert(op);
+   if (!op) {
+   return 0;
+   }
return op - 1;
 }
 
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] nvc0: Remove unused pointer value cfg.

2013-11-03 Thread Vinson Lee
cfg is only used inside for loop so also move declaration there.

Fixes "Unused pointer value" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index 21aa358..4f83f57 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -1155,9 +1155,6 @@ nvc0_mp_pm_query_end(struct nvc0_context *nvc0, struct 
nvc0_query *q)
const uint block[3] = { 32, is_nve4 ? 4 : 1, 1 };
const uint grid[3] = { screen->mp_count, 1, 1 };
unsigned c;
-   const struct nvc0_mp_pm_query_cfg *cfg;
-
-   cfg = nvc0_mp_pm_query_get_cfg(nvc0, q);
 
if (unlikely(!screen->pm.prog)) {
   struct nvc0_program *prog = CALLOC_STRUCT(nvc0_program);
@@ -1212,6 +1209,7 @@ nvc0_mp_pm_query_end(struct nvc0_context *nvc0, struct 
nvc0_query *q)
mask = 0;
for (c = 0; c < 8; ++c) {
   unsigned i;
+  const struct nvc0_mp_pm_query_cfg *cfg;
   q = nvc0_query(screen->pm.mp_counter[c]);
   if (!q)
  continue;
-- 
1.8.3.1

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


[Mesa-dev] [PATCH] gallivm: Remove llvm::DisablePrettyStackTrace for LLVM >= 3.4.

2013-11-03 Thread Vinson Lee
LLVM 3.4 r193971 removed llvm::DisablePrettyStackTrace and made the
pretty stack trace opt-in rather than opt-out.

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp 
b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index e8d2db2..65c02d8 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -174,12 +174,14 @@ lp_set_target_options(void)
}
 #endif
 
+#if HAVE_LLVM < 0x0304
/*
 * By default LLVM adds a signal handler to output a pretty stack trace.
 * This signal handler is never removed, causing problems when unloading the
 * shared object where the gallium driver resides.
 */
llvm::DisablePrettyStackTrace = true;
+#endif
 
// If we have a native target, initialize it to ensure it is linked in and
// usable by the JIT.
-- 
1.8.3.2

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


[Mesa-dev] [PATCH] i965: Add missing break in SHADER_OPCODE_GEN7_SCRATCH_READ case.

2013-11-14 Thread Vinson Lee
Fixes "Missing break in switch" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp 
b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
index 39a5266..a4fae0d 100644
--- a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
+++ b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
@@ -335,6 +335,8 @@ schedule_node::set_latency_gen7(bool is_haswell)
* then around 140.  Presumably this is cache hit vs miss.
*/
   latency = 50;
+  break;
+
case SHADER_OPCODE_UNTYPED_ATOMIC:
   /* Test code:
*   mov(8)g112<1>ud   0xud   { align1 WE_all 1Q };
-- 
1.8.4.2

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


[Mesa-dev] [PATCH] gallivm: Ignore unknown file type in non-debug builds.

2013-11-19 Thread Vinson Lee
Fixes "Uninitialized pointer read" defect reported by Coverity.

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 37f7a56..6d8dc8c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -2410,6 +2410,7 @@ emit_dump_file(struct lp_build_tgsi_soa_context *bld,
 res = LLVMBuildLoad(builder, reg_ptr, "");
  } else {
 assert(0);
+continue;
  }
 
  emit_dump_reg(gallivm, file, index, chan, res);
-- 
1.8.3.2

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


[Mesa-dev] [PATCH] glsl: Link glcpp with math library.

2013-11-19 Thread Vinson Lee
This patch fixes this build error with Oracle Solaris Studio.

libtool: link: /opt/solarisstudio12.3/bin/cc -g -o glcpp/glcpp glcpp.o 
prog_hash_table.o  ./.libs/libglcpp.a
Undefined   first referenced
 symbol in file
sqrtprog_hash_table.o

Signed-off-by: Vinson Lee 
---
 src/glsl/Makefile.am |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index cbf253c..05b6759 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -93,7 +93,9 @@ libglcpp_la_SOURCES = \
 glcpp_glcpp_SOURCES =  \
glcpp/glcpp.c   \
$(top_srcdir)/src/mesa/program/prog_hash_table.c
-glcpp_glcpp_LDADD = libglcpp.la
+glcpp_glcpp_LDADD =\
+   libglcpp.la \
+   -lm
 
 libglsl_la_LIBADD = libglcpp.la
 libglsl_la_SOURCES =   \
-- 
1.7.9.2

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


  1   2   3   4   5   6   >