Re: [Mesa-dev] [PATCH] radv: Don't use vgpr indexing for outputs on GFX9.

2017-10-21 Thread Timothy Arceri



On 22/10/17 09:57, Bas Nieuwenhuizen wrote:

Due to LLVM bugs. Fixes a bunch of dEQP-VK.glsl.indexing.*
tests.
---
  src/amd/vulkan/radv_shader.c | 5 +
  1 file changed, 5 insertions(+)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index e572f693203..07e68d6032b 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -264,6 +264,11 @@ radv_shader_compile_to_nir(struct radv_device *device,
 !llvm_has_working_vgpr_indexing)) {
indirect_mask |= nir_var_shader_in;
}
+   if (!llvm_has_working_vgpr_indexing &&
+   (nir->info.stage == MESA_SHADER_VERTEX ||
+nir->info.stage == MESA_SHADER_TESS_EVAL ||
+nir->info.stage == MESA_SHADER_FRAGMENT))
+   indirect_mask |= nir_var_shader_out;


radeonsi doesn't support indirects for geom outputs either.

Maybe just:

if (!llvm_has_working_vgpr_indexing &&
!nir->info.stage == MESA_SHADER_TESS_CTRL)
indirect_mask |= nir_var_shader_out;

If you agree feel few to add:

Reviewed-by: Timothy Arceri 

  
  	/* TODO: We shouldn't need to do this, however LLVM isn't currently

 * smart enough to handle indirects without causing excess spilling


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


[Mesa-dev] [PATCH] radv: Don't use vgpr indexing for outputs on GFX9.

2017-10-21 Thread Bas Nieuwenhuizen
Due to LLVM bugs. Fixes a bunch of dEQP-VK.glsl.indexing.*
tests.
---
 src/amd/vulkan/radv_shader.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index e572f693203..07e68d6032b 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -264,6 +264,11 @@ radv_shader_compile_to_nir(struct radv_device *device,
 !llvm_has_working_vgpr_indexing)) {
indirect_mask |= nir_var_shader_in;
}
+   if (!llvm_has_working_vgpr_indexing &&
+   (nir->info.stage == MESA_SHADER_VERTEX ||
+nir->info.stage == MESA_SHADER_TESS_EVAL ||
+nir->info.stage == MESA_SHADER_FRAGMENT))
+   indirect_mask |= nir_var_shader_out;
 
/* TODO: We shouldn't need to do this, however LLVM isn't currently
 * smart enough to handle indirects without causing excess spilling
-- 
2.14.2

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


Re: [Mesa-dev] meson build for etnaviv and imx

2017-10-21 Thread Christian Gmeiner
Hi Dylan

2017-10-21 12:17 GMT+02:00 Christian Gmeiner :
> 2017-10-21 1:04 GMT+02:00 Dylan Baker :
>> This is all pretty straight-forward, it builds on my system, but I don't have
>> any actual hardware to test on.
>>
>> Christian and/or Wladimir, could one of you build this and do some kind of
>> testing to ensure it works?
>>
>
> Thanks for adding etnaviv/imx support - had that on my TODO list for elce. I 
> am
> just updating the used rfs filesystem on my nfs share and will give it a try.
>

Works as expected!

greets
--
Christian Gmeiner, MSc

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


Re: [Mesa-dev] meson build for etnaviv and imx

2017-10-21 Thread Christian Gmeiner
Hi

2017-10-21 8:54 GMT+02:00 Wladimir J. van der Laan :
> On Fri, Oct 20, 2017 at 04:04:09PM -0700, Dylan Baker wrote:
>> This is all pretty straight-forward, it builds on my system, but I don't have
>> any actual hardware to test on.
>>
>> Christian and/or Wladimir, could one of you build this and do some kind of
>> testing to ensure it works?
>
> Sure, if you can give me exact steps to test it (I don't even know what meson 
> is).
>

pip3 install --user meson;
meson build -Dgallium-drivers=etnaviv,imx -Dvulkan-drivers= -Ddri-drivers=
cd build; ninja

For more info have a look at http://mesonbuild.com/

greets
--
Christian Gmeiner, MSc

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


Re: [Mesa-dev] [PATCH 2/2] meson: build imx driver

2017-10-21 Thread Christian Gmeiner
2017-10-21 1:04 GMT+02:00 Dylan Baker :
> This is build tested only.
>
> Signed-off-by: Dylan Baker 

Reviewed-by: Christian Gmeiner 

> ---
>  meson.build|  5 +
>  meson_options.txt  |  2 +-
>  src/gallium/meson.build|  3 +++
>  src/gallium/targets/dri/meson.build|  5 +
>  src/gallium/winsys/imx/drm/meson.build | 28 
>  5 files changed, 42 insertions(+), 1 deletion(-)
>  create mode 100644 src/gallium/winsys/imx/drm/meson.build
>
> diff --git a/meson.build b/meson.build
> index 143ee7febf3..fdd99e48ae7 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -98,6 +98,7 @@ with_gallium_softpipe = false
>  with_gallium_vc4 = false
>  with_gallium_vc5 = false
>  with_gallium_etnaviv = false
> +with_gallium_imx = false
>  _drivers = get_option('gallium-drivers')
>  if _drivers != ''
>_split = _drivers.split(',')
> @@ -108,6 +109,7 @@ if _drivers != ''
>with_gallium_vc4 = _split.contains('vc4')
>with_gallium_vc5 = _split.contains('vc5')
>with_gallium_etnaviv = _split.contains('etnaviv')
> +  with_gallium_imx = _split.contains('imx')
>with_gallium = true
>with_dri = true
>  endif
> @@ -123,6 +125,9 @@ endif
>  if with_dri_swrast and with_gallium_softpipe
>error('Only one swrast provider can be built')
>  endif
> +if with_gallium_imx and not with_gallium_etnaviv
> +  error('IMX driver requires etnaviv driver')
> +endif
>
>  dep_libdrm_intel = []
>  if with_dri_i915
> diff --git a/meson_options.txt b/meson_options.txt
> index fbc6fad5a41..4596c8415cd 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -46,7 +46,7 @@ option(
>  option(
>'gallium-drivers',
>type : 'string',
> -  value : 'pl111,radeonsi,nouveau,swrast,vc4,etnaviv',
> +  value : 'pl111,radeonsi,nouveau,swrast,vc4,etnaviv,imx',
>description : 'comma separated list of gallium drivers to build.'
>  )
>  option(
> diff --git a/src/gallium/meson.build b/src/gallium/meson.build
> index cc823ca2e4f..29b0548a62e 100644
> --- a/src/gallium/meson.build
> +++ b/src/gallium/meson.build
> @@ -61,6 +61,9 @@ endif
>  if with_gallium_etnaviv
>subdir('winsys/etnaviv/drm')
>  endif
> +if with_gallium_imx
> +  subdir('winsys/imx/drm')
> +endif
>  subdir('state_trackers/dri')
>  # TODO: freedreno
>  # TODO: i915
> diff --git a/src/gallium/targets/dri/meson.build 
> b/src/gallium/targets/dri/meson.build
> index 9640e8acbab..1517fcc5d3c 100644
> --- a/src/gallium/targets/dri/meson.build
> +++ b/src/gallium/targets/dri/meson.build
> @@ -96,6 +96,11 @@ if with_gallium_etnaviv
>gallium_dri_link_with += [libetnaviv, libetnavivdrm]
>gallium_dri_drivers += 'etnaviv_dri.so'
>  endif
> +if with_gallium_imx
> +  gallium_dri_c_args += '-DGALLIUM_IMX'
> +  gallium_dri_link_with += libimxdrm
> +  gallium_dri_drivers += 'imx-drm_dri.so'
> +endif
>
>  if with_gallium_vc4 or with_gallium_vc5
>gallium_dri_link_with += libbroadcom_cle
> diff --git a/src/gallium/winsys/imx/drm/meson.build 
> b/src/gallium/winsys/imx/drm/meson.build
> new file mode 100644
> index 000..468345476ec
> --- /dev/null
> +++ b/src/gallium/winsys/imx/drm/meson.build
> @@ -0,0 +1,28 @@
> +# Copyright © 2017 Intel Corporation
> +
> +# Permission is hereby granted, free of charge, to any person obtaining a 
> copy
> +# of this software and associated documentation files (the "Software"), to 
> deal
> +# in the Software without restriction, including without limitation the 
> rights
> +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> +# copies of the Software, and to permit persons to whom the Software is
> +# furnished to do so, subject to the following conditions:
> +
> +# The above copyright notice and this permission notice shall be included in
> +# all copies or substantial portions of the Software.
> +
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM,
> +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
> +# SOFTWARE.
> +
> +libimxdrm = static_library(
> +  'imxdrm',
> +  'imx_drm_winsys.c',
> +  include_directories : [
> +inc_include, inc_src, inc_gallium, inc_gallium_aux,
> +include_directories('../..'),
> +  ],
> +)
> --
> 2.14.2
>

greets
--
Christian Gmeiner, MSc

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


Re: [Mesa-dev] [PATCH 1/2] meson: build etnaviv driver + winsys

2017-10-21 Thread Christian Gmeiner
2017-10-21 1:04 GMT+02:00 Dylan Baker :
> Build tested only.
>
> Signed-off-by: Dylan Baker 

Reviewed-by: Christian Gmeiner 

> ---
>  meson.build|  6 ++
>  meson_options.txt  |  2 +-
>  src/gallium/drivers/etnaviv/meson.build| 96 
> ++
>  src/gallium/meson.build|  7 ++-
>  src/gallium/targets/dri/meson.build|  5 ++
>  src/gallium/winsys/etnaviv/drm/meson.build | 28 +
>  6 files changed, 142 insertions(+), 2 deletions(-)
>  create mode 100644 src/gallium/drivers/etnaviv/meson.build
>  create mode 100644 src/gallium/winsys/etnaviv/drm/meson.build
>
> diff --git a/meson.build b/meson.build
> index 82c4d2ed12c..143ee7febf3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -97,6 +97,7 @@ with_gallium_nouveau = false
>  with_gallium_softpipe = false
>  with_gallium_vc4 = false
>  with_gallium_vc5 = false
> +with_gallium_etnaviv = false
>  _drivers = get_option('gallium-drivers')
>  if _drivers != ''
>_split = _drivers.split(',')
> @@ -106,6 +107,7 @@ if _drivers != ''
>with_gallium_softpipe = _split.contains('swrast')
>with_gallium_vc4 = _split.contains('vc4')
>with_gallium_vc5 = _split.contains('vc5')
> +  with_gallium_etnaviv = _split.contains('etnaviv')
>with_gallium = true
>with_dri = true
>  endif
> @@ -564,6 +566,7 @@ dep_m = cc.find_library('m', required : false)
>  dep_libdrm_amdgpu = []
>  dep_libdrm_radeon = []
>  dep_libdrm_nouveau = []
> +dep_libdrm_etnaviv = []
>  if with_amd_vk or with_gallium_radeonsi
>dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.84')
>  endif
> @@ -573,6 +576,9 @@ endif
>  if with_gallium_nouveau
>dep_libdrm_nouveau = dependency('libdrm_nouveau', version : '>= 2.4.66')
>  endif
> +if with_gallium_etnaviv
> +  dep_libdrm_etnaviv = dependency('libdrm_etnaviv', version : '>= 2.4.82')
> +endif
>
>  llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
>  if with_amd_vk
> diff --git a/meson_options.txt b/meson_options.txt
> index 8fd00d41b45..fbc6fad5a41 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -46,7 +46,7 @@ option(
>  option(
>'gallium-drivers',
>type : 'string',
> -  value : 'pl111,radeonsi,nouveau,swrast,vc4',
> +  value : 'pl111,radeonsi,nouveau,swrast,vc4,etnaviv',
>description : 'comma separated list of gallium drivers to build.'
>  )
>  option(
> diff --git a/src/gallium/drivers/etnaviv/meson.build 
> b/src/gallium/drivers/etnaviv/meson.build
> new file mode 100644
> index 000..f4ae57b4a75
> --- /dev/null
> +++ b/src/gallium/drivers/etnaviv/meson.build
> @@ -0,0 +1,96 @@
> +# Copyright © 2017 Intel Corporation
> +
> +# Permission is hereby granted, free of charge, to any person obtaining a 
> copy
> +# of this software and associated documentation files (the "Software"), to 
> deal
> +# in the Software without restriction, including without limitation the 
> rights
> +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> +# copies of the Software, and to permit persons to whom the Software is
> +# furnished to do so, subject to the following conditions:
> +
> +# The above copyright notice and this permission notice shall be included in
> +# all copies or substantial portions of the Software.
> +
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM,
> +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
> +# SOFTWARE.
> +
> +files_etnaviv = files(
> +  'hw/cmdstream.xml.h',
> +  'hw/common.xml.h',
> +  'hw/isa.xml.h',
> +  'hw/state_3d.xml.h',
> +  'hw/state.xml.h',
> +  'etnaviv_asm.c',
> +  'etnaviv_asm.h',
> +  'etnaviv_blend.c',
> +  'etnaviv_blend.h',
> +  'etnaviv_clear_blit.c',
> +  'etnaviv_clear_blit.h',
> +  'etnaviv_compiler.c',
> +  'etnaviv_compiler.h',
> +  'etnaviv_context.c',
> +  'etnaviv_context.h',
> +  'etnaviv_debug.h',
> +  'etnaviv_disasm.c',
> +  'etnaviv_disasm.h',
> +  'etnaviv_emit.c',
> +  'etnaviv_emit.h',
> +  'etnaviv_fence.c',
> +  'etnaviv_fence.h',
> +  'etnaviv_format.c',
> +  'etnaviv_format.h',
> +  'etnaviv_internal.h',
> +  'etnaviv_query.c',
> +  'etnaviv_query.h',
> +  'etnaviv_query_hw.c',
> +  'etnaviv_query_hw.h',
> +  'etnaviv_query_sw.c',
> +  'etnaviv_query_sw.h',
> +  'etnaviv_rasterizer.c',
> +  'etnaviv_rasterizer.h',
> +  'etnaviv_resource.c',
> +  'etnaviv_resource.h',
> +  'etnaviv_rs.c',
> +  'etnaviv_rs.h',
> +  'etnaviv_screen.c',
> +  'etnaviv_screen.h',
> +  'etnaviv_shader.c',
> +  'etnaviv_shader.h',
> +  

[Mesa-dev] [PATCH] ac/nir: Account for compact array index in GS input load from LDS.

2017-10-21 Thread Bas Nieuwenhuizen
Mirrors the vram path.

Fixes: d4ecc3c9299 'ac/nir: Add loading from LDS for merged GS.'
---
 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 ca856bb2f9e..83b49b535c6 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3011,7 +3011,7 @@ load_gs_input(struct nir_to_llvm_context *ctx,
if (ctx->ac.chip_class >= GFX9) {
LLVMValueRef dw_addr = 
ctx->gs_vtx_offset[vtx_offset_param];
dw_addr = LLVMBuildAdd(ctx->ac.builder, dw_addr,
-  LLVMConstInt(ctx->ac.i32, param 
* 4 + i, 0), "");
+  LLVMConstInt(ctx->ac.i32, param 
* 4 + i + const_index, 0), "");
value[i] = lds_load(ctx, dw_addr);
} else {
args[0] = ctx->esgs_ring;
-- 
2.14.2

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


Re: [Mesa-dev] [PATCH] glsl: fix derived cs variables for variable group sizes

2017-10-21 Thread Ilia Mirkin
On Sat, Oct 21, 2017 at 3:18 PM, Ilia Mirkin  wrote:
> Both gl_GlobalInvocationID and gl_LocalInvocationIndex depend on the
> gl_WorkGroupSize. However with variable group sizes, this value is not
> available. Use the gl_LocalGroupSizeARB instead, which contains the
> relevant value.
>
> There should not be any situation where at least one of those is not
> defined.

Actually ... there is. When there are multiple compute shaders, linked
together, some may not have a work group size declaration.

So this needs a more subtle solution. Could be that the shader with
main() does not have either declaration. Seems like this should be
moved to link-time, at which point all this stuff is groupped
together. There could be other difficulties with that of course...

>
> Reported-by: Stephane Chevigny 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103393
> Cc: mesa-sta...@lists.freedesktop.org
> Signed-off-by: Ilia Mirkin 
> ---
>  src/compiler/glsl/builtin_variables.cpp | 12 +++-
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/src/compiler/glsl/builtin_variables.cpp 
> b/src/compiler/glsl/builtin_variables.cpp
> index ea2d897cc8e..85ac0de848b 100644
> --- a/src/compiler/glsl/builtin_variables.cpp
> +++ b/src/compiler/glsl/builtin_variables.cpp
> @@ -1494,15 +1494,9 @@ initialize_cs_derived_variables(gl_shader *shader,
> assert(gl_WorkGroupID);
> ir_variable *gl_WorkGroupSize =
>shader->symbols->get_variable("gl_WorkGroupSize");
> -   if (gl_WorkGroupSize == NULL) {
> -  void *const mem_ctx = ralloc_parent(shader->ir);
> -  gl_WorkGroupSize = new(mem_ctx) ir_variable(glsl_type::uvec3_type,
> -  "gl_WorkGroupSize",
> -  ir_var_auto);
> -  gl_WorkGroupSize->data.how_declared = ir_var_declared_implicitly;
> -  gl_WorkGroupSize->data.read_only = true;
> -  shader->ir->push_head(gl_WorkGroupSize);
> -   }
> +   if (gl_WorkGroupSize == NULL)
> +  gl_WorkGroupSize = 
> shader->symbols->get_variable("gl_LocalGroupSizeARB");
> +   assert(gl_WorkGroupSize);
> ir_variable *gl_LocalInvocationID =
>shader->symbols->get_variable("gl_LocalInvocationID");
> assert(gl_LocalInvocationID);
> --
> 2.13.6
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] glsl: fix derived cs variables for variable group sizes

2017-10-21 Thread Ilia Mirkin
Both gl_GlobalInvocationID and gl_LocalInvocationIndex depend on the
gl_WorkGroupSize. However with variable group sizes, this value is not
available. Use the gl_LocalGroupSizeARB instead, which contains the
relevant value.

There should not be any situation where at least one of those is not
defined.

Reported-by: Stephane Chevigny 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103393
Cc: mesa-sta...@lists.freedesktop.org
Signed-off-by: Ilia Mirkin 
---
 src/compiler/glsl/builtin_variables.cpp | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/compiler/glsl/builtin_variables.cpp 
b/src/compiler/glsl/builtin_variables.cpp
index ea2d897cc8e..85ac0de848b 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -1494,15 +1494,9 @@ initialize_cs_derived_variables(gl_shader *shader,
assert(gl_WorkGroupID);
ir_variable *gl_WorkGroupSize =
   shader->symbols->get_variable("gl_WorkGroupSize");
-   if (gl_WorkGroupSize == NULL) {
-  void *const mem_ctx = ralloc_parent(shader->ir);
-  gl_WorkGroupSize = new(mem_ctx) ir_variable(glsl_type::uvec3_type,
-  "gl_WorkGroupSize",
-  ir_var_auto);
-  gl_WorkGroupSize->data.how_declared = ir_var_declared_implicitly;
-  gl_WorkGroupSize->data.read_only = true;
-  shader->ir->push_head(gl_WorkGroupSize);
-   }
+   if (gl_WorkGroupSize == NULL)
+  gl_WorkGroupSize = shader->symbols->get_variable("gl_LocalGroupSizeARB");
+   assert(gl_WorkGroupSize);
ir_variable *gl_LocalInvocationID =
   shader->symbols->get_variable("gl_LocalInvocationID");
assert(gl_LocalInvocationID);
-- 
2.13.6

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


[Mesa-dev] [PATCH] radv: Don't compile shaders when they are cached already.

2017-10-21 Thread Bas Nieuwenhuizen
When the gs_copy_shader is NULL (due to an incomplete cache), but
the main shaders are found, we still do the nir, but we shouldn't
compile the shaders again. For merged shaders we should also account
for the missing shaders.

Fixes: ce03c119ce0 'radv: Add code to compile merged shaders.'
---
 src/amd/vulkan/radv_pipeline.c | 42 +++---
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index db550811eaf..f23afa42b70 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1779,10 +1779,12 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
radv_link_shaders(pipeline, nir);
 
if (nir[MESA_SHADER_FRAGMENT]) {
-   pipeline->shaders[MESA_SHADER_FRAGMENT] =
-   radv_shader_variant_create(device, 
modules[MESA_SHADER_FRAGMENT], [MESA_SHADER_FRAGMENT], 1,
-  pipeline->layout, keys ? 
keys + MESA_SHADER_FRAGMENT : 0,
-  
[MESA_SHADER_FRAGMENT], _sizes[MESA_SHADER_FRAGMENT]);
+   if (!pipeline->shaders[MESA_SHADER_FRAGMENT]) {
+   pipeline->shaders[MESA_SHADER_FRAGMENT] =
+  radv_shader_variant_create(device, 
modules[MESA_SHADER_FRAGMENT], [MESA_SHADER_FRAGMENT], 1,
+ pipeline->layout, 
keys ? keys + MESA_SHADER_FRAGMENT : 0,
+ 
[MESA_SHADER_FRAGMENT], _sizes[MESA_SHADER_FRAGMENT]);
+   }
 
/* TODO: These are no longer used as keys we should refactor 
this */
if (keys) {
@@ -1793,26 +1795,28 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
}
}
 
