Re: [Mesa-dev] [PATCH 01/17] i965: Restore a lost comment about TXF offset bugs.

2014-10-14 Thread Chris Forbes
I haven't tested to make sure this doesn't regress anything, but all
looks sensible.

For the series:

Reviewed-by: Chris Forbes 

On Tue, Oct 14, 2014 at 5:54 PM, Kenneth Graunke  wrote:
> Eric's original code to work around TXF offset bugs contained a comment
> explaining the problem, which was lost when Chris generalized it to an
> IR transformation (in commit 598ca510b8a118c3c7e18b5d031a2b116120e0a6).
>
> This commit adds the original comment to the newer code.
>
> Signed-off-by: Kenneth Graunke 
> ---
>  src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp 
> b/src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp
> index c95d7f3..8c59b9e 100644
> --- a/src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp
> @@ -66,6 +66,11 @@ 
> brw_lower_unnormalized_offset_visitor::visit_leave(ir_texture *ir)
> void *mem_ctx = ralloc_parent(ir);
>
> if (ir->op == ir_txf) {
> +  /* It appears that the ld instruction used for txf does its
> +   * address bounds check before adding in the offset.  To work
> +   * around this, just add the integer offset to the integer texel
> +   * coordinate, and don't put the offset in the header.
> +   */
>ir_variable *var = new(mem_ctx) ir_variable(ir->coordinate->type,
>"coordinate",
>ir_var_temporary);
> --
> 2.1.2
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 84566] Unify the format conversion code

2014-10-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=84566

--- Comment #16 from Iago Toral  ---
We also need new mesa_format enums and pack/unpack functions for byte swapped
variants of non-array types.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] Trivial fix for ChromeOS unit test

2014-10-14 Thread Lionel Landwerlin
Hey there,

While enabling LibVA on the Ozone backend of ChromeOS (EGL/GLES2 without X), I
stumbled upon a crash.

This patch is a fix for that problem. It's pretty much a copy/paste of a
snippet already in EGL/wayland file.

Cheers,

-
Lionel

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


[Mesa-dev] [PATCH] egl/drm: do not crash when swapping buffers without any rendering

2014-10-14 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 src/egl/drivers/dri2/platform_drm.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_drm.c 
b/src/egl/drivers/dri2/platform_drm.c
index 70bd7d4..f6b9c3a 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -418,6 +418,14 @@ dri2_drm_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLSurface *draw)
  for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)
 if (dri2_surf->color_buffers[i].age > 0)
dri2_surf->color_buffers[i].age++;
+
+ /* Make sure we have a back buffer in case we're swapping without
+  * ever rendering. */
+ if (get_back_bo(dri2_surf) < 0) {
+_eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
+return EGL_FALSE;
+ }
+
  dri2_surf->current = dri2_surf->back;
  dri2_surf->current->age = 1;
  dri2_surf->back = NULL;
-- 
2.1.1

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


[Mesa-dev] [PATCH] mesa: validate sampler uniforms during gluniform calls

2014-10-14 Thread Tapani Pälli
Patch fixes 'glsl-2types-of-textures-on-same-unit' in WebGL conformance
test suite, no Piglit regressions.

To avoid adding potentially heavy check during draw (valid_to_render),
check is done during uniform updates by inspecting TexturesUsed mask.

A new boolean variable is introduced to cache validation state.

Signed-off-by: Tapani Pälli 
---
 src/mesa/main/context.c | 11 +++
 src/mesa/main/mtypes.h  |  1 +
 src/mesa/main/uniform_query.cpp | 44 +
 src/mesa/main/uniforms.c| 14 +
 4 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 5a8f718..8848338 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -133,6 +133,7 @@
 #include "program/prog_print.h"
 #include "math/m_matrix.h"
 #include "main/dispatch.h" /* for _gloffset_COUNT */
+#include "uniforms.h"
 
 #ifdef USE_SPARC_ASM
 #include "sparc/sparc.h"
@@ -1949,6 +1950,16 @@ _mesa_valid_to_render(struct gl_context *ctx, const char 
*where)
   }
}
 
+   /* If a program is active, check if validation of samplers succeeded. */
+   if (ctx->_Shader->ActiveProgram) {
+  char errMsg[100];
+  if (!_mesa_sampler_uniforms_are_valid(ctx->_Shader->ActiveProgram,
+errMsg, 100)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s", errMsg);
+ return GL_FALSE;
+  }
+   }
+
if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
   _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
   "%s(incomplete framebuffer)", where);
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 5e9453b..27670bd 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2873,6 +2873,7 @@ struct gl_shader_program
GLboolean LinkStatus;   /**< GL_LINK_STATUS */
GLboolean Validated;
GLboolean _Used;/**< Ever used for drawing? */
+   GLboolean SamplersValidated; /**< Samplers validated against texture units? 
*/
GLchar *InfoLog;
 
