[Mesa-dev] [Bug 40448] New: Unigine Sanctuary: window disappear when changing settings

2011-08-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=40448

   Summary: Unigine Sanctuary: window disappear when changing
settings
   Product: Mesa
   Version: git
  Platform: Other
   URL: http://unigine.com/products/sanctuary/
OS/Version: All
Status: NEW
  Keywords: regression
  Severity: normal
  Priority: medium
 Component: Mesa core
AssignedTo: mesa-dev@lists.freedesktop.org
ReportedBy: pavel.ondra...@email.cz
CC: jbar...@virtuousgeek.org


When changing some settings in Unigine that causes the engine to restart itself
(for example shaders quality) after restart the Unigine window disappear. It is
still running just there is no window any more. 

4df137691ee29bb812347fa2c5f19095243ede22 is the first bad commit
commit 4df137691ee29bb812347fa2c5f19095243ede22
Author: Jesse Barnes 
Date:   Fri May 6 10:31:24 2011 -0700

GLX/DRI2: handle swap event swap count wrapping

Create a new GLX drawable struct to track client related info, and add a
wrap counter to it drawable and track it as we receive events.  This
allows us to support the full 64 bits of the event structure we pass to
the client even though the server only gives us a 32 bit count.

Reviewed-by: Michel Dänzer 
Reviewed-by: Jeremy Huddleston 
Signed-off-by: Jesse Barnes 

I'm not 100% sure about this commit since the issue is not always reproducible,
but it seems likely this can be it.

This is with r300g driver, RV530 card. Assigning to mesa core because of the
bisect results, I did try the llvmpipe, to see if other drivers are also
affected, however it is so slow here I can't change any settings.

Mesa: 110f846c2578357ebee4e6fab7d71e0e496493d3
GPU: RV530
Kernel: 2.6.40.3-0.fc15.i686 (probably renamed 3.0.3 for some reason)
Xserver: 1.10.3

-- 
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 2/3] xorg/xvmc: Only set decode buffer when available

2011-08-29 Thread Christian König
Am Montag, den 29.08.2011, 00:36 -0400 schrieb Younes Manton:
[snip]
> Well, that was what the last discussion was all about, whether or not
> decode buffers should be handled internally by each driver or
> externally. It was decided to handle it externally, to simplify life
> for drivers that want/need multiple buffers and to keep most of the
> ugliness in XvMC, since VDPAU and VA don't have the same kinds of
> problems.
> 
> Anyway, your patch is cleaner for the driver that doesn't want to
> support multiple decode buffers, but now every state tracker has to
> deal with drivers with decode buffers and drivers without, and we have
> to do these if checks at init/cleanup and every frame. The alternative
> is that you support create_buffer, etc, and just return the same
> decode buffer each time, and if you don't want to bother creating a
> new type to represent a decode buffer you can just return anything
> non-null, like the decoder itself, and just implement the other
> functions as emty no-ops, that way the state trackers only have to
> deal with one interface.
> 
> Anyway, I don't have a strong preference either way, and since we
> currently only have 2 drivers and 2 state trackers, it doesn't matter
> much. I'll push this in a couple of days if no other comments.
I have implementing the vaapi state tracker on my todo list, but not as
with very high priority. So we would end up with 3 state tracker and 2
drivers, but honestly my preferences aren't going strongly into the one
or another preference either.

So I think it is ok to push the patch as it is, since it doesn't make so
much of a difference.

Christian.

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


Re: [Mesa-dev] [PATCH 3/3] xorg/xvmc: Add missing call to set_picture_parameters

2011-08-29 Thread Christian König
Am Sonntag, den 28.08.2011, 19:13 +0200 schrieb Maarten Lankhorst:
> Hey,
> 
> On 08/28/2011 05:04 PM, Christian König wrote:
> > Hi Maarten,
> >
> > could you put this into SetDecoderStatus instead? This makes the picture
> > structure also available in end_frame.
> Erm it doesn't make sense there. It might make sense to move it to after
> the begin_frame though, but with interlaced frames I don't see why you
> would want to move it into SetDecoderStatus, since you could have interlaced
> frames with different picture_structures.
Oh, what I wanted to say is: Remember the picture structure in use when
begin_frame is called and just set it to the same value when end_frame
is called. Also having a end_frame/begin_frame when the picture
structure changes from top to bottom (or the other way around) couldn't
hurt also.

Christian.

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


Re: [Mesa-dev] [PATCH] winsys/radeon: Create async thread only once

2011-08-29 Thread Christian König
I haven't really tested this, so please speak up if anybody finds any
regression, but I'm going to push this if there are no objections.

Beside being a real killer for performance, the whole "[New Thread
0x7fffe60fb700 (LWP 5212)]/[Thread 0x7fffe60fb700 (LWP 5212) exited]" in
gdb is quite annoying.

Christian.

Am Samstag, den 27.08.2011, 22:57 +0200 schrieb Maarten Lankhorst:
> I noticed that a thread was created for every time async flush was called, so 
> I moved it and used some semaphores to synch.
> 
> Signed-off-by: Maarten Lankhorst 
> 
> ---
> diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c 
> b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
> index c309354..dd3a4a3 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
> +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
> @@ -130,6 +130,9 @@ static void radeon_destroy_cs_context(struct 
> radeon_cs_context *csc)
>  FREE(csc->relocs);
>  }
>  
> +DEBUG_GET_ONCE_BOOL_OPTION(thread, "RADEON_THREAD", TRUE)
> +static PIPE_THREAD_ROUTINE(radeon_drm_cs_emit_ioctl, param);
> +
>  static struct radeon_winsys_cs *radeon_drm_cs_create(struct radeon_winsys 
> *rws)
>  {
>  struct radeon_drm_winsys *ws = radeon_drm_winsys(rws);
> @@ -139,6 +142,8 @@ static struct radeon_winsys_cs 
> *radeon_drm_cs_create(struct radeon_winsys *rws)
>  if (!cs) {
>  return NULL;
>  }
> +pipe_semaphore_init(&cs->flush_queued, 0);
> +pipe_semaphore_init(&cs->flush_completed, 0);
>  
>  cs->ws = ws;
>  
> @@ -158,6 +163,8 @@ static struct radeon_winsys_cs 
> *radeon_drm_cs_create(struct radeon_winsys *rws)
>  cs->base.buf = cs->csc->buf;
>  
>  p_atomic_inc(&ws->num_cs);
> +if (cs->ws->num_cpus > 1 && debug_get_option_thread())
> +cs->thread = pipe_thread_create(radeon_drm_cs_emit_ioctl, cs);
>  return &cs->base;
>  }
>  
> @@ -357,9 +364,8 @@ static void radeon_drm_cs_write_reloc(struct 
> radeon_winsys_cs *rcs,
>  OUT_CS(&cs->base, index * RELOC_DWORDS);
>  }
>  
> -static PIPE_THREAD_ROUTINE(radeon_drm_cs_emit_ioctl, param)
> +static void radeon_drm_cs_emit_ioctl_oneshot(struct radeon_cs_context *csc)
>  {
> -struct radeon_cs_context *csc = (struct radeon_cs_context*)param;
>  unsigned i;
>  
>  if (drmCommandWriteRead(csc->fd, DRM_RADEON_CS,
> @@ -381,20 +387,32 @@ static PIPE_THREAD_ROUTINE(radeon_drm_cs_emit_ioctl, 
> param)
>  p_atomic_dec(&csc->relocs_bo[i]->num_active_ioctls);
>  
>  radeon_cs_context_cleanup(csc);
> +}
> +
> +static PIPE_THREAD_ROUTINE(radeon_drm_cs_emit_ioctl, param)
> +{
> +struct radeon_drm_cs *cs = (struct radeon_drm_cs*)param;
> +
> +while (1) {
> +pipe_semaphore_wait(&cs->flush_queued);
> +if (cs->kill_thread)
> +break;
> +radeon_drm_cs_emit_ioctl_oneshot(cs->cst);
> +pipe_semaphore_signal(&cs->flush_completed);
> +}
> +pipe_semaphore_signal(&cs->flush_completed);
>  return NULL;
>  }
>  
>  void radeon_drm_cs_sync_flush(struct radeon_drm_cs *cs)
>  {
>  /* Wait for any pending ioctl to complete. */
> -if (cs->thread) {
> -pipe_thread_wait(cs->thread);
> -cs->thread = 0;
> +if (cs->thread && cs->flush_started) {
> +pipe_semaphore_wait(&cs->flush_completed);
> +cs->flush_started = 0;
>  }
>  }
>  
> -DEBUG_GET_ONCE_BOOL_OPTION(thread, "RADEON_THREAD", TRUE)
> -
>  static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs, unsigned flags)
>  {
>  struct radeon_drm_cs *cs = radeon_drm_cs(rcs);
> @@ -402,33 +420,33 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs 
> *rcs, unsigned flags)
>  
>  radeon_drm_cs_sync_flush(cs);
>  
> +/* Flip command streams. */
> +tmp = cs->csc;
> +cs->csc = cs->cst;
> +cs->cst = tmp;
> +
>  /* If the CS is not empty, emit it in a newly-spawned thread. */
>  if (cs->base.cdw) {
> -unsigned i, crelocs = cs->csc->crelocs;
> +unsigned i, crelocs = cs->cst->crelocs;
>  
> -cs->csc->chunks[0].length_dw = cs->base.cdw;
> +cs->cst->chunks[0].length_dw = cs->base.cdw;
>  
>  for (i = 0; i < crelocs; i++) {
>  /* Update the number of active asynchronous CS ioctls for the 
> buffer. */
> -p_atomic_inc(&cs->csc->relocs_bo[i]->num_active_ioctls);
> +p_atomic_inc(&cs->cst->relocs_bo[i]->num_active_ioctls);
>  }
>  
> -if (cs->ws->num_cpus > 1 && debug_get_option_thread() &&
> +if (cs->thread &&
>  (flags & RADEON_FLUSH_ASYNC)) {
> -cs->thread = pipe_thread_create(radeon_drm_cs_emit_ioctl, 
> cs->csc);
> -assert(cs->thread);
> +cs->flush_started = 1;
> +pipe_semaphore_signal(&cs->flush_queued);
>  } else {
> -radeon_drm_cs_emit_ioctl(cs->csc);
> +radeon_drm_cs_emit_ioctl_oneshot(cs->cst);
>  }
>  } else {
> -radeon_cs_context_cleanup(cs->csc);
> +radeon_cs_cont

Re: [Mesa-dev] [PATCH 7/7] g3dvl: Rewrite the mpeg 1&2 bitstream parser

2011-08-29 Thread Christian König
Am Sonntag, den 28.08.2011, 18:55 +0100 schrieb Andy Furniss:
> deathsim...@vodafone.de wrote:
> > From: Christian König
> >
> > Based on work of Maarten Lankhorst this time.
> 
> I am getting new artifacts on r600 and softpipe (ignoring all the other 
> issues it has) when using -vc ffmpeg12vdpau, -vo vdpau alone or xvmc are 
> unaffected.
> 
> Some streams don't show it at all eg. Pendulum, other SD it may be very 
> transient/brief affecting only the last macroblock.
> HD streams also vary but the corruption I've seen so far has always been 
> limited to the bottom row.
> 
> http://www.w6rz.net/vertpix1.zip
> 
> is the worse I've seen so far.
Thanks to you once more, it was just looking at the bytes left in the
buffer, but not the bits! So we ended up not decoding the last 32 bits
of a buffer.

I just pushed a fix, and I'm really wondering where the heck do you get
all those nice test videos.

Christian.

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


[Mesa-dev] [Bug 40401] Cogs is slow

2011-08-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=40401

--- Comment #11 from Tobias Jakobi  2011-08-29 02:03:49 
PDT ---
(In reply to comment #10)
> But the problem maybe is in the same component for the Intel drivers side.
i965 is not using gallium, so no.

-- 
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] winsys/radeon: Create async thread only once

2011-08-29 Thread Michel Dänzer
On Sam, 2011-08-27 at 22:57 +0200, Maarten Lankhorst wrote: 
> @@ -402,33 +420,33 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs 
> *rcs, unsigned flags)
>  
>  radeon_drm_cs_sync_flush(cs);
>  
> +/* Flip command streams. */
> +tmp = cs->csc;
> +cs->csc = cs->cst;
> +cs->cst = tmp;
> +
>  /* If the CS is not empty, emit it in a newly-spawned thread. */

The 'newly-spawned' in this comment is no longer accurate, is it?
Otherwise looks good to me.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast |  Debian, X and DRI developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] OpenGL to DirectX with Mesa3D

2011-08-29 Thread Jose Fonseca


- Original Message -
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On 08/25/2011 10:55 AM, Anonimo Veneziano wrote:
> > Hi all
> > I am a programmer but not very skilled in 3D graphics (so pardon me
> > if I
> > write something wrong).
> > I need to build my own opengl32.dll to redirect my OpenGL
> > application
> > calls to DirectX (better if 10 or 11, but 9 could be ok too)
> > TitaniumGL and 3DAnalyzer dont work for my case (already tested,
> > application crashes).
> > 1. Do you know if some other OpenGL->DirectX converter exist that I
> > could use?
> >  
> > I am trying to use Mesa3D v7.10.3, and in particular I found
> > GLDirect
> > very interesting, but I am not able to get it compiled with dx9. I
> > see
> > it has been changed since GLDirect 5.0.2 old released version (that
> > is
> > of no use for me, it's opengl 1.1).
> > So in Mesa v7.10.3 I tried to compile GLDirect and fixed some
> > errors but
> > at the moment I had some errors I cannot fix compiling
> > "gld_primitive_dx9.c" and "gld_texture_dx9.c":
> > for example in the first file the structures SWvertex (from
> > swrast.h)
> > and gl_context (from mtypes.h) seems different from those defined
> > in Mesa,
> > 2. Did someone compile GLDirect in Mesa 7.10.3? Can you help me to
> > do it?
> >  
> > 3. Could Gallium help me in some way? I am not sure to have
> > understood
> > well it...
> >  
> > Many thanks in advance and sorry to have bothered you but I am in a
> > hurry on a project and hope to get some solution!
> 
> The GLDirect stuff is really, really dead.  It hasn't been maintained
> in
> years, and it probably hasn't been able to compile in just about as
> long.  Moreover, as per discussions in another thread
> (http://marc.info/?l=mesa3d-dev&m=131421311903781&w=2), this code is
> literally minutes from being deleted.

That's my understanding too. It only did basic (fixed function?) GL to DX7 or 
8, so is both unmaintained and uterl useless for most nowawadays applications.

> Since the internal Gallium interface is essentially a clone of the
> DX10
> interface, it should be trivial to make a Gallium DX10 driver.  Note
> that this is different from a DX10 state tracker (this is the
> top-half
> layer that makes a particular API available to applications).
> 
> One of the Gallium guys should know more...

Gallium is inspired in DX10 but it is a superset, so there's still the task of 
translating the superset bits that are not in DX10.

There's also the svga pipe driver which follow DX9 semantics closely.

Either way, although gallium code base could help kickstarting a GL -> DX 
converter, making a solid GL -> DX converter is a huge endeaveour, even by an 
developer familiar with both set of APIs.

I'd agree that an actively maintained project with that goal in mind, such as 
Angle, as a better bet.

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


[Mesa-dev] [PATCH] r600g: Make unaligned 3D textures work on +evergreen

2011-08-29 Thread deathsimple
From: Christian König 

The layersize calculation is slightly different on +evergreen.
This makes mpeg2 video decoding and piglits texture-packed-formats
test work correctly on this hardware.
---
 src/gallium/drivers/r600/r600_texture.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_texture.c 
b/src/gallium/drivers/r600/r600_texture.c
index 7c1bd9d..e5783b9 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -262,7 +262,11 @@ static void r600_setup_miptree(struct pipe_screen *screen,
nblocksx = r600_texture_get_nblocksx(screen, rtex, i);
nblocksy = r600_texture_get_nblocksy(screen, rtex, i);
 
-   layer_size = nblocksx * nblocksy * blocksize;
+   if (chipc >= EVERGREEN && array_mode == 
V_038000_ARRAY_LINEAR_GENERAL)
+   layer_size = align(nblocksx, 64) * nblocksy * blocksize;
+   else
+   layer_size = nblocksx * nblocksy * blocksize;
+
if (ptex->target == PIPE_TEXTURE_CUBE) {
if (chipc >= R700)
size = layer_size * 8;
-- 
1.7.4.1

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


[Mesa-dev] [Bug 40401] Cogs is slow

2011-08-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=40401

--- Comment #12 from imamdxl8...@gmail.com 2011-08-29 04:54:26 PDT ---
(In reply to comment #11)
> (In reply to comment #10)
> > But the problem maybe is in the same component for the Intel drivers side.
> i965 is not using gallium, so no.

Sorry, I meant u_vbuf_manager equivalent component in the i965 driver not in
gallium

-- 
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] driconf: Added german translation

2011-08-29 Thread Lauri Kasanen
On Sun, 28 Aug 2011 14:55:56 +0200
Carl-Philip Haensch  wrote:
> > It looks to me you wrote the translations in the result file; the   
> > Makefile says you should be editing the .po file, and options.h   
> > would autogenerate from that.
> >
> > - Lauri
> >
> 
> Whats the proper tool to auto generate the new entries in the .po file  
> from t_options.h?

The Makefile in that dir says to "make po".

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


[Mesa-dev] [PATCH 1/2] tgsi: add support for texture offsets to the TGSI IR.

2011-08-29 Thread Dave Airlie
From: Dave Airlie 

This adds tokens for texture offsets, to store 4 * swizzled vec 3
for use in TXF and other opcodes.

It also contains TGSI exec changes for softpipe to use this code,
along with GLSL->TGSI support for TXF.

Signed-off-by: Dave Airlie 
---
 src/gallium/auxiliary/tgsi/tgsi_build.c  |   64 -
 src/gallium/auxiliary/tgsi/tgsi_dump.c   |   11 
 src/gallium/auxiliary/tgsi/tgsi_exec.c   |   22 -
 src/gallium/auxiliary/tgsi/tgsi_exec.h   |3 +-
 src/gallium/auxiliary/tgsi/tgsi_parse.c  |3 +
 src/gallium/auxiliary/tgsi/tgsi_parse.h  |2 +
 src/gallium/auxiliary/tgsi/tgsi_ureg.c   |   24 +-
 src/gallium/auxiliary/tgsi/tgsi_ureg.h   |   12 -
 src/gallium/docs/source/tgsi.rst |   13 -
 src/gallium/drivers/softpipe/sp_tex_sample.c |   17 +--
 src/gallium/include/pipe/p_shader_tokens.h   |   11 -
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp   |   47 ++-
 src/mesa/state_tracker/st_mesa_to_tgsi.c |1 +
 13 files changed, 208 insertions(+), 22 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c 
b/src/gallium/auxiliary/tgsi/tgsi_build.c
index 269940e..56491c9 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_build.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_build.c
@@ -631,7 +631,7 @@ tgsi_default_instruction_texture( void )
struct tgsi_instruction_texture instruction_texture;
 
instruction_texture.Texture = TGSI_TEXTURE_UNKNOWN;
-   instruction_texture.Padding = 0;
+   instruction_texture.NumOffsets = 0;
 
return instruction_texture;
 }
@@ -639,6 +639,7 @@ tgsi_default_instruction_texture( void )
 static struct tgsi_instruction_texture
 tgsi_build_instruction_texture(
unsigned texture,
+   unsigned num_offsets,
struct tgsi_token *prev_token,
struct tgsi_instruction *instruction,
struct tgsi_header *header )
@@ -646,7 +647,7 @@ tgsi_build_instruction_texture(
struct tgsi_instruction_texture instruction_texture;
 
instruction_texture.Texture = texture;
-   instruction_texture.Padding = 0;
+   instruction_texture.NumOffsets = num_offsets;
instruction->Texture = 1;
 
instruction_grow( instruction, header );
@@ -654,6 +655,41 @@ tgsi_build_instruction_texture(
return instruction_texture;
 }
 
+
+static struct tgsi_texture_offset
+tgsi_default_texture_offset( void )
+{
+   struct tgsi_texture_offset instruction_texture_offset;
+
+   instruction_texture_offset.Index = 0;
+   instruction_texture_offset.File = 0;
+   instruction_texture_offset.SwizzleX = 0;
+   instruction_texture_offset.SwizzleY = 0;
+   instruction_texture_offset.SwizzleZ = 0;
+
+   return instruction_texture_offset;
+}
+
+static struct tgsi_texture_offset
+tgsi_build_texture_offset(
+   int index, int file, int swizzle_x, int swizzle_y, int swizzle_z,
+   struct tgsi_token *prev_token,
+   struct tgsi_instruction *instruction,
+   struct tgsi_header *header )
+{
+   struct tgsi_texture_offset texture_offset;
+
+   texture_offset.Index = index;
+   texture_offset.File = file;
+   texture_offset.SwizzleX = swizzle_x;
+   texture_offset.SwizzleY = swizzle_y;
+   texture_offset.SwizzleZ = swizzle_z;
+
+   instruction_grow( instruction, header );
+
+   return texture_offset;
+}
+
 static struct tgsi_src_register
 tgsi_default_src_register( void )
 {
@@ -825,6 +861,9 @@ tgsi_default_full_instruction( void )
full_instruction.Predicate = tgsi_default_instruction_predicate();
full_instruction.Label = tgsi_default_instruction_label();
full_instruction.Texture = tgsi_default_instruction_texture();
+   for( i = 0;  i < TGSI_FULL_MAX_TEX_OFFSETS; i++ ) {
+  full_instruction.TexOffsets[i] = tgsi_default_texture_offset();
+   }
for( i = 0;  i < TGSI_FULL_MAX_DST_REGISTERS; i++ ) {
   full_instruction.Dst[i] = tgsi_default_full_dst_register();
}
@@ -908,12 +947,31 @@ tgsi_build_full_instruction(
 
   *instruction_texture = tgsi_build_instruction_texture(
  full_inst->Texture.Texture,
+full_inst->Texture.NumOffsets,
  prev_token,
  instruction,
  header   );
   prev_token = (struct tgsi_token  *) instruction_texture;
-   }
 
+  for (i = 0; i < full_inst->Texture.NumOffsets; i++) {
+ struct tgsi_texture_offset *texture_offset;
+   
+ if ( maxsize <= size )
+return 0;
+texture_offset = (struct tgsi_texture_offset *)&tokens[size];
+ size++;
+ *texture_offset = tgsi_build_texture_offset(
+full_inst->TexOffsets[i].Index,
+full_inst->TexOffsets[i].File,
+full_inst->TexOffsets[i].SwizzleX,
+full_inst->TexOffsets[i].SwizzleY,
+full_inst->TexOffsets[i].SwizzleZ,
+prev_token,
+instruction,
+header);
+ prev_token = (struct tgsi_token *) texture_offset;
+  }
+   }
for( i = 0;  i <   full_inst->Instruction.NumDstRegs; i++ ) {
   const str

[Mesa-dev] [PATCH 2/2] gallium: add caps for MIN/MAX texel offsets.

2011-08-29 Thread Dave Airlie
From: Dave Airlie 

As per Brian's suggestion, add caps for drivers that support texture
offsets to advertise a min/max via TGSI, also use it in the state tracker.

Signed-off-by: Dave Airlie 
---
 src/gallium/drivers/r600/r600_pipe.c |6 ++
 src/gallium/drivers/softpipe/sp_screen.c |4 
 src/gallium/include/pipe/p_defines.h |4 +++-
 src/mesa/state_tracker/st_extensions.c   |3 +++
 4 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_pipe.c 
b/src/gallium/drivers/r600/r600_pipe.c
index d180e36..a97525b 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -407,6 +407,12 @@ static int r600_get_param(struct pipe_screen* pscreen, 
enum pipe_cap param)
case PIPE_CAP_TIMER_QUERY:
return r600_get_clock_crystal_freq(rscreen->radeon) != 0;
 
+   case PIPE_CAP_MIN_TEXEL_OFFSET:
+   return -8;
+
+   case PIPE_CAP_MAX_TEXEL_OFFSET:
+   return 7;
+
default:
R600_ERR("r600: unknown param %d\n", param);
return 0;
diff --git a/src/gallium/drivers/softpipe/sp_screen.c 
b/src/gallium/drivers/softpipe/sp_screen.c
index 1e58d27..5a1c175 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -131,6 +131,10 @@ softpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
   return 1;
case PIPE_CAP_ARRAY_TEXTURES:
   return 1;
+   case PIPE_CAP_MIN_TEXEL_OFFSET:
+  return -8;
+   case PIPE_CAP_MAX_TEXEL_OFFSET:
+  return 7;
default:
   return 0;
}
diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index 795de1f..19c0cab 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -471,7 +471,9 @@ enum pipe_cap {
PIPE_CAP_MIXED_COLORBUFFER_FORMATS = 46,
PIPE_CAP_SEAMLESS_CUBE_MAP = 47,
PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE = 48,
-   PIPE_CAP_SCALED_RESOLVE = 49
+   PIPE_CAP_SCALED_RESOLVE = 49,
+   PIPE_CAP_MIN_TEXEL_OFFSET = 50,
+   PIPE_CAP_MAX_TEXEL_OFFSET = 51,
 };
 
 /* Shader caps not specific to any single stage */
diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index 8e90093..28db910 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -203,6 +203,9 @@ void st_init_limits(struct st_context *st)
 
/* XXX we'll need a better query here someday */
if (screen->get_param(screen, PIPE_CAP_GLSL)) {
+  c->MinProgramTexelOffset = screen->get_param(screen, 
PIPE_CAP_MIN_TEXEL_OFFSET);
+  c->MaxProgramTexelOffset = screen->get_param(screen, 
PIPE_CAP_MAX_TEXEL_OFFSET);
+
   c->GLSLVersion = 120;
}
 }
-- 
1.7.6

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


Re: [Mesa-dev] [PATCH 00/13] Fix include style accross Mesa

2011-08-29 Thread Brian Paul

On 08/27/2011 09:51 AM, Kai Wasserbäch wrote:

[Please CC me on all replies, I'm not subscribed to mesa-dev.]

Dear mesa-dev list,
the following 13 patches were prompted by Brian Paul's e-mail [0] about g3dvl.
Neither patch should have functional impact and thus be safe to apply.

The first patch is an outlier and a follow-up to the two patches I've
posted recently to this list and Ian Romanick committed.

Please note, that – should you accept the patches – somebody else needs to
commit them to Mesa's Git, as I don't have commit access.


Thanks.  Pushed.

-Brian


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


Re: [Mesa-dev] OpenGL to DirectX with Mesa3D

2011-08-29 Thread Anonimo Veneziano

Thanks all for your answers and suggestions!
I will have a try on the possible solutions/ways/components you all cited.
Otherwise I think I will have to wait ANGLE to grow up and cover more features. 
By the way, ANGLE is OpenGL ES -> DX not OpenGL, so I think I need also a 
OpenGL -> OpenGL ES translator. Right? Any idea/suggestion? does something like 
that exist?
Thanks again, regards
 

> Date: Mon, 29 Aug 2011 04:05:31 -0700
> From: jfons...@vmware.com
> To: ano...@hotmail.co.uk
> CC: mesa-dev@lists.freedesktop.org; i...@freedesktop.org
> Subject: Re: [Mesa-dev] OpenGL to DirectX with Mesa3D
> 
> 
> 
> - Original Message -
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> > 
> > On 08/25/2011 10:55 AM, Anonimo Veneziano wrote:
> > > Hi all
> > > I am a programmer but not very skilled in 3D graphics (so pardon me
> > > if I
> > > write something wrong).
> > > I need to build my own opengl32.dll to redirect my OpenGL
> > > application
> > > calls to DirectX (better if 10 or 11, but 9 could be ok too)
> > > TitaniumGL and 3DAnalyzer dont work for my case (already tested,
> > > application crashes).
> > > 1. Do you know if some other OpenGL->DirectX converter exist that I
> > > could use?
> > > 
> > > I am trying to use Mesa3D v7.10.3, and in particular I found
> > > GLDirect
> > > very interesting, but I am not able to get it compiled with dx9. I
> > > see
> > > it has been changed since GLDirect 5.0.2 old released version (that
> > > is
> > > of no use for me, it's opengl 1.1).
> > > So in Mesa v7.10.3 I tried to compile GLDirect and fixed some
> > > errors but
> > > at the moment I had some errors I cannot fix compiling
> > > "gld_primitive_dx9.c" and "gld_texture_dx9.c":
> > > for example in the first file the structures SWvertex (from
> > > swrast.h)
> > > and gl_context (from mtypes.h) seems different from those defined
> > > in Mesa,
> > > 2. Did someone compile GLDirect in Mesa 7.10.3? Can you help me to
> > > do it?
> > > 
> > > 3. Could Gallium help me in some way? I am not sure to have
> > > understood
> > > well it...
> > > 
> > > Many thanks in advance and sorry to have bothered you but I am in a
> > > hurry on a project and hope to get some solution!
> > 
> > The GLDirect stuff is really, really dead. It hasn't been maintained
> > in
> > years, and it probably hasn't been able to compile in just about as
> > long. Moreover, as per discussions in another thread
> > (http://marc.info/?l=mesa3d-dev&m=131421311903781&w=2), this code is
> > literally minutes from being deleted.
> 
> That's my understanding too. It only did basic (fixed function?) GL to DX7 or 
> 8, so is both unmaintained and uterl useless for most nowawadays applications.
> 
> > Since the internal Gallium interface is essentially a clone of the
> > DX10
> > interface, it should be trivial to make a Gallium DX10 driver. Note
> > that this is different from a DX10 state tracker (this is the
> > top-half
> > layer that makes a particular API available to applications).
> > 
> > One of the Gallium guys should know more...
> 
> Gallium is inspired in DX10 but it is a superset, so there's still the task 
> of translating the superset bits that are not in DX10.
> 
> There's also the svga pipe driver which follow DX9 semantics closely.
> 
> Either way, although gallium code base could help kickstarting a GL -> DX 
> converter, making a solid GL -> DX converter is a huge endeaveour, even by an 
> developer familiar with both set of APIs.
> 
> I'd agree that an actively maintained project with that goal in mind, such as 
> Angle, as a better bet.
> 
> Jose
  ___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] split-up maptextureimage series

2011-08-29 Thread Brian Paul

On 08/24/2011 12:08 PM, Eric Anholt wrote:

OK, that last patchbomb had some issues.  For sanity, I'd like to get
some of the non-controversial stuff in before polishing off the
remainder.  This is the part of my branch not related to
GetTexImage().  It's also the stuff that should be reasonably well
tested by our current testsuite.

This is the "mti-3" branch of my repo.


Eric, I think you should go ahead and merge this branch.  I had some 
spare time over the weekend and have reworked much of my patch series 
relative to this branch.


I only found one issue on mti-3.  In commit 
4c492f2b4abb59764c2f3fced597c4598eb9f46f one of us accidentally 
removed the block of code that calls _mesa_validate_pbo_teximage() in 
_mesa_store_teximage3d().  The attached patch fixes it.


-Brian


_mesa_store_teximage3d.patch
Description: application/pgp-keys
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] mesa: Remove all mention of MESA_FORMAT_CI8

2011-08-29 Thread Brian Paul

On 08/27/2011 12:47 AM, Ian Romanick wrote:

From: Ian Romanick

Nothing in Mesa supports color-index textures, and most of the other
infrastructure that could allow such support has already been removed.
This puts the final nail in the coffin.


Reviewed-by: Brian Paul 

Just one small thing: if you grep for GL_COLOR_INDEX in formats.c 
you'll see some comments that should be updated to no longer mention 
that format.


Another follow-on to this would be to remove GL_EXT_paletted_texture 
support.


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


Re: [Mesa-dev] [PATCH 2/2] mesa: Remove all mention of MESA_FORMAT_CI8

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/29/2011 07:38 AM, Brian Paul wrote:
> On 08/27/2011 12:47 AM, Ian Romanick wrote:
>> From: Ian Romanick
>>
>> Nothing in Mesa supports color-index textures, and most of the other
>> infrastructure that could allow such support has already been removed.
>> This puts the final nail in the coffin.
> 
> Reviewed-by: Brian Paul 
> 
> Just one small thing: if you grep for GL_COLOR_INDEX in formats.c you'll
> see some comments that should be updated to no longer mention that format.
> 
> Another follow-on to this would be to remove GL_EXT_paletted_texture
> support.

It's almost like you read my mind. :) The only reason I didn't do that
last year was because a couple DRI1 drivers (e.g., tdfx) still exposed
that extension.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5btZ8ACgkQX1gOwKyEAw9rigCffK81O5JeR6Rlh5Vi6it7g91G
+zUAnj17N5+r1mM5gdQYe6OEmthfmgpu
=Q/Fl
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] llvm-config on a biarch machine

2011-08-29 Thread Brian Paul

On 08/24/2011 09:34 AM, Kevin DeKorte wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On a biarch machine like Fedora llvm-config defaults to outputting the
values for a 64bit build. With a recent patch to llvm-devel there are
now arch specific versions of llvm-config and this patch should use them
properly. With this patch I the proper llvm-config is used for 64 bit
and 32bit builds. There may be a better way to do this, so this is an
example that worked for me.


diff --git a/configure.ac b/configure.ac
index ea58dae..e3d9d5a 100644
- - --- a/configure.ac
+++ b/configure.ac
@@ -1745,7 +1745,15 @@ if test "x$enable_gallium_llvm" = xauto; then
 esac
  fi
  if test "x$enable_gallium_llvm" = xyes; then
- - -AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
+if test "x$enable_32bit" = xyes; then
+AC_PATH_PROG([LLVM_CONFIG], [llvm-config-32], [no])
+fi
+if test "x$enable_64" = xyes; then
+AC_PATH_PROG([LLVM_CONFIG], [llvm-config-64], [no])
+fi
+if test "x$LLVM_CONFIG" = x; then
+AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
+fi

 if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version`



That part looks OK to me.




However, when building the 32 bit version of mesa (--enable-32-bit) it
seems that the CFLAGS are not properly passed to the llvmpipe
Makefile. So I had to manually add in the compiler flags as follows,
which is incorrect for 64bit.

diff --git a/src/gallium/drivers/llvmpipe/Makefile
b/src/gallium/drivers/llvmpip
index f930135..047fbf6 100644
- - --- a/src/gallium/drivers/llvmpipe/Makefile
+++ b/src/gallium/drivers/llvmpipe/Makefile
@@ -70,7 +70,8 @@ PROGS_DEPS := ../../auxiliary/libgallium.a
  lp_tile_soa.c: lp_tile_soa.py ../../auxiliary/util/u_format_parse.py
../../auxi
 $(PYTHON2) $(PYTHON_FLAGS) lp_tile_soa.py
../../auxiliary/util/u_format.

- - -LDFLAGS += $(LLVM_LDFLAGS)
+CFLAGS += -m32
+LDFLAGS += -m32 $(LLVM_LDFLAGS)
  LIBS += -L../../auxiliary/ -lgallium libllvmpipe.a $(LLVM_LIBS)
$(GL_LIB_DEPS)
  LD=$(CXX)

So some work needs to be done to llvmpipe to properly include the
CFLAGS/LDFLAGS


Yeah, we can't just force -m32 there.  I don't have time to 
investigate this, maybe somone else can.


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


Re: [Mesa-dev] [PATCH] mesa, glsl_to_tgsi: fixes for native integers

2011-08-29 Thread Eric Anholt
On Fri, 26 Aug 2011 21:58:12 -0500, Bryan Cain  wrote:
> This fixes all of the piglit regressions in softpipe when native integers are
> enabled.
> ---
>  src/mesa/main/uniforms.c   |8 +
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |   45 
> ++--
>  2 files changed, 43 insertions(+), 10 deletions(-)
> 
> diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
> index cda840f..0801476 100644
> --- a/src/mesa/main/uniforms.c
> +++ b/src/mesa/main/uniforms.c
> @@ -776,13 +776,7 @@ set_program_uniform(struct gl_context *ctx, struct 
> gl_program *program,
>   /* if the uniform is bool-valued, convert to 1 or 0 */
>   if (isUniformBool) {
>  for (i = 0; i < elems; i++) {
> -   if (basicType == GL_FLOAT)
> -  uniformVal[i].b = uniformVal[i].f != 0.0f ? 1 : 0;
> -   else
> -  uniformVal[i].b = uniformVal[i].u ? 1 : 0;
> -   
> -   if (!ctx->Const.NativeIntegers)
> -  uniformVal[i].f = uniformVal[i].b ? 1.0f : 0.0f;
> +   uniformVal[i].f = uniformVal[i].f != 0.0f ? 1.0f : 0.0f;
>  }
>   }
>}

I think booleans should be integer 1 as uniforms.  Otherwise I'll need a
RealNativeIntegers flag to get that behavior.


pgpeZ8a983JIx.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] Initial Common Subexpression Elimination implementation.

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07/17/2011 12:29 PM, vljn wrote:

> +class box:public exec_node

For the record, I'm going to NAK with extreme prejudice any patch that
includes this crap.  I'm not trying to be a jerk, but I've explained at
least twice why this is unacceptable.

> +{
> +public:
> + void* content;
> +
> + box(void* c):content(c)
> + {
> +
> + }
> +};
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5bxhwACgkQX1gOwKyEAw+ShQCdEv/5eaUtaymAZQ/7Ud/CeLcK
K4wAoJXm4vz4epUvt3QYEiE4lZTtyYzt
=Qxn7
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] Initial Common Subexpression Elimination implementation.

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/29/2011 10:02 AM, Ian Romanick wrote:
> On 07/17/2011 12:29 PM, vljn wrote:
> 
>> +class box:public exec_node
> 
> For the record, I'm going to NAK with extreme prejudice any patch that
> includes this crap.  I'm not trying to be a jerk, but I've explained at
> least twice why this is unacceptable.

Blarg.  But I am having a case of the stupid Mondays.  I didn't notice
that this message was over a month old.  Please, ignore this.

> 
>> +{
>> +public:
>> +void* content;
>> +
>> +box(void* c):content(c)
>> +{
>> +
>> +}
>> +};
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5bxloACgkQX1gOwKyEAw8w1wCfWlfQuOt1WoaTAbo3A4+bqgnQ
po0AnRdUFcfkTBIWwyWV32lrSDx4fwPU
=h/an
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa, glsl_to_tgsi: fixes for native integers

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/29/2011 09:31 AM, Eric Anholt wrote:
> On Fri, 26 Aug 2011 21:58:12 -0500, Bryan Cain  wrote:
>> This fixes all of the piglit regressions in softpipe when native integers are
>> enabled.
>> ---
>>  src/mesa/main/uniforms.c   |8 +
>>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |   45 
>> ++--
>>  2 files changed, 43 insertions(+), 10 deletions(-)
>>
>> diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
>> index cda840f..0801476 100644
>> --- a/src/mesa/main/uniforms.c
>> +++ b/src/mesa/main/uniforms.c
>> @@ -776,13 +776,7 @@ set_program_uniform(struct gl_context *ctx, struct 
>> gl_program *program,
>>   /* if the uniform is bool-valued, convert to 1 or 0 */
>>   if (isUniformBool) {
>>  for (i = 0; i < elems; i++) {
>> -   if (basicType == GL_FLOAT)
>> -  uniformVal[i].b = uniformVal[i].f != 0.0f ? 1 : 0;
>> -   else
>> -  uniformVal[i].b = uniformVal[i].u ? 1 : 0;
>> -   
>> -   if (!ctx->Const.NativeIntegers)
>> -  uniformVal[i].f = uniformVal[i].b ? 1.0f : 0.0f;
>> +   uniformVal[i].f = uniformVal[i].f != 0.0f ? 1.0f : 0.0f;
>>  }
>>   }
>>}
> 
> I think booleans should be integer 1 as uniforms.  Otherwise I'll need a
> RealNativeIntegers flag to get that behavior.

I think the issue they're running into is that all non-Intel hardware
uses ~0 for true (out of the "set" instructions) and 0 for false when
using integers.  Most of the rest of the stack expects 1 and 0, so the
impedance mismatch is causing headaches.  The (1-b) implementation of
ir_unop_not stops working, for example.  Though, in that case it seems
like you should have (and use) an integer bit-wise not instruction.

It seems like there should be a better way to handle this...
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5bx+4ACgkQX1gOwKyEAw+rLQCgnj1U5CMLKV6PY9rK3huJzYZO
1lgAn3WpLDmPBh3xy8uosHg0pNfy7mtM
=9snJ
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa, glsl_to_tgsi: fixes for native integers

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/27/2011 08:44 AM, Bryan Cain wrote:
> On 08/27/2011 05:39 AM, Christoph Bumiller wrote:
>> On 27.08.2011 04:58, Bryan Cain wrote:
>>> This fixes all of the piglit regressions in softpipe when native integers 
>>> are
>>> enabled.
>>> ---
>>>  src/mesa/main/uniforms.c   |8 +
>>>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |   45 
>>> ++--
>>>  2 files changed, 43 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
>>> index cda840f..0801476 100644
>>> --- a/src/mesa/main/uniforms.c
>>> +++ b/src/mesa/main/uniforms.c
>>> @@ -776,13 +776,7 @@ set_program_uniform(struct gl_context *ctx, struct 
>>> gl_program *program,
>>>   /* if the uniform is bool-valued, convert to 1 or 0 */
>>>   if (isUniformBool) {
>>>  for (i = 0; i < elems; i++) {
>>> -   if (basicType == GL_FLOAT)
>>> -  uniformVal[i].b = uniformVal[i].f != 0.0f ? 1 : 0;
>>> -   else
>>> -  uniformVal[i].b = uniformVal[i].u ? 1 : 0;
>>> -   
>>> -   if (!ctx->Const.NativeIntegers)
>>> -  uniformVal[i].f = uniformVal[i].b ? 1.0f : 0.0f;
>>> +   uniformVal[i].f = uniformVal[i].f != 0.0f ? 1.0f : 0.0f;
>>>  }
>>>   }
>>>}
>>> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
>>> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>>> index 9cac309..d1674eb 100644
>>> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>>> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>>> @@ -385,6 +385,8 @@ public:
>>> void emit_scalar(ir_instruction *ir, unsigned op,
>>> st_dst_reg dst, st_src_reg src0, st_src_reg src1);
>>>  
>>> +   void try_emit_integer_set(ir_instruction *ir, unsigned op, st_dst_reg 
>>> dst);
>>> +
>>> void emit_arl(ir_instruction *ir, st_dst_reg dst, st_src_reg src0);
>>>  
>>> void emit_scs(ir_instruction *ir, unsigned op,
>>> @@ -563,6 +565,8 @@ glsl_to_tgsi_visitor::emit(ir_instruction *ir, unsigned 
>>> op,
>>>  
>>> this->instructions.push_tail(inst);
>>> 
>>> +   try_emit_integer_set(ir, op, dst);
>>> +   
>>> return inst;
>>>  }
>>>  
>>> @@ -589,6 +593,32 @@ glsl_to_tgsi_visitor::emit(ir_instruction *ir, 
>>> unsigned op)
>>>  }
>>>  
>>>  /**
>>> + * Emits the code to convert the result of integer SET instructions to 
>>> floats.
>>> + */
>>> +void
>>> +glsl_to_tgsi_visitor::try_emit_integer_set(ir_instruction *ir, unsigned op,
>>> +st_dst_reg dst)
>>> +{
>>> +   st_src_reg src;
>>> +
>>> +   if (!(op == TGSI_OPCODE_USEQ ||
>>> + op == TGSI_OPCODE_USNE ||
>>> + op == TGSI_OPCODE_ISGE ||
>>> + op == TGSI_OPCODE_USGE ||
>>> + op == TGSI_OPCODE_ISLT ||
>>> + op == TGSI_OPCODE_USLT))
>>> +  return;
>>> +
>>> +   src = st_src_reg(dst);
>>> +   src.type = GLSL_TYPE_INT;
>>> +
>>> +   dst.type = GLSL_TYPE_FLOAT;
>>> +   emit(ir, TGSI_OPCODE_I2F, dst, src);
>>> +   src.type = GLSL_TYPE_FLOAT;
>>> +   emit(ir, TGSI_OPCODE_SNE, dst, src, st_src_reg_for_float(0.0));
>>> +}
>>> +
>> emit(ir, TGSI_OPCODE_AND, dst, src, st_src_reg_for_float(1.0f));
>>
>> I still don't quite like booleans as floats, but I guess I can just
>> easily track back to the source SET to emit my set-predicate-register op
>> without having all the fuss in between.
> 
> For now, I'm trying to get things working.  Once integers are working on
> softpipe and r600g with no piglit regressions, I'll look into
> optimizations like using AND.

I think this is the underlying problem.  Without this patch series, some
of the code treats booleans as integers, and some of it still tries to
apply floating-point tricks.  Instead of reverting back to using
floating-point for booleans, it seems much better (by all metrics) to
finish the conversion to integer.  Emitting (1-x) for logical-not or
(a*b) for logical-and when you have an actual NOT and AND instructions
is just silly.

Fixing that will make it irrelevant whether the integer set-on
instructions generate 1 or ~0 for true.  Right?

>>> +/**
>>>   * Determines whether to use an integer, unsigned integer, or float opcode 
>>>   * based on the operands and input opcode, then emits the result.
>>>   * 
>>> @@ -1662,7 +1692,6 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
>>>emit_scalar(ir, TGSI_OPCODE_RSQ, result_dst, op[0]);
>>>break;
>>> case ir_unop_i2f:
>>> -   case ir_unop_b2f:
>>>if (native_integers) {
>>>   emit(ir, TGSI_OPCODE_I2F, result_dst, op[0]);
>>>   break;
>>> @@ -1670,10 +1699,14 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
>>> case ir_unop_i2u:
>>> case ir_unop_u2i:
>>>/* Converting between signed and unsigned integers is a no-op. */
>>> -   case ir_unop_b2i:
>>> -  /* Booleans are stored as integers (or floats in GLSL 1.20 and 
>>> lower).

Re: [Mesa-dev] split-up maptextureimage series

2011-08-29 Thread Eric Anholt
On Mon, 29 Aug 2011 08:32:41 -0600, Brian Paul  wrote:
Non-text part: multipart/mixed
> On 08/24/2011 12:08 PM, Eric Anholt wrote:
> > OK, that last patchbomb had some issues.  For sanity, I'd like to get
> > some of the non-controversial stuff in before polishing off the
> > remainder.  This is the part of my branch not related to
> > GetTexImage().  It's also the stuff that should be reasonably well
> > tested by our current testsuite.
> >
> > This is the "mti-3" branch of my repo.
> 
> Eric, I think you should go ahead and merge this branch.  I had some 
> spare time over the weekend and have reworked much of my patch series 
> relative to this branch.
> 
> I only found one issue on mti-3.  In commit 
> 4c492f2b4abb59764c2f3fced597c4598eb9f46f one of us accidentally 
> removed the block of code that calls _mesa_validate_pbo_teximage() in 
> _mesa_store_teximage3d().  The attached patch fixes it.

Thanks.  Pushed.

I started trying to build a GetTexImage internalformat/format/types test
for piglit so we could actually test the big change remaining in the
split mapteximage series.  The WIP for that is on the master branch of
my piglit tree.  Oh how I hate GL's pixel path.


pgpf0OiTlI9Gt.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] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-29 Thread Eric Anholt
On Sun, 28 Aug 2011 20:51:10 -0500, Bryan Cain  wrote:
> On 08/28/2011 07:38 PM, Eric Anholt wrote:
> > On Sat, 27 Aug 2011 20:18:55 -0700, Kenneth Graunke  
> > wrote:
> >> From: Bryan Cain 
> >>
> >> Using multiply and reciprocal for integer division involves potentially
> >> lossy floating point conversions.  This is okay for older GPUs that
> >> represent integers as floating point, but undesirable for GPUs with
> >> native integer division instructions.
> >>
> >> TGSI, for example, has UDIV/IDIV instructions for integer division,
> >> so it makes sense to handle this directly.  Likewise for i965.
> >>
> >> Signed-off-by: Bryan Cain 
> >> Signed-off-by: Kenneth Graunke 
> >
> >> ---
> >> case ir_binop_div:
> >> -  if (lowering(DIV_TO_MUL_RCP))
> >> +  if (lowering(INT_DIV_TO_MUL_RCP) && 
> >> ir->operands[1]->type->is_integer())
> >> +   int_div_to_mul_rcp(ir);
> >> +  else if (lowering(DIV_TO_MUL_RCP))
> >> div_to_mul_rcp(ir);
> >>break;
> >>  
> > Sure looks odd to me for one of these to be checking the type and ther
> > other not.
> 
> It works, though.  If it's not an integer type, it's going to be a float
> type.

Not to my reading.  If ir->op[1]->type->is_integer() &&
!lowering(INT_DIV_TO_MULL_RCP) && lowering(DIV_TO_MUL_RCP), then
assert(ir->operands[1]->type->is_float()) should fail.


pgpD2YZnGOLZ6.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] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/28/2011 06:51 PM, Bryan Cain wrote:
> On 08/28/2011 07:38 PM, Eric Anholt wrote:
>> On Sat, 27 Aug 2011 20:18:55 -0700, Kenneth Graunke  
>> wrote:
>>> From: Bryan Cain 
>>>
>>> Using multiply and reciprocal for integer division involves potentially
>>> lossy floating point conversions.  This is okay for older GPUs that
>>> represent integers as floating point, but undesirable for GPUs with
>>> native integer division instructions.
>>>
>>> TGSI, for example, has UDIV/IDIV instructions for integer division,
>>> so it makes sense to handle this directly.  Likewise for i965.
>>>
>>> Signed-off-by: Bryan Cain 
>>> Signed-off-by: Kenneth Graunke 
>>
>>> ---
>>> case ir_binop_div:
>>> -  if (lowering(DIV_TO_MUL_RCP))
>>> +  if (lowering(INT_DIV_TO_MUL_RCP) && 
>>> ir->operands[1]->type->is_integer())
>>> +int_div_to_mul_rcp(ir);
>>> +  else if (lowering(DIV_TO_MUL_RCP))
>>>  div_to_mul_rcp(ir);
>>>break;
>>>  
>> Sure looks odd to me for one of these to be checking the type and ther
>> other not.
> 
> It works, though.  If it's not an integer type, it's going to be a float
> type.

Right, but it could be an integer type and !lower(INT_DIV_TO_MUL_RCP).
In which case if lower(DIV_TO_MUL_RCP), do_to_mul_rcp will get called on
an integer type.  Right?
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5b0X4ACgkQX1gOwKyEAw+IEQCfV1mHz5ZrwLMvPpbAzAGdlorg
zNcAn2iMVg8U7J5BVGiRugikqKYI5D7C
=myKt
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-29 Thread Kenneth Graunke
From: Bryan Cain 

Using multiply and reciprocal for integer division involves potentially
lossy floating point conversions.  This is okay for older GPUs that
represent integers as floating point, but undesirable for GPUs with
native integer division instructions.

TGSI, for example, has UDIV/IDIV instructions for integer division,
so it makes sense to handle this directly.  Likewise for i965.

Signed-off-by: Bryan Cain 
Signed-off-by: Kenneth Graunke 
---
v3: Check for int/float explicitly, fixing a mistake where div_to_mul_rcp
would be run on integers when !lowering(INT_DIV_TO_MUL_RCP) and
lowering(DIV_TO_MUL_RCP).

 src/glsl/ir_optimization.h |   13 ++--
 src/glsl/lower_instructions.cpp|  125 
 src/mesa/drivers/dri/i965/brw_shader.cpp   |1 +
 src/mesa/program/ir_to_mesa.cpp|2 +-
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |2 +-
 5 files changed, 80 insertions(+), 63 deletions(-)

diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h
index f7808bd..48448d4 100644
--- a/src/glsl/ir_optimization.h
+++ b/src/glsl/ir_optimization.h
@@ -29,12 +29,13 @@
  */
 
 /* Operations for lower_instructions() */
-#define SUB_TO_ADD_NEG 0x01
-#define DIV_TO_MUL_RCP 0x02
-#define EXP_TO_EXP20x04
-#define POW_TO_EXP20x08
-#define LOG_TO_LOG20x10
-#define MOD_TO_FRACT   0x20
+#define SUB_TO_ADD_NEG 0x01
+#define DIV_TO_MUL_RCP 0x02
+#define EXP_TO_EXP20x04
+#define POW_TO_EXP20x08
+#define LOG_TO_LOG20x10
+#define MOD_TO_FRACT   0x20
+#define INT_DIV_TO_MUL_RCP 0x40
 
 bool do_common_optimization(exec_list *ir, bool linked, unsigned 
max_unroll_iterations);
 
diff --git a/src/glsl/lower_instructions.cpp b/src/glsl/lower_instructions.cpp
index 23aa19b..d79eb0a 100644
--- a/src/glsl/lower_instructions.cpp
+++ b/src/glsl/lower_instructions.cpp
@@ -32,6 +32,7 @@
  * Currently supported transformations:
  * - SUB_TO_ADD_NEG
  * - DIV_TO_MUL_RCP
+ * - INT_DIV_TO_MUL_RCP
  * - EXP_TO_EXP2
  * - POW_TO_EXP2
  * - LOG_TO_LOG2
@@ -47,8 +48,8 @@
  * want to recognize add(op0, neg(op1)) or the other way around to
  * produce a subtract anyway.
  *
- * DIV_TO_MUL_RCP:
- * ---
+ * DIV_TO_MUL_RCP and INT_DIV_TO_MUL_RCP:
+ * --
  * Breaks an ir_unop_div expression down to op0 * (rcp(op1)).
  *
  * Many GPUs don't have a divide instruction (945 and 965 included),
@@ -56,6 +57,10 @@
  * reciprocal.  By breaking the operation down, constant reciprocals
  * can get constant folded.
  *
+ * DIV_TO_MUL_RCP only lowers floating point division; INT_DIV_TO_MUL_RCP
+ * handles the integer case, converting to and from floating point so that
+ * RCP is possible.
+ *
  * EXP_TO_EXP2 and LOG_TO_LOG2:
  * 
  * Many GPUs don't have a base e log or exponent instruction, but they
@@ -95,6 +100,7 @@ private:
 
void sub_to_add_neg(ir_expression *);
void div_to_mul_rcp(ir_expression *);
+   void int_div_to_mul_rcp(ir_expression *);
void mod_to_fract(ir_expression *);
void exp_to_exp2(ir_expression *);
void pow_to_exp2(ir_expression *);
@@ -127,60 +133,67 @@ lower_instructions_visitor::sub_to_add_neg(ir_expression 
*ir)
 void
 lower_instructions_visitor::div_to_mul_rcp(ir_expression *ir)
 {
-   if (!ir->operands[1]->type->is_integer()) {
-  /* New expression for the 1.0 / op1 */
-  ir_rvalue *expr;
-  expr = new(ir) ir_expression(ir_unop_rcp,
-  ir->operands[1]->type,
-  ir->operands[1],
-  NULL);
-
-  /* op0 / op1 -> op0 * (1.0 / op1) */
-  ir->operation = ir_binop_mul;
-  ir->operands[1] = expr;
+   assert(ir->operands[1]->type->is_float());
+
+   /* New expression for the 1.0 / op1 */
+   ir_rvalue *expr;
+   expr = new(ir) ir_expression(ir_unop_rcp,
+   ir->operands[1]->type,
+   ir->operands[1]);
+
+   /* op0 / op1 -> op0 * (1.0 / op1) */
+   ir->operation = ir_binop_mul;
+   ir->operands[1] = expr;
+
+   this->progress = true;
+}
+
+void
+lower_instructions_visitor::int_div_to_mul_rcp(ir_expression *ir)
+{
+   assert(ir->operands[1]->type->is_integer());
+
+   /* Be careful with integer division -- we need to do it as a
+* float and re-truncate, since rcp(n > 1) of an integer would
+* just be 0.
+*/
+   ir_rvalue *op0, *op1;
+   const struct glsl_type *vec_type;
+
+   vec_type = glsl_type::get_instance(GLSL_TYPE_FLOAT,
+ ir->operands[1]->type->vector_elements,
+ ir->operands[1]->type->matrix_columns);
+
+   if (ir->operands[1]->type->base_type == GLSL_TYPE_INT)
+  op1 = new(ir) ir_expression(ir_unop_i2f, vec_type, ir->operands[1], 
NULL);
+   else
+  op1 = new(ir) ir_expression(ir_unop_u2f, vec_type, ir->operands[1], 
NULL);
+
+   op1 = new(ir) ir_ex

Re: [Mesa-dev] [PATCH 15/21] mesa: Enable vertex programs by default, remove checks

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/27/2011 05:39 AM, Marek Olšák wrote:
> Hi Ian,
> 
> I was trying to enable NV_vertex_program without regressions in
> st/mesa before, but these piglit tests were always failing and are still
> failing with your patch:
> 
> nv-add
> nv-arl
> nv-init-zero-addr
> nv-init-zero-reg
> nv-mov

After digging around some more, I think everything except nouveau needs:

ctx->ShaderCompilerOptions[].EmitNVTempInitialization = true;

I did that for r200 in patch 16/21.  If that fixes softpipe, we should
just make that setting be the default.

> r600g just fails or assertion-fails, but softpipe sometimes crashes
> (e.g. in nv-init-zero-addr). That's the reason st/mesa doesn't support
> NV_vertex_program currently.

That's weird.  What's the assertion failure?  Is it some invalid
instruction or something else?

> Marek
> 
> On Sat, Aug 27, 2011 at 9:57 AM, Ian Romanick  wrote:
>> From: Ian Romanick 
>>
>> Specifically, the following extensions are enabled:
>>
>>GL_ARB_vertex_program
>>GL_EXT_gpu_program_paramaters
>>GL_NV_vertex_program
>>
>> GL_NV_vertex_program1_1 is *not* enabled because several drivers that
>> have vertex shader hardware do not support the RCC opcode.  This would
>> be easy enough to add to R200 (which does not support Inf), but it may
>> be more complex for others.
>>
>> Note that this enables GL_NV_vertex_program on r200 where it was not
>> previously enabled.  No piglit regressions (or new failures) were
>> seen.
>>
>> Cc: Alex Deucher 
>> Cc: Dave Airlie 
>> ---
>>  src/mesa/drivers/common/meta.c |   22 +-
>>  src/mesa/main/arbprogram.c |   36 +---
>>  src/mesa/main/eval.c   |9 -
>>  src/mesa/main/extensions.c |3 +++
>>  src/mesa/main/getstring.c  |8 +---
>>  src/mesa/main/matrix.c |   30 +-
>>  src/mesa/main/nvprogram.c  |   22 ++
>>  7 files changed, 37 insertions(+), 93 deletions(-)
>>
>> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
>> index 291d912..b9c20ac 100644
>> --- a/src/mesa/drivers/common/meta.c
>> +++ b/src/mesa/drivers/common/meta.c
>> @@ -427,12 +427,10 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield 
>> state)
>>}
>>
>>if (state & MESA_META_SHADER) {
>> -  if (ctx->Extensions.ARB_vertex_program) {
>> - save->VertexProgramEnabled = ctx->VertexProgram.Enabled;
>> - _mesa_reference_vertprog(ctx, &save->VertexProgram,
>> - ctx->VertexProgram.Current);
>> - _mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB, GL_FALSE);
>> -  }
>> +  save->VertexProgramEnabled = ctx->VertexProgram.Enabled;
>> +  _mesa_reference_vertprog(ctx, &save->VertexProgram,
>> +  ctx->VertexProgram.Current);
>> +  _mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB, GL_FALSE);
>>
>>   if (ctx->Extensions.ARB_fragment_program) {
>>  save->FragmentProgramEnabled = ctx->FragmentProgram.Enabled;
>> @@ -697,13 +695,11 @@ _mesa_meta_end(struct gl_context *ctx)
>>}
>>
>>if (state & MESA_META_SHADER) {
>> -  if (ctx->Extensions.ARB_vertex_program) {
>> - _mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB,
>> -  save->VertexProgramEnabled);
>> - _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
>> -  save->VertexProgram);
>> -_mesa_reference_vertprog(ctx, &save->VertexProgram, NULL);
>> -  }
>> +  _mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB,
>> +  save->VertexProgramEnabled);
>> +  _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
>> +  save->VertexProgram);
>> +  _mesa_reference_vertprog(ctx, &save->VertexProgram, NULL);
>>
>>   if (ctx->Extensions.ARB_fragment_program) {
>>  _mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB,
>> diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c
>> index b83369d..3d40356 100644
>> --- a/src/mesa/main/arbprogram.c
>> +++ b/src/mesa/main/arbprogram.c
>> @@ -77,9 +77,7 @@ _mesa_BindProgram(GLenum target, GLuint id)
>>ASSERT_OUTSIDE_BEGIN_END(ctx);
>>
>>/* Error-check target and get curProg */
>> -   if ((target == GL_VERTEX_PROGRAM_ARB) && /* == GL_VERTEX_PROGRAM_NV */
>> -(ctx->Extensions.NV_vertex_program ||
>> - ctx->Extensions.ARB_vertex_program)) {
>> +   if (target == GL_VERTEX_PROGRAM_ARB) {
>>   curProg = &ctx->VertexProgram.Current->Base;
>>}
>>else if ((target == GL_FRAGMENT_PROGRAM_NV
>> @@ -276,8 +274,7 @@ get_local_param_pointer(struct gl_context *ctx, const 
>> char *func,
>>struct gl_program *prog;
>>GLuint maxParams;
>>
>> -   if (target == GL_VERTEX_PROGRAM_ARB
>> -   && ctx->Extensions.ARB_vertex_program) {
>> +   if (target == GL_VERTEX_PROGRAM_ARB) {
>>   prog = &(c

Re: [Mesa-dev] [PATCH v3] glsl: Use a separate div_to_mul_rcp lowering flag for integers.

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/29/2011 10:52 AM, Kenneth Graunke wrote:
> From: Bryan Cain 
> 
> Using multiply and reciprocal for integer division involves potentially
> lossy floating point conversions.  This is okay for older GPUs that
> represent integers as floating point, but undesirable for GPUs with
> native integer division instructions.
> 
> TGSI, for example, has UDIV/IDIV instructions for integer division,
> so it makes sense to handle this directly.  Likewise for i965.
> 
> Signed-off-by: Bryan Cain 
> Signed-off-by: Kenneth Graunke 

Reviewed-by: Ian Romanick 

> ---
> v3: Check for int/float explicitly, fixing a mistake where div_to_mul_rcp
> would be run on integers when !lowering(INT_DIV_TO_MUL_RCP) and
> lowering(DIV_TO_MUL_RCP).
> 
>  src/glsl/ir_optimization.h |   13 ++--
>  src/glsl/lower_instructions.cpp|  125 
> 
>  src/mesa/drivers/dri/i965/brw_shader.cpp   |1 +
>  src/mesa/program/ir_to_mesa.cpp|2 +-
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |2 +-
>  5 files changed, 80 insertions(+), 63 deletions(-)
> 
> diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h
> index f7808bd..48448d4 100644
> --- a/src/glsl/ir_optimization.h
> +++ b/src/glsl/ir_optimization.h
> @@ -29,12 +29,13 @@
>   */
>  
>  /* Operations for lower_instructions() */
> -#define SUB_TO_ADD_NEG 0x01
> -#define DIV_TO_MUL_RCP 0x02
> -#define EXP_TO_EXP20x04
> -#define POW_TO_EXP20x08
> -#define LOG_TO_LOG20x10
> -#define MOD_TO_FRACT   0x20
> +#define SUB_TO_ADD_NEG 0x01
> +#define DIV_TO_MUL_RCP 0x02
> +#define EXP_TO_EXP20x04
> +#define POW_TO_EXP20x08
> +#define LOG_TO_LOG20x10
> +#define MOD_TO_FRACT   0x20
> +#define INT_DIV_TO_MUL_RCP 0x40
>  
>  bool do_common_optimization(exec_list *ir, bool linked, unsigned 
> max_unroll_iterations);
>  
> diff --git a/src/glsl/lower_instructions.cpp b/src/glsl/lower_instructions.cpp
> index 23aa19b..d79eb0a 100644
> --- a/src/glsl/lower_instructions.cpp
> +++ b/src/glsl/lower_instructions.cpp
> @@ -32,6 +32,7 @@
>   * Currently supported transformations:
>   * - SUB_TO_ADD_NEG
>   * - DIV_TO_MUL_RCP
> + * - INT_DIV_TO_MUL_RCP
>   * - EXP_TO_EXP2
>   * - POW_TO_EXP2
>   * - LOG_TO_LOG2
> @@ -47,8 +48,8 @@
>   * want to recognize add(op0, neg(op1)) or the other way around to
>   * produce a subtract anyway.
>   *
> - * DIV_TO_MUL_RCP:
> - * ---
> + * DIV_TO_MUL_RCP and INT_DIV_TO_MUL_RCP:
> + * --
>   * Breaks an ir_unop_div expression down to op0 * (rcp(op1)).
>   *
>   * Many GPUs don't have a divide instruction (945 and 965 included),
> @@ -56,6 +57,10 @@
>   * reciprocal.  By breaking the operation down, constant reciprocals
>   * can get constant folded.
>   *
> + * DIV_TO_MUL_RCP only lowers floating point division; INT_DIV_TO_MUL_RCP
> + * handles the integer case, converting to and from floating point so that
> + * RCP is possible.
> + *
>   * EXP_TO_EXP2 and LOG_TO_LOG2:
>   * 
>   * Many GPUs don't have a base e log or exponent instruction, but they
> @@ -95,6 +100,7 @@ private:
>  
> void sub_to_add_neg(ir_expression *);
> void div_to_mul_rcp(ir_expression *);
> +   void int_div_to_mul_rcp(ir_expression *);
> void mod_to_fract(ir_expression *);
> void exp_to_exp2(ir_expression *);
> void pow_to_exp2(ir_expression *);
> @@ -127,60 +133,67 @@ 
> lower_instructions_visitor::sub_to_add_neg(ir_expression *ir)
>  void
>  lower_instructions_visitor::div_to_mul_rcp(ir_expression *ir)
>  {
> -   if (!ir->operands[1]->type->is_integer()) {
> -  /* New expression for the 1.0 / op1 */
> -  ir_rvalue *expr;
> -  expr = new(ir) ir_expression(ir_unop_rcp,
> -ir->operands[1]->type,
> -ir->operands[1],
> -NULL);
> -
> -  /* op0 / op1 -> op0 * (1.0 / op1) */
> -  ir->operation = ir_binop_mul;
> -  ir->operands[1] = expr;
> +   assert(ir->operands[1]->type->is_float());
> +
> +   /* New expression for the 1.0 / op1 */
> +   ir_rvalue *expr;
> +   expr = new(ir) ir_expression(ir_unop_rcp,
> + ir->operands[1]->type,
> + ir->operands[1]);
> +
> +   /* op0 / op1 -> op0 * (1.0 / op1) */
> +   ir->operation = ir_binop_mul;
> +   ir->operands[1] = expr;
> +
> +   this->progress = true;
> +}
> +
> +void
> +lower_instructions_visitor::int_div_to_mul_rcp(ir_expression *ir)
> +{
> +   assert(ir->operands[1]->type->is_integer());
> +
> +   /* Be careful with integer division -- we need to do it as a
> +* float and re-truncate, since rcp(n > 1) of an integer would
> +* just be 0.
> +*/
> +   ir_rvalue *op0, *op1;
> +   const struct glsl_type *vec_type;
> +
> +   vec_type = glsl_type::get_instance(GLSL_TYPE_FLOAT,
> +

[Mesa-dev] [PATCH 1/3] mesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

This was also discussed at XDS 2010.  However, actually making the
change was delayed because several drivers still exposed these
extensions to significant benefit (e.g., tdfx).  Now that those
drivers have been removed, this code can be removed as well.
---
 src/mesa/main/colortab.c|  689 +--
 src/mesa/main/colortab.h|7 -
 src/mesa/main/enable.c  |8 -
 src/mesa/main/extensions.c  |4 -
 src/mesa/main/get.c |1 -
 src/mesa/main/mtypes.h  |   12 +-
 src/mesa/main/texformat.c   |7 -
 src/mesa/main/texgetimage.c |   13 +-
 src/mesa/main/teximage.c|   17 -
 src/mesa/main/texobj.c  |3 -
 src/mesa/main/texstate.c|3 -
 11 files changed, 15 insertions(+), 749 deletions(-)

diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index ddb0f1f..f20dee6 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -41,361 +41,14 @@
 
 #if FEATURE_colortable
 
-
-/**
- * Given an internalFormat token passed to glColorTable,
- * return the corresponding base format.
- * Return -1 if invalid token.
- */
-static GLint
-base_colortab_format( GLenum format )
-{
-   switch (format) {
-  case GL_ALPHA:
-  case GL_ALPHA4:
-  case GL_ALPHA8:
-  case GL_ALPHA12:
-  case GL_ALPHA16:
- return GL_ALPHA;
-  case GL_LUMINANCE:
-  case GL_LUMINANCE4:
-  case GL_LUMINANCE8:
-  case GL_LUMINANCE12:
-  case GL_LUMINANCE16:
- return GL_LUMINANCE;
-  case GL_LUMINANCE_ALPHA:
-  case GL_LUMINANCE4_ALPHA4:
-  case GL_LUMINANCE6_ALPHA2:
-  case GL_LUMINANCE8_ALPHA8:
-  case GL_LUMINANCE12_ALPHA4:
-  case GL_LUMINANCE12_ALPHA12:
-  case GL_LUMINANCE16_ALPHA16:
- return GL_LUMINANCE_ALPHA;
-  case GL_INTENSITY:
-  case GL_INTENSITY4:
-  case GL_INTENSITY8:
-  case GL_INTENSITY12:
-  case GL_INTENSITY16:
- return GL_INTENSITY;
-  case GL_RGB:
-  case GL_R3_G3_B2:
-  case GL_RGB4:
-  case GL_RGB5:
-  case GL_RGB8:
-  case GL_RGB10:
-  case GL_RGB12:
-  case GL_RGB16:
- return GL_RGB;
-  case GL_RGBA:
-  case GL_RGBA2:
-  case GL_RGBA4:
-  case GL_RGB5_A1:
-  case GL_RGBA8:
-  case GL_RGB10_A2:
-  case GL_RGBA12:
-  case GL_RGBA16:
- return GL_RGBA;
-  default:
- return -1;  /* error */
-   }
-}
-
-
-
-/**
- * Examine table's format and set the component sizes accordingly.
- */
-static void
-set_component_sizes( struct gl_color_table *table )
-{
-   /* assuming the ubyte table */
-   const GLubyte sz = 8;
-
-   switch (table->_BaseFormat) {
-  case GL_ALPHA:
- table->RedSize = 0;
- table->GreenSize = 0;
- table->BlueSize = 0;
- table->AlphaSize = sz;
- table->IntensitySize = 0;
- table->LuminanceSize = 0;
- break;
-  case GL_LUMINANCE:
- table->RedSize = 0;
- table->GreenSize = 0;
- table->BlueSize = 0;
- table->AlphaSize = 0;
- table->IntensitySize = 0;
- table->LuminanceSize = sz;
- break;
-  case GL_LUMINANCE_ALPHA:
- table->RedSize = 0;
- table->GreenSize = 0;
- table->BlueSize = 0;
- table->AlphaSize = sz;
- table->IntensitySize = 0;
- table->LuminanceSize = sz;
- break;
-  case GL_INTENSITY:
- table->RedSize = 0;
- table->GreenSize = 0;
- table->BlueSize = 0;
- table->AlphaSize = 0;
- table->IntensitySize = sz;
- table->LuminanceSize = 0;
- break;
-  case GL_RGB:
- table->RedSize = sz;
- table->GreenSize = sz;
- table->BlueSize = sz;
- table->AlphaSize = 0;
- table->IntensitySize = 0;
- table->LuminanceSize = 0;
- break;
-  case GL_RGBA:
- table->RedSize = sz;
- table->GreenSize = sz;
- table->BlueSize = sz;
- table->AlphaSize = sz;
- table->IntensitySize = 0;
- table->LuminanceSize = 0;
- break;
-  default:
- _mesa_problem(NULL, "unexpected format in set_component_sizes");
-   }
-}
-
-
-
-/**
- * Update/replace all or part of a color table.  Helper function
- * used by _mesa_ColorTable() and _mesa_ColorSubTable().
- * The table->Table buffer should already be allocated.
- * \param start first entry to update
- * \param count number of entries to update
- * \param format format of user-provided table data
- * \param type datatype of user-provided table data
- * \param data user-provided table data
- * \param [rgba]Scale - RGBA scale factors
- * \param [rgba]Bias - RGBA bias factors
- */
-static void
-store_colortable_entries(struct gl_context *ctx, struct gl_color_table *table,
-GLsizei start, GLsizei count,
-GLenum format, GLenum type, const GLvoid *data,
-

[Mesa-dev] [PATCH 2/3] mesa: Remove dd_function_table::CopyColorTable, ::CopyColorSubTable, and ::UpdateTexturePalette

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

There's nothing left that can call any of these functions.  This also
removes the meta-ops code that implemented the first two.
---
 src/mesa/drivers/common/driverfuncs.c |5 ---
 src/mesa/drivers/common/meta.c|   55 -
 src/mesa/drivers/common/meta.h|   20 
 src/mesa/main/dd.h|   23 --
 4 files changed, 0 insertions(+), 103 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 78caa05..6484d28 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -118,11 +118,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
driver->UnmapTexture = NULL;
driver->TextureMemCpy = memcpy;
driver->IsTextureResident = NULL;
-   driver->UpdateTexturePalette = NULL;
-
-   /* imaging */
-   driver->CopyColorTable = _mesa_meta_CopyColorTable;
-   driver->CopyColorSubTable = _mesa_meta_CopyColorSubTable;
 
/* Vertex/fragment programs */
driver->BindProgram = NULL;
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 291d912..ad04d36 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -2939,58 +2939,3 @@ _mesa_meta_CopyTexSubImage3D(struct gl_context *ctx, 
GLenum target, GLint level,
copy_tex_sub_image(ctx, 3, target, level, xoffset, yoffset, zoffset,
   x, y, width, height);
 }
-
-
-void
-_mesa_meta_CopyColorTable(struct gl_context *ctx,
-  GLenum target, GLenum internalformat,
-  GLint x, GLint y, GLsizei width)
-{
-   GLfloat *buf;
-
-   buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
-   if (!buf) {
-  _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorTable");
-  return;
-   }
-
-   /*
-* Read image from framebuffer (disable pixel transfer ops)
-*/
-   _mesa_meta_begin(ctx, MESA_META_PIXEL_STORE | MESA_META_PIXEL_TRANSFER);
-   ctx->Driver.ReadPixels(ctx, x, y, width, 1,
-  GL_RGBA, GL_FLOAT, &ctx->Pack, buf);
-
-   _mesa_ColorTable(target, internalformat, width, GL_RGBA, GL_FLOAT, buf);
-
-   _mesa_meta_end(ctx);
-
-   free(buf);
-}
-
-
-void
-_mesa_meta_CopyColorSubTable(struct gl_context *ctx,GLenum target, GLsizei 
start,
- GLint x, GLint y, GLsizei width)
-{
-   GLfloat *buf;
-
-   buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
-   if (!buf) {
-  _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorSubTable");
-  return;
-   }
-
-   /*
-* Read image from framebuffer (disable pixel transfer ops)
-*/
-   _mesa_meta_begin(ctx, MESA_META_PIXEL_STORE | MESA_META_PIXEL_TRANSFER);
-   ctx->Driver.ReadPixels(ctx, x, y, width, 1,
-  GL_RGBA, GL_FLOAT, &ctx->Pack, buf);
-
-   _mesa_ColorSubTable(target, start, width, GL_RGBA, GL_FLOAT, buf);
-
-   _mesa_meta_end(ctx);
-
-   free(buf);
-}
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index ac20e37..9a92613 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -121,24 +121,4 @@ _mesa_meta_CopyTexSubImage3D(struct gl_context *ctx, 
GLenum target, GLint level,
  GLint x, GLint y,
  GLsizei width, GLsizei height);
 
-extern void
-_mesa_meta_CopyColorTable(struct gl_context *ctx,
-  GLenum target, GLenum internalformat,
-  GLint x, GLint y, GLsizei width);
-
-extern void
-_mesa_meta_CopyColorSubTable(struct gl_context *ctx,GLenum target, GLsizei 
start,
- GLint x, GLint y, GLsizei width);
-
-extern void
-_mesa_meta_CopyConvolutionFilter1D(struct gl_context *ctx, GLenum target,
-   GLenum internalFormat,
-   GLint x, GLint y, GLsizei width);
-
-extern void
-_mesa_meta_CopyConvolutionFilter2D(struct gl_context *ctx, GLenum target,
-   GLenum internalFormat, GLint x, GLint y,
-   GLsizei width, GLsizei height);
-
-
 #endif /* META_H */
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index d918b1e..9390b05 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -523,29 +523,6 @@ struct dd_function_table {
 */
GLboolean (*IsTextureResident)( struct gl_context *ctx,
struct gl_texture_object *t );
-
-   /**
-* Called when the texture's color lookup table is changed.
-* 
-* If \p tObj is NULL then the shared texture palette
-* gl_texture_object::Palette is to be updated.
-*/
-   void (*UpdateTexturePalette)( struct gl_context *ctx,
- struct gl_texture_object *tObj );
-   /*@}*/
-
-   
-   /**
-* \name Imaging functionality
-*/
-   /*@{*/
-   void (*CopyColorTable)( struct gl_con

[Mesa-dev] [PATCH 3/3] mesa: Remove all mention of GL_COLOR_INDEX*_EXT

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

These enums were only valid with the paletted texture extensions.
This allows a couple other trivial clean-ups.
---
 src/mesa/main/image.c   |   27 ---
 src/mesa/main/image.h   |3 ---
 src/mesa/main/texgetimage.c |8 ++--
 3 files changed, 2 insertions(+), 36 deletions(-)

diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 37127dc..3e75e7c 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -249,12 +249,6 @@ _mesa_components_in_format( GLenum format )
 {
switch (format) {
   case GL_COLOR_INDEX:
-  case GL_COLOR_INDEX1_EXT:
-  case GL_COLOR_INDEX2_EXT:
-  case GL_COLOR_INDEX4_EXT:
-  case GL_COLOR_INDEX8_EXT:
-  case GL_COLOR_INDEX12_EXT:
-  case GL_COLOR_INDEX16_EXT:
   case GL_STENCIL_INDEX:
   case GL_DEPTH_COMPONENT:
   case GL_RED:
@@ -863,27 +857,6 @@ _mesa_is_color_format(GLenum format)
 
 
 /**
- * Test if the given image format is a color index format.
- */
-GLboolean
-_mesa_is_index_format(GLenum format)
-{
-   switch (format) {
-  case GL_COLOR_INDEX:
-  case GL_COLOR_INDEX1_EXT:
-  case GL_COLOR_INDEX2_EXT:
-  case GL_COLOR_INDEX4_EXT:
-  case GL_COLOR_INDEX8_EXT:
-  case GL_COLOR_INDEX12_EXT:
-  case GL_COLOR_INDEX16_EXT:
- return GL_TRUE;
-  default:
- return GL_FALSE;
-   }
-}
-
-
-/**
  * Test if the given image format is a depth component format.
  */
 GLboolean
diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h
index 005fbcc..46adaec 100644
--- a/src/mesa/main/image.h
+++ b/src/mesa/main/image.h
@@ -61,9 +61,6 @@ extern GLboolean
 _mesa_is_color_format(GLenum format);
 
 extern GLboolean
-_mesa_is_index_format(GLenum format);
-
-extern GLboolean
 _mesa_is_depth_format(GLenum format);
 
 extern GLboolean
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 6c1b07f..7f799af 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -567,16 +567,12 @@ getteximage_error_check(struct gl_context *ctx, GLenum 
target, GLint level,
}
 
if (_mesa_components_in_format(format) <= 0 ||
-   format == GL_STENCIL_INDEX) {
+   format == GL_STENCIL_INDEX ||
+   format == GL_COLOR_INDEX) {
   _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexImage(format)" );
   return GL_TRUE;
}
 
-   if (_mesa_is_index_format(format)) {
-  _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
-  return GL_TRUE;
-   }
-
if (!ctx->Extensions.ARB_depth_texture && _mesa_is_depth_format(format)) {
   _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
   return GL_TRUE;
-- 
1.7.4.4

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


Re: [Mesa-dev] [PATCH 1/3] mesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette

2011-08-29 Thread Brian Paul

On 08/29/2011 12:12 PM, Ian Romanick wrote:

From: Ian Romanick

This was also discussed at XDS 2010.  However, actually making the
change was delayed because several drivers still exposed these
extensions to significant benefit (e.g., tdfx).  Now that those
drivers have been removed, this code can be removed as well.


For the series, Reviewed-by: Brian Paul 

There may be some dead pixel-transfer code related to color tables too.

Can we get rid of 'struct gl_color_table' entirely?

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


Re: [Mesa-dev] [PATCH 1/3] mesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette

2011-08-29 Thread Brian Paul

On 08/29/2011 12:26 PM, Brian Paul wrote:

On 08/29/2011 12:12 PM, Ian Romanick wrote:

From: Ian Romanick

This was also discussed at XDS 2010. However, actually making the
change was delayed because several drivers still exposed these
extensions to significant benefit (e.g., tdfx). Now that those
drivers have been removed, this code can be removed as well.


For the series, Reviewed-by: Brian Paul 

There may be some dead pixel-transfer code related to color tables too.

Can we get rid of 'struct gl_color_table' entirely?


BTW, are you going to document the various driver/feature removals in 
the release notes?


-Brian

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


[Mesa-dev] [PATCH 0/3] make: A few small cleanups

2011-08-29 Thread Chad Versace
Chad Versace (3):
  make: Remove duplicate defintion of COMMON_SOURCES in Radeon
makefiles
  make: Remove duplicate occurence of driverfuncs.c
  make: Factor out source lists from drivers/dri/common into
Makefile.sources

 src/mesa/drivers/dri/Makefile.defines|   21 +++--
 src/mesa/drivers/dri/common/Makefile.sources |   19 +++
 src/mesa/drivers/dri/r300/Makefile   |9 -
 src/mesa/drivers/dri/r600/Makefile   |9 -
 src/mesa/drivers/dri/swrast/Makefile |1 -
 5 files changed, 26 insertions(+), 33 deletions(-)
 create mode 100644 src/mesa/drivers/dri/common/Makefile.sources

-- 
1.7.6

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


[Mesa-dev] [PATCH 1/3] make: Remove duplicate defintion of COMMON_SOURCES in Radeon makefiles

2011-08-29 Thread Chad Versace
Remove defintion of COMMON_SOURCES from {r300,r660}/Makefile. The
defintion is a duplicate of that found in
src/mesa/drivers/dri/Makefile.defines.

CC: Ian Romanick 
Signed-off-by: Chad Versace 
---
 src/mesa/drivers/dri/r300/Makefile |9 -
 src/mesa/drivers/dri/r600/Makefile |9 -
 2 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/Makefile 
b/src/mesa/drivers/dri/r300/Makefile
index 9f23a84..a0a00e0 100644
--- a/src/mesa/drivers/dri/r300/Makefile
+++ b/src/mesa/drivers/dri/r300/Makefile
@@ -11,15 +11,6 @@ ifeq ($(RADEON_LDFLAGS),)
 CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c
 endif
 
-COMMON_SOURCES = \
-   ../../common/driverfuncs.c \
-   ../common/drirenderbuffer.c \
-   ../common/utils.c \
-   ../common/texmem.c \
-   ../common/vblank.c \
-   ../common/xmlconfig.c \
-   ../common/dri_util.c
-
 RADEON_COMMON_SOURCES = \
radeon_bo_legacy.c \
radeon_buffer_objects.c \
diff --git a/src/mesa/drivers/dri/r600/Makefile 
b/src/mesa/drivers/dri/r600/Makefile
index bec0b5a..2adc352 100644
--- a/src/mesa/drivers/dri/r600/Makefile
+++ b/src/mesa/drivers/dri/r600/Makefile
@@ -11,15 +11,6 @@ ifeq ($(RADEON_LDFLAGS),)
 CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c
 endif
 
-COMMON_SOURCES = \
-   ../../common/driverfuncs.c \
-   ../common/drirenderbuffer.c \
-   ../common/utils.c \
-   ../common/texmem.c \
-   ../common/vblank.c \
-   ../common/xmlconfig.c \
-   ../common/dri_util.c
-
 RADEON_COMMON_SOURCES = \
radeon_bo_legacy.c \
radeon_common_context.c \
-- 
1.7.6

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


[Mesa-dev] [PATCH 2/3] make: Remove duplicate occurence of driverfuncs.c

2011-08-29 Thread Chad Versace
driverfuncs.o is already contained in libmesa.a, so remove it from the
following source lists:
src/mesa/drivers/dri/Makefiles.defines:COMMON_SOURCES.
src/mesa/drivers/dri/swrast/Makefile:SWRAST_COMMON_SOURCES

v2

- [idr] Also remove driverfuncs.c from swrast/Makefile.
- [idr] Fix commit message. For the autoconf build, it was incorrect to say
  that driverfuncs.o was built twice.

CC: Ian Romanick 
Signed-off-by: Chad Versace 
---
 src/mesa/drivers/dri/Makefile.defines |1 -
 src/mesa/drivers/dri/swrast/Makefile  |1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/Makefile.defines 
b/src/mesa/drivers/dri/Makefile.defines
index 19b6de8..90ae551 100644
--- a/src/mesa/drivers/dri/Makefile.defines
+++ b/src/mesa/drivers/dri/Makefile.defines
@@ -7,7 +7,6 @@ COMMON_GALLIUM_SOURCES = \
 ../common/xmlconfig.c
 
 COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
-../../common/driverfuncs.c \
 ../common/texmem.c \
 ../common/drirenderbuffer.c
 
diff --git a/src/mesa/drivers/dri/swrast/Makefile 
b/src/mesa/drivers/dri/swrast/Makefile
index 4cb99fd..509fa28 100644
--- a/src/mesa/drivers/dri/swrast/Makefile
+++ b/src/mesa/drivers/dri/swrast/Makefile
@@ -20,7 +20,6 @@ C_SOURCES = \
 ASM_SOURCES =
 
 SWRAST_COMMON_SOURCES = \
-   ../../common/driverfuncs.c \
../common/utils.c \
../common/drisw_util.c
 
-- 
1.7.6

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


[Mesa-dev] [PATCH 3/3] make: Factor out source lists from drivers/dri/common into Makefile.sources

2011-08-29 Thread Chad Versace
In order that the Autoconf and Android build can share the same source
lists, move the lists from
src/mesa/drivers/dri/Makefile.defines
into
src/mesa/drivers/dri/common/Makefile.sources

I would like for Android to just reuse Makefile.defines, but the file is
unsuitable for reuse.

v2

- [olv] Remove MESA_TOP from definition of *_INCLUDES so that
  Makefile.sources can be self-contained.

CC: Chia-I Wu 
Signed-off: Chad Versace 
---
 src/mesa/drivers/dri/Makefile.defines|   20 +++-
 src/mesa/drivers/dri/common/Makefile.sources |   19 +++
 2 files changed, 26 insertions(+), 13 deletions(-)
 create mode 100644 src/mesa/drivers/dri/common/Makefile.sources

diff --git a/src/mesa/drivers/dri/Makefile.defines 
b/src/mesa/drivers/dri/Makefile.defines
index 90ae551..6ff8df5 100644
--- a/src/mesa/drivers/dri/Makefile.defines
+++ b/src/mesa/drivers/dri/Makefile.defines
@@ -1,14 +1,13 @@
 # -*-makefile-*-
 
+# Import mesa_dri_common_*
+include ../common/Makefile.sources
+
 COMMON_GALLIUM_SOURCES = \
-../common/utils.c \
-../common/vblank.c \
-../common/dri_util.c \
-../common/xmlconfig.c
+   $(addprefix ../common/, $(mesa_dri_common_gallium_SOURCES))
 
-COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
-../common/texmem.c \
-../common/drirenderbuffer.c
+COMMON_SOURCES = \
+   $(addprefix ../common/, $(mesa_dri_common_SOURCES))
 
 INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
 
@@ -20,13 +19,8 @@ OBJECTS = $(C_SOURCES:.c=.o) \
 ### Include directories
 SHARED_INCLUDES = \
-I. \
-   -I$(TOP)/src/mesa/drivers/dri/common \
-Iserver \
-   -I$(TOP)/include \
-   -I$(TOP)/src/mapi \
-   -I$(TOP)/src/mesa \
-   -I$(TOP)/src/egl/main \
-   -I$(TOP)/src/egl/drivers/dri \
+   $(addprefix -I$(TOP)/, $(mesa_dri_common_INCLUDES)) \
$(LIBDRM_CFLAGS)
 
 INCLUDES += $(API_DEFINES)
diff --git a/src/mesa/drivers/dri/common/Makefile.sources 
b/src/mesa/drivers/dri/common/Makefile.sources
new file mode 100644
index 000..22df2f0
--- /dev/null
+++ b/src/mesa/drivers/dri/common/Makefile.sources
@@ -0,0 +1,19 @@
+mesa_dri_common_gallium_SOURCES := \
+   utils.c \
+   vblank.c \
+   dri_util.c \
+   xmlconfig.c
+
+mesa_dri_common_SOURCES := \
+   $(mesa_dri_common_gallium_SOURCES) \
+texmem.c \
+drirenderbuffer.c
+
+# Paths are relative to MESA_TOP.
+mesa_dri_common_INCLUDES := \
+   include \
+   src/egl/drivers/dri \
+   src/egl/main \
+   src/mapi \
+   src/mesa \
+   src/mesa/drivers/dri/common \
-- 
1.7.6

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


Re: [Mesa-dev] [PATCH 2/2] i965: Avoid generating MOVs for most ir_assignment handling.

2011-08-29 Thread Kenneth Graunke
On 08/28/2011 05:31 PM, Eric Anholt wrote:
> On Sat, 27 Aug 2011 03:23:28 -0700, Kenneth Graunke  
> wrote:
>> This is a port of vec4_visitor::try_rewrite_rhs_to_dst to fs_visitor.
>>
>> Not only is this technique less invasive and more robust, it also
>> generates better code.  Over and above the previous technique, this
>> reduced instruction count in shader-db:
>>
>> With all FS optimizations (register coalescing and such) disabled, this
>> reduced instruction count by 6.23% on average and 36% in the best case.
>>
>> With optimizations left enabled, it still reduced instruction count by
>> 0.28% on average and 1.4% in the best case.
>>
>> In no case did this technique result in more code than the prior method.
> 
> I was actually trying to do this, too, before I GPU hung and ran out of
> battery.  However, I don't think just a comparison of before this commit
> to after this commit is fair -- you need to compare before the revert to
> after this commit.

Eric and I just talked about this in person.  For the record...

The 0.28%/1.4% improvement really is comparing instruction count /prior
to the revert/ with /after the new technique/.  So it really is better.

Eric also had a few small changes to future-proof the code.

With those in place, I've pushed this patch.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/8] i965, mesa: Build libmesa_dricore and i965_dri for Android

2011-08-29 Thread Chad Versace
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

v2 of this series has been posted.

- -- 
Chad Versace
c...@chad-versace.us

On 08/26/2011 06:53 PM, Chad Versace wrote:
> This series builds libmesa_dricore.so and i965_dri.so for Android. Along the
> way, a few cleanups are necessary.
> 
> This just gets the driver to build. I have not tested it yet.
> 
> Chad Versace (8):
>   android: Remove -fvisibility=hidden from CFLAGS so that we can build
> a shared dricore
>   mesa: Build libmesa_dricore.so for Android
>   make: Document imported variables
>   make: Remove duplicate occurence of driverfuncs.c
>   make: Factor out source lists from drivers/dri/common into
> Makefile.sources
>   dri: Build libmesa_dri_common for Android
>   i965: Fix Android build by removing relative includes
>   i965: Build i965_dri.so for Android


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOW99BAAoJEAIvNt057x8i2rUP/23cS39dkzdLbd2D4tm4OHAz
M+DbsskfwViayxvVbMnNiLJ2EdXDV5alMOuXLKDvo2OTo54rGgA7SriAKSkLU6I+
V162qTFSfmEOXTW2xMmVapvPR5mj1sJ8tt3/BUaxOUJJ8cs4XWk+oirCEnTmCyQA
uP0haL8laPJeVzcuWEgcw9tlgKWjZEwGrepMK68U1lo3fQGSGfxbmuCCmkd2k01c
P47pSoceZGwKB77rU5t/cSQTTnDO1dNHPqeDiel3rwJx6rnIIg/7ZYeEi2COSsfJ
psTyRk6mz/1a2lfHUngJax0Hci9+CHqnAE2Zi4qcPwwIrK0insybMftYJ93twkmw
J1JfZH4tgKHq430PzFtIm3tGFceVqMo1WEUgftgFIobKWmYYbRet/fhEEj4+U4rz
TbT2y/q+yA6s25KQawf6TeZ0usgDjmuZvDN+i5Z1GoO72QgeISca9YNUtARW0rBI
rHkpZzYqx2XoeLnlHhp5q6BnpZH6eWohrhbIHv1wCAY7YvIIpwcKyhfqtyz2DBbH
3D0tYjaPGP6n0croBNtggrWKsCDiLdXJvM5rBPU3XPa3xBae1dudGLdzdBdJdxyC
BjrCB903u1azY9B7LFr17exHVAQODQc3S+asofdo4IFbLQ0grtq4NguWP3FocaPS
UamkdTokER/7Sn8VSy/M
=gua1
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [v2 PATCH 0/5] i965, mesa: Build libmesa_dricore and i965_dri for Android

2011-08-29 Thread Chad Versace
This series builds libmesa_dricore.a and i965_dri.so for Android. Along the
way, a few cleanups are necessary.

Note: This series depends on another series I posted to mesa-dev:
  [PATCH 0/3] make: A few small cleanups

This just gets the driver to build. I have not tested it yet.

v2

Changes noted in each patch.

Chad Versace (5):
  mesa: Build libmesa_dricore.a for Android
  make: Document imported variables
  dri: Build libmesa_dri_common for Android
  i965: Fix Android build by removing relative includes
  i965: Build i965_dri.so for Android

 Android.mk |8 ++-
 src/mesa/Android.mk|   35 +++
 src/mesa/drivers/dri/Android.mk|   62 
 src/mesa/drivers/dri/common/Android.mk |   41 +
 src/mesa/drivers/dri/i965/Android.mk   |   61 +++
 src/mesa/drivers/dri/i965/brw_clip.c   |2 +-
 src/mesa/drivers/dri/i965/brw_context.c|2 +-
 .../drivers/dri/i965/brw_cubemap_normalize.cpp |4 +-
 src/mesa/drivers/dri/i965/brw_eu.c |2 +-
 src/mesa/drivers/dri/i965/brw_eu_emit.c|2 +-
 src/mesa/drivers/dri/i965/brw_fs.cpp   |4 +-
 src/mesa/drivers/dri/i965/brw_fs.h |4 +-
 .../dri/i965/brw_fs_channel_expressions.cpp|6 +-
 src/mesa/drivers/dri/i965/brw_fs_emit.cpp  |2 +-
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp  |6 +-
 .../dri/i965/brw_fs_schedule_instructions.cpp  |6 +-
 .../drivers/dri/i965/brw_fs_vector_splitting.cpp   |   10 ++--
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp   |6 +-
 src/mesa/drivers/dri/i965/brw_gs.c |2 +-
 src/mesa/drivers/dri/i965/brw_program.c|2 +-
 src/mesa/drivers/dri/i965/brw_sf.c |2 +-
 src/mesa/drivers/dri/i965/brw_shader.cpp   |4 +-
 src/mesa/drivers/dri/i965/brw_state_batch.c|2 +-
 src/mesa/drivers/dri/i965/brw_vec4.h   |2 +-
 src/mesa/drivers/dri/i965/brw_vec4_emit.cpp|2 +-
 .../drivers/dri/i965/brw_vec4_reg_allocate.cpp |2 +-
 src/mesa/drivers/dri/i965/brw_vs.c |2 +-
 src/mesa/drivers/dri/i965/brw_vtbl.c   |2 +-
 src/mesa/drivers/dri/i965/brw_wm.c |2 +-
 29 files changed, 244 insertions(+), 43 deletions(-)
 create mode 100644 src/mesa/drivers/dri/Android.mk
 create mode 100644 src/mesa/drivers/dri/common/Android.mk
 create mode 100644 src/mesa/drivers/dri/i965/Android.mk

-- 
1.7.6

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


[Mesa-dev] [PATCH 1/5] mesa: Build libmesa_dricore.a for Android

2011-08-29 Thread Chad Versace
libmesa_dricore.a is analogous to the libmesa.a built by the Autoconf
build.

v2

- Change libmesa_dricore from a shared library to a static library.
  I decided to make this change after realizing that libmesa_dricore.so
  indiscriminately exported all its symbols.

CC: Ian Romanick 
CC: Chia-I Wu 
Signed-off-by: Chad Versace 
---
 src/mesa/Android.mk |   29 +
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk
index 67808d4..5f0f4af 100644
--- a/src/mesa/Android.mk
+++ b/src/mesa/Android.mk
@@ -83,6 +83,35 @@ include $(BUILD_STATIC_LIBRARY)
 endif # MESA_BUILD_GALLIUM
 
 # ---
+# Build libmesa_dricore for DRI modules
+# ---
+
+ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libmesa_dricore
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+
+LOCAL_CFLAGS := \
+   $(common_CFLAGS) \
+   -DFEATURE_GL=1
+
+LOCAL_C_INCLUDES := \
+   $(common_C_INCLUDES)
+
+LOCAL_SRC_FILES := \
+$(MESA_SOURCES) \
+$(MESA_CXX_SOURCES) \
+$(common_ASM)
+
+include $(LOCAL_PATH)/Android.gen.mk
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+endif # MESA_BUILD_CLASSIC
+
+# ---
 # Build libmesa_glsl_utils
 #
 # It is used to avoid circular dependency between core mesa and glsl.
-- 
1.7.6

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


[Mesa-dev] [PATCH 2/5] make: Document imported variables

2011-08-29 Thread Chad Versace
In src/mesa/Android.mk, it is non-trivial to determine which variables are
imported by `include sources.mak`. So document them.

v2

- [olv] Add X86_sources to list of documented variables.

CC: Chia-I Wu 
Signed-off-by: Chad Versace 
---
 src/mesa/Android.mk |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk
index 5f0f4af..f21ba3a 100644
--- a/src/mesa/Android.mk
+++ b/src/mesa/Android.mk
@@ -25,6 +25,12 @@
 
 LOCAL_PATH := $(call my-dir)
 
+# Import the following variables:
+# MESA_CXX_SOURCES
+# MESA_GALLIUM_CXX_SOURCES
+# MESA_GALLIUM_SOURCES
+# MESA_SOURCES
+# X86_SOURCES
 include $(LOCAL_PATH)/sources.mak
 
 common_CFLAGS := \
-- 
1.7.6

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


[Mesa-dev] [PATCH 3/5] dri: Build libmesa_dri_common for Android

2011-08-29 Thread Chad Versace
libmesa_dri_common is a static library that contains the sources in
src/mesa/drivers/dri/common. Each DRI driver should link to it.

v2

- [olv] In toplevel Android.mk, replace subdir src/mesa/drivers/dri/common
  with src/mesa/drivers/dri, and add the subdir only if MESA_BUILD_CLASSIC.
- [olv] Remove redundant ifdef guard in src/mesa/drivers/dri/common/Android.mk

CC: Chia-I Wu 
Signed-off-by: Chad Versace 
---
 Android.mk |4 ++-
 src/mesa/drivers/dri/Android.mk|   27 +
 src/mesa/drivers/dri/common/Android.mk |   41 
 3 files changed, 71 insertions(+), 1 deletions(-)
 create mode 100644 src/mesa/drivers/dri/Android.mk
 create mode 100644 src/mesa/drivers/dri/common/Android.mk

diff --git a/Android.mk b/Android.mk
index bc4b74e..2ad83a0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -78,7 +78,9 @@ SUBDIRS := \
src/egl/main
 
 ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
-SUBDIRS += src/egl/drivers/dri2
+SUBDIRS += \
+   src/egl/drivers/dri2 \
+   src/mesa/drivers/dri
 endif
 
 ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk
new file mode 100644
index 000..05b02cb
--- /dev/null
+++ b/src/mesa/drivers/dri/Android.mk
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2011 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+SUBDIRS := common
+
+include $(foreach d, $(SUBDIRS), $(LOCAL_PATH)/$(d)/Android.mk)
diff --git a/src/mesa/drivers/dri/common/Android.mk 
b/src/mesa/drivers/dri/common/Android.mk
new file mode 100644
index 000..76464a1
--- /dev/null
+++ b/src/mesa/drivers/dri/common/Android.mk
@@ -0,0 +1,41 @@
+#
+# Mesa 3-D graphics library
+#
+# Copyright (C) 2011 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+#
+# Build libmesa_dri_common
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+include $(LOCAL_PATH)/Makefile.sources
+
+LOCAL_MODULE := libmesa_dri_common
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+
+LOCAL_C_INCLUDES := $(MESA_DRI_C_INCLUDES)
+LOCAL_SRC_FILES := $(mesa_dri_common_SOURCES)
+
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
-- 
1.7.6

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


[Mesa-dev] [PATCH 4/5] i965: Fix Android build by removing relative includes

2011-08-29 Thread Chad Versace
Replace each occurence of
#include "../glsl/*.h"
with
#include "glsl/*.h"

v2

- [idr] Eliminated spurious whitespace.

CC: Ian Romanick 
Signed-off-by: Chad Versace 
---
 src/mesa/drivers/dri/i965/brw_clip.c   |2 +-
 src/mesa/drivers/dri/i965/brw_context.c|2 +-
 .../drivers/dri/i965/brw_cubemap_normalize.cpp |4 ++--
 src/mesa/drivers/dri/i965/brw_eu.c |2 +-
 src/mesa/drivers/dri/i965/brw_eu_emit.c|2 +-
 src/mesa/drivers/dri/i965/brw_fs.cpp   |4 ++--
 src/mesa/drivers/dri/i965/brw_fs.h |4 ++--
 .../dri/i965/brw_fs_channel_expressions.cpp|6 +++---
 src/mesa/drivers/dri/i965/brw_fs_emit.cpp  |2 +-
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp  |6 +++---
 .../dri/i965/brw_fs_schedule_instructions.cpp  |6 +++---
 .../drivers/dri/i965/brw_fs_vector_splitting.cpp   |   10 +-
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp   |6 +++---
 src/mesa/drivers/dri/i965/brw_gs.c |2 +-
 src/mesa/drivers/dri/i965/brw_program.c|2 +-
 src/mesa/drivers/dri/i965/brw_sf.c |2 +-
 src/mesa/drivers/dri/i965/brw_shader.cpp   |4 ++--
 src/mesa/drivers/dri/i965/brw_state_batch.c|2 +-
 src/mesa/drivers/dri/i965/brw_vec4.h   |2 +-
 src/mesa/drivers/dri/i965/brw_vec4_emit.cpp|2 +-
 .../drivers/dri/i965/brw_vec4_reg_allocate.cpp |2 +-
 src/mesa/drivers/dri/i965/brw_vs.c |2 +-
 src/mesa/drivers/dri/i965/brw_vtbl.c   |2 +-
 src/mesa/drivers/dri/i965/brw_wm.c |2 +-
 24 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_clip.c 
b/src/mesa/drivers/dri/i965/brw_clip.c
index d82206b..b49c9f4 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.c
+++ b/src/mesa/drivers/dri/i965/brw_clip.c
@@ -42,7 +42,7 @@
 #include "brw_state.h"
 #include "brw_clip.h"
 
-#include "../glsl/ralloc.h"
+#include "glsl/ralloc.h"
 
 #define FRONT_UNFILLED_BIT  0x1
 #define BACK_UNFILLED_BIT   0x2
diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c
index e00e248..898ad8a 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -40,7 +40,7 @@
 #include "brw_state.h"
 #include "intel_span.h"
 #include "tnl/t_pipeline.h"
-#include "../glsl/ralloc.h"
+#include "glsl/ralloc.h"
 
 /***
  * Mesa's Driver Functions
diff --git a/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp 
b/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
index 8574169..ff9485c 100644
--- a/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
+++ b/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
@@ -30,8 +30,8 @@
  * \author Eric Anholt 
  */
 
-#include "../glsl/glsl_types.h"
-#include "../glsl/ir.h"
+#include "glsl/glsl_types.h"
+#include "glsl/ir.h"
 
 class brw_cubemap_normalize_visitor : public ir_hierarchical_visitor {
 public:
diff --git a/src/mesa/drivers/dri/i965/brw_eu.c 
b/src/mesa/drivers/dri/i965/brw_eu.c
index c1f2520..0e04af9 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -34,7 +34,7 @@
 #include "brw_defines.h"
 #include "brw_eu.h"
 
-#include "../glsl/ralloc.h"
+#include "glsl/ralloc.h"
 
 /* Returns the corresponding conditional mod for swapping src0 and
  * src1 in e.g. CMP.
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c 
b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index c5013de..e8d0998 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -34,7 +34,7 @@
 #include "brw_defines.h"
 #include "brw_eu.h"
 
-#include "../glsl/ralloc.h"
+#include "glsl/ralloc.h"
 
 /***
  * Internal helper for constructing instructions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 0b0445e..8b85f3b 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -46,8 +46,8 @@ extern "C" {
 }
 #include "brw_shader.h"
 #include "brw_fs.h"
-#include "../glsl/glsl_types.h"
-#include "../glsl/ir_print_visitor.h"
+#include "glsl/glsl_types.h"
+#include "glsl/ir_print_visitor.h"
 
 #define MAX_INSTRUCTION (1 << 30)
 
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h 
b/src/mesa/drivers/dri/i965/brw_fs.h
index 10f45f3..49454a5 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -44,8 +44,8 @@ extern "C" {
 #include "brw_eu.h"
 #include "brw_wm.h"
 }
-#include "../glsl/glsl_types.h"
-#include "../glsl/ir.h"
+#include "glsl/glsl_types.h"
+#include "glsl/ir.h"
 
 enum register_file {
ARF = BRW_ARCHITECTURE_REGISTER_FILE,
diff --git a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp 
b/src/mesa/drivers/dri/i965/brw_fs

[Mesa-dev] [PATCH 5/5] i965: Build i965_dri.so for Android

2011-08-29 Thread Chad Versace
Compile tested only.

v2

- [olv] Update comments to include i965 in list of classic drivers.

CC: Ian Romanick 
CC: Chia-I Wu 
Signed-off-by: Chad Versace 
---
 Android.mk   |4 +-
 src/mesa/drivers/dri/Android.mk  |   35 +++
 src/mesa/drivers/dri/i965/Android.mk |   61 ++
 3 files changed, 98 insertions(+), 2 deletions(-)
 create mode 100644 src/mesa/drivers/dri/i965/Android.mk

diff --git a/Android.mk b/Android.mk
index 2ad83a0..7c7c55a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -23,7 +23,7 @@
 
 # BOARD_GPU_DRIVERS should be defined.  The valid values are
 #
-#   classic drivers:
+#   classic drivers: i965
 #   gallium drivers: swrast i915g nouveau r300g r600g vmwgfx
 #
 # The main target is libGLES_mesa.  For each classic driver enabled, a DRI
@@ -36,7 +36,7 @@ MESA_PYTHON2 := python
 DRM_TOP := external/drm
 DRM_GRALLOC_TOP := hardware/drm_gralloc
 
-classic_drivers :=
+classic_drivers := i965
 gallium_drivers := swrast i915g nouveau r300g r600g vmwgfx
 
 MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))
diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk
index 05b02cb..d3b7826 100644
--- a/src/mesa/drivers/dri/Android.mk
+++ b/src/mesa/drivers/dri/Android.mk
@@ -22,6 +22,41 @@
 
 LOCAL_PATH := $(call my-dir)
 
+# Import mesa_dri_common_INCLUDES.
+include $(LOCAL_PATH)/common/Makefile.sources
+
+#---
+# Variables common to all DRI drivers
+
+MESA_DRI_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/dri
+MESA_DRI_MODULE_UNSTRIPPED_PATH := 
$(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/dri
+
+MESA_DRI_C_INCLUDES := \
+   $(addprefix $(MESA_TOP)/, $(mesa_dri_common_INCLUDES)) \
+   $(DRM_TOP) \
+   $(DRM_TOP)/include/drm \
+   external/expat/lib
+
+MESA_DRI_WHOLE_STATIC_LIBRARIES := \
+   libmesa_glsl \
+   libmesa_dri_common \
+   libmesa_dricore
+
+MESA_DRI_SHARED_LIBRARIES := \
+   libcutils \
+   libdl \
+   libdrm \
+   libexpat \
+   libglapi \
+   liblog \
+
+#---
+# Build drivers and libmesa_dri_common
+
 SUBDIRS := common
 
+ifneq ($(filter i965, $(MESA_GPU_DRIVERS)),)
+   SUBDIRS += i965
+endif
+
 include $(foreach d, $(SUBDIRS), $(LOCAL_PATH)/$(d)/Android.mk)
diff --git a/src/mesa/drivers/dri/i965/Android.mk 
b/src/mesa/drivers/dri/i965/Android.mk
new file mode 100644
index 000..2a289dd
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/Android.mk
@@ -0,0 +1,61 @@
+#
+# Copyright (C) 2011 Intel Corporation
+# Copyright (C) 2010-2011 Chia-I Wu 
+# Copyright (C) 2010-2011 LunarG
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := i965_dri
+LOCAL_MODULE_PATH := $(MESA_DRI_MODULE_PATH)
+LOCAL_UNSTRIPPED_PATH := $(MESA_DRI_MODULE_UNSTRIPPED_PATH)
+
+# Import variables i965_*.
+include $(LOCAL_PATH)/Makefile.sources
+
+# Overriding LOCAL_CC below is an ugly workaround.  We cannot place -std=c99
+# in LOCAL_C_FLAGS because Android appends LOCAL_C_FLAGS to LOCAL_CPP_FLAGS.
+LOCAL_CC := $(CC) -std=c99
+
+LOCAL_C_FLAGS := \
+   $(MESA_DRI_C_FLAGS) \
+   -DI965
+
+LOCAL_C_INCLUDES := \
+   $(i965_INCLUDES) \
+   $(MESA_DRI_C_INCLUDES) \
+   $(DRM_TOP)/intel
+
+LOCAL_SRC_FILES := \
+   $(i965_C_SOURCES) \
+   $(i965_CXX_SOURCES) \
+   $(i965_ASM_SOURCES)
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+   $(MESA_DRI_WHOLE_STATIC_LIBRARIES)
+
+LOCAL_SHARED_LIBRARIES := \
+   $(MESA_DRI_SHARED_LIBRARIES) \
+   libdrm_intel
+
+include $(MESA_COMMON_MK)
+include $(BUILD_SHARED_LIBRARY)
-- 
1.7.6

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


Re: [Mesa-dev] [PATCH 15/21] mesa: Enable vertex programs by default, remove checks

2011-08-29 Thread Marek Olšák
On Mon, Aug 29, 2011 at 7:59 PM, Ian Romanick  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 08/27/2011 05:39 AM, Marek Olšák wrote:
>> Hi Ian,
>>
>> I was trying to enable NV_vertex_program without regressions in
>> st/mesa before, but these piglit tests were always failing and are still
>> failing with your patch:
>>
>> nv-add
>> nv-arl
>> nv-init-zero-addr
>> nv-init-zero-reg
>> nv-mov
>
> After digging around some more, I think everything except nouveau needs:
>
>    ctx->ShaderCompilerOptions[].EmitNVTempInitialization = true;
>
> I did that for r200 in patch 16/21.  If that fixes softpipe, we should
> just make that setting be the default.
>
>> r600g just fails or assertion-fails, but softpipe sometimes crashes
>> (e.g. in nv-init-zero-addr). That's the reason st/mesa doesn't support
>> NV_vertex_program currently.
>
> That's weird.  What's the assertion failure?  Is it some invalid
> instruction or something else?

These two:

../../src/gallium/auxiliary/tgsi/tgsi_ureg.h:863:ureg_writemask:
Assertion `reg.File != TGSI_FILE_NULL' failed.
../../src/gallium/auxiliary/tgsi/tgsi_ureg.h:909:ureg_src_indirect:
Assertion `addr.File == TGSI_FILE_ADDRESS || addr.File ==
TGSI_FILE_TEMPORARY' failed.

EmitNVTempInitialization fixes those assertions, but all the NV tests
still fail on softpipe and r600g.

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


[Mesa-dev] Missing integer "set" opcodes in Gallium

2011-08-29 Thread Bryan Cain
I somehow didn't notice this until now, but why are there no Gallium
"set" opcodes for integers that are equivalent to the SGT or SLE opcodes
for floats?  Does it have to do with available hardware features?

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


Re: [Mesa-dev] Missing integer "set" opcodes in Gallium

2011-08-29 Thread Brian Paul
On Mon, Aug 29, 2011 at 1:49 PM, Bryan Cain  wrote:
> I somehow didn't notice this until now, but why are there no Gallium
> "set" opcodes for integers that are equivalent to the SGT or SLE opcodes
> for floats?  Does it have to do with available hardware features?

It's probably just an oversight since we haven't used or needed
integer operators up until now.  I say go ahead and add what you need.

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


Re: [Mesa-dev] Missing integer "set" opcodes in Gallium

2011-08-29 Thread Zack Rusin
On Monday, August 29, 2011 03:49:03 PM Bryan Cain wrote:
> I somehow didn't notice this until now, but why are there no Gallium
> "set" opcodes for integers that are equivalent to the SGT or SLE opcodes
> for floats?  Does it have to do with available hardware features?

It's largely because D3D10 only implements those. It'd be interesting to find 
out whether d3d10 implements only those because of hardware support or whether 
they just wanted to cut down on the number of instructions (which is also 
reasonable). 
Either way though if GL needs those ops then, like Brian mentioned, it'd be a 
good idea to add them.

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


Re: [Mesa-dev] Missing integer "set" opcodes in Gallium

2011-08-29 Thread Zack Rusin
On Monday, August 29, 2011 04:02:08 PM Zack Rusin wrote:
> Either way though if GL needs those ops then, like Brian mentioned, it'd be
> a  good idea to add them.

Actually I think it seems easier to just flip the ops rather than add new 
instructions, i.e. change stuff like a > b, to b < a, and a <= b to b >= a. 
Just an opinion though, I don't have strong preferences here. 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Missing integer "set" opcodes in Gallium

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/29/2011 01:41 PM, Zack Rusin wrote:
> On Monday, August 29, 2011 04:02:08 PM Zack Rusin wrote:
>> Either way though if GL needs those ops then, like Brian mentioned, it'd be
>> a  good idea to add them.
> 
> Actually I think it seems easier to just flip the ops rather than add new 
> instructions, i.e. change stuff like a > b, to b < a, and a <= b to b >= a. 
> Just an opinion though, I don't have strong preferences here. 

For what it's worth, this is how most hardware implements many of the
floating-point set-on instructions.  It's even easier there because you
also have per-operand negation.  Implementing the full set as
instructions / pseudo-ops does have the advantage of making IR dumps a
lot more readable.  *shrug*
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5cBwYACgkQX1gOwKyEAw970gCfWcTEDyDYCnC8JelTcoNWnTI0
RRYAniUCKzykrqsRVkTnJVCDcVyc3Byd
=Izn1
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 20/21] mesa: Remove vertex program extension enable flags

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/27/2011 06:47 AM, Brian Paul wrote:
> On Sat, Aug 27, 2011 at 1:57 AM, Ian Romanick  wrote:
>> From: Ian Romanick 
>>
>> The following extensions are always enabled, and drivers do not have
>> to option to disable them:
>>
>>GL_ARB_vertex_program
>>GL_EXT_gpu_program_parameters
>>GL_NV_vertex_program
> 
> It seems that the assumption here is that we'll support these
> extensions in all drivers for the foreseeable future.
> 
> I'm thinking ahead a bit to OpenGL 3.2 and core profiles.  When we get
> to 3.2 support, I'd like to support core profile contexts which won't
> have these legacy extensions.  So when someone creates a 3.2 core
> profile context and accidentally does
> glEnable(GL_VERTEX_PROGRAM_TWO_SIDE_ARB) we should catch that and
> generate an error.
> 
> If we're removing the internal flags and checks for these extensions,
> how would we do that?

That's a good point, and I think this is similar to Chia-I's comment on
patch 03/21 about OpenGL ES.  What we currently have isn't very
maintainable for either situation.  Each driver has to maintain a
different set of extensions that it exposes in different APIs /
contexts.  I have a couple ideas of how we could accomplish that, but I
want to spend a little more time looking into each to see the possible
implications.

I'll spin a reduced version of this series that should be less
objectionable.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5cB/4ACgkQX1gOwKyEAw+pNACfZOxS/MI8j808BfwZy6f3qQgv
j5oAn3e/+ggOhnk+i/F27r5OI99seaNJ
=DdrG
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 15/21] mesa: Enable vertex programs by default, remove checks

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/29/2011 12:46 PM, Marek Olšák wrote:
> On Mon, Aug 29, 2011 at 7:59 PM, Ian Romanick  wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> On 08/27/2011 05:39 AM, Marek Olšák wrote:
>>> Hi Ian,
>>>
>>> I was trying to enable NV_vertex_program without regressions in
>>> st/mesa before, but these piglit tests were always failing and are still
>>> failing with your patch:
>>>
>>> nv-add
>>> nv-arl
>>> nv-init-zero-addr
>>> nv-init-zero-reg
>>> nv-mov
>>
>> After digging around some more, I think everything except nouveau needs:
>>
>>ctx->ShaderCompilerOptions[].EmitNVTempInitialization = true;
>>
>> I did that for r200 in patch 16/21.  If that fixes softpipe, we should
>> just make that setting be the default.
>>
>>> r600g just fails or assertion-fails, but softpipe sometimes crashes
>>> (e.g. in nv-init-zero-addr). That's the reason st/mesa doesn't support
>>> NV_vertex_program currently.
>>
>> That's weird.  What's the assertion failure?  Is it some invalid
>> instruction or something else?
> 
> These two:
> 
> ../../src/gallium/auxiliary/tgsi/tgsi_ureg.h:863:ureg_writemask:
> Assertion `reg.File != TGSI_FILE_NULL' failed.
> ../../src/gallium/auxiliary/tgsi/tgsi_ureg.h:909:ureg_src_indirect:
> Assertion `addr.File == TGSI_FILE_ADDRESS || addr.File ==
> TGSI_FILE_TEMPORARY' failed.
> 
> EmitNVTempInitialization fixes those assertions, but all the NV tests
> still fail on softpipe and r600g.

That's exactly the opposite of what I expected.  Okay, this has my
curiosity.  I'll have to dig into it...
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5cCFcACgkQX1gOwKyEAw/nfwCfcnFGD0i31eJI6+hsvN0wbcWY
IbcAn2pRmnoyxS87qujh7aDrTk49yEx5
=DzeO
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 01/20] glsl: Silence several "warning: unused parameter"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

---
 src/glsl/ast_to_hir.cpp   |6 ++
 src/glsl/builtin_stubs.cpp|1 +
 src/glsl/glcpp/glcpp.c|1 +
 src/glsl/ir_function_detect_recursion.cpp |4 
 src/glsl/lower_jumps.cpp  |1 +
 src/glsl/opt_discard_simplification.cpp   |1 +
 src/glsl/opt_if_simplification.cpp|1 +
 src/glsl/standalone_scaffolding.cpp   |1 +
 8 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 9e7496b..5af45e1 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2958,6 +2958,12 @@ ast_function::hir(exec_list *instructions,
 
const char *const name = identifier;
 
+   /* New functions are always added to the top-level IR instruction stream,
+* so this instruction list pointer is ignored.  See also emit_function
+* (called below).
+*/
+   (void) instructions;
+
/* From page 21 (page 27 of the PDF) of the GLSL 1.20 spec,
 *
 *   "Function declarations (prototypes) cannot occur inside of functions;
diff --git a/src/glsl/builtin_stubs.cpp b/src/glsl/builtin_stubs.cpp
index 00b3294..dfa5d32 100644
--- a/src/glsl/builtin_stubs.cpp
+++ b/src/glsl/builtin_stubs.cpp
@@ -35,4 +35,5 @@ _mesa_glsl_release_functions(void)
 void
 _mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state)
 {
+   (void) state;
 }
diff --git a/src/glsl/glcpp/glcpp.c b/src/glsl/glcpp/glcpp.c
index 3252891..e461a65 100644
--- a/src/glsl/glcpp/glcpp.c
+++ b/src/glsl/glcpp/glcpp.c
@@ -34,6 +34,7 @@ void
 _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
struct gl_shader *sh)
 {
+   (void) ctx;
*ptr = sh;
 }
 
diff --git a/src/glsl/ir_function_detect_recursion.cpp 
b/src/glsl/ir_function_detect_recursion.cpp
index 8f805bf..890bc45 100644
--- a/src/glsl/ir_function_detect_recursion.cpp
+++ b/src/glsl/ir_function_detect_recursion.cpp
@@ -289,6 +289,8 @@ emit_errors_unlinked(const void *key, void *data, void 
*closure)
function *f = (function *) data;
YYLTYPE loc;
 
+   (void) key;
+
char *proto = prototype_string(f->sig->return_type,
  f->sig->function_name(),
  &f->sig->parameters);
@@ -308,6 +310,8 @@ emit_errors_linked(const void *key, void *data, void 
*closure)
   (struct gl_shader_program *) closure;
function *f = (function *) data;
 
+   (void) key;
+
char *proto = prototype_string(f->sig->return_type,
  f->sig->function_name(),
  &f->sig->parameters);
diff --git a/src/glsl/lower_jumps.cpp b/src/glsl/lower_jumps.cpp
index 6187499..92813f5 100644
--- a/src/glsl/lower_jumps.cpp
+++ b/src/glsl/lower_jumps.cpp
@@ -438,6 +438,7 @@ struct ir_lower_jumps_visitor : public 
ir_control_flow_visitor {
* satisfied, because discard statements can't contain other
* statements.
*/
+  (void) ir;
}
 
enum jump_strength get_jump_strength(ir_instruction* ir)
diff --git a/src/glsl/opt_discard_simplification.cpp 
b/src/glsl/opt_discard_simplification.cpp
index a19947d..ba4981b 100644
--- a/src/glsl/opt_discard_simplification.cpp
+++ b/src/glsl/opt_discard_simplification.cpp
@@ -138,6 +138,7 @@ is_only_instruction(ir_discard *discard)
 ir_visitor_status
 discard_simplifier::visit_enter(ir_assignment *ir)
 {
+   (void) ir;
return visit_continue_with_parent;
 }
 
diff --git a/src/glsl/opt_if_simplification.cpp 
b/src/glsl/opt_if_simplification.cpp
index 29b1d18..940dd08 100644
--- a/src/glsl/opt_if_simplification.cpp
+++ b/src/glsl/opt_if_simplification.cpp
@@ -49,6 +49,7 @@ public:
 ir_visitor_status
 ir_if_simplification_visitor::visit_enter(ir_assignment *ir)
 {
+   (void) ir;
return visit_continue_with_parent;
 }
 
diff --git a/src/glsl/standalone_scaffolding.cpp 
b/src/glsl/standalone_scaffolding.cpp
index bbd7bb9..72aa1e4 100644
--- a/src/glsl/standalone_scaffolding.cpp
+++ b/src/glsl/standalone_scaffolding.cpp
@@ -37,6 +37,7 @@ void
 _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
struct gl_shader *sh)
 {
+   (void) ctx;
*ptr = sh;
 }
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 02/20] glsl: Silence "ast_to_hir.cpp:1984:25: warning: comparison of unsigned expression >= 0 is always true"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

ast_type_qualifier::location should have been a signed integer from
the beginning, and the giant comment in
apply_type_qualifier_to_variable explains why.
---
 src/glsl/ast.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index d1de227..532347d 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -372,7 +372,7 @@ struct ast_type_qualifier {
 * \note
 * This field is only valid if \c explicit_location is set.
 */
-   unsigned location;
+   int location;
 
/**
 * Return true if and only if an interpolation qualifier is present.
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 03/20] intel: Silence many "intel_batchbuffer.h:97:39: warning: comparison between signed and unsigned integer expressions"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

---
 src/mesa/drivers/dri/intel/intel_batchbuffer.h |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h 
b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
index fb4134d..90dc0ed 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
@@ -57,9 +57,11 @@ static INLINE uint32_t float_as_int(float f)
  * be passed as structs rather than dwords, but that's a little bit of
  * work...
  */
-static INLINE GLint
+static INLINE unsigned
 intel_batchbuffer_space(struct intel_context *intel)
 {
+   assert((intel->batch.state_batch_offset - intel->batch.reserved_space)
+ >= intel->batch.used*4);
return (intel->batch.state_batch_offset - intel->batch.reserved_space) - 
intel->batch.used*4;
 }
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 04/20] intel: Silence several "warning: unused parameter"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

---
 src/mesa/drivers/dri/intel/intel_buffer_objects.c |   47 ++---
 1 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c 
b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index d908975..0acc3a1 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -151,6 +151,12 @@ intel_bufferobj_data(struct gl_context * ctx,
struct intel_context *intel = intel_context(ctx);
struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
 
+   /* Part of the ABI, but this function doesn't use it.
+*/
+#ifndef I915
+   (void) target;
+#endif
+
intel_obj->Base.Size = size;
intel_obj->Base.Usage = usage;
 
@@ -743,9 +749,7 @@ intel_bufferobj_copy_subdata(struct gl_context *ctx,
 
 #if FEATURE_APPLE_object_purgeable
 static GLenum
-intel_buffer_purgeable(struct gl_context * ctx,
-   drm_intel_bo *buffer,
-   GLenum option)
+intel_buffer_purgeable(drm_intel_bo *buffer)
 {
int retained = 0;
 
@@ -764,7 +768,7 @@ intel_buffer_object_purgeable(struct gl_context * ctx,
 
intel = intel_buffer_object (obj);
if (intel->buffer != NULL)
-  return intel_buffer_purgeable (ctx, intel->buffer, option);
+  return intel_buffer_purgeable(intel->buffer);
 
if (option == GL_RELEASED_APPLE) {
   if (intel->sys_buffer != NULL) {
@@ -775,10 +779,8 @@ intel_buffer_object_purgeable(struct gl_context * ctx,
   return GL_RELEASED_APPLE;
} else {
   /* XXX Create the buffer and madvise(MADV_DONTNEED)? */
-  return intel_buffer_purgeable (ctx,
- intel_bufferobj_buffer(intel_context(ctx),
-intel, INTEL_READ),
- option);
+  return intel_buffer_purgeable(intel_bufferobj_buffer(intel_context(ctx),
+  intel, INTEL_READ));
}
 }
 
@@ -789,11 +791,14 @@ intel_texture_object_purgeable(struct gl_context * ctx,
 {
struct intel_texture_object *intel;
 
+   (void) ctx;
+   (void) option;
+
intel = intel_texture_object(obj);
if (intel->mt == NULL || intel->mt->region == NULL)
   return GL_RELEASED_APPLE;
 
-   return intel_buffer_purgeable (ctx, intel->mt->region->buffer, option);
+   return intel_buffer_purgeable(intel->mt->region->buffer);
 }
 
 static GLenum
@@ -803,17 +808,18 @@ intel_render_object_purgeable(struct gl_context * ctx,
 {
struct intel_renderbuffer *intel;
 
+   (void) ctx;
+   (void) option;
+
intel = intel_renderbuffer(obj);
if (intel->region == NULL)
   return GL_RELEASED_APPLE;
 
-   return intel_buffer_purgeable (ctx, intel->region->buffer, option);
+   return intel_buffer_purgeable(intel->region->buffer);
 }
 
 static GLenum
-intel_buffer_unpurgeable(struct gl_context * ctx,
- drm_intel_bo *buffer,
- GLenum option)
+intel_buffer_unpurgeable(drm_intel_bo *buffer)
 {
int retained;
 
@@ -829,7 +835,10 @@ intel_buffer_object_unpurgeable(struct gl_context * ctx,
 struct gl_buffer_object *obj,
 GLenum option)
 {
-   return intel_buffer_unpurgeable (ctx, intel_buffer_object (obj)->buffer, 
option);
+   (void) ctx;
+   (void) option;
+
+   return intel_buffer_unpurgeable(intel_buffer_object (obj)->buffer);
 }
 
 static GLenum
@@ -839,11 +848,14 @@ intel_texture_object_unpurgeable(struct gl_context * ctx,
 {
struct intel_texture_object *intel;
 
+   (void) ctx;
+   (void) option;
+
intel = intel_texture_object(obj);
if (intel->mt == NULL || intel->mt->region == NULL)
   return GL_UNDEFINED_APPLE;
 
-   return intel_buffer_unpurgeable (ctx, intel->mt->region->buffer, option);
+   return intel_buffer_unpurgeable(intel->mt->region->buffer);
 }
 
 static GLenum
@@ -853,11 +865,14 @@ intel_render_object_unpurgeable(struct gl_context * ctx,
 {
struct intel_renderbuffer *intel;
 
+   (void) ctx;
+   (void) option;
+
intel = intel_renderbuffer(obj);
if (intel->region == NULL)
   return GL_UNDEFINED_APPLE;
 
-   return intel_buffer_unpurgeable (ctx, intel->region->buffer, option);
+   return intel_buffer_unpurgeable(intel->region->buffer);
 }
 #endif
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 05/20] intel: Silence "warning: unused parameter ‘intel’"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

The intel_context was not used in any of these functions, so remove it.
---
 src/mesa/drivers/dri/intel/intel_buffer_objects.c |   10 --
 src/mesa/drivers/dri/intel/intel_buffer_objects.h |3 +--
 src/mesa/drivers/dri/intel/intel_tex_validate.c   |5 ++---
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c 
b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index 0acc3a1..df52656 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -82,8 +82,7 @@ intel_bufferobj_alloc(struct gl_context * ctx, GLuint name, 
GLenum target)
 /* Break the COW tie to the region.  The region gets to keep the data.
  */
 void
-intel_bufferobj_release_region(struct intel_context *intel,
-   struct intel_buffer_object *intel_obj)
+intel_bufferobj_release_region(struct intel_buffer_object *intel_obj)
 {
assert(intel_obj->region->buffer == intel_obj->buffer);
intel_obj->region->pbo = NULL;
@@ -111,7 +110,6 @@ intel_bufferobj_cow(struct intel_context *intel,
 static void
 intel_bufferobj_free(struct gl_context * ctx, struct gl_buffer_object *obj)
 {
-   struct intel_context *intel = intel_context(ctx);
struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
 
assert(intel_obj);
@@ -125,7 +123,7 @@ intel_bufferobj_free(struct gl_context * ctx, struct 
gl_buffer_object *obj)
 
free(intel_obj->sys_buffer);
if (intel_obj->region) {
-  intel_bufferobj_release_region(intel, intel_obj);
+  intel_bufferobj_release_region(intel_obj);
}
 
drm_intel_bo_unreference(intel_obj->buffer);
@@ -163,7 +161,7 @@ intel_bufferobj_data(struct gl_context * ctx,
assert(!obj->Pointer); /* Mesa should have unmapped it */
 
if (intel_obj->region)
-  intel_bufferobj_release_region(intel, intel_obj);
+  intel_bufferobj_release_region(intel_obj);
 
if (intel_obj->buffer != NULL)
   release_buffer(intel_obj);
@@ -516,7 +514,7 @@ intel_bufferobj_buffer(struct intel_context *intel,
   if (flag == INTEL_WRITE_PART)
  intel_bufferobj_cow(intel, intel_obj);
   else if (flag == INTEL_WRITE_FULL) {
- intel_bufferobj_release_region(intel, intel_obj);
+ intel_bufferobj_release_region(intel_obj);
 intel_bufferobj_alloc_buffer(intel, intel_obj);
   }
}
diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.h 
b/src/mesa/drivers/dri/intel/intel_buffer_objects.h
index 81ee21f..d75cdbf 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.h
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.h
@@ -106,8 +106,7 @@ intel_buffer_object(struct gl_buffer_object *obj)
  */
 void intel_bufferobj_cow(struct intel_context *intel,
  struct intel_buffer_object *intel_obj);
-void intel_bufferobj_release_region(struct intel_context *intel,
-struct intel_buffer_object *intel_obj);
+void intel_bufferobj_release_region(struct intel_buffer_object *intel_obj);
 
 
 #endif
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c 
b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index 31ac689..f47f12a 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c
@@ -14,8 +14,7 @@
  * but BaseLevel.
  */
 static void
-intel_update_max_level(struct intel_context *intel,
-  struct intel_texture_object *intelObj,
+intel_update_max_level(struct intel_texture_object *intelObj,
   struct gl_sampler_object *sampler)
 {
struct gl_texture_object *tObj = &intelObj->base;
@@ -87,7 +86,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, 
GLuint unit)
 
/* What levels must the tree include at a minimum?
 */
-   intel_update_max_level(intel, intelObj, sampler);
+   intel_update_max_level(intelObj, sampler);
firstImage = intel_texture_image(tObj->Image[0][tObj->BaseLevel]);
 
/* Fallback case:
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 06/20] intel: Silence "warning: unused parameter ‘fb’"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

The gl_framebuffer was not used in intel_draw_buffer, so remove it.
---
 src/mesa/drivers/dri/intel/intel_buffers.c |2 +-
 src/mesa/drivers/dri/intel/intel_buffers.h |2 +-
 src/mesa/drivers/dri/intel/intel_context.c |4 ++--
 src/mesa/drivers/dri/intel/intel_fbo.c |6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c 
b/src/mesa/drivers/dri/intel/intel_buffers.c
index fccdcbd..8341cbf 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -97,7 +97,7 @@ intelDrawBuffer(struct gl_context * ctx, GLenum mode)
 dri2InvalidateDrawable(intel->driContext->driDrawablePriv);
}
 
-   intel_draw_buffer(ctx, ctx->DrawBuffer);
+   intel_draw_buffer(ctx);
 }
 
 
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.h 
b/src/mesa/drivers/dri/intel/intel_buffers.h
index a7e7797..896ec5a 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.h
+++ b/src/mesa/drivers/dri/intel/intel_buffers.h
@@ -43,7 +43,7 @@ extern struct intel_region *intel_drawbuf_region(struct 
intel_context *intel);
 extern void intel_check_front_buffer_rendering(struct intel_context *intel);
 
 static inline void
-intel_draw_buffer(struct gl_context * ctx, struct gl_framebuffer *fb)
+intel_draw_buffer(struct gl_context * ctx)
 {
struct intel_context *intel = intel_context(ctx);
 
diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
index 14342ef..6ba7e10 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -409,7 +409,7 @@ intel_prepare_render(struct intel_context *intel)
if (drawable && drawable->dri2.stamp != driContext->dri2.draw_stamp) {
   if (drawable->lastStamp != drawable->dri2.stamp)
 intel_update_renderbuffers(driContext, drawable);
-  intel_draw_buffer(&intel->ctx, intel->ctx.DrawBuffer);
+  intel_draw_buffer(&intel->ctx);
   driContext->dri2.draw_stamp = drawable->dri2.stamp;
}
 
@@ -979,7 +979,7 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
* is NULL at that point.  We can't call _mesa_makecurrent()
* first, since we need the buffer size for the initial
* viewport.  So just call intel_draw_buffer() again here. */
-  intel_draw_buffer(&intel->ctx, intel->ctx.DrawBuffer);
+  intel_draw_buffer(&intel->ctx);
}
else {
   _mesa_make_current(NULL, NULL, NULL);
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c 
b/src/mesa/drivers/dri/intel/intel_fbo.c
index 754f9f2..8421b69 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -437,7 +437,7 @@ intel_bind_framebuffer(struct gl_context * ctx, GLenum 
target,
struct gl_framebuffer *fb, struct gl_framebuffer 
*fbread)
 {
if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
-  intel_draw_buffer(ctx, fb);
+  intel_draw_buffer(ctx);
}
else {
   /* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */
@@ -458,7 +458,7 @@ intel_framebuffer_renderbuffer(struct gl_context * ctx,
intel_flush(ctx);
 
_mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb);
-   intel_draw_buffer(ctx, fb);
+   intel_draw_buffer(ctx);
 }
 
 static bool
@@ -749,7 +749,7 @@ intel_render_texture(struct gl_context * ctx,
}
 #endif
/* update drawing region, etc */
-   intel_draw_buffer(ctx, fb);
+   intel_draw_buffer(ctx);
 }
 
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 07/20] intel: Silence several "warning: unused parameter"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

The intel_context and tiling parameters were not used by any if the
i9[14]5_miptree_layout or the functions they call, and the tiling parameter was
not used by brw_miptree_layout.  Remove the unnecessary parameters.
---
 src/mesa/drivers/dri/i915/i915_tex_layout.c|   40 ---
 src/mesa/drivers/dri/i965/brw_tex_layout.c |7 ++--
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |   16 -
 src/mesa/drivers/dri/intel/intel_mipmap_tree.h |   11 ++-
 src/mesa/drivers/dri/intel/intel_tex_layout.c  |4 +--
 src/mesa/drivers/dri/intel/intel_tex_layout.h  |5 +--
 6 files changed, 30 insertions(+), 53 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c 
b/src/mesa/drivers/dri/i915/i915_tex_layout.c
index e6a4711..45ca38e 100644
--- a/src/mesa/drivers/dri/i915/i915_tex_layout.c
+++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c
@@ -112,9 +112,7 @@ static GLint bottom_offsets[6] = {
  *
  */
 static void
-i915_miptree_layout_cube(struct intel_context *intel,
-struct intel_mipmap_tree * mt,
-uint32_t tiling)
+i915_miptree_layout_cube(struct intel_mipmap_tree * mt)
 {
const GLuint dim = mt->width0;
GLuint face;
@@ -156,9 +154,7 @@ i915_miptree_layout_cube(struct intel_context *intel,
 }
 
 static void
-i915_miptree_layout_3d(struct intel_context *intel,
-  struct intel_mipmap_tree * mt,
-  uint32_t tiling)
+i915_miptree_layout_3d(struct intel_mipmap_tree * mt)
 {
GLuint width = mt->width0;
GLuint height = mt->height0;
@@ -201,9 +197,7 @@ i915_miptree_layout_3d(struct intel_context *intel,
 }
 
 static void
-i915_miptree_layout_2d(struct intel_context *intel,
-  struct intel_mipmap_tree * mt,
-  uint32_t tiling)
+i915_miptree_layout_2d(struct intel_mipmap_tree * mt)
 {
GLuint width = mt->width0;
GLuint height = mt->height0;
@@ -231,20 +225,19 @@ i915_miptree_layout_2d(struct intel_context *intel,
 }
 
 GLboolean
-i915_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree * mt,
-   uint32_t tiling)
+i915_miptree_layout(struct intel_mipmap_tree * mt)
 {
switch (mt->target) {
case GL_TEXTURE_CUBE_MAP:
-  i915_miptree_layout_cube(intel, mt, tiling);
+  i915_miptree_layout_cube(mt);
   break;
case GL_TEXTURE_3D:
-  i915_miptree_layout_3d(intel, mt, tiling);
+  i915_miptree_layout_3d(mt);
   break;
case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
case GL_TEXTURE_RECTANGLE_ARB:
-  i915_miptree_layout_2d(intel, mt, tiling);
+  i915_miptree_layout_2d(mt);
   break;
default:
   _mesa_problem(NULL, "Unexpected tex target in i915_miptree_layout()");
@@ -319,9 +312,7 @@ i915_miptree_layout(struct intel_context *intel, struct 
intel_mipmap_tree * mt,
  */
 
 static void
-i945_miptree_layout_cube(struct intel_context *intel,
-struct intel_mipmap_tree * mt,
-uint32_t tiling)
+i945_miptree_layout_cube(struct intel_mipmap_tree * mt)
 {
const GLuint dim = mt->width0;
GLuint face;
@@ -411,9 +402,7 @@ i945_miptree_layout_cube(struct intel_context *intel,
 }
 
 static void
-i945_miptree_layout_3d(struct intel_context *intel,
-  struct intel_mipmap_tree * mt,
-  uint32_t tiling)
+i945_miptree_layout_3d(struct intel_mipmap_tree * mt)
 {
GLuint width = mt->width0;
GLuint height = mt->height0;
@@ -467,23 +456,22 @@ i945_miptree_layout_3d(struct intel_context *intel,
 }
 
 GLboolean
-i945_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree * mt,
-   uint32_t tiling)
+i945_miptree_layout(struct intel_mipmap_tree * mt)
 {
switch (mt->target) {
case GL_TEXTURE_CUBE_MAP:
   if (mt->compressed)
-i945_miptree_layout_cube(intel, mt, tiling);
+i945_miptree_layout_cube(mt);
   else
-i915_miptree_layout_cube(intel, mt, tiling);
+i915_miptree_layout_cube(mt);
   break;
case GL_TEXTURE_3D:
-  i945_miptree_layout_3d(intel, mt, tiling);
+  i945_miptree_layout_3d(mt);
   break;
case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
case GL_TEXTURE_RECTANGLE_ARB:
-  i945_miptree_layout_2d(intel, mt, tiling, 1);
+  i945_miptree_layout_2d(mt, 1);
   break;
default:
   _mesa_problem(NULL, "Unexpected tex target in i945_miptree_layout()");
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c 
b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index 46a417a..d3cbb72 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -40,8 +40,7 @@
 #define FILE_DEBUG_FLAG DEBUG_MIPTREE
 
 GLboolean brw_miptree_layout(struct intel_context *intel,
-struct intel_mipmap_tree *mt,
-uint32_t tiling)
+struct intel_mipm

[Mesa-dev] [PATCH 09/20] intel: Silence "warning: unused parameter ‘depth0’"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

The depth0 parameter was not used in intel_miptree_create_for_region,
so remove it.  All of the places that call this function, pass 1 for
that parameter, and the place where it looks like it should have been
used (the call to intel_miptree_create_internal) also had 1 hard
coded.
---
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |3 +--
 src/mesa/drivers/dri/intel/intel_mipmap_tree.h |3 +--
 src/mesa/drivers/dri/intel/intel_tex_image.c   |5 ++---
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 72cdd4c..7739fa4 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -161,8 +161,7 @@ struct intel_mipmap_tree *
 intel_miptree_create_for_region(struct intel_context *intel,
GLenum target,
gl_format format,
-   struct intel_region *region,
-   GLuint depth0)
+   struct intel_region *region)
 {
struct intel_mipmap_tree *mt;
 
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h 
b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
index ff746d7..7f20319 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
@@ -148,8 +148,7 @@ struct intel_mipmap_tree *
 intel_miptree_create_for_region(struct intel_context *intel,
GLenum target,
gl_format format,
-   struct intel_region *region,
-   GLuint depth0);
+   struct intel_region *region);
 
 int intel_miptree_pitch_align (struct intel_context *intel,
   struct intel_mipmap_tree *mt,
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c 
b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 29a6d3b..2bbd952 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -790,8 +790,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
   texFormat = MESA_FORMAT_ARGB;
}
 
-   mt = intel_miptree_create_for_region(intel, target, texFormat,
-   rb->region, 1);
+   mt = intel_miptree_create_for_region(intel, target, texFormat, rb->region);
if (mt == NULL)
return;
 
@@ -853,7 +852,7 @@ intel_image_target_texture_2d(struct gl_context *ctx, 
GLenum target,
   return;
 
mt = intel_miptree_create_for_region(intel, target, image->format,
-   image->region, 1);
+   image->region);
if (mt == NULL)
return;
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 08/20] intel: Silence "warning: unused parameter ‘target’"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

The GLenum target parameter was not used in intel_copy_texsubimage, so
remove it.
---
 src/mesa/drivers/dri/intel/intel_fbo.c  |2 +-
 src/mesa/drivers/dri/intel/intel_tex.h  |1 -
 src/mesa/drivers/dri/intel/intel_tex_copy.c |5 ++---
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c 
b/src/mesa/drivers/dri/intel/intel_fbo.c
index 8421b69..6068e3c 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -894,7 +894,7 @@ intel_blit_framebuffer_copy_tex_sub_image(struct gl_context 
*ctx,
 _mesa_select_tex_image(ctx, texObj, target, dstLevel);
  GLenum internalFormat = texImage->InternalFormat;
 
- if (intel_copy_texsubimage(intel_context(ctx), target,
+ if (intel_copy_texsubimage(intel_context(ctx),
 intel_texture_image(texImage),
 internalFormat,
 dstX0, dstY0,
diff --git a/src/mesa/drivers/dri/intel/intel_tex.h 
b/src/mesa/drivers/dri/intel/intel_tex.h
index 1eaa3cc..ff6719c4 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.h
+++ b/src/mesa/drivers/dri/intel/intel_tex.h
@@ -72,7 +72,6 @@ void intel_tex_image_s8z24_gather(struct intel_context *intel,
 int intel_compressed_num_bytes(GLuint mesaFormat);
 
 GLboolean intel_copy_texsubimage(struct intel_context *intel,
- GLenum target,
  struct intel_texture_image *intelImage,
  GLenum internalFormat,
  GLint dstx, GLint dsty,
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c 
b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index 600bd12..139847b 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -65,7 +65,6 @@ get_teximage_readbuffer(struct intel_context *intel, GLenum 
internalFormat)
 
 GLboolean
 intel_copy_texsubimage(struct intel_context *intel,
-   GLenum target,
struct intel_texture_image *intelImage,
GLenum internalFormat,
GLint dstx, GLint dsty,
@@ -179,7 +178,7 @@ intelCopyTexSubImage1D(struct gl_context * ctx, GLenum 
target, GLint level,
/* Need to check texture is compatible with source format. 
 */
 
-   if (!intel_copy_texsubimage(intel_context(ctx), target,
+   if (!intel_copy_texsubimage(intel_context(ctx),
intel_texture_image(texImage),
internalFormat, xoffset, 0, x, y, width, 1)) {
   fallback_debug("%s - fallback to swrast\n", __FUNCTION__);
@@ -203,7 +202,7 @@ intelCopyTexSubImage2D(struct gl_context * ctx, GLenum 
target, GLint level,
/* Need to check texture is compatible with source format. 
 */
 
-   if (!intel_copy_texsubimage(intel_context(ctx), target,
+   if (!intel_copy_texsubimage(intel_context(ctx),
intel_texture_image(texImage),
internalFormat,
xoffset, yoffset, x, y, width, height)) {
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 11/20] intel: Silence several "warning: unused parameter"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

Trivially silence the compiler by adding '(void) foo;' for each unused
parameter.  These parameters could not be removed.  They are part of
interface used elsewhere in Mesa, and some of the other customers
actually use these parameters.
---
 src/mesa/drivers/dri/intel/intel_tex.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex.c 
b/src/mesa/drivers/dri/intel/intel_tex.c
index 4faa01a..f979523 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -24,6 +24,8 @@ intelNewTextureObject(struct gl_context * ctx, GLuint name, 
GLenum target)
 {
struct intel_texture_object *obj = CALLOC_STRUCT(intel_texture_object);
 
+   (void) ctx;
+
DBG("%s\n", __FUNCTION__);
_mesa_initialize_texture_object(&obj->base, name, target);
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 10/20] intel: Silence several "warning: unused parameter"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

The internalFormat, format, and type parameters were not used by
either try_pbo_upload or try_pbo_zcopy, so remove them.  The width
parameter was also not used by try_pbo_zcopy (because it doesn't
actually copy anything), so remove it too.
---
 src/mesa/drivers/dri/intel/intel_tex_image.c |   17 -
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c 
b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 2bbd952..2ef5d55 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -160,9 +160,7 @@ static GLboolean
 try_pbo_upload(struct intel_context *intel,
struct intel_texture_image *intelImage,
const struct gl_pixelstore_attrib *unpack,
-   GLint internalFormat,
-   GLint width, GLint height,
-   GLenum format, GLenum type, const void *pixels)
+   GLint width, GLint height, const void *pixels)
 {
struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
GLuint src_offset, src_stride;
@@ -220,9 +218,7 @@ static GLboolean
 try_pbo_zcopy(struct intel_context *intel,
   struct intel_texture_image *intelImage,
   const struct gl_pixelstore_attrib *unpack,
-  GLint internalFormat,
-  GLint width, GLint height,
-  GLenum format, GLenum type, const void *pixels)
+  GLint width, const void *pixels)
 {
struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
GLuint src_offset, src_stride;
@@ -466,10 +462,7 @@ intelTexImage(struct gl_context * ctx,
   intelObj->mt->first_level == level &&
   intelObj->mt->last_level == level) {
 
- if (try_pbo_zcopy(intel, intelImage, unpack,
-   internalFormat,
-   width, height, format, type, pixels)) {
-
+ if (try_pbo_zcopy(intel, intelImage, unpack, width, pixels)) {
 DBG("pbo zcopy upload succeeded\n");
 return;
  }
@@ -478,9 +471,7 @@ intelTexImage(struct gl_context * ctx,
 
   /* Otherwise, attempt to use the blitter for PBO image uploads.
*/
-  if (try_pbo_upload(intel, intelImage, unpack,
- internalFormat,
- width, height, format, type, pixels)) {
+  if (try_pbo_upload(intel, intelImage, unpack, width, height, pixels)) {
  DBG("pbo upload succeeded\n");
  return;
   }
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 13/20] dri_util: Silence several "warning: unused parameter"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

The parameters can't be removed because they are part of the DRI ABI.
---
 src/mesa/drivers/dri/common/dri_util.c |   12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index 82638fa..6d64019 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -418,6 +418,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig 
*config,
  * supported either.
  */
 (void) attrs;
+(void) renderType;
 
 pdp = malloc(sizeof *pdp);
 if (!pdp) {
@@ -594,8 +595,10 @@ driDestroyContext(__DRIcontext *pcp)
 /**
  * Create the per-drawable private driver information.
  * 
- * \param render_type   Type of rendering target.  \c GLX_RGBA is the only
+ * \param render_type   Type of rendering target.  \c GLX_RGBA_TYPE is the only
  *  type likely to ever be supported for direct-rendering.
+ *  However, \c GLX_RGBA_FLOAT_TYPE_ARB may eventually be
+ *  supported by some drivers.
  * \param sharedContext with which to share textures, etc. or NULL
  *
  * \returns An opaque pointer to the per-context private information on
@@ -616,6 +619,8 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig 
*config,
 __DRIcontext *pcp;
 void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
 
+(void) render_type;
+
 pcp = malloc(sizeof *pcp);
 if (!pcp)
return NULL;
@@ -700,6 +705,9 @@ dri2CreateNewContext(__DRIscreen *screen, const __DRIconfig 
*config,
 static int
 driCopyContext(__DRIcontext *dest, __DRIcontext *src, unsigned long mask)
 {
+(void) dest;
+(void) src;
+(void) mask;
 return GL_FALSE;
 }
 
@@ -806,6 +814,8 @@ driCreateNewScreen(int scrn,
 static const __DRIextension *emptyExtensionList[] = { NULL };
 __DRIscreen *psp;
 
+(void) loaderPrivate;
+
 if (driDriverAPI.InitScreen == NULL)
return NULL;
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 12/20] intel: Silence "intel/intel_fbo.h:105:4: warning: comparison of unsigned expression < 0 is always false"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

The test was of an enum, attIndex, which should be unsigned.  The
explicit check for < 0 was replaced with a cast to unsigned in an
assertion that attIndex is less than the size of the array it will be
used to index.
---
 src/mesa/drivers/dri/intel/intel_fbo.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h 
b/src/mesa/drivers/dri/intel/intel_fbo.h
index 2487994..d8fc1a5 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -29,6 +29,8 @@
 #define INTEL_FBO_H
 
 #include 
+#include 
+#include "main/compiler.h"
 #include "main/formats.h"
 #include "intel_screen.h"
 
@@ -101,9 +103,7 @@ intel_get_renderbuffer(struct gl_framebuffer *fb, 
gl_buffer_index attIndex)
struct gl_renderbuffer *rb;
struct intel_renderbuffer *irb;
 
-   /* XXX: Who passes -1 to intel_get_renderbuffer? */
-   if (attIndex < 0)
-  return NULL;
+   assert((unsigned)attIndex < Elements(fb->Attachment));
 
rb = fb->Attachment[attIndex].Renderbuffer;
if (!rb)
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 14/20] dri: Silence several "warning: unused parameter"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

---
 src/mesa/drivers/dri/common/depthtmp.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/common/depthtmp.h 
b/src/mesa/drivers/dri/common/depthtmp.h
index 81bec9c..c6e2bb7 100644
--- a/src/mesa/drivers/dri/common/depthtmp.h
+++ b/src/mesa/drivers/dri/common/depthtmp.h
@@ -66,6 +66,8 @@ static void TAG(WriteDepthSpan)( struct gl_context *ctx,
 #endif
   }
HW_WRITE_UNLOCK();
+
+   (void) ctx;
 }
 
 
@@ -120,6 +122,8 @@ static void TAG(WriteMonoDepthSpan)( struct gl_context *ctx,
 HW_ENDCLIPLOOP();
   }
HW_WRITE_UNLOCK();
+
+   (void) ctx;
 }
 #endif
 
@@ -168,6 +172,8 @@ static void TAG(WriteDepthPixels)( struct gl_context *ctx,
 #endif
   }
HW_WRITE_UNLOCK();
+
+   (void) ctx;
 }
 
 
@@ -238,6 +244,8 @@ static void TAG(ReadDepthPixels)( struct gl_context *ctx,
 #endif
   }
HW_READ_UNLOCK();
+
+   (void) ctx;
 }
 
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 15/20] swrast-dri: Silence several "warning: unused parameter"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

---
 src/mesa/drivers/dri/swrast/swrast.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/swrast/swrast.c 
b/src/mesa/drivers/dri/swrast/swrast.c
index 719b406..6d4f5fc 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -135,6 +135,9 @@ swrastFillInModes(__DRIscreen *psp,
 uint8_t stencil_bits_array[4];
 uint8_t msaa_samples_array[1];
 
+(void) psp;
+(void) have_back_buffer;
+
 depth_bits_array[0] = 0;
 depth_bits_array[1] = 0;
 depth_bits_array[2] = depth_bits;
@@ -215,6 +218,7 @@ static void
 dri_destroy_screen(__DRIscreen * sPriv)
 {
 TRACE;
+(void) sPriv;
 }
 
 
@@ -278,6 +282,9 @@ swrast_alloc_front_storage(struct gl_context *ctx, struct 
gl_renderbuffer *rb,
 
 TRACE;
 
+(void) ctx;
+(void) internalFormat;
+
 rb->Data = NULL;
 rb->Width = width;
 rb->Height = height;
@@ -376,6 +383,9 @@ dri_create_buffer(__DRIscreen * sPriv,
 
 TRACE;
 
+(void) sPriv;
+(void) isPixmap;
+
 drawable = CALLOC_STRUCT(dri_drawable);
 if (drawable == NULL)
goto drawable_fail;
@@ -537,6 +547,10 @@ viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei 
w, GLsizei h)
 struct gl_framebuffer *draw = ctx->WinSysDrawBuffer;
 struct gl_framebuffer *read = ctx->WinSysReadBuffer;
 
+(void) x;
+(void) y;
+(void) w;
+(void) h;
 swrast_check_and_update_window_size(ctx, draw);
 swrast_check_and_update_window_size(ctx, read);
 }
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 17/20] spantmp2: Silence many "warning: unused parameter ‘ctx’"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to
all the function templates to make GCC happy.
---
 src/mesa/drivers/dri/common/spantmp2.h |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/common/spantmp2.h 
b/src/mesa/drivers/dri/common/spantmp2.h
index abd7956..83cfbb1 100644
--- a/src/mesa/drivers/dri/common/spantmp2.h
+++ b/src/mesa/drivers/dri/common/spantmp2.h
@@ -465,6 +465,8 @@ static void TAG(WriteRGBASpan)( struct gl_context *ctx,
GLuint n, GLint x, GLint y,
const void *values, const GLubyte mask[] )
 {
+   (void) ctx;
+
HW_WRITE_LOCK()
   {
  const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
@@ -508,6 +510,8 @@ static void TAG(WriteRGBSpan)( struct gl_context *ctx,
   GLuint n, GLint x, GLint y,
   const void *values, const GLubyte mask[] )
 {
+   (void) ctx;
+
HW_WRITE_LOCK()
   {
  const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values;
@@ -547,6 +551,8 @@ static void TAG(WriteRGBAPixels)( struct gl_context *ctx,
   GLuint n, const GLint x[], const GLint y[],
   const void *values, const GLubyte mask[] )
 {
+   (void) ctx;
+
HW_WRITE_LOCK()
   {
  const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
@@ -593,6 +599,8 @@ static void TAG(WriteMonoRGBASpan)( struct gl_context *ctx,
GLuint n, GLint x, GLint y, 
const void *value, const GLubyte mask[] )
 {
+   (void) ctx;
+
HW_WRITE_LOCK()
   {
  const GLubyte *color = (const GLubyte *) value;
@@ -634,6 +642,8 @@ static void TAG(WriteMonoRGBAPixels)( struct gl_context 
*ctx,
  const void *value,
  const GLubyte mask[] ) 
 {
+   (void) ctx;
+
HW_WRITE_LOCK()
   {
  const GLubyte *color = (const GLubyte *) value;
@@ -673,6 +683,8 @@ static void TAG(ReadRGBASpan)( struct gl_context *ctx,
struct gl_renderbuffer *rb,
   GLuint n, GLint x, GLint y, void *values)
 {
+   (void) ctx;
+
HW_READ_LOCK()
   {
  GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
@@ -713,6 +725,8 @@ static void TAG2(ReadRGBASpan,_MMX)( struct gl_context *ctx,
__asm__ __volatile__( "emms" );
 #endif
 
+   (void) ctx;
+
HW_READ_LOCK()
  {
 GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
@@ -757,6 +771,8 @@ static void TAG2(ReadRGBASpan,_SSE2)( struct gl_context 
*ctx,
   GLuint n, GLint x, GLint y,
   void *values)
 {
+   (void) ctx;
+
HW_READ_LOCK()
  {
 GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
@@ -799,6 +815,8 @@ static void TAG2(ReadRGBASpan,_SSE)( struct gl_context *ctx,
__asm__ __volatile__( "emms" );
 #endif
 
+   (void) ctx;
+
HW_READ_LOCK()
  {
 GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
@@ -834,6 +852,8 @@ static void TAG(ReadRGBAPixels)( struct gl_context *ctx,
 GLuint n, const GLint x[], const GLint y[],
 void *values )
 {
+   (void) ctx;
+
HW_READ_LOCK()
   {
  GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 16/20] mesa: Silence "main/teximage.h:148:72: warning: unused parameter ‘texObj’"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

---
 src/mesa/main/teximage.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 19abc64..8ef1d45 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -147,6 +147,7 @@ _mesa_lock_texture(struct gl_context *ctx, struct 
gl_texture_object *texObj)
 static INLINE void
 _mesa_unlock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
 {
+   (void) texObj;
_glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
 }
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 18/20] tnl_dd: Silence "tnl_dd/t_dd_tritmp.h:292:3: warning: suggest braces around empty body in an ‘if’ statement"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

---
 src/mesa/tnl_dd/t_dd_tritmp.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h
index 022f0c6..cb1204d 100644
--- a/src/mesa/tnl_dd/t_dd_tritmp.h
+++ b/src/mesa/tnl_dd/t_dd_tritmp.h
@@ -288,8 +288,9 @@ static void TAG(triangle)( struct gl_context *ctx, GLuint 
e0, GLuint e1, GLuint
 VERT_Z_ADD(v[1], offset);
 VERT_Z_ADD(v[2], offset);
   }
-  if (DO_UNFILLED)
+  if (DO_UNFILLED) {
 RASTERIZE( GL_TRIANGLES );
+  }
   if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
  SETUP_STENCIL(facing);
  TRI( v[0], v[1], v[2] );
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 19/20] swrast: Silence many "warning: unused parameter ‘ctx’"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to
all the function templates to make GCC happy.
---
 src/mesa/swrast/s_spantemp.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h
index 8a94850..517c2eb 100644
--- a/src/mesa/swrast/s_spantemp.h
+++ b/src/mesa/swrast/s_spantemp.h
@@ -65,6 +65,7 @@ NAME(get_row)( struct gl_context *ctx, struct gl_renderbuffer 
*rb,
   INC_PIXEL_PTR(pixel);
}
(void) rb;
+   (void) ctx;
 }
 
 
@@ -82,6 +83,7 @@ NAME(get_values)( struct gl_context *ctx, struct 
gl_renderbuffer *rb,
   FETCH_PIXEL(dest[i], pixel);
}
(void) rb;
+   (void) ctx;
 }
 
 
@@ -111,6 +113,7 @@ NAME(put_row)( struct gl_context *ctx, struct 
gl_renderbuffer *rb,
   }
}
(void) rb;
+   (void) ctx;
 }
 
 
@@ -136,6 +139,7 @@ NAME(put_row_rgb)( struct gl_context *ctx, struct 
gl_renderbuffer *rb,
   INC_PIXEL_PTR(pixel);
}
(void) rb;
+   (void) ctx;
 }
 
 
@@ -165,6 +169,7 @@ NAME(put_mono_row)( struct gl_context *ctx, struct 
gl_renderbuffer *rb,
   }
}
(void) rb;
+   (void) ctx;
 }
 
 
@@ -186,6 +191,7 @@ NAME(put_values)( struct gl_context *ctx, struct 
gl_renderbuffer *rb,
   }
}
(void) rb;
+   (void) ctx;
 }
 
 
@@ -207,6 +213,7 @@ NAME(put_mono_values)( struct gl_context *ctx, struct 
gl_renderbuffer *rb,
   }
}
(void) rb;
+   (void) ctx;
 }
 
 
-- 
1.7.4.4

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


[Mesa-dev] [PATCH 20/20] nvprogram: Silence "warning: unused parameter ‘ctx’"

2011-08-29 Thread Ian Romanick
From: Ian Romanick 

---
 src/mesa/main/nvprogram.c  |2 +-
 src/mesa/main/nvprogram.h  |2 +-
 src/mesa/program/nvvertparse.c |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c
index 7ff7645..a0e89b1 100644
--- a/src/mesa/main/nvprogram.c
+++ b/src/mesa/main/nvprogram.c
@@ -560,7 +560,7 @@ _mesa_emit_nv_temp_initialization(struct gl_context *ctx,
 }
 
 void
-_mesa_setup_nv_temporary_count(struct gl_context *ctx, struct gl_program 
*program)
+_mesa_setup_nv_temporary_count(struct gl_program *program)
 {
GLuint i;
 
diff --git a/src/mesa/main/nvprogram.h b/src/mesa/main/nvprogram.h
index 3a55783..fc579a9 100644
--- a/src/mesa/main/nvprogram.h
+++ b/src/mesa/main/nvprogram.h
@@ -110,7 +110,7 @@ _mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, 
const GLubyte *name,
GLdouble *params);
 
 extern void
-_mesa_setup_nv_temporary_count(struct gl_context *ctx, struct gl_program 
*program);
+_mesa_setup_nv_temporary_count(struct gl_program *program);
 
 extern void
 _mesa_emit_nv_temp_initialization(struct gl_context *ctx,
diff --git a/src/mesa/program/nvvertparse.c b/src/mesa/program/nvvertparse.c
index bdd44a4..91fe2c4 100644
--- a/src/mesa/program/nvvertparse.c
+++ b/src/mesa/program/nvvertparse.c
@@ -1427,7 +1427,7 @@ _mesa_parse_nv_vertex_program(struct gl_context *ctx, 
GLenum dstTarget,
   }
   program->Base.NumParameters = program->Base.Parameters->NumParameters;
 
-  _mesa_setup_nv_temporary_count(ctx, &program->Base);
+  _mesa_setup_nv_temporary_count(&program->Base);
   _mesa_emit_nv_temp_initialization(ctx, &program->Base);
}
else {
-- 
1.7.4.4

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


Re: [Mesa-dev] [PATCH 3/3] xorg/xvmc: Add missing call to set_picture_parameters

2011-08-29 Thread Maarten Lankhorst
Hey Christian,

On 08/29/2011 10:14 AM, Christian König wrote:
> Am Sonntag, den 28.08.2011, 19:13 +0200 schrieb Maarten Lankhorst:
>> Hey,
>>
>> On 08/28/2011 05:04 PM, Christian König wrote:
>>> Hi Maarten,
>>>
>>> could you put this into SetDecoderStatus instead? This makes the picture
>>> structure also available in end_frame.
>> Erm it doesn't make sense there. It might make sense to move it to after
>> the begin_frame though, but with interlaced frames I don't see why you
>> would want to move it into SetDecoderStatus, since you could have interlaced
>> frames with different picture_structures.
> Oh, what I wanted to say is: Remember the picture structure in use when
> begin_frame is called and just set it to the same value when end_frame
> is called. Also having a end_frame/begin_frame when the picture
> structure changes from top to bottom (or the other way around) couldn't
> hurt also.
>
The nouveau decoder doesn't need to remember the picture structure,
it only needs it during the render call. If vl_mpeg12_decoder needs it,
wouldn't it make more sense to remember it in the vl_mpeg12_buffer?

Also I think it's safe to assume that the picture_structure won't change,
since the mpeg spec assumes its constant for the entire frame.

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


Re: [Mesa-dev] Mesa (master): glsl_to_tgsi: fix a reference leak on an error path

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/29/2011 01:31 PM, Marek Olšák wrote:
> Module: Mesa
> Branch: master
> Commit: b2064ff3115afa075021902ecd35f4a5a772dc9e
> URL:
> http://cgit.freedesktop.org/mesa/mesa/commit/?id=b2064ff3115afa075021902ecd35f4a5a772dc9e
> 
> Author: Marek Olšák 
> Date:   Thu Aug 25 04:11:05 2011 +0200
> 
> glsl_to_tgsi: fix a reference leak on an error path
> 
> ---
> 
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 2266083..3fbb0cd 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -5050,6 +5050,7 @@ st_link_shader(struct gl_context *ctx, struct 
> gl_shader_program *prog)
>  break;
>   }
>   if (!ok) {
> +_mesa_reference_program(ctx, &linked_prog, NULL);
>  return GL_FALSE;
>   }
>}

Won't that leave prog->_LinkedShaders[i]->Program pointing at the dead
program?  I think you want:

  if (!ok) {
+_mesa_reference_program(ctx,
&prog->_LinkedShaders[i]->Program, NULL);
 return GL_FALSE;
  }

Right?
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5cDyoACgkQX1gOwKyEAw8V0ACgnPyVYuPE0yTgV3Ta2ifVAP/6
HDMAoJ6vOFTy6r70v8/AGjRGshytPWAK
=+rCK
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/3] xorg/xvmc: Only set decode buffer when available

2011-08-29 Thread Maarten Lankhorst
Hey,

On 08/29/2011 10:08 AM, Christian König wrote:
> Am Montag, den 29.08.2011, 00:36 -0400 schrieb Younes Manton:
> [snip]
>> Well, that was what the last discussion was all about, whether or not
>> decode buffers should be handled internally by each driver or
>> externally. It was decided to handle it externally, to simplify life
>> for drivers that want/need multiple buffers and to keep most of the
>> ugliness in XvMC, since VDPAU and VA don't have the same kinds of
>> problems.
>>
>> Anyway, your patch is cleaner for the driver that doesn't want to
>> support multiple decode buffers, but now every state tracker has to
>> deal with drivers with decode buffers and drivers without, and we have
>> to do these if checks at init/cleanup and every frame. The alternative
>> is that you support create_buffer, etc, and just return the same
>> decode buffer each time, and if you don't want to bother creating a
>> new type to represent a decode buffer you can just return anything
>> non-null, like the decoder itself, and just implement the other
>> functions as emty no-ops, that way the state trackers only have to
>> deal with one interface.
>>
>> Anyway, I don't have a strong preference either way, and since we
>> currently only have 2 drivers and 2 state trackers, it doesn't matter
>> much. I'll push this in a couple of days if no other comments.
> I have implementing the vaapi state tracker on my todo list, but not as
> with very high priority. So we would end up with 3 state tracker and 2
> drivers, but honestly my preferences aren't going strongly into the one
> or another preference either.
>
> So I think it is ok to push the patch as it is, since it doesn't make so
> much of a difference.
>
>
Well I suppose I can just return NULL, and nop the others, it doesn't
seem like the create call is being error checked?

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


Re: [Mesa-dev] [PATCH 7/7] g3dvl: Rewrite the mpeg 1&2 bitstream parser

2011-08-29 Thread Andy Furniss

Christian König wrote:


Thanks to you once more, it was just looking at the bytes left in the
buffer, but not the bits! So we ended up not decoding the last 32 bits
of a buffer.


That seems to have fixed it.



I just pushed a fix, and I'm really wondering where the heck do you get
all those nice test videos.


Well, in the case of HD almost all from http://www.w6rz.net .

For SD I can test UK TV from a DVB-T card, or I use streams from

ftp://ftp.tek.com/tv/test/streams/Element/MPEG-Video/625/

The Pendulum I got from an ISO that was linked to from a German 
monitor/tv review site but I don't have a link for that.


Ironically your question made me search to see if I had any other mpeg2 
HD not from w6rz - I found one and it has issues with -vf ffmpeg12vdpau :-)


I've never tested with this before so don't know if it's a regression, 
it renders OK but hangs at the end and then may or may not segfault.


If it doesn't segfault then ddd will show it looping round int the same 
function as shown in my screenshot, which shows the bt and value of 
num_skipped_macroblocks.


Maybe the stream is faulty - http://www.andyqos.ukfsn.org/swan.mpg

The ddd screenshot - http://www.andyqos.ukfsn.org/vdpau-swan-ddd.png
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/3] make: A few small cleanups

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/29/2011 11:43 AM, Chad Versace wrote:
> Chad Versace (3):
>   make: Remove duplicate defintion of COMMON_SOURCES in Radeon
> makefiles
>   make: Remove duplicate occurence of driverfuncs.c
>   make: Factor out source lists from drivers/dri/common into
> Makefile.sources

Reviewed-by: Ian Romanick 

>  src/mesa/drivers/dri/Makefile.defines|   21 +++--
>  src/mesa/drivers/dri/common/Makefile.sources |   19 +++
>  src/mesa/drivers/dri/r300/Makefile   |9 -
>  src/mesa/drivers/dri/r600/Makefile   |9 -
>  src/mesa/drivers/dri/swrast/Makefile |1 -
>  5 files changed, 26 insertions(+), 33 deletions(-)
>  create mode 100644 src/mesa/drivers/dri/common/Makefile.sources
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk5cG90ACgkQX1gOwKyEAw+kqACdHrcE3rfhYkwM6svSbL3cGgTv
dysAn24nnHh2wL1fQCtbiqD5yJJqgGr5
=iMA5
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 4/5] i965: Fix Android build by removing relative includes

2011-08-29 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/29/2011 11:50 AM, Chad Versace wrote:

This patch is

Reviewed-by: Ian Romanick 

I can't really speak to the others in this series.

> Replace each occurence of
> #include "../glsl/*.h"
> with
> #include "glsl/*.h"
> 
> v2
> 
> - [idr] Eliminated spurious whitespace.
> 
> CC: Ian Romanick 
> Signed-off-by: Chad Versace 
> ---
>  src/mesa/drivers/dri/i965/brw_clip.c   |2 +-
>  src/mesa/drivers/dri/i965/brw_context.c|2 +-
>  .../drivers/dri/i965/brw_cubemap_normalize.cpp |4 ++--
>  src/mesa/drivers/dri/i965/brw_eu.c |2 +-
>  src/mesa/drivers/dri/i965/brw_eu_emit.c|2 +-
>  src/mesa/drivers/dri/i965/brw_fs.cpp   |4 ++--
>  src/mesa/drivers/dri/i965/brw_fs.h |4 ++--
>  .../dri/i965/brw_fs_channel_expressions.cpp|6 +++---
>  src/mesa/drivers/dri/i965/brw_fs_emit.cpp  |2 +-
>  src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp  |6 +++---
>  .../dri/i965/brw_fs_schedule_instructions.cpp  |6 +++---
>  .../drivers/dri/i965/brw_fs_vector_splitting.cpp   |   10 +-
>  src/mesa/drivers/dri/i965/brw_fs_visitor.cpp   |6 +++---
>  src/mesa/drivers/dri/i965/brw_gs.c |2 +-
>  src/mesa/drivers/dri/i965/brw_program.c|2 +-
>  src/mesa/drivers/dri/i965/brw_sf.c |2 +-
>  src/mesa/drivers/dri/i965/brw_shader.cpp   |4 ++--
>  src/mesa/drivers/dri/i965/brw_state_batch.c|2 +-
>  src/mesa/drivers/dri/i965/brw_vec4.h   |2 +-
>  src/mesa/drivers/dri/i965/brw_vec4_emit.cpp|2 +-
>  .../drivers/dri/i965/brw_vec4_reg_allocate.cpp |2 +-
>  src/mesa/drivers/dri/i965/brw_vs.c |2 +-
>  src/mesa/drivers/dri/i965/brw_vtbl.c   |2 +-
>  src/mesa/drivers/dri/i965/brw_wm.c |2 +-
>  24 files changed, 40 insertions(+), 40 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_clip.c 
> b/src/mesa/drivers/dri/i965/brw_clip.c
> index d82206b..b49c9f4 100644
> --- a/src/mesa/drivers/dri/i965/brw_clip.c
> +++ b/src/mesa/drivers/dri/i965/brw_clip.c
> @@ -42,7 +42,7 @@
>  #include "brw_state.h"
>  #include "brw_clip.h"
>  
> -#include "../glsl/ralloc.h"
> +#include "glsl/ralloc.h"
>  
>  #define FRONT_UNFILLED_BIT  0x1
>  #define BACK_UNFILLED_BIT   0x2
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
> b/src/mesa/drivers/dri/i965/brw_context.c
> index e00e248..898ad8a 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -40,7 +40,7 @@
>  #include "brw_state.h"
>  #include "intel_span.h"
>  #include "tnl/t_pipeline.h"
> -#include "../glsl/ralloc.h"
> +#include "glsl/ralloc.h"
>  
>  /***
>   * Mesa's Driver Functions
> diff --git a/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp 
> b/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
> index 8574169..ff9485c 100644
> --- a/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
> @@ -30,8 +30,8 @@
>   * \author Eric Anholt 
>   */
>  
> -#include "../glsl/glsl_types.h"
> -#include "../glsl/ir.h"
> +#include "glsl/glsl_types.h"
> +#include "glsl/ir.h"
>  
>  class brw_cubemap_normalize_visitor : public ir_hierarchical_visitor {
>  public:
> diff --git a/src/mesa/drivers/dri/i965/brw_eu.c 
> b/src/mesa/drivers/dri/i965/brw_eu.c
> index c1f2520..0e04af9 100644
> --- a/src/mesa/drivers/dri/i965/brw_eu.c
> +++ b/src/mesa/drivers/dri/i965/brw_eu.c
> @@ -34,7 +34,7 @@
>  #include "brw_defines.h"
>  #include "brw_eu.h"
>  
> -#include "../glsl/ralloc.h"
> +#include "glsl/ralloc.h"
>  
>  /* Returns the corresponding conditional mod for swapping src0 and
>   * src1 in e.g. CMP.
> diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c 
> b/src/mesa/drivers/dri/i965/brw_eu_emit.c
> index c5013de..e8d0998 100644
> --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
> +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
> @@ -34,7 +34,7 @@
>  #include "brw_defines.h"
>  #include "brw_eu.h"
>  
> -#include "../glsl/ralloc.h"
> +#include "glsl/ralloc.h"
>  
>  /***
>   * Internal helper for constructing instructions
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
> b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 0b0445e..8b85f3b 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -46,8 +46,8 @@ extern "C" {
>  }
>  #include "brw_shader.h"
>  #include "brw_fs.h"
> -#include "../glsl/glsl_types.h"
> -#include "../glsl/ir_print_visitor.h"
> +#include "glsl/glsl_types.h"
> +#include "glsl/ir_print_visitor.h"
>  
>  #define MAX_INSTRUCTION (1 << 30)
>  
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h 
> b/src/mesa/drivers/dri/i965/brw_fs.h
> index 10f45f3..49454a5 1

Re: [Mesa-dev] [PATCH 2/3] xorg/xvmc: Only set decode buffer when available

2011-08-29 Thread Younes Manton
2011/8/29 Maarten Lankhorst :
> Hey,
>
> On 08/29/2011 10:08 AM, Christian König wrote:
>> Am Montag, den 29.08.2011, 00:36 -0400 schrieb Younes Manton:
>> [snip]
>>> Well, that was what the last discussion was all about, whether or not
>>> decode buffers should be handled internally by each driver or
>>> externally. It was decided to handle it externally, to simplify life
>>> for drivers that want/need multiple buffers and to keep most of the
>>> ugliness in XvMC, since VDPAU and VA don't have the same kinds of
>>> problems.
>>>
>>> Anyway, your patch is cleaner for the driver that doesn't want to
>>> support multiple decode buffers, but now every state tracker has to
>>> deal with drivers with decode buffers and drivers without, and we have
>>> to do these if checks at init/cleanup and every frame. The alternative
>>> is that you support create_buffer, etc, and just return the same
>>> decode buffer each time, and if you don't want to bother creating a
>>> new type to represent a decode buffer you can just return anything
>>> non-null, like the decoder itself, and just implement the other
>>> functions as emty no-ops, that way the state trackers only have to
>>> deal with one interface.
>>>
>>> Anyway, I don't have a strong preference either way, and since we
>>> currently only have 2 drivers and 2 state trackers, it doesn't matter
>>> much. I'll push this in a couple of days if no other comments.
>> I have implementing the vaapi state tracker on my todo list, but not as
>> with very high priority. So we would end up with 3 state tracker and 2
>> drivers, but honestly my preferences aren't going strongly into the one
>> or another preference either.
>>
>> So I think it is ok to push the patch as it is, since it doesn't make so
>> much of a difference.
>>
>>
> Well I suppose I can just return NULL, and nop the others, it doesn't
> seem like the create call is being error checked?
>
> ~Maarten
>

It should be error checked. If you return NULL the state tracker won't
be able to tell if the call failed because of error or because the
driver doesn't support it.

Anyway, pushed. It can always be revisited later.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 38970] [bisected]piglit glx/glx-pixmap-multi failed

2011-08-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=38970

--- Comment #6 from Ian Romanick  2011-08-29 17:31:35 PDT 
---
This works on recent X servers.  I believe that there were some bugs with
pixmap tracking on the X server that were fixed around the same time this patch
went it.  Unless there is some compelling reason to do otherwise, we should
consider this patch as being correct but tickling a latent bug elsewhere.  My
inclination is to close as WONTFIX.

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


[Mesa-dev] [PATCH 1/3] Enable GLX_EXT_texture_from_pixmap in software.

2011-08-29 Thread Stéphane Marchesin
From: nobled 

Signed-off-by: nobled 
Signed-off-by: Stuart Abercrombie 
Signed-off-by: Stéphane Marchesin 
---
 src/glx/drisw_glx.c |   83 +-
 1 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 7bd6450..21d0a0a 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -48,6 +48,8 @@ struct drisw_screen
__GLXDRIscreen vtable;
const __DRIcoreExtension *core;
const __DRIswrastExtension *swrast;
+   const __DRItexBufferExtension *texBuffer;
+
const __DRIconfig **driver_configs;
 
void *driver;
@@ -294,6 +296,66 @@ drisw_unbind_context(struct glx_context *context, struct 
glx_context *new)
(*psc->core->unbindContext) (pcp->driContext);
 }
 
+static void
+drisw_bind_tex_image(Display * dpy,
+   GLXDrawable drawable,
+   int buffer, const int *attrib_list)
+{
+   struct glx_context *gc = __glXGetCurrentContext();
+   struct drisw_context *pcp = (struct drisw_context *) gc;
+   __GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable);
+   struct glx_display *dpyPriv = __glXInitialize(dpy);
+   struct drisw_drawable *pdraw = (struct drisw_drawable *) base;
+   struct drisw_screen *psc;
+
+   if (pdraw != NULL) {
+  psc = (struct drisw_screen *) base->psc;
+
+  if (!psc->texBuffer)
+ return;
+
+  if (psc->texBuffer->base.version >= 2 &&
+psc->texBuffer->setTexBuffer2 != NULL) {
+ (*psc->texBuffer->setTexBuffer2) (pcp->driContext,
+  pdraw->base.textureTarget,
+  pdraw->base.textureFormat,
+  pdraw->driDrawable);
+  }
+  else {
+ (*psc->texBuffer->setTexBuffer) (pcp->driContext,
+ pdraw->base.textureTarget,
+ pdraw->driDrawable);
+  }
+   }
+}
+
+static void
+drisw_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer)
+{
+#if __DRI_TEX_BUFFER_VERSION >= 3
+   struct glx_context *gc = __glXGetCurrentContext();
+   struct dri2_context *pcp = (struct dri2_context *) gc;
+   __GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable);
+   struct glx_display *dpyPriv = __glXInitialize(dpy);
+   struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
+   struct dri2_screen *psc;
+
+   if (pdraw != NULL) {
+  psc = (struct dri2_screen *) base->psc;
+
+  if (!psc->texBuffer)
+ return;
+
+  if (psc->texBuffer->base.version >= 3 &&
+  psc->texBuffer->releaseTexBuffer != NULL) {
+ (*psc->texBuffer->releaseTexBuffer) (pcp->driContext,
+   pdraw->base.textureTarget,
+   pdraw->driDrawable);
+  }
+   }
+#endif
+}
+
 static const struct glx_context_vtable drisw_context_vtable = {
drisw_destroy_context,
drisw_bind_context,
@@ -301,8 +363,8 @@ static const struct glx_context_vtable drisw_context_vtable 
= {
NULL,
NULL,
DRI_glXUseXFont,
-   NULL,
-   NULL,
+   drisw_bind_tex_image,
+   drisw_release_tex_image,
NULL, /* get_proc_address */
 };
 
@@ -439,6 +501,20 @@ static const struct glx_screen_vtable drisw_screen_vtable 
= {
drisw_create_context
 };
 
+static void
+driswBindExtensions(struct drisw_screen *psc, const __DRIextension 
**extensions)
+{
+   int i;
+
+   /* FIXME: Figure out what other extensions can be ported here from dri2. */
+   for (i = 0; extensions[i]; i++) {
+  if ((strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0)) {
+psc->texBuffer = (__DRItexBufferExtension *) extensions[i];
+__glXEnableDirectExtension(&psc->base, "GLX_EXT_texture_from_pixmap");
+  }
+   }
+}
+
 static struct glx_screen *
 driswCreateScreen(int screen, struct glx_display *priv)
 {
@@ -488,6 +564,9 @@ driswCreateScreen(int screen, struct glx_display *priv)
   goto handle_error;
}
 
+   extensions = psc->core->getExtensions(psc->driScreen);
+   driswBindExtensions(psc, extensions);
+
psc->base.configs =
   driConvertConfigs(psc->core, psc->base.configs, driver_configs);
psc->base.visuals =
-- 
1.7.5.3.367.ga9930

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


[Mesa-dev] [PATCH 2/3] Duplicate state_tracker/dri/sw/dri_drawable.c

2011-08-29 Thread Stéphane Marchesin
We need this for the upcoming fix for sw texture_from_pixmap.

Signed-off-by: Stuart Abercrombie 
Signed-off-by: Stéphane Marchesin 
---
 src/gallium/state_trackers/dri/sw/dri_drawable.c |  270 +-
 1 files changed, 269 insertions(+), 1 deletions(-)
 mode change 12 => 100644 src/gallium/state_trackers/dri/sw/dri_drawable.c

diff --git a/src/gallium/state_trackers/dri/sw/dri_drawable.c 
b/src/gallium/state_trackers/dri/sw/dri_drawable.c
deleted file mode 12
index 0fc19be..000
--- a/src/gallium/state_trackers/dri/sw/dri_drawable.c
+++ /dev/null
@@ -1 +0,0 @@
-../common/dri_drawable.c
\ No newline at end of file
diff --git a/src/gallium/state_trackers/dri/sw/dri_drawable.c 
b/src/gallium/state_trackers/dri/sw/dri_drawable.c
new file mode 100644
index 000..7b8de31
--- /dev/null
+++ b/src/gallium/state_trackers/dri/sw/dri_drawable.c
@@ -0,0 +1,269 @@
+/**
+ *
+ * Copyright 2009, VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+/*
+ * Author: Keith Whitwell 
+ * Author: Jakob Bornecrantz 
+ */
+
+#include "dri_screen.h"
+#include "dri_context.h"
+#include "dri_drawable.h"
+
+#include "pipe/p_screen.h"
+#include "util/u_format.h"
+#include "util/u_memory.h"
+#include "util/u_inlines.h"
+ 
+
+static boolean
+dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi,
+const enum st_attachment_type *statts,
+unsigned count,
+struct pipe_resource **out)
+{
+   struct dri_drawable *drawable =
+  (struct dri_drawable *) stfbi->st_manager_private;
+   struct dri_screen *screen = dri_screen(drawable->sPriv);
+   unsigned statt_mask, new_mask;
+   boolean new_stamp;
+   int i;
+
+   statt_mask = 0x0;
+   for (i = 0; i < count; i++)
+  statt_mask |= (1 << statts[i]);
+
+   /* record newly allocated textures */
+   new_mask = (statt_mask & ~drawable->texture_mask);
+
+   /*
+* dPriv->pStamp is the server stamp.  It should be accessed with a lock, at
+* least for DRI1.  dPriv->lastStamp is the client stamp.  It has the value
+* of the server stamp when last checked.
+*/
+   new_stamp = (drawable->texture_stamp != drawable->dPriv->lastStamp);
+
+   if (new_stamp || new_mask || screen->broken_invalidate) {
+  if (new_stamp && drawable->update_drawable_info)
+ drawable->update_drawable_info(drawable);
+
+  drawable->allocate_textures(drawable, statts, count);
+
+  /* add existing textures */
+  for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
+ if (drawable->textures[i])
+statt_mask |= (1 << i);
+  }
+
+  drawable->texture_stamp = drawable->dPriv->lastStamp;
+  drawable->texture_mask = statt_mask;
+   }
+
+   if (!out)
+  return TRUE;
+
+   for (i = 0; i < count; i++) {
+  out[i] = NULL;
+  pipe_resource_reference(&out[i], drawable->textures[statts[i]]);
+   }
+
+   return TRUE;
+}
+
+static boolean
+dri_st_framebuffer_flush_front(struct st_framebuffer_iface *stfbi,
+   enum st_attachment_type statt)
+{
+   struct dri_drawable *drawable =
+  (struct dri_drawable *) stfbi->st_manager_private;
+
+   /* XXX remove this and just set the correct one on the framebuffer */
+   drawable->flush_frontbuffer(drawable, statt);
+
+   return TRUE;
+}
+
+/**
+ * This is called when we need to set up GL rendering to a new X window.
+ */
+boolean
+dri_create_buffer(__DRIscreen * sPriv,
+ __DRIdrawable * dPriv,
+ const struct gl_config * visual, boolean isPixmap)
+{
+   struct dri_screen *screen = sPriv->private;
+   struct dri_drawable *drawable = NULL;
+
+   if (isPixmap)
+  goto fail;  /* not implemen

[Mesa-dev] [PATCH 3/3] state_trackers/dri/sw: Implement texture_from_pixmap.

2011-08-29 Thread Stéphane Marchesin
Signed-off-by: Stuart Abercrombie 
Signed-off-by: Stéphane Marchesin 
---
 src/gallium/state_trackers/dri/sw/dri_drawable.c |   50 +++---
 1 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/src/gallium/state_trackers/dri/sw/dri_drawable.c 
b/src/gallium/state_trackers/dri/sw/dri_drawable.c
index 7b8de31..05c64b6 100644
--- a/src/gallium/state_trackers/dri/sw/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/sw/dri_drawable.c
@@ -37,7 +37,8 @@
 #include "util/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_inlines.h"
- 
+
+#include "state_tracker/st_context.h" 
 
 static boolean
 dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi,
@@ -195,14 +196,23 @@ dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
 {
struct dri_context *ctx = dri_context(pDRICtx);
struct dri_drawable *drawable = dri_drawable(dPriv);
-   struct pipe_resource *pt;
-
+   struct pipe_resource *res;
+   struct st_context *stctx = (struct st_context *)ctx->st;
+   struct pipe_context *pipe = stctx->pipe;
+   struct pipe_transfer *tex_xfer;
+   char *map;
+   __DRIscreen *sPriv = dPriv->driScreenPriv;
+   int x, y, w, h, line, ximage_stride;
+
+   sPriv->swrast_loader->getDrawableInfo(dPriv, &x, &y, &w, &h, 
dPriv->loaderPrivate);
+ 
dri_drawable_validate_att(drawable, ST_ATTACHMENT_FRONT_LEFT);
 
-   pt = drawable->textures[ST_ATTACHMENT_FRONT_LEFT];
+   /* Use the pipe resource associated with the X drawable */
+   res = drawable->textures[ST_ATTACHMENT_FRONT_LEFT];
 
-   if (pt) {
-  enum pipe_format internal_format = pt->format;
+   if (res) {
+  enum pipe_format internal_format = res->format;
 
   if (format == __DRI_TEXTURE_FORMAT_RGB)  {
  /* only need to cover the formats recognized by dri_fill_st_visual */
@@ -218,9 +228,35 @@ dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
  }
   }
 
+
+  tex_xfer = pipe_get_transfer(pipe, res,
+0, 0,// level, layer
+PIPE_TRANSFER_WRITE,
+x, y,
+w, h);
+
+
+  map = pipe_transfer_map(pipe, tex_xfer);
+ 
+  /* Copy the Drawable content to the mapped texture buffer */
+  sPriv->swrast_loader->getImage(dPriv, x, y, w, h, map,
+  dPriv->loaderPrivate);
+
+  /* The pipe transfer has a pitch rounded up to the nearest 64 pixels.
+ We assume 32 bit pixels. */
+  ximage_stride = w * 4;  
+  for (line = h-1; line; --line) {
+ memmove(&map[line * tex_xfer->stride], &map[line * ximage_stride], 
ximage_stride);
+  }
+
+  pipe_transfer_unmap(pipe, tex_xfer);
+
+  pipe_transfer_destroy(pipe, tex_xfer);
+
   ctx->st->teximage(ctx->st,
 (target == GL_TEXTURE_2D) ? ST_TEXTURE_2D : ST_TEXTURE_RECT,
-0, internal_format, pt, FALSE);
+0, internal_format, res, FALSE);
+
}
 }
 
-- 
1.7.5.3.367.ga9930

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


[Mesa-dev] [Bug 38970] [bisected]piglit glx/glx-pixmap-multi failed

2011-08-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=38970

--- Comment #7 from Gordon Jin  2011-08-29 17:57:58 PDT 
---
Ian, thanks for the reply. I agree we can close it if it works with recent
xserver.

Xun, please verify.

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


Re: [Mesa-dev] [PATCH] winsys/radeon: Create async thread only once

2011-08-29 Thread Marek Olšák
Thanks. I wanted to do this long ago.

Reviewed-by: Marek Olšák 

On Sat, Aug 27, 2011 at 10:57 PM, Maarten Lankhorst
 wrote:
> I noticed that a thread was created for every time async flush was called, so 
> I moved it and used some semaphores to synch.
>
> Signed-off-by: Maarten Lankhorst 
>
> ---
> diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c 
> b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
> index c309354..dd3a4a3 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
> +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
> @@ -130,6 +130,9 @@ static void radeon_destroy_cs_context(struct 
> radeon_cs_context *csc)
>     FREE(csc->relocs);
>  }
>
> +DEBUG_GET_ONCE_BOOL_OPTION(thread, "RADEON_THREAD", TRUE)
> +static PIPE_THREAD_ROUTINE(radeon_drm_cs_emit_ioctl, param);
> +
>  static struct radeon_winsys_cs *radeon_drm_cs_create(struct radeon_winsys 
> *rws)
>  {
>     struct radeon_drm_winsys *ws = radeon_drm_winsys(rws);
> @@ -139,6 +142,8 @@ static struct radeon_winsys_cs 
> *radeon_drm_cs_create(struct radeon_winsys *rws)
>     if (!cs) {
>         return NULL;
>     }
> +    pipe_semaphore_init(&cs->flush_queued, 0);
> +    pipe_semaphore_init(&cs->flush_completed, 0);
>
>     cs->ws = ws;
>
> @@ -158,6 +163,8 @@ static struct radeon_winsys_cs 
> *radeon_drm_cs_create(struct radeon_winsys *rws)
>     cs->base.buf = cs->csc->buf;
>
>     p_atomic_inc(&ws->num_cs);
> +    if (cs->ws->num_cpus > 1 && debug_get_option_thread())
> +        cs->thread = pipe_thread_create(radeon_drm_cs_emit_ioctl, cs);
>     return &cs->base;
>  }
>
> @@ -357,9 +364,8 @@ static void radeon_drm_cs_write_reloc(struct 
> radeon_winsys_cs *rcs,
>     OUT_CS(&cs->base, index * RELOC_DWORDS);
>  }
>
> -static PIPE_THREAD_ROUTINE(radeon_drm_cs_emit_ioctl, param)
> +static void radeon_drm_cs_emit_ioctl_oneshot(struct radeon_cs_context *csc)
>  {
> -    struct radeon_cs_context *csc = (struct radeon_cs_context*)param;
>     unsigned i;
>
>     if (drmCommandWriteRead(csc->fd, DRM_RADEON_CS,
> @@ -381,20 +387,32 @@ static PIPE_THREAD_ROUTINE(radeon_drm_cs_emit_ioctl, 
> param)
>         p_atomic_dec(&csc->relocs_bo[i]->num_active_ioctls);
>
>     radeon_cs_context_cleanup(csc);
> +}
> +
> +static PIPE_THREAD_ROUTINE(radeon_drm_cs_emit_ioctl, param)
> +{
> +    struct radeon_drm_cs *cs = (struct radeon_drm_cs*)param;
> +
> +    while (1) {
> +        pipe_semaphore_wait(&cs->flush_queued);
> +        if (cs->kill_thread)
> +            break;
> +        radeon_drm_cs_emit_ioctl_oneshot(cs->cst);
> +        pipe_semaphore_signal(&cs->flush_completed);
> +    }
> +    pipe_semaphore_signal(&cs->flush_completed);
>     return NULL;
>  }
>
>  void radeon_drm_cs_sync_flush(struct radeon_drm_cs *cs)
>  {
>     /* Wait for any pending ioctl to complete. */
> -    if (cs->thread) {
> -        pipe_thread_wait(cs->thread);
> -        cs->thread = 0;
> +    if (cs->thread && cs->flush_started) {
> +        pipe_semaphore_wait(&cs->flush_completed);
> +        cs->flush_started = 0;
>     }
>  }
>
> -DEBUG_GET_ONCE_BOOL_OPTION(thread, "RADEON_THREAD", TRUE)
> -
>  static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs, unsigned flags)
>  {
>     struct radeon_drm_cs *cs = radeon_drm_cs(rcs);
> @@ -402,33 +420,33 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs 
> *rcs, unsigned flags)
>
>     radeon_drm_cs_sync_flush(cs);
>
> +    /* Flip command streams. */
> +    tmp = cs->csc;
> +    cs->csc = cs->cst;
> +    cs->cst = tmp;
> +
>     /* If the CS is not empty, emit it in a newly-spawned thread. */
>     if (cs->base.cdw) {
> -        unsigned i, crelocs = cs->csc->crelocs;
> +        unsigned i, crelocs = cs->cst->crelocs;
>
> -        cs->csc->chunks[0].length_dw = cs->base.cdw;
> +        cs->cst->chunks[0].length_dw = cs->base.cdw;
>
>         for (i = 0; i < crelocs; i++) {
>             /* Update the number of active asynchronous CS ioctls for the 
> buffer. */
> -            p_atomic_inc(&cs->csc->relocs_bo[i]->num_active_ioctls);
> +            p_atomic_inc(&cs->cst->relocs_bo[i]->num_active_ioctls);
>         }
>
> -        if (cs->ws->num_cpus > 1 && debug_get_option_thread() &&
> +        if (cs->thread &&
>             (flags & RADEON_FLUSH_ASYNC)) {
> -            cs->thread = pipe_thread_create(radeon_drm_cs_emit_ioctl, 
> cs->csc);
> -            assert(cs->thread);
> +            cs->flush_started = 1;
> +            pipe_semaphore_signal(&cs->flush_queued);
>         } else {
> -            radeon_drm_cs_emit_ioctl(cs->csc);
> +            radeon_drm_cs_emit_ioctl_oneshot(cs->cst);
>         }
>     } else {
> -        radeon_cs_context_cleanup(cs->csc);
> +        radeon_cs_context_cleanup(cs->cst);
>     }
>
> -    /* Flip command streams. */
> -    tmp = cs->csc;
> -    cs->csc = cs->cst;
> -    cs->cst = tmp;
> -
>     /* Prepare a new CS. */
>     cs->base.buf = cs->csc->buf;
>     cs->base.cdw = 0;
> @@ -438,6 +456,15 @@ static void radeon_drm_cs_destroy(struct 
> radeon_winsys_cs *

[Mesa-dev] [PATCH] driconf: Updated German translation

2011-08-29 Thread Carl-Philip Haensch
---
 src/mesa/drivers/dri/common/xmlpool/de.po |  141 +++--
 1 files changed, 91 insertions(+), 50 deletions(-)

diff --git a/src/mesa/drivers/dri/common/xmlpool/de.po 
b/src/mesa/drivers/dri/common/xmlpool/de.po
index 4ea82f9..8b5a296 100644
--- a/src/mesa/drivers/dri/common/xmlpool/de.po
+++ b/src/mesa/drivers/dri/common/xmlpool/de.po
@@ -7,10 +7,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Mesa 6.3\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-04-11 23:19+0200\n"
+"POT-Creation-Date: 2011-08-29 16:34+0200\n"
 "PO-Revision-Date: 2005-04-11 01:34+0200\n"
 "Last-Translator: Felix Kuehling \n"
 "Language-Team: German \n"
+"Language: de\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -32,148 +33,148 @@ msgstr "Zeige Performanceboxen"
 msgid "Image Quality"
 msgstr "Bildqualität"
 
-#: t_options.h:77
+#: t_options.h:82
 msgid "Texture color depth"
 msgstr "Texturfarbtiefe"
 
-#: t_options.h:78
+#: t_options.h:83
 msgid "Prefer frame buffer color depth"
 msgstr "Bevorzuge Farbtiefe des Framebuffers"
 
-#: t_options.h:79
+#: t_options.h:84
 msgid "Prefer 32 bits per texel"
 msgstr "Bevorzuge 32 bits pro Texel"
 
-#: t_options.h:80
+#: t_options.h:85
 msgid "Prefer 16 bits per texel"
 msgstr "Bevorzuge 16 bits pro Texel"
 
-#: t_options.h:81
+#: t_options.h:86
 msgid "Force 16 bits per texel"
 msgstr "Erzwinge 16 bits pro Texel"
 
-#: t_options.h:87
+#: t_options.h:92
 msgid "Initial maximum value for anisotropic texture filtering"
 msgstr "Initialer Maximalwert für anisotropische Texturfilterung"
 
-#: t_options.h:92
+#: t_options.h:97
 msgid "Forbid negative texture LOD bias"
 msgstr "Verbiete negative Textur-Detailgradverschiebung"
 
-#: t_options.h:97
+#: t_options.h:102
 msgid ""
 "Enable S3TC texture compression even if software support is not available"
 msgstr ""
 "Aktiviere S3TC Texturkomprimierung auch wenn die nötige "
 "Softwareunterstützung fehlt"
 
-#: t_options.h:104
+#: t_options.h:109
 msgid "Initial color reduction method"
 msgstr "Initiale Farbreduktionsmethode"
 
-#: t_options.h:105
+#: t_options.h:110
 msgid "Round colors"
 msgstr "Farben runden"
 
-#: t_options.h:106
+#: t_options.h:111
 msgid "Dither colors"
 msgstr "Farben rastern"
 
-#: t_options.h:114
+#: t_options.h:119
 msgid "Color rounding method"
 msgstr "Farbrundungsmethode"
 
-#: t_options.h:115
+#: t_options.h:120
 msgid "Round color components downward"
 msgstr "Farbkomponenten abrunden"
 
-#: t_options.h:116
+#: t_options.h:121
 msgid "Round to nearest color"
 msgstr "Zur ähnlichsten Farbe runden"
 
-#: t_options.h:125
+#: t_options.h:130
 msgid "Color dithering method"
 msgstr "Farbrasterungsmethode"
 
-#: t_options.h:126
+#: t_options.h:131
 msgid "Horizontal error diffusion"
 msgstr "Horizontale Fehlerstreuung"
 
-#: t_options.h:127
+#: t_options.h:132
 msgid "Horizontal error diffusion, reset error at line start"
 msgstr "Horizontale Fehlerstreuung, Fehler am Zeilenanfang zurücksetzen"
 
-#: t_options.h:128
+#: t_options.h:133
 msgid "Ordered 2D color dithering"
 msgstr "Geordnete 2D Farbrasterung"
 
-#: t_options.h:134
+#: t_options.h:139
 msgid "Floating point depth buffer"
 msgstr "Fließkomma z-Puffer"
 
-#: t_options.h:140
+#: t_options.h:145
 msgid "Performance"
 msgstr "Leistung"
 
-#: t_options.h:148
+#: t_options.h:153
 msgid "TCL mode (Transformation, Clipping, Lighting)"
 msgstr "TCL-Modus (Transformation, Clipping, Licht)"
 
-#: t_options.h:149
+#: t_options.h:154
 msgid "Use software TCL pipeline"
 msgstr "Benutze die Software-TCL-Pipeline"
 
-#: t_options.h:150
+#: t_options.h:155
 msgid "Use hardware TCL as first TCL pipeline stage"
 msgstr "Benutze Hardware TCL als erste Stufe der TCL-Pipeline"
 
-#: t_options.h:151
+#: t_options.h:156
 msgid "Bypass the TCL pipeline"
 msgstr "Umgehe die TCL-Pipeline"
 
-#: t_options.h:152
+#: t_options.h:157
 msgid ""
 "Bypass the TCL pipeline with state-based machine code generated on-the-fly"
 msgstr ""
 "Umgehe die TCL-Pipeline mit zur Laufzeit erzeugtem, zustandsbasiertem "
 "Maschinencode"
 
-#: t_options.h:161
+#: t_options.h:166
 msgid "Method to limit rendering latency"
 msgstr "Methode zur Begrenzung der Bildverzögerung"
 
-#: t_options.h:162
+#: t_options.h:167
 msgid "Busy waiting for the graphics hardware"
 msgstr "Aktives Warten auf die Grafikhardware"
 
-#: t_options.h:163
+#: t_options.h:168
 msgid "Sleep for brief intervals while waiting for the graphics hardware"
 msgstr "Kurze Schlafintervalle beim Warten auf die Grafikhardware"
 
-#: t_options.h:164
+#: t_options.h:169
 msgid "Let the graphics hardware emit a software interrupt and sleep"
 msgstr ""
 "Die Grafikhardware eine Softwareunterbrechnung erzeugen lassen und schlafen"
 
-#: t_options.h:174
+#: t_options.h:179
 msgid "Synchronization with vertical refresh (swap intervals)"
 msgstr "Synchronisation mit der vertikalen Bildwiederholung"
 
-#: t_options.h:175
+#: t_options.h:180
 msgid "Never synchroni

[Mesa-dev] map-texture-image-v5 branch

2011-08-29 Thread Brian Paul
I've created this branch with the first batch of my reworked
map-texture-image patches.  I'm having some network/mail problems so
git-send-email isn't working for me ATM.  Please review/test and I'll
merge to master.  Thanks.

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


Re: [Mesa-dev] [PATCH 3/3] make: Factor out source lists from drivers/dri/common into Makefile.sources

2011-08-29 Thread Chia-I Wu
On Tue, Aug 30, 2011 at 2:43 AM, Chad Versace  wrote:
> In order that the Autoconf and Android build can share the same source
> lists, move the lists from
>    src/mesa/drivers/dri/Makefile.defines
> into
>    src/mesa/drivers/dri/common/Makefile.sources
>
> I would like for Android to just reuse Makefile.defines, but the file is
> unsuitable for reuse.
>
> v2
> 
> - [olv] Remove MESA_TOP from definition of *_INCLUDES so that
>  Makefile.sources can be self-contained.
>
> CC: Chia-I Wu 
> Signed-off: Chad Versace 
> ---
>  src/mesa/drivers/dri/Makefile.defines        |   20 +++-
>  src/mesa/drivers/dri/common/Makefile.sources |   19 +++
>  2 files changed, 26 insertions(+), 13 deletions(-)
>  create mode 100644 src/mesa/drivers/dri/common/Makefile.sources
>
> diff --git a/src/mesa/drivers/dri/Makefile.defines 
> b/src/mesa/drivers/dri/Makefile.defines
> index 90ae551..6ff8df5 100644
> --- a/src/mesa/drivers/dri/Makefile.defines
> +++ b/src/mesa/drivers/dri/Makefile.defines
> @@ -1,14 +1,13 @@
>  # -*-makefile-*-
>
> +# Import mesa_dri_common_*
> +include ../common/Makefile.sources
> +
>  COMMON_GALLIUM_SOURCES = \
> -        ../common/utils.c \
> -        ../common/vblank.c \
> -        ../common/dri_util.c \
> -        ../common/xmlconfig.c
> +       $(addprefix ../common/, $(mesa_dri_common_gallium_SOURCES))
>
> -COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
> -        ../common/texmem.c \
> -        ../common/drirenderbuffer.c
> +COMMON_SOURCES = \
> +       $(addprefix ../common/, $(mesa_dri_common_SOURCES))
>
>  INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
>
> @@ -20,13 +19,8 @@ OBJECTS = $(C_SOURCES:.c=.o) \
>  ### Include directories
>  SHARED_INCLUDES = \
>        -I. \
> -       -I$(TOP)/src/mesa/drivers/dri/common \
>        -Iserver \
> -       -I$(TOP)/include \
> -       -I$(TOP)/src/mapi \
> -       -I$(TOP)/src/mesa \
> -       -I$(TOP)/src/egl/main \
> -       -I$(TOP)/src/egl/drivers/dri \
> +       $(addprefix -I$(TOP)/, $(mesa_dri_common_INCLUDES)) \
>        $(LIBDRM_CFLAGS)
>
>  INCLUDES += $(API_DEFINES)
> diff --git a/src/mesa/drivers/dri/common/Makefile.sources 
> b/src/mesa/drivers/dri/common/Makefile.sources
> new file mode 100644
> index 000..22df2f0
> --- /dev/null
> +++ b/src/mesa/drivers/dri/common/Makefile.sources
> @@ -0,0 +1,19 @@
> +mesa_dri_common_gallium_SOURCES := \
> +       utils.c \
> +       vblank.c \
> +       dri_util.c \
> +       xmlconfig.c
> +
> +mesa_dri_common_SOURCES := \
> +       $(mesa_dri_common_gallium_SOURCES) \
> +        texmem.c \
> +        drirenderbuffer.c
> +
> +# Paths are relative to MESA_TOP.
> +mesa_dri_common_INCLUDES := \
> +       include \
> +       src/egl/drivers/dri \
> +       src/egl/main \
> +       src/mapi \
> +       src/mesa \
> +       src/mesa/drivers/dri/common \
Is the last backslash intended?  Either way, this file looks good to
me.  I did not go through other changes though.


> --
> 1.7.6
>
>



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


Re: [Mesa-dev] [PATCH 1/5] mesa: Build libmesa_dricore.a for Android

2011-08-29 Thread Chia-I Wu
On Tue, Aug 30, 2011 at 2:50 AM, Chad Versace  wrote:
> libmesa_dricore.a is analogous to the libmesa.a built by the Autoconf
> build.
>
> v2
> 
> - Change libmesa_dricore from a shared library to a static library.
>  I decided to make this change after realizing that libmesa_dricore.so
>  indiscriminately exported all its symbols.
Reviewed-by: Chia-I Wu 

> CC: Ian Romanick 
> CC: Chia-I Wu 
> Signed-off-by: Chad Versace 
> ---
>  src/mesa/Android.mk |   29 +
>  1 files changed, 29 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk
> index 67808d4..5f0f4af 100644
> --- a/src/mesa/Android.mk
> +++ b/src/mesa/Android.mk
> @@ -83,6 +83,35 @@ include $(BUILD_STATIC_LIBRARY)
>  endif # MESA_BUILD_GALLIUM
>
>  # ---
> +# Build libmesa_dricore for DRI modules
> +# ---
> +
> +ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
> +
> +include $(CLEAR_VARS)
> +
> +LOCAL_MODULE := libmesa_dricore
> +LOCAL_MODULE_CLASS := STATIC_LIBRARIES
> +
> +LOCAL_CFLAGS := \
> +       $(common_CFLAGS) \
> +       -DFEATURE_GL=1
> +
> +LOCAL_C_INCLUDES := \
> +       $(common_C_INCLUDES)
> +
> +LOCAL_SRC_FILES := \
> +        $(MESA_SOURCES) \
> +        $(MESA_CXX_SOURCES) \
> +        $(common_ASM)
> +
> +include $(LOCAL_PATH)/Android.gen.mk
> +include $(MESA_COMMON_MK)
> +include $(BUILD_STATIC_LIBRARY)
> +
> +endif # MESA_BUILD_CLASSIC
> +
> +# ---
>  # Build libmesa_glsl_utils
>  #
>  # It is used to avoid circular dependency between core mesa and glsl.
> --
> 1.7.6
>
>



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


Re: [Mesa-dev] [PATCH 2/5] make: Document imported variables

2011-08-29 Thread Chia-I Wu
On Tue, Aug 30, 2011 at 2:50 AM, Chad Versace  wrote:
> In src/mesa/Android.mk, it is non-trivial to determine which variables are
> imported by `include sources.mak`. So document them.
>
> v2
> 
> - [olv] Add X86_sources to list of documented variables.
Reviewed-by: Chia-I Wu 

> CC: Chia-I Wu 
> Signed-off-by: Chad Versace 
> ---
>  src/mesa/Android.mk |    6 ++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk
> index 5f0f4af..f21ba3a 100644
> --- a/src/mesa/Android.mk
> +++ b/src/mesa/Android.mk
> @@ -25,6 +25,12 @@
>
>  LOCAL_PATH := $(call my-dir)
>
> +# Import the following variables:
> +#     MESA_CXX_SOURCES
> +#     MESA_GALLIUM_CXX_SOURCES
> +#     MESA_GALLIUM_SOURCES
> +#     MESA_SOURCES
> +#     X86_SOURCES
>  include $(LOCAL_PATH)/sources.mak
>
>  common_CFLAGS := \
> --
> 1.7.6
>
>



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


Re: [Mesa-dev] [PATCH 3/5] dri: Build libmesa_dri_common for Android

2011-08-29 Thread Chia-I Wu
On Tue, Aug 30, 2011 at 2:50 AM, Chad Versace  wrote:
> libmesa_dri_common is a static library that contains the sources in
> src/mesa/drivers/dri/common. Each DRI driver should link to it.
>
> v2
> 
> - [olv] In toplevel Android.mk, replace subdir src/mesa/drivers/dri/common
>  with src/mesa/drivers/dri, and add the subdir only if MESA_BUILD_CLASSIC.
> - [olv] Remove redundant ifdef guard in src/mesa/drivers/dri/common/Android.mk
>
> CC: Chia-I Wu 
> Signed-off-by: Chad Versace 
> ---
>  Android.mk                             |    4 ++-
>  src/mesa/drivers/dri/Android.mk        |   27 +
>  src/mesa/drivers/dri/common/Android.mk |   41 
> 
>  3 files changed, 71 insertions(+), 1 deletions(-)
>  create mode 100644 src/mesa/drivers/dri/Android.mk
>  create mode 100644 src/mesa/drivers/dri/common/Android.mk
>
> diff --git a/Android.mk b/Android.mk
> index bc4b74e..2ad83a0 100644
> --- a/Android.mk
> +++ b/Android.mk
> @@ -78,7 +78,9 @@ SUBDIRS := \
>        src/egl/main
>
>  ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
> -SUBDIRS += src/egl/drivers/dri2
> +SUBDIRS += \
> +       src/egl/drivers/dri2 \
> +       src/mesa/drivers/dri
>  endif
>
>  ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
> diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk
> new file mode 100644
> index 000..05b02cb
> --- /dev/null
> +++ b/src/mesa/drivers/dri/Android.mk
> @@ -0,0 +1,27 @@
> +#
> +# Copyright (C) 2011 Intel Corporation
> +#
> +# Permission is hereby granted, free of charge, to any person obtaining a
> +# copy of this software and associated documentation files (the "Software"),
> +# to deal in the Software without restriction, including without limitation
> +# the rights to use, copy, modify, merge, publish, distribute, sublicense,
> +# and/or sell copies of the Software, and to permit persons to whom the
> +# Software is furnished to do so, subject to the following conditions:
> +#
> +# The above copyright notice and this permission notice shall be included
> +# in all copies or substantial portions of the Software.
> +#
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> +# DEALINGS IN THE SOFTWARE.
> +#
> +
> +LOCAL_PATH := $(call my-dir)
> +
> +SUBDIRS := common
> +
> +include $(foreach d, $(SUBDIRS), $(LOCAL_PATH)/$(d)/Android.mk)
> diff --git a/src/mesa/drivers/dri/common/Android.mk 
> b/src/mesa/drivers/dri/common/Android.mk
> new file mode 100644
> index 000..76464a1
> --- /dev/null
> +++ b/src/mesa/drivers/dri/common/Android.mk
> @@ -0,0 +1,41 @@
> +#
> +# Mesa 3-D graphics library
> +#
> +# Copyright (C) 2011 Intel Corporation
> +#
> +# Permission is hereby granted, free of charge, to any person obtaining a
> +# copy of this software and associated documentation files (the "Software"),
> +# to deal in the Software without restriction, including without limitation
> +# the rights to use, copy, modify, merge, publish, distribute, sublicense,
> +# and/or sell copies of the Software, and to permit persons to whom the
> +# Software is furnished to do so, subject to the following conditions:
> +#
> +# The above copyright notice and this permission notice shall be included
> +# in all copies or substantial portions of the Software.
> +#
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> +# DEALINGS IN THE SOFTWARE.
> +#
> +
> +#
> +# Build libmesa_dri_common
> +#
> +
> +LOCAL_PATH := $(call my-dir)
> +include $(CLEAR_VARS)
> +
> +include $(LOCAL_PATH)/Makefile.sources
> +
> +LOCAL_MODULE := libmesa_dri_common
> +LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_CLASS is optional unless you need to generate files.  I
am fine either way though.
> +LOCAL_C_INCLUDES := $(MESA_DRI_C_INCLUDES)
MESA_DRI_C_INCLUDES is not defined anywhere.  But I suppose that is
fine as there is no way to build libmesa_dri_common yet.

With or without the changes,

Reviewed-by: Chia-I Wu 
> +LOCAL_SRC_FILES := $(mesa_dri_common_SOURCES)

> +include $(MESA_COMMON_MK)
> +include $(BUILD_STATIC_LIBRARY)
> --
> 1.7.6
>
>



-- 
o...@lunarg.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
h

Re: [Mesa-dev] [PATCH 5/5] i965: Build i965_dri.so for Android

2011-08-29 Thread Chia-I Wu
On Tue, Aug 30, 2011 at 2:50 AM, Chad Versace  wrote:
> Compile tested only.
>
> v2
> 
> - [olv] Update comments to include i965 in list of classic drivers.
>
> CC: Ian Romanick 
> CC: Chia-I Wu 
> Signed-off-by: Chad Versace 
> ---
>  Android.mk                           |    4 +-
>  src/mesa/drivers/dri/Android.mk      |   35 +++
>  src/mesa/drivers/dri/i965/Android.mk |   61 
> ++
>  3 files changed, 98 insertions(+), 2 deletions(-)
>  create mode 100644 src/mesa/drivers/dri/i965/Android.mk
>
> diff --git a/Android.mk b/Android.mk
> index 2ad83a0..7c7c55a 100644
> --- a/Android.mk
> +++ b/Android.mk
> @@ -23,7 +23,7 @@
>
>  # BOARD_GPU_DRIVERS should be defined.  The valid values are
>  #
> -#   classic drivers:
> +#   classic drivers: i965
>  #   gallium drivers: swrast i915g nouveau r300g r600g vmwgfx
>  #
>  # The main target is libGLES_mesa.  For each classic driver enabled, a DRI
> @@ -36,7 +36,7 @@ MESA_PYTHON2 := python
>  DRM_TOP := external/drm
>  DRM_GRALLOC_TOP := hardware/drm_gralloc
>
> -classic_drivers :=
> +classic_drivers := i965
>  gallium_drivers := swrast i915g nouveau r300g r600g vmwgfx
>
>  MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))
> diff --git a/src/mesa/drivers/dri/Android.mk b/src/mesa/drivers/dri/Android.mk
> index 05b02cb..d3b7826 100644
> --- a/src/mesa/drivers/dri/Android.mk
> +++ b/src/mesa/drivers/dri/Android.mk
> @@ -22,6 +22,41 @@
>
>  LOCAL_PATH := $(call my-dir)
>
> +# Import mesa_dri_common_INCLUDES.
> +include $(LOCAL_PATH)/common/Makefile.sources
> +
> +#---
> +# Variables common to all DRI drivers
> +
> +MESA_DRI_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/dri
> +MESA_DRI_MODULE_UNSTRIPPED_PATH := 
> $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/dri
> +
> +MESA_DRI_C_INCLUDES := \
> +       $(addprefix $(MESA_TOP)/, $(mesa_dri_common_INCLUDES)) \
> +       $(DRM_TOP) \
> +       $(DRM_TOP)/include/drm \
> +       external/expat/lib
> +
> +MESA_DRI_WHOLE_STATIC_LIBRARIES := \
> +       libmesa_glsl \
> +       libmesa_dri_common \
> +       libmesa_dricore
> +
> +MESA_DRI_SHARED_LIBRARIES := \
> +       libcutils \
> +       libdl \
> +       libdrm \
> +       libexpat \
> +       libglapi \
> +       liblog \
Spurious backslash?

I did not test, but

Reviewed-by: Chia-I Wu 

> +
> +#---
> +# Build drivers and libmesa_dri_common
> +
>  SUBDIRS := common
>
> +ifneq ($(filter i965, $(MESA_GPU_DRIVERS)),)
> +       SUBDIRS += i965
> +endif
> +
>  include $(foreach d, $(SUBDIRS), $(LOCAL_PATH)/$(d)/Android.mk)
> diff --git a/src/mesa/drivers/dri/i965/Android.mk 
> b/src/mesa/drivers/dri/i965/Android.mk
> new file mode 100644
> index 000..2a289dd
> --- /dev/null
> +++ b/src/mesa/drivers/dri/i965/Android.mk
> @@ -0,0 +1,61 @@
> +#
> +# Copyright (C) 2011 Intel Corporation
> +# Copyright (C) 2010-2011 Chia-I Wu 
> +# Copyright (C) 2010-2011 LunarG
> +#
> +# Permission is hereby granted, free of charge, to any person obtaining a
> +# copy of this software and associated documentation files (the "Software"),
> +# to deal in the Software without restriction, including without limitation
> +# the rights to use, copy, modify, merge, publish, distribute, sublicense,
> +# and/or sell copies of the Software, and to permit persons to whom the
> +# Software is furnished to do so, subject to the following conditions:
> +#
> +# The above copyright notice and this permission notice shall be included
> +# in all copies or substantial portions of the Software.
> +#
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> +# DEALINGS IN THE SOFTWARE.
> +#
> +
> +LOCAL_PATH := $(call my-dir)
> +include $(CLEAR_VARS)
> +
> +LOCAL_MODULE := i965_dri
> +LOCAL_MODULE_PATH := $(MESA_DRI_MODULE_PATH)
> +LOCAL_UNSTRIPPED_PATH := $(MESA_DRI_MODULE_UNSTRIPPED_PATH)
> +
> +# Import variables i965_*.
> +include $(LOCAL_PATH)/Makefile.sources
> +
> +# Overriding LOCAL_CC below is an ugly workaround.  We cannot place -std=c99
> +# in LOCAL_C_FLAGS because Android appends LOCAL_C_FLAGS to LOCAL_CPP_FLAGS.
> +LOCAL_CC := $(CC) -std=c99
> +
> +LOCAL_C_FLAGS := \
> +       $(MESA_DRI_C_FLAGS) \
> +       -DI965
> +
> +LOCAL_C_INCLUDES := \
> +       $(i965_INCLUDES) \
> +       $(MESA_DRI_C_INCLUDES) \
> +       $(DRM_TOP)/intel
> +
> +LOCAL_SRC_FILES := \
> +       $(i965_C_SOURCES) \
> +       $(i965_CXX_SOURCES) \
> +       $(i965_ASM_SOURCES)
> +
> +LOCAL_WHOLE_STATIC_LIBRARIES := \
> +       $(MESA_DRI_WHOLE_STATIC_LIBRARIES)
> +
> +LOCAL_SHARED_LIBRA

Re: [Mesa-dev] Missing integer "set" opcodes in Gallium

2011-08-29 Thread Bryan Cain
On 08/29/2011 03:41 PM, Zack Rusin wrote:
> On Monday, August 29, 2011 04:02:08 PM Zack Rusin wrote:
>> Either way though if GL needs those ops then, like Brian mentioned, it'd be
>> a  good idea to add them.
> Actually I think it seems easier to just flip the ops rather than add new 
> instructions, i.e. change stuff like a > b, to b < a, and a <= b to b >= a. 
> Just an opinion though, I don't have strong preferences here.

You're right; that's an easier solution.  That way, the only opcode I'll
need to add is UARL.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 02/20] glsl: Silence "ast_to_hir.cpp:1984:25: warning: comparison of unsigned expression >= 0 is always true"

2011-08-29 Thread Kenneth Graunke
On 08/29/2011 02:58 PM, Ian Romanick wrote:
> From: Ian Romanick 
> 
> ast_type_qualifier::location should have been a signed integer from
> the beginning, and the giant comment in
> apply_type_qualifier_to_variable explains why.
> ---
>  src/glsl/ast.h |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/glsl/ast.h b/src/glsl/ast.h
> index d1de227..532347d 100644
> --- a/src/glsl/ast.h
> +++ b/src/glsl/ast.h
> @@ -372,7 +372,7 @@ struct ast_type_qualifier {
>  * \note
>  * This field is only valid if \c explicit_location is set.
>  */
> -   unsigned location;
> +   int location;
>  
> /**
>  * Return true if and only if an interpolation qualifier is present.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40207
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/3] mesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette

2011-08-29 Thread Kenneth Graunke
On 08/29/2011 11:12 AM, Ian Romanick wrote:
> From: Ian Romanick 
> 
> This was also discussed at XDS 2010.  However, actually making the
> change was delayed because several drivers still exposed these
> extensions to significant benefit (e.g., tdfx).  Now that those
> drivers have been removed, this code can be removed as well.

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