Re: [Mesa-dev] [PATCH v3] meta/GetTexSubImage: Account for GL_PACK_SKIP_IMAGES on compressed textures

2016-11-15 Thread Eduardo Lima Mitev

On 11/15/2016 12:25 AM, Kenneth Graunke wrote:

From: Eduardo Lima Mitev 

This option was being ignored when packing compressed 3D and cube textures.

Fixes CTS test (on gen8+):
* GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore

v2: Drop API checks.
v3 (Ken): Just apply the existing code in more cases.
---
 src/mesa/drivers/common/meta.c | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

Hey Eduardo,

It looks like the existing code already tries to handle SkipImages - but
we weren't applying it for 3D and cubemap textures.  I found a spec quote
in the narrative for GetTexImage that indicates we need to do it for those
as well.

What do you think of this version?  I preserved your authorship as I wanted
you to get the credit for this bugfix - I just typed it up so that I could
make sure it actually fixed the test, and since I had it typed up, I figured
I'd send it out to save you some time...



Hi Kenneth,

Great, this is the correct solution. I tried to make my original patch 
work with _mesa_image_address3d() for all targets, as yours, but I 
missed resetting SkipPixels and SkipRows for TEXTURE_3D, so it was 
regressing some subcases.


Patch is:

Reviewed-by: Eduardo Lima Mitev 

I don't mind you taking authorship. Knowing the correct solution is way 
more useful to me :). If you want, take the authorship, put my R-b and 
push; otherwise let me know and I'll put your R-b and push it myself.


Thanks!

Eduardo


 --Ken

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 5ab1e6c..99c85cf 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3243,8 +3243,20 @@ _mesa_meta_GetTexSubImage(struct gl_context *ctx,

   for (slice = 0; slice < depth; slice++) {
  void *dst;
- if (texImage->TexObject->Target == GL_TEXTURE_2D_ARRAY
- || texImage->TexObject->Target == GL_TEXTURE_CUBE_MAP_ARRAY) {
+ /* Section 8.11.4 (Texture Image Queries) of the GL 4.5 spec says:
+  *
+  *"For three-dimensional, two-dimensional array, cube map array,
+  * and cube map textures pixel storage operations are applied as
+  * if the image were two-dimensional, except that the additional
+  * pixel storage state values PACK_IMAGE_HEIGHT and
+  * PACK_SKIP_IMAGES are applied. The correspondence of texels to
+  * memory locations is as defined for TexImage3D in section 8.5."
+  */
+ switch (texImage->TexObject->Target) {
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_CUBE_MAP_ARRAY: {
 /* Setup pixel packing.  SkipPixels and SkipRows will be applied
  * in the decompress_texture_image() function's call to
  * glReadPixels but we need to compute the dest slice's address
@@ -3255,9 +3267,11 @@ _mesa_meta_GetTexSubImage(struct gl_context *ctx,
 packing.SkipRows = 0;
 dst = _mesa_image_address3d(&packing, pixels, width, height,
 format, type, slice, 0, 0);
+break;
  }
- else {
+ default:
 dst = pixels;
+break;
  }
  result = decompress_texture_image(ctx, texImage, slice,
xoffset, yoffset, width, height,



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


Re: [Mesa-dev] [PATCH] android: amd/common: add support for libmesa_amd_common

2016-11-15 Thread Nicolai Hähnle

On 12.11.2016 22:26, Mauro Rossi wrote:

We'd really want to do:

git rm src/amd/common/Makefile.sources
git mv src/amd/common/Makefile.am src/amd/Makefile.common.am
sed -i s|common/||g src/amd/Makefile.common.am
+ fix the odd piece throughout.

As-is we have the sources lists duplicated and makefiles async from
one another. And if history has thought us anything - this will break
all the everytime.

Mauro, can you give it a try ?

Thanks
Emil


Hi,

sed command was not necessary but I had to add
$(top_src)/src/amd/common include,
change configure.ac (like Jason Ekstrand had to do when isl makefile
structure was flattened),
modify Makefile.common.am as Makefile.addrlib.am

I've tried to build and there is no amd related error, it should be ok,
but in my "mesa for linux" build system I am lacking proper llvm
installation and I see llvm building errors, probably related to this
fact.

Please review and check by launching a build on your more stable linux
build systems/CI jobs, before pushing to mesa-dev
Thanks

Mauro

From f78f66049118db3ed9b241dfd020418efe52c10b Mon Sep 17 00:00:00 2001
From: Mauro Rossi 
Date: Sat, 12 Nov 2016 22:10:44 +0100
Subject: [PATCH] amd: flatten amd/common makefile structure

This pulls amd/common build rules into upper level makefile,
along with amd/addlib which is already there.


Looks reasonable to me, but perhaps somebody with more familiarity with 
the build system can take another look?


Reviewed-by: Nicolai Hähnle 


---
 configure.ac   |  1 -
 src/amd/Makefile.am|  1 +
 src/amd/{common/Makefile.am => Makefile.common.am} | 15 ++-
 src/amd/common/Makefile.sources| 31 --
 4 files changed, 9 insertions(+), 39 deletions(-)
 rename src/amd/{common/Makefile.am => Makefile.common.am} (83%)
 delete mode 100644 src/amd/common/Makefile.sources

diff --git a/configure.ac b/configure.ac
index 4761c59..ebe0a2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2682,7 +2682,6 @@ dnl Substitute the config
 AC_CONFIG_FILES([Makefile
 src/Makefile
 src/amd/Makefile
-src/amd/common/Makefile
 src/amd/vulkan/Makefile
 src/compiler/Makefile
 src/egl/Makefile
diff --git a/src/amd/Makefile.am b/src/amd/Makefile.am
index d01d435..1402ca5 100644
--- a/src/amd/Makefile.am
+++ b/src/amd/Makefile.am
@@ -25,3 +25,4 @@ noinst_LTLIBRARIES =

 EXTRA_DIST = $(COMMON_HEADER_FILES)
 include Makefile.addrlib.am
+include Makefile.common.am
diff --git a/src/amd/common/Makefile.am b/src/amd/Makefile.common.am
similarity index 83%
rename from src/amd/common/Makefile.am
rename to src/amd/Makefile.common.am
index bc269ab..4ae8e28 100644
--- a/src/amd/common/Makefile.am
+++ b/src/amd/Makefile.common.am
@@ -19,15 +19,16 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.

-include Makefile.sources
+COMMON_LIBS = common/libamd_common.la

 # TODO cleanup these
-AM_CPPFLAGS = \
+common_libamd_common_la_AM_CPPFLAGS = \
 $(VALGRIND_CFLAGS) \
 $(DEFINES) \
 -I$(top_srcdir)/include \
 -I$(top_builddir)/src \
 -I$(top_srcdir)/src \
+-I$(top_srcdir)/src/amd/common \
 -I$(top_builddir)/src/compiler \
 -I$(top_builddir)/src/compiler/nir \
 -I$(top_srcdir)/src/compiler \
@@ -37,21 +38,21 @@ AM_CPPFLAGS = \
 -I$(top_srcdir)/src/gallium/auxiliary \
 -I$(top_srcdir)/src/gallium/include

-AM_CFLAGS = $(VISIBILITY_CFLAGS) \
+common_libamd_common_la_AM_CFLAGS = $(VISIBILITY_CFLAGS) \
 $(PTHREAD_CFLAGS) \
 $(LLVM_CFLAGS) \
 $(LIBELF_CFLAGS)

-AM_CXXFLAGS = \
+common_libamd_common_la_AM_CXXFLAGS = \
 $(VISIBILITY_CXXFLAGS) \
 $(LLVM_CXXFLAGS)

-noinst_LTLIBRARIES = libamd_common.la
+noinst_LTLIBRARIES += $(COMMON_LIBS)

-libamd_common_la_SOURCES = $(AMD_COMPILER_SOURCES)
+common_libamd_common_la_SOURCES = $(AMD_COMPILER_SOURCES)

 # nir_to_llvm requires LLVM 3.9, which is only required as a minimum when
 # radv is built.
 if HAVE_RADEON_VULKAN
-libamd_common_la_SOURCES += $(AMD_NIR_SOURCES)
+common_libamd_common_la_SOURCES += $(AMD_NIR_SOURCES)
 endif
diff --git a/src/amd/common/Makefile.sources b/src/amd/common/Makefile.sources
deleted file mode 100644
index 0aff73b..000
--- a/src/amd/common/Makefile.sources
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright © 2016 Bas Nieuwenhuizen
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substanti

Re: [Mesa-dev] [PATCH 13/59] glsl/ast/ir: Add 64-bit integer constant support

2016-11-15 Thread Nicolai Hähnle

On 10.11.2016 23:42, Ian Romanick wrote:

On 10/27/2016 06:09 AM, Nicolai Hähnle wrote:

On 26.10.2016 02:59, Ian Romanick wrote:

From: Dave Airlie 

This adds support for 64-bit integer constants to the parser,
ast and ir.

v2: fix a few issues found in testing.

v3: Add missing ir_constant copy contructor support.

Signed-off-by: Dave Airlie 
Reviewed-by: Ian Romanick  [v2]
---
 src/compiler/glsl/ast.h  |   4 ++
 src/compiler/glsl/ast_function.cpp   |   9 ++-
 src/compiler/glsl/ast_to_hir.cpp |  14 
 src/compiler/glsl/glsl_lexer.ll  |  27 +--
 src/compiler/glsl/glsl_parser.yy |  16 +
 src/compiler/glsl/glsl_parser_extras.cpp |   8 +++
 src/compiler/glsl/ir.cpp | 117
+++
 src/compiler/glsl/ir.h   |   6 ++
 8 files changed, 193 insertions(+), 8 deletions(-)


[snip]

diff --git a/src/compiler/glsl/glsl_parser_extras.cpp
b/src/compiler/glsl/glsl_parser_extras.cpp
index a44fedf..6b41c9f 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -1242,6 +1242,14 @@ ast_expression::print(void) const
   printf("%f ", primary_expression.double_constant);
   break;

+   case ast_int64_constant:
+  printf("%ld ", primary_expression.int64_constant);
+  break;
+
+   case ast_uint64_constant:
+  printf("%lu ", primary_expression.uint64_constant);
+  break;


Should this use PRIu64?


Yes.  The previous one should use PRId64.  I'll fix that too.


Apart from that, this patch is

Reviewed-by: Nicolai Hähnle 

Patch 14 & 15 didn't make it through to me. Is that a gmail problem or a
mailing list host problem?


They made it to me.  Did you ever receive these?

https://lists.freedesktop.org/archives/mesa-dev/2016-October/133293.html
https://lists.freedesktop.org/archives/mesa-dev/2016-October/133297.html


Yes, they eventually arrived. I think this was due to the temporary 
mailing list problem a few weeks ago.


Nicolai




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


Re: [Mesa-dev] [PATCH 31/59] st/glsl_to_tgsi: add support for 64-bit integers. (v2)

2016-11-15 Thread Nicolai Hähnle

On 10.11.2016 23:59, Ian Romanick wrote:

On 10/27/2016 06:32 AM, Nicolai Hähnle wrote:

On 26.10.2016 02:59, Ian Romanick wrote:

From: Dave Airlie 

v2: add conversion opcodes.

v3 (idr): Rebase on replacemtn of TGSI_OPCODE_I2U64 with
TGSI_OPCODE_I2I64.

Signed-off-by: Dave Airlie 
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 217
++---
 1 file changed, 198 insertions(+), 19 deletions(-)


[snip]

+   case ir_unop_u2i64:
+   case ir_unop_u2u64:
+   case ir_unop_b2i64:
+   case ir_unop_b2u64: {
+  st_src_reg temp = get_temp(glsl_type::uvec4_type);
+  st_dst_reg temp_dst = st_dst_reg(temp);
+  unsigned orig_swz = op[0].swizzle;
+  /*
+   * To convert unsigned to 64-bit:
+   * zero Y channel, copy X channel.
+   */
+  temp_dst.writemask = WRITEMASK_Y;
+  if (vector_elements > 1)
+ temp_dst.writemask |= WRITEMASK_W;
+  emit_asm(ir, TGSI_OPCODE_MOV, temp_dst, st_src_reg_for_int(0));
+  temp_dst.writemask = WRITEMASK_X;
+  if (vector_elements > 1)
+  temp_dst.writemask |= WRITEMASK_Z;
+  op[0].swizzle = MAKE_SWIZZLE4(GET_SWZ(orig_swz, 0),
GET_SWZ(orig_swz, 0),
+GET_SWZ(orig_swz, 1),
GET_SWZ(orig_swz, 1));
+  if (ir->operation == ir_unop_u2i64 || ir->operation ==
ir_unop_u2u64)
+ emit_asm(ir, TGSI_OPCODE_MOV, temp_dst, op[0]);
+  else
+ emit_asm(ir, TGSI_OPCODE_AND, temp_dst, op[0],
st_src_reg_for_int(1));
+  result_src = temp;
+  result_src.type = GLSL_TYPE_UINT64;
+  if (vector_elements > 2) {
+ st_src_reg temp = get_temp(glsl_type::uvec4_type);
+ st_dst_reg temp_dst = st_dst_reg(temp);
+ temp_dst.writemask = WRITEMASK_Y;
+ if (vector_elements > 3)
+temp_dst.writemask |= WRITEMASK_W;
+ emit_asm(ir, TGSI_OPCODE_MOV, temp_dst, st_src_reg_for_int(0));
+
+ temp_dst.writemask = WRITEMASK_X;
+ if (vector_elements > 3)
+temp_dst.writemask |= WRITEMASK_Z;
+ op[0].swizzle = MAKE_SWIZZLE4(GET_SWZ(orig_swz, 2),
GET_SWZ(orig_swz, 2),
+   GET_SWZ(orig_swz, 3),
GET_SWZ(orig_swz, 3));
+ if (ir->operation == ir_unop_u2i64 || ir->operation ==
ir_unop_u2u64)
+emit_asm(ir, TGSI_OPCODE_MOV, temp_dst, op[0]);
+ else
+emit_asm(ir, TGSI_OPCODE_AND, temp_dst, op[0],
st_src_reg_for_int(1));
+  }
+  break;
+   }


This part is suspicious. It looks like the top two vector elements are
written into a temporary register that isn't used anywhere.


Uh... I have no idea about this code. :)  All of the Gallium patches
were written by Dave, and I've just been rebasing them.


Sure, no problem. I can take care of those patches when the rest of the 
series lands, I'd just ask you not to push them as-is. Especially the 
pipe cap patch _really_ shouldn't land in master as-is :)


Thanks,
Nicolai
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/7] GLSL: Lowering small conditional branches

2016-11-15 Thread Nicolai Hähnle

On 12.11.2016 20:34, Marek Olšák wrote:

On Wed, Nov 2, 2016 at 10:33 PM, Marek Olšák  wrote:

On Wed, Nov 2, 2016 at 3:02 PM, Nicolai Hähnle  wrote:

Patches 1, 2, 4 - 6:

Reviewed-by: Nicolai Hähnle 


Thanks.



I have one pending LLVM patch related to indirect addressing. Not sure if
that's related to the regressions, but it may be.


LLVM master fixes all but one regression. It's:

spec@glsl-1.10@execution@variable-indexing@vs-output-array-vec3-index-wr


Nicolai, is that regression OK with you? The decrease in spilling is
worth it. There is no CTS regression. Can I get Rbs for patches 3 & 7?


Yes, I understand the point of patch #3 now, and as for the regression, 
it might actually be similar to another problem I'm looking at right 
now. You can add my R-b for 3 & 7 as well.


Nicolai



Thanks,
Marek


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


Re: [Mesa-dev] [PATCH 3/3] radeonsi: set unsafe fpmath on FP instructions when allowed by R600_DEBUG

2016-11-15 Thread Nicolai Hähnle

For the series:

Reviewed-by: Nicolai Hähnle 

On 13.11.2016 17:13, Marek Olšák wrote:

From: Marek Olšák 

---
 src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c 
b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
index 624a167..2f38949 100644
--- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
+++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
@@ -15,20 +15,21 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  * USE OR OTHER DEALINGS IN THE SOFTWARE.
  */

 #include "si_shader_internal.h"
+#include "si_pipe.h"
 #include "radeon/radeon_elf_util.h"

 #include "gallivm/lp_bld_const.h"
 #include "gallivm/lp_bld_gather.h"
 #include "gallivm/lp_bld_flow.h"
 #include "gallivm/lp_bld_init.h"
 #include "gallivm/lp_bld_intr.h"
 #include "gallivm/lp_bld_misc.h"
 #include "gallivm/lp_bld_swizzle.h"
 #include "tgsi/tgsi_info.h"
@@ -1239,21 +1240,24 @@ void si_llvm_context_init(struct si_shader_context *ctx,
memset(ctx, 0, sizeof(*ctx));
ctx->shader = shader;
ctx->screen = sscreen;
ctx->tm = tm;
ctx->type = info ? info->processor : -1;

ctx->gallivm.context = LLVMContextCreate();
ctx->gallivm.module = LLVMModuleCreateWithNameInContext("tgsi",
ctx->gallivm.context);
LLVMSetTarget(ctx->gallivm.module, "amdgcn--");
-   ctx->gallivm.builder = LLVMCreateBuilderInContext(ctx->gallivm.context);
+
+   bool unsafe_fpmath = (sscreen->b.debug_flags & DBG_UNSAFE_MATH) != 0;
+   ctx->gallivm.builder = lp_create_builder(ctx->gallivm.context,
+unsafe_fpmath);

struct lp_build_tgsi_context *bld_base = &ctx->soa.bld_base;

bld_base->info = info;

if (info && info->array_max[TGSI_FILE_TEMPORARY] > 0) {
int size = info->array_max[TGSI_FILE_TEMPORARY];

ctx->temp_arrays = CALLOC(size, sizeof(ctx->temp_arrays[0]));
ctx->temp_array_allocas = CALLOC(size, 
sizeof(ctx->temp_array_allocas[0]));


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


Re: [Mesa-dev] [PATCH v3] meta/GetTexSubImage: Account for GL_PACK_SKIP_IMAGES on compressed textures

2016-11-15 Thread Kenneth Graunke
On Tuesday, November 15, 2016 9:27:00 AM PST Eduardo Lima Mitev wrote:
> On 11/15/2016 12:25 AM, Kenneth Graunke wrote:
> > From: Eduardo Lima Mitev 
> >
> > This option was being ignored when packing compressed 3D and cube textures.
> >
> > Fixes CTS test (on gen8+):
> > * GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore
> >
> > v2: Drop API checks.
> > v3 (Ken): Just apply the existing code in more cases.
> > ---
> >  src/mesa/drivers/common/meta.c | 20 +---
> >  1 file changed, 17 insertions(+), 3 deletions(-)
> >
> > Hey Eduardo,
> >
> > It looks like the existing code already tries to handle SkipImages - but
> > we weren't applying it for 3D and cubemap textures.  I found a spec quote
> > in the narrative for GetTexImage that indicates we need to do it for those
> > as well.
> >
> > What do you think of this version?  I preserved your authorship as I wanted
> > you to get the credit for this bugfix - I just typed it up so that I could
> > make sure it actually fixed the test, and since I had it typed up, I figured
> > I'd send it out to save you some time...
> >
> 
> Hi Kenneth,
> 
> Great, this is the correct solution. I tried to make my original patch 
> work with _mesa_image_address3d() for all targets, as yours, but I 
> missed resetting SkipPixels and SkipRows for TEXTURE_3D, so it was 
> regressing some subcases.
> 
> Patch is:
> 
> Reviewed-by: Eduardo Lima Mitev 
> 
> I don't mind you taking authorship. Knowing the correct solution is way 
> more useful to me :). If you want, take the authorship, put my R-b and 
> push; otherwise let me know and I'll put your R-b and push it myself.
> 
> Thanks!
> 
> Eduardo

Reviewed-by: Kenneth Graunke 

Go ahead and push it :) Thanks!


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


Re: [Mesa-dev] [PATCH v3] meta/GetTexSubImage: Account for GL_PACK_SKIP_IMAGES on compressed textures

2016-11-15 Thread Nicolai Hähnle

On 15.11.2016 09:27, Eduardo Lima Mitev wrote:

On 11/15/2016 12:25 AM, Kenneth Graunke wrote:

From: Eduardo Lima Mitev 

This option was being ignored when packing compressed 3D and cube
textures.

Fixes CTS test (on gen8+):
* GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore

v2: Drop API checks.
v3 (Ken): Just apply the existing code in more cases.
---
 src/mesa/drivers/common/meta.c | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

Hey Eduardo,

It looks like the existing code already tries to handle SkipImages - but
we weren't applying it for 3D and cubemap textures.  I found a spec quote
in the narrative for GetTexImage that indicates we need to do it for
those
as well.

What do you think of this version?  I preserved your authorship as I
wanted
you to get the credit for this bugfix - I just typed it up so that I
could
make sure it actually fixed the test, and since I had it typed up, I
figured
I'd send it out to save you some time...



Hi Kenneth,

Great, this is the correct solution. I tried to make my original patch
work with _mesa_image_address3d() for all targets, as yours, but I
missed resetting SkipPixels and SkipRows for TEXTURE_3D, so it was
regressing some subcases.


For what it's worth, there's also _mesa_image_address which takes a 
dimensions parameter and automatically applies / doesn't apply 
SkipImages. But since you do manual fixups of SkipPixels/SkipRows 
anyway, it might not be the right thing here.


Cheers,
Nicolai



Patch is:

Reviewed-by: Eduardo Lima Mitev 

I don't mind you taking authorship. Knowing the correct solution is way
more useful to me :). If you want, take the authorship, put my R-b and
push; otherwise let me know and I'll put your R-b and push it myself.

Thanks!

Eduardo


 --Ken

diff --git a/src/mesa/drivers/common/meta.c
b/src/mesa/drivers/common/meta.c
index 5ab1e6c..99c85cf 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3243,8 +3243,20 @@ _mesa_meta_GetTexSubImage(struct gl_context *ctx,

   for (slice = 0; slice < depth; slice++) {
  void *dst;
- if (texImage->TexObject->Target == GL_TEXTURE_2D_ARRAY
- || texImage->TexObject->Target ==
GL_TEXTURE_CUBE_MAP_ARRAY) {
+ /* Section 8.11.4 (Texture Image Queries) of the GL 4.5 spec
says:
+  *
+  *"For three-dimensional, two-dimensional array, cube
map array,
+  * and cube map textures pixel storage operations are
applied as
+  * if the image were two-dimensional, except that the
additional
+  * pixel storage state values PACK_IMAGE_HEIGHT and
+  * PACK_SKIP_IMAGES are applied. The correspondence of
texels to
+  * memory locations is as defined for TexImage3D in
section 8.5."
+  */
+ switch (texImage->TexObject->Target) {
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_CUBE_MAP_ARRAY: {
 /* Setup pixel packing.  SkipPixels and SkipRows will be
applied
  * in the decompress_texture_image() function's call to
  * glReadPixels but we need to compute the dest slice's
address
@@ -3255,9 +3267,11 @@ _mesa_meta_GetTexSubImage(struct gl_context *ctx,
 packing.SkipRows = 0;
 dst = _mesa_image_address3d(&packing, pixels, width, height,
 format, type, slice, 0, 0);
+break;
  }
- else {
+ default:
 dst = pixels;
+break;
  }
  result = decompress_texture_image(ctx, texImage, slice,
xoffset, yoffset, width,
height,



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

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


[Mesa-dev] [PATCH] intel: Set min_ds_entries on Broxton.

2016-11-15 Thread Kenneth Graunke
This was missing.

Signed-off-by: Kenneth Graunke 
---
 src/intel/common/gen_device_info.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/intel/common/gen_device_info.c 
b/src/intel/common/gen_device_info.c
index 1dc1769..c7b8e56 100644
--- a/src/intel/common/gen_device_info.c
+++ b/src/intel/common/gen_device_info.c
@@ -391,6 +391,7 @@ static const struct gen_device_info gen_device_info_bxt = {
.urb = {
   .size = 192,
   .min_vs_entries = 34,
+  .min_ds_entries = 34,
   .max_vs_entries = 704,
   .max_tcs_entries = 256,
   .max_tes_entries = 416,
@@ -413,6 +414,7 @@ static const struct gen_device_info gen_device_info_bxt_2x6 
= {
.urb = {
   .size = 128,
   .min_vs_entries = 34,
+  .min_ds_entries = 34,
   .max_vs_entries = 352,
   .max_tcs_entries = 128,
   .max_tes_entries = 208,
-- 
2.10.2

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


[Mesa-dev] [PATCH v2] mesa: add NV_image_formats extension support

2016-11-15 Thread Lionel Landwerlin
v2: Replace helper function by qualifier struct field (Ilia)
Enable NV_image_formats using ARB_shader_image_load_store (Ilia)

Signed-off-by: Lionel Landwerlin 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98480
Cc: Ilia Mirkin 
---
 src/compiler/glsl/glsl_parser.yy | 86 +---
 src/compiler/glsl/glsl_parser_extras.cpp |  2 +
 src/compiler/glsl/glsl_parser_extras.h   |  2 +
 src/mesa/main/extensions_table.h |  1 +
 src/mesa/main/mtypes.h   |  1 +
 src/mesa/main/shaderimage.c  | 22 +---
 6 files changed, 67 insertions(+), 47 deletions(-)

diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index 7d709c7..a48dc68 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -1296,51 +1296,55 @@ layout_qualifier_id:
unsigned required_glsl;
/** Minimum GLSL ES version required for the image format. */
unsigned required_essl;
+   /* NV_image_formats */
+   bool nv_image_formats;
 } map[] = {
-   { "rgba32f", GL_RGBA32F, GLSL_TYPE_FLOAT, 130, 310 },
-   { "rgba16f", GL_RGBA16F, GLSL_TYPE_FLOAT, 130, 310 },
-   { "rg32f", GL_RG32F, GLSL_TYPE_FLOAT, 130, 0 },
-   { "rg16f", GL_RG16F, GLSL_TYPE_FLOAT, 130, 0 },
-   { "r11f_g11f_b10f", GL_R11F_G11F_B10F, GLSL_TYPE_FLOAT, 130, 0 
},
-   { "r32f", GL_R32F, GLSL_TYPE_FLOAT, 130, 310 },
-   { "r16f", GL_R16F, GLSL_TYPE_FLOAT, 130, 0 },
-   { "rgba32ui", GL_RGBA32UI, GLSL_TYPE_UINT, 130, 310 },
-   { "rgba16ui", GL_RGBA16UI, GLSL_TYPE_UINT, 130, 310 },
-   { "rgb10_a2ui", GL_RGB10_A2UI, GLSL_TYPE_UINT, 130, 0 },
-   { "rgba8ui", GL_RGBA8UI, GLSL_TYPE_UINT, 130, 310 },
-   { "rg32ui", GL_RG32UI, GLSL_TYPE_UINT, 130, 0 },
-   { "rg16ui", GL_RG16UI, GLSL_TYPE_UINT, 130, 0 },
-   { "rg8ui", GL_RG8UI, GLSL_TYPE_UINT, 130, 0 },
-   { "r32ui", GL_R32UI, GLSL_TYPE_UINT, 130, 310 },
-   { "r16ui", GL_R16UI, GLSL_TYPE_UINT, 130, 0 },
-   { "r8ui", GL_R8UI, GLSL_TYPE_UINT, 130, 0 },
-   { "rgba32i", GL_RGBA32I, GLSL_TYPE_INT, 130, 310 },
-   { "rgba16i", GL_RGBA16I, GLSL_TYPE_INT, 130, 310 },
-   { "rgba8i", GL_RGBA8I, GLSL_TYPE_INT, 130, 310 },
-   { "rg32i", GL_RG32I, GLSL_TYPE_INT, 130, 0 },
-   { "rg16i", GL_RG16I, GLSL_TYPE_INT, 130, 0 },
-   { "rg8i", GL_RG8I, GLSL_TYPE_INT, 130, 0 },
-   { "r32i", GL_R32I, GLSL_TYPE_INT, 130, 310 },
-   { "r16i", GL_R16I, GLSL_TYPE_INT, 130, 0 },
-   { "r8i", GL_R8I, GLSL_TYPE_INT, 130, 0 },
-   { "rgba16", GL_RGBA16, GLSL_TYPE_FLOAT, 130, 0 },
-   { "rgb10_a2", GL_RGB10_A2, GLSL_TYPE_FLOAT, 130, 0 },
-   { "rgba8", GL_RGBA8, GLSL_TYPE_FLOAT, 130, 310 },
-   { "rg16", GL_RG16, GLSL_TYPE_FLOAT, 130, 0 },
-   { "rg8", GL_RG8, GLSL_TYPE_FLOAT, 130, 0 },
-   { "r16", GL_R16, GLSL_TYPE_FLOAT, 130, 0 },
-   { "r8", GL_R8, GLSL_TYPE_FLOAT, 130, 0 },
-   { "rgba16_snorm", GL_RGBA16_SNORM, GLSL_TYPE_FLOAT, 130, 0 },
-   { "rgba8_snorm", GL_RGBA8_SNORM, GLSL_TYPE_FLOAT, 130, 310 },
-   { "rg16_snorm", GL_RG16_SNORM, GLSL_TYPE_FLOAT, 130, 0 },
-   { "rg8_snorm", GL_RG8_SNORM, GLSL_TYPE_FLOAT, 130, 0 },
-   { "r16_snorm", GL_R16_SNORM, GLSL_TYPE_FLOAT, 130, 0 },
-   { "r8_snorm", GL_R8_SNORM, GLSL_TYPE_FLOAT, 130, 0 }
+   { "rgba32f", GL_RGBA32F, GLSL_TYPE_FLOAT, 130, 310, false },
+   { "rgba16f", GL_RGBA16F, GLSL_TYPE_FLOAT, 130, 310, false },
+   { "rg32f", GL_RG32F, GLSL_TYPE_FLOAT, 130, 0, true },
+   { "rg16f", GL_RG16F, GLSL_TYPE_FLOAT, 130, 0, true },
+   { "r11f_g11f_b10f", GL_R11F_G11F_B10F, GLSL_TYPE_FLOAT, 130, 0, 
true },
+   { "r32f", GL_R32F, GLSL_TYPE_FLOAT, 130, 310, false },
+   { "r16f", GL_R16F, GLSL_TYPE_FLOAT, 130, 0, true },
+   { "rgba32ui", GL_RGBA32UI, GLSL_TYPE_UINT, 130, 310, false },
+   { "rgba16ui", GL_RGBA16UI, GLSL_TYPE_UINT, 130, 310, false },
+   { "rgb10_a2ui", GL_RGB10_A2UI, GLSL_TYPE_UINT, 130, 0, true },
+   { "rgba8ui", GL_RGBA8UI, GLSL_TYPE_UINT, 130, 310, false },
+   { "rg32ui", GL_RG32UI, GLSL_TYPE_UINT, 130, 0, true },
+   { "rg16ui", GL_RG16UI, GLSL_TYPE_UINT, 130, 0, true },
+   { "rg8ui", GL_RG8UI, GLSL_TYPE_UINT, 130, 0, true },
+   { "r32ui", GL_R32UI, GLSL_TYPE_UINT, 130, 310, false },
+   { "r16ui", GL_R16UI, GLSL_TYPE_UINT, 130, 0, true },
+   { "r8ui", GL_R8UI, GLSL_TYPE_UINT, 130, 0, true },
+   { "rgba32i

[Mesa-dev] [Bug 98629] OpenGL applications warns "MESA-LOADER: failed to retrieve device information"

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98629

Emil Velikov  changed:

   What|Removed |Added

Product|Mesa|DRI
 Resolution|--- |FIXED
   Assignee|mesa-dev@lists.freedesktop. |dri-devel@lists.freedesktop
   |org |.org
 Status|NEW |RESOLVED
  Component|Mesa core   |libdrm
Version|13.0|unspecified
 QA Contact|mesa-dev@lists.freedesktop. |
   |org |

--- Comment #6 from Emil Velikov  ---
Fixed with the following commit, which is part of libdrm 2.4.73.
Thanks for the report and testing !

commit f53d3542c1dfa2a1c1a5a7155d058df9a6bcce7b
Author: Emil Velikov 
Date:   Fri Nov 11 19:04:11 2016 +

xd86drm: read more than 128 bytes of uevent in drmParsePciBusInfo

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


Re: [Mesa-dev] [PATCH v3] meta/GetTexSubImage: Account for GL_PACK_SKIP_IMAGES on compressed textures

2016-11-15 Thread Eduardo Lima Mitev
On 11/15/2016 11:03 AM, Nicolai Hähnle wrote:
> On 15.11.2016 09:27, Eduardo Lima Mitev wrote:
>> On 11/15/2016 12:25 AM, Kenneth Graunke wrote:
>>> From: Eduardo Lima Mitev 
>>>
>>> This option was being ignored when packing compressed 3D and cube
>>> textures.
>>>
>>> Fixes CTS test (on gen8+):
>>> * GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore
>>>
>>> v2: Drop API checks.
>>> v3 (Ken): Just apply the existing code in more cases.
>>> ---
>>>  src/mesa/drivers/common/meta.c | 20 +---
>>>  1 file changed, 17 insertions(+), 3 deletions(-)
>>>
>>> Hey Eduardo,
>>>
>>> It looks like the existing code already tries to handle SkipImages - but
>>> we weren't applying it for 3D and cubemap textures.  I found a spec
>>> quote
>>> in the narrative for GetTexImage that indicates we need to do it for
>>> those
>>> as well.
>>>
>>> What do you think of this version?  I preserved your authorship as I
>>> wanted
>>> you to get the credit for this bugfix - I just typed it up so that I
>>> could
>>> make sure it actually fixed the test, and since I had it typed up, I
>>> figured
>>> I'd send it out to save you some time...
>>>
>>
>> Hi Kenneth,
>>
>> Great, this is the correct solution. I tried to make my original patch
>> work with _mesa_image_address3d() for all targets, as yours, but I
>> missed resetting SkipPixels and SkipRows for TEXTURE_3D, so it was
>> regressing some subcases.
> 
> For what it's worth, there's also _mesa_image_address which takes a
> dimensions parameter and automatically applies / doesn't apply
> SkipImages. But since you do manual fixups of SkipPixels/SkipRows
> anyway, it might not be the right thing here.
>

Yes, we could use _mesa_image_address() directly, but I think it is more
legible to call mesa_image_address3d(), because it is consistent with
the purpose of this code-path and the comment in it, being for
dimensions >2.

Thanks,
Eduardo

> Cheers,
> Nicolai
> 
>>
>> Patch is:
>>
>> Reviewed-by: Eduardo Lima Mitev 
>>
>> I don't mind you taking authorship. Knowing the correct solution is way
>> more useful to me :). If you want, take the authorship, put my R-b and
>> push; otherwise let me know and I'll put your R-b and push it myself.
>>
>> Thanks!
>>
>> Eduardo
>>
>>>  --Ken
>>>
>>> diff --git a/src/mesa/drivers/common/meta.c
>>> b/src/mesa/drivers/common/meta.c
>>> index 5ab1e6c..99c85cf 100644
>>> --- a/src/mesa/drivers/common/meta.c
>>> +++ b/src/mesa/drivers/common/meta.c
>>> @@ -3243,8 +3243,20 @@ _mesa_meta_GetTexSubImage(struct gl_context *ctx,
>>>
>>>for (slice = 0; slice < depth; slice++) {
>>>   void *dst;
>>> - if (texImage->TexObject->Target == GL_TEXTURE_2D_ARRAY
>>> - || texImage->TexObject->Target ==
>>> GL_TEXTURE_CUBE_MAP_ARRAY) {
>>> + /* Section 8.11.4 (Texture Image Queries) of the GL 4.5 spec
>>> says:
>>> +  *
>>> +  *"For three-dimensional, two-dimensional array, cube
>>> map array,
>>> +  * and cube map textures pixel storage operations are
>>> applied as
>>> +  * if the image were two-dimensional, except that the
>>> additional
>>> +  * pixel storage state values PACK_IMAGE_HEIGHT and
>>> +  * PACK_SKIP_IMAGES are applied. The correspondence of
>>> texels to
>>> +  * memory locations is as defined for TexImage3D in
>>> section 8.5."
>>> +  */
>>> + switch (texImage->TexObject->Target) {
>>> + case GL_TEXTURE_3D:
>>> + case GL_TEXTURE_2D_ARRAY:
>>> + case GL_TEXTURE_CUBE_MAP:
>>> + case GL_TEXTURE_CUBE_MAP_ARRAY: {
>>>  /* Setup pixel packing.  SkipPixels and SkipRows will be
>>> applied
>>>   * in the decompress_texture_image() function's call to
>>>   * glReadPixels but we need to compute the dest slice's
>>> address
>>> @@ -3255,9 +3267,11 @@ _mesa_meta_GetTexSubImage(struct gl_context *ctx,
>>>  packing.SkipRows = 0;
>>>  dst = _mesa_image_address3d(&packing, pixels, width,
>>> height,
>>>  format, type, slice, 0, 0);
>>> +break;
>>>   }
>>> - else {
>>> + default:
>>>  dst = pixels;
>>> +break;
>>>   }
>>>   result = decompress_texture_image(ctx, texImage, slice,
>>> xoffset, yoffset, width,
>>> height,
>>>
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 

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


Re: [Mesa-dev] [PATCH v3] meta/GetTexSubImage: Account for GL_PACK_SKIP_IMAGES on compressed textures

2016-11-15 Thread Eduardo Lima Mitev
On 11/15/2016 10:58 AM, Kenneth Graunke wrote:
> On Tuesday, November 15, 2016 9:27:00 AM PST Eduardo Lima Mitev wrote:
>> On 11/15/2016 12:25 AM, Kenneth Graunke wrote:
>>> From: Eduardo Lima Mitev 
>>>
>>> This option was being ignored when packing compressed 3D and cube textures.
>>>
>>> Fixes CTS test (on gen8+):
>>> * GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore
>>>
>>> v2: Drop API checks.
>>> v3 (Ken): Just apply the existing code in more cases.
>>> ---
>>>  src/mesa/drivers/common/meta.c | 20 +---
>>>  1 file changed, 17 insertions(+), 3 deletions(-)
>>>
>>> Hey Eduardo,
>>>
>>> It looks like the existing code already tries to handle SkipImages - but
>>> we weren't applying it for 3D and cubemap textures.  I found a spec quote
>>> in the narrative for GetTexImage that indicates we need to do it for those
>>> as well.
>>>
>>> What do you think of this version?  I preserved your authorship as I wanted
>>> you to get the credit for this bugfix - I just typed it up so that I could
>>> make sure it actually fixed the test, and since I had it typed up, I figured
>>> I'd send it out to save you some time...
>>>
>>
>> Hi Kenneth,
>>
>> Great, this is the correct solution. I tried to make my original patch 
>> work with _mesa_image_address3d() for all targets, as yours, but I 
>> missed resetting SkipPixels and SkipRows for TEXTURE_3D, so it was 
>> regressing some subcases.
>>
>> Patch is:
>>
>> Reviewed-by: Eduardo Lima Mitev 
>>
>> I don't mind you taking authorship. Knowing the correct solution is way 
>> more useful to me :). If you want, take the authorship, put my R-b and 
>> push; otherwise let me know and I'll put your R-b and push it myself.
>>
>> Thanks!
>>
>> Eduardo
> 
> Reviewed-by: Kenneth Graunke 
> 
> Go ahead and push it :) Thanks!
> 

Pushed, thanks Ken!
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] nir/spirv: implement ordered / unordered floating point comparisons properly

2016-11-15 Thread Iago Toral Quiroga
Besides the logical operation involved, these also require that we test if the
operands are ordered / unordered.

For ordered operations, both operands must be ordered (and they must pass the
conditional test) while for unordered operations it is sufficient if only one
of the operands is unordered (or they pass the logical test).

Fixes the following Vulkan CTS tests:

dEQP-VK.spirv_assembly.instruction.compute.opfunord.equal
dEQP-VK.spirv_assembly.instruction.compute.opfunord.greater
dEQP-VK.spirv_assembly.instruction.compute.opfunord.greaterequal
dEQP-VK.spirv_assembly.instruction.compute.opfunord.less
dEQP-VK.spirv_assembly.instruction.compute.opfunord.lessequal
---
 src/compiler/spirv/vtn_alu.c | 54 +++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c
index 6d98a62..a2c7a88 100644
--- a/src/compiler/spirv/vtn_alu.c
+++ b/src/compiler/spirv/vtn_alu.c
@@ -257,7 +257,10 @@ vtn_nir_alu_op_for_spirv_opcode(SpvOp opcode, bool *swap)
case SpvOpBitReverse:return nir_op_bitfield_reverse;
case SpvOpBitCount:  return nir_op_bit_count;
 
-   /* Comparisons: (TODO: How do we want to handled ordered/unordered?) */
+   /* The ordered / unordered operators need special implementation besides
+* the logical operator to use since they also need to check if operands are
+* ordered.
+*/
case SpvOpFOrdEqual:return nir_op_feq;
case SpvOpFUnordEqual:  return nir_op_feq;
case SpvOpINotEqual:return nir_op_ine;
@@ -447,6 +450,55 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
   nir_imm_float(&b->nb, INFINITY));
   break;
 
+
+   case SpvOpFUnordEqual:
+   case SpvOpFUnordNotEqual:
+   case SpvOpFUnordLessThan:
+   case SpvOpFUnordGreaterThan:
+   case SpvOpFUnordLessThanEqual:
+   case SpvOpFUnordGreaterThanEqual: {
+  bool swap;
+  nir_op op = vtn_nir_alu_op_for_spirv_opcode(opcode, &swap);
+
+  if (swap) {
+ nir_ssa_def *tmp = src[0];
+ src[0] = src[1];
+ src[1] = tmp;
+  }
+
+  val->ssa->def =
+ nir_ior(&b->nb,
+ nir_build_alu(&b->nb, op, src[0], src[1], NULL, NULL),
+ nir_ior(&b->nb,
+ nir_fne(&b->nb, src[0], src[0]),
+ nir_fne(&b->nb, src[1], src[1])));
+  break;
+   }
+
+   case SpvOpFOrdEqual:
+   case SpvOpFOrdNotEqual:
+   case SpvOpFOrdLessThan:
+   case SpvOpFOrdGreaterThan:
+   case SpvOpFOrdLessThanEqual:
+   case SpvOpFOrdGreaterThanEqual: {
+  bool swap;
+  nir_op op = vtn_nir_alu_op_for_spirv_opcode(opcode, &swap);
+
+  if (swap) {
+ nir_ssa_def *tmp = src[0];
+ src[0] = src[1];
+ src[1] = tmp;
+  }
+
+  val->ssa->def =
+ nir_iand(&b->nb,
+  nir_build_alu(&b->nb, op, src[0], src[1], NULL, NULL),
+  nir_iand(&b->nb,
+  nir_eq(&b->nb, src[0], src[0]),
+  nir_eq(&b->nb, src[1], src[1])));
+  break;
+   }
+
default: {
   bool swap;
   nir_op op = vtn_nir_alu_op_for_spirv_opcode(opcode, &swap);
-- 
2.7.4

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


[Mesa-dev] [PATCH 01/13] egl: return error for unknown EGLImage attributes

2016-11-15 Thread Varad Gautam
From: Pekka Paalanen 

Commit 0135e5d6c83add5e539492a4899504e33f3f2434 "egl: Add support for
more EGLImage extensions to EGL core." removed an error code for unknown
EGLImage attributes without explaining why.

EGL_KHR_image_base says:

   * If an attribute specified in  is not one of the
 attributes listed in Table bbb, the error EGL_BAD_PARAMETER is
 generated.

Implement this.

Signed-off-by: Pekka Paalanen 
Signed-off-by: Varad Gautam 
CC: 
---
 src/egl/main/eglimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/egl/main/eglimage.c b/src/egl/main/eglimage.c
index 818b597..411d1ca 100644
--- a/src/egl/main/eglimage.c
+++ b/src/egl/main/eglimage.c
@@ -170,7 +170,7 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, 
_EGLDisplay *dpy,
  break;
 
   default:
- /* unknown attrs are ignored */
+ err = EGL_BAD_PARAMETER;
  break;
   }
 
-- 
2.6.2

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


[Mesa-dev] [PATCH 03/13] egl: update eglext.h

2016-11-15 Thread Varad Gautam
From: Varad Gautam 

update eglext.h to revision 33288 from Khronos

Signed-off-by: Varad Gautam 
---
 include/EGL/eglext.h | 60 ++--
 1 file changed, 58 insertions(+), 2 deletions(-)

diff --git a/include/EGL/eglext.h b/include/EGL/eglext.h
index 4ccbab8..762b5a6 100644
--- a/include/EGL/eglext.h
+++ b/include/EGL/eglext.h
@@ -33,12 +33,12 @@ extern "C" {
 ** used to make the header, and the header can be found at
 **   http://www.opengl.org/registry/
 **
-** Khronos $Revision$ on $Date$
+** Khronos $Revision: 33288 $ on $Date: 2016-11-09 17:46:01 -0800 (Wed, 09 Nov 
2016) $
 */
 
 #include 
 
-#define EGL_EGLEXT_VERSION 20160809
+#define EGL_EGLEXT_VERSION 20161109
 
 /* Generated C header for:
  * API: egl
@@ -77,6 +77,13 @@ EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay 
dpy, EGLenum type,
 #define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR   0x0040
 #endif /* EGL_KHR_config_attribs */
 
+#ifndef EGL_KHR_context_flush_control
+#define EGL_KHR_context_flush_control 1
+#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0
+#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR  0x2097
+#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098
+#endif /* EGL_KHR_context_flush_control */
+
 #ifndef EGL_KHR_create_context
 #define EGL_KHR_create_context 1
 #define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098
@@ -343,6 +350,24 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR 
(EGLDisplay dpy, EGLStreamKHR
 #endif /* KHRONOS_SUPPORT_INT64 */
 #endif /* EGL_KHR_stream */
 
+#ifndef EGL_KHR_stream_attrib
+#define EGL_KHR_stream_attrib 1
+#ifdef KHRONOS_SUPPORT_INT64
+typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMATTRIBKHRPROC) 
(EGLDisplay dpy, const EGLAttrib *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSTREAMATTRIBKHRPROC) (EGLDisplay 
dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMATTRIBKHRPROC) (EGLDisplay 
dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib *value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC) 
(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC) 
(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamAttribKHR (EGLDisplay dpy, 
const EGLAttrib *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglSetStreamAttribKHR (EGLDisplay dpy, 
EGLStreamKHR stream, EGLenum attribute, EGLAttrib value);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamAttribKHR (EGLDisplay dpy, 
EGLStreamKHR stream, EGLenum attribute, EGLAttrib *value);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireAttribKHR (EGLDisplay 
dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseAttribKHR (EGLDisplay 
dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
+#endif
+#endif /* KHRONOS_SUPPORT_INT64 */
+#endif /* EGL_KHR_stream_attrib */
+
 #ifndef EGL_KHR_stream_consumer_gltexture
 #define EGL_KHR_stream_consumer_gltexture 1
 #ifdef EGL_KHR_stream
@@ -520,6 +545,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE 
(EGLDisplay dpy, EGLSu
 #define EGL_FIXED_SIZE_ANGLE  0x3201
 #endif /* EGL_ANGLE_window_fixed_size */
 
+#ifndef EGL_ARM_implicit_external_sync
+#define EGL_ARM_implicit_external_sync 1
+#define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A
+#endif /* EGL_ARM_implicit_external_sync */
+
 #ifndef EGL_ARM_pixmap_multisample_discard
 #define EGL_ARM_pixmap_multisample_discard 1
 #define EGL_DISCARD_SAMPLES_ARM   0x3286
@@ -604,6 +634,27 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT 
(EGLDisplay dpy, EGLint a
 #define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285
 #endif /* EGL_EXT_image_dma_buf_import */
 
+#ifndef EGL_EXT_image_dma_buf_import_modifiers
+#define EGL_EXT_image_dma_buf_import_modifiers 1
+#define EGL_DMA_BUF_PLANE3_FD_EXT 0x3440
+#define EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441
+#define EGL_DMA_BUF_PLANE3_PITCH_EXT  0x3442
+#define EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443
+#define EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444
+#define EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445
+#define EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446
+#define EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447
+#define EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448
+#define EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449
+#define EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFFORMATSEXTPROC) (EGLDisplay 
dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFMODIFIERSEXTPROC) 
(EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, 
EGLBoolean *external_only, EGLint *num_modifiers);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryDmaBufFormatsEXT (EGLDisplay dpy,

[Mesa-dev] [PATCH 00/13] implement EGL_EXT_image_dma_buf_import_modifiers

2016-11-15 Thread Varad Gautam
Hello,

This series implements EGL_EXT_image_dma_buf_import_modifiers [1] which makes
it possible to pass drm fourcc modifiers to EGL when importing dmabufs.

[1] 
https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt

Pekka Paalanen (5):
  egl: return error for unknown EGLImage attributes
  egl: introduce DMA_BUF_MAX_PLANES
  egl/main: add support for fourth plane tokens
  dri: support DRIimage creation from dmabufs with modifiers
  egl_dri2: add support for using modifier attributes in
eglCreateImageKHR

Varad Gautam (8):
  egl: update eglext.h
  st/dri: implement DRIimage creation from dmabufs with modifiers
  egl: implement eglQueryDmaBufFormatsEXT
  dri: add queryDmaBufModifiers to DRIimage
  gallium: introduce format modifier querying
  st/dri: support format modifier queries
  egl: implement eglQueryDmaBufModifiersEXT
  egl: advertise EGL_EXT_image_dma_buf_import_modifiers

 include/EGL/eglext.h |  60 ++-
 include/GL/internal/dri_interface.h  |  31 +++-
 src/egl/drivers/dri2/egl_dri2.c  | 209 +--
 src/egl/main/eglapi.c|  41 +
 src/egl/main/eglapi.h|   9 +
 src/egl/main/egldisplay.h|   1 +
 src/egl/main/eglimage.c  |  63 ++-
 src/egl/main/eglimage.h  |  10 +-
 src/gallium/docs/source/screen.rst   |   2 +
 src/gallium/drivers/freedreno/freedreno_screen.c |   1 +
 src/gallium/drivers/i915/i915_screen.c   |   1 +
 src/gallium/drivers/ilo/ilo_screen.c |   1 +
 src/gallium/drivers/llvmpipe/lp_screen.c |   1 +
 src/gallium/drivers/nouveau/nv30/nv30_screen.c   |   1 +
 src/gallium/drivers/nouveau/nv50/nv50_screen.c   |   1 +
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   |   1 +
 src/gallium/drivers/r300/r300_screen.c   |   1 +
 src/gallium/drivers/r600/r600_pipe.c |   1 +
 src/gallium/drivers/radeonsi/si_pipe.c   |   1 +
 src/gallium/drivers/softpipe/sp_screen.c |   1 +
 src/gallium/drivers/svga/svga_screen.c   |   1 +
 src/gallium/drivers/swr/swr_screen.cpp   |   1 +
 src/gallium/drivers/vc4/vc4_screen.c |   1 +
 src/gallium/drivers/virgl/virgl_screen.c |   1 +
 src/gallium/include/pipe/p_defines.h |   1 +
 src/gallium/include/pipe/p_screen.h  |   7 +
 src/gallium/include/state_tracker/drm_driver.h   |   2 +
 src/gallium/state_trackers/dri/dri2.c|  63 ++-
 28 files changed, 487 insertions(+), 27 deletions(-)

-- 
2.6.2

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


[Mesa-dev] [PATCH 04/13] egl/main: add support for fourth plane tokens

2016-11-15 Thread Varad Gautam
From: Pekka Paalanen 

The EGL_EXT_dma_buf_import_modifiers extension adds support for a
fourth plane, just like DRM KMS API does.

Bump maximum dma_buf plane count to four.

Signed-off-by: Pekka Paalanen 
Signed-off-by: Varad Gautam 
---
 src/egl/drivers/dri2/egl_dri2.c |  2 +-
 src/egl/main/eglimage.c | 12 
 src/egl/main/eglimage.h |  2 +-
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 9a41ad0..58d16e1 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2038,7 +2038,7 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
 * "If  is EGL_LINUX_DMA_BUF_EXT, and the EGL_LINUX_DRM_FOURCC_EXT
 *  attribute indicates a single-plane format, EGL_BAD_ATTRIBUTE is
 *  generated if any of the EGL_DMA_BUF_PLANE1_* or EGL_DMA_BUF_PLANE2_*
-*  attributes are specified."
+*  or EGL_DMA_BUF_PLANE3_* attributes are specified."
 */
for (i = plane_n; i < DMA_BUF_MAX_PLANES; ++i) {
   if (attrs->DMABufPlaneFds[i].IsPresent ||
diff --git a/src/egl/main/eglimage.c b/src/egl/main/eglimage.c
index 411d1ca..cd170c6 100644
--- a/src/egl/main/eglimage.c
+++ b/src/egl/main/eglimage.c
@@ -133,6 +133,18 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, 
_EGLDisplay *dpy,
  attrs->DMABufPlanePitches[2].Value = val;
  attrs->DMABufPlanePitches[2].IsPresent = EGL_TRUE;
  break;
+  case EGL_DMA_BUF_PLANE3_FD_EXT:
+ attrs->DMABufPlaneFds[3].Value = val;
+ attrs->DMABufPlaneFds[3].IsPresent = EGL_TRUE;
+ break;
+  case EGL_DMA_BUF_PLANE3_OFFSET_EXT:
+ attrs->DMABufPlaneOffsets[3].Value = val;
+ attrs->DMABufPlaneOffsets[3].IsPresent = EGL_TRUE;
+ break;
+  case EGL_DMA_BUF_PLANE3_PITCH_EXT:
+ attrs->DMABufPlanePitches[3].Value = val;
+ attrs->DMABufPlanePitches[3].IsPresent = EGL_TRUE;
+ break;
   case EGL_YUV_COLOR_SPACE_HINT_EXT:
  if (val != EGL_ITU_REC601_EXT && val != EGL_ITU_REC709_EXT &&
  val != EGL_ITU_REC2020_EXT) {
diff --git a/src/egl/main/eglimage.h b/src/egl/main/eglimage.h
index 9a75d0c..2c110c7 100644
--- a/src/egl/main/eglimage.h
+++ b/src/egl/main/eglimage.h
@@ -46,7 +46,7 @@ struct _egl_image_attrib_int
EGLBoolean IsPresent;
 };
 
-#define DMA_BUF_MAX_PLANES 3
+#define DMA_BUF_MAX_PLANES 4
 
 struct _egl_image_attribs
 {
-- 
2.6.2

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


[Mesa-dev] [PATCH 09/13] dri: add queryDmaBufModifiers to DRIimage

2016-11-15 Thread Varad Gautam
From: Varad Gautam 

queryDmaBufModifiers function allows querying implementation
supported dmabuf format modifiers for a given format.

Signed-off-by: Varad Gautam 
---
 include/GL/internal/dri_interface.h | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/GL/internal/dri_interface.h 
b/include/GL/internal/dri_interface.h
index 4874e59..c3a6b3d 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1094,7 +1094,7 @@ struct __DRIdri2ExtensionRec {
  * extensions.
  */
 #define __DRI_IMAGE "DRI_IMAGE"
-#define __DRI_IMAGE_VERSION 14
+#define __DRI_IMAGE_VERSION 15
 
 
 /**
@@ -1439,6 +1439,16 @@ struct __DRIimageExtensionRec {
   enum __DRIChromaSiting vert_siting,
   unsigned *error,
   void *loaderPrivate);
+
+   /*
+* Returns modifiers supported by the driver for a given format.
+*
+* For EGL_EXT_image_dma_buf_import_modifiers.
+*
+* \since 15
+*/
+   void (*queryDmaBufModifiers)(__DRIscreen *screen, int fourcc, int max,
+uint64_t *modifiers, int *count);
 };
 
 
-- 
2.6.2

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


[Mesa-dev] [PATCH 02/13] egl: introduce DMA_BUF_MAX_PLANES

2016-11-15 Thread Varad Gautam
From: Pekka Paalanen 

Rather than hardcoding 3, use a #define. Makes it easier to bump this
later to 4.

Signed-off-by: Pekka Paalanen 
Signed-off-by: Varad Gautam 
---
 src/egl/drivers/dri2/egl_dri2.c | 8 
 src/egl/main/eglimage.h | 8 +---
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index d9e2ad7..9a41ad0 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2040,7 +2040,7 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
 *  generated if any of the EGL_DMA_BUF_PLANE1_* or EGL_DMA_BUF_PLANE2_*
 *  attributes are specified."
 */
-   for (i = plane_n; i < 3; ++i) {
+   for (i = plane_n; i < DMA_BUF_MAX_PLANES; ++i) {
   if (attrs->DMABufPlaneFds[i].IsPresent ||
   attrs->DMABufPlaneOffsets[i].IsPresent ||
   attrs->DMABufPlanePitches[i].IsPresent) {
@@ -2073,9 +2073,9 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext 
*ctx,
__DRIimage *dri_image;
unsigned num_fds;
unsigned i;
-   int fds[3];
-   int pitches[3];
-   int offsets[3];
+   int fds[DMA_BUF_MAX_PLANES];
+   int pitches[DMA_BUF_MAX_PLANES];
+   int offsets[DMA_BUF_MAX_PLANES];
unsigned error;
 
/**
diff --git a/src/egl/main/eglimage.h b/src/egl/main/eglimage.h
index 0dd5e12..9a75d0c 100644
--- a/src/egl/main/eglimage.h
+++ b/src/egl/main/eglimage.h
@@ -46,6 +46,8 @@ struct _egl_image_attrib_int
EGLBoolean IsPresent;
 };
 
+#define DMA_BUF_MAX_PLANES 3
+
 struct _egl_image_attribs
 {
/* EGL_KHR_image_base */
@@ -67,9 +69,9 @@ struct _egl_image_attribs
 
/* EGL_EXT_image_dma_buf_import */
struct _egl_image_attrib_int DMABufFourCC;
-   struct _egl_image_attrib_int DMABufPlaneFds[3];
-   struct _egl_image_attrib_int DMABufPlaneOffsets[3];
-   struct _egl_image_attrib_int DMABufPlanePitches[3];
+   struct _egl_image_attrib_int DMABufPlaneFds[DMA_BUF_MAX_PLANES];
+   struct _egl_image_attrib_int DMABufPlaneOffsets[DMA_BUF_MAX_PLANES];
+   struct _egl_image_attrib_int DMABufPlanePitches[DMA_BUF_MAX_PLANES];
struct _egl_image_attrib_int DMABufYuvColorSpaceHint;
struct _egl_image_attrib_int DMABufSampleRangeHint;
struct _egl_image_attrib_int DMABufChromaHorizontalSiting;
-- 
2.6.2

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


[Mesa-dev] [PATCH 07/13] egl_dri2: add support for using modifier attributes in eglCreateImageKHR

2016-11-15 Thread Varad Gautam
From: Pekka Paalanen 

allow creating EGLImages with dmabuf format modifiers when target is
EGL_LINUX_DMA_BUF_EXT for EGL_EXT_image_dma_buf_import_modifiers.

Signed-off-by: Pekka Paalanen 
Signed-off-by: Varad Gautam 
---
 src/egl/drivers/dri2/egl_dri2.c | 68 ++---
 src/egl/main/egldisplay.h   |  1 +
 src/egl/main/eglimage.c | 49 +
 src/egl/main/eglimage.h |  2 ++
 4 files changed, 109 insertions(+), 11 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 58d16e1..4eb1861 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1937,6 +1937,21 @@ dri2_check_dma_buf_attribs(const _EGLImageAttribs *attrs)
   }
}
 
+   /**
+* If  is EGL_LINUX_DMA_BUF_EXT, both or neither of the following
+* attribute values may be given.
+*
+* This is referring to EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT and
+* EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, and the same for other planes.
+*/
+   for (i = 0; i < DMA_BUF_MAX_PLANES; ++i) {
+  if (attrs->DMABufPlaneModifiersLo[i].IsPresent !=
+  attrs->DMABufPlaneModifiersHi[i].IsPresent) {
+ _eglError(EGL_BAD_PARAMETER, "modifier attribute lo or hi missing");
+ return EGL_FALSE;
+  }
+   }
+
return EGL_TRUE;
 }
 
@@ -2043,7 +2058,9 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
for (i = plane_n; i < DMA_BUF_MAX_PLANES; ++i) {
   if (attrs->DMABufPlaneFds[i].IsPresent ||
   attrs->DMABufPlaneOffsets[i].IsPresent ||
-  attrs->DMABufPlanePitches[i].IsPresent) {
+  attrs->DMABufPlanePitches[i].IsPresent ||
+  attrs->DMABufPlaneModifiersLo[i].IsPresent ||
+  attrs->DMABufPlaneModifiersHi[i].IsPresent) {
  _eglError(EGL_BAD_ATTRIBUTE, "too many plane attributes");
  return 0;
   }
@@ -2076,6 +2093,8 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext 
*ctx,
int fds[DMA_BUF_MAX_PLANES];
int pitches[DMA_BUF_MAX_PLANES];
int offsets[DMA_BUF_MAX_PLANES];
+   uint64_t modifiers[DMA_BUF_MAX_PLANES];
+   int nonzero_modifier_found = 0;
unsigned error;
 
/**
@@ -2106,18 +2125,45 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, 
_EGLContext *ctx,
   fds[i] = attrs.DMABufPlaneFds[i].Value;
   pitches[i] = attrs.DMABufPlanePitches[i].Value;
   offsets[i] = attrs.DMABufPlaneOffsets[i].Value;
+  if (attrs.DMABufPlaneModifiersLo[i].IsPresent) {
+ modifiers[i] = attrs.DMABufPlaneModifiersHi[i].Value;
+ modifiers[i] = (modifiers[i] << 32) |
+attrs.DMABufPlaneModifiersLo[i].Value;
+ if (modifiers[i] != 0)
+nonzero_modifier_found = EGL_TRUE;
+  } else {
+ modifiers[i] = 0;
+  }
}
 
-   dri_image =
-  dri2_dpy->image->createImageFromDmaBufs(dri2_dpy->dri_screen,
- attrs.Width, attrs.Height, attrs.DMABufFourCC.Value,
- fds, num_fds, pitches, offsets,
- attrs.DMABufYuvColorSpaceHint.Value,
- attrs.DMABufSampleRangeHint.Value,
- attrs.DMABufChromaHorizontalSiting.Value,
- attrs.DMABufChromaVerticalSiting.Value,
- &error,
- NULL);
+   if (nonzero_modifier_found && dri2_dpy->image->createImageFromDmaBufs2) {
+  dri_image =
+ dri2_dpy->image->createImageFromDmaBufs2(dri2_dpy->dri_screen,
+attrs.Width, attrs.Height, attrs.DMABufFourCC.Value,
+fds, num_fds, pitches, offsets, modifiers,
+attrs.DMABufYuvColorSpaceHint.Value,
+attrs.DMABufSampleRangeHint.Value,
+attrs.DMABufChromaHorizontalSiting.Value,
+attrs.DMABufChromaVerticalSiting.Value,
+&error,
+NULL);
+   } else {
+  if (nonzero_modifier_found) {
+ _eglError(EGL_BAD_MATCH, "unsupported dma_buf format modifier");
+ return EGL_NO_IMAGE_KHR;
+  }
+
+  dri_image =
+ dri2_dpy->image->createImageFromDmaBufs(dri2_dpy->dri_screen,
+attrs.Width, attrs.Height, attrs.DMABufFourCC.Value,
+fds, num_fds, pitches, offsets,
+attrs.DMABufYuvColorSpaceHint.Value,
+attrs.DMABufSampleRangeHint.Value,
+attrs.DMABufChromaHorizontalSiting.Value,
+attrs.DMABufChromaVerticalSiting.Value,
+&error,
+NULL);
+   }
dri2_create_image_khr_texture_error(error);
 
if (!dri_image)
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 62d9a11..7a59dc5 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -101,6 +101,7 @@ struct _egl_extensions
EGLBoolean EXT_buffer_age;
EGLBoolean EXT_create_context_robustness;
EGLBoolean EXT_image_dma_buf_import;
+   EGLBoolean EXT_image_dma_buf_import_modifiers;
EGLBoolean EXT_swap_buffers_with_damage;
 
EGLBoolean KHR_cl_event2;
diff --git a/src/egl/main/eglimage.c b/src/egl/ma

[Mesa-dev] [PATCH 13/13] egl: advertise EGL_EXT_image_dma_buf_import_modifiers

2016-11-15 Thread Varad Gautam
From: Varad Gautam 

Signed-off-by: Varad Gautam 
---
 src/egl/drivers/dri2/egl_dri2.c | 5 +
 src/egl/main/eglapi.c   | 1 +
 2 files changed, 6 insertions(+)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 443e0a3..a9a6f95 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -754,6 +754,11 @@ dri2_setup_screen(_EGLDisplay *disp)
   dri2_dpy->image->createImageFromDmaBufs) {
  disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE;
   }
+  if (dri2_dpy->image->base.version >= 15 &&
+  dri2_dpy->image->createImageFromDmaBufs2 &&
+  dri2_dpy->image->queryDmaBufModifiers) {
+ disp->Extensions.EXT_image_dma_buf_import_modifiers = EGL_TRUE;
+  }
 #endif
}
 }
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index cd65115..44d7935 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -481,6 +481,7 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(EXT_buffer_age);
_EGL_CHECK_EXTENSION(EXT_create_context_robustness);
_EGL_CHECK_EXTENSION(EXT_image_dma_buf_import);
+   _EGL_CHECK_EXTENSION(EXT_image_dma_buf_import_modifiers);
_EGL_CHECK_EXTENSION(EXT_swap_buffers_with_damage);
 
_EGL_CHECK_EXTENSION(KHR_cl_event2);
-- 
2.6.2

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


[Mesa-dev] [PATCH 08/13] egl: implement eglQueryDmaBufFormatsEXT

2016-11-15 Thread Varad Gautam
From: Varad Gautam 

allow egl clients to query the dmabuf formats supported on this platform.

Signed-off-by: Louis-Francis Ratté-Boulianne 
Signed-off-by: Varad Gautam 
---
 src/egl/drivers/dri2/egl_dri2.c | 87 +
 src/egl/main/eglapi.c   | 19 +
 src/egl/main/eglapi.h   |  4 ++
 3 files changed, 110 insertions(+)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 4eb1861..de2d4df 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -78,6 +78,68 @@ const __DRIuseInvalidateExtension use_invalidate = {
.base = { __DRI_USE_INVALIDATE, 1 }
 };
 
+static const EGLint dma_buf_formats[] = {
+   DRM_FORMAT_R8,
+   DRM_FORMAT_RG88,
+   DRM_FORMAT_GR88,
+   DRM_FORMAT_RGB332,
+   DRM_FORMAT_BGR233,
+   DRM_FORMAT_XRGB,
+   DRM_FORMAT_XBGR,
+   DRM_FORMAT_RGBX,
+   DRM_FORMAT_BGRX,
+   DRM_FORMAT_ARGB,
+   DRM_FORMAT_ABGR,
+   DRM_FORMAT_RGBA,
+   DRM_FORMAT_BGRA,
+   DRM_FORMAT_XRGB1555,
+   DRM_FORMAT_XBGR1555,
+   DRM_FORMAT_RGBX5551,
+   DRM_FORMAT_BGRX5551,
+   DRM_FORMAT_ARGB1555,
+   DRM_FORMAT_ABGR1555,
+   DRM_FORMAT_RGBA5551,
+   DRM_FORMAT_BGRA5551,
+   DRM_FORMAT_RGB565,
+   DRM_FORMAT_BGR565,
+   DRM_FORMAT_RGB888,
+   DRM_FORMAT_BGR888,
+   DRM_FORMAT_XRGB,
+   DRM_FORMAT_XBGR,
+   DRM_FORMAT_RGBX,
+   DRM_FORMAT_BGRX,
+   DRM_FORMAT_ARGB,
+   DRM_FORMAT_ABGR,
+   DRM_FORMAT_RGBA,
+   DRM_FORMAT_BGRA,
+   DRM_FORMAT_XRGB2101010,
+   DRM_FORMAT_XBGR2101010,
+   DRM_FORMAT_RGBX1010102,
+   DRM_FORMAT_BGRX1010102,
+   DRM_FORMAT_ARGB2101010,
+   DRM_FORMAT_ABGR2101010,
+   DRM_FORMAT_RGBA1010102,
+   DRM_FORMAT_BGRA1010102,
+   DRM_FORMAT_YUYV,
+   DRM_FORMAT_YVYU,
+   DRM_FORMAT_UYVY,
+   DRM_FORMAT_VYUY,
+   DRM_FORMAT_NV12,
+   DRM_FORMAT_NV21,
+   DRM_FORMAT_NV16,
+   DRM_FORMAT_NV61,
+   DRM_FORMAT_YUV410,
+   DRM_FORMAT_YVU410,
+   DRM_FORMAT_YUV411,
+   DRM_FORMAT_YVU411,
+   DRM_FORMAT_YUV420,
+   DRM_FORMAT_YVU420,
+   DRM_FORMAT_YUV422,
+   DRM_FORMAT_YVU422,
+   DRM_FORMAT_YUV444,
+   DRM_FORMAT_YVU444
+};
+
 EGLint dri2_to_egl_attribute_map[] = {
0,
EGL_BUFFER_SIZE,/* __DRI_ATTRIB_BUFFER_SIZE */
@@ -2069,6 +2131,30 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
return plane_n;
 }
 
+static EGLBoolean
+dri2_query_dma_buf_formats(_EGLDriver *drv, _EGLDisplay *disp,
+EGLint max, EGLint *formats, EGLint *count)
+{
+   EGLint i;
+
+   if (max < 0 || (max > 0 && formats == NULL)) {
+  _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
+  return EGL_FALSE;
+   }
+
+   if (max == 0) {
+  *count = ARRAY_SIZE(dma_buf_formats);
+  return EGL_TRUE;
+   }
+
+   for (i = 0; i < ARRAY_SIZE(dma_buf_formats) && i < max; i++) {
+  formats[i] = dma_buf_formats[i];
+   }
+   *count = i;
+
+   return EGL_TRUE;
+}
+
 /**
  * The spec says:
  *
@@ -2953,6 +3039,7 @@ _eglBuiltInDriverDRI2(const char *args)
dri2_drv->base.API.ExportDRMImageMESA = dri2_export_drm_image_mesa;
dri2_drv->base.API.ExportDMABUFImageQueryMESA = 
dri2_export_dma_buf_image_query_mesa;
dri2_drv->base.API.ExportDMABUFImageMESA = dri2_export_dma_buf_image_mesa;
+   dri2_drv->base.API.QueryDmaBufFormatsEXT = dri2_query_dma_buf_formats;
 #endif
 #ifdef HAVE_WAYLAND_PLATFORM
dri2_drv->base.API.BindWaylandDisplayWL = dri2_bind_wayland_display_wl;
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 53340bf..53d34d8 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -2257,6 +2257,24 @@ eglQueryDebugKHR(EGLint attribute, EGLAttrib *value)
return EGL_TRUE;
 }
 
+static EGLBoolean EGLAPIENTRY
+eglQueryDmaBufFormatsEXT(EGLDisplay dpy, EGLint max_formats,
+ EGLint *formats, EGLint *num_formats)
+{
+   _EGLDisplay *disp = _eglLockDisplay(dpy);
+   _EGLDriver *drv;
+   EGLBoolean ret;
+
+   _EGL_FUNC_START(NULL, EGL_NONE, NULL, EGL_FALSE);
+
+   _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
+
+   ret = drv->API.QueryDmaBufFormatsEXT(drv, disp, max_formats, formats,
+num_formats);
+
+   RETURN_EGL_EVAL(disp, ret);
+}
+
 __eglMustCastToProperFunctionPointerType EGLAPIENTRY
 eglGetProcAddress(const char *procname)
 {
@@ -2340,6 +2358,7 @@ eglGetProcAddress(const char *procname)
   { "eglLabelObjectKHR", (_EGLProc) eglLabelObjectKHR },
   { "eglDebugMessageControlKHR", (_EGLProc) eglDebugMessageControlKHR },
   { "eglQueryDebugKHR", (_EGLProc) eglQueryDebugKHR },
+  { "eglQueryDmaBufFormatsEXT", (_EGLProc) eglQueryDmaBufFormatsEXT },
   { NULL, NULL }
};
EGLint i;
diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h
index b9bcc8e..13388b1 100644
--- a/src/egl/main/eglapi.h
+++ b/src/egl/main/eglapi.h
@@ -196,6 +196,10 @@ struct _egl_api
int (*GLInteropExportObject)(_EGLDisplay *dpy, _EGLContext *ctx,

[Mesa-dev] [PATCH 05/13] dri: support DRIimage creation from dmabufs with modifiers

2016-11-15 Thread Varad Gautam
From: Pekka Paalanen 

add createImageFromDmaBufs2 function which accepts per-plane dmabuf
format modifiers.

Signed-off-by: Pekka Paalanen 
Signed-off-by: Varad Gautam 
---
 include/GL/internal/dri_interface.h | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/include/GL/internal/dri_interface.h 
b/include/GL/internal/dri_interface.h
index d0b1bc6..4874e59 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1094,7 +1094,8 @@ struct __DRIdri2ExtensionRec {
  * extensions.
  */
 #define __DRI_IMAGE "DRI_IMAGE"
-#define __DRI_IMAGE_VERSION 13
+#define __DRI_IMAGE_VERSION 14
+
 
 /**
  * These formats correspond to the similarly named MESA_FORMAT_*
@@ -1420,6 +1421,24 @@ struct __DRIimageExtensionRec {
 */
void (*unmapImage)(__DRIcontext *context, __DRIimage *image, void *data);
 
+   /*
+* Like createImageFromDmaBufs, but takes also format modifiers.
+*
+* For EGL_EXT_image_dma_buf_import_modifiers.
+*
+* \since 14
+*/
+   __DRIimage *(*createImageFromDmaBufs2)(__DRIscreen *screen,
+  int width, int height, int fourcc,
+  int *fds, int num_fds,
+  int *strides, int *offsets,
+  uint64_t *modifiers,
+  enum __DRIYUVColorSpace color_space,
+  enum __DRISampleRange sample_range,
+  enum __DRIChromaSiting horiz_siting,
+  enum __DRIChromaSiting vert_siting,
+  unsigned *error,
+  void *loaderPrivate);
 };
 
 
-- 
2.6.2

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


[Mesa-dev] [PATCH 12/13] egl: implement eglQueryDmaBufModifiersEXT

2016-11-15 Thread Varad Gautam
From: Varad Gautam 

query and return supported dmabuf format modifiers for
EGL_EXT_image_dma_buf_import_modifiers.

Signed-off-by: Varad Gautam 
---
 src/egl/drivers/dri2/egl_dri2.c | 39 +++
 src/egl/main/eglapi.c   | 21 +
 src/egl/main/eglapi.h   |  5 +
 3 files changed, 65 insertions(+)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index de2d4df..443e0a3 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2155,6 +2155,44 @@ dri2_query_dma_buf_formats(_EGLDriver *drv, _EGLDisplay 
*disp,
return EGL_TRUE;
 }
 
+static EGLBoolean
+dri2_query_dma_buf_modifiers(_EGLDriver *drv, _EGLDisplay *disp, EGLint format,
+ EGLint max, EGLuint64KHR *modifiers,
+ EGLBoolean *external_only, EGLint *count)
+{
+   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+   EGLint i;
+
+   if (max < 0) {
+  _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
+  return EGL_FALSE;
+   }
+
+   if (max > 0 && modifiers == NULL) {
+  _eglError(EGL_BAD_PARAMETER, "invalid modifiers array");
+  return EGL_FALSE;
+   }
+
+   for (i = 0; i < ARRAY_SIZE(dma_buf_formats); i++) {
+  if (format == dma_buf_formats[i])
+ break;
+   }
+   if (i == ARRAY_SIZE(dma_buf_formats)) {
+  _eglError(EGL_BAD_PARAMETER, "invalid format");
+  return EGL_FALSE;
+   }
+
+   dri2_dpy->image->queryDmaBufModifiers(dri2_dpy->dri_screen, format, max,
+ modifiers, count);
+
+   if (external_only != NULL) {
+  for (i = 0; i < *count && i < max; i++)
+ external_only[i] = EGL_TRUE;
+   }
+
+   return EGL_TRUE;
+}
+
 /**
  * The spec says:
  *
@@ -3040,6 +3078,7 @@ _eglBuiltInDriverDRI2(const char *args)
dri2_drv->base.API.ExportDMABUFImageQueryMESA = 
dri2_export_dma_buf_image_query_mesa;
dri2_drv->base.API.ExportDMABUFImageMESA = dri2_export_dma_buf_image_mesa;
dri2_drv->base.API.QueryDmaBufFormatsEXT = dri2_query_dma_buf_formats;
+   dri2_drv->base.API.QueryDmaBufModifiersEXT = dri2_query_dma_buf_modifiers;
 #endif
 #ifdef HAVE_WAYLAND_PLATFORM
dri2_drv->base.API.BindWaylandDisplayWL = dri2_bind_wayland_display_wl;
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 53d34d8..cd65115 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -2275,6 +2275,26 @@ eglQueryDmaBufFormatsEXT(EGLDisplay dpy, EGLint 
max_formats,
RETURN_EGL_EVAL(disp, ret);
 }
 
+static EGLBoolean EGLAPIENTRY
+eglQueryDmaBufModifiersEXT(EGLDisplay dpy, EGLint format, EGLint max_modifiers,
+   EGLuint64KHR *modifiers, EGLBoolean *external_only,
+   EGLint *num_modifiers)
+{
+   _EGLDisplay *disp = _eglLockDisplay(dpy);
+   _EGLDriver *drv;
+   EGLBoolean ret;
+
+   _EGL_FUNC_START(NULL, EGL_NONE, NULL, EGL_FALSE);
+
+   _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
+
+   ret = drv->API.QueryDmaBufModifiersEXT(drv, disp, format, max_modifiers,
+  modifiers, external_only,
+  num_modifiers);
+
+   RETURN_EGL_EVAL(disp, ret);
+}
+
 __eglMustCastToProperFunctionPointerType EGLAPIENTRY
 eglGetProcAddress(const char *procname)
 {
@@ -2359,6 +2379,7 @@ eglGetProcAddress(const char *procname)
   { "eglDebugMessageControlKHR", (_EGLProc) eglDebugMessageControlKHR },
   { "eglQueryDebugKHR", (_EGLProc) eglQueryDebugKHR },
   { "eglQueryDmaBufFormatsEXT", (_EGLProc) eglQueryDmaBufFormatsEXT },
+  { "eglQueryDmaBufModifiersEXT", (_EGLProc) eglQueryDmaBufModifiersEXT },
   { NULL, NULL }
};
EGLint i;
diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h
index 13388b1..3428195 100644
--- a/src/egl/main/eglapi.h
+++ b/src/egl/main/eglapi.h
@@ -200,6 +200,11 @@ struct _egl_api
EGLBoolean (*QueryDmaBufFormatsEXT)(_EGLDriver *drv, _EGLDisplay *dpy,
EGLint max_formats, EGLint *formats,
EGLint *num_formats);
+   EGLBoolean (*QueryDmaBufModifiersEXT) (_EGLDriver *drv, _EGLDisplay *dpy,
+  EGLint format, EGLint max_modifiers,
+  EGLuint64KHR *modifiers,
+  EGLBoolean *external_only,
+  EGLint *num_modifiers);
 };
 
 EGLint _eglConvertIntsToAttribs(const EGLint *int_list,
-- 
2.6.2

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


[Mesa-dev] [PATCH 11/13] st/dri: support format modifier queries

2016-11-15 Thread Varad Gautam
From: Varad Gautam 

ask the driver for supported modifiers for a given format.

Signed-off-by: Varad Gautam 
---
 src/gallium/state_trackers/dri/dri2.c | 20 +++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/dri/dri2.c 
b/src/gallium/state_trackers/dri/dri2.c
index a2b87a7..2684481 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1259,6 +1259,21 @@ dri2_from_fds(__DRIscreen *screen, int width, int 
height, int fourcc,
return img;
 }
 
+static void
+dri2_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
+ uint64_t *modifiers, int *count)
+{
+   struct dri_screen *screen = dri_screen(_screen);
+   struct pipe_screen *pscreen = screen->base.screen;
+   int dri_components;
+   enum pipe_format format = dri2_format_to_pipe_format(
+ convert_fourcc(fourcc,&dri_components));
+
+   if (pscreen->get_param(pscreen, PIPE_CAP_QUERY_DMABUF_MODIFIERS))
+  pscreen->get_modifiers_for_format(pscreen, format, max, modifiers,
+count);
+}
+
 static __DRIimage *
 dri2_from_dma_bufs(__DRIscreen *screen,
int width, int height, int fourcc,
@@ -1425,7 +1440,7 @@ dri2_get_capabilities(__DRIscreen *_screen)
 
 /* The extension is modified during runtime if DRI_PRIME is detected */
 static __DRIimageExtension dri2ImageExtension = {
-.base = { __DRI_IMAGE, 14 },
+.base = { __DRI_IMAGE, 15 },
 
 .createImageFromName  = dri2_create_image_from_name,
 .createImageFromRenderbuffer  = dri2_create_image_from_renderbuffer,
@@ -1938,6 +1953,8 @@ dri2_init_screen(__DRIscreen * sPriv)
  dri2ImageExtension.createImageFromFds = dri2_from_fds;
  dri2ImageExtension.createImageFromDmaBufs = dri2_from_dma_bufs;
  dri2ImageExtension.createImageFromDmaBufs2 = dri2_from_dma_bufs2;
+ dri2ImageExtension.queryDmaBufModifiers =
+dri2_query_dma_buf_modifiers;
   }
}
 
@@ -2011,6 +2028,7 @@ dri_kms_init_screen(__DRIscreen * sPriv)
   dri2ImageExtension.createImageFromFds = dri2_from_fds;
   dri2ImageExtension.createImageFromDmaBufs = dri2_from_dma_bufs;
   dri2ImageExtension.createImageFromDmaBufs2 = dri2_from_dma_bufs2;
+  dri2ImageExtension.queryDmaBufModifiers = dri2_query_dma_buf_modifiers;
}
 
sPriv->extensions = dri_screen_extensions;
-- 
2.6.2

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


[Mesa-dev] [PATCH 06/13] st/dri: implement DRIimage creation from dmabufs with modifiers

2016-11-15 Thread Varad Gautam
From: Varad Gautam 

support importing dmabufs into DRIimage taking format modifiers in
account, as per DRIimage extension version 14.

Signed-off-by: Varad Gautam 
---
 src/gallium/include/state_tracker/drm_driver.h |  2 ++
 src/gallium/state_trackers/dri/dri2.c  | 45 +++---
 2 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/src/gallium/include/state_tracker/drm_driver.h 
b/src/gallium/include/state_tracker/drm_driver.h
index c80fb09..8b9d6bc 100644
--- a/src/gallium/include/state_tracker/drm_driver.h
+++ b/src/gallium/include/state_tracker/drm_driver.h
@@ -45,6 +45,8 @@ struct winsys_handle
 * Output for texture_get_handle.
 */
unsigned offset;
+
+   uint64_t modifier;
 };
 
 
diff --git a/src/gallium/state_trackers/dri/dri2.c 
b/src/gallium/state_trackers/dri/dri2.c
index 9ec069b..a2b87a7 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -884,7 +884,7 @@ static __DRIimage *
 dri2_create_image_from_fd(__DRIscreen *_screen,
   int width, int height, int fourcc,
   int *fds, int num_fds, int *strides,
-  int *offsets, unsigned *error,
+  int *offsets, uint64_t *modifiers, unsigned *error,
   int *dri_components, void *loaderPrivate)
 {
struct winsys_handle whandles[3];
@@ -929,6 +929,8 @@ dri2_create_image_from_fd(__DRIscreen *_screen,
   whandles[i].handle = (unsigned)fds[i];
   whandles[i].stride = (unsigned)strides[i];
   whandles[i].offset = (unsigned)offsets[i];
+  if (modifiers)
+ whandles[i].modifier = modifiers[i];
}
 
if (fourcc == __DRI_IMAGE_FOURCC_YVU420) {
@@ -1248,7 +1250,7 @@ dri2_from_fds(__DRIscreen *screen, int width, int height, 
int fourcc,
int dri_components;
 
img = dri2_create_image_from_fd(screen, width, height, fourcc,
-   fds, num_fds, strides, offsets, NULL,
+   fds, num_fds, strides, offsets, NULL, NULL,
&dri_components, loaderPrivate);
if (img == NULL)
   return NULL;
@@ -1273,7 +1275,7 @@ dri2_from_dma_bufs(__DRIscreen *screen,
int dri_components;
 
img = dri2_create_image_from_fd(screen, width, height, fourcc,
-   fds, num_fds, strides, offsets, error,
+   fds, num_fds, strides, offsets, NULL, error,
&dri_components, loaderPrivate);
if (img == NULL)
   return NULL;
@@ -1288,6 +1290,38 @@ dri2_from_dma_bufs(__DRIscreen *screen,
return img;
 }
 
+static __DRIimage *
+dri2_from_dma_bufs2(__DRIscreen *screen,
+int width, int height, int fourcc,
+int *fds, int num_fds,
+int *strides, int *offsets,
+uint64_t *modifiers,
+enum __DRIYUVColorSpace yuv_color_space,
+enum __DRISampleRange sample_range,
+enum __DRIChromaSiting horizontal_siting,
+enum __DRIChromaSiting vertical_siting,
+unsigned *error,
+void *loaderPrivate)
+{
+   __DRIimage *img;
+   int dri_components;
+
+   img = dri2_create_image_from_fd(screen, width, height, fourcc,
+   fds, num_fds, strides, offsets, modifiers,
+   error, &dri_components, loaderPrivate);
+   if (img == NULL)
+  return NULL;
+
+   img->yuv_color_space = yuv_color_space;
+   img->sample_range = sample_range;
+   img->horizontal_siting = horizontal_siting;
+   img->vertical_siting = vertical_siting;
+   img->dri_components = dri_components;
+
+   *error = __DRI_IMAGE_ERROR_SUCCESS;
+   return img;
+}
+
 static void
 dri2_blit_image(__DRIcontext *context, __DRIimage *dst, __DRIimage *src,
 int dstx0, int dsty0, int dstwidth, int dstheight,
@@ -1391,7 +1425,7 @@ dri2_get_capabilities(__DRIscreen *_screen)
 
 /* The extension is modified during runtime if DRI_PRIME is detected */
 static __DRIimageExtension dri2ImageExtension = {
-.base = { __DRI_IMAGE, 12 },
+.base = { __DRI_IMAGE, 14 },
 
 .createImageFromName  = dri2_create_image_from_name,
 .createImageFromRenderbuffer  = dri2_create_image_from_renderbuffer,
@@ -1409,6 +1443,7 @@ static __DRIimageExtension dri2ImageExtension = {
 .getCapabilities  = dri2_get_capabilities,
 .mapImage = dri2_map_image,
 .unmapImage   = dri2_unmap_image,
+.createImageFromDmaBufs2  = NULL,
 };
 
 
@@ -1902,6 +1937,7 @@ dri2_init_screen(__DRIscreen * sPriv)
   (cap & DRM_PRIME_CAP_IMPORT)) {
  dri2ImageExtension.createImageFromFds = dri2_from_fds;
  dri2ImageExtension.createImageFromDmaBufs = dri2_from_dma_bufs;
+ dri2ImageExtension.cr

[Mesa-dev] [PATCH 10/13] gallium: introduce format modifier querying

2016-11-15 Thread Varad Gautam
From: Varad Gautam 

drivers should implement pipe_screen->get_modifiers_for_format and
advertise it with PIPE_CAP_QUERY_DMABUF_MODIFIERS to support format
modifier queries.

Signed-off-by: Varad Gautam 
---
 src/gallium/docs/source/screen.rst   | 2 ++
 src/gallium/drivers/freedreno/freedreno_screen.c | 1 +
 src/gallium/drivers/i915/i915_screen.c   | 1 +
 src/gallium/drivers/ilo/ilo_screen.c | 1 +
 src/gallium/drivers/llvmpipe/lp_screen.c | 1 +
 src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 1 +
 src/gallium/drivers/nouveau/nv50/nv50_screen.c   | 1 +
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   | 1 +
 src/gallium/drivers/r300/r300_screen.c   | 1 +
 src/gallium/drivers/r600/r600_pipe.c | 1 +
 src/gallium/drivers/radeonsi/si_pipe.c   | 1 +
 src/gallium/drivers/softpipe/sp_screen.c | 1 +
 src/gallium/drivers/svga/svga_screen.c   | 1 +
 src/gallium/drivers/swr/swr_screen.cpp   | 1 +
 src/gallium/drivers/vc4/vc4_screen.c | 1 +
 src/gallium/drivers/virgl/virgl_screen.c | 1 +
 src/gallium/include/pipe/p_defines.h | 1 +
 src/gallium/include/pipe/p_screen.h  | 7 +++
 18 files changed, 25 insertions(+)

diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index 6ad2bec..1775fe3 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -364,6 +364,8 @@ The integer capabilities:
 * ``PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS``: Whether interleaved stream
   output mode is able to interleave across buffers. This is required for
   ARB_transform_feedback3.
+* ``PIPE_CAP_QUERY_DMABUF_MODIFIERS``: Whether the driver supports modifier
+  queries for a given format.
 
 
 .. _pipe_capf:
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
b/src/gallium/drivers/freedreno/freedreno_screen.c
index 97da0d7..2786d45 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -288,6 +288,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
+   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
return 0;
 
case PIPE_CAP_MAX_VIEWPORTS:
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index bfadca3..ce42e04 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -278,6 +278,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
case PIPE_CAP_MAX_WINDOW_RECTANGLES:
case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
+   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
   return 0;
 
case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
diff --git a/src/gallium/drivers/ilo/ilo_screen.c 
b/src/gallium/drivers/ilo/ilo_screen.c
index f3f182c..05fc906 100644
--- a/src/gallium/drivers/ilo/ilo_screen.c
+++ b/src/gallium/drivers/ilo/ilo_screen.c
@@ -517,6 +517,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
+   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
   return 0;
 
case PIPE_CAP_VENDOR_ID:
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
b/src/gallium/drivers/llvmpipe/lp_screen.c
index 4b502f0..2a8fa76 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -338,6 +338,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
case PIPE_CAP_MAX_WINDOW_RECTANGLES:
case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
   return 0;
}
/* should only get here on unhandled cases */
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c 
b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 96708c0..6ba768b 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -203,6 +203,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
+   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
   return 0;
 
case PIPE_CAP_VENDOR_ID:
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c 
b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index 50cdeda..5c922ed 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -255,6 +255,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
case PIPE_CAP_VIEWPORT_SUBPIXEL_B

Re: [Mesa-dev] [PATCH] intel: Set min_ds_entries on Broxton.

2016-11-15 Thread Ben Widawsky

On 16-11-15 03:08:22, Kenneth Graunke wrote:

This was missing.

Signed-off-by: Kenneth Graunke 


Cc: stable?
Reviewed-by: Ben Widawsky 

Would you mind taking a quick look at the cleanup patch I have for defining GEN9
and GEN9_LP feature macros?


---
src/intel/common/gen_device_info.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/src/intel/common/gen_device_info.c 
b/src/intel/common/gen_device_info.c
index 1dc1769..c7b8e56 100644
--- a/src/intel/common/gen_device_info.c
+++ b/src/intel/common/gen_device_info.c
@@ -391,6 +391,7 @@ static const struct gen_device_info gen_device_info_bxt = {
   .urb = {
  .size = 192,
  .min_vs_entries = 34,
+  .min_ds_entries = 34,
  .max_vs_entries = 704,
  .max_tcs_entries = 256,
  .max_tes_entries = 416,
@@ -413,6 +414,7 @@ static const struct gen_device_info gen_device_info_bxt_2x6 
= {
   .urb = {
  .size = 128,
  .min_vs_entries = 34,
+  .min_ds_entries = 34,
  .max_vs_entries = 352,
  .max_tcs_entries = 128,
  .max_tes_entries = 208,
--
2.10.2


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


Re: [Mesa-dev] Stable release process

2016-11-15 Thread Emil Velikov
Hi Matt,

On 14 November 2016 at 22:31, Matt Turner  wrote:
> A long time ago, patch authors were tasked with cherry-picking their
> patches to stable branches. Today we Cc
> mesa-sta...@lists.freedesktop.org and Emil rebases those patches onto
> stable. Cc'ing the list happens even on patches sent for their first
> review that are ultimately rejected, creating a lot of noise (and
> presumably makes the mailing list less useful).
>
I believe it's the increased volume (overall) and off-list decisions
make things a bit confusing. Then again, the latter happens quite
rare, so I don't believe it's an issue.

In the early stages I was going through the mesa-stable@ list for
patches that have fallen through the cracks.
It seemed quite useful, yet people did not had time or just dropped
the ball on patches. My prodding seems to have caused annoyance, so
I've opted against it.

So my question is:
Do people agree with my prodding, should we revive it ?

> Initial questions:
>
> Is the mesa-stable@ mailing list useful (other than as a tag in a
> committed patch)?
>
Yes, mesa-stable is useful. We had a number of fixes that landed
explicitly thanks to it.

> What do "nominated" and "queued" in the stable release candidate
> announcements actually mean?
>
Those terms originated when Carl was around and seems to be commonly
asked topic:
 - Nominated:
Patch that is nominated but yet to to merged in the patch
queue/branch. There are three* ways to nominate a patch, which I'd
imagine can be causing confusion.
 - Queued:
Patch is in the queue/branch and will feature in the next release.
Barring reported regressions objections from developers.

> Should driver maintainers cherry-pick patches to stable on their own?
>
I'd suggest against that where possible.

> Regardless of the outcome of that question, I think we would the
> process would be more transparent and predictable if patches were
> incorporated into the branch over time rather than all at once a few
> days before the release.
Fully, agree. I'm dusting off a series on the topic and will send to
the list by EOD.

Thanks
Emil
* Official ones and one unofficial that people opt for. Latter of
which being the core/sole reason behind "forgotten" patches.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Stable release process

2016-11-15 Thread Marek Olšák
I think that if people add the Cc stable tag to patches that are going
to land in master first, they shouldn't send it to the stable ML,
because that is redundant. Yet, many people do that. I would go even
further and say that any unreviewed patches shouldn't be sent to the
stable ML. At least that would be my policy I were the release
manager.

I don't know how Emil manages that ML, but I guess it's not fun.

Marek


On Mon, Nov 14, 2016 at 11:31 PM, Matt Turner  wrote:
> A long time ago, patch authors were tasked with cherry-picking their
> patches to stable branches. Today we Cc
> mesa-sta...@lists.freedesktop.org and Emil rebases those patches onto
> stable. Cc'ing the list happens even on patches sent for their first
> review that are ultimately rejected, creating a lot of noise (and
> presumably makes the mailing list less useful).
>
> Initial questions:
>
> Is the mesa-stable@ mailing list useful (other than as a tag in a
> committed patch)?
>
> What do "nominated" and "queued" in the stable release candidate
> announcements actually mean?
>
> Should driver maintainers cherry-pick patches to stable on their own?
>
> Regardless of the outcome of that question, I think we would the
> process would be more transparent and predictable if patches were
> incorporated into the branch over time rather than all at once a few
> days before the release.
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 1/3] loader: add loader_get_extensions_name(..) helper

2016-11-15 Thread Emil Velikov
On 12 November 2016 at 16:26, Christian Gmeiner
 wrote:

> ../../include/GL/internal/dri_interface.h:512:5: error: unknown type
> name 'GLboolean'
>  GLboolean front_buffer,
>  ^
> ../../include/GL/internal/dri_interface.h:514:1: warning: no semicolon
> at end of struct or union
>  };
>  ^
> ../../include/GL/internal/dri_interface.h:1288:4: error: expected
> specifier-qualifier-list before 'GLboolean'
> GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
> ^
> Makefile:641: recipe for target 'libloader_la-loader.lo' failed
> make[3]: *** [libloader_la-loader.lo] Error 1
> make[3]: Leaving directory '/run/media/christian/christian/ac_mesa/src/loader'
> Makefile:865: recipe for target 'all-recursive' failed
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory '/run/media/christian/christian/ac_mesa/src'
> Makefile:656: recipe for target 'all' failed
> make[1]: *** [all] Error 2
>
Grr, I forgot that dri_interface.h is using GL types yet does not
include any header that provides them.

>> Let me know how you feel on the latter and I can amend accordingly
>> before pushing.
>
> The only way to life without those includes would be move
> __DRI_DRIVER_GET_EXTENSIONS define
> but that feels quite strange.
>
Yes having a local define is what I had in mind. Apologies, I should
have made it clearer.

With the fun that we've been having with GL and mesa_interop headers,
typedefs and alike, I've "tweaked" the patch to use a local define and
landed the series.
Not too happy about it, but it's a minor hack that will save us a fair
few others.

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Stable release process

2016-11-15 Thread Emil Velikov
On 15 November 2016 at 16:13, Marek Olšák  wrote:
> I think that if people add the Cc stable tag to patches that are going
> to land in master first, they shouldn't send it to the stable ML,
> because that is redundant. Yet, many people do that. I would go even
> further and say that any unreviewed patches shouldn't be sent to the
> stable ML. At least that would be my policy I were the release
> manager.
>
Since I'm no longer tracking nominated-but-not-merged-in-master
patches things are noticeably better.

Fwiw the official policy has been to not merge patches without review.
I've bent that rule (and others) on a number of occasions for pretty
much everyone.
I hope that doesn't happen again, but in all fairness it will.
Otherwise we'll get a lot of upset/angry/alienated developers.

> I don't know how Emil manages that ML, but I guess it's not fun.
>
it's "less fun" when one uses a unofficial way to nominate patches - hint, hint.
Again it's my fault for not having things in a clearer and easier to
parse/understand way.

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 07/13] egl_dri2: add support for using modifier attributes in eglCreateImageKHR

2016-11-15 Thread Eric Engestrom
On Tuesday, 2016-11-15 19:54:28 +0530, Varad Gautam wrote:
> From: Pekka Paalanen 
> 
> allow creating EGLImages with dmabuf format modifiers when target is
> EGL_LINUX_DMA_BUF_EXT for EGL_EXT_image_dma_buf_import_modifiers.
> 
> Signed-off-by: Pekka Paalanen 
> Signed-off-by: Varad Gautam 
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 68 
> ++---
>  src/egl/main/egldisplay.h   |  1 +
>  src/egl/main/eglimage.c | 49 +
>  src/egl/main/eglimage.h |  2 ++
>  4 files changed, 109 insertions(+), 11 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 58d16e1..4eb1861 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -1937,6 +1937,21 @@ dri2_check_dma_buf_attribs(const _EGLImageAttribs 
> *attrs)
>}
> }
>  
> +   /**
> +* If  is EGL_LINUX_DMA_BUF_EXT, both or neither of the following
> +* attribute values may be given.
> +*
> +* This is referring to EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT and
> +* EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT, and the same for other planes.
> +*/
> +   for (i = 0; i < DMA_BUF_MAX_PLANES; ++i) {
> +  if (attrs->DMABufPlaneModifiersLo[i].IsPresent !=
> +  attrs->DMABufPlaneModifiersHi[i].IsPresent) {
> + _eglError(EGL_BAD_PARAMETER, "modifier attribute lo or hi missing");
> + return EGL_FALSE;
> +  }
> +   }
> +
> return EGL_TRUE;
>  }
>  
> @@ -2043,7 +2058,9 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
> for (i = plane_n; i < DMA_BUF_MAX_PLANES; ++i) {
>if (attrs->DMABufPlaneFds[i].IsPresent ||
>attrs->DMABufPlaneOffsets[i].IsPresent ||
> -  attrs->DMABufPlanePitches[i].IsPresent) {
> +  attrs->DMABufPlanePitches[i].IsPresent ||
> +  attrs->DMABufPlaneModifiersLo[i].IsPresent ||
> +  attrs->DMABufPlaneModifiersHi[i].IsPresent) {
>   _eglError(EGL_BAD_ATTRIBUTE, "too many plane attributes");
>   return 0;
>}
> @@ -2076,6 +2093,8 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, 
> _EGLContext *ctx,
> int fds[DMA_BUF_MAX_PLANES];
> int pitches[DMA_BUF_MAX_PLANES];
> int offsets[DMA_BUF_MAX_PLANES];
> +   uint64_t modifiers[DMA_BUF_MAX_PLANES];
> +   int nonzero_modifier_found = 0;
> unsigned error;
>  
> /**
> @@ -2106,18 +2125,45 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, 
> _EGLContext *ctx,
>fds[i] = attrs.DMABufPlaneFds[i].Value;
>pitches[i] = attrs.DMABufPlanePitches[i].Value;
>offsets[i] = attrs.DMABufPlaneOffsets[i].Value;
> +  if (attrs.DMABufPlaneModifiersLo[i].IsPresent) {
> + modifiers[i] = attrs.DMABufPlaneModifiersHi[i].Value;
> + modifiers[i] = (modifiers[i] << 32) |
> +attrs.DMABufPlaneModifiersLo[i].Value;

I'd prefer this, it's clearer IMO, and avoids temporarily invalid values
(eg. `hi` unshifted):

modifiers[i] = attrs.DMABufPlaneModifiersHi[i].Value << 32 |
   attrs.DMABufPlaneModifiersLo[i].Value;

Otherwise, it all looks good to me (one nit-pick below), but I don't
know Gallium enough, so I'm only r-b'ing the EGL bits.

Patches 1-4, 7-8, 12-13 are:
Reviewed-by: Eric Engestrom 

> + if (modifiers[i] != 0)
> +nonzero_modifier_found = EGL_TRUE;
> +  } else {
> + modifiers[i] = 0;
> +  }
> }
>  
> -   dri_image =
> -  dri2_dpy->image->createImageFromDmaBufs(dri2_dpy->dri_screen,
> - attrs.Width, attrs.Height, attrs.DMABufFourCC.Value,
> - fds, num_fds, pitches, offsets,
> - attrs.DMABufYuvColorSpaceHint.Value,
> - attrs.DMABufSampleRangeHint.Value,
> - attrs.DMABufChromaHorizontalSiting.Value,
> - attrs.DMABufChromaVerticalSiting.Value,
> - &error,
> - NULL);
> +   if (nonzero_modifier_found && dri2_dpy->image->createImageFromDmaBufs2) {
> +  dri_image =
> + dri2_dpy->image->createImageFromDmaBufs2(dri2_dpy->dri_screen,
> +attrs.Width, attrs.Height, attrs.DMABufFourCC.Value,
> +fds, num_fds, pitches, offsets, modifiers,
> +attrs.DMABufYuvColorSpaceHint.Value,
> +attrs.DMABufSampleRangeHint.Value,
> +attrs.DMABufChromaHorizontalSiting.Value,
> +attrs.DMABufChromaVerticalSiting.Value,
> +&error,
> +NULL);
> +   } else {
> +  if (nonzero_modifier_found) {
> + _eglError(EGL_BAD_MATCH, "unsupported dma_buf format modifier");
> + return EGL_NO_IMAGE_KHR;
> +  }
> +
> +  dri_image =
> + dri2_dpy->image->createImageFromDmaBufs(dri2_dpy->dri_screen,
> +attrs.Width, attrs.Height, attrs.DMABufFourCC.Value,
> +fds, num_fds, pitches, offsets,
> +attrs.DMABufYuvColorSpaceHint.Value,
> +attrs.DMABufSampleRangeHint.Value,
> +attrs.DMABu

Re: [Mesa-dev] [PATCH 00/13] implement EGL_EXT_image_dma_buf_import_modifiers

2016-11-15 Thread Marek Olšák
Hi,

Is the modifier just a driver-specific description of the tiling
layout and compression?

What makes you think that 8 bytes is enough to describe that? What if
I need 9 bytes just to program the display hardware?

Drivers importing DMABUFs still have to invoke the texture tiling
calculator to get all necessary parameters for rendering (not just
display), which may even be 128 bytes per plane.

Marek


On Tue, Nov 15, 2016 at 3:24 PM, Varad Gautam  wrote:
> Hello,
>
> This series implements EGL_EXT_image_dma_buf_import_modifiers [1] which makes
> it possible to pass drm fourcc modifiers to EGL when importing dmabufs.
>
> [1] 
> https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt
>
> Pekka Paalanen (5):
>   egl: return error for unknown EGLImage attributes
>   egl: introduce DMA_BUF_MAX_PLANES
>   egl/main: add support for fourth plane tokens
>   dri: support DRIimage creation from dmabufs with modifiers
>   egl_dri2: add support for using modifier attributes in
> eglCreateImageKHR
>
> Varad Gautam (8):
>   egl: update eglext.h
>   st/dri: implement DRIimage creation from dmabufs with modifiers
>   egl: implement eglQueryDmaBufFormatsEXT
>   dri: add queryDmaBufModifiers to DRIimage
>   gallium: introduce format modifier querying
>   st/dri: support format modifier queries
>   egl: implement eglQueryDmaBufModifiersEXT
>   egl: advertise EGL_EXT_image_dma_buf_import_modifiers
>
>  include/EGL/eglext.h |  60 ++-
>  include/GL/internal/dri_interface.h  |  31 +++-
>  src/egl/drivers/dri2/egl_dri2.c  | 209 
> +--
>  src/egl/main/eglapi.c|  41 +
>  src/egl/main/eglapi.h|   9 +
>  src/egl/main/egldisplay.h|   1 +
>  src/egl/main/eglimage.c  |  63 ++-
>  src/egl/main/eglimage.h  |  10 +-
>  src/gallium/docs/source/screen.rst   |   2 +
>  src/gallium/drivers/freedreno/freedreno_screen.c |   1 +
>  src/gallium/drivers/i915/i915_screen.c   |   1 +
>  src/gallium/drivers/ilo/ilo_screen.c |   1 +
>  src/gallium/drivers/llvmpipe/lp_screen.c |   1 +
>  src/gallium/drivers/nouveau/nv30/nv30_screen.c   |   1 +
>  src/gallium/drivers/nouveau/nv50/nv50_screen.c   |   1 +
>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   |   1 +
>  src/gallium/drivers/r300/r300_screen.c   |   1 +
>  src/gallium/drivers/r600/r600_pipe.c |   1 +
>  src/gallium/drivers/radeonsi/si_pipe.c   |   1 +
>  src/gallium/drivers/softpipe/sp_screen.c |   1 +
>  src/gallium/drivers/svga/svga_screen.c   |   1 +
>  src/gallium/drivers/swr/swr_screen.cpp   |   1 +
>  src/gallium/drivers/vc4/vc4_screen.c |   1 +
>  src/gallium/drivers/virgl/virgl_screen.c |   1 +
>  src/gallium/include/pipe/p_defines.h |   1 +
>  src/gallium/include/pipe/p_screen.h  |   7 +
>  src/gallium/include/state_tracker/drm_driver.h   |   2 +
>  src/gallium/state_trackers/dri/dri2.c|  63 ++-
>  28 files changed, 487 insertions(+), 27 deletions(-)
>
> --
> 2.6.2
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/13] implement EGL_EXT_image_dma_buf_import_modifiers

2016-11-15 Thread Rob Clark
On Tue, Nov 15, 2016 at 11:44 AM, Marek Olšák  wrote:
>
> Hi,
>
> Is the modifier just a driver-specific description of the tiling
> layout and compression?
>
> What makes you think that 8 bytes is enough to describe that? What if
> I need 9 bytes just to program the display hardware?
>
> Drivers importing DMABUFs still have to invoke the texture tiling
> calculator to get all necessary parameters for rendering (not just
> display), which may even be 128 bytes per plane.

fwiw, this maps 1:1 to addfb2 ioctl, and just brings egl to parity with kms.

Maybe the addfb2 approach wasn't the best idea compared to some of the
ideas proposed for hypothetical "liballoc" for being ultra-generic.
OTOH perhaps you can just treat it like an enum?  I mean maybe the set
of tiled formats that you would actually exchange with another device
is less than 2^^72.  It seems reasonable to restrict the possible
tiled formats supported by this extension to only things that can be
exchanged with i965..

BR,
-R

>
> Marek
>
>
> On Tue, Nov 15, 2016 at 3:24 PM, Varad Gautam  wrote:
> > Hello,
> >
> > This series implements EGL_EXT_image_dma_buf_import_modifiers [1] which 
> > makes
> > it possible to pass drm fourcc modifiers to EGL when importing dmabufs.
> >
> > [1] 
> > https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt
> >
> > Pekka Paalanen (5):
> >   egl: return error for unknown EGLImage attributes
> >   egl: introduce DMA_BUF_MAX_PLANES
> >   egl/main: add support for fourth plane tokens
> >   dri: support DRIimage creation from dmabufs with modifiers
> >   egl_dri2: add support for using modifier attributes in
> > eglCreateImageKHR
> >
> > Varad Gautam (8):
> >   egl: update eglext.h
> >   st/dri: implement DRIimage creation from dmabufs with modifiers
> >   egl: implement eglQueryDmaBufFormatsEXT
> >   dri: add queryDmaBufModifiers to DRIimage
> >   gallium: introduce format modifier querying
> >   st/dri: support format modifier queries
> >   egl: implement eglQueryDmaBufModifiersEXT
> >   egl: advertise EGL_EXT_image_dma_buf_import_modifiers
> >
> >  include/EGL/eglext.h |  60 ++-
> >  include/GL/internal/dri_interface.h  |  31 +++-
> >  src/egl/drivers/dri2/egl_dri2.c  | 209 
> > +--
> >  src/egl/main/eglapi.c|  41 +
> >  src/egl/main/eglapi.h|   9 +
> >  src/egl/main/egldisplay.h|   1 +
> >  src/egl/main/eglimage.c  |  63 ++-
> >  src/egl/main/eglimage.h  |  10 +-
> >  src/gallium/docs/source/screen.rst   |   2 +
> >  src/gallium/drivers/freedreno/freedreno_screen.c |   1 +
> >  src/gallium/drivers/i915/i915_screen.c   |   1 +
> >  src/gallium/drivers/ilo/ilo_screen.c |   1 +
> >  src/gallium/drivers/llvmpipe/lp_screen.c |   1 +
> >  src/gallium/drivers/nouveau/nv30/nv30_screen.c   |   1 +
> >  src/gallium/drivers/nouveau/nv50/nv50_screen.c   |   1 +
> >  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   |   1 +
> >  src/gallium/drivers/r300/r300_screen.c   |   1 +
> >  src/gallium/drivers/r600/r600_pipe.c |   1 +
> >  src/gallium/drivers/radeonsi/si_pipe.c   |   1 +
> >  src/gallium/drivers/softpipe/sp_screen.c |   1 +
> >  src/gallium/drivers/svga/svga_screen.c   |   1 +
> >  src/gallium/drivers/swr/swr_screen.cpp   |   1 +
> >  src/gallium/drivers/vc4/vc4_screen.c |   1 +
> >  src/gallium/drivers/virgl/virgl_screen.c |   1 +
> >  src/gallium/include/pipe/p_defines.h |   1 +
> >  src/gallium/include/pipe/p_screen.h  |   7 +
> >  src/gallium/include/state_tracker/drm_driver.h   |   2 +
> >  src/gallium/state_trackers/dri/dri2.c|  63 ++-
> >  28 files changed, 487 insertions(+), 27 deletions(-)
> >
> > --
> > 2.6.2
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Stable release process

2016-11-15 Thread Marek Olšák
On Tue, Nov 15, 2016 at 5:30 PM, Emil Velikov  wrote:
> On 15 November 2016 at 16:13, Marek Olšák  wrote:
>> I think that if people add the Cc stable tag to patches that are going
>> to land in master first, they shouldn't send it to the stable ML,
>> because that is redundant. Yet, many people do that. I would go even
>> further and say that any unreviewed patches shouldn't be sent to the
>> stable ML. At least that would be my policy I were the release
>> manager.
>>
> Since I'm no longer tracking nominated-but-not-merged-in-master
> patches things are noticeably better.

What about patches in mesa-stable that can't be merged to master,
because master needs to be fixed differently? Will you then apply the
patches from mesa-stable or ignore them?

Based on experience, it looks like you ignore them completely, which
is why many fixes that I sent for inclusion to stable branches only
(not master) have never been applied. This process needs to be fixed.

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


Re: [Mesa-dev] [PATCH 1/3] swr: add support for upper-left fragcoord position

2016-11-15 Thread Rowley, Timothy O
Reviewed-by: Tim Rowley 
mailto:timothy.o.row...@intel.com>>

On Nov 14, 2016, at 7:03 PM, Ilia Mirkin 
mailto:imir...@alum.mit.edu>> wrote:

Fixes glsl-arb-fragment-coord-conventions.

Signed-off-by: Ilia Mirkin mailto:imir...@alum.mit.edu>>
---
src/gallium/drivers/swr/swr_shader.cpp | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/swr/swr_shader.cpp 
b/src/gallium/drivers/swr/swr_shader.cpp
index f639df3..e4f9796 100644
--- a/src/gallium/drivers/swr/swr_shader.cpp
+++ b/src/gallium/drivers/swr/swr_shader.cpp
@@ -500,8 +500,14 @@ BuilderSWR::CompileFS(struct swr_context *ctx, 
swr_jit_fs_key &key)
 inputs[attrib][3] = wrap(VIMMED1(1.0f));
 continue;
  } else if (semantic_name == TGSI_SEMANTIC_POSITION) { // gl_FragCoord
- inputs[attrib][0] = wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vX, 
PixelPositions_center}, "vX"));
- inputs[attrib][1] = wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vY, 
PixelPositions_center}, "vY"));
+ if (swr_fs->info.base.properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER] 
==
+ TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER) {
+inputs[attrib][0] = wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vX, 
PixelPositions_center}, "vX"));
+inputs[attrib][1] = wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vY, 
PixelPositions_center}, "vY"));
+ } else {
+inputs[attrib][0] = wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vX, 
PixelPositions_UL}, "vX"));
+inputs[attrib][1] = wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vY, 
PixelPositions_UL}, "vY"));
+ }
 inputs[attrib][2] = wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vZ}, "vZ"));
 inputs[attrib][3] =
wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vOneOverW, 
PixelPositions_center}, "vOneOverW"));
--
2.7.3


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


Re: [Mesa-dev] [PATCH 2/3] swr: always enable adding start/base vertex to gl_VertexId

2016-11-15 Thread Rowley, Timothy O
Reviewed-by: Tim Rowley 
mailto:timothy.o.row...@intel.com>>

On Nov 14, 2016, at 7:03 PM, Ilia Mirkin 
mailto:imir...@alum.mit.edu>> wrote:

Fixes gl-3.2-basevertex-vertexid

Signed-off-by: Ilia Mirkin mailto:imir...@alum.mit.edu>>
---
src/gallium/drivers/swr/swr_state.cpp | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/swr/swr_state.cpp 
b/src/gallium/drivers/swr/swr_state.cpp
index 2c7f3be..8038ef5 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -447,6 +447,7 @@ swr_create_vertex_elements_state(struct pipe_context *pipe,
   assert(num_elements <= PIPE_MAX_ATTRIBS);
   velems = CALLOC_STRUCT(swr_vertex_element_state);
   if (velems) {
+  velems->fsState.bVertexIDOffsetEnable = true;
  velems->fsState.numAttribs = num_elements;
  for (unsigned i = 0; i < num_elements; i++) {
 // XXX: we should do this keyed on the VS usage info
--
2.7.3


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


Re: [Mesa-dev] [PATCH 3/3] swr: mark color clamping as unsupported

2016-11-15 Thread Rowley, Timothy O
Reviewed-by: Tim Rowley 
mailto:timothy.o.row...@intel.com>>

On Nov 14, 2016, at 7:03 PM, Ilia Mirkin 
mailto:imir...@alum.mit.edu>> wrote:

There is no functionality in swr to clamp either vertex or frag colors.
This could be added in swr_shader, at which point these could be
re-enabled.

Fixes arb_color_buffer_float-render

Signed-off-by: Ilia Mirkin mailto:imir...@alum.mit.edu>>
---
src/gallium/drivers/swr/swr_screen.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/swr/swr_screen.cpp 
b/src/gallium/drivers/swr/swr_screen.cpp
index e52f8d2..0b1d61d 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -235,8 +235,9 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
   case PIPE_CAP_TEXTURE_BARRIER:
  return 0;
   case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
-   case PIPE_CAP_VERTEX_COLOR_UNCLAMPED: /* draw module */
-   case PIPE_CAP_VERTEX_COLOR_CLAMPED: /* draw module */
+   case PIPE_CAP_VERTEX_COLOR_CLAMPED:
+  return 0;
+   case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
  return 1;
   case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
  return 1;
--
2.7.3


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


Re: [Mesa-dev] softpipe and PIPE_CAP_MIXED_COLORBUFFER_FORMATS?

2016-11-15 Thread Roland Scheidegger
Am 14.11.2016 um 20:15 schrieb A223 A223:
> My application requires PIPE_CAP_MIXED_COLORBUFFER_FORMATS and I
> noticed that it is not enabled for softpipe. I hardcoded it to be
> turned on and did not notice any ill effects so far.
> 
> Is it necessary that PIPE_CAP_MIXED_COLORBUFFER_FORMATS be disabled
> for softpipe?

Off-hand I wouldn't know of a reason why that shouldn't work.
softpipe renders everything to rgba32f tiles anyway, then converts when
loading/storing these tiles. Tile cache is per rt so should be
completely independent.
A better answer would probably involve a piglit run :-).

Roland


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


Re: [Mesa-dev] [PATCH 02/14] swr: [rasterizer memory] round up when dividing by block sizes

2016-11-15 Thread Cherniak, Bruce
Sorry, yes, I was aware of the updated patch.  What I meant (in not enough 
words apparently) is that a change like this could affect other users of the 
core and need to go through full CI.  We’ve run CI on the updated patch and it 
passes.

So, yes, please go ahead and send that one out.  Reviewing it will be quick 
with testing already done.

On Nov 14, 2016, at 10:50 PM, Ilia Mirkin 
mailto:imir...@alum.mit.edu>> wrote:


I think you're aware, but I actually have an updated version of this patch on 
my branch. Let me know if you want me to send it out.

The issue is that the texture width/height need not be a multiple of the 
format's block size. However mip sizes are computed based on that unrounded 
size.

On Nov 14, 2016 8:45 PM, "Cherniak, Bruce" 
mailto:bruce.chern...@intel.com>> wrote:
We need to run this through CI for all core users.

> On Nov 12, 2016, at 5:00 PM, Ilia Mirkin 
> mailto:imir...@alum.mit.edu>> wrote:
>
> There's no guarantee that mip width/height will be a multiple of the
> compressed block size. Make sure to round up when dividing.
>
> Signed-off-by: Ilia Mirkin mailto:imir...@alum.mit.edu>>
> ---
>
> Note - I don't actually need this. An earlier version of my patches needed
> something like this. However since it's a real fix, I figured I'd include
> it here.
>
> .../drivers/swr/rasterizer/memory/TilingFunctions.h   | 15 ---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h 
> b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
> index 0694a99..710bfb3 100644
> --- a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
> +++ b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
> @@ -276,7 +276,10 @@ INLINE void ComputeLODOffset1D(
> uint32_t curWidth = baseWidth;
> // translate mip width from pixels to blocks for block compressed 
> formats
> // @note hAlign is already in blocks for compressed formats so no 
> need to convert
> -if (info.isBC) curWidth /= info.bcWidth;
> +if (info.isBC)
> +{
> +curWidth = GFX_ALIGN(curWidth, info.bcWidth) / info.bcWidth;
> +}
>
> offset = GFX_ALIGN(curWidth, hAlign);
> for (uint32_t l = 1; l < lod; ++l)
> @@ -314,7 +317,10 @@ INLINE void ComputeLODOffsetX(
> uint32_t curWidth = baseWidth;
> // convert mip width from pixels to blocks for block compressed 
> formats
> // @note hAlign is already in blocks for compressed formats so no 
> need to convert
> -if (info.isBC) curWidth /= info.bcWidth;
> +if (info.isBC)
> +{
> +curWidth = GFX_ALIGN(curWidth, info.bcWidth) / info.bcWidth;
> +}
>
> curWidth = std::max(curWidth >> 1, 1U);
> curWidth = GFX_ALIGN(curWidth, hAlign);
> @@ -352,7 +358,10 @@ INLINE void ComputeLODOffsetY(
>
> // translate mip height from pixels to blocks for block compressed 
> formats
> // @note VAlign is already in blocks for compressed formats so no 
> need to convert
> -if (info.isBC) mipHeight /= info.bcHeight;
> +if (info.isBC)
> +{
> +mipHeight = GFX_ALIGN(mipHeight, info.bcHeight) / info.bcHeight;
> +}
>
> for (uint32_t l = 1; l <= lod; ++l)
> {
> --
> 2.7.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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


Re: [Mesa-dev] [PATCH 00/13] implement EGL_EXT_image_dma_buf_import_modifiers

2016-11-15 Thread Marek Olšák
On Tue, Nov 15, 2016 at 5:58 PM, Rob Clark  wrote:
> On Tue, Nov 15, 2016 at 11:44 AM, Marek Olšák  wrote:
>>
>> Hi,
>>
>> Is the modifier just a driver-specific description of the tiling
>> layout and compression?
>>
>> What makes you think that 8 bytes is enough to describe that? What if
>> I need 9 bytes just to program the display hardware?
>>
>> Drivers importing DMABUFs still have to invoke the texture tiling
>> calculator to get all necessary parameters for rendering (not just
>> display), which may even be 128 bytes per plane.
>
> fwiw, this maps 1:1 to addfb2 ioctl, and just brings egl to parity with kms.
>
> Maybe the addfb2 approach wasn't the best idea compared to some of the
> ideas proposed for hypothetical "liballoc" for being ultra-generic.
> OTOH perhaps you can just treat it like an enum?  I mean maybe the set
> of tiled formats that you would actually exchange with another device
> is less than 2^^72.  It seems reasonable to restrict the possible
> tiled formats supported by this extension to only things that can be
> exchanged with i965..

For tile modes alone, 64 bits seem enough.

For compression, you may need a separate buffer to hold compression
data, so now you have to encode the tile mode and other parameters of
the plane, parameters of the compression buffer, and possibly also the
pitch and offset of the compression buffer.

I'm not saying it can't be done, but it wouldn't be nice.

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


Re: [Mesa-dev] [PATCH 10/13] gallium: introduce format modifier querying

2016-11-15 Thread Roland Scheidegger
It looks like there aren't any possible modifier bits defined, so how is
this supposed to work?

Roland

Am 15.11.2016 um 15:24 schrieb Varad Gautam:
> From: Varad Gautam 
> 
> drivers should implement pipe_screen->get_modifiers_for_format and
> advertise it with PIPE_CAP_QUERY_DMABUF_MODIFIERS to support format
> modifier queries.
> 
> Signed-off-by: Varad Gautam 
> ---
>  src/gallium/docs/source/screen.rst   | 2 ++
>  src/gallium/drivers/freedreno/freedreno_screen.c | 1 +
>  src/gallium/drivers/i915/i915_screen.c   | 1 +
>  src/gallium/drivers/ilo/ilo_screen.c | 1 +
>  src/gallium/drivers/llvmpipe/lp_screen.c | 1 +
>  src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 1 +
>  src/gallium/drivers/nouveau/nv50/nv50_screen.c   | 1 +
>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   | 1 +
>  src/gallium/drivers/r300/r300_screen.c   | 1 +
>  src/gallium/drivers/r600/r600_pipe.c | 1 +
>  src/gallium/drivers/radeonsi/si_pipe.c   | 1 +
>  src/gallium/drivers/softpipe/sp_screen.c | 1 +
>  src/gallium/drivers/svga/svga_screen.c   | 1 +
>  src/gallium/drivers/swr/swr_screen.cpp   | 1 +
>  src/gallium/drivers/vc4/vc4_screen.c | 1 +
>  src/gallium/drivers/virgl/virgl_screen.c | 1 +
>  src/gallium/include/pipe/p_defines.h | 1 +
>  src/gallium/include/pipe/p_screen.h  | 7 +++
>  18 files changed, 25 insertions(+)
> 
> diff --git a/src/gallium/docs/source/screen.rst 
> b/src/gallium/docs/source/screen.rst
> index 6ad2bec..1775fe3 100644
> --- a/src/gallium/docs/source/screen.rst
> +++ b/src/gallium/docs/source/screen.rst
> @@ -364,6 +364,8 @@ The integer capabilities:
>  * ``PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS``: Whether interleaved stream
>output mode is able to interleave across buffers. This is required for
>ARB_transform_feedback3.
> +* ``PIPE_CAP_QUERY_DMABUF_MODIFIERS``: Whether the driver supports modifier
> +  queries for a given format.
>  
>  
>  .. _pipe_capf:
> diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
> b/src/gallium/drivers/freedreno/freedreno_screen.c
> index 97da0d7..2786d45 100644
> --- a/src/gallium/drivers/freedreno/freedreno_screen.c
> +++ b/src/gallium/drivers/freedreno/freedreno_screen.c
> @@ -288,6 +288,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum 
> pipe_cap param)
>   case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
>   case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
>   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
> + case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
>   return 0;
>  
>   case PIPE_CAP_MAX_VIEWPORTS:
> diff --git a/src/gallium/drivers/i915/i915_screen.c 
> b/src/gallium/drivers/i915/i915_screen.c
> index bfadca3..ce42e04 100644
> --- a/src/gallium/drivers/i915/i915_screen.c
> +++ b/src/gallium/drivers/i915/i915_screen.c
> @@ -278,6 +278,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
> cap)
> case PIPE_CAP_MAX_WINDOW_RECTANGLES:
> case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
> case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
> +   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
>return 0;
>  
> case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
> diff --git a/src/gallium/drivers/ilo/ilo_screen.c 
> b/src/gallium/drivers/ilo/ilo_screen.c
> index f3f182c..05fc906 100644
> --- a/src/gallium/drivers/ilo/ilo_screen.c
> +++ b/src/gallium/drivers/ilo/ilo_screen.c
> @@ -517,6 +517,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap 
> param)
> case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
> case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
> case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
> +   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
>return 0;
>  
> case PIPE_CAP_VENDOR_ID:
> diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
> b/src/gallium/drivers/llvmpipe/lp_screen.c
> index 4b502f0..2a8fa76 100644
> --- a/src/gallium/drivers/llvmpipe/lp_screen.c
> +++ b/src/gallium/drivers/llvmpipe/lp_screen.c
> @@ -338,6 +338,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
> pipe_cap param)
> case PIPE_CAP_MAX_WINDOW_RECTANGLES:
> case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
> case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
> +   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
>return 0;
> }
> /* should only get here on unhandled cases */
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c 
> b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> index 96708c0..6ba768b 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> @@ -203,6 +203,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum 
> pipe_cap param)
> case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
> case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
> case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
> +   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
>return 0;
>  
> case PIPE_CAP_VENDOR_ID:
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c 

[Mesa-dev] [Bug 97879] [amdgpu] Rocket League: long hangs (several seconds) when loading assets (models/textures/shaders?)

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97879

--- Comment #45 from Gregor Münch  ---
No change with GIT of today. Slowdowns remain the same.

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


Re: [Mesa-dev] [PATCH 00/13] implement EGL_EXT_image_dma_buf_import_modifiers

2016-11-15 Thread Rob Clark
On Tue, Nov 15, 2016 at 12:17 PM, Marek Olšák  wrote:
> On Tue, Nov 15, 2016 at 5:58 PM, Rob Clark  wrote:
>> On Tue, Nov 15, 2016 at 11:44 AM, Marek Olšák  wrote:
>>>
>>> Hi,
>>>
>>> Is the modifier just a driver-specific description of the tiling
>>> layout and compression?
>>>
>>> What makes you think that 8 bytes is enough to describe that? What if
>>> I need 9 bytes just to program the display hardware?
>>>
>>> Drivers importing DMABUFs still have to invoke the texture tiling
>>> calculator to get all necessary parameters for rendering (not just
>>> display), which may even be 128 bytes per plane.
>>
>> fwiw, this maps 1:1 to addfb2 ioctl, and just brings egl to parity with kms.
>>
>> Maybe the addfb2 approach wasn't the best idea compared to some of the
>> ideas proposed for hypothetical "liballoc" for being ultra-generic.
>> OTOH perhaps you can just treat it like an enum?  I mean maybe the set
>> of tiled formats that you would actually exchange with another device
>> is less than 2^^72.  It seems reasonable to restrict the possible
>> tiled formats supported by this extension to only things that can be
>> exchanged with i965..
>
> For tile modes alone, 64 bits seem enough.
>
> For compression, you may need a separate buffer to hold compression
> data, so now you have to encode the tile mode and other parameters of
> the plane, parameters of the compression buffer, and possibly also the
> pitch and offset of the compression buffer.
>
> I'm not saying it can't be done, but it wouldn't be nice.

Perhaps pass the compression buffer as a separate plane?  Then it gets
it's own dmabuf fd, and stride (and offset incase it really is a
single buffer) plus 64b modifier..

BR,
-R

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


Re: [Mesa-dev] [PATCH 02/14] swr: [rasterizer memory] round up when dividing by block sizes

2016-11-15 Thread Ilia Mirkin
Ah OK. Yeah - I fully expect you to be running all these changes
through some qualification process. You have other users, and other
hardware. My hope is that you're running this through your target
applications and making sure they don't regress. I'm mostly just
worried about correctness for now.

Will send the v2 later today.

Cheers,

  -ilia

On Tue, Nov 15, 2016 at 12:13 PM, Cherniak, Bruce
 wrote:
> Sorry, yes, I was aware of the updated patch.  What I meant (in not enough
> words apparently) is that a change like this could affect other users of the
> core and need to go through full CI.  We’ve run CI on the updated patch and
> it passes.
>
> So, yes, please go ahead and send that one out.  Reviewing it will be quick
> with testing already done.
>
> On Nov 14, 2016, at 10:50 PM, Ilia Mirkin  wrote:
>
> I think you're aware, but I actually have an updated version of this patch
> on my branch. Let me know if you want me to send it out.
>
> The issue is that the texture width/height need not be a multiple of the
> format's block size. However mip sizes are computed based on that unrounded
> size.
>
>
> On Nov 14, 2016 8:45 PM, "Cherniak, Bruce"  wrote:
>>
>> We need to run this through CI for all core users.
>>
>> > On Nov 12, 2016, at 5:00 PM, Ilia Mirkin  wrote:
>> >
>> > There's no guarantee that mip width/height will be a multiple of the
>> > compressed block size. Make sure to round up when dividing.
>> >
>> > Signed-off-by: Ilia Mirkin 
>> > ---
>> >
>> > Note - I don't actually need this. An earlier version of my patches
>> > needed
>> > something like this. However since it's a real fix, I figured I'd
>> > include
>> > it here.
>> >
>> > .../drivers/swr/rasterizer/memory/TilingFunctions.h   | 15
>> > ---
>> > 1 file changed, 12 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
>> > b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
>> > index 0694a99..710bfb3 100644
>> > --- a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
>> > +++ b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
>> > @@ -276,7 +276,10 @@ INLINE void ComputeLODOffset1D(
>> > uint32_t curWidth = baseWidth;
>> > // translate mip width from pixels to blocks for block
>> > compressed formats
>> > // @note hAlign is already in blocks for compressed formats so
>> > no need to convert
>> > -if (info.isBC) curWidth /= info.bcWidth;
>> > +if (info.isBC)
>> > +{
>> > +curWidth = GFX_ALIGN(curWidth, info.bcWidth) /
>> > info.bcWidth;
>> > +}
>> >
>> > offset = GFX_ALIGN(curWidth, hAlign);
>> > for (uint32_t l = 1; l < lod; ++l)
>> > @@ -314,7 +317,10 @@ INLINE void ComputeLODOffsetX(
>> > uint32_t curWidth = baseWidth;
>> > // convert mip width from pixels to blocks for block compressed
>> > formats
>> > // @note hAlign is already in blocks for compressed formats so
>> > no need to convert
>> > -if (info.isBC) curWidth /= info.bcWidth;
>> > +if (info.isBC)
>> > +{
>> > +curWidth = GFX_ALIGN(curWidth, info.bcWidth) /
>> > info.bcWidth;
>> > +}
>> >
>> > curWidth = std::max(curWidth >> 1, 1U);
>> > curWidth = GFX_ALIGN(curWidth, hAlign);
>> > @@ -352,7 +358,10 @@ INLINE void ComputeLODOffsetY(
>> >
>> > // translate mip height from pixels to blocks for block
>> > compressed formats
>> > // @note VAlign is already in blocks for compressed formats so
>> > no need to convert
>> > -if (info.isBC) mipHeight /= info.bcHeight;
>> > +if (info.isBC)
>> > +{
>> > +mipHeight = GFX_ALIGN(mipHeight, info.bcHeight) /
>> > info.bcHeight;
>> > +}
>> >
>> > for (uint32_t l = 1; l <= lod; ++l)
>> > {
>> > --
>> > 2.7.3
>> >
>> > ___
>> > mesa-dev mailing list
>> > mesa-dev@lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 10/13] gallium: introduce format modifier querying

2016-11-15 Thread Rob Clark
see drm_fourcc.h (if the extension txt didn't mention that, perhaps it should)

BR,
-R

On Tue, Nov 15, 2016 at 12:23 PM, Roland Scheidegger  wrote:
> It looks like there aren't any possible modifier bits defined, so how is
> this supposed to work?
>
> Roland
>
> Am 15.11.2016 um 15:24 schrieb Varad Gautam:
>> From: Varad Gautam 
>>
>> drivers should implement pipe_screen->get_modifiers_for_format and
>> advertise it with PIPE_CAP_QUERY_DMABUF_MODIFIERS to support format
>> modifier queries.
>>
>> Signed-off-by: Varad Gautam 
>> ---
>>  src/gallium/docs/source/screen.rst   | 2 ++
>>  src/gallium/drivers/freedreno/freedreno_screen.c | 1 +
>>  src/gallium/drivers/i915/i915_screen.c   | 1 +
>>  src/gallium/drivers/ilo/ilo_screen.c | 1 +
>>  src/gallium/drivers/llvmpipe/lp_screen.c | 1 +
>>  src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 1 +
>>  src/gallium/drivers/nouveau/nv50/nv50_screen.c   | 1 +
>>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   | 1 +
>>  src/gallium/drivers/r300/r300_screen.c   | 1 +
>>  src/gallium/drivers/r600/r600_pipe.c | 1 +
>>  src/gallium/drivers/radeonsi/si_pipe.c   | 1 +
>>  src/gallium/drivers/softpipe/sp_screen.c | 1 +
>>  src/gallium/drivers/svga/svga_screen.c   | 1 +
>>  src/gallium/drivers/swr/swr_screen.cpp   | 1 +
>>  src/gallium/drivers/vc4/vc4_screen.c | 1 +
>>  src/gallium/drivers/virgl/virgl_screen.c | 1 +
>>  src/gallium/include/pipe/p_defines.h | 1 +
>>  src/gallium/include/pipe/p_screen.h  | 7 +++
>>  18 files changed, 25 insertions(+)
>>
>> diff --git a/src/gallium/docs/source/screen.rst 
>> b/src/gallium/docs/source/screen.rst
>> index 6ad2bec..1775fe3 100644
>> --- a/src/gallium/docs/source/screen.rst
>> +++ b/src/gallium/docs/source/screen.rst
>> @@ -364,6 +364,8 @@ The integer capabilities:
>>  * ``PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS``: Whether interleaved stream
>>output mode is able to interleave across buffers. This is required for
>>ARB_transform_feedback3.
>> +* ``PIPE_CAP_QUERY_DMABUF_MODIFIERS``: Whether the driver supports modifier
>> +  queries for a given format.
>>
>>
>>  .. _pipe_capf:
>> diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
>> b/src/gallium/drivers/freedreno/freedreno_screen.c
>> index 97da0d7..2786d45 100644
>> --- a/src/gallium/drivers/freedreno/freedreno_screen.c
>> +++ b/src/gallium/drivers/freedreno/freedreno_screen.c
>> @@ -288,6 +288,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum 
>> pipe_cap param)
>>   case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
>>   case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
>>   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
>> + case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
>>   return 0;
>>
>>   case PIPE_CAP_MAX_VIEWPORTS:
>> diff --git a/src/gallium/drivers/i915/i915_screen.c 
>> b/src/gallium/drivers/i915/i915_screen.c
>> index bfadca3..ce42e04 100644
>> --- a/src/gallium/drivers/i915/i915_screen.c
>> +++ b/src/gallium/drivers/i915/i915_screen.c
>> @@ -278,6 +278,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
>> cap)
>> case PIPE_CAP_MAX_WINDOW_RECTANGLES:
>> case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
>> case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
>> +   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
>>return 0;
>>
>> case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
>> diff --git a/src/gallium/drivers/ilo/ilo_screen.c 
>> b/src/gallium/drivers/ilo/ilo_screen.c
>> index f3f182c..05fc906 100644
>> --- a/src/gallium/drivers/ilo/ilo_screen.c
>> +++ b/src/gallium/drivers/ilo/ilo_screen.c
>> @@ -517,6 +517,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap 
>> param)
>> case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
>> case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
>> case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
>> +   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
>>return 0;
>>
>> case PIPE_CAP_VENDOR_ID:
>> diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
>> b/src/gallium/drivers/llvmpipe/lp_screen.c
>> index 4b502f0..2a8fa76 100644
>> --- a/src/gallium/drivers/llvmpipe/lp_screen.c
>> +++ b/src/gallium/drivers/llvmpipe/lp_screen.c
>> @@ -338,6 +338,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
>> pipe_cap param)
>> case PIPE_CAP_MAX_WINDOW_RECTANGLES:
>> case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
>> case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
>> +   case PIPE_CAP_QUERY_DMABUF_MODIFIERS:
>>return 0;
>> }
>> /* should only get here on unhandled cases */
>> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c 
>> b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
>> index 96708c0..6ba768b 100644
>> --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
>> +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
>> @@ -203,6 +203,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum 
>> pipe_cap param)
>> case PIPE_CAP_VIEWPORT_SUBPIXEL_BI

Re: [Mesa-dev] [PATCH 13/14] swr: remove formats from mapping table that don't have StoreTile impls

2016-11-15 Thread Cherniak, Bruce
You’re absolutely correct, the gallivm sampler supports all formats regardless 
of our table.  I stand corrected.

Reviewed-by: Bruce Cherniak 
mailto:bruce.chern...@intel.com>>

On Nov 14, 2016, at 10:38 PM, Ilia Mirkin 
mailto:imir...@alum.mit.edu>> wrote:


All formats are supported by the gallivm texturing logic (except some 
compressed ones). Swr backend only needs to know about the format for 
rendering, not texturing. Makes sense to me just list the renderable ones here.

If you want a reminder of which formats could be renderable but aren't, how 
about leaving all those in a comment?

Either way, the most important change is to remove all the l/la/i swr format 
enums (I.e. make the function return -1) since they only have load, not store 
implementations. If you still disagree with the above reasoning, I'll redo that 
bit of the series.

On Nov 14, 2016 8:47 PM, "Cherniak, Bruce" 
mailto:bruce.chern...@intel.com>> wrote:
This table lists all supported formats (both renderable and texturable).

swr_texture_layout calls mesa_to_swr_format to convert the PIPE_FORMAT_* to the 
appropriate SWR_FORMAT enum.  Removing these entries would result in -1 
(unsupported format).  We might need to add a “is_renderable” field to the 
table for its use in swr_is_format_supported, but I believe these formats 
should remain.

Although, it looks like you highlighted another bug, swr_texture_layout should 
return false with an early test for mesa_to_swr_format(fmt), rather than 
continuing on.


> On Nov 12, 2016, at 5:00 PM, Ilia Mirkin 
> mailto:imir...@alum.mit.edu>> wrote:
>
> This table exists for the purpose of determining renderable formats.
> Without a StoreTile implementation, that can't happen.
>
> This basically removes rendering support to all L/LA/I formats. They can
> be re-added when/if StoreTile implementations are added.
>
> Signed-off-by: Ilia Mirkin mailto:imir...@alum.mit.edu>>
> ---
> src/gallium/drivers/swr/swr_screen.cpp | 86 +++---
> 1 file changed, 48 insertions(+), 38 deletions(-)
>
> diff --git a/src/gallium/drivers/swr/swr_screen.cpp 
> b/src/gallium/drivers/swr/swr_screen.cpp
> index 98f5e44..9e80e94 100644
> --- a/src/gallium/drivers/swr/swr_screen.cpp
> +++ b/src/gallium/drivers/swr/swr_screen.cpp
> @@ -427,12 +427,7 @@ mesa_to_swr_format(enum pipe_format format)
>   {PIPE_FORMAT_B4G4R4A4_UNORM, B4G4R4A4_UNORM},
>   {PIPE_FORMAT_B5G6R5_UNORM,   B5G6R5_UNORM},
>   {PIPE_FORMAT_R10G10B10A2_UNORM,  R10G10B10A2_UNORM},
> -  {PIPE_FORMAT_L8_UNORM,   L8_UNORM},
>   {PIPE_FORMAT_A8_UNORM,   A8_UNORM},
> -  {PIPE_FORMAT_I8_UNORM,   I8_UNORM},
> -  {PIPE_FORMAT_L8A8_UNORM, L8A8_UNORM},
> -  {PIPE_FORMAT_L16_UNORM,  L16_UNORM},
> -  {PIPE_FORMAT_UYVY,   YCRCB_SWAPUVY},
>   {PIPE_FORMAT_Z16_UNORM,  R16_UNORM}, // z
>   {PIPE_FORMAT_Z32_FLOAT,  R32_FLOAT}, // z
>   {PIPE_FORMAT_Z24_UNORM_S8_UINT,  R24_UNORM_X8_TYPELESS}, // z
> @@ -486,26 +481,11 @@ mesa_to_swr_format(enum pipe_format format)
>   {PIPE_FORMAT_R16G16B16_FLOAT,R16G16B16_FLOAT},
>   {PIPE_FORMAT_R16G16B16A16_FLOAT, R16G16B16A16_FLOAT},
>
> -  {PIPE_FORMAT_L8_SRGB,L8_UNORM_SRGB},
> -  {PIPE_FORMAT_L8A8_SRGB,  L8A8_UNORM_SRGB},
>   {PIPE_FORMAT_R8G8B8_SRGB,R8G8B8_UNORM_SRGB},
>   {PIPE_FORMAT_B8G8R8A8_SRGB,  B8G8R8A8_UNORM_SRGB},
>   {PIPE_FORMAT_B8G8R8X8_SRGB,  B8G8R8X8_UNORM_SRGB},
>   {PIPE_FORMAT_R8G8B8A8_SRGB,  R8G8B8A8_UNORM_SRGB},
>
> -  {PIPE_FORMAT_DXT1_RGBA,  BC1_UNORM},
> -  {PIPE_FORMAT_DXT3_RGBA,  BC2_UNORM},
> -  {PIPE_FORMAT_DXT5_RGBA,  BC3_UNORM},
> -
> -  {PIPE_FORMAT_DXT1_SRGBA, BC1_UNORM_SRGB},
> -  {PIPE_FORMAT_DXT3_SRGBA, BC2_UNORM_SRGB},
> -  {PIPE_FORMAT_DXT5_SRGBA, BC3_UNORM_SRGB},
> -
> -  {PIPE_FORMAT_RGTC1_UNORM,BC4_UNORM},
> -  {PIPE_FORMAT_RGTC1_SNORM,BC4_SNORM},
> -  {PIPE_FORMAT_RGTC2_UNORM,BC5_UNORM},
> -  {PIPE_FORMAT_RGTC2_SNORM,BC5_SNORM},
> -
>   {PIPE_FORMAT_B5G5R5X1_UNORM, B5G5R5X1_UNORM},
>   {PIPE_FORMAT_R10G10B10A2_USCALED,R10G10B10A2_USCALED},
>   {PIPE_FORMAT_R11G11B10_FLOAT,R11G11B10_FLOAT},
> @@ -514,18 +494,9 @@ mesa_to_swr_format(enum pipe_format format)
>   {PIPE_FORMAT_B10G10R10A2_UNORM,  B10G10R10A2_UNORM},
>   {PIPE_FORMAT_R8G8B8X8_UNORM, R8G8B8X8_UNORM},
>
> -  {PIPE_FORMAT_L16A16_UNORM,   L16A16_UNORM},
>   {PIPE_FORMAT_A16_UNORM,  A16_UNORM},
> -  {PIPE_FORMAT_I16_UNORM,  I16_UNORM},
> -
>   {PIPE_FORMAT_A16_FLOAT,  A16_FLOAT},
> -  {PIPE_FORMAT_L16_FLOAT,  L16_FLOAT},
> -  {PIPE_FORMAT_L16A16_FL

Re: [Mesa-dev] [PATCH 00/14] swr: resource-related (and misc) fixes

2016-11-15 Thread Cherniak, Bruce
CI results are complete.  Go ahead and push those I marked reviewed (all but 
patches 6 & 11).

On Nov 14, 2016, at 10:40 PM, Ilia Mirkin 
mailto:imir...@alum.mit.edu>> wrote:


Should I push the ones you mark as r-b or wait for a separate go-ahead based on 
CI results?

On Nov 14, 2016 8:45 PM, "Cherniak, Bruce" 
mailto:bruce.chern...@intel.com>> wrote:
Reviewing/commenting on each patch individually.  We’re also testing more 
thoroughly in our CI.

In general, your help and interest in OpenSWR is very much appreciated!


> On Nov 12, 2016, at 5:00 PM, Ilia Mirkin 
> mailto:imir...@alum.mit.edu>> wrote:
>
> This is a bit of a hodge-podge, but largely related to improving texture
> resource manipulation - mapping, texturing, rendering, etc. There's a WIP
> commit at the end which was required to make swr not crash on piglit exit
> half the time, but I think it needs to be redone in a proper way.
>
> The meat is in the "swr: rework resource layout and surface setup" commit.
> This redoes surface layout for swr to match with the rasterizer's
> expectations. This way we can tell it which array index or LOD to render to.
> This will also be important for layered rendering when GS support comes
> along. It also paves the way to supporting the swr backend's tiling to
> improve cache performance.
>
> Unfortunately it does mean more overhead for all textures, not just the
> renderable ones. I thought this was acceptable, as supporting multiple
> different layout mechanisms seems a little confusing.
>
> This series overall fixes ~600 piglit tests. You can see this series (+ one
> more commit that's not really ready) at
>
> http://github.com/imirkin/mesa/commits/swr
>
> I highly recommend testing this in your higher-core/higher-perf environments
> than my desktop SKL (or, *gasp*, SDE on a Core i7-920).
>
> Ilia Mirkin (14):
>  swr: [rasterizer memory] add support for R32_FLOAT_X8X24 formats
>  swr: [rasterizer memory] round up when dividing by block sizes
>  swr: [rasterizer memory] fix store tile for 128-bit ymajor tiling
>  swr: [rasterizer jitter] don't bother quantizing unused channels
>  swr: add archrast generated files to gitignore
>  swr: fix texture layout for compressed formats
>  swr: mark both frag and vert textures read, don't forget about cbs
>  swr: no support for shader stencil export
>  swr: mark rgb9_e5 as unrenderable
>  swr: disable blending for integer formats
>  swr: rework resource layout and surface setup
>  swr: remove unnecessary -1 entries in format mapping table
>  swr: remove formats from mapping table that don't have StoreTile impls
>  WIP swr: make sure that all rendering is finished on shader destroy
>
> src/gallium/drivers/swr/.gitignore |   4 +
> .../drivers/swr/rasterizer/jitter/blend_jit.cpp|   2 +-
> .../drivers/swr/rasterizer/memory/LoadTile.h   |   1 +
> .../drivers/swr/rasterizer/memory/StoreTile.h  |   3 +-
> .../swr/rasterizer/memory/TilingFunctions.h|  15 +-
> src/gallium/drivers/swr/swr_context.cpp| 108 --
> src/gallium/drivers/swr/swr_draw.cpp   |   4 +-
> src/gallium/drivers/swr/swr_resource.h |   8 +-
> src/gallium/drivers/swr/swr_screen.cpp | 397 +
> src/gallium/drivers/swr/swr_shader.cpp |  28 +-
> src/gallium/drivers/swr/swr_state.cpp  | 197 ++
> 11 files changed, 433 insertions(+), 334 deletions(-)
>
> --
> 2.7.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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


Re: [Mesa-dev] [PATCH 12/14] swr: remove unnecessary -1 entries in format mapping table

2016-11-15 Thread Cherniak, Bruce
As per our IRC discussion… 
Reviewed-by: Bruce Cherniak  

> On Nov 14, 2016, at 7:46 PM, Cherniak, Bruce  wrote:
> 
> For book-keeping, to know which formats we have left to support/enable, we’d 
> like to leave the -1 entries.  It’s a little clutter, but the sore thumb gets 
> the hammer.
> 
>> On Nov 12, 2016, at 5:00 PM, Ilia Mirkin  wrote:
>> 
>> Signed-off-by: Ilia Mirkin 
>> ---
>> src/gallium/drivers/swr/swr_screen.cpp | 126 
>> -
>> 1 file changed, 126 deletions(-)
>> 
>> diff --git a/src/gallium/drivers/swr/swr_screen.cpp 
>> b/src/gallium/drivers/swr/swr_screen.cpp
>> index 73deb03..98f5e44 100644
>> --- a/src/gallium/drivers/swr/swr_screen.cpp
>> +++ b/src/gallium/drivers/swr/swr_screen.cpp
>> @@ -421,11 +421,8 @@ SWR_FORMAT
>> mesa_to_swr_format(enum pipe_format format)
>> {
>>   static const std::map mesa2swr = {
>> -  {PIPE_FORMAT_NONE,   (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_B8G8R8A8_UNORM, B8G8R8A8_UNORM},
>>  {PIPE_FORMAT_B8G8R8X8_UNORM, B8G8R8X8_UNORM},
>> -  {PIPE_FORMAT_A8R8G8B8_UNORM, (SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_X8R8G8B8_UNORM, (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_B5G5R5A1_UNORM, B5G5R5A1_UNORM},
>>  {PIPE_FORMAT_B4G4R4A4_UNORM, B4G4R4A4_UNORM},
>>  {PIPE_FORMAT_B5G6R5_UNORM,   B5G6R5_UNORM},
>> @@ -436,35 +433,18 @@ mesa_to_swr_format(enum pipe_format format)
>>  {PIPE_FORMAT_L8A8_UNORM, L8A8_UNORM},
>>  {PIPE_FORMAT_L16_UNORM,  L16_UNORM},
>>  {PIPE_FORMAT_UYVY,   YCRCB_SWAPUVY},
>> -  {PIPE_FORMAT_YUYV,   (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_Z16_UNORM,  R16_UNORM}, // z
>> -  {PIPE_FORMAT_Z32_UNORM,  (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_Z32_FLOAT,  R32_FLOAT}, // z
>>  {PIPE_FORMAT_Z24_UNORM_S8_UINT,  R24_UNORM_X8_TYPELESS}, // z
>> -  {PIPE_FORMAT_S8_UINT_Z24_UNORM,  (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_Z24X8_UNORM,R24_UNORM_X8_TYPELESS}, // z
>> -  {PIPE_FORMAT_X8Z24_UNORM,(SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_S8_UINT,(SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R64_FLOAT,  (SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R64G64_FLOAT,   (SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R64G64B64_FLOAT,(SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R64G64B64A64_FLOAT, (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_R32_FLOAT,  R32_FLOAT},
>>  {PIPE_FORMAT_R32G32_FLOAT,   R32G32_FLOAT},
>>  {PIPE_FORMAT_R32G32B32_FLOAT,R32G32B32_FLOAT},
>>  {PIPE_FORMAT_R32G32B32A32_FLOAT, R32G32B32A32_FLOAT},
>> -  {PIPE_FORMAT_R32_UNORM,  (SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R32G32_UNORM,   (SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R32G32B32_UNORM,(SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R32G32B32A32_UNORM, (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_R32_USCALED,R32_USCALED},
>>  {PIPE_FORMAT_R32G32_USCALED, R32G32_USCALED},
>>  {PIPE_FORMAT_R32G32B32_USCALED,  R32G32B32_USCALED},
>>  {PIPE_FORMAT_R32G32B32A32_USCALED,   R32G32B32A32_USCALED},
>> -  {PIPE_FORMAT_R32_SNORM,  (SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R32G32_SNORM,   (SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R32G32B32_SNORM,(SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R32G32B32A32_SNORM, (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_R32_SSCALED,R32_SSCALED},
>>  {PIPE_FORMAT_R32G32_SSCALED, R32G32_SSCALED},
>>  {PIPE_FORMAT_R32G32B32_SSCALED,  R32G32B32_SSCALED},
>> @@ -489,7 +469,6 @@ mesa_to_swr_format(enum pipe_format format)
>>  {PIPE_FORMAT_R8G8_UNORM, R8G8_UNORM},
>>  {PIPE_FORMAT_R8G8B8_UNORM,   R8G8B8_UNORM},
>>  {PIPE_FORMAT_R8G8B8A8_UNORM, R8G8B8A8_UNORM},
>> -  {PIPE_FORMAT_X8B8G8R8_UNORM, (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_R8_USCALED, R8_USCALED},
>>  {PIPE_FORMAT_R8G8_USCALED,   R8G8_USCALED},
>>  {PIPE_FORMAT_R8G8B8_USCALED, R8G8B8_USCALED},
>> @@ -502,10 +481,6 @@ mesa_to_swr_format(enum pipe_format format)
>>  {PIPE_FORMAT_R8G8_SSCALED,   R8G8_SSCALED},
>>  {PIPE_FORMAT_R8G8B8_SSCALED, R8G8B8_SSCALED},
>>  {PIPE_FORMAT_R8G8B8A8_SSCALED,   R8G8B8A8_SSCALED},
>> -  {PIPE_FORMAT_R32_FIXED,  (SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R32G32_FIXED,   (SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R32G32B32_FIXED,(SWR_FORMAT)-1},
>> -  {PIPE_FORMAT_R32G32B32A32_FIXED, (SWR_FORMAT)-1},
>>  {PIPE_FORMAT_R16_FLOAT,  R16_FLOAT},
>>  {PIPE_FORMAT_R16G16_FLOAT,   R16G16_FLOAT},
>>  {PIPE_FORMAT_R16G16B16_FLOAT,R16G16B16_FLOAT},
>> @@ -514,20 +489,14 @@ mesa_to_swr_format(enum pipe_format format)
>>  {PIPE_FORMAT_L8_SRGB,L8_UNORM_SRGB},
>>  {PIPE_FORMAT_L8A8_

Re: [Mesa-dev] [PATCH 00/13] implement EGL_EXT_image_dma_buf_import_modifiers

2016-11-15 Thread Marek Olšák
On Tue, Nov 15, 2016 at 6:26 PM, Rob Clark  wrote:
> On Tue, Nov 15, 2016 at 12:17 PM, Marek Olšák  wrote:
>> On Tue, Nov 15, 2016 at 5:58 PM, Rob Clark  wrote:
>>> On Tue, Nov 15, 2016 at 11:44 AM, Marek Olšák  wrote:

 Hi,

 Is the modifier just a driver-specific description of the tiling
 layout and compression?

 What makes you think that 8 bytes is enough to describe that? What if
 I need 9 bytes just to program the display hardware?

 Drivers importing DMABUFs still have to invoke the texture tiling
 calculator to get all necessary parameters for rendering (not just
 display), which may even be 128 bytes per plane.
>>>
>>> fwiw, this maps 1:1 to addfb2 ioctl, and just brings egl to parity with kms.
>>>
>>> Maybe the addfb2 approach wasn't the best idea compared to some of the
>>> ideas proposed for hypothetical "liballoc" for being ultra-generic.
>>> OTOH perhaps you can just treat it like an enum?  I mean maybe the set
>>> of tiled formats that you would actually exchange with another device
>>> is less than 2^^72.  It seems reasonable to restrict the possible
>>> tiled formats supported by this extension to only things that can be
>>> exchanged with i965..
>>
>> For tile modes alone, 64 bits seem enough.
>>
>> For compression, you may need a separate buffer to hold compression
>> data, so now you have to encode the tile mode and other parameters of
>> the plane, parameters of the compression buffer, and possibly also the
>> pitch and offset of the compression buffer.
>>
>> I'm not saying it can't be done, but it wouldn't be nice.
>
> Perhaps pass the compression buffer as a separate plane?  Then it gets
> it's own dmabuf fd, and stride (and offset incase it really is a
> single buffer) plus 64b modifier..

And then I'd have to update all the window system protocols to get the
second plane for basic RGBA formats. Thank you very much, I'm not
interested.

Immutable metadata (modifiers) stored in the kernel is the only
scalable (and thus usable) solution here. There was an argument
against _mutable_ metadata attached to BOs and the synchronization
hell it can cause, but I've not seen any argument against _immutable_
metadata. Trying to push the metadata (modifiers) through window
system protocols seems like a horrible idea to me, not just because of
that fact that window system protocols shouldn't care about
driver-specific stuff, but also because of the immense burden once you
realize that you have to fix all window system protocols and KMS apps
because 64 bits of metadata is not enough to support your hardware.
It's clearly not economically sustainable.

That said, I'm OK with the patch series (I didn't read all of it - you
still need an ack from someone else), but widespread adoption of this
feature is unlikely to happen.

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


[Mesa-dev] [AppVeyor] mesa master #2692 failed

2016-11-15 Thread AppVeyor



Build mesa 2692 failed


Commit 358079da2d by Marek Olšák on 11/12/2016 10:10 PM:

radeonsi: set unsafe fpmath on FP instructions when allowed by R600_DEBUG\n\nReviewed-by: Nicolai Hähnle 


Configure your notification preferences

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


[Mesa-dev] Fwd: errors for mesa master Android build 554

2016-11-15 Thread Rob Herring
This commit breaks the build for Android. Looks like a prototype is
missing and LLVM is stricter.

Rob

commit 1a21d21580965eff751414d140b3c1762eb3
Author: Christian Gmeiner 
Date:   Thu Nov 3 15:25:21 2016 +0100

dri: make use of dri_get_extensions_name(..) helper

Signed-off-by: Christian Gmeiner 
Reviewed-by: Emil Velikov 

-- Forwarded message --
From:  
Date: Tue, Nov 15, 2016 at 11:02 AM
Subject: errors for mesa master Android build 554
To: rob.herr...@linaro.org


Build URL: https://ci.linaro.org/jenkins/job/robher-aosp/554/
Full log: https://ci.linaro.org/jenkins/job/robher-aosp/554/consoleText
Parsed warnings/errors:
https://ci.linaro.org/jenkins/job/robher-aosp/554/parsed_console

ERRORS:
W: GPG error: http://ppa.launchpad.net utopic Release: The following
signatures couldn't be verified because the public key is not
available: NO_PUBKEY F1FCBACA7BE1F97B
+ sudo apt-get install -y gcc-4.9-multilib bison git gperf
libxml2-utils python-mako zip time python-pycurl genisoimage patch
mtools libfdt-dev python-mako gettext openjdk-8-jdk
Reading package lists...
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
   get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
   ^ ~~
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
   get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
   ^ ~~
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:26: error:
implicit declaration of function 'dri_get_extensions_name' is invalid
in C99 [-Werror,-Wimplicit-function-declaration]
   get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
 ^
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
   get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
   ^ ~~
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:26: error: implicit
declaration of function 'dri_get_extensions_name' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
   get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
 ^
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
   get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
   ^ ~~
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
   get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
   ^ ~~
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
   get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
   ^ ~~
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:26: error:
implicit declaration of function 'dri_get_extensions_name' is invalid
in C99 [-Werror,-Wimplicit-function-declaration]
   get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
 ^
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
   get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
   ^ ~~
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:26: error: implicit
declaration of function 'dri_get_extensions_name' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
   get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
 ^
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
   get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
   ^ ~~
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Fwd: errors for mesa master Android build 554

2016-11-15 Thread Brian Paul
It also broke our in-house Jenkins build on Ubuntu.  Though, it's 
building OK on my local system.  Hmm.


  CC   dri_common.lo
../../../src/glx/dri_common.c: In function ‘driGetDriverExtensions’:
../../../src/glx/dri_common.c:164:32: error: implicit declaration of 
function ‘dri_get_extensions_name’ [-Werror=implicit-function-declaration]

char *get_extensions_name = dri_get_extensions_name(driver_name);
^
../../../src/glx/dri_common.c:164:32: warning: initialization makes 
pointer from integer without a cast [-Wint-conversion]

cc1: some warnings being treated as errors
Makefile:892: recipe for target 'dri_common.lo' failed

-Brian

On 11/15/2016 11:36 AM, Rob Herring wrote:

This commit breaks the build for Android. Looks like a prototype is
missing and LLVM is stricter.

Rob

commit 1a21d21580965eff751414d140b3c1762eb3
Author: Christian Gmeiner 
Date:   Thu Nov 3 15:25:21 2016 +0100

 dri: make use of dri_get_extensions_name(..) helper

 Signed-off-by: Christian Gmeiner 
 Reviewed-by: Emil Velikov 

-- Forwarded message --
From:  
Date: Tue, Nov 15, 2016 at 11:02 AM
Subject: errors for mesa master Android build 554
To: rob.herr...@linaro.org


Build URL: https://ci.linaro.org/jenkins/job/robher-aosp/554/
Full log: https://ci.linaro.org/jenkins/job/robher-aosp/554/consoleText
Parsed warnings/errors:
https://ci.linaro.org/jenkins/job/robher-aosp/554/parsed_console

ERRORS:
W: GPG error: http://ppa.launchpad.net utopic Release: The following
signatures couldn't be verified because the public key is not
available: NO_PUBKEY F1FCBACA7BE1F97B
+ sudo apt-get install -y gcc-4.9-multilib bison git gperf
libxml2-utils python-mako zip time python-pycurl genisoimage patch
mtools libfdt-dev python-mako gettext openjdk-8-jdk
Reading package lists...
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
^ ~~
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
^ ~~
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:26: error:
implicit declaration of function 'dri_get_extensions_name' is invalid
in C99 [-Werror,-Wimplicit-function-declaration]
get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
  ^
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
^ ~~
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:26: error: implicit
declaration of function 'dri_get_extensions_name' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
  ^
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
^ ~~
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
^ ~~
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
get_extensions_name = dri_get_extensions_name(dri->base.driver_name);
^ ~~
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:26: error:
implicit declaration of function 'dri_get_extensions_name' is invalid
in C99 [-Werror,-Wimplicit-function-declaration]
get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
  ^
external/mesa3d/src/egl/drivers/dri2/egl_dri2.c:517:24: error:
incompatible integer to pointer conversion assigning to 'char *' from
'int' [-Werror,-Wint-conversion]
get_extensions_name = dri_get_extensions_name(dri2_dpy->driver_name);
^ ~~
external/mesa3d/src/gbm/backends/dri/gbm_dri.c:366:26: error: implicit
declaration of function 'dri_get_extensions_nam

Re: [Mesa-dev] [PATCH 00/13] implement EGL_EXT_image_dma_buf_import_modifiers

2016-11-15 Thread Rob Clark
On Tue, Nov 15, 2016 at 1:04 PM, Marek Olšák  wrote:
> On Tue, Nov 15, 2016 at 6:26 PM, Rob Clark  wrote:
>> On Tue, Nov 15, 2016 at 12:17 PM, Marek Olšák  wrote:
>>> On Tue, Nov 15, 2016 at 5:58 PM, Rob Clark  wrote:
 On Tue, Nov 15, 2016 at 11:44 AM, Marek Olšák  wrote:
>
> Hi,
>
> Is the modifier just a driver-specific description of the tiling
> layout and compression?
>
> What makes you think that 8 bytes is enough to describe that? What if
> I need 9 bytes just to program the display hardware?
>
> Drivers importing DMABUFs still have to invoke the texture tiling
> calculator to get all necessary parameters for rendering (not just
> display), which may even be 128 bytes per plane.

 fwiw, this maps 1:1 to addfb2 ioctl, and just brings egl to parity with 
 kms.

 Maybe the addfb2 approach wasn't the best idea compared to some of the
 ideas proposed for hypothetical "liballoc" for being ultra-generic.
 OTOH perhaps you can just treat it like an enum?  I mean maybe the set
 of tiled formats that you would actually exchange with another device
 is less than 2^^72.  It seems reasonable to restrict the possible
 tiled formats supported by this extension to only things that can be
 exchanged with i965..
>>>
>>> For tile modes alone, 64 bits seem enough.
>>>
>>> For compression, you may need a separate buffer to hold compression
>>> data, so now you have to encode the tile mode and other parameters of
>>> the plane, parameters of the compression buffer, and possibly also the
>>> pitch and offset of the compression buffer.
>>>
>>> I'm not saying it can't be done, but it wouldn't be nice.
>>
>> Perhaps pass the compression buffer as a separate plane?  Then it gets
>> it's own dmabuf fd, and stride (and offset incase it really is a
>> single buffer) plus 64b modifier..
>
> And then I'd have to update all the window system protocols to get the
> second plane for basic RGBA formats. Thank you very much, I'm not
> interested.

afaiu weston already supports planar formats, and I know android does.
So really only a matter of fixing x11 ;-)

> Immutable metadata (modifiers) stored in the kernel is the only
> scalable (and thus usable) solution here. There was an argument
> against _mutable_ metadata attached to BOs and the synchronization
> hell it can cause, but I've not seen any argument against _immutable_
> metadata. Trying to push the metadata (modifiers) through window
> system protocols seems like a horrible idea to me, not just because of
> that fact that window system protocols shouldn't care about
> driver-specific stuff, but also because of the immense burden once you
> realize that you have to fix all window system protocols and KMS apps
> because 64 bits of metadata is not enough to support your hardware.
> It's clearly not economically sustainable.
>
> That said, I'm OK with the patch series (I didn't read all of it - you
> still need an ack from someone else), but widespread adoption of this
> feature is unlikely to happen.

I'm needing something like this for sharing tiled yuv buffers w/ video
decoder, so even outside of window-system it has some utility.

BR,
-R
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] gallivm: limit use of setFastMathFlags to LLVM 3.8 and later

2016-11-15 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp 
b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index da3cbdd..a68428d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -732,18 +732,20 @@ lp_is_function(LLVMValueRef v)
 #else
return llvm::isa(llvm::unwrap(v));
 #endif
 }
 
 extern "C" LLVMBuilderRef
 lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath)
 {
LLVMBuilderRef builder = LLVMCreateBuilderInContext(ctx);
 
+#if HAVE_LLVM >= 0x0308
if (unsafe_fpmath) {
   llvm::FastMathFlags flags;
   flags.setUnsafeAlgebra();
   llvm::unwrap(builder)->setFastMathFlags(flags);
}
+#endif
 
return builder;
 }
-- 
2.7.4

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


Re: [Mesa-dev] [PATCH] gallivm: limit use of setFastMathFlags to LLVM 3.8 and later

2016-11-15 Thread Brian Paul

On 11/15/2016 11:56 AM, Marek Olšák wrote:

From: Marek Olšák 

---
  src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp 
b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index da3cbdd..a68428d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -732,18 +732,20 @@ lp_is_function(LLVMValueRef v)
  #else
return llvm::isa(llvm::unwrap(v));
  #endif
  }

  extern "C" LLVMBuilderRef
  lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath)
  {
 LLVMBuilderRef builder = LLVMCreateBuilderInContext(ctx);

+#if HAVE_LLVM >= 0x0308
 if (unsafe_fpmath) {
llvm::FastMathFlags flags;
flags.setUnsafeAlgebra();
llvm::unwrap(builder)->setFastMathFlags(flags);
 }
+#endif

 return builder;
  }



Reviewed-by: Brian Paul 

Thanks!

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


Re: [Mesa-dev] Fwd: errors for mesa master Android build 554

2016-11-15 Thread Emil Velikov
On 15 November 2016 at 18:40, Brian Paul  wrote:
> It also broke our in-house Jenkins build on Ubuntu.  Though, it's building
> OK on my local system.  Hmm.
>
>   CC   dri_common.lo
> ../../../src/glx/dri_common.c: In function ‘driGetDriverExtensions’:
> ../../../src/glx/dri_common.c:164:32: error: implicit declaration of
> function ‘dri_get_extensions_name’ [-Werror=implicit-function-declaration]
> char *get_extensions_name = dri_get_extensions_name(driver_name);
> ^
> ../../../src/glx/dri_common.c:164:32: warning: initialization makes pointer
> from integer without a cast [-Wint-conversion]
> cc1: some warnings being treated as errors
> Makefile:892: recipe for target 'dri_common.lo' failed
>
I've picked the old patch. Should be fixed ~around the same time this
email hit the list ;-)

Pardon the disruption.
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] util/disk_cache: use unambiguous naming

2016-11-15 Thread Marek Olšák
From: Marek Olšák 

---
 src/compiler/glsl/tests/cache_test.c | 140 +--
 src/util/disk_cache.c|  30 
 src/util/disk_cache.h|  56 +++---
 3 files changed, 114 insertions(+), 112 deletions(-)

diff --git a/src/compiler/glsl/tests/cache_test.c 
b/src/compiler/glsl/tests/cache_test.c
index 94a3c1d..ca22605 100644
--- a/src/compiler/glsl/tests/cache_test.c
+++ b/src/compiler/glsl/tests/cache_test.c
@@ -108,292 +108,292 @@ rmrf_local(const char *path)
 {
if (path == NULL || *path == '\0' || *path != '.')
   return -1;
 
return nftw(path, remove_entry, 64, FTW_DEPTH | FTW_PHYS | FTW_MOUNT);
 }
 
 #define CACHE_TEST_TMP "./cache-test-tmp"
 
 static void
-test_cache_create(void)
+test_disk_cache_create(void)
 {
-   struct program_cache *cache;
+   struct disk_cache *cache;
int err;
 
/* Before doing anything else, ensure that with
-* MESA_GLSL_CACHE_DISABLE set, that cache_create returns NULL.
+* MESA_GLSL_CACHE_DISABLE set, that disk_cache_create returns NULL.
 */
setenv("MESA_GLSL_CACHE_DISABLE", "1", 1);
-   cache = cache_create();
-   expect_null(cache, "cache_create with MESA_GLSL_CACHE_DISABLE set");
+   cache = disk_cache_create();
+   expect_null(cache, "disk_cache_create with MESA_GLSL_CACHE_DISABLE set");
 
unsetenv("MESA_GLSL_CACHE_DISABLE");
 
-   /* For the first real cache_create() clear these environment
+   /* For the first real disk_cache_create() clear these environment
 * variables to test creation of cache in home directory.
 */
unsetenv("MESA_GLSL_CACHE_DIR");
unsetenv("XDG_CACHE_HOME");
 
-   cache = cache_create();
-   expect_non_null(cache, "cache_create with no environment variables");
+   cache = disk_cache_create();
+   expect_non_null(cache, "disk_cache_create with no environment variables");
 
-   cache_destroy(cache);
+   disk_cache_destroy(cache);
 
/* Test with XDG_CACHE_HOME set */
setenv("XDG_CACHE_HOME", CACHE_TEST_TMP "/xdg-cache-home", 1);
-   cache = cache_create();
-   expect_null(cache, "cache_create with XDG_CACHE_HOME set with"
+   cache = disk_cache_create();
+   expect_null(cache, "disk_cache_create with XDG_CACHE_HOME set with"
"a non-existing parent directory");
 
mkdir(CACHE_TEST_TMP, 0755);
-   cache = cache_create();
-   expect_non_null(cache, "cache_create with XDG_CACHE_HOME set");
+   cache = disk_cache_create();
+   expect_non_null(cache, "disk_cache_create with XDG_CACHE_HOME set");
 
-   cache_destroy(cache);
+   disk_cache_destroy(cache);
 
/* Test with MESA_GLSL_CACHE_DIR set */
err = rmrf_local(CACHE_TEST_TMP);
expect_equal(err, 0, "Removing " CACHE_TEST_TMP);
 
setenv("MESA_GLSL_CACHE_DIR", CACHE_TEST_TMP "/mesa-glsl-cache-dir", 1);
-   cache = cache_create();
-   expect_null(cache, "cache_create with MESA_GLSL_CACHE_DIR set with"
+   cache = disk_cache_create();
+   expect_null(cache, "disk_cache_create with MESA_GLSL_CACHE_DIR set with"
"a non-existing parent directory");
 
mkdir(CACHE_TEST_TMP, 0755);
-   cache = cache_create();
-   expect_non_null(cache, "cache_create with MESA_GLSL_CACHE_DIR set");
+   cache = disk_cache_create();
+   expect_non_null(cache, "disk_cache_create with MESA_GLSL_CACHE_DIR set");
 
-   cache_destroy(cache);
+   disk_cache_destroy(cache);
 }
 
 static bool
-does_cache_contain(struct program_cache *cache, cache_key key)
+does_cache_contain(struct disk_cache *cache, cache_key key)
 {
void *result;
 
-   result = cache_get(cache, key, NULL);
+   result = disk_cache_get(cache, key, NULL);
 
if (result) {
   free(result);
   return true;
}
 
return false;
 }
 
 static void
 test_put_and_get(void)
 {
-   struct program_cache *cache;
+   struct disk_cache *cache;
/* If the text of this blob is changed, then blob_key_byte_zero
 * also needs to be updated.
 */
char blob[] = "This is a blob of thirty-seven bytes";
uint8_t blob_key[20];
uint8_t blob_key_byte_zero = 0xca;
char string[] = "While this string has thirty-four";
uint8_t string_key[20];
char *result;
size_t size;
uint8_t *one_KB, *one_MB;
uint8_t one_KB_key[20], one_MB_key[20];
int count;
 
-   cache = cache_create();
+   cache = disk_cache_create();
 
_mesa_sha1_compute(blob, sizeof(blob), blob_key);
 
-   /* Ensure that cache_get returns nothing before anything is added. */
-   result = cache_get(cache, blob_key, &size);
-   expect_null(result, "cache_get with non-existent item (pointer)");
-   expect_equal(size, 0, "cache_get with non-existent item (size)");
+   /* Ensure that disk_cache_get returns nothing before anything is added. */
+   result = disk_cache_get(cache, blob_key, &size);
+   expect_null(result, "disk_cache_get with non-existent item (pointer)");
+   expect_equal(size, 0, "disk_cache_get with non-existent item (size)");
 
/* Simple test of put and get. */
-   cache_put(cache, blo

[Mesa-dev] [PATCH 1/2] util: import cache.c/h from glsl

2016-11-15 Thread Marek Olšák
From: Marek Olšák 

It's not dependent on GLSL and it can be useful for shader caches that don't
deal with GLSL.

v2: address review comments
---
 configure.ac |  4 
 src/compiler/Makefile.glsl.am|  4 
 src/compiler/Makefile.sources|  4 
 src/compiler/glsl/tests/cache_test.c | 22 +-
 src/util/Makefile.sources|  2 ++
 src/{compiler/glsl/cache.c => util/disk_cache.c} | 16 +---
 src/{compiler/glsl/cache.h => util/disk_cache.h} | 11 +--
 7 files changed, 17 insertions(+), 46 deletions(-)
 rename src/{compiler/glsl/cache.c => util/disk_cache.c} (98%)
 rename src/{compiler/glsl/cache.h => util/disk_cache.h} (99%)

diff --git a/configure.ac b/configure.ac
index 9d62b90..90845e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1354,24 +1354,20 @@ AC_ARG_ENABLE([shader-cache],
 [if test "x$with_sha1" != "x"; then
 enable_shader_cache=yes
  else
 enable_shader_cache=no
  fi])
 if test "x$with_sha1" = "x"; then
 if test "x$enable_shader_cache" = "xyes"; then
 AC_MSG_ERROR([Cannot enable shader cache (no SHA-1 implementation 
found)])
 fi
 fi
-AM_CONDITIONAL([ENABLE_SHADER_CACHE], [test x$enable_shader_cache = xyes])
-if test "x$enable_shader_cache" = "xyes"; then
-   AC_DEFINE([ENABLE_SHADER_CACHE], [1], [Enable shader cache])
-fi
 
 if test "x$enable_dri" = xyes; then
 if test "$enable_static" = yes; then
 AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
 fi
 
 # not a hard requirement as swrast does not depend on it
 if test "x$have_libdrm" = xyes; then
 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
 fi
diff --git a/src/compiler/Makefile.glsl.am b/src/compiler/Makefile.glsl.am
index 3eac677..5b1d74e 100644
--- a/src/compiler/Makefile.glsl.am
+++ b/src/compiler/Makefile.glsl.am
@@ -124,24 +124,20 @@ glsl_glcpp_glcpp_LDADD =  \
-lm
 
 glsl_libglsl_la_LIBADD = \
nir/libnir.la \
glsl/libglcpp.la
 
 glsl_libglsl_la_SOURCES =  \
$(LIBGLSL_GENERATED_FILES)  \
$(LIBGLSL_FILES)
 
-if ENABLE_SHADER_CACHE
-glsl_libglsl_la_SOURCES += $(LIBGLSL_SHADER_CACHE_FILES)
-endif
-
 glsl_libstandalone_la_SOURCES = \
$(GLSL_COMPILER_CXX_FILES)
 
 glsl_libstandalone_la_LIBADD = \
glsl/libglsl.la \
$(top_builddir)/src/libglsl_util.la \
$(top_builddir)/src/util/libmesautil.la \
$(PTHREAD_LIBS)
 
 glsl_compiler_SOURCES = \
diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
index 08d93e0..d05bcac 100644
--- a/src/compiler/Makefile.sources
+++ b/src/compiler/Makefile.sources
@@ -129,24 +129,20 @@ LIBGLSL_FILES = \
glsl/opt_redundant_jumps.cpp \
glsl/opt_structure_splitting.cpp \
glsl/opt_swizzle_swizzle.cpp \
glsl/opt_tree_grafting.cpp \
glsl/opt_vectorize.cpp \
glsl/program.h \
glsl/propagate_invariance.cpp \
glsl/s_expression.cpp \
glsl/s_expression.h
 
-LIBGLSL_SHADER_CACHE_FILES = \
-   glsl/cache.c \
-   glsl/cache.h
-
 # glsl_compiler
 
 GLSL_COMPILER_CXX_FILES = \
glsl/ir_builder_print_visitor.cpp \
glsl/ir_builder_print_visitor.h \
glsl/opt_add_neg_to_sub.h \
glsl/standalone_scaffolding.cpp \
glsl/standalone_scaffolding.h \
glsl/standalone.cpp \
glsl/standalone.h
diff --git a/src/compiler/glsl/tests/cache_test.c 
b/src/compiler/glsl/tests/cache_test.c
index 724dfcd..94a3c1d 100644
--- a/src/compiler/glsl/tests/cache_test.c
+++ b/src/compiler/glsl/tests/cache_test.c
@@ -25,45 +25,25 @@
 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
 #include "util/mesa-sha1.h"
-#include "cache.h"
+#include "util/disk_cache.h"
 
 bool error = false;
 
 #ifdef ENABLE_SHADER_CACHE
-void
-_mesa_warning(void *ctx, const char *fmt, ...);
-
-void
-_mesa_warning(void *ctx, const char *fmt, ...)
-{
-va_list vargs;
-(void) ctx;
-
-va_start(vargs, fmt);
-
-/* This output is not thread-safe, but that's good enough for the
- * standalone compiler.
- */
-fprintf(stderr, "Mesa warning: ");
-vfprintf(stderr, fmt, vargs);
-fprintf(stderr, "\n");
-
-va_end(vargs);
-}
 
 static void
 expect_equal(uint64_t actual, uint64_t expected, const char *test)
 {
if (actual != expected) {
   fprintf(stderr, "Error: Test '%s' failed: Expected=%ld, Actual=%ld\n",
   test, expected, actual);
   error = true;
}
 }
diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources
index c5531c8..b7ca347 100644
--- a/src/util/Makefile.sources
+++ b/src/util/Makefile.sources
@@ -1,16 +1,18 @@
 MESA_UTIL_FILES := \
bitscan.c \
bitscan.h \
  

Re: [Mesa-dev] Stable release process

2016-11-15 Thread Ian Romanick
On 11/14/2016 02:31 PM, Matt Turner wrote:
> A long time ago, patch authors were tasked with cherry-picking their
> patches to stable branches. Today we Cc
> mesa-sta...@lists.freedesktop.org and Emil rebases those patches onto
> stable. Cc'ing the list happens even on patches sent for their first
> review that are ultimately rejected, creating a lot of noise (and
> presumably makes the mailing list less useful).

When we first came up with the process several years ago, we had a
couple goals that didn't always align.  The top two were:

- Bug fixes shouldn't be missed from stable releases.

- Individual developers shouldn't have to shepherd patches into stable.

Secondary goals:

- Reviewers should know when a fix is destined for stable.

- Fixes that weren't initially marked for stable could be marked later.

Using a separate mailing list seemed to meet all those goals.  Reviewers
would know a patch was destined for stable due to the Cc.  Once a patch
landed on master with the Cc, the developer could "forget" about it.  It
was now in the hands of the stable maintainer.  It would also be easy to
nominate a patch for stable after it landed on master by just sending it
to the stable list.

All the things that make it easy to get a patch in the stable queue also
make it hard to get a patch out.  If a patch is rejected (never lands on
master), it is still floating on the stable list.  If a patch lands but,
after the fact, we decide it shouldn't go to stable, it's still tagged
in the git log (the .cherry-ignore file helps with this).

> Initial questions:
> 
> Is the mesa-stable@ mailing list useful (other than as a tag in a
> committed patch)?
> 
> What do "nominated" and "queued" in the stable release candidate
> announcements actually mean?
> 
> Should driver maintainers cherry-pick patches to stable on their own?

I think there's value in having a single gatekeeper for stable.  It's
common for bug fixes to touch common code.  The single gatekeeper has a
responsibility to ensure that other drivers don't break, etc.

There are some things we could try that are somewhere between the
current system and multiple pushers.  Other projects have a model where
subsystem maintainers send branches to the next level up maintainer to
merge.  Something similar to that might work.  We have to be careful
that we don't pick a system that only works well for AMD and Intel.

> Regardless of the outcome of that question, I think we would the
> process would be more transparent and predictable if patches were
> incorporated into the branch over time rather than all at once a few
> days before the release.
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 

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


[Mesa-dev] [Bug 98740] bitcode.cpp:102:8: error: ‘Error’ is not a member of ‘llvm’

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98740

Bug ID: 98740
   Summary: bitcode.cpp:102:8: error: ‘Error’ is not a member of
‘llvm’
   Product: Mesa
   Version: 13.0
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Keywords: regression
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: v...@freedesktop.org
QA Contact: mesa-dev@lists.freedesktop.org

mesa: 341fc0073a3c05fd43e9c7a33613bcb881f25f33 (master 13.1.0-devel)

  CXX  llvm/codegen/libclllvm_la-bitcode.lo
llvm/codegen/bitcode.cpp: In function ‘std::unique_ptr
clover::llvm::parse_module_library(const clover::module&, llvm::LLVMContext&,
std::__cxx11::string&)’:
llvm/codegen/bitcode.cpp:102:8: error: ‘Error’ is not a member of ‘llvm’
if (::llvm::Error err = mod.takeError()) {
^

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


Re: [Mesa-dev] [PATCH 1/2] util: import cache.c/h from glsl

2016-11-15 Thread Emil Velikov
On 15 November 2016 at 19:07, Marek Olšák  wrote:
> From: Marek Olšák 
>
> It's not dependent on GLSL and it can be useful for shader caches that don't
> deal with GLSL.
>
> v2: address review comments
Thank you !

> ---
>  configure.ac |  4 
>  src/compiler/Makefile.glsl.am|  4 
>  src/compiler/Makefile.sources|  4 
>  src/compiler/glsl/tests/cache_test.c | 22 +-
>  src/util/Makefile.sources|  2 ++
>  src/{compiler/glsl/cache.c => util/disk_cache.c} | 16 +---
>  src/{compiler/glsl/cache.h => util/disk_cache.h} | 11 +--
>  7 files changed, 17 insertions(+), 46 deletions(-)
>  rename src/{compiler/glsl/cache.c => util/disk_cache.c} (98%)
>  rename src/{compiler/glsl/cache.h => util/disk_cache.h} (99%)
>
> diff --git a/configure.ac b/configure.ac
> index 9d62b90..90845e6 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1354,24 +1354,20 @@ AC_ARG_ENABLE([shader-cache],
>  [if test "x$with_sha1" != "x"; then
>  enable_shader_cache=yes
>   else
>  enable_shader_cache=no
>   fi])
>  if test "x$with_sha1" = "x"; then
>  if test "x$enable_shader_cache" = "xyes"; then
>  AC_MSG_ERROR([Cannot enable shader cache (no SHA-1 implementation 
> found)])
>  fi
>  fi
> -AM_CONDITIONAL([ENABLE_SHADER_CACHE], [test x$enable_shader_cache = xyes])
> -if test "x$enable_shader_cache" = "xyes"; then
> -   AC_DEFINE([ENABLE_SHADER_CACHE], [1], [Enable shader cache])
> -fi
>
Looks like I wasn't unclear - you want to drop the AM_CONDITIONAL and
keep the other three lines. As-is the code is never built so one
cannot really use it.

With that
Reviewed-by: Emil Velikov 

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


Re: [Mesa-dev] [PATCH 31/59] st/glsl_to_tgsi: add support for 64-bit integers. (v2)

2016-11-15 Thread Ian Romanick
On 11/15/2016 01:40 AM, Nicolai Hähnle wrote:
> On 10.11.2016 23:59, Ian Romanick wrote:
>> On 10/27/2016 06:32 AM, Nicolai Hähnle wrote:
>>> This part is suspicious. It looks like the top two vector elements are
>>> written into a temporary register that isn't used anywhere.
>>
>> Uh... I have no idea about this code. :)  All of the Gallium patches
>> were written by Dave, and I've just been rebasing them.
> 
> Sure, no problem. I can take care of those patches when the rest of the
> series lands, I'd just ask you not to push them as-is. Especially the
> pipe cap patch _really_ shouldn't land in master as-is :)

That's fair. :)  I'm going to resend the parts of the series that
haven't landed soon.  When I do, I'll rebase this to the end, and I
won't send it.  I'll leave it in my arb_gpu_shader_int64 branch on fd.o.
 That should make it easy for you to take over.  How does that sound?

> Thanks,
> Nicolai

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


[Mesa-dev] [Bug 98740] bitcode.cpp:102:8: error: ‘Error’ is not a member of ‘llvm’

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98740

Emil Velikov  changed:

   What|Removed |Added

 CC||ved...@miletic.net

--- Comment #1 from Emil Velikov  ---
Likely caused by the following. Commit seems to be missing a HAVE_LLVM guard
like everywhere else.

commit 8e430ff8b060b4e8e922bae24b3c57837da6ea77
Author: Vedran Miletić 
AuthorDate: Mon Nov 14 12:17:42 2016 +0100
Commit: Tom Stellard 
CommitDate: Mon Nov 14 15:50:29 2016 +

clover: adapt to new error API since LLVM r286752

Tested-by: Dieter Nützel 

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


Re: [Mesa-dev] [PATCH] ac/nir/llvm: fix channel in texture gather lowering code.

2016-11-15 Thread Dave Airlie
On 15 November 2016 at 17:33, Dave Airlie  wrote:
> From: Dave Airlie 
>
> Just noticed this by inspection, while trying to locate other
> CTS failures. Don't think it fixes anything, but it might be
> needed once I find the proper fix.

Just noticed it does fix some CTS tests fails like
dEQP-VK.glsl.texture_gather.basic.2d.rgba8i.size_npot.repeat_mirrored_repeat

so I'll push it later.

Dave.

> ---
>  src/amd/common/ac_nir_to_llvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index cb0d9a6..5887125 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -1764,7 +1764,7 @@ static LLVMValueRef radv_lower_gather4_integer(struct 
> nir_to_llvm_context *ctx,
>
> for (c = 0; c < 2; c++) {
> half_texel[c] = LLVMBuildExtractElement(ctx->builder, 
> size,
> -   ctx->i32zero, 
> "");
> +   
> LLVMConstInt(ctx->i32, c, false), "");
> half_texel[c] = LLVMBuildUIToFP(ctx->builder, 
> half_texel[c], ctx->f32, "");
> half_texel[c] = emit_fdiv(ctx, ctx->f32one, 
> half_texel[c]);
> half_texel[c] = LLVMBuildFMul(ctx->builder, 
> half_texel[c],
> --
> 2.7.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] isl: Fix height calculation in isl_msaa_interleaved_scale_px_to_sa

2016-11-15 Thread Jordan Justen
No known fixed tests, but it looks like a typo from:

commit 8ac99eabb6570f0f3c5f7d7da1332a99ce636362

intel/isl: Add a helper for getting the size of an interleaved pixel

Cc: Jason Ekstrand 
Signed-off-by: Jordan Justen 
---
 src/intel/isl/isl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 7831c5e..32463b1 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -339,7 +339,7 @@ isl_msaa_interleaved_scale_px_to_sa(uint32_t samples,
if (width)
   *width = isl_align(*width, 2) * px_size_sa.width;
if (height)
-  *height = isl_align(*height, 2) * px_size_sa.width;
+  *height = isl_align(*height, 2) * px_size_sa.height;
 }
 
 static enum isl_array_pitch_span
-- 
2.10.2

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


[Mesa-dev] [PATCH] blorp: Use designated initializers in surf_convert_to_single_slice

2016-11-15 Thread Jordan Justen
Signed-off-by: Jordan Justen 
---
 src/intel/blorp/blorp_blit.c | 29 +
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 1108335..c0b56c3 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -1347,22 +1347,19 @@ surf_convert_to_single_slice(const struct isl_device 
*isl_dev,
uint32_t tile_x_px, tile_y_px;
surf_get_intratile_offset_px(info, &tile_x_px, &tile_y_px);
 
-   /* TODO: Once this file gets converted to C, we shouls just use designated
-* initializers.
-*/
-   struct isl_surf_init_info init_info = { 0, };
-
-   init_info.dim = ISL_SURF_DIM_2D;
-   init_info.format = info->surf.format;
-   init_info.width = slice_width_px + tile_x_px;
-   init_info.height = slice_height_px + tile_y_px;
-   init_info.depth = 1;
-   init_info.levels = 1;
-   init_info.array_len = 1;
-   init_info.samples = info->surf.samples;
-   init_info.min_pitch = info->surf.row_pitch;
-   init_info.usage = info->surf.usage;
-   init_info.tiling_flags = 1 << info->surf.tiling;
+   struct isl_surf_init_info init_info = {
+  .dim = ISL_SURF_DIM_2D,
+  .format = info->surf.format,
+  .width = slice_width_px + tile_x_px,
+  .height = slice_height_px + tile_y_px,
+  .depth = 1,
+  .levels = 1,
+  .array_len = 1,
+  .samples = info->surf.samples,
+  .min_pitch = info->surf.row_pitch,
+  .usage = info->surf.usage,
+  .tiling_flags = 1 << info->surf.tiling,
+   };
 
isl_surf_init_s(isl_dev, &info->surf, &init_info);
assert(info->surf.row_pitch == init_info.min_pitch);
-- 
2.10.2

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


Re: [Mesa-dev] [PATCH] hurd: Fix build

2016-11-15 Thread Emil Velikov
On 13 November 2016 at 23:30, Samuel Thibault
 wrote:
> GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
> limitation. This works around it in arbprogram.c and shaderapi.c by
> defining PATH_MAX to an arbitrary value (4096, as on Linux).
>
> Signed-off-by: Samuel Thibault 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632

Fixes: c417c0c9c37 ("mesa: Add MESA_SHADER_CAPTURE_PATH for writing
.shader_test files.")
Cc: "13.0" 

Ken it's up-to you which patch to opt for. Please add the above tags
when possible.

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [AppVeyor] mesa master #2695 completed

2016-11-15 Thread AppVeyor


Build mesa 2695 completed



Commit a6ff2a3378 by Marek Olšák on 11/13/2016 3:54 PM:

util/disk_cache: use unambiguous naming\n\nReviewed-by: Emil Velikov 


Configure your notification preferences

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


[Mesa-dev] [Bug 98699] "float[a+++4 ? 1:1] f; " crashes glsl_compiler

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98699

--- Comment #2 from Ian Romanick  ---
I don't even want to know how you came across that. :)  Just looking at the
backtrace, it seems the problem is the "a++" generates an assignment.  The code
that handles array sizes doesn't anticipate any why for there to be anything
other than an expression tree without side-effects, so it fails the assertion. 
The grammar doesn't allow anything else inside [] that would generate an
assignment, and I apparently didn't think about post-increment and friends.

Other things like function calls with out or inout parameters might also hit
this.  It would be good to have a set of piglit tests to exercise this.  If you
can write the tests, I should be able to fix Mesa. :)

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


[Mesa-dev] [Bug 98699] "float[a+++4 ? 1:1] f; " crashes glsl_compiler

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98699

Ian Romanick  changed:

   What|Removed |Added

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

--- Comment #3 from Ian Romanick  ---
(In reply to Ian Romanick from comment #2)
> Other things like function calls with out or inout parameters might also hit
> this.  It would be good to have a set of piglit tests to exercise this.  If
> you can write the tests, I should be able to fix Mesa. :)

It seems Ken already has patches out on the mailing list.

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


Re: [Mesa-dev] [PATCH 2/3] i965: Consolidate GEN9 LP definition

2016-11-15 Thread Kenneth Graunke
On Thursday, November 10, 2016 10:20:12 AM PST Ben Widawsky wrote:
> From: Ben Widawsky 
> 
> Signed-off-by: Ben Widawsky 
> ---
>  src/intel/common/gen_device_info.c | 116 
> +
>  1 file changed, 40 insertions(+), 76 deletions(-)

I tried to check on the /* XXX: guess */ values.  What a mess :(
They look right to me, but we should come back and check again later.

Add min_ds_entries to both new macros, and this gets my:
Reviewed-by: Kenneth Graunke 

Thanks Ben!


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


Re: [Mesa-dev] [PATCH] isl: Fix height calculation in isl_msaa_interleaved_scale_px_to_sa

2016-11-15 Thread Jason Ekstrand
Oops... Please back-port.  Rb

On Nov 15, 2016 11:20 AM, "Jordan Justen"  wrote:

> No known fixed tests, but it looks like a typo from:
>
> commit 8ac99eabb6570f0f3c5f7d7da1332a99ce636362
>
> intel/isl: Add a helper for getting the size of an interleaved pixel
>
> Cc: Jason Ekstrand 
> Signed-off-by: Jordan Justen 
> ---
>  src/intel/isl/isl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> index 7831c5e..32463b1 100644
> --- a/src/intel/isl/isl.c
> +++ b/src/intel/isl/isl.c
> @@ -339,7 +339,7 @@ isl_msaa_interleaved_scale_px_to_sa(uint32_t samples,
> if (width)
>*width = isl_align(*width, 2) * px_size_sa.width;
> if (height)
> -  *height = isl_align(*height, 2) * px_size_sa.width;
> +  *height = isl_align(*height, 2) * px_size_sa.height;
>  }
>
>  static enum isl_array_pitch_span
> --
> 2.10.2
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] blorp: Use designated initializers in surf_convert_to_single_slice

2016-11-15 Thread Kenneth Graunke
On Tuesday, November 15, 2016 11:22:28 AM PST Jordan Justen wrote:
> Signed-off-by: Jordan Justen 
> ---
>  src/intel/blorp/blorp_blit.c | 29 +
>  1 file changed, 13 insertions(+), 16 deletions(-)
> 
> diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
> index 1108335..c0b56c3 100644
> --- a/src/intel/blorp/blorp_blit.c
> +++ b/src/intel/blorp/blorp_blit.c
> @@ -1347,22 +1347,19 @@ surf_convert_to_single_slice(const struct isl_device 
> *isl_dev,
> uint32_t tile_x_px, tile_y_px;
> surf_get_intratile_offset_px(info, &tile_x_px, &tile_y_px);
>  
> -   /* TODO: Once this file gets converted to C, we shouls just use designated
> -* initializers.
> -*/
> -   struct isl_surf_init_info init_info = { 0, };
> -
> -   init_info.dim = ISL_SURF_DIM_2D;
> -   init_info.format = info->surf.format;
> -   init_info.width = slice_width_px + tile_x_px;
> -   init_info.height = slice_height_px + tile_y_px;
> -   init_info.depth = 1;
> -   init_info.levels = 1;
> -   init_info.array_len = 1;
> -   init_info.samples = info->surf.samples;
> -   init_info.min_pitch = info->surf.row_pitch;
> -   init_info.usage = info->surf.usage;
> -   init_info.tiling_flags = 1 << info->surf.tiling;
> +   struct isl_surf_init_info init_info = {
> +  .dim = ISL_SURF_DIM_2D,
> +  .format = info->surf.format,
> +  .width = slice_width_px + tile_x_px,
> +  .height = slice_height_px + tile_y_px,
> +  .depth = 1,
> +  .levels = 1,
> +  .array_len = 1,
> +  .samples = info->surf.samples,
> +  .min_pitch = info->surf.row_pitch,
> +  .usage = info->surf.usage,
> +  .tiling_flags = 1 << info->surf.tiling,
> +   };
>  
> isl_surf_init_s(isl_dev, &info->surf, &init_info);
> assert(info->surf.row_pitch == init_info.min_pitch);
> 

Reviewed-by: Kenneth Graunke 


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


Re: [Mesa-dev] [PATCH] blorp: Use designated initializers in surf_convert_to_single_slice

2016-11-15 Thread Jason Ekstrand
Of you want to make it simpler, we have a macro wrapper called
isl_surf_init that will turn those fields into named parameters.  Either
way, thanks for fixing this up.  Rb

On Nov 15, 2016 11:23 AM, "Jordan Justen"  wrote:

Signed-off-by: Jordan Justen 
---
 src/intel/blorp/blorp_blit.c | 29 +
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 1108335..c0b56c3 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -1347,22 +1347,19 @@ surf_convert_to_single_slice(const struct
isl_device *isl_dev,
uint32_t tile_x_px, tile_y_px;
surf_get_intratile_offset_px(info, &tile_x_px, &tile_y_px);

-   /* TODO: Once this file gets converted to C, we shouls just use
designated
-* initializers.
-*/
-   struct isl_surf_init_info init_info = { 0, };
-
-   init_info.dim = ISL_SURF_DIM_2D;
-   init_info.format = info->surf.format;
-   init_info.width = slice_width_px + tile_x_px;
-   init_info.height = slice_height_px + tile_y_px;
-   init_info.depth = 1;
-   init_info.levels = 1;
-   init_info.array_len = 1;
-   init_info.samples = info->surf.samples;
-   init_info.min_pitch = info->surf.row_pitch;
-   init_info.usage = info->surf.usage;
-   init_info.tiling_flags = 1 << info->surf.tiling;
+   struct isl_surf_init_info init_info = {
+  .dim = ISL_SURF_DIM_2D,
+  .format = info->surf.format,
+  .width = slice_width_px + tile_x_px,
+  .height = slice_height_px + tile_y_px,
+  .depth = 1,
+  .levels = 1,
+  .array_len = 1,
+  .samples = info->surf.samples,
+  .min_pitch = info->surf.row_pitch,
+  .usage = info->surf.usage,
+  .tiling_flags = 1 << info->surf.tiling,
+   };

isl_surf_init_s(isl_dev, &info->surf, &init_info);
assert(info->surf.row_pitch == init_info.min_pitch);
--
2.10.2

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


[Mesa-dev] [Bug 98699] "float[a+++4 ? 1:1] f; " crashes glsl_compiler

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98699

Kenneth Graunke  changed:

   What|Removed |Added

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

--- Comment #4 from Kenneth Graunke  ---
My patches for Karol's other crashes have landed, but I haven't looked at this
one.

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


[Mesa-dev] [PATCH v2 2/14] swr: [rasterizer memory] minify original sizes for block formats

2016-11-15 Thread Ilia Mirkin
There's no guarantee that mip width/height will be a multiple of the
compressed block size. Doing a divide by the block size first yields
different results than GL expects, so we do the divide at the end.

Signed-off-by: Ilia Mirkin 
---

This replaces the previous patch, "swr: [rasterizer memory] round up when
dividing by block sizes". My original comment was that I didn't need it, but
I do need this one since I'm back to using the tiling functions for determining
all the offset layouts. And since pretending it's really a RG32 format doesn't
work, I have to feed a compressed format to the swr backend.

 .../swr/rasterizer/memory/TilingFunctions.h| 36 +++---
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h 
b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
index 0694a99..11ed451 100644
--- a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
+++ b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
@@ -274,9 +274,12 @@ INLINE void ComputeLODOffset1D(
 else
 {
 uint32_t curWidth = baseWidth;
-// translate mip width from pixels to blocks for block compressed 
formats
-// @note hAlign is already in blocks for compressed formats so no need 
to convert
-if (info.isBC) curWidth /= info.bcWidth;
+// @note hAlign is already in blocks for compressed formats so 
upconvert
+//   so that we have the desired alignment post-divide.
+if (info.isBC)
+{
+hAlign *= info.bcWidth;
+}
 
 offset = GFX_ALIGN(curWidth, hAlign);
 for (uint32_t l = 1; l < lod; ++l)
@@ -285,7 +288,7 @@ INLINE void ComputeLODOffset1D(
 offset += curWidth;
 }
 
-if (info.isSubsampled)
+if (info.isSubsampled || info.isBC)
 {
 offset /= info.bcWidth;
 }
@@ -312,14 +315,17 @@ INLINE void ComputeLODOffsetX(
 else
 {
 uint32_t curWidth = baseWidth;
-// convert mip width from pixels to blocks for block compressed formats
-// @note hAlign is already in blocks for compressed formats so no need 
to convert
-if (info.isBC) curWidth /= info.bcWidth;
+// @note hAlign is already in blocks for compressed formats so 
upconvert
+//   so that we have the desired alignment post-divide.
+if (info.isBC)
+{
+hAlign *= info.bcWidth;
+}
 
 curWidth = std::max(curWidth >> 1, 1U);
 curWidth = GFX_ALIGN(curWidth, hAlign);
 
-if (info.isSubsampled)
+if (info.isSubsampled || info.isBC)
 {
 curWidth /= info.bcWidth;
 }
@@ -350,9 +356,12 @@ INLINE void ComputeLODOffsetY(
 offset = 0;
 uint32_t mipHeight = baseHeight;
 
-// translate mip height from pixels to blocks for block compressed 
formats
-// @note VAlign is already in blocks for compressed formats so no need 
to convert
-if (info.isBC) mipHeight /= info.bcHeight;
+// @note vAlign is already in blocks for compressed formats so 
upconvert
+//   so that we have the desired alignment post-divide.
+if (info.isBC)
+{
+vAlign *= info.bcHeight;
+}
 
 for (uint32_t l = 1; l <= lod; ++l)
 {
@@ -360,6 +369,11 @@ INLINE void ComputeLODOffsetY(
 offset += ((l != 2) ? alignedMipHeight : 0);
 mipHeight = std::max(mipHeight >> 1, 1U);
 }
+
+if (info.isBC)
+{
+offset /= info.bcHeight;
+}
 }
 }
 
-- 
2.7.3

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


[Mesa-dev] [Bug 98740] bitcode.cpp:102:8: error: ‘Error’ is not a member of ‘llvm’

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98740

Vinson Lee  changed:

   What|Removed |Added

   Keywords||bisected
 CC||die...@nuetzel-hh.de

--- Comment #2 from Vinson Lee  ---
8e430ff8b060b4e8e922bae24b3c57837da6ea77 is the first bad commit
commit 8e430ff8b060b4e8e922bae24b3c57837da6ea77
Author: Vedran Miletić 
Date:   Mon Nov 14 12:17:42 2016 +0100

clover: adapt to new error API since LLVM r286752

Tested-by: Dieter Nützel 

:04 04 39db27c43b4e9586570f89c88fe906116131eab2
9e21c128e992a97726b6e0b7ba89a3792ccd6303 M  src
bisect run success

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


[Mesa-dev] [Bug 98699] "float[a+++4 ? 1:1] f; " crashes glsl_compiler

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98699

--- Comment #5 from Ian Romanick  ---
(In reply to Kenneth Graunke from comment #4)
> My patches for Karol's other crashes have landed, but I haven't looked at
> this one.

This may be fixed by the fix for bug #98694.  The backtrace looks similar / the
same.

Karol: Does that patch also fix this crash?

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


[Mesa-dev] [PATCH] mesa: Drop PATH_MAX usage.

2016-11-15 Thread Kenneth Graunke
GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
limitation, so this failed to compile.  Apparently glibc does not
enforce PATH_MAX restrictions anyway, so it's kind of a hoax:

https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html

MSVC uses a different name (_MAX_PATH) as well, which is annoying.

We don't really need it.  We can simply asprintf() the filenames.
If the filename exceeds an OS path limit, presumably fopen() will
fail, and we already check that.  (We actually use ralloc_asprintf
because Mesa provides that everywhere, and it doesn't look like we've
provided an implementation of GNU's asprintf() for all platforms.)

Fixes the build on GNU/Hurd.

Cc: "13.0" 
Signed-off-by: Samuel Thibault 
Signed-off-by: Kenneth Graunke 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
---
 src/mesa/main/arbprogram.c | 12 
 src/mesa/main/shaderapi.c  | 37 +++--
 2 files changed, 15 insertions(+), 34 deletions(-)

Samuel, does this fix the build for you?

Emil, I didn't add the Fixes: tag because this was broken long before
that patch - MESA_SHADER_DUMP_PATH/MESA_SHADER_READ_PATH have existed
for a while now.

diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c
index 9c7622a..be46904 100644
--- a/src/mesa/main/arbprogram.c
+++ b/src/mesa/main/arbprogram.c
@@ -41,11 +41,6 @@
 #include "program/program.h"
 #include "program/prog_print.h"
 
-#ifdef _MSC_VER
-#include 
-#define PATH_MAX _MAX_PATH
-#endif
-
 /**
  * Bind a program (make it current)
  * \note Called from the GL API dispatcher by both glBindProgramNV
@@ -382,12 +377,12 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, 
GLsizei len,
const char *capture_path = _mesa_get_shader_capture_path();
if (capture_path != NULL) {
   FILE *file;
-  char filename[PATH_MAX];
   const char *shader_type =
  target == GL_FRAGMENT_PROGRAM_ARB ? "fragment" : "vertex";
+  char *filename =
+ ralloc_asprintf(NULL, "%s/%cp-%u.shader_test",
+ capture_path, shader_type[0], prog->Id);
 
-  _mesa_snprintf(filename, sizeof(filename), "%s/%cp-%u.shader_test",
- capture_path, shader_type[0], prog->Id);
   file = fopen(filename, "w");
   if (file) {
  fprintf(file,
@@ -397,6 +392,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, 
GLsizei len,
   } else {
  _mesa_warning(ctx, "Failed to open %s", filename);
   }
+  ralloc_free(filename);
}
 }
 
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index be3c203..d9f1b06 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -60,11 +60,6 @@
 #include "util/hash_table.h"
 #include "util/mesa-sha1.h"
 
-#ifdef _MSC_VER
-#include 
-#define PATH_MAX _MAX_PATH
-#endif
-
 /**
  * Return mask of GLSL_x flags by examining the MESA_GLSL env var.
  */
@@ -112,13 +107,6 @@ _mesa_get_shader_capture_path(void)
if (!read_env_var) {
   path = getenv("MESA_SHADER_CAPTURE_PATH");
   read_env_var = true;
-  if (path &&
-  strlen(path) > PATH_MAX - strlen("/fp-4294967295.shader_test")) {
- GET_CURRENT_CONTEXT(ctx);
- _mesa_warning(ctx, "MESA_SHADER_CAPTURE_PATH too long; ignoring "
-"request to capture shaders");
- path = NULL;
-  }
}
 
return path;
@@ -1101,11 +1089,8 @@ _mesa_link_program(struct gl_context *ctx, struct 
gl_shader_program *shProg)
const char *capture_path = _mesa_get_shader_capture_path();
if (shProg->Name != 0 && shProg->Name != ~0 && capture_path != NULL) {
   FILE *file;
-  char filename[PATH_MAX];
-
-  _mesa_snprintf(filename, sizeof(filename), "%s/%u.shader_test",
- capture_path, shProg->Name);
-
+  char *filename = ralloc_asprintf(NULL, "%s/%u.shader_test",
+   capture_path, shProg->Name);
   file = fopen(filename, "w");
   if (file) {
  fprintf(file, "[require]\nGLSL%s >= %u.%02u\n",
@@ -1124,6 +1109,8 @@ _mesa_link_program(struct gl_context *ctx, struct 
gl_shader_program *shProg)
   } else {
  _mesa_warning(ctx, "Failed to open %s", filename);
   }
+
+  ralloc_free(filename);
}
 
if (shProg->LinkStatus == GL_FALSE &&
@@ -1618,9 +1605,9 @@ generate_sha1(const char *source, char sha_str[64])
  *
  * /_.glsl
  */
-static void
+static char *
 construct_name(const gl_shader_stage stage, const char *source,
-   const char *path, char *name, unsigned length)
+   const char *path)
 {
char sha[64];
static const char *types[] = {
@@ -1628,8 +1615,7 @@ construct_name(const gl_shader_stage stage, const char 
*source,
};
 
generate_sha1(source, sha);
-   _mesa_snprintf(name, length, "%s/%s_%s.glsl", path, types[stage],
-  sha);
+   return ralloc_asprintf(NULL, "%s/%s_%s.glsl", path, types[stage

[Mesa-dev] [PATCH] radv: don't crash on null swapchain destroy.

2016-11-15 Thread Dave Airlie
From: Dave Airlie 

Just return if the passed in swapchain is NULL.

Fixes: dEQP-VK.wsi.xlib.swapchain.destroy.null_handle

Signed-off-by: Dave Airlie 
---
 src/amd/vulkan/radv_wsi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index a946bd4..1f1ab1c 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -288,6 +288,9 @@ void radv_DestroySwapchainKHR(
RADV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
const VkAllocationCallbacks *alloc;
 
+   if (!_swapchain)
+   return;
+
if (pAllocator)
alloc = pAllocator;
else
-- 
2.7.4

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


Re: [Mesa-dev] Stable release process

2016-11-15 Thread Jason Ekstrand
On Nov 15, 2016 11:07 AM, "Ian Romanick"  wrote:
>
> On 11/14/2016 02:31 PM, Matt Turner wrote:
> > A long time ago, patch authors were tasked with cherry-picking their
> > patches to stable branches. Today we Cc
> > mesa-sta...@lists.freedesktop.org and Emil rebases those patches onto
> > stable. Cc'ing the list happens even on patches sent for their first
> > review that are ultimately rejected, creating a lot of noise (and
> > presumably makes the mailing list less useful).
>
> When we first came up with the process several years ago, we had a
> couple goals that didn't always align.  The top two were:
>
> - Bug fixes shouldn't be missed from stable releases.
>
> - Individual developers shouldn't have to shepherd patches into stable.
>
> Secondary goals:
>
> - Reviewers should know when a fix is destined for stable.
>
> - Fixes that weren't initially marked for stable could be marked later.
>
> Using a separate mailing list seemed to meet all those goals.  Reviewers
> would know a patch was destined for stable due to the Cc.  Once a patch
> landed on master with the Cc, the developer could "forget" about it.  It
> was now in the hands of the stable maintainer.  It would also be easy to
> nominate a patch for stable after it landed on master by just sending it
> to the stable list.
>
> All the things that make it easy to get a patch in the stable queue also
> make it hard to get a patch out.  If a patch is rejected (never lands on
> master), it is still floating on the stable list.  If a patch lands but,
> after the fact, we decide it shouldn't go to stable, it's still tagged
> in the git log (the .cherry-ignore file helps with this).

This sounds a lot like the one thing patchwork is good for.  Would setting
up patchwork for the stable list solve some of these problems?  Then we
would always know what's on it and the stable maintainer would be
responsible for keeping it tidy.  It's not a lot of patches so the burden
wouldn't be large.  It may even make the cherry picking easier.

> > Initial questions:
> >
> > Is the mesa-stable@ mailing list useful (other than as a tag in a
> > committed patch)?
> >
> > What do "nominated" and "queued" in the stable release candidate
> > announcements actually mean?
> >
> > Should driver maintainers cherry-pick patches to stable on their own?
>
> I think there's value in having a single gatekeeper for stable.  It's
> common for bug fixes to touch common code.  The single gatekeeper has a
> responsibility to ensure that other drivers don't break, etc.
>
> There are some things we could try that are somewhere between the
> current system and multiple pushers.  Other projects have a model where
> subsystem maintainers send branches to the next level up maintainer to
> merge.  Something similar to that might work.  We have to be careful
> that we don't pick a system that only works well for AMD and Intel.
>
> > Regardless of the outcome of that question, I think we would the
> > process would be more transparent and predictable if patches were
> > incorporated into the branch over time rather than all at once a few
> > days before the release.
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] android: amd/common: add support for libmesa_amd_common

2016-11-15 Thread Emil Velikov
On 15 November 2016 at 09:15, Nicolai Hähnle  wrote:
> On 12.11.2016 22:26, Mauro Rossi wrote:
>>>
>>> We'd really want to do:
>>>
>>> git rm src/amd/common/Makefile.sources
>>> git mv src/amd/common/Makefile.am src/amd/Makefile.common.am
>>> sed -i s|common/||g src/amd/Makefile.common.am
>>> + fix the odd piece throughout.
>>>
>>> As-is we have the sources lists duplicated and makefiles async from
>>> one another. And if history has thought us anything - this will break
>>> all the everytime.
>>>
>>> Mauro, can you give it a try ?
>>>
>>> Thanks
>>> Emil
>>
>>
>> Hi,
>>
>> sed command was not necessary but I had to add
>> $(top_src)/src/amd/common include,
>> change configure.ac (like Jason Ekstrand had to do when isl makefile
>> structure was flattened),
>> modify Makefile.common.am as Makefile.addrlib.am
>>
>> I've tried to build and there is no amd related error, it should be ok,
>> but in my "mesa for linux" build system I am lacking proper llvm
>> installation and I see llvm building errors, probably related to this
>> fact.
>>
>> Please review and check by launching a build on your more stable linux
>> build systems/CI jobs, before pushing to mesa-dev
>> Thanks
>>
>> Mauro
>>
>> From f78f66049118db3ed9b241dfd020418efe52c10b Mon Sep 17 00:00:00 2001
>> From: Mauro Rossi 
>> Date: Sat, 12 Nov 2016 22:10:44 +0100
>> Subject: [PATCH] amd: flatten amd/common makefile structure
>>
>> This pulls amd/common build rules into upper level makefile,
>> along with amd/addlib which is already there.
>
>
> Looks reasonable to me, but perhaps somebody with more familiarity with the
> build system can take another look?
>
> Reviewed-by: Nicolai Hähnle 
>
I've unintentionally missed out your r-b Nicolai, apologies.

Had to apply a couple of small fixes, other than that it looks great.

Thank you Mauro!
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 97879] [amdgpu] Rocket League: long hangs (several seconds) when loading assets (models/textures/shaders?)

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97879

--- Comment #46 from George Billios  ---
This is also valid for Trine 3.

Big delay to start ~5mins
setting MESA_SHADER_CAPTURE_PATH results in about 16k files!!!

specs
i7 860
Fury R9

4.7-staging kernel 
mesa-git Mesa 13.1.0-devel (git-151aeca)
llvm 3.9.0

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


[Mesa-dev] [Bug 97879] [amdgpu] Rocket League: long hangs (several seconds) when loading assets (models/textures/shaders?)

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=97879

George Billios  changed:

   What|Removed |Added

 CC||gbill...@gmail.com

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


[Mesa-dev] [Bug 98699] "float[a+++4 ? 1:1] f; " crashes glsl_compiler

2016-11-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=98699

--- Comment #6 from Karol Herbst  ---
no, it doesn't. Just tested on current master.

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


Re: [Mesa-dev] [PATCH] mesa: Drop PATH_MAX usage.

2016-11-15 Thread Emil Velikov
On 15 November 2016 at 20:04, Kenneth Graunke  wrote:
> GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
> limitation, so this failed to compile.  Apparently glibc does not
> enforce PATH_MAX restrictions anyway, so it's kind of a hoax:
>
> https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html
>
> MSVC uses a different name (_MAX_PATH) as well, which is annoying.
>
> We don't really need it.  We can simply asprintf() the filenames.
> If the filename exceeds an OS path limit, presumably fopen() will
> fail, and we already check that.  (We actually use ralloc_asprintf
> because Mesa provides that everywhere, and it doesn't look like we've
> provided an implementation of GNU's asprintf() for all platforms.)
>
> Fixes the build on GNU/Hurd.
>
> Cc: "13.0" 
> Signed-off-by: Samuel Thibault 
> Signed-off-by: Kenneth Graunke 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
> ---
>  src/mesa/main/arbprogram.c | 12 
>  src/mesa/main/shaderapi.c  | 37 +++--
>  2 files changed, 15 insertions(+), 34 deletions(-)
>
> Samuel, does this fix the build for you?
>
> Emil, I didn't add the Fixes: tag because this was broken long before
> that patch - MESA_SHADER_DUMP_PATH/MESA_SHADER_READ_PATH have existed
> for a while now.
>
Ack, makes sense. I've only looked at the latest instance which
introduces/uses the define.

The patch is spot on afaict
Reviewed-by: Emil Velikov 

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


[Mesa-dev] [PATCH] wsi: fix VK_INCOMPLETE for vkGetSwapchainImagesKHR

2016-11-15 Thread Dave Airlie
From: Dave Airlie 

This fixes the x11 and wayland backends to not assert:
dEQP-VK.wsi.xcb.swapchain.get_images.incomplete

Signed-off-by: Dave Airlie 
---
 src/vulkan/wsi/wsi_common_wayland.c | 16 +++-
 src/vulkan/wsi/wsi_common_x11.c | 16 +++-
 2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/src/vulkan/wsi/wsi_common_wayland.c 
b/src/vulkan/wsi/wsi_common_wayland.c
index 7691744..f6c218b 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -498,19 +498,25 @@ wsi_wl_swapchain_get_images(struct wsi_swapchain 
*wsi_chain,
 uint32_t *pCount, VkImage *pSwapchainImages)
 {
struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain;
+   uint32_t ret_count;
+   VkResult result;
 
if (pSwapchainImages == NULL) {
   *pCount = chain->image_count;
   return VK_SUCCESS;
}
 
-   assert(chain->image_count <= *pCount);
-   for (uint32_t i = 0; i < chain->image_count; i++)
-  pSwapchainImages[i] = chain->images[i].image;
+   result = VK_SUCCESS;
+   ret_count = chain->image_count;
+   if (chain->image_count > *pCount) {
+ ret_count = *pCount;
+ result = VK_INCOMPLETE;
+   }
 
-   *pCount = chain->image_count;
+   for (uint32_t i = 0; i < ret_count; i++)
+  pSwapchainImages[i] = chain->images[i].image;
 
-   return VK_SUCCESS;
+   return result;
 }
 
 static VkResult
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index c758d2d..b69a621 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -510,19 +510,25 @@ x11_get_images(struct wsi_swapchain *anv_chain,
uint32_t* pCount, VkImage *pSwapchainImages)
 {
struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain;
+   uint32_t ret_count;
+   VkResult result;
 
if (pSwapchainImages == NULL) {
   *pCount = chain->image_count;
   return VK_SUCCESS;
}
 
-   assert(chain->image_count <= *pCount);
-   for (uint32_t i = 0; i < chain->image_count; i++)
-  pSwapchainImages[i] = chain->images[i].image;
+   result = VK_SUCCESS;
+   ret_count = chain->image_count;
+   if (chain->image_count > *pCount) {
+ ret_count = *pCount;
+ result = VK_INCOMPLETE;
+   }
 
-   *pCount = chain->image_count;
+   for (uint32_t i = 0; i < ret_count; i++)
+  pSwapchainImages[i] = chain->images[i].image;
 
-   return VK_SUCCESS;
+   return result;
 }
 
 static VkResult
-- 
2.7.4

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


Re: [Mesa-dev] [PATCH] mesa: Drop PATH_MAX usage.

2016-11-15 Thread Roland Mainz
On Tue, Nov 15, 2016 at 9:56 PM, Emil Velikov  wrote:
> On 15 November 2016 at 20:04, Kenneth Graunke  wrote:
>> GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
>> limitation, so this failed to compile.  Apparently glibc does not
>> enforce PATH_MAX restrictions anyway, so it's kind of a hoax:
>>
>> https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html
>>
>> MSVC uses a different name (_MAX_PATH) as well, which is annoying.
>>
>> We don't really need it.  We can simply asprintf() the filenames.
>> If the filename exceeds an OS path limit, presumably fopen() will
>> fail, and we already check that.  (We actually use ralloc_asprintf
>> because Mesa provides that everywhere, and it doesn't look like we've
>> provided an implementation of GNU's asprintf() for all platforms.)
>>
>> Fixes the build on GNU/Hurd.
>>
>> Cc: "13.0" 
>> Signed-off-by: Samuel Thibault 
>> Signed-off-by: Kenneth Graunke 
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
>> ---
>>  src/mesa/main/arbprogram.c | 12 
>>  src/mesa/main/shaderapi.c  | 37 +++--
>>  2 files changed, 15 insertions(+), 34 deletions(-)
>>
>> Samuel, does this fix the build for you?
>>
>> Emil, I didn't add the Fixes: tag because this was broken long before
>> that patch - MESA_SHADER_DUMP_PATH/MESA_SHADER_READ_PATH have existed
>> for a while now.
>>
> Ack, makes sense. I've only looked at the latest instance which
> introduces/uses the define.
>
> The patch is spot on afaict
> Reviewed-by: Emil Velikov 

-- snip --
+   char *name = construct_name(stage, source, read_path);
f = fopen(name, "r");
+   ralloc_free(name);
if (!f)
   return NULL;
-- snip --

You don't need |errno|, right ? Most variants of |*free()| don't
preserve the |errno| value...



Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] wsi: fix VK_INCOMPLETE for vkGetSwapchainImagesKHR

2016-11-15 Thread Jason Ekstrand
Rb.  Please cc stable

On Nov 15, 2016 1:20 PM, "Dave Airlie"  wrote:

> From: Dave Airlie 
>
> This fixes the x11 and wayland backends to not assert:
> dEQP-VK.wsi.xcb.swapchain.get_images.incomplete
>
> Signed-off-by: Dave Airlie 
> ---
>  src/vulkan/wsi/wsi_common_wayland.c | 16 +++-
>  src/vulkan/wsi/wsi_common_x11.c | 16 +++-
>  2 files changed, 22 insertions(+), 10 deletions(-)
>
> diff --git a/src/vulkan/wsi/wsi_common_wayland.c
> b/src/vulkan/wsi/wsi_common_wayland.c
> index 7691744..f6c218b 100644
> --- a/src/vulkan/wsi/wsi_common_wayland.c
> +++ b/src/vulkan/wsi/wsi_common_wayland.c
> @@ -498,19 +498,25 @@ wsi_wl_swapchain_get_images(struct wsi_swapchain
> *wsi_chain,
>  uint32_t *pCount, VkImage *pSwapchainImages)
>  {
> struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain;
> +   uint32_t ret_count;
> +   VkResult result;
>
> if (pSwapchainImages == NULL) {
>*pCount = chain->image_count;
>return VK_SUCCESS;
> }
>
> -   assert(chain->image_count <= *pCount);
> -   for (uint32_t i = 0; i < chain->image_count; i++)
> -  pSwapchainImages[i] = chain->images[i].image;
> +   result = VK_SUCCESS;
> +   ret_count = chain->image_count;
> +   if (chain->image_count > *pCount) {
> + ret_count = *pCount;
> + result = VK_INCOMPLETE;
> +   }
>
> -   *pCount = chain->image_count;
> +   for (uint32_t i = 0; i < ret_count; i++)
> +  pSwapchainImages[i] = chain->images[i].image;
>
> -   return VK_SUCCESS;
> +   return result;
>  }
>
>  static VkResult
> diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_
> x11.c
> index c758d2d..b69a621 100644
> --- a/src/vulkan/wsi/wsi_common_x11.c
> +++ b/src/vulkan/wsi/wsi_common_x11.c
> @@ -510,19 +510,25 @@ x11_get_images(struct wsi_swapchain *anv_chain,
> uint32_t* pCount, VkImage *pSwapchainImages)
>  {
> struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain;
> +   uint32_t ret_count;
> +   VkResult result;
>
> if (pSwapchainImages == NULL) {
>*pCount = chain->image_count;
>return VK_SUCCESS;
> }
>
> -   assert(chain->image_count <= *pCount);
> -   for (uint32_t i = 0; i < chain->image_count; i++)
> -  pSwapchainImages[i] = chain->images[i].image;
> +   result = VK_SUCCESS;
> +   ret_count = chain->image_count;
> +   if (chain->image_count > *pCount) {
> + ret_count = *pCount;
> + result = VK_INCOMPLETE;
> +   }
>
> -   *pCount = chain->image_count;
> +   for (uint32_t i = 0; i < ret_count; i++)
> +  pSwapchainImages[i] = chain->images[i].image;
>
> -   return VK_SUCCESS;
> +   return result;
>  }
>
>  static VkResult
> --
> 2.7.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Rework use of gl program structures

2016-11-15 Thread Timothy Arceri
Most of these patches are clean-ups on there own so I'd be grateful for
even partial series reviews.

Thanks,
Tim

On Fri, 2016-11-11 at 11:45 +1100, Timothy Arceri wrote:
> I started out with a goal of freeing _LinkedShaders after linking as
> this
> would have allowed a bunch of code simplification and also reduced
> the
> possibility of subtle bugs in i965 where a program that is currently
> active is relinked but fails and then we recompile a variant of the
> still
> active program but we would have lost things such as per stage atomic
> bindings which would be deleted during the failed relink.
> 
> In the end this series grew larger than expected so for now this
> series
> aims to switch the pipeline objects CurrentProgram array from using
> gl_shader_program to gl_program. Previously the CurrentProgram array
> could have contained multiple pointers to the same struct which was
> confusing and we would often need to fish out the information we were
> really after from the gl_program anyway. Using gl_program makes much
> more sense and allows us to optimise some critical paths such as SSO
> and sampler validation which are called at draw time.
> 
> In patch 68 when we finally change the pointers used in
> CurrentProgram
> you can see some of the confusion caused by the old way of doing
> things
> where use_shader_program() calls 
> _mesa_shader_program_init_subroutine_defaults() on each stage in
> gl_shader_program but we also call use_shader_program() itself for
> each stage in gl_shader_program so unless we are dealing with single
> stage SSO programs we will initialise subroutine defaults many
> times over. 
> 
> Patch 11 is noteworthy as it creates a gl_program at the start of
> linking which allows us to just set values directly rather than
> copying them from gl_linked_shader at a later time. Patch 55 is
> a good example of one of the many clean-ups this allows.
> 
> On top of all this these changes should help make shader cache
> cleaner
> (once I get around to rebasing and fixing it) and hopefully resolve
> some of the problems I was having figuring out how to get it working
> for SSO.
> 
> I've tried to make the order of the patchs make sense for reviewing
> but since almost everything is working towards the last 3 patches
> reviewers may need to jump to the last few patches at times.
> 
> Finally the last 3 patches will need to be squashed to stop
> compilation errors I've just split them up to help make reviewing
> easier. I would have liked to have made patch 69 separate but the
> patches have some circular dependencies that made it difficult.
> 
> I'm really happy with how this series turned out and the improvements
> I was able to make along the way. Please review.
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: Drop PATH_MAX usage.

2016-11-15 Thread Kenneth Graunke
On Tuesday, November 15, 2016 10:28:11 PM PST Roland Mainz wrote:
> On Tue, Nov 15, 2016 at 9:56 PM, Emil Velikov  
> wrote:
> > On 15 November 2016 at 20:04, Kenneth Graunke  wrote:
> >> GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
> >> limitation, so this failed to compile.  Apparently glibc does not
> >> enforce PATH_MAX restrictions anyway, so it's kind of a hoax:
> >>
> >> https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html
> >>
> >> MSVC uses a different name (_MAX_PATH) as well, which is annoying.
> >>
> >> We don't really need it.  We can simply asprintf() the filenames.
> >> If the filename exceeds an OS path limit, presumably fopen() will
> >> fail, and we already check that.  (We actually use ralloc_asprintf
> >> because Mesa provides that everywhere, and it doesn't look like we've
> >> provided an implementation of GNU's asprintf() for all platforms.)
> >>
> >> Fixes the build on GNU/Hurd.
> >>
> >> Cc: "13.0" 
> >> Signed-off-by: Samuel Thibault 
> >> Signed-off-by: Kenneth Graunke 
> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
> >> ---
> >>  src/mesa/main/arbprogram.c | 12 
> >>  src/mesa/main/shaderapi.c  | 37 +++--
> >>  2 files changed, 15 insertions(+), 34 deletions(-)
> >>
> >> Samuel, does this fix the build for you?
> >>
> >> Emil, I didn't add the Fixes: tag because this was broken long before
> >> that patch - MESA_SHADER_DUMP_PATH/MESA_SHADER_READ_PATH have existed
> >> for a while now.
> >>
> > Ack, makes sense. I've only looked at the latest instance which
> > introduces/uses the define.
> >
> > The patch is spot on afaict
> > Reviewed-by: Emil Velikov 
> 
> -- snip --
> +   char *name = construct_name(stage, source, read_path);
> f = fopen(name, "r");
> +   ralloc_free(name);
> if (!f)
>return NULL;
> -- snip --
> 
> You don't need |errno|, right ? Most variants of |*free()| don't
> preserve the |errno| value...
> 
> 
> 
> Bye,
> Roland

Good catch!  But no, we don't need errno...if the file fails to open,
we just bail, without caring why.


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


Re: [Mesa-dev] [PATCH] mesa: Drop PATH_MAX usage.

2016-11-15 Thread Roland Mainz
On Tue, Nov 15, 2016 at 11:05 PM, Kenneth Graunke  wrote:
> On Tuesday, November 15, 2016 10:28:11 PM PST Roland Mainz wrote:
>> On Tue, Nov 15, 2016 at 9:56 PM, Emil Velikov  
>> wrote:
>> > On 15 November 2016 at 20:04, Kenneth Graunke  
>> > wrote:
>> >> GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary
>> >> limitation, so this failed to compile.  Apparently glibc does not
>> >> enforce PATH_MAX restrictions anyway, so it's kind of a hoax:
>> >>
>> >> https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html
>> >>
>> >> MSVC uses a different name (_MAX_PATH) as well, which is annoying.
>> >>
>> >> We don't really need it.  We can simply asprintf() the filenames.
>> >> If the filename exceeds an OS path limit, presumably fopen() will
>> >> fail, and we already check that.  (We actually use ralloc_asprintf
>> >> because Mesa provides that everywhere, and it doesn't look like we've
>> >> provided an implementation of GNU's asprintf() for all platforms.)
>> >>
>> >> Fixes the build on GNU/Hurd.
>> >>
>> >> Cc: "13.0" 
>> >> Signed-off-by: Samuel Thibault 
>> >> Signed-off-by: Kenneth Graunke 
>> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632
>> >> ---
>> >>  src/mesa/main/arbprogram.c | 12 
>> >>  src/mesa/main/shaderapi.c  | 37 +++--
>> >>  2 files changed, 15 insertions(+), 34 deletions(-)
>> >>
>> >> Samuel, does this fix the build for you?
>> >>
>> >> Emil, I didn't add the Fixes: tag because this was broken long before
>> >> that patch - MESA_SHADER_DUMP_PATH/MESA_SHADER_READ_PATH have existed
>> >> for a while now.
>> >>
>> > Ack, makes sense. I've only looked at the latest instance which
>> > introduces/uses the define.
>> >
>> > The patch is spot on afaict
>> > Reviewed-by: Emil Velikov 
>>
>> -- snip --
>> +   char *name = construct_name(stage, source, read_path);
>> f = fopen(name, "r");
>> +   ralloc_free(name);
>> if (!f)
>>return NULL;
>> -- snip --
>>
>> You don't need |errno|, right ? Most variants of |*free()| don't
>> preserve the |errno| value...
>
> Good catch!  But no, we don't need errno...if the file fails to open,
> we just bail, without caring why.

OK... small comment would be nice so people won't try to "fix" this in
the future - most people will think this was an accidental mistake and
then drop code to save&&restore |errno| for no good reason.



Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] blorp: Use designated initializers in surf_convert_to_single_slice

2016-11-15 Thread Jordan Justen
On 2016-11-15 11:36:33, Jason Ekstrand wrote:
>Of you want to make it simpler, we have a macro wrapper called
>isl_surf_init that will turn those fields into named parameters.  Either
>way, thanks for fixing this up.  Rb
> 
>On Nov 15, 2016 11:23 AM, "Jordan Justen" 
>wrote:
> 
>  Signed-off-by: Jordan Justen 
>  ---
>   src/intel/blorp/blorp_blit.c | 29 +
>   1 file changed, 13 insertions(+), 16 deletions(-)
> 
>  diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
>  index 1108335..c0b56c3 100644
>  --- a/src/intel/blorp/blorp_blit.c
>  +++ b/src/intel/blorp/blorp_blit.c
>  @@ -1347,22 +1347,19 @@ surf_convert_to_single_slice(const struct
>  isl_device *isl_dev,
>  uint32_t tile_x_px, tile_y_px;
>  surf_get_intratile_offset_px(info, &tile_x_px, &tile_y_px);
> 
>  -   /* TODO: Once this file gets converted to C, we shouls just use
>  designated
>  -* initializers.
>  -*/
>  -   struct isl_surf_init_info init_info = { 0, };
>  -
>  -   init_info.dim = ISL_SURF_DIM_2D;
>  -   init_info.format = info->surf.format;
>  -   init_info.width = slice_width_px + tile_x_px;
>  -   init_info.height = slice_height_px + tile_y_px;
>  -   init_info.depth = 1;
>  -   init_info.levels = 1;
>  -   init_info.array_len = 1;
>  -   init_info.samples = info->surf.samples;
>  -   init_info.min_pitch = info->surf.row_pitch;
>  -   init_info.usage = info->surf.usage;
>  -   init_info.tiling_flags = 1 << info->surf.tiling;
>  +   struct isl_surf_init_info init_info = {
>  +  .dim = ISL_SURF_DIM_2D,
>  +  .format = info->surf.format,
>  +  .width = slice_width_px + tile_x_px,
>  +  .height = slice_height_px + tile_y_px,
>  +  .depth = 1,
>  +  .levels = 1,
>  +  .array_len = 1,
>  +  .samples = info->surf.samples,
>  +  .min_pitch = info->surf.row_pitch,
>  +  .usage = info->surf.usage,
>  +  .tiling_flags = 1 << info->surf.tiling,
>  +   };
> 
>  isl_surf_init_s(isl_dev, &info->surf, &init_info);
>  assert(info->surf.row_pitch == init_info.min_pitch);

Regarding the isl_surf_init wrapper, this assert uses the init
structure. I could change to use the wrapper if we think it is okay to
drop the assert.

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


[Mesa-dev] [PATCH] mesa: if MESA_DEBUG=context, create a debug context

2016-11-15 Thread Brian Paul
A number of drivers report useful debug/perf information accessible
through GL_ARB_debug_output and with debug contexts (i.e. setting the
GLX_CONTEXT_DEBUG_BIT_ARB flag).  But few applications actually use
the GL_ARB_debug_output extension.

This change lets one set the MESA_DEBUG env var to "context" to force-set
a debug context and report debug/perf messages to stderr (or whatever
file MESA_LOG_FILE is set to).  This is a useful debugging tool.

The small change in st_api_create_context() is needed so that
st_update_debug_callback() gets called to hook up the driver debug
callbacks when ST_CONTEXT_FLAG_DEBUG was not set, but MESA_DEBUG=context.
---
 src/mesa/main/debug.c   |  3 ++-
 src/mesa/main/debug_output.c| 28 
 src/mesa/main/mtypes.h  |  3 ++-
 src/mesa/state_tracker/st_manager.c |  2 ++
 4 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 5ca7d5c..3471b26 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -189,7 +189,8 @@ set_debug_flags(const char *str)
   { "silent", DEBUG_SILENT }, /* turn off debug messages */
   { "flush", DEBUG_ALWAYS_FLUSH }, /* flush after each drawing command */
   { "incomplete_tex", DEBUG_INCOMPLETE_TEXTURE },
-  { "incomplete_fbo", DEBUG_INCOMPLETE_FBO }
+  { "incomplete_fbo", DEBUG_INCOMPLETE_FBO },
+  { "context", DEBUG_CONTEXT } /* force set GL_CONTEXT_FLAG_DEBUG_BIT flag 
*/
};
GLuint i;
 
diff --git a/src/mesa/main/debug_output.c b/src/mesa/main/debug_output.c
index 85f64bd..290d626 100644
--- a/src/mesa/main/debug_output.c
+++ b/src/mesa/main/debug_output.c
@@ -99,6 +99,7 @@ struct gl_debug_state
const void *CallbackData;
GLboolean SyncOutput;
GLboolean DebugOutput;
+   GLboolean LogToStderr;
 
struct gl_debug_group *Groups[MAX_DEBUG_GROUP_STACK_DEPTH];
struct gl_debug_message GroupMessages[MAX_DEBUG_GROUP_STACK_DEPTH];
@@ -617,6 +618,17 @@ debug_log_message(struct gl_debug_state *debug,
GLint nextEmpty;
struct gl_debug_message *emptySlot;
 
+   if (debug->LogToStderr) {
+  /* since 'buf' is not null terminated, make a copy and add \0 */
+  char *buf2 = malloc(len + 1);
+  if (buf2) {
+ memcpy(buf2, buf, len);
+ buf2[len] = 0;
+ _mesa_log("Mesa debug output: %s\n", buf2);
+ free(buf2);
+  }
+   }
+
assert(len < MAX_DEBUG_MESSAGE_LENGTH);
 
if (log->NumMessages == MAX_DEBUG_LOGGED_MESSAGES)
@@ -845,6 +857,7 @@ log_msg_locked_and_unlock(struct gl_context *ctx,
}
 
if (ctx->Debug->Callback) {
+  /* Call the user's callback function */
   GLenum gl_source = debug_source_enums[source];
   GLenum gl_type = debug_type_enums[type];
   GLenum gl_severity = debug_severity_enums[severity];
@@ -860,6 +873,7 @@ log_msg_locked_and_unlock(struct gl_context *ctx,
   callback(gl_source, gl_type, id, gl_severity, len, buf, data);
}
else {
+  /* add debug message to queue */
   debug_log_message(ctx->Debug, source, type, id, severity, len, buf);
   _mesa_unlock_debug_state(ctx);
}
@@ -1267,6 +1281,20 @@ void
 _mesa_init_debug_output(struct gl_context *ctx)
 {
mtx_init(&ctx->DebugMutex, mtx_plain);
+
+   if (MESA_DEBUG_FLAGS & DEBUG_CONTEXT) {
+  /* If the MESA_DEBUG env is set to "context", we'll turn on the
+   * GL_CONTEXT_FLAG_DEBUG_BIT context flag and log debug output
+   * messages to stderr (or whatever MESA_LOG_FILE points at).
+   */
+  struct gl_debug_state *debug = _mesa_lock_debug_state(ctx);
+  if (!debug) {
+ return;
+  }
+  debug->DebugOutput = GL_TRUE;
+  debug->LogToStderr = GL_TRUE;
+  ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT;
+   }
 }
 
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 5e98040..66bc07e 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4679,7 +4679,8 @@ enum _debug
DEBUG_SILENT = (1 << 0),
DEBUG_ALWAYS_FLUSH  = (1 << 1),
DEBUG_INCOMPLETE_TEXTURE = (1 << 2),
-   DEBUG_INCOMPLETE_FBO = (1 << 3)
+   DEBUG_INCOMPLETE_FBO = (1 << 3),
+   DEBUG_CONTEXT= (1 << 4)
 };
 
 #ifdef __cplusplus
diff --git a/src/mesa/state_tracker/st_manager.c 
b/src/mesa/state_tracker/st_manager.c
index 0f71e63..c3d8286 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -680,7 +680,9 @@ st_api_create_context(struct st_api *stapi, struct 
st_manager *smapi,
   }
 
   st->ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT;
+   }
 
+   if (st->ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT) {
   st_update_debug_callback(st);
}
 
-- 
1.9.1

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


[Mesa-dev] [PATCH mesa] egl: fix function name in debug string

2016-11-15 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/egl/main/eglconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c
index 6161d26..876c8f0 100644
--- a/src/egl/main/eglconfig.c
+++ b/src/egl/main/eglconfig.c
@@ -728,7 +728,7 @@ _eglFilterConfigArray(_EGLArray *array, EGLConfig *configs,
EGLint i, count;
 
if (!num_configs)
-  return _eglError(EGL_BAD_PARAMETER, "eglChooseConfigs");
+  return _eglError(EGL_BAD_PARAMETER, "eglChooseConfig");
 
/* get the number of matched configs */
count = _eglFilterArray(array, NULL, 0,
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa] egl: fix helper function name

2016-11-15 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/egl/main/eglapi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 53340bf..934d585 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -1195,7 +1195,7 @@ eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
 
 
 static EGLBoolean
-eglSwapBuffersWithDamageCommon(_EGLDisplay *disp, _EGLSurface *surf,
+_eglSwapBuffersWithDamageCommon(_EGLDisplay *disp, _EGLSurface *surf,
EGLint *rects, EGLint n_rects)
 {
_EGLContext *ctx = _eglGetCurrentContext();
@@ -1224,7 +1224,7 @@ eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface 
surface,
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLSurface *surf = _eglLookupSurface(surface, disp);
_EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
-   return eglSwapBuffersWithDamageCommon(disp, surf, rects, n_rects);
+   return _eglSwapBuffersWithDamageCommon(disp, surf, rects, n_rects);
 }
 
 static EGLBoolean EGLAPIENTRY
@@ -1234,7 +1234,7 @@ eglSwapBuffersWithDamageKHR(EGLDisplay dpy, EGLSurface 
surface,
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLSurface *surf = _eglLookupSurface(surface, disp);
_EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
-   return eglSwapBuffersWithDamageCommon(disp, surf, rects, n_rects);
+   return _eglSwapBuffersWithDamageCommon(disp, surf, rects, n_rects);
 }
 
 EGLBoolean EGLAPIENTRY
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa] egl/wayland: avoid double-return

2016-11-15 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/egl/drivers/dri2/platform_wayland.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c 
b/src/egl/drivers/dri2/platform_wayland.c
index 4fd4289..64eb4ef 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -693,9 +693,11 @@ try_damage_buffer(struct dri2_egl_surface *dri2_surf,
rect[2], rect[3]);
}
return EGL_TRUE;
-#endif
+#else
return EGL_FALSE;
+#endif
 }
+
 /**
  * Called via eglSwapBuffers(), drv->API.SwapBuffers().
  */
-- 
Cheers,
  Eric

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


  1   2   >