[Mesa-dev] [Bug 50484] Mesa build fails if no `indent` available

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50484

Kenneth Graunke  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|mesa-dev@lists.freedesktop. |kenn...@whitecape.org
   |org |

--- Comment #1 from Kenneth Graunke  2012-05-30 00:15:22 
PDT ---
A proposed patch is on the mailing list:
http://lists.freedesktop.org/archives/mesa-dev/2012-May/022368.html

I'll probably commit it tomorrow if there are no objections.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- 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] softpipe: Fix everything that is wrong with clipping and interpolation.

2012-05-30 Thread Dave Airlie
On Tue, May 29, 2012 at 4:34 PM, Olivier Galibert  wrote:
> This includes:
> - picking up correctly which attributes are flatshaded and which are
>  noperspective
>
> - copying the flatshaded attributes when needed, including the
>  non-built-in ones
>
> - correctly interpolating the noperspective attributes in screen-space
>  instead than in a 3d-correct fashion.
>

Have you checked llvmpipe with this? since it might need changes to go
along with this.

Also a count of piglit tests if fixes in the commit might be good.

Otherwise looks good to me, and fixes something I stared at for a few
hours in vain one day.

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


Re: [Mesa-dev] [PATCH 1/2] mesa: common/meta: avoid printing uninitialized bytes.

2012-05-30 Thread Oliver McFadden
On Tue, May 29, 2012 at 10:27:15AM -0700, Eric Anholt wrote:
> On Sat, 26 May 2012 10:22:16 +0300, Oliver McFadden 
>  wrote:
> > Mesa 8.1-devel implementation error: meta program compile failed:
> > ��
> 
> I think this is the wrong fix.  From the GL 3.0 spec:
> 
> "These commands return the info log string in infoLog. This string
>  will be null terminated.  The actual number of characters written
>  into infoLog, excluding the null terminator, is returned in
>  length... The number of characters in the info log can be queried
>  with GetShaderiv or GetProgramiv with INFO LOG LENGTH."
> 
> So you just need to malloc size + 1.

OK. I will check this and hold-off on the uninitialized bytes patch.

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


Re: [Mesa-dev] [PATCH 2/2] mesa: don't compile integer clear shaders for unsupported APIs

2012-05-30 Thread Oliver McFadden
On Tue, May 29, 2012 at 08:33:33AM -0600, Brian Paul wrote:
> On Tue, May 29, 2012 at 1:40 AM, Oliver McFadden
>  wrote:
> > On Sat, May 26, 2012 at 10:22:17AM +0300, Oliver McFadden wrote:
> >> Discovered while running the Khronos conformance test suite and
> >> receiving "implementation error: meta program compile failed."
> >>
> >> This bug was recently introduced by the i965 clear patch set and would
> >> only be detected while using the ES2 API and only on gen6+ hardware.
> >>
> >> Signed-off-by: Oliver McFadden 
> >> ---
> >>  src/mesa/drivers/common/meta.c |    3 ++-
> >>  1 files changed, 2 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/src/mesa/drivers/common/meta.c 
> >> b/src/mesa/drivers/common/meta.c
> >> index 316d7b2..21bdeb1 100644
> >> --- a/src/mesa/drivers/common/meta.c
> >> +++ b/src/mesa/drivers/common/meta.c
> >> @@ -1793,7 +1793,8 @@ meta_glsl_clear_init(struct gl_context *ctx, struct 
> >> clear_state *clear)
> >>     clear->ColorLocation = _mesa_GetUniformLocationARB(clear->ShaderProg,
> >>                                                     "color");
> >>
> >> -   if (ctx->Const.GLSLVersion >= 130) {
> >> +   if (ctx->API != API_OPENGLES && ctx->API != API_OPENGLES2 &&
> >> +       ctx->Const.GLSLVersion >= 130) {
> 
> Wouldn't it be simpler to test ctx->API == API_OPENGL?

The logic here was that we might have some other API implemented in the
future, which would make use of meta clear code and use the integer
shaders. But AFAIK currently there are no such cases, so using
ctx->API == API_OPENGL should be fine.

I'll round-up the Reviewed-by's and push the patch.

> 
> Looks OK otherwise.
> 
> Reviewed-by: Brian Paul 

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


Re: [Mesa-dev] [PATCH 00/26] Unit test generated code, fix bugs

2012-05-30 Thread Brian Paul

On 05/29/2012 04:51 PM, Ian Romanick wrote:

This series contains four bits of stuff:

Patches 01/26 and 02/26 move the existing GLX tests from tests/glx to
src/glx/tests.  This matches the placement of the other unit tests in
Mesa.

Patches 03/26, 04/26, 19/26, and 20/26 add new tests for code
generated from XML descriptions of the OpenGL and GLX APIs.  These
test indirect_size.c and indirect_init.c in src/glx,
_mesa_lookup_enum_by_{name,nr} in src/mesa/main/enums.c, and the
dispatch tables in src/mapi/glapi.

Patches 05/26 through 18/26 fix minor bugs in
_mesa_lookup_enum_by_{name,nr} found with using the unit tests.  The
fixes appear in the sequence before the test cases so that, during a
bisect, 'make check' will always pass.


These look good to me.  Reviewed-by: Brian Paul 



Patches 21/26 through 26/26 remove some functions from the dispatch
table that are dead on arrival.  The unit tests give some assurance
that this change won't break things.


Looks good too.  Reviewed-by: Brian Paul 

BTW, GL_SGIX_pixel_texture was actually implemented in Mesa for a 
while some years ago.


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


Re: [Mesa-dev] [PATCH] softpipe: Offset is not to be applied to the layer parameter of array texture fetches.

2012-05-30 Thread Brian Paul

On 05/29/2012 01:45 PM, Olivier Galibert wrote:

Signed-off-by: Olivier Galibert
---
  src/gallium/drivers/softpipe/sp_tex_sample.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c 
b/src/gallium/drivers/softpipe/sp_tex_sample.c
index d4c0175..f29a6c7 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -2693,7 +2693,7 @@ sample_get_texels(struct tgsi_sampler *tgsi_sampler,
 case PIPE_TEXTURE_1D_ARRAY:
for (j = 0; j<  TGSI_QUAD_SIZE; j++) {
   int x = CLAMP(v_i[j] + offset[0], 0, width - 1);
- int y = CLAMP(v_j[j] + offset[1], 0, layers - 1);
+ int y = CLAMP(v_j[j], 0, layers - 1);
 tx = get_texel_1d_array(samp, addr, x, y);
 for (c = 0; c<  4; c++) {
rgba[c][j] = tx[c];
@@ -2715,7 +2715,7 @@ sample_get_texels(struct tgsi_sampler *tgsi_sampler,
for (j = 0; j<  TGSI_QUAD_SIZE; j++) {
   int x = CLAMP(v_i[j] + offset[0], 0, width - 1);
   int y = CLAMP(v_j[j] + offset[1], 0, height - 1);
- int layer = CLAMP(v_k[j] + offset[2], 0, layers - 1);
+ int layer = CLAMP(v_k[j], 0, layers - 1);
 tx = get_texel_2d_array(samp, addr, x, y, layer);
 for (c = 0; c<  4; c++) {
rgba[c][j] = tx[c];


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


Re: [Mesa-dev] [PATCH] softpipe: Fix everything that is wrong with clipping and interpolation.

2012-05-30 Thread Brian Paul

On 05/29/2012 09:34 AM, Olivier Galibert wrote:

This includes:
- picking up correctly which attributes are flatshaded and which are
   noperspective

- copying the flatshaded attributes when needed, including the
   non-built-in ones

- correctly interpolating the noperspective attributes in screen-space
   instead than in a 3d-correct fashion.

Signed-off-by: Olivier Galibert
---
  src/gallium/auxiliary/draw/draw_pipe_clip.c |  105 +++
  1 file changed, 74 insertions(+), 31 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pipe_clip.c 
b/src/gallium/auxiliary/draw/draw_pipe_clip.c
index 4da4d65..3824ced 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_clip.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_clip.c
@@ -39,6 +39,7 @@

  #include "draw_vs.h"
  #include "draw_pipe.h"
+#include "draw_fs.h"


  #ifndef IS_NEGATIVE
@@ -56,11 +57,12 @@
  struct clip_stage {
 struct draw_stage stage;  /**<  base class */

-   /* Basically duplicate some of the flatshading logic here:
-*/
-   boolean flat;
-   uint num_color_attribs;
-   uint color_attribs[4];  /* front/back primary/secondary colors */
+   /* List of the attributes to be flatshaded. */
+   uint num_flat_attribs;
+   uint flat_attribs[PIPE_MAX_SHADER_OUTPUTS];
+
+   /* Mask of attributes in noperspective mode */
+   boolean noperspective_attribs[PIPE_MAX_SHADER_OUTPUTS];

 float (*plane)[4];
  };
@@ -91,17 +93,16 @@ static void interp_attr( float dst[4],


  /**
- * Copy front/back, primary/secondary colors from src vertex to dst vertex.
- * Used when flat shading.
+ * Copy flat shaded attributes src vertex to dst vertex.
   */
-static void copy_colors( struct draw_stage *stage,
-struct vertex_header *dst,
-const struct vertex_header *src )
+static void copy_flat( struct draw_stage *stage,
+   struct vertex_header *dst,
+   const struct vertex_header *src )
  {
 const struct clip_stage *clipper = clip_stage(stage);
 uint i;
-   for (i = 0; i<  clipper->num_color_attribs; i++) {
-  const uint attr = clipper->color_attribs[i];
+   for (i = 0; i<  clipper->num_flat_attribs; i++) {
+  const uint attr = clipper->flat_attribs[i];
COPY_4FV(dst->data[attr], src->data[attr]);
 }
  }
@@ -120,6 +121,7 @@ static void interp( const struct clip_stage *clip,
 const unsigned pos_attr = 
draw_current_shader_position_output(clip->stage.draw);
 const unsigned clip_attr = 
draw_current_shader_clipvertex_output(clip->stage.draw);
 unsigned j;
+   float t_nopersp = 0;

 /* Vertex header.
  */
@@ -152,8 +154,27 @@ static void interp( const struct clip_stage *clip,
 /* Other attributes
  */
 for (j = 0; j<  nr_attrs; j++) {
-  if (j != pos_attr&&  j != clip_attr)
-interp_attr(dst->data[j], t, in->data[j], out->data[j]);
+  if (j != pos_attr&&  j != clip_attr) {
+ if (clip->noperspective_attribs[j]) {
+if (!t_nopersp || !t) {


For floating point values, I think this is better/clearer:

   if (t_nopersp == 0.0 || t == 0.0) {


+   // Compute the t in screen-space instead of 3d space.
+   //
+   // When both points are at the same screen position,
+   // we can pick whatever value (the interpolated point
+   // won't be in front anyway), so just use t.
+   int k;
+   t_nopersp = t;


We need more comments here.  This is a loop over the vertex position X 
and Y components which looks for two different X or Y values, then 
computes the new interpolation parameter.


It should also be noted that t_nopersp only needs to be computed once. 
 It would be clearer if it were compute before the for-j loop instead 
of inside.  It's pretty cheap so we could probably do it all the time.




+   for (k=0; k<  2; k++)
+  if (in->data[pos_attr][k] != out->data[pos_attr][k]) {
+ t_nopersp = (dst->data[pos_attr][k] - 
out->data[pos_attr][k]) /
+(in->data[pos_attr][k] - out->data[pos_attr][k]);
+ break;
+  }
+}
+interp_attr(dst->data[j], t_nopersp, in->data[j], out->data[j]);
+ } else
+interp_attr(dst->data[j], t, in->data[j], out->data[j]);
+  }
 }
  }

@@ -406,14 +427,14 @@ do_clip_tri( struct draw_stage *stage,
 /* If flat-shading, copy provoking vertex color to polygon vertex[0]
  */
 if (n>= 3) {
-  if (clipper->flat) {
+  if (clipper->num_flat_attribs) {
   if (stage->draw->rasterizer->flatshade_first) {
  if (inlist[0] != header->v[0]) {
 assert(tmpnr<  MAX_CLIPPED_VERTICES + 1);
 if (tmpnr>= MAX_CLIPPED_VERTICES + 1)
return;
 inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
-   copy_colors(st

[Mesa-dev] [Bug 50475] src/glx/glxclient.h:54:30: fatal error: glapi/glapitable.h: No such file or directory

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50475

--- Comment #1 from Brian Paul  2012-05-30 08:04:21 PDT 
---
I'm working on fixing the Scons build.  It might take a little while...

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- 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 50475] src/glx/glxclient.h:54:30: fatal error: glapi/glapitable.h: No such file or directory

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50475

--- Comment #2 from Brian Paul  2012-05-30 09:36:27 PDT 
---
Created attachment 62293
  --> https://bugs.freedesktop.org/attachment.cgi?id=62293
repair scons breakage

Vinson, can you try this patch?  I haven't tested it much but the build seems
to work.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- 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] Fw: [Intel-gfx] [PATCH] intel: add a timed wait function

2012-05-30 Thread Eric Anholt
On Sun, 27 May 2012 13:16:54 -0700, Ben Widawsky  wrote:
> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> index b776d2f..695a449 100644
> --- a/intel/intel_bufmgr_gem.c
> +++ b/intel/intel_bufmgr_gem.c
> @@ -1478,6 +1478,32 @@ drm_intel_gem_bo_wait_rendering(drm_intel_bo *bo)
>   drm_intel_gem_bo_start_gtt_access(bo, 1);
>  }
>  
> +int drm_intel_gem_bo_wait(drm_intel_bo *bo, uint64_t *timeout_ns)
> +{
> + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)
> bo->bufmgr;
> + drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
> + struct drm_i915_gem_wait wait;
> + int ret;
> +
> + if (!timeout_ns)
> + return -EINVAL;

At least for the GL case, timeout of 0 ns wants to turn into
GL_TIMEOUT_EXPIRED or GL_ALREADY_SIGNALED.  -EINVAL doesn't sound like
translating into either of those -- are you thinking that GL will
special case 0 ns to not call this function?

> +
> + wait.bo_handle = bo_gem->gem_handle;
> + wait.timeout_ns = *timeout_ns;
> + wait.flags = 0;
> + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_WAIT, &wait);
> + if (ret)
> + return ret;
> +
> + if (wait.timeout_ns == 0) {
> + DBG("Wait timed out on buffer %d\n",
> bo_gem->gem_handle);
> + *timeout_ns = 0;
> + } else
> + *timeout_ns = wait.timeout_ns;
> +
> + return ret;
> +}

Do we see any consumers wanting the unslept time?  GL doesn't care, and
not passing a pointer would be more convenient for the caller.

I guess GL_ALREADY_SIGNALED handling will be done using a check for
bo_busy() before calling this.


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


[Mesa-dev] [PATCH 2/8] mesa: Move the version information right into configure.ac.

2012-05-30 Thread Eric Anholt
Nothing else called version.mk.
---
 bin/version.mk |   17 -
 configure.ac   |8 +---
 2 files changed, 1 insertion(+), 24 deletions(-)
 delete mode 100755 bin/version.mk

diff --git a/bin/version.mk b/bin/version.mk
deleted file mode 100755
index ab20d79..000
--- a/bin/version.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/make -sf
-# Print the various Mesa version fields. This is mostly used to add the
-# version to configure.
-
-# This reflects that this script is usually called from the toplevel
-TOP = .
-
-include $(TOP)/configs/default
-
-version:
-   @echo $(MESA_VERSION)
-major:
-   @echo $(MESA_MAJOR)
-minor:
-   @echo $(MESA_MINOR)
-tiny:
-   @echo $(MESA_TINY)
diff --git a/configure.ac b/configure.ac
index 20bd00b..bf78284 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,17 +2,11 @@ dnl Process this file with autoconf to create configure.
 
 AC_PREREQ([2.60])
 
-dnl Versioning - scrape the version from configs/default
-m4_define([mesa_version],
-[m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n' | tr 
-d '\r'])])
-m4_ifval(mesa_version,,
-[m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk 
version`])])
-
 dnl Tell the user about autoconf.html in the --help output
 m4_divert_once([HELP_END], [
 See docs/autoconf.html for more details on the options for Mesa.])
 
-AC_INIT([Mesa],[mesa_version],
+AC_INIT([Mesa], [8.1.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
 AC_CONFIG_AUX_DIR([bin])
 AC_CANONICAL_HOST
-- 
1.7.10

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


[Mesa-dev] [PATCH 3/8] automake: Globally add stub automake targets to the old Makefiles.

2012-05-30 Thread Eric Anholt
I tried to update all the old Makefiles that included the default
config to be sure they had a default target if they didn't previously
have one, since this new all target will always point at it.  Almost
everything had one.
---
 configs/default |   13 +
 src/gallium/drivers/i915/Makefile   |3 ---
 src/gallium/drivers/llvmpipe/Makefile   |3 ---
 src/gallium/drivers/nouveau/Makefile|3 ---
 src/gallium/drivers/nv30/Makefile   |3 ---
 src/gallium/drivers/nv50/Makefile   |3 ---
 src/gallium/drivers/nvc0/Makefile   |3 ---
 src/gallium/drivers/radeon/Makefile |3 ---
 src/gallium/drivers/radeonsi/Makefile   |3 ---
 src/gallium/drivers/rbug/Makefile   |3 ---
 src/gallium/drivers/softpipe/Makefile   |3 ---
 src/gallium/drivers/svga/Makefile   |3 ---
 src/gallium/drivers/trace/Makefile  |3 ---
 src/gallium/state_trackers/d3d1x/winedlls/Makefile.wine |2 +-
 src/glx/apple/Makefile  |2 +-
 src/mapi/glapi/gen/Makefile |2 +-
 16 files changed, 16 insertions(+), 39 deletions(-)

diff --git a/configs/default b/configs/default
index 0f8b09f..20ba796 100644
--- a/configs/default
+++ b/configs/default
@@ -172,3 +172,16 @@ GLESv2_PC_CFLAGS =
 VG_PC_REQ_PRIV =
 VG_PC_LIB_PRIV =
 VG_PC_CFLAGS =
+
+# default targets
+# this helps reduce the mismatch between our automake Makefiles and the old
+# custom Makefiles while we transition.
+
+all: default
+
+am--refresh:
+
+distclean: clean
+
+check:
+test:
diff --git a/src/gallium/drivers/i915/Makefile 
b/src/gallium/drivers/i915/Makefile
index b7d8a1f..0e57678 100644
--- a/src/gallium/drivers/i915/Makefile
+++ b/src/gallium/drivers/i915/Makefile
@@ -7,6 +7,3 @@ LIBNAME = i915
 include Makefile.sources
 
 include ../../Makefile.template
-
-# FIXME: Remove when this driver is converted to automake.
-all: default
diff --git a/src/gallium/drivers/llvmpipe/Makefile 
b/src/gallium/drivers/llvmpipe/Makefile
index 8df891c..1a4e93d 100644
--- a/src/gallium/drivers/llvmpipe/Makefile
+++ b/src/gallium/drivers/llvmpipe/Makefile
@@ -62,9 +62,6 @@ CLEAN_EXTRA = *.o
 
 include ../../Makefile.template
 
-# FIXME: Remove when this driver is converted to automake.
-all: default
-
 PROGS_DEPS := ../../auxiliary/libgallium.a
 
 lp_tile_soa.c: lp_tile_soa.py ../../auxiliary/util/u_format_parse.py 
../../auxiliary/util/u_format_pack.py ../../auxiliary/util/u_format.csv
diff --git a/src/gallium/drivers/nouveau/Makefile 
b/src/gallium/drivers/nouveau/Makefile
index cfb8831..d583324 100644
--- a/src/gallium/drivers/nouveau/Makefile
+++ b/src/gallium/drivers/nouveau/Makefile
@@ -14,6 +14,3 @@ LIBRARY_DEFINES += $(shell $(PKG_CONFIG) libdrm 
libdrm_nouveau --cflags-only-oth
 include Makefile.sources
 
 include ../../Makefile.template
-
-# FIXME: Remove when this driver is converted to automake.
-all: default
diff --git a/src/gallium/drivers/nv30/Makefile 
b/src/gallium/drivers/nv30/Makefile
index 94d1a77..de521aa 100644
--- a/src/gallium/drivers/nv30/Makefile
+++ b/src/gallium/drivers/nv30/Makefile
@@ -10,6 +10,3 @@ LIBRARY_INCLUDES = \
 
 include ../../Makefile.template
 # DO NOT DELETE
-
-# FIXME: Remove when this driver is converted to automake.
-all: default
diff --git a/src/gallium/drivers/nv50/Makefile 
b/src/gallium/drivers/nv50/Makefile
index 2dd37ee..18e30b0 100644
--- a/src/gallium/drivers/nv50/Makefile
+++ b/src/gallium/drivers/nv50/Makefile
@@ -10,6 +10,3 @@ LIBRARY_INCLUDES = \
$(LIBDRM_CFLAGS)
 
 include ../../Makefile.template
-
-# FIXME: Remove when this driver is converted to automake.
-all: default
diff --git a/src/gallium/drivers/nvc0/Makefile 
b/src/gallium/drivers/nvc0/Makefile
index a60127f..c412625 100644
--- a/src/gallium/drivers/nvc0/Makefile
+++ b/src/gallium/drivers/nvc0/Makefile
@@ -10,6 +10,3 @@ LIBRARY_INCLUDES = \
$(LIBDRM_CFLAGS)
 
 include ../../Makefile.template
-
-# FIXME: Remove when this driver is converted to automake.
-all: default
diff --git a/src/gallium/drivers/radeon/Makefile 
b/src/gallium/drivers/radeon/Makefile
index 3f930cd..92ada00 100644
--- a/src/gallium/drivers/radeon/Makefile
+++ b/src/gallium/drivers/radeon/Makefile
@@ -68,6 +68,3 @@ AMDILGenCodeEmitter.inc: *.td
 LOADER_LIBS=$(shell llvm-config --libs bitreader asmparser)
 loader: loader.o libradeon.a
gcc -o loader -L/usr/local/lib $(LDFLAGS) loader.o libradeon.a 
$(LLVM_LIBS) $(LOADER_LIBS) -lpthread -ldl -lstdc++ -lm
-
-# FIXME: Remove when this driver is converted to automake.
-all: default
diff --git a/src/gallium/drivers/radeonsi/Makefile 
b/src/gallium/drivers/radeonsi/Makefile
index 90f6f47..5d16b41 100644
--- a/src/gallium/drivers/radeonsi/Makefile
+++ b/src/gallium/drivers/radeonsi/Ma

[Mesa-dev] [PATCH 5/8] automake: Convert src/Makefile to automake.

2012-05-30 Thread Eric Anholt
---
 configure.ac|1 +
 src/.gitignore  |1 +
 src/Makefile|   40 
 src/Makefile.am |4 
 4 files changed, 6 insertions(+), 40 deletions(-)
 create mode 100644 src/.gitignore
 delete mode 100644 src/Makefile
 create mode 100644 src/Makefile.am

diff --git a/configure.ac b/configure.ac
index bfc5c94..01da2b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2093,6 +2093,7 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
 dnl Substitute the config
 AC_CONFIG_FILES([configs/autoconf
Makefile
+   src/Makefile
src/gallium/auxiliary/pipe-loader/Makefile
src/gallium/state_trackers/clover/Makefile
src/gallium/drivers/Makefile
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 000..5fc607b
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1 @@
+/Makefile
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index 4f65da0..000
--- a/src/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# src/Makefile
-
-TOP = ..
-
-include $(TOP)/configs/current
-
-SUBDIRS = $(SRC_DIRS)
-
-
-default: message $(TOP)/$(LIB_DIR) subdirs
-
-
-message:
-   @echo "Making sources for" $(CONFIG_NAME)
-
-
-subdirs:
-   @for dir in $(SUBDIRS) ; do \
-   if [ -d $$dir ] ; then \
-   (cd $$dir && $(MAKE)) || exit 1; \
-   fi \
-   done
-
-install: $(TOP)/$(LIB_DIR)
-   @for dir in $(SUBDIRS) ; do \
-   if [ -d $$dir ] ; then \
-   (cd $$dir && $(MAKE) install) || exit 1 ; \
-   fi \
-   done
-
-$(TOP)/$(LIB_DIR):
-   -@test -d $(TOP)/$(LIB_DIR) || mkdir -p $(TOP)/$(LIB_DIR)
-
-
-clean:
-   -@for dir in $(SUBDIRS) ; do \
-   if [ -d $$dir ] ; then \
-   (cd $$dir && $(MAKE) clean) ; \
-   fi \
-   done
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 000..d6a7946
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,4 @@
+SUBDIRS=$(SRC_DIRS)
+
+all-local:
+   $(MKDIR_P) $(top_builddir)/$(LIB_DIR)
-- 
1.7.10

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


[Mesa-dev] [PATCH 4/8] automake: Move top-level makefile to automake.

2012-05-30 Thread Eric Anholt
This is part of a series to fix our build issues in the automake case
by hooking up the automatic Makefile regeneration support.  The
extract_git_sha1 is moved into src/mesa/Makefile so that we get
correct dependency generation.
---
 .gitignore   |1 +
 Makefile |  156 --
 Makefile.am  |  124 +++
 bin/extract_git_sha1 |   20 ---
 configure.ac |1 +
 src/mesa/Makefile|   17 ++
 6 files changed, 143 insertions(+), 176 deletions(-)
 delete mode 100644 Makefile
 create mode 100644 Makefile.am
 delete mode 100755 bin/extract_git_sha1

diff --git a/.gitignore b/.gitignore
index 717d45d..f481dc4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,4 @@ Makefile.in
 .dir-locals.el
 .deps/
 .libs/
+/Makefile
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 2a71ec8..000
--- a/Makefile
+++ /dev/null
@@ -1,156 +0,0 @@
-# Top-level Mesa makefile
-
-TOP = .
-
-SUBDIRS = src
-
-
-# The git command below generates an empty string when we're not
-# building in a GIT tree (i.e., building from a release tarball).
-default: $(TOP)/configs/current
-   @$(TOP)/bin/extract_git_sha1
-   @for dir in $(SUBDIRS) ; do \
-   if [ -d $$dir ] ; then \
-   (cd $$dir && $(MAKE)) || exit 1 ; \
-   fi \
-   done
-
-all: default
-
-
-doxygen:
-   cd doxygen && $(MAKE)
-
-check:
-   make -C src/glsl/tests check
-   make -C tests check
-
-clean:
-   -@touch $(TOP)/configs/current
-   -@for dir in $(SUBDIRS) ; do \
-   if [ -d $$dir ] ; then \
-   (cd $$dir && $(MAKE) clean) ; \
-   fi \
-   done
-   -@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current
-
-
-realclean: clean
-   -rm -rf lib*
-   -rm -f $(TOP)/configs/current
-   -rm -f $(TOP)/configs/autoconf
-   -rm -rf autom4te.cache
-   -find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
- -name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
-
-
-distclean: realclean
-
-
-install:
-   @for dir in $(SUBDIRS) ; do \
-   if [ -d $$dir ] ; then \
-   (cd $$dir && $(MAKE) install) || exit 1 ; \
-   fi \
-   done
-
-
-.PHONY: default doxygen clean realclean distclean install check
-
-# If there's no current configuration file
-$(TOP)/configs/current:
-   @echo
-   @echo
-   @echo "Please run './configure' then 'make'"
-   @echo "See './configure --help' for details"
-   @echo
-   @echo "(ignore the following error message)"
-   @exit 1
-
-# Rules for making release tarballs
-
-PACKAGE_VERSION=8.1-devel
-PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
-PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
-
-EXTRA_FILES = \
-   aclocal.m4  \
-   configure   \
-   tests/Makefile.in   \
-   tests/glx/Makefile.in   \
-   src/glsl/glsl_parser.cpp\
-   src/glsl/glsl_parser.h  \
-   src/glsl/glsl_lexer.cpp \
-   src/glsl/glcpp/glcpp-lex.c  \
-   src/glsl/glcpp/glcpp-parse.c\
-   src/glsl/glcpp/glcpp-parse.h\
-   src/mesa/main/api_exec_es1.c\
-   src/mesa/main/api_exec_es1_dispatch.h   \
-   src/mesa/main/api_exec_es1_remap_helper.h   \
-   src/mesa/main/api_exec_es2.c\
-   src/mesa/main/api_exec_es2_dispatch.h   \
-   src/mesa/main/api_exec_es2_remap_helper.h   \
-   src/mesa/program/lex.yy.c   \
-   src/mesa/program/program_parse.tab.c\
-   src/mesa/program/program_parse.tab.h
-
-IGNORE_FILES = \
-   -x autogen.sh
-
-
-parsers: configure
-   -@touch $(TOP)/configs/current
-   $(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
-   $(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
-   $(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c 
program/program_parse.tab.h
-
-# Everything for new a Mesa release:
-ARCHIVES = $(PACKAGE_NAME).tar.gz \
-   $(PACKAGE_NAME).tar.bz2 \
-   $(PACKAGE_NAME).zip \
-
-tarballs: md5
-   rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
-
-# Helper for autoconf builds
-ACLOCAL = aclocal
-ACLOCAL_FLAGS =
-AUTOCONF = autoconf
-AC_FLAGS =
-aclocal.m4: configure.ac acinclude.m4
-   $(ACLOCAL) $(ACLOCAL_FLAGS)
-configure: configure.ac aclocal.m4 acinclude.m4
-   $(AUTOCONF) $(AC_FLAGS)
-
-manifest.txt: .git
-   ( \
-   ls -1 $(EXTRA_FILES) ; \
-   git ls-files $(IGNORE_FILES) \
-   ) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
-
-../$(PACKAGE_DIR):
-   

[Mesa-dev] [PATCH 6/8] automake: Add a prefix variable for libglsl sources.

2012-05-30 Thread Eric Anholt
See e86c40a84d241b954594f5ae7df9b9c3fc797a4e for reasoning.  In the
process I did s/:=/=/ to shut up automake about nonportable make syntax.
---
 src/glsl/Android.mk   |1 +
 src/glsl/Makefile |1 +
 src/glsl/Makefile.sources |  172 ++---
 3 files changed, 88 insertions(+), 86 deletions(-)

diff --git a/src/glsl/Android.mk b/src/glsl/Android.mk
index cf793d6..66c8bec 100644
--- a/src/glsl/Android.mk
+++ b/src/glsl/Android.mk
@@ -25,6 +25,7 @@
 
 LOCAL_PATH := $(call my-dir)
 
+GLSL_SRCDIR = .
 include $(LOCAL_PATH)/Makefile.sources
 
 # ---
diff --git a/src/glsl/Makefile b/src/glsl/Makefile
index 7c80c95..2ae46d1 100644
--- a/src/glsl/Makefile
+++ b/src/glsl/Makefile
@@ -7,6 +7,7 @@ include $(TOP)/configs/current
 
 LIBNAME = glsl
 
+GLSL_SRCDIR=.
 include Makefile.sources
 
 GLCPP_SOURCES = \
diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources
index caa8ad5..b58de17 100644
--- a/src/glsl/Makefile.sources
+++ b/src/glsl/Makefile.sources
@@ -2,92 +2,92 @@
 
 # libglcpp
 
-LIBGLCPP_FILES := \
-   glcpp/pp.c
+LIBGLCPP_FILES = \
+   $(GLSL_SRCDIR)/glcpp/pp.c
 
-LIBGLCPP_GENERATED_FILES := \
-   glcpp/glcpp-lex.c \
-   glcpp/glcpp-parse.c
+LIBGLCPP_GENERATED_FILES = \
+   $(GLSL_SRCDIR)/glcpp/glcpp-lex.c \
+   $(GLSL_SRCDIR)/glcpp/glcpp-parse.c
 
 # libglsl
 
-LIBGLSL_FILES := \
-   strtod.c \
-   ralloc.c
+LIBGLSL_FILES = \
+   $(GLSL_SRCDIR)/strtod.c \
+   $(GLSL_SRCDIR)/ralloc.c
 
-LIBGLSL_CXX_FILES := \
-   ast_expr.cpp \
-   ast_function.cpp \
-   ast_to_hir.cpp \
-   ast_type.cpp \
-   builtin_variables.cpp \
-   glsl_parser_extras.cpp \
-   glsl_types.cpp \
-   glsl_symbol_table.cpp \
-   hir_field_selection.cpp \
-   ir_basic_block.cpp \
-   ir_builder.cpp \
-   ir_clone.cpp \
-   ir_constant_expression.cpp \
-   ir.cpp \
-   ir_expression_flattening.cpp \
-   ir_function_can_inline.cpp \
-   ir_function_detect_recursion.cpp \
-   ir_function.cpp \
-   ir_hierarchical_visitor.cpp \
-   ir_hv_accept.cpp \
-   ir_import_prototypes.cpp \
-   ir_print_visitor.cpp \
-   ir_reader.cpp \
-   ir_rvalue_visitor.cpp \
-   ir_set_program_inouts.cpp \
-   ir_validate.cpp \
-   ir_variable_refcount.cpp \
-   linker.cpp \
-   link_functions.cpp \
-   link_uniforms.cpp \
-   link_uniform_initializers.cpp \
-   loop_analysis.cpp \
-   loop_controls.cpp \
-   loop_unroll.cpp \
-   lower_clip_distance.cpp \
-   lower_discard.cpp \
-   lower_discard_flow.cpp \
-   lower_if_to_cond_assign.cpp \
-   lower_instructions.cpp \
-   lower_jumps.cpp \
-   lower_mat_op_to_vec.cpp \
-   lower_noise.cpp \
-   lower_texture_projection.cpp \
-   lower_variable_index_to_cond_assign.cpp \
-   lower_vec_index_to_cond_assign.cpp \
-   lower_vec_index_to_swizzle.cpp \
-   lower_vector.cpp \
-   lower_output_reads.cpp \
-   opt_algebraic.cpp \
-   opt_array_splitting.cpp \
-   opt_constant_folding.cpp \
-   opt_constant_propagation.cpp \
-   opt_constant_variable.cpp \
-   opt_copy_propagation.cpp \
-   opt_copy_propagation_elements.cpp \
-   opt_dead_code.cpp \
-   opt_dead_code_local.cpp \
-   opt_dead_functions.cpp \
-   opt_function_inlining.cpp \
-   opt_if_simplification.cpp \
-   opt_noop_swizzle.cpp \
-   opt_redundant_jumps.cpp \
-   opt_structure_splitting.cpp \
-   opt_swizzle_swizzle.cpp \
-   opt_tree_grafting.cpp \
-   s_expression.cpp
+LIBGLSL_CXX_FILES = \
+   $(GLSL_SRCDIR)/ast_expr.cpp \
+   $(GLSL_SRCDIR)/ast_function.cpp \
+   $(GLSL_SRCDIR)/ast_to_hir.cpp \
+   $(GLSL_SRCDIR)/ast_type.cpp \
+   $(GLSL_SRCDIR)/builtin_variables.cpp \
+   $(GLSL_SRCDIR)/glsl_parser_extras.cpp \
+   $(GLSL_SRCDIR)/glsl_types.cpp \
+   $(GLSL_SRCDIR)/glsl_symbol_table.cpp \
+   $(GLSL_SRCDIR)/hir_field_selection.cpp \
+   $(GLSL_SRCDIR)/ir_basic_block.cpp \
+   $(GLSL_SRCDIR)/ir_builder.cpp \
+   $(GLSL_SRCDIR)/ir_clone.cpp \
+   $(GLSL_SRCDIR)/ir_constant_expression.cpp \
+   $(GLSL_SRCDIR)/ir.cpp \
+   $(GLSL_SRCDIR)/ir_expression_flattening.cpp \
+   $(GLSL_SRCDIR)/ir_function_can_inline.cpp \
+   $(GLSL_SRCDIR)/ir_function_detect_recursion.cpp \
+   $(GLSL_SRCDIR)/ir_function.cpp \
+   $(GLSL_SRCDIR)/ir_hierarchical_visitor.cpp \
+   $(GLSL_SRCDIR)/ir_hv_accept.cpp \
+   $(GLSL_SRCDIR)/ir_import_prototypes.cpp \
+   $(GLSL_SRCDIR)/ir_print_visitor.cpp \
+   $(GLSL_SRCDIR)/ir_reader.cpp \
+   $(GLSL_SRCDIR)/ir_rvalue_visitor.cpp \
+   $(GLSL_SRCDIR)/ir_set_program_inouts.cpp \
+   $(GLSL_SRCDIR)/ir_validate.cpp \
+   $(GLSL_SRCDIR)/ir_variable_refcount.cpp \
+   $(GLSL_SRCDIR)/linker.cpp \
+   $(GLSL_SRCDIR)/link_funct

[Mesa-dev] [PATCH 7/8] automake: Merge the dricore libglsl build into libdricore.

2012-05-30 Thread Eric Anholt
Now we have just one library of "all of Mesa core" instead of both
libdricore and libglsl that drivers link against.

I did this change in a sort of nonrecursive make fashion: the
generated files are still produced in the non-automake build, like the
rest of dricore, but the GLSL files are stuffed into libdricore
without building a convenience library in src/glsl (even though we
could now).  This would make a bit more sense if glsl was just another
dir under src/mesa, because right now I had to contort the prefix
variable name to look another ../ level up.
---
 configs/autoconf.in |1 -
 configure.ac|8 +++-
 src/glsl/Makefile   |   35 +++
 src/mesa/libdricore/Makefile.am |   10 +-
 4 files changed, 15 insertions(+), 39 deletions(-)

diff --git a/configs/autoconf.in b/configs/autoconf.in
index 38f49a2..7d0d3b6 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -119,7 +119,6 @@ GALLIUM_DRIVERS = $(foreach 
DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drive
 
 # Driver specific build vars
 DRI_DIRS = @DRI_DIRS@
-DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
 DRICORE_LIBS = @DRICORE_LIBS@
 DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
 EGL_PLATFORMS = @EGL_PLATFORMS@
diff --git a/configure.ac b/configure.ac
index 01da2b0..a8d4a26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1075,18 +1075,16 @@ DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
 MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
 
 if test "x$enable_dri" = xyes && test "x$driglx_direct" = xyes ; then
-DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
 DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
-DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) 
-lglsl'
-DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) 
-ldricore -lglsl'
+DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR)'
+DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) 
-ldricore'
 DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE'
 DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE'
-MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)'
+MESA_MODULES='$(DRICORE_LIBS)'
 HAVE_DRICORE=yes
 fi
 AM_CONDITIONAL(HAVE_DRICORE, test x$HAVE_DRICORE = xyes)
 AC_SUBST([DRICORE_LIBS])
-AC_SUBST([DRICORE_GLSL_LIBS])
 AC_SUBST([DRICORE_LIB_DEPS])
 AC_SUBST([DRI_CXXFLAGS])
 AC_SUBST([DRI_CFLAGS])
diff --git a/src/glsl/Makefile b/src/glsl/Makefile
index 2ae46d1..3cf9fc9 100644
--- a/src/glsl/Makefile
+++ b/src/glsl/Makefile
@@ -68,9 +68,6 @@ OBJECTS = \
$(C_SOURCES:.c=.o) \
$(CXX_SOURCES:.cpp=.o)
 
-DRICORE_OBJ_DIR = obj-visible
-OBJECTS_DRICORE = $(addprefix $(DRICORE_OBJ_DIR)/,$(OBJECTS))
-
 INCLUDES = \
-I. \
-I../mesa \
@@ -88,13 +85,7 @@ ALL_SOURCES = \
 
 # TARGETS #
 
-default: depend lib$(LIBNAME).a $(APPS) $(DRICORE_GLSL_LIBS)
-
-$(TOP)/$(LIB_DIR)/libglsl.so: $(OBJECTS_DRICORE) builtin_function.o Makefile 
$(TOP)/src/glsl/Makefile.template
-   $(MKLIB) -o $@ -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
-   -cplusplus -noprefix \
-   -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/$@.dylib \
-   $(OBJECTS_DRICORE) builtin_function.o
+default: depend lib$(LIBNAME).a $(APPS)
 
 lib$(LIBNAME).a: $(OBJECTS) builtin_function.o Makefile 
$(TOP)/src/glsl/Makefile.template
$(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS) builtin_function.o
@@ -103,28 +94,16 @@ depend: $(ALL_SOURCES) Makefile
rm -f depend
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(ALL_SOURCES) 2> /dev/null
-   $(MKDEP) $(MKDEP_OPTIONS) -a -p $(DRICORE_OBJ_DIR)/ $(INCLUDES) 
$(ALL_SOURCES) 2> /dev/null
 
 # Remove .o and backup files
-clean: clean-dricore
+clean:
rm -f $(GLCPP_OBJECTS) $(GLSL2_OBJECTS) $(TEST_OBJECTS) $(OBJECTS) 
lib$(LIBNAME).a depend depend.bak builtin_function.cpp builtin_function.o 
builtin_stubs.o builtin_compiler
-rm -f $(APPS)
 
-clean-dricore:
-   -rm -f $(OBJECTS_DRICORE) $(TOP)/$(LIB_DIR)/libglsl.so libglsl.so
-
-ifneq (,$(DRICORE_GLSL_LIBS))
-DRICORE_INSTALL_TARGET = install-dricore
-endif
-
 # Dummy target
-install: $(DRICORE_INSTALL_TARGET)
+install:
@echo -n ""
 
-install-dricore: default
-   $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
-   $(INSTALL) -m 755 $(DRICORE_GLSL_LIBS) 
$(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
-
 # RULES #
 
 glsl_compiler: $(GLSL2_OBJECTS) libglsl.a
@@ -143,14 +122,6 @@ glcpp/glcpp: $(GLCPP_OBJECTS)
 .c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
 
-$(DRICORE_OBJ_DIR)/%.o : %.cpp
-   @mkdir -p $(dir $@)
-   $(CXX) -c $(INCLUDES) $(DRI_CXXFLAGS) $(DEFINES) $< -o $@
-
-$(DRICORE_OBJ_DIR)/%.o : %.c
-   @mkdir -p $(dir $@)
-   $(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DEFINES) $< -o $@
-
 glsl_lexer.cpp: glsl_lexer.ll
$(FLEX) --nounistd -o$@  $<
 
diff --git a/src/mesa/libdricore/Makefile.am

[Mesa-dev] [PATCH 8/8] glsl: Put a bunch of optimization visitors under anonymous namespaces.

2012-05-30 Thread Eric Anholt
Because these classes are used entirely from their own source files
and not from separate DSOs, the linker gets to produce massively less
code.  This cuts about 13k of text in the libdricore case.  In the
non-libdricore case, the additional linkage information allows the
compiler to inline some code, so libglsl.a size actually increases by
about 300 bytes.

For a dricore build, improves shader_runner runtime on
glsl-fs-copy-propagation-texcoords-1 by 0.21% +/- 0.03% (n=353574,
outliers removed).  No statistically significant difference with n=322
on glslparsertest on a yofrankie shader intended to test compiler
performance.
---
 src/glsl/opt_algebraic.cpp |4 
 src/glsl/opt_constant_folding.cpp  |4 
 src/glsl/opt_constant_propagation.cpp  |4 
 src/glsl/opt_constant_variable.cpp |4 
 src/glsl/opt_copy_propagation.cpp  |4 
 src/glsl/opt_copy_propagation_elements.cpp |4 
 src/glsl/opt_dead_code_local.cpp   |3 +++
 src/glsl/opt_dead_functions.cpp|3 +++
 src/glsl/opt_function_inlining.cpp |3 +++
 src/glsl/opt_if_simplification.cpp |4 
 src/glsl/opt_noop_swizzle.cpp  |4 
 src/glsl/opt_redundant_jumps.cpp   |4 
 src/glsl/opt_structure_splitting.cpp   |4 
 src/glsl/opt_swizzle_swizzle.cpp   |4 
 src/glsl/opt_tree_grafting.cpp |4 
 15 files changed, 57 insertions(+)

diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp
index cade961..d397612 100644
--- a/src/glsl/opt_algebraic.cpp
+++ b/src/glsl/opt_algebraic.cpp
@@ -34,6 +34,8 @@
 #include "ir_optimization.h"
 #include "glsl_types.h"
 
+namespace {
+
 /**
  * Visitor class for replacing expressions with ir_constant values.
  */
@@ -68,6 +70,8 @@ public:
bool progress;
 };
 
+} /* unnamed namespace */
+
 static inline bool
 is_vec_zero(ir_constant *ir)
 {
diff --git a/src/glsl/opt_constant_folding.cpp 
b/src/glsl/opt_constant_folding.cpp
index dcad599..7d94d48 100644
--- a/src/glsl/opt_constant_folding.cpp
+++ b/src/glsl/opt_constant_folding.cpp
@@ -32,6 +32,8 @@
 #include "ir_optimization.h"
 #include "glsl_types.h"
 
+namespace {
+
 /**
  * Visitor class for replacing expressions with ir_constant values.
  */
@@ -56,6 +58,8 @@ public:
bool progress;
 };
 
+} /* unnamed namespace */
+
 void
 ir_constant_folding_visitor::handle_rvalue(ir_rvalue **rvalue)
 {
diff --git a/src/glsl/opt_constant_propagation.cpp 
b/src/glsl/opt_constant_propagation.cpp
index 2601b52..c5ae36b 100644
--- a/src/glsl/opt_constant_propagation.cpp
+++ b/src/glsl/opt_constant_propagation.cpp
@@ -41,6 +41,8 @@
 #include "ir_optimization.h"
 #include "glsl_types.h"
 
+namespace {
+
 class acp_entry : public exec_node
 {
 public:
@@ -450,6 +452,8 @@ ir_constant_propagation_visitor::add_constant(ir_assignment 
*ir)
this->acp->push_tail(entry);
 }
 
+} /* unnamed namespace */
+
 /**
  * Does a constant propagation pass on the code present in the instruction 
stream.
  */
diff --git a/src/glsl/opt_constant_variable.cpp 
b/src/glsl/opt_constant_variable.cpp
index f3bc867..1bbaf8e 100644
--- a/src/glsl/opt_constant_variable.cpp
+++ b/src/glsl/opt_constant_variable.cpp
@@ -37,6 +37,8 @@
 #include "ir_optimization.h"
 #include "glsl_types.h"
 
+namespace {
+
 struct assignment_entry {
exec_node link;
int assignment_count;
@@ -55,6 +57,8 @@ public:
exec_list list;
 };
 
+} /* unnamed namespace */
+
 static struct assignment_entry *
 get_assignment_entry(ir_variable *var, exec_list *list)
 {
diff --git a/src/glsl/opt_copy_propagation.cpp 
b/src/glsl/opt_copy_propagation.cpp
index 923619d..2952ce5 100644
--- a/src/glsl/opt_copy_propagation.cpp
+++ b/src/glsl/opt_copy_propagation.cpp
@@ -38,6 +38,8 @@
 #include "ir_optimization.h"
 #include "glsl_types.h"
 
+namespace {
+
 class acp_entry : public exec_node
 {
 public:
@@ -107,6 +109,8 @@ public:
void *mem_ctx;
 };
 
+} /* unnamed namespace */
+
 ir_visitor_status
 ir_copy_propagation_visitor::visit_enter(ir_function_signature *ir)
 {
diff --git a/src/glsl/opt_copy_propagation_elements.cpp 
b/src/glsl/opt_copy_propagation_elements.cpp
index 11d9d7b..de9f4ef 100644
--- a/src/glsl/opt_copy_propagation_elements.cpp
+++ b/src/glsl/opt_copy_propagation_elements.cpp
@@ -49,6 +49,8 @@
 
 static bool debug = false;
 
+namespace {
+
 class acp_entry : public exec_node
 {
 public:
@@ -135,6 +137,8 @@ public:
void *shader_mem_ctx;
 };
 
+} /* unnamed namespace */
+
 ir_visitor_status
 ir_copy_propagation_elements_visitor::visit_enter(ir_function_signature *ir)
 {
diff --git a/src/glsl/opt_dead_code_local.cpp b/src/glsl/opt_dead_code_local.cpp
index 4af78a7..8c31802 100644
--- a/src/glsl/opt_dead_code_local.cpp
+++ b/src/glsl/opt_dead_code_local.cpp
@@ -40,6 +40,8 @@
 
 static bool debug = false;
 
+namespace {
+
 class assignment_entry : public exec_node
 {
 public:
@@ -138,6 +140,7 @@ public:

Re: [Mesa-dev] [Intel-gfx] [PATCH] intel: add a timed wait function

2012-05-30 Thread Ben Widawsky
On Wed, 30 May 2012 10:41:20 -0700
Eric Anholt  wrote:

> On Sun, 27 May 2012 13:16:54 -0700, Ben Widawsky  wrote:
> > diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> > index b776d2f..695a449 100644
> > --- a/intel/intel_bufmgr_gem.c
> > +++ b/intel/intel_bufmgr_gem.c
> > @@ -1478,6 +1478,32 @@ drm_intel_gem_bo_wait_rendering(drm_intel_bo *bo)
> > drm_intel_gem_bo_start_gtt_access(bo, 1);
> >  }
> >  
> > +int drm_intel_gem_bo_wait(drm_intel_bo *bo, uint64_t *timeout_ns)
> > +{
> > +   drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)
> > bo->bufmgr;
> > +   drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
> > +   struct drm_i915_gem_wait wait;
> > +   int ret;
> > +
> > +   if (!timeout_ns)
> > +   return -EINVAL;
> 
> At least for the GL case, timeout of 0 ns wants to turn into
> GL_TIMEOUT_EXPIRED or GL_ALREADY_SIGNALED.  -EINVAL doesn't sound like
> translating into either of those -- are you thinking that GL will
> special case 0 ns to not call this function?

Well, it's timeout of NULL, not 0. 0 should do what you want. I can turn
NULL into 0 just as easily, if you want?

> 
> > +
> > +   wait.bo_handle = bo_gem->gem_handle;
> > +   wait.timeout_ns = *timeout_ns;
> > +   wait.flags = 0;
> > +   ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_WAIT, &wait);
> > +   if (ret)
> > +   return ret;
> > +
> > +   if (wait.timeout_ns == 0) {
> > +   DBG("Wait timed out on buffer %d\n",
> > bo_gem->gem_handle);
> > +   *timeout_ns = 0;
> > +   } else
> > +   *timeout_ns = wait.timeout_ns;
> > +
> > +   return ret;
> > +}
> 
> Do we see any consumers wanting the unslept time?  GL doesn't care, and
> not passing a pointer would be more convenient for the caller.

That is how I originally had it, but Daniel Vetter requested otherwise.
I don't care either way. This interacts with your earlier comment as
well.

> 
> I guess GL_ALREADY_SIGNALED handling will be done using a check for
> bo_busy() before calling this.

It shouldn't have to.

I think the outcome is either, drop the return time, or convert NULLs to
0, and everything should be fine, right?


-- 
Ben Widawsky, Intel Open Source Technology Center
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] automake: Check for 'indent' and fall back to 'cat' if not found.

2012-05-30 Thread Ben Widawsky
On Tue, 29 May 2012 16:07:15 -0700
Kenneth Graunke  wrote:

> The glapi generator code uses indent to produce more readable code.
> However, we don't want to make GNU indent a hard build dependency; check
> for it in configure.ac and fall back to 'cat' if it's not available.
> 
> Signed-off-by: Kenneth Graunke 
Acked-by: Ben Widawsky 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 50480] Commit f9d1562 breaks x86 build after x86_64 build

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50480

Matt Turner  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||NOTABUG

--- Comment #1 from Matt Turner  2012-05-30 11:34:08 PDT ---
Run `git clean -dfx`

When making build system changes, there's no way to make both the old and new
system clean up everything potentially left over by both the old and new
systems.

I've seen this kind of thing reported really often, so I'll close this report.
Reopen if `git clean -dfx` and reruning ./autogen.sh doesn't fix it.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- 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 50480] Commit f9d1562 breaks x86 build after x86_64 build

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50480

Droste  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|NOTABUG |

--- Comment #2 from Droste  2012-05-30 11:37:25 PDT ---
git clean -fdx obviously does help (as it removes everything that is not
tracked). but building mesa (with rerun autogen.sh) will recreate the *.lo
files in src/mesa/libcore and make clean does not remove them. 

Currently to build x86 and x86_64 in the same tree I have to run git clean -fdx
before building. before the change a make clean was enough.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- 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 50480] Commit f9d1562 breaks x86 build after x86_64 build

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50480

--- Comment #3 from Droste  2012-05-30 11:49:19 PDT ---
just to clarify what is going on:

what should work, but does not:
1. git clean -fdx 
2. autogen.sh 
3. make && make install
4. make clean
5. autogen.sh --enable-32-bit ...
6. make -> fails

what still does work is:
1. git clean -fdx 
2. autogen.sh 
3. make && make install
4. git clean -fdx
5. autogen.sh --enable-32-bit ...
6. make && make install

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] scons: add code to generate the various GL API files

2012-05-30 Thread Brian Paul
This fixes recent build breakage when we began building the generated
API files from xml as part of the normal build process.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=50475
---
 src/SConscript|1 +
 src/gallium/targets/libgl-xlib/SConscript |3 ++
 src/glx/SConscript|   51 +
 src/mapi/glapi/SConscript |   25 ++
 src/mapi/glapi/gen/SConscript |   42 +++
 src/mesa/SConscript   |   15 +++-
 src/mesa/drivers/osmesa/SConscript|2 +
 7 files changed, 137 insertions(+), 2 deletions(-)
 create mode 100644 src/mapi/glapi/gen/SConscript

diff --git a/src/SConscript b/src/SConscript
index 3d00878..75c4446 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -16,6 +16,7 @@ if env['hostonly']:
 # used.  libgl-xlib and libgl-gdi adapt themselves to use the targets defined
 # in mapi/glapi-shared/SConscript.  mesa/SConscript also adapts itself to
 # enable OpenGL ES support.
+SConscript('mapi/glapi/gen/SConscript')
 SConscript('mapi/glapi/SConscript')
 SConscript('mesa/SConscript')
 
diff --git a/src/gallium/targets/libgl-xlib/SConscript 
b/src/gallium/targets/libgl-xlib/SConscript
index 25a4582..1b92c30 100644
--- a/src/gallium/targets/libgl-xlib/SConscript
+++ b/src/gallium/targets/libgl-xlib/SConscript
@@ -35,6 +35,9 @@ sources = [
 'xlib.c',
 ]
 
+# The sources depend on the python-generated GL API files/headers.
+env.Depends(sources, glapi_headers)
+
 if True:
 env.Append(CPPDEFINES = ['GALLIUM_TRACE', 'GALLIUM_RBUG', 
'GALLIUM_GALAHAD', 'GALLIUM_SOFTPIPE'])
 env.Prepend(LIBS = [trace, rbug, galahad, softpipe])
diff --git a/src/glx/SConscript b/src/glx/SConscript
index 17a5690..664cb86 100644
--- a/src/glx/SConscript
+++ b/src/glx/SConscript
@@ -1,8 +1,11 @@
 Import('*')
 
+from sys import executable as python_cmd
+
 env = env.Clone()
 
 env.Prepend(CPPPATH = [
+   '.',   # the build//glx/ directory
'#include',
'#include/GL/internal',
'#src/mesa',
@@ -80,6 +83,54 @@ libgl = env.SharedLibrary(
 source = sources,
 )
 
+
+# Generate GLX-specific .c and .h files here.  Other GL API-related
+# files are used, but they're generated in mapi/glapi/gen/ since they're
+# used by other targets as well.
+
+GLAPI = '#src/mapi/glapi/'
+
+env.CodeGenerate(
+target = 'indirect.c',
+script = GLAPI + 'gen/glX_proto_send.py',
+source = GLAPI + 'gen/gl_and_es_API.xml',
+command = python_cmd + ' $SCRIPT -f $SOURCE -m proto > $TARGET'
+)
+
+env.CodeGenerate(
+target = 'indirect_size.c', 
+script = GLAPI + 'gen/glX_proto_size.py',
+source = GLAPI + 'gen/gl_API.xml',
+command = python_cmd + ' $SCRIPT -f $SOURCE -m size_c --only-set > $TARGET'
+)
+
+env.CodeGenerate(
+target = 'indirect_init.c', 
+script = GLAPI + 'gen/glX_proto_send.py',
+source = GLAPI + 'gen/gl_API.xml',
+command = python_cmd + ' $SCRIPT -f $SOURCE -m init_c > $TARGET'
+)
+
+headers = []
+
+headers += env.CodeGenerate(
+target = 'indirect_size.h',
+script = GLAPI + 'gen/glX_proto_size.py',
+source = GLAPI + 'gen/gl_API.xml',
+command = python_cmd + ' $SCRIPT -f $SOURCE -m size_h --only-set -h 
_INDIRECT_SIZE_H > $TARGET'
+)
+
+headers += env.CodeGenerate(
+target = 'indirect.h',
+script = GLAPI + 'gen/glX_proto_send.py',
+source = GLAPI + 'gen/gl_API.xml',
+command = python_cmd + ' $SCRIPT -m init_h -f $SOURCE > $TARGET',
+)
+
+
+env.Depends(sources, headers)
+
+
 libgl = env.InstallSharedLibrary(libgl, version=(1, 2))
 
 env.Alias('glx', libgl)
diff --git a/src/mapi/glapi/SConscript b/src/mapi/glapi/SConscript
index 4097a7f..ad007a6 100644
--- a/src/mapi/glapi/SConscript
+++ b/src/mapi/glapi/SConscript
@@ -2,6 +2,8 @@
 # SConscript for glapi
 
 
+from sys import executable as python_cmd
+
 Import('*')
 
 env = env.Clone()
@@ -47,6 +49,8 @@ for s in mapi_sources:
 # Assembly sources
 #
 if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
+GLAPI = '#src/mapi/glapi/'
+
 if env['machine'] == 'x86':
 env.Append(CPPDEFINES = [
 'USE_X86_ASM',
@@ -54,6 +58,12 @@ if env['gcc'] and env['platform'] not in ('darwin', 
'windows'):
 glapi_sources += [
 'glapi_x86.S',
 ]
+env.CodeGenerate(
+target = 'glapi_x86.S',
+script = GLAPI + 'gen/gl_x86_asm.py',
+source = GLAPI + 'gen/gl_API.xml',
+command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+)
 elif env['machine'] == 'x86_64':
 env.Append(CPPDEFINES = [
 'USE_X86_64_ASM',
@@ -61,6 +71,12 @@ if env['gcc'] and env['platform'] not in ('darwin', 
'windows'):
 glapi_sources += [
 'glapi_x86-64.S'
 ]
+env.CodeGenerate(
+target = 'glapi_x86-64.S',
+script = GLAPI + 'gen/gl_x86-64_asm.py',
+ 

Re: [Mesa-dev] Fw: [Intel-gfx] [PATCH] intel: add a timed wait function

2012-05-30 Thread Daniel Vetter
On Wed, May 30, 2012 at 7:41 PM, Eric Anholt  wrote:
> I guess GL_ALREADY_SIGNALED handling will be done using a check for
> bo_busy() before calling this.

I've just read through the mesa code and gl_already_signalled seems to
be handled already by core mesa code in _mesa_ClientWaitSync (if the
driver sets syncObject->Status correctly). So I guess the current
kernel code should work as-is and only the libdrm interface needs some
colour adjustments around the timeout parameter.
-Daniel
-- 
Daniel Vetter
daniel.vet...@ffwll.ch - +41 (0) 79 364 57 48 - http://blog.ffwll.ch
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 50480] Commit f9d1562 breaks x86 build after x86_64 build

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50480

--- Comment #4 from Droste  2012-05-30 12:13:13 PDT ---
Created attachment 62299
  --> https://bugs.freedesktop.org/attachment.cgi?id=62299
Patch to make 'make clean' work again

This would fix the problem, but I'm not sure if it's supposed to work this way
with automake or if this is just a workaround

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- 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] softpipe: Fix everything that is wrong with clipping and interpolation.

2012-05-30 Thread Olivier Galibert
On Wed, May 30, 2012 at 11:38:06AM +0100, Dave Airlie wrote:
> Have you checked llvmpipe with this? since it might need changes to go
> along with this.

It didn't look like llvmpipe was going anywhere near that.  OTOH, a
piglit run of llvmpipe I just did on the place gave me zero errors in
that area (including int interpolation if you can believe it) which
left me somewhat surprised.  I didn't think it was working correctly
in the first place...  It was failing in other places due to f.i. the
lack of support for anything other than z24s8, so I didn't hit
softpipe by mistake, I think.


> Also a count of piglit tests if fixes in the commit might be good.

That's going to take a little more time, given my trees are
accumulating not-yet-commited fixes.

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


Re: [Mesa-dev] [PATCH] softpipe: Fix everything that is wrong with clipping and interpolation.

2012-05-30 Thread Olivier Galibert
On Wed, May 30, 2012 at 07:32:16AM -0600, Brian Paul wrote:
> All the code above could use more comments.  Otherwise it takes some 
> pretty intense studying to understand what's going on there.

Ok, I'll take that into account (and the previous comments too).

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


Re: [Mesa-dev] [Intel-gfx] [PATCH] intel: add a timed wait function

2012-05-30 Thread Ben Widawsky
On Wed, 30 May 2012 21:07:57 +0200
Daniel Vetter  wrote:

> On Wed, May 30, 2012 at 7:41 PM, Eric Anholt  wrote:
> > I guess GL_ALREADY_SIGNALED handling will be done using a check for
> > bo_busy() before calling this.
> 
> I've just read through the mesa code and gl_already_signalled seems to
> be handled already by core mesa code in _mesa_ClientWaitSync (if the
> driver sets syncObject->Status correctly). So I guess the current
> kernel code should work as-is and only the libdrm interface needs some
> colour adjustments around the timeout parameter.
> -Daniel

What have we all agreed on for the color?

-- 
Ben Widawsky, Intel Open Source Technology Center
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] automake: Connect the libdricore target to make clean.

2012-05-30 Thread Eric Anholt
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50480
---
 src/mesa/Makefile |1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index 741ca0f..845b524 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -232,6 +232,7 @@ clean:
-@cd drivers/osmesa && $(MAKE) clean
-@cd x86 && $(MAKE) clean
-@cd x86-64 && $(MAKE) clean
+   -@cd libdricore && $(MAKE) clean
 
 
 -include $(DEPENDS)
-- 
1.7.10

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


[Mesa-dev] [Bug 43629] mesa># gmake freebsd-dri-amd64 breaks

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=43629

Eric Anholt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||NOTABUG

--- Comment #6 from Eric Anholt  2012-05-30 14:01:12 PDT ---
The old static configs like freebsd-* are deprecated and about to be removed. 
You should use just ./autogen.sh (which it sounds like you are in later
comments) and then "make".  The original error report is just one of the
reasons we're removing the old static configs.

Re: comment 4, the list of dri drivers defaults to a particular set, then the
requirements for those are tested for with errors if they're missing.  The
assumption here is that this is better for the user than quietly not building a
driver they may care about when the libdrm requirement gets increased.  To
disable a driver you don't care for, you can use something explicit like
"--with-dri-drivers=swrast,i915,i965,radeon" and
"--with-gallium-drivers=swrast,r600,r300".

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- 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 50482] git mesa fails to build

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50482

--- Comment #1 from Eric Anholt  2012-05-30 14:02:31 PDT ---
Can you provide your ./configure arguments so we can maybe reproduce the
failure?  Do you have a range of commits for when the breakage was?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- 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 50480] Commit f9d1562 breaks x86 build after x86_64 build

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50480

--- Comment #5 from Eric Anholt  2012-05-30 14:17:53 PDT ---
Proposed patch:

http://lists.freedesktop.org/archives/mesa-dev/2012-May/022402.html

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] softpipe: Fix everything that is wrong with clipping and interpolation.

2012-05-30 Thread Olivier Galibert
This includes:
- picking up correctly which attributes are flatshaded and which are
  noperspective

- copying the flatshaded attributes when needed, including the
  non-built-in ones

- correctly interpolating the noperspective attributes in screen-space
  instead than in a 3d-correct fashion.

Signed-off-by: Olivier Galibert 
---
 src/gallium/auxiliary/draw/draw_pipe_clip.c |  144 +--
 1 file changed, 113 insertions(+), 31 deletions(-)

I've kicked the f_nopersp computation up so that it's always
evaluated, and I've added a bunch of comments.

Every generated interpolation test in piglit pass for both softpipe
and llvmpipe at that point (after forcing llvmpipe to GLSL 1.30 of
course).

diff --git a/src/gallium/auxiliary/draw/draw_pipe_clip.c 
b/src/gallium/auxiliary/draw/draw_pipe_clip.c
index 4da4d65..2d36eb3 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_clip.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_clip.c
@@ -39,6 +39,7 @@
 
 #include "draw_vs.h"
 #include "draw_pipe.h"
+#include "draw_fs.h"
 
 
 #ifndef IS_NEGATIVE
@@ -56,11 +57,12 @@
 struct clip_stage {
struct draw_stage stage;  /**< base class */
 
-   /* Basically duplicate some of the flatshading logic here:
-*/
-   boolean flat;
-   uint num_color_attribs;
-   uint color_attribs[4];  /* front/back primary/secondary colors */
+   /* List of the attributes to be flatshaded. */
+   uint num_flat_attribs;
+   uint flat_attribs[PIPE_MAX_SHADER_OUTPUTS];
+
+   /* Mask of attributes in noperspective mode */
+   boolean noperspective_attribs[PIPE_MAX_SHADER_OUTPUTS];
 
float (*plane)[4];
 };
@@ -91,17 +93,16 @@ static void interp_attr( float dst[4],
 
 
 /**
- * Copy front/back, primary/secondary colors from src vertex to dst vertex.
- * Used when flat shading.
+ * Copy flat shaded attributes src vertex to dst vertex.
  */
-static void copy_colors( struct draw_stage *stage,
-struct vertex_header *dst,
-const struct vertex_header *src )
+static void copy_flat( struct draw_stage *stage,
+   struct vertex_header *dst,
+   const struct vertex_header *src )
 {
const struct clip_stage *clipper = clip_stage(stage);
uint i;
-   for (i = 0; i < clipper->num_color_attribs; i++) {
-  const uint attr = clipper->color_attribs[i];
+   for (i = 0; i < clipper->num_flat_attribs; i++) {
+  const uint attr = clipper->flat_attribs[i];
   COPY_4FV(dst->data[attr], src->data[attr]);
}
 }
@@ -120,6 +121,7 @@ static void interp( const struct clip_stage *clip,
const unsigned pos_attr = 
draw_current_shader_position_output(clip->stage.draw);
const unsigned clip_attr = 
draw_current_shader_clipvertex_output(clip->stage.draw);
unsigned j;
+   float t_nopersp;
 
/* Vertex header.
 */
@@ -148,12 +150,36 @@ static void interp( const struct clip_stage *clip,
   dst->data[pos_attr][2] = pos[2] * oow * scale[2] + trans[2];
   dst->data[pos_attr][3] = oow;
}
+   
+   /**
+* Compute the t in screen-space instead of 3d space to use
+* for noperspective interpolation.
+*
+* The points can be aligned with the X axis, so in that case try
+* the Y.  When both points are at the same screen position, we can
+* pick whatever value (the interpolated point won't be in front
+* anyway), so just use the 3d t.
+*/
+   {
+  int k;
+  t_nopersp = t;
+  for (k = 0; k < 2; k++)
+ if (in->data[pos_attr][k] != out->data[pos_attr][k]) {
+t_nopersp = (dst->data[pos_attr][k] - out->data[pos_attr][k]) /
+   (in->data[pos_attr][k] - out->data[pos_attr][k]);
+break;
+ }
+   }
 
/* Other attributes
 */
for (j = 0; j < nr_attrs; j++) {
-  if (j != pos_attr && j != clip_attr)
-interp_attr(dst->data[j], t, in->data[j], out->data[j]);
+  if (j != pos_attr && j != clip_attr) {
+ if (clip->noperspective_attribs[j])
+interp_attr(dst->data[j], t_nopersp, in->data[j], out->data[j]);
+ else
+interp_attr(dst->data[j], t, in->data[j], out->data[j]);
+  }
}
 }
 
@@ -406,14 +432,14 @@ do_clip_tri( struct draw_stage *stage,
/* If flat-shading, copy provoking vertex color to polygon vertex[0]
 */
if (n >= 3) {
-  if (clipper->flat) {
+  if (clipper->num_flat_attribs) {
  if (stage->draw->rasterizer->flatshade_first) {
 if (inlist[0] != header->v[0]) {
assert(tmpnr < MAX_CLIPPED_VERTICES + 1);
if (tmpnr >= MAX_CLIPPED_VERTICES + 1)
   return;
inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
-   copy_colors(stage, inlist[0], header->v[0]);
+   copy_flat(stage, inlist[0], header->v[0]);
 }
  }
  else {
@@ -422,7 +448,7 @@ do_clip_tri( struct draw_stage *stage,
if (tmpnr >= MAX_CLIPPED_VERTICES + 1)
   

Re: [Mesa-dev] [PATCH 20/26] mesa/tests: Add tests for the generated dispatch table

2012-05-30 Thread Eric Anholt
On Tue, 29 May 2012 15:51:47 -0700, "Ian Romanick"  wrote:
> +TEST(GetProcAddress, ABINameByOffset)
> +{
> +   /* 408 functions have had their locations in the dispatch table set since
> +* the danw of time.  Verify that all of these functions are at the 
> correct
 ^dawn

(also copy and pasted)

I don't like the "as big as at some git sha1" test given that you
immediately go on to show that the test is invalid and just hack around
it.  That sounds to me like "this test should be removed".  Maybe just
check that it's bigger than the fixed ABI?


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


Re: [Mesa-dev] Fw: [Intel-gfx] [PATCH] intel: add a timed wait function

2012-05-30 Thread Eric Anholt
On Wed, 30 May 2012 21:07:57 +0200, Daniel Vetter  wrote:
> On Wed, May 30, 2012 at 7:41 PM, Eric Anholt  wrote:
> > I guess GL_ALREADY_SIGNALED handling will be done using a check for
> > bo_busy() before calling this.
> 
> I've just read through the mesa code and gl_already_signalled seems to
> be handled already by core mesa code in _mesa_ClientWaitSync (if the
> driver sets syncObject->Status correctly). So I guess the current
> kernel code should work as-is and only the libdrm interface needs some
> colour adjustments around the timeout parameter.

Yeah, matches what I found.

Did you want pointer for timeout in the userspace api?  I don't feel
strongly about it, I just didn't see a use.  The equivalent API I could
think of was select(), where apparently linux returns time unwaited,
while "everyone else" doesn't.  I don't see a strong recommendation
either way from that.



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


[Mesa-dev] [PATCH] svga: fix saturated TEX instructions

2012-05-30 Thread Brian Paul
TEX instructions can't do saturation.  Do the TEX into a temp reg w/out
saturation, then do a MOV_SAT.
---
 src/gallium/drivers/svga/svga_tgsi_insn.c |   19 +--
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c 
b/src/gallium/drivers/svga/svga_tgsi_insn.c
index a689126..64dfa55 100644
--- a/src/gallium/drivers/svga/svga_tgsi_insn.c
+++ b/src/gallium/drivers/svga/svga_tgsi_insn.c
@@ -1628,10 +1628,12 @@ static boolean emit_tex(struct svga_shader_emitter 
*emit,
   emit->key.fkey.tex[unit].swizzle_b != PIPE_SWIZZLE_BLUE 
||
   emit->key.fkey.tex[unit].swizzle_a != 
PIPE_SWIZZLE_ALPHA);
 
-   /* If doing compare processing or tex swizzle, need to put fetched color 
into
-* a temporary so it can be used as a source later on.
+   boolean saturate = insn->Instruction.Saturate != TGSI_SAT_NONE;
+
+   /* If doing compare processing or tex swizzle or saturation, we need to put
+* the fetched color into a temporary so it can be used as a source later 
on.
 */
-   if (compare || swizzle) {
+   if (compare || swizzle || saturate) {
   tex_result = get_temp( emit );
}
else {
@@ -1658,7 +1660,7 @@ static boolean emit_tex(struct svga_shader_emitter *emit,
if (compare) {
   SVGA3dShaderDestToken dst2;
 
-  if (swizzle)
+  if (swizzle || saturate)
  dst2 = tex_result;
   else
  dst2 = dst;
@@ -1710,8 +1712,13 @@ static boolean emit_tex(struct svga_shader_emitter *emit,
   }
}
 
-   if (swizzle) {
-  /* swizzle from tex_result to dst */
+   if (saturate && !swizzle) {
+  /* MOV_SAT real_dst, dst */
+  if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), dst, src(tex_result) 
))
+ return FALSE;
+   }
+   else if (swizzle) {
+  /* swizzle from tex_result to dst (handles saturation too, if any) */
   emit_tex_swizzle(emit,
dst, src(tex_result),
emit->key.fkey.tex[unit].swizzle_r,
-- 
1.7.3.4

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


[Mesa-dev] [Bug 50480] Commit f9d1562 breaks x86 build after x86_64 build

2012-05-30 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=50480

Droste  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED

--- Comment #6 from Droste  2012-05-30 16:08:37 PDT ---
yes, that does fix the problem

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- 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] automake: Connect the libdricore target to make clean.

2012-05-30 Thread Kenneth Graunke
On 05/30/2012 01:53 PM, Eric Anholt wrote:
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50480
> ---
>  src/mesa/Makefile |1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/mesa/Makefile b/src/mesa/Makefile
> index 741ca0f..845b524 100644
> --- a/src/mesa/Makefile
> +++ b/src/mesa/Makefile
> @@ -232,6 +232,7 @@ clean:
>   -@cd drivers/osmesa && $(MAKE) clean
>   -@cd x86 && $(MAKE) clean
>   -@cd x86-64 && $(MAKE) clean
> + -@cd libdricore && $(MAKE) clean
>  
>  
>  -include $(DEPENDS)

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 1/8] automake: Remove the old static configs system.

2012-05-30 Thread Kenneth Graunke
On 05/30/2012 10:56 AM, Eric Anholt wrote:
> With the incremental automake conversion, we'd broken those that
> included glx or egl.

Patches 1-5 and 8 are:
Reviewed-by: Kenneth Graunke 

I'm a bit confused about the dricore stuff.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] automake: Add AM_PROG_AR before LT_INIT to silence a lot of warnings.

2012-05-30 Thread Kenneth Graunke
Signed-off-by: Kenneth Graunke 
---
 configure.ac |2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure.ac b/configure.ac
index 9fb8149..9d22451 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,8 @@ echo \#buildapi-variable-no-builddir >/dev/null
 # to make
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+AM_PROG_AR
+
 LT_PREREQ([2.2])
 LT_INIT([disable-static])
 
-- 
1.7.10.3

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


[Mesa-dev] [PATCH] automake: use -m32 in CCASFLAGS when using --enable-32-bit

2012-05-30 Thread Tapani Pälli
this fixes libdricore directory build with --enable-32-bit on a x86_64 system

Signed-off-by: Tapani Pälli 
---
 configure.ac |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9fb8149..cb96d46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -271,6 +271,7 @@ if test "x$enable_32bit" = xyes; then
 if test "x$GCC" = xyes; then
 CFLAGS="$CFLAGS -m32"
 ARCH_FLAGS="$ARCH_FLAGS -m32"
+   CCASFLAGS="$CCASFLAGS -m32"
 fi
 if test "x$GXX" = xyes; then
 CXXFLAGS="$CXXFLAGS -m32"
-- 
1.7.7.6

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