-   if (device->physical_device->rad_info.chip_class >= GFX9 &&
-   modules[MESA_SHADER_TESS_CTRL] && 
!pipeline->shaders[MESA_SHADER_TESS_CTRL]) {
-   struct nir_shader *combined_nir[] = {nir[MESA_SHADER_VERTEX], 
nir[MESA_SHADER_TESS_CTRL]};
-   struct ac_shader_variant_key key = keys[MESA_SHADER_TESS_CTRL];
-   key.tcs.vs_key = keys[MESA_SHADER_VERTEX].vs;
-   pipeline->shaders[MESA_SHADER_TESS_CTRL] = 
radv_shader_variant_create(device, modules[MESA_SHADER_TESS_CTRL], 
combined_nir, 2,
-   
  pipeline->layout,
-   
  , [MESA_SHADER_TESS_CTRL],
-   
  _sizes[MESA_SHADER_TESS_CTRL]);
+   if (device->physical_device->rad_info.chip_class >= GFX9 && 
modules[MESA_SHADER_TESS_CTRL]) {
+   if (!pipeline->shaders[MESA_SHADER_TESS_CTRL]) {
+   struct nir_shader *combined_nir[] = 
{nir[MESA_SHADER_VERTEX], nir[MESA_SHADER_TESS_CTRL]};
+   struct ac_shader_variant_key key = 
keys[MESA_SHADER_TESS_CTRL];
+   key.tcs.vs_key = keys[MESA_SHADER_VERTEX].vs;
+   pipeline->shaders[MESA_SHADER_TESS_CTRL] = 
radv_shader_variant_create(device, modules[MESA_SHADER_TESS_CTRL], 
combined_nir, 2,
+   
  pipeline->layout,
+   
  , [MESA_SHADER_TESS_CTRL],
+   
  _sizes[MESA_SHADER_TESS_CTRL]);
+   }
modules[MESA_SHADER_VERTEX] = NULL;
}
 
-   if (device->physical_device->rad_info.chip_class >= GFX9 &&
-   modules[MESA_SHADER_GEOMETRY] && 
!pipeline->shaders[MESA_SHADER_GEOMETRY]) {
+   if (device->physical_device->rad_info.chip_class >= GFX9 && 
modules[MESA_SHADER_GEOMETRY]) {
gl_shader_stage pre_stage = modules[MESA_SHADER_TESS_EVAL] ? 
MESA_SHADER_TESS_EVAL : MESA_SHADER_VERTEX;
-   struct nir_shader *combined_nir[] = {nir[pre_stage], 
nir[MESA_SHADER_GEOMETRY]};
-   pipeline->shaders[MESA_SHADER_GEOMETRY] = 
radv_shader_variant_create(device, modules[MESA_SHADER_GEOMETRY], combined_nir, 
2,
-   
 pipeline->layout,
-   
 [pre_stage] , [MESA_SHADER_GEOMETRY],
+   if (!pipeline->shaders[MESA_SHADER_GEOMETRY]) {
+   struct nir_shader *combined_nir[] = {nir[pre_stage], 
nir[MESA_SHADER_GEOMETRY]};
+   pipeline->shaders[MESA_SHADER_GEOMETRY] = 
radv_shader_variant_create(device, modules[MESA_SHADER_GEOMETRY], 

[Mesa-dev] [PATCH] radv: Don't check for max GL GS invocations.

2017-10-21 Thread Bas Nieuwenhuizen
We specify 127 instead of 32 as the limit in vulkan.

Fixes: 6bc42855f92 'radv: enable GS on GFX9'
---
 src/amd/vulkan/radv_pipeline.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index eac4456a3fb..db550811eaf 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1196,8 +1196,6 @@ static void calculate_gfx9_gs_info(const 
VkGraphicsPipelineCreateInfo *pCreateIn
unsigned max_gs_prims, gs_prims;
unsigned min_es_verts, es_verts, worst_case_es_verts;
 
-   assert(gs_num_invocations <= 32); /* GL maximum */
-
if (uses_adjacency || gs_num_invocations > 1)
max_gs_prims = 127 / gs_num_invocations;
else
-- 
2.14.2

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


Re: [Mesa-dev] [PATCH 3/3] radv: Don't explicitly reference vertex shader for draw_id.

2017-10-21 Thread Samuel Pitoiset

With my comment on patch 2 addressed, series is:

Reviewed-by: Samuel Pitoiset 

Thanks for fixing this!

On 10/21/2017 06:25 PM, Bas Nieuwenhuizen wrote:

With merged shaders the vertex shader may not exist. This got in
because the offending patch was written before merged shaders were
upstream, but committed after.

Fixes: 75dfab24a2c 'radv: refactor indirect draws with radv_draw_info'
---
  src/amd/vulkan/radv_cmd_buffer.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index dc8e037dbd3..f8501257348 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -2954,7 +2954,7 @@ radv_cs_emit_indirect_draw_packet(struct radv_cmd_buffer 
*cmd_buffer,
struct radeon_winsys_cs *cs = cmd_buffer->cs;
unsigned di_src_sel = indexed ? V_0287F0_DI_SRC_SEL_DMA
  : V_0287F0_DI_SRC_SEL_AUTO_INDEX;
-   bool draw_id_enable = 
cmd_buffer->state.pipeline->shaders[MESA_SHADER_VERTEX]->info.info.vs.needs_draw_id;
+   bool draw_id_enable = 
radv_get_vertex_shader(cmd_buffer->state.pipeline)->info.info.vs.needs_draw_id;
uint32_t base_reg = cmd_buffer->state.pipeline->graphics.vtx_base_sgpr;
assert(base_reg);
  


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


Re: [Mesa-dev] [PATCH 2/3] radv: Keep RADV_CMD_DIRTY_INDEX_BUFFER.

2017-10-21 Thread Samuel Pitoiset



On 10/21/2017 06:25 PM, Bas Nieuwenhuizen wrote:

Otherwise for non-indexed draws we set and immediately unset it.

Fixes: 341529dbee5 'radv: use optimal packet order for draws'
---
  src/amd/vulkan/radv_cmd_buffer.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 887b789df87..dc8e037dbd3 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3152,7 +3152,7 @@ radv_emit_all_graphics_states(struct radv_cmd_buffer 
*cmd_buffer,
 info->instance_count > 1, info->indirect,
 info->indirect ? 0 : info->count);
  
-	cmd_buffer->state.dirty = 0;

+   cmd_buffer->state.dirty &= RADV_CMD_DIRTY_INDEX_BUFFER;


This is actually not needed, I think I messed up my rebase. Now, all 
dirty flags are cleared in the relevant emit helpers.


So, cmd_buffer->state.dirty = 0; should be removed.


  }
  
  static void



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


[Mesa-dev] [Bug 103388] Linking libcltgsi.la (llvm/codegen/libclllvm_la-common.lo) fails with "error: no match for 'operator-'" with GCC-7, Mesa from Git and current LLVM revisions

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103388

--- Comment #4 from Kai  ---
(In reply to Andy Furniss from comment #3)
> Don't know why it would work with 4.8, but it's a known issue.

Sorry, should have made that clear in my comment: I only tested the GCC from
Debian's 7.2.0-11 package. I have no idea, if an older GCC would have worked.

> You could remove --enable-opencl as a temp workaround or apply this patch
> until the alternate fix that's discussed goes in.
> 
> https://patchwork.freedesktop.org/patch/182916/

Thanks, the patch works. You can have my
 Tested-by: Kai Wasserbäch 
for it.

-- 
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] [PATCH 3/3] radv: Don't explicitly reference vertex shader for draw_id.

2017-10-21 Thread Bas Nieuwenhuizen
With merged shaders the vertex shader may not exist. This got in
because the offending patch was written before merged shaders were
upstream, but committed after.

Fixes: 75dfab24a2c 'radv: refactor indirect draws with radv_draw_info'
---
 src/amd/vulkan/radv_cmd_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index dc8e037dbd3..f8501257348 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -2954,7 +2954,7 @@ radv_cs_emit_indirect_draw_packet(struct radv_cmd_buffer 
*cmd_buffer,
struct radeon_winsys_cs *cs = cmd_buffer->cs;
unsigned di_src_sel = indexed ? V_0287F0_DI_SRC_SEL_DMA
  : V_0287F0_DI_SRC_SEL_AUTO_INDEX;
-   bool draw_id_enable = 
cmd_buffer->state.pipeline->shaders[MESA_SHADER_VERTEX]->info.info.vs.needs_draw_id;
+   bool draw_id_enable = 
radv_get_vertex_shader(cmd_buffer->state.pipeline)->info.info.vs.needs_draw_id;
uint32_t base_reg = cmd_buffer->state.pipeline->graphics.vtx_base_sgpr;
assert(base_reg);
 
-- 
2.14.2

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


[Mesa-dev] [PATCH 1/3] radv: Correctly detect changed shaders for vertex descriptors.

2017-10-21 Thread Bas Nieuwenhuizen
As they were emitted after the new pipeline, the changed pipeline
detection was not working anymore.

Fixes: 341529dbee5 'radv: use optimal packet order for draws'
---
 src/amd/vulkan/radv_cmd_buffer.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index d511659d02d..887b789df87 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1719,11 +1719,11 @@ radv_flush_constants(struct radv_cmd_buffer *cmd_buffer,
 }
 
 static bool
-radv_cmd_buffer_update_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer)
+radv_cmd_buffer_update_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer, 
bool pipeline_is_dirty)
 {
struct radv_device *device = cmd_buffer->device;
 
-   if ((cmd_buffer->state.pipeline != cmd_buffer->state.emitted_pipeline 
|| cmd_buffer->state.vb_dirty) &&
+   if ((pipeline_is_dirty || cmd_buffer->state.vb_dirty) &&
cmd_buffer->state.pipeline->vertex_elements.count &&

radv_get_vertex_shader(cmd_buffer->state.pipeline)->info.info.vs.has_vertex_buffers)
 {
struct radv_vertex_elements_info *velems = 
_buffer->state.pipeline->vertex_elements;
@@ -1771,9 +1771,9 @@ radv_cmd_buffer_update_vertex_descriptors(struct 
radv_cmd_buffer *cmd_buffer)
 }
 
 static bool
-radv_upload_graphics_shader_descriptors(struct radv_cmd_buffer *cmd_buffer)
+radv_upload_graphics_shader_descriptors(struct radv_cmd_buffer *cmd_buffer, 
bool pipeline_is_dirty)
 {
-   if (!radv_cmd_buffer_update_vertex_descriptors(cmd_buffer))
+   if (!radv_cmd_buffer_update_vertex_descriptors(cmd_buffer, 
pipeline_is_dirty))
return false;
 
radv_flush_descriptors(cmd_buffer, VK_SHADER_STAGE_ALL_GRAPHICS);
@@ -3186,7 +3186,7 @@ radv_draw(struct radv_cmd_buffer *cmd_buffer,
si_emit_cache_flush(cmd_buffer);
/* <-- CUs are idle here --> */
 
-   if (!radv_upload_graphics_shader_descriptors(cmd_buffer))
+   if (!radv_upload_graphics_shader_descriptors(cmd_buffer, 
pipeline_is_dirty))
return;
 
radv_emit_draw_packets(cmd_buffer, info);
@@ -3211,7 +3211,7 @@ radv_draw(struct radv_cmd_buffer *cmd_buffer,
   cmd_buffer->state.pipeline);
}
 
-   if (!radv_upload_graphics_shader_descriptors(cmd_buffer))
+   if (!radv_upload_graphics_shader_descriptors(cmd_buffer, 
pipeline_is_dirty))
return;
 
radv_emit_all_graphics_states(cmd_buffer, info);
-- 
2.14.2

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


[Mesa-dev] [PATCH 2/3] radv: Keep RADV_CMD_DIRTY_INDEX_BUFFER.

2017-10-21 Thread Bas Nieuwenhuizen
Otherwise for non-indexed draws we set and immediately unset it.

Fixes: 341529dbee5 'radv: use optimal packet order for draws'
---
 src/amd/vulkan/radv_cmd_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 887b789df87..dc8e037dbd3 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3152,7 +3152,7 @@ radv_emit_all_graphics_states(struct radv_cmd_buffer 
*cmd_buffer,
 info->instance_count > 1, info->indirect,
 info->indirect ? 0 : info->count);
 
-   cmd_buffer->state.dirty = 0;
+   cmd_buffer->state.dirty &= RADV_CMD_DIRTY_INDEX_BUFFER;
 }
 
 static void
-- 
2.14.2

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


[Mesa-dev] [Bug 103388] Linking libcltgsi.la (llvm/codegen/libclllvm_la-common.lo) fails with "error: no match for 'operator-'" with GCC-7, Mesa from Git and current LLVM revisions

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103388

--- Comment #3 from Andy Furniss  ---
Don't know why it would work with 4.8, but it's a known issue.

You could remove --enable-opencl as a temp workaround or apply this patch until
the alternate fix that's discussed goes in.

https://patchwork.freedesktop.org/patch/182916/

-- 
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


[Mesa-dev] [PATCH 0/3] OpenGL 3.1 with ARB_compatibility

2017-10-21 Thread Marek Olšák
Hi,

This shouldn't be a surprise to some of you. Let's say this is a new
trend in Mesa.

OpenGL 3.1 with ARB_compatibility is tiny since most of the work was
done a long time ago.

This is not really a Compatibility profile because the first Compatibility
profile starts at OpenGL 3.2, but it's fundamentally the same thing.

Please review.

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


[Mesa-dev] [PATCH 2/3] mesa: enable ARB_texture_buffer_* extensions in the Compatibility profile

2017-10-21 Thread Marek Olšák
From: Marek Olšák 

We already have piglit tests testing alpha, luminance, and intensity
formats. They were skipped by piglit until now.

Additionally, I'm enabling one ARB_texture_buffer_range piglit test to run
with the compat profile.
---
 src/mapi/glapi/gen/apiexec.py| 12 +---
 src/mesa/drivers/dri/i965/intel_extensions.c |  8 +---
 src/mesa/main/extensions_table.h |  6 +++---
 src/mesa/main/get.c  |  2 --
 src/mesa/main/get_hash_params.py | 20 ++--
 src/mesa/main/tests/dispatch_sanity.cpp  |  8 
 src/mesa/main/texparam.c |  4 ++--
 src/mesa/state_tracker/st_context.c  |  2 +-
 src/mesa/state_tracker/st_extensions.c   |  8 +++-
 src/mesa/state_tracker/st_extensions.h   |  3 ++-
 src/mesa/state_tracker/st_manager.c  |  2 +-
 11 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
index 61eda4b..7da0818 100644
--- a/src/mapi/glapi/gen/apiexec.py
+++ b/src/mapi/glapi/gen/apiexec.py
@@ -28,21 +28,21 @@ class exec_info():
 10).  For example, glCreateProgram was added in OpenGL 2.0, so
 compatibility=20 and core=31.
 
 If the attribute is None, then it cannot be supported by that
 API.  For example, glNewList was removed from core profiles, so
 compatibility=10 and core=None.
 
 Each of the attributes that is not None must have a valid value.  The
 valid ranges are:
 
-compatiblity: [10, 30]
+compatibility: [10, )
 core: [31, )
 es1: [10, 11]
 es2: [20, )
 
 These ranges are enforced by the constructor.
 """
 def __init__(self, compatibility=None, core=None, es1=None, es2=None):
 if compatibility is not None:
 assert isinstance(compatibility, int)
 assert compatibility >= 10
@@ -59,23 +59,22 @@ class exec_info():
 if es2 is not None:
 assert isinstance(es2, int)
 assert es2 >= 20
 
 self.compatibility = compatibility
 self.core = core
 self.es1 = es1
 self.es2 = es2
 
 functions = {
-# OpenGL 3.1 / GL_ARB_texture_buffer_object.  Mesa only exposes this
-# extension with core profile.
-"TexBuffer": exec_info(core=31, es2=31),
+# OpenGL 3.1 / GL_ARB_texture_buffer_object.
+"TexBuffer": exec_info(compatibility=20, core=31, es2=31),
 
 # OpenGL 3.2 / GL_OES_geometry_shader.
 "FramebufferTexture": exec_info(core=32, es2=31),
 
 # OpenGL 4.0 / GL_ARB_shader_subroutines. Mesa only exposes this
 # extension with core profile.
 "GetSubroutineUniformLocation": exec_info(core=31),
 "GetSubroutineIndex": exec_info(core=31),
 "GetActiveSubroutineUniformiv": exec_info(core=31),
 "GetActiveSubroutineUniformName": exec_info(core=31),
@@ -137,23 +136,22 @@ functions = {
 "ViewportIndexedf": exec_info(core=32, es2=31),
 "ViewportIndexedfv": exec_info(core=32, es2=31),
 "ScissorArrayv": exec_info(core=32, es2=31),
 "ScissorIndexed": exec_info(core=32, es2=31),
 "ScissorIndexedv": exec_info(core=32, es2=31),
 "DepthRangeArrayv": exec_info(core=32),
 "DepthRangeIndexed": exec_info(core=32),
 # GetFloati_v also GL_ARB_shader_atomic_counters
 # GetDoublei_v also GL_ARB_shader_atomic_counters
 
-# OpenGL 4.3 / GL_ARB_texture_buffer_range.  Mesa can expose the extension
-# with OpenGL 3.1.
-"TexBufferRange": exec_info(core=31, es2=31),
+# OpenGL 4.3 / GL_ARB_texture_buffer_range.
+"TexBufferRange": exec_info(compatibility=20, core=31, es2=31),
 
 # OpenGL 4.3 / GL_ARB_framebuffer_no_attachments.  Mesa can expose the
 # extension with OpenGL 3.0.
 "FramebufferParameteri": exec_info(compatibility=30, core=31, es2=31),
 "GetFramebufferParameteri": exec_info(compatibility=30, core=31, es2=31),
 
 # OpenGL 4.5 / GL_ARB_direct_state_access.   Mesa can expose the extension
 # with core profile.
 "CreateTransformFeedbacks": exec_info(core=31),
 "TransformFeedbackBufferBase": exec_info(core=31),
diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c 
b/src/mesa/drivers/dri/i965/intel_extensions.c
index 519d0a5..21cf632 100644
--- a/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -171,23 +171,25 @@ intelInitExtensions(struct gl_context *ctx)
  !driQueryOptionb(>optionCache, "disable_blend_func_extended");
   ctx->Extensions.ARB_conditional_render_inverted = true;
   ctx->Extensions.ARB_cull_distance = true;
   ctx->Extensions.ARB_draw_buffers_blend = true;
   ctx->Extensions.ARB_enhanced_layouts = true;
   ctx->Extensions.ARB_ES3_compatibility = true;
   ctx->Extensions.ARB_fragment_layer_viewport = true;
   ctx->Extensions.ARB_pipeline_statistics_query = true;
   ctx->Extensions.ARB_sample_shading = 

[Mesa-dev] [PATCH 1/3] mesa: return 0 for GL_INTERNALFORMAT_SUPPORTED for unsupported TBO formats

2017-10-21 Thread Marek Olšák
From: Marek Olšák 

---
 src/mesa/main/formatquery.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index 77c7faa..05b7810 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -895,20 +895,25 @@ _mesa_GetInternalformativ(GLenum target, GLenum 
internalformat, GLenum pname,
   if (pname == GL_NUM_SAMPLE_COUNTS && ctx->API == API_OPENGLES2 &&
   ctx->Version == 30 && _mesa_is_enum_format_integer(internalformat)) {
  goto end;
   }
 
   ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
   buffer);
   break;
 
case GL_INTERNALFORMAT_SUPPORTED:
+  /* Reject invalid texture buffer formats. */
+  if (target == GL_TEXTURE_BUFFER &&
+  _mesa_validate_texbuffer_format(ctx, internalformat) == 
MESA_FORMAT_NONE)
+ break;
+
   /* Having a supported  is implemented as a prerequisite
* for all the . Thus,  if we reach this point, the 
internalformat is
* supported.
*/
   buffer[0] = GL_TRUE;
   break;
 
case GL_INTERNALFORMAT_PREFERRED:
   /* The ARB_internalformat_query2 spec says:
*
-- 
2.7.4

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


[Mesa-dev] [PATCH 3/3] mesa: final changes to expose OpenGL 3.1 with ARB_compatibility

2017-10-21 Thread Marek Olšák
From: Marek Olšák 

---
 src/mesa/main/extensions_table.h |  1 +
 src/mesa/main/mtypes.h   |  1 +
 src/mesa/main/version.c  | 13 -
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index e26d395..38e915d 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -33,20 +33,21 @@ EXT(ARB_ES3_2_compatibility , 
ARB_ES3_2_compatibility
 EXT(ARB_ES3_compatibility   , ARB_ES3_compatibility
  , GLL, GLC,  x ,  x , 2012)
 EXT(ARB_arrays_of_arrays, ARB_arrays_of_arrays 
  , GLL, GLC,  x ,  x , 2012)
 EXT(ARB_base_instance   , ARB_base_instance
  , GLL, GLC,  x ,  x , 2011)
 EXT(ARB_bindless_texture, ARB_bindless_texture 
  , GLL, GLC,  x ,  x , 2013)
 EXT(ARB_blend_func_extended , ARB_blend_func_extended  
  , GLL, GLC,  x ,  x , 2009)
 EXT(ARB_buffer_storage  , ARB_buffer_storage   
  , GLL, GLC,  x ,  x , 2013)
 EXT(ARB_clear_buffer_object , dummy_true   
  , GLL, GLC,  x ,  x , 2012)
 EXT(ARB_clear_texture   , ARB_clear_texture
  , GLL, GLC,  x ,  x , 2013)
 EXT(ARB_clip_control, ARB_clip_control 
  , GLL, GLC,  x ,  x , 2014)
 EXT(ARB_color_buffer_float  , ARB_color_buffer_float   
  , GLL, GLC,  x ,  x , 2004)
+EXT(ARB_compatibility   , ARB_compatibility
  , GLL,  x ,  x ,  x , 2009)
 EXT(ARB_compressed_texture_pixel_storage, dummy_true   
  , GLL, GLC,  x ,  x , 2011)
 EXT(ARB_compute_shader  , ARB_compute_shader   
  , GLL, GLC,  x ,  x , 2012)
 EXT(ARB_compute_variable_group_size , ARB_compute_variable_group_size  
  , GLL, GLC,  x ,  x , 2013)
 EXT(ARB_conditional_render_inverted , ARB_conditional_render_inverted  
  , GLL, GLC,  x ,  x , 2014)
 EXT(ARB_conservative_depth  , ARB_conservative_depth   
  , GLL, GLC,  x ,  x , 2011)
 EXT(ARB_copy_buffer , dummy_true   
  , GLL, GLC,  x ,  x , 2008)
 EXT(ARB_copy_image  , ARB_copy_image   
  , GLL, GLC,  x ,  x , 2012)
 EXT(ARB_cull_distance   , ARB_cull_distance
  , GLL, GLC,  x ,  x , 2014)
 EXT(ARB_debug_output, dummy_true   
  , GLL, GLC,  x ,  x , 2009)
 EXT(ARB_depth_buffer_float  , ARB_depth_buffer_float   
  , GLL, GLC,  x ,  x , 2008)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 2802a0e..8a1fae1 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4012,20 +4012,21 @@ struct gl_extensions
GLboolean ARB_ES3_1_compatibility;
GLboolean ARB_ES3_2_compatibility;
GLboolean ARB_arrays_of_arrays;
GLboolean ARB_base_instance;
GLboolean ARB_bindless_texture;
GLboolean ARB_blend_func_extended;
GLboolean ARB_buffer_storage;
GLboolean ARB_clear_texture;
GLboolean ARB_clip_control;
GLboolean ARB_color_buffer_float;
+   GLboolean ARB_compatibility;
GLboolean ARB_compute_shader;
GLboolean ARB_compute_variable_group_size;
GLboolean ARB_conditional_render_inverted;
GLboolean ARB_conservative_depth;
GLboolean ARB_copy_image;
GLboolean ARB_cull_distance;
GLboolean ARB_depth_buffer_float;
GLboolean ARB_depth_clamp;
GLboolean ARB_depth_texture;
GLboolean ARB_derivative_control;
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index 90c5c5f..06b8e4d 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -572,25 +572,25 @@ compute_version_es2(const struct gl_extensions 
*extensions,
   return 0;
}
 }
 
 GLuint
 _mesa_get_version(const struct gl_extensions *extensions,
   struct gl_constants *consts, gl_api api)
 {
switch (api) {
case API_OPENGL_COMPAT:
-  /* Disable GLSL 1.40 and later for legacy contexts.
-   * This disallows creation of the GL 3.1 compatibility context. */
+  /* Disable higher GLSL versions for legacy contexts.
+   * This disallows creation of higher compatibility contexts. */
   if (!consts->AllowHigherCompatVersion) {
- if (consts->GLSLVersion > 130) {
-consts->GLSLVersion = 130;
+ if (consts->GLSLVersion > 140) {
+consts->GLSLVersion = 140;
  }
   }
   /* fall through */
case API_OPENGL_CORE:
   return compute_version(extensions, consts, api);
case API_OPENGLES:
   return 

[Mesa-dev] [Bug 88536] AMD graphics hardware hangs with an homogeneous coloured screen or blank screen, and with chirp coming from the graphics card

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=88536

mirh  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #24 from mirh  ---
https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/881526/comments/56
User reported this to be an overheating issue

-- 
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


[Mesa-dev] [Bug 103388] Linking libcltgsi.la (llvm/codegen/libclllvm_la-common.lo) fails with "error: no match for 'operator-'" with GCC-7, Mesa from Git and current LLVM revisions

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103388

Kai  changed:

   What|Removed |Added

   Keywords||regression
Summary|Mesa git fails to build |Linking libcltgsi.la
   |with recent llvm trunk &|(llvm/codegen/libclllvm_la-
   |ggc-7   |common.lo) fails with
   ||"error: no match for
   ||'operator-'" with GCC-7,
   ||Mesa from Git and current
   ||LLVM revisions

-- 
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 103388] Mesa git fails to build with recent llvm trunk & ggc-7

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103388

Kai  changed:

   What|Removed |Added

 CC||k...@dev.carbon-project.org

--- Comment #2 from Kai  ---
Created attachment 134973
  --> https://bugs.freedesktop.org/attachment.cgi?id=134973=edit
Build log of failing build

I have the same issue in a clean pbuilder chroot of Debian Sid, exact versions
are:
- Mesa: Git:master/24fe4e6143
- libdrm: Git:master/e580be90e8 (tag: libdrm-2.4.85)
- LLVM: SVN:trunk/r316233 (6.0 devel)
- GCC: 7.2.0-11

The full build log, including configure line, is attached.

The error is:
> libtool: link: ar cru .libs/libcltgsi.a tgsi/.libs/libcltgsi_la-compiler.o 
> libtool: link: ranlib .libs/libcltgsi.a
> libtool: link: ( cd ".libs" && rm -f "libcltgsi.la" && ln -s 
> "../libcltgsi.la" "libcltgsi.la" )
> ../../../../../src/gallium/state_trackers/clover/llvm/codegen/common.cpp: In 
> function 'std::vector 
> {anonymous}::make_kernel_args(const llvm::Module&, const string&, const 
> clang::CompilerInstance&)':
> ../../../../../src/gallium/state_trackers/clover/llvm/codegen/common.cpp:132:52:
>  error: no match for 'operator-' (operand types are 'clang::LangAS' and 
> 'const int')
> if (address_space == 
> address_spaces[clang::LangAS::opencl_local
> 
> ~~~
> - 
> compat::lang_as_offset]) {
> ^~~~
> Makefile:924: recipe for target 'llvm/codegen/libclllvm_la-common.lo' failed
> make[5]: *** [llvm/codegen/libclllvm_la-common.lo] Error 1
> make[5]: *** Waiting for unfinished jobs

-- 
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 103388] Mesa git fails to build with recent llvm trunk & ggc-7

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103388

--- Comment #1 from network...@rkmail.ru ---
My build options: ./configure --host=x86_64-suse-linux-gnu
--build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking
--prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
--libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var
--sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info
--disable-dependency-tracking --enable-llvm --enable-llvm-shared-libs
--with-gallium-drivers=swrast,r600,r300,nouveau,radeonsi,svga,virgl
--with-dri-drivers=i965,i915,r200,radeon --enable-debug --enable-shared-glapi
--enable-glx-tls --enable-dri3 --enable-asm --enable-nine
--enable-texture-float --enable-gallium-extra-hud --enable-lmsensors
--with-platforms=x11,drm --enable-opencl --enable-opencl-icd
--with-clang-libdir=/usr/lib64/ --with-platforms=x11,wayland,drm
--with-vulkan-drivers=radeon,intel --enable-xa --enable-va --enable-vdpau
--enable-omx-bellagio --disable-xvmc --enable-gbm --enable-gles1 --enable-gles2
--with-dri-searchpath=/usr/lib64/dri

-- 
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 103388] Mesa git fails to build with recent llvm trunk & ggc-7

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103388

Bug ID: 103388
   Summary: Mesa git fails to build with recent llvm trunk & ggc-7
   Product: Mesa
   Version: git
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Other
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: network...@rkmail.ru
QA Contact: mesa-dev@lists.freedesktop.org

Trying to build Mesa master commit 0fdd531457ecaba263e6a27e030d451774f54b32
with llvm trunk revision 316259, but build fails with message:

[  305s] llvm/codegen/common.cpp:132:52: error: no match for 'operator-'
(operand types are 'clang::LangAS' and 'const int')

Build finished successfully with gcc 4.8, but fails with gcc 5.x, 6.x and 7.x

-- 
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] meson build for etnaviv and imx

2017-10-21 Thread Christian Gmeiner
2017-10-21 1:04 GMT+02:00 Dylan Baker :
> This is all pretty straight-forward, it builds on my system, but I don't have
> any actual hardware to test on.
>
> Christian and/or Wladimir, could one of you build this and do some kind of
> testing to ensure it works?
>

Thanks for adding etnaviv/imx support - had that on my TODO list for elce. I am
just updating the used rfs filesystem on my nfs share and will give it a try.


greets
--
Christian Gmeiner, MSc

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


Re: [Mesa-dev] [PATCH v3 05/43] nir: Populate conversion opcodes to/from 16-bit types

2017-10-21 Thread Pohjolainen, Topi
On Sat, Oct 21, 2017 at 11:22:45AM +0300, Pohjolainen, Topi wrote:
> On Thu, Oct 12, 2017 at 08:37:54PM +0200, Jose Maria Casanova Crespo wrote:
> > From: Eduardo Lima Mitev 
> > 
> > This will include the following NIR ALU opcodes:
> >  * nir_op_i2i16
> >  * nir_op_i2f16
> >  * nir_op_u2u16
> >  * nir_op_u2f16
> >  * nir_op_f2i16
> >  * nir_op_f2u16
> >  * nir_op_f2f16
> 
> Subject says "...to/from 16-bit types", it should only say "to", right?
> 
> I thought conversion from 16-bits to 32-bits was also needed but apparently
> not (all the promotions seem to happen case by case in the backend. For 
> example,
> the move from 16-bits to 32-bits when 16-bit RT isn't supported). A few
> words here in the commit would be nice explaining why only one direction is
> needed.

Right, I forgot, conversions in the other direction use simply f2* with source
bit-size set accordingly.

So, just drop "from" in the subject.

> 
> > 
> > Reviewed-by: Jason Ekstrand 
> > ---
> >  src/compiler/nir/nir_opcodes_c.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/compiler/nir/nir_opcodes_c.py 
> > b/src/compiler/nir/nir_opcodes_c.py
> > index a1db54f05a..02bb4738ed 100644
> > --- a/src/compiler/nir/nir_opcodes_c.py
> > +++ b/src/compiler/nir/nir_opcodes_c.py
> > @@ -62,7 +62,7 @@ nir_type_conversion_op(nir_alu_type src, nir_alu_type dst)
> >  % endif
> >  %  endif
> > switch (dst_bit_size) {
> > -% for dst_bits in [32, 64]:
> > +% for dst_bits in [16, 32, 64]:
> >case ${dst_bits}:
> >   return ${'nir_op_{0}2{1}{2}'.format(src_t[0], 
> > dst_t[0], dst_bits)};
> >  % endfor
> > -- 
> > 2.13.6
> > 
> > ___
> > 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 103386] Cross compilation fails with undefined reference

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103386

bkarthik...@gmail.com changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #1 from bkarthik...@gmail.com ---


*** This bug has been marked as a duplicate of bug 103385 ***

-- 
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 103385] Cross compilation fails with undefined reference

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103385

--- Comment #1 from bkarthik...@gmail.com ---
*** Bug 103386 has been marked as a duplicate of this bug. ***

-- 
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


[Mesa-dev] [Bug 103386] Cross compilation fails with undefined reference

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103386

bkarthik...@gmail.com changed:

   What|Removed |Added

 CC||bkarthik...@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 103386] Cross compilation fails with undefined reference

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103386

bkarthik...@gmail.com changed:

   What|Removed |Added

 Whiteboard||cross compilation

-- 
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


[Mesa-dev] [Bug 103386] Cross compilation fails with undefined reference

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103386

Bug ID: 103386
   Summary: Cross compilation fails with undefined reference
   Product: Mesa
   Version: 13.0
  Hardware: ARM
OS: Linux (All)
Status: NEW
  Severity: major
  Priority: medium
 Component: Other
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: bkarthik...@gmail.com
QA Contact: mesa-dev@lists.freedesktop.org

I have been trying to cross compile Mesa 13.0.6 and 12.0.6 for an arm platform.
Both compilation is failing with the following error 
=
  Making all in gbm
  make[3]: Entering directory
'/opt/qt/qt5.9.1arm_source/dependencies/mesa/mesa-13.0.6/src/gbm'
  CCLD libgbm.la
  ../../src/loader/.libs/libloader.a(libxmlconfig_la-xmlconfig.o): In function
`__getProgramName':
  xmlconfig.c:(.text+0x78): undefined reference to `__progname'
  collect2: error: ld returned 1 exit status
  Makefile:847: recipe for target 'libgbm.la' failed
  make[3]: *** [libgbm.la] Error 1
=

-- 
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 103385] Cross compilation fails with undefined reference

2017-10-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=103385

Bug ID: 103385
   Summary: Cross compilation fails with undefined reference
   Product: Mesa
   Version: 13.0
  Hardware: ARM
OS: Linux (All)
Status: NEW
  Severity: major
  Priority: medium
 Component: Other
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: bkarthik...@gmail.com
QA Contact: mesa-dev@lists.freedesktop.org

I have been trying to cross compile Mesa 13.0.6 and 12.0.6 for an arm platform.
Both compilation is failing with the following error 

 Making all in gbm
make[3]: Entering directory
'/opt/qt/qt5.9.1arm_source/dependencies/mesa/mesa-13.0.6/src/gbm'
  CCLD libgbm.la
../../src/loader/.libs/libloader.a(libxmlconfig_la-xmlconfig.o): In function
`__getProgramName':
xmlconfig.c:(.text+0x78): undefined reference to `__progname'
collect2: error: ld returned 1 exit status
Makefile:847: recipe for target 'libgbm.la' failed
make[3]: *** [libgbm.la] Error 1

-- 
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 8/8] etnaviv: fix rs blit for formats with blocksize of 8

2017-10-21 Thread Wladimir J. van der Laan
On Sat, Oct 21, 2017 at 10:22:09AM +0200, Christian Gmeiner wrote:
> Hi Wladimir
> 
> 2017-10-21 7:28 GMT+02:00 Wladimir J. van der Laan :
> > On Fri, Oct 20, 2017 at 10:21:28PM +0200, Christian Gmeiner wrote:
> >> Fixes piglit/bin/oes_texture_float half
> >>
> >> Signed-off-by: Christian Gmeiner 
> >> ---
> >>  src/gallium/drivers/etnaviv/etnaviv_translate.h | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/src/gallium/drivers/etnaviv/etnaviv_translate.h 
> >> b/src/gallium/drivers/etnaviv/etnaviv_translate.h
> >> index 0761251a36..c82a244e6d 100644
> >> --- a/src/gallium/drivers/etnaviv/etnaviv_translate.h
> >> +++ b/src/gallium/drivers/etnaviv/etnaviv_translate.h
> >> @@ -249,6 +249,8 @@ etna_compatible_rs_format(enum pipe_format fmt)
> >>return PIPE_FORMAT_B4G4R4A4_UNORM;
> >> case 4:
> >>return PIPE_FORMAT_B8G8R8A8_UNORM;
> >> +   case 8:
> >> +  return PIPE_FORMAT_B8G8R8A8_UNORM;
> >
> > That's the same as 4. How does the RS know it has to copy 8 bytes per pixel?
> >
> 
> I tried all possible values for case 8 and there are a handful of them
> which helped to pass
> oes_texture_float half piglit. I am not really sure if RS @gc2000 even
> supports 64bit clears/blits (as I never
> have seen them in any cmd stream dumps). Lets see if I can find the
> the format used by RS for 64bit clears/blits.
> In the worst case we need to fall back to a slower blit method. Will
> look into the this today.

OK thanks for the explanation. Unfortunately I'm not sure about that either. I
don't really understand why this makes it pass the test, but it's interesting.

Doesn't seem too easy to fall back on sw here, especially on gc2000 because of
the split-tiled and supertiled formats.

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


Re: [Mesa-dev] [PATCH v3 05/43] nir: Populate conversion opcodes to/from 16-bit types

2017-10-21 Thread Pohjolainen, Topi
On Thu, Oct 12, 2017 at 08:37:54PM +0200, Jose Maria Casanova Crespo wrote:
> From: Eduardo Lima Mitev 
> 
> This will include the following NIR ALU opcodes:
>  * nir_op_i2i16
>  * nir_op_i2f16
>  * nir_op_u2u16
>  * nir_op_u2f16
>  * nir_op_f2i16
>  * nir_op_f2u16
>  * nir_op_f2f16

Subject says "...to/from 16-bit types", it should only say "to", right?

I thought conversion from 16-bits to 32-bits was also needed but apparently
not (all the promotions seem to happen case by case in the backend. For example,
the move from 16-bits to 32-bits when 16-bit RT isn't supported). A few
words here in the commit would be nice explaining why only one direction is
needed.

> 
> Reviewed-by: Jason Ekstrand 
> ---
>  src/compiler/nir/nir_opcodes_c.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/compiler/nir/nir_opcodes_c.py 
> b/src/compiler/nir/nir_opcodes_c.py
> index a1db54f05a..02bb4738ed 100644
> --- a/src/compiler/nir/nir_opcodes_c.py
> +++ b/src/compiler/nir/nir_opcodes_c.py
> @@ -62,7 +62,7 @@ nir_type_conversion_op(nir_alu_type src, nir_alu_type dst)
>  % endif
>  %  endif
> switch (dst_bit_size) {
> -% for dst_bits in [32, 64]:
> +% for dst_bits in [16, 32, 64]:
>case ${dst_bits}:
>   return ${'nir_op_{0}2{1}{2}'.format(src_t[0], dst_t[0], 
> dst_bits)};
>  % endfor
> -- 
> 2.13.6
> 
> ___
> 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 8/8] etnaviv: fix rs blit for formats with blocksize of 8

2017-10-21 Thread Christian Gmeiner
Hi Wladimir

2017-10-21 7:28 GMT+02:00 Wladimir J. van der Laan :
> On Fri, Oct 20, 2017 at 10:21:28PM +0200, Christian Gmeiner wrote:
>> Fixes piglit/bin/oes_texture_float half
>>
>> Signed-off-by: Christian Gmeiner 
>> ---
>>  src/gallium/drivers/etnaviv/etnaviv_translate.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/src/gallium/drivers/etnaviv/etnaviv_translate.h 
>> b/src/gallium/drivers/etnaviv/etnaviv_translate.h
>> index 0761251a36..c82a244e6d 100644
>> --- a/src/gallium/drivers/etnaviv/etnaviv_translate.h
>> +++ b/src/gallium/drivers/etnaviv/etnaviv_translate.h
>> @@ -249,6 +249,8 @@ etna_compatible_rs_format(enum pipe_format fmt)
>>return PIPE_FORMAT_B4G4R4A4_UNORM;
>> case 4:
>>return PIPE_FORMAT_B8G8R8A8_UNORM;
>> +   case 8:
>> +  return PIPE_FORMAT_B8G8R8A8_UNORM;
>
> That's the same as 4. How does the RS know it has to copy 8 bytes per pixel?
>

I tried all possible values for case 8 and there are a handful of them
which helped to pass
oes_texture_float half piglit. I am not really sure if RS @gc2000 even
supports 64bit clears/blits (as I never
have seen them in any cmd stream dumps). Lets see if I can find the
the format used by RS for 64bit clears/blits.
In the worst case we need to fall back to a slower blit method. Will
look into the this today.

greets
--
Christian Gmeiner, MSc

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


Re: [Mesa-dev] [PATCH 7/8] etnaviv: add float formats

2017-10-21 Thread Christian Gmeiner
Hi Wladimir

2017-10-21 8:27 GMT+02:00 Wladimir J. van der Laan :
> On Fri, Oct 20, 2017 at 10:21:27PM +0200, Christian Gmeiner wrote:
>> Signed-off-by: Christian Gmeiner 
>
> Reviewed-by: Wladimir J. van der Laan 
>
> Optional suggestions inline.
>

Makes sense and will be fixed in v2.

>> ---
>>  src/gallium/drivers/etnaviv/etnaviv_format.c | 22 +-
>>  1 file changed, 17 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/gallium/drivers/etnaviv/etnaviv_format.c 
>> b/src/gallium/drivers/etnaviv/etnaviv_format.c
>> index 7297de3d85..a7085800aa 100644
>> --- a/src/gallium/drivers/etnaviv/etnaviv_format.c
>> +++ b/src/gallium/drivers/etnaviv/etnaviv_format.c
>> @@ -108,7 +108,10 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
>> V_(R16_SINT,SHORT,  NONE),
>> V_(R16_USCALED, UNSIGNED_SHORT, NONE),
>> V_(R16_SSCALED, SHORT,  NONE),
>> -   V_(R16_FLOAT,   HALF_FLOAT, NONE),
>> +   VT(R16_FLOAT,   HALF_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(X, Y, Z, W), 
>> R16F),
>> +
>> +   _T(A16_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(0, 0, 0, X), NONE),
>> +   _T(L16_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(X, X, X, 1), NONE),
>
> FWIW we can also do:
>
> _T(I16_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(X, X, X, X), NONE),
>
>> _T(B4G4R4A4_UNORM, A4R4G4B4, SWIZ(X, Y, Z, W), A4R4G4B4),
>> _T(B4G4R4X4_UNORM, X4R4G4B4, SWIZ(X, Y, Z, W), X4R4G4B4),
>> @@ -142,16 +145,22 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = 
>> {
>> V_(R32_UINT,UNSIGNED_INT, NONE),
>> V_(R32_USCALED, UNSIGNED_INT, NONE),
>> V_(R32_SSCALED, INT,  NONE),
>> -   V_(R32_FLOAT,   FLOAT,NONE),
>> +   VT(R32_FLOAT,   FLOAT,EXT_R32F | EXT_FORMAT, SWIZ(X, Y, Z, W), 
>> R32F),
>> V_(R32_FIXED,   FIXED,NONE),
>>
>> +   _T(A32_FLOAT, EXT_R32F | EXT_FORMAT, SWIZ(0, 0, 0, X), NONE),
>> +   _T(L32_FLOAT, EXT_R32F | EXT_FORMAT, SWIZ(X, X, X, 1), NONE),
>
> And:
>
> _T(I32_FLOAT, EXT_R32F | EXT_FORMAT, SWIZ(X, X, X, X), NONE),
>
>> +
>> V_(R16G16_UNORM,   UNSIGNED_SHORT, NONE),
>> V_(R16G16_SNORM,   SHORT,  NONE),
>> V_(R16G16_UINT,UNSIGNED_SHORT, NONE),
>> V_(R16G16_SINT,SHORT,  NONE),
>> V_(R16G16_USCALED, UNSIGNED_SHORT, NONE),
>> V_(R16G16_SSCALED, SHORT,  NONE),
>> -   V_(R16G16_FLOAT,   HALF_FLOAT, NONE),
>> +   VT(R16G16_FLOAT,   HALF_FLOAT, EXT_G16R16F | EXT_FORMAT, SWIZ(X, 0, 
>> 0, 1), G16R16F),
>> +
>> +   _T(R16A16_FLOAT, EXT_G16R16F | EXT_FORMAT, SWIZ(X, 0, 0, Y), NONE),
>> +   _T(L16A16_FLOAT, EXT_G16R16F | EXT_FORMAT, SWIZ(X, X, X, Y), NONE),
>>
>> V_(A8B8G8R8_UNORM,   UNSIGNED_BYTE, NONE),
>>
>> @@ -171,6 +180,8 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
>> V_(R10G10B10A2_USCALED, UNSIGNED_INT_10_10_10_2, NONE),
>> V_(R10G10B10A2_SSCALED, INT_10_10_10_2,  NONE),
>>
>> +   _T(R11G11B10_FLOAT, EXT_B10G11R11F | EXT_FORMAT, SWIZ(X, Y, Z, 1), 
>> B10G11R11F),
>> +
>> _T(X8Z24_UNORM,   D24S8, SWIZ(X, Y, Z, W), A8R8G8B8),
>> _T(S8_UINT_Z24_UNORM, D24S8, SWIZ(X, Y, Z, W), A8R8G8B8),
>>
>> @@ -190,7 +201,8 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
>> V_(R16G16B16A16_SINT,SHORT,  NONE),
>> V_(R16G16B16A16_USCALED, UNSIGNED_SHORT, NONE),
>> V_(R16G16B16A16_SSCALED, SHORT,  NONE),
>> -   V_(R16G16B16A16_FLOAT,   HALF_FLOAT, NONE),
>> +   VT(R16G16B16A16_FLOAT,   HALF_FLOAT, EXT_A16B16G16R16F | EXT_FORMAT, 
>> SWIZ(X, Y, Z, W), A16B16G16R16F),
>> +   VT(R16G16B16X16_FLOAT,   HALF_FLOAT, EXT_A16B16G16R16F | EXT_FORMAT, 
>> SWIZ(X, Y, Z, 1), A16B16G16R16F),
>>
>> V_(R32G32_UNORM,   UNSIGNED_INT, NONE),
>> V_(R32G32_SNORM,   INT,  NONE),
>> @@ -198,7 +210,7 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
>> V_(R32G32_SINT,INT,  NONE),
>> V_(R32G32_USCALED, UNSIGNED_INT, NONE),
>> V_(R32G32_SSCALED, INT,  NONE),
>> -   V_(R32G32_FLOAT,   FLOAT,NONE),
>> +   VT(R32G32_FLOAT,   FLOAT,EXT_G32R32F | EXT_FORMAT, SWIZ(X, Y, Z, 
>> W), G32R32F),
>> V_(R32G32_FIXED,   FIXED,NONE),
>>
>> /* 96-bit */
>> --
>> 2.11.0
>>
>> ___
>> etnaviv mailing list
>> etna...@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/etnaviv


greets
--
Christian Gmeiner, MSc

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


Re: [Mesa-dev] [PATCH 4/8] etnaviv: add support for extended PE formats

2017-10-21 Thread Christian Gmeiner
Hi Wladimir

2017-10-21 7:27 GMT+02:00 Wladimir J. van der Laan :
> On Fri, Oct 20, 2017 at 10:21:24PM +0200, Christian Gmeiner wrote:
>> Use the extended format if an such a format was passed.
>>
>> Signed-off-by: Christian Gmeiner 
>> ---
>>  src/gallium/drivers/etnaviv/etnaviv_state.c | 10 --
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c 
>> b/src/gallium/drivers/etnaviv/etnaviv_state.c
>> index 34bcb19069..727d726f76 100644
>> --- a/src/gallium/drivers/etnaviv/etnaviv_state.c
>> +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c
>> @@ -126,13 +126,19 @@ etna_set_framebuffer_state(struct pipe_context *pctx,
>>struct etna_surface *cbuf = etna_surface(sv->cbufs[0]);
>>struct etna_resource *res = etna_resource(cbuf->base.texture);
>>bool color_supertiled = (res->layout & ETNA_LAYOUT_BIT_SUPER) != 0;
>> +  uint32_t fmt = translate_rs_format(cbuf->base.format);
>>
>>assert(res->layout & ETNA_LAYOUT_BIT_TILE); /* Cannot render to 
>> linear surfaces */
>>etna_update_render_resource(pctx, cbuf->base.texture);
>>
>>pipe_surface_reference(>cbuf, >base);
>> -  cs->PE_COLOR_FORMAT =
>> - 
>> VIVS_PE_COLOR_FORMAT_FORMAT(translate_rs_format(cbuf->base.format)) |
>> +
>> +  if (fmt >= RS_FORMAT_R16F)
>> +  cs->PE_COLOR_FORMAT = VIVS_PE_COLOR_FORMAT_FORMAT_EXT(fmt);
>
> Please set the VIVS_PE_COLOR_FORMAT_FORMAT_FORMAT_MASK bit when using
> VIVS_PE_COLOR_FORMAT_FORMAT_EXT, some hw needs this to know it should
> use the extended format instead of the base format (and in any case the blob 
> does
> it).
>

Will be fixed in v2.

> 0x06112f10, /*   [0142C] PE.COLOR_FORMAT := 
> FORMAT=X4R4G4B4,FORMAT_MASK=1,COMPONENTS=R=1,G=1,B=1,A=1,SUPER_TILED_NEW=1,COMPONENTS_MASK=0,OVERWRITE=1,OVERWRITE_MASK=0,SUPER_TILED=1,SUPER_TILED_MASK=0,FORMAT_EXT=A8R8G8B8,FORMAT_EXT_MASK=0
>  */
>
> (the blob even uses the FORMAT_EXT and masks FORMAT for every format - on GPUs
> that support the EXT format bits, but there's some backwards compatbility
> handling, even GC7000 still understands the old way)
>

Good to know - thanks

greets
--
Christian Gmeiner, MSc

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


Re: [Mesa-dev] meson build for etnaviv and imx

2017-10-21 Thread Wladimir J. van der Laan
On Fri, Oct 20, 2017 at 04:04:09PM -0700, Dylan Baker wrote:
> This is all pretty straight-forward, it builds on my system, but I don't have
> any actual hardware to test on.
> 
> Christian and/or Wladimir, could one of you build this and do some kind of
> testing to ensure it works?

Sure, if you can give me exact steps to test it (I don't even know what meson 
is).

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


Re: [Mesa-dev] [PATCH 1/8] mesa: handle OES_texture_half_float formats in _mesa_base_tex_format()

2017-10-21 Thread Wladimir J. van der Laan
On Fri, Oct 20, 2017 at 10:21:21PM +0200, Christian Gmeiner wrote:
> Signed-off-by: Christian Gmeiner 
> ---
>  src/mesa/main/glformats.c | 19 +++
>  1 file changed, 19 insertions(+)

Reviewed-by: Wladimir J. van der Laan 

(as far as I'm qualified to review this code)

> 
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> index 1e797c24c2..78299aebae 100644
> --- a/src/mesa/main/glformats.c
> +++ b/src/mesa/main/glformats.c
> @@ -2424,6 +2424,25 @@ _mesa_base_tex_format(const struct gl_context *ctx, 
> GLint internalFormat)
>   return GL_YCBCR_MESA;
> }
>  
> +   if (ctx->Extensions.OES_texture_half_float) {
> +   switch (internalFormat) {
> +   case GL_ALPHA16F_ARB:
> +  return GL_ALPHA;
> +   case GL_RGBA16F_ARB:
> +  return GL_RGBA;
> +   case GL_RGB16F_ARB:
> +  return GL_RGB;
> +   case GL_INTENSITY16F_ARB:
> +  return GL_INTENSITY;
> +   case GL_LUMINANCE16F_ARB:
> +  return GL_LUMINANCE;
> +   case GL_LUMINANCE_ALPHA16F_ARB:
> +  return GL_LUMINANCE_ALPHA;
> +   default:
> +  ; /* fallthrough */

Looks good to me.

These tokens match the _EXT float formats defined in the OpenGL ES gl2ext.h
(except for GL_INTENSITY16F_ARB which has no ES equivalent), that's great, as
there's no _ARB formats there.

The R and RG textures are handled in ctx->Extensions.ARB_texture_rg so indeed
doesn't have to be done here.

> +   }
> +   }
> +
> if (ctx->Extensions.ARB_texture_float) {
>switch (internalFormat) {
>case GL_ALPHA16F_ARB:
> -- 
> 2.11.0
> 
> ___
> etnaviv mailing list
> etna...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 23/32] mesa/glsl: add api_enabled flag to gl_transform_feedback_info

2017-10-21 Thread Timothy Arceri



On 21/10/17 10:14, Jason Ekstrand wrote:
On Wed, Oct 18, 2017 at 10:32 PM, Jordan Justen 
> wrote:


From: Timothy Arceri >

This will be used to disable the shader cache when xfb is enabled
via the api as we don't currently allow for it when generating the
sha for the shader.
---
  src/compiler/glsl/link_varyings.cpp | 5 -
  src/mesa/main/mtypes.h              | 3 +++
  2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/link_varyings.cpp
b/src/compiler/glsl/link_varyings.cpp
index 29842ecacd..823d6899d7 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -1089,9 +1089,12 @@ store_tfeedback_info(struct gl_context *ctx,
struct gl_shader_program *prog,
      * however some drivers expect to receive the list of transform
feedback
      * declarations in order so sort it now for convenience.
      */
-   if (has_xfb_qualifiers)
+   if (has_xfb_qualifiers) {
        qsort(tfeedback_decls, num_tfeedback_decls,
sizeof(*tfeedback_decls),
              cmp_xfb_offset);
+   } else {
+      xfb_prog->sh.LinkedTransformFeedback->api_enabled = true;
+   }

     xfb_prog->sh.LinkedTransformFeedback->Varyings =
        rzalloc_array(xfb_prog, struct
gl_transform_feedback_varying_info,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a5a1398698..d94ed22b65 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1779,6 +1779,9 @@ struct gl_transform_feedback_buffer
  /** Post-link transform feedback info. */
  struct gl_transform_feedback_info
  {
+   /* Was xfb enabled via the api or in shader layout qualifiers */
+   bool api_enabled;


I have no idea what this patch is doing.  However, the comment above 
seems to directly contradict the code higher above.  In particular, we 
leave this false if there *are* XFB qualifiers.  Maybe this is an 
artifact of history and we just need a new name/comment?


XFB can be enable two different ways.

1. Via in shaders layout attributes in which case the xfb varyings are 
used in the computation of the shaders sha and everything is fine.


2. Via the API where we currently don't add the xfb varyings to the key 
so we use this patch to disable caching.


Now that we no longer have to worry about fallback paths (where the api 
might have been updated since linking was called) it's probably trivial 
to just add the varyings as part of the key. However this patch is the 
more tested path for now if we are aiming to get this into 17.3.






+
     unsigned NumOutputs;

     /* Bitmask of active buffer indices. */
--
2.15.0.rc0

___
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 7/8] etnaviv: add float formats

2017-10-21 Thread Wladimir J. van der Laan
On Fri, Oct 20, 2017 at 10:21:27PM +0200, Christian Gmeiner wrote:
> Signed-off-by: Christian Gmeiner 

Reviewed-by: Wladimir J. van der Laan 

Optional suggestions inline.

> ---
>  src/gallium/drivers/etnaviv/etnaviv_format.c | 22 +-
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_format.c 
> b/src/gallium/drivers/etnaviv/etnaviv_format.c
> index 7297de3d85..a7085800aa 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_format.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_format.c
> @@ -108,7 +108,10 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
> V_(R16_SINT,SHORT,  NONE),
> V_(R16_USCALED, UNSIGNED_SHORT, NONE),
> V_(R16_SSCALED, SHORT,  NONE),
> -   V_(R16_FLOAT,   HALF_FLOAT, NONE),
> +   VT(R16_FLOAT,   HALF_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(X, Y, Z, W), 
> R16F),
> +
> +   _T(A16_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(0, 0, 0, X), NONE),
> +   _T(L16_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(X, X, X, 1), NONE),

FWIW we can also do:

_T(I16_FLOAT, EXT_R16F | EXT_FORMAT, SWIZ(X, X, X, X), NONE),

> _T(B4G4R4A4_UNORM, A4R4G4B4, SWIZ(X, Y, Z, W), A4R4G4B4),
> _T(B4G4R4X4_UNORM, X4R4G4B4, SWIZ(X, Y, Z, W), X4R4G4B4),
> @@ -142,16 +145,22 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
> V_(R32_UINT,UNSIGNED_INT, NONE),
> V_(R32_USCALED, UNSIGNED_INT, NONE),
> V_(R32_SSCALED, INT,  NONE),
> -   V_(R32_FLOAT,   FLOAT,NONE),
> +   VT(R32_FLOAT,   FLOAT,EXT_R32F | EXT_FORMAT, SWIZ(X, Y, Z, W), 
> R32F),
> V_(R32_FIXED,   FIXED,NONE),
>  
> +   _T(A32_FLOAT, EXT_R32F | EXT_FORMAT, SWIZ(0, 0, 0, X), NONE),
> +   _T(L32_FLOAT, EXT_R32F | EXT_FORMAT, SWIZ(X, X, X, 1), NONE),

And:

_T(I32_FLOAT, EXT_R32F | EXT_FORMAT, SWIZ(X, X, X, X), NONE),

> +
> V_(R16G16_UNORM,   UNSIGNED_SHORT, NONE),
> V_(R16G16_SNORM,   SHORT,  NONE),
> V_(R16G16_UINT,UNSIGNED_SHORT, NONE),
> V_(R16G16_SINT,SHORT,  NONE),
> V_(R16G16_USCALED, UNSIGNED_SHORT, NONE),
> V_(R16G16_SSCALED, SHORT,  NONE),
> -   V_(R16G16_FLOAT,   HALF_FLOAT, NONE),
> +   VT(R16G16_FLOAT,   HALF_FLOAT, EXT_G16R16F | EXT_FORMAT, SWIZ(X, 0, 
> 0, 1), G16R16F),
> +
> +   _T(R16A16_FLOAT, EXT_G16R16F | EXT_FORMAT, SWIZ(X, 0, 0, Y), NONE),
> +   _T(L16A16_FLOAT, EXT_G16R16F | EXT_FORMAT, SWIZ(X, X, X, Y), NONE),
>  
> V_(A8B8G8R8_UNORM,   UNSIGNED_BYTE, NONE),
>  
> @@ -171,6 +180,8 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
> V_(R10G10B10A2_USCALED, UNSIGNED_INT_10_10_10_2, NONE),
> V_(R10G10B10A2_SSCALED, INT_10_10_10_2,  NONE),
>  
> +   _T(R11G11B10_FLOAT, EXT_B10G11R11F | EXT_FORMAT, SWIZ(X, Y, Z, 1), 
> B10G11R11F),
> +
> _T(X8Z24_UNORM,   D24S8, SWIZ(X, Y, Z, W), A8R8G8B8),
> _T(S8_UINT_Z24_UNORM, D24S8, SWIZ(X, Y, Z, W), A8R8G8B8),
>  
> @@ -190,7 +201,8 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
> V_(R16G16B16A16_SINT,SHORT,  NONE),
> V_(R16G16B16A16_USCALED, UNSIGNED_SHORT, NONE),
> V_(R16G16B16A16_SSCALED, SHORT,  NONE),
> -   V_(R16G16B16A16_FLOAT,   HALF_FLOAT, NONE),
> +   VT(R16G16B16A16_FLOAT,   HALF_FLOAT, EXT_A16B16G16R16F | EXT_FORMAT, 
> SWIZ(X, Y, Z, W), A16B16G16R16F),
> +   VT(R16G16B16X16_FLOAT,   HALF_FLOAT, EXT_A16B16G16R16F | EXT_FORMAT, 
> SWIZ(X, Y, Z, 1), A16B16G16R16F),
>  
> V_(R32G32_UNORM,   UNSIGNED_INT, NONE),
> V_(R32G32_SNORM,   INT,  NONE),
> @@ -198,7 +210,7 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
> V_(R32G32_SINT,INT,  NONE),
> V_(R32G32_USCALED, UNSIGNED_INT, NONE),
> V_(R32G32_SSCALED, INT,  NONE),
> -   V_(R32G32_FLOAT,   FLOAT,NONE),
> +   VT(R32G32_FLOAT,   FLOAT,EXT_G32R32F | EXT_FORMAT, SWIZ(X, Y, Z, 
> W), G32R32F),
> V_(R32G32_FIXED,   FIXED,NONE),
>  
> /* 96-bit */
> -- 
> 2.11.0
> 
> ___
> etnaviv mailing list
> etna...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 6/8] etnaviv: expose float formats only if GPU supports it

2017-10-21 Thread Wladimir J. van der Laan
On Fri, Oct 20, 2017 at 10:21:26PM +0200, Christian Gmeiner wrote:
> Signed-off-by: Christian Gmeiner 

Reviewed-by: Wladimir J. van der Laan 

> ---
>  src/gallium/drivers/etnaviv/etnaviv_screen.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c 
> b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> index 0fba192284..ff52054990 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> @@ -493,6 +493,10 @@ gpu_supports_texure_format(struct etna_screen *screen, 
> uint32_t fmt,
> */
>if (util_format_is_etc(format))
>   supported = VIV_FEATURE(screen, chipMinorFeatures2, HALTI1);
> +
> +  /* At the moment we do not differ between half-float and float. */
> +  if (util_format_is_float(format))
> +  supported = VIV_FEATURE(screen, chipMinorFeatures1, HALF_FLOAT);
> }
>  
> if (!supported)
> -- 
> 2.11.0
> 
> ___
> etnaviv mailing list
> etna...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 5/8] etnaviv: handle 8 byte block in tiling

2017-10-21 Thread Wladimir J. van der Laan
On Fri, Oct 20, 2017 at 10:21:25PM +0200, Christian Gmeiner wrote:
> Signed-off-by: Christian Gmeiner 

Reviewed-by: Wladimir J. van der Laan 

> ---
>  src/gallium/drivers/etnaviv/etnaviv_tiling.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_tiling.c 
> b/src/gallium/drivers/etnaviv/etnaviv_tiling.c
> index f4f85c1d6e..113b39cc98 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_tiling.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_tiling.c
> @@ -68,7 +68,9 @@ etna_texture_tile(void *dest, void *src, unsigned basex, 
> unsigned basey,
>unsigned dst_stride, unsigned width, unsigned height,
>unsigned src_stride, unsigned elmtsize)
>  {
> -   if (elmtsize == 4) {
> +   if (elmtsize == 8) {
> +  DO_TILE(uint64_t)
> +   } else if (elmtsize == 4) {
>DO_TILE(uint32_t)
> } else if (elmtsize == 2) {
>DO_TILE(uint16_t)
> @@ -84,7 +86,9 @@ etna_texture_untile(void *dest, void *src, unsigned basex, 
> unsigned basey,
>  unsigned src_stride, unsigned width, unsigned height,
>  unsigned dst_stride, unsigned elmtsize)
>  {
> -   if (elmtsize == 4) {
> +   if (elmtsize == 8) {
> +  DO_UNTILE(uint64_t)
> +   } else if (elmtsize == 4) {
>DO_UNTILE(uint32_t);
> } else if (elmtsize == 2) {
>DO_UNTILE(uint16_t);
> -- 
> 2.11.0
> 
> ___
> etnaviv mailing list
> etna...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/8] etnaviv: update RS_FORMAT_MASK to include extended formats

2017-10-21 Thread Wladimir J. van der Laan
On Fri, Oct 20, 2017 at 10:21:23PM +0200, Christian Gmeiner wrote:
> Also update RS_FORMAT_RB_SWAP.
> 
> Signed-off-by: Christian Gmeiner 

Reviewed-by: Wladimir J. van der Laan 

> ---
>  src/gallium/drivers/etnaviv/etnaviv_format.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_format.c 
> b/src/gallium/drivers/etnaviv/etnaviv_format.c
> index a2e215b439..7297de3d85 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_format.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_format.c
> @@ -45,9 +45,9 @@ struct etna_format {
>  
>  #define RS_FORMAT_NONE ~0
>  
> -#define RS_FORMAT_MASK0xf
> +#define RS_FORMAT_MASK0x1f
>  #define RS_FORMAT(x)  ((x) & RS_FORMAT_MASK)
> -#define RS_FORMAT_RB_SWAP 0x10
> +#define RS_FORMAT_RB_SWAP 0x20
>  
>  #define RS_FORMAT_X8B8G8R8(RS_FORMAT_X8R8G8B8 | RS_FORMAT_RB_SWAP)
>  #define RS_FORMAT_A8B8G8R8(RS_FORMAT_A8R8G8B8 | RS_FORMAT_RB_SWAP)
> -- 
> 2.11.0
> 
> ___
> etnaviv mailing list
> etna...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/8] etnaviv: HALTI0 indicates extended PE formats

2017-10-21 Thread Wladimir J. van der Laan
On Fri, Oct 20, 2017 at 10:21:22PM +0200, Christian Gmeiner wrote:
> Signed-off-by: Christian Gmeiner 

Reviewed-by: Wladimir J. van der Laan

Verified that HALTI0 has PE TEXTURE_FORMAT_EXT by looking at GC2000 blob 
replays.

> ---
>  src/gallium/drivers/etnaviv/etnaviv_screen.c | 18 +-
>  1 file changed, 17 insertions(+), 1 deletion(-)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev