Mesa (master): mesa/pack: don' t apply transfer operations to integer format buffers. (v3)

2011-09-13 Thread Dave Airlie
Module: Mesa
Branch: master
Commit: 1ab4e221fddcb0c825e6f51a46a3c908dd58e52a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ab4e221fddcb0c825e6f51a46a3c908dd58e52a

Author: Dave Airlie airl...@redhat.com
Date:   Mon Sep 12 14:44:25 2011 +0100

mesa/pack: don't apply transfer operations to integer format buffers. (v3)

The EXT_texture_integer issues says:

Should pixel transfer operations be defined for the integer pixel
path?

RESOLVED: No.  Fragment shaders can achieve similar results
with more flexibility.  There is no need to aggrandize this
legacy mechanism.

v2: fix comments, fix unpack paths, use same comment/code
v3: fix last comment

Signed-off-by: Dave Airlie airl...@redhat.com
Reviewed-by: Brian Paul bri...@vmware.com

---

 src/mesa/main/pack.c |   23 +++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index fd3f89d..8388708 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -506,6 +506,13 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint 
n, GLfloat rgba[][4],
   luminance = NULL;
}
 
+   /* EXT_texture_integer specifies no transfer ops on integer
+* types in the resolved issues section. Just set them to 0
+* for integer surfaces.
+*/
+   if (intDstFormat)
+  transferOps = 0;
+
if (transferOps) {
   _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
}
@@ -3452,6 +3459,7 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
   const struct gl_pixelstore_attrib *srcPacking,
   GLbitfield transferOps )
 {
+   GLboolean intFormat = _mesa_is_integer_format(srcFormat);
ASSERT(dstFormat == GL_ALPHA ||
   dstFormat == GL_LUMINANCE ||
   dstFormat == GL_LUMINANCE_ALPHA ||
@@ -3500,6 +3508,13 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
   srcType == GL_UNSIGNED_INT_5_9_9_9_REV ||
   srcType == GL_UNSIGNED_INT_10F_11F_11F_REV);
 
+   /* EXT_texture_integer specifies no transfer ops on integer
+* types in the resolved issues section. Just set them to 0
+* for integer surfaces.
+*/
+   if (intFormat)
+  transferOps = 0;
+
/* Try simple cases first */
if (transferOps == 0) {
   if (srcType == CHAN_TYPE) {
@@ -3815,6 +3830,7 @@ _mesa_unpack_color_span_float( struct gl_context *ctx,
   GLint dstComponents;
   GLint rDst, gDst, bDst, aDst, lDst, iDst;
   GLfloat (*rgba)[4] = (GLfloat (*)[4]) malloc(4 * n * sizeof(GLfloat));
+  GLboolean intFormat = _mesa_is_integer_format(srcFormat);
 
   if (!rgba) {
  _mesa_error(ctx, GL_OUT_OF_MEMORY, pixel unpacking);
@@ -3825,6 +3841,13 @@ _mesa_unpack_color_span_float( struct gl_context *ctx,
   /* source  dest image formats should have been error checked by now */
   assert(dstComponents  0);
 
+  /* EXT_texture_integer specifies no transfer ops on integer
+   * types in the resolved issues section. Just set them to 0
+   * for integer surfaces.
+   */
+  if (intFormat)
+ transferOps = 0;
+
   /*
* Extract image data and convert to RGBA floats
*/

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


Mesa (master): r600g: fix typo in r600g: simplify deducing chip family

2011-09-13 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 8dbf9d70d3228f707abc39d8e7db6367638f146b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8dbf9d70d3228f707abc39d8e7db6367638f146b

Author: Marek Olšák mar...@gmail.com
Date:   Tue Sep 13 13:07:46 2011 +0200

r600g: fix typo in r600g: simplify deducing chip family

---

 src/gallium/winsys/r600/drm/r600_drm.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/winsys/r600/drm/r600_drm.c 
b/src/gallium/winsys/r600/drm/r600_drm.c
index d2cb9da..64c353c 100644
--- a/src/gallium/winsys/r600/drm/r600_drm.c
+++ b/src/gallium/winsys/r600/drm/r600_drm.c
@@ -73,7 +73,7 @@ struct radeon *radeon_create(struct radeon_winsys *ws)
radeon-chip_class = CAYMAN;
} else if (radeon-family = CHIP_CEDAR) {
radeon-chip_class = EVERGREEN;
-   } else if (radeon-family = CHIP_RV730) {
+   } else if (radeon-family = CHIP_RV770) {
radeon-chip_class = R700;
} else {
radeon-chip_class = R600;

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


Mesa (master): nv50/nvc0: add support for R4A4_UNORM and A4R4_UNORM formats

2011-09-13 Thread Marcin Ślusarz
Module: Mesa
Branch: master
Commit: f626d99edf17a1d3203b257f6fe6993229ea6866
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f626d99edf17a1d3203b257f6fe6993229ea6866

Author: Marcin Slusarz marcin.slus...@gmail.com
Date:   Tue Sep 13 15:14:19 2011 +0200

nv50/nvc0: add support for R4A4_UNORM and A4R4_UNORM formats

R4A4 is needed by OSD in mplayer's xvmc output

---

 src/gallium/drivers/nv50/nv50_formats.c |8 
 src/gallium/drivers/nvc0/nvc0_formats.c |8 
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_formats.c 
b/src/gallium/drivers/nv50/nv50_formats.c
index 34502d0..4e0e581 100644
--- a/src/gallium/drivers/nv50/nv50_formats.c
+++ b/src/gallium/drivers/nv50/nv50_formats.c
@@ -575,6 +575,14 @@ const struct nv50_format 
nv50_format_table[PIPE_FORMAT_COUNT] =
 B_(C3, C2, C1, C0, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
 SAMPLER_VIEW },
 
+   [PIPE_FORMAT_R4A4_UNORM] = { 0,
+B_(C0, ZERO, ZERO, C1, UNORM, UNORM, UNORM, UNORM, 4_4, 0),
+SAMPLER_VIEW },
+
+   [PIPE_FORMAT_A4R4_UNORM] = { 0,
+B_(C1, ZERO, ZERO, C0, UNORM, UNORM, UNORM, UNORM, 4_4, 0),
+SAMPLER_VIEW },
+
/* FIXED FORMATS - hw doesn't support these, convert on vbo push for now */
 
[PIPE_FORMAT_R32G32B32A32_FIXED] = { 0,
diff --git a/src/gallium/drivers/nvc0/nvc0_formats.c 
b/src/gallium/drivers/nvc0/nvc0_formats.c
index 8dd4419..87d7fd8 100644
--- a/src/gallium/drivers/nvc0/nvc0_formats.c
+++ b/src/gallium/drivers/nvc0/nvc0_formats.c
@@ -576,6 +576,14 @@ const struct nvc0_format 
nvc0_format_table[PIPE_FORMAT_COUNT] =
 B_(C3, C2, C1, C0, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 0),
 SAMPLER_VIEW },
 
+   [PIPE_FORMAT_R4A4_UNORM] = { 0,
+B_(C0, ZERO, ZERO, C1, UNORM, UNORM, UNORM, UNORM, 4_4, 0),
+SAMPLER_VIEW },
+
+   [PIPE_FORMAT_A4R4_UNORM] = { 0,
+B_(C1, ZERO, ZERO, C0, UNORM, UNORM, UNORM, UNORM, 4_4, 0),
+SAMPLER_VIEW },
+
/* FIXED FORMATS - hw doesn't support these, convert on vbo push for now */
 
[PIPE_FORMAT_R32G32B32A32_FIXED] = { 0,

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


Mesa (7.11): nouveau: fix nouveau_fence leak

2011-09-13 Thread Marcin Ślusarz
Module: Mesa
Branch: 7.11
Commit: e7794048ca8e4122e9e5de8ba4ab1f93331f2ba8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7794048ca8e4122e9e5de8ba4ab1f93331f2ba8

Author: Marcin Slusarz marcin.slus...@gmail.com
Date:   Tue Sep  6 16:12:52 2011 +0200

nouveau: fix nouveau_fence leak

(commit 96054375b1ea98d7827f0d4b567168fa2baeb38e in master)

---

 src/gallium/drivers/nouveau/nouveau_fence.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_fence.c 
b/src/gallium/drivers/nouveau/nouveau_fence.c
index d8f59dc..ea2038c 100644
--- a/src/gallium/drivers/nouveau/nouveau_fence.c
+++ b/src/gallium/drivers/nouveau/nouveau_fence.c
@@ -219,5 +219,7 @@ nouveau_fence_next(struct nouveau_screen *screen)
if (screen-fence.current-state  NOUVEAU_FENCE_STATE_EMITTED)
   nouveau_fence_emit(screen-fence.current);
 
+   nouveau_fence_ref(NULL, screen-fence.current);
+
nouveau_fence_new(screen, screen-fence.current, FALSE);
 }

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


Mesa (master): gallium: minor comments for util_format_channel_description fields

2011-09-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 52b9ec727bfeca0cf13078dc352962b58293b2d4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=52b9ec727bfeca0cf13078dc352962b58293b2d4

Author: Brian Paul bri...@vmware.com
Date:   Mon Sep 12 17:04:11 2011 -0600

gallium: minor comments for util_format_channel_description fields

---

 src/gallium/auxiliary/util/u_format.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_format.h 
b/src/gallium/auxiliary/util/u_format.h
index 566fa79..3527103 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -119,9 +119,9 @@ enum util_format_colorspace {
 
 struct util_format_channel_description
 {
-   unsigned type:6;
+   unsigned type:6;/** UTIL_FORMAT_TYPE_x */
unsigned normalized:1;
-   unsigned size:9;
+   unsigned size:9;/** bits per channel */
 };
 
 

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


Mesa (master): gallivm: remove unused vars

2011-09-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 0ebf83b7318784e495b9cc56631f3961bb705827
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0ebf83b7318784e495b9cc56631f3961bb705827

Author: Brian Paul bri...@vmware.com
Date:   Tue Sep 13 08:16:01 2011 -0600

gallivm: remove unused vars

---

 src/gallium/auxiliary/gallivm/lp_bld_sample.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c 
b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
index cb6717d..884bddd 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c
@@ -913,7 +913,6 @@ lp_build_cube_lookup(struct lp_build_sample_context *bld,
LLVMValueRef arx_ge_ary, arx_ge_arz;
LLVMValueRef ary_ge_arx, ary_ge_arz;
LLVMValueRef arx_ge_ary_arz, ary_ge_arx_arz;
-   LLVMValueRef rx_pos, ry_pos, rz_pos;
 
assert(bld-coord_bld.type.length == 4);
 
@@ -942,10 +941,6 @@ lp_build_cube_lookup(struct lp_build_sample_context *bld,
arx_ge_ary_arz = LLVMBuildAnd(builder, arx_ge_ary, arx_ge_arz, );
ary_ge_arx_arz = LLVMBuildAnd(builder, ary_ge_arx, ary_ge_arz, );
 
-   rx_pos = LLVMBuildFCmp(builder, LLVMRealUGE, rx, float_bld-zero, );
-   ry_pos = LLVMBuildFCmp(builder, LLVMRealUGE, ry, float_bld-zero, );
-   rz_pos = LLVMBuildFCmp(builder, LLVMRealUGE, rz, float_bld-zero, );
-
{
   struct lp_build_if_state if_ctx;
   LLVMValueRef face_s_var;

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


Mesa (master): st/mesa: fix incorrect debug output

2011-09-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: b06613c6cc029c3ff200430b0706b5229c4508bd
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b06613c6cc029c3ff200430b0706b5229c4508bd

Author: Brian Paul bri...@vmware.com
Date:   Tue Sep 13 09:30:31 2011 -0600

st/mesa: fix incorrect debug output

format and type are not GL enums here.

---

 src/mesa/state_tracker/st_texture.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/st_texture.c 
b/src/mesa/state_tracker/st_texture.c
index 232c286..c5dc7dc 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -72,9 +72,8 @@ st_texture_create(struct st_context *st,
if (target == PIPE_TEXTURE_CUBE)
   assert(layers == 6);
 
-   DBG(%s target %s format %s last_level %d\n, __FUNCTION__,
-   _mesa_lookup_enum_by_nr(target),
-   _mesa_lookup_enum_by_nr(format), last_level);
+   DBG(%s target %d format %s last_level %d\n, __FUNCTION__,
+   (int) target, util_format_name(format), last_level);
 
assert(format);
assert(screen-is_format_supported(screen, format, target, 0,

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