Re: [Mesa-dev] [PATCH V2 2/3] glsl: add new expression types for interpolateAt*

2013-11-11 Thread Chris Forbes
Sorry, that commit message ended up a mess.

On Tue, Nov 12, 2013 at 8:45 PM, Chris Forbes  wrote:
> Will be used to implement interpolateAtCentroid(), interpolateAtOffset()
> and interpolateAtSample() from ARB_gpu_shader5
> Will be used to implement interpolateAtCentroid() from ARB_gpu_shader5.
>
> Signed-off-by: Chris Forbes 
> ---
>  src/glsl/ir.cpp|  6 ++
>  src/glsl/ir.h  | 27 +--
>  src/glsl/ir_builder.cpp| 18 ++
>  src/glsl/ir_builder.h  |  4 
>  src/glsl/ir_constant_expression.cpp|  2 ++
>  src/glsl/ir_validate.cpp   | 18 ++
>  src/mesa/program/ir_to_mesa.cpp|  3 +++
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |  3 +++
>  8 files changed, 79 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
> index 1b49736..8a5f9e7 100644
> --- a/src/glsl/ir.cpp
> +++ b/src/glsl/ir.cpp
> @@ -251,6 +251,7 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
> case ir_unop_dFdx:
> case ir_unop_dFdy:
> case ir_unop_bitfield_reverse:
> +   case ir_unop_interpolate_at_centroid:
>this->type = op0->type;
>break;
>
> @@ -405,6 +406,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, 
> ir_rvalue *op1)
> case ir_binop_rshift:
> case ir_binop_bfm:
> case ir_binop_ldexp:
> +   case ir_binop_interpolate_at_offset:
> +   case ir_binop_interpolate_at_sample:
>this->type = op0->type;
>break;
>
> @@ -527,6 +530,7 @@ static const char *const operator_strs[] = {
> "find_msb",
> "find_lsb",
> "noise",
> +   "interpolate_at_centroid",
> "+",
> "-",
> "*",
> @@ -560,6 +564,8 @@ static const char *const operator_strs[] = {
> "ubo_load",
> "ldexp",
> "vector_extract",
> +   "interpolate_at_offset",
> +   "interpolate_at_sample",
> "fma",
> "lrp",
> "csel",
> diff --git a/src/glsl/ir.h b/src/glsl/ir.h
> index 7b905ef..2a5b612 100644
> --- a/src/glsl/ir.h
> +++ b/src/glsl/ir.h
> @@ -1199,9 +1199,16 @@ enum ir_expression_operation {
> ir_unop_noise,
>
> /**
> +* Interpolate fs input at centroid
> +*
> +* operand0 is the fs input.
> +*/
> +   ir_unop_interpolate_at_centroid,
> +
> +   /**
>  * A sentinel marking the last of the unary operations.
>  */
> -   ir_last_unop = ir_unop_noise,
> +   ir_last_unop = ir_unop_interpolate_at_centroid,
>
> ir_binop_add,
> ir_binop_sub,
> @@ -1320,9 +1327,25 @@ enum ir_expression_operation {
> ir_binop_vector_extract,
>
> /**
> +* Interpolate fs input at offset
> +*
> +* operand0 is the fs input
> +* operand1 is the offset from the pixel center
> +*/
> +   ir_binop_interpolate_at_offset,
> +
> +   /**
> +* Interpolate fs input at sample position
> +*
> +* operand0 is the fs input
> +* operand1 is the sample ID
> +*/
> +   ir_binop_interpolate_at_sample,
> +
> +   /**
>  * A sentinel marking the last of the binary operations.
>  */
> -   ir_last_binop = ir_binop_vector_extract,
> +   ir_last_binop = ir_binop_interpolate_at_sample,
>
> /**
>  * \name Fused floating-point multiply-add, part of ARB_gpu_shader5.
> diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp
> index 6c49734..791b280 100644
> --- a/src/glsl/ir_builder.cpp
> +++ b/src/glsl/ir_builder.cpp
> @@ -496,6 +496,24 @@ b2f(operand a)
>  }
>
>  ir_expression *
> +interpolate_at_centroid(operand a)
> +{
> +   return expr(ir_unop_interpolate_at_centroid, a);
> +}
> +
> +ir_expression *
> +interpolate_at_offset(operand a, operand b)
> +{
> +   return expr(ir_binop_interpolate_at_offset, a, b);
> +}
> +
> +ir_expression *
> +interpolate_at_sample(operand a, operand b)
> +{
> +   return expr(ir_binop_interpolate_at_sample, a, b);
> +}
> +
> +ir_expression *
>  fma(operand a, operand b, operand c)
>  {
> return expr(ir_triop_fma, a, b, c);
> diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h
> index 1f07788..3c8780a 100644
> --- a/src/glsl/ir_builder.h
> +++ b/src/glsl/ir_builder.h
> @@ -184,6 +184,10 @@ ir_expression *i2b(operand a);
>  ir_expression *f2b(operand a);
>  ir_expression *b2f(operand a);
>
> +ir_expression *interpolate_at_centroid(operand a);
> +ir_expression *interpolate_at_offset(operand a, operand b);
> +ir_expression *interpolate_at_sample(operand a, operand b);
> +
>  ir_expression *fma(operand a, operand b, operand c);
>  ir_expression *lrp(operand x, operand y, operand a);
>  ir_expression *csel(operand a, operand b, operand c);
> diff --git a/src/glsl/ir_constant_expression.cpp 
> b/src/glsl/ir_constant_expression.cpp
> index 0efd1d5..ca92768 100644
> --- a/src/glsl/ir_constant_expression.cpp
> +++ b/src/glsl/ir_constant_expression.cpp
> @@ -415,6 +415,8 @@ ir_expression::constant_expression_value(struct 
> hash_table *variable_context)
>case ir_binop_lshift:
>

[Mesa-dev] [PATCH V2 0/3] ARB_gpu_shader5 interpolateAt* plumbing

2013-11-11 Thread Chris Forbes
This series adds the driver-independent bits for the following new
builtin functions in ARB_gpu_shader5:

- interpolateAtCentroid
- interpolateAtOffset
- interpolateAtSample

Passes all the compiler piglits for these builtins.

Big changes from the RFC series from the other day:

- Don't abuse ir_var_mode_shader_in; add a new flag for it.
- Don't assume everyone wants lowering of interpolateAtSample.

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


[Mesa-dev] [PATCH V2 3/3] glsl: add new interpolateAt* builtin functions

2013-11-11 Thread Chris Forbes
V2: - Don't assume everyone wants interpolateAtSample() lowered to
  interpolateAtOffset. It turns out this isn't what we want most
  of the time for i965. Lowering can be added later in an ir pass
  which drivers opt into, rather than bolting it straight into the
  builtin definition.
- Only expose the interpolateAt* builtins in the fragment language.

Signed-off-by: Chris Forbes 
---
 src/glsl/builtin_functions.cpp | 67 ++
 1 file changed, 67 insertions(+)

diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index 8cb75e5..49eb8a8 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -214,6 +214,14 @@ gpu_shader5(const _mesa_glsl_parse_state *state)
 }
 
 static bool
+fs_gpu_shader5(const _mesa_glsl_parse_state *state)
+{
+   return state->target == fragment_shader &&
+  (state->is_version(400, 0) || state->ARB_gpu_shader5_enable);
+}
+
+
+static bool
 texture_array_lod(const _mesa_glsl_parse_state *state)
 {
return lod_exists_in_stage(state) &&
@@ -564,6 +572,9 @@ private:
B1(uaddCarry)
B1(usubBorrow)
B1(mulExtended)
+   B1(interpolateAtCentroid)
+   B1(interpolateAtOffset)
+   B1(interpolateAtSample)
 
ir_function_signature *_atomic_intrinsic(builtin_available_predicate avail);
ir_function_signature *_atomic_op(const char *intrinsic,
@@ -2092,6 +2103,24 @@ builtin_builder::create_builtins()
 _mulExtended(glsl_type::uvec3_type),
 _mulExtended(glsl_type::uvec4_type),
 NULL);
+   add_function("interpolateAtCentroid",
+_interpolateAtCentroid(glsl_type::float_type),
+_interpolateAtCentroid(glsl_type::vec2_type),
+_interpolateAtCentroid(glsl_type::vec3_type),
+_interpolateAtCentroid(glsl_type::vec4_type),
+NULL);
+   add_function("interpolateAtOffset",
+_interpolateAtOffset(glsl_type::float_type),
+_interpolateAtOffset(glsl_type::vec2_type),
+_interpolateAtOffset(glsl_type::vec3_type),
+_interpolateAtOffset(glsl_type::vec4_type),
+NULL);
+   add_function("interpolateAtSample",
+_interpolateAtSample(glsl_type::float_type),
+_interpolateAtSample(glsl_type::vec2_type),
+_interpolateAtSample(glsl_type::vec3_type),
+_interpolateAtSample(glsl_type::vec4_type),
+NULL);
 
add_function("atomicCounter",
 _atomic_op("__intrinsic_atomic_read",
@@ -3970,6 +3999,44 @@ builtin_builder::_mulExtended(const glsl_type *type)
 }
 
 ir_function_signature *
+builtin_builder::_interpolateAtCentroid(const glsl_type *type)
+{
+   ir_variable *interpolant = in_var(type, "interpolant");
+   interpolant->must_be_shader_input = 1;
+   MAKE_SIG(type, fs_gpu_shader5, 1, interpolant);
+
+   body.emit(ret(interpolate_at_centroid(interpolant)));
+
+   return sig;
+}
+
+ir_function_signature *
+builtin_builder::_interpolateAtOffset(const glsl_type *type)
+{
+   ir_variable *interpolant = in_var(type, "interpolant");
+   interpolant->must_be_shader_input = 1;
+   ir_variable *offset = in_var(glsl_type::vec2_type, "offset");
+   MAKE_SIG(type, fs_gpu_shader5, 2, interpolant, offset);
+
+   body.emit(ret(interpolate_at_offset(interpolant, offset)));
+
+   return sig;
+}
+
+ir_function_signature *
+builtin_builder::_interpolateAtSample(const glsl_type *type)
+{
+   ir_variable *interpolant = in_var(type, "interpolant");
+   interpolant->must_be_shader_input = 1;
+   ir_variable *sample_num = in_var(glsl_type::int_type, "sample_num");
+   MAKE_SIG(type, fs_gpu_shader5, 2, interpolant, sample_num);
+
+   body.emit(ret(interpolate_at_sample(interpolant, sample_num)));
+
+   return sig;
+}
+
+ir_function_signature *
 builtin_builder::_atomic_intrinsic(builtin_available_predicate avail)
 {
ir_variable *counter = in_var(glsl_type::atomic_uint_type, "counter");
-- 
1.8.4.2

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


[Mesa-dev] [PATCH V2 1/3] allow builtin functions to require parameters to be shader inputs

2013-11-11 Thread Chris Forbes
The new interpolateAt* builtins have strange restrictions on the
 parameter.

- It must be a shader input, or an element of a shader input array.
- It must not include a swizzle.

V2: Don't abuse ir_var_mode_shader_in for this; make a new flag.

Signed-off-by: Chris Forbes 
---
 src/glsl/ast_function.cpp | 18 ++
 src/glsl/ir.h |  6 ++
 src/glsl/ir_clone.cpp |  1 +
 3 files changed, 25 insertions(+)

diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 2707522..8730e71 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -131,6 +131,24 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
 return false;
   }
 
+  /* Verify that shader_in parameters are shader inputs */
+  if (formal->must_be_shader_input) {
+ ir_variable *var = actual->variable_referenced();
+ if (var && var->mode != ir_var_shader_in) {
+_mesa_glsl_error(&loc, state,
+ "parameter `%s` must be a shader input",
+ formal->name);
+return false;
+ }
+
+ if (actual->ir_type == ir_type_swizzle) {
+_mesa_glsl_error(&loc, state,
+ "parameter `%s` must not be swizzled",
+ formal->name);
+return false;
+ }
+  }
+
   /* Verify that 'out' and 'inout' actual parameters are lvalues. */
   if (formal->mode == ir_var_function_out
   || formal->mode == ir_var_function_inout) {
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 2f06fb9..7b905ef 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -600,6 +600,12 @@ public:
unsigned from_named_ifc_block_array:1;
 
/**
+* Non-zero if the variable must be a shader input. This is useful for
+* constraints on function parameters.
+*/
+   unsigned must_be_shader_input:1;
+
+   /**
 * \brief Layout qualifier for gl_FragDepth.
 *
 * This is not equal to \c ir_depth_layout_none if and only if this
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp
index b0f173a..3d5ea50 100644
--- a/src/glsl/ir_clone.cpp
+++ b/src/glsl/ir_clone.cpp
@@ -69,6 +69,7 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
var->depth_layout = this->depth_layout;
var->assigned = this->assigned;
var->used = this->used;
+   var->must_be_shader_input = this->must_be_shader_input;
 
var->num_state_slots = this->num_state_slots;
if (this->state_slots) {
-- 
1.8.4.2

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


[Mesa-dev] [PATCH V2 2/3] glsl: add new expression types for interpolateAt*

2013-11-11 Thread Chris Forbes
Will be used to implement interpolateAtCentroid(), interpolateAtOffset()
and interpolateAtSample() from ARB_gpu_shader5
Will be used to implement interpolateAtCentroid() from ARB_gpu_shader5.

Signed-off-by: Chris Forbes 
---
 src/glsl/ir.cpp|  6 ++
 src/glsl/ir.h  | 27 +--
 src/glsl/ir_builder.cpp| 18 ++
 src/glsl/ir_builder.h  |  4 
 src/glsl/ir_constant_expression.cpp|  2 ++
 src/glsl/ir_validate.cpp   | 18 ++
 src/mesa/program/ir_to_mesa.cpp|  3 +++
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |  3 +++
 8 files changed, 79 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 1b49736..8a5f9e7 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -251,6 +251,7 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
case ir_unop_dFdx:
case ir_unop_dFdy:
case ir_unop_bitfield_reverse:
+   case ir_unop_interpolate_at_centroid:
   this->type = op0->type;
   break;
 
@@ -405,6 +406,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, 
ir_rvalue *op1)
case ir_binop_rshift:
case ir_binop_bfm:
case ir_binop_ldexp:
+   case ir_binop_interpolate_at_offset:
+   case ir_binop_interpolate_at_sample:
   this->type = op0->type;
   break;
 
@@ -527,6 +530,7 @@ static const char *const operator_strs[] = {
"find_msb",
"find_lsb",
"noise",
+   "interpolate_at_centroid",
"+",
"-",
"*",
@@ -560,6 +564,8 @@ static const char *const operator_strs[] = {
"ubo_load",
"ldexp",
"vector_extract",
+   "interpolate_at_offset",
+   "interpolate_at_sample",
"fma",
"lrp",
"csel",
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 7b905ef..2a5b612 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1199,9 +1199,16 @@ enum ir_expression_operation {
ir_unop_noise,
 
/**
+* Interpolate fs input at centroid
+*
+* operand0 is the fs input.
+*/
+   ir_unop_interpolate_at_centroid,
+
+   /**
 * A sentinel marking the last of the unary operations.
 */
-   ir_last_unop = ir_unop_noise,
+   ir_last_unop = ir_unop_interpolate_at_centroid,
 
ir_binop_add,
ir_binop_sub,
@@ -1320,9 +1327,25 @@ enum ir_expression_operation {
ir_binop_vector_extract,
 
/**
+* Interpolate fs input at offset
+*
+* operand0 is the fs input
+* operand1 is the offset from the pixel center
+*/
+   ir_binop_interpolate_at_offset,
+
+   /**
+* Interpolate fs input at sample position
+*
+* operand0 is the fs input
+* operand1 is the sample ID
+*/
+   ir_binop_interpolate_at_sample,
+
+   /**
 * A sentinel marking the last of the binary operations.
 */
-   ir_last_binop = ir_binop_vector_extract,
+   ir_last_binop = ir_binop_interpolate_at_sample,
 
/**
 * \name Fused floating-point multiply-add, part of ARB_gpu_shader5.
diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp
index 6c49734..791b280 100644
--- a/src/glsl/ir_builder.cpp
+++ b/src/glsl/ir_builder.cpp
@@ -496,6 +496,24 @@ b2f(operand a)
 }
 
 ir_expression *
+interpolate_at_centroid(operand a)
+{
+   return expr(ir_unop_interpolate_at_centroid, a);
+}
+
+ir_expression *
+interpolate_at_offset(operand a, operand b)
+{
+   return expr(ir_binop_interpolate_at_offset, a, b);
+}
+
+ir_expression *
+interpolate_at_sample(operand a, operand b)
+{
+   return expr(ir_binop_interpolate_at_sample, a, b);
+}
+
+ir_expression *
 fma(operand a, operand b, operand c)
 {
return expr(ir_triop_fma, a, b, c);
diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h
index 1f07788..3c8780a 100644
--- a/src/glsl/ir_builder.h
+++ b/src/glsl/ir_builder.h
@@ -184,6 +184,10 @@ ir_expression *i2b(operand a);
 ir_expression *f2b(operand a);
 ir_expression *b2f(operand a);
 
+ir_expression *interpolate_at_centroid(operand a);
+ir_expression *interpolate_at_offset(operand a, operand b);
+ir_expression *interpolate_at_sample(operand a, operand b);
+
 ir_expression *fma(operand a, operand b, operand c);
 ir_expression *lrp(operand x, operand y, operand a);
 ir_expression *csel(operand a, operand b, operand c);
diff --git a/src/glsl/ir_constant_expression.cpp 
b/src/glsl/ir_constant_expression.cpp
index 0efd1d5..ca92768 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -415,6 +415,8 @@ ir_expression::constant_expression_value(struct hash_table 
*variable_context)
   case ir_binop_lshift:
   case ir_binop_rshift:
   case ir_binop_ldexp:
+  case ir_binop_interpolate_at_offset:
+  case ir_binop_interpolate_at_sample:
   case ir_binop_vector_extract:
   case ir_triop_csel:
   case ir_triop_bitfield_extract:
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 13e41a0..4ed8d35 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_valida

Re: [Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Rogovin, Kevin
Hello,
  A subsequent patch has been sent out, and to put my head firmly into a paper 
bag, what should have been a two dry runs were not dry runs and got sent out;  
worse, it was sent three times... Sighs. My sincere apologies. Command lines 
are dangerous. As a side note, I do not know how the 2nd dry was recorded as 
sent after the correct run.

 If people want, I can send it out again with a different subject, but the 
details of the message are:

 http://lists.freedesktop.org/archives/mesa-dev/2013-November/048257.html

[Mesa-dev] [PATCH] nicer-no-wrap-patch
Kevin Rogovin kevin.rogovin at intel.com 
Mon Nov 11 23:26:47 PST 2013

with commit message:

"Track bytes written during no flush phases for debug builds "


-Kevin


From: Rogovin, Kevin
Sent: Tuesday, November 12, 2013 8:39 AM
To: mesa-dev@lists.freedesktop.org
Subject: RE: [Mesa-dev] [PATCH] nicer-no-wrap-patch

Hi all, I will later submit a patch taking into account comments, however one 
comment I will address *now*.

Eric Anholt [e...@anholt.net] writes:

>Kevin Rogovin  writes:
>
>> This patch adds a function interface for enabling no wrap on batch commands,
>>adds to it assert enforcement that the number bytes added to the
>> batch buffer does not exceed a passed value and finally this is used
>> in brw_try_draw_prims() to help make sure that estimated_max_prim_size
>> is a good value.
>
>I don't like adding overhead to every batch operation.  You can just do
>an assert like I did in 185b5a54c94ce11487146042c8eec24909187ed6

That approach used in brw_blorp_exec.cpp will not work here because the estimate
is (and should be) computed in brw_try_draw_prims() and the assert needs to be 
done
whenever commands or state are added to the batch buffer. Additionally it is 
literally an
overhead or exactly writing one boolean and two integers _per_ draw call. This 
overhead
is literally insignificant next to the overhead of the call stack to reach 
brw_try_draw_primis().

However, I will make it so that the write to those variables only occurs in 
debug, since the
assert is only for the purpose of debug; going further those members will only 
exists in debug
for that matter.

From: Eric Anholt [e...@anholt.net]
Sent: Monday, November 11, 2013 9:56 PM
To: Rogovin, Kevin; mesa-dev@lists.freedesktop.org
Cc: Rogovin, Kevin
Subject: Re: [Mesa-dev] [PATCH] nicer-no-wrap-patch

Kevin Rogovin  writes:

> This patch adds a function interface for enabling no wrap on batch commands,
> adds to it assert enforcement that the number bytes added to the
> batch buffer does not exceed a passed value and finally this is used
> in brw_try_draw_prims() to help make sure that estimated_max_prim_size
> is a good value.

I don't like adding overhead to every batch operation.  You can just do
an assert like I did in 185b5a54c94ce11487146042c8eec24909187ed6
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Kevin Rogovin
Track bytes written during no flush phases for debug builds 


---
 src/mesa/drivers/dri/i965/brw_context.h   | 85 +++
 src/mesa/drivers/dri/i965/brw_draw.c  |  4 +-
 src/mesa/drivers/dri/i965/brw_state_batch.c   | 15 +
 src/mesa/drivers/dri/i965/intel_batchbuffer.h |  6 ++
 4 files changed, 108 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
b/src/mesa/drivers/dri/i965/brw_context.h
index 8b1cbb3..638e570 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1028,8 +1028,37 @@ struct brw_context
uint32_t reset_count;
 
struct intel_batchbuffer batch;
+
+   /**
+* Debug-only: flag to indicate to that batch buffer flush 
+* should not happen
+* 
+* While no_batch_wrap is true, the batch buffer must not
+* be flushed. Use the functions begin_no_batch_wrap() and
+* end_no_batch_wrap() to mark the start and end points
+* that the batch buffer must not be flushed.
+*/
bool no_batch_wrap;
 
+   /**
+* Debug-only: expected maximum number bytes added to 
+* batch buffer
+*
+* If \ref no_batch_wrap is true, specifies the number
+* of bytes that are expected before \ref no_batch_wrap
+* is set to false.
+*/
+   int max_expected_batch_size_during_no_batch_wrap;
+
+   /**
+* Debug-only: current number of bytes added to batch buffer
+*
+* records the number of bytes consumed so far
+* in the batch buffer since the last time \ref 
+* no_batch_wrap was set to true
+*/
+   int number_bytes_consumed_during_no_batch_wrap;
+
struct {
   drm_intel_bo *bo;
   GLuint offset;
@@ -1450,6 +1479,62 @@ is_power_of_two(uint32_t value)
return (value & (value - 1)) == 0;
 }
 
+/**
+ * Affect only in debug: Begin mark of don't flush batch buffer
+ *
+ * Function to mark the start of a sequence of commands and state 
+ * added to the batch buffer that must not be partitioned by
+ * a flush. 
+ * Requirements: 
+ * - no_batch_wrap is false
+ *
+ * Output/side effects:
+ * - no_batch_wrap set to true
+ * - max_expected_batch_size_during_no_batch_wrap set
+ * - number_bytes_consumed_during_no_batch_wrap reset to 0
+ *
+ * \ref brw context pointer
+ * \ref pmax_expected_batch_size value specifying expected maximum number of 
bytes to 
+ *   be consumed in the batch buffer  
+ */ 
+static INLINE void
+begin_no_batch_wrap(struct brw_context *brw, int pmax_expected_batch_size)
+{
+#ifdef DEBUG
+   assert(!brw->no_batch_wrap);
+   brw->no_batch_wrap=true;
+   brw->max_expected_batch_size_during_no_batch_wrap=pmax_expected_batch_size;
+   brw->number_bytes_consumed_during_no_batch_wrap=0;
+#else
+   (void)brw;
+   (void)pmax_expected_batch_size;
+#endif
+}
+
+/**
+ * Affect only in Debug only: end mark of don't flush batch buffer
+ *
+ * Function to mark the end of a sequence of commands and state 
+ * added to the batch buffer that must not be partitioned by
+ * a flush. 
+ * Requirements:
+ * - no_batch_wrap is true
+ *
+ * Output/side effects:
+ * - no_batch_wrap set to false
+ */
+static INLINE void
+end_no_batch_wrap(struct brw_context *brw)
+{
+#ifdef DEBUG
+   assert(brw->no_batch_wrap);
+   brw->no_batch_wrap=false;
+#else
+   (void)brw;
+#endif
+}
+
+
 /*==
  * brw_vtbl.c
  */
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c 
b/src/mesa/drivers/dri/i965/brw_draw.c
index 7b33b76..12f0ffe 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -416,14 +416,14 @@ retry:
* *_set_prim or intel_batchbuffer_flush(), which only impacts
* brw->state.dirty.brw.
*/
+  begin_no_batch_wrap(brw, estimated_max_prim_size);
   if (brw->state.dirty.brw) {
-brw->no_batch_wrap = true;
 brw_upload_state(brw);
   }
 
   brw_emit_prim(brw, &prims[i], brw->primitive);
+  end_no_batch_wrap(brw);
 
-  brw->no_batch_wrap = false;
 
   if (dri_bufmgr_check_aperture_space(&brw->batch.bo, 1)) {
 if (!fail_next) {
diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c 
b/src/mesa/drivers/dri/i965/brw_state_batch.c
index c71d2f3..60d3c2d 100644
--- a/src/mesa/drivers/dri/i965/brw_state_batch.c
+++ b/src/mesa/drivers/dri/i965/brw_state_batch.c
@@ -127,6 +127,21 @@ brw_state_batch(struct brw_context *brw,
assert(size < batch->bo->size);
offset = ROUND_DOWN_TO(batch->state_batch_offset - size, alignment);
 
+#ifdef DEBUG
+   if(brw->no_batch_wrap) {
+  /* although the request is for size bytes, the consumption 
+   * can be greater because of alignment, thus we use the 
+   * differences of the new-to-be offset with the old 
+   * offset value.
+   */
+  brw->number_bytes_consumed_during_no_batch_wrap += 
+ (batch->state_batch_offset-offset);
+
+  assert(brw->number_bytes_consumed_dur

[Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Kevin Rogovin
feedback integrated

space-pace
---
 src/mesa/drivers/dri/i965/brw_context.h   | 85 +++
 src/mesa/drivers/dri/i965/brw_draw.c  |  4 +-
 src/mesa/drivers/dri/i965/brw_state_batch.c   | 15 +
 src/mesa/drivers/dri/i965/intel_batchbuffer.h |  6 ++
 4 files changed, 108 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
b/src/mesa/drivers/dri/i965/brw_context.h
index 8b1cbb3..638e570 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1028,8 +1028,37 @@ struct brw_context
uint32_t reset_count;
 
struct intel_batchbuffer batch;
+
+   /**
+* Debug-only: flag to indicate to that batch buffer flush 
+* should not happen
+* 
+* While no_batch_wrap is true, the batch buffer must not
+* be flushed. Use the functions begin_no_batch_wrap() and
+* end_no_batch_wrap() to mark the start and end points
+* that the batch buffer must not be flushed.
+*/
bool no_batch_wrap;
 
+   /**
+* Debug-only: expected maximum number bytes added to 
+* batch buffer
+*
+* If \ref no_batch_wrap is true, specifies the number
+* of bytes that are expected before \ref no_batch_wrap
+* is set to false.
+*/
+   int max_expected_batch_size_during_no_batch_wrap;
+
+   /**
+* Debug-only: current number of bytes added to batch buffer
+*
+* records the number of bytes consumed so far
+* in the batch buffer since the last time \ref 
+* no_batch_wrap was set to true
+*/
+   int number_bytes_consumed_during_no_batch_wrap;
+
struct {
   drm_intel_bo *bo;
   GLuint offset;
@@ -1450,6 +1479,62 @@ is_power_of_two(uint32_t value)
return (value & (value - 1)) == 0;
 }
 
+/**
+ * Affect only in debug: Begin mark of don't flush batch buffer
+ *
+ * Function to mark the start of a sequence of commands and state 
+ * added to the batch buffer that must not be partitioned by
+ * a flush. 
+ * Requirements: 
+ * - no_batch_wrap is false
+ *
+ * Output/side effects:
+ * - no_batch_wrap set to true
+ * - max_expected_batch_size_during_no_batch_wrap set
+ * - number_bytes_consumed_during_no_batch_wrap reset to 0
+ *
+ * \ref brw context pointer
+ * \ref pmax_expected_batch_size value specifying expected maximum number of 
bytes to 
+ *   be consumed in the batch buffer  
+ */ 
+static INLINE void
+begin_no_batch_wrap(struct brw_context *brw, int pmax_expected_batch_size)
+{
+#ifdef DEBUG
+   assert(!brw->no_batch_wrap);
+   brw->no_batch_wrap=true;
+   brw->max_expected_batch_size_during_no_batch_wrap=pmax_expected_batch_size;
+   brw->number_bytes_consumed_during_no_batch_wrap=0;
+#else
+   (void)brw;
+   (void)pmax_expected_batch_size;
+#endif
+}
+
+/**
+ * Affect only in Debug only: end mark of don't flush batch buffer
+ *
+ * Function to mark the end of a sequence of commands and state 
+ * added to the batch buffer that must not be partitioned by
+ * a flush. 
+ * Requirements:
+ * - no_batch_wrap is true
+ *
+ * Output/side effects:
+ * - no_batch_wrap set to false
+ */
+static INLINE void
+end_no_batch_wrap(struct brw_context *brw)
+{
+#ifdef DEBUG
+   assert(brw->no_batch_wrap);
+   brw->no_batch_wrap=false;
+#else
+   (void)brw;
+#endif
+}
+
+
 /*==
  * brw_vtbl.c
  */
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c 
b/src/mesa/drivers/dri/i965/brw_draw.c
index 7b33b76..12f0ffe 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -416,14 +416,14 @@ retry:
* *_set_prim or intel_batchbuffer_flush(), which only impacts
* brw->state.dirty.brw.
*/
+  begin_no_batch_wrap(brw, estimated_max_prim_size);
   if (brw->state.dirty.brw) {
-brw->no_batch_wrap = true;
 brw_upload_state(brw);
   }
 
   brw_emit_prim(brw, &prims[i], brw->primitive);
+  end_no_batch_wrap(brw);
 
-  brw->no_batch_wrap = false;
 
   if (dri_bufmgr_check_aperture_space(&brw->batch.bo, 1)) {
 if (!fail_next) {
diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c 
b/src/mesa/drivers/dri/i965/brw_state_batch.c
index c71d2f3..60d3c2d 100644
--- a/src/mesa/drivers/dri/i965/brw_state_batch.c
+++ b/src/mesa/drivers/dri/i965/brw_state_batch.c
@@ -127,6 +127,21 @@ brw_state_batch(struct brw_context *brw,
assert(size < batch->bo->size);
offset = ROUND_DOWN_TO(batch->state_batch_offset - size, alignment);
 
+#ifdef DEBUG
+   if(brw->no_batch_wrap) {
+  /* although the request is for size bytes, the consumption 
+   * can be greater because of alignment, thus we use the 
+   * differences of the new-to-be offset with the old 
+   * offset value.
+   */
+  brw->number_bytes_consumed_during_no_batch_wrap += 
+ (batch->state_batch_offset-offset);
+
+  assert(brw->number_bytes_consumed_during_no_batch_wrap <= 
+

[Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Kevin Rogovin
feedback integrated

space-pace
---
 src/mesa/drivers/dri/i965/brw_context.h   | 85 +++
 src/mesa/drivers/dri/i965/brw_draw.c  |  4 +-
 src/mesa/drivers/dri/i965/brw_state_batch.c   | 15 +
 src/mesa/drivers/dri/i965/intel_batchbuffer.h |  6 ++
 4 files changed, 108 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
b/src/mesa/drivers/dri/i965/brw_context.h
index 8b1cbb3..638e570 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1028,8 +1028,37 @@ struct brw_context
uint32_t reset_count;
 
struct intel_batchbuffer batch;
+
+   /**
+* Debug-only: flag to indicate to that batch buffer flush 
+* should not happen
+* 
+* While no_batch_wrap is true, the batch buffer must not
+* be flushed. Use the functions begin_no_batch_wrap() and
+* end_no_batch_wrap() to mark the start and end points
+* that the batch buffer must not be flushed.
+*/
bool no_batch_wrap;
 
+   /**
+* Debug-only: expected maximum number bytes added to 
+* batch buffer
+*
+* If \ref no_batch_wrap is true, specifies the number
+* of bytes that are expected before \ref no_batch_wrap
+* is set to false.
+*/
+   int max_expected_batch_size_during_no_batch_wrap;
+
+   /**
+* Debug-only: current number of bytes added to batch buffer
+*
+* records the number of bytes consumed so far
+* in the batch buffer since the last time \ref 
+* no_batch_wrap was set to true
+*/
+   int number_bytes_consumed_during_no_batch_wrap;
+
struct {
   drm_intel_bo *bo;
   GLuint offset;
@@ -1450,6 +1479,62 @@ is_power_of_two(uint32_t value)
return (value & (value - 1)) == 0;
 }
 
+/**
+ * Affect only in debug: Begin mark of don't flush batch buffer
+ *
+ * Function to mark the start of a sequence of commands and state 
+ * added to the batch buffer that must not be partitioned by
+ * a flush. 
+ * Requirements: 
+ * - no_batch_wrap is false
+ *
+ * Output/side effects:
+ * - no_batch_wrap set to true
+ * - max_expected_batch_size_during_no_batch_wrap set
+ * - number_bytes_consumed_during_no_batch_wrap reset to 0
+ *
+ * \ref brw context pointer
+ * \ref pmax_expected_batch_size value specifying expected maximum number of 
bytes to 
+ *   be consumed in the batch buffer  
+ */ 
+static INLINE void
+begin_no_batch_wrap(struct brw_context *brw, int pmax_expected_batch_size)
+{
+#ifdef DEBUG
+   assert(!brw->no_batch_wrap);
+   brw->no_batch_wrap=true;
+   brw->max_expected_batch_size_during_no_batch_wrap=pmax_expected_batch_size;
+   brw->number_bytes_consumed_during_no_batch_wrap=0;
+#else
+   (void)brw;
+   (void)pmax_expected_batch_size;
+#endif
+}
+
+/**
+ * Affect only in Debug only: end mark of don't flush batch buffer
+ *
+ * Function to mark the end of a sequence of commands and state 
+ * added to the batch buffer that must not be partitioned by
+ * a flush. 
+ * Requirements:
+ * - no_batch_wrap is true
+ *
+ * Output/side effects:
+ * - no_batch_wrap set to false
+ */
+static INLINE void
+end_no_batch_wrap(struct brw_context *brw)
+{
+#ifdef DEBUG
+   assert(brw->no_batch_wrap);
+   brw->no_batch_wrap=false;
+#else
+   (void)brw;
+#endif
+}
+
+
 /*==
  * brw_vtbl.c
  */
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c 
b/src/mesa/drivers/dri/i965/brw_draw.c
index 7b33b76..12f0ffe 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -416,14 +416,14 @@ retry:
* *_set_prim or intel_batchbuffer_flush(), which only impacts
* brw->state.dirty.brw.
*/
+  begin_no_batch_wrap(brw, estimated_max_prim_size);
   if (brw->state.dirty.brw) {
-brw->no_batch_wrap = true;
 brw_upload_state(brw);
   }
 
   brw_emit_prim(brw, &prims[i], brw->primitive);
+  end_no_batch_wrap(brw);
 
-  brw->no_batch_wrap = false;
 
   if (dri_bufmgr_check_aperture_space(&brw->batch.bo, 1)) {
 if (!fail_next) {
diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c 
b/src/mesa/drivers/dri/i965/brw_state_batch.c
index c71d2f3..60d3c2d 100644
--- a/src/mesa/drivers/dri/i965/brw_state_batch.c
+++ b/src/mesa/drivers/dri/i965/brw_state_batch.c
@@ -127,6 +127,21 @@ brw_state_batch(struct brw_context *brw,
assert(size < batch->bo->size);
offset = ROUND_DOWN_TO(batch->state_batch_offset - size, alignment);
 
+#ifdef DEBUG
+   if(brw->no_batch_wrap) {
+  /* although the request is for size bytes, the consumption 
+   * can be greater because of alignment, thus we use the 
+   * differences of the new-to-be offset with the old 
+   * offset value.
+   */
+  brw->number_bytes_consumed_during_no_batch_wrap += 
+ (batch->state_batch_offset-offset);
+
+  assert(brw->number_bytes_consumed_during_no_batch_wrap <= 
+

Re: [Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Rogovin, Kevin
Hi all, I will later submit a patch taking into account comments, however one 
comment I will address *now*.

Eric Anholt [e...@anholt.net] writes:

>Kevin Rogovin  writes:
>
>> This patch adds a function interface for enabling no wrap on batch commands,
>>adds to it assert enforcement that the number bytes added to the
>> batch buffer does not exceed a passed value and finally this is used
>> in brw_try_draw_prims() to help make sure that estimated_max_prim_size
>> is a good value.
>
>I don't like adding overhead to every batch operation.  You can just do
>an assert like I did in 185b5a54c94ce11487146042c8eec24909187ed6

That approach used in brw_blorp_exec.cpp will not work here because the estimate
is (and should be) computed in brw_try_draw_prims() and the assert needs to be 
done
whenever commands or state are added to the batch buffer. Additionally it is 
literally an
overhead or exactly writing one boolean and two integers _per_ draw call. This 
overhead
is literally insignificant next to the overhead of the call stack to reach 
brw_try_draw_primis().

However, I will make it so that the write to those variables only occurs in 
debug, since the
assert is only for the purpose of debug; going further those members will only 
exists in debug
for that matter.

From: Eric Anholt [e...@anholt.net]
Sent: Monday, November 11, 2013 9:56 PM
To: Rogovin, Kevin; mesa-dev@lists.freedesktop.org
Cc: Rogovin, Kevin
Subject: Re: [Mesa-dev] [PATCH] nicer-no-wrap-patch

Kevin Rogovin  writes:

> This patch adds a function interface for enabling no wrap on batch commands,
> adds to it assert enforcement that the number bytes added to the
> batch buffer does not exceed a passed value and finally this is used
> in brw_try_draw_prims() to help make sure that estimated_max_prim_size
> is a good value.

I don't like adding overhead to every batch operation.  You can just do
an assert like I did in 185b5a54c94ce11487146042c8eec24909187ed6
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965: Make the driver compile until a proper libdrm can be released.

2013-11-11 Thread Meng, Mengmeng
Hi Eric,
 Mesa complied error on 10.0 and it was fixed with this patch. Could you push 
this patch to Mesa 10.0?

Errors(git-035cce8):
brw_context.c: In function 'brwCreateContext':
brw_context.c:721:9: error: implicit declaration of function 
'drm_intel_get_reset_stats' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Thanks,
Meng

-Original Message-
From: mesa-dev-boun...@lists.freedesktop.org 
[mailto:mesa-dev-boun...@lists.freedesktop.org] On Behalf Of Eric Anholt
Sent: Saturday, November 09, 2013 2:50 AM
To: mesa-dev@lists.freedesktop.org
Subject: [Mesa-dev] [PATCH] i965: Make the driver compile until a proper libdrm 
can be released.

No depending on unreleased code.
---
 src/mesa/drivers/dri/i965/brw_context.c | 8 +++-
 src/mesa/drivers/dri/i965/brw_reset.c   | 7 +++
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c
index a33e993..bee98e3 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -714,12 +714,10 @@ brwCreateContext(gl_api api,
}
 
/* Notification of GPU resets requires hardware contexts and a kernel new
-* enough to support DRM_IOCTL_I915_GET_RESET_STATS.
+* enough to support DRM_IOCTL_I915_GET_RESET_STATS, which isn't upstream
+* yet.
 */
-   if (notify_reset &&
-   (brw->hw_ctx == NULL
-|| drm_intel_get_reset_stats(brw->hw_ctx, &brw->reset_count, NULL,
- NULL))) {
+   if (notify_reset) {
   /* This is the wrong error code, but the correct error code (one that
* will cause EGL to generate EGL_BAD_MATCH) doesn't seem to exist.
*/
diff --git a/src/mesa/drivers/dri/i965/brw_reset.c 
b/src/mesa/drivers/dri/i965/brw_reset.c
index 7eca1bc..e93b2e2 100644
--- a/src/mesa/drivers/dri/i965/brw_reset.c
+++ b/src/mesa/drivers/dri/i965/brw_reset.c
@@ -42,10 +42,17 @@ brw_get_graphics_reset_status(struct gl_context *ctx)
 */
assert(brw->hw_ctx != NULL);
 
+#if 0
+   /* This is waiting until the kernel code can be merged and a new libdrm
+* actually released.
+*/
err = drm_intel_get_reset_stats(brw->hw_ctx, &reset_count, &active,
&pending);
if (err)
   return GL_NO_ERROR;
+#else
+   return GL_NO_ERROR;
+#endif
 
/* A reset was observed while a batch from this context was executing.
 * Assume that this context was at fault.
-- 
1.8.4.rc3

___
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


[Mesa-dev] [PATCH] EGL: fix build without libdrm

2013-11-11 Thread Samuel Thibault
This fixes building EGL without libdrm support.

Signed-off-by: Samuel Thibault 
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index a64f4e8..e703f28 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -33,8 +33,10 @@
 #include 
 #include 
 #include 
+#ifdef HAVE_DRM_PLATFORM
 #include 
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -520,10 +522,12 @@ dri2_setup_screen(_EGLDisplay *disp)
  disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
  disp->Extensions.KHR_gl_texture_cubemap_image = EGL_TRUE;
   }
+#ifdef HAVE_DRM_PLATFORM
   if (dri2_dpy->image->base.version >= 8 &&
   dri2_dpy->image->createImageFromDmaBufs) {
  disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE;
   }
+#endif
}
 }
 
@@ -1158,6 +1162,7 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, 
_EGLContext *ctx,
return dri2_create_image(disp, dri_image);
 }
 
+#ifdef HAVE_DRM_PLATFORM
 static _EGLImage *
 dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
  EGLClientBuffer buffer, const EGLint 
*attr_list)
@@ -1202,6 +1207,7 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, 
_EGLContext *ctx,
 
return dri2_create_image(disp, dri_image);
 }
+#endif
 
 #ifdef HAVE_WAYLAND_PLATFORM
 
@@ -1375,6 +1381,7 @@ dri2_create_image_khr_texture(_EGLDisplay *disp, 
_EGLContext *ctx,
return &dri2_img->base;
 }
 
+#ifdef HAVE_DRM_PLATFORM
 static EGLBoolean
 dri2_check_dma_buf_attribs(const _EGLImageAttribs *attrs)
 {
@@ -1629,6 +1636,7 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext 
*ctx,
 
return res;
 }
+#endif
 
 _EGLImage *
 dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
@@ -1648,14 +1656,18 @@ dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay 
*disp,
   return dri2_create_image_khr_texture(disp, ctx, target, buffer, 
attr_list);
case EGL_GL_RENDERBUFFER_KHR:
   return dri2_create_image_khr_renderbuffer(disp, ctx, buffer, attr_list);
+#ifdef HAVE_DRM_PLATFORM
case EGL_DRM_BUFFER_MESA:
   return dri2_create_image_mesa_drm_buffer(disp, ctx, buffer, attr_list);
+#endif
 #ifdef HAVE_WAYLAND_PLATFORM
case EGL_WAYLAND_BUFFER_WL:
   return dri2_create_image_wayland_wl_buffer(disp, ctx, buffer, attr_list);
 #endif
+#ifdef HAVE_DRM_PLATFORM
case EGL_LINUX_DMA_BUF_EXT:
   return dri2_create_image_dma_buf(disp, ctx, buffer, attr_list);
+#endif
default:
   _eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
   return EGL_NO_IMAGE_KHR;
@@ -1676,6 +1688,7 @@ dri2_destroy_image_khr(_EGLDriver *drv, _EGLDisplay 
*disp, _EGLImage *image)
return EGL_TRUE;
 }
 
+#ifdef HAVE_DRM_PLATFORM
 static _EGLImage *
 dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
   const EGLint *attr_list)
@@ -1786,6 +1799,7 @@ dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay 
*disp, _EGLImage *img,
 
return EGL_TRUE;
 }
+#endif
 
 #ifdef HAVE_WAYLAND_PLATFORM
 
@@ -2020,8 +2034,10 @@ _eglBuiltInDriverDRI2(const char *args)
dri2_drv->base.API.ReleaseTexImage = dri2_release_tex_image;
dri2_drv->base.API.CreateImageKHR = dri2_create_image_khr;
dri2_drv->base.API.DestroyImageKHR = dri2_destroy_image_khr;
+#ifdef HAVE_DRM_PLATFORM
dri2_drv->base.API.CreateDRMImageMESA = dri2_create_drm_image_mesa;
dri2_drv->base.API.ExportDRMImageMESA = dri2_export_drm_image_mesa;
+#endif
 #ifdef HAVE_WAYLAND_PLATFORM
dri2_drv->base.API.BindWaylandDisplayWL = dri2_bind_wayland_display_wl;
dri2_drv->base.API.UnbindWaylandDisplayWL = dri2_unbind_wayland_display_wl;
diff --git a/src/egl/drivers/dri2/platform_x11.c 
b/src/egl/drivers/dri2/platform_x11.c
index a518db1..c56a413 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -33,7 +33,9 @@
 #include 
 #include 
 #include 
+#ifdef HAVE_DRM_PLATFORM
 #include 
+#endif
 #include 
 #include 
 
@@ -606,6 +608,7 @@ dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
 static EGLBoolean
 dri2_authenticate(_EGLDisplay *disp)
 {
+#ifdef HAVE_DRM_PLATFORM
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
drm_magic_t magic;
 
@@ -620,6 +623,9 @@ dri2_authenticate(_EGLDisplay *disp)
}
 
return EGL_TRUE;
+#else
+   return EGL_FALSE;
+#endif
 }
 
 static EGLBoolean
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 15/37] r300: move the final sources list to Makefile.sources

2013-11-11 Thread Emil Velikov
On 11/11/13 23:00, Tom Stellard wrote:
> On Sat, Nov 02, 2013 at 07:00:45PM +, Emil Velikov wrote:
>> Signed-off-by: Emil Velikov 
> 
> Can you make sure make check still works with this patch, if it does,
> then:
> 
make check for in-tree builds works like a charm.
But if I try an out-of tree things go crazy, due to the missing
compiler/tests/*test within the build folder.

> Reviewed-by: Tom Stellard 
Thanks
Emil
> 
>> ---
>>  src/gallium/drivers/r300/Makefile.am  | 13 ++---
>>  src/gallium/drivers/r300/Makefile.sources | 14 +-
>>  2 files changed, 15 insertions(+), 12 deletions(-)
>>
>> diff --git a/src/gallium/drivers/r300/Makefile.am 
>> b/src/gallium/drivers/r300/Makefile.am
>> index 524df24..4edeb47 100644
>> --- a/src/gallium/drivers/r300/Makefile.am
>> +++ b/src/gallium/drivers/r300/Makefile.am
>> @@ -3,7 +3,6 @@ include $(top_srcdir)/src/gallium/Automake.inc
>>  
>>  noinst_LTLIBRARIES = libr300.la libr300-helper.la
>>  check_PROGRAMS = r300_compiler_tests
>> -testdir = compiler/tests
>>  TESTS = r300_compiler_tests
>>  
>>  AM_CFLAGS = \
>> @@ -22,13 +21,7 @@ r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
>>  $(GALLIUM_DRI_LIB_DEPS)
>>  r300_compiler_tests_CPPFLAGS = \
>>  -I$(top_srcdir)/src/gallium/drivers/r300/compiler
>> -r300_compiler_tests_SOURCES = \
>> -$(testdir)/r300_compiler_tests.c \
>> -$(testdir)/radeon_compiler_optimize_tests.c \
>> -$(testdir)/radeon_compiler_regalloc_tests.c \
>> -$(testdir)/radeon_compiler_util_tests.c \
>> -$(testdir)/rc_test_helpers.c \
>> -$(testdir)/unit_test.c
>> +r300_compiler_tests_SOURCES = $(COMPILER_TESTS_SOURCES)
>>  
>>  libr300_la_SOURCES = $(C_SOURCES)
>>  
>> @@ -39,6 +32,4 @@ libr300_la_SOURCES = $(C_SOURCES)
>>  #
>>  # Solve this by building them into a separate helper library that can be 
>> linked
>>  # in place of libmesagallium.
>> -libr300_helper_la_SOURCES = \
>> -ralloc.c \
>> -register_allocate.c
>> +libr300_helper_la_SOURCES = $(HELPER_SOURCES)
>> diff --git a/src/gallium/drivers/r300/Makefile.sources 
>> b/src/gallium/drivers/r300/Makefile.sources
>> index 10ceffb..0e9ab52 100644
>> --- a/src/gallium/drivers/r300/Makefile.sources
>> +++ b/src/gallium/drivers/r300/Makefile.sources
>> @@ -1,4 +1,4 @@
>> -C_SOURCES = \
>> +C_SOURCES := \
>>  r300_blit.c \
>>  r300_chipset.c \
>>  r300_context.c \
>> @@ -57,3 +57,15 @@ C_SOURCES = \
>>  compiler/r3xx_vertprog.c \
>>  compiler/r3xx_vertprog_dump.c \
>>  compiler/memory_pool.c
>> +
>> +COMPILER_TESTS_SOURCES := \
>> +compiler/tests/r300_compiler_tests.c \
>> +compiler/tests/radeon_compiler_optimize_tests.c \
>> +compiler/tests/radeon_compiler_regalloc_tests.c \
>> +compiler/tests/radeon_compiler_util_tests.c \
>> +compiler/tests/rc_test_helpers.c \
>> +compiler/tests/unit_test.c
>> +
>> +HELPER_SOURCES := \
>> +ralloc.c \
>> +register_allocate.c
>> -- 
>> 1.8.4.2
>>
>> ___
>> 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


[Mesa-dev] [PATCH demos v2 1/3] Perf: Add command line capabilities to perf framework

2013-11-11 Thread Courtney Goeltzenleuchter
These were entirely interactive. Adding ability to pass in
command line arguments allows future tests to include
automated test capabilities.

Signed-off-by: Courtney Goeltzenleuchter 
---
 src/perf/copytex.c  | 2 +-
 src/perf/drawoverhead.c | 2 +-
 src/perf/fbobind.c  | 2 +-
 src/perf/fill.c | 2 +-
 src/perf/genmipmap.c| 2 +-
 src/perf/glmain.c   | 2 +-
 src/perf/glmain.h   | 2 +-
 src/perf/glslstateschange.c | 2 +-
 src/perf/readpixels.c   | 2 +-
 src/perf/swapbuffers.c  | 2 +-
 src/perf/teximage.c | 2 +-
 src/perf/vbo.c  | 2 +-
 src/perf/vertexrate.c   | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/perf/copytex.c b/src/perf/copytex.c
index f7a6b8a..376d699 100644
--- a/src/perf/copytex.c
+++ b/src/perf/copytex.c
@@ -57,7 +57,7 @@ static const struct vertex vertices[1] = {
 
 /** Called from test harness/main */
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
const GLenum filter = GL_LINEAR;
GLenum stat;
diff --git a/src/perf/drawoverhead.c b/src/perf/drawoverhead.c
index f75c9bb..06a815f 100644
--- a/src/perf/drawoverhead.c
+++ b/src/perf/drawoverhead.c
@@ -55,7 +55,7 @@ static const struct vertex vertices[4] = {
 
 /** Called from test harness/main */
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
/* setup VBO w/ vertex data */
glGenBuffersARB(1, &VBO);
diff --git a/src/perf/fbobind.c b/src/perf/fbobind.c
index fb52a93..4206294 100644
--- a/src/perf/fbobind.c
+++ b/src/perf/fbobind.c
@@ -56,7 +56,7 @@ static const struct vertex vertices[1] = {
 
 /** Called from test harness/main */
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
const GLenum filter = GL_LINEAR;
GLenum stat;
diff --git a/src/perf/fill.c b/src/perf/fill.c
index 279f2b5..70cb64b 100644
--- a/src/perf/fill.c
+++ b/src/perf/fill.c
@@ -120,7 +120,7 @@ static GLuint ShaderProg1, ShaderProg2;
 
 /** Called from test harness/main */
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
GLint u;
 
diff --git a/src/perf/genmipmap.c b/src/perf/genmipmap.c
index 20e2fa3..a37f7ab 100644
--- a/src/perf/genmipmap.c
+++ b/src/perf/genmipmap.c
@@ -52,7 +52,7 @@ static const struct vertex vertices[1] = {
 
 /** Called from test harness/main */
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
if (!PerfExtensionSupported("GL_ARB_framebuffer_object")) {
   printf("Sorry, this test requires GL_ARB_framebuffer_object\n");
diff --git a/src/perf/glmain.c b/src/perf/glmain.c
index 81c1173..3bc18ad 100644
--- a/src/perf/glmain.c
+++ b/src/perf/glmain.c
@@ -258,7 +258,7 @@ main(int argc, char *argv[])
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Draw);
glutIdleFunc(Idle);
-   PerfInit();
+   PerfInit(argc, argv);
glutMainLoop();
return 0;
 }
diff --git a/src/perf/glmain.h b/src/perf/glmain.h
index d9bcd5f..18cde08 100644
--- a/src/perf/glmain.h
+++ b/src/perf/glmain.h
@@ -56,7 +56,7 @@ PerfExtensionSupported(const char *ext);
 /** Test programs must implement these functions **/
 
 extern void
-PerfInit(void);
+PerfInit(int argc, char *argv[]);
 
 extern void
 PerfNextRound(void);
diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c
index 7422b78..83f8d6b 100644
--- a/src/perf/glslstateschange.c
+++ b/src/perf/glslstateschange.c
@@ -257,7 +257,7 @@ InitPrograms(void)
 }
 
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
if (!ShadersSupported())
   exit(1);
diff --git a/src/perf/readpixels.c b/src/perf/readpixels.c
index ac7dc42..1e777a6 100644
--- a/src/perf/readpixels.c
+++ b/src/perf/readpixels.c
@@ -51,7 +51,7 @@ static GLvoid *ReadBuffer;
 
 /** Called from test harness/main */
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
/* setup VBO */
glGenBuffersARB(1, &VBO);
diff --git a/src/perf/swapbuffers.c b/src/perf/swapbuffers.c
index 63c7fc0..24436f7 100644
--- a/src/perf/swapbuffers.c
+++ b/src/perf/swapbuffers.c
@@ -50,7 +50,7 @@ static const struct vertex vertices[4] = {
 
 /** Called from test harness/main */
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
/* setup VBO w/ vertex data */
glGenBuffersARB(1, &VBO);
diff --git a/src/perf/teximage.c b/src/perf/teximage.c
index a3005d0..88316f3 100644
--- a/src/perf/teximage.c
+++ b/src/perf/teximage.c
@@ -73,7 +73,7 @@ static const struct vertex vertices[1] = {
 
 /** Called from test harness/main */
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
/* setup VBO w/ vertex data */
glGenBuffersARB(1, &VBO);
diff --git a/src/perf/vbo.c b/src/perf/vbo.c
index b326c05..6a0d313 100644
--- a/src/perf/vbo.c
+++ b/src/perf/vbo.c
@@ -51,7 +51,7 @@ static const GLfloat Vertex0[2] = { 0.0, 0.0 };
 
 /** Called from test harness/main */
 void
-PerfInit(void)
+PerfInit(int argc, char *argv[])
 {
/* setup VBO */
glGenBuffersARB(1, &VBO);
diff --git a/src/perf/vertexrate.c b/src/perf/vertexrate.c
index b535552.

[Mesa-dev] [PATCH demos v2 2/3] perf: Update teximage to measure more formats

2013-11-11 Thread Courtney Goeltzenleuchter
Needed test to measure texture upload speed under a variety
of modes (mipmap, source format, internal format, size, etc.)
This new test has an interactive run mode like the other Mesa
Perf tests but also includes command line options to make
it automatable.
Fix up code formatting.
Integrate review feedback.

This provides a quick way to get feedback on texture upload
related performance tuning.
Texture image data is initialized and aligned to 64 byte bounary.
Uses Mesa demos Perf library to do the measurements.

Signed-off-by: Courtney Goeltzenleuchter 
---
 src/perf/teximage.c | 720 
 1 file changed, 563 insertions(+), 157 deletions(-)

diff --git a/src/perf/teximage.c b/src/perf/teximage.c
index 88316f3..3ab33a5 100644
--- a/src/perf/teximage.c
+++ b/src/perf/teximage.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
+ * Copyright (C) 2012-2013 LunarG, Inc.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -14,49 +15,64 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
  */
 
 /**
- * Measure glTex[Sub]Image2D() and glGetTexImage() rate
- *
- * Brian Paul
- * 16 Sep 2009
+ * Measure glTexImage2D() rate
+ *   enhanced from teximage.c by Brian Paul, 16 Sep 2009
+ *  2013 - Lisa Owens (lisa at lunarg.com)
+ *   - Courtney Goeltzenleuchter (courtney at lunarg.com)
  */
 
 #include "glmain.h"
 #include "common.h"
+#include 
+#include 
+#include 
 
+/**
+ * Align a value up to an alignment value
+ *
+ * If \c value is not already aligned to the requested alignment value, it
+ * will be rounded up.
+ *
+ * \param value  Value to be rounded
+ * \param alignment  Alignment value to be used.  This must be a power of two.
+ *
+ * \sa ROUND_DOWN_TO()
+ */
+#define ALIGN_PTR(value, alignment)  (((uintptr_t)(value) + (alignment) - 1) & 
~ (uintptr_t)((alignment) - 1))
 
 int WinWidth = 100, WinHeight = 100;
 
+/* for texture creation */
 static GLuint VBO;
 static GLuint TexObj = 0;
 static GLubyte *TexImage = NULL;
-static GLsizei TexSize;
-static GLenum TexIntFormat, TexSrcFormat, TexSrcType;
-
-static const GLboolean DrawPoint = GL_TRUE;
-static const GLboolean TexSubImage4 = GL_FALSE;
 
 enum {
-   MODE_CREATE_TEXIMAGE,
-   MODE_TEXIMAGE,
-   MODE_TEXSUBIMAGE,
-   MODE_GETTEXIMAGE,
-   MODE_COUNT
+   TEST_CREATE_TEXIMAGE,
+   TEST_TEXIMAGE,
+   TEST_TEXIMAGE_MIPMAP,
+   TEST_TEXSUBIMAGE,
+   TEST_GETTEXIMAGE,
+   TEST_COUNT
 };
 
-static const char *mode_name[MODE_COUNT] = 
-{
+static const char *test_name[TEST_COUNT] = {
"Create_TexImage",
"TexImage",
+   "TexImage_Mipmap",
"TexSubImage",
"GetTexImage"
 };
 
+GLboolean test_enable[TEST_COUNT];
 
 
 struct vertex
@@ -68,8 +84,322 @@ static const struct vertex vertices[1] = {
{ 0.0, 0.0, 0.5, 0.5 },
 };
 
+
+/** define some functions */
+GLenum parseType(char *);
+GLenum parseFormat(char *, int);
+GLuint determineTexelSize(GLenum format, GLenum type);
+void parseConfigFile(void);
+GLuint GenerateMipmapImages(void);
+
 #define VOFFSET(F) ((void *) offsetof(struct vertex, F))
 
+/** defaults; options can be provided to set these */
+GLint g_level = 0;
+GLsizei g_width = 256;
+GLsizei g_height = 256;
+GLuint g_texelsize = 4;
+GLenum g_texsrctype = GL_UNSIGNED_BYTE;
+GLenum g_texfmt = GL_RGBA;
+GLenum g_texintfmt = 0;
+GLboolean g_drawpoint = GL_TRUE;
+GLboolean g_subtexquad = GL_FALSE;
+char configName[2056];
+int formattype = 1;
+int intformattype = 2;
+char typeName[256] = "GL_UNSIGNED_BYTE";
+char formatName[256] = "GL_RGBA";
+char internalformatName[256] = "GL_RGBA";
+GLboolean g_verbose = GL_FALSE;
+
+/* used when mipmapping */
+static GLsizei g_initialwidth;
+static GLsizei g_initialheight;
+int g_numLevel = 0;
+GLubyte *g_mipmapimgs[64];
+GLsizei g_mmwidths[64];
+GLsizei g_mmheights[64];
+
+enum csvStyle {
+   CSV_STYLE_OFF,
+   CSV_STYLE_DATA,
+   CSV_STYLE_FULL
+};
+enum csvStyle g_csvstyle = CSV_STYLE_OFF;
+
+struct gl_parse_type {
+   char *name;
+   GLenum type;
+   bool fixed_size; /* true indicates texel size is component size */
+   int component_size;
+};
+
+struct gl_parse_type parse_type_table[] = {
+   {"GL_UNSIGNED_BYTE", GL_UNSIGNED_BYTE, false, 1},
+   {"GL_BYTE", GL_BYTE, false, 1},
+   {"GL_UNSIGNED_SHORT", GL_UNSIGNED_SHORT, false, 2},
+   {"GL_SHORT", GL_SHORT, false, 2},
+   {"GL_UNSIGNED_INT", GL_UNSIGNED_INT, false, 4},
+   {

Re: [Mesa-dev] [PATCH 14/37] r300: add symlink to ralloc.c and register_allocate.c

2013-11-11 Thread Emil Velikov
On 11/11/13 23:03, Tom Stellard wrote:
> On Sat, Nov 02, 2013 at 07:00:44PM +, Emil Velikov wrote:
>> Make automake's subdir-objects work.
>> Update includes.
>>
>> Signed-off-by: Emil Velikov 
>> ---
>>  src/gallium/drivers/r300/Makefile.am | 6 +++---
>>  src/gallium/drivers/r300/ralloc.c| 1 +
>>  src/gallium/drivers/r300/register_allocate.c | 1 +
>>  3 files changed, 5 insertions(+), 3 deletions(-)
>>  create mode 12 src/gallium/drivers/r300/ralloc.c
>>  create mode 12 src/gallium/drivers/r300/register_allocate.c
>>
>> diff --git a/src/gallium/drivers/r300/Makefile.am 
>> b/src/gallium/drivers/r300/Makefile.am
>> index 14aaf03..524df24 100644
>> --- a/src/gallium/drivers/r300/Makefile.am
>> +++ b/src/gallium/drivers/r300/Makefile.am
>> @@ -8,7 +8,7 @@ TESTS = r300_compiler_tests
>>  
>>  AM_CFLAGS = \
>>  -I$(top_srcdir)/src/gallium/drivers \
>> --I$(top_srcdir)/include \
>> +-I$(top_srcdir)/src/mesa/program \
>>  -I$(top_srcdir)/src/mesa \
>>  -I$(top_srcdir)/src/glsl \
>>  -I$(top_srcdir)/src/mapi \
>> @@ -40,5 +40,5 @@ libr300_la_SOURCES = $(C_SOURCES)
>>  # Solve this by building them into a separate helper library that can be 
>> linked
>>  # in place of libmesagallium.
>>  libr300_helper_la_SOURCES = \
>> -$(top_srcdir)/src/glsl/ralloc.c \
>> -$(top_srcdir)/src/mesa/program/register_allocate.c
>> +ralloc.c \
>> +register_allocate.c
>> diff --git a/src/gallium/drivers/r300/ralloc.c 
>> b/src/gallium/drivers/r300/ralloc.c
>> new file mode 12
>> index 000..c5402db
>> --- /dev/null
>> +++ b/src/gallium/drivers/r300/ralloc.c
>> @@ -0,0 +1 @@
>> +../../../glsl/ralloc.c
>> \ No newline at end of file
>> diff --git a/src/gallium/drivers/r300/register_allocate.c 
>> b/src/gallium/drivers/r300/register_allocate.c
>> new file mode 12
>> index 000..2117950
>> --- /dev/null
>> +++ b/src/gallium/drivers/r300/register_allocate.c
>> @@ -0,0 +1 @@
>> +../../../mesa/program/register_allocate.c
> 
> Will this still work with out-of-tree builds?
> 
Seems like it. Note that I can only build test this, but the compiler
test(s) seems to run fine.
> -Tom
> 
>> \ No newline at end of file
>> -- 
>> 1.8.4.2
>>
>> ___
>> 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


[Mesa-dev] [PATCH demos v2 3/3] perf: Add script to run collection of texture formats

2013-11-11 Thread Courtney Goeltzenleuchter
bench_teximage.sh runs all the same formats that teximage
ran. Also passes the command line arguments of the script
to the benchmark to allow tester to set --csvstyle to full
or data for output more easily parsed by scripts and such.

Signed-off-by: Courtney Goeltzenleuchter 
---
 src/perf/bench_teximage.sh | 44 
 1 file changed, 44 insertions(+)
 create mode 100755 src/perf/bench_teximage.sh

diff --git a/src/perf/bench_teximage.sh b/src/perf/bench_teximage.sh
new file mode 100755
index 000..29a2aa6
--- /dev/null
+++ b/src/perf/bench_teximage.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+./teximage --width 16 --height 16 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test Create_TexImage $@
+./teximage --width 64 --height 64 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test Create_TexImage $@
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test Create_TexImage $@
+./teximage --width 1024 --height 1024 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test Create_TexImage $@
+./teximage --width 4096 --height 4096 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test Create_TexImage $@
+echo ""
+./teximage --width 16 --height 16 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test TexImage $@
+./teximage --width 64 --height 64 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test TexImage $@
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test TexImage $@
+./teximage --width 1024 --height 1024 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test TexImage $@
+./teximage --width 4096 --height 4096 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test TexImage $@
+echo ""
+./teximage --width 16 --height 16 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test GetTexImage $@
+./teximage --width 64 --height 64 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test GetTexImage $@
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test GetTexImage $@
+./teximage --width 1024 --height 1024 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test GetTexImage $@
+./teximage --width 4096 --height 4096 --type GL_UNSIGNED_BYTE --format GL_RGBA 
--internalformat GL_RGBA --test GetTexImage $@
+echo ""
+# TexImage(RGB/ubyte 256 x 256): 3287.3 images/sec, 616.4 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format GL_RGB 
--internalformat GL_RGB --test TexImage $@
+#TexSubImage(RGB/ubyte 256 x 256): 3335.5 images/sec, 625.4 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format GL_RGB 
--internalformat GL_RGB --test TexSubImage $@
+#GetTexImage(RGB/ubyte 256 x 256): 1161.0 images/sec, 217.7 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format GL_RGB 
--internalformat GL_RGB --test GetTexImage $@
+#TexImage(RGB/565 256 x 256): 266.2 images/sec, 33.3 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_SHORT_5_6_5 --format 
GL_RGB --internalformat GL_RGB --test TexImage $@
+#TexSubImage(RGB/565 256 x 256): 264.6 images/sec, 33.1 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_SHORT_5_6_5 --format 
GL_RGB --internalformat GL_RGB --test TexSubImage $@
+#GetTexImage(RGB/565 256 x 256): 641.2 images/sec, 80.2 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_SHORT_5_6_5 --format 
GL_RGB --internalformat GL_RGB --test GetTexImage $@
+#TexImage(BGRA/ubyte 256 x 256): 8691.8 images/sec, 2172.9 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format GL_BGRA 
--internalformat GL_RGBA --test TexImage $@
+#TexSubImage(BGRA/ubyte 256 x 256): 8953.0 images/sec, 2238.3 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format GL_BGRA 
--internalformat GL_RGBA --test TexSubImage $@
+#GetTexImage(BGRA/ubyte 256 x 256): 11736.4 images/sec, 2934.1 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format GL_BGRA 
--internalformat GL_RGBA --test GetTexImage $@
+#TexImage(L/ubyte 256 x 256): 20898.0 images/sec, 1306.1 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format 
GL_LUMINANCE --internalformat GL_LUMINANCE --test TexImage $@
+#TexSubImage(L/ubyte 256 x 256): 21830.8 images/sec, 1364.4 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format 
GL_LUMINANCE --internalformat GL_LUMINANCE --test TexSubImage $@
+#GetTexImage(L/ubyte 256 x 256): 30453.5 images/sec, 1903.3 MB/sec
+./teximage --width 256 --height 256 --type GL_UNSIGNED_BYTE --format 
GL_LUMINANCE --internalformat GL_LUMINANCE --test GetTexImage $@
+
-- 
1.8.1.2

___
mesa-dev mailing list
mesa-dev@lists.freedes

[Mesa-dev] [PATCH demos v2 0/3] Customizable texture upload benchmark

2013-11-11 Thread Courtney Goeltzenleuchter
This patch series updates teximage to support additional
test modes and commandline interface.
I had started with adding a new test but it was similar to teximage
and, as suggested, I'm submitting this patch that simply
replaces teximage with this new test.
Can run interactively, similar to previous teximage test or can use
command line arguments to specify size of texture, mipmap or not,
source pixel format and internal pixel format.

Test includes [--csvstyle off | data | full] argument that
outputs the benchmark data in a more easily parsed manner
for test automation scripts.

The first patch adds command line argument passing to the perf
infrastructure.

One big commit to update teximage. Would have been similar
commit using other route (new test eventually replacing teximage.)

Add bash script to benchmark all the modes tested previously.

Courtney Goeltzenleuchter (3):
  Perf: Add command line capabilities to perf framework
  Perf: Add test to measure texture upload
  Perf: teximage_enh Add command line options

 src/perf/CMakeLists.txt|   1 +
 src/perf/Makefile.am   |   1 +
 src/perf/bench_glTexImage2D.sh |  73 +
 src/perf/copytex.c |   2 +-
 src/perf/drawoverhead.c|   2 +-
 src/perf/fbobind.c |   2 +-
 src/perf/fill.c|   2 +-
 src/perf/genmipmap.c   |   2 +-
 src/perf/glmain.c  |   2 +-
 src/perf/glmain.h  |   2 +-
 src/perf/glslstateschange.c|   2 +-
 src/perf/readpixels.c  |   2 +-
 src/perf/swapbuffers.c |   2 +-
 src/perf/teximage.c|   2 +-
 src/perf/teximage_enh.README   |  10 +
 src/perf/teximage_enh.c| 597 +
 src/perf/vbo.c |   2 +-
 src/perf/vertexrate.c  |   2 +-
 18 files changed, 695 insertions(+), 13 deletions(-)
 create mode 100755 src/perf/bench_glTexImage2D.sh
 create mode 100644 src/perf/teximage_enh.README
 create mode 100644 src/perf/teximage_enh.c

-- 
1.8.1.2

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


[Mesa-dev] [PATCH] dri: Remove redundant createNewContext function from __DRIimageDriverExtension

2013-11-11 Thread Kristian Høgsberg
createContextAttribs is a superset of what createNewContext provides.
Also remove the function typedef, since createNewContext is deprecated
and no longer used in  multiple interfaces.

Signed-off-by: Kristian Høgsberg 
---
 include/GL/internal/dri_interface.h| 12 
 src/mesa/drivers/dri/common/dri_util.c |  1 -
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/include/GL/internal/dri_interface.h 
b/include/GL/internal/dri_interface.h
index ed43257..b012570 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -783,12 +783,6 @@ typedef __DRIdrawable *
   void *loaderPrivate);
 
 typedef __DRIcontext *
-(*__DRIcreateNewContextFunc)(__DRIscreen *screen,
- const __DRIconfig *config,
- __DRIcontext *shared,
- void *loaderPrivate);
-
-typedef __DRIcontext *
 (*__DRIcreateContextAttribsFunc)(__DRIscreen *screen,
  int api,
  const __DRIconfig *config,
@@ -949,7 +943,10 @@ struct __DRIdri2ExtensionRec {
void *loaderPrivate);
 
__DRIcreateNewDrawableFunc   createNewDrawable;
-   __DRIcreateNewContextFunccreateNewContext;
+   __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
 
/* Since version 2 */
__DRIgetAPIMaskFunc  getAPIMask;
@@ -1405,7 +1402,6 @@ struct __DRIimageDriverExtensionRec {
/* Common DRI functions, shared with DRI2 */
__DRIcreateNewScreen2FunccreateNewScreen2;
__DRIcreateNewDrawableFunc   createNewDrawable;
-   __DRIcreateNewContextFunccreateNewContext;
__DRIcreateContextAttribsFunccreateContextAttribs;
__DRIgetAPIMaskFunc  getAPIMask;
 };
diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index a7328e4..27e1eb2 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -943,7 +943,6 @@ const __DRIimageDriverExtension driImageDriverExtension = {
 
 .createNewScreen2   = driCreateNewScreen2,
 .createNewDrawable  = driCreateNewDrawable,
-.createNewContext   = driCreateNewContext,
 .getAPIMask = driGetAPIMask,
 .createContextAttribs   = driCreateContextAttribs,
 };
-- 
1.8.3.1

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


Re: [Mesa-dev] [PATCH] clover: Remove dead file from Makefile.sources.

2013-11-11 Thread Emil Velikov
On 11/11/13 23:54, Matt Turner wrote:
Just stumbled on this a bit earlier. Seems line make dist has some
benefits. :)

Reviewed-by: Emil Velikov 
> ---
>  src/gallium/state_trackers/clover/Makefile.sources | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/gallium/state_trackers/clover/Makefile.sources 
> b/src/gallium/state_trackers/clover/Makefile.sources
> index 520f52f..42b3345 100644
> --- a/src/gallium/state_trackers/clover/Makefile.sources
> +++ b/src/gallium/state_trackers/clover/Makefile.sources
> @@ -13,7 +13,6 @@ CPP_SOURCES := \
>   core/object.hpp \
>   core/error.hpp \
>   core/compiler.hpp \
> - core/geometry.hpp \
>   core/device.hpp \
>   core/device.cpp \
>   core/context.hpp \
> 

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


Re: [Mesa-dev] [PATCH] clover: Remove dead file from Makefile.sources.

2013-11-11 Thread Tom Stellard
On Mon, Nov 11, 2013 at 03:54:48PM -0800, Matt Turner wrote:
> ---

Reviewed-by: Tom Stellard 

>  src/gallium/state_trackers/clover/Makefile.sources | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/gallium/state_trackers/clover/Makefile.sources 
> b/src/gallium/state_trackers/clover/Makefile.sources
> index 520f52f..42b3345 100644
> --- a/src/gallium/state_trackers/clover/Makefile.sources
> +++ b/src/gallium/state_trackers/clover/Makefile.sources
> @@ -13,7 +13,6 @@ CPP_SOURCES := \
>   core/object.hpp \
>   core/error.hpp \
>   core/compiler.hpp \
> - core/geometry.hpp \
>   core/device.hpp \
>   core/device.cpp \
>   core/context.hpp \
> -- 
> 1.8.3.2
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Petr Sebor

Not having push access rights, I hope this fix gets merged soon.
Hopefully a stable release candidate as well.

Thanks,
Petr

On 12.11.2013 00:32, Brian Paul wrote:

On 11/11/2013 04:19 PM, Petr Sebor wrote:
Otherwise, the function would enable generic vertex attributes 0 and 
1 of the
array object it does not own. This was causing crashes in Euro Truck 
Simulator 2,
since the incorrectly enabled generic attribute 0 in the foreign 
context got
precedence before vertex position attribute at later time, leading to 
NULL

pointer dereference.

Signed-off-by: Petr Sebor 


Reviewed-by: Brian Paul 

___
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


[Mesa-dev] [PATCH] clover: Remove dead file from Makefile.sources.

2013-11-11 Thread Matt Turner
---
 src/gallium/state_trackers/clover/Makefile.sources | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/Makefile.sources 
b/src/gallium/state_trackers/clover/Makefile.sources
index 520f52f..42b3345 100644
--- a/src/gallium/state_trackers/clover/Makefile.sources
+++ b/src/gallium/state_trackers/clover/Makefile.sources
@@ -13,7 +13,6 @@ CPP_SOURCES := \
core/object.hpp \
core/error.hpp \
core/compiler.hpp \
-   core/geometry.hpp \
core/device.hpp \
core/device.cpp \
core/context.hpp \
-- 
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 3/3] radeon/llvm: Free elf_buffer after use

2013-11-11 Thread Tom Stellard
On Thu, Nov 07, 2013 at 06:08:16PM -0600, Aaron Watry wrote:
> Prevents a memory leak.
> ---
>  src/gallium/drivers/radeon/radeon_llvm_emit.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c 
> b/src/gallium/drivers/radeon/radeon_llvm_emit.c
> index d2e5642..e35c212 100644
> --- a/src/gallium/drivers/radeon/radeon_llvm_emit.c
> +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c
> @@ -176,6 +176,9 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct 
> radeon_llvm_binary *binary,
>   if (elf){
>   elf_end(elf);
>   }
> + if (elf_buffer){
> + FREE(elf_buffer);
> + }

We don't need the NULL check here either.

-Tom

>   LLVMDisposeMemoryBuffer(out_buffer);
>   LLVMDisposeTargetMachine(tm);
>   return 0;
> -- 
> 1.8.3.2
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/3] r600/llvm: initialize radeon_llvm_binary

2013-11-11 Thread Tom Stellard
On Thu, Nov 07, 2013 at 06:08:14PM -0600, Aaron Watry wrote:
> use memset to initialize to 0's... otherwise code_size and config_size could 
> be uninitialized when read later in this method. It's also hard to do NULL 
> checks on uninitialized pointers.
> ---
>  src/gallium/drivers/r600/r600_llvm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/gallium/drivers/r600/r600_llvm.c 
> b/src/gallium/drivers/r600/r600_llvm.c
> index 5afe3cb..f52ae84 100644
> --- a/src/gallium/drivers/r600/r600_llvm.c
> +++ b/src/gallium/drivers/r600/r600_llvm.c
> @@ -712,6 +712,7 @@ unsigned r600_llvm_compile(
>   const char * gpu_family = r600_llvm_gpu_string(family);
>   unsigned i;
>  
> +memset(&binary, 0, sizeof(struct radeon_llvm_binary));

The indentation looks wrong here, otherwise this patch is:

Reviewed-by: Tom Stellard 

>   r = radeon_llvm_compile(mod, &binary, gpu_family, dump);
>  
>   assert(binary.code_size % 4 == 0);
> -- 
> 1.8.3.2
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/3] r600/llvm: Free binary.code/binary.config in r600_llvm_compile

2013-11-11 Thread Tom Stellard
On Thu, Nov 07, 2013 at 06:08:15PM -0600, Aaron Watry wrote:
> radeon_llvm_compile allocates memory for binary.code, binary.config, or 
> neither depending on
> what's being done.
> 
> We need to make sure to free that memory after it's no longer needed.
> ---
>  src/gallium/drivers/r600/r600_llvm.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/gallium/drivers/r600/r600_llvm.c 
> b/src/gallium/drivers/r600/r600_llvm.c
> index f52ae84..084ba2a 100644
> --- a/src/gallium/drivers/r600/r600_llvm.c
> +++ b/src/gallium/drivers/r600/r600_llvm.c
> @@ -745,6 +745,13 @@ unsigned r600_llvm_compile(
>   }
>   }
>  
> + if (binary.code){
> + FREE(binary.code);
> + }
> + if (binary.config){
> + FREE(binary.config);
> + }
> +

You don't need to check for NULL here.   FREE accepts NULL pointers.

-Tom

>   return r;
>  }
>  
> -- 
> 1.8.3.2
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Ian Romanick
On 11/11/2013 03:19 PM, Petr Sebor wrote:
> Otherwise, the function would enable generic vertex attributes 0 and 1 of the
> array object it does not own. This was causing crashes in Euro Truck 
> Simulator 2,
> since the incorrectly enabled generic attribute 0 in the foreign context got
> precedence before vertex position attribute at later time, leading to NULL
> pointer dereference.
> 
> Signed-off-by: Petr Sebor 

Looks good to me.

Reviewed-by: Ian Romanick 

> ---
> This version is really much better for the reasons both you and Ian mentioned.
> And... works for me! Thanks!
> 
> Petr
> ---
>  src/mesa/drivers/common/meta.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
> index f818416..3be 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -1515,6 +1515,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
> sizeof(struct vertex), OFFSET(x));
>_mesa_VertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE,
> sizeof(struct vertex), OFFSET(s));
> +
> +  _mesa_EnableVertexAttribArray(0);
> +  _mesa_EnableVertexAttribArray(1);
> }
>  
> /* Generate a relevant fragment shader program for the texture target */
> @@ -1591,8 +1594,6 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
> _mesa_DeleteObjectARB(vs);
> _mesa_BindAttribLocation(ShaderProg, 0, "position");
> _mesa_BindAttribLocation(ShaderProg, 1, "texcoords");
> -   _mesa_EnableVertexAttribArray(0);
> -   _mesa_EnableVertexAttribArray(1);
> link_program_with_debug(ctx, ShaderProg);
> ralloc_free(mem_ctx);
> if (texture_2d)
> 

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


Re: [Mesa-dev] [PATCH 1/3] dri: Add helpers for implementing allocBuffer/releaseBuffer with __DRIimage

2013-11-11 Thread Chad Versace

On 11/11/2013 02:20 PM, Kristian Høgsberg wrote:

On Mon, Nov 11, 2013 at 1:57 PM, Chad Versace
 wrote:

On 11/11/2013 01:22 PM, Kristian Høgsberg wrote:


Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension.

For the intel dri driver, this consolidates window system color buffer
allocation in intel_create_image().

Signed-off-by: Kristian Høgsberg 
---
   src/mesa/drivers/dri/common/dri_util.c   | 75

   src/mesa/drivers/dri/common/dri_util.h   | 10 +
   src/mesa/drivers/dri/i915/intel_screen.c | 56 +---
   src/mesa/drivers/dri/i965/intel_screen.c | 55 +--
   4 files changed, 89 insertions(+), 107 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c
b/src/mesa/drivers/dri/common/dri_util.c
index 86cf24c..a7328e4 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c





+__DRIbuffer *
+driAllocateBuffer(__DRIscreen *screen,
+  unsigned attachment, unsigned format,
+  int width, int height)
+{
+   struct dri_image_buffer *buffer;
+   __DRIimageExtension *image = screen->image_extension;
+   int dri_format, name, stride;
+
+   assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
+  attachment == __DRI_BUFFER_BACK_LEFT);
+
+   /* We just need a __DRI_IMAGE_FORMAT code that has a cpp that matches
+* format / 8.  The image format code is stored in the __DRIimage, but
the
+* __DRIbuffer we create from the image, only stores the cpp. */
+
+   switch (format) {
+   case 32:
+  dri_format = __DRI_IMAGE_FORMAT_XRGB;
+  break;
+   case 16:
+  dri_format = __DRI_IMAGE_FORMAT_RGB565;
+  break;
+   default:
+  return NULL;
+   }
+
+   buffer = calloc(1, sizeof *buffer);
+   if (buffer == NULL)
+  return NULL;
+
+   buffer->image = image->createImage(screen,
+  width, height, dri_format,
+  __DRI_IMAGE_USE_SHARE |
+  __DRI_IMAGE_USE_SCANOUT,
+  buffer);



It's incorrect to specify __DRI_IMAGE_USE_SCANOUT regardless of
attachment type. GBM, Wayland, and Android use driAllocateBuffer
to allocate more than just the scanout buffer. They use it to
allocate auxillary buffers too. If i965 were to respect the
caching restrictions implied by __DRI_IMAGE_USE_SCANOUT, its
use for aux buffers would hurt performance. (As far as I can
tell, though, intel_create_image() wrongly ignores __DRI_IMAGE_USE_SCANOUT).

Instead, I think you should set the USE_SCANOUT bit if and only if
attachment is one of __DRI_BUFFER_(BACK|FRONT)_(LEFT|RIGHT).


The commit message says:

"Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension."

which is true for the Intel DRI driver.  The DRI2 interface allows the
driver to ask for auxillary buffers, but since we stopped supporting
multiple processes rendering to the same X window, our driver no
longer does that.  This is under driver control and thus if a driver
knows it will never ask for aux buffers, it can use these helpers.

Kristian


Ah, thanks for correcting me. I also solved the questions I had regarding
patch 3, so this series is
Reviewed-by: Chad Versace 

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


Re: [Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Brian Paul

On 11/11/2013 04:19 PM, Petr Sebor wrote:

Otherwise, the function would enable generic vertex attributes 0 and 1 of the
array object it does not own. This was causing crashes in Euro Truck Simulator 
2,
since the incorrectly enabled generic attribute 0 in the foreign context got
precedence before vertex position attribute at later time, leading to NULL
pointer dereference.

Signed-off-by: Petr Sebor 


Reviewed-by: Brian Paul 

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


[Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Petr Sebor
Otherwise, the function would enable generic vertex attributes 0 and 1 of the
array object it does not own. This was causing crashes in Euro Truck Simulator 
2,
since the incorrectly enabled generic attribute 0 in the foreign context got
precedence before vertex position attribute at later time, leading to NULL
pointer dereference.

Signed-off-by: Petr Sebor 
---
This version is really much better for the reasons both you and Ian mentioned.
And... works for me! Thanks!

Petr
---
 src/mesa/drivers/common/meta.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index f818416..3be 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1515,6 +1515,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
sizeof(struct vertex), OFFSET(x));
   _mesa_VertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE,
sizeof(struct vertex), OFFSET(s));
+
+  _mesa_EnableVertexAttribArray(0);
+  _mesa_EnableVertexAttribArray(1);
}
 
/* Generate a relevant fragment shader program for the texture target */
@@ -1591,8 +1594,6 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
_mesa_DeleteObjectARB(vs);
_mesa_BindAttribLocation(ShaderProg, 0, "position");
_mesa_BindAttribLocation(ShaderProg, 1, "texcoords");
-   _mesa_EnableVertexAttribArray(0);
-   _mesa_EnableVertexAttribArray(1);
link_program_with_debug(ctx, ShaderProg);
ralloc_free(mem_ctx);
if (texture_2d)
-- 
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: Link test program with -ldl.

2013-11-11 Thread Matt Turner
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71512
---
 src/mesa/drivers/dri/i965/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/Makefile.am 
b/src/mesa/drivers/dri/i965/Makefile.am
index 8c0f9a3..6bce3c1 100644
--- a/src/mesa/drivers/dri/i965/Makefile.am
+++ b/src/mesa/drivers/dri/i965/Makefile.am
@@ -48,6 +48,7 @@ TEST_LIBS = \
../common/libmegadriver_stub.la \
$(DRI_LIB_DEPS) \
 ../../../libmesa.la \
+   $(DLOPEN_LIBS) \
 -lrt \
../common/libdri_test_stubs.la
 
-- 
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 14/37] r300: add symlink to ralloc.c and register_allocate.c

2013-11-11 Thread Tom Stellard
On Sat, Nov 02, 2013 at 07:00:44PM +, Emil Velikov wrote:
> Make automake's subdir-objects work.
> Update includes.
> 
> Signed-off-by: Emil Velikov 
> ---
>  src/gallium/drivers/r300/Makefile.am | 6 +++---
>  src/gallium/drivers/r300/ralloc.c| 1 +
>  src/gallium/drivers/r300/register_allocate.c | 1 +
>  3 files changed, 5 insertions(+), 3 deletions(-)
>  create mode 12 src/gallium/drivers/r300/ralloc.c
>  create mode 12 src/gallium/drivers/r300/register_allocate.c
> 
> diff --git a/src/gallium/drivers/r300/Makefile.am 
> b/src/gallium/drivers/r300/Makefile.am
> index 14aaf03..524df24 100644
> --- a/src/gallium/drivers/r300/Makefile.am
> +++ b/src/gallium/drivers/r300/Makefile.am
> @@ -8,7 +8,7 @@ TESTS = r300_compiler_tests
>  
>  AM_CFLAGS = \
>   -I$(top_srcdir)/src/gallium/drivers \
> - -I$(top_srcdir)/include \
> + -I$(top_srcdir)/src/mesa/program \
>   -I$(top_srcdir)/src/mesa \
>   -I$(top_srcdir)/src/glsl \
>   -I$(top_srcdir)/src/mapi \
> @@ -40,5 +40,5 @@ libr300_la_SOURCES = $(C_SOURCES)
>  # Solve this by building them into a separate helper library that can be 
> linked
>  # in place of libmesagallium.
>  libr300_helper_la_SOURCES = \
> - $(top_srcdir)/src/glsl/ralloc.c \
> - $(top_srcdir)/src/mesa/program/register_allocate.c
> + ralloc.c \
> + register_allocate.c
> diff --git a/src/gallium/drivers/r300/ralloc.c 
> b/src/gallium/drivers/r300/ralloc.c
> new file mode 12
> index 000..c5402db
> --- /dev/null
> +++ b/src/gallium/drivers/r300/ralloc.c
> @@ -0,0 +1 @@
> +../../../glsl/ralloc.c
> \ No newline at end of file
> diff --git a/src/gallium/drivers/r300/register_allocate.c 
> b/src/gallium/drivers/r300/register_allocate.c
> new file mode 12
> index 000..2117950
> --- /dev/null
> +++ b/src/gallium/drivers/r300/register_allocate.c
> @@ -0,0 +1 @@
> +../../../mesa/program/register_allocate.c

Will this still work with out-of-tree builds?

-Tom

> \ No newline at end of file
> -- 
> 1.8.4.2
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 15/37] r300: move the final sources list to Makefile.sources

2013-11-11 Thread Tom Stellard
On Sat, Nov 02, 2013 at 07:00:45PM +, Emil Velikov wrote:
> Signed-off-by: Emil Velikov 

Can you make sure make check still works with this patch, if it does,
then:

Reviewed-by: Tom Stellard 

> ---
>  src/gallium/drivers/r300/Makefile.am  | 13 ++---
>  src/gallium/drivers/r300/Makefile.sources | 14 +-
>  2 files changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/src/gallium/drivers/r300/Makefile.am 
> b/src/gallium/drivers/r300/Makefile.am
> index 524df24..4edeb47 100644
> --- a/src/gallium/drivers/r300/Makefile.am
> +++ b/src/gallium/drivers/r300/Makefile.am
> @@ -3,7 +3,6 @@ include $(top_srcdir)/src/gallium/Automake.inc
>  
>  noinst_LTLIBRARIES = libr300.la libr300-helper.la
>  check_PROGRAMS = r300_compiler_tests
> -testdir = compiler/tests
>  TESTS = r300_compiler_tests
>  
>  AM_CFLAGS = \
> @@ -22,13 +21,7 @@ r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
>   $(GALLIUM_DRI_LIB_DEPS)
>  r300_compiler_tests_CPPFLAGS = \
>   -I$(top_srcdir)/src/gallium/drivers/r300/compiler
> -r300_compiler_tests_SOURCES = \
> - $(testdir)/r300_compiler_tests.c \
> - $(testdir)/radeon_compiler_optimize_tests.c \
> - $(testdir)/radeon_compiler_regalloc_tests.c \
> - $(testdir)/radeon_compiler_util_tests.c \
> - $(testdir)/rc_test_helpers.c \
> - $(testdir)/unit_test.c
> +r300_compiler_tests_SOURCES = $(COMPILER_TESTS_SOURCES)
>  
>  libr300_la_SOURCES = $(C_SOURCES)
>  
> @@ -39,6 +32,4 @@ libr300_la_SOURCES = $(C_SOURCES)
>  #
>  # Solve this by building them into a separate helper library that can be 
> linked
>  # in place of libmesagallium.
> -libr300_helper_la_SOURCES = \
> - ralloc.c \
> - register_allocate.c
> +libr300_helper_la_SOURCES = $(HELPER_SOURCES)
> diff --git a/src/gallium/drivers/r300/Makefile.sources 
> b/src/gallium/drivers/r300/Makefile.sources
> index 10ceffb..0e9ab52 100644
> --- a/src/gallium/drivers/r300/Makefile.sources
> +++ b/src/gallium/drivers/r300/Makefile.sources
> @@ -1,4 +1,4 @@
> -C_SOURCES = \
> +C_SOURCES := \
>   r300_blit.c \
>   r300_chipset.c \
>   r300_context.c \
> @@ -57,3 +57,15 @@ C_SOURCES = \
>   compiler/r3xx_vertprog.c \
>   compiler/r3xx_vertprog_dump.c \
>   compiler/memory_pool.c
> +
> +COMPILER_TESTS_SOURCES := \
> + compiler/tests/r300_compiler_tests.c \
> + compiler/tests/radeon_compiler_optimize_tests.c \
> + compiler/tests/radeon_compiler_regalloc_tests.c \
> + compiler/tests/radeon_compiler_util_tests.c \
> + compiler/tests/rc_test_helpers.c \
> + compiler/tests/unit_test.c
> +
> +HELPER_SOURCES := \
> + ralloc.c \
> + register_allocate.c
> -- 
> 1.8.4.2
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 07/27] gtest: enable subdir-objects to prevent automake warnings

2013-11-11 Thread Matt Turner
On Mon, Nov 11, 2013 at 10:53 AM, Emil Velikov  wrote:
> Signed-off-by: Emil Velikov 
> ---
>  src/gtest/Makefile.am | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/gtest/Makefile.am b/src/gtest/Makefile.am
> index 4188c6b..23ea749 100644
> --- a/src/gtest/Makefile.am
> +++ b/src/gtest/Makefile.am
> @@ -18,6 +18,7 @@
>  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> DEALINGS
>  # IN THE SOFTWARE.
> +AUTOMAKE_OPTIONS = subdir-objects

Put a newline before AUTOMAKE_OPTIONS.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 61364] LLVM assertion when starting X11

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

--- Comment #10 from Tom Stellard  ---
This should be fixed now in mesa master when linking with llvm static
libraries.  Can you re-test?

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


Re: [Mesa-dev] [PATCH 3/3] i965/fs: Try a different pre-scheduling heuristic if the first spills.

2013-11-11 Thread Matt Turner
On Wed, Nov 6, 2013 at 6:47 PM, Eric Anholt  wrote:
> Since LIFO fails on some shaders in one particular way, and non-LIFO
> systematically fails in another way on different kinds of shaders, try
> them both. and pick whichever one successfully register allocates first.
> Slightly prefer non-LIFO in case we produce extra dependencies in register
> allocation, since it should start out with fewer stalls than LIFO.
>
> This is madness, but I haven't come up with another way to get unigine
> tropics to not spill while keeping other programs from not spilling and
> retaining the non-unigine performance wins from texture-grf.
>
> total instructions in shared programs: 1626728 -> 1626288 (-0.03%)
> instructions in affected programs: 1015 -> 575 (-43.35%)
> GAINED:50
> LOST:  0
> ---

And these three are

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

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

--- Comment #8 from Armin K  ---
Even to be more precise, (manually) reverting this commit fixes the issue, at
least here:

http://cgit.freedesktop.org/mesa/mesa/commit/?id=0cce5538673148ffcd7aa9479f6b88cf9a641352

Reproducible with GCC 4.8.2 and Binutils 2.23.2.

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


Re: [Mesa-dev] [PATCH] i965/fs: Fix message setup for SIMD8 spills.

2013-11-11 Thread Paul Berry
On 5 November 2013 16:21, Eric Anholt  wrote:

> In the SIMD16 spilling changes, I replaced a "1" in the spill path with
> "mlen", but obviously it wasn't mlen before because spills have the g0
> header along with the payload. The interface I was trying to use was
> asking for how many physical regs we're writing, so we're looking for "1"
> or "2".
>
> I'm guessing this actually passed piglit because the high 8 bits of the
> execution mask in SIMD8 mode are all 0s.
>

Reviewed-by: Paul Berry 


> ---
>  src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> index 63ac530..83917f5 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> @@ -757,7 +757,7 @@ fs_generator::generate_scratch_write(fs_inst *inst,
> struct brw_reg src)
>retype(brw_message_reg(inst->base_mrf + 1),
> BRW_REGISTER_TYPE_UD),
>retype(src, BRW_REGISTER_TYPE_UD));
> brw_oword_block_write_scratch(p, brw_message_reg(inst->base_mrf),
> - inst->mlen, inst->offset);
> + dispatch_width / 8, inst->offset);
>  }
>
>  void
> --
> 1.8.4.rc3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/3] i965: Add a warning if something ever hits a bug I noticed.

2013-11-11 Thread Matt Turner
On Tue, Nov 5, 2013 at 5:35 PM, Eric Anholt  wrote:
> We'd have to map the VBO and rewrite things to a lower stride to fix it.
> ---

These three are

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

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

--- Comment #7 from Armin K  ---
If you revert changes to Makefile.am made by these two commits, test builds and
passess fine:

http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c5330226f391a7a29b6538851090b0ef730a239

http://cgit.freedesktop.org/mesa/mesa/commit/?id=0cce5538673148ffcd7aa9479f6b88cf9a641352

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


Re: [Mesa-dev] [PATCH 2/4] i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB

2013-11-11 Thread Daniel Vetter
On Mon, Nov 11, 2013 at 01:45:43PM -0800, Ian Romanick wrote:
> On 11/11/2013 01:35 PM, Daniel Vetter wrote:
> > On Mon, Nov 11, 2013 at 11:19:07AM -0800, Ian Romanick wrote:
> >> From: Ian Romanick 
> >>
> >> Systems with little physical memory installed will report less than
> >> 2GiB, and some systems may (hypothetically?) have a larger address space
> >> for the GPU.  My IVB still reports 1534.
> >>
> >> Signed-off-by: Ian Romanick 
> >> Cc: Daniel Vetter 
> >> Cc: "10.0" 
> >> ---
> >>  src/mesa/drivers/dri/i965/intel_screen.c | 10 +++---
> >>  1 file changed, 7 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
> >> b/src/mesa/drivers/dri/i965/intel_screen.c
> >> index e39d654..592150b 100644
> >> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> >> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> >> @@ -823,10 +823,14 @@ brw_query_renderer_integer(__DRIscreen *psp, int 
> >> param, int *value)
> >>/* Once a batch uses more than 75% of the maximum mappable size, we
> >> * assume that there's some fragmentation, and we start doing extra
> >> * flushing, etc.  That's the big cliff apps will care about.
> >> -   *
> >> -   * Can only map 2G onto the GPU through the GTT.
> >> */
> >> -  const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
> >> +  size_t aper_size;
> >> +  size_t mappable_size;
> >> +
> >> +  drm_intel_get_aperture_sizes(psp->fd, &mappable_size, &aper_size);
> > 
> > Hm, I haven't seen the (presumably) libdrm patch that adds this yet float
> > by, but you really want to match the uint64_t libdrm uses internally for
> > gtt_size here ... ;-)
> > 
> > With that fixed both patches are
> > Reviewed-by: Daniel Vetter 
> > I'll look at the wrapper as soon as it hits my inbox.
> 
> Eh... drm_intel_get_aperture_sizes has been around for almost 2.5 years.
> 
> commit 9d77603d8b95aee4f2408e437c55af15ee05b608
> Author: Chris Wilson 
> AuthorDate: Sat Jun 4 12:47:19 2011 +0100
> Commit: Chris Wilson 
> CommitDate: Sat Jun 4 13:01:11 2011 +0100
> 
> intel: Add interface to query aperture sizes.
> 
> Signed-off-by: Chris Wilson 

Oops, indeed. I seem to be blind.

> Should I submit a libdrm patch to change it's interface from size_t to
> uint64_t?

Would be an abi break I think (at least on 32 bit), so not worth the
trouble. I'll scowl a bit at Chris for failing to predict the future and
add it to the list of things to fix for bdw. Patches are r-b as is.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/3] dri: Add helpers for implementing allocBuffer/releaseBuffer with __DRIimage

2013-11-11 Thread Kristian Høgsberg
On Mon, Nov 11, 2013 at 1:57 PM, Chad Versace
 wrote:
> On 11/11/2013 01:22 PM, Kristian Høgsberg wrote:
>>
>> Drivers that only call getBuffers to request color buffers can use these
>> generic, __DRIimage based helpers to implement the allocBuffer and
>> releaseBuffer functions of __DRIdri2Extension.
>>
>> For the intel dri driver, this consolidates window system color buffer
>> allocation in intel_create_image().
>>
>> Signed-off-by: Kristian Høgsberg 
>> ---
>>   src/mesa/drivers/dri/common/dri_util.c   | 75
>> 
>>   src/mesa/drivers/dri/common/dri_util.h   | 10 +
>>   src/mesa/drivers/dri/i915/intel_screen.c | 56 +---
>>   src/mesa/drivers/dri/i965/intel_screen.c | 55 +--
>>   4 files changed, 89 insertions(+), 107 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/common/dri_util.c
>> b/src/mesa/drivers/dri/common/dri_util.c
>> index 86cf24c..a7328e4 100644
>> --- a/src/mesa/drivers/dri/common/dri_util.c
>> +++ b/src/mesa/drivers/dri/common/dri_util.c
>
>
>
>> +__DRIbuffer *
>> +driAllocateBuffer(__DRIscreen *screen,
>> +  unsigned attachment, unsigned format,
>> +  int width, int height)
>> +{
>> +   struct dri_image_buffer *buffer;
>> +   __DRIimageExtension *image = screen->image_extension;
>> +   int dri_format, name, stride;
>> +
>> +   assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
>> +  attachment == __DRI_BUFFER_BACK_LEFT);
>> +
>> +   /* We just need a __DRI_IMAGE_FORMAT code that has a cpp that matches
>> +* format / 8.  The image format code is stored in the __DRIimage, but
>> the
>> +* __DRIbuffer we create from the image, only stores the cpp. */
>> +
>> +   switch (format) {
>> +   case 32:
>> +  dri_format = __DRI_IMAGE_FORMAT_XRGB;
>> +  break;
>> +   case 16:
>> +  dri_format = __DRI_IMAGE_FORMAT_RGB565;
>> +  break;
>> +   default:
>> +  return NULL;
>> +   }
>> +
>> +   buffer = calloc(1, sizeof *buffer);
>> +   if (buffer == NULL)
>> +  return NULL;
>> +
>> +   buffer->image = image->createImage(screen,
>> +  width, height, dri_format,
>> +  __DRI_IMAGE_USE_SHARE |
>> +  __DRI_IMAGE_USE_SCANOUT,
>> +  buffer);
>
>
> It's incorrect to specify __DRI_IMAGE_USE_SCANOUT regardless of
> attachment type. GBM, Wayland, and Android use driAllocateBuffer
> to allocate more than just the scanout buffer. They use it to
> allocate auxillary buffers too. If i965 were to respect the
> caching restrictions implied by __DRI_IMAGE_USE_SCANOUT, its
> use for aux buffers would hurt performance. (As far as I can
> tell, though, intel_create_image() wrongly ignores __DRI_IMAGE_USE_SCANOUT).
>
> Instead, I think you should set the USE_SCANOUT bit if and only if
> attachment is one of __DRI_BUFFER_(BACK|FRONT)_(LEFT|RIGHT).

The commit message says:

"Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension."

which is true for the Intel DRI driver.  The DRI2 interface allows the
driver to ask for auxillary buffers, but since we stopped supporting
multiple processes rendering to the same X window, our driver no
longer does that.  This is under driver control and thus if a driver
knows it will never ask for aux buffers, it can use these helpers.

Kristian
>
>> +
>> +   if (buffer->image == NULL) {
>> +  free(buffer);
>> +  return NULL;
>> +   }
>> +
>> +   image->queryImage(buffer->image, __DRI_IMAGE_ATTRIB_NAME, &name);
>> +   image->queryImage(buffer->image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
>> +
>> +   buffer->base.attachment = attachment;
>> +   buffer->base.name = name;
>> +   buffer->base.pitch = stride;
>> +   buffer->base.cpp = format / 8;
>> +
>> +   return &buffer->base;
>> +}
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] tests: Fix make check for out of tree builds.

2013-11-11 Thread Matt Turner
On Mon, Nov 11, 2013 at 12:18 PM, Rico Schüller  wrote:
> Signed-off-by: Rico Schüller 
> ---
>  src/mapi/shared-glapi/tests/Makefile.am | 1 +
>  src/mesa/main/tests/Makefile.am | 1 +
>  2 Dateien geändert, 2 Zeilen hinzugefügt(+)
>
> diff --git a/src/mapi/shared-glapi/tests/Makefile.am 
> b/src/mapi/shared-glapi/tests/Makefile.am
> index 98065fc..7e71b4f 100644
> --- a/src/mapi/shared-glapi/tests/Makefile.am
> +++ b/src/mapi/shared-glapi/tests/Makefile.am
> @@ -3,6 +3,7 @@ AM_CFLAGS = $(PTHREAD_CFLAGS)
>  AM_CPPFLAGS = \
> -I$(top_srcdir)/src/gtest/include \
> -I$(top_srcdir)/src/mapi \
> +   -I$(top_builddir)/src/mapi \
> -I$(top_srcdir)/include
>
>  TESTS = shared-glapi-test
> diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am
> index 97713f2..0d3a51f 100644
> --- a/src/mesa/main/tests/Makefile.am
> +++ b/src/mesa/main/tests/Makefile.am
> @@ -7,6 +7,7 @@ AM_CPPFLAGS = \
> -I$(top_srcdir)/src/gtest/include \
> -I$(top_srcdir)/src/mapi \
> -I$(top_srcdir)/src/mesa \
> +   -I$(top_builddir)/src/mesa \
> -I$(top_srcdir)/include \
> $(DEFINES) $(INCLUDE_DIRS)
>
> --
> 1.7.11.7

Thanks! Reviewed-by and committed.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2 v3] i965: add XRGB to tiled_memcpy

2013-11-11 Thread Matt Turner
On Mon, Nov 11, 2013 at 1:19 PM, Chad Versace
 wrote:
> On 11/07/2013 01:59 PM, Courtney Goeltzenleuchter wrote:
>>
>> MESA_FORMAT_XRGB is equivalent to MESA_FORMAT_ARGB in terms
>> of storage on the device, so okay to use this optimized copy routine.
>>
>> This series builds on work from Frank Henigman to optimize the
>> process of uploading a texture to the GPU. This series adds support for
>> MESA_XRGB_ and full miptrees where were found to be common activities
>> in the Smokin' Guns game. The issue was found while profiling the app
>> but that part is not benchmarked. Smokin-Guns uses mipmap textures with
>> an internal format of GL_RGB (MESA_XRGB_ in the driver).
>>
>> These changes need a performance tool to run against to show how they
>> improve execution performance for specific texture formats. Using this
>> benchmark I've measured the following improvement on my Ivybridge
>> Intel(R) Xeon(R) CPU E3-1225 V2 @ 3.20GHz.
>>
>> Using 1024x1024, RGBA  source, mipmap
>>  <>
>
>
> I don't understand. What do you mean by ``<>``? That all these
> numbers were obtained with this patch? But that doesn't make sense, because
> these are before-and-after numbers. And it can't be just this patch, because
> these numbers are identical to the numbers quoted in patch 2.

The first column is "before", the second is after patch 1, and the
third is after patch 2. Instead of doing before->after patch 1 in
patch 1's commit, and after patch 1->after patch 2 in patch 2's
commit, he just pasted the same data in and added <> above
the column that corresponds to the patch.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

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

--- Comment #6 from Ian Romanick  ---
I'm really confused now. :(  You're sure that bisect is good?  There's nothing
in that commit that modifies any file under src/glx.

I'm also not able to reproduce this even using your configure options.

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


Re: [Mesa-dev] [PATCH 1/3] dri: Add helpers for implementing allocBuffer/releaseBuffer with __DRIimage

2013-11-11 Thread Chad Versace

On 11/11/2013 01:22 PM, Kristian Høgsberg wrote:

Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension.

For the intel dri driver, this consolidates window system color buffer
allocation in intel_create_image().

Signed-off-by: Kristian Høgsberg 
---
  src/mesa/drivers/dri/common/dri_util.c   | 75 
  src/mesa/drivers/dri/common/dri_util.h   | 10 +
  src/mesa/drivers/dri/i915/intel_screen.c | 56 +---
  src/mesa/drivers/dri/i965/intel_screen.c | 55 +--
  4 files changed, 89 insertions(+), 107 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index 86cf24c..a7328e4 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c




+__DRIbuffer *
+driAllocateBuffer(__DRIscreen *screen,
+  unsigned attachment, unsigned format,
+  int width, int height)
+{
+   struct dri_image_buffer *buffer;
+   __DRIimageExtension *image = screen->image_extension;
+   int dri_format, name, stride;
+
+   assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
+  attachment == __DRI_BUFFER_BACK_LEFT);
+
+   /* We just need a __DRI_IMAGE_FORMAT code that has a cpp that matches
+* format / 8.  The image format code is stored in the __DRIimage, but the
+* __DRIbuffer we create from the image, only stores the cpp. */
+
+   switch (format) {
+   case 32:
+  dri_format = __DRI_IMAGE_FORMAT_XRGB;
+  break;
+   case 16:
+  dri_format = __DRI_IMAGE_FORMAT_RGB565;
+  break;
+   default:
+  return NULL;
+   }
+
+   buffer = calloc(1, sizeof *buffer);
+   if (buffer == NULL)
+  return NULL;
+
+   buffer->image = image->createImage(screen,
+  width, height, dri_format,
+  __DRI_IMAGE_USE_SHARE |
+  __DRI_IMAGE_USE_SCANOUT,
+  buffer);


It's incorrect to specify __DRI_IMAGE_USE_SCANOUT regardless of
attachment type. GBM, Wayland, and Android use driAllocateBuffer
to allocate more than just the scanout buffer. They use it to
allocate auxillary buffers too. If i965 were to respect the
caching restrictions implied by __DRI_IMAGE_USE_SCANOUT, its
use for aux buffers would hurt performance. (As far as I can
tell, though, intel_create_image() wrongly ignores __DRI_IMAGE_USE_SCANOUT).

Instead, I think you should set the USE_SCANOUT bit if and only if
attachment is one of __DRI_BUFFER_(BACK|FRONT)_(LEFT|RIGHT).


+
+   if (buffer->image == NULL) {
+  free(buffer);
+  return NULL;
+   }
+
+   image->queryImage(buffer->image, __DRI_IMAGE_ATTRIB_NAME, &name);
+   image->queryImage(buffer->image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
+
+   buffer->base.attachment = attachment;
+   buffer->base.name = name;
+   buffer->base.pitch = stride;
+   buffer->base.cpp = format / 8;
+
+   return &buffer->base;
+}


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


Re: [Mesa-dev] [PATCH 2/4] i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB

2013-11-11 Thread Ian Romanick
On 11/11/2013 01:35 PM, Daniel Vetter wrote:
> On Mon, Nov 11, 2013 at 11:19:07AM -0800, Ian Romanick wrote:
>> From: Ian Romanick 
>>
>> Systems with little physical memory installed will report less than
>> 2GiB, and some systems may (hypothetically?) have a larger address space
>> for the GPU.  My IVB still reports 1534.
>>
>> Signed-off-by: Ian Romanick 
>> Cc: Daniel Vetter 
>> Cc: "10.0" 
>> ---
>>  src/mesa/drivers/dri/i965/intel_screen.c | 10 +++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
>> b/src/mesa/drivers/dri/i965/intel_screen.c
>> index e39d654..592150b 100644
>> --- a/src/mesa/drivers/dri/i965/intel_screen.c
>> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
>> @@ -823,10 +823,14 @@ brw_query_renderer_integer(__DRIscreen *psp, int 
>> param, int *value)
>>/* Once a batch uses more than 75% of the maximum mappable size, we
>> * assume that there's some fragmentation, and we start doing extra
>> * flushing, etc.  That's the big cliff apps will care about.
>> -   *
>> -   * Can only map 2G onto the GPU through the GTT.
>> */
>> -  const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
>> +  size_t aper_size;
>> +  size_t mappable_size;
>> +
>> +  drm_intel_get_aperture_sizes(psp->fd, &mappable_size, &aper_size);
> 
> Hm, I haven't seen the (presumably) libdrm patch that adds this yet float
> by, but you really want to match the uint64_t libdrm uses internally for
> gtt_size here ... ;-)
> 
> With that fixed both patches are
> Reviewed-by: Daniel Vetter 
> I'll look at the wrapper as soon as it hits my inbox.

Eh... drm_intel_get_aperture_sizes has been around for almost 2.5 years.

commit 9d77603d8b95aee4f2408e437c55af15ee05b608
Author: Chris Wilson 
AuthorDate: Sat Jun 4 12:47:19 2011 +0100
Commit: Chris Wilson 
CommitDate: Sat Jun 4 13:01:11 2011 +0100

intel: Add interface to query aperture sizes.

Signed-off-by: Chris Wilson 

Should I submit a libdrm patch to change it's interface from size_t to
uint64_t?

> -Daniel
> 
> 
>> +
>> +  const unsigned gpu_mappable_megabytes =
>> + (aper_size / (1024 * 1024)) * 3 / 4;
>>  
>>const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
>>const long system_page_size = sysconf(_SC_PAGE_SIZE);
>> -- 
>> 1.8.1.4

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

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

--- Comment #5 from Vinson Lee  ---
I see the same output.

$ nm -u src/glx/.libs/create_context.o
 U __assert_fail
 U free
 U GetGLXScreenConfigs
 U _GLOBAL_OFFSET_TABLE_
 U __glXSendErrorForXcb
 U indirect_create_context_attribs
 U xcb_generate_id
 U xcb_glx_create_context_attribs_arb_checked
 U xcb_request_check
 U XGetXCBConnection

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

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

--- Comment #4 from Ian Romanick  ---
Hrm... diffing that with mine doesn't show anything obvious.  How about 'nm -u
src/glx/.libs/create_context.o'?  I get:

[idr@mumford-wire master-64]$ nm -u src/glx/.libs/create_context.o 
 U __assert_fail
 U free
 U GetGLXScreenConfigs
 U _GLOBAL_OFFSET_TABLE_
 U __glXSendErrorForXcb
 U indirect_create_context_attribs
 U xcb_generate_id
 U xcb_glx_create_context_attribs_arb_checked
 U xcb_request_check
 U XGetXCBConnection

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

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

--- Comment #3 from Vinson Lee  ---
Created attachment 89058
  --> https://bugs.freedesktop.org/attachment.cgi?id=89058&action=edit
nm -u src/glx/tests/*.o

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


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

2013-11-11 Thread Chad Versace

On 09/27/2013 10:20 PM, Vinson Lee wrote:

Fixes "Resource leak" defects reported by Coverity.

Signed-off-by: Vinson Lee 


Thanks. Committed.

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


Re: [Mesa-dev] [PATCH 2/4] i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB

2013-11-11 Thread Daniel Vetter
On Mon, Nov 11, 2013 at 11:19:07AM -0800, Ian Romanick wrote:
> From: Ian Romanick 
> 
> Systems with little physical memory installed will report less than
> 2GiB, and some systems may (hypothetically?) have a larger address space
> for the GPU.  My IVB still reports 1534.
> 
> Signed-off-by: Ian Romanick 
> Cc: Daniel Vetter 
> Cc: "10.0" 
> ---
>  src/mesa/drivers/dri/i965/intel_screen.c | 10 +++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
> b/src/mesa/drivers/dri/i965/intel_screen.c
> index e39d654..592150b 100644
> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> @@ -823,10 +823,14 @@ brw_query_renderer_integer(__DRIscreen *psp, int param, 
> int *value)
>/* Once a batch uses more than 75% of the maximum mappable size, we
> * assume that there's some fragmentation, and we start doing extra
> * flushing, etc.  That's the big cliff apps will care about.
> -   *
> -   * Can only map 2G onto the GPU through the GTT.
> */
> -  const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
> +  size_t aper_size;
> +  size_t mappable_size;
> +
> +  drm_intel_get_aperture_sizes(psp->fd, &mappable_size, &aper_size);

Hm, I haven't seen the (presumably) libdrm patch that adds this yet float
by, but you really want to match the uint64_t libdrm uses internally for
gtt_size here ... ;-)

With that fixed both patches are
Reviewed-by: Daniel Vetter 
I'll look at the wrapper as soon as it hits my inbox.
-Daniel


> +
> +  const unsigned gpu_mappable_megabytes =
> + (aper_size / (1024 * 1024)) * 3 / 4;
>  
>const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
>const long system_page_size = sysconf(_SC_PAGE_SIZE);
> -- 
> 1.8.1.4
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

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

--- Comment #2 from Ian Romanick  ---
That is bizarre.  I always 'make check' as part of my build, and I haven't seen
that failure.  There must be something different about your configure flags
that allows this to happen.  Something is happening that causes
src/glx/indirect_glx.o go get pulled in when linking glx-test, and it should
not.

Can you attach the output of 'nm -u src/glx/tests/*.o'?

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


Re: [Mesa-dev] [PATCH] i965: Delete #define's and use local variables inside function

2013-11-11 Thread Chad Versace

On 11/07/2013 04:51 PM, Anuj Phogat wrote:

X_f, Y_f, Xp_f, Yp_f variables are used just inside
translate_dst_to_src().So, they can be defined just as
local variables.

Signed-off-by: Anuj Phogat 


Reviewed-by: Chad Versace 

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


Re: [Mesa-dev] [PATCH 07/18] i915: Wire up initial support for DRI_RENDERER_QUERY extension

2013-11-11 Thread Daniel Vetter
On Mon, Nov 11, 2013 at 11:03:49AM -0800, Ian Romanick wrote:
> On 11/09/2013 02:44 AM, Daniel Vetter wrote:
> > On Fri, Oct 11, 2013 at 03:10:14PM -0700, Ian Romanick wrote:
> >> From: Ian Romanick 
> >>
> >> Signed-off-by: Ian Romanick 
> >> ---
> >>  src/mesa/drivers/dri/i915/intel_screen.c | 79 
> >> 
> >>  1 file changed, 79 insertions(+)
> >>
> >> diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
> >> b/src/mesa/drivers/dri/i915/intel_screen.c
> >> index 4f8c342..fa4fdc0 100644
> >> --- a/src/mesa/drivers/dri/i915/intel_screen.c
> >> +++ b/src/mesa/drivers/dri/i915/intel_screen.c
> >> @@ -27,6 +27,7 @@
> >>  
> >>  #include 
> >>  #include 
> >> +#include 
> >>  #include "main/glheader.h"
> >>  #include "main/context.h"
> >>  #include "main/framebuffer.h"
> >> @@ -741,6 +742,84 @@ static struct __DRIimageExtensionRec 
> >> intelImageExtension = {
> >>  .createImageFromFds = intel_create_image_from_fds
> >>  };
> >>  
> >> +static int
> >> +i915_query_renderer_integer(__DRIscreen *psp, int param, int *value)
> >> +{
> >> +   const struct intel_screen *const intelScreen =
> >> +  (struct intel_screen *) psp->driverPrivate;
> >> +
> >> +   switch (param) {
> >> +   case __DRI2_RENDERER_VENDOR_ID:
> >> +  value[0] = 0x8086;
> >> +  return 0;
> >> +   case __DRI2_RENDERER_DEVICE_ID:
> >> +  value[0] = intelScreen->deviceID;
> >> +  return 0;
> >> +   case __DRI2_RENDERER_ACCELERATED:
> >> +  value[0] = 1;
> >> +  return 0;
> >> +   case __DRI2_RENDERER_VIDEO_MEMORY: {
> >> +  struct sysinfo info;
> >> +  uint64_t system_memory_bytes;
> >> +  unsigned system_memory_megabytes;
> >> +
> >> +  /* Once a batch uses more than 75% of the maximum mappable size, we
> >> +   * assume that there's some fragmentation, and we start doing extra
> >> +   * flushing, etc.  That's the big cliff apps will care about.
> >> +   */
> >> +  const unsigned long agp_bytes = drmAgpSize(psp->fd);
> > 
> > So despite me shooting at this in the next patch saying that this is
> > - the wrong interface, it doesn't actually really tell you what you want
> >   to know (since it fails to take pinnned crap into account),
> > - doesn't work on half the platforms i915_dri supports already,
> > - and is massively deprecated on all others and a major pain for us to
> >   keep on live support in the kernel
> 
> In fairness, you missed this specific issue on your first review and
> shot at it after I committed it. :(  There was no malice... just
> timezone fail.  In the future, I'll CC you any Mesa changes that
> interact with the kernel so that you'll notice them sooner.

Yeah, I try to read most of mesa-devel, but can't really go into details
of the patches everywhere. I only replied to the i965 patch since Ken's
review made me curious to check the details. Then your reply later on made
me check the previous patch.

Anyway, I've cooled off now, just happy that we've caught this zoombie in
the nick of time ;-)

Another thing I've noticed is that you adjust the advertised vram size
with the available memory. I don't think that's an issue already since the
aperture space checker in libdrm (which mesa uses to avoid overfilling
batches) doesn't do that. But it'll be one on memory constrained
phones/tablets and also with the much bigger gtt on bdw.

I think the right fix for that is to adjust the
aperture.aper_available_size in the kernel, so that all users of this
interface have correct data. The kernel already adjusts this for pinned
objects and similar stuff, so would fit neatly. I'll wip up a kernel patch
for that. I guess we could leave the current stuff in for 10.0 and remove
it in master once the kernel fix has landed.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/3] wayland: Use __DRIimage based getBuffers implementation when available

2013-11-11 Thread Kristian Høgsberg
This lets us allocate color buffers as __DRIimages and pass them into
the driver instead of having to create a __DRIbuffer with the flink
that requires.

Signed-off-by: Kristian Høgsberg 
Cc: "10.0" 
---
 src/egl/drivers/dri2/egl_dri2.h |   3 +-
 src/egl/drivers/dri2/platform_wayland.c | 140 ++--
 2 files changed, 96 insertions(+), 47 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index c7d6484..bbe5602 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -117,7 +117,7 @@ struct dri2_egl_display
 
__DRIdri2LoaderExtensiondri2_loader_extension;
__DRIswrastLoaderExtension  swrast_loader_extension;
-   const __DRIextension *extensions[4];
+   const __DRIextension *extensions[5];
const __DRIextension**driver_extensions;
 
 #ifdef HAVE_X11_PLATFORM
@@ -189,7 +189,6 @@ struct dri2_egl_surface
 #ifdef HAVE_WAYLAND_PLATFORM
   struct wl_buffer   *wl_buffer;
   __DRIimage *dri_image;
-  int pitch, name;
 #endif
 #ifdef HAVE_DRM_PLATFORM
   struct gbm_bo   *bo;
diff --git a/src/egl/drivers/dri2/platform_wayland.c 
b/src/egl/drivers/dri2/platform_wayland.c
index c0de16b..f9065bb 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -257,12 +257,11 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
 }
 
 static int
-get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
+get_back_bo(struct dri2_egl_surface *dri2_surf)
 {
struct dri2_egl_display *dri2_dpy =
   dri2_egl_display(dri2_surf->base.Resource.Display);
-   __DRIimage *image;
-   int i, name, pitch;
+   int i;
 
/* There might be a buffer release already queued that wasn't processed */
wl_display_dispatch_queue_pending(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
@@ -295,23 +294,30 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, 
__DRIbuffer *buffer)
if (dri2_surf->back->dri_image == NULL)
   return -1;
 
+   dri2_surf->back->locked = 1;
+
+   return 0;
+}
+
+
+static void
+back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
+{
+   struct dri2_egl_display *dri2_dpy =
+  dri2_egl_display(dri2_surf->base.Resource.Display);
+   __DRIimage *image;
+   int name, pitch;
+
image = dri2_surf->back->dri_image;
 
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_NAME, &name);
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &pitch);
 
-   dri2_surf->back->name = name;
-   dri2_surf->back->pitch = pitch;
-
buffer->attachment = __DRI_BUFFER_BACK_LEFT;
buffer->name = name;
buffer->pitch = pitch;
buffer->cpp = 4;
buffer->flags = 0;
-
-   dri2_surf->back->locked = 1;
-
-   return 0;
 }
 
 static int
@@ -337,16 +343,12 @@ get_aux_bo(struct dri2_egl_surface *dri2_surf,
return 0;
 }
 
-static __DRIbuffer *
-dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
-int *width, int *height,
-unsigned int *attachments, int count,
-int *out_count, void *loaderPrivate)
+static int
+update_buffers(struct dri2_egl_surface *dri2_surf)
 {
-   struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
   dri2_egl_display(dri2_surf->base.Resource.Display);
-   int i, j;
+   int i;
 
if (dri2_surf->base.Type == EGL_WINDOW_BIT &&
(dri2_surf->base.Width != dri2_surf->wl_win->width || 
@@ -360,22 +362,9 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
   dri2_surf->dy = dri2_surf->wl_win->dy;
}
 
-   for (i = 0, j = 0; i < 2 * count; i += 2, j++) {
-  switch (attachments[i]) {
-  case __DRI_BUFFER_BACK_LEFT:
-if (get_back_bo(dri2_surf, &dri2_surf->buffers[j]) < 0) {
-   _eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
-   return NULL;
-}
-break;
-  default:
-if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
-   &dri2_surf->buffers[j]) < 0) {
-   _eglError(EGL_BAD_ALLOC, "failed to allocate aux buffer");
-   return NULL;
-}
-break;
-  }
+   if (get_back_bo(dri2_surf) < 0) {
+  _eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
+  return -1;
}
 
/* If we have an extra unlocked buffer at this point, we had to do triple
@@ -391,6 +380,36 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
   }
}
 
+   return 0;
+}
+
+static __DRIbuffer *
+dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
+int *width, int *height,
+unsigned int *attachments, int count,
+int *out_count, void *loaderPrivate)
+{
+   struct dri2_egl_surface *dri2_surf = loaderPrivate;
+   int i, j;
+
+   if (update_buffers(dri2_surf) < 0)
+  return NULL;

Re: [Mesa-dev] [PATCH 2/2] i965: Enhance tiled_memcpy to support all levels

2013-11-11 Thread Chad Versace

On 11/08/2013 08:13 AM, Courtney Goeltzenleuchter wrote:

Support all levels of a supported texture format.

Using 1024x1024, RGBA  source, mipmap
<>
internal-format Before (MB/sec) XRGB (MB/sec)   mipmap (MB/sec)
GL_RGBA 628.15  627.15  615.90
GL_RGB  265.95  456.35  611.53
512x512
GL_RGBA 600.23  597.00  619.95
GL_RGB  255.50  440.62  611.28
256x256
GL_RGBA 489.08  487.80  587.42
GL_RGB  229.03  376.63  585.00

Test shows similar pattern for 512x512 and 256x256.

Benchmark has been sent to mesa-dev list: teximage_enh

Courtney Goeltzenleuchter (2):
   i965: add XRGB to tiled_memcpy
   i965: Enhance tiled_memcpy to support all levels

  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 11 ---
  1 file changed, 8 insertions(+), 3 deletions(-)

--
1.8.1.2

Signed-off-by: Courtney Goeltzenleuchter 
---
  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 8 ++--
  1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c 
b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index b1826fa..50f802f 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -543,7 +543,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
 uint32_t cpp;
 mem_copy_fn mem_copy = NULL;

-   /* This fastpath is restricted to specific texture types: level 0 of
+   /* This fastpath is restricted to specific texture types:
  * a 2D BGRA, RGBA, L8 or A8 texture. It could be generalized to support
  * more types.
  *
@@ -555,7 +555,6 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
 if (!brw->has_llc ||
 type != GL_UNSIGNED_BYTE ||
 texImage->TexObject->Target != GL_TEXTURE_2D ||
-   texImage->Level != 0 ||
 pixels == NULL ||
 _mesa_is_bufferobj(packing->BufferObj) ||
 packing->Alignment > 4 ||
@@ -631,6 +630,11 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
 packing->Alignment, packing->RowLength, packing->SkipPixels,
 packing->SkipRows, for_glTexImage);

+   /* Adjust x and y offset based on miplevel
+*/


One small nitpick. The above comment is short enough to fit on a single line.
There's no need to place '*/' on a line by itself.


+   xoffset += image->mt->level[texImage->Level].level_x;
+   yoffset += image->mt->level[texImage->Level].level_y;
+
 linear_to_tiled(
xoffset * cpp, (xoffset + width) * cpp,
yoffset, yoffset + height,



The code looks good, though I haven't tested it yet. But, I see the same
issues with the commit message that I had with patch 1.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/3] dri: Add helpers for implementing allocBuffer/releaseBuffer with __DRIimage

2013-11-11 Thread Kristian Høgsberg
Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension.

For the intel dri driver, this consolidates window system color buffer
allocation in intel_create_image().

Signed-off-by: Kristian Høgsberg 
---
 src/mesa/drivers/dri/common/dri_util.c   | 75 
 src/mesa/drivers/dri/common/dri_util.h   | 10 +
 src/mesa/drivers/dri/i915/intel_screen.c | 56 +---
 src/mesa/drivers/dri/i965/intel_screen.c | 55 +--
 4 files changed, 89 insertions(+), 107 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index 86cf24c..a7328e4 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -115,6 +115,7 @@ driCreateNewScreen2(int scrn, int fd,
 {
 static const __DRIextension *emptyExtensionList[] = { NULL };
 __DRIscreen *psp;
+int i;
 
 psp = calloc(1, sizeof(*psp));
 if (!psp)
@@ -161,6 +162,11 @@ driCreateNewScreen2(int scrn, int fd,
return NULL;
 }
 
+for (i = 0; psp->extensions[i]; i++) {
+   if (strcmp(psp->extensions[i]->name, __DRI_IMAGE) == 0)
+  psp->image_extension = (__DRIimageExtension *) psp->extensions[i];
+}
+
 int gl_version_override = _mesa_get_gl_version_override();
 if (gl_version_override >= 31) {
psp->max_gl_core_version = MAX2(psp->max_gl_core_version,
@@ -862,6 +868,75 @@ driImageFormatToGLFormat(uint32_t image_format)
}
 }
 
+struct dri_image_buffer {
+   __DRIbuffer base;
+   __DRIimage *image;
+};
+
+__DRIbuffer *
+driAllocateBuffer(__DRIscreen *screen,
+  unsigned attachment, unsigned format,
+  int width, int height)
+{
+   struct dri_image_buffer *buffer;
+   __DRIimageExtension *image = screen->image_extension;
+   int dri_format, name, stride;
+
+   assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
+  attachment == __DRI_BUFFER_BACK_LEFT);
+
+   /* We just need a __DRI_IMAGE_FORMAT code that has a cpp that matches
+* format / 8.  The image format code is stored in the __DRIimage, but the
+* __DRIbuffer we create from the image, only stores the cpp. */
+
+   switch (format) {
+   case 32:
+  dri_format = __DRI_IMAGE_FORMAT_XRGB;
+  break;
+   case 16:
+  dri_format = __DRI_IMAGE_FORMAT_RGB565;
+  break;
+   default:
+  return NULL;
+   }
+
+   buffer = calloc(1, sizeof *buffer);
+   if (buffer == NULL)
+  return NULL;
+
+   buffer->image = image->createImage(screen,
+  width, height, dri_format,
+  __DRI_IMAGE_USE_SHARE |
+  __DRI_IMAGE_USE_SCANOUT,
+  buffer);
+
+   if (buffer->image == NULL) {
+  free(buffer);
+  return NULL;
+   }
+
+   image->queryImage(buffer->image, __DRI_IMAGE_ATTRIB_NAME, &name);
+   image->queryImage(buffer->image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
+
+   buffer->base.attachment = attachment;
+   buffer->base.name = name;
+   buffer->base.pitch = stride;
+   buffer->base.cpp = format / 8;
+
+   return &buffer->base;
+}
+
+void
+driReleaseBuffer(__DRIscreen *screen, __DRIbuffer *_buffer)
+{
+   struct dri_image_buffer *buffer = (struct dri_image_buffer *) _buffer;
+   __DRIimageExtension *image = screen->image_extension;
+
+   image->destroyImage(buffer->image);
+   free(buffer);
+}
+
+
 /** Image driver interface */
 const __DRIimageDriverExtension driImageDriverExtension = {
 .base = { __DRI_IMAGE_DRIVER, __DRI_IMAGE_DRIVER_VERSION },
diff --git a/src/mesa/drivers/dri/common/dri_util.h 
b/src/mesa/drivers/dri/common/dri_util.h
index 79a8564..240213d 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -165,6 +165,7 @@ struct __DRIscreenRec {
 int max_gl_es2_version;
 
 const __DRIextension **extensions;
+   __DRIimageExtension *image_extension;
 
 const __DRIswrastLoaderExtension *swrast_loader;
 
@@ -291,4 +292,13 @@ driUpdateFramebufferSize(struct gl_context *ctx, const 
__DRIdrawable *dPriv);
 
 extern const __DRIimageDriverExtension driImageDriverExtension;
 
+extern __DRIbuffer *
+driAllocateBuffer(__DRIscreen *screen,
+  unsigned attachment, unsigned format,
+  int width, int height);
+
+extern void
+driReleaseBuffer(__DRIscreen *screen, __DRIbuffer *_buffer);
+
+
 #endif /* _DRI_UTIL_H_ */
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
b/src/mesa/drivers/dri/i915/intel_screen.c
index 2c309ed..a143652 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -1185,58 +1185,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
return (const __DRIconfig**) intel_screen_make_configs(psp);
 }
 
-struct intel_buffer {

[Mesa-dev] [PATCH 2/3] gbm: Add support for __DRIimage based getBuffers when available

2013-11-11 Thread Kristian Høgsberg
This lets us allocate color buffers as __DRIimages and pass them into
the driver instead of having to create a __DRIbuffer with the flink
that requires.

Signed-off-by: Kristian Høgsberg 
Cc: "10.0" 
---
 src/egl/drivers/dri2/platform_drm.c | 46 ++---
 src/gbm/backends/dri/gbm_dri.c  | 28 +-
 src/gbm/backends/dri/gbm_driint.h   |  8 ++-
 3 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_drm.c 
b/src/egl/drivers/dri2/platform_drm.c
index 7b1e3a1..181b29d 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -175,13 +175,12 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLSurface *surf)
 }
 
 static int
-get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
+get_back_bo(struct dri2_egl_surface *dri2_surf)
 {
struct dri2_egl_display *dri2_dpy =
   dri2_egl_display(dri2_surf->base.Resource.Display);
-   struct gbm_dri_bo *bo;
struct gbm_dri_surface *surf = dri2_surf->gbm_surf;
-   int i, name, pitch;
+   int i;
 
if (dri2_surf->back == NULL) {
   for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
@@ -201,6 +200,17 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, 
__DRIbuffer *buffer)
if (dri2_surf->back->bo == NULL)
   return -1;
 
+   return 0;
+}
+
+static void
+back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
+{
+   struct dri2_egl_display *dri2_dpy =
+  dri2_egl_display(dri2_surf->base.Resource.Display);
+   struct gbm_dri_bo *bo;
+   int name, pitch;
+
bo = (struct gbm_dri_bo *) dri2_surf->back->bo;
 
dri2_dpy->image->queryImage(bo->image, __DRI_IMAGE_ATTRIB_NAME, &name);
@@ -211,8 +221,6 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer 
*buffer)
buffer->pitch = pitch;
buffer->cpp = 4;
buffer->flags = 0;
-
-   return 0;
 }
 
 static int
@@ -254,10 +262,11 @@ dri2_get_buffers_with_format(__DRIdrawable *driDrawable,
 
   switch (attachments[i]) {
   case __DRI_BUFFER_BACK_LEFT:
-if (get_back_bo(dri2_surf, &dri2_surf->buffers[j]) < 0) {
+if (get_back_bo(dri2_surf) < 0) {
_eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");
return NULL;
 }
+ back_bo_to_dri_buffer(dri2_surf, &dri2_surf->buffers[j]);
 break;
   default:
 if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
@@ -312,6 +321,27 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
return buffer;
 }
 
+static int
+dri_image_get_buffers(__DRIdrawable *driDrawable,
+  unsigned int format,
+  uint32_t *stamp,
+  void *loaderPrivate,
+  uint32_t buffer_mask,
+  struct __DRIimageList *buffers)
+{
+   struct dri2_egl_surface *dri2_surf = loaderPrivate;
+   struct gbm_dri_bo *bo;
+
+   if (get_back_bo(dri2_surf) < 0)
+  return 0;
+
+   bo = (struct gbm_dri_bo *) dri2_surf->back->bo;
+   buffers->image_mask = __DRI_IMAGE_BUFFER_BACK;
+   buffers->back = bo->image;
+
+   return 1;
+}
+
 static void
 dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
 {
@@ -348,9 +378,8 @@ dri2_query_buffer_age(_EGLDriver *drv,
   _EGLDisplay *disp, _EGLSurface *surface)
 {
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
-   __DRIbuffer buffer;
 
-   if (get_back_bo(dri2_surf, &buffer) < 0) {
+   if (get_back_bo(dri2_surf) < 0) {
   _eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age");
   return 0;
}
@@ -469,6 +498,7 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->gbm_dri->get_buffers = dri2_get_buffers;
dri2_dpy->gbm_dri->flush_front_buffer = dri2_flush_front_buffer;
dri2_dpy->gbm_dri->get_buffers_with_format = dri2_get_buffers_with_format;
+   dri2_dpy->gbm_dri->image_get_buffers = dri_image_get_buffers;
 
dri2_dpy->gbm_dri->base.base.surface_lock_front_buffer = lock_front_buffer;
dri2_dpy->gbm_dri->base.base.surface_release_buffer = release_buffer;
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index e95fcc7..6c63c75 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -104,6 +104,24 @@ dri_get_buffers_with_format(__DRIdrawable * driDrawable,
count, out_count, surf->dri_private);
 }
 
+static int
+image_get_buffers(__DRIdrawable *driDrawable,
+  unsigned int format,
+  uint32_t *stamp,
+  void *loaderPrivate,
+  uint32_t buffer_mask,
+  struct __DRIimageList *buffers)
+{
+   struct gbm_dri_surface *surf = loaderPrivate;
+   struct gbm_dri_device *dri = gbm_dri_device(surf->base.gbm);
+
+   if (dri->image_get_buffers == NULL)
+  return 0;
+
+   return dri->image_get_buffers(driDrawable, format, stamp,
+

Re: [Mesa-dev] [PATCH 1/2 v3] i965: add XRGB to tiled_memcpy

2013-11-11 Thread Chad Versace

On 11/07/2013 01:59 PM, Courtney Goeltzenleuchter wrote:

MESA_FORMAT_XRGB is equivalent to MESA_FORMAT_ARGB in terms
of storage on the device, so okay to use this optimized copy routine.

This series builds on work from Frank Henigman to optimize the
process of uploading a texture to the GPU. This series adds support for
MESA_XRGB_ and full miptrees where were found to be common activities
in the Smokin' Guns game. The issue was found while profiling the app
but that part is not benchmarked. Smokin-Guns uses mipmap textures with
an internal format of GL_RGB (MESA_XRGB_ in the driver).

These changes need a performance tool to run against to show how they
improve execution performance for specific texture formats. Using this
benchmark I've measured the following improvement on my Ivybridge
Intel(R) Xeon(R) CPU E3-1225 V2 @ 3.20GHz.

Using 1024x1024, RGBA  source, mipmap
 <>


I don't understand. What do you mean by ``<>``? That all these
numbers were obtained with this patch? But that doesn't make sense, because
these are before-and-after numbers. And it can't be just this patch, because
these numbers are identical to the numbers quoted in patch 2.


internal-format Before (MB/sec) XRGB (MB/sec)   mipmap (MB/sec)
GL_RGBA 628.15  627.15  615.90
GL_RGB  265.95  456.35  611.53
512x512
GL_RGBA 600.23  597.00  619.95
GL_RGB  255.50  440.62  611.28
256x256
GL_RGBA 489.08  487.80  587.42
GL_RGB  229.03  376.63  585.00

Test shows similar pattern for 512x512 and 256x256.


The above table confuses me. There is a column named "Before", but no column
named "After". There 'internal-format' exists in the same location as '512x512'
and '256x256', but 'internal-format' is not a size.


Benchmark has been sent to mesa-dev list: teximage_enh



 -8<- 

Courtney Goeltzenleuchter (2):
   i965: add XRGB to tiled_memcpy
   i965: Enhance tiled_memcpy to support all levels

  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 11 ---
  1 file changed, 8 insertions(+), 3 deletions(-)

--
1.8.1.2

 ->8- 

Commit messages should not contain coverletter metadata, such
as the above snippet. This also applies to patch 2.


Signed-off-by: Courtney Goeltzenleuchter 
---
  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c 
b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index 0384bcc..b1826fa 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -571,7 +571,8 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
 (texImage->TexFormat == MESA_FORMAT_A8 && format == GL_ALPHA)) {
cpp = 1;
mem_copy = memcpy;
-   } else if (texImage->TexFormat == MESA_FORMAT_ARGB) {
+   } else if ((texImage->TexFormat == MESA_FORMAT_ARGB)
+ || (texImage->TexFormat == MESA_FORMAT_XRGB)) {
cpp = 4;
if (format == GL_BGRA) {
   mem_copy = memcpy;



The code change itself looks good. I'm just having a hard time making sense
out of the commit message.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: Add ARB_texture_view to Mesa core

2013-11-11 Thread Courtney Goeltzenleuchter
On Mon, Nov 11, 2013 at 11:15 AM, Ian Romanick  wrote:

> On 11/05/2013 11:36 AM, Courtney Goeltzenleuchter wrote:
> > On Tue, Nov 5, 2013 at 12:22 PM, Ian Romanick  > > wrote:
> >
> > On 11/05/2013 09:44 AM, Chris Forbes wrote:
> > >> So, you can create a GL_LUMINANCE view of a GL_LUMINANCE texture.
> >  Hmm...
> > >
> > > My understanding is you can't actually, since views can only be
> > > created from immutable-format textures, and GL_LUMINANCE is not a
> > > sized internalformat, so it can't be used with TexStorage?
> >
> > I was just using GL_LUMINANCE as shorthand for GL_LUMINANCE4,
> > GL_LUMINANCE8, GL_LUMINANCE12, and GL_LUMINANCE16.  As far as I can
> > tell,
> >
> > glGenTextures(1, &tex);
> > glBindTexture(GL_TEXTURE_2D, tex);
> > glTexStorage2D(GL_TEXTURE_2D,
> > 8,
> > GL_LUMINANCE8,
> > 1024, 1024);
> >
> > is perfectly valid.  Sayeth GL_ARB_texture_storage:
> >
> > Accepted by the  parameter of TexStorage* when
> > implemented on OpenGL ES:
> >
> > ALPHA8_EXT 0x803C
> > LUMINANCE8_EXT 0x8040
> > LUMINANCE8_ALPHA8_EXT  0x8045
> >
> > I guess that means GL_LUMINANCE4, GL_LUMINANCE12, and GL_LUMINANCE16
> are
> > out.  As are all GL_INTENSITY formats.  There are still these three
> > legacy formats to handle.
> >
> > So, if we support GL_ARB_texture_view in a compatibility profile,
> >
> > glGenTextures(1, &view);
> > glTextureView(view,
> > GL_TEXTURE_2D,
> > tex,
> > GL_LUMINANCE8,
> > 1, 1, 1, 1);
> >
> > is also valid.
> >
> > Right?
> >
> >
> > The spec is pickier than that.  For 8bit texels the allowed internal
> > formats are: R8UI, R8I, R8, R8_SNORM
> > I use the table specified in the ARB_texture_view to translate the
> > target internalFormat passed to glTextureView into a VIEW_CLASS.
> > GL_LUMINANCE8 does not have a valid VIEW_CLASS and could not match the
> > internal format of the source texture.
>
> I don't think it matters that GL_LUMINANCE8 is missing from the table or
> that it doesn't have a VIEW_CLASS.  The GL_ARB_texture_view spec says
> (emphasis mine):
>
>The two textures' internal formats must be compatible according to
>Table 3.X.2 (Compatible internal formats for TextureView) if the
>internal format exists in that table and *the internal formats
>must be identical if not in that table*, or else an
>INVALID_OPERATION error is generated.
>
> In my above code example, the internal formats are identical.  By my
> reading of the above quoted text, that code is legal.  We should modify
> one of the texture_view tests to use these legacy formats, and try that
> test on NVIDIA with a compatibility profile.
>

Good point. I'll talk with Jon about testing that if we don't already.

Courtney


>
> > That makes me wonder, should I be trying to map the target
> > internalformat into a driver internal format?
> >
> > Courtney
> >
> > --
> > Courtney Goeltzenleuchter
> > LunarG
>
>


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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

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

Vinson Lee  changed:

   What|Removed |Added

 CC||i...@freedesktop.org,
   ||kenn...@whitecape.org

--- Comment #1 from Vinson Lee  ---
17c94de33baf66ad5c264b7a046394c651bc6126 is the first bad commit
commit 17c94de33baf66ad5c264b7a046394c651bc6126
Author: Ian Romanick 
Date:   Mon Sep 10 17:11:33 2012 +0300

mesa/dri: Add basic plumbing for GLX_ARB_robustness reset notification
strategy

No drivers advertise the DRI2 extension yet, so no driver should ever
see a value other than false for notify_reset.

The changes in nouveau use tabs because nouveau seems to have it's own
indentation rules.

Signed-off-by: Ian Romanick 
Reviewed-by: Kenneth Graunke 

:04 04 76b2737e9b48d9c042d4bc05020803c7328d605a
dba600f5c9a4c2e147e30e60fbd5b7f286aaa17a Msrc
bisect run success

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


[Mesa-dev] [PATCH] tests: Fix make check for out of tree builds.

2013-11-11 Thread Rico Schüller
Signed-off-by: Rico Schüller 
---
 src/mapi/shared-glapi/tests/Makefile.am | 1 +
 src/mesa/main/tests/Makefile.am | 1 +
 2 Dateien geändert, 2 Zeilen hinzugefügt(+)

diff --git a/src/mapi/shared-glapi/tests/Makefile.am 
b/src/mapi/shared-glapi/tests/Makefile.am
index 98065fc..7e71b4f 100644
--- a/src/mapi/shared-glapi/tests/Makefile.am
+++ b/src/mapi/shared-glapi/tests/Makefile.am
@@ -3,6 +3,7 @@ AM_CFLAGS = $(PTHREAD_CFLAGS)
 AM_CPPFLAGS = \
-I$(top_srcdir)/src/gtest/include \
-I$(top_srcdir)/src/mapi \
+   -I$(top_builddir)/src/mapi \
-I$(top_srcdir)/include
 
 TESTS = shared-glapi-test
diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am
index 97713f2..0d3a51f 100644
--- a/src/mesa/main/tests/Makefile.am
+++ b/src/mesa/main/tests/Makefile.am
@@ -7,6 +7,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/gtest/include \
-I$(top_srcdir)/src/mapi \
-I$(top_srcdir)/src/mesa \
+   -I$(top_builddir)/src/mesa \
-I$(top_srcdir)/include \
$(DEFINES) $(INCLUDE_DIRS)
 
-- 
1.7.11.7

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


Re: [Mesa-dev] [PATCH V3 00/13] ARB_draw_indirect for i965

2013-11-11 Thread Chris Forbes
Thanks, Paul.

Now just seeking r-b for 1, 6, and 12. Anyone?

On Tue, Nov 12, 2013 at 8:37 AM, Paul Berry  wrote:
> On 9 November 2013 01:02, Chris Forbes  wrote:
>>
>> This series adds support for ARB_draw_indirect and ARB_multi_draw_indirect
>> on Gen7+.
>>
>> Big changes:
>> - Get rid of overcomplicated state tracking for the indirect bo in i965.
>> - Make primcount==0 produce GL_INVALID_VALUE in MultiDraw*Indirect
>> - Small tidyups for clarity
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
> Patches 1, 6, and 12 are:
>
> Acked-by: Paul Berry 
>
> The remainder are:
>
> Reviewed-by: Paul Berry 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Eric Anholt
Kevin Rogovin  writes:

> This patch adds a function interface for enabling no wrap on batch commands,
> adds to it assert enforcement that the number bytes added to the
> batch buffer does not exceed a passed value and finally this is used
> in brw_try_draw_prims() to help make sure that estimated_max_prim_size
> is a good value.

I don't like adding overhead to every batch operation.  You can just do
an assert like I did in 185b5a54c94ce11487146042c8eec24909187ed6


pgpgsiOZon9hC.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V3 00/13] ARB_draw_indirect for i965

2013-11-11 Thread Paul Berry
On 9 November 2013 01:02, Chris Forbes  wrote:

> This series adds support for ARB_draw_indirect and ARB_multi_draw_indirect
> on Gen7+.
>
> Big changes:
> - Get rid of overcomplicated state tracking for the indirect bo in i965.
> - Make primcount==0 produce GL_INVALID_VALUE in MultiDraw*Indirect
> - Small tidyups for clarity
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>

Patches 1, 6, and 12 are:

Acked-by: Paul Berry 

The remainder are:

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


[Mesa-dev] [PATCH 4/4] i915: Actually enable __DRI2rendererQueryExtensionRec

2013-11-11 Thread Ian Romanick
From: Ian Romanick 

More rebase fail.  This code was written long before i915 and i965 were
split, so most of the code in i9[16]5/intel_screen.c only needed to
exist in one place.  It looks like I fixed n-1 of those places after
rebasing on the split.

I only found this from the defined-but-not-used warning for
intelRendererQueryExtension was .  I noticed this while fixing the
other, related warnings.

Signed-off-by: Ian Romanick 
Cc: "10.0" 
Cc: Daniel Vetter 
---
If anyone wants to make the argument that this should land on the
release branch, I'll drop it.  In some ways that would make the first
patch in the series moot as drmAgpSize could never be called.

 src/mesa/drivers/dri/i915/intel_screen.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
b/src/mesa/drivers/dri/i915/intel_screen.c
index 0dd6507..f225595 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -789,6 +789,7 @@ static const __DRIextension *intelScreenExtensions[] = {
 &intelTexBufferExtension.base,
 &intelFlushExtension.base,
 &intelImageExtension.base,
+&intelRendererQueryExtension.base,
 &dri2ConfigQueryExtension.base,
 NULL
 };
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 3/4] dri: Change value param to unsigned

2013-11-11 Thread Ian Romanick
From: Ian Romanick 

This silences some compiler warnings in i915 and i965.  See also
75982a5.

Signed-off-by: Ian Romanick 
Cc: "10.0" 
---
 src/mesa/drivers/dri/common/utils.c  | 2 +-
 src/mesa/drivers/dri/common/utils.h  | 2 +-
 src/mesa/drivers/dri/i915/intel_screen.c | 2 +-
 src/mesa/drivers/dri/i965/intel_screen.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/common/utils.c 
b/src/mesa/drivers/dri/common/utils.c
index b30fca9..9c94832 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -494,7 +494,7 @@ driIndexConfigAttrib(const __DRIconfig *config, int index,
  * Zero if a recognized value of \c param is supplied, -1 otherwise.
  */
 int
-driQueryRendererIntegerCommon(__DRIscreen *psp, int param, int *value)
+driQueryRendererIntegerCommon(__DRIscreen *psp, int param, unsigned int *value)
 {
switch (param) {
case __DRI2_RENDERER_VERSION: {
diff --git a/src/mesa/drivers/dri/common/utils.h 
b/src/mesa/drivers/dri/common/utils.h
index 5d6ef87..22af123 100644
--- a/src/mesa/drivers/dri/common/utils.h
+++ b/src/mesa/drivers/dri/common/utils.h
@@ -66,6 +66,6 @@ driIndexConfigAttrib(const __DRIconfig *config, int index,
 unsigned int *attrib, unsigned int *value);
 
 int
-driQueryRendererIntegerCommon(__DRIscreen *psp, int param, int *value);
+driQueryRendererIntegerCommon(__DRIscreen *psp, int param, unsigned int 
*value);
 
 #endif /* DRI_DEBUG_H */
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
b/src/mesa/drivers/dri/i915/intel_screen.c
index 5b84780..0dd6507 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -702,7 +702,7 @@ static struct __DRIimageExtensionRec intelImageExtension = {
 };
 
 static int
-i915_query_renderer_integer(__DRIscreen *psp, int param, int *value)
+i915_query_renderer_integer(__DRIscreen *psp, int param, unsigned int *value)
 {
const struct intel_screen *const intelScreen =
   (struct intel_screen *) psp->driverPrivate;
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
b/src/mesa/drivers/dri/i965/intel_screen.c
index 592150b..4f7584a 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -804,7 +804,7 @@ static struct __DRIimageExtensionRec intelImageExtension = {
 };
 
 static int
-brw_query_renderer_integer(__DRIscreen *psp, int param, int *value)
+brw_query_renderer_integer(__DRIscreen *psp, int param, unsigned int *value)
 {
const struct intel_screen *const intelScreen =
   (struct intel_screen *) psp->driverPrivate;
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 1/4] i915: Use drm_intel_get_aperture_sizes instead of drmAgpSize

2013-11-11 Thread Ian Romanick
From: Ian Romanick 

Send the zombie back to the grave before it infects the townsfolk.

Signed-off-by: Ian Romanick 
Cc: Daniel Vetter 
Cc: "10.0" 
---
 src/mesa/drivers/dri/i915/intel_screen.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
b/src/mesa/drivers/dri/i915/intel_screen.c
index 2c309ed..5b84780 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -722,9 +722,13 @@ i915_query_renderer_integer(__DRIscreen *psp, int param, 
int *value)
* assume that there's some fragmentation, and we start doing extra
* flushing, etc.  That's the big cliff apps will care about.
*/
-  const unsigned long agp_bytes = drmAgpSize(psp->fd);
+  size_t aper_size;
+  size_t mappable_size;
+
+  drm_intel_get_aperture_sizes(psp->fd, &mappable_size, &aper_size);
+
   const unsigned gpu_mappable_megabytes =
- (agp_bytes / (1024 * 1024)) * 3 / 4;
+ (aper_size / (1024 * 1024)) * 3 / 4;
 
   const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
   const long system_page_size = sysconf(_SC_PAGE_SIZE);
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 2/4] i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB

2013-11-11 Thread Ian Romanick
From: Ian Romanick 

Systems with little physical memory installed will report less than
2GiB, and some systems may (hypothetically?) have a larger address space
for the GPU.  My IVB still reports 1534.

Signed-off-by: Ian Romanick 
Cc: Daniel Vetter 
Cc: "10.0" 
---
 src/mesa/drivers/dri/i965/intel_screen.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
b/src/mesa/drivers/dri/i965/intel_screen.c
index e39d654..592150b 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -823,10 +823,14 @@ brw_query_renderer_integer(__DRIscreen *psp, int param, 
int *value)
   /* Once a batch uses more than 75% of the maximum mappable size, we
* assume that there's some fragmentation, and we start doing extra
* flushing, etc.  That's the big cliff apps will care about.
-   *
-   * Can only map 2G onto the GPU through the GTT.
*/
-  const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
+  size_t aper_size;
+  size_t mappable_size;
+
+  drm_intel_get_aperture_sizes(psp->fd, &mappable_size, &aper_size);
+
+  const unsigned gpu_mappable_megabytes =
+ (aper_size / (1024 * 1024)) * 3 / 4;
 
   const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
   const long system_page_size = sysconf(_SC_PAGE_SIZE);
-- 
1.8.1.4

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


Re: [Mesa-dev] [PATCH 07/18] i915: Wire up initial support for DRI_RENDERER_QUERY extension

2013-11-11 Thread Ian Romanick
On 11/09/2013 02:44 AM, Daniel Vetter wrote:
> On Fri, Oct 11, 2013 at 03:10:14PM -0700, Ian Romanick wrote:
>> From: Ian Romanick 
>>
>> Signed-off-by: Ian Romanick 
>> ---
>>  src/mesa/drivers/dri/i915/intel_screen.c | 79 
>> 
>>  1 file changed, 79 insertions(+)
>>
>> diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
>> b/src/mesa/drivers/dri/i915/intel_screen.c
>> index 4f8c342..fa4fdc0 100644
>> --- a/src/mesa/drivers/dri/i915/intel_screen.c
>> +++ b/src/mesa/drivers/dri/i915/intel_screen.c
>> @@ -27,6 +27,7 @@
>>  
>>  #include 
>>  #include 
>> +#include 
>>  #include "main/glheader.h"
>>  #include "main/context.h"
>>  #include "main/framebuffer.h"
>> @@ -741,6 +742,84 @@ static struct __DRIimageExtensionRec 
>> intelImageExtension = {
>>  .createImageFromFds = intel_create_image_from_fds
>>  };
>>  
>> +static int
>> +i915_query_renderer_integer(__DRIscreen *psp, int param, int *value)
>> +{
>> +   const struct intel_screen *const intelScreen =
>> +  (struct intel_screen *) psp->driverPrivate;
>> +
>> +   switch (param) {
>> +   case __DRI2_RENDERER_VENDOR_ID:
>> +  value[0] = 0x8086;
>> +  return 0;
>> +   case __DRI2_RENDERER_DEVICE_ID:
>> +  value[0] = intelScreen->deviceID;
>> +  return 0;
>> +   case __DRI2_RENDERER_ACCELERATED:
>> +  value[0] = 1;
>> +  return 0;
>> +   case __DRI2_RENDERER_VIDEO_MEMORY: {
>> +  struct sysinfo info;
>> +  uint64_t system_memory_bytes;
>> +  unsigned system_memory_megabytes;
>> +
>> +  /* Once a batch uses more than 75% of the maximum mappable size, we
>> +   * assume that there's some fragmentation, and we start doing extra
>> +   * flushing, etc.  That's the big cliff apps will care about.
>> +   */
>> +  const unsigned long agp_bytes = drmAgpSize(psp->fd);
> 
> So despite me shooting at this in the next patch saying that this is
> - the wrong interface, it doesn't actually really tell you what you want
>   to know (since it fails to take pinnned crap into account),
> - doesn't work on half the platforms i915_dri supports already,
> - and is massively deprecated on all others and a major pain for us to
>   keep on live support in the kernel

In fairness, you missed this specific issue on your first review and
shot at it after I committed it. :(  There was no malice... just
timezone fail.  In the future, I'll CC you any Mesa changes that
interact with the kernel so that you'll notice them sooner.

> you've decided to raise this particular zombie and commited it shortly
> before the branch point. Please rip this out asap before it shows up
> anywhere in a release and use the gem aperture ioctl instead.
> 
> That would also fix things for gen4, where the hardwired 2G isn't really
> the truth of things either.
>
> Yours, decently pissed,
> -Daniel

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


Re: [Mesa-dev] [RFC] Haiku viewport / framebuffer invalidation

2013-11-11 Thread Jose Fonseca


- Original Message -
> I've been banging my head against a wall for a while now on this.
> 
> So the Haiku applications that call glViewport(.. for window
> resizes,etc never actually execute the Driver's Viewport call.
> (aka ctx->Driver.Viewport:
> http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/targets/haiku-softpipe/GalliumContext.cpp#n346)
> 
> I found "void GLAPIENTRY _mesa_Viewport" in viewport.c, however I
> have a feeling this never gets called as softpipe is a Gallium
> driver not a Mesa driver.

They execute src/mesa/state_tracker/st_cb_viewport.c

I'm not sure I fully understand the Haiku case, but I suggest you look at the 
WGL state tracker, particular src/gallium/state_trackers/wgl/stw_framebuffer.c 
and friends, as it might be useful for you.

On Windows, we get a callback (stw_call_window_proc) whenever windows get 
resized. We simply note down the new size, and set a flag "must_resize". The 
actual resize happens when stw_framebuffer::validate happens, in 
stw_st_framebuffer_validate. 

I hope this helps.

Jose

> 
> I know there are stamp's in the st_context and st_framebuffer, however
> ++'ing them on a window resize doesn't seem to solve the issue.
> 
> Our libGL actually is aware of window resizes, so I have a fix in that
> manually calls the viewport calls on resize.. however I don't think
> this is a good long term fix as the viewport is always forced to the
> size of the window (which isn't correct was far as I know)
> 
> http://cgit.freedesktop.org/mesa/mesa/commit/?id=e759f1c111018949db114e76ebf1a723525fb802
> 
> Thoughts?
> 
>  -- Alex
> ___
> 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


[Mesa-dev] [PATCH 22/27] targets/xvmc: use drop duplicated compiler flags

2013-11-11 Thread Emil Velikov
Automake.inc already has GALLIUM_VIDEO_CFLAGS, which
provide the essential compiler flags needed.

Note: this commit adds VISIBILITY_CFLAGS to nouveau.

Signed-off-by: Emil Velikov 
---
 src/gallium/targets/r600/xvmc/Makefile.am| 8 +---
 src/gallium/targets/xvmc-nouveau/Makefile.am | 7 +--
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/gallium/targets/r600/xvmc/Makefile.am 
b/src/gallium/targets/r600/xvmc/Makefile.am
index 44cd511..367f597 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -23,13 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 xvmcdir = $(XVMC_LIB_INSTALL_DIR)
 xvmc_LTLIBRARIES = libXvMCr600.la
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index f3d6b1e..37013f1 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -23,12 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 xvmcdir = $(XVMC_LIB_INSTALL_DIR)
 xvmc_LTLIBRARIES = libXvMCnouveau.la
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 24/27] targets/xvmc: consolidate lib deps into Automake.inc

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc | 6 ++
 src/gallium/targets/r600/xvmc/Makefile.am| 5 +
 src/gallium/targets/xvmc-nouveau/Makefile.am | 5 +
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index f33bc37..5ed6a3d 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -57,6 +57,12 @@ GALLIUM_VDPAU_LIB_DEPS = \
$(VDPAU_LIBS) \
$(LIBDRM_LIBS)
 
+GALLIUM_XVMC_LIB_DEPS = \
+   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
+   $(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
+   $(XVMC_LIBS) \
+   $(LIBDRM_LIBS)
+
 GALLIUM_WINSYS_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
diff --git a/src/gallium/targets/r600/xvmc/Makefile.am 
b/src/gallium/targets/r600/xvmc/Makefile.am
index 1a75f52..a21da80 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -36,14 +36,11 @@ libXvMCr600_la_LDFLAGS = \
$(GALLIUM_XVMC_LINKER_FLAGS)
 
 libXvMCr600_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/r600/libr600.la \
-   $(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
+   $(GALLIUM_XVMC_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(XVMC_LIBS) \
-   $(LIBDRM_LIBS) \
$(RADEON_LIBS)
 
 if HAVE_MESA_LLVM
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index 4328c05..bd30e4d 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -37,14 +37,11 @@ libXvMCnouveau_la_LDFLAGS = \
$(GALLIUM_XVMC_LINKER_FLAGS)
 
 libXvMCnouveau_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
-   $(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
+   $(GALLIUM_XVMC_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(XVMC_LIBS) \
-   $(LIBDRM_LIBS) \
$(NOUVEAU_LIBS)
 
 if HAVE_MESA_LLVM
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 21/27] gallium/winsys: compact compiler flags into Automake.inc

2013-11-11 Thread Emil Velikov
Cleanup the duplicating flags and consolidate into a sigle variable.

Note: this patch adds VISIBILITY_CFLAGS to the following targets
* freedreno/drm
* i915/{drm,sw}
* nouveau/drm
* sw/fbdev
* sw/null
* sw/wayland
* sw/wrapper
* sw/xlib

Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc | 6 ++
 src/gallium/winsys/freedreno/drm/Makefile.am | 2 +-
 src/gallium/winsys/i915/drm/Makefile.am  | 3 +--
 src/gallium/winsys/i915/sw/Makefile.am   | 3 +--
 src/gallium/winsys/intel/drm/Makefile.am | 5 ++---
 src/gallium/winsys/nouveau/drm/Makefile.am   | 3 +--
 src/gallium/winsys/radeon/drm/Makefile.am| 6 ++
 src/gallium/winsys/svga/drm/Makefile.am  | 7 ++-
 src/gallium/winsys/sw/dri/Makefile.am| 5 ++---
 src/gallium/winsys/sw/fbdev/Makefile.am  | 4 ++--
 src/gallium/winsys/sw/null/Makefile.am   | 4 ++--
 src/gallium/winsys/sw/wayland/Makefile.am| 4 ++--
 src/gallium/winsys/sw/wrapper/Makefile.am| 4 ++--
 src/gallium/winsys/sw/xlib/Makefile.am   | 4 ++--
 14 files changed, 28 insertions(+), 32 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 86e9b1e..f67b295 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -50,3 +50,9 @@ GALLIUM_VDPAU_LIB_DEPS = \
$(VDPAU_LIBS) \
$(LIBDRM_LIBS)
 
+GALLIUM_WINSYS_CFLAGS = \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   $(DEFINES) \
+   $(VISIBILITY_CFLAGS)
diff --git a/src/gallium/winsys/freedreno/drm/Makefile.am 
b/src/gallium/winsys/freedreno/drm/Makefile.am
index 8a74dcd..cf4c24c 100644
--- a/src/gallium/winsys/freedreno/drm/Makefile.am
+++ b/src/gallium/winsys/freedreno/drm/Makefile.am
@@ -25,7 +25,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
+   $(GALLIUM_WINSYS_CFLAGS) \
$(FREEDRENO_CFLAGS)
 
 noinst_LTLIBRARIES = libfreedrenodrm.la
diff --git a/src/gallium/winsys/i915/drm/Makefile.am 
b/src/gallium/winsys/i915/drm/Makefile.am
index 7a64925..82c477d 100644
--- a/src/gallium/winsys/i915/drm/Makefile.am
+++ b/src/gallium/winsys/i915/drm/Makefile.am
@@ -24,9 +24,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
+   $(GALLIUM_WINSYS_CFLAGS) \
$(INTEL_CFLAGS)
 
 noinst_LTLIBRARIES = libi915drm.la
diff --git a/src/gallium/winsys/i915/sw/Makefile.am 
b/src/gallium/winsys/i915/sw/Makefile.am
index 186fee3..39f6022 100644
--- a/src/gallium/winsys/i915/sw/Makefile.am
+++ b/src/gallium/winsys/i915/sw/Makefile.am
@@ -24,9 +24,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
+   $(GALLIUM_WINSYS_CFLAGS) \
$(INTEL_CFLAGS)
 
 noinst_LTLIBRARIES = libi915sw.la
diff --git a/src/gallium/winsys/intel/drm/Makefile.am 
b/src/gallium/winsys/intel/drm/Makefile.am
index 3c4a271..30f4486 100644
--- a/src/gallium/winsys/intel/drm/Makefile.am
+++ b/src/gallium/winsys/intel/drm/Makefile.am
@@ -25,9 +25,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(INTEL_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_WINSYS_CFLAGS) \
+   $(INTEL_CFLAGS)
 
 noinst_LTLIBRARIES = libintelwinsys.la
 
diff --git a/src/gallium/winsys/nouveau/drm/Makefile.am 
b/src/gallium/winsys/nouveau/drm/Makefile.am
index f9645f5..9c94ea4 100644
--- a/src/gallium/winsys/nouveau/drm/Makefile.am
+++ b/src/gallium/winsys/nouveau/drm/Makefile.am
@@ -24,9 +24,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
+   $(GALLIUM_WINSYS_CFLAGS) \
$(NOUVEAU_CFLAGS)
 
 noinst_LTLIBRARIES = libnouveaudrm.la
diff --git a/src/gallium/winsys/radeon/drm/Makefile.am 
b/src/gallium/winsys/radeon/drm/Makefile.am
index d5c5474..b413b0b 100644
--- a/src/gallium/winsys/radeon/drm/Makefile.am
+++ b/src/gallium/winsys/radeon/drm/Makefile.am
@@ -2,10 +2,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/include \
-   $(GALLIUM_CFLAGS) \
-   $(RADEON_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_WINSYS_CFLAGS) \
+   $(RADEON_CFLAGS)
 
 noinst_LTLIBRARIES = libradeonwinsys.la
 
diff --git a/src/gallium/winsys/svga/drm/Makefile.am 
b/src/gallium/winsys/svga/drm/Makefile.am
index d7ada3c..69398b8 100644
--- a/src/gallium/winsys/svga/drm/Makefile.am
+++ b/src/gallium/winsys/svga/drm/Makefile.am
@@ -23,16 +23,13 @@
 include Makefile.sources
 i

[Mesa-dev] [PATCH 03/27] scons: drop obsolete enabled_apis variable

2013-11-11 Thread Emil Velikov
The variable was forgotten during the FEATURE_* removal.

Signed-off-by: Emil Velikov 
---
 src/mesa/SConscript | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index 4213498..a2bb9f1 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -18,9 +18,6 @@ env.Append(CPPPATH = [
 Dir('.'), # src/mesa build path
 ])
 
-enabled_apis = []
-enabled_apis += ['GL']
-
 if env['platform'] == 'windows':
 env.Append(CPPDEFINES = [
 '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS 
headers
@@ -340,10 +337,6 @@ mesa_sources = (
 
 GLAPI = '#src/mapi/glapi/'
 
-if env['gles']:
-
-enabled_apis += ['ES1', 'ES2']
-
 get_hash_header = env.CodeGenerate(
   target = 'main/get_hash.h',
   script = 'main/get_hash_generator.py',
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 06/27] gbm: enable subdir-objects to prevent automake warnings

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gbm/Makefile.am | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
index 1282b14..9b3fb0d 100644
--- a/src/gbm/Makefile.am
+++ b/src/gbm/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = main/gbm.pc
 
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 05/27] scons: move SConscript from gallium/targets/ to mesa/drivers/dri/common/

2013-11-11 Thread Emil Velikov
Store scons side by side with the other build systems.

v2: cleanup after a failed rebase

Signed-off-by: Emil Velikov 
---
 src/gallium/SConscript |  1 -
 src/gallium/targets/SConscript.dri | 83 --
 src/mesa/drivers/SConscript|  5 +-
 src/mesa/drivers/dri/common/SConscript | 83 ++
 4 files changed, 87 insertions(+), 85 deletions(-)
 delete mode 100644 src/gallium/targets/SConscript.dri
 create mode 100644 src/mesa/drivers/dri/common/SConscript

diff --git a/src/gallium/SConscript b/src/gallium/SConscript
index c68519d..6e27be2 100644
--- a/src/gallium/SConscript
+++ b/src/gallium/SConscript
@@ -124,7 +124,6 @@ if not env['embedded']:
 
 if env['dri']:
 SConscript([
-'targets/SConscript.dri',
 'targets/dri-swrast/SConscript',
 'targets/dri-vmwgfx/SConscript',
 ])
diff --git a/src/gallium/targets/SConscript.dri 
b/src/gallium/targets/SConscript.dri
deleted file mode 100644
index 8b15532..000
--- a/src/gallium/targets/SConscript.dri
+++ /dev/null
@@ -1,83 +0,0 @@
-###
-# SConcscript file for dri targets
-
-Import('*')
-
-drienv = env.Clone()
-
-drienv.Replace(CPPPATH = [
-'#src/mesa/drivers/dri/common',
-xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
-'#include',
-'#include/GL/internal',
-'#src/mapi',
-'#src/gallium/include',
-'#src/gallium/auxiliary',
-'#src/gallium/drivers',
-'#src/gallium/winsys',
-'#src/mesa',
-'#src/mesa/main',
-'#src/mesa/glapi',
-'#src/mesa/math',
-'#src/mesa/transform',
-'#src/mesa/shader',
-'#src/mesa/swrast',
-'#src/mesa/swrast_setup',
-'#src/egl/main',
-'#src/egl/drivers/dri',
-])
-
-driswenv = drienv.Clone()
-driswenv.Append(CPPDEFINES = [
-'__NOT_HAVE_DRM_H',
-])
-
-drienv.PkgUseModules('DRM')
-
-dri_common_utils = drienv.SharedObject(
-target = 'utils.o',
-source = '#src/mesa/drivers/dri/common/utils.c'
-)
-
-dri_common_xmlconfig = drienv.SharedObject(
-target = 'xmlconfig.o',
-source = '#src/mesa/drivers/dri/common/xmlconfig.c'
-)
-
-dri_common_dri_util = drienv.SharedObject(
-target = 'dri_util.o',
-source = '#src/mesa/drivers/dri/common/dri_util.c'
-)
-
-dri_common_drisw_util = driswenv.SharedObject(
-target = 'drisw_util.o',
-source = '#src/mesa/drivers/dri/common/dri_util.c'
-)
-
-
-COMMON_DRI_SW_OBJECTS = [
-dri_common_utils,
-dri_common_xmlconfig,
-dri_common_drisw_util,
-]
-
-COMMON_DRI_DRM_OBJECTS = [
-dri_common_utils,
-dri_common_xmlconfig,
-dri_common_dri_util,
-]
-
-drienv.AppendUnique(LIBS = [
-'expat',
-])
-
-driswenv.AppendUnique(LIBS = [
-'expat',
-])
-
-Export([
-'drienv',
-'driswenv',
-'COMMON_DRI_SW_OBJECTS',
-'COMMON_DRI_DRM_OBJECTS',
-])
diff --git a/src/mesa/drivers/SConscript b/src/mesa/drivers/SConscript
index 355e680..5db5957 100644
--- a/src/mesa/drivers/SConscript
+++ b/src/mesa/drivers/SConscript
@@ -6,7 +6,10 @@ if env['x11']:
 SConscript('x11/SConscript')
 
 if env['dri']:
-SConscript('dri/common/xmlpool/SConscript')
+SConscript([
+'dri/common/xmlpool/SConscript',
+'dri/common/SConscript',
+])
 
 if env['platform'] == 'windows':
 SConscript('windows/gdi/SConscript')
diff --git a/src/mesa/drivers/dri/common/SConscript 
b/src/mesa/drivers/dri/common/SConscript
new file mode 100644
index 000..8b15532
--- /dev/null
+++ b/src/mesa/drivers/dri/common/SConscript
@@ -0,0 +1,83 @@
+###
+# SConcscript file for dri targets
+
+Import('*')
+
+drienv = env.Clone()
+
+drienv.Replace(CPPPATH = [
+'#src/mesa/drivers/dri/common',
+xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
+'#include',
+'#include/GL/internal',
+'#src/mapi',
+'#src/gallium/include',
+'#src/gallium/auxiliary',
+'#src/gallium/drivers',
+'#src/gallium/winsys',
+'#src/mesa',
+'#src/mesa/main',
+'#src/mesa/glapi',
+'#src/mesa/math',
+'#src/mesa/transform',
+'#src/mesa/shader',
+'#src/mesa/swrast',
+'#src/mesa/swrast_setup',
+'#src/egl/main',
+'#src/egl/drivers/dri',
+])
+
+driswenv = drienv.Clone()
+driswenv.Append(CPPDEFINES = [
+'__NOT_HAVE_DRM_H',
+])
+
+drienv.PkgUseModules('DRM')
+
+dri_common_utils = drienv.SharedObject(
+target = 'utils.o',
+source = '#src/mesa/drivers/dri/common/utils.c'
+)
+
+dri_common_xmlconfig = drienv.SharedObject(
+target = 'xmlconfig.o',
+source = '#src/mesa/drivers/dri/common/xmlconfig.c'
+)
+
+dri_common_dri_util = drienv.SharedObject(
+target = 'dri_util.o',
+source = '#src/mesa/drivers/dri/common/dri_util.c'
+)
+
+dri_common_drisw_util = driswenv.SharedObject(
+target = 'drisw_util.o',
+source = '#src/mesa/drivers/dri/common/dri_util.c'
+)
+
+
+COMMON_DRI_SW_OBJECTS = [
+dri_common_utils,
+dri_common_xmlco

[Mesa-dev] [PATCH 27/27] targets/dri: move linker flags out of configure into Automake.inc

2013-11-11 Thread Emil Velikov
Previous assumption was that the same set of flags can be reused
for both classic and gallium drivers. With megadriver work done
the classic drivers ended up using their own (single) instance of
the flags.

Move these into Automake.inc and rename to indicate that those
are gallium specific. Additionally silence an automake/autoconf
warning "XXX is not a standard libtool library name", due to
the parsing issues of the module tag.

Signed-off-by: Emil Velikov 
---
 configure.ac  | 2 --
 src/gallium/Automake.inc  | 8 
 src/gallium/targets/dri-freedreno/Makefile.am | 2 +-
 src/gallium/targets/dri-i915/Makefile.am  | 2 +-
 src/gallium/targets/dri-ilo/Makefile.am   | 2 +-
 src/gallium/targets/dri-nouveau/Makefile.am   | 2 +-
 src/gallium/targets/dri-swrast/Makefile.am| 2 +-
 src/gallium/targets/dri-vmwgfx/Makefile.am| 2 +-
 src/gallium/targets/r300/dri/Makefile.am  | 2 +-
 src/gallium/targets/r600/dri/Makefile.am  | 2 +-
 src/gallium/targets/radeonsi/dri/Makefile.am  | 2 +-
 11 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index b126bb0..b12ab70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1050,7 +1050,6 @@ if test "x$enable_dri" = xyes; then
 DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm 
$PTHREAD_LIBS $DLOPEN_LIBS"
 GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS 
$EXPAT_LIBS -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
 
-DRI_DRIVER_LDFLAGS="-module -avoid-version -shared -Wl,-Bsymbolic"
 fi
 
 AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
@@ -1058,7 +1057,6 @@ AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = 
xyes -o \
   "x$enable_osmesa" = xyes -o \
   -n "$DRI_DIRS")
 AC_SUBST([DRI_LIB_DEPS])
-AC_SUBST([DRI_DRIVER_LDFLAGS])
 AC_SUBST([GALLIUM_DRI_LIB_DEPS])
 
 case $DRI_DIRS in
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 2a3ad21..b6b9b36 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -50,6 +50,14 @@ GALLIUM_VIDEO_CFLAGS = \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
 
+
+# TODO: add -export-symbols-regex
+GALLIUM_DRI_LINKER_FLAGS = \
+   -module \
+   -avoid-version \
+   -shared \
+   -Wl,-Bsymbolic
+
 GALLIUM_VDPAU_LINKER_FLAGS = \
-module \
-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
diff --git a/src/gallium/targets/dri-freedreno/Makefile.am 
b/src/gallium/targets/dri-freedreno/Makefile.am
index 2708dd3..94500b0 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -32,7 +32,7 @@ AM_CPPFLAGS = \
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = kgsl_dri.la msm_dri.la
 
-COMMON_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
+COMMON_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
 
 COMMON_LIBADD = \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index 582c270..3f8468f 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -35,7 +35,7 @@ dri_LTLIBRARIES = i915_dri.la
 
 i915_dri_la_SOURCES = target.c
 
-i915_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
+i915_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
 
 i915_dri_la_LIBADD = \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
diff --git a/src/gallium/targets/dri-ilo/Makefile.am 
b/src/gallium/targets/dri-ilo/Makefile.am
index 3633d08..418e2ea 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -35,7 +35,7 @@ noinst_LTLIBRARIES = ilo_dri.la
 ilo_dri_la_SOURCES = target.c
 
 # need -rpath to create a noinst shared library
-ilo_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS) \
+ilo_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS) \
 -rpath $(abs_builddir)
 
 ilo_dri_la_LIBADD = \
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am 
b/src/gallium/targets/dri-nouveau/Makefile.am
index 120e242..1988067 100644
--- a/src/gallium/targets/dri-nouveau/Makefile.am
+++ b/src/gallium/targets/dri-nouveau/Makefile.am
@@ -34,7 +34,7 @@ dri_LTLIBRARIES = nouveau_dri.la
 nodist_EXTRA_nouveau_dri_la_SOURCES = dummy.cpp
 nouveau_dri_la_SOURCES = target.c
 
-nouveau_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
+nouveau_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
 
 nouveau_dri_la_LIBADD = \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
diff --git a/src/gallium/targets/dri-swrast/Makefile.am 
b/src/gallium/targets/dri-swrast/Makefile.am
index 11166ae..ec1576b 100644
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ b/src/gallium/targets/dri-swrast/Makefile.am
@@ -42,7 +42,7 @@ swrast_dri_la_SOURCES = \
$(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
$(top_srcdir)/src/mesa/drivers/dri/comm

[Mesa-dev] [PATCH 11/27] r300: move the final sources list to Makefile.sources

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/r300/Makefile.am  | 13 ++---
 src/gallium/drivers/r300/Makefile.sources | 14 +-
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/r300/Makefile.am 
b/src/gallium/drivers/r300/Makefile.am
index 524df24..4edeb47 100644
--- a/src/gallium/drivers/r300/Makefile.am
+++ b/src/gallium/drivers/r300/Makefile.am
@@ -3,7 +3,6 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 noinst_LTLIBRARIES = libr300.la libr300-helper.la
 check_PROGRAMS = r300_compiler_tests
-testdir = compiler/tests
 TESTS = r300_compiler_tests
 
 AM_CFLAGS = \
@@ -22,13 +21,7 @@ r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
$(GALLIUM_DRI_LIB_DEPS)
 r300_compiler_tests_CPPFLAGS = \
-I$(top_srcdir)/src/gallium/drivers/r300/compiler
-r300_compiler_tests_SOURCES = \
-   $(testdir)/r300_compiler_tests.c \
-   $(testdir)/radeon_compiler_optimize_tests.c \
-   $(testdir)/radeon_compiler_regalloc_tests.c \
-   $(testdir)/radeon_compiler_util_tests.c \
-   $(testdir)/rc_test_helpers.c \
-   $(testdir)/unit_test.c
+r300_compiler_tests_SOURCES = $(COMPILER_TESTS_SOURCES)
 
 libr300_la_SOURCES = $(C_SOURCES)
 
@@ -39,6 +32,4 @@ libr300_la_SOURCES = $(C_SOURCES)
 #
 # Solve this by building them into a separate helper library that can be linked
 # in place of libmesagallium.
-libr300_helper_la_SOURCES = \
-   ralloc.c \
-   register_allocate.c
+libr300_helper_la_SOURCES = $(HELPER_SOURCES)
diff --git a/src/gallium/drivers/r300/Makefile.sources 
b/src/gallium/drivers/r300/Makefile.sources
index 10ceffb..0e9ab52 100644
--- a/src/gallium/drivers/r300/Makefile.sources
+++ b/src/gallium/drivers/r300/Makefile.sources
@@ -1,4 +1,4 @@
-C_SOURCES = \
+C_SOURCES := \
r300_blit.c \
r300_chipset.c \
r300_context.c \
@@ -57,3 +57,15 @@ C_SOURCES = \
compiler/r3xx_vertprog.c \
compiler/r3xx_vertprog_dump.c \
compiler/memory_pool.c
+
+COMPILER_TESTS_SOURCES := \
+   compiler/tests/r300_compiler_tests.c \
+   compiler/tests/radeon_compiler_optimize_tests.c \
+   compiler/tests/radeon_compiler_regalloc_tests.c \
+   compiler/tests/radeon_compiler_util_tests.c \
+   compiler/tests/rc_test_helpers.c \
+   compiler/tests/unit_test.c
+
+HELPER_SOURCES := \
+   ralloc.c \
+   register_allocate.c
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 01/27] st/egl: use *_FILE over *_SOURCES names for filelists

2013-11-11 Thread Emil Velikov
Silence automake warnings about missing program/library whenever
the _SOURCES suffix is used for temporary variable names.

  warning: variable 'gdi_SOURCES' is defined but no program or
  library has 'gdi' as canonical name (possible typo)

Reported-by: Ilia Mirkin 
Reported-by: Johannes Obermayr 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70581
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/egl/Android.mk   |  6 +++---
 src/gallium/state_trackers/egl/Makefile.am  | 12 ++--
 src/gallium/state_trackers/egl/Makefile.sources | 18 +-
 src/gallium/state_trackers/egl/SConscript   | 10 +-
 4 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/gallium/state_trackers/egl/Android.mk 
b/src/gallium/state_trackers/egl/Android.mk
index 2627608..b27e14b 100644
--- a/src/gallium/state_trackers/egl/Android.mk
+++ b/src/gallium/state_trackers/egl/Android.mk
@@ -23,14 +23,14 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# get common_SOURCES, android_SOURCES
+# get common_FILES, android_FILES
 include $(LOCAL_PATH)/Makefile.sources
 
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := \
-   $(common_SOURCES) \
-   $(android_SOURCES)
+   $(common_FILES) \
+   $(android_FILES)
 
 LOCAL_CFLAGS := -DHAVE_ANDROID_BACKEND
 
diff --git a/src/gallium/state_trackers/egl/Makefile.am 
b/src/gallium/state_trackers/egl/Makefile.am
index da360bb..c069c29 100644
--- a/src/gallium/state_trackers/egl/Makefile.am
+++ b/src/gallium/state_trackers/egl/Makefile.am
@@ -32,10 +32,10 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include
 
 noinst_LTLIBRARIES = libegl.la
-libegl_la_SOURCES = $(common_SOURCES)
+libegl_la_SOURCES = $(common_FILES)
 
 if HAVE_EGL_PLATFORM_X11
-libegl_la_SOURCES += $(x11_SOURCES) $(x11_drm_SOURCES)
+libegl_la_SOURCES += $(x11_FILES) $(x11_drm_FILES)
 AM_CFLAGS += \
$(X11_INCLUDES) \
$(LIBDRM_CFLAGS) \
@@ -49,7 +49,7 @@ AM_CPPFLAGS += \
 endif
 
 if HAVE_EGL_PLATFORM_WAYLAND
-libegl_la_SOURCES += $(wayland_SOURCES)
+libegl_la_SOURCES += $(wayland_FILES)
 AM_CFLAGS += \
$(LIBDRM_CFLAGS) \
$(WAYLAND_CFLAGS)
@@ -62,7 +62,7 @@ AM_CPPFLAGS += \
 endif
 
 if HAVE_EGL_PLATFORM_DRM
-libegl_la_SOURCES += $(drm_SOURCES)
+libegl_la_SOURCES += $(drm_FILES)
 AM_CFLAGS += \
$(LIBDRM_CFLAGS)
 AM_CPPFLAGS += \
@@ -73,14 +73,14 @@ AM_CPPFLAGS += \
 endif
 
 if HAVE_EGL_PLATFORM_FBDEV
-libegl_la_SOURCES += $(fbdev_SOURCES)
+libegl_la_SOURCES += $(fbdev_FILES)
 AM_CPPFLAGS += \
-I$(top_srcdir)/src/gallium/winsys/sw \
-DHAVE_FBDEV_BACKEND
 endif
 
 if HAVE_EGL_PLATFORM_NULL
-libegl_la_SOURCES += $(null_SOURCES)
+libegl_la_SOURCES += $(null_FILES)
 AM_CPPFLAGS += \
-I$(top_srcdir)/src/gallium/winsys/sw \
-DHAVE_NULL_BACKEND
diff --git a/src/gallium/state_trackers/egl/Makefile.sources 
b/src/gallium/state_trackers/egl/Makefile.sources
index aaf6b8b..2f60b3a 100644
--- a/src/gallium/state_trackers/egl/Makefile.sources
+++ b/src/gallium/state_trackers/egl/Makefile.sources
@@ -1,4 +1,4 @@
-common_SOURCES := \
+common_FILES := \
common/egl_g3d_api.c \
common/egl_g3d.c \
common/egl_g3d_image.c \
@@ -7,33 +7,33 @@ common_SOURCES := \
common/native_helper.c \
common/native_wayland_drm_bufmgr.c
 
-android_SOURCES := \
+android_FILES := \
android/native_android.cpp
 
-drm_SOURCES := \
+drm_FILES := \
drm/modeset.c \
drm/native_drm.c
 
-fbdev_SOURCES := \
+fbdev_FILES := \
fbdev/native_fbdev.c
 
-gdi_SOURCES := \
+gdi_FILES := \
gdi/native_gdi.c
 
-null_SOURCES := \
+null_FILES := \
null/native_null.c
 
-x11_SOURCES := \
+x11_FILES := \
x11/glxinit.c \
x11/native_dri2.c \
x11/native_x11.c \
x11/native_ximage.c
 
-x11_drm_SOURCES := \
+x11_drm_FILES := \
x11/x11_screen.c \
x11/dri2.c
 
-wayland_SOURCES := \
+wayland_FILES := \
wayland/native_drm.c \
wayland/native_shm.c \
wayland/native_wayland.c
diff --git a/src/gallium/state_trackers/egl/SConscript 
b/src/gallium/state_trackers/egl/SConscript
index b86f8b5..bd0ee02 100644
--- a/src/gallium/state_trackers/egl/SConscript
+++ b/src/gallium/state_trackers/egl/SConscript
@@ -11,11 +11,11 @@ env.Append(CPPPATH = [
 '.',
 ])
 
-sources = env.ParseSourceList('Makefile.sources', 'common_SOURCES')
+sources = env.ParseSourceList('Makefile.sources', 'common_FILES')
 
 if env['platform'] == 'windows':
 env.Append(CPPDEFINES = ['HAVE_GDI_BACKEND'])
-sources.append(env.ParseSourceList('Makefile.sources', 'gdi_SOURCES'))
+sources.append(env.ParseSourceList('Makefile.sources', 'gdi_FILES'))
 else:
 if env['drm']:
 env.PkgUseModules('DRM')
@@ -25,10 +25,10 @@ else:
 '#/src/glx',
 '#/src/mapi',
 ])
-sources.append(env.ParseSourceList('Makefile.sources', 'x11_SOURCES'))
+sources.append(env.ParseSourceList('Makefile.sources', 'x11_FILES'

[Mesa-dev] [PATCH 10/27] r300: add symlink to ralloc.c and register_allocate.c

2013-11-11 Thread Emil Velikov
Make automake's subdir-objects work.
Update includes.

Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/r300/Makefile.am | 6 +++---
 src/gallium/drivers/r300/ralloc.c| 1 +
 src/gallium/drivers/r300/register_allocate.c | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)
 create mode 12 src/gallium/drivers/r300/ralloc.c
 create mode 12 src/gallium/drivers/r300/register_allocate.c

diff --git a/src/gallium/drivers/r300/Makefile.am 
b/src/gallium/drivers/r300/Makefile.am
index 14aaf03..524df24 100644
--- a/src/gallium/drivers/r300/Makefile.am
+++ b/src/gallium/drivers/r300/Makefile.am
@@ -8,7 +8,7 @@ TESTS = r300_compiler_tests
 
 AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/mesa/program \
-I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/src/glsl \
-I$(top_srcdir)/src/mapi \
@@ -40,5 +40,5 @@ libr300_la_SOURCES = $(C_SOURCES)
 # Solve this by building them into a separate helper library that can be linked
 # in place of libmesagallium.
 libr300_helper_la_SOURCES = \
-   $(top_srcdir)/src/glsl/ralloc.c \
-   $(top_srcdir)/src/mesa/program/register_allocate.c
+   ralloc.c \
+   register_allocate.c
diff --git a/src/gallium/drivers/r300/ralloc.c 
b/src/gallium/drivers/r300/ralloc.c
new file mode 12
index 000..c5402db
--- /dev/null
+++ b/src/gallium/drivers/r300/ralloc.c
@@ -0,0 +1 @@
+../../../glsl/ralloc.c
\ No newline at end of file
diff --git a/src/gallium/drivers/r300/register_allocate.c 
b/src/gallium/drivers/r300/register_allocate.c
new file mode 12
index 000..2117950
--- /dev/null
+++ b/src/gallium/drivers/r300/register_allocate.c
@@ -0,0 +1 @@
+../../../mesa/program/register_allocate.c
\ No newline at end of file
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 17/27] targets/vdpau: compact compiler flags into Automake.inc

2013-11-11 Thread Emil Velikov
Store the compiler flags into a variable, in order to minimise
flags duplication (amongst vdpau and xvmc).

Note: this commit add VISIBILITY_CFLAGS to the nouveau target

Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc   | 11 +++
 src/gallium/targets/r600/vdpau/Makefile.am |  8 +---
 src/gallium/targets/radeonsi/vdpau/Makefile.am |  8 +---
 src/gallium/targets/vdpau-nouveau/Makefile.am  |  7 +--
 4 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 5cb0b26..b242bb4 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -25,3 +25,14 @@ GALLIUM_DRIVER_CXXFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
$(DEFINES) \
$(VISIBILITY_CXXFLAGS)
+
+GALLIUM_VIDEO_CFLAGS = \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   -I$(top_srcdir)/src/gallium/drivers \
+   -I$(top_srcdir)/src/gallium/winsys \
+   $(DEFINES) \
+   $(PTHREAD_CFLAGS) \
+   $(LIBDRM_CFLAGS) \
+   $(VISIBILITY_CFLAGS)
diff --git a/src/gallium/targets/r600/vdpau/Makefile.am 
b/src/gallium/targets/r600/vdpau/Makefile.am
index 70af0bf..742df52 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -23,13 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_r600.la
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am 
b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index a4d97fe..9b14634 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -23,13 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_radeonsi.la
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index 213725a..20eb920 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -23,12 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_nouveau.la
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 20/27] targets/vdpau: drop unused libraries from linker

2013-11-11 Thread Emil Velikov
In order for one to use trace, noop, rbug and/or galahad, they must
set the corresponding GALLIUM_* CFLAG.

Signed-off-by: Emil Velikov 
---
 src/gallium/targets/r600/vdpau/Makefile.am | 1 -
 src/gallium/targets/radeonsi/vdpau/Makefile.am | 3 ---
 src/gallium/targets/vdpau-nouveau/Makefile.am  | 1 -
 3 files changed, 5 deletions(-)

diff --git a/src/gallium/targets/r600/vdpau/Makefile.am 
b/src/gallium/targets/r600/vdpau/Makefile.am
index 5d63eed..7f43fbb 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -40,7 +40,6 @@ libvdpau_r600_la_LDFLAGS = \
 libvdpau_r600_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/r600/libr600.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(RADEON_LIBS)
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am 
b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index 22d3c28..0292b2b 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -41,9 +41,6 @@ libvdpau_radeonsi_la_LDFLAGS = \
 libvdpau_radeonsi_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
-   $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
-   $(top_builddir)/src/gallium/drivers/noop/libnoop.la \
$(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(RADEON_LIBS)
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index 001cb4e..fbaad03 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -41,7 +41,6 @@ libvdpau_nouveau_la_LDFLAGS = \
 libvdpau_nouveau_la_LIBADD = \
$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(NOUVEAU_LIBS)
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 04/27] freedreno: compact a2xx and a3xx makefiles into parent ones

2013-11-11 Thread Emil Velikov
From: Johannes Obermayr 

Nearly everything within the three Makefile.am's is identical.
Let's simplify things a little.

v2: Rebase and rewrite the commit message (Emil Velikov)

Signed-off-by: Emil Velikov 
---
 configure.ac   |  2 --
 src/gallium/drivers/freedreno/Makefile.am  | 12 +++-
 src/gallium/drivers/freedreno/Makefile.sources | 32 ++
 src/gallium/drivers/freedreno/a2xx/Makefile.am | 14 --
 .../drivers/freedreno/a2xx/Makefile.sources| 15 --
 src/gallium/drivers/freedreno/a3xx/Makefile.am | 14 --
 .../drivers/freedreno/a3xx/Makefile.sources| 15 --
 7 files changed, 36 insertions(+), 68 deletions(-)
 delete mode 100644 src/gallium/drivers/freedreno/a2xx/Makefile.am
 delete mode 100644 src/gallium/drivers/freedreno/a2xx/Makefile.sources
 delete mode 100644 src/gallium/drivers/freedreno/a3xx/Makefile.am
 delete mode 100644 src/gallium/drivers/freedreno/a3xx/Makefile.sources

diff --git a/configure.ac b/configure.ac
index f756b73..b126bb0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1981,8 +1981,6 @@ AC_CONFIG_FILES([Makefile
src/gallium/auxiliary/pipe-loader/Makefile
src/gallium/drivers/Makefile
src/gallium/drivers/freedreno/Makefile
-   src/gallium/drivers/freedreno/a2xx/Makefile
-   src/gallium/drivers/freedreno/a3xx/Makefile
src/gallium/drivers/galahad/Makefile
src/gallium/drivers/i915/Makefile
src/gallium/drivers/identity/Makefile
diff --git a/src/gallium/drivers/freedreno/Makefile.am 
b/src/gallium/drivers/freedreno/Makefile.am
index 9f5a80a..22fd790 100644
--- a/src/gallium/drivers/freedreno/Makefile.am
+++ b/src/gallium/drivers/freedreno/Makefile.am
@@ -12,11 +12,7 @@ AM_CFLAGS = \
$(FREEDRENO_CFLAGS) \
$(VISIBILITY_CFLAGS)
 
-SUBDIRS = a2xx a3xx
-
-libfreedreno_la_SOURCES = $(C_SOURCES)
-
-libfreedreno_la_LIBADD = \
-   a3xx/libfd3xx.la \
-   a2xx/libfd2xx.la
-
+libfreedreno_la_SOURCES = \
+   $(C_SOURCES) \
+   $(a2xx_SOURCES) \
+   $(a3xx_SOURCES)
diff --git a/src/gallium/drivers/freedreno/Makefile.sources 
b/src/gallium/drivers/freedreno/Makefile.sources
index 02a88b6..e54bff0 100644
--- a/src/gallium/drivers/freedreno/Makefile.sources
+++ b/src/gallium/drivers/freedreno/Makefile.sources
@@ -9,3 +9,35 @@ C_SOURCES := \
freedreno_context.c \
freedreno_screen.c \
freedreno_gmem.c
+
+a2xx_SOURCES := \
+   a2xx/fd2_blend.c \
+   a2xx/fd2_compiler.c \
+   a2xx/fd2_context.c \
+   a2xx/fd2_draw.c \
+   a2xx/fd2_emit.c \
+   a2xx/fd2_gmem.c \
+   a2xx/fd2_program.c \
+   a2xx/fd2_rasterizer.c \
+   a2xx/fd2_screen.c \
+   a2xx/fd2_texture.c \
+   a2xx/fd2_util.c \
+   a2xx/fd2_zsa.c \
+   a2xx/disasm-a2xx.c \
+   a2xx/ir-a2xx.c
+
+a3xx_SOURCES := \
+   a3xx/fd3_blend.c \
+   a3xx/fd3_compiler.c \
+   a3xx/fd3_context.c \
+   a3xx/fd3_draw.c \
+   a3xx/fd3_emit.c \
+   a3xx/fd3_gmem.c \
+   a3xx/fd3_program.c \
+   a3xx/fd3_rasterizer.c \
+   a3xx/fd3_screen.c \
+   a3xx/fd3_texture.c \
+   a3xx/fd3_util.c \
+   a3xx/fd3_zsa.c \
+   a3xx/disasm-a3xx.c \
+   a3xx/ir-a3xx.c
diff --git a/src/gallium/drivers/freedreno/a2xx/Makefile.am 
b/src/gallium/drivers/freedreno/a2xx/Makefile.am
deleted file mode 100644
index b8a5ac1..000
--- a/src/gallium/drivers/freedreno/a2xx/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-include Makefile.sources
-include $(top_srcdir)/src/gallium/Automake.inc
-
-noinst_LTLIBRARIES = libfd2xx.la
-
-AM_CFLAGS = \
-   -Wno-packed-bitfield-compat \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/drivers/freedreno \
-   $(GALLIUM_CFLAGS) \
-   $(FREEDRENO_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
-
-libfd2xx_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/freedreno/a2xx/Makefile.sources 
b/src/gallium/drivers/freedreno/a2xx/Makefile.sources
deleted file mode 100644
index 1ef2852..000
--- a/src/gallium/drivers/freedreno/a2xx/Makefile.sources
+++ /dev/null
@@ -1,15 +0,0 @@
-C_SOURCES := \
-   fd2_blend.c \
-   fd2_compiler.c \
-   fd2_context.c \
-   fd2_draw.c \
-   fd2_emit.c \
-   fd2_gmem.c \
-   fd2_program.c \
-   fd2_rasterizer.c \
-   fd2_screen.c \
-   fd2_texture.c \
-   fd2_util.c \
-   fd2_zsa.c \
-   disasm-a2xx.c \
-   ir-a2xx.c
diff --git a/src/gallium/drivers/freedreno/a3xx/Makefile.am 
b/src/gallium/drivers/freedreno/a3xx/Makefile.am
deleted file mode 100644
index 6b8b2e4..000
--- a/src/gallium/drivers/freedreno/a3xx/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-include Makefile.sources
-include $(top_srcdir)/src/gallium/Automake.inc
-
-noinst_LTLIBRARIES = libfd3xx.la
-
-AM_CFLAGS = \
-   -Wno-packed-bitfield-compat \
-   -I$(

[Mesa-dev] [PATCH 19/27] targets/vdpau: consolidate lib deps into Automake.inc

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc   | 7 +++
 src/gallium/targets/r600/vdpau/Makefile.am | 5 +
 src/gallium/targets/radeonsi/vdpau/Makefile.am | 5 +
 src/gallium/targets/vdpau-nouveau/Makefile.am  | 5 +
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 765fdd2..86e9b1e 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -43,3 +43,10 @@ GALLIUM_VDPAU_LINKER_FLAGS = \
-export-symbols-regex $(VDPAU_EXPORTS) \
-shared \
-no-undefined
+
+GALLIUM_VDPAU_LIB_DEPS = \
+   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
+   $(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
+   $(VDPAU_LIBS) \
+   $(LIBDRM_LIBS)
+
diff --git a/src/gallium/targets/r600/vdpau/Makefile.am 
b/src/gallium/targets/r600/vdpau/Makefile.am
index 3a65a6f..5d63eed 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -38,14 +38,11 @@ libvdpau_r600_la_LDFLAGS = \
$(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_r600_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/r600/libr600.la \
-   $(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
+   $(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(VDPAU_LIBS) \
-   $(LIBDRM_LIBS) \
$(RADEON_LIBS)
 
 if HAVE_MESA_LLVM
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am 
b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index cd4dcfc..22d3c28 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -39,16 +39,13 @@ libvdpau_radeonsi_la_LDFLAGS = \
$(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_radeonsi_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
-   $(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
$(top_builddir)/src/gallium/drivers/noop/libnoop.la \
+   $(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(VDPAU_LIBS) \
-   $(LIBDRM_LIBS) \
$(RADEON_LIBS)
 
 if HAVE_MESA_LLVM
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index 8a15d46..001cb4e 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -39,14 +39,11 @@ libvdpau_nouveau_la_LDFLAGS = \
$(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_nouveau_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
-   $(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
+   $(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(VDPAU_LIBS) \
-   $(LIBDRM_LIBS) \
$(NOUVEAU_LIBS)
 
 if HAVE_MESA_LLVM
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 15/27] targets/radeonsi: move drm_target.c to a common folder

2013-11-11 Thread Emil Velikov
... and symlink to each target.
Make automake's subdir-objects work for radeonsi.

Signed-off-by: Emil Velikov 
---
 src/gallium/targets/radeonsi/common/drm_target.c | 69 
 src/gallium/targets/radeonsi/dri/Makefile.am |  2 +-
 src/gallium/targets/radeonsi/dri/drm_target.c|  1 +
 src/gallium/targets/radeonsi/drm_target.c| 69 
 src/gallium/targets/radeonsi/vdpau/Makefile.am   |  2 +-
 src/gallium/targets/radeonsi/vdpau/drm_target.c  |  1 +
 6 files changed, 73 insertions(+), 71 deletions(-)
 create mode 100644 src/gallium/targets/radeonsi/common/drm_target.c
 create mode 12 src/gallium/targets/radeonsi/dri/drm_target.c
 delete mode 100644 src/gallium/targets/radeonsi/drm_target.c
 create mode 12 src/gallium/targets/radeonsi/vdpau/drm_target.c

diff --git a/src/gallium/targets/radeonsi/common/drm_target.c 
b/src/gallium/targets/radeonsi/common/drm_target.c
new file mode 100644
index 000..9eef368
--- /dev/null
+++ b/src/gallium/targets/radeonsi/common/drm_target.c
@@ -0,0 +1,69 @@
+/**
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+#include "state_tracker/drm_driver.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "radeon/drm/radeon_drm_public.h"
+#include "radeon/drm/radeon_winsys.h"
+#include "radeonsi/radeonsi_public.h"
+
+static struct pipe_screen *create_screen(int fd)
+{
+   struct radeon_winsys *radeon;
+
+   radeon = radeon_drm_winsys_create(fd);
+   if (!radeon)
+  return NULL;
+
+   if (!radeon->screen) {
+  radeon->screen = radeonsi_screen_create(radeon);
+  if (!radeon->screen)
+ return NULL;
+
+  radeon->screen = debug_screen_wrap(radeon->screen);
+   }
+
+   return radeon->screen;
+}
+
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+  return &throttle_ret;
+   default:
+  break;
+   }
+   return NULL;
+}
+
+DRM_DRIVER_DESCRIPTOR("radeonsi", "radeon", create_screen, drm_configuration)
diff --git a/src/gallium/targets/radeonsi/dri/Makefile.am 
b/src/gallium/targets/radeonsi/dri/Makefile.am
index 8a78f1b..9eb21cd 100644
--- a/src/gallium/targets/radeonsi/dri/Makefile.am
+++ b/src/gallium/targets/radeonsi/dri/Makefile.am
@@ -42,7 +42,7 @@ dri_LTLIBRARIES = radeonsi_dri.la
 
 nodist_EXTRA_radeonsi_dri_la_SOURCES = dummy.cpp
 radeonsi_dri_la_SOURCES = \
-   ../drm_target.c
+   drm_target.c
 
 radeonsi_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
 
diff --git a/src/gallium/targets/radeonsi/dri/drm_target.c 
b/src/gallium/targets/radeonsi/dri/drm_target.c
new file mode 12
index 000..6955421
--- /dev/null
+++ b/src/gallium/targets/radeonsi/dri/drm_target.c
@@ -0,0 +1 @@
+../common/drm_target.c
\ No newline at end of file
diff --git a/src/gallium/targets/radeonsi/drm_target.c 
b/src/gallium/targets/radeonsi/drm_target.c
deleted file mode 100644
index 9eef368..000
--- a/src/gallium/targets/radeonsi/drm_target.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- *
- * Copyright 2013 Advanced Micro Devices, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnish

[Mesa-dev] [PATCH 26/27] targets/dri: compact compiler flags into Automake.inc

2013-11-11 Thread Emil Velikov
Greatly reduce duplication and provide a sane minimum of
CFLAGS for all DRI targets.

Note: This commit adds VISIBILITY_CFLAGS to the following:
* freedreno
* i915
* ilo
* nouveau
* vmwgfx

Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc  | 13 +
 src/gallium/targets/dri-freedreno/Makefile.am |  9 +
 src/gallium/targets/dri-i915/Makefile.am  |  9 +
 src/gallium/targets/dri-ilo/Makefile.am   |  9 +
 src/gallium/targets/dri-nouveau/Makefile.am   |  9 +
 src/gallium/targets/dri-swrast/Makefile.am|  9 +
 src/gallium/targets/dri-vmwgfx/Makefile.am|  9 +
 src/gallium/targets/r300/dri/Makefile.am  | 10 +-
 src/gallium/targets/r600/dri/Makefile.am  | 10 +-
 src/gallium/targets/radeonsi/dri/Makefile.am  | 10 +-
 10 files changed, 22 insertions(+), 75 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 5ed6a3d..2a3ad21 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -26,6 +26,19 @@ GALLIUM_DRIVER_CXXFLAGS = \
$(DEFINES) \
$(VISIBILITY_CXXFLAGS)
 
+GALLIUM_DRI_CFLAGS = \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   -I$(top_srcdir)/src/gallium/drivers \
+   -I$(top_srcdir)/src/gallium/winsys \
+   -I$(top_srcdir)/src/mesa \
+   -I$(top_srcdir)/src/mapi \
+   $(DEFINES) \
+   $(PTHREAD_CFLAGS) \
+   $(LIBDRM_CFLAGS) \
+   $(VISIBILITY_CFLAGS)
+
 GALLIUM_VIDEO_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
diff --git a/src/gallium/targets/dri-freedreno/Makefile.am 
b/src/gallium/targets/dri-freedreno/Makefile.am
index 228fafc..2708dd3 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -23,15 +23,8 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
+   $(GALLIUM_DRI_CFLAGS)
 AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys \
-   -I$(top_srcdir)/src/mesa \
-   -I$(top_srcdir)/src/mapi \
-   -I$(top_builddir)/src/mesa/drivers/dri/common \
-DGALLIUM_RBUG \
-DGALLIUM_TRACE \
-DGALLIUM_NOOP
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index 851c412..582c270 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -23,15 +23,8 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
+   $(GALLIUM_DRI_CFLAGS)
 AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys \
-   -I$(top_srcdir)/src/mesa \
-   -I$(top_srcdir)/src/mapi \
-   -I$(top_builddir)/src/mesa/drivers/dri/common \
-DGALLIUM_RBUG \
-DGALLIUM_TRACE \
-DGALLIUM_GALAHAD \
diff --git a/src/gallium/targets/dri-ilo/Makefile.am 
b/src/gallium/targets/dri-ilo/Makefile.am
index 776c970..3633d08 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -24,15 +24,8 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
+   $(GALLIUM_DRI_CFLAGS)
 AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys \
-   -I$(top_srcdir)/src/mesa \
-   -I$(top_srcdir)/src/mapi \
-   -I$(top_builddir)/src/mesa/drivers/dri/common \
-DGALLIUM_RBUG \
-DGALLIUM_TRACE \
-DGALLIUM_GALAHAD
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am 
b/src/gallium/targets/dri-nouveau/Makefile.am
index 17b2c4a..120e242 100644
--- a/src/gallium/targets/dri-nouveau/Makefile.am
+++ b/src/gallium/targets/dri-nouveau/Makefile.am
@@ -23,15 +23,8 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
+   $(GALLIUM_DRI_CFLAGS)
 AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys \
-   -I$(top_srcdir)/src/mesa \
-   -I$(top_srcdir)/src/mapi \
-   -I$(top_builddir)/src/mesa/drivers/dri/common \
-DGALLIUM_RBUG \
-DGALLIUM_TRACE
 
diff --git a/src/gallium/targets/dri-swrast/Makefile.am 
b/src/gallium/targets/dri-swrast/Makefile.am
index cddbbe3..11166ae 100644
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ b/src/gallium/targets/dri-swrast/Makefile.am
@@ -23,17 +23,10 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
$(EXPAT_CFLAGS) \
-

[Mesa-dev] [PATCH 25/27] targets/xvmc: do not link against libtrace.la

2013-11-11 Thread Emil Velikov
In order to use the trace driver, one needs to define
GALLIUM_TRACE. Neither one of the two targets was
defining it, thus we're safe to remove libtrace.la.

Signed-off-by: Emil Velikov 
---
 src/gallium/targets/r600/xvmc/Makefile.am| 1 -
 src/gallium/targets/xvmc-nouveau/Makefile.am | 1 -
 2 files changed, 2 deletions(-)

diff --git a/src/gallium/targets/r600/xvmc/Makefile.am 
b/src/gallium/targets/r600/xvmc/Makefile.am
index a21da80..7fe9b1a 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -38,7 +38,6 @@ libXvMCr600_la_LDFLAGS = \
 libXvMCr600_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/r600/libr600.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(GALLIUM_XVMC_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(RADEON_LIBS)
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index bd30e4d..4a45f41 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -39,7 +39,6 @@ libXvMCnouveau_la_LDFLAGS = \
 libXvMCnouveau_la_LIBADD = \
$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(GALLIUM_XVMC_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(NOUVEAU_LIBS)
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 09/27] st/xvmc: enable automake subdir-objects

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/xvmc/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/state_trackers/xvmc/Makefile.am 
b/src/gallium/state_trackers/xvmc/Makefile.am
index c110912..3968238 100644
--- a/src/gallium/state_trackers/xvmc/Makefile.am
+++ b/src/gallium/state_trackers/xvmc/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 07/27] gtest: enable subdir-objects to prevent automake warnings

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gtest/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gtest/Makefile.am b/src/gtest/Makefile.am
index 4188c6b..23ea749 100644
--- a/src/gtest/Makefile.am
+++ b/src/gtest/Makefile.am
@@ -18,6 +18,7 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
+AUTOMAKE_OPTIONS = subdir-objects
 
 AM_CFLAGS = $(DEFINES) -I$(top_srcdir)/src/gtest/include
 AM_CXXFLAGS = $(DEFINES) -I$(top_srcdir)/src/gtest/include
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 23/27] targets/xvmc: move linker flags to Automake.inc

2013-11-11 Thread Emil Velikov
Minimise duplication and sources of error
(eg nouveau was missing shared and no-undefined)

Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc | 7 +++
 src/gallium/targets/r600/xvmc/Makefile.am| 5 +
 src/gallium/targets/xvmc-nouveau/Makefile.am | 5 +
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index f67b295..f33bc37 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -44,6 +44,13 @@ GALLIUM_VDPAU_LINKER_FLAGS = \
-shared \
-no-undefined
 
+# TODO: add -export-symbols-regex
+GALLIUM_XVMC_LINKER_FLAGS = \
+   -module \
+   -version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
+   -shared \
+   -no-undefined
+
 GALLIUM_VDPAU_LIB_DEPS = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
diff --git a/src/gallium/targets/r600/xvmc/Makefile.am 
b/src/gallium/targets/r600/xvmc/Makefile.am
index 367f597..1a75f52 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -33,10 +33,7 @@ libXvMCr600_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libXvMCr600_la_LDFLAGS = \
-   -module \
-   -version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
-   -shared \
-   -no-undefined
+   $(GALLIUM_XVMC_LINKER_FLAGS)
 
 libXvMCr600_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index 37013f1..4328c05 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -34,10 +34,7 @@ libXvMCnouveau_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libXvMCnouveau_la_LDFLAGS = \
-   -module \
-   -version-number $(XVMC_MAJOR):$(XVMC_MINOR)
-   -shared \
-   -no-undefined
+   $(GALLIUM_XVMC_LINKER_FLAGS)
 
 libXvMCnouveau_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 08/27] dri/common: move source file lists to Makefile.sources

2013-11-11 Thread Emil Velikov
* Allow the lists to be shared among build systems.
* Update automake and Android build systems.

Signed-off-by: Emil Velikov 
Reviewed-by: Ian Romanick 
---
 src/mesa/drivers/dri/common/Android.mk   |  2 +-
 src/mesa/drivers/dri/common/Makefile.am  | 10 --
 src/mesa/drivers/dri/common/Makefile.sources |  8 
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/common/Android.mk 
b/src/mesa/drivers/dri/common/Android.mk
index b3dac29..0489a32 100644
--- a/src/mesa/drivers/dri/common/Android.mk
+++ b/src/mesa/drivers/dri/common/Android.mk
@@ -40,7 +40,7 @@ LOCAL_C_INCLUDES := \
 $(intermediates) \
 $(MESA_DRI_C_INCLUDES)
 
-LOCAL_SRC_FILES := $(mesa_dri_common_SOURCES)
+LOCAL_SRC_FILES := $(DRI_COMMON_FILES)
 
 LOCAL_GENERATED_SOURCES := \
 $(intermediates)/xmlpool/options.h
diff --git a/src/mesa/drivers/dri/common/Makefile.am 
b/src/mesa/drivers/dri/common/Makefile.am
index 7f87ed6..e500bdb 100644
--- a/src/mesa/drivers/dri/common/Makefile.am
+++ b/src/mesa/drivers/dri/common/Makefile.am
@@ -21,6 +21,8 @@
 
 SUBDIRS = xmlpool
 
+include Makefile.sources
+
 AM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/ \
@@ -35,13 +37,9 @@ noinst_LTLIBRARIES = \
libmegadriver_stub.la \
libdri_test_stubs.la
 
-libdricommon_la_SOURCES = \
-   utils.c \
-   dri_util.c \
-   xmlconfig.c
+libdricommon_la_SOURCES = $(DRI_COMMON_FILES)
 
-libdri_test_stubs_la_SOURCES = \
-   dri_test.c
+libdri_test_stubs_la_SOURCES = $(test_stubs_FILES)
 libdri_test_stubs_la_CFLAGS = $(AM_CFLAGS) -DNO_MAIN
 
 libmegadriver_stub_la_SOURCES = megadriver_stub.c
diff --git a/src/mesa/drivers/dri/common/Makefile.sources 
b/src/mesa/drivers/dri/common/Makefile.sources
index 040b717..8469b49 100644
--- a/src/mesa/drivers/dri/common/Makefile.sources
+++ b/src/mesa/drivers/dri/common/Makefile.sources
@@ -1,11 +1,8 @@
-mesa_dri_common_gallium_SOURCES := \
+DRI_COMMON_FILES := \
utils.c \
dri_util.c \
xmlconfig.c
 
-mesa_dri_common_SOURCES := \
-   $(mesa_dri_common_gallium_SOURCES)
-
 # Paths are relative to MESA_TOP.
 mesa_dri_common_INCLUDES := \
include \
@@ -14,3 +11,6 @@ mesa_dri_common_INCLUDES := \
src/mapi \
src/mesa \
src/mesa/drivers/dri/common
+
+test_stubs_FILES := \
+   dri_test.c
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 18/27] targets/vdpau: move linker flags to Automake.inc

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc   |  7 +++
 src/gallium/targets/r600/vdpau/Makefile.am | 10 +++---
 src/gallium/targets/radeonsi/vdpau/Makefile.am | 10 +++---
 src/gallium/targets/vdpau-nouveau/Makefile.am  |  7 +++
 4 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index b242bb4..765fdd2 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -36,3 +36,10 @@ GALLIUM_VIDEO_CFLAGS = \
$(PTHREAD_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
+
+GALLIUM_VDPAU_LINKER_FLAGS = \
+   -module \
+   -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
+   -export-symbols-regex $(VDPAU_EXPORTS) \
+   -shared \
+   -no-undefined
diff --git a/src/gallium/targets/r600/vdpau/Makefile.am 
b/src/gallium/targets/r600/vdpau/Makefile.am
index 742df52..3a65a6f 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+# Note: Make sure VDPAU_EXPORTS is defined before including Automake.inc
+VDPAU_EXPORTS = '^(vdp_imp_device_create_x11|radeon_drm_winsys_create)$$'
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -28,18 +30,12 @@ AM_CFLAGS = \
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_r600.la
 
-EXPORTS = '^(vdp_imp_device_create_x11|radeon_drm_winsys_create)$$'
-
 libvdpau_r600_la_SOURCES = \
drm_target.c \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libvdpau_r600_la_LDFLAGS = \
-   -module \
-   -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-   -export-symbols-regex $(EXPORTS) \
-   -shared \
-   -no-undefined
+   $(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_r600_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am 
b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index 9b14634..cd4dcfc 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+# Note: Make sure VDPAU_EXPORTS is defined before including Automake.inc
+VDPAU_EXPORTS = '^(vdp_imp_device_create_x11|radeon_drm_winsys_create)$$'
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -28,19 +30,13 @@ AM_CFLAGS = \
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_radeonsi.la
 
-EXPORTS = '^(vdp_imp_device_create_x11|radeon_drm_winsys_create)$$'
-
 nodist_EXTRA_libvdpau_radeonsi_la_SOURCES = dummy.cpp
 libvdpau_radeonsi_la_SOURCES = \
drm_target.c \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libvdpau_radeonsi_la_LDFLAGS = \
-   -module \
-   -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-   -export-symbols-regex $(EXPORTS) \
-   -shared \
-   -no-undefined
+   $(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_radeonsi_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index 20eb920..8a15d46 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+# Note: Make sure VDPAU_EXPORTS is defined before including Automake.inc
+VDPAU_EXPORTS = '^(vdp_imp_device_create_x11|nouveau_drm_screen_create)$$'
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -34,10 +36,7 @@ libvdpau_nouveau_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libvdpau_nouveau_la_LDFLAGS = \
-   -module \
-   -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-   -shared \
-   -no-undefined
+   $(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_nouveau_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 02/27] Android: remove unused MESA_ENABLED_APIS variable

2013-11-11 Thread Emil Velikov
The variable was forgotten during the FEATURE_* removal.

Signed-off-by: Emil Velikov 
---
 src/mesa/Android.libmesa_dricore.mk | 2 --
 src/mesa/Android.libmesa_st_mesa.mk | 2 --
 src/mesa/program/Android.mk | 2 --
 3 files changed, 6 deletions(-)

diff --git a/src/mesa/Android.libmesa_dricore.mk 
b/src/mesa/Android.libmesa_dricore.mk
index 3679b50..0db5825 100644
--- a/src/mesa/Android.libmesa_dricore.mk
+++ b/src/mesa/Android.libmesa_dricore.mk
@@ -38,8 +38,6 @@ include $(CLEAR_VARS)
 LOCAL_MODULE := libmesa_dricore
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 
-MESA_ENABLED_APIS := ES1 ES2 GL
-
 LOCAL_SRC_FILES := \
$(MESA_FILES)
 
diff --git a/src/mesa/Android.libmesa_st_mesa.mk 
b/src/mesa/Android.libmesa_st_mesa.mk
index e7203c4..e6374a6 100644
--- a/src/mesa/Android.libmesa_st_mesa.mk
+++ b/src/mesa/Android.libmesa_st_mesa.mk
@@ -37,8 +37,6 @@ include $(CLEAR_VARS)
 
 LOCAL_MODULE := libmesa_st_mesa
 
-MESA_ENABLED_APIS := ES1 ES2
-
 LOCAL_SRC_FILES := \
$(MESA_GALLIUM_FILES)
 
diff --git a/src/mesa/program/Android.mk b/src/mesa/program/Android.mk
index 29a1b6a..e85afe6 100644
--- a/src/mesa/program/Android.mk
+++ b/src/mesa/program/Android.mk
@@ -47,8 +47,6 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 
 intermediates := $(call local-intermediates-dir)
 
-MESA_ENABLED_APIS := ES1 ES2
-
 # TODO(chadv): In Makefile.sources, move these vars to a different list so we 
can
 # remove this kludge.
 generated_sources_basenames := \
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 14/27] targets/r600: move drm_target.c to common folder

2013-11-11 Thread Emil Velikov
... and symlink for each target.
Make automake's subdir-objects work for r600.

Signed-off-by: Emil Velikov 
---
 src/gallium/targets/r600/common/drm_target.c | 69 
 src/gallium/targets/r600/dri/Makefile.am |  2 +-
 src/gallium/targets/r600/dri/drm_target.c|  1 +
 src/gallium/targets/r600/drm_target.c| 69 
 src/gallium/targets/r600/vdpau/Makefile.am   |  2 +-
 src/gallium/targets/r600/vdpau/drm_target.c  |  1 +
 src/gallium/targets/r600/xvmc/Makefile.am|  2 +-
 src/gallium/targets/r600/xvmc/drm_target.c   |  1 +
 8 files changed, 75 insertions(+), 72 deletions(-)
 create mode 100644 src/gallium/targets/r600/common/drm_target.c
 create mode 12 src/gallium/targets/r600/dri/drm_target.c
 delete mode 100644 src/gallium/targets/r600/drm_target.c
 create mode 12 src/gallium/targets/r600/vdpau/drm_target.c
 create mode 12 src/gallium/targets/r600/xvmc/drm_target.c

diff --git a/src/gallium/targets/r600/common/drm_target.c 
b/src/gallium/targets/r600/common/drm_target.c
new file mode 100644
index 000..28004ac
--- /dev/null
+++ b/src/gallium/targets/r600/common/drm_target.c
@@ -0,0 +1,69 @@
+/**
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+#include "state_tracker/drm_driver.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "radeon/drm/radeon_drm_public.h"
+#include "radeon/drm/radeon_winsys.h"
+#include "r600/r600_public.h"
+
+static struct pipe_screen *create_screen(int fd)
+{
+   struct radeon_winsys *radeon;
+
+   radeon = radeon_drm_winsys_create(fd);
+   if (!radeon)
+  return NULL;
+
+   if (!radeon->screen) {
+  radeon->screen = r600_screen_create(radeon);
+  if (!radeon->screen)
+ return NULL;
+
+  radeon->screen = debug_screen_wrap(radeon->screen);
+   }
+
+   return radeon->screen;
+}
+
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+  return &throttle_ret;
+   default:
+  break;
+   }
+   return NULL;
+}
+
+DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen, drm_configuration)
diff --git a/src/gallium/targets/r600/dri/Makefile.am 
b/src/gallium/targets/r600/dri/Makefile.am
index c7fca32..b5ea37a 100644
--- a/src/gallium/targets/r600/dri/Makefile.am
+++ b/src/gallium/targets/r600/dri/Makefile.am
@@ -41,7 +41,7 @@ dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = r600_dri.la
 
 r600_dri_la_SOURCES = \
-   ../drm_target.c
+   drm_target.c
 
 r600_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
 
diff --git a/src/gallium/targets/r600/dri/drm_target.c 
b/src/gallium/targets/r600/dri/drm_target.c
new file mode 12
index 000..6955421
--- /dev/null
+++ b/src/gallium/targets/r600/dri/drm_target.c
@@ -0,0 +1 @@
+../common/drm_target.c
\ No newline at end of file
diff --git a/src/gallium/targets/r600/drm_target.c 
b/src/gallium/targets/r600/drm_target.c
deleted file mode 100644
index 28004ac..000
--- a/src/gallium/targets/r600/drm_target.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- *
- * Copyright 2013 Advanced Micro Devices, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permi

[Mesa-dev] [PATCH 16/27] gallium/drivers: compact compiler flags into Automake.inc

2013-11-11 Thread Emil Velikov
* minimise flags duplication
* distingush between VISIBILITY C and CXX flags
* set only required flags - C and/or CXX

Signed-off-by: Emil Velikov 
---
 src/gallium/Automake.inc  | 22 ++
 src/gallium/drivers/freedreno/Makefile.am | 10 --
 src/gallium/drivers/galahad/Makefile.am   |  4 +---
 src/gallium/drivers/i915/Makefile.am  |  8 +++-
 src/gallium/drivers/identity/Makefile.am  |  4 +---
 src/gallium/drivers/ilo/Makefile.am   |  8 ++--
 src/gallium/drivers/llvmpipe/Makefile.am  | 13 ++---
 src/gallium/drivers/noop/Makefile.am  |  4 +---
 src/gallium/drivers/nouveau/Makefile.am   | 10 --
 src/gallium/drivers/r300/Makefile.am  | 12 +---
 src/gallium/drivers/r600/Makefile.am  | 28 ++--
 src/gallium/drivers/radeon/Makefile.am| 22 +++---
 src/gallium/drivers/radeonsi/Makefile.am  | 14 +-
 src/gallium/drivers/rbug/Makefile.am  | 13 +++--
 src/gallium/drivers/softpipe/Makefile.am  |  7 ++-
 src/gallium/drivers/svga/Makefile.am  |  9 ++---
 src/gallium/drivers/trace/Makefile.am |  3 +--
 17 files changed, 83 insertions(+), 108 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index fabc2af..5cb0b26 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -3,3 +3,25 @@ GALLIUM_CFLAGS = \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
$(DEFINES)
+
+# src/gallium/auxiliary must appear before src/gallium/drivers
+# because there are stupidly two rbug_context.h files in
+# different directories, and which one is included by the
+# preprocessor is determined by the ordering of the -I flags.
+GALLIUM_DRIVER_CFLAGS = \
+   -I$(srcdir)/include \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   -I$(top_srcdir)/src/gallium/drivers \
+   $(DEFINES) \
+   $(VISIBILITY_CFLAGS)
+
+GALLIUM_DRIVER_CXXFLAGS = \
+   -I$(srcdir)/include \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   -I$(top_srcdir)/src/gallium/drivers \
+   $(DEFINES) \
+   $(VISIBILITY_CXXFLAGS)
diff --git a/src/gallium/drivers/freedreno/Makefile.am 
b/src/gallium/drivers/freedreno/Makefile.am
index a7b307a..7947dd1 100644
--- a/src/gallium/drivers/freedreno/Makefile.am
+++ b/src/gallium/drivers/freedreno/Makefile.am
@@ -3,16 +3,14 @@ AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libfreedreno.la
-
 AM_CFLAGS = \
-Wno-packed-bitfield-compat \
-   -I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/src/gallium/drivers/freedreno/a3xx \
-I$(top_srcdir)/src/gallium/drivers/freedreno/a2xx \
-   $(GALLIUM_CFLAGS) \
-   $(FREEDRENO_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_DRIVER_CFLAGS) \
+   $(FREEDRENO_CFLAGS)
+
+noinst_LTLIBRARIES = libfreedreno.la
 
 libfreedreno_la_SOURCES = \
$(C_SOURCES) \
diff --git a/src/gallium/drivers/galahad/Makefile.am 
b/src/gallium/drivers/galahad/Makefile.am
index 5f64b93..17572c3 100644
--- a/src/gallium/drivers/galahad/Makefile.am
+++ b/src/gallium/drivers/galahad/Makefile.am
@@ -7,9 +7,7 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_DRIVER_CFLAGS)
 
 noinst_LTLIBRARIES = libgalahad.la
 
diff --git a/src/gallium/drivers/i915/Makefile.am 
b/src/gallium/drivers/i915/Makefile.am
index 4e6f464..a4a3e86 100644
--- a/src/gallium/drivers/i915/Makefile.am
+++ b/src/gallium/drivers/i915/Makefile.am
@@ -23,11 +23,9 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libi915.la
+AM_CFLAGS = \
+   $(GALLIUM_DRIVER_CFLAGS)
 
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/include \
-   $(GALLIUM_CFLAGS)
+noinst_LTLIBRARIES = libi915.la
 
 libi915_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/identity/Makefile.am 
b/src/gallium/drivers/identity/Makefile.am
index 1caf328..7fcbc7c 100644
--- a/src/gallium/drivers/identity/Makefile.am
+++ b/src/gallium/drivers/identity/Makefile.am
@@ -2,9 +2,7 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_DRIVER_CFLAGS)
 
 noinst_LTLIBRARIES = libidentity.la
 
diff --git a/src/gallium/drivers/ilo/Makefile.am 
b/src/gallium/drivers/ilo/Makefile.am
index b5f6400..04d4da8 100644
--- a/src/gallium/drivers/ilo/Makefile.am
+++ b/src/gallium/drivers/ilo/Makefile.am
@@ -2

[Mesa-dev] [PATCH 12/27] gallium/drivers: enable automake subdir-objects

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/freedreno/Makefile.am | 2 ++
 src/gallium/drivers/ilo/Makefile.am   | 2 ++
 src/gallium/drivers/nouveau/Makefile.am   | 2 ++
 src/gallium/drivers/r300/Makefile.am  | 2 ++
 src/gallium/drivers/r600/Makefile.am  | 2 ++
 src/gallium/drivers/svga/Makefile.am  | 2 ++
 6 files changed, 12 insertions(+)

diff --git a/src/gallium/drivers/freedreno/Makefile.am 
b/src/gallium/drivers/freedreno/Makefile.am
index 22fd790..a7b307a 100644
--- a/src/gallium/drivers/freedreno/Makefile.am
+++ b/src/gallium/drivers/freedreno/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/ilo/Makefile.am 
b/src/gallium/drivers/ilo/Makefile.am
index 0aa4a33..b5f6400 100644
--- a/src/gallium/drivers/ilo/Makefile.am
+++ b/src/gallium/drivers/ilo/Makefile.am
@@ -21,6 +21,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/nouveau/Makefile.am 
b/src/gallium/drivers/nouveau/Makefile.am
index c4b51d9..369dada 100644
--- a/src/gallium/drivers/nouveau/Makefile.am
+++ b/src/gallium/drivers/nouveau/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/r300/Makefile.am 
b/src/gallium/drivers/r300/Makefile.am
index 4edeb47..9d66003 100644
--- a/src/gallium/drivers/r300/Makefile.am
+++ b/src/gallium/drivers/r300/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/r600/Makefile.am 
b/src/gallium/drivers/r600/Makefile.am
index 0490ba2..cede6fa 100644
--- a/src/gallium/drivers/r600/Makefile.am
+++ b/src/gallium/drivers/r600/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/svga/Makefile.am 
b/src/gallium/drivers/svga/Makefile.am
index 7eacd90..b6fed00 100644
--- a/src/gallium/drivers/svga/Makefile.am
+++ b/src/gallium/drivers/svga/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 13/27] targets/r300: move drm_target.c to common folder

2013-11-11 Thread Emil Velikov
... and symlink for each target.
Make automake's subdir-objects work for r300.

Signed-off-by: Emil Velikov 
---
 src/gallium/targets/r300/common/drm_target.c | 54 
 src/gallium/targets/r300/dri/Makefile.am |  2 +-
 src/gallium/targets/r300/dri/drm_target.c|  1 +
 src/gallium/targets/r300/drm_target.c| 54 
 4 files changed, 56 insertions(+), 55 deletions(-)
 create mode 100644 src/gallium/targets/r300/common/drm_target.c
 create mode 12 src/gallium/targets/r300/dri/drm_target.c
 delete mode 100644 src/gallium/targets/r300/drm_target.c

diff --git a/src/gallium/targets/r300/common/drm_target.c 
b/src/gallium/targets/r300/common/drm_target.c
new file mode 100644
index 000..2c10bbd
--- /dev/null
+++ b/src/gallium/targets/r300/common/drm_target.c
@@ -0,0 +1,54 @@
+/**
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "radeon/drm/radeon_drm_public.h"
+#include "radeon/drm/radeon_winsys.h"
+#include "r300/r300_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+   struct radeon_winsys *sws;
+
+   sws = radeon_drm_winsys_create(fd);
+   if (!sws)
+  return NULL;
+
+   if (!sws->screen) {
+  sws->screen = r300_screen_create(sws);
+  if (!sws->screen)
+ return NULL;
+
+  sws->screen = debug_screen_wrap(sws->screen);
+   }
+
+   return sws->screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen, NULL)
diff --git a/src/gallium/targets/r300/dri/Makefile.am 
b/src/gallium/targets/r300/dri/Makefile.am
index 4b41c30..3f659c9 100644
--- a/src/gallium/targets/r300/dri/Makefile.am
+++ b/src/gallium/targets/r300/dri/Makefile.am
@@ -42,7 +42,7 @@ dri_LTLIBRARIES = r300_dri.la
 
 nodist_EXTRA_r300_dri_la_SOURCES = dummy.cpp
 r300_dri_la_SOURCES = \
-   ../drm_target.c
+   drm_target.c
 
 r300_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
 
diff --git a/src/gallium/targets/r300/dri/drm_target.c 
b/src/gallium/targets/r300/dri/drm_target.c
new file mode 12
index 000..6955421
--- /dev/null
+++ b/src/gallium/targets/r300/dri/drm_target.c
@@ -0,0 +1 @@
+../common/drm_target.c
\ No newline at end of file
diff --git a/src/gallium/targets/r300/drm_target.c 
b/src/gallium/targets/r300/drm_target.c
deleted file mode 100644
index 2c10bbd..000
--- a/src/gallium/targets/r300/drm_target.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- *
- * Copyright 2013 Advanced Micro Devices, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR 

[Mesa-dev] Automake subdir-objects v2

2013-11-11 Thread Emil Velikov
Hello list,

Here is an updated version of the subdir-objects series sent earlier.

As a reminder the series aims to
* make mesa build system "subdir-objects" compliant
* minimise flags duplication across gallium

Changes since previous version:
* Resolved git-rebase mess in patch 5.
* Dropped patches 6, 8 per Matt's request.
* Dropped patch 10, 11 - libprogram is gone.
* Dropped patches 17, 18 per Christian's request.
* Dropped patch 22 - x86{,-64} is handled alot better now.
* Dropped patches 33, 34, 35 - st/xorg no longer exists.
* Resolved minor git rebase conflicts.

The branch can be found over at subdir-objects-v3
https://github.com/evelikov/Mesa.git


As always comments and review is greatly appreciated :)

Cheers,
Emil

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


  1   2   >