unsigned Version;   /**< GLSL version used for linking */
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 1592c9b..c2776c0 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -1064,42 +1064,16 @@ extern "C" bool
 _mesa_sampler_uniforms_are_valid(const struct gl_shader_program *shProg,
 char *errMsg, size_t errMsgLength)
 {
-   const glsl_type *unit_types[MAX_COMBINED_TEXTURE_IMAGE_UNITS];
-
-   memset(unit_types, 0, sizeof(unit_types));
-
-   for (unsigned i = 0; i < shProg->NumUserUniformStorage; i++) {
-  const struct gl_uniform_storage *const storage =
-&shProg->UniformStorage[i];
-  const glsl_type *const t = (storage->type->is_array())
-? storage->type->fields.array : storage->type;
-
-  if (!t->is_sampler())
-continue;
-
-  const unsigned count = MAX2(1, storage->type->array_size());
-  for (unsigned j = 0; j < count; j++) {
-const unsigned unit = storage->storage[j].i;
-
-/* The types of the samplers associated with a particular texture
- * unit must be an exact match.  Page 74 (page 89 of the PDF) of the
- * OpenGL 3.3 core spec says:
- *
- * "It is not allowed to have variables of different sampler
- * types pointing to the same texture image unit within a program
- * object."
- */
-if (unit_types[unit] == NULL) {
-   unit_types[unit] = t;
-} else if (unit_types[unit] != t) {
-   _mesa_snprintf(errMsg, errMsgLength,
-  "Texture unit %d is accessed both as %s and %s",
-  unit, unit_types[unit]->name, t->name);
-   return false;
-}
-  }
+   /* Shader does not have samplers. */
+   if (shProg->NumUserUniformStorage == 0)
+  return true;
+
+   if (!shProg->SamplersValidated) {
+  _mesa_snprintf(errMsg, errMsgLength,
+ "active samplers with a different type "
+ "refer to the same texture image unit");
+  return false;
}
-
return true;
 }
 
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 0d0cbf5..af7a822 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -75,12 +75,26 @@ _mesa_update_shader_textures_used(struct gl_shader_program 
*shProg,
memcpy(prog->SamplerUnits, shader->SamplerUnits, 
sizeof(prog->SamplerUnits));
memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
 
+   shProg->SamplersValidated = GL_TRUE;
+
for (s = 0; s < MAX_SAMPLERS; s++) {
   if (prog->SamplersUsed & (1 << s)) {
  GLuint unit = shader->SamplerUnits[s];
  GLuint tgt = shader->SamplerTargets[s];
  assert(unit < Elements(prog->TexturesUsed));
  assert(tgt < NUM_TEXTURE_TARGETS);
+
+

Re: [Mesa-dev] [PATCH] mesa: validate sampler uniforms during gluniform calls

2014-10-14 Thread Tapani

On 10/14/2014 03:35 PM, Francisco Jerez wrote:

Tapani Pälli  writes:


Patch fixes 'glsl-2types-of-textures-on-same-unit' in WebGL conformance
test suite, no Piglit regressions.

To avoid adding potentially heavy check during draw (valid_to_render),
check is done during uniform updates by inspecting TexturesUsed mask.

A new boolean variable is introduced to cache validation state.

Signed-off-by: Tapani Pälli 
---
  src/mesa/main/context.c | 11 +++
  src/mesa/main/mtypes.h  |  1 +
  src/mesa/main/uniform_query.cpp | 44 +
  src/mesa/main/uniforms.c| 14 +
  4 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 5a8f718..8848338 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -133,6 +133,7 @@
  #include "program/prog_print.h"
  #include "math/m_matrix.h"
  #include "main/dispatch.h" /* for _gloffset_COUNT */
+#include "uniforms.h"
  
  #ifdef USE_SPARC_ASM

  #include "sparc/sparc.h"
@@ -1949,6 +1950,16 @@ _mesa_valid_to_render(struct gl_context *ctx, const char 
*where)
}
 }
  
+   /* If a program is active, check if validation of samplers succeeded. */

+   if (ctx->_Shader->ActiveProgram) {
+  char errMsg[100];
+  if (!_mesa_sampler_uniforms_are_valid(ctx->_Shader->ActiveProgram,
+errMsg, 100)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s", errMsg);
+ return GL_FALSE;
+  }
+   }
+
 if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
"%s(incomplete framebuffer)", where);
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 5e9453b..27670bd 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2873,6 +2873,7 @@ struct gl_shader_program
 GLboolean LinkStatus;   /**< GL_LINK_STATUS */
 GLboolean Validated;
 GLboolean _Used;/**< Ever used for drawing? */
+   GLboolean SamplersValidated; /**< Samplers validated against texture units? 
*/
 GLchar *InfoLog;
  
 unsigned Version;   /**< GLSL version used for linking */

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 1592c9b..c2776c0 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -1064,42 +1064,16 @@ extern "C" bool
  _mesa_sampler_uniforms_are_valid(const struct gl_shader_program *shProg,
 char *errMsg, size_t errMsgLength)
  {
-   const glsl_type *unit_types[MAX_COMBINED_TEXTURE_IMAGE_UNITS];
-
-   memset(unit_types, 0, sizeof(unit_types));
-
-   for (unsigned i = 0; i < shProg->NumUserUniformStorage; i++) {
-  const struct gl_uniform_storage *const storage =
-&shProg->UniformStorage[i];
-  const glsl_type *const t = (storage->type->is_array())
-? storage->type->fields.array : storage->type;
-
-  if (!t->is_sampler())
-continue;
-
-  const unsigned count = MAX2(1, storage->type->array_size());
-  for (unsigned j = 0; j < count; j++) {
-const unsigned unit = storage->storage[j].i;
-
-/* The types of the samplers associated with a particular texture
- * unit must be an exact match.  Page 74 (page 89 of the PDF) of the
- * OpenGL 3.3 core spec says:
- *
- * "It is not allowed to have variables of different sampler
- * types pointing to the same texture image unit within a program
- * object."
- */
-if (unit_types[unit] == NULL) {
-   unit_types[unit] = t;
-} else if (unit_types[unit] != t) {
-   _mesa_snprintf(errMsg, errMsgLength,
-  "Texture unit %d is accessed both as %s and %s",
-  unit, unit_types[unit]->name, t->name);
-   return false;
-}
-  }
+   /* Shader does not have samplers. */
+   if (shProg->NumUserUniformStorage == 0)
+  return true;
+
+   if (!shProg->SamplersValidated) {
+  _mesa_snprintf(errMsg, errMsgLength,
+ "active samplers with a different type "
+ "refer to the same texture image unit");
+  return false;
 }
-
 return true;
  }
  
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c

index 0d0cbf5..af7a822 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -75,12 +75,26 @@ _mesa_update_shader_textures_used(struct gl_shader_program 
*shProg,
 memcpy(prog->SamplerUnits, shader->SamplerUnits, 
sizeof(prog->SamplerUnits));
 memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed));
  
+   shProg->SamplersValidated = GL_TRUE;

+
 for (s = 0; s < MAX_SAMPLERS; s++) {
if (prog->SamplersUsed & (1 << s)) {
   GLuint unit = shader->SamplerUnits[s];
   GLuint tgt = shader->SamplerTarge

[Mesa-dev] [PATCH 3/3] gallium/vc4: rework the USE_VC4_SIMULATOR build

2014-10-14 Thread Emil Velikov
 - Conditionally build and link libvc4_kernel.la
 - Move -lsimpenrose from SIM_LDFLAGS to SIM_LIB

Cc: Eric Anholt 
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/vc4/Makefile.am| 16 +---
 src/gallium/drivers/vc4/kernel/Makefile.am |  6 +-
 src/gallium/drivers/vc4/kernel/vc4_gem.c   |  4 
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/vc4/Makefile.am 
b/src/gallium/drivers/vc4/Makefile.am
index 3fc591f..2dd0a00 100644
--- a/src/gallium/drivers/vc4/Makefile.am
+++ b/src/gallium/drivers/vc4/Makefile.am
@@ -19,16 +19,19 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
 
+if USE_VC4_SIMULATOR
 SUBDIRS = kernel
 
-include Makefile.sources
-include $(top_srcdir)/src/gallium/Automake.inc
-
-if USE_VC4_SIMULATOR
 SIM_CFLAGS = -DUSE_VC4_SIMULATOR=1
-SIM_LDFLAGS = -lsimpenrose
+SIM_LIB = \
+   kernel/libvc4_kernel.la \
+   -lsimpenrose
+
 endif
 
+include Makefile.sources
+include $(top_srcdir)/src/gallium/Automake.inc
+
 AM_CFLAGS = \
$(LIBDRM_CFLAGS) \
$(GALLIUM_DRIVER_CFLAGS) \
@@ -39,5 +42,4 @@ AM_CFLAGS = \
 noinst_LTLIBRARIES = libvc4.la
 
 libvc4_la_SOURCES = $(C_SOURCES)
-libvc4_la_LIBADD = $(SIM_LIB) kernel/libvc4_kernel.la
-libvc4_la_LDFLAGS = $(SIM_LDFLAGS)
+libvc4_la_LIBADD = $(SIM_LIB)
diff --git a/src/gallium/drivers/vc4/kernel/Makefile.am 
b/src/gallium/drivers/vc4/kernel/Makefile.am
index 1ae5f1c..0352485 100644
--- a/src/gallium/drivers/vc4/kernel/Makefile.am
+++ b/src/gallium/drivers/vc4/kernel/Makefile.am
@@ -22,16 +22,12 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-if USE_VC4_SIMULATOR
-SIM_CFLAGS = -DUSE_VC4_SIMULATOR=1
-endif
-
 AM_CFLAGS = \
$(LIBDRM_CFLAGS) \
$(GALLIUM_DRIVER_CFLAGS) \
-   $(SIM_CFLAGS) \
-I$(top_srcdir)/src/mesa/ \
-I$(srcdir)/../ \
+   -DUSE_VC4_SIMULATOR=1 \
$()
 
 noinst_LTLIBRARIES = libvc4_kernel.la
diff --git a/src/gallium/drivers/vc4/kernel/vc4_gem.c 
b/src/gallium/drivers/vc4/kernel/vc4_gem.c
index 1ea17aa..720bfe5 100644
--- a/src/gallium/drivers/vc4/kernel/vc4_gem.c
+++ b/src/gallium/drivers/vc4/kernel/vc4_gem.c
@@ -21,8 +21,6 @@
  * IN THE SOFTWARE.
  */
 
-#ifdef USE_VC4_SIMULATOR
-
 #include "vc4_drv.h"
 
 int
@@ -143,5 +141,3 @@ fail:
kfree(temp);
return ret;
 }
-
-#endif /* USE_VC4_SIMULATOR */
-- 
2.1.0

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


[Mesa-dev] [PATCH 1/3] gallium/vc4: correctly include the source files

2014-10-14 Thread Emil Velikov
The kernel files are built into a separate static library and
all the functions that require it are already wrapped in ifdef
USE_VC4_SIMULATOR. Don't forget the header file :)

Cc: Eric Anholt 
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/vc4/Makefile.sources| 3 ---
 src/gallium/drivers/vc4/kernel/Makefile.sources | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/vc4/Makefile.sources 
b/src/gallium/drivers/vc4/Makefile.sources
index 1befb9f..2336565 100644
--- a/src/gallium/drivers/vc4/Makefile.sources
+++ b/src/gallium/drivers/vc4/Makefile.sources
@@ -36,7 +36,4 @@ C_SOURCES := \
vc4_state.c \
vc4_tiling.c \
vc4_tiling.h \
-   kernel/vc4_gem.c \
-   kernel/vc4_validate.c \
-   kernel/vc4_validate_shaders.c \
$()
diff --git a/src/gallium/drivers/vc4/kernel/Makefile.sources 
b/src/gallium/drivers/vc4/kernel/Makefile.sources
index d1d70dd..7d17a89 100644
--- a/src/gallium/drivers/vc4/kernel/Makefile.sources
+++ b/src/gallium/drivers/vc4/kernel/Makefile.sources
@@ -1,4 +1,5 @@
 C_SOURCES := \
+   vc4_drv.h \
vc4_gem.c \
vc4_validate.c \
vc4_validate_shaders.c \
-- 
2.1.0

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


[Mesa-dev] [PATCH 2/3] gallium/vc4: move 'kernel' declarations to kernel/vc4_drv.h

2014-10-14 Thread Emil Velikov
 - Used only within kernel/*.c
 - Remove the unused min/max macros

Cc: Eric Anholt 
Signed-off-by: Emil Velikov 
---
 src/gallium/drivers/vc4/kernel/vc4_drv.h | 16 
 src/gallium/drivers/vc4/vc4_simulator_validate.h | 18 --
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/src/gallium/drivers/vc4/kernel/vc4_drv.h 
b/src/gallium/drivers/vc4/kernel/vc4_drv.h
index 45d9c40..c1092c0 100644
--- a/src/gallium/drivers/vc4/kernel/vc4_drv.h
+++ b/src/gallium/drivers/vc4/kernel/vc4_drv.h
@@ -26,6 +26,22 @@
 
 #include "vc4_simulator_validate.h"
 
+#define DRM_INFO(...) fprintf(stderr, __VA_ARGS__)
+#define DRM_ERROR(...) fprintf(stderr, __VA_ARGS__)
+#define kmalloc(size, arg) malloc(size)
+#define kcalloc(size, count, arg) calloc(size, count)
+#define kfree(ptr) free(ptr)
+#define krealloc(ptr, size, args) realloc(ptr, size)
+#define roundup(x, y) align(x, y)
+#define BUG_ON(condition) assert(!(condition))
+
+static inline int
+copy_from_user(void *dst, void *src, size_t size)
+{
+memcpy(dst, src, size);
+return 0;
+}
+
 enum vc4_bo_mode {
VC4_MODE_UNDECIDED,
VC4_MODE_TILE_ALLOC,
diff --git a/src/gallium/drivers/vc4/vc4_simulator_validate.h 
b/src/gallium/drivers/vc4/vc4_simulator_validate.h
index d6c2aec..a893b30 100644
--- a/src/gallium/drivers/vc4/vc4_simulator_validate.h
+++ b/src/gallium/drivers/vc4/vc4_simulator_validate.h
@@ -36,24 +36,6 @@
 
 struct exec_info;
 
-#define DRM_INFO(...) fprintf(stderr, __VA_ARGS__)
-#define DRM_ERROR(...) fprintf(stderr, __VA_ARGS__)
-#define kmalloc(size, arg) malloc(size)
-#define kcalloc(size, count, arg) calloc(size, count)
-#define kfree(ptr) free(ptr)
-#define krealloc(ptr, size, args) realloc(ptr, size)
-#define roundup(x, y) align(x, y)
-#define max(x, y) MAX2(x, y)
-#define min(x, y) MiN2(x, y)
-#define BUG_ON(condition) assert(!(condition))
-
-static inline int
-copy_from_user(void *dst, void *src, size_t size)
-{
-memcpy(dst, src, size);
-return 0;
-}
-
 typedef uint8_t u8;
 typedef uint16_t u16;
 typedef uint32_t u32;
-- 
2.1.0

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


Re: [Mesa-dev] [PATCH] egl_dri2: Allow both 24 and 32 bit X visuals for RGBA configs

2014-10-14 Thread Emil Velikov
Humble ping.

On 23/09/14 01:25, Emil Velikov wrote:
> From: Sjoerd Simons 
> 
> When using RGBA EGLConfigs allow both RGB and RGBA X visuals, such that
> application can decide whether they want to use RGBA (and have the
> compositor blend their windows).
> 
> On my system with this change EGLConfigs with a 24 bit visual comes up
> first, as such applications blindly picking the first EGLConfig will
> still get an RGB X visual.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67676
> ---
> 
> Hello gents,
> 
> This patch has been stuck in bugzilla since February this year. Bringing 
> it around here to gather greater exposure and perhaps some 
> comments/reviews.
> 
> -Emil
> 
>  src/egl/drivers/dri2/egl_dri2.c |  5 +
>  src/egl/drivers/dri2/platform_x11.c | 17 +
>  2 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 20a7243..2ed90a7 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -110,6 +110,11 @@ EGLint dri2_to_egl_attribute_map[] = {
>  static EGLBoolean
>  dri2_match_config(const _EGLConfig *conf, const _EGLConfig *criteria)
>  {
> +
> +   if (criteria->NativeVisualID != EGL_DONT_CARE &&
> +conf->NativeVisualID != criteria->NativeVisualID)
> +  return EGL_FALSE;
> +
> if (_eglCompareConfigs(conf, criteria, NULL, EGL_FALSE) != 0)
>return EGL_FALSE;
>  
> diff --git a/src/egl/drivers/dri2/platform_x11.c 
> b/src/egl/drivers/dri2/platform_x11.c
> index a7a7338..3395fb7 100644
> --- a/src/egl/drivers/dri2/platform_x11.c
> +++ b/src/egl/drivers/dri2/platform_x11.c
> @@ -672,14 +672,15 @@ dri2_x11_add_configs_for_visuals(struct 
> dri2_egl_display *dri2_dpy,
>   dri2_add_config(disp, dri2_dpy->driver_configs[j], id++,
>   surface_type, config_attrs, rgba_masks);
>  
> -/* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig.
> - * Otherwise it will only match a 32-bit RGBA visual.  On a
> - * composited window manager on X11, this will make all of the
> - * EGLConfigs with destination alpha get blended by the
> - * compositor.  This is probably not what the application
> - * wants... especially on drivers that only have 32-bit RGBA
> - * EGLConfigs! */
> -if (d.data->depth == 24) {
> +/* Allow both 24-bit RGB visual and 32 bit RGBA to match a 32-bit
> + * RGBA EGLConfig.  Otherwise it will only match a 32-bit RGBA
> + * visual.  On a composited window manager on X11, this will make
> + * all of the EGLConfigs with destination alpha get blended by 
> the
> + * compositor.  This is probably not what the application 
> wants...
> + * especially on drivers that only have 32-bit RGBA EGLConfigs!
> + * Allowing both allows applications to make the decision whether
> + * 32 bit visuals are intended */
> +if (d.data->depth == 24 || d.data->depth == 32) {
> rgba_masks[3] =
>~(rgba_masks[0] | rgba_masks[1] | rgba_masks[2]);
> dri2_add_config(disp, dri2_dpy->driver_configs[j], id++,
> 

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


Re: [Mesa-dev] [PATCH] r300/compiler: remove useless check

2014-10-14 Thread Tom Stellard
On Tue, Oct 14, 2014 at 03:27:58AM +0200, David Heidelberger wrote:
> 
> This code is already in if (!variable->C->is_r500) so no need check
> twice.
> 

I've pushed this patch, thanks!

-Tom

> Signed-off-by: David Heidelberger 
> ---
>   src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c | 7 ++-
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c 
> b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c
> index 64b225d..14f93fb 100644
> --- a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c
> +++ b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c
> @@ -387,11 +387,8 @@ static enum rc_reg_class variable_get_class(
>* instructions can't be
>* swizzle on r300/r400 GPUs.
>*/
> - if (!variable->C->is_r500) {
> - can_change_writemask = 
> 0;
> - break;
> - }
> - old_swizzle = 
> r.U.I.Src->Swizzle;
> + can_change_writemask = 0;
> + break;
>   }
>   new_swizzle = rc_adjust_channels(
>   old_swizzle, 
> conversion_swizzle);
> -- 
> 2.1.2

> From 524f212763d824040fd0d362b0230770ed8faba1 Mon Sep 17 00:00:00 2001
> From: David Heidelberger 
> Date: Tue, 14 Oct 2014 02:25:01 +0200
> Subject: [PATCH] r300/compiler: remove useless check
> 
> This code is already in if (!variable->C->is_r500) so no need check
> twice.
> 
> Signed-off-by: David Heidelberger 
> ---
>  src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c | 7 ++-
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c 
> b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c
> index 64b225d..14f93fb 100644
> --- a/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c
> +++ b/src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c
> @@ -387,11 +387,8 @@ static enum rc_reg_class variable_get_class(
>* instructions can't be
>* swizzle on r300/r400 GPUs.
>*/
> - if (!variable->C->is_r500) {
> - can_change_writemask = 
> 0;
> - break;
> - }
> - old_swizzle = 
> r.U.I.Src->Swizzle;
> + can_change_writemask = 0;
> + break;
>   }
>   new_swizzle = rc_adjust_channels(
>   old_swizzle, 
> conversion_swizzle);
> -- 
> 2.1.2
> 

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

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


[Mesa-dev] The final batch of gallium 'make dist'

2014-10-14 Thread Emil Velikov
Hello list,

As the title says it - this ought to be the final batch of patches 
needed to get 'make dist' working for gallium. With that one out of the 
way I'll start looking into egl, gbm . and mapi.

Some of the patches may contain rather controversial changes, but I 
would rather get things working and then nitpick on making it 'perfect'

As usual any comment and suggestions are greatly appreciated.

-Emil

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


[Mesa-dev] [PATCH 2/4] gallium: ship the gallium API headers

2014-10-14 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 src/gallium/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/Makefile.am b/src/gallium/Makefile.am
index 21595a1..b12802a 100644
--- a/src/gallium/Makefile.am
+++ b/src/gallium/Makefile.am
@@ -179,6 +179,7 @@ endif
 ##
 
 EXTRA_DIST += \
+   include \
state_trackers/README \
state_trackers/wgl targets/libgl-gdi \
targets/graw-gdi targets/graw-null  targets/graw-xlib \
-- 
2.1.0

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


[Mesa-dev] [PATCH 4/4] targets: bundle all files in the tarball

2014-10-14 Thread Emil Velikov
We were missing a few files
 - The version scripts
 - Android & scons build scripts
 - A few headers.

Signed-off-by: Emil Velikov 
---
 src/gallium/targets/dri/Makefile.am | 5 +
 src/gallium/targets/egl-static/Makefile.am  | 7 ++-
 src/gallium/targets/gbm/Makefile.am | 3 +++
 src/gallium/targets/libgl-xlib/Makefile.am  | 3 +++
 src/gallium/targets/omx/Makefile.am | 2 ++
 src/gallium/targets/opencl/Makefile.am  | 2 ++
 src/gallium/targets/osmesa/Makefile.am  | 2 ++
 src/gallium/targets/pipe-loader/Makefile.am | 2 ++
 src/gallium/targets/va/Makefile.am  | 2 ++
 src/gallium/targets/vdpau/Makefile.am   | 4 
 src/gallium/targets/xa/Makefile.am  | 2 ++
 src/gallium/targets/xvmc/Makefile.am| 1 +
 12 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/src/gallium/targets/dri/Makefile.am 
b/src/gallium/targets/dri/Makefile.am
index 1094ffd..13c29ad 100644
--- a/src/gallium/targets/dri/Makefile.am
+++ b/src/gallium/targets/dri/Makefile.am
@@ -59,6 +59,11 @@ gallium_dri_la_LIBADD = \
 gallium_dri_la_LDFLAGS += \
-Wl,--allow-multiple-definition
 
+EXTRA_gallium_dri_la_DEPENDENCIES = \
+   dri.sym \
+   $(top_srcdir)/src/gallium/targets/dri-vdpau.dyn
+EXTRA_DIST = SConscript
+
 TARGET_DRIVERS =
 TARGET_CPPFLAGS =
 TARGET_LIB_DEPS = $(top_builddir)/src/loader/libloader.la
diff --git a/src/gallium/targets/egl-static/Makefile.am 
b/src/gallium/targets/egl-static/Makefile.am
index 3f0e650..d5759e6 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -59,7 +59,9 @@ nodist_EXTRA_egl_gallium_la_SOURCES = dummy.cpp
 egl_gallium_la_SOURCES = \
egl.c \
egl_pipe.c \
-   egl_st.c
+   egl_pipe.h \
+   egl_st.c \
+   egl_st.h
 
 egl_gallium_la_LIBADD = \
$(top_builddir)/src/loader/libloader.la \
@@ -151,6 +153,9 @@ egl_gallium_la_LIBADD += \
$(top_builddir)/src/mapi/vgapi/libOpenVG.la
 endif
 
+EXTRA_egl_gallium_la_DEPENDENCIES = egl.sym
+EXTRA_DIST = Android.mk SConscript
+
 #if HAVE_GALLIUM_STATIC_TARGETS
 
 TARGET_DRIVERS =
diff --git a/src/gallium/targets/gbm/Makefile.am 
b/src/gallium/targets/gbm/Makefile.am
index 2c9b425..248ec2c 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -50,6 +50,9 @@ gbm_gallium_drm_la_LDFLAGS += \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/gbm/gbm.sym
 endif
 
+EXTRA_gbm_gallium_la_DEPENDENCIES = gbm.sym
+EXTRA_DIST = gallium-gbm-symbols-check
+
 if HAVE_GALLIUM_STATIC_TARGETS
 
 TARGET_DRIVERS =
diff --git a/src/gallium/targets/libgl-xlib/Makefile.am 
b/src/gallium/targets/libgl-xlib/Makefile.am
index 4ed2025..cb77a54 100644
--- a/src/gallium/targets/libgl-xlib/Makefile.am
+++ b/src/gallium/targets/libgl-xlib/Makefile.am
@@ -74,4 +74,7 @@ AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 lib@GL_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif
 
+EXTRA_lib@GL_LIB@_la_DEPENDENCIES = libgl-xlib.sym
+EXTRA_DIST = SConscript
+
 include $(top_srcdir)/install-gallium-links.mk
diff --git a/src/gallium/targets/omx/Makefile.am 
b/src/gallium/targets/omx/Makefile.am
index 4be1063..7ea3144 100644
--- a/src/gallium/targets/omx/Makefile.am
+++ b/src/gallium/targets/omx/Makefile.am
@@ -30,6 +30,8 @@ libomx_mesa_la_LIBADD = \
$(OMX_LIBS) \
$(GALLIUM_COMMON_LIB_DEPS)
 
+EXTRA_libomx_mesa_la_DEPENDENCIES = omx.sym
+
 if HAVE_GALLIUM_STATIC_TARGETS
 
 TARGET_DRIVERS =
diff --git a/src/gallium/targets/opencl/Makefile.am 
b/src/gallium/targets/opencl/Makefile.am
index 43ba5dd..6889824 100644
--- a/src/gallium/targets/opencl/Makefile.am
+++ b/src/gallium/targets/opencl/Makefile.am
@@ -42,6 +42,8 @@ lib@OPENCL_LIBNAME@_la_LIBADD = \
 nodist_EXTRA_lib@OPENCL_LIBNAME@_la_SOURCES = dummy.cpp
 lib@OPENCL_LIBNAME@_la_SOURCES =
 
+EXTRA_lib@OPENCL_LIBNAME@_la_DEPENDENCIES = opencl.sym
+EXTRA_DIST = mesa.icd
 
 if HAVE_CLOVER_ICD
 icddir = /etc/OpenCL/vendors/
diff --git a/src/gallium/targets/osmesa/Makefile.am 
b/src/gallium/targets/osmesa/Makefile.am
index 3a554a9..058b098 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -75,6 +75,8 @@ lib@OSMESA_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
 lib@OSMESA_LIB@_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 endif
 
+EXTRA_lib@OSMESA_LIB@_la_DEPENDENCIES = osmesa.sym
+
 include $(top_srcdir)/install-gallium-links.mk
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/src/gallium/targets/pipe-loader/Makefile.am 
b/src/gallium/targets/pipe-loader/Makefile.am
index 5f1330a..a02f204 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -179,3 +179,5 @@ pipe_swrast_la_LIBADD += \
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
 endif
 endif
+
+EXTRA_DIST = pipe.sym
diff --git a/src/gallium/targets/va/Makefile.am 
b/src/gallium/targets/va/Makefile.am
index 8112f78..53b43c6 10064

[Mesa-dev] [PATCH 3/4] auxiliary: ship all files in the distribution tarball

2014-10-14 Thread Emil Velikov
 - Add all headers into Makefile.sources
 - Don't forget the target-helpers
 - Add the python scripts & the formats table/list (csv)
 - Temporary add vl/vl_winsys_dri.c to EXTRA_DIST until we rework the
way VL is build.
 - Add the following to EXTRA_DIST - they are included via the
generated u_indices_gen.c thus we should not add them to *SOURCES.
  indices/u_indices.c
  indices/u_unfilled_indices.c

XXX: Should we nuke gallivm/f.cpp ? It seems that no-one is using it.

Signed-off-by: Emil Velikov 
---
 src/gallium/auxiliary/Makefile.am  |  10 +
 src/gallium/auxiliary/Makefile.sources | 321 +++--
 2 files changed, 271 insertions(+), 60 deletions(-)

diff --git a/src/gallium/auxiliary/Makefile.am 
b/src/gallium/auxiliary/Makefile.am
index 4d8ba89..3688edc 100644
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -46,3 +46,13 @@ indices/u_unfilled_gen.c: $(srcdir)/indices/u_unfilled_gen.py
 util/u_format_table.c: $(srcdir)/util/u_format_table.py 
$(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py 
$(srcdir)/util/u_format.csv
$(AM_V_at)$(MKDIR_P) util
$(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py 
$(srcdir)/util/u_format.csv > $@
+
+EXTRA_DIST = \
+   indices/u_indices.c \
+   indices/u_unfilled_indices.c \
+   target-helpers \
+   util/u_format.csv \
+   util/u_format_pack.py \
+   util/u_format_parse.py \
+   util/u_format_table.py \
+   vl/vl_winsys_dri.c
diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index 58d8af7..de90549 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -1,11 +1,21 @@
 C_SOURCES := \
cso_cache/cso_cache.c \
+   cso_cache/cso_cache.h \
cso_cache/cso_context.c \
+   cso_cache/cso_context.h \
cso_cache/cso_hash.c \
+   cso_cache/cso_hash.h \
+   draw/draw_cliptest_tmp.h \
draw/draw_context.c \
+   draw/draw_context.h \
+   draw/draw_decompose_tmp.h \
draw/draw_fs.c \
+   draw/draw_fs.h \
draw/draw_gs.c \
+   draw/draw_gs.h \
+   draw/draw_gs_tmp.h \
draw/draw_pipe.c \
+   draw/draw_pipe.h \
draw/draw_pipe_aaline.c \
draw/draw_pipe_aapoint.c \
draw/draw_pipe_clip.c \
@@ -22,141 +32,305 @@ C_SOURCES := \
draw/draw_pipe_wide_line.c \
draw/draw_pipe_wide_point.c \
draw/draw_prim_assembler.c \
+   draw/draw_prim_assembler.h \
+   draw/draw_prim_assembler_tmp.h \
+   draw/draw_private.h \
draw/draw_pt.c \
+   draw/draw_pt_decompose.h \
draw/draw_pt_emit.c \
draw/draw_pt_fetch.c \
draw/draw_pt_fetch_emit.c \
draw/draw_pt_fetch_shade_emit.c \
draw/draw_pt_fetch_shade_pipeline.c \
+   draw/draw_pt.h \
draw/draw_pt_post_vs.c \
draw/draw_pt_so_emit.c \
draw/draw_pt_util.c \
draw/draw_pt_vsplit.c \
+   draw/draw_pt_vsplit_tmp.h \
+   draw/draw_so_emit_tmp.h \
+   draw/draw_split_tmp.h \
+   draw/draw_vbuf.h \
draw/draw_vertex.c \
+   draw/draw_vertex.h \
draw/draw_vs.c \
draw/draw_vs_exec.c \
+   draw/draw_vs.h \
draw/draw_vs_variant.c \
hud/font.c \
+   hud/font.h \
hud/hud_context.c \
+   hud/hud_context.h \
hud/hud_cpu.c \
+   hud/hud_driver_query.c \
hud/hud_fps.c \
-hud/hud_driver_query.c \
+   hud/hud_private.h \
+   indices/u_indices.h \
+   indices/u_indices_priv.h \
indices/u_primconvert.c \
+   indices/u_primconvert.h \
+   os/os_memory_aligned.h \
+   os/os_memory_debug.h \
+   os/os_memory.h \
+   os/os_memory_stdc.h \
os/os_misc.c \
+   os/os_misc.h \
+   os/os_mman.h \
os/os_process.c \
+   os/os_process.h \
+   os/os_thread.h \
os/os_time.c \
+   os/os_time.h \
pipebuffer/pb_buffer_fenced.c \
+   pipebuffer/pb_buffer_fenced.h \
+   pipebuffer/pb_buffer.h \
pipebuffer/pb_buffer_malloc.c \
pipebuffer/pb_bufmgr_alt.c \
pipebuffer/pb_bufmgr_cache.c \
pipebuffer/pb_bufmgr_debug.c \
+   pipebuffer/pb_bufmgr.h \
pipebuffer/pb_bufmgr_mm.c \
pipebuffer/pb_bufmgr_ondemand.c \
pipebuffer/pb_bufmgr_pool.c \
pipebuffer/pb_bufmgr_slab.c \
pipebuffer/pb_validate.c \
+   pipebuffer/pb_validate.h \
+   postprocess/filters.h \
+   postprocess/postprocess.h \
postprocess/pp_celshade.c \
+   postprocess/pp_celshade.h \
postprocess/pp_colors.c \
+   postprocess/pp_colors.h \
+   postprocess/pp_filters.h \
postprocess/pp_init.c \
+   postprocess/pp_mlaa_areamap.h \
postprocess/pp_mlaa.c \
-   postprocess/pp_run.c \
+   postprocess/pp_mlaa.h \
+   postprocess/pp_private.h \
postproces

[Mesa-dev] [PATCH 1/4] pipe-loader: consolidate sources into Makefile.sources

2014-10-14 Thread Emil Velikov
Drop the unneeded subdir-objects.

Signed-off-by: Emil Velikov 
---
 src/gallium/auxiliary/pipe-loader/Makefile.am  | 10 ++
 src/gallium/auxiliary/pipe-loader/Makefile.sources |  8 
 2 files changed, 10 insertions(+), 8 deletions(-)
 create mode 100644 src/gallium/auxiliary/pipe-loader/Makefile.sources

diff --git a/src/gallium/auxiliary/pipe-loader/Makefile.am 
b/src/gallium/auxiliary/pipe-loader/Makefile.am
index 1204c79..44917f3 100644
--- a/src/gallium/auxiliary/pipe-loader/Makefile.am
+++ b/src/gallium/auxiliary/pipe-loader/Makefile.am
@@ -1,4 +1,4 @@
-AUTOMAKE_OPTIONS = subdir-objects
+include Makefile.sources
 
 AM_CPPFLAGS = $(DEFINES) \
$(VISIBILITY_CFLAGS) \
@@ -11,16 +11,10 @@ AM_CPPFLAGS = $(DEFINES) \
 noinst_LTLIBRARIES = libpipe_loader.la
 noinst_LTLIBRARIES += libpipe_loader_client.la
 
-COMMON_SOURCES = \
-   pipe_loader.h \
-   pipe_loader_priv.h \
-   pipe_loader.c \
-   pipe_loader_sw.c
-
 if HAVE_DRM_LOADER_GALLIUM
 AM_CFLAGS = $(LIBDRM_CFLAGS)
 
-COMMON_SOURCES += pipe_loader_drm.c
+COMMON_SOURCES += $(DRM_SOURCES)
 
 COMMON_LIBADD = \
$(top_builddir)/src/loader/libloader.la
diff --git a/src/gallium/auxiliary/pipe-loader/Makefile.sources 
b/src/gallium/auxiliary/pipe-loader/Makefile.sources
new file mode 100644
index 000..d6e3c2c
--- /dev/null
+++ b/src/gallium/auxiliary/pipe-loader/Makefile.sources
@@ -0,0 +1,8 @@
+COMMON_SOURCES := \
+   pipe_loader.c \
+   pipe_loader.h \
+   pipe_loader_priv.h \
+   pipe_loader_sw.c
+
+DRM_SOURCES := \
+   pipe_loader_drm.c
-- 
2.1.0

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


[Mesa-dev] [PATCH 2.9/4] i965/fs: Properly precolor payload registers on GEN5 in SIMD16

2014-10-14 Thread Jason Ekstrand
For GEN6 SIMD16 mode, we have to 2-align all the registers, so we only have
the even-numbered ones.  This means that we have to divide the register
number by 2 when we precolor.  This wasn't a problem before because we were
setting up the interference between ra_node registers wrong.  This will be
fixed in the next commit.

Signed-off-by: Jason Ekstrand 
---
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index fd34941..9e74127 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -390,7 +390,16 @@ fs_visitor::setup_payload_interference(struct ra_graph *g,
* The alternative would be to have per-physical-register classes, which
* would just be silly.
*/
-  ra_set_node_reg(g, first_payload_node + i, i);
+  if (brw->intelScreen->devinfo->gen <= 5 && dispatch_width == 16) {
+ /* We have to divide by 2 here because we only have even numbered
+  * registers.  Some of the payload registers will be odd, but
+  * that's ok because their physical register numbers have already
+  * been assigned.  The only thing this is used for is interference.
+  */
+ ra_set_node_reg(g, first_payload_node + i, i / 2);
+  } else {
+ ra_set_node_reg(g, first_payload_node + i, i);
+  }
}
 }
 
-- 
2.1.0

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


Re: [Mesa-dev] [PATCH] i965: Allow CSE on Gen4-5 unary math.

2014-10-14 Thread Matt Turner
Reviewed-by: Matt Turner 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 84566] Unify the format conversion code

2014-10-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=84566

--- Comment #17 from Jason Ekstrand  ---
(In reply to Iago Toral from comment #16)
> We also need new mesa_format enums and pack/unpack functions for byte
> swapped variants of non-array types.

Why?  Is this for the byte_swapped flag on GL upload/downloads?  If that's the
only reason, then I'd rather not bother adding mesa types.  We can easily do a
byte swap with _mesa_swizzle_and_convert.  While it's a little bit of a
performance hit, people shouldn't be using that attribute anyway.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965/fs: Use the correct regs_written on unspill instructions

2014-10-14 Thread Jason Ekstrand
Signed-off-by: Jason Ekstrand 
---
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index 28a7483..46e465f 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -641,6 +641,7 @@ fs_visitor::emit_unspill(bblock_t *block, fs_inst *inst, 
fs_reg dst,
   unspill_inst->offset = spill_offset;
   unspill_inst->ir = inst->ir;
   unspill_inst->annotation = inst->annotation;
+  unspill_inst->regs_written = reg_size;
 
   if (!gen7_read) {
  unspill_inst->base_mrf = 14;
-- 
2.1.0

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


Re: [Mesa-dev] [PATCH] i965/fs: Use the correct regs_written on unspill instructions

2014-10-14 Thread Kenneth Graunke
On Tuesday, October 14, 2014 12:03:00 PM Jason Ekstrand wrote:
> Signed-off-by: Jason Ekstrand 
> ---
>  src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp 
> b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
> index 28a7483..46e465f 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
> @@ -641,6 +641,7 @@ fs_visitor::emit_unspill(bblock_t *block, fs_inst *inst, 
> fs_reg dst,
>unspill_inst->offset = spill_offset;
>unspill_inst->ir = inst->ir;
>unspill_inst->annotation = inst->annotation;
> +  unspill_inst->regs_written = reg_size;
>  
>if (!gen7_read) {
>   unspill_inst->base_mrf = 14;
> 

Right, this code lives in a loop that unspills large things in reg_size chunks.

Good catch.

Reviewed-by: Kenneth Graunke 

signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] Assertion `key->nr_vertex_elements <= llvm->draw->pt.nr_vertex_elements' failed.

2014-10-14 Thread Thomas Sondergaard
using llvmpipe I'm hitting the following assertion in some old code that 
use glEdgeFlag().


src/gallium/auxiliary/draw/draw_llvm.c:1824:draw_llvm_make_variant_key: 
Assertion `key->nr_vertex_elements <= llvm->draw->pt.nr_vertex_elements' 
failed.


I have captured a trace with apitrace from the program that you can 
download here:


http://spear.medical-insight.com/~ts/camloader.trace (size: 286KiB)

I can trigger the assertion like this:

LD_LIBRARY_PATH=.../mesa/build/linux-x86_64-debug/gallium/targets/libgl-xlib 
apitrace replay camloader.trace


I have reproduced this problem with mesa.git master tonight (commit 
742158b51ee981) and with versions of mesa that predates version 10.


I hope you can (help me) figure out what is wrong.

Thanks,
Thomas


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


Re: [Mesa-dev] Assertion `key->nr_vertex_elements <= llvm->draw->pt.nr_vertex_elements' failed.

2014-10-14 Thread Roland Scheidegger

On 10/14/2014 01:14 PM, Thomas Sondergaard wrote:

using llvmpipe I'm hitting the following assertion in some old code that
use glEdgeFlag().

src/gallium/auxiliary/draw/draw_llvm.c:1824:draw_llvm_make_variant_key:
Assertion `key->nr_vertex_elements <= llvm->draw->pt.nr_vertex_elements'
failed.

I have captured a trace with apitrace from the program that you can
download here:

https://urldefense.proofpoint.com/v1/url?u=http://spear.medical-insight.com/~ts/camloader.trace&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=F4msKE2WxRzA%2BwN%2B25muztFm5TSPwE8HKJfWfR2NgfY%3D%0A&m=sKwEyXn7fc%2FNucRx6KesK7QsmLBbFD6UarCJqZpe4M4%3D%0A&s=cce0b92df9c2172c5c13bc70d46d0f3d682252d07880b0e75ec11551de9f634d
(size: 286KiB)

I can trigger the assertion like this:

LD_LIBRARY_PATH=.../mesa/build/linux-x86_64-debug/gallium/targets/libgl-xlib
apitrace replay camloader.trace

I have reproduced this problem with mesa.git master tonight (commit
742158b51ee981) and with versions of mesa that predates version 10.

I hope you can (help me) figure out what is wrong.



I don't think edgeflags ever worked with llvmpipe - there's some piglit 
test which fails since forever though it does not crash. I'm not 
entirely sure how much work it would be to make it work, there's 
probably not that much interest.


Roland

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


Re: [Mesa-dev] [PATCH 12/17] i965/fs: don't pass in ir_texture to emit_texture_*

2014-10-14 Thread Jason Ekstrand
On Mon, Oct 13, 2014 at 9:54 PM, Kenneth Graunke 
wrote:

> From: Connor Abbott 
>
> At this point, the only thing it's used for is the opcode.
>
> Signed-off-by: Connor Abbott 
> Reviewed-by: Kenneth Graunke 
> ---
>  src/mesa/drivers/dri/i965/brw_fs.h   |  6 ++---
>  src/mesa/drivers/dri/i965/brw_fs_fp.cpp  |  6 ++---
>  src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 35
> ++--
>  3 files changed, 23 insertions(+), 24 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h
> b/src/mesa/drivers/dri/i965/brw_fs.h
> index 5441031..2615e40 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_fs.h
> @@ -470,18 +470,18 @@ public:
> void compute_sample_position(fs_reg dst, fs_reg int_sample_pos);
> fs_reg rescale_texcoord(fs_reg coordinate, const glsl_type *coord_type,
> bool is_rect, uint32_t sampler, int texunit);
> -   fs_inst *emit_texture_gen4(ir_texture *ir, fs_reg dst,
> +   fs_inst *emit_texture_gen4(ir_texture_opcode op, fs_reg dst,
>fs_reg coordinate, int coord_components,
>fs_reg shadow_comp,
>fs_reg lod, fs_reg lod2, int
> grad_components,
>uint32_t sampler);
> -   fs_inst *emit_texture_gen5(ir_texture *ir, fs_reg dst,
> +   fs_inst *emit_texture_gen5(ir_texture_opcode op, fs_reg dst,
>fs_reg coordinate, int coord_components,
>fs_reg shadow_comp,
>fs_reg lod, fs_reg lod2, int
> grad_components,
>fs_reg sample_index, uint32_t sampler,
>bool has_offset);
> -   fs_inst *emit_texture_gen7(ir_texture *ir, fs_reg dst,
> +   fs_inst *emit_texture_gen7(ir_texture_opcode op, fs_reg dst,
>fs_reg coordinate, int coord_components,
>fs_reg shadow_comp,
>fs_reg lod, fs_reg lod2, int
> grad_components,
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
> index a77769b..99cdecb 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
> @@ -487,11 +487,11 @@ fs_visitor::emit_fragment_program_code()
>
>   fs_inst *inst;
>   if (brw->gen >= 7) {
> -inst = emit_texture_gen7(ir, dst, coordinate,
> coord_components, shadow_c, lod, dpdy, 0, sample_index, fs_reg(0u),
> fs_reg(fpi->TexSrcUnit), texel_offset);
> +inst = emit_texture_gen7(ir->op, dst, coordinate,
> coord_components, shadow_c, lod, dpdy, 0, sample_index, fs_reg(0u),
> fs_reg(fpi->TexSrcUnit), texel_offset);
>   } else if (brw->gen >= 5) {
> -inst = emit_texture_gen5(ir, dst, coordinate,
> coord_components, shadow_c, lod, dpdy, 0, sample_index, fpi->TexSrcUnit,
> false);
> +inst = emit_texture_gen5(ir->op, dst, coordinate,
> coord_components, shadow_c, lod, dpdy, 0, sample_index, fpi->TexSrcUnit,
> false);
>   } else {
> -inst = emit_texture_gen4(ir, dst, coordinate,
> coord_components, shadow_c, lod, dpdy, 0, fpi->TexSrcUnit);
> +inst = emit_texture_gen4(ir->op, dst, coordinate,
> coord_components, shadow_c, lod, dpdy, 0, fpi->TexSrcUnit);
>   }
>
>   inst->shadow_compare = fpi->TexShadow;
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> index c741ca3..2251bae 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> @@ -1166,7 +1166,7 @@ fs_visitor::visit(ir_assignment *ir)
>  }
>
>  fs_inst *
> -fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst,
> +fs_visitor::emit_texture_gen4(ir_texture_opcode op, fs_reg dst,
>fs_reg coordinate, int coord_components,
>fs_reg shadow_c,
>fs_reg lod, fs_reg dPdy, int
> grad_components,
> @@ -1194,13 +1194,13 @@ fs_visitor::emit_texture_gen4(ir_texture *ir,
> fs_reg dst,
>}
>mlen += 3;
>
> -  if (ir->op == ir_tex) {
> +  if (op == ir_tex) {
>  /* There's no plain shadow compare message, so we use shadow
>   * compare with a bias of 0.0.
>   */
>  emit(MOV(fs_reg(MRF, base_mrf + mlen), fs_reg(0.0f)));
>  mlen++;
> -  } else if (ir->op == ir_txb || ir->op == ir_txl) {
> +  } else if (op == ir_txb || op == ir_txl) {
>  emit(MOV(fs_reg(MRF, base_mrf + mlen), lod));
>  mlen++;
>} else {
> @@ -1209,7 +1209,7 @@ fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg
> dst,
>
>emit(MOV(fs_reg(MRF, base_mrf + mlen), shadow_c));
>mlen++;
> -   } else if (ir->op == ir_tex) {
> +   } else if (op == ir_tex) {
>

Re: [Mesa-dev] [PATCH 12/17] i965/fs: don't pass in ir_texture to emit_texture_*

2014-10-14 Thread Jason Ekstrand
On Tue, Oct 14, 2014 at 3:03 PM, Jason Ekstrand 
wrote:

>
>
> On Mon, Oct 13, 2014 at 9:54 PM, Kenneth Graunke 
> wrote:
>
>> From: Connor Abbott 
>>
>> At this point, the only thing it's used for is the opcode.
>>
>> Signed-off-by: Connor Abbott 
>> Reviewed-by: Kenneth Graunke 
>> ---
>>  src/mesa/drivers/dri/i965/brw_fs.h   |  6 ++---
>>  src/mesa/drivers/dri/i965/brw_fs_fp.cpp  |  6 ++---
>>  src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 35
>> ++--
>>  3 files changed, 23 insertions(+), 24 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h
>> b/src/mesa/drivers/dri/i965/brw_fs.h
>> index 5441031..2615e40 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs.h
>> +++ b/src/mesa/drivers/dri/i965/brw_fs.h
>> @@ -470,18 +470,18 @@ public:
>> void compute_sample_position(fs_reg dst, fs_reg int_sample_pos);
>> fs_reg rescale_texcoord(fs_reg coordinate, const glsl_type
>> *coord_type,
>> bool is_rect, uint32_t sampler, int texunit);
>> -   fs_inst *emit_texture_gen4(ir_texture *ir, fs_reg dst,
>> +   fs_inst *emit_texture_gen4(ir_texture_opcode op, fs_reg dst,
>>fs_reg coordinate, int coord_components,
>>fs_reg shadow_comp,
>>fs_reg lod, fs_reg lod2, int
>> grad_components,
>>uint32_t sampler);
>> -   fs_inst *emit_texture_gen5(ir_texture *ir, fs_reg dst,
>> +   fs_inst *emit_texture_gen5(ir_texture_opcode op, fs_reg dst,
>>fs_reg coordinate, int coord_components,
>>fs_reg shadow_comp,
>>fs_reg lod, fs_reg lod2, int
>> grad_components,
>>fs_reg sample_index, uint32_t sampler,
>>bool has_offset);
>> -   fs_inst *emit_texture_gen7(ir_texture *ir, fs_reg dst,
>> +   fs_inst *emit_texture_gen7(ir_texture_opcode op, fs_reg dst,
>>fs_reg coordinate, int coord_components,
>>fs_reg shadow_comp,
>>fs_reg lod, fs_reg lod2, int
>> grad_components,
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
>> b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
>> index a77769b..99cdecb 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
>> @@ -487,11 +487,11 @@ fs_visitor::emit_fragment_program_code()
>>
>>   fs_inst *inst;
>>   if (brw->gen >= 7) {
>> -inst = emit_texture_gen7(ir, dst, coordinate,
>> coord_components, shadow_c, lod, dpdy, 0, sample_index, fs_reg(0u),
>> fs_reg(fpi->TexSrcUnit), texel_offset);
>> +inst = emit_texture_gen7(ir->op, dst, coordinate,
>> coord_components, shadow_c, lod, dpdy, 0, sample_index, fs_reg(0u),
>> fs_reg(fpi->TexSrcUnit), texel_offset);
>>   } else if (brw->gen >= 5) {
>> -inst = emit_texture_gen5(ir, dst, coordinate,
>> coord_components, shadow_c, lod, dpdy, 0, sample_index, fpi->TexSrcUnit,
>> false);
>> +inst = emit_texture_gen5(ir->op, dst, coordinate,
>> coord_components, shadow_c, lod, dpdy, 0, sample_index, fpi->TexSrcUnit,
>> false);
>>   } else {
>> -inst = emit_texture_gen4(ir, dst, coordinate,
>> coord_components, shadow_c, lod, dpdy, 0, fpi->TexSrcUnit);
>> +inst = emit_texture_gen4(ir->op, dst, coordinate,
>> coord_components, shadow_c, lod, dpdy, 0, fpi->TexSrcUnit);
>>   }
>>
>>   inst->shadow_compare = fpi->TexShadow;
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> index c741ca3..2251bae 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> @@ -1166,7 +1166,7 @@ fs_visitor::visit(ir_assignment *ir)
>>  }
>>
>>  fs_inst *
>> -fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst,
>> +fs_visitor::emit_texture_gen4(ir_texture_opcode op, fs_reg dst,
>>fs_reg coordinate, int coord_components,
>>fs_reg shadow_c,
>>fs_reg lod, fs_reg dPdy, int
>> grad_components,
>> @@ -1194,13 +1194,13 @@ fs_visitor::emit_texture_gen4(ir_texture *ir,
>> fs_reg dst,
>>}
>>mlen += 3;
>>
>> -  if (ir->op == ir_tex) {
>> +  if (op == ir_tex) {
>>  /* There's no plain shadow compare message, so we use shadow
>>   * compare with a bias of 0.0.
>>   */
>>  emit(MOV(fs_reg(MRF, base_mrf + mlen), fs_reg(0.0f)));
>>  mlen++;
>> -  } else if (ir->op == ir_txb || ir->op == ir_txl) {
>> +  } else if (op == ir_txb || op == ir_txl) {
>>  emit(MOV(fs_reg(MRF, base_mrf + mlen), lod));
>>  mlen++;
>>} else {
>> @@ -1209,7 +1209,7 @@ fs_visitor::emit_texture_gen4(ir_textur

[Mesa-dev] [PATCH] i965: Fix an off-by-1 error in the draw upload code's size calculation.

2014-10-14 Thread Kenneth Graunke
According to INTEL_DEBUG=perf, "Borderlands: The Pre-Sequel" was
stalling on nearly every glBufferSubData call, with very slightly
overlapping busy ranges.

It turns out the draw upload code was accidentally including an extra
stride's worth of data in the vertex buffer size due to a simple
off-by-one error.  We considered this extra bit of buffer space to be
busy (in use by the GPU), when it was actually idle.

The new diagram should make it easier to understand the formula.  It's
basically what I drew on paper when working through an actual
glDrawRangeElements call.

Eliminates all glBufferSubData stalls in "Borderlands: The Pre-Sequel."

Signed-off-by: Kenneth Graunke 
Cc: mesa-sta...@lists.freedesktop.org
---
 src/mesa/drivers/dri/i965/brw_draw_upload.c | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

No Piglit regressions on Haswell.  This might help Dota 2 and Serious Sam 3
as well, but I haven't checked.

diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c 
b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 5a12439..6cb653c 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -486,8 +486,28 @@ brw_prepare_vertices(struct brw_context *brw)
   offset = 0;
   size = intel_buffer->Base.Size;
} else {
+  /* Compute the size/amount of data referenced by the GPU.
+   * If the data is interleaved, StrideB may be larger than
+   * _ElementSize.  As an example, assume we have 2 interleaved
+   * attributes A and B.  The data is organized like this:
+   *
+   *   StrideEltSize
+   *_,,_,
+   *   /\  / \
+   *A: ---   ---   ---   ---   ---   ---
+   *B:---   ---   ---   ---   ---   ---
+   *
+   *   |= 4 elts ==|  (4-1) * Stride + EltSize
+   *
+   * max_index - min_index gives the number of elements that
+   * will be referenced.  Say we're drawing 4 elements.  On
+   * the first three, we need the full stride in order to get
+   * to the next element.  But on the last, we only want the
+   * element size, since we don't actually read the other
+   * interleaved vertex attributes stored beyond that.
+   */
   offset = buffer->offset + min_index * buffer->stride;
-  size = (buffer->stride * (max_index - min_index) +
+  size = (buffer->stride * MAX2(max_index - min_index - 1, 0) +
   glarray->_ElementSize);
}
 }
-- 
2.1.2

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


Re: [Mesa-dev] [PATCH 17/17] i965/fs: don't make a fake ir_texture in the Mesa IR frontend

2014-10-14 Thread Connor Abbott
On Tue, Oct 14, 2014 at 12:54 AM, Kenneth Graunke  wrote:
> From: Connor Abbott 
>
> Now that we've made all the texture emit code mostly independent of GLSL
> IR, this isn't necessary any more.
>
> Signed-off-by: Connor Abbott 
> Reviewed-by: Kenneth Graunke 
> ---
>  src/mesa/drivers/dri/i965/brw_fs_fp.cpp | 19 +--
>  1 file changed, 5 insertions(+), 14 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp 
> b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
> index 1ba24a9..6348bc1 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
> @@ -391,14 +391,7 @@ fs_visitor::emit_fragment_program_code()
>case OPCODE_TEX:
>case OPCODE_TXB:
>case OPCODE_TXP: {
> - /* We piggy-back on the GLSL IR support for texture setup.  To do 
> so,
> -  * we have to cook up an ir_texture that has the coordinate field
> -  * with appropriate type, and shadow_comparitor set or not.  All the
> -  * other properties of ir_texture are passed in as arguments to the
> -  * emit_texture_gen* function.
> -  */
> - ir_texture *ir = NULL;
> -
> + ir_texture_opcode op;
>   fs_reg lod;
>   fs_reg dpdy;
>   fs_reg coordinate = src[0];
> @@ -408,10 +401,10 @@ fs_visitor::emit_fragment_program_code()
>
>   switch (fpi->Opcode) {
>   case OPCODE_TEX:
> -ir = new(mem_ctx) ir_texture(ir_tex);
> +op = ir_tex;
>  break;
>   case OPCODE_TXP: {
> -ir = new(mem_ctx) ir_texture(ir_tex);
> +op = ir_tex;
>
>  coordinate = fs_reg(this, glsl_type::vec3_type);
>  fs_reg invproj = fs_reg(this, glsl_type::float_type);
> @@ -423,15 +416,13 @@ fs_visitor::emit_fragment_program_code()
>  break;
>   }
>   case OPCODE_TXB:
> -ir = new(mem_ctx) ir_texture(ir_txb);
> +op = ir_txb;
>  lod = offset(src[0], 3);
>  break;
>   default:
>  unreachable("not reached");
>   }
>
> - ir->type = glsl_type::vec4_type;
> -
>   const glsl_type *coordinate_type;
>   switch (fpi->TexSrcTarget) {
>   case TEXTURE_1D_INDEX:
> @@ -479,7 +470,7 @@ fs_visitor::emit_fragment_program_code()
>   if (fpi->TexShadow)
>  shadow_c = offset(coordinate, 2);
>
> - emit_texture(ir->op, glsl_type::vec4_type, coordinate, 
> coordinate_type,
> + emit_texture(op, glsl_type::vec4_type, coordinate, coordinate_type,
>shadow_c, lod, dpdy, 0, sample_index,
>reg_undef, 0, /* offset, components */
>reg_undef, /* mcs */
> --
> 2.1.2
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

I think there are a few more texture-related patches in my nir-i965-fs
branch which you don't have here, namely:

i965/fs: don't pass through the coordinate type
i965/fs: be more careful about types when emitting textures

Like the one fixing integer texture swizzles, I only realized I needed
these after I started working on the NIR backend, so I never sent them
as part of the original series, but it seems to me like they should
probably be in there (and it's likely that they have conflicts too).
Did you miss them?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965: Fix an off-by-1 error in the draw upload code's size calculation.

2014-10-14 Thread Kenneth Graunke
On Tuesday, October 14, 2014 04:42:39 PM Kenneth Graunke wrote:
> According to INTEL_DEBUG=perf, "Borderlands: The Pre-Sequel" was
> stalling on nearly every glBufferSubData call, with very slightly
> overlapping busy ranges.
> 
> It turns out the draw upload code was accidentally including an extra
> stride's worth of data in the vertex buffer size due to a simple
> off-by-one error.  We considered this extra bit of buffer space to be
> busy (in use by the GPU), when it was actually idle.
> 
> The new diagram should make it easier to understand the formula.  It's
> basically what I drew on paper when working through an actual
> glDrawRangeElements call.
> 
> Eliminates all glBufferSubData stalls in "Borderlands: The Pre-Sequel."
> 
> Signed-off-by: Kenneth Graunke 
> Cc: mesa-sta...@lists.freedesktop.org
> ---
>  src/mesa/drivers/dri/i965/brw_draw_upload.c | 22 +-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> No Piglit regressions on Haswell.  This might help Dota 2 and Serious Sam 3
> as well, but I haven't checked.

Chris Forbes asked me for actual performance numbers, so here they are:
the initial sequence is roughly 1.6x to 1.8x faster.  (I measured FPS by typing 
`stat fps` in the developer console and eyeballing the FPS counter it displayed 
in the corner.  Not the most scientific, but when the change is large 
enough...it works.)

signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] egl/drm: do not crash when swapping buffers without any rendering

2014-10-14 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 src/egl/drivers/dri2/platform_drm.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_drm.c 
b/src/egl/drivers/dri2/platform_drm.c
index 70bd7d4..f6b9c3a 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -418,6 +418,14 @@ dri2_drm_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLSurface *draw)
  for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)
 if (dri2_surf->color_buffers[i].age > 0)
dri2_surf->color_buffers[i].age++;
+
+ /* Make sure we have a back buffer in case we're swapping without
+  * ever rendering. */
+ if (get_back_bo(dri2_surf) < 0) {
+_eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
+return EGL_FALSE;
+ }
+
  dri2_surf->current = dri2_surf->back;
  dri2_surf->current->age = 1;
  dri2_surf->back = NULL;
-- 
2.1.1

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


[Mesa-dev] [Bug 84570] Borderlands 2: Constant frame rate drops while playing; really bad with additionl lighting

2014-10-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=84570

--- Comment #16 from Michel Dänzer  ---
(In reply to Kai from comment #15)
> THAT is a LOT better! Even with DynamicLights on I only get occasional FPS
> drops. Usually directly after entering a new area. Sometimes, when there's a
> lot to draw, that moves, you can get the drops again as well.

And those remaining drops don't happen with other drivers? Lower FPS when more
things are happening doesn't seem unexpected, and e.g. when entering a new
area, the game code itself might slow down due to loading stuff etc.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 84570] Borderlands 2: Constant frame rate drops while playing; really bad with additionl lighting

2014-10-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=84570

--- Comment #17 from Michel Dänzer  ---
Can you attach a new GALLIUM_HUD screenshot corresponding to a remaining drop?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 84566] Unify the format conversion code

2014-10-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=84566

--- Comment #18 from Iago Toral  ---
(In reply to Jason Ekstrand from comment #17)
> (In reply to Iago Toral from comment #16)
> > We also need new mesa_format enums and pack/unpack functions for byte
> > swapped variants of non-array types.
> 
> Why?  Is this for the byte_swapped flag on GL upload/downloads?  If that's
> the only reason, then I'd rather not bother adding mesa types.  We can
> easily do a byte swap with _mesa_swizzle_and_convert.  While it's a little
> bit of a performance hit, people shouldn't be using that attribute anyway.

I think that won't help in this case. We can only use _mesa_swizzle_and_convert
for array types, but as I say, this involves non-array types like
GL_UNSIGNED_INT_10_10_10_2. The master converter will not use
_mesa_swizzle_and_convert with these, it goes through things like
_mesa_unpack_rgba_row and _mesa_pack_float_rgba_row for example (which rely on
auto-generated pack/unpack functions). Do you think we should try expand these
to consider byte-swapping?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev