Mesa (master): vulkan/wsi: fix possible random stalls in wsi_display_wait_for_event

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 440813114281bfd05c2b0d26c6488d1410790be4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=440813114281bfd05c2b0d26c6488d1410790be4

Author: Marcin Ślusarz 
Date:   Fri Oct 16 20:07:28 2020 +0200

vulkan/wsi: fix possible random stalls in wsi_display_wait_for_event

pthread_cond_broadcast man page says this:
"The pthread_cond_broadcast() or pthread_cond_signal() functions may
 be called by a thread whether or not it currently owns the mutex that
 threads calling pthread_cond_wait() or pthread_cond_timedwait() have
 associated with the condition variable during their waits; however,
 if predictable scheduling behavior is required, then that mutex shall
 be locked by the thread calling pthread_cond_broadcast() or
 pthread_cond_signal()."

Found by reading the code.
Compile tested only.

Fixes: da997ebec92 ("vulkan: Add KHR_display extension using DRM [v10]")

Signed-off-by: Marcin Ślusarz 
Reviewed-by: Lionel Landwerlin 
Part-of: 

---

 src/vulkan/wsi/wsi_common_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vulkan/wsi/wsi_common_display.c 
b/src/vulkan/wsi/wsi_common_display.c
index 3a304e36537..f6eea5906f8 100644
--- a/src/vulkan/wsi/wsi_common_display.c
+++ b/src/vulkan/wsi/wsi_common_display.c
@@ -1210,8 +1210,8 @@ wsi_display_wait_thread(void *data)
   if (ret > 0) {
  pthread_mutex_lock(>wait_mutex);
  (void) drmHandleEvent(wsi->fd, _context);
- pthread_mutex_unlock(>wait_mutex);
  pthread_cond_broadcast(>wait_cond);
+ pthread_mutex_unlock(>wait_mutex);
   }
}
return NULL;

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


Mesa (master): panfrost: Fix stride for AFBC_FORMAT_MOD_BLOCK_SIZE_32x8.

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 85053c016c898455434f6264981a2ddd4b60f04e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=85053c016c898455434f6264981a2ddd4b60f04e

Author: Vinson Lee 
Date:   Thu Oct 15 16:14:16 2020 -0700

panfrost: Fix stride for AFBC_FORMAT_MOD_BLOCK_SIZE_32x8.

Fix defect reported by Coverity Scan.

Identical code for different branches (IDENTICAL_BRANCHES)
identical_branches: Ternary expression on condition width has
identical then and else expressions: 32. Should one of the
expressions be modified, or the entire ternary expression
replaced?

Fixes: 8bb1d61f276c ("panfrost: Add panfrost_block_dim helper")
Signed-off-by: Vinson Lee 
Reviewed-by: Alyssa Rosenzweig 
Reviewed-by: Daniel Stone 
Part-of: 

---

 src/panfrost/lib/pan_texture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c
index 6de8223c7f0..c3802930f6c 100644
--- a/src/panfrost/lib/pan_texture.c
+++ b/src/panfrost/lib/pan_texture.c
@@ -219,7 +219,7 @@ panfrost_block_dim(uint64_t modifier, bool width, unsigned 
plane)
 case AFBC_FORMAT_MOD_BLOCK_SIZE_16x16:
 return 16;
 case AFBC_FORMAT_MOD_BLOCK_SIZE_32x8:
-return width ? 32 : 32;
+return width ? 32 : 8;
 case AFBC_FORMAT_MOD_BLOCK_SIZE_64x4:
 return width ? 64 : 4;
 case AFBC_FORMAT_MOD_BLOCK_SIZE_32x8_64x4:

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


Mesa (master): anv: Advertise VK_KHR_shader_terminate_invocation

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 8dd03a7c125f8e7f3d29d0fd131f7129cddb5244
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8dd03a7c125f8e7f3d29d0fd131f7129cddb5244

Author: Caio Marcelo de Oliveira Filho 
Date:   Wed May  6 21:56:29 2020 -0700

anv: Advertise VK_KHR_shader_terminate_invocation

Reviewed-by: Jason Ekstrand 
Part-of: 

---

 docs/relnotes/new_features.txt | 1 +
 src/intel/vulkan/anv_device.c  | 7 +++
 src/intel/vulkan/anv_extensions.py | 1 +
 3 files changed, 9 insertions(+)

diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt
index c8459535187..c9b86f13a79 100644
--- a/docs/relnotes/new_features.txt
+++ b/docs/relnotes/new_features.txt
@@ -9,3 +9,4 @@ GLX_EXT_swap_control for DRI2 and DRI3
 GLX_EXT_swap_control_tear for DRI3
 VK_KHR_copy_commands2 on RADV
 NGG GS support in ACO
+VK_KHR_shader_terminate_invocation on ANV
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 95cfb586387..c4e932cc4f4 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1379,6 +1379,13 @@ void anv_GetPhysicalDeviceFeatures2(
  break;
   }
 
