Mesa (master): freedreno: update generated headers

2015-08-24 Thread Rob Clark
Module: Mesa
Branch: master
Commit: afb6c24a207fe7b9917644b940e4c5d1870c5c92
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=afb6c24a207fe7b9917644b940e4c5d1870c5c92

Author: Rob Clark robcl...@freedesktop.org
Date:   Mon Aug 24 12:58:08 2015 -0400

freedreno: update generated headers

Signed-off-by: Rob Clark robcl...@freedesktop.org

---

 src/gallium/drivers/freedreno/a2xx/a2xx.xml.h |2 +-
 src/gallium/drivers/freedreno/a3xx/a3xx.xml.h |2 +-
 src/gallium/drivers/freedreno/a4xx/a4xx.xml.h |5 -
 src/gallium/drivers/freedreno/adreno_common.xml.h |2 +-
 src/gallium/drivers/freedreno/adreno_pm4.xml.h|2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a2xx/a2xx.xml.h 
b/src/gallium/drivers/freedreno/a2xx/a2xx.xml.h
index 0261f0d..dd48956 100644
--- a/src/gallium/drivers/freedreno/a2xx/a2xx.xml.h
+++ b/src/gallium/drivers/freedreno/a2xx/a2xx.xml.h
@@ -14,7 +14,7 @@ The rules-ng-ng source files this header was generated from 
are:
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_common.xml (  
10551 bytes, from 2015-05-20 20:03:14)
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_pm4.xml(  
14968 bytes, from 2015-05-20 20:12:27)
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/a3xx.xml  (  
67120 bytes, from 2015-08-14 23:22:03)
-- /home/robclark/src/freedreno/envytools/rnndb/adreno/a4xx.xml  (  
63785 bytes, from 2015-08-14 18:27:06)
+- /home/robclark/src/freedreno/envytools/rnndb/adreno/a4xx.xml  (  
63915 bytes, from 2015-08-24 16:56:28)
 
 Copyright (C) 2013-2015 by the following authors:
 - Rob Clark robdcl...@gmail.com (robclark)
diff --git a/src/gallium/drivers/freedreno/a3xx/a3xx.xml.h 
b/src/gallium/drivers/freedreno/a3xx/a3xx.xml.h
index 48d1337..441bfec 100644
--- a/src/gallium/drivers/freedreno/a3xx/a3xx.xml.h
+++ b/src/gallium/drivers/freedreno/a3xx/a3xx.xml.h
@@ -14,7 +14,7 @@ The rules-ng-ng source files this header was generated from 
are:
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_common.xml (  
10551 bytes, from 2015-05-20 20:03:14)
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_pm4.xml(  
14968 bytes, from 2015-05-20 20:12:27)
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/a3xx.xml  (  
67120 bytes, from 2015-08-14 23:22:03)
-- /home/robclark/src/freedreno/envytools/rnndb/adreno/a4xx.xml  (  
63785 bytes, from 2015-08-14 18:27:06)
+- /home/robclark/src/freedreno/envytools/rnndb/adreno/a4xx.xml  (  
63915 bytes, from 2015-08-24 16:56:28)
 
 Copyright (C) 2013-2015 by the following authors:
 - Rob Clark robdcl...@gmail.com (robclark)
diff --git a/src/gallium/drivers/freedreno/a4xx/a4xx.xml.h 
b/src/gallium/drivers/freedreno/a4xx/a4xx.xml.h
index ac55066..2e1d712 100644
--- a/src/gallium/drivers/freedreno/a4xx/a4xx.xml.h
+++ b/src/gallium/drivers/freedreno/a4xx/a4xx.xml.h
@@ -14,7 +14,7 @@ The rules-ng-ng source files this header was generated from 
are:
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_common.xml (  
10551 bytes, from 2015-05-20 20:03:14)
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_pm4.xml(  
14968 bytes, from 2015-05-20 20:12:27)
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/a3xx.xml  (  
67120 bytes, from 2015-08-14 23:22:03)
-- /home/robclark/src/freedreno/envytools/rnndb/adreno/a4xx.xml  (  
63785 bytes, from 2015-08-14 18:27:06)
+- /home/robclark/src/freedreno/envytools/rnndb/adreno/a4xx.xml  (  
63915 bytes, from 2015-08-24 16:56:28)
 
 Copyright (C) 2013-2015 by the following authors:
 - Rob Clark robdcl...@gmail.com (robclark)
@@ -162,10 +162,13 @@ enum a4xx_tex_fmt {
TFMT4_8_UNORM = 4,
TFMT4_8_8_UNORM = 14,
TFMT4_8_8_8_8_UNORM = 28,
+   TFMT4_8_SNORM = 5,
TFMT4_8_8_SNORM = 15,
TFMT4_8_8_8_8_SNORM = 29,
+   TFMT4_8_UINT = 6,
TFMT4_8_8_UINT = 16,
TFMT4_8_8_8_8_UINT = 30,
+   TFMT4_8_SINT = 7,
TFMT4_8_8_SINT = 17,
TFMT4_8_8_8_8_SINT = 31,
TFMT4_16_UINT = 21,
diff --git a/src/gallium/drivers/freedreno/adreno_common.xml.h 
b/src/gallium/drivers/freedreno/adreno_common.xml.h
index 399a9e52..29944b7 100644
--- a/src/gallium/drivers/freedreno/adreno_common.xml.h
+++ b/src/gallium/drivers/freedreno/adreno_common.xml.h
@@ -14,7 +14,7 @@ The rules-ng-ng source files this header was generated from 
are:
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_common.xml (  
10551 bytes, from 2015-05-20 20:03:14)
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_pm4.xml(  
14968 bytes, from 2015-05-20 20:12:27)
 - /home/robclark/src/freedreno/envytools/rnndb/adreno/a3xx.xml  (  
67120 bytes, from 2015-08-14 23:22:03)
-- /home/robclark/src/freedreno/envytools/rnndb/adreno/a4xx.xml  (  
63785 bytes, from 2015-08-14 18:27:06)
+- 

Mesa (master): freedreno/a4xx: formats update

2015-08-24 Thread Rob Clark
Module: Mesa
Branch: master
Commit: 000e225360c020e8b3de142c4c898baad321d242
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=000e225360c020e8b3de142c4c898baad321d242

Author: Rob Clark robcl...@freedesktop.org
Date:   Sat Aug 15 11:57:22 2015 -0400

freedreno/a4xx: formats update

Fixes glamor, which wants to use R8 integer textures.

Signed-off-by: Rob Clark robcl...@freedesktop.org

---

 src/gallium/drivers/freedreno/a4xx/fd4_format.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_format.c 
b/src/gallium/drivers/freedreno/a4xx/fd4_format.c
index 3e00454..6c9e217 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_format.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_format.c
@@ -79,9 +79,9 @@ struct fd4_format {
 static struct fd4_format formats[PIPE_FORMAT_COUNT] = {
/* 8-bit */
VT(R8_UNORM,   8_UNORM, R8_UNORM, WZYX),
-   V_(R8_SNORM,   8_SNORM, NONE, WZYX),
-   V_(R8_UINT,8_UINT,  NONE, WZYX),
-   V_(R8_SINT,8_SINT,  NONE, WZYX),
+   VT(R8_SNORM,   8_SNORM, NONE, WZYX),
+   VT(R8_UINT,8_UINT,  NONE, WZYX),
+   VT(R8_SINT,8_SINT,  NONE, WZYX),
V_(R8_USCALED, 8_UINT,  NONE, WZYX),
V_(R8_SSCALED, 8_UINT,  NONE, WZYX),
 
@@ -115,8 +115,8 @@ static struct fd4_format formats[PIPE_FORMAT_COUNT] = {
 
VT(R8G8_UNORM,   8_8_UNORM, R8G8_UNORM, WZYX),
VT(R8G8_SNORM,   8_8_SNORM, R8G8_SNORM, WZYX),
-   VT(R8G8_UINT,8_8_UINT,  NONE,   WZYX),
-   VT(R8G8_SINT,8_8_SINT,  NONE,   WZYX),
+   VT(R8G8_UINT,8_8_UINT,  R8G8_UINT,  WZYX),
+   VT(R8G8_SINT,8_8_SINT,  R8G8_SINT,  WZYX),
V_(R8G8_USCALED, 8_8_UINT,  NONE,   WZYX),
V_(R8G8_SSCALED, 8_8_SINT,  NONE,   WZYX),
 

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


Mesa (master): mesa/formats: only do type and component lookup for uncompressed formats

2015-08-24 Thread Nanley Chery
Module: Mesa
Branch: master
Commit: 9f00af672b59766008994a190730d48ae03773dd
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f00af672b59766008994a190730d48ae03773dd

Author: Nanley Chery nanley.g.ch...@intel.com
Date:   Fri Jul 31 09:25:56 2015 -0700

mesa/formats: only do type and component lookup for uncompressed formats

Only uncompressed formats have a non-void type and actual
components per pixel. Rename _mesa_format_to_type_and_comps
to _mesa_uncompressed_format_to_type_and_comps and require
callers to check if the format is not compressed.

v2. include compressed format cases to avoid gcc warnings (Chad).

Reviewed-by: Chad Versace chad.vers...@intel.com
Signed-off-by: Nanley Chery nanley.g.ch...@intel.com

---

 src/mesa/main/format_utils.c |2 +-
 src/mesa/main/formats.c  |   89 --
 src/mesa/main/formats.h  |2 +-
 src/mesa/main/mipmap.c   |2 +-
 4 files changed, 46 insertions(+), 49 deletions(-)

diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
index 810bb16..5fdabd5 100644
--- a/src/mesa/main/format_utils.c
+++ b/src/mesa/main/format_utils.c
@@ -602,7 +602,7 @@ _mesa_format_to_array(mesa_format format, GLenum *type, int 
*num_components,
 
*normalized = !_mesa_is_format_integer(format);
 
-   _mesa_format_to_type_and_comps(format, type, format_components);
+   _mesa_uncompressed_format_to_type_and_comps(format, type, 
format_components);
 
switch (_mesa_get_format_layout(format)) {
case MESA_FORMAT_LAYOUT_ARRAY:
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 8c7e6ad..673c6b9 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -885,9 +885,9 @@ _mesa_format_row_stride(mesa_format format, GLsizei width)
 
 
 /**
- * Debug/test: check that all formats are handled in the
- * _mesa_format_to_type_and_comps() function.  When new pixel formats
- * are added to Mesa, that function needs to be updated.
+ * Debug/test: check that all uncompressed formats are handled in the
+ * _mesa_uncompressed_format_to_type_and_comps() function. When new pixel
+ * formats are added to Mesa, that function needs to be updated.
  * This is a no-op after the first call.
  */
 static void
@@ -901,7 +901,8 @@ check_format_to_type_and_comps(void)
   /* This function will emit a problem/warning if the format is
* not handled.
*/
-  _mesa_format_to_type_and_comps(f, datatype, comps);
+  if (!_mesa_is_format_compressed(f))
+ _mesa_uncompressed_format_to_type_and_comps(f, datatype, comps);
}
 }
 
@@ -997,11 +998,11 @@ _mesa_test_formats(void)
 
 
 /**
- * Return datatype and number of components per texel for the given 
mesa_format.
- * Only used for mipmap generation code.
+ * Return datatype and number of components per texel for the given
+ * uncompressed mesa_format. Only used for mipmap generation code.
  */
 void
-_mesa_format_to_type_and_comps(mesa_format format,
+_mesa_uncompressed_format_to_type_and_comps(mesa_format format,
GLenum *datatype, GLuint *comps)
 {
switch (format) {
@@ -1235,44 +1236,6 @@ _mesa_format_to_type_and_comps(mesa_format format,
   *comps = 2;
   return;
 
-   case MESA_FORMAT_RGB_FXT1:
-   case MESA_FORMAT_RGBA_FXT1:
-   case MESA_FORMAT_RGB_DXT1:
-   case MESA_FORMAT_RGBA_DXT1:
-   case MESA_FORMAT_RGBA_DXT3:
-   case MESA_FORMAT_RGBA_DXT5:
-   case MESA_FORMAT_SRGB_DXT1:
-   case MESA_FORMAT_SRGBA_DXT1:
-   case MESA_FORMAT_SRGBA_DXT3:
-   case MESA_FORMAT_SRGBA_DXT5:
-   case MESA_FORMAT_R_RGTC1_UNORM:
-   case MESA_FORMAT_R_RGTC1_SNORM:
-   case MESA_FORMAT_RG_RGTC2_UNORM:
-   case MESA_FORMAT_RG_RGTC2_SNORM:
-   case MESA_FORMAT_L_LATC1_UNORM:
-   case MESA_FORMAT_L_LATC1_SNORM:
-   case MESA_FORMAT_LA_LATC2_UNORM:
-   case MESA_FORMAT_LA_LATC2_SNORM:
-   case MESA_FORMAT_ETC1_RGB8:
-   case MESA_FORMAT_ETC2_RGB8:
-   case MESA_FORMAT_ETC2_SRGB8:
-   case MESA_FORMAT_ETC2_RGBA8_EAC:
-   case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
-   case MESA_FORMAT_ETC2_R11_EAC:
-   case MESA_FORMAT_ETC2_RG11_EAC:
-   case MESA_FORMAT_ETC2_SIGNED_R11_EAC:
-   case MESA_FORMAT_ETC2_SIGNED_RG11_EAC:
-   case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1:
-   case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1:
-   case MESA_FORMAT_BPTC_RGBA_UNORM:
-   case MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM:
-   case MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT:
-   case MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT:
-  /* XXX generate error instead? */
-  *datatype = GL_UNSIGNED_BYTE;
-  *comps = 0;
-  return;
-
case MESA_FORMAT_RGBA_FLOAT32:
   *datatype = GL_FLOAT;
   *comps = 4;
@@ -1571,12 +1534,46 @@ _mesa_format_to_type_and_comps(mesa_format format,
   assert(0);
   return;
 
+   case MESA_FORMAT_RGB_FXT1:
+   case MESA_FORMAT_RGBA_FXT1:
+   case MESA_FORMAT_RGB_DXT1:
+   case MESA_FORMAT_RGBA_DXT1:
+   case MESA_FORMAT_RGBA_DXT3:
+   case MESA_FORMAT_RGBA_DXT5:
+   case 

Mesa (master): i965: Always re-emit the pipeline select during invariant state emission

2015-08-24 Thread Chris Wilson
Module: Mesa
Branch: master
Commit: 4e5752e2b78243a71766538f62ca0a80488047a7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4e5752e2b78243a71766538f62ca0a80488047a7

Author: Chris Wilson ch...@chris-wilson.co.uk
Date:   Sun Aug 23 09:24:57 2015 +0100

i965: Always re-emit the pipeline select during invariant state emission

On the older platforms where we don't have logical contexts preserving
state across batches, we emit the invariant state setup on every batch
using the brw_invariant_state atom. This includes the pipeline selection
which is cached with the introduction of

commit 0e0e23ef537c9add672ff322f34e129a07edc55e
Author: Jordan Justen jordan.l.jus...@intel.com
Date:   Wed Apr 22 11:43:50 2015 -0700

i965/state: Emit pipeline select when changing pipelines

However, we do not reset the cache between batches on context-less
platforms resulting in us not setting the pipeline selection and can
cause GPU hangs if a media pipelined was loaded in the meantime (e.g.
mixing mplayer/gstreamer using libva and gnome-shell). A simple solution
is to just forcibly re-emit the pipeline select along with the invariant
state and reset the cache at that point.

Reported-and-tested-by: Tomasz C. toma...@o2.pl
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91254
Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk
Cc: Jordan Justen jordan.l.jus...@intel.com
Cc: Kenneth Graunke kenn...@whitecape.org
Reviewed-by: Jordan Justen jordan.l.jus...@intel.com
Cc: 10.6 11.0 mesa-sta...@lists.freedesktop.org

---

 src/mesa/drivers/dri/i965/brw_misc_state.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c 
b/src/mesa/drivers/dri/i965/brw_misc_state.c
index e9d9467..2751152 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -878,7 +878,8 @@ brw_upload_invariant_state(struct brw_context *brw)
 {
const bool is_965 = brw-gen == 4  !brw-is_g4x;
 
-   brw_select_pipeline(brw, BRW_RENDER_PIPELINE);
+   brw_emit_select_pipeline(brw, BRW_RENDER_PIPELINE);
+   brw-last_pipeline = BRW_RENDER_PIPELINE;
 
if (brw-gen  6) {
   /* Disable depth offset clamping. */

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


Mesa (master): 22 new commits

2015-08-24 Thread Kenneth Graunke
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d7971b41ce3bd5ffce9580b3796b40d3591d6e5e
Author: Connor Abbott cwabbo...@gmail.com
Date:   Tue Jul 21 19:54:35 2015 -0700

nir/cf: reimplement nir_cf_node_remove() using the new API

This gives us some testing of it. Also, the old nir_cf_node_remove()
wasn't handling phi nodes correctly and was calling cleanup_cf_node()
too late.

Signed-off-by: Connor Abbott connor.w.abb...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc7f2d2364a98d4ec8fb8627b03c6f84b353998c
Author: Connor Abbott cwabbo...@gmail.com
Date:   Tue Jul 21 19:54:34 2015 -0700

nir/cf: add new control modification API's

These will help us do a number of things, including:

- Early return elimination.
- Dead control flow elimination.
- Various optimizations, such as replacing:

if (foo) {
...
}
if (!foo) {
...
}

with:

if (foo) {
...
} else {
...
}

Signed-off-by: Connor Abbott connor.w.abb...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=476eb5e4a16efdbc54c4418e44b1f38989026add
Author: Connor Abbott cwabbo...@gmail.com
Date:   Tue Jul 21 19:54:33 2015 -0700

nir/cf: use a cursor for inserting control flow

Signed-off-by: Connor Abbott connor.w.abb...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d356f84d4ceb9fb63e4b254ab8b26ce891c2f2b9
Author: Connor Abbott cwabbo...@gmail.com
Date:   Tue Jul 21 19:54:32 2015 -0700

nir/cf: add split_block_cursor()

This is a helper that will be shared between the new control flow
insertion and modification code.

Signed-off-by: Connor Abbott connor.w.abb...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=58a360c6b8aead1fec34aea298654ab544e7c8e8
Author: Connor Abbott cwabbo...@gmail.com
Date:   Tue Jul 21 19:54:31 2015 -0700

nir/cf: add split_block_before_instr()

Signed-off-by: Connor Abbott connor.w.abb...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6e47a34b29459dcf977a8c1223805cb0a275a8c8
Author: Connor Abbott cwabbo...@gmail.com
Date:   Tue Jul 21 19:54:30 2015 -0700

nir/cf: add a cursor structure

For now, it allows us to refactor the control flow insertion API's so
that there's a single entrypoint (with some wrappers). More importantly,
it will allow us to reduce the combinatorial explosion in the extract
function. There, we need to specify two points to extract, which may be
at the beginning of a block, the end of a block, or in the middle of a
block. And then there are various wrappers based off of that (before a
control flow node, before a control flow list, etc.). Rather than having
9 different functions, we can have one function and push the actual
logic of determining which variant to use down to the split function,
which will be shared with nir_cf_node_insert().

In the future, we may want to make the instruction insertion API's as
well as the builder use this, but that's a future cleanup.

Signed-off-by: Connor Abbott connor.w.abb...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f5c81f86f9b1b08b57435562be657fb2d220408
Author: Connor Abbott cwabbo...@gmail.com
Date:   Tue Jul 21 19:54:29 2015 -0700

nir/cf: fix link_blocks() when there are no successors

When we insert a single basic block A into another basic block B, we
will split B into C and D, insert A in the middle, and then splice
together C, A, and D. When we splice together C and A, we need to move
the successors of A into C -- except A has no successors, since it
hasn't been inserted yet. So in move_successors(), we need to handle the
case where the block whose successors are to be moved doesn't have any
successors. Fixing link_blocks() here prevents a segfault and makes it
work correctly.

Signed-off-by: Connor Abbott connor.w.abb...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6d028749ac593b6c724ab86a42bf969da47cc569
Author: Connor Abbott cwabbo...@gmail.com
Date:   Tue Jul 21 19:54:28 2015 -0700

nir/cf: clean up jumps when cleaning up CF nodes

We may delete a control flow node which contains structured jumps to
other parts of the program. We need to remove the jump as a predecessor,
as well as remove any phi node sources which reference it. Right now,
the same problem exists for blocks that don't end in a jump 

Mesa (master): mesa/formats: store whether or not a format is sRGB in gl_format_info

2015-08-24 Thread Nanley Chery
Module: Mesa
Branch: master
Commit: 8f378d1083179ea9e760688582faf95aea880b94
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f378d1083179ea9e760688582faf95aea880b94

Author: Nanley Chery nanley.g.ch...@intel.com
Date:   Tue May 19 09:58:17 2015 -0700

mesa/formats: store whether or not a format is sRGB in gl_format_info

v2: remove extra newline.
v3: use bool instead of GLboolean.

Reviewed-by: Anuj Phogat anuj.pho...@gmail.com
Signed-off-by: Nanley Chery nanley.g.ch...@intel.com

---

 src/mesa/main/format_info.py |2 ++
 src/mesa/main/formats.c  |   28 
 2 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
index c249e73..839d407 100644
--- a/src/mesa/main/format_info.py
+++ b/src/mesa/main/format_info.py
@@ -180,6 +180,8 @@ for fmat in formats:
bits = [ get_channel_bits(fmat, name) for name in ['l', 'i', 'z', 's']]
print '  {0},'.format(', '.join(map(str, bits)))
 
+   print '  {0:d},'.format(fmat.colorspace == 'srgb')
+
print '  {0}, {1}, {2},'.format(fmat.block_width, fmat.block_height,
int(fmat.block_size() / 8))
 
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 673c6b9..5e1d9a6 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -65,6 +65,8 @@ struct gl_format_info
GLubyte DepthBits;
GLubyte StencilBits;
 
+   bool IsSRGBFormat;
+
/**
 * To describe compressed formats.  If not compressed, Width=Height=1.
 */
@@ -568,30 +570,8 @@ _mesa_is_format_color_format(mesa_format format)
 GLenum
 _mesa_get_format_color_encoding(mesa_format format)
 {
-   /* XXX this info should be encoded in gl_format_info */
-   switch (format) {
-   case MESA_FORMAT_BGR_SRGB8:
-   case MESA_FORMAT_A8B8G8R8_SRGB:
-   case MESA_FORMAT_B8G8R8A8_SRGB:
-   case MESA_FORMAT_A8R8G8B8_SRGB:
-   case MESA_FORMAT_R8G8B8A8_SRGB:
-   case MESA_FORMAT_L_SRGB8:
-   case MESA_FORMAT_L8A8_SRGB:
-   case MESA_FORMAT_A8L8_SRGB:
-   case MESA_FORMAT_SRGB_DXT1:
-   case MESA_FORMAT_SRGBA_DXT1:
-   case MESA_FORMAT_SRGBA_DXT3:
-   case MESA_FORMAT_SRGBA_DXT5:
-   case MESA_FORMAT_R8G8B8X8_SRGB:
-   case MESA_FORMAT_ETC2_SRGB8:
-   case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
-   case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1:
-   case MESA_FORMAT_B8G8R8X8_SRGB:
-   case MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM:
-  return GL_SRGB;
-   default:
-  return GL_LINEAR;
-   }
+   const struct gl_format_info *info = _mesa_get_format_info(format);
+   return info-IsSRGBFormat ? GL_SRGB : GL_LINEAR;
 }
 
 

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


Mesa (master): mesa: enable texture stencil8 for multisample

2015-08-24 Thread Dave Airlie
Module: Mesa
Branch: master
Commit: 529acab22a3e21e0ed0c5243675aec6c0ee27e8f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=529acab22a3e21e0ed0c5243675aec6c0ee27e8f

Author: Dave Airlie airl...@redhat.com
Date:   Wed Jul 29 18:09:44 2015 +1000

mesa: enable texture stencil8 for multisample

This fixes GL45-CTS.gtf44.GL31Tests.texture_stencil8.texture_stencil8_gl44
from the ogl conform suite.

Reviewed-by: Ilia Mirkin imir...@alum.mit.edu
Cc: 10.6 11.0 mesa-sta...@lists.freedesktop.org
Signed-off-by: Dave Airlie airl...@redhat.com

---

 src/mesa/main/teximage.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 253e881..6a5489e 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -5569,10 +5569,13 @@ static GLboolean
 is_renderable_texture_format(struct gl_context *ctx, GLenum internalformat)
 {
/* Everything that is allowed for renderbuffers,
-* except for a base format of GL_STENCIL_INDEX.
+* except for a base format of GL_STENCIL_INDEX, unless supported.
 */
GLenum baseFormat = _mesa_base_fbo_format(ctx, internalformat);
-   return baseFormat != 0  baseFormat != GL_STENCIL_INDEX;
+   if (ctx-Extensions.ARB_texture_stencil8)
+  return baseFormat != 0;
+   else
+  return baseFormat != 0  baseFormat != GL_STENCIL_INDEX;
 }
 
 

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


Mesa (master): mesa: make _mesa_bind_texture_unit() static

2015-08-24 Thread Brian Paul
Module: Mesa
Branch: master
Commit: e089ca26e1efc095fd38715def5f410cf7476ad5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e089ca26e1efc095fd38715def5f410cf7476ad5

Author: Brian Paul bri...@vmware.com
Date:   Mon Aug 24 07:50:51 2015 -0600

mesa: make _mesa_bind_texture_unit() static

It's only called from the file it's defined in.

Reviewed-by: Timothy Arceri t_arc...@yahoo.com.au

---

 src/mesa/main/texobj.c |   10 +-
 src/mesa/main/texobj.h |4 
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 395e4d3..c5d83e1 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1745,10 +1745,10 @@ _mesa_BindTexture( GLenum target, GLuint texName )
  * texture object will be decremented.  It'll be deleted if the
  * count hits zero.
  */
-void
-_mesa_bind_texture_unit(struct gl_context *ctx,
-GLuint unit,
-struct gl_texture_object *texObj)
+static void
+bind_texture_unit(struct gl_context *ctx,
+  GLuint unit,
+  struct gl_texture_object *texObj)
 {
struct gl_texture_unit *texUnit;
 
@@ -1837,7 +1837,7 @@ _mesa_BindTextureUnit(GLuint unit, GLuint texture)
}
assert(valid_texture_object(texObj));
 
-   _mesa_bind_texture_unit(ctx, unit, texObj);
+   bind_texture_unit(ctx, unit, texObj);
 }
 
 
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index ec5ccb2..690878c 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -209,10 +209,6 @@ extern void
 _mesa_delete_nameless_texture(struct gl_context *ctx,
   struct gl_texture_object *texObj);
 
-extern void
-_mesa_bind_texture_unit(struct gl_context *ctx,
-GLuint unit,
-struct gl_texture_object *texObj);
 
 /*@}*/
 

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


Mesa (master): nir: Use !block_ends_in_jump() in a few places rather than open-coding.

2015-08-24 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: 4f2cdd849738019ce9552ee1d5f8dafce8af3f10
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f2cdd849738019ce9552ee1d5f8dafce8af3f10

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Mon Aug 24 12:18:51 2015 -0700

nir: Use !block_ends_in_jump() in a few places rather than open-coding.

Connor introduced this helper recently; we should use it here too.

I had to move the function earlier in the file for it to be available.

Signed-off-by: Kenneth Graunke kenn...@whitecape.org
Reviewed-by: Jason Ekstrand jason.ekstr...@intel.com

---

 src/glsl/nir/nir_control_flow.c |   21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c
index 86c7ca2..5c03375 100644
--- a/src/glsl/nir/nir_control_flow.c
+++ b/src/glsl/nir/nir_control_flow.c
@@ -47,6 +47,13 @@
  */
 /*@{*/
 
+static bool
+block_ends_in_jump(nir_block *block)
+{
+   return !exec_list_is_empty(block-instr_list) 
+  nir_block_last_instr(block)-type == nir_instr_type_jump;
+}
+
 static inline void
 block_add_pred(nir_block *block, nir_block *pred)
 {
@@ -111,14 +118,12 @@ link_non_block_to_block(nir_cf_node *node, nir_block 
*block)
   assert(last_else-type == nir_cf_node_block);
   nir_block *last_else_block = nir_cf_node_as_block(last_else);
 
-  if (exec_list_is_empty(last_then_block-instr_list) ||
-  nir_block_last_instr(last_then_block)-type != nir_instr_type_jump) {
+  if (!block_ends_in_jump(last_then_block)) {
  unlink_block_successors(last_then_block);
  link_blocks(last_then_block, block, NULL);
   }
 
-  if (exec_list_is_empty(last_else_block-instr_list) ||
-  nir_block_last_instr(last_else_block)-type != nir_instr_type_jump) {
+  if (!block_ends_in_jump(last_else_block)) {
  unlink_block_successors(last_else_block);
  link_blocks(last_else_block, block, NULL);
   }
@@ -294,14 +299,6 @@ move_successors(nir_block *source, nir_block *dest)
link_blocks(dest, succ1, succ2);
 }
 
-static bool
-block_ends_in_jump(nir_block *block)
-{
-   return !exec_list_is_empty(block-instr_list) 
-  nir_block_last_instr(block)-type == nir_instr_type_jump;
-}
-
-
 /* Given a basic block with no successors that has been inserted into the
  * control flow tree, gives it the successors it would normally have assuming
  * it doesn't end in a jump instruction. Also inserts phi sources with undefs

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