Re: [Mesa-dev] [PATCH] i965: Reenable glBitmap() after the sRGB winsys enabling.

2013-09-22 Thread Kenneth Graunke
On 09/21/2013 04:47 PM, Eric Anholt wrote:
> The format of the window system framebuffer changed from ARGB to
> SARGB8, but we're still supposed to render to it the same as ARGB
> unless the user flipped the GL_FRAMEBUFFER_SRGB switch.
> ---
>  src/mesa/drivers/dri/i965/intel_pixel_bitmap.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c 
> b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
> index 5398cb8..91f21a3 100644
> --- a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
> +++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
> @@ -25,6 +25,7 @@
>   * 
>   **/
>  
> +#include "main/blend.h"
>  #include "main/glheader.h"
>  #include "main/enums.h"
>  #include "main/image.h"
> @@ -227,7 +228,7 @@ do_blit_bitmap( struct gl_context *ctx,
> UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[2], tmpColor[2]);
> UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
>  
> -   switch (irb->mt->format) {
> +   switch (_mesa_get_render_format(ctx, intel_rb_format(irb))) {
> case MESA_FORMAT_ARGB:
> case MESA_FORMAT_XRGB:
>color = PACK_COLOR_(ubcolor[3], ubcolor[0], ubcolor[1], 
> ubcolor[2]);
> 

A strange area of the code to wind up in :)

Good catch, though.  Candidate for stable?

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


Re: [Mesa-dev] XDC schedule published

2013-09-22 Thread Ian Romanick
On 09/20/2013 02:48 PM, Ian Romanick wrote:
> "Final" schedule is now available:
> 
> http://www.x.org/wiki/Events/XDC2013/Program/

In addition, folks arriving today can meet up this evening at Backspace.

115 NW 5th Ave, Portland
503.248.2900

http://www.backspace.bz/

I'm planning to arrive there around 6pm.  They're having a poetry slam
at 7:30, so will probably seek entertainment elsewhere...

 - Just around the corner from Backspace is Ground Kontrol
(http://groundkontrol.com/), Portland's retro-arcade.  After 5pm, Ground
Kontrol is 21+ only.

 - Just a couple more blocks away from Backspace and Ground Kontrol is
Powell's City of Books (http://www.powells.com/).  "Building #2," which
houses all the tech books closes at 9pm, but the main building is open
until 11pm.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] i965: Extract region use from hiz depth buffer

2013-09-22 Thread Ben Widawsky
Starting with Ivybridge, the hierarchical had relaxed requirements for
its allocation. Following a "simple" formula in the bspec was all you
needed to satisfy the requirement.

To prepare the code for this, extract all places where the miptree was
used, when we really only needed the region. This allows an upcoming
patch to simply allocate the region, and not the whole miptree.

CC: Chad Versace 
Signed-off-by: Ben Widawsky 
---
 src/mesa/drivers/dri/i965/brw_misc_state.c|  8 +++---
 src/mesa/drivers/dri/i965/gen6_blorp.cpp  |  2 +-
 src/mesa/drivers/dri/i965/gen7_blorp.cpp  |  2 +-
 src/mesa/drivers/dri/i965/gen7_misc_state.c   |  6 ++---
 src/mesa/drivers/dri/i965/intel_fbo.c |  4 +--
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 35 +++
 src/mesa/drivers/dri/i965/intel_mipmap_tree.h |  5 +++-
 7 files changed, 34 insertions(+), 28 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c 
b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 7f4cd6f..80bdc1d 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -211,7 +211,7 @@ brw_get_depthstencil_tile_masks(struct intel_mipmap_tree 
*depth_mt,
 
   if (intel_miptree_slice_has_hiz(depth_mt, depth_level, depth_layer)) {
  uint32_t hiz_tile_mask_x, hiz_tile_mask_y;
- intel_region_get_tile_masks(depth_mt->hiz_mt->region,
+ intel_region_get_tile_masks(depth_mt->hiz_depth_buffer.region,
  &hiz_tile_mask_x, &hiz_tile_mask_y, 
false);
 
  /* Each HiZ row represents 2 rows of pixels */
@@ -667,11 +667,11 @@ brw_emit_depth_stencil_hiz(struct brw_context *brw,
 
   /* Emit hiz buffer. */
   if (hiz) {
- struct intel_mipmap_tree *hiz_mt = depth_mt->hiz_mt;
+struct intel_region *region = depth_mt->hiz_depth_buffer.region;
 BEGIN_BATCH(3);
 OUT_BATCH((_3DSTATE_HIER_DEPTH_BUFFER << 16) | (3 - 2));
-OUT_BATCH(hiz_mt->region->pitch - 1);
-OUT_RELOC(hiz_mt->region->bo,
+OUT_BATCH(region->pitch - 1);
+OUT_RELOC(region->bo,
   I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
   brw->depthstencil.hiz_offset);
 ADVANCE_BATCH();
diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp 
b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
index da523e5..7b41dad 100644
--- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
@@ -887,7 +887,7 @@ gen6_blorp_emit_depth_stencil_config(struct brw_context 
*brw,
 
/* 3DSTATE_HIER_DEPTH_BUFFER */
{
-  struct intel_region *hiz_region = params->depth.mt->hiz_mt->region;
+  struct intel_region *hiz_region = 
params->depth.mt->hiz_depth_buffer.region;
   uint32_t hiz_offset =
  intel_region_get_aligned_offset(hiz_region,
  draw_x & ~tile_mask_x,
diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp 
b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
index 9df3d92..dea5d48 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
@@ -737,7 +737,7 @@ gen7_blorp_emit_depth_stencil_config(struct brw_context 
*brw,
 
/* 3DSTATE_HIER_DEPTH_BUFFER */
{
-  struct intel_region *hiz_region = params->depth.mt->hiz_mt->region;
+  struct intel_region *hiz_region = 
params->depth.mt->hiz_depth_buffer.region;
 
   BEGIN_BATCH(3);
   OUT_BATCH((GEN7_3DSTATE_HIER_DEPTH_BUFFER << 16) | (3 - 2));
diff --git a/src/mesa/drivers/dri/i965/gen7_misc_state.c 
b/src/mesa/drivers/dri/i965/gen7_misc_state.c
index eb942cf..1685b38 100644
--- a/src/mesa/drivers/dri/i965/gen7_misc_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_misc_state.c
@@ -143,12 +143,12 @@ gen7_emit_depth_stencil_hiz(struct brw_context *brw,
   OUT_BATCH(0);
   ADVANCE_BATCH();
} else {
-  struct intel_mipmap_tree *hiz_mt = depth_mt->hiz_mt;
+  struct intel_region *region = depth_mt->hiz_depth_buffer.region;
   BEGIN_BATCH(3);
   OUT_BATCH(GEN7_3DSTATE_HIER_DEPTH_BUFFER << 16 | (3 - 2));
   OUT_BATCH((mocs << 25) |
-(hiz_mt->region->pitch - 1));
-  OUT_RELOC(hiz_mt->region->bo,
+(region->pitch - 1));
+  OUT_RELOC(region->bo,
 I915_GEM_DOMAIN_RENDER,
 I915_GEM_DOMAIN_RENDER,
 0);
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c 
b/src/mesa/drivers/dri/i965/intel_fbo.c
index 1692325..ef26643 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -452,9 +452,9 @@ intel_renderbuffer_update_wrapper(struct brw_context *brw,
 
intel_renderbuffer_set_draw_offset(irb);
 
-   if (mt->hiz_mt == NULL && brw_is_hiz_depth_format(brw, rb->Format)) {
+   if (mt->hiz_depth_buffer.region == NULL && brw_is_hiz_depth_format(brw, 
rb->Format)) {
   intel_miptree_alloc_hiz(brw, mt);
-  if (!mt->hiz_mt)
+  i

[Mesa-dev] [PATCH 2/2] i965: Use IVB specific formula for depthbuffer

2013-09-22 Thread Ben Widawsky
After the last patch, we can replace the region allocated in the miptree
creation with a more straightforward (and hopefully smaller resulting)
buffer based on the bspec's allocation formula.

Since I am relatively new to this part of the bspec, I would very much
appreciate scrutiny during review of this. There were some ambiguities
to me which are likely obvious to others.

To prove the reduced [GPU] memory usage I created a simple script which
polls the memory usage of the process through debugfs ever .1 seconds.
The following results show the memory usage difference over 5 runs of
xonotic-glx with ultra settings.

The data suggests a 10MB savings on average. I've not measured the
savings on the CPU side, but I imagine some amount of savings would be
present there as well.

x master/mem_usage.txt
+ mine/mem_usage.txt
N   Min   MaxMedian   Avg Stddev
x 17121  98959360 7.3394995e+08 7.2782234e+08 7.2209615e+08 43633222
+ 17166 1.2538266e+08 7.2241562e+08   7.16288e+08 7.1071472e+08 42964578

Below is the FPS data over those same 5 tests. I'm not sure if the
decrease is statistically significant to y'all. I don't have any
theories about it.

x master/xonotic.fps
+ mine/xonotic.fps
N   Min   MaxMedian   Avg Stddev
x   5 27.430746 27.524985  27.50568 27.487017 0.039439874
+   5 27.409173 27.461715 27.441207 27.440883 0.021086805

NOTE: There were a couple of places in the arithmetic where I could have
taken some shortcuts. In order to make the code match with the spec as
much as possible, I've decided not to do this. One shortcut I did make
was the tiling type. Digging through the code it looks like you always
want Y-tiled, except when it won't fit, in which case you want X-tiled.
I wasn't a fan of the existing helper function that's there since it has
a few irrelevant parameters for this operation. I suspect people
reviewing this might ask me to change this, which is fine; I just wanted
to explain the motivation.

CC: Chad Versace 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67564
Signed-off-by: Ben Widawsky 
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 149 +++---
 1 file changed, 133 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index cb6ead3..595228f 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1271,29 +1271,146 @@ intel_miptree_slice_enable_hiz(struct brw_context *brw,
return true;
 }
 
+static struct intel_region *
+gen7_create_hiz_depth_buffer(struct brw_context *brw,
+struct intel_mipmap_tree *mt)
+{
+#define level(x, l) ((x) >> (l) > 0 ? (x) >> (l) : 1)
+   struct intel_region *region;
+   uint32_t q_pitch, w0, h0, h1, h_level, z_depth; /* Inputs to formula */
+   size_t hz_width; /* Number of bytes */
+   unsigned int hz_height; /* Number of rows */
+
+   z_depth = mt->level[0].depth;
+   w0 = level(mt->logical_width0, 0);
+   h0 = level(mt->logical_height0, 0);
+   h1 = level(mt->logical_height0, 1);
+
+   /* The value of Z_Height and Z_Width must each be multiplied by 2 before
+* being applied to the table below if Number of Multisamples is set to
+* NUMSAMPLES_4. The value of Z_Height must be multiplied by 2 and Z_Width
+* must be multiplied by 4 before being applied to the table below if Number
+* of Multisamples is set to NUMSAMPLES_8.
+*/
+   switch (mt->num_samples) {
+  case 16:
+h0 = CEILING(h0, 2) * 8;
+h1 = CEILING(h1, 2) * 8;
+break;
+  case 8:
+h0 = CEILING(h0, 2) * 4 * z_depth;
+h1 = CEILING(h1, 2) * 4 * z_depth;
+w0 = CEILING(w0, 2) * 8;
+break;
+  case 4:
+h0 = CEILING(h0, 2) * 4;
+h1 = CEILING(h1, 2) * 4;
+w0 = CEILING(w0, 2) * 4;
+break;
+  case 2:
+w0 = CEILING(w0, 2) * 4;
+break;
+  case 1:
+  case 0:
+break;
+  default:
+fprintf(stderr, "Unknown number of samples: %d\n", mt->num_samples);
+abort();
+   }
+
+   hz_width = CEILING(w0, 16) * 16;
+
+   /* ... Where, Qpitch is computed using vertical alignment j=8. Please refer
+* to the GPU overview volume for Qpitch definition.  NB: The docs have
+* multiple formulas for q_pitch on IVB, but the HSW docs only have the
+* below definition.
+*/
+   q_pitch = h0 + h1 + 11 * 8;
+
+   /* The following is directly derived from the "Hierarchical Depth Buffer"
+* section of the bspec.
+*/
+   switch (mt->target) {
+   case GL_TEXTURE_1D_ARRAY:
+   case GL_TEXTURE_2D_ARRAY:
+   case GL_TEXTURE_2D:
+  hz_height = CEILING((q_pitch * z_depth / 2), 8) * 8;
+  break;
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
+  hz_height = CEILING((q_pitch * z_depth * 6 / 2), 8) * 8;
+  break;
+   case GL_TEXTURE_3D:
+   

Re: [Mesa-dev] [RFC PATCH 4/5] ralloc: Make the C++ macros arrange for class destructors to be called.

2013-09-22 Thread Eric Anholt
Ian Romanick  writes:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 09/21/2013 11:41 AM, Eric Anholt wrote:
>> Ian Romanick  writes:
>> 
>>> Premature "send" strikes again...
>>> 
>>> On 09/19/2013 05:26 PM, Ian Romanick wrote:
 On 09/18/2013 04:55 PM, Kenneth Graunke wrote:
> Previously, almost all classes didn't actually call their
> destructors, which is non-intuitive for C++ code.  Setting
> them up to be called was somewhat of a pain, since it
> required defining a helper function.
> 
> With the new macros, we can easily encapsulate this
> complexity, making destructors just happen automatically.
> 
> Signed-off-by: Kenneth Graunke  --- 
> src/glsl/ralloc.h | 8  1 file changed, 8
> insertions(+)
> 
> diff --git a/src/glsl/ralloc.h b/src/glsl/ralloc.h index
> 799d3a9..82a3daa 100644 --- a/src/glsl/ralloc.h +++
> b/src/glsl/ralloc.h @@ -405,15 +405,23 @@ bool
> ralloc_vasprintf_append(char **str, const char *fmt, va_list
> args); #endif
> 
> #define _RALLOC_OPS(ALLOC, TYPE)
> \ +private:
> \ +   static void _ralloc_##TYPE##_destructor_callback(void
> *p) \ +   {
> \ +  reinterpret_cast(p)->~TYPE();
> \ +   }
> \ +public:
> \ static void* operator new(size_t size, void *mem_ctx)
> \ {
> \ void *p = ALLOC(mem_ctx, size);
> \ assert(p != NULL);
> \ +  ralloc_set_destructor(p,
> _ralloc_##TYPE##_destructor_callback);\
>>> 
>>> All of the IR objects share the ir_instruction destructor:
>>> 
>>> virtual ~ir_instruction() { }
>>> 
>>> Doing this universally will add two indirect function calls when
>>> every object is released.  I wish we had a compiler benchmark so
>>> that we could know whether this is going to hurt app start up
>>> time on apps with lots of large shaders. :(
>> 
>> You can test this easily, thanks to shader_runner, "time", and 
>> shader-db.
>> 
>> For a large l4d2 shader: N   Min   Max
>> Median   AvgStddev x 1088  0.012401
>> 0.024984  0.017926   0.017903518  0.0018709739 + 1088
>> 0.012483  0.028997  0.017919   0.017883756  0.0019610448 No
>> difference proven at 95.0% confidence
>
> Does shader-db compile all the shaders in a single GL context?  If it
> doesn't there's probably a lot of other overhead that could mask the
> issue.  Still, this definitely means that compile times won't skyrocket...

I've used this many times to show overhead in compiling, I didn't see
any reason things would be different this time.

Of course, this time I happened to run the wrong version of the script,
which wasn't successfully compiling.  Updated numbers:

x 4636  0.029608  0.057734   0.04657   0.044289073  0.0049689317
+ 4636  0.029798  0.057689  0.046927   0.044643953  0.0049795278
Difference at 95.0% confidence
0.00035488 +/- 0.0002025
0.801281% +/- 0.457224%
(Student's t, pooled s = 0.00497423)

So, yeah, there's a bit of a loss here, much more than I expected.


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


Re: [Mesa-dev] [RFC PATCH 4/5] ralloc: Make the C++ macros arrange for class destructors to be called.

2013-09-22 Thread Francisco Jerez
Eric Anholt  writes:

>[...]
> I've used this many times to show overhead in compiling, I didn't see
> any reason things would be different this time.
>
> Of course, this time I happened to run the wrong version of the script,
> which wasn't successfully compiling.  Updated numbers:
>
> x 4636  0.029608  0.057734   0.04657   0.044289073  0.0049689317
> + 4636  0.029798  0.057689  0.046927   0.044643953  0.0049795278
> Difference at 95.0% confidence
>   0.00035488 +/- 0.0002025
>   0.801281% +/- 0.457224%
>   (Student's t, pooled s = 0.00497423)
>
> So, yeah, there's a bit of a loss here, much more than I expected.

Hi Eric, thank you for taking the time to test this.

I can see several possibilities here.  One might be using a common base
class for ralloc-able objects, as Ken suggested in passing.  If the base
class already has a virtual destructor it would avoid the need of having
an intermediate destruction callback executed by ralloc, probably
halving the amount of indirect function calls and hopefully reducing
that difference below your confidence margin.

I also find this solution to be more elegant than using macros to make a
class inherit functionality.

Another possibility would be to make the destructor of ir_instruction
non-virtual.  It seems that the only reason it's virtual right now is to
avoid a (usually reasonable) compiler warning in several places when
subclasses of ir_instruction are deleted.  A different way to avoid it
would be to mark ir_instruction subclasses as "final", which would tell
the compiler that none of them have any subclasses themselves and it's
safe to delete them directly:

| class ir_loop final : public ir_instruction {
|~ir_loop(); // Non-virtual
|// ...
| };
| 
| void foo() {
|delete new ir_loop(); // Doesn't cause a warning.
| }
| 
| class ir_loop_override : public ir_loop {}; // Causes a compiler error.

Note that the "final" keyword is a C++11 language feature, but it's well
supported by both gcc and clang, and it seems to be supported by VC10 as
well.  This solution has the disadvantage that if any of the
ir_instruction subclasses ever actually needs a non-trivial destructor
it will cause a leak.  The first solution seems like a better
alternative to me.

What do you think?


pgpFwml7R4dHO.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 4/7] mesa: Convert some runtime asserts to static asserts.

2013-09-22 Thread Eric Anholt
Brian Paul  writes:

> On Fri, Sep 20, 2013 at 7:52 PM, Eric Anholt  wrote:
>> Noticed while grepping through the code for something else.
>> ---
>>  src/mesa/program/program.c | 36 ++--
>>  1 file changed, 22 insertions(+), 14 deletions(-)
>>
>> diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
>> index 2529c13..5dd68d9 100644
>> --- a/src/mesa/program/program.c
>> +++ b/src/mesa/program/program.c
>> @@ -55,27 +55,35 @@ _mesa_init_program(struct gl_context *ctx)
>>  * If this assertion fails, we need to increase the field
>>  * size for register indexes (see INST_INDEX_BITS).
>>  */
>> -   ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4
>><= (1 << INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4
>><= (1 << INST_INDEX_BITS));
>>
>> -   ASSERT(ctx->Const.VertexProgram.MaxTemps <= (1 << INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.VertexProgram.MaxLocalParams <= (1 << 
>> INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.FragmentProgram.MaxTemps <= (1 << INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <= (1 << 
>> INST_INDEX_BITS));
>> -
>> -   ASSERT(ctx->Const.VertexProgram.MaxUniformComponents <= 4 * 
>> MAX_UNIFORMS);
>> -   ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents <= 4 * 
>> MAX_UNIFORMS);
>> -
>> -   ASSERT(ctx->Const.VertexProgram.MaxAddressOffset <= (1 << 
>> INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << 
>> INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxTemps <=
>> + (1 << INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxLocalParams <=
>> + (1 << INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxTemps <=
>> + (1 << INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <=
>> + (1 << INST_INDEX_BITS));
>> +
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxUniformComponents <=
>> + 4 * MAX_UNIFORMS);
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents <=
>> + 4 * MAX_UNIFORMS);
>> +
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxAddressOffset <=
>> + (1 << INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <=
>> + (1 << INST_INDEX_BITS));
>
> Are you sure about those?  How does the compiler know the values of
> ctx->Const.Foo at compile time?
>
> It's worrisome that our STATIC_ASSERT macro is silent at compile time
> when the expression isn't a compile-time constant.  The problem with
> our macro now is variable-sized arrays are OK at compile time.

Having looked at things a bit more, it seems to be an intentional
feature of the macro.  You want the compiler to stop if it can prove
that the assert fails, but not if it can't prove the value either way
(think -O0, where constant expression evaluation is much more limited).
I'm not sure how to make a more emphatic macro that won't make us
occasionally check in broken code in the -O0 case (which I know I'm not
testing, at least).


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


[Mesa-dev] [PATCH 4/7 v2] mesa: Convert some runtime asserts to static asserts.

2013-09-22 Thread Eric Anholt
Noticed while grepping through the code for something else.
---
 src/mesa/program/program.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 2529c13..3a1eb73 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -72,10 +72,10 @@ _mesa_init_program(struct gl_context *ctx)
ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << 
INST_INDEX_BITS));
 
/* If this fails, increase prog_instruction::TexSrcUnit size */
-   ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
+   STATIC_ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
 
/* If this fails, increase prog_instruction::TexSrcTarget size */
-   ASSERT(NUM_TEXTURE_TARGETS <= (1 << 4));
+   STATIC_ASSERT(NUM_TEXTURE_TARGETS <= (1 << 4));
 
ctx->Program.ErrorPos = -1;
ctx->Program.ErrorString = _mesa_strdup("");
-- 
1.8.4.rc3

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


[Mesa-dev] [PATCH 3/7 v2] mesa: Shrink the size of the enum string lookup struct.

2013-09-22 Thread Eric Anholt
Since it's only used for debug information, we can misalign the struct and
save the disk space.  Another 19k on a 64-bit build.

v2: Make a compiler.h macro to only use the attribute if we know we can.
---
 src/mapi/glapi/gen/gl_enums.py | 6 --
 src/mesa/main/compiler.h   | 9 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py
index e1ab600..a0c47f4 100644
--- a/src/mapi/glapi/gen/gl_enums.py
+++ b/src/mapi/glapi/gen/gl_enums.py
@@ -47,8 +47,8 @@ class PrintGlEnums(gl_XML.gl_print_base):
 print '#include "main/imports.h"'
 print '#include "main/mtypes.h"'
 print ''
-print 'typedef struct {'
-print '   size_t offset;'
+print 'typedef struct PACKED {'
+print '   uint16_t offset;'
 print '   int n;'
 print '} enum_elt;'
 print ''
@@ -78,6 +78,8 @@ static char token_tmp[20];
 
 const char *_mesa_lookup_enum_by_nr( int nr )
 {
+   STATIC_ASSERT(sizeof(enum_string_table) < (1 << 16));
+
enum_elt *elt = _mesa_bsearch(& nr, enum_string_table_offsets,
  Elements(enum_string_table_offsets),
  sizeof(enum_string_table_offsets[0]),
diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
index fb7baf8..0f27d5a 100644
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -270,6 +270,15 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
 #define NULL 0
 #endif
 
+/* Used to optionally mark structures with misaligned elements or size as
+ * packed, to trade off performance for space.
+ */
+#if (__GNUC__ >= 3)
+#define PACKED __attribute__((__packed__))
+#else
+#define PACKED
+#endif
+
 
 /**
  * LONGSTRING macro
-- 
1.8.4.rc3

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


Re: [Mesa-dev] Mesa built code size reduction

2013-09-22 Thread Eric Anholt
Eric Anholt  writes:

> Since I'm going to be talking about the megadrivers idea next week at
> XDC, I thought I'd look at what the impact would be of an alternate
> option, and to do that I wanted to first fix up any stupid wastes of
> disk space I found.  I found more than I expected.

This is also in my mesa tree as "mesa-compiled-size" with the two
individual r-bs folded in.


pgp19sxHcoPeg.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] i965: Fix cube array coordinate normalization

2013-09-22 Thread Eric Anholt
Chris Forbes  writes:

> Hardware requires the magnitude of the largest component to not exceed
> 1; brw_cubemap_normalize ensures that this is the case.
>
> Unfortunately, we would previously multiply the array index for cube
> arrays by the normalization factor. The incorrect array index would then
> cause the sampler to attempt to access either the wrong cube, or memory
> outside the cube surface entirely, resulting in garbage rendering or in
> the worst case, hangs.

> +   /* coordinate.xyz *= expr */
> +   assign = new(mem_ctx) ir_assignment(
> +  new(mem_ctx) ir_dereference_variable(var),
> +  new(mem_ctx) ir_expression(ir_binop_mul,
> + ir->coordinate->type,
> +new(mem_ctx) ir_dereference_variable(var),
> +expr));

Something went weird with your indentation here.  They ought to line up
with the ir_binop_mul.

Other than that,

Reviewed-by: Eric Anholt 


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


[Mesa-dev] Consolidate the source files to Makefile.sources v2

2013-09-22 Thread Emil Velikov
This is a first part of my planned automake rework - moving source files
list(s) into Makefile.sources.

* The first four patches are rather trivial cleanups (first one being an
update of Johannes Obermayr's patch from his ).


* The next 24 provides Makefile.sources for the following
 gallium/drivers/
 gallium/state_trackers/
 gallium/winsys/!sw/

* With the final patch nuking an obsolete .gitignore

Overall the diffstat looks quite nice :P
 91 files changed, 511 insertions(+), 685 deletions(-)


Review and comments welcome :)

The series is available in the makefile.sources-v3 branch over at
https://github.com/evelikov/Mesa/

I'm bit short of commit access so would be great of someone can commit the
patches that look reasonable.

Cheers
Emil


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


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

2013-09-22 Thread Emil Velikov
From: Johannes Obermayr 

libdricommon.la is available whenever a non swrast driver is built.
All the classic dri drivers make use of the prebuild library but all
of the gallium ones rebuild it explicitly.

While we're here gallium/{llvm,soft}pipe does not require HAVE_COMMON_DRI
thus do not set in during configure.

v2: [Emil] Add commit message and drop HAVE_COMMON_DRI from configure.ac
Signed-off-by: Emil Velikov 
---
 configure.ac  |  1 -
 src/gallium/targets/dri-freedreno/Makefile.am | 10 +++---
 src/gallium/targets/dri-i915/Makefile.am  |  7 ++-
 src/gallium/targets/dri-ilo/Makefile.am   |  7 ++-
 src/gallium/targets/dri-nouveau/Makefile.am   |  7 ++-
 src/gallium/targets/dri-r300/Makefile.am  |  7 ++-
 src/gallium/targets/dri-r600/Makefile.am  |  7 ++-
 src/gallium/targets/dri-radeonsi/Makefile.am  |  7 ++-
 src/gallium/targets/dri-vmwgfx/Makefile.am|  6 ++
 9 files changed, 17 insertions(+), 42 deletions(-)

diff --git a/configure.ac b/configure.ac
index ca9228c..a14e791 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1816,7 +1816,6 @@ if test "x$with_gallium_drivers" != x; then
 
 if test "x$enable_dri" = xyes; then
 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
-HAVE_COMMON_DRI=yes
 fi
 if test "x$enable_vdpau" = xyes; then
 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
diff --git a/src/gallium/targets/dri-freedreno/Makefile.am 
b/src/gallium/targets/dri-freedreno/Makefile.am
index 615ae6f..ac7460a 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -39,14 +39,10 @@ AM_CPPFLAGS = \
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = kgsl_dri.la msm_dri.la
 
-COMMON_SOURCES = \
-   $(top_srcdir)/src/mesa/drivers/dri/common/utils.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
-
 COMMON_LDFLAGS = -module -avoid-version -shared -no-undefined
 
 COMMON_LIBADD = \
+   $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
@@ -65,12 +61,12 @@ COMMON_LIBADD += $(LLVM_LIBS)
 endif
 
 nodist_EXTRA_kgsl_dri_la_SOURCES = dummy.cpp
-kgsl_dri_la_SOURCES = target-kgsl.c $(COMMON_SOURCES)
+kgsl_dri_la_SOURCES = target-kgsl.c
 kgsl_dri_la_LDFLAGS = $(COMMON_LDFLAGS)
 kgsl_dri_la_LIBADD  = $(COMMON_LIBADD)
 
 nodist_EXTRA_msm_dri_la_SOURCES = dummy.cpp
-msm_dri_la_SOURCES  = target-msm.c $(COMMON_SOURCES)
+msm_dri_la_SOURCES  = target-msm.c
 msm_dri_la_LDFLAGS  = $(COMMON_LDFLAGS)
 msm_dri_la_LIBADD   = $(COMMON_LIBADD)
 
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index ce6be78..e1c6eca 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -40,15 +40,12 @@ AM_CPPFLAGS = \
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = i915_dri.la
 
-i915_dri_la_SOURCES = \
-   target.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/utils.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
+i915_dri_la_SOURCES = target.c
 
 i915_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
 
 i915_dri_la_LIBADD = \
+   $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
diff --git a/src/gallium/targets/dri-ilo/Makefile.am 
b/src/gallium/targets/dri-ilo/Makefile.am
index 7761f33..88233f6 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -39,17 +39,14 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = ilo_dri.la
 
-ilo_dri_la_SOURCES = \
-   target.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/utils.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
-   $(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
+ilo_dri_la_SOURCES = target.c
 
 # need -rpath to create a noinst shared library
 ilo_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
 -rpath $(abs_builddir)
 
 ilo_dri_la_LIBADD = \
+   $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am 
b/src/gallium/targets/dri-nouveau/Makefile.am
index 9cc5455..a02394e 100644
--- a/src/gallium/targets/dr

[Mesa-dev] [PATCH 02/29] mesa/drivers: drop HAVE_*_DRI from individual makefiles

2013-09-22 Thread Emil Velikov
The mesa/drivers/dri/Makefile.am already guards the individual
targets/subdirs with HAVE_*_DRI before including them. Thus making
the additional check within each Makefile.am unnecessary.

Signed-off-by: Emil Velikov 
---
 src/mesa/drivers/dri/i915/Makefile.am| 3 ---
 src/mesa/drivers/dri/i965/Makefile.am| 4 
 src/mesa/drivers/dri/nouveau/Makefile.am | 3 ---
 src/mesa/drivers/dri/r200/Makefile.am| 3 ---
 src/mesa/drivers/dri/radeon/Makefile.am  | 3 ---
 src/mesa/drivers/dri/swrast/Makefile.am  | 3 ---
 6 files changed, 19 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/Makefile.am 
b/src/mesa/drivers/dri/i915/Makefile.am
index 978917c..1f4b21e 100644
--- a/src/mesa/drivers/dri/i915/Makefile.am
+++ b/src/mesa/drivers/dri/i915/Makefile.am
@@ -46,10 +46,7 @@ AM_CFLAGS += \
 endif
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)
-
-if HAVE_I915_DRI
 dri_LTLIBRARIES = i915_dri.la
-endif
 
 i915_dri_la_SOURCES = $(i915_FILES)
 i915_dri_la_LDFLAGS = -module -avoid-version -shared
diff --git a/src/mesa/drivers/dri/i965/Makefile.am 
b/src/mesa/drivers/dri/i965/Makefile.am
index 27c67d1..04fa011 100644
--- a/src/mesa/drivers/dri/i965/Makefile.am
+++ b/src/mesa/drivers/dri/i965/Makefile.am
@@ -23,8 +23,6 @@
 
 include Makefile.sources
 
-if HAVE_I965_DRI
-
 AM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/ \
@@ -95,5 +93,3 @@ test_eu_compact_LDADD = $(TEST_LIBS)
 all-local: i965_dri.la
$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
ln -f .libs/i965_dri.so $(top_builddir)/$(LIB_DIR)/i965_dri.so;
-
-endif
diff --git a/src/mesa/drivers/dri/nouveau/Makefile.am 
b/src/mesa/drivers/dri/nouveau/Makefile.am
index 2b47f75..2723ce7 100644
--- a/src/mesa/drivers/dri/nouveau/Makefile.am
+++ b/src/mesa/drivers/dri/nouveau/Makefile.am
@@ -34,10 +34,7 @@ AM_CFLAGS = \
$(NOUVEAU_CFLAGS)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)
-
-if HAVE_NOUVEAU_DRI
 dri_LTLIBRARIES = nouveau_vieux_dri.la
-endif
 
 nouveau_vieux_dri_la_SOURCES = \
$(NOUVEAU_C_FILES)
diff --git a/src/mesa/drivers/dri/r200/Makefile.am 
b/src/mesa/drivers/dri/r200/Makefile.am
index 4357922..950ac9d 100644
--- a/src/mesa/drivers/dri/r200/Makefile.am
+++ b/src/mesa/drivers/dri/r200/Makefile.am
@@ -37,10 +37,7 @@ AM_CFLAGS = \
$(RADEON_CFLAGS)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)
-
-if HAVE_R200_DRI
 dri_LTLIBRARIES = r200_dri.la
-endif
 
 r200_dri_la_SOURCES = \
 $(R200_C_FILES)
diff --git a/src/mesa/drivers/dri/radeon/Makefile.am 
b/src/mesa/drivers/dri/radeon/Makefile.am
index 43de059..56afd7e 100644
--- a/src/mesa/drivers/dri/radeon/Makefile.am
+++ b/src/mesa/drivers/dri/radeon/Makefile.am
@@ -37,10 +37,7 @@ AM_CFLAGS = \
$(RADEON_CFLAGS)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)
-
-if HAVE_RADEON_DRI
 dri_LTLIBRARIES = radeon_dri.la
-endif
 
 radeon_dri_la_SOURCES = \
 $(RADEON_C_FILES)
diff --git a/src/mesa/drivers/dri/swrast/Makefile.am 
b/src/mesa/drivers/dri/swrast/Makefile.am
index d3da196..de160ed 100644
--- a/src/mesa/drivers/dri/swrast/Makefile.am
+++ b/src/mesa/drivers/dri/swrast/Makefile.am
@@ -34,10 +34,7 @@ AM_CFLAGS = \
$(VISIBILITY_CFLAGS)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)
-
-if HAVE_SWRAST_DRI
 dri_LTLIBRARIES = swrast_dri.la
-endif
 
 swrast_dri_la_SOURCES = \
$(SWRAST_C_FILES)
-- 
1.8.4

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


[Mesa-dev] [PATCH 03/29] gallium/radeon: drop unused variable LIBGALLIUM_LIBS

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/radeon/Makefile.am | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/gallium/drivers/radeon/Makefile.am 
b/src/gallium/drivers/radeon/Makefile.am
index ac8cbd3..d5a6ff2 100644
--- a/src/gallium/drivers/radeon/Makefile.am
+++ b/src/gallium/drivers/radeon/Makefile.am
@@ -1,8 +1,6 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-LIBGALLIUM_LIBS=
-
 noinst_LTLIBRARIES = libradeon.la
 
 AM_CFLAGS = $(GALLIUM_CFLAGS) $(RADEON_CFLAGS)
@@ -30,7 +28,6 @@ libllvmradeon_la_SOURCES = \
$(LLVM_C_FILES)
 
 libllvmradeon_la_LIBADD = \
-   $(LIBGALLIUM_LIBS) \
$(CLOCK_LIB) \
$(LLVM_LIBS) \
$(ELF_LIB)
-- 
1.8.4

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


[Mesa-dev] [PATCH 04/29] r600: use NEED_RADEON_LLVM over R600_NEED_RADEON_GALLIUM

2013-09-22 Thread Emil Velikov
libllvmradeon.la is available whenever NEED_RADEON_LLVM is set, using
R600_NEED_RADEON_GALLIUM is rather ambiguous and unnecessary. Drop it
in favour of NEED_RADEON_LLVM.

Signed-off-by: Emil Velikov 
---
 configure.ac | 2 --
 src/gallium/drivers/r600/Makefile.am | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index a14e791..cf3ffd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1773,7 +1773,6 @@ if test "x$with_gallium_drivers" != x; then
 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
 if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; 
then
 radeon_llvm_check
-R600_NEED_RADEON_GALLIUM=yes;
 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
 fi
 if test "x$enable_r600_llvm" = xyes; then
@@ -1929,7 +1928,6 @@ AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test 
"x$HAVE_GALLIUM_I915" = xyes -o \
  "x$HAVE_GALLIUM_SVGA" = xyes)
 AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
 AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
-AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = 
xyes)
 AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
 AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
 AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = 
xyes)
diff --git a/src/gallium/drivers/r600/Makefile.am 
b/src/gallium/drivers/r600/Makefile.am
index 9203d03..cbe4a09 100644
--- a/src/gallium/drivers/r600/Makefile.am
+++ b/src/gallium/drivers/r600/Makefile.am
@@ -24,7 +24,7 @@ libr600_la_SOURCES = \
 
 libr600_la_LIBADD = ../radeon/libradeon.la
 
-if R600_NEED_RADEON_GALLIUM
+if NEED_RADEON_LLVM
 
 libr600_la_SOURCES += \
$(LLVM_C_SOURCES)
-- 
1.8.4

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


[Mesa-dev] [PATCH 05/29] softpipe: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/softpipe/Android.mk   | 33 ++
 src/gallium/drivers/softpipe/Makefile.am  | 32 ++---
 src/gallium/drivers/softpipe/Makefile.sources | 30 +++
 src/gallium/drivers/softpipe/SConscript   | 34 +++
 4 files changed, 37 insertions(+), 92 deletions(-)
 create mode 100644 src/gallium/drivers/softpipe/Makefile.sources

diff --git a/src/gallium/drivers/softpipe/Android.mk 
b/src/gallium/drivers/softpipe/Android.mk
index 6a125a5..5d3a93b 100644
--- a/src/gallium/drivers/softpipe/Android.mk
+++ b/src/gallium/drivers/softpipe/Android.mk
@@ -23,37 +23,8 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# from Makefile
-C_SOURCES = \
-   sp_fs_exec.c \
-   sp_clear.c \
-   sp_fence.c \
-   sp_flush.c \
-   sp_query.c \
-   sp_context.c \
-   sp_draw_arrays.c \
-   sp_prim_vbuf.c \
-   sp_quad_pipe.c \
-   sp_quad_stipple.c \
-   sp_quad_depth_test.c \
-   sp_quad_fs.c \
-   sp_quad_blend.c \
-   sp_screen.c \
-sp_setup.c \
-   sp_state_blend.c \
-   sp_state_clip.c \
-   sp_state_derived.c \
-   sp_state_sampler.c \
-   sp_state_shader.c \
-   sp_state_so.c \
-   sp_state_rasterizer.c \
-   sp_state_surface.c \
-   sp_state_vertex.c \
-   sp_texture.c \
-   sp_tex_sample.c \
-   sp_tex_tile_cache.c \
-   sp_tile_cache.c \
-   sp_surface.c
+# get C_SOURCES
+include $(LOCAL_PATH)/Makefile.sources
 
 include $(CLEAR_VARS)
 
diff --git a/src/gallium/drivers/softpipe/Makefile.am 
b/src/gallium/drivers/softpipe/Makefile.am
index 52ce958..432fe7d 100644
--- a/src/gallium/drivers/softpipe/Makefile.am
+++ b/src/gallium/drivers/softpipe/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CPPFLAGS = \
@@ -29,33 +30,4 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = libsoftpipe.la
 
-libsoftpipe_la_SOURCES = \
-   sp_fs_exec.c \
-   sp_clear.c \
-   sp_fence.c \
-   sp_flush.c \
-   sp_query.c \
-   sp_context.c \
-   sp_draw_arrays.c \
-   sp_prim_vbuf.c \
-   sp_quad_pipe.c \
-   sp_quad_stipple.c \
-   sp_quad_depth_test.c \
-   sp_quad_fs.c \
-   sp_quad_blend.c \
-   sp_screen.c \
-   sp_setup.c \
-   sp_state_blend.c \
-   sp_state_clip.c \
-   sp_state_derived.c \
-   sp_state_sampler.c \
-   sp_state_shader.c \
-   sp_state_so.c \
-   sp_state_rasterizer.c \
-   sp_state_surface.c \
-   sp_state_vertex.c \
-   sp_texture.c \
-   sp_tex_sample.c \
-   sp_tex_tile_cache.c \
-   sp_tile_cache.c \
-   sp_surface.c
+libsoftpipe_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/softpipe/Makefile.sources 
b/src/gallium/drivers/softpipe/Makefile.sources
new file mode 100644
index 000..8237bcf
--- /dev/null
+++ b/src/gallium/drivers/softpipe/Makefile.sources
@@ -0,0 +1,30 @@
+C_SOURCES := \
+   sp_fs_exec.c \
+   sp_clear.c \
+   sp_fence.c \
+   sp_flush.c \
+   sp_query.c \
+   sp_context.c \
+   sp_draw_arrays.c \
+   sp_prim_vbuf.c \
+   sp_quad_pipe.c \
+   sp_quad_stipple.c \
+   sp_quad_depth_test.c \
+   sp_quad_fs.c \
+   sp_quad_blend.c \
+   sp_screen.c \
+   sp_setup.c \
+   sp_state_blend.c \
+   sp_state_clip.c \
+   sp_state_derived.c \
+   sp_state_sampler.c \
+   sp_state_shader.c \
+   sp_state_so.c \
+   sp_state_rasterizer.c \
+   sp_state_surface.c \
+   sp_state_vertex.c \
+   sp_texture.c \
+   sp_tex_sample.c \
+   sp_tex_tile_cache.c \
+   sp_tile_cache.c \
+   sp_surface.c
diff --git a/src/gallium/drivers/softpipe/SConscript 
b/src/gallium/drivers/softpipe/SConscript
index da2c93e..6768cbb 100644
--- a/src/gallium/drivers/softpipe/SConscript
+++ b/src/gallium/drivers/softpipe/SConscript
@@ -2,39 +2,11 @@ Import('*')
 
 env = env.Clone()
 
+
 softpipe = env.ConvenienceLibrary(
target = 'softpipe',
-   source = [
-   'sp_fs_exec.c',
-   'sp_clear.c',
-   'sp_context.c',
-   'sp_draw_arrays.c',
-   'sp_fence.c',
-   'sp_flush.c',
-   'sp_prim_vbuf.c',
-   'sp_setup.c',
-   'sp_quad_blend.c',
-   'sp_quad_pipe.c',
-   'sp_quad_depth_test.c',
-   'sp_quad_fs.c',
-   'sp_quad_stipple.c',
-   'sp_query.c',
-   'sp_screen.c',
-   'sp_state_blend.c',
-   'sp_state_clip.c',
-   'sp_state_derived.c',
-   'sp_state_rasterizer.c',
-   'sp_state_sampler.c',
-   'sp_state_shader.c',
-   'sp_state_so.c',
-  

[Mesa-dev] [PATCH 06/29] rbug: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/rbug/Makefile.am  | 7 ++-
 src/gallium/drivers/rbug/Makefile.sources | 5 +
 src/gallium/drivers/rbug/SConscript   | 8 ++--
 3 files changed, 9 insertions(+), 11 deletions(-)
 create mode 100644 src/gallium/drivers/rbug/Makefile.sources

diff --git a/src/gallium/drivers/rbug/Makefile.am 
b/src/gallium/drivers/rbug/Makefile.am
index 3c1a8b5..1aa6521 100644
--- a/src/gallium/drivers/rbug/Makefile.am
+++ b/src/gallium/drivers/rbug/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 noinst_LTLIBRARIES = librbug.la
@@ -34,8 +35,4 @@ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/include
 
-librbug_la_SOURCES = \
-   rbug_core.c \
-   rbug_context.c \
-   rbug_objects.c \
-   rbug_screen.c
+librbug_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/rbug/Makefile.sources 
b/src/gallium/drivers/rbug/Makefile.sources
new file mode 100644
index 000..32a18f6
--- /dev/null
+++ b/src/gallium/drivers/rbug/Makefile.sources
@@ -0,0 +1,5 @@
+C_SOURCES := \
+   rbug_core.c \
+   rbug_context.c \
+   rbug_objects.c \
+   rbug_screen.c
diff --git a/src/gallium/drivers/rbug/SConscript 
b/src/gallium/drivers/rbug/SConscript
index 169c271..63209ab 100644
--- a/src/gallium/drivers/rbug/SConscript
+++ b/src/gallium/drivers/rbug/SConscript
@@ -4,12 +4,8 @@ env = env.Clone()
 
 rbug = env.ConvenienceLibrary(
target = 'rbug',
-   source = [
-   'rbug_context.c',
-   'rbug_core.c',
-   'rbug_objects.c',
-   'rbug_screen.c',
-   ])
+   source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
+   )
 
 env.Alias('rbug', rbug)
 
-- 
1.8.4

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


[Mesa-dev] [PATCH 07/29] llvmpipe: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/llvmpipe/Makefile.am  | 44 ++
 src/gallium/drivers/llvmpipe/Makefile.sources | 42 +
 src/gallium/drivers/llvmpipe/SConscript   | 45 ++-
 3 files changed, 46 insertions(+), 85 deletions(-)
 create mode 100644 src/gallium/drivers/llvmpipe/Makefile.sources

diff --git a/src/gallium/drivers/llvmpipe/Makefile.am 
b/src/gallium/drivers/llvmpipe/Makefile.am
index 9059053..f24bf71 100644
--- a/src/gallium/drivers/llvmpipe/Makefile.am
+++ b/src/gallium/drivers/llvmpipe/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CPPFLAGS = \
@@ -31,48 +32,7 @@ AM_CXXFLAGS= $(LLVM_CXXFLAGS)
 
 noinst_LTLIBRARIES = libllvmpipe.la
 
-libllvmpipe_la_SOURCES = \
-   lp_bld_alpha.c \
-   lp_bld_blend.c \
-   lp_bld_blend_aos.c \
-   lp_bld_blend_logicop.c \
-   lp_bld_depth.c \
-   lp_bld_interp.c \
-   lp_clear.c \
-   lp_context.c \
-   lp_draw_arrays.c \
-   lp_fence.c \
-   lp_flush.c \
-   lp_jit.c \
-   lp_memory.c \
-   lp_perf.c \
-   lp_query.c \
-   lp_rast.c \
-   lp_rast_debug.c \
-   lp_rast_tri.c \
-   lp_scene.c \
-   lp_scene_queue.c \
-   lp_screen.c \
-   lp_setup.c \
-   lp_setup_line.c \
-   lp_setup_point.c \
-   lp_setup_tri.c \
-   lp_setup_vbuf.c \
-   lp_state_blend.c \
-   lp_state_clip.c \
-   lp_state_derived.c \
-   lp_state_fs.c \
-   lp_state_setup.c \
-   lp_state_gs.c \
-   lp_state_rasterizer.c \
-   lp_state_sampler.c \
-   lp_state_so.c \
-   lp_state_surface.c \
-   lp_state_vertex.c \
-   lp_state_vs.c \
-   lp_surface.c \
-   lp_tex_sample.c \
-   lp_texture.c
+libllvmpipe_la_SOURCES = $(C_SOURCES)
 
 libllvmpipe_la_LDFLAGS = $(LLVM_LDFLAGS)
 
diff --git a/src/gallium/drivers/llvmpipe/Makefile.sources 
b/src/gallium/drivers/llvmpipe/Makefile.sources
new file mode 100644
index 000..8a19acd
--- /dev/null
+++ b/src/gallium/drivers/llvmpipe/Makefile.sources
@@ -0,0 +1,42 @@
+C_SOURCES := \
+   lp_bld_alpha.c \
+   lp_bld_blend.c \
+   lp_bld_blend_aos.c \
+   lp_bld_blend_logicop.c \
+   lp_bld_depth.c \
+   lp_bld_interp.c \
+   lp_clear.c \
+   lp_context.c \
+   lp_draw_arrays.c \
+   lp_fence.c \
+   lp_flush.c \
+   lp_jit.c \
+   lp_memory.c \
+   lp_perf.c \
+   lp_query.c \
+   lp_rast.c \
+   lp_rast_debug.c \
+   lp_rast_tri.c \
+   lp_scene.c \
+   lp_scene_queue.c \
+   lp_screen.c \
+   lp_setup.c \
+   lp_setup_line.c \
+   lp_setup_point.c \
+   lp_setup_tri.c \
+   lp_setup_vbuf.c \
+   lp_state_blend.c \
+   lp_state_clip.c \
+   lp_state_derived.c \
+   lp_state_fs.c \
+   lp_state_setup.c \
+   lp_state_gs.c \
+   lp_state_rasterizer.c \
+   lp_state_sampler.c \
+   lp_state_so.c \
+   lp_state_surface.c \
+   lp_state_vertex.c \
+   lp_state_vs.c \
+   lp_surface.c \
+   lp_tex_sample.c \
+   lp_texture.c
diff --git a/src/gallium/drivers/llvmpipe/SConscript 
b/src/gallium/drivers/llvmpipe/SConscript
index 22314c2..20500fd 100644
--- a/src/gallium/drivers/llvmpipe/SConscript
+++ b/src/gallium/drivers/llvmpipe/SConscript
@@ -11,49 +11,8 @@ env = env.Clone()
 
 llvmpipe = env.ConvenienceLibrary(
target = 'llvmpipe',
-   source = [
-   'lp_bld_alpha.c',
-   'lp_bld_blend.c',
-   'lp_bld_blend_aos.c',
-   'lp_bld_blend_logicop.c',
-   'lp_bld_depth.c',
-   'lp_bld_interp.c',
-   'lp_clear.c',
-   'lp_context.c',
-   'lp_draw_arrays.c',
-   'lp_fence.c',
-   'lp_flush.c',
-   'lp_jit.c',
-   'lp_memory.c',
-   'lp_perf.c',
-   'lp_query.c',
-   'lp_rast.c',
-   'lp_rast_debug.c',
-   'lp_rast_tri.c',
-   'lp_scene.c',
-   'lp_scene_queue.c',
-   'lp_screen.c',
-   'lp_setup.c',
-   'lp_setup_line.c',
-   'lp_setup_point.c',
-   'lp_setup_tri.c',
-   'lp_setup_vbuf.c',
-   'lp_state_blend.c',
-   'lp_state_clip.c',
-   'lp_state_derived.c',
-   'lp_state_fs.c',
-   'lp_state_setup.c',
-   'lp_state_gs.c',
-   'lp_state_rasterizer.c',
-   'lp_state_sampler.c',
-'lp_state_so.c',
-   'lp_state_surface.c',
-   'lp_state_vertex.c',
-   'lp_state_vs.c',
-   'lp_surface.c',
-   'lp_tex_sample.c'

[Mesa-dev] [PATCH 08/29] trace: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/trace/Makefile.am  | 8 ++--
 src/gallium/drivers/trace/Makefile.sources | 6 ++
 src/gallium/drivers/trace/SConscript   | 9 ++---
 3 files changed, 10 insertions(+), 13 deletions(-)
 create mode 100644 src/gallium/drivers/trace/Makefile.sources

diff --git a/src/gallium/drivers/trace/Makefile.am 
b/src/gallium/drivers/trace/Makefile.am
index 984ead4..db5904d 100644
--- a/src/gallium/drivers/trace/Makefile.am
+++ b/src/gallium/drivers/trace/Makefile.am
@@ -1,3 +1,4 @@
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -6,9 +7,4 @@ AM_CFLAGS = \
 
 noinst_LTLIBRARIES = libtrace.la
 
-libtrace_la_SOURCES = \
-   tr_context.c \
-   tr_dump.c \
-   tr_dump_state.c \
-   tr_screen.c \
-   tr_texture.c
+libtrace_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/trace/Makefile.sources 
b/src/gallium/drivers/trace/Makefile.sources
new file mode 100644
index 000..d325739
--- /dev/null
+++ b/src/gallium/drivers/trace/Makefile.sources
@@ -0,0 +1,6 @@
+C_SOURCES := \
+   tr_context.c \
+   tr_dump.c \
+   tr_dump_state.c \
+   tr_screen.c \
+   tr_texture.c
diff --git a/src/gallium/drivers/trace/SConscript 
b/src/gallium/drivers/trace/SConscript
index 1384fe3..7341d1c 100644
--- a/src/gallium/drivers/trace/SConscript
+++ b/src/gallium/drivers/trace/SConscript
@@ -4,13 +4,8 @@ env = env.Clone()
 
 trace = env.ConvenienceLibrary(
 target = 'trace',
-source = [
-'tr_context.c',
-'tr_dump.c',
-'tr_dump_state.c',
-'tr_screen.c',
-'tr_texture.c',
-])
+source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
+)
 
 env.Alias('trace', trace)
 
-- 
1.8.4

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


[Mesa-dev] [PATCH 09/29] freedreno: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/freedreno/Makefile.am   | 13 ++---
 src/gallium/drivers/freedreno/Makefile.sources  | 11 +++
 src/gallium/drivers/freedreno/a2xx/Makefile.am  | 17 ++---
 src/gallium/drivers/freedreno/a2xx/Makefile.sources | 15 +++
 src/gallium/drivers/freedreno/a3xx/Makefile.am  | 17 ++---
 src/gallium/drivers/freedreno/a3xx/Makefile.sources | 15 +++
 6 files changed, 47 insertions(+), 41 deletions(-)
 create mode 100644 src/gallium/drivers/freedreno/Makefile.sources
 create mode 100644 src/gallium/drivers/freedreno/a2xx/Makefile.sources
 create mode 100644 src/gallium/drivers/freedreno/a3xx/Makefile.sources

diff --git a/src/gallium/drivers/freedreno/Makefile.am 
b/src/gallium/drivers/freedreno/Makefile.am
index b6dbbd1..9f5a80a 100644
--- a/src/gallium/drivers/freedreno/Makefile.am
+++ b/src/gallium/drivers/freedreno/Makefile.am
@@ -1,3 +1,4 @@
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 noinst_LTLIBRARIES = libfreedreno.la
@@ -13,17 +14,7 @@ AM_CFLAGS = \
 
 SUBDIRS = a2xx a3xx
 
-libfreedreno_la_SOURCES = \
-   freedreno_util.c \
-   freedreno_fence.c \
-   freedreno_resource.c \
-   freedreno_surface.c \
-   freedreno_draw.c \
-   freedreno_state.c \
-   freedreno_texture.c \
-   freedreno_context.c \
-   freedreno_screen.c \
-   freedreno_gmem.c
+libfreedreno_la_SOURCES = $(C_SOURCES)
 
 libfreedreno_la_LIBADD = \
a3xx/libfd3xx.la \
diff --git a/src/gallium/drivers/freedreno/Makefile.sources 
b/src/gallium/drivers/freedreno/Makefile.sources
new file mode 100644
index 000..02a88b6
--- /dev/null
+++ b/src/gallium/drivers/freedreno/Makefile.sources
@@ -0,0 +1,11 @@
+C_SOURCES := \
+   freedreno_util.c \
+   freedreno_fence.c \
+   freedreno_resource.c \
+   freedreno_surface.c \
+   freedreno_draw.c \
+   freedreno_state.c \
+   freedreno_texture.c \
+   freedreno_context.c \
+   freedreno_screen.c \
+   freedreno_gmem.c
diff --git a/src/gallium/drivers/freedreno/a2xx/Makefile.am 
b/src/gallium/drivers/freedreno/a2xx/Makefile.am
index 8ab0f76..b8a5ac1 100644
--- a/src/gallium/drivers/freedreno/a2xx/Makefile.am
+++ b/src/gallium/drivers/freedreno/a2xx/Makefile.am
@@ -1,3 +1,4 @@
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 noinst_LTLIBRARIES = libfd2xx.la
@@ -10,18 +11,4 @@ AM_CFLAGS = \
$(FREEDRENO_CFLAGS) \
$(VISIBILITY_CFLAGS)
 
-libfd2xx_la_SOURCES = \
-   fd2_blend.c \
-   fd2_compiler.c \
-   fd2_context.c \
-   fd2_draw.c \
-   fd2_emit.c \
-   fd2_gmem.c \
-   fd2_program.c \
-   fd2_rasterizer.c \
-   fd2_screen.c \
-   fd2_texture.c \
-   fd2_util.c \
-   fd2_zsa.c \
-   disasm-a2xx.c \
-   ir-a2xx.c
+libfd2xx_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/freedreno/a2xx/Makefile.sources 
b/src/gallium/drivers/freedreno/a2xx/Makefile.sources
new file mode 100644
index 000..1ef2852
--- /dev/null
+++ b/src/gallium/drivers/freedreno/a2xx/Makefile.sources
@@ -0,0 +1,15 @@
+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
index a7e415f..6b8b2e4 100644
--- a/src/gallium/drivers/freedreno/a3xx/Makefile.am
+++ b/src/gallium/drivers/freedreno/a3xx/Makefile.am
@@ -1,3 +1,4 @@
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 noinst_LTLIBRARIES = libfd3xx.la
@@ -10,18 +11,4 @@ AM_CFLAGS = \
$(FREEDRENO_CFLAGS) \
$(VISIBILITY_CFLAGS)
 
-libfd3xx_la_SOURCES = \
-   fd3_blend.c \
-   fd3_compiler.c \
-   fd3_context.c \
-   fd3_draw.c \
-   fd3_emit.c \
-   fd3_gmem.c \
-   fd3_program.c \
-   fd3_rasterizer.c \
-   fd3_screen.c \
-   fd3_texture.c \
-   fd3_util.c \
-   fd3_zsa.c \
-   disasm-a3xx.c \
-   ir-a3xx.c
+libfd3xx_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/freedreno/a3xx/Makefile.sources 
b/src/gallium/drivers/freedreno/a3xx/Makefile.sources
new file mode 100644
index 000..24ee6f0
--- /dev/null
+++ b/src/gallium/drivers/freedreno/a3xx/Makefile.sources
@@ -0,0 +1,15 @@
+C_SOURCES := \
+   fd3_blend.c \
+   fd3_compiler.c \
+   fd3_context.c \
+   fd3_draw.c \
+   fd3_emit.c \
+   fd3_gmem.c \
+   fd3_program.c \
+   fd3_rasterizer.c \
+   fd3_screen.c \
+   fd3_texture.c \
+   fd3_util.c \
+   fd3_zsa.c \
+   disasm-a3xx.c \
+   ir-a3xx.c
-- 
1.8.4

_

[Mesa-dev] [PATCH 10/29] identity: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 configure.ac  |  1 +
 src/gallium/drivers/Makefile.am   | 11 +--
 src/gallium/drivers/identity/Makefile.am  | 11 +++
 src/gallium/drivers/identity/Makefile.sources |  4 
 src/gallium/drivers/identity/SConscript   |  7 ++-
 5 files changed, 19 insertions(+), 15 deletions(-)
 create mode 100644 src/gallium/drivers/identity/Makefile.am
 create mode 100644 src/gallium/drivers/identity/Makefile.sources

diff --git a/configure.ac b/configure.ac
index cf3ffd8..f6a0291 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1990,6 +1990,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/drivers/freedreno/a2xx/Makefile
src/gallium/drivers/freedreno/a3xx/Makefile
src/gallium/drivers/i915/Makefile
+   src/gallium/drivers/identity/Makefile
src/gallium/drivers/ilo/Makefile
src/gallium/drivers/llvmpipe/Makefile
src/gallium/drivers/nouveau/Makefile
diff --git a/src/gallium/drivers/Makefile.am b/src/gallium/drivers/Makefile.am
index 171d102..c75fb82 100644
--- a/src/gallium/drivers/Makefile.am
+++ b/src/gallium/drivers/Makefile.am
@@ -11,7 +11,7 @@ AM_CFLAGS = $(VISIBILITY_CFLAGS)
 
 noinst_LTLIBRARIES =
 
-SUBDIRS = . trace rbug
+SUBDIRS = . identity trace rbug
 
 

 
@@ -24,15 +24,6 @@ galahad_libgalahad_la_SOURCES = \
 
 

 
-noinst_LTLIBRARIES += identity/libidentity.la
-
-identity_libidentity_la_SOURCES = \
-   identity/id_objects.c \
-   identity/id_context.c \
-   identity/id_screen.c
-
-
-
 # Meta-driver which combines whichever software rasterizers have been
 # built into a single convenience library.
 
diff --git a/src/gallium/drivers/identity/Makefile.am 
b/src/gallium/drivers/identity/Makefile.am
new file mode 100644
index 000..1caf328
--- /dev/null
+++ b/src/gallium/drivers/identity/Makefile.am
@@ -0,0 +1,11 @@
+include Makefile.sources
+include $(top_srcdir)/src/gallium/Automake.inc
+
+AM_CFLAGS = \
+   -I$(top_srcdir)/src/gallium/drivers \
+   $(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS)
+
+noinst_LTLIBRARIES = libidentity.la
+
+libidentity_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/identity/Makefile.sources 
b/src/gallium/drivers/identity/Makefile.sources
new file mode 100644
index 000..14351e0
--- /dev/null
+++ b/src/gallium/drivers/identity/Makefile.sources
@@ -0,0 +1,4 @@
+C_SOURCES := \
+   id_objects.c \
+   id_context.c \
+   id_screen.c
diff --git a/src/gallium/drivers/identity/SConscript 
b/src/gallium/drivers/identity/SConscript
index d24d1ec..1209951 100644
--- a/src/gallium/drivers/identity/SConscript
+++ b/src/gallium/drivers/identity/SConscript
@@ -4,11 +4,8 @@ env = env.Clone()
 
 identity = env.ConvenienceLibrary(
target = 'identity',
-   source = [
-   'id_context.c',
-   'id_objects.c',
-   'id_screen.c',
-   ])
+   source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
+   )
 
 env.Alias('identity', identity)
 
-- 
1.8.4

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


[Mesa-dev] [PATCH 11/29] noop: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 configure.ac  |  1 +
 src/gallium/drivers/Makefile.am   | 13 +
 src/gallium/drivers/noop/Makefile.am  | 16 
 src/gallium/drivers/noop/Makefile.sources |  3 +++
 src/gallium/drivers/noop/SConscript   |  8 +++-
 5 files changed, 24 insertions(+), 17 deletions(-)
 create mode 100644 src/gallium/drivers/noop/Makefile.am
 create mode 100644 src/gallium/drivers/noop/Makefile.sources

diff --git a/configure.ac b/configure.ac
index f6a0291..38d4e5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1993,6 +1993,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/drivers/identity/Makefile
src/gallium/drivers/ilo/Makefile
src/gallium/drivers/llvmpipe/Makefile
+   src/gallium/drivers/noop/Makefile
src/gallium/drivers/nouveau/Makefile
src/gallium/drivers/r300/Makefile
src/gallium/drivers/r600/Makefile
diff --git a/src/gallium/drivers/Makefile.am b/src/gallium/drivers/Makefile.am
index c75fb82..3f7621d 100644
--- a/src/gallium/drivers/Makefile.am
+++ b/src/gallium/drivers/Makefile.am
@@ -11,7 +11,7 @@ AM_CFLAGS = $(VISIBILITY_CFLAGS)
 
 noinst_LTLIBRARIES =
 
-SUBDIRS = . identity trace rbug
+SUBDIRS = . identity noop trace rbug
 
 

 
@@ -24,17 +24,6 @@ galahad_libgalahad_la_SOURCES = \
 
 

 
-# Meta-driver which combines whichever software rasterizers have been
-# built into a single convenience library.
-
-noinst_LTLIBRARIES += noop/libnoop.la
-
-noop_libnoop_la_SOURCES = \
-   noop/noop_pipe.c \
-   noop/noop_state.c
-
-
-
 if HAVE_GALLIUM_R600
 
 SUBDIRS += radeon
diff --git a/src/gallium/drivers/noop/Makefile.am 
b/src/gallium/drivers/noop/Makefile.am
new file mode 100644
index 000..1f4ba02
--- /dev/null
+++ b/src/gallium/drivers/noop/Makefile.am
@@ -0,0 +1,16 @@
+
+
+# Meta-driver which combines whichever software rasterizers have been
+# built into a single convenience library.
+
+include Makefile.sources
+include $(top_srcdir)/src/gallium/Automake.inc
+
+AM_CFLAGS = \
+   -I$(top_srcdir)/src/gallium/drivers \
+   $(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS)
+
+noinst_LTLIBRARIES = libnoop.la
+
+libnoop_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/noop/Makefile.sources 
b/src/gallium/drivers/noop/Makefile.sources
new file mode 100644
index 000..916385e
--- /dev/null
+++ b/src/gallium/drivers/noop/Makefile.sources
@@ -0,0 +1,3 @@
+C_SOURCES := \
+   noop_pipe.c \
+   noop_state.c
diff --git a/src/gallium/drivers/noop/SConscript 
b/src/gallium/drivers/noop/SConscript
index a4d0dca..9cb2e29 100644
--- a/src/gallium/drivers/noop/SConscript
+++ b/src/gallium/drivers/noop/SConscript
@@ -7,9 +7,7 @@ env = env.Clone()
 
 noop = env.ConvenienceLibrary(
target = 'noop',
-   source = [
-   'noop_pipe.c',
-   'noop_state.c'
-   ]
-) + extra
+   source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
+   ) + extra
+
 Export('noop')
-- 
1.8.4

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


[Mesa-dev] [PATCH 12/29] galahad: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 configure.ac |  1 +
 src/gallium/drivers/Makefile.am  | 21 +
 src/gallium/drivers/galahad/Makefile.am  | 16 
 src/gallium/drivers/galahad/Makefile.sources |  4 
 src/gallium/drivers/galahad/SConscript   |  7 ++-
 5 files changed, 24 insertions(+), 25 deletions(-)
 create mode 100644 src/gallium/drivers/galahad/Makefile.am
 create mode 100644 src/gallium/drivers/galahad/Makefile.sources

diff --git a/configure.ac b/configure.ac
index 38d4e5c..48c7be6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1989,6 +1989,7 @@ AC_CONFIG_FILES([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
src/gallium/drivers/ilo/Makefile
diff --git a/src/gallium/drivers/Makefile.am b/src/gallium/drivers/Makefile.am
index 3f7621d..f8baa3c 100644
--- a/src/gallium/drivers/Makefile.am
+++ b/src/gallium/drivers/Makefile.am
@@ -1,26 +1,7 @@
 AUTOMAKE_OPTIONS = subdir-objects
 
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/include \
-   -I$(top_srcdir)/src/gallium/include \
-   -I$(top_srcdir)/src/gallium/auxiliary \
-   -I$(top_srcdir)/src/gallium/drivers \
-   $(DEFINES)
 
-AM_CFLAGS = $(VISIBILITY_CFLAGS)
-
-noinst_LTLIBRARIES =
-
-SUBDIRS = . identity noop trace rbug
-
-
-
-noinst_LTLIBRARIES += galahad/libgalahad.la
-
-galahad_libgalahad_la_SOURCES = \
-   galahad/glhd_objects.c \
-   galahad/glhd_context.c \
-   galahad/glhd_screen.c
+SUBDIRS = . galahad identity noop trace rbug
 
 

 
diff --git a/src/gallium/drivers/galahad/Makefile.am 
b/src/gallium/drivers/galahad/Makefile.am
new file mode 100644
index 000..5f64b93
--- /dev/null
+++ b/src/gallium/drivers/galahad/Makefile.am
@@ -0,0 +1,16 @@
+
+
+# Meta-driver which combines whichever software rasterizers have been
+# built into a single convenience library.
+
+include Makefile.sources
+include $(top_srcdir)/src/gallium/Automake.inc
+
+AM_CFLAGS = \
+   -I$(top_srcdir)/src/gallium/drivers \
+   $(GALLIUM_CFLAGS) \
+   $(VISIBILITY_CFLAGS)
+
+noinst_LTLIBRARIES = libgalahad.la
+
+libgalahad_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/galahad/Makefile.sources 
b/src/gallium/drivers/galahad/Makefile.sources
new file mode 100644
index 000..f6c7f4b
--- /dev/null
+++ b/src/gallium/drivers/galahad/Makefile.sources
@@ -0,0 +1,4 @@
+C_SOURCES := \
+   glhd_objects.c \
+   glhd_context.c \
+   glhd_screen.c
diff --git a/src/gallium/drivers/galahad/SConscript 
b/src/gallium/drivers/galahad/SConscript
index 3f39f99..b1d31e4 100644
--- a/src/gallium/drivers/galahad/SConscript
+++ b/src/gallium/drivers/galahad/SConscript
@@ -4,11 +4,8 @@ env = env.Clone()
 
 galahad = env.ConvenienceLibrary(
target = 'galahad',
-   source = [
-   'glhd_context.c',
-   'glhd_objects.c',
-   'glhd_screen.c',
-   ])
+   source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
+   )
 
 env.Alias('galahad', galahad)
 
-- 
1.8.4

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


[Mesa-dev] [PATCH 13/29] st/clover: consolidate CPP sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/clover/Makefile.am  | 43 ++
 src/gallium/state_trackers/clover/Makefile.sources | 40 
 2 files changed, 43 insertions(+), 40 deletions(-)
 create mode 100644 src/gallium/state_trackers/clover/Makefile.sources

diff --git a/src/gallium/state_trackers/clover/Makefile.am 
b/src/gallium/state_trackers/clover/Makefile.am
index b4c197a..d0ce68e 100644
--- a/src/gallium/state_trackers/clover/Makefile.am
+++ b/src/gallium/state_trackers/clover/Makefile.am
@@ -1,5 +1,7 @@
 AUTOMAKE_OPTIONS = subdir-objects
 
+include Makefile.sources
+
 AM_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\" \
@@ -35,46 +37,7 @@ libclover_la_CXXFLAGS = \
 libclover_la_LIBADD = \
libcltgsi.la libclllvm.la
 
-libclover_la_SOURCES = \
-   core/base.hpp \
-   core/compat.hpp \
-   core/compiler.hpp \
-   core/geometry.hpp \
-   core/device.hpp \
-   core/device.cpp \
-   core/context.hpp \
-   core/context.cpp \
-   core/queue.hpp \
-   core/queue.cpp \
-   core/format.hpp \
-   core/format.cpp \
-   core/memory.hpp \
-   core/memory.cpp \
-   core/platform.hpp \
-   core/platform.cpp \
-   core/resource.hpp \
-   core/resource.cpp \
-   core/sampler.hpp \
-   core/sampler.cpp \
-   core/event.hpp \
-   core/event.cpp \
-   core/program.hpp \
-   core/program.cpp \
-   core/kernel.hpp \
-   core/kernel.cpp \
-   core/module.hpp \
-   core/module.cpp \
-   api/util.hpp \
-   api/platform.cpp \
-   api/device.cpp \
-   api/context.cpp \
-   api/queue.cpp \
-   api/memory.cpp \
-   api/transfer.cpp \
-   api/sampler.cpp \
-   api/event.cpp \
-   api/program.cpp \
-   api/kernel.cpp
+libclover_la_SOURCES = $(CPP_SOURCES)
 
 cldir = $(includedir)/CL
 cl_HEADERS = \
diff --git a/src/gallium/state_trackers/clover/Makefile.sources 
b/src/gallium/state_trackers/clover/Makefile.sources
new file mode 100644
index 000..fd23d78
--- /dev/null
+++ b/src/gallium/state_trackers/clover/Makefile.sources
@@ -0,0 +1,40 @@
+CPP_SOURCES := \
+   core/base.hpp \
+   core/compat.hpp \
+   core/compiler.hpp \
+   core/geometry.hpp \
+   core/device.hpp \
+   core/device.cpp \
+   core/context.hpp \
+   core/context.cpp \
+   core/queue.hpp \
+   core/queue.cpp \
+   core/format.hpp \
+   core/format.cpp \
+   core/memory.hpp \
+   core/memory.cpp \
+   core/platform.hpp \
+   core/platform.cpp \
+   core/resource.hpp \
+   core/resource.cpp \
+   core/sampler.hpp \
+   core/sampler.cpp \
+   core/event.hpp \
+   core/event.cpp \
+   core/program.hpp \
+   core/program.cpp \
+   core/kernel.hpp \
+   core/kernel.cpp \
+   core/module.hpp \
+   core/module.cpp \
+   api/util.hpp \
+   api/platform.cpp \
+   api/device.cpp \
+   api/context.cpp \
+   api/queue.cpp \
+   api/memory.cpp \
+   api/transfer.cpp \
+   api/sampler.cpp \
+   api/event.cpp \
+   api/program.cpp \
+   api/kernel.cpp
-- 
1.8.4

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


[Mesa-dev] [PATCH 14/29] st/dri: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/dri/drm/Makefile.am  | 7 ++-
 src/gallium/state_trackers/dri/drm/Makefile.sources | 5 +
 src/gallium/state_trackers/dri/drm/SConscript   | 9 +
 3 files changed, 8 insertions(+), 13 deletions(-)
 create mode 100644 src/gallium/state_trackers/dri/drm/Makefile.sources

diff --git a/src/gallium/state_trackers/dri/drm/Makefile.am 
b/src/gallium/state_trackers/dri/drm/Makefile.am
index f8916b1..c90c463 100644
--- a/src/gallium/state_trackers/dri/drm/Makefile.am
+++ b/src/gallium/state_trackers/dri/drm/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CPPFLAGS = \
@@ -34,8 +35,4 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = libdridrm.la
 
-libdridrm_la_SOURCES = \
-   dri_context.c \
-   dri_screen.c \
-   dri_drawable.c \
-   dri2.c
+libdridrm_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/state_trackers/dri/drm/Makefile.sources 
b/src/gallium/state_trackers/dri/drm/Makefile.sources
new file mode 100644
index 000..b9b93a2
--- /dev/null
+++ b/src/gallium/state_trackers/dri/drm/Makefile.sources
@@ -0,0 +1,5 @@
+C_SOURCES := \
+   dri_context.c \
+   dri_screen.c \
+   dri_drawable.c \
+   dri2.c
diff --git a/src/gallium/state_trackers/dri/drm/SConscript 
b/src/gallium/state_trackers/dri/drm/SConscript
index a996f50..07eaa0a 100644
--- a/src/gallium/state_trackers/dri/drm/SConscript
+++ b/src/gallium/state_trackers/dri/drm/SConscript
@@ -15,15 +15,8 @@ env.Append(CPPPATH = [
 xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
 ])
 
-sources = [
-'dri_context.c',
-'dri_drawable.c',
-'dri_screen.c',
-'dri2.c',
-]
-
 st_dri = env.ConvenienceLibrary(
 target = 'st_dri',
-source = sources,
+source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
 )
 Export('st_dri')
-- 
1.8.4

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


[Mesa-dev] [PATCH 15/29] st/dri/sw: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/dri/sw/Makefile.am  | 7 ++-
 src/gallium/state_trackers/dri/sw/Makefile.sources | 5 +
 src/gallium/state_trackers/dri/sw/SConscript   | 9 +
 3 files changed, 8 insertions(+), 13 deletions(-)
 create mode 100644 src/gallium/state_trackers/dri/sw/Makefile.sources

diff --git a/src/gallium/state_trackers/dri/sw/Makefile.am 
b/src/gallium/state_trackers/dri/sw/Makefile.am
index b62161a..f0377a8 100644
--- a/src/gallium/state_trackers/dri/sw/Makefile.am
+++ b/src/gallium/state_trackers/dri/sw/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CPPFLAGS = \
@@ -34,8 +35,4 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = libdrisw.la
 
-libdrisw_la_SOURCES = \
-   dri_context.c \
-   dri_screen.c \
-   dri_drawable.c \
-   drisw.c
+libdrisw_la_SOURCES =  $(C_SOURCES)
diff --git a/src/gallium/state_trackers/dri/sw/Makefile.sources 
b/src/gallium/state_trackers/dri/sw/Makefile.sources
new file mode 100644
index 000..1255934
--- /dev/null
+++ b/src/gallium/state_trackers/dri/sw/Makefile.sources
@@ -0,0 +1,5 @@
+C_SOURCES := \
+   dri_context.c \
+   dri_screen.c \
+   dri_drawable.c \
+   drisw.c
diff --git a/src/gallium/state_trackers/dri/sw/SConscript 
b/src/gallium/state_trackers/dri/sw/SConscript
index 287733e..6d482a5 100644
--- a/src/gallium/state_trackers/dri/sw/SConscript
+++ b/src/gallium/state_trackers/dri/sw/SConscript
@@ -15,15 +15,8 @@ env.Append(CPPPATH = [
 
 env.Append(CPPDEFINES = [('__NOT_HAVE_DRM_H', '1')])
 
-sources = [
-'dri_context.c',
-'dri_drawable.c',
-'dri_screen.c',
-'drisw.c',
-]
-
 st_drisw = env.ConvenienceLibrary(
 target = 'st_drisw',
-source = sources,
+source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
 )
 Export('st_drisw')
-- 
1.8.4

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


[Mesa-dev] [PATCH 16/29] st/egl: consolidate C sources lists into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/egl/Android.mk   | 12 ++--
 src/gallium/state_trackers/egl/Makefile.am  | 31 +---
 src/gallium/state_trackers/egl/Makefile.sources | 39 +
 src/gallium/state_trackers/egl/SConscript   | 24 ---
 4 files changed, 53 insertions(+), 53 deletions(-)
 create mode 100644 src/gallium/state_trackers/egl/Makefile.sources

diff --git a/src/gallium/state_trackers/egl/Android.mk 
b/src/gallium/state_trackers/egl/Android.mk
index 13b013b..2627608 100644
--- a/src/gallium/state_trackers/egl/Android.mk
+++ b/src/gallium/state_trackers/egl/Android.mk
@@ -23,16 +23,8 @@
 
 LOCAL_PATH := $(call my-dir)
 
-common_SOURCES := \
-   common/egl_g3d.c \
-   common/egl_g3d_api.c \
-   common/egl_g3d_image.c \
-   common/egl_g3d_st.c \
-   common/egl_g3d_sync.c \
-   common/native_helper.c
-
-android_SOURCES := \
-   android/native_android.cpp
+# get common_SOURCES, android_SOURCES
+include $(LOCAL_PATH)/Makefile.sources
 
 include $(CLEAR_VARS)
 
diff --git a/src/gallium/state_trackers/egl/Makefile.am 
b/src/gallium/state_trackers/egl/Makefile.am
index 126fafc..1d84d61 100644
--- a/src/gallium/state_trackers/egl/Makefile.am
+++ b/src/gallium/state_trackers/egl/Makefile.am
@@ -22,6 +22,7 @@
 
 AUTOMAKE_OPTIONS = subdir-objects
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = $(GALLIUM_CFLAGS)
@@ -31,23 +32,10 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include
 
 noinst_LTLIBRARIES = libegl.la
-libegl_la_SOURCES = \
-   common/egl_g3d_api.c \
-   common/egl_g3d.c \
-   common/egl_g3d_image.c \
-   common/egl_g3d_st.c \
-   common/egl_g3d_sync.c \
-   common/native_helper.c \
-   common/native_wayland_drm_bufmgr.c
+libegl_la_SOURCES = $(common_SOURCES)
 
 if HAVE_EGL_PLATFORM_X11
-libegl_la_SOURCES += \
-   x11/glxinit.c \
-   x11/native_dri2.c \
-   x11/native_x11.c \
-   x11/native_ximage.c \
-   x11/x11_screen.c \
-   x11/dri2.c
+libegl_la_SOURCES += $(x11_SOURCES) $(x11_drm_SOURCES)
 AM_CFLAGS += \
$(X11_CFLAGS) \
$(LIBDRM_CFLAGS) \
@@ -61,10 +49,7 @@ AM_CPPFLAGS += \
 endif
 
 if HAVE_EGL_PLATFORM_WAYLAND
-libegl_la_SOURCES += \
-   wayland/native_drm.c \
-   wayland/native_shm.c \
-   wayland/native_wayland.c
+libegl_la_SOURCES += $(wayland_SOURCES)
 AM_CFLAGS += \
$(LIBDRM_CFLAGS) \
$(WAYLAND_CFLAGS)
@@ -77,9 +62,7 @@ AM_CPPFLAGS += \
 endif
 
 if HAVE_EGL_PLATFORM_DRM
-libegl_la_SOURCES += \
-   drm/modeset.c \
-   drm/native_drm.c
+libegl_la_SOURCES += $(drm_SOURCES)
 AM_CFLAGS += \
$(LIBDRM_CFLAGS)
 AM_CPPFLAGS += \
@@ -90,14 +73,14 @@ AM_CPPFLAGS += \
 endif
 
 if HAVE_EGL_PLATFORM_FBDEV
-libegl_la_SOURCES += fbdev/native_fbdev.c
+libegl_la_SOURCES += $(fbdev_SOURCES)
 AM_CPPFLAGS += \
-I$(top_srcdir)/src/gallium/winsys/sw \
-DHAVE_FBDEV_BACKEND
 endif
 
 if HAVE_EGL_PLATFORM_NULL
-libegl_la_SOURCES += null/native_null.c
+libegl_la_SOURCES += $(null_SOURCES)
 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
new file mode 100644
index 000..aaf6b8b
--- /dev/null
+++ b/src/gallium/state_trackers/egl/Makefile.sources
@@ -0,0 +1,39 @@
+common_SOURCES := \
+   common/egl_g3d_api.c \
+   common/egl_g3d.c \
+   common/egl_g3d_image.c \
+   common/egl_g3d_st.c \
+   common/egl_g3d_sync.c \
+   common/native_helper.c \
+   common/native_wayland_drm_bufmgr.c
+
+android_SOURCES := \
+   android/native_android.cpp
+
+drm_SOURCES := \
+   drm/modeset.c \
+   drm/native_drm.c
+
+fbdev_SOURCES := \
+   fbdev/native_fbdev.c
+
+gdi_SOURCES := \
+   gdi/native_gdi.c
+
+null_SOURCES := \
+   null/native_null.c
+
+x11_SOURCES := \
+   x11/glxinit.c \
+   x11/native_dri2.c \
+   x11/native_x11.c \
+   x11/native_ximage.c
+
+x11_drm_SOURCES := \
+   x11/x11_screen.c \
+   x11/dri2.c
+
+wayland_SOURCES := \
+   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 2f7ac7e..b86f8b5 100644
--- a/src/gallium/state_trackers/egl/SConscript
+++ b/src/gallium/state_trackers/egl/SConscript
@@ -11,18 +11,11 @@ env.Append(CPPPATH = [
 '.',
 ])
 
-sources = [
-'common/egl_g3d.c',
-'common/egl_g3d_api.c',
-'common/egl_g3d_image.c',
-'common/egl_g3d_st.c',
-'common/egl_g3d_sync.c',
-'common/native_helper.c',
-]
+sources = env.ParseSourceList('Makefile.sources', 'common_SOURCES')
 
 if env['platform'] == 'windows':
 env.Append(CPPDEFINES = ['HAVE_GDI_BACKEND'])
-sources.append('gdi/native_gdi.c')
+sources.append(env.ParseSourceLis

[Mesa-dev] [PATCH 17/29] st/gbm: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/gbm/Makefile.am  | 3 ++-
 src/gallium/state_trackers/gbm/Makefile.sources | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 src/gallium/state_trackers/gbm/Makefile.sources

diff --git a/src/gallium/state_trackers/gbm/Makefile.am 
b/src/gallium/state_trackers/gbm/Makefile.am
index b113d0d..16f58d8 100644
--- a/src/gallium/state_trackers/gbm/Makefile.am
+++ b/src/gallium/state_trackers/gbm/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = $(GALLIUM_CFLAGS)
@@ -33,4 +34,4 @@ endif
 
 noinst_LTLIBRARIES = libgbm.la
 
-libgbm_la_SOURCES = gbm_drm.c
+libgbm_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/state_trackers/gbm/Makefile.sources 
b/src/gallium/state_trackers/gbm/Makefile.sources
new file mode 100644
index 000..41e2790
--- /dev/null
+++ b/src/gallium/state_trackers/gbm/Makefile.sources
@@ -0,0 +1,2 @@
+C_SOURCES := \
+   gbm_drm.c
-- 
1.8.4

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


[Mesa-dev] [PATCH 18/29] st/glx: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Move glx/{,xlib/}Makefile.am to preserve file list

Signed-off-by: Emil Velikov 
---
 configure.ac  |  2 +-
 src/gallium/state_trackers/Makefile.am|  2 +-
 src/gallium/state_trackers/glx/{ => xlib}/Makefile.am |  8 ++--
 src/gallium/state_trackers/glx/xlib/Makefile.sources  |  6 ++
 src/gallium/state_trackers/glx/xlib/SConscript| 10 +-
 src/gallium/targets/libgl-xlib/Makefile.am|  2 +-
 6 files changed, 12 insertions(+), 18 deletions(-)
 rename src/gallium/state_trackers/glx/{ => xlib}/Makefile.am (92%)
 create mode 100644 src/gallium/state_trackers/glx/xlib/Makefile.sources

diff --git a/configure.ac b/configure.ac
index 48c7be6..a67d372 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2011,7 +2011,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/state_trackers/dri/sw/Makefile
src/gallium/state_trackers/egl/Makefile
src/gallium/state_trackers/gbm/Makefile
-   src/gallium/state_trackers/glx/Makefile
+   src/gallium/state_trackers/glx/xlib/Makefile
src/gallium/state_trackers/osmesa/Makefile
src/gallium/state_trackers/vdpau/Makefile
src/gallium/state_trackers/vega/Makefile
diff --git a/src/gallium/state_trackers/Makefile.am 
b/src/gallium/state_trackers/Makefile.am
index 5774598..fabe271 100644
--- a/src/gallium/state_trackers/Makefile.am
+++ b/src/gallium/state_trackers/Makefile.am
@@ -22,7 +22,7 @@
 SUBDIRS =
 
 if HAVE_X11_DRIVER
-SUBDIRS += glx
+SUBDIRS += glx/xlib
 endif
 
 if HAVE_GALLIUM_OSMESA
diff --git a/src/gallium/state_trackers/glx/Makefile.am 
b/src/gallium/state_trackers/glx/xlib/Makefile.am
similarity index 92%
rename from src/gallium/state_trackers/glx/Makefile.am
rename to src/gallium/state_trackers/glx/xlib/Makefile.am
index e5b3924..7a63594 100644
--- a/src/gallium/state_trackers/glx/Makefile.am
+++ b/src/gallium/state_trackers/glx/xlib/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -32,9 +33,4 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = libxlib.la
 
-libxlib_la_SOURCES = \
-   xlib/glx_api.c \
-   xlib/glx_getproc.c \
-   xlib/glx_usefont.c \
-   xlib/xm_api.c \
-   xlib/xm_st.c
+libxlib_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/state_trackers/glx/xlib/Makefile.sources 
b/src/gallium/state_trackers/glx/xlib/Makefile.sources
new file mode 100644
index 000..a77a895
--- /dev/null
+++ b/src/gallium/state_trackers/glx/xlib/Makefile.sources
@@ -0,0 +1,6 @@
+C_SOURCES := \
+   glx_api.c \
+   glx_getproc.c \
+   glx_usefont.c \
+   xm_api.c \
+   xm_st.c
diff --git a/src/gallium/state_trackers/glx/xlib/SConscript 
b/src/gallium/state_trackers/glx/xlib/SConscript
index 9e7ebf3..88e81b8 100644
--- a/src/gallium/state_trackers/glx/xlib/SConscript
+++ b/src/gallium/state_trackers/glx/xlib/SConscript
@@ -11,16 +11,8 @@ env.Append(CPPPATH = [
 '#/src/mesa/main',
 ])
 
-sources = [
-'glx_api.c',
-'glx_getproc.c',
-'glx_usefont.c',
-'xm_api.c',
-'xm_st.c',
-]
-
 st_xlib = env.ConvenienceLibrary(
 target = 'st_xlib',
-source = sources,
+source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
 )
 Export('st_xlib')
diff --git a/src/gallium/targets/libgl-xlib/Makefile.am 
b/src/gallium/targets/libgl-xlib/Makefile.am
index cca0da4..89066c7 100644
--- a/src/gallium/targets/libgl-xlib/Makefile.am
+++ b/src/gallium/targets/libgl-xlib/Makefile.am
@@ -45,7 +45,7 @@ libGL_la_SOURCES = xlib.c
 libGL_la_LDFLAGS = -version-number $(GL_MAJOR):$(GL_MINOR):$(GL_TINY) 
-no-undefined
 
 libGL_la_LIBADD = \
-   $(top_builddir)/src/gallium/state_trackers/glx/libxlib.la \
+   $(top_builddir)/src/gallium/state_trackers/glx/xlib/libxlib.la \
$(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
$(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
-- 
1.8.4

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


[Mesa-dev] [PATCH 19/29] st/osmesa: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/osmesa/Makefile.am  | 4 ++--
 src/gallium/state_trackers/osmesa/Makefile.sources | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/osmesa/Makefile.sources

diff --git a/src/gallium/state_trackers/osmesa/Makefile.am 
b/src/gallium/state_trackers/osmesa/Makefile.am
index 3182012..4ba6c20 100644
--- a/src/gallium/state_trackers/osmesa/Makefile.am
+++ b/src/gallium/state_trackers/osmesa/Makefile.am
@@ -19,6 +19,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = $(GALLIUM_CFLAGS)
@@ -37,5 +38,4 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = libosmesa.la
 
-libosmesa_la_SOURCES = \
-   osmesa.c
+libosmesa_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/state_trackers/osmesa/Makefile.sources 
b/src/gallium/state_trackers/osmesa/Makefile.sources
new file mode 100644
index 000..f8008ef
--- /dev/null
+++ b/src/gallium/state_trackers/osmesa/Makefile.sources
@@ -0,0 +1,2 @@
+C_SOURCES := \
+   osmesa.c
-- 
1.8.4

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


[Mesa-dev] [PATCH 20/29] st/vdpau: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/vdpau/Makefile.am  | 14 ++
 src/gallium/state_trackers/vdpau/Makefile.sources | 12 
 2 files changed, 14 insertions(+), 12 deletions(-)
 create mode 100644 src/gallium/state_trackers/vdpau/Makefile.sources

diff --git a/src/gallium/state_trackers/vdpau/Makefile.am 
b/src/gallium/state_trackers/vdpau/Makefile.am
index f7c5ed6..a2fa366 100644
--- a/src/gallium/state_trackers/vdpau/Makefile.am
+++ b/src/gallium/state_trackers/vdpau/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 VDPAU_MAJOR = 1
@@ -35,15 +36,4 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = libvdpautracker.la
 
-libvdpautracker_la_SOURCES = \
-   htab.c \
-   ftab.c \
-   device.c \
-   query.c \
-   surface.c \
-   decode.c \
-   presentation.c \
-   bitmap.c \
-   output.c \
-   preemption.c \
-   mixer.c
+libvdpautracker_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/state_trackers/vdpau/Makefile.sources 
b/src/gallium/state_trackers/vdpau/Makefile.sources
new file mode 100644
index 000..d90a870
--- /dev/null
+++ b/src/gallium/state_trackers/vdpau/Makefile.sources
@@ -0,0 +1,12 @@
+C_SOURCES := \
+   htab.c \
+   ftab.c \
+   device.c \
+   query.c \
+   surface.c \
+   decode.c \
+   presentation.c \
+   bitmap.c \
+   output.c \
+   preemption.c \
+   mixer.c
-- 
1.8.4

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


[Mesa-dev] [PATCH 21/29] st/vega: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/vega/Makefile.am  | 32 ++
 src/gallium/state_trackers/vega/Makefile.sources | 30 +
 src/gallium/state_trackers/vega/SConscript   | 34 +---
 3 files changed, 33 insertions(+), 63 deletions(-)
 create mode 100644 src/gallium/state_trackers/vega/Makefile.sources

diff --git a/src/gallium/state_trackers/vega/Makefile.am 
b/src/gallium/state_trackers/vega/Makefile.am
index 5c5d071..8b3d601 100644
--- a/src/gallium/state_trackers/vega/Makefile.am
+++ b/src/gallium/state_trackers/vega/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = $(GALLIUM_CFLAGS)
@@ -29,36 +30,7 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = libvega.la
 
-libvega_la_SOURCES =   \
-   api.c   \
-   api_context.c   \
-   api_filters.c   \
-   api_images.c\
-   api_masks.c \
-   api_misc.c  \
-   api_paint.c \
-   api_params.c\
-   api_path.c  \
-   api_text.c  \
-   api_transform.c \
-   arc.c   \
-   bezier.c\
-   handle.c\
-   image.c \
-   mask.c  \
-   paint.c \
-   path.c  \
-   polygon.c   \
-   renderer.c  \
-   shader.c\
-   shaders_cache.c \
-   stroker.c   \
-   text.c  \
-   vg_context.c\
-   vg_manager.c\
-   vg_state.c  \
-   vg_translate.c  \
-   vgu.c
+libvega_la_SOURCES = $(C_SOURCES)
 
 BUILT_SOURCES = api_tmp.h
 CLEANFILES = api_tmp.h
diff --git a/src/gallium/state_trackers/vega/Makefile.sources 
b/src/gallium/state_trackers/vega/Makefile.sources
new file mode 100644
index 000..cba9722
--- /dev/null
+++ b/src/gallium/state_trackers/vega/Makefile.sources
@@ -0,0 +1,30 @@
+C_SOURCES :=   \
+   api.c \
+   api_context.c \
+   api_filters.c \
+   api_images.c \
+   api_masks.c \
+   api_misc.c \
+   api_paint.c \
+   api_params.c \
+   api_path.c \
+   api_text.c \
+   api_transform.c \
+   arc.c \
+   bezier.c \
+   handle.c \
+   image.c \
+   mask.c \
+   paint.c \
+   path.c \
+   polygon.c \
+   renderer.c \
+   shader.c \
+   shaders_cache.c \
+   stroker.c \
+   text.c \
+   vg_context.c \
+   vg_manager.c \
+   vg_state.c \
+   vg_translate.c \
+   vgu.c
diff --git a/src/gallium/state_trackers/vega/SConscript 
b/src/gallium/state_trackers/vega/SConscript
index f8d7504..29d5498 100644
--- a/src/gallium/state_trackers/vega/SConscript
+++ b/src/gallium/state_trackers/vega/SConscript
@@ -15,38 +15,6 @@ env.Append(CPPDEFINES = [
 'KHRONOS_DLL_EXPORTS',
 ])
 
-vega_sources = [
-'api.c',
-'api_context.c',
-'api_filters.c',
-'api_images.c',
-'api_masks.c',
-'api_misc.c',
-'api_paint.c',
-'api_params.c',
-'api_path.c',
-'api_text.c',
-'api_transform.c',
-'arc.c',
-'bezier.c',
-'handle.c',
-'image.c',
-'mask.c',
-'paint.c',
-'path.c',
-'polygon.c',
-'renderer.c',
-'shader.c',
-'shaders_cache.c',
-'stroker.c',
-'text.c',
-'vg_context.c',
-'vg_manager.c',
-'vg_state.c',
-'vg_translate.c',
-'vgu.c'
-]
-
 api_tmp, = env.CodeGenerate(
 target = 'api_tmp.h',
 script = '#src/mapi/mapi_abi.py',
@@ -56,7 +24,7 @@ api_tmp, = env.CodeGenerate(
 
 st_vega = env.ConvenienceLibrary(
 target = 'st_vega',
-source = vega_sources,
+source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
 )
 
 Export('st_vega')
-- 
1.8.4

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


[Mesa-dev] [PATCH 22/29] st/wgl: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/wgl/Makefile.sources | 15 +++
 src/gallium/state_trackers/wgl/SConscript   | 19 +--
 2 files changed, 16 insertions(+), 18 deletions(-)
 create mode 100644 src/gallium/state_trackers/wgl/Makefile.sources

diff --git a/src/gallium/state_trackers/wgl/Makefile.sources 
b/src/gallium/state_trackers/wgl/Makefile.sources
new file mode 100644
index 000..e93342a
--- /dev/null
+++ b/src/gallium/state_trackers/wgl/Makefile.sources
@@ -0,0 +1,15 @@
+C_SOURCES := \
+   stw_context.c \
+   stw_device.c \
+   stw_ext_context.c \
+   stw_ext_extensionsstring.c \
+   stw_ext_gallium.c \
+   stw_ext_pbuffer.c \
+   stw_ext_pixelformat.c \
+   stw_ext_swapinterval.c \
+   stw_framebuffer.c \
+   stw_getprocaddress.c \
+   stw_pixelformat.c \
+   stw_st.c \
+   stw_tls.c \
+   stw_wgl.c
diff --git a/src/gallium/state_trackers/wgl/SConscript 
b/src/gallium/state_trackers/wgl/SConscript
index 1014b45..6c604a0 100644
--- a/src/gallium/state_trackers/wgl/SConscript
+++ b/src/gallium/state_trackers/wgl/SConscript
@@ -19,25 +19,8 @@ if not env['gles']:
 # prevent _glapi_* from being declared __declspec(dllimport)
 env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
 
-sources = [
-'stw_context.c',
-'stw_device.c',
-'stw_ext_context.c',
-'stw_ext_extensionsstring.c',
-'stw_ext_gallium.c',
-'stw_ext_pbuffer.c',
-'stw_ext_pixelformat.c',
-'stw_ext_swapinterval.c',
-'stw_framebuffer.c',
-'stw_getprocaddress.c',
-'stw_pixelformat.c',
-'stw_st.c',
-'stw_tls.c',
-'stw_wgl.c',
-]
-
 wgl = env.ConvenienceLibrary(
 target ='wgl',
-source = sources,
+source = env.ParseSourceList('Makefile.sources', 'C_SOURCES'),
 )
 Export('wgl')
-- 
1.8.4

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


[Mesa-dev] [PATCH 23/29] st/xa: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/xa/Makefile.am  | 9 ++---
 src/gallium/state_trackers/xa/Makefile.sources | 7 +++
 2 files changed, 9 insertions(+), 7 deletions(-)
 create mode 100644 src/gallium/state_trackers/xa/Makefile.sources

diff --git a/src/gallium/state_trackers/xa/Makefile.am 
b/src/gallium/state_trackers/xa/Makefile.am
index 57d55c4..7d0b366 100644
--- a/src/gallium/state_trackers/xa/Makefile.am
+++ b/src/gallium/state_trackers/xa/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -40,10 +41,4 @@ xa_include_HEADERS = \
 
 noinst_LTLIBRARIES = libxatracker.la
 
-libxatracker_la_SOURCES = \
-   xa_tracker.c \
-   xa_context.c \
-   xa_renderer.c \
-   xa_tgsi.c \
-   xa_yuv.c \
-   xa_composite.c
+libxatracker_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/state_trackers/xa/Makefile.sources 
b/src/gallium/state_trackers/xa/Makefile.sources
new file mode 100644
index 000..154bc04
--- /dev/null
+++ b/src/gallium/state_trackers/xa/Makefile.sources
@@ -0,0 +1,7 @@
+C_SOURCES := \
+   xa_tracker.c \
+   xa_context.c \
+   xa_renderer.c \
+   xa_tgsi.c \
+   xa_yuv.c \
+   xa_composite.c
-- 
1.8.4

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


[Mesa-dev] [PATCH 24/29] st/xorg: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/xorg/Makefile.am  | 14 +++---
 src/gallium/state_trackers/xorg/Makefile.sources | 11 +++
 src/gallium/state_trackers/xorg/SConscript   | 15 +--
 3 files changed, 15 insertions(+), 25 deletions(-)
 create mode 100644 src/gallium/state_trackers/xorg/Makefile.sources

diff --git a/src/gallium/state_trackers/xorg/Makefile.am 
b/src/gallium/state_trackers/xorg/Makefile.am
index e3bad1f..ffc1ad0 100644
--- a/src/gallium/state_trackers/xorg/Makefile.am
+++ b/src/gallium/state_trackers/xorg/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -28,6 +29,7 @@ AM_CFLAGS = \
$(LIBKMS_XORG_CFLAGS) \
$(LIBDRM_XORG_CFLAGS) \
$(shell $(PKG_CONFIG) --cflags-only-I xorg-server)
+
 AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/mesa \
@@ -38,14 +40,4 @@ AM_CPPFLAGS = \
 
 noinst_LTLIBRARIES = libxorgtracker.la
 
-libxorgtracker_la_SOURCES =\
-   xorg_composite.c\
-   xorg_crtc.c \
-   xorg_dri2.c \
-   xorg_driver.c   \
-   xorg_exa.c  \
-   xorg_exa_tgsi.c \
-   xorg_output.c   \
-   xorg_renderer.c \
-   xorg_xv.c   \
-   xorg_xvmc.c
+libxorgtracker_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/state_trackers/xorg/Makefile.sources 
b/src/gallium/state_trackers/xorg/Makefile.sources
new file mode 100644
index 000..7b07356
--- /dev/null
+++ b/src/gallium/state_trackers/xorg/Makefile.sources
@@ -0,0 +1,11 @@
+C_SOURCES := \
+   xorg_composite.c \
+   xorg_crtc.c \
+   xorg_dri2.c \
+   xorg_driver.c \
+   xorg_exa.c \
+   xorg_exa_tgsi.c \
+   xorg_output.c \
+   xorg_renderer.c \
+   xorg_xv.c \
+   xorg_xvmc.c
diff --git a/src/gallium/state_trackers/xorg/SConscript 
b/src/gallium/state_trackers/xorg/SConscript
index 1768f70..88990d5 100644
--- a/src/gallium/state_trackers/xorg/SConscript
+++ b/src/gallium/state_trackers/xorg/SConscript
@@ -22,21 +22,8 @@ if conf.CheckHeader('X11/extensions/dpmsconst.h'):
 
 conf.Finish()
 
-sources = [
-'xorg_composite.c',
-'xorg_crtc.c',
-'xorg_dri2.c',
-'xorg_driver.c',
-'xorg_exa.c',
-'xorg_exa_tgsi.c',
-'xorg_output.c',
-'xorg_renderer.c',
-'xorg_xv.c',
-'xorg_xvmc.c',
-]
-
 st_xorg = env.ConvenienceLibrary(
 target = 'st_xorg',
-source = sources,
+source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
 )
 Export('st_xorg')
-- 
1.8.4

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


[Mesa-dev] [PATCH 25/29] st/xvmc: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/state_trackers/xvmc/Makefile.am  | 8 ++--
 src/gallium/state_trackers/xvmc/Makefile.sources | 6 ++
 2 files changed, 8 insertions(+), 6 deletions(-)
 create mode 100644 src/gallium/state_trackers/xvmc/Makefile.sources

diff --git a/src/gallium/state_trackers/xvmc/Makefile.am 
b/src/gallium/state_trackers/xvmc/Makefile.am
index 008c50a..c110912 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.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -28,12 +29,7 @@ AM_CFLAGS = \
 
 noinst_LTLIBRARIES = libxvmctracker.la
 
-libxvmctracker_la_SOURCES = \
-   block.c \
-   surface.c \
-   context.c \
-   subpicture.c \
-   attributes.c
+libxvmctracker_la_SOURCES = $(C_SOURCES)
 
 check_PROGRAMS = \
tests/test_context \
diff --git a/src/gallium/state_trackers/xvmc/Makefile.sources 
b/src/gallium/state_trackers/xvmc/Makefile.sources
new file mode 100644
index 000..8609801
--- /dev/null
+++ b/src/gallium/state_trackers/xvmc/Makefile.sources
@@ -0,0 +1,6 @@
+C_SOURCES := \
+   block.c \
+   surface.c \
+   context.c \
+   subpicture.c \
+   attributes.c
-- 
1.8.4

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


[Mesa-dev] [PATCH 27/29] winsys/nouveau/drm: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/winsys/nouveau/drm/Android.mk   | 4 ++--
 src/gallium/winsys/nouveau/drm/Makefile.am  | 3 ++-
 src/gallium/winsys/nouveau/drm/Makefile.sources | 2 ++
 3 files changed, 6 insertions(+), 3 deletions(-)
 create mode 100644 src/gallium/winsys/nouveau/drm/Makefile.sources

diff --git a/src/gallium/winsys/nouveau/drm/Android.mk 
b/src/gallium/winsys/nouveau/drm/Android.mk
index 93c540b..2e2a9d1 100644
--- a/src/gallium/winsys/nouveau/drm/Android.mk
+++ b/src/gallium/winsys/nouveau/drm/Android.mk
@@ -23,8 +23,8 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# from Makefile
-C_SOURCES = nouveau_drm_winsys.c
+# get C_SOURCES
+include $(LOCAL_PATH)/Makefile.sources
 
 include $(CLEAR_VARS)
 
diff --git a/src/gallium/winsys/nouveau/drm/Makefile.am 
b/src/gallium/winsys/nouveau/drm/Makefile.am
index 1448877..f9645f5 100644
--- a/src/gallium/winsys/nouveau/drm/Makefile.am
+++ b/src/gallium/winsys/nouveau/drm/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -30,4 +31,4 @@ AM_CFLAGS = \
 
 noinst_LTLIBRARIES = libnouveaudrm.la
 
-libnouveaudrm_la_SOURCES = nouveau_drm_winsys.c
+libnouveaudrm_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/winsys/nouveau/drm/Makefile.sources 
b/src/gallium/winsys/nouveau/drm/Makefile.sources
new file mode 100644
index 000..43b8e86
--- /dev/null
+++ b/src/gallium/winsys/nouveau/drm/Makefile.sources
@@ -0,0 +1,2 @@
+C_SOURCES := \
+   nouveau_drm_winsys.c
-- 
1.8.4

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


[Mesa-dev] [PATCH 26/29] winsys/i915/sw: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/winsys/i915/sw/Makefile.am  | 7 ++-
 src/gallium/winsys/i915/sw/Makefile.sources | 5 +
 src/gallium/winsys/i915/sw/SConscript   | 7 +--
 3 files changed, 8 insertions(+), 11 deletions(-)
 create mode 100644 src/gallium/winsys/i915/sw/Makefile.sources

diff --git a/src/gallium/winsys/i915/sw/Makefile.am 
b/src/gallium/winsys/i915/sw/Makefile.am
index 2276f0d..186fee3 100644
--- a/src/gallium/winsys/i915/sw/Makefile.am
+++ b/src/gallium/winsys/i915/sw/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -30,8 +31,4 @@ AM_CFLAGS = \
 
 noinst_LTLIBRARIES = libi915sw.la
 
-libi915sw_la_SOURCES = \
-   i915_sw_batchbuffer.c \
-   i915_sw_buffer.c \
-   i915_sw_fence.c \
-   i915_sw_winsys.c
+libi915sw_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/winsys/i915/sw/Makefile.sources 
b/src/gallium/winsys/i915/sw/Makefile.sources
new file mode 100644
index 000..89a38c6
--- /dev/null
+++ b/src/gallium/winsys/i915/sw/Makefile.sources
@@ -0,0 +1,5 @@
+C_SOURCES := \
+   i915_sw_batchbuffer.c \
+   i915_sw_buffer.c \
+   i915_sw_fence.c \
+   i915_sw_winsys.c
diff --git a/src/gallium/winsys/i915/sw/SConscript 
b/src/gallium/winsys/i915/sw/SConscript
index 84f427a..9d78519 100644
--- a/src/gallium/winsys/i915/sw/SConscript
+++ b/src/gallium/winsys/i915/sw/SConscript
@@ -2,12 +2,7 @@ Import('*')
 
 env = env.Clone()
 
-i915_sw_sources = [
-'i915_sw_batchbuffer.c',
-'i915_sw_buffer.c',
-'i915_sw_winsys.c',
-'i915_sw_fence.c',
-]
+i915_sw_sources = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
 
 i915sw = env.ConvenienceLibrary(
 target ='i915sw',
-- 
1.8.4

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


[Mesa-dev] [PATCH 28/29] winsys/freedreno/drm: consolidate C sources list into Makefile.sources

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/winsys/freedreno/drm/Makefile.am  | 3 ++-
 src/gallium/winsys/freedreno/drm/Makefile.sources | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 src/gallium/winsys/freedreno/drm/Makefile.sources

diff --git a/src/gallium/winsys/freedreno/drm/Makefile.am 
b/src/gallium/winsys/freedreno/drm/Makefile.am
index 58f69d1..8a74dcd 100644
--- a/src/gallium/winsys/freedreno/drm/Makefile.am
+++ b/src/gallium/winsys/freedreno/drm/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -29,4 +30,4 @@ AM_CFLAGS = \
 
 noinst_LTLIBRARIES = libfreedrenodrm.la
 
-libfreedrenodrm_la_SOURCES = freedreno_drm_winsys.c
+libfreedrenodrm_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/winsys/freedreno/drm/Makefile.sources 
b/src/gallium/winsys/freedreno/drm/Makefile.sources
new file mode 100644
index 000..18a8f28
--- /dev/null
+++ b/src/gallium/winsys/freedreno/drm/Makefile.sources
@@ -0,0 +1,2 @@
+C_SOURCES := \
+   freedreno_drm_winsys.c
-- 
1.8.4

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


[Mesa-dev] [PATCH 29/29] winsys/freedreno/drm: drop obsolete .gitignore

2013-09-22 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/winsys/freedreno/drm/.gitignore | 1 -
 1 file changed, 1 deletion(-)
 delete mode 100644 src/gallium/winsys/freedreno/drm/.gitignore

diff --git a/src/gallium/winsys/freedreno/drm/.gitignore 
b/src/gallium/winsys/freedreno/drm/.gitignore
deleted file mode 100644
index f3c7a7c..000
--- a/src/gallium/winsys/freedreno/drm/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-Makefile
-- 
1.8.4

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


[Mesa-dev] [Bug 69682] New: mesa-9.2.0 and glamor-0.5.1 crash X - (?) _mesa_GetVertexAttribdv (?)

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

  Priority: medium
Bug ID: 69682
  Assignee: mesa-dev@lists.freedesktop.org
   Summary: mesa-9.2.0 and glamor-0.5.1 crash X - (?)
_mesa_GetVertexAttribdv (?)
  Severity: normal
Classification: Unclassified
OS: Linux (All)
  Reporter: g...@politeia.in
  Hardware: x86-64 (AMD64)
Status: NEW
   Version: 9.2
 Component: Mesa core
   Product: Mesa

Hello, 

First of all, please change the summary to something better as I had no idea
how to describe this issue.

So, I switched to the radeon driver and I'm trying to use glamor. The backtrace
is reproducible always if I add: `Load "glamoregl"` to my xorg.conf

If I don't load the glamoregl it fallbacks to swrast.

-- 
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 69682] mesa-9.2.0 and glamor-0.5.1 crash X - (?) _mesa_GetVertexAttribdv (?)

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

--- Comment #1 from Denis M. (Phr33d0m)  ---
Created attachment 86329
  --> https://bugs.freedesktop.org/attachment.cgi?id=86329&action=edit
X-crash-backtrace.txt

-- 
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 4/7] mesa: Convert some runtime asserts to static asserts.

2013-09-22 Thread Dave Airlie
On Sun, Sep 22, 2013 at 12:57 AM, Brian Paul  wrote:
> On Fri, Sep 20, 2013 at 7:52 PM, Eric Anholt  wrote:
>> Noticed while grepping through the code for something else.
>> ---
>>  src/mesa/program/program.c | 36 ++--
>>  1 file changed, 22 insertions(+), 14 deletions(-)
>>
>> diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
>> index 2529c13..5dd68d9 100644
>> --- a/src/mesa/program/program.c
>> +++ b/src/mesa/program/program.c
>> @@ -55,27 +55,35 @@ _mesa_init_program(struct gl_context *ctx)
>>  * If this assertion fails, we need to increase the field
>>  * size for register indexes (see INST_INDEX_BITS).
>>  */
>> -   ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4
>><= (1 << INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4
>><= (1 << INST_INDEX_BITS));
>>
>> -   ASSERT(ctx->Const.VertexProgram.MaxTemps <= (1 << INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.VertexProgram.MaxLocalParams <= (1 << 
>> INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.FragmentProgram.MaxTemps <= (1 << INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <= (1 << 
>> INST_INDEX_BITS));
>> -
>> -   ASSERT(ctx->Const.VertexProgram.MaxUniformComponents <= 4 * 
>> MAX_UNIFORMS);
>> -   ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents <= 4 * 
>> MAX_UNIFORMS);
>> -
>> -   ASSERT(ctx->Const.VertexProgram.MaxAddressOffset <= (1 << 
>> INST_INDEX_BITS));
>> -   ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << 
>> INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxTemps <=
>> + (1 << INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxLocalParams <=
>> + (1 << INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxTemps <=
>> + (1 << INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <=
>> + (1 << INST_INDEX_BITS));
>> +
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxUniformComponents <=
>> + 4 * MAX_UNIFORMS);
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents <=
>> + 4 * MAX_UNIFORMS);
>> +
>> +   STATIC_ASSERT(ctx->Const.VertexProgram.MaxAddressOffset <=
>> + (1 << INST_INDEX_BITS));
>> +   STATIC_ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <=
>> + (1 << INST_INDEX_BITS));
>
> Are you sure about those?  How does the compiler know the values of
> ctx->Const.Foo at compile time?
>
> It's worrisome that our STATIC_ASSERT macro is silent at compile time
> when the expression isn't a compile-time constant.  The problem with
> our macro now is variable-sized arrays are OK at compile time.

just as an aside the current S_A macro produces a warning on later gcc's.

kinda a misfeature.

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


[Mesa-dev] [Bug 69682] mesa-9.2.0 and glamor-0.5.1 crash X - (?) _mesa_GetVertexAttribdv (?)

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

Ian Romanick  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Ian Romanick  ---
This is the same underlying issue as bug #66359 and probably others.  The
fundamental problem is that glamor is doing something that can never work:
linking with libGL in the xserver.  libGL and the xserver's GLX module fight
about where functions go in the dispatch table, and everybody loses.

*** This bug has been marked as a duplicate of bug 66359 ***

-- 
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 66359] Mesa crashes in _mesa_VertexAttrib2dvNV on starting KDE 4.11

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

Ian Romanick  changed:

   What|Removed |Added

 CC||g...@politeia.in

--- Comment #8 from Ian Romanick  ---
*** Bug 69682 has been marked as a duplicate of this bug. ***

-- 
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 69682] mesa-9.2.0 and glamor-0.5.1 crash X - (?) _mesa_GetVertexAttribdv (?)

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

Marek Olšák  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|DUPLICATE   |---

--- Comment #3 from Marek Olšák  ---
(In reply to comment #2)
> This is the same underlying issue as bug #66359 and probably others.  The
> fundamental problem is that glamor is doing something that can never work:
> linking with libGL in the xserver.  libGL and the xserver's GLX module fight
> about where functions go in the dispatch table, and everybody loses.
> 
> *** This bug has been marked as a duplicate of bug 66359 ***

Are you suggesting that Glamor is doomed to never work reliably for everybody,
and that the X.Org state tracker (Gallium driver + DDX->Gallium translation
layer) providing a complete DDX in one .so is the way to go for Mesa drivers
without a DDX?

-- 
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 69682] mesa-9.2.0 and glamor-0.5.1 crash X - (?) _mesa_GetVertexAttribdv (?)

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

--- Comment #4 from Marek Olšák  ---
Sorry for reopening. Anyway, Denis, please attach your xorg.conf. I think this
can be fixed at least for you.

-- 
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 69682] mesa-9.2.0 and glamor-0.5.1 crash X - (?) _mesa_GetVertexAttribdv (?)

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

--- Comment #5 from Kenneth Graunke  ---
ajax is talking about things related to this at XDC this year.  There are
definitely solutions.

-- 
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/hsw: compute DDX in a subspan based only on top row

2013-09-22 Thread Chia-I Wu
On Fri, Sep 20, 2013 at 10:50 PM, Paul Berry  wrote:
> On 17 September 2013 19:54, Chia-I Wu  wrote:
>>
>> Hi Paul,
>>
>> On Mon, Sep 16, 2013 at 3:46 PM, Chia-I Wu  wrote:
>> > On Sat, Sep 14, 2013 at 5:15 AM, Paul Berry 
>> > wrote:
>> >> On 12 September 2013 22:06, Chia-I Wu  wrote:
>> >>>
>> >>> From: Chia-I Wu 
>> >>>
>> >>> Consider only the top-left and top-right pixels to approximate DDX in
>> >>> a
>> >>> 2x2
>> >>> subspan, unless the application or the user requests a more accurate
>> >>> approximation.  This results in a less accurate approximation.
>> >>> However,
>> >>> it
>> >>> improves the performance of Xonotic with Ultra settings by 24.3879%
>> >>> +/-
>> >>> 0.832202% (at 95.0% confidence) on Haswell.  No noticeable image
>> >>> quality
>> >>> difference observed.
>> >>>
>> >>> No piglit gpu.tests regressions (tested with v1)
>> >>>
>> >>> I failed to come up with an explanation for the performance
>> >>> difference, as
>> >>> the
>> >>> change does not affect Ivy Bridge.  If anyone has the insight, please
>> >>> kindly
>> >>> enlighten me.  Performance differences may also be observed on other
>> >>> games
>> >>> that call textureGrad and dFdx.
>> >>>
>> >>> v2: Honor GL_FRAGMENT_SHADER_DERIVATIVE_HINT and add a drirc option.
>> >>> Update
>> >>> comments.
>> >>
>> >>
>> >> I'm not entirely comfortable making a change that has a known negative
>> >> impact on computational accuracy (even one that leads to such an
>> >> impressive
>> >> performance improvement) when we don't have any theories as to why the
>> >> performance improvement happens, or why the improvement doesn't apply
>> >> to Ivy
>> >> Bridge.  In my experience, making changes to the codebase without
>> >> understanding why they improve things almost always leads to
>> >> improvements
>> >> that are brittle, since it's likely that the true source of the
>> >> improvement
>> >> is a coincidence that will be wiped out by some future change (or won't
>> >> be
>> >> relevant to client programs other than this particular benchmark).
>> >> Having a
>> >> theory as to why the performance improvement happens would help us be
>> >> confident that we're applying the right fix under the right
>> >> circumstances.
>> > That is how I feel as I've mentioned.  I am really glad to have the
>> > discussion.  I have done some experiments actually.  It is just that
>> > those experiments only tell me what theories are likely to be wrong.
>> > They could not tell me if a theory is right.
>> Do the experiments make sense to you?  What other experiments do you
>> want to see conducted?
>>
>> It could be hard to get direct proof without knowing the internal
>> working..
>
>
> Sorry for the slow reply.  We had some internal discussions with the
> hardware architects about this, and it appears that the first theory is
> correct: Haswell has an optimization in its sample_d processing which allows
> it to assume that all pixels in a 2x2 subspan will resolve to the same LOD
> provided that all the gradients in the 2x2 subspan are sufficiently similar
> to each other.  There's a register called SAMPLER_MODE which determines how
> similar the gradients have to be in order to trigger the optimization.  It
> can be set to values between 0 and 0x1f, where 0 (the default) means "only
> trigger the optimization if the gradients are exactly equal" and 0x1f means
> "trigger the optimization as frequently as possible".  Obviously triggering
> the optimization more often reduces the quality of the rendered output
> slightly, because it forces all pixels within a 2x2 subspan to sample from
> the same LOD.
>
> We believe that setting this register to 0x1f should produce an equivalent
> speed-up to your patch, without sacrificing the quality of d/dx when it is
> used for other (non-sample_d) purposes.  This approach would have the
> additional advantage that the benefit would apply to any shader that uses
> the sample_d message, regardless of whether or not that shader uses d/dx and
> d/dy to compute its gradients.
>
> Would you mind trying this register to see if it produces an equivalent
> performance benefit in both your micro-benchmark and Xonotic with Ultra
> settings?  The register is located at address 07028h in register space MMIO
> 0/2/0.  When setting it, the upper 16 bits are a write mask, so to set the
> register to 0 you would store 0x001f, and to set it to 0x1f you would
> store 0x001f001f.
>
> Since the SAMPLER_MODE setting allows us to trade off quality vs
> performance, we're also interested to know whether a value less than 0x1f is
> sufficient to produce the performance improvement in Xonotic--it would be
> nice if we could find a "sweet spot" for this setting that produces the
> performance improvement we need without sacrificing too much quality.
Great finding!  I will see if setting the register helps.

Since my goal was to figure out why sample_d is slower than sample and
the DDX change worked, that made me wonder if sample assumes a

Re: [Mesa-dev] [PATCH 4/7] mesa: Convert some runtime asserts to static asserts.

2013-09-22 Thread Kenneth Graunke
On 09/22/2013 01:53 PM, Dave Airlie wrote:
> On Sun, Sep 22, 2013 at 12:57 AM, Brian Paul  wrote:
[snip]
>> It's worrisome that our STATIC_ASSERT macro is silent at compile time
>> when the expression isn't a compile-time constant.  The problem with
>> our macro now is variable-sized arrays are OK at compile time.
> 
> just as an aside the current S_A macro produces a warning on later gcc's.
> 
> kinda a misfeature.
> 
> Dave.

Really?  I'm not getting a warning with GCC 4.8.  I used to, but haven't
since:

commit 5db22494934779a3e7fb7669379d1693ff19d39f
Author: Paul Berry 
Date:   Tue Apr 2 09:51:47 2013 -0700

Avoid spurious GCC warnings in STATIC_ASSERT() macro.

GCC 4.8 now warns about typedefs that are local to a scope and not
used anywhere within that scope.  This produced spurious warnings with
the STATIC_ASSERT() macro (which used a typedef to provoke a compile
error in the event of an assertion failure).

This patch switches to a simpler technique that avoids the warning.

v2: Avoid GCC-specific syntax.  Also update p_compiler.h.

Reviewed-by: Kenneth Graunke 

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


Re: [Mesa-dev] [PATCH 3/7 v2] mesa: Shrink the size of the enum string lookup struct.

2013-09-22 Thread Kenneth Graunke
On 09/22/2013 12:56 PM, Eric Anholt wrote:
> Since it's only used for debug information, we can misalign the struct and
> save the disk space.  Another 19k on a 64-bit build.
> 
> v2: Make a compiler.h macro to only use the attribute if we know we can.
> ---
>  src/mapi/glapi/gen/gl_enums.py | 6 --
>  src/mesa/main/compiler.h   | 9 +
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py
> index e1ab600..a0c47f4 100644
> --- a/src/mapi/glapi/gen/gl_enums.py
> +++ b/src/mapi/glapi/gen/gl_enums.py
> @@ -47,8 +47,8 @@ class PrintGlEnums(gl_XML.gl_print_base):
>  print '#include "main/imports.h"'
>  print '#include "main/mtypes.h"'
>  print ''
> -print 'typedef struct {'
> -print '   size_t offset;'
> +print 'typedef struct PACKED {'
> +print '   uint16_t offset;'
>  print '   int n;'
>  print '} enum_elt;'
>  print ''
> @@ -78,6 +78,8 @@ static char token_tmp[20];
>  
>  const char *_mesa_lookup_enum_by_nr( int nr )
>  {
> +   STATIC_ASSERT(sizeof(enum_string_table) < (1 << 16));
> +
> enum_elt *elt = _mesa_bsearch(& nr, enum_string_table_offsets,
>   Elements(enum_string_table_offsets),
>   sizeof(enum_string_table_offsets[0]),
> diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
> index fb7baf8..0f27d5a 100644
> --- a/src/mesa/main/compiler.h
> +++ b/src/mesa/main/compiler.h
> @@ -270,6 +270,15 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
>  #define NULL 0
>  #endif
>  
> +/* Used to optionally mark structures with misaligned elements or size as
> + * packed, to trade off performance for space.
> + */
> +#if (__GNUC__ >= 3)
> +#define PACKED __attribute__((__packed__))
> +#else
> +#define PACKED
> +#endif
> +
>  
>  /**
>   * LONGSTRING macro
> 

Looks good to me!

Patches 1, 3v2, 4v2, 5, 6 are:

Reviewed-by: Kenneth Graunke 

Patch 2 looks good as well, but I haven't looked closely enough, so for
now it just gets a:

Acked-by: Kenneth Graunke 

I don't know enough about patch 7 to respond.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 02/29] mesa/drivers: drop HAVE_*_DRI from individual makefiles

2013-09-22 Thread Kenneth Graunke
On 09/22/2013 01:29 PM, Emil Velikov wrote:
> The mesa/drivers/dri/Makefile.am already guards the individual
> targets/subdirs with HAVE_*_DRI before including them. Thus making
> the additional check within each Makefile.am unnecessary.
> 
> Signed-off-by: Emil Velikov 
> ---
>  src/mesa/drivers/dri/i915/Makefile.am| 3 ---
>  src/mesa/drivers/dri/i965/Makefile.am| 4 
>  src/mesa/drivers/dri/nouveau/Makefile.am | 3 ---
>  src/mesa/drivers/dri/r200/Makefile.am| 3 ---
>  src/mesa/drivers/dri/radeon/Makefile.am  | 3 ---
>  src/mesa/drivers/dri/swrast/Makefile.am  | 3 ---
>  6 files changed, 19 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i915/Makefile.am 
> b/src/mesa/drivers/dri/i915/Makefile.am
> index 978917c..1f4b21e 100644
> --- a/src/mesa/drivers/dri/i915/Makefile.am
> +++ b/src/mesa/drivers/dri/i915/Makefile.am
> @@ -46,10 +46,7 @@ AM_CFLAGS += \
>  endif
>  
>  dridir = $(DRI_DRIVER_INSTALL_DIR)
> -
> -if HAVE_I915_DRI
>  dri_LTLIBRARIES = i915_dri.la
> -endif
>  
>  i915_dri_la_SOURCES = $(i915_FILES)
>  i915_dri_la_LDFLAGS = -module -avoid-version -shared
> diff --git a/src/mesa/drivers/dri/i965/Makefile.am 
> b/src/mesa/drivers/dri/i965/Makefile.am
> index 27c67d1..04fa011 100644
> --- a/src/mesa/drivers/dri/i965/Makefile.am
> +++ b/src/mesa/drivers/dri/i965/Makefile.am
> @@ -23,8 +23,6 @@
>  
>  include Makefile.sources
>  
> -if HAVE_I965_DRI
> -
>  AM_CFLAGS = \
>   -I$(top_srcdir)/include \
>   -I$(top_srcdir)/src/ \
> @@ -95,5 +93,3 @@ test_eu_compact_LDADD = $(TEST_LIBS)
>  all-local: i965_dri.la
>   $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
>   ln -f .libs/i965_dri.so $(top_builddir)/$(LIB_DIR)/i965_dri.so;
> -
> -endif
> diff --git a/src/mesa/drivers/dri/nouveau/Makefile.am 
> b/src/mesa/drivers/dri/nouveau/Makefile.am
> index 2b47f75..2723ce7 100644
> --- a/src/mesa/drivers/dri/nouveau/Makefile.am
> +++ b/src/mesa/drivers/dri/nouveau/Makefile.am
> @@ -34,10 +34,7 @@ AM_CFLAGS = \
>   $(NOUVEAU_CFLAGS)
>  
>  dridir = $(DRI_DRIVER_INSTALL_DIR)
> -
> -if HAVE_NOUVEAU_DRI
>  dri_LTLIBRARIES = nouveau_vieux_dri.la
> -endif
>  
>  nouveau_vieux_dri_la_SOURCES = \
>   $(NOUVEAU_C_FILES)
> diff --git a/src/mesa/drivers/dri/r200/Makefile.am 
> b/src/mesa/drivers/dri/r200/Makefile.am
> index 4357922..950ac9d 100644
> --- a/src/mesa/drivers/dri/r200/Makefile.am
> +++ b/src/mesa/drivers/dri/r200/Makefile.am
> @@ -37,10 +37,7 @@ AM_CFLAGS = \
>   $(RADEON_CFLAGS)
>  
>  dridir = $(DRI_DRIVER_INSTALL_DIR)
> -
> -if HAVE_R200_DRI
>  dri_LTLIBRARIES = r200_dri.la
> -endif
>  
>  r200_dri_la_SOURCES = \
>  $(R200_C_FILES)
> diff --git a/src/mesa/drivers/dri/radeon/Makefile.am 
> b/src/mesa/drivers/dri/radeon/Makefile.am
> index 43de059..56afd7e 100644
> --- a/src/mesa/drivers/dri/radeon/Makefile.am
> +++ b/src/mesa/drivers/dri/radeon/Makefile.am
> @@ -37,10 +37,7 @@ AM_CFLAGS = \
>   $(RADEON_CFLAGS)
>  
>  dridir = $(DRI_DRIVER_INSTALL_DIR)
> -
> -if HAVE_RADEON_DRI
>  dri_LTLIBRARIES = radeon_dri.la
> -endif
>  
>  radeon_dri_la_SOURCES = \
>  $(RADEON_C_FILES)
> diff --git a/src/mesa/drivers/dri/swrast/Makefile.am 
> b/src/mesa/drivers/dri/swrast/Makefile.am
> index d3da196..de160ed 100644
> --- a/src/mesa/drivers/dri/swrast/Makefile.am
> +++ b/src/mesa/drivers/dri/swrast/Makefile.am
> @@ -34,10 +34,7 @@ AM_CFLAGS = \
>   $(VISIBILITY_CFLAGS)
>  
>  dridir = $(DRI_DRIVER_INSTALL_DIR)
> -
> -if HAVE_SWRAST_DRI
>  dri_LTLIBRARIES = swrast_dri.la
> -endif
>  
>  swrast_dri_la_SOURCES = \
>   $(SWRAST_C_FILES)
> 

Nice!

Patch 2 is:
Reviewed-by: Kenneth Graunke 

I don't plan on looking at the rest of the series.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/4] RFC: gl_shader cache

2013-09-22 Thread Tapani Pälli

On 09/20/2013 05:23 PM, Christoph Brill wrote:
2013/9/20 Tapani Pälli >


Hello;


On my SNB desktop machine shader-db takes ~2.4secs without cache,
with cache
it takes ~1.8secs (~2.7 when cache gets generated) (values are avg
from 100
runs compiling all the shaders). Shader-db creates 266 blobs
eating 46M of
disk space when using cache.


This sounds that we will need a configure option to disable the cache 
on platforms with

a low amount of disk space (thinking of phones/embedded devices here).


Yep, configure option makes sense, will definitely add this. I would not 
worry about the size too much yet, I haven't optimized for size (or 
performance), I've been concentrating on getting the functionality to 
work first. I'm sure the blobs can be made smaller.


// Tapani

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


Re: [Mesa-dev] [PATCH] i965/hsw: compute DDX in a subspan based only on top row

2013-09-22 Thread Chia-I Wu
On Mon, Sep 23, 2013 at 12:09 PM, Chia-I Wu  wrote:
> On Fri, Sep 20, 2013 at 10:50 PM, Paul Berry  wrote:
>> On 17 September 2013 19:54, Chia-I Wu  wrote:
>>>
>>> Hi Paul,
>>>
>>> On Mon, Sep 16, 2013 at 3:46 PM, Chia-I Wu  wrote:
>>> > On Sat, Sep 14, 2013 at 5:15 AM, Paul Berry 
>>> > wrote:
>>> >> On 12 September 2013 22:06, Chia-I Wu  wrote:
>>> >>>
>>> >>> From: Chia-I Wu 
>>> >>>
>>> >>> Consider only the top-left and top-right pixels to approximate DDX in
>>> >>> a
>>> >>> 2x2
>>> >>> subspan, unless the application or the user requests a more accurate
>>> >>> approximation.  This results in a less accurate approximation.
>>> >>> However,
>>> >>> it
>>> >>> improves the performance of Xonotic with Ultra settings by 24.3879%
>>> >>> +/-
>>> >>> 0.832202% (at 95.0% confidence) on Haswell.  No noticeable image
>>> >>> quality
>>> >>> difference observed.
>>> >>>
>>> >>> No piglit gpu.tests regressions (tested with v1)
>>> >>>
>>> >>> I failed to come up with an explanation for the performance
>>> >>> difference, as
>>> >>> the
>>> >>> change does not affect Ivy Bridge.  If anyone has the insight, please
>>> >>> kindly
>>> >>> enlighten me.  Performance differences may also be observed on other
>>> >>> games
>>> >>> that call textureGrad and dFdx.
>>> >>>
>>> >>> v2: Honor GL_FRAGMENT_SHADER_DERIVATIVE_HINT and add a drirc option.
>>> >>> Update
>>> >>> comments.
>>> >>
>>> >>
>>> >> I'm not entirely comfortable making a change that has a known negative
>>> >> impact on computational accuracy (even one that leads to such an
>>> >> impressive
>>> >> performance improvement) when we don't have any theories as to why the
>>> >> performance improvement happens, or why the improvement doesn't apply
>>> >> to Ivy
>>> >> Bridge.  In my experience, making changes to the codebase without
>>> >> understanding why they improve things almost always leads to
>>> >> improvements
>>> >> that are brittle, since it's likely that the true source of the
>>> >> improvement
>>> >> is a coincidence that will be wiped out by some future change (or won't
>>> >> be
>>> >> relevant to client programs other than this particular benchmark).
>>> >> Having a
>>> >> theory as to why the performance improvement happens would help us be
>>> >> confident that we're applying the right fix under the right
>>> >> circumstances.
>>> > That is how I feel as I've mentioned.  I am really glad to have the
>>> > discussion.  I have done some experiments actually.  It is just that
>>> > those experiments only tell me what theories are likely to be wrong.
>>> > They could not tell me if a theory is right.
>>> Do the experiments make sense to you?  What other experiments do you
>>> want to see conducted?
>>>
>>> It could be hard to get direct proof without knowing the internal
>>> working..
>>
>>
>> Sorry for the slow reply.  We had some internal discussions with the
>> hardware architects about this, and it appears that the first theory is
>> correct: Haswell has an optimization in its sample_d processing which allows
>> it to assume that all pixels in a 2x2 subspan will resolve to the same LOD
>> provided that all the gradients in the 2x2 subspan are sufficiently similar
>> to each other.  There's a register called SAMPLER_MODE which determines how
>> similar the gradients have to be in order to trigger the optimization.  It
>> can be set to values between 0 and 0x1f, where 0 (the default) means "only
>> trigger the optimization if the gradients are exactly equal" and 0x1f means
>> "trigger the optimization as frequently as possible".  Obviously triggering
>> the optimization more often reduces the quality of the rendered output
>> slightly, because it forces all pixels within a 2x2 subspan to sample from
>> the same LOD.
>>
>> We believe that setting this register to 0x1f should produce an equivalent
>> speed-up to your patch, without sacrificing the quality of d/dx when it is
>> used for other (non-sample_d) purposes.  This approach would have the
>> additional advantage that the benefit would apply to any shader that uses
>> the sample_d message, regardless of whether or not that shader uses d/dx and
>> d/dy to compute its gradients.
>>
>> Would you mind trying this register to see if it produces an equivalent
>> performance benefit in both your micro-benchmark and Xonotic with Ultra
>> settings?  The register is located at address 07028h in register space MMIO
>> 0/2/0.  When setting it, the upper 16 bits are a write mask, so to set the
>> register to 0 you would store 0x001f, and to set it to 0x1f you would
>> store 0x001f001f.
>>
>> Since the SAMPLER_MODE setting allows us to trade off quality vs
>> performance, we're also interested to know whether a value less than 0x1f is
>> sufficient to produce the performance improvement in Xonotic--it would be
>> nice if we could find a "sweet spot" for this setting that produces the
>> performance improvement we need without sacrificing too much quality.
> Great finding!  I will see if sett