+  case 
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR: {
+ VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR *features =
+(VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR *)ext;
+ features->shaderTerminateInvocation = true;
+ break;
+  }
+
   case 
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT: {
  VkPhysicalDeviceSubgroupSizeControlFeaturesEXT *features =
 (VkPhysicalDeviceSubgroupSizeControlFeaturesEXT *)ext;
diff --git a/src/intel/vulkan/anv_extensions.py 
b/src/intel/vulkan/anv_extensions.py
index 1617e2e3665..d3f64c790d4 100644
--- a/src/intel/vulkan/anv_extensions.py
+++ b/src/intel/vulkan/anv_extensions.py
@@ -106,6 +106,7 @@ EXTENSIONS = [
 Extension('VK_KHR_shader_float_controls', 1, 'device->info.gen 
>= 8'),
 Extension('VK_KHR_shader_non_semantic_info',  1, True),
 Extension('VK_KHR_shader_subgroup_extended_types',1, 'device->info.gen 
>= 8'),
+Extension('VK_KHR_shader_terminate_invocation',   1, True),
 Extension('VK_KHR_spirv_1_4', 1, True),
 Extension('VK_KHR_storage_buffer_storage_class',  1, True),
 Extension('VK_KHR_surface',  25, 
'ANV_HAS_SURFACE'),

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


Mesa (master): vulkan: Update XML and headers to 1.2.158

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 8251eed83e72317db3f0fc2d5edad4e42b136561
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8251eed83e72317db3f0fc2d5edad4e42b136561

Author: Caio Marcelo de Oliveira Filho 
Date:   Mon Oct 19 10:04:32 2020 -0700

vulkan: Update XML and headers to 1.2.158

Acked-by: Jason Ekstrand 
Part-of: 

---

 include/vulkan/vulkan_core.h | 166 +++-
 src/vulkan/registry/vk.xml   | 222 ++-
 2 files changed, 362 insertions(+), 26 deletions(-)

diff --git a/include/vulkan/vulkan_core.h b/include/vulkan/vulkan_core.h
index ac904bca213..6f77387a07f 100644
--- a/include/vulkan/vulkan_core.h
+++ b/include/vulkan/vulkan_core.h
@@ -43,7 +43,7 @@ extern "C" {
 #define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)// Patch version should 
always be set to 0
 
 // Version of this file
-#define VK_HEADER_VERSION 154
+#define VK_HEADER_VERSION 158
 
 // Complete version of this file
 #define VK_HEADER_VERSION_COMPLETE VK_MAKE_VERSION(1, 2, VK_HEADER_VERSION)
@@ -462,7 +462,6 @@ typedef enum VkStructureType {
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV = 
1000154000,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV = 
1000154001,
 VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT = 1000158000,
-VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158001,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT = 
1000158002,
 VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT = 
1000158003,
 VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT = 
1000158004,
@@ -522,6 +521,7 @@ typedef enum VkStructureType {
 VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD = 1000213000,
 VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD = 
1000213001,
 VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA = 1000214000,
+VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR 
= 1000215000,
 VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000217000,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT = 
1000218000,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT = 
1000218001,
@@ -529,8 +529,14 @@ typedef enum VkStructureType {
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT = 
1000225000,
 
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT 
= 1000225001,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT = 
1000225002,
+VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000226000,
+VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR = 
1000226001,
+VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR = 
1000226002,
+VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR = 
1000226003,
+VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR = 1000226004,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD = 
1000227000,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD = 
1000229000,
+VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT = 
1000234000,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT = 
1000237000,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT = 
1000238000,
 VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT = 1000238001,
@@ -578,6 +584,9 @@ typedef enum VkStructureType {
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT = 
1000281001,
 
VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM = 
1000282000,
 VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM = 1000282001,
+VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT = 
1000284000,
+VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT = 1000284001,
+VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT = 1000284002,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT = 1000286000,
 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT = 1000286001,
 VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT = 1000287000,
@@ -747,6 +756,7 @@ typedef enum VkImageLayout {
 VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT = 1000218000,
 VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = 
VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL,
 VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = 
VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL,
+VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR = 
VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV,
 VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL_KHR = 

Mesa (master): clover/nir: add a constant folding pass before lowering mem const

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 7e55f0e17dfc11717513fee1f62772de49eddb66
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e55f0e17dfc11717513fee1f62772de49eddb66

Author: Dave Airlie 
Date:   Mon Oct 19 10:38:16 2020 +1000

clover/nir: add a constant folding pass before lowering mem const

If we lower mem constants first, then direct array accesses to
constants never get lowered, so do a constant fold pass first to
remove direct const array accesses.

Reviewed-by: Karol Herbst 
Part-of: 

---

 src/gallium/frontends/clover/nir/invocation.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/frontends/clover/nir/invocation.cpp 
b/src/gallium/frontends/clover/nir/invocation.cpp
index 9eb353dab9f..8528057b593 100644
--- a/src/gallium/frontends/clover/nir/invocation.cpp
+++ b/src/gallium/frontends/clover/nir/invocation.cpp
@@ -284,6 +284,9 @@ module clover::nir::spirv_to_nir(const module , const 
device ,
   sysval_options.has_base_global_invocation_id = true;
   NIR_PASS_V(nir, nir_lower_compute_system_values, _options);
 
+  // constant fold before lowering mem constants
+  NIR_PASS_V(nir, nir_opt_constant_folding);
+
   NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_mem_constant, NULL);
   NIR_PASS_V(nir, nir_lower_mem_constant_vars,
  glsl_get_cl_type_size_align);

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


Mesa (master): anv: Set only one ISL usage bit (RT/texture) for CopyBuffer sources

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 103ad427bc7f61015cea65f71486355644c276b3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=103ad427bc7f61015cea65f71486355644c276b3

Author: Kenneth Graunke 
Date:   Wed Sep 30 15:05:54 2020 -0700

anv: Set only one ISL usage bit (RT/texture) for CopyBuffer sources

Most uses of this function deal with destination buffers, but for
copy_buffer_to_image, the buffer is the source, and isn't rendered
to.  We should avoid setting ISL_SURF_USAGE_RENDER_TARGET_BIT.
Also, we should avoid setting ISL_SURF_USAGE_TEXTURE_BIT for the
destination, which isn't sampled from.

Reviewed-by: Jason Ekstrand 
Part-of: 

---

 src/intel/vulkan/anv_blorp.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
index 953596cb015..0025e36ad3c 100644
--- a/src/intel/vulkan/anv_blorp.c
+++ b/src/intel/vulkan/anv_blorp.c
@@ -132,6 +132,7 @@ get_blorp_surf_for_anv_buffer(struct anv_device *device,
   struct anv_buffer *buffer, uint64_t offset,
   uint32_t width, uint32_t height,
   uint32_t row_pitch, enum isl_format format,
+  bool is_dest,
   struct blorp_surf *blorp_surf,
   struct isl_surf *isl_surf)
 {
@@ -171,8 +172,8 @@ get_blorp_surf_for_anv_buffer(struct anv_device *device,
  .array_len = 1,
  .samples = 1,
  .row_pitch_B = row_pitch,
- .usage = ISL_SURF_USAGE_TEXTURE_BIT |
-  ISL_SURF_USAGE_RENDER_TARGET_BIT,
+ .usage = is_dest ? ISL_SURF_USAGE_RENDER_TARGET_BIT
+  : ISL_SURF_USAGE_TEXTURE_BIT,
  .tiling_flags = ISL_TILING_LINEAR_BIT);
assert(ok);
 }
@@ -567,7 +568,7 @@ copy_buffer_to_image(struct anv_cmd_buffer *cmd_buffer,
get_blorp_surf_for_anv_buffer(cmd_buffer->device,
  anv_buffer, region->bufferOffset,
  buffer_extent.width, buffer_extent.height,
- buffer_row_pitch, buffer_format,
+ buffer_row_pitch, buffer_format, false,
  , _isl_surf);
 
bool dst_has_shadow = false;
@@ -,7 +1112,7 @@ void anv_CmdFillBuffer(
   get_blorp_surf_for_anv_buffer(cmd_buffer->device,
 dst_buffer, dstOffset,
 MAX_SURFACE_DIM, MAX_SURFACE_DIM,
-MAX_SURFACE_DIM * bs, isl_format,
+MAX_SURFACE_DIM * bs, isl_format, true,
 , _surf);
 
   blorp_clear(, , isl_format, ISL_SWIZZLE_IDENTITY,
@@ -1128,7 +1129,7 @@ void anv_CmdFillBuffer(
   get_blorp_surf_for_anv_buffer(cmd_buffer->device,
 dst_buffer, dstOffset,
 MAX_SURFACE_DIM, height,
-MAX_SURFACE_DIM * bs, isl_format,
+MAX_SURFACE_DIM * bs, isl_format, true,
 , _surf);
 
   blorp_clear(, , isl_format, ISL_SWIZZLE_IDENTITY,
@@ -1143,7 +1144,7 @@ void anv_CmdFillBuffer(
   get_blorp_surf_for_anv_buffer(cmd_buffer->device,
 dst_buffer, dstOffset,
 width, 1,
-width * bs, isl_format,
+width * bs, isl_format, true,
 , _surf);
 
   blorp_clear(, , isl_format, ISL_SWIZZLE_IDENTITY,

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


Mesa (master): isl, anv, iris: Add a centralized helper to select MOCS based on usage

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 02fe825a61344a065260da40b72852cce800ac01
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=02fe825a61344a065260da40b72852cce800ac01

Author: Kenneth Graunke 
Date:   Wed Oct  7 07:44:56 2020 -0700

isl, anv, iris: Add a centralized helper to select MOCS based on usage

On Gen12+, we can enable additional caches in certain usage situations.
This routes that decision making to a central place in ISL, based on
surface usage flags, and updates both drivers to use it.  (i965 doesn't
need to change because it doesn't support Gen12.)

We continue handling the "external" decision via an anv_mocs() wrapper
for now, since we store that flag in anv_bo, which isl doesn't know
about.  (We could introduce an ISL_SURF_USAGE_EXTERNAL, but I'm not
actually sure that would be cleaner.)

This patch should not have any functional nor performance effects, as
we continue selecting the exact same MOCS values for now.

Reviewed-by: Jason Ekstrand 
Part-of: 

---

 src/gallium/drivers/iris/iris_blit.c |  8 +++--
 src/gallium/drivers/iris/iris_blorp.c|  3 +-
 src/gallium/drivers/iris/iris_context.h  |  2 +-
 src/gallium/drivers/iris/iris_draw.c |  3 +-
 src/gallium/drivers/iris/iris_program.c  |  8 +++--
 src/gallium/drivers/iris/iris_resource.c |  3 ++
 src/gallium/drivers/iris/iris_resource.h |  6 ++--
 src/gallium/drivers/iris/iris_state.c| 54 
 src/intel/isl/isl.c  |  9 ++
 src/intel/isl/isl.h  |  6 
 src/intel/vulkan/anv_blorp.c | 36 ++---
 src/intel/vulkan/anv_cmd_buffer.c|  1 +
 src/intel/vulkan/anv_descriptor_set.c| 10 +-
 src/intel/vulkan/anv_device.c|  3 +-
 src/intel/vulkan/anv_image.c | 12 +++
 src/intel/vulkan/anv_private.h   |  9 --
 src/intel/vulkan/gen7_cmd_buffer.c   | 18 +--
 src/intel/vulkan/gen8_cmd_buffer.c   | 11 ---
 src/intel/vulkan/genX_blorp_exec.c   |  3 +-
 src/intel/vulkan/genX_cmd_buffer.c   | 31 --
 src/intel/vulkan/genX_gpu_memcpy.c   |  4 +--
 21 files changed, 160 insertions(+), 80 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_blit.c 
b/src/gallium/drivers/iris/iris_blit.c
index 283d30bcfe2..b0da817a071 100644
--- a/src/gallium/drivers/iris/iris_blit.c
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -250,7 +250,9 @@ iris_blorp_surf_for_resource(struct isl_device *isl_dev,
  .buffer = res->bo,
  .offset = res->offset,
  .reloc_flags = is_render_target ? EXEC_OBJECT_WRITE : 0,
- .mocs = iris_mocs(res->bo, isl_dev),
+ .mocs = iris_mocs(res->bo, isl_dev,
+   is_render_target ? ISL_SURF_USAGE_RENDER_TARGET_BIT
+: ISL_SURF_USAGE_TEXTURE_BIT),
   },
   .aux_usage = aux_usage,
};
@@ -261,7 +263,7 @@ iris_blorp_surf_for_resource(struct isl_device *isl_dev,
  .buffer = res->aux.bo,
  .offset = res->aux.offset,
  .reloc_flags = is_render_target ? EXEC_OBJECT_WRITE : 0,
- .mocs = iris_mocs(res->bo, isl_dev),
+ .mocs = iris_mocs(res->bo, isl_dev, 0),
   };
   surf->clear_color =
  iris_resource_get_clear_color(res, NULL, NULL);
@@ -269,7 +271,7 @@ iris_blorp_surf_for_resource(struct isl_device *isl_dev,
  .buffer = res->aux.clear_color_bo,
  .offset = res->aux.clear_color_offset,
  .reloc_flags = 0,
- .mocs = iris_mocs(res->aux.clear_color_bo, isl_dev),
+ .mocs = iris_mocs(res->aux.clear_color_bo, isl_dev, 0),
   };
}
 }
diff --git a/src/gallium/drivers/iris/iris_blorp.c 
b/src/gallium/drivers/iris/iris_blorp.c
index 8c55621ad0e..a36dfdd6c6f 100644
--- a/src/gallium/drivers/iris/iris_blorp.c
+++ b/src/gallium/drivers/iris/iris_blorp.c
@@ -183,7 +183,8 @@ blorp_alloc_vertex_buffer(struct blorp_batch *blorp_batch,
*addr = (struct blorp_address) {
   .buffer = bo,
   .offset = offset,
-  .mocs = iris_mocs(bo, >screen->isl_dev),
+  .mocs = iris_mocs(bo, >screen->isl_dev,
+ISL_SURF_USAGE_VERTEX_BUFFER_BIT),
};
 
return map;
diff --git a/src/gallium/drivers/iris/iris_context.h 
b/src/gallium/drivers/iris/iris_context.h
index b83241dd90a..d2a38acba1e 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -850,7 +850,7 @@ uint32_t iris_upload_border_color(struct iris_context *ice,
 void iris_upload_ubo_ssbo_surf_state(struct iris_context *ice,
  struct pipe_shader_buffer *buf,
  struct iris_state_ref *surf_state,
- bool ssbo);
+ isl_surf_usage_flags_t usage);
 const struct shader_info *iris_get_shader_info(const struct 

Mesa (master): isl: Enable Tigerlake HDC:L1 caches via MOCS in various cases.

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: aca31baafc09634d69134d7ccbdfe6d426cbbbff
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aca31baafc09634d69134d7ccbdfe6d426cbbbff

Author: Kenneth Graunke 
Date:   Wed Oct  7 09:45:35 2020 -0700

isl: Enable Tigerlake HDC:L1 caches via MOCS in various cases.

Thanks to Felix Degrood for discovering that we missed enabling this
additional caching on Tigerlake!  Felix also benchmarked the changes.

We now use MOCS 48 (HDC:L1 + L3 + LLC) for render targets, textures,
and pull constant buffers.  We leave storage buffers & images, as well
as stateless messages, using the previous MOCS 2 value.  We can't use
HDC:L1 with atomics, and we don't know a priori whether storage buffers
will be used with atomics or not.  Similarly, the Vulkan buffer device
address feature allows atomics to be performed on buffers via stateless
messages, and we only can control MOCS at the base address level, so
we can't do much there.

This is closer to what the Windows Vulkan and OpenGL drivers do,
though it isn't quite the same - they also disable LLC in some cases,
but we observed this to have noticable performance regressions when
we tried (though a couple titles benefited).  We may try experiment
with that in the future.

Improves performance in a number of titles:

- Unreal Engine 4 Shooter Demo   [VK]: 11.8%
- Witcher 3[DXVK]:  3.9%
- Rise of the Tomb Raider[VK]:  1.5%
- Shadow of the Tomb Raider  [VK]:  1.0%
- Grand Theft Auto V   [DXVK]:  0.8%

We did not observe any performance regressions.

Reviewed-by: Jason Ekstrand 
Part-of: 

---

 src/intel/isl/isl.c | 21 +
 src/intel/isl/isl.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 8101225fb9f..f1849c0515a 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -112,6 +112,9 @@ isl_device_setup_mocs(struct isl_device *dev)
  dev->mocs.external = 3 << 1;
  /* TC=LLC/eLLC, LeCC=WB, LRUM=3, L3CC=WB */
  dev->mocs.internal = 2 << 1;
+
+ /* L1 - HDC:L1 + L3 + LLC */
+ dev->mocs.l1_hdc_l3_llc = 48 << 1;
   }
} else if (dev->info->gen >= 9) {
   /* TC=LLC/eLLC, LeCC=PTE, LRUM=3, L3CC=WB */
@@ -160,6 +163,24 @@ isl_device_setup_mocs(struct isl_device *dev)
 uint32_t
 isl_mocs(const struct isl_device *dev, isl_surf_usage_flags_t usage)
 {
+   if (dev->info->gen >= 12 && !dev->info->is_dg1) {
+  if (usage & ISL_SURF_USAGE_STAGING_BIT)
+ return dev->mocs.internal;
+
+  /* Using L1:HDC for storage buffers breaks Vulkan memory model
+   * tests that use shader atomics.  This isn't likely to work out,
+   * and we can't know a priori whether they'll be used.  So just
+   * continue with ordinary internal MOCS for now.
+   */
+  if (usage & ISL_SURF_USAGE_STORAGE_BIT)
+ return dev->mocs.internal;
+
+  if (usage & (ISL_SURF_USAGE_CONSTANT_BUFFER_BIT |
+   ISL_SURF_USAGE_RENDER_TARGET_BIT |
+   ISL_SURF_USAGE_TEXTURE_BIT))
+ return dev->mocs.l1_hdc_l3_llc;
+   }
+
return dev->mocs.internal;
 }
 
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index abb63395d71..4e805867d6a 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -1076,6 +1076,7 @@ struct isl_device {
struct {
   uint32_t internal;
   uint32_t external;
+  uint32_t l1_hdc_l3_llc;
} mocs;
 };
 

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


Mesa (master): ci/android: Switch build to using platform SDK version 26.

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: ab57df26225ef99f91e179dc53ebeabfaaaf92fa
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab57df26225ef99f91e179dc53ebeabfaaaf92fa

Author: Eric Anholt 
Date:   Thu Sep 24 16:44:50 2020 -0700

ci/android: Switch build to using platform SDK version 26.

In SDK 25 (Android 7, 2016), the kernel only went up to around 4.4, so
the upstreamed sync API didn't exist, and libsync didn't expose
sync_merge().

In SDK 26 (Android 8, 2017), the kernel is sometimes bumped to 4.9 or
4.14, but libsync has a sync_merge() that operates on either the
downstream or the upstream API.

Since our android-targeting drivers in general use sync objects (requiring
a kernel newer than 7 got) and sync_merge() (suggesting interaction with
external fencing that started in Android 8), make CI build against an SDK
version with the sync API.  I think really doing SDK 25 right at this
point would involve backporting mesa with some #ifdefs to not expose sync
APIs that wouldn't work.

Reviewed-by: Kristian H. Kristensen 
Acked-by: Tapani Pälli 
Part-of: 

---

 .gitlab-ci.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d123d0e6a8b..378c3a2bace 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -689,6 +689,7 @@ meson-android:
 EXTRA_OPTION: >
   -D android-stub=true
   -D llvm=disabled
+  -D platform-sdk-version=26
 GALLIUM_ST: >
   -D dri3=disabled
   -D gallium-vdpau=disabled

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


Mesa (master): turnip: Only link libdrm in the DRM case, not KGSL.

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 4df98c3c0ca14b3fc6468ef792bbb7484d1e8c47
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4df98c3c0ca14b3fc6468ef792bbb7484d1e8c47

Author: Eric Anholt 
Date:   Fri Sep 18 12:43:18 2020 -0700

turnip: Only link libdrm in the DRM case, not KGSL.

libvulkan's not a fan of opening my libdrm.so.2 from /vendor/lib64 or
/vendor/lib64/hw, but then we shouldn't need it, anyway.

Part-of: 

---

 src/freedreno/vulkan/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/freedreno/vulkan/meson.build b/src/freedreno/vulkan/meson.build
index 6d97698f41a..3e22ab4d7b9 100644
--- a/src/freedreno/vulkan/meson.build
+++ b/src/freedreno/vulkan/meson.build
@@ -111,6 +111,7 @@ if with_freedreno_kgsl
   libtu_files += files('tu_kgsl.c')
 else
   libtu_files += files('tu_drm.c')
+  tu_deps += dep_libdrm
 endif
 
 libvulkan_freedreno = shared_library(
@@ -136,7 +137,6 @@ libvulkan_freedreno = shared_library(
 idep_libfreedreno_common,
 dep_dl,
 dep_elf,
-dep_libdrm,
 dep_m,
 dep_thread,
 dep_valgrind,

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


Mesa (master): android: Add pre-4.7 Android kernel compatibility to our libsync header.

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 27b888794624225343287e57f5fcea63f94850b3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=27b888794624225343287e57f5fcea63f94850b3

Author: Eric Anholt 
Date:   Tue Sep 22 13:02:37 2020 -0700

android: Add pre-4.7 Android kernel compatibility to our libsync header.

The downstream Android kernels had a different API than was merged
upstream, and libsync on Android abstracts over that for us.  Use their
sync_merge() and sync_wait(), at the cost of linking against libsync
(which Android.mk and meson both do).

Reviewed-by: Kristian H. Kristensen 
Part-of: 

---

 src/util/libsync.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/util/libsync.h b/src/util/libsync.h
index f1a2f96d36b..2e9f499200b 100644
--- a/src/util/libsync.h
+++ b/src/util/libsync.h
@@ -40,6 +40,14 @@
 extern "C" {
 #endif
 
+#ifdef ANDROID
+/* On Android, rely on the system's libsync instead of rolling our own
+ * sync_wait() and sync_merge().  This gives us compatibility with pre-4.7
+ * Android kernels.
+ */
+#include 
+#else
+
 #ifndef SYNC_IOC_MERGE
 /* duplicated from linux/sync_file.h to avoid build-time dependency
  * on new (v4.7) kernel headers.  Once distro's are mostly using
@@ -101,6 +109,8 @@ static inline int sync_merge(const char *name, int fd1, int 
fd2)
return data.fence;
 }
 
+#endif /* !ANDROID */
+
 /* accumulate fd2 into fd1.  If *fd1 is not a valid fd then dup fd2,
  * otherwise sync_merge() and close the old *fd1.  This can be used
  * to implement the pattern:

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


Mesa (master): turnip: Don't link the WSI code if we don't have a WSI extension.

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: f63ce9bbe0c7c0157dd4ef22acfe9f412a8ec0b2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f63ce9bbe0c7c0157dd4ef22acfe9f412a8ec0b2

Author: Eric Anholt 
Date:   Fri Sep 18 14:36:36 2020 -0700

turnip: Don't link the WSI code if we don't have a WSI extension.

I don't like the TU_HAS_SURFACE duplication, but this is a step to having
a non-libdrm-dependent turnip on Android with KGSL (which doesn't have
drm for rendering).

Part-of: 

---

 src/freedreno/vulkan/meson.build | 14 --
 src/freedreno/vulkan/tu_device.c | 10 ++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/freedreno/vulkan/meson.build b/src/freedreno/vulkan/meson.build
index 2dbcfd85c06..6d97698f41a 100644
--- a/src/freedreno/vulkan/meson.build
+++ b/src/freedreno/vulkan/meson.build
@@ -59,12 +59,14 @@ libtu_files = files(
   'tu_shader.c',
   'tu_util.c',
   'tu_util.h',
-  'tu_wsi.c',
   'vk_format.h',
 )
 
 tu_deps = []
 tu_flags = []
+tu_link_with = []
+
+tu_wsi = false
 
 if with_platform_x11
   tu_deps += dep_xcb_dri3
@@ -73,17 +75,25 @@ if with_platform_x11
 '-DVK_USE_PLATFORM_XLIB_KHR',
   ]
   libtu_files += files('tu_wsi_x11.c')
+  tu_wsi = true
 endif
 
 if with_platform_wayland
   tu_deps += dep_wayland_client
   tu_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
   libtu_files += files('tu_wsi_wayland.c')
+  tu_wsi = true
 endif
 
 if system_has_kms_drm and not with_platform_android
   tu_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
   libtu_files += files('tu_wsi_display.c')
+  tu_wsi = true
+endif
+
+if tu_wsi
+  libtu_files += 'tu_wsi.c'
+  tu_link_with += libvulkan_wsi
 endif
 
 if with_platform_android
@@ -118,7 +128,7 @@ libvulkan_freedreno = shared_library(
 inc_freedreno,
   ],
   link_with : [
-libvulkan_wsi,
+tu_link_with,
 libfreedreno_ir3,
 libfreedreno_layout,
   ],
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index 4bb4d52e702..a94e3910d55 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -44,6 +44,12 @@
 /* for fd_get_driver/device_uuid() */
 #include "freedreno/common/freedreno_uuid.h"
 
+#define TU_HAS_SURFACE \
+   (VK_USE_PLATFORM_WAYLAND_KHR || \
+VK_USE_PLATFORM_XCB_KHR || \
+VK_USE_PLATFORM_XLIB_KHR || \
+VK_USE_PLATFORM_DISPLAY_KHR)
+
 static int
 tu_device_get_cache_uuid(uint16_t family, void *uuid)
 {
@@ -124,11 +130,13 @@ tu_physical_device_init(struct tu_physical_device *device,
 
tu_physical_device_get_supported_extensions(device, 
>supported_extensions);
 
+#if TU_HAS_SURFACE
result = tu_wsi_init(device);
if (result != VK_SUCCESS) {
   vk_startup_errorf(instance, result, "WSI init failure");
   goto fail;
}
+#endif
 
return VK_SUCCESS;
 
@@ -142,7 +150,9 @@ fail:
 static void
 tu_physical_device_finish(struct tu_physical_device *device)
 {
+#if TU_HAS_SURFACE
tu_wsi_finish(device);
+#endif
 
disk_cache_destroy(device->disk_cache);
close(device->local_fd);

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


Mesa (master): android_stub: Update platform headers to include gralloc1.h.

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: e92f4ac9f46848a5d0eab482b867c1f3f1c15b68
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e92f4ac9f46848a5d0eab482b867c1f3f1c15b68

Author: Eric Anholt 
Date:   Tue Sep 22 10:55:53 2020 -0700

android_stub: Update platform headers to include gralloc1.h.

This header is used in anv and radv, and soon turnip.  Since the script
just checks out master, this also bumps the headers to upstream
02dfcc7c1562 ("Merge "Merge Android R"")

Reviewed-by: Kristian H. Kristensen 
Part-of: 

---

 bin/update-android-headers.sh|3 +-
 include/android_stub/android/data_space.h|   50 ++
 include/android_stub/android/native_window.h |   73 ++
 include/android_stub/apex/window.h   |  210 ++
 include/android_stub/hardware/gralloc1.h | 1044 ++
 include/android_stub/log/event_tag_map.h |   14 -
 include/android_stub/log/log_properties.h|1 +
 include/android_stub/log/log_read.h  |7 +
 include/android_stub/system/window.h |  192 -
 include/android_stub/vndk/window.h   |9 +
 10 files changed, 1548 insertions(+), 55 deletions(-)

Diff:   
http://cgit.freedesktop.org/mesa/mesa/diff/?id=e92f4ac9f46848a5d0eab482b867c1f3f1c15b68
___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Import a copy of drm's libsync.h

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: e8c89a9bcbaf85bd8772991151cbef7c0a2ddd76
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e8c89a9bcbaf85bd8772991151cbef7c0a2ddd76

Author: Eric Anholt 
Date:   Tue Sep 22 12:59:24 2020 -0700

util: Import a copy of drm's libsync.h

libsync.h is one of the common dependencies on libdrm from drivers that
otherwise don't want libdrm.  Given that it's header-only code, just
import it to Mesa instead of forcing library dependencies on our users.

Copied from libdrm commit a84caff71be9 (" intel: Add PCI ID support to RKL
platform")

Reviewed-by: Kristian H. Kristensen 
Part-of: 

---

 src/util/libsync.h | 148 +
 1 file changed, 148 insertions(+)

diff --git a/src/util/libsync.h b/src/util/libsync.h
new file mode 100644
index 000..f1a2f96d36b
--- /dev/null
+++ b/src/util/libsync.h
@@ -0,0 +1,148 @@
+/*
+ *  sync abstraction
+ *  Copyright 2015-2016 Collabora Ltd.
+ *
+ *  Based on the implementation from the Android Open Source Project,
+ *
+ *  Copyright 2012 Google, Inc
+ *
+ *  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.
+ */
+
+#ifndef _LIBSYNC_H
+#define _LIBSYNC_H
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#ifndef SYNC_IOC_MERGE
+/* duplicated from linux/sync_file.h to avoid build-time dependency
+ * on new (v4.7) kernel headers.  Once distro's are mostly using
+ * something newer than v4.7 drop this and #include 
+ * instead.
+ */
+struct sync_merge_data {
+   charname[32];
+   int32_t fd2;
+   int32_t fence;
+   uint32_tflags;
+   uint32_tpad;
+};
+#define SYNC_IOC_MAGIC '>'
+#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
+#endif
+
+
+static inline int sync_wait(int fd, int timeout)
+{
+   struct pollfd fds = {0};
+   int ret;
+
+   fds.fd = fd;
+   fds.events = POLLIN;
+
+   do {
+   ret = poll(, 1, timeout);
+   if (ret > 0) {
+   if (fds.revents & (POLLERR | POLLNVAL)) {
+   errno = EINVAL;
+   return -1;
+   }
+   return 0;
+   } else if (ret == 0) {
+   errno = ETIME;
+   return -1;
+   }
+   } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
+
+   return ret;
+}
+
+static inline int sync_merge(const char *name, int fd1, int fd2)
+{
+   struct sync_merge_data data = {0};
+   int ret;
+
+   data.fd2 = fd2;
+   strncpy(data.name, name, sizeof(data.name));
+
+   do {
+   ret = ioctl(fd1, SYNC_IOC_MERGE, );
+   } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
+
+   if (ret < 0)
+   return ret;
+
+   return data.fence;
+}
+
+/* accumulate fd2 into fd1.  If *fd1 is not a valid fd then dup fd2,
+ * otherwise sync_merge() and close the old *fd1.  This can be used
+ * to implement the pattern:
+ *
+ *init()
+ *{
+ *   batch.fence_fd = -1;
+ *}
+ *
+ *// does *NOT* take ownership of fd
+ *server_sync(int fd)
+ *{
+ *   if (sync_accumulate("foo", _fd, fd)) {
+ *  ... error ...
+ *   }
+ *}
+ */
+static inline int sync_accumulate(const char *name, int *fd1, int fd2)
+{
+   int ret;
+
+   assert(fd2 >= 0);
+
+   if (*fd1 < 0) {
+   *fd1 = dup(fd2);
+   return 0;
+   }
+
+   ret = sync_merge(name, *fd1, fd2);
+   if (ret < 0) {
+   /* leave *fd1 as it is */
+   return ret;
+   }
+
+   close(*fd1);
+   *fd1 = ret;
+
+   return 0;
+}
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif


Mesa (master): turnip: Drop a dead error checking path in device init.

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 8a72666e91bd14e8ff1b8246ba636189abe8ddf3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8a72666e91bd14e8ff1b8246ba636189abe8ddf3

Author: Eric Anholt 
Date:   Tue Sep 15 19:18:12 2020 -0700

turnip: Drop a dead error checking path in device init.

The only result != SUCCESS setters above all jump across to the fail
label.

Part-of: 

---

 src/freedreno/vulkan/tu_device.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index c98ca46a670..b59da961a11 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -124,11 +124,6 @@ tu_physical_device_init(struct tu_physical_device *device,
 
tu_physical_device_get_supported_extensions(device, 
>supported_extensions);
 
-   if (result != VK_SUCCESS) {
-  vk_error(instance, result);
-  goto fail;
-   }
-
result = tu_wsi_init(device);
if (result != VK_SUCCESS) {
   vk_startup_errorf(instance, result, "WSI init failure");

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


Mesa (master): turnip: Use Mesa's libsync.h instead of libdrm's libsync.h.

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 8f3313fb4797bfbc597654d045fff54948749dd1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f3313fb4797bfbc597654d045fff54948749dd1

Author: Eric Anholt 
Date:   Fri Sep 18 13:16:23 2020 -0700

turnip: Use Mesa's libsync.h instead of libdrm's libsync.h.

Given that we already link to Android's libsync, use it instead of using a
build-time dependency on libdrm for the KGSL path.  This also would help
for older kernel compat with KGSL.

Part-of: 

---

 src/freedreno/vulkan/tu_android.c | 1 +
 src/freedreno/vulkan/tu_device.c  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/freedreno/vulkan/tu_android.c 
b/src/freedreno/vulkan/tu_android.c
index ce3a9ce8809..1a0557458c0 100644
--- a/src/freedreno/vulkan/tu_android.c
+++ b/src/freedreno/vulkan/tu_android.c
@@ -37,6 +37,7 @@
 
 #include "drm-uapi/drm_fourcc.h"
 
+#include "util/libsync.h"
 #include "util/os_file.h"
 
 static int
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index b59da961a11..4bb4d52e702 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -28,7 +28,7 @@
 #include "tu_private.h"
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 

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


Mesa (master): radv: report latest extension spec versions

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 72799886e7e10202e2756ad93fd93d59b11f900b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=72799886e7e10202e2756ad93fd93d59b11f900b

Author: Samuel Pitoiset 
Date:   Thu Oct 15 11:08:26 2020 +0200

radv: report latest extension spec versions

Found with the vulkan extension checker tool.

Signed-off-by: Samuel Pitoiset 
Reviewed-by: Bas Nieuwenhuizen 
Part-of: 

---

 src/amd/vulkan/radv_extensions.py | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/amd/vulkan/radv_extensions.py 
b/src/amd/vulkan/radv_extensions.py
index 5d6f550637a..5084b523b21 100644
--- a/src/amd/vulkan/radv_extensions.py
+++ b/src/amd/vulkan/radv_extensions.py
@@ -62,10 +62,10 @@ EXTENSIONS = [
 Extension('VK_KHR_buffer_device_address', 1, True),
 Extension('VK_KHR_copy_commands2',1, True),
 Extension('VK_KHR_create_renderpass2',1, True),
-Extension('VK_KHR_dedicated_allocation',  1, True),
+Extension('VK_KHR_dedicated_allocation',  3, True),
 Extension('VK_KHR_depth_stencil_resolve', 1, True),
 Extension('VK_KHR_descriptor_update_template',1, True),
-Extension('VK_KHR_device_group',  1, True),
+Extension('VK_KHR_device_group',  4, True),
 Extension('VK_KHR_device_group_creation', 1, True),
 Extension('VK_KHR_draw_indirect_count',   1, True),
 Extension('VK_KHR_driver_properties', 1, True),
@@ -85,19 +85,19 @@ EXTENSIONS = [
 Extension('VK_KHR_image_format_list', 1, True),
 Extension('VK_KHR_imageless_framebuffer', 1, True),
 Extension('VK_KHR_incremental_present',   1, 
'RADV_HAS_SURFACE'),
-Extension('VK_KHR_maintenance1',  1, True),
+Extension('VK_KHR_maintenance1',  2, True),
 Extension('VK_KHR_maintenance2',  1, True),
 Extension('VK_KHR_maintenance3',  1, True),
 Extension('VK_KHR_pipeline_executable_properties',1, True),
-Extension('VK_KHR_push_descriptor',   1, True),
+Extension('VK_KHR_push_descriptor',   2, True),
 Extension('VK_KHR_relaxed_block_layout',  1, True),
-Extension('VK_KHR_sampler_mirror_clamp_to_edge',  1, True),
-Extension('VK_KHR_sampler_ycbcr_conversion',  1, True),
+Extension('VK_KHR_sampler_mirror_clamp_to_edge',  3, True),
+Extension('VK_KHR_sampler_ycbcr_conversion', 14, True),
 Extension('VK_KHR_separate_depth_stencil_layouts',1, True),
 Extension('VK_KHR_shader_atomic_int64',   1, 
'LLVM_VERSION_MAJOR >= 9 || !device->use_llvm'),
 Extension('VK_KHR_shader_clock',  1, True),
 Extension('VK_KHR_shader_draw_parameters',1, True),
-Extension('VK_KHR_shader_float_controls', 1, True),
+Extension('VK_KHR_shader_float_controls', 4, True),
 Extension('VK_KHR_shader_float16_int8',   1, True),
 Extension('VK_KHR_shader_non_semantic_info',  1, True),
 Extension('VK_KHR_shader_subgroup_extended_types',1, True),
@@ -105,7 +105,7 @@ EXTENSIONS = [
 Extension('VK_KHR_storage_buffer_storage_class',  1, True),
 Extension('VK_KHR_surface',  25, 
'RADV_HAS_SURFACE'),
 Extension('VK_KHR_surface_protected_capabilities',1, 
'RADV_HAS_SURFACE'),
-Extension('VK_KHR_swapchain',68, 
'RADV_HAS_SURFACE'),
+Extension('VK_KHR_swapchain',70, 
'RADV_HAS_SURFACE'),
 Extension('VK_KHR_swapchain_mutable_format',  1, 
'RADV_HAS_SURFACE'),
 Extension('VK_KHR_timeline_semaphore',2, 
'device->rad_info.has_syncobj_wait_for_submit'),
 Extension('VK_KHR_uniform_buffer_standard_layout',1, True),
@@ -119,9 +119,9 @@ EXTENSIONS = [
 Extension('VK_KHR_8bit_storage',  1, True),
 Extension('VK_EXT_direct_mode_display',   1, 
'VK_USE_PLATFORM_DISPLAY_KHR'),
 Extension('VK_EXT_acquire_xlib_display',  1, 
'VK_USE_PLATFORM_XLIB_XRANDR_EXT'),
-Extension('VK_EXT_buffer_device_address', 1, True),
+Extension('VK_EXT_buffer_device_address', 2, True),
 Extension('VK_EXT_calibrated_timestamps', 1, True),
-Extension('VK_EXT_conditional_rendering', 1, True),
+Extension('VK_EXT_conditional_rendering', 2, True),
 Extension('VK_EXT_conservative_rasterization',1, 
'device->rad_info.chip_class >= GFX9'),
 Extension('VK_EXT_custom_border_color',   12, True),
 Extension('VK_EXT_display_surface_counter',   

Mesa (master): meson: Add xcb-fixes to loader when using x11 and dri3. Fixes undefined symbol for xcb_xfixes_create_region in loader_dri3_helper.c

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: cf17d6251653f4a98e7c4f904ea2f0bc0ecedd5c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf17d6251653f4a98e7c4f904ea2f0bc0ecedd5c

Author: Duncan Hopkins 
Date:   Thu Oct 15 12:14:57 2020 +0100

meson: Add xcb-fixes to loader when using x11 and dri3. Fixes undefined symbol 
for xcb_xfixes_create_region in loader_dri3_helper.c

loader_dr3_helper.c uses xcb_xfixes_create_region() that requires 
dep_xcb_xfixes to link. This is dependent on with_platform_x11 and with_dri3.
But the source meson file does not set this up dependent on with_dri3.
The build was initialsed using platforms=x11 and gallium-drivers=zink,swrast.

Reviewed-by: Eric Anholt 
Part-of: 

---

 meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index cfe02fa6373..3cb3c904927 100644
--- a/meson.build
+++ b/meson.build
@@ -1782,7 +1782,8 @@ if with_platform_x11
   dep_xxf86vm = dependency('xxf86vm')
 endif
   endif
-  if (with_egl or (
+  if (with_egl or 
+  with_dri3 or (
   with_gallium_vdpau or with_gallium_xvmc or with_gallium_xa or
   with_gallium_omx != 'disabled'))
 dep_xcb_xfixes = dependency('xcb-xfixes')

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


Mesa (master): mesa: Pass the correct caller string to _mesa_lookup_or_create_texture

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 25627ffe656339da9477d47039d3ad561dd70fd3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=25627ffe656339da9477d47039d3ad561dd70fd3

Author: Ian Romanick 
Date:   Mon Oct 12 16:53:37 2020 -0700

mesa: Pass the correct caller string to _mesa_lookup_or_create_texture

An actual bug found by the 'unused parameter' warning. :D

Reviewed-by: Matt Turner 
Reviewed-by: Kristian H. Kristensen 
Part-of: 

---

 src/mesa/main/texobj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 1d057b88cea..8a2d2fe8659 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1822,7 +1822,7 @@ bind_texture(struct gl_context *ctx, GLenum target, 
GLuint texName,
 {
struct gl_texture_object *newTexObj =
   _mesa_lookup_or_create_texture(ctx, target, texName, no_error, false,
- "glBindTexture");
+ caller);
if (!newTexObj)
   return;
 

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


Mesa (master): i965: Silence unused parameter warnings

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 4cd930565e3887f52e2bedc3040daa14df0ff8d3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4cd930565e3887f52e2bedc3040daa14df0ff8d3

Author: Ian Romanick 
Date:   Mon Oct 12 16:16:34 2020 -0700

i965: Silence unused parameter warnings

src/mesa/drivers/dri/i965/intel_screen.c: In function ‘brw_driconf_get_xml’:
src/mesa/drivers/dri/i965/intel_screen.c:103:33: warning: unused parameter 
‘driver_name’ [-Wunused-parameter]
  103 | brw_driconf_get_xml(const char *driver_name)
  | ^~~
src/mesa/drivers/dri/i965/intel_screen.c: In function ‘intel_unmap_image’:
src/mesa/drivers/dri/i965/intel_screen.c:882:33: warning: unused parameter 
‘context’ [-Wunused-parameter]
  882 | intel_unmap_image(__DRIcontext *context, __DRIimage *image, void 
*map_info)
  |   ~~^~~
src/mesa/drivers/dri/i965/intel_screen.c:882:54: warning: unused parameter 
‘image’ [-Wunused-parameter]
  882 | intel_unmap_image(__DRIcontext *context, __DRIimage *image, void 
*map_info)
  |  ^
src/mesa/drivers/dri/i965/intel_screen.c: In function ‘intelReleaseBuffer’:
src/mesa/drivers/dri/i965/intel_screen.c:2904:33: warning: unused parameter 
‘dri_screen’ [-Wunused-parameter]
 2904 | intelReleaseBuffer(__DRIscreen *dri_screen, __DRIbuffer *buffer)
  |~^~

src/mesa/drivers/dri/i965/brw_context.c: In function 
‘brw_set_background_context’:
src/mesa/drivers/dri/i965/brw_context.c:144:58: warning: unused parameter 
‘queue_info’ [-Wunused-parameter]
  144 |struct util_queue_monitoring *queue_info)
  |~~^~

Reviewed-by: Matt Turner 
Reviewed-by: Kristian H. Kristensen 
Part-of: 

---

 src/mesa/drivers/dri/i965/brw_context.c  | 2 +-
 src/mesa/drivers/dri/i965/intel_screen.c | 7 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c
index 149a5e38561..bdb754d41eb 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -141,7 +141,7 @@ intel_get_string(struct gl_context * ctx, GLenum name)
 
 static void
 brw_set_background_context(struct gl_context *ctx,
-   struct util_queue_monitoring *queue_info)
+   UNUSED struct util_queue_monitoring *queue_info)
 {
struct brw_context *brw = brw_context(ctx);
__DRIcontext *driContext = brw->driContext;
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
b/src/mesa/drivers/dri/i965/intel_screen.c
index 03d035e9abf..97efe2d37f6 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -100,7 +100,7 @@ static const driOptionDescription brw_driconf[] = {
 };
 
 static char *
-brw_driconf_get_xml(const char *driver_name)
+brw_driconf_get_xml(UNUSED const char *driver_name)
 {
return driGetOptionsXml(brw_driconf, ARRAY_SIZE(brw_driconf));
 }
@@ -879,7 +879,8 @@ intel_map_image(__DRIcontext *context, __DRIimage *image,
 }
 
 static void
-intel_unmap_image(__DRIcontext *context, __DRIimage *image, void *map_info)
+intel_unmap_image(UNUSED __DRIcontext *context, UNUSED __DRIimage *image,
+  void *map_info)
 {
struct brw_bo *bo = map_info;
 
@@ -2896,7 +2897,7 @@ intelAllocateBuffer(__DRIscreen *dri_screen,
 }
 
 static void
-intelReleaseBuffer(__DRIscreen *dri_screen, __DRIbuffer *buffer)
+intelReleaseBuffer(UNUSED __DRIscreen *dri_screen, __DRIbuffer *buffer)
 {
struct intel_buffer *intelBuffer = (struct intel_buffer *) buffer;
 

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


Mesa (master): mesa/st: Silence unused parameter warnings in st_context.c

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 9b847d4150fff3e8871617b2c0f971127bf71280
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9b847d4150fff3e8871617b2c0f971127bf71280

Author: Ian Romanick 
Date:   Mon Oct 12 16:18:13 2020 -0700

mesa/st: Silence unused parameter warnings in st_context.c

src/mesa/state_tracker/st_context.c: In function ‘st_Enable’:
src/mesa/state_tracker/st_context.c:101:57: warning: unused parameter ‘state’ 
[-Wunused-parameter]
  101 | st_Enable(struct gl_context *ctx, GLenum cap, GLboolean state)
  |   ~~^

Reviewed-by: Matt Turner 
Reviewed-by: Kristian H. Kristensen 
Part-of: 

---

 src/mesa/state_tracker/st_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_context.c 
b/src/mesa/state_tracker/st_context.c
index 2f45b659b9a..68f52891c4a 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -98,7 +98,7 @@ DEBUG_GET_ONCE_BOOL_OPTION(mesa_mvp_dp4, "MESA_MVP_DP4", 
FALSE)
  * Called via ctx->Driver.Enable()
  */
 static void
-st_Enable(struct gl_context *ctx, GLenum cap, GLboolean state)
+st_Enable(struct gl_context *ctx, GLenum cap, UNUSED GLboolean state)
 {
struct st_context *st = st_context(ctx);
 

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


Mesa (staging/20.2): st/mesa: Add missing sentinels in format_map[]

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: staging/20.2
Commit: c6396afbacd3783b7976fb7261c05ba5095bb143
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6396afbacd3783b7976fb7261c05ba5095bb143

Author: Nanley Chery 
Date:   Thu Oct 15 09:25:23 2020 -0700

st/mesa: Add missing sentinels in format_map[]

Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz 
Part-of: 
(cherry picked from commit cf11ebfbc22b5ebabdcedac0e045deb0f63ecff7)

---

 .pick_status.json  | 2 +-
 src/mesa/state_tracker/st_format.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 1a86878baed..c7c2f2175fa 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -211,7 +211,7 @@
 "description": "st/mesa: Add missing sentinels in format_map[]",
 "nominated": true,
 "nomination_type": 0,
-"resolution": 0,
+"resolution": 1,
 "master_sha": null,
 "because_sha": null
 },
diff --git a/src/mesa/state_tracker/st_format.c 
b/src/mesa/state_tracker/st_format.c
index c84dd7b324d..e2053362197 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -234,19 +234,19 @@ static const struct format_mapping format_map[] = {
 DEFAULT_RGB_FORMATS }
},
{
-  { GL_RGB4 },
+  { GL_RGB4, 0 },
   { PIPE_FORMAT_B4G4R4X4_UNORM, PIPE_FORMAT_B4G4R4A4_UNORM,
 PIPE_FORMAT_A4B4G4R4_UNORM,
 DEFAULT_RGB_FORMATS }
},
{
-  { GL_RGB5 },
+  { GL_RGB5, 0 },
   { PIPE_FORMAT_B5G5R5X1_UNORM, PIPE_FORMAT_X1B5G5R5_UNORM,
 PIPE_FORMAT_B5G5R5A1_UNORM, PIPE_FORMAT_A1B5G5R5_UNORM,
 DEFAULT_RGB_FORMATS }
},
{
-  { GL_RGB565 },
+  { GL_RGB565, 0 },
   { PIPE_FORMAT_B5G6R5_UNORM, DEFAULT_RGB_FORMATS }
},
 

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


Mesa (staging/20.2): .pick_status.json: Update to 7c5129985bcac75053823a31674e8a1e2629230c

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: staging/20.2
Commit: 00cde89303086814d765cd02244f677b47764f5d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=00cde89303086814d765cd02244f677b47764f5d

Author: Dylan Baker 
Date:   Fri Oct 16 09:40:02 2020 -0700

.pick_status.json: Update to 7c5129985bcac75053823a31674e8a1e2629230c

---

 .pick_status.json | 270 ++
 1 file changed, 270 insertions(+)

diff --git a/.pick_status.json b/.pick_status.json
index 0d54b98fed7..0312b391362 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1,4 +1,274 @@
 [
+{
+"sha": "7c5129985bcac75053823a31674e8a1e2629230c",
+"description": "zink: implement ARB_draw_indirect",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "3e3b6e995fa44ab778451c1fc24c2caabca4299f",
+"description": "zink: set 3.3 complete in features.txt",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "80c66642cc88dcd06432ea5d49bb768c3cd9f06d",
+"description": "zink: bump GLSL to 3.30",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "44baddf1fe995d25762e048ddf5cf10acdcd718a",
+"description": "zink: set 3.2 complete in features.txt",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "26b076ff66f0c95a63a7afb048d4adbe39e76c50",
+"description": "zink: GLSL 1.50",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "b27ec49e0220b1a71f24fd0e451dbee305ab0877",
+"description": "zink: mark off GL 3.1 as done in features.txt",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "815f0c01b0f373848784a8f4c7ef5a9026050413",
+"description": "zink: bump to glsl 1.40",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "8028991f361f22f20abdbed0c2f61f7c5c23c052",
+"description": "zink: enable gs pipe caps",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "4c734da7defb6869af4f2f509782b95eb0180024",
+"description": "zink: add gallium handling for geometry shaders",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "d59e4b8ce6497097954028df2469fc7b404a106b",
+"description": "zink: round out handling for streamout buffer stride 
setting during draw",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "9915c540b269943907874a666911a9efb2ea4303",
+"description": "zink: remove ADJACENCY prim types from primconvert 
path",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "d656c600a399e09a80dbec4c03e5d8e122904521",
+"description": "zink: add handling for gs in ntv",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "9671cd9215150d8eeecfe0868dbedba3493f8b5a",
+"description": "zink: re-transform gl_Position for gs input",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "ea2279daf1f561acedaae90959d23888cf754d5d",
+"description": "zink: add ntv handling for geometry shader variables",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "423a342ae7486173fc7ef26a3776de1aafcf91bd",
+"description": "zink: handle shader io vars more generically for use 
with gs",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": 

Mesa (staging/20.2): intel/isl: Drop redundant unpack of unorm channels

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: staging/20.2
Commit: ae6b7d1e3ecc15000da8403c43d89f448c19b294
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae6b7d1e3ecc15000da8403c43d89f448c19b294

Author: Nanley Chery 
Date:   Thu Oct 15 10:11:57 2020 -0700

intel/isl: Drop redundant unpack of unorm channels

Fixes: 09ced654204 ("intel/isl: Add format conversion code")
Reviewed-by: Sagar Ghuge 
Part-of: 
(cherry picked from commit 5e27e0432274a29e75f9267269a2b367eda33cbf)

---

 .pick_status.json  | 2 +-
 src/intel/isl/isl_format.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index c7c2f2175fa..a1607581e7b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -202,7 +202,7 @@
 "description": "intel/isl: Drop redundant unpack of unorm channels",
 "nominated": true,
 "nomination_type": 1,
-"resolution": 0,
+"resolution": 1,
 "master_sha": null,
 "because_sha": "09ced6542049986f7fe52af8087aec9fc23d9f16"
 },
diff --git a/src/intel/isl/isl_format.c b/src/intel/isl/isl_format.c
index 5f92c3e1f36..6b848c2c53c 100644
--- a/src/intel/isl/isl_format.c
+++ b/src/intel/isl/isl_format.c
@@ -1272,7 +1272,6 @@ unpack_channel(union isl_color_value *value,
 
switch (layout->type) {
case ISL_UNORM:
-  unpacked.f32 = _mesa_unorm_to_float(packed, layout->bits);
   if (colorspace == ISL_COLORSPACE_SRGB) {
  if (layout->bits == 8) {
 unpacked.f32 = util_format_srgb_8unorm_to_linear_float(packed);

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


Mesa (staging/20.2): isl: Fix the aux-map encoding for D24_UNORM_X8

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: staging/20.2
Commit: 1219eace69c4a106277ca7dc4c6614f96d7a8167
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1219eace69c4a106277ca7dc4c6614f96d7a8167

Author: Nanley Chery 
Date:   Fri Oct 16 10:49:48 2020 -0700

isl: Fix the aux-map encoding for D24_UNORM_X8

Bspec: 53911 now defines the encoding for this format.

Cc: mesa-stable
Reviewed-by: Sagar Ghuge 
Part-of: 
(cherry picked from commit 3c87ac1f60875b5bbd4facca22fc426ee747997a)

---

 .pick_status.json   | 2 +-
 src/intel/isl/isl.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 372309bb349..db157923cce 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4,7 +4,7 @@
 "description": "isl: Fix the aux-map encoding for D24_UNORM_X8",
 "nominated": true,
 "nomination_type": 0,
-"resolution": 0,
+"resolution": 1,
 "master_sha": null,
 "because_sha": null
 },
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index e9731616bb1..a037956f017 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -2969,7 +2969,7 @@ isl_format_get_aux_map_encoding(enum isl_format format)
case ISL_FORMAT_R32_SINT: return 0x12;
case ISL_FORMAT_R32_UINT: return 0x13;
case ISL_FORMAT_R32_FLOAT: return 0x11;
-   case ISL_FORMAT_R24_UNORM_X8_TYPELESS: return 0x11;
+   case ISL_FORMAT_R24_UNORM_X8_TYPELESS: return 0x13;
case ISL_FORMAT_B5G6R5_UNORM: return 0xA;
case ISL_FORMAT_B5G6R5_UNORM_SRGB: return 0xA;
case ISL_FORMAT_B5G5R5A1_UNORM: return 0xA;

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


Mesa (staging/20.2): Revert "radeonsi/gfx10: disable vertex grouping"

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: staging/20.2
Commit: 07e1df3cd1ed12fe02a53a29e75d672aad2aebdb
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=07e1df3cd1ed12fe02a53a29e75d672aad2aebdb

Author: Marek Olšák 
Date:   Wed Oct 14 14:46:48 2020 -0400

Revert "radeonsi/gfx10: disable vertex grouping"

This reverts commit 42f921387b9c939cf1d809fa447d7980f73aa591.

It causes GPU hangs on gfx10.3.

Fixes: a23802bcb9a - ac,radeonsi: start adding support for gfx10.3

Acked-by: Pierre-Eric Pelloux-Prayer 
Part-of: 
(cherry picked from commit 6810e6e4d0e321fc45f55e984912b824fe2a1b28)

---

 .pick_status.json   | 2 +-
 src/gallium/drivers/radeonsi/si_state_draw.c| 8 +---
 src/gallium/drivers/radeonsi/si_state_shaders.c | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index a1607581e7b..372309bb349 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -175,7 +175,7 @@
 "description": "Revert \"radeonsi/gfx10: disable vertex grouping\"",
 "nominated": true,
 "nomination_type": 1,
-"resolution": 0,
+"resolution": 1,
 "master_sha": null,
 "because_sha": "a23802bcb9a42a02d34a5a36d6e66d6532813a0d"
 },
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c 
b/src/gallium/drivers/radeonsi/si_state_draw.c
index b6b789da0c2..7a4740149bb 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -668,23 +668,25 @@ static void gfx10_emit_ge_cntl(struct si_context *sctx, 
unsigned num_patches)
if (sctx->ngg) {
   if (sctx->tes_shader.cso) {
  ge_cntl = S_03096C_PRIM_GRP_SIZE(num_patches) |
-   S_03096C_VERT_GRP_SIZE(256) | /* 256 = disable vertex 
grouping */
+   S_03096C_VERT_GRP_SIZE(0) |
S_03096C_BREAK_WAVE_AT_EOI(key.u.tess_uses_prim_id);
   } else {
  ge_cntl = si_get_vs_state(sctx)->ge_cntl;
   }
} else {
   unsigned primgroup_size;
-  unsigned vertgroup_size = 256; /* 256 = disable vertex grouping */
-  ;
+  unsigned vertgroup_size;
 
   if (sctx->tes_shader.cso) {
  primgroup_size = num_patches; /* must be a multiple of NUM_PATCHES */
+ vertgroup_size = 0;
   } else if (sctx->gs_shader.cso) {
  unsigned vgt_gs_onchip_cntl = 
sctx->gs_shader.current->ctx_reg.gs.vgt_gs_onchip_cntl;
  primgroup_size = G_028A44_GS_PRIMS_PER_SUBGRP(vgt_gs_onchip_cntl);
+ vertgroup_size = G_028A44_ES_VERTS_PER_SUBGRP(vgt_gs_onchip_cntl);
   } else {
  primgroup_size = 128; /* recommended without a GS and tess */
+ vertgroup_size = 0;
   }
 
   ge_cntl = S_03096C_PRIM_GRP_SIZE(primgroup_size) | 
S_03096C_VERT_GRP_SIZE(vertgroup_size) |
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c 
b/src/gallium/drivers/radeonsi/si_state_shaders.c
index e2dc6bdabf3..327cf578ede 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1243,7 +1243,7 @@ static void gfx10_shader_ngg(struct si_screen *sscreen, 
struct si_shader *shader
 S_03096C_VERT_GRP_SIZE(shader->ngg.max_gsprims + 2);
} else {
   shader->ge_cntl = S_03096C_PRIM_GRP_SIZE(shader->ngg.max_gsprims) |
-S_03096C_VERT_GRP_SIZE(256) | /* 256 = disable vertex 
grouping */
+S_03096C_VERT_GRP_SIZE(shader->ngg.hw_max_esverts) |
 S_03096C_BREAK_WAVE_AT_EOI(break_wave_at_eoi);
 
   /* Bug workaround for a possible hang with non-tessellation cases.

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


Mesa (staging/20.2): .pick_status.json: Update to 3c87ac1f60875b5bbd4facca22fc426ee747997a

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: staging/20.2
Commit: a4e81dd7a2e5c33cb688e45b53a3e441ef2cb5d9
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4e81dd7a2e5c33cb688e45b53a3e441ef2cb5d9

Author: Dylan Baker 
Date:   Mon Oct 19 09:53:24 2020 -0700

.pick_status.json: Update to 3c87ac1f60875b5bbd4facca22fc426ee747997a

---

 .pick_status.json | 252 ++
 1 file changed, 252 insertions(+)

diff --git a/.pick_status.json b/.pick_status.json
index 0312b391362..1a86878baed 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1,4 +1,256 @@
 [
+{
+"sha": "3c87ac1f60875b5bbd4facca22fc426ee747997a",
+"description": "isl: Fix the aux-map encoding for D24_UNORM_X8",
+"nominated": true,
+"nomination_type": 0,
+"resolution": 0,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "9a062383e35f812410fe025930b016b4b67710e5",
+"description": "anv: Implement VariableDescriptorCount",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "215218f32f50136534cc37eec9bada2b4b6d1f95",
+"description": "anv: Add a descriptor_count to descriptor sets",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "dd1971c9d8f7ea80a52538c04a82f6166d96b952",
+"description": "anv: Bump the number of update-after-bind descriptors 
to 1M",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "3c0ba7b1802bf231ef3f0a7bdbeb474be99a2aed",
+"description": "zink: reject resource-imports with modifiers",
+"nominated": false,
+"nomination_type": 1,
+"resolution": 4,
+"master_sha": null,
+"because_sha": "d686835171c44cf325306f6c87408bef999f5496"
+},
+{
+"sha": "068b4bf76c03a983982be8af13daf228be4531ce",
+"description": "doc/features: remove zink entries for GL 3.3 items",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "af8d488ea5e13219c67c132a3edfa2e7a698746d",
+"description": "util,ac,aco,radv: Cross-platform memstream API",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "4c2e7b08930654cff115b1a4a22abc851dae958b",
+"description": "util,radv,radv/winsys: Cross-platform rwlock API",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "9d4999e7cf7ca530b3e99a1923f1df9e2069cd34",
+"description": "anv: Ignore continue flag in primary cmd buffers",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "b3529e56b5d98b7cae22d57f7c474092c94f7f65",
+"description": "ac/nir: implement missing nir_op_pack_half_2x16_split",
+"nominated": false,
+"nomination_type": 1,
+"resolution": 4,
+"master_sha": null,
+"because_sha": "2f125908b358c2423aa34d2673ec04aa546b971a"
+},
+{
+"sha": "57d317865e7bee02a17efcde8beeb6a220f900f1",
+"description": "radeonsi: enable NGG culling by default on Navi1x PRO 
cards",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "67a67ea29e7177393c3ba9f70c5b7207862065ab",
+"description": "radeonsi: enable NGG on Navi14 PRO cards",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "bc3c74e2a296b48c4473a37c863e9df3005355fb",
+"description": "radeonsi: tweak LATE_ALLOC_GS numbers for faster NGG 
culling",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "b38b5aabee4a106ca3a071ed6568a2a0bd4bd977",
+"description": "radeonsi: pack LDS better for NGG culling",
+"nominated": false,
+"nomination_type": null,
+"resolution": 4,
+"master_sha": null,
+"because_sha": null
+},
+{
+"sha": "8094367988932b071ec482fe717eebddeaaf58ca",
+"description": "radeonsi: write VS/TES system values into LDS after 
culling",
+  

Mesa (master): isl: Fix the aux-map encoding for D24_UNORM_X8

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 3c87ac1f60875b5bbd4facca22fc426ee747997a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c87ac1f60875b5bbd4facca22fc426ee747997a

Author: Nanley Chery 
Date:   Fri Oct 16 10:49:48 2020 -0700

isl: Fix the aux-map encoding for D24_UNORM_X8

Bspec: 53911 now defines the encoding for this format.

Cc: mesa-stable
Reviewed-by: Sagar Ghuge 
Part-of: 

---

 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 ab821839ecf..787a385c567 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -2941,7 +2941,7 @@ isl_format_get_aux_map_encoding(enum isl_format format)
case ISL_FORMAT_R32_SINT: return 0x12;
case ISL_FORMAT_R32_UINT: return 0x13;
case ISL_FORMAT_R32_FLOAT: return 0x11;
-   case ISL_FORMAT_R24_UNORM_X8_TYPELESS: return 0x11;
+   case ISL_FORMAT_R24_UNORM_X8_TYPELESS: return 0x13;
case ISL_FORMAT_B5G6R5_UNORM: return 0xA;
case ISL_FORMAT_B5G6R5_UNORM_SRGB: return 0xA;
case ISL_FORMAT_B5G5R5A1_UNORM: return 0xA;

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


Mesa (master): anv: Implement VariableDescriptorCount

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 9a062383e35f812410fe025930b016b4b67710e5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a062383e35f812410fe025930b016b4b67710e5

Author: Jason Ekstrand 
Date:   Thu Oct 15 22:56:09 2020 -0500

anv: Implement VariableDescriptorCount

Reviewed-by: Lionel Landwerlin 
Part-of: 

---

 src/intel/vulkan/anv_cmd_buffer.c |   4 +-
 src/intel/vulkan/anv_descriptor_set.c | 179 ++
 src/intel/vulkan/anv_device.c |   2 +-
 src/intel/vulkan/anv_private.h|  10 +-
 src/intel/vulkan/genX_cmd_buffer.c|  17 +++-
 5 files changed, 182 insertions(+), 30 deletions(-)

diff --git a/src/intel/vulkan/anv_cmd_buffer.c 
b/src/intel/vulkan/anv_cmd_buffer.c
index 86596b66457..4734926e871 100644
--- a/src/intel/vulkan/anv_cmd_buffer.c
+++ b/src/intel/vulkan/anv_cmd_buffer.c
@@ -1239,9 +1239,9 @@ anv_cmd_buffer_push_descriptor_set(struct anv_cmd_buffer 
*cmd_buffer,
   anv_descriptor_set_layout_ref(layout);
   set->layout = layout;
}
-   set->size = anv_descriptor_set_layout_size(layout);
+   set->size = anv_descriptor_set_layout_size(layout, 0);
set->buffer_view_count = layout->buffer_view_count;
-   set->descriptor_count = layout->size;
+   set->descriptor_count = layout->descriptor_count;
set->buffer_views = (*push_set)->buffer_views;
 
if (layout->descriptor_buffer_size &&
diff --git a/src/intel/vulkan/anv_descriptor_set.c 
b/src/intel/vulkan/anv_descriptor_set.c
index 883c917e3d8..09d698e7ccb 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -248,17 +248,31 @@ void anv_GetDescriptorSetLayoutSupport(
const struct anv_physical_device *pdevice = device->physical;
 
uint32_t surface_count[MESA_SHADER_STAGES] = { 0, };
+   VkDescriptorType varying_desc_type = VK_DESCRIPTOR_TYPE_MAX_ENUM;
bool needs_descriptor_buffer = false;
 
+   const VkDescriptorSetLayoutBindingFlagsCreateInfo *binding_flags_info =
+  vk_find_struct_const(pCreateInfo->pNext,
+   DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO);
+
for (uint32_t b = 0; b < pCreateInfo->bindingCount; b++) {
   const VkDescriptorSetLayoutBinding *binding = >pBindings[b];
 
+  VkDescriptorBindingFlags flags = 0;
+  if (binding_flags_info && binding_flags_info->bindingCount > 0) {
+ assert(binding_flags_info->bindingCount == pCreateInfo->bindingCount);
+ flags = binding_flags_info->pBindingFlags[b];
+  }
+
   enum anv_descriptor_data desc_data =
  anv_descriptor_data_for_type(pdevice, binding->descriptorType);
 
   if (anv_needs_descriptor_buffer(binding->descriptorType, desc_data))
  needs_descriptor_buffer = true;
 
+  if (flags & VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT)
+ varying_desc_type = binding->descriptorType;
+
   switch (binding->descriptorType) {
   case VK_DESCRIPTOR_TYPE_SAMPLER:
  /* There is no real limit on samplers */
@@ -300,6 +314,19 @@ void anv_GetDescriptorSetLayoutSupport(
  surface_count[s] += 1;
}
 
+   VkDescriptorSetVariableDescriptorCountLayoutSupport *vdcls =
+  vk_find_struct(pSupport->pNext,
+ DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT);
+   if (vdcls != NULL) {
+  if (varying_desc_type == VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT) {
+ vdcls->maxVariableDescriptorCount = MAX_INLINE_UNIFORM_BLOCK_SIZE;
+  } else if (varying_desc_type != VK_DESCRIPTOR_TYPE_MAX_ENUM) {
+ vdcls->maxVariableDescriptorCount = UINT16_MAX;
+  } else {
+ vdcls->maxVariableDescriptorCount = 0;
+  }
+   }
+
bool supported = true;
for (unsigned s = 0; s < MESA_SHADER_STAGES; s++) {
   /* Our maximum binding table size is 240 and we need to reserve 8 for
@@ -417,22 +444,37 @@ VkResult anv_CreateDescriptorSetLayout(
   if (binding->descriptorCount == 0)
  continue;
 
-#ifndef NDEBUG
   set_layout->binding[b].type = binding->descriptorType;
-#endif
 
   if (binding_flags_info && binding_flags_info->bindingCount > 0) {
  assert(binding_flags_info->bindingCount == pCreateInfo->bindingCount);
  set_layout->binding[b].flags =
 binding_flags_info->pBindingFlags[info_idx];
+
+ /* From the Vulkan spec:
+  *
+  *"If VkDescriptorSetLayoutCreateInfo::flags includes
+  *VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then
+  *all elements of pBindingFlags must not include
+  *VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT,
+  *VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT, or
+  *VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT"
+  */
+ if (pCreateInfo->flags &
+ VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR) {
+

Mesa (master): anv: Add a descriptor_count to descriptor sets

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 215218f32f50136534cc37eec9bada2b4b6d1f95
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=215218f32f50136534cc37eec9bada2b4b6d1f95

Author: Jason Ekstrand 
Date:   Fri Oct 16 12:52:46 2020 -0500

anv: Add a descriptor_count to descriptor sets

This is useful for asserting in-bounds descriptor set access.

Reviewed-by: Lionel Landwerlin 
Part-of: 

---

 src/intel/vulkan/anv_cmd_buffer.c | 1 +
 src/intel/vulkan/anv_descriptor_set.c | 2 ++
 src/intel/vulkan/anv_private.h| 1 +
 src/intel/vulkan/genX_cmd_buffer.c| 6 --
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_cmd_buffer.c 
b/src/intel/vulkan/anv_cmd_buffer.c
index fd3a92d924a..86596b66457 100644
--- a/src/intel/vulkan/anv_cmd_buffer.c
+++ b/src/intel/vulkan/anv_cmd_buffer.c
@@ -1241,6 +1241,7 @@ anv_cmd_buffer_push_descriptor_set(struct anv_cmd_buffer 
*cmd_buffer,
}
set->size = anv_descriptor_set_layout_size(layout);
set->buffer_view_count = layout->buffer_view_count;
+   set->descriptor_count = layout->size;
set->buffer_views = (*push_set)->buffer_views;
 
if (layout->descriptor_buffer_size &&
diff --git a/src/intel/vulkan/anv_descriptor_set.c 
b/src/intel/vulkan/anv_descriptor_set.c
index 480f7272d75..883c917e3d8 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -982,6 +982,8 @@ anv_descriptor_set_create(struct anv_device *device,
   (struct anv_buffer_view *) >descriptors[layout->size];
set->buffer_view_count = layout->buffer_view_count;
 
+   set->descriptor_count = layout->size;
+
/* By defining the descriptors to be zero now, we can later verify that
 * a descriptor has not been populated with user data.
 */
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index d6b9aea3512..f2046fb6ffe 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -2091,6 +2091,7 @@ struct anv_descriptor_set {
/* Link to descriptor pool's desc_sets list . */
struct list_head pool_link;
 
+   uint32_t descriptor_count;
struct anv_descriptor descriptors[0];
 };
 
diff --git a/src/intel/vulkan/genX_cmd_buffer.c 
b/src/intel/vulkan/genX_cmd_buffer.c
index 5f1eca71ed1..985e3b9df5f 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -2600,8 +2600,10 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
 
   default: {
  assert(binding->set < MAX_SETS);
- const struct anv_descriptor *desc =
-
_state->descriptors[binding->set]->descriptors[binding->index];
+ const struct anv_descriptor_set *set =
+pipe_state->descriptors[binding->set];
+ assert(binding->index < set->descriptor_count);
+ const struct anv_descriptor *desc = >descriptors[binding->index];
 
  switch (desc->type) {
  case VK_DESCRIPTOR_TYPE_SAMPLER:

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


Mesa (master): anv: Bump the number of update-after-bind descriptors to 1M

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: dd1971c9d8f7ea80a52538c04a82f6166d96b952
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd1971c9d8f7ea80a52538c04a82f6166d96b952

Author: Jason Ekstrand 
Date:   Thu Oct 15 20:33:12 2020 -0500

anv: Bump the number of update-after-bind descriptors to 1M

It's a bit hard to exactly map our implementation to the limits
described by Vulkan.  The bindless surface handle in the extended
message descriptors is 20 bits and it's an index into the table of
RENDER_SURFACE_STATE structs that starts at bindless surface base
address.  This means that we can have at must 1M surface states
allocated at any given time.  Since most image views take two
descriptors, this means we have a limit of about 500K image views.

However, since we allocate surface states at vkCreateImageView time,
this means our limit is actually something on the order of 500K image
views allocated at any time.  The actual limit describe by Vulkan, on
the other hand, is a limit of how many you can have in a descriptor set.
Assuming anyone using 1M descriptors will be using the same image view
twice a bunch of times (or a bunch of null descriptors), we can safely
advertise a larger limit.  1M is what's required by D3D12, so let's
advertise that.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3335
Reviewed-by: Lionel Landwerlin 
Part-of: 

---

 src/intel/vulkan/anv_device.c | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 3accdf7d709..2b400be65a7 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1744,17 +1744,22 @@ anv_get_physical_device_properties_1_2(struct 
anv_physical_device *pdevice,
p->shaderSignedZeroInfNanPreserveFloat64  = true;
 
/* It's a bit hard to exactly map our implementation to the limits
-* described here.  The bindless surface handle in the extended
+* described by Vulkan.  The bindless surface handle in the extended
 * message descriptors is 20 bits and it's an index into the table of
 * RENDER_SURFACE_STATE structs that starts at bindless surface base
-* address.  Given that most things consume two surface states per
-* view (general/sampled for textures and write-only/read-write for
-* images), we claim 2^19 things.
+* address.  This means that we can have at must 1M surface states
+* allocated at any given time.  Since most image views take two
+* descriptors, this means we have a limit of about 500K image views.
 *
-* For SSBOs, we just use A64 messages so there is no real limit
-* there beyond the limit on the total size of a descriptor set.
+* However, since we allocate surface states at vkCreateImageView time,
+* this means our limit is actually something on the order of 500K image
+* views allocated at any time.  The actual limit describe by Vulkan, on
+* the other hand, is a limit of how many you can have in a descriptor set.
+* Assuming anyone using 1M descriptors will be using the same image view
+* twice a bunch of times (or a bunch of null descriptors), we can safely
+* advertise a larger limit here.
 */
-   const unsigned max_bindless_views = 1 << 19;
+   const unsigned max_bindless_views = 1 << 20;
p->maxUpdateAfterBindDescriptorsInAllPools= max_bindless_views;
p->shaderUniformBufferArrayNonUniformIndexingNative   = false;
p->shaderSampledImageArrayNonUniformIndexingNative= false;

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


Mesa (master): zink: reject resource-imports with modifiers

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 3c0ba7b1802bf231ef3f0a7bdbeb474be99a2aed
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c0ba7b1802bf231ef3f0a7bdbeb474be99a2aed

Author: Erik Faye-Lund 
Date:   Mon Oct 19 11:17:30 2020 +0200

zink: reject resource-imports with modifiers

Zink doesn't support forwarding DRM modifiers yet, so whenever those are
used, we end up ignoring them. That's not going to do the right thing in
most cases, so let's reject them instead.

Since d686835171c, the dri2 code tries to create a 0x0 surface without
any format when trying to import. This makes this go from
rendering-issues to asserting in debug builds, making things even worse.

Fixes: d686835171c ("gallium/dri2: Support I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS 
import")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3654
Reviewed-by: Daniel Stone 
Reviewed-By: Mike Blumenkrantz 
Part-of: 

---

 src/gallium/drivers/zink/zink_resource.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_resource.c 
b/src/gallium/drivers/zink/zink_resource.c
index e53e941ed33..88bc347ad6b 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -36,6 +36,8 @@
 
 #include "frontend/sw_winsys.h"
 
+#include "drm-uapi/drm_fourcc.h"
+
 static void
 zink_resource_destroy(struct pipe_screen *pscreen,
   struct pipe_resource *pres)
@@ -339,6 +341,7 @@ zink_resource_get_handle(struct pipe_screen *pscreen,
   if (result != VK_SUCCESS)
  return false;
   whandle->handle = fd;
+  whandle->modifier = DRM_FORMAT_MOD_INVALID;
}
return true;
 }
@@ -349,6 +352,9 @@ zink_resource_from_handle(struct pipe_screen *pscreen,
  struct winsys_handle *whandle,
  unsigned usage)
 {
+   if (whandle->modifier != DRM_FORMAT_MOD_INVALID)
+  return NULL;
+
return resource_create(pscreen, templ, whandle, usage);
 }
 

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


Mesa (master): doc/features: remove zink entries for GL 3.3 items

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 068b4bf76c03a983982be8af13daf228be4531ce
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=068b4bf76c03a983982be8af13daf228be4531ce

Author: Mike Blumenkrantz 
Date:   Sat Oct 17 09:40:18 2020 -0400

doc/features: remove zink entries for GL 3.3 items

zink fully supports 3.3, so we don't need to be listed for these

Reviewed-by: Hoe Hao Cheng 
Part-of: 

---

 docs/features.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/features.txt b/docs/features.txt
index 03c3704d2cd..0d48b75c098 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -99,9 +99,9 @@ GL 3.2, GLSL 1.50 --- all DONE: i965, nv50, nvc0, r600, 
radeonsi, llvmpipe, soft
 
 GL 3.3, GLSL 3.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, 
softpipe, virgl, zink
 
-  GL_ARB_blend_func_extendedDONE (freedreno/a3xx, 
swr, zink, panfrost)
+  GL_ARB_blend_func_extendedDONE (freedreno/a3xx, 
swr, panfrost)
   GL_ARB_explicit_attrib_location   DONE (all drivers that 
support GLSL)
-  GL_ARB_occlusion_query2   DONE (freedreno, swr, 
v3d, zink, panfrost)
+  GL_ARB_occlusion_query2   DONE (freedreno, swr, 
v3d, panfrost)
   GL_ARB_sampler_objectsDONE (all drivers)
   GL_ARB_shader_bit_encodingDONE (freedreno, swr, 
v3d, panfrost)
   GL_ARB_texture_rgb10_a2ui DONE (freedreno, swr, 
panfrost)

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


Mesa (master): util,ac,aco,radv: Cross-platform memstream API

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: af8d488ea5e13219c67c132a3edfa2e7a698746d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=af8d488ea5e13219c67c132a3edfa2e7a698746d

Author: James Park 
Date:   Tue Aug  4 10:58:11 2020 -0700

util,ac,aco,radv: Cross-platform memstream API

POSIX memstream is not available on Windows.

Reviewed-by: Samuel Pitoiset 
Part-of: 

---

 src/amd/common/ac_debug.c  |  7 ++-
 src/amd/compiler/aco_assembler.cpp |  7 ++-
 src/amd/compiler/aco_instruction_selection.cpp |  7 ++-
 src/amd/compiler/aco_interface.cpp | 12 ++--
 src/amd/compiler/aco_optimizer.cpp |  7 ++-
 src/amd/compiler/aco_validate.cpp  | 14 +++--
 src/amd/vulkan/radv_shader.c   | 16 +++--
 src/util/memstream.c   | 81 ++
 src/util/memstream.h   | 67 +
 src/util/meson.build   |  2 +
 10 files changed, 197 insertions(+), 23 deletions(-)

diff --git a/src/amd/common/ac_debug.c b/src/amd/common/ac_debug.c
index 246a89ee86a..5acf4928d0b 100644
--- a/src/amd/common/ac_debug.c
+++ b/src/amd/common/ac_debug.c
@@ -33,6 +33,7 @@
 
 #include "sid.h"
 #include "sid_tables.h"
+#include "util/memstream.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "util/u_string.h"
@@ -584,10 +585,12 @@ void ac_parse_ib_chunk(FILE *f, uint32_t *ib_ptr, int 
num_dw, const int *trace_i
 
char *out;
size_t outsize;
-   FILE *memf = open_memstream(, );
+   struct u_memstream mem;
+   u_memstream_open(, , );
+   FILE *const memf = u_memstream_get();
ib.f = memf;
ac_do_parse_ib(memf, );
-   fclose(memf);
+   u_memstream_close();
 
if (out) {
   format_ib_output(f, out);
diff --git a/src/amd/compiler/aco_assembler.cpp 
b/src/amd/compiler/aco_assembler.cpp
index ac9339c99eb..755bed09e1a 100644
--- a/src/amd/compiler/aco_assembler.cpp
+++ b/src/amd/compiler/aco_assembler.cpp
@@ -5,6 +5,7 @@
 #include "aco_builder.h"
 #include "common/sid.h"
 #include "ac_shader_util.h"
+#include "util/memstream.h"
 #include "util/u_math.h"
 
 namespace aco {
@@ -83,11 +84,13 @@ void emit_instruction(asm_context& ctx, 
std::vector& out, Instruction*
if (opcode == (uint32_t)-1) {
   char *out;
   size_t outsize;
-  FILE *memf = open_memstream(, );
+  struct u_memstream mem;
+  u_memstream_open(, , );
+  FILE *const memf = u_memstream_get();
 
   fprintf(memf, "Unsupported opcode: ");
   aco_print_instr(instr, memf);
-  fclose(memf);
+  u_memstream_close();
 
   aco_err(ctx.program, out);
   free(out);
diff --git a/src/amd/compiler/aco_instruction_selection.cpp 
b/src/amd/compiler/aco_instruction_selection.cpp
index 1da9ea41d98..c57b6709ac6 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -34,6 +34,7 @@
 #include "aco_interface.h"
 #include "aco_instruction_selection.h"
 #include "util/fast_idiv_by_const.h"
+#include "util/memstream.h"
 
 #include "ac_exp_param.h"
 #include "sid.h"
@@ -50,11 +51,13 @@ static void _isel_err(isel_context *ctx, const char *file, 
unsigned line,
 {
char *out;
size_t outsize;
-   FILE *memf = open_memstream(, );
+   struct u_memstream mem;
+   u_memstream_open(, , );
+   FILE *const memf = u_memstream_get();
 
fprintf(memf, "%s: ", msg);
nir_print_instr(instr, memf);
-   fclose(memf);
+   u_memstream_close();
 
_aco_err(ctx->program, file, line, out);
free(out);
diff --git a/src/amd/compiler/aco_interface.cpp 
b/src/amd/compiler/aco_interface.cpp
index 9b3f88e8a26..55ddd19b638 100644
--- a/src/amd/compiler/aco_interface.cpp
+++ b/src/amd/compiler/aco_interface.cpp
@@ -23,6 +23,7 @@
 
 #include "aco_interface.h"
 #include "aco_ir.h"
+#include "util/memstream.h"
 #include "vulkan/radv_shader.h"
 #include "vulkan/radv_shader_args.h"
 
@@ -110,11 +111,12 @@ void aco_compile_shader(unsigned shader_count,
if (args->options->record_ir) {
   char *data = NULL;
   size_t size = 0;
-  FILE *f = open_memstream(, );
-  if (f) {
- aco_print_program(program.get(), f);
- fputc(0, f);
- fclose(f);
+  u_memstream mem;
+  if (u_memstream_open(, , )) {
+ FILE *const memf = u_memstream_get();
+ aco_print_program(program.get(), memf);
+ fputc(0, memf);
+ u_memstream_close();
   }
 
   llvm_ir = std::string(data, data + size);
diff --git a/src/amd/compiler/aco_optimizer.cpp 
b/src/amd/compiler/aco_optimizer.cpp
index a21fb21d1fa..22497a10452 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -30,6 +30,7 @@
 
 #include "aco_ir.h"
 #include "util/half_float.h"
+#include "util/memstream.h"
 #include "util/u_math.h"
 
 namespace aco {
@@ -40,11 +41,13 @@ void perfwarn(Program *program, 

Mesa (master): util,radv,radv/winsys: Cross-platform rwlock API

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 4c2e7b08930654cff115b1a4a22abc851dae958b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c2e7b08930654cff115b1a4a22abc851dae958b

Author: James Park 
Date:   Tue Oct 13 21:06:21 2020 -0700

util,radv,radv/winsys: Cross-platform rwlock API

POSIX rwlock is not available on Windows.

Reviewed-by: Samuel Pitoiset 
Part-of: 

---

 src/amd/vulkan/radv_device.c  |  18 ++--
 src/amd/vulkan/radv_private.h |   3 +-
 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c |   8 +-
 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c |  20 ++--
 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c |   4 +-
 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h |   3 +-
 src/util/meson.build  |   1 +
 src/util/rwlock.h | 113 ++
 8 files changed, 143 insertions(+), 27 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 160263b5e03..3185d129991 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2386,7 +2386,7 @@ radv_queue_finish(struct radv_queue *queue)
 static void
 radv_bo_list_init(struct radv_bo_list *bo_list)
 {
-   pthread_rwlock_init(_list->rwlock, NULL);
+   u_rwlock_init(_list->rwlock);
bo_list->list.count = bo_list->capacity = 0;
bo_list->list.bos = NULL;
 }
@@ -2395,7 +2395,7 @@ static void
 radv_bo_list_finish(struct radv_bo_list *bo_list)
 {
free(bo_list->list.bos);
-   pthread_rwlock_destroy(_list->rwlock);
+   u_rwlock_destroy(_list->rwlock);
 }
 
 VkResult radv_bo_list_add(struct radv_device *device,
@@ -2409,13 +2409,13 @@ VkResult radv_bo_list_add(struct radv_device *device,
if (unlikely(!device->use_global_bo_list))
return VK_SUCCESS;
 
-   pthread_rwlock_wrlock(_list->rwlock);
+   u_rwlock_wrlock(_list->rwlock);
if (bo_list->list.count == bo_list->capacity) {
unsigned capacity = MAX2(4, bo_list->capacity * 2);
void *data = realloc(bo_list->list.bos, capacity * 
sizeof(struct radeon_winsys_bo*));
 
if (!data) {
-   pthread_rwlock_unlock(_list->rwlock);
+   u_rwlock_wrunlock(_list->rwlock);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
 
@@ -2424,7 +2424,7 @@ VkResult radv_bo_list_add(struct radv_device *device,
}
 
bo_list->list.bos[bo_list->list.count++] = bo;
-   pthread_rwlock_unlock(_list->rwlock);
+   u_rwlock_wrunlock(_list->rwlock);
return VK_SUCCESS;
 }
 
@@ -2439,7 +2439,7 @@ void radv_bo_list_remove(struct radv_device *device,
if (unlikely(!device->use_global_bo_list))
return;
 
-   pthread_rwlock_wrlock(_list->rwlock);
+   u_rwlock_wrlock(_list->rwlock);
/* Loop the list backwards so we find the most recently added
 * memory first. */
for(unsigned i = bo_list->list.count; i-- > 0;) {
@@ -2449,7 +2449,7 @@ void radv_bo_list_remove(struct radv_device *device,
break;
}
}
-   pthread_rwlock_unlock(_list->rwlock);
+   u_rwlock_wrunlock(_list->rwlock);
 }
 
 static void
@@ -4574,7 +4574,7 @@ radv_queue_submit_deferred(struct 
radv_deferred_queue_submission *submission,
sem_info.cs_emit_signal = j + advance == 
submission->cmd_buffer_count;
 
if (unlikely(queue->device->use_global_bo_list)) {
-   
pthread_rwlock_rdlock(>device->bo_list.rwlock);
+   u_rwlock_rdlock(>device->bo_list.rwlock);
bo_list = >device->bo_list.list;
}
 
@@ -4584,7 +4584,7 @@ radv_queue_submit_deferred(struct 
radv_deferred_queue_submission *submission,
  can_patch, 
base_fence);
 
if (unlikely(queue->device->use_global_bo_list))
-   
pthread_rwlock_unlock(>device->bo_list.rwlock);
+   
u_rwlock_rdunlock(>device->bo_list.rwlock);
 
if (result != VK_SUCCESS)
goto fail;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 5bb6bbfae8a..eb651b547fa 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -48,6 +48,7 @@
 #include "compiler/shader_enums.h"
 #include "util/macros.h"
 #include "util/list.h"
+#include "util/rwlock.h"
 #include "util/xmlconfig.h"
 #include "vk_alloc.h"
 #include "vk_debug_report.h"
@@ -741,7 +742,7 @@ struct radv_queue {
 struct radv_bo_list {
struct radv_winsys_bo_list list;
unsigned capacity;
-   pthread_rwlock_t rwlock;
+   struct u_rwlock rwlock;
 };
 

Mesa (master): anv: Ignore continue flag in primary cmd buffers

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: 9d4999e7cf7ca530b3e99a1923f1df9e2069cd34
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d4999e7cf7ca530b3e99a1923f1df9e2069cd34

Author: Ricardo Garcia 
Date:   Thu Oct 15 18:14:52 2020 +0200

anv: Ignore continue flag in primary cmd buffers

According to the Vulkan specification, the
VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT flag will be ignored if
included in a VkCommandBufferBeginInfo for a primary command buffer.
This also implies pBeginInfo->pInheritanceInfo should not be read even
if the flag is present, and makes it legal to include the flag knowing
it will be ignored.

Signed-off-by: Ricardo Garcia 
Reviewed-by: Lionel Landwerlin 
Part-of: 

---

 src/intel/vulkan/genX_cmd_buffer.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/genX_cmd_buffer.c 
b/src/intel/vulkan/genX_cmd_buffer.c
index 4c6ca738121..5f1eca71ed1 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -1536,8 +1536,17 @@ genX(BeginCommandBuffer)(
 
cmd_buffer->usage_flags = pBeginInfo->flags;
 
-   assert(cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_SECONDARY ||
-  !(cmd_buffer->usage_flags & 
VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT));
+   /* VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT must be ignored for
+* primary level command buffers.
+*
+* From the Vulkan 1.0 spec:
+*
+*VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT specifies that a
+*secondary command buffer is considered to be entirely inside a render
+*pass. If this is a primary command buffer, then this bit is ignored.
+*/
+   if (cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY)
+  cmd_buffer->usage_flags &= 
~VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT;
 
genX(cmd_buffer_emit_state_base_address)(cmd_buffer);
 

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


Mesa (master): ac/nir: implement missing nir_op_pack_half_2x16_split

2020-10-19 Thread GitLab Mirror
Module: Mesa
Branch: master
Commit: b3529e56b5d98b7cae22d57f7c474092c94f7f65
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3529e56b5d98b7cae22d57f7c474092c94f7f65

Author: Samuel Pitoiset 
Date:   Fri Oct 16 13:46:08 2020 +0200

ac/nir: implement missing nir_op_pack_half_2x16_split

RADV now lowers lower_pack_half_2x16.

Fixes: 2f125908b35 ("radv,aco: lower_pack_half_2x16")
Signed-off-by: Samuel Pitoiset 
Reviewed-by: Daniel Schürmann 
Part-of: 

---

 src/amd/llvm/ac_nir_to_llvm.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c
index 07db0c64c24..325baf5e2ec 100644
--- a/src/amd/llvm/ac_nir_to_llvm.c
+++ b/src/amd/llvm/ac_nir_to_llvm.c
@@ -1034,6 +1034,13 @@ static void visit_alu(struct ac_nir_context *ctx, const 
nir_alu_instr *instr)
case nir_op_pack_half_2x16:
   result = emit_pack_2x16(>ac, src[0], ac_build_cvt_pkrtz_f16);
   break;
+   case nir_op_pack_half_2x16_split:
+  src[0] = ac_to_float(>ac, src[0]);
+  src[1] = ac_to_float(>ac, src[1]);
+  result = LLVMBuildBitCast(ctx->ac.builder,
+ac_build_cvt_pkrtz_f16(>ac, src),
+ctx->ac.i32, "");
+  break;
case nir_op_pack_snorm_2x16:
   result = emit_pack_2x16(>ac, src[0], ac_build_cvt_pknorm_i16);
   break;

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