[Mesa-dev] [Bug 108508] Graphic glitches with stream output support on OLAND AMD GPU GCN 1.0

2018-10-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=108508

--- Comment #11 from Ahmed Elsayed  ---
I made a system restore to roll back to the stable Mesa release, and installed
the new Mesa 18.3 driver released yesterday.

The Witcher III: still the same.

Mafia III: the graphic glitches decreased but still exist.

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


[Mesa-dev] [PATCH 15/15] anv/android: turn on VK_ANDROID_external_memory_android_hardware_buffer

2018-10-29 Thread Tapani Pälli
Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_extensions.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/intel/vulkan/anv_extensions.py 
b/src/intel/vulkan/anv_extensions.py
index ab9240f9fd8..ca414284fdd 100644
--- a/src/intel/vulkan/anv_extensions.py
+++ b/src/intel/vulkan/anv_extensions.py
@@ -69,6 +69,7 @@ MAX_API_VERSION = None # Computed later
 # the those extension strings, then tests dEQP-VK.api.info.instance.extensions
 # and dEQP-VK.api.info.device fail due to the duplicated strings.
 EXTENSIONS = [
+Extension('VK_ANDROID_external_memory_android_hardware_buffer', 3, 
'ANDROID'),
 Extension('VK_ANDROID_native_buffer', 5, 'ANDROID'),
 Extension('VK_KHR_16bit_storage', 1, 'device->info.gen 
>= 8'),
 Extension('VK_KHR_8bit_storage',  1, 'device->info.gen 
>= 8'),
-- 
2.17.2

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


[Mesa-dev] [PATCH 10/15] anv/android: support creating images from external format

2018-10-29 Thread Tapani Pälli
Since we don't know the exact format at creation time, some initialization
is done only when bound with memory in vkBindImageMemory.

v2: demand dedicated allocation in vkGetImageMemoryRequirements2 if
image has external format

v3: refactor prepare_ahw_image, support vkBindImageMemory2,
calculate stride correctly for rgb(x) surfaces, rename as
'resolve_ahw_image'

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_android.c |  39 
 src/intel/vulkan/anv_device.c  |   2 +-
 src/intel/vulkan/anv_image.c   | 108 -
 src/intel/vulkan/anv_private.h |  10 +++
 4 files changed, 157 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c
index 42fa050af93..f993da875fe 100644
--- a/src/intel/vulkan/anv_android.c
+++ b/src/intel/vulkan/anv_android.c
@@ -360,6 +360,45 @@ anv_create_ahw_memory(VkDevice device_h,
return VK_SUCCESS;
 }
 
+VkResult
+anv_image_from_external(
+   VkDevice device_h,
+   const VkImageCreateInfo *base_info,
+   const struct VkExternalMemoryImageCreateInfo *create_info,
+   const VkAllocationCallbacks *alloc,
+   VkImage *out_image_h)
+{
+   ANV_FROM_HANDLE(anv_device, device, device_h);
+   VkImage image_h = VK_NULL_HANDLE;
+   struct anv_image *image = NULL;
+   VkResult result = VK_SUCCESS;
+
+   const struct VkExternalFormatANDROID *ext_info =
+  vk_find_struct_const(base_info->pNext, EXTERNAL_FORMAT_ANDROID);
+
+   if (ext_info && ext_info->externalFormat != 0) {
+  assert(base_info->format == VK_FORMAT_UNDEFINED);
+  assert(base_info->imageType == VK_IMAGE_TYPE_2D);
+  assert(base_info->usage == VK_IMAGE_USAGE_SAMPLED_BIT);
+  assert(base_info->tiling == VK_IMAGE_TILING_OPTIMAL);
+   }
+
+   struct anv_image_create_info anv_info = {
+  .vk_info = base_info,
+  .isl_extra_usage_flags = ISL_SURF_USAGE_DISABLE_AUX_BIT,
+  .external_format = true,
+   };
+
+   result = anv_image_create(device_h, _info, alloc, _h);
+   image = anv_image_from_handle(image_h);
+   if (result != VK_SUCCESS)
+  return result;
+
+   *out_image_h = image_h;
+
+   return result;
+}
+
 VkResult
 anv_image_from_gralloc(VkDevice device_h,
const VkImageCreateInfo *base_info,
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 37f923ab3d0..0bf6a5e3e1f 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -2763,7 +2763,7 @@ void anv_GetImageMemoryRequirements2(
   switch (ext->sType) {
   case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
  VkMemoryDedicatedRequirements *requirements = (void *)ext;
- if (image->needs_set_tiling) {
+ if (image->needs_set_tiling || image->external_format) {
 /* If we need to set the tiling for external consumers, we need a
  * dedicated allocation.
  *
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index be467815b96..26b5389f6d9 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -595,6 +595,15 @@ anv_image_create(VkDevice _device,
image->drm_format_mod = isl_mod_info ? isl_mod_info->modifier :
   DRM_FORMAT_MOD_INVALID;
 
+   /* In case of external format, We don't know format yet,
+* so skip the rest for now.
+*/
+   if (create_info->external_format) {
+  image->external_format = true;
+  *pImage = anv_image_to_handle(image);
+  return VK_SUCCESS;
+   }
+
const struct anv_format *format = anv_get_format(image->vk_format);
assert(format != NULL);
 
@@ -637,6 +646,14 @@ anv_CreateImage(VkDevice device,
 VkImage *pImage)
 {
 #ifdef ANDROID
+   const struct VkExternalMemoryImageCreateInfo *create_info =
+  vk_find_struct_const(pCreateInfo->pNext, 
EXTERNAL_MEMORY_IMAGE_CREATE_INFO);
+
+   if (create_info && create_info->handleTypes &
+   VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID)
+  return anv_image_from_external(device, pCreateInfo, create_info,
+ pAllocator, pImage);
+
const VkNativeBufferANDROID *gralloc_info =
   vk_find_struct_const(pCreateInfo->pNext, NATIVE_BUFFER_ANDROID);
 
@@ -693,6 +710,85 @@ static void anv_image_bind_memory_plane(struct anv_device 
*device,
};
 }
 
+#ifdef ANDROID
+/* We are binding AHardwareBuffer. Get a description, resolve the
+ * format and prepare anv_image properly.
+ */
+static void
+resolve_ahw_image(struct anv_device *device,
+  struct anv_image *image,
+  struct anv_device_memory *mem)
+{
+   assert(mem->ahw);
+
+   AHardwareBuffer_Desc desc;
+   AHardwareBuffer_describe(mem->ahw, );
+
+   /* Check tiling. */
+   int i915_tiling = anv_gem_get_tiling(device, mem->bo->gem_handle);
+   VkImageTiling vk_tiling = 2;
+
+   isl_tiling_flags_t isl_tiling_flags = 0;
+
+   switch (i915_tiling) {
+   case 

[Mesa-dev] [PATCH 11/15] anv: support VkExternalFormatANDROID in vkCreateSamplerYcbcrConversion

2018-10-29 Thread Tapani Pälli
If external format is used, we store the external format identifier in
conversion to be used later when creating VkImageView.

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_formats.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 500ba5a1e09..1d3b1f67928 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -1150,6 +1150,17 @@ VkResult anv_CreateSamplerYcbcrConversion(
ANV_FROM_HANDLE(anv_device, device, _device);
struct anv_ycbcr_conversion *conversion;
 
+   struct anv_format *ext_format = NULL;
+#ifdef ANDROID
+   /* Search for VkExternalFormatANDROID here and resolve the format. */
+   const struct VkExternalFormatANDROID *ext_info =
+  vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_FORMAT_ANDROID);
+
+   uint64_t format = ext_info ? ext_info->externalFormat : 0;
+   if (format)
+  ext_format = (struct anv_format *) (uintptr_t) format;
+#endif
+
assert(pCreateInfo->sType == 
VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO);
 
conversion = vk_alloc2(>alloc, pAllocator, sizeof(*conversion), 8,
@@ -1170,6 +1181,10 @@ VkResult anv_CreateSamplerYcbcrConversion(
conversion->chroma_offsets[1] = pCreateInfo->yChromaOffset;
conversion->chroma_filter = pCreateInfo->chromaFilter;
 
+   /* Setup external format. */
+   if (ext_format)
+  conversion->format = ext_format;
+
bool has_chroma_subsampled = false;
for (uint32_t p = 0; p < conversion->format->n_planes; p++) {
   if (conversion->format->planes[p].has_chroma &&
-- 
2.17.2

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


[Mesa-dev] [PATCH 13/15] anv: support VkSamplerYcbcrConversionInfo in vkCreateImageView

2018-10-29 Thread Tapani Pälli
If a conversion struct was passed, then we resolve the format from
conversion structure.

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_image.c | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 26b5389f6d9..cca43f6e6a0 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -1379,6 +1379,18 @@ anv_CreateImageView(VkDevice _device,
assert(range->layerCount > 0);
assert(range->baseMipLevel < image->levels);
 
+   struct anv_format *ext_format = NULL;
+#ifdef ANDROID
+   /* Search for VkExternalFormatANDROID and set the format. */
+   const struct VkSamplerYcbcrConversionInfo *ext_info =
+  vk_find_struct_const(pCreateInfo->pNext, SAMPLER_YCBCR_CONVERSION_INFO);
+
+   if (ext_info) {
+  ANV_FROM_HANDLE(anv_ycbcr_conversion, conversion, ext_info->conversion);
+  ext_format = conversion->format;
+   }
+#endif
+
const VkImageViewUsageCreateInfo *usage_info =
   vk_find_struct_const(pCreateInfo, IMAGE_VIEW_USAGE_CREATE_INFO);
VkImageUsageFlags view_usage = usage_info ? usage_info->usage : 
image->usage;
@@ -1423,6 +1435,10 @@ anv_CreateImageView(VkDevice _device,
iview->n_planes = anv_image_aspect_get_planes(iview->aspect_mask);
iview->vk_format = pCreateInfo->format;
 
+   /* External format - resolve vk_format from external format. */
+   if (ext_format)
+  iview->vk_format = anv_get_vkformat(ext_format);
+
iview->extent = (VkExtent3D) {
   .width  = anv_minify(image->extent.width , range->baseMipLevel),
   .height = anv_minify(image->extent.height, range->baseMipLevel),
@@ -1439,7 +1455,7 @@ anv_CreateImageView(VkDevice _device,
   VkImageAspectFlags vplane_aspect =
  anv_plane_to_aspect(iview->aspect_mask, vplane);
   struct anv_format_plane format =
- anv_get_format_plane(>info, pCreateInfo->format,
+ anv_get_format_plane(>info, iview->vk_format,
   vplane_aspect, image->tiling);
 
   iview->planes[vplane].image_plane = iplane;
-- 
2.17.2

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


[Mesa-dev] [PATCH 14/15] anv: ignore VkSamplerYcbcrConversion on non-yuv formats

2018-10-29 Thread Tapani Pälli
This fulfills a requirement for clients that want to utilize same
code path for images with external formats (VK_FORMAT_UNDEFINED) and
"regular" RGBA images where format is known. This is similar to how
OES_EGL_image_external works.

To support this, we allow color conversion samplers for non-YUV
formats but skip setting up conversion when format does not have
can_ycbcr flag set.

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/genX_state.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/genX_state.c b/src/intel/vulkan/genX_state.c
index 42800a2581e..9b579d3118c 100644
--- a/src/intel/vulkan/genX_state.c
+++ b/src/intel/vulkan/genX_state.c
@@ -337,8 +337,11 @@ VkResult genX(CreateSampler)(
  if (conversion == NULL)
 break;
 
- sampler->n_planes = conversion->format->n_planes;
- sampler->conversion = conversion;
+ /* Setup conversion only if format is YUV format. */
+ if (conversion && conversion->format->can_ycbcr) {
+sampler->n_planes = conversion->format->n_planes;
+sampler->conversion = conversion;
+ }
  break;
   }
 #if GEN_GEN >= 9
-- 
2.17.2

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


[Mesa-dev] [PATCH 08/15] anv/android: support import/export of AHardwareBuffer objects

2018-10-29 Thread Tapani Pälli
v2: add support for non-image buffers (AHARDWAREBUFFER_FORMAT_BLOB)
v3: properly handle usage bits when creating from image
v4: refactor, code cleanup (Jason)

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_android.c | 128 +
 src/intel/vulkan/anv_device.c  |  47 +++-
 src/intel/vulkan/anv_private.h |  18 +
 3 files changed, 191 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c
index d0a20dd85c5..42fa050af93 100644
--- a/src/intel/vulkan/anv_android.c
+++ b/src/intel/vulkan/anv_android.c
@@ -232,6 +232,134 @@ anv_ahw_usage_from_vk_usage(const VkImageCreateFlags 
vk_create,
return ahw_usage;
 }
 
+VkResult
+anv_GetMemoryAndroidHardwareBufferANDROID(
+   VkDevice device_h,
+   const VkMemoryGetAndroidHardwareBufferInfoANDROID *pInfo,
+   struct AHardwareBuffer **pBuffer)
+{
+   ANV_FROM_HANDLE(anv_device_memory, mem, pInfo->memory);
+
+   /* Some quotes from Vulkan spec:
+*
+* "If the device memory was created by importing an Android hardware
+* buffer, vkGetMemoryAndroidHardwareBufferANDROID must return that same
+* Android hardware buffer object."
+*
+* "VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID must
+* have been included in VkExportMemoryAllocateInfoKHR::handleTypes when
+* memory was created."
+*/
+   if (mem->ahw) {
+  *pBuffer = mem->ahw;
+  /* Increase refcount. */
+  AHardwareBuffer_acquire(mem->ahw);
+  return VK_SUCCESS;
+   }
+
+   return VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR;
+}
+
+/*
+ * Called from anv_AllocateMemory when import AHardwareBuffer.
+ */
+VkResult
+anv_import_ahw_memory(VkDevice device_h,
+  struct anv_device_memory *mem,
+  const VkImportAndroidHardwareBufferInfoANDROID *info)
+{
+   ANV_FROM_HANDLE(anv_device, device, device_h);
+
+   /* Get a description of buffer contents. */
+   AHardwareBuffer_Desc desc;
+   AHardwareBuffer_describe(info->buffer, );
+   VkResult result = VK_SUCCESS;
+
+   /* Import from AHardwareBuffer to anv_device_memory. */
+   const native_handle_t *handle =
+  AHardwareBuffer_getNativeHandle(info->buffer);
+
+   int dma_buf = (handle && handle->numFds) ? handle->data[0] : -1;
+   if (dma_buf < 0)
+  return VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR;
+
+   uint64_t bo_flags = 0;
+   if (device->instance->physicalDevice.supports_48bit_addresses)
+  bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+   if (device->instance->physicalDevice.use_softpin)
+  bo_flags |= EXEC_OBJECT_PINNED;
+
+   result = anv_bo_cache_import(device, >bo_cache,
+dma_buf, bo_flags, >bo);
+   if (result != VK_SUCCESS)
+  return result;
+
+   /* "If the vkAllocateMemory command succeeds, the implementation must
+* acquire a reference to the imported hardware buffer, which it must
+* release when the device memory object is freed. If the command fails,
+* the implementation must not retain a reference."
+*/
+   AHardwareBuffer_acquire(info->buffer);
+   mem->ahw = info->buffer;
+
+   return result;
+}
+
+VkResult
+anv_create_ahw_memory(VkDevice device_h,
+  struct anv_device_memory *mem,
+  const VkMemoryAllocateInfo *pAllocateInfo)
+{
+   ANV_FROM_HANDLE(anv_device, dev, device_h);
+
+   const VkMemoryDedicatedAllocateInfo *dedicated_info =
+  vk_find_struct_const(pAllocateInfo->pNext,
+   MEMORY_DEDICATED_ALLOCATE_INFO);
+
+   uint32_t w = 0;
+   uint32_t h = 1;
+   uint32_t layers = 1;
+   uint32_t format = 0;
+   uint64_t usage = 0;
+
+   /* If caller passed dedicated information. */
+   if (dedicated_info && dedicated_info->image) {
+  ANV_FROM_HANDLE(anv_image, image, dedicated_info->image);
+  w = image->extent.width;
+  h = image->extent.height;
+  layers = image->array_size;
+  format = android_format_from_vk(image->vk_format);
+  usage = anv_ahw_usage_from_vk_usage(image->create_flags, image->usage);
+   } else if (dedicated_info && dedicated_info->buffer) {
+  ANV_FROM_HANDLE(anv_buffer, buffer, dedicated_info->buffer);
+  w = buffer->size;
+  format = AHARDWAREBUFFER_FORMAT_BLOB;
+  usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN |
+  AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN;
+   } else {
+  w = pAllocateInfo->allocationSize;
+  format = AHARDWAREBUFFER_FORMAT_BLOB;
+  usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN |
+  AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN;
+   }
+
+   struct AHardwareBuffer *ahw = NULL;
+   struct AHardwareBuffer_Desc desc = {
+  .width = w,
+  .height = h,
+  .layers = layers,
+  .format = format,
+  .usage = usage,
+};
+
+   if (AHardwareBuffer_allocate(, ) != 0)
+  return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+   mem->ahw = ahw;
+
+   return VK_SUCCESS;
+}
+
 VkResult
 anv_image_from_gralloc(VkDevice device_h,

[Mesa-dev] [PATCH 12/15] anv: introduce helper to resolve vk_format from anv_format

2018-10-29 Thread Tapani Pälli
Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_formats.c | 18 ++
 src/intel/vulkan/anv_private.h |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 1d3b1f67928..166b50f5a07 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -405,6 +405,24 @@ anv_get_format(VkFormat vk_format)
return format;
 }
 
+VkFormat
+anv_get_vkformat(const struct anv_format *format)
+{
+#define LAST_FORMAT(table) table + sizeof(table) - sizeof(struct anv_format)
+
+   const struct anv_format *last_main = LAST_FORMAT(main_formats);
+   const struct anv_format *last_ycbcr = LAST_FORMAT(ycbcr_formats);
+
+#undef LAST_FORMAT
+
+   if (format >= main_formats && format <= last_main)
+  return format - main_formats;
+   else if (format >= ycbcr_formats && format <= last_ycbcr)
+  return format - ycbcr_formats;
+
+   return VK_FORMAT_UNDEFINED;
+}
+
 /**
  * Exactly one bit must be set in \a aspect.
  */
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 882de030ae0..bfdb711337e 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -2634,6 +2634,9 @@ anv_plane_to_aspect(VkImageAspectFlags image_aspects,
 const struct anv_format *
 anv_get_format(VkFormat format);
 
+VkFormat
+anv_get_vkformat(const struct anv_format *format);
+
 static inline uint32_t
 anv_get_format_planes(VkFormat vk_format)
 {
-- 
2.17.2

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


[Mesa-dev] [PATCH 09/15] anv/android: add ahardwarebuffer external memory properties

2018-10-29 Thread Tapani Pälli
v2: have separate memory properties for android, set usage
flags for buffers correctly

v3: code cleanup (Jason)
+ limit maxArrayLayers to 1 for AHardwareBuffer based images

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_formats.c | 46 ++
 1 file changed, 46 insertions(+)

diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 12c080c7c33..500ba5a1e09 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -948,6 +948,26 @@ static const VkExternalMemoryProperties prime_fd_props = {
   VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
 };
 
+static const VkExternalMemoryProperties android_buffer_props = {
+   .externalMemoryFeatures = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT |
+ VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT,
+   .exportFromImportedHandleTypes =
+  VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID,
+   .compatibleHandleTypes =
+  VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID,
+};
+
+
+static const VkExternalMemoryProperties android_image_props = {
+   .externalMemoryFeatures = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT |
+ VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT |
+ VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT,
+   .exportFromImportedHandleTypes =
+  VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID,
+   .compatibleHandleTypes =
+  VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID,
+};
+
 VkResult anv_GetPhysicalDeviceImageFormatProperties2(
 VkPhysicalDevicephysicalDevice,
 const VkPhysicalDeviceImageFormatInfo2* base_info,
@@ -957,8 +977,12 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties2(
const VkPhysicalDeviceExternalImageFormatInfo *external_info = NULL;
VkExternalImageFormatPropertiesKHR *external_props = NULL;
VkSamplerYcbcrConversionImageFormatProperties *ycbcr_props = NULL;
+   struct VkAndroidHardwareBufferUsageANDROID *android_usage = NULL;
VkResult result;
 
+   /* Only used on Android environment. */
+   (void) android_usage;
+
/* Extract input structs */
vk_foreach_struct_const(s, base_info->pNext) {
   switch (s->sType) {
@@ -980,6 +1004,9 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties2(
   case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES:
  ycbcr_props = (void *) s;
  break;
+  case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID:
+ android_usage = (void *) s;
+ break;
   default:
  anv_debug_ignored_stype(s->sType);
  break;
@@ -991,6 +1018,17 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties2(
if (result != VK_SUCCESS)
   goto fail;
 
+#ifdef ANDROID
+   if (android_usage) {
+  android_usage->androidHardwareBufferUsage =
+ anv_ahw_usage_from_vk_usage(base_info->flags,
+ base_info->usage);
+
+  /* Limit maxArrayLayers to 1 for AHardwareBuffer based images for now. */
+  base_props->imageFormatProperties.maxArrayLayers = 1;
+   }
+#endif
+
/* From the Vulkan 1.0.42 spec:
 *
 *If handleType is 0, vkGetPhysicalDeviceImageFormatProperties2 will
@@ -1004,6 +1042,10 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties2(
  if (external_props)
 external_props->externalMemoryProperties = prime_fd_props;
  break;
+  case VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID:
+ if (external_props)
+external_props->externalMemoryProperties = android_image_props;
+ break;
   default:
  /* From the Vulkan 1.0.42 spec:
   *
@@ -1086,6 +1128,10 @@ void anv_GetPhysicalDeviceExternalBufferProperties(
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
   pExternalBufferProperties->externalMemoryProperties = prime_fd_props;
   return;
+   case VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID:
+  pExternalBufferProperties->externalMemoryProperties =
+ android_buffer_props;
+  return;
default:
   goto unsupported;
}
-- 
2.17.2

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


[Mesa-dev] [PATCH 05/15] anv/android: add GetAndroidHardwareBufferPropertiesANDROID

2018-10-29 Thread Tapani Pälli
Use the anv_format address in formats table as implementation-defined
external format identifier for now. When adding YUV format support this
might need to change.

v2: code cleanup (Jason)
v3: set anv_format address as identifier

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_android.c | 105 +
 1 file changed, 105 insertions(+)

diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c
index 46c41d57861..67e9adee73e 100644
--- a/src/intel/vulkan/anv_android.c
+++ b/src/intel/vulkan/anv_android.c
@@ -29,6 +29,8 @@
 #include 
 
 #include "anv_private.h"
+#include "vk_format_info.h"
+#include "vk_util.h"
 
 static int anv_hal_open(const struct hw_module_t* mod, const char* id, struct 
hw_device_t** dev);
 static int anv_hal_close(struct hw_device_t *dev);
@@ -96,6 +98,109 @@ anv_hal_close(struct hw_device_t *dev)
return -1;
 }
 
+static VkResult
+get_ahw_buffer_format_properties(
+   VkDevice device_h,
+   const struct AHardwareBuffer *buffer,
+   VkAndroidHardwareBufferFormatPropertiesANDROID *pProperties)
+{
+   ANV_FROM_HANDLE(anv_device, device, device_h);
+
+   /* Get a description of buffer contents . */
+   AHardwareBuffer_Desc desc;
+   AHardwareBuffer_describe(buffer, );
+
+   /* Verify description. */
+   uint64_t gpu_usage =
+  AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE |
+  AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT |
+  AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER;
+
+   /* "Buffer must be a valid Android hardware buffer object with at least
+* one of the AHARDWAREBUFFER_USAGE_GPU_* usage flags."
+*/
+   if (!(desc.usage & (gpu_usage)))
+  return VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR;
+
+   /* Fill properties fields based on description. */
+   VkAndroidHardwareBufferFormatPropertiesANDROID *p = pProperties;
+
+   p->format = vk_format_from_android(desc.format);
+
+   const struct anv_format *anv_format = anv_get_format(p->format);
+   p->externalFormat = (uint64_t) (uintptr_t) anv_format;
+
+   p->formatFeatures =
+  anv_get_image_format_features(>info, p->format,
+anv_format, VK_IMAGE_TILING_OPTIMAL);
+
+   /* "Images can be created with an external format even if the Android 
hardware
+*  buffer has a format which has an equivalent Vulkan format to enable
+*  consistent handling of images from sources that might use either 
category
+*  of format. However, all images created with an external format are 
subject
+*  to the valid usage requirements associated with external formats, even 
if
+*  the Android hardware buffer’s format has a Vulkan equivalent."
+*
+* "The formatFeatures member *must* include
+*  VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT and at least one of
+*  VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT or
+*  VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT"
+*/
+   p->formatFeatures |=
+  VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT;
+
+   /* "Implementations may not always be able to determine the color model,
+*  numerical range, or chroma offsets of the image contents, so the values
+*  in VkAndroidHardwareBufferFormatPropertiesANDROID are only suggestions.
+*  Applications should treat these values as sensible defaults to use in
+*  the absence of more reliable information obtained through some other
+*  means."
+*/
+   p->samplerYcbcrConversionComponents.r = VK_COMPONENT_SWIZZLE_IDENTITY;
+   p->samplerYcbcrConversionComponents.g = VK_COMPONENT_SWIZZLE_IDENTITY;
+   p->samplerYcbcrConversionComponents.b = VK_COMPONENT_SWIZZLE_IDENTITY;
+   p->samplerYcbcrConversionComponents.a = VK_COMPONENT_SWIZZLE_IDENTITY;
+
+   p->suggestedYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY;
+   p->suggestedYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL;
+   p->suggestedXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
+   p->suggestedYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
+
+   return VK_SUCCESS;
+}
+
+VkResult
+anv_GetAndroidHardwareBufferPropertiesANDROID(
+   VkDevice device_h,
+   const struct AHardwareBuffer *buffer,
+   VkAndroidHardwareBufferPropertiesANDROID *pProperties)
+{
+   ANV_FROM_HANDLE(anv_device, dev, device_h);
+   struct anv_physical_device *pdevice = >instance->physicalDevice;
+
+   VkAndroidHardwareBufferFormatPropertiesANDROID *format_prop =
+  vk_find_struct(pProperties->pNext,
+ ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID);
+
+   /* Fill format properties of an Android hardware buffer. */
+   if (format_prop)
+  get_ahw_buffer_format_properties(device_h, buffer, format_prop);
+
+   const native_handle_t *handle =
+  AHardwareBuffer_getNativeHandle(buffer);
+   int dma_buf = (handle && handle->numFds) ? handle->data[0] : -1;
+   if (dma_buf < 0)
+  return VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR;
+
+   /* All memory types. */
+   uint32_t memory_types = (1ull << pdevice->memory.type_count) - 1;
+
+   pProperties->allocationSize = 

[Mesa-dev] [PATCH 04/15] anv: add from/to helpers with android and vulkan formats

2018-10-29 Thread Tapani Pälli
v2: handle R8G8B8X8 as R8G8B8_UNORM (Jason)

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/vk_format_info.h | 43 +++
 1 file changed, 43 insertions(+)

diff --git a/src/intel/vulkan/vk_format_info.h 
b/src/intel/vulkan/vk_format_info.h
index a1cc6952c8f..2990e23c601 100644
--- a/src/intel/vulkan/vk_format_info.h
+++ b/src/intel/vulkan/vk_format_info.h
@@ -27,6 +27,49 @@
 #include 
 #include 
 
+#ifdef ANDROID
+#include 
+static inline VkFormat
+vk_format_from_android(unsigned android_format)
+{
+   switch (android_format) {
+   case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
+  return VK_FORMAT_R8G8B8A8_UNORM;
+   case AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM:
+   case AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM:
+  return VK_FORMAT_R8G8B8_UNORM;
+   case AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM:
+  return VK_FORMAT_R5G6B5_UNORM_PACK16;
+   case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
+  return VK_FORMAT_R16G16B16A16_SFLOAT;
+   case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
+  return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
+   case AHARDWAREBUFFER_FORMAT_BLOB:
+   default:
+  return VK_FORMAT_UNDEFINED;
+   }
+}
+
+static inline unsigned
+android_format_from_vk(unsigned vk_format)
+{
+   switch (vk_format) {
+   case VK_FORMAT_R8G8B8A8_UNORM:
+  return AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM;
+   case VK_FORMAT_R8G8B8_UNORM:
+  return AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM;
+   case VK_FORMAT_R5G6B5_UNORM_PACK16:
+  return AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM;
+   case VK_FORMAT_R16G16B16A16_SFLOAT:
+  return AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT;
+   case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
+  return AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM;
+   default:
+  return AHARDWAREBUFFER_FORMAT_BLOB;
+   }
+}
+#endif
+
 static inline VkImageAspectFlags
 vk_format_aspects(VkFormat format)
 {
-- 
2.17.2

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


[Mesa-dev] [PATCH 06/15] anv: add anv_ahw_usage_from_vk_usage helper function

2018-10-29 Thread Tapani Pälli
Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_android.c | 31 +++
 src/intel/vulkan/anv_private.h |  3 +++
 2 files changed, 34 insertions(+)

diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c
index 67e9adee73e..d0a20dd85c5 100644
--- a/src/intel/vulkan/anv_android.c
+++ b/src/intel/vulkan/anv_android.c
@@ -201,6 +201,37 @@ anv_GetAndroidHardwareBufferPropertiesANDROID(
return VK_SUCCESS;
 }
 
+/* Construct ahw usage mask from image usage bits, see
+ * 'AHardwareBuffer Usage Equivalence' in Vulkan spec.
+ */
+uint64_t
+anv_ahw_usage_from_vk_usage(const VkImageCreateFlags vk_create,
+const VkImageUsageFlags vk_usage)
+{
+   uint64_t ahw_usage = 0;
+
+   if (vk_usage & VK_IMAGE_USAGE_SAMPLED_BIT)
+  ahw_usage |= AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
+
+   if (vk_usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)
+  ahw_usage |= AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
+
+   if (vk_usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
+  ahw_usage |= AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT;
+
+   if (vk_create & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT)
+  ahw_usage |= AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP;
+
+   if (vk_create & VK_IMAGE_CREATE_PROTECTED_BIT)
+  ahw_usage |= AHARDWAREBUFFER_USAGE_PROTECTED_CONTENT;
+
+   /* No usage bits set - set at least one GPU usage. */
+   if (ahw_usage == 0)
+  ahw_usage = AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
+
+   return ahw_usage;
+}
+
 VkResult
 anv_image_from_gralloc(VkDevice device_h,
const VkImageCreateInfo *base_info,
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index f7c531f0f8f..bec3c457f68 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -3108,6 +3108,9 @@ VkResult anv_image_from_gralloc(VkDevice device_h,
 const VkNativeBufferANDROID *gralloc_info,
 const VkAllocationCallbacks *alloc,
 VkImage *pImage);
+uint64_t
+anv_ahw_usage_from_vk_usage(const VkImageCreateFlags vk_create,
+const VkImageUsageFlags vk_usage);
 #endif
 
 const struct anv_surface *
-- 
2.17.2

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


[Mesa-dev] [PATCH 07/15] anv: refactor, remove else block in AllocateMemory

2018-10-29 Thread Tapani Pälli
This makes it cleaner to introduce more cases where we import memory
from different types of external memory buffers.

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_device.c | 64 +++
 1 file changed, 34 insertions(+), 30 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index ee35e013329..383182312e2 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -2333,42 +2333,46 @@ VkResult anv_AllocateMemory(
* If the import fails, we leave the file descriptor open.
*/
   close(fd_info->fd);
-   } else {
-  const VkExportMemoryAllocateInfoKHR *fd_info =
- vk_find_struct_const(pAllocateInfo->pNext, 
EXPORT_MEMORY_ALLOCATE_INFO_KHR);
-  if (fd_info && fd_info->handleTypes)
- bo_flags |= ANV_BO_EXTERNAL;
-
-  result = anv_bo_cache_alloc(device, >bo_cache,
-  pAllocateInfo->allocationSize, bo_flags,
-  >bo);
-  if (result != VK_SUCCESS)
- goto fail;
+  goto success;
+   }
 
-  const VkMemoryDedicatedAllocateInfoKHR *dedicated_info =
- vk_find_struct_const(pAllocateInfo->pNext, 
MEMORY_DEDICATED_ALLOCATE_INFO_KHR);
-  if (dedicated_info && dedicated_info->image != VK_NULL_HANDLE) {
- ANV_FROM_HANDLE(anv_image, image, dedicated_info->image);
+   /* Regular allocate (not importing memory). */
 
- /* Some legacy (non-modifiers) consumers need the tiling to be set on
-  * the BO.  In this case, we have a dedicated allocation.
-  */
- if (image->needs_set_tiling) {
-const uint32_t i915_tiling =
-   isl_tiling_to_i915_tiling(image->planes[0].surface.isl.tiling);
-int ret = anv_gem_set_tiling(device, mem->bo->gem_handle,
- 
image->planes[0].surface.isl.row_pitch_B,
- i915_tiling);
-if (ret) {
-   anv_bo_cache_release(device, >bo_cache, mem->bo);
-   return vk_errorf(device->instance, NULL,
-VK_ERROR_OUT_OF_DEVICE_MEMORY,
-"failed to set BO tiling: %m");
-}
+   const VkExportMemoryAllocateInfoKHR *export_info =
+  vk_find_struct_const(pAllocateInfo->pNext, 
EXPORT_MEMORY_ALLOCATE_INFO_KHR);
+   if (export_info && export_info->handleTypes)
+  bo_flags |= ANV_BO_EXTERNAL;
+
+   result = anv_bo_cache_alloc(device, >bo_cache,
+   pAllocateInfo->allocationSize, bo_flags,
+   >bo);
+   if (result != VK_SUCCESS)
+  goto fail;
+
+   const VkMemoryDedicatedAllocateInfoKHR *dedicated_info =
+  vk_find_struct_const(pAllocateInfo->pNext, 
MEMORY_DEDICATED_ALLOCATE_INFO_KHR);
+   if (dedicated_info && dedicated_info->image != VK_NULL_HANDLE) {
+  ANV_FROM_HANDLE(anv_image, image, dedicated_info->image);
+
+  /* Some legacy (non-modifiers) consumers need the tiling to be set on
+   * the BO.  In this case, we have a dedicated allocation.
+   */
+  if (image->needs_set_tiling) {
+ const uint32_t i915_tiling =
+isl_tiling_to_i915_tiling(image->planes[0].surface.isl.tiling);
+ int ret = anv_gem_set_tiling(device, mem->bo->gem_handle,
+  image->planes[0].surface.isl.row_pitch_B,
+  i915_tiling);
+ if (ret) {
+anv_bo_cache_release(device, >bo_cache, mem->bo);
+return vk_errorf(device->instance, NULL,
+ VK_ERROR_OUT_OF_DEVICE_MEMORY,
+ "failed to set BO tiling: %m");
  }
   }
}
 
+ success:
*pMem = anv_device_memory_to_handle(mem);
 
return VK_SUCCESS;
-- 
2.17.2

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


[Mesa-dev] [PATCH 00/15] VK_ANDROID_external_memory_android_hardware_buffer

2018-10-29 Thread Tapani Pälli
Hi;

Here are fixes to earlier series with some refactoring, addressing 
Jason's comments and fixing some bugs I found when running Android CTS 
suite.

With these changes following android.graphics.cts.BasicVulkanGpuTest 
tests start to pass:

 testBasicBufferImportAndRenderingExternalFormat
 testBasicBufferImportAndRenderingExplicitFormat

for these formats:

 AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM
 AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM
 AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM
 AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM

Format AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM is skipped by CTS since it 
was recently removed from minigbm gralloc implementation due to other 
tests for this format not passing and apparently Android does not 
mandate this format for GPU usage.

Support for YUV format(s) is left for the future. This means that 
following test does not pass:

 android.graphics.cts.MediaVulkanGpuTest#testMediaImportAndRendering

Making it work will need some discussion with Media folks and adding 
support for HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL. I had already some 
look in to this but I'd like to work on that separately from this
series.

dEQP results (dEQP-VK.api.external.memory.android_hardware_buffer*):

 dEQP:   Passed:22/29 (75.9%)
 dEQP:   Failed:0/29 (0.0%)
 dEQP:   Not supported: 7/29 (24.1%)
 dEQP:   Warnings:  0/29 (0.0%)

Tree with these changes available here:
https://cgit.freedesktop.org/~tpalli/mesa/log/?h=ahw

And here is a Android Celadon compatible tree:
https://github.com/tpalli/external-mesa/tree/ahw-android

No regressions spotted by Intel CI. Any comments appreciated!

Tapani Pälli (15):
  anv: add create_flags as part of anv_image
  anv: refactor make_surface to use data from anv_image
  anv: make anv_get_image_format_features public
  anv: add from/to helpers with android and vulkan formats
  anv/android: add GetAndroidHardwareBufferPropertiesANDROID
  anv: add anv_ahw_usage_from_vk_usage helper function
  anv: refactor, remove else block in AllocateMemory
  anv/android: support import/export of AHardwareBuffer objects
  anv/android: add ahardwarebuffer external memory properties
  anv/android: support creating images from external format
  anv: support VkExternalFormatANDROID in vkCreateSamplerYcbcrConversion
  anv: introduce helper to resolve vk_format from anv_format
  anv: support VkSamplerYcbcrConversionInfo in vkCreateImageView
  anv: ignore VkSamplerYcbcrConversion on non-yuv formats
  anv/android: turn on
VK_ANDROID_external_memory_android_hardware_buffer

 src/intel/vulkan/anv_android.c | 303 +
 src/intel/vulkan/anv_device.c  | 109 ---
 src/intel/vulkan/anv_extensions.py |   1 +
 src/intel/vulkan/anv_formats.c | 101 --
 src/intel/vulkan/anv_image.c   | 205 +++
 src/intel/vulkan/anv_private.h |  45 +
 src/intel/vulkan/genX_state.c  |   7 +-
 src/intel/vulkan/vk_format_info.h  |  43 
 8 files changed, 731 insertions(+), 83 deletions(-)

-- 
2.17.2

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


[Mesa-dev] [PATCH 02/15] anv: refactor make_surface to use data from anv_image

2018-10-29 Thread Tapani Pälli
Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_image.c   | 78 ++
 src/intel/vulkan/anv_private.h |  5 +++
 2 files changed, 46 insertions(+), 37 deletions(-)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index c92e032a239..be467815b96 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -159,28 +159,26 @@ add_surface(struct anv_image *image, struct anv_surface 
*surf, uint32_t plane)
 
 static bool
 all_formats_ccs_e_compatible(const struct gen_device_info *devinfo,
- const struct VkImageCreateInfo *vk_info)
+ const VkImageFormatListCreateInfoKHR *fmt_list,
+ struct anv_image *image)
 {
enum isl_format format =
-  anv_get_isl_format(devinfo, vk_info->format,
- VK_IMAGE_ASPECT_COLOR_BIT, vk_info->tiling);
+  anv_get_isl_format(devinfo, image->vk_format,
+ VK_IMAGE_ASPECT_COLOR_BIT, image->tiling);
 
if (!isl_format_supports_ccs_e(devinfo, format))
   return false;
 
-   if (!(vk_info->flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT))
+   if (!(image->create_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT))
   return true;
 
-   const VkImageFormatListCreateInfoKHR *fmt_list =
-  vk_find_struct_const(vk_info->pNext, IMAGE_FORMAT_LIST_CREATE_INFO_KHR);
-
if (!fmt_list || fmt_list->viewFormatCount == 0)
   return false;
 
for (uint32_t i = 0; i < fmt_list->viewFormatCount; i++) {
   enum isl_format view_format =
  anv_get_isl_format(devinfo, fmt_list->pViewFormats[i],
-VK_IMAGE_ASPECT_COLOR_BIT, vk_info->tiling);
+VK_IMAGE_ASPECT_COLOR_BIT, image->tiling);
 
   if (!isl_formats_are_ccs_e_compatible(devinfo, format, view_format))
  return false;
@@ -300,11 +298,11 @@ add_aux_state_tracking_buffer(struct anv_image *image,
 static VkResult
 make_surface(const struct anv_device *dev,
  struct anv_image *image,
- const struct anv_image_create_info *anv_info,
+ uint32_t stride,
  isl_tiling_flags_t tiling_flags,
+ isl_surf_usage_flags_t isl_extra_usage_flags,
  VkImageAspectFlagBits aspect)
 {
-   const VkImageCreateInfo *vk_info = anv_info->vk_info;
bool ok;
 
static const enum isl_surf_dim vk_to_isl_surf_dim[] = {
@@ -313,8 +311,7 @@ make_surface(const struct anv_device *dev,
   [VK_IMAGE_TYPE_3D] = ISL_SURF_DIM_3D,
};
 
-   image->extent = anv_sanitize_image_extent(vk_info->imageType,
- vk_info->extent);
+   image->extent = anv_sanitize_image_extent(image->type, image->extent);
 
const unsigned plane = anv_image_aspect_to_plane(image->aspects, aspect);
const  struct anv_format_plane plane_format =
@@ -322,8 +319,8 @@ make_surface(const struct anv_device *dev,
struct anv_surface *anv_surf = >planes[plane].surface;
 
const isl_surf_usage_flags_t usage =
-  choose_isl_surf_usage(vk_info->flags, image->usage,
-anv_info->isl_extra_usage_flags, aspect);
+  choose_isl_surf_usage(image->create_flags, image->usage,
+isl_extra_usage_flags, aspect);
 
/* If an image is created as BLOCK_TEXEL_VIEW_COMPATIBLE, then we need to
 * fall back to linear on Broadwell and earlier because we aren't
@@ -333,24 +330,24 @@ make_surface(const struct anv_device *dev,
 */
bool needs_shadow = false;
if (dev->info.gen <= 8 &&
-   (vk_info->flags & VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT) &&
-   vk_info->tiling == VK_IMAGE_TILING_OPTIMAL) {
+   (image->create_flags & VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT) 
&&
+   image->tiling == VK_IMAGE_TILING_OPTIMAL) {
   assert(isl_format_is_compressed(plane_format.isl_format));
   tiling_flags = ISL_TILING_LINEAR_BIT;
   needs_shadow = true;
}
 
ok = isl_surf_init(>isl_dev, _surf->isl,
-  .dim = vk_to_isl_surf_dim[vk_info->imageType],
+  .dim = vk_to_isl_surf_dim[image->type],
   .format = plane_format.isl_format,
   .width = image->extent.width / plane_format.denominator_scales[0],
   .height = image->extent.height / plane_format.denominator_scales[1],
   .depth = image->extent.depth,
-  .levels = vk_info->mipLevels,
-  .array_len = vk_info->arrayLayers,
-  .samples = vk_info->samples,
+  .levels = image->levels,
+  .array_len = image->array_size,
+  .samples = image->samples,
   .min_alignment_B = 0,
-  .row_pitch_B = anv_info->stride,
+  .row_pitch_B = stride,
   .usage = usage,
   .tiling_flags = tiling_flags);
 
@@ -370,16 +367,16 @@ make_surface(const struct anv_device *dev,
   assert(tiling_flags == ISL_TILING_LINEAR_BIT);
 
   ok = isl_surf_init(>isl_dev, 
>planes[plane].shadow_surface.isl,
- .dim = 

[Mesa-dev] [PATCH 01/15] anv: add create_flags as part of anv_image

2018-10-29 Thread Tapani Pälli
This will make it possible for next patch to rip
anv_image_create_info out from make_surface function.

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_image.c   | 1 +
 src/intel/vulkan/anv_private.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index e89ce012be7..c92e032a239 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -591,6 +591,7 @@ anv_image_create(VkDevice _device,
image->array_size = pCreateInfo->arrayLayers;
image->samples = pCreateInfo->samples;
image->usage = pCreateInfo->usage;
+   image->create_flags = pCreateInfo->flags;
image->tiling = pCreateInfo->tiling;
image->disjoint = pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT;
image->needs_set_tiling = wsi_info && wsi_info->scanout;
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index d8a08d9d67f..e9abe6343b3 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -2689,6 +2689,7 @@ struct anv_image {
uint32_t samples; /**< VkImageCreateInfo::samples */
uint32_t n_planes;
VkImageUsageFlags usage; /**< Superset of VkImageCreateInfo::usage. */
+   VkImageCreateFlags create_flags; /* Flags used when creating image. */
VkImageTiling tiling; /** VkImageCreateInfo::tiling */
 
/** True if this is needs to be bound to an appropriately tiled BO.
-- 
2.17.2

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


[Mesa-dev] [PATCH 03/15] anv: make anv_get_image_format_features public

2018-10-29 Thread Tapani Pälli
This will be utilized later by GetAndroidHardwareBufferPropertiesANDROID.

Signed-off-by: Tapani Pälli 
---
 src/intel/vulkan/anv_formats.c | 22 +++---
 src/intel/vulkan/anv_private.h |  5 +
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 9199567f445..12c080c7c33 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -467,11 +467,11 @@ anv_get_format_plane(const struct gen_device_info 
*devinfo, VkFormat vk_format,
 
 // Format capabilities
 
-static VkFormatFeatureFlags
-get_image_format_features(const struct gen_device_info *devinfo,
-  VkFormat vk_format,
-  const struct anv_format *anv_format,
-  VkImageTiling vk_tiling)
+VkFormatFeatureFlags
+anv_get_image_format_features(const struct gen_device_info *devinfo,
+  VkFormat vk_format,
+  const struct anv_format *anv_format,
+  VkImageTiling vk_tiling)
 {
VkFormatFeatureFlags flags = 0;
 
@@ -718,11 +718,11 @@ void anv_GetPhysicalDeviceFormatProperties(
 
*pFormatProperties = (VkFormatProperties) {
   .linearTilingFeatures =
- get_image_format_features(devinfo, vk_format, anv_format,
-   VK_IMAGE_TILING_LINEAR),
+ anv_get_image_format_features(devinfo, vk_format, anv_format,
+   VK_IMAGE_TILING_LINEAR),
   .optimalTilingFeatures =
- get_image_format_features(devinfo, vk_format, anv_format,
-   VK_IMAGE_TILING_OPTIMAL),
+ anv_get_image_format_features(devinfo, vk_format, anv_format,
+   VK_IMAGE_TILING_OPTIMAL),
   .bufferFeatures =
  get_buffer_format_features(devinfo, vk_format, anv_format),
};
@@ -769,8 +769,8 @@ anv_get_image_format_properties(
if (format == NULL)
   goto unsupported;
 
-   format_feature_flags = get_image_format_features(devinfo, info->format,
-format, info->tiling);
+   format_feature_flags = anv_get_image_format_features(devinfo, info->format,
+format, info->tiling);
 
switch (info->type) {
default:
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index c88d14d6973..f7c531f0f8f 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -3149,6 +3149,11 @@ anv_sanitize_image_offset(const VkImageType imageType,
}
 }
 
+VkFormatFeatureFlags
+anv_get_image_format_features(const struct gen_device_info *devinfo,
+  VkFormat vk_format,
+  const struct anv_format *anv_format,
+  VkImageTiling vk_tiling);
 
 void anv_fill_buffer_surface_state(struct anv_device *device,
struct anv_state state,
-- 
2.17.2

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


[Mesa-dev] [PATCH 12/14] mesa/vbo: Move src/mesa/vbo/vbo_exec_array.c -> src/mesa/main/draw.c

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

The array type draw is no longer directly dependent on the vbo module.
Thus move array type draws into mesa/main/draw.c.
Rename symbols starting with vbo_* to _mesa_* and apply some
reindenting to make it consistent.

Signed-off-by: Mathias Fröhlich 
---
 src/mapi/glapi/gen/gl_genexec.py  |   4 +-
 src/mesa/Makefile.sources |   3 +-
 .../{vbo/vbo_exec_array.c => main/draw.c} | 487 +-
 src/mesa/main/draw.h  |  83 +++
 src/mesa/meson.build  |   3 +-
 src/mesa/vbo/vbo.h|  34 +-
 6 files changed, 334 insertions(+), 280 deletions(-)
 rename src/mesa/{vbo/vbo_exec_array.c => main/draw.c} (79%)
 create mode 100644 src/mesa/main/draw.h

diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py
index fc5b10a4b3..bd14bff4f2 100644
--- a/src/mapi/glapi/gen/gl_genexec.py
+++ b/src/mapi/glapi/gen/gl_genexec.py
@@ -71,6 +71,7 @@ header = """/**
 #include "main/depth.h"
 #include "main/debug_output.h"
 #include "main/dlist.h"
+#include "main/draw.h"
 #include "main/drawpix.h"
 #include "main/drawtex.h"
 #include "main/rastpos.h"
@@ -131,7 +132,6 @@ header = """/**
 #include "main/formatquery.h"
 #include "main/dispatch.h"
 #include "main/vdpau.h"
-#include "vbo/vbo.h"
 
 
 /**
@@ -152,7 +152,7 @@ _mesa_initialize_exec_table(struct gl_context *ctx)
 
assert(ctx->Version > 0);
 
-   vbo_initialize_exec_dispatch(ctx, exec);
+   _mesa_initialize_exec_dispatch(ctx, exec);
 """
 
 
diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
index 0d3c27711f..6ff7ee2e3b 100644
--- a/src/mesa/Makefile.sources
+++ b/src/mesa/Makefile.sources
@@ -66,6 +66,8 @@ MAIN_FILES = \
main/depth.h \
main/dlist.c \
main/dlist.h \
+   main/draw.c \
+   main/draw.h \
main/drawpix.c \
main/drawpix.h \
main/drawtex.c \
@@ -405,7 +407,6 @@ VBO_FILES = \
vbo/vbo_attrib_tmp.h \
vbo/vbo_context.c \
vbo/vbo_exec_api.c \
-   vbo/vbo_exec_array.c \
vbo/vbo_exec.c \
vbo/vbo_exec_draw.c \
vbo/vbo_exec_eval.c \
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/main/draw.c
similarity index 79%
rename from src/mesa/vbo/vbo_exec_array.c
rename to src/mesa/main/draw.c
index e55d99c84b..7729a860d0 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/main/draw.c
@@ -1,9 +1,9 @@
 /**
- * 
+ *
  * Copyright 2003 VMware, Inc.
  * Copyright 2009 VMware, Inc.
  * All Rights Reserved.
- * 
+ *
  * 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
@@ -11,11 +11,11 @@
  * distribute, sub license, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the
  * next paragraph) shall be included in all copies or 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 NON-INFRINGEMENT.
@@ -23,21 +23,22 @@
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
+ *
  **/
 
 #include 
-#include "main/arrayobj.h"
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/state.h"
-#include "main/draw_validate.h"
-#include "main/dispatch.h"
-#include "main/varray.h"
-#include "main/bufferobj.h"
-#include "main/enums.h"
-#include "main/macros.h"
-#include "main/transformfeedback.h"
+#include "arrayobj.h"
+#include "glheader.h"
+#include "context.h"
+#include "state.h"
+#include "draw.h"
+#include "draw_validate.h"
+#include "dispatch.h"
+#include "varray.h"
+#include "bufferobj.h"
+#include "enums.h"
+#include "macros.h"
+#include "transformfeedback.h"
 
 typedef struct {
GLuint count;
@@ -272,7 +273,7 @@ print_draw_arrays(struct gl_context *ctx,
 {
const struct gl_vertex_array_object *vao = ctx->Array.VAO;
 
-   printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
+   printf("_mesa_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
   mode, start, count);
 
unsigned i;
@@ -298,33 +299,33 @@ print_draw_arrays(struct gl_context *ctx,
  int offset = (int) (GLintptr)
 _mesa_vertex_attrib_address(array, binding);
 
-unsigned multiplier;
-switch (array->Type) {
-case GL_DOUBLE:
-case 

[Mesa-dev] [PATCH 05/14] vbo: Test for VBO_SAVE_PRIM_WEAK in _mesa_prim::mode is false.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

When setting the _mesa_prim::mode field we always filter out
all non OpenGL primitive mode bits. So this tested bit cannot be
there anymore and the test evaluates to zero.
The zero is removed with the next patch to ease review.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/vbo/vbo_save_loopback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c
index 36b1f71eb5..5d4d9c574e 100644
--- a/src/mesa/vbo/vbo_save_loopback.c
+++ b/src/mesa/vbo/vbo_save_loopback.c
@@ -227,7 +227,7 @@ _vbo_loopback_vertex_list(struct gl_context *ctx,
const struct _mesa_prim *prims = node->prims;
const GLuint prim_count = node->prim_count;
for (GLuint i = 0; i < prim_count; i++) {
-  if ((prims[i].mode & VBO_SAVE_PRIM_WEAK) && _mesa_inside_begin_end(ctx)) 
{
+  if ((0) && _mesa_inside_begin_end(ctx)) {
  loopback_weak_prim(ctx, [i]);
   } else {
  loopback_prim(ctx, buffer, [i], wrap_count, stride, la, nr);
-- 
2.17.2

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


[Mesa-dev] [PATCH 10/14] vbo: Preserve vbo_save::no_current_update on primitive restart.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

With this change we preserve the no_current_update property when we
observe a glPrimitiveRestart call. That means that we now also get the
no_current_update optimization for display lists that are made
out of indexed draws using primitive restart.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/vbo/vbo_save_api.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 896a8ac329..7a5cc18bac 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1277,10 +1277,11 @@ _save_PrimitiveRestartNV(void)
} else {
   /* get current primitive mode */
   GLenum curPrim = save->prims[save->prim_count - 1].mode;
+  bool no_current_update = save->no_current_update;
 
   /* restart primitive */
   CALL_End(GET_DISPATCH(), ());
-  vbo_save_NotifyBegin(ctx, curPrim, false);
+  vbo_save_NotifyBegin(ctx, curPrim, no_current_update);
}
 }
 
-- 
2.17.2

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


[Mesa-dev] [PATCH 11/14] vbo: Pull the _mesa_set_draw_vao calls out of the if clauses.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

These calls are just the same in each if branch. So pull that
before the if.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/vbo/vbo_exec_array.c | 114 --
 1 file changed, 38 insertions(+), 76 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 9335a246ea..e55d99c84b 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -547,14 +547,12 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei 
count)
 
FLUSH_FOR_DRAW(ctx);
 
-   if (_mesa_is_no_error_enabled(ctx)) {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
+   _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
 
+   if (_mesa_is_no_error_enabled(ctx)) {
   if (ctx->NewState)
  _mesa_update_state(ctx);
} else {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
-
   if (!_mesa_validate_DrawArrays(ctx, mode, count))
  return;
}
@@ -585,14 +583,12 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, 
GLsizei count,
 
FLUSH_FOR_DRAW(ctx);
 
-   if (_mesa_is_no_error_enabled(ctx)) {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
+   _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
 
+   if (_mesa_is_no_error_enabled(ctx)) {
   if (ctx->NewState)
  _mesa_update_state(ctx);
} else {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
-
   if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count,
   numInstances))
  return;
@@ -626,14 +622,12 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, 
GLint first,
 
FLUSH_FOR_DRAW(ctx);
 
-   if (_mesa_is_no_error_enabled(ctx)) {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
+   _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
 
+   if (_mesa_is_no_error_enabled(ctx)) {
   if (ctx->NewState)
  _mesa_update_state(ctx);
} else {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
-
   if (!_mesa_validate_DrawArraysInstanced(ctx, mode, first, count,
   numInstances))
  return;
@@ -666,14 +660,12 @@ vbo_exec_MultiDrawArrays(GLenum mode, const GLint *first,
 
FLUSH_FOR_DRAW(ctx);
 
-   if (_mesa_is_no_error_enabled(ctx)) {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
+   _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
 
+   if (_mesa_is_no_error_enabled(ctx)) {
   if (ctx->NewState)
  _mesa_update_state(ctx);
} else {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
-
   if (!_mesa_validate_MultiDrawArrays(ctx, mode, count, primcount))
  return;
}
@@ -888,14 +880,12 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, GLuint 
start, GLuint end,
 
FLUSH_FOR_DRAW(ctx);
 
-   if (_mesa_is_no_error_enabled(ctx)) {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
+   _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
 
+   if (_mesa_is_no_error_enabled(ctx)) {
   if (ctx->NewState)
  _mesa_update_state(ctx);
} else {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
-
   if (!_mesa_validate_DrawRangeElements(ctx, mode, start, end, count,
 type, indices))
  return;
@@ -999,14 +989,12 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum 
type,
 
FLUSH_FOR_DRAW(ctx);
 
-   if (_mesa_is_no_error_enabled(ctx)) {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
+   _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
 
+   if (_mesa_is_no_error_enabled(ctx)) {
   if (ctx->NewState)
  _mesa_update_state(ctx);
} else {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
-
   if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices))
  return;
}
@@ -1032,14 +1020,12 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei 
count, GLenum type,
 
FLUSH_FOR_DRAW(ctx);
 
-   if (_mesa_is_no_error_enabled(ctx)) {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
+   _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
 
+   if (_mesa_is_no_error_enabled(ctx)) {
   if (ctx->NewState)
  _mesa_update_state(ctx);
} else {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
-
   if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices))
  return;
}
@@ -1065,14 +1051,12 @@ vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei 
count, GLenum type,
 
FLUSH_FOR_DRAW(ctx);
 
-   if (_mesa_is_no_error_enabled(ctx)) {
-  _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
+   _mesa_set_draw_vao(ctx, ctx->Array.VAO, enabled_filter(ctx));
 
+   if 

[Mesa-dev] [PATCH 09/14] vbo: Make no_current_update an argument to vbo_save_NotifyBegin.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

Instead of coding additional information into the primitive
mode, make the only remaining flag there a direct argument to
vbo_save_NotifyBegin.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/main/dlist.c   |  2 +-
 src/mesa/vbo/vbo.h  |  3 ++-
 src/mesa/vbo/vbo_save.h |  1 -
 src/mesa/vbo/vbo_save_api.c | 14 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index ae23d29283..97461cede3 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -6094,7 +6094,7 @@ save_Begin(GLenum mode)
else {
   ctx->Driver.CurrentSavePrimitive = mode;
 
-  vbo_save_NotifyBegin(ctx, mode);
+  vbo_save_NotifyBegin(ctx, mode, false);
}
 }
 
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index ac0be5acf4..60b725468d 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -100,7 +100,8 @@ void
 vbo_save_SaveFlushVertices(struct gl_context *ctx);
 
 void
-vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode);
+vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode,
+ bool no_current_update);
 
 void
 vbo_save_NewList(struct gl_context *ctx, GLuint list, GLenum mode);
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 6f2cc5bad4..e8677b1ac5 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -137,7 +137,6 @@ _vbo_save_get_vertex_count(const struct 
vbo_save_vertex_list *node)
 #define VBO_SAVE_BUFFER_SIZE (256*1024) /* dwords */
 #define VBO_SAVE_PRIM_SIZE   128
 #define VBO_SAVE_PRIM_MODE_MASK 0x3f
-#define VBO_SAVE_PRIM_NO_CURRENT_UPDATE 0x80
 
 struct vbo_save_vertex_store {
struct gl_buffer_object *bufferobj;
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 28f8c46793..896a8ac329 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1193,7 +1193,8 @@ _save_CallLists(GLsizei n, GLenum type, const GLvoid * v)
  * Updating of ctx->Driver.CurrentSavePrimitive is already taken care of.
  */
 void
-vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode)
+vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode,
+ bool no_current_update)
 {
struct vbo_save_context *save = _context(ctx)->save;
const GLuint i = save->prim_count++;
@@ -1209,8 +1210,7 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode)
save->prims[i].base_instance = 0;
save->prims[i].is_indirect = 0;
 
-   save->no_current_update =
-  (mode & VBO_SAVE_PRIM_NO_CURRENT_UPDATE) ? 1 : 0;
+   save->no_current_update = no_current_update;
 
if (save->out_of_memory) {
   _mesa_install_save_vtxfmt(ctx, >vtxfmt_noop);
@@ -1280,7 +1280,7 @@ _save_PrimitiveRestartNV(void)
 
   /* restart primitive */
   CALL_End(GET_DISPATCH(), ());
-  vbo_save_NotifyBegin(ctx, curPrim);
+  vbo_save_NotifyBegin(ctx, curPrim, false);
}
 }
 
@@ -1294,7 +1294,7 @@ static void GLAPIENTRY
 _save_OBE_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
 {
GET_CURRENT_CONTEXT(ctx);
-   vbo_save_NotifyBegin(ctx, GL_QUADS);
+   vbo_save_NotifyBegin(ctx, GL_QUADS, true);
CALL_Vertex2f(GET_DISPATCH(), (x1, y1));
CALL_Vertex2f(GET_DISPATCH(), (x2, y1));
CALL_Vertex2f(GET_DISPATCH(), (x2, y2));
@@ -1327,7 +1327,7 @@ _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei 
count)
 
_ae_map_vbos(ctx);
 
-   vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_NO_CURRENT_UPDATE));
+   vbo_save_NotifyBegin(ctx, mode, true);
 
for (i = 0; i < count; i++)
   CALL_ArrayElement(GET_DISPATCH(), (start + i));
@@ -1410,7 +1410,7 @@ _save_OBE_DrawElementsBaseVertex(GLenum mode, GLsizei 
count, GLenum type,
   indices =
  ADD_POINTERS(indexbuf->Mappings[MAP_INTERNAL].Pointer, indices);
 
-   vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_NO_CURRENT_UPDATE));
+   vbo_save_NotifyBegin(ctx, mode, true);
 
switch (type) {
case GL_UNSIGNED_BYTE:
-- 
2.17.2

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


[Mesa-dev] [PATCH 14/14] mesa: Collect all the draw functions in draw.{h, c}.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

Some of these functions were distributed across different
implementation and header files. Put them at a central place.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/drivers/common/meta.c |  1 +
 src/mesa/main/draw.c   | 43 ++
 src/mesa/main/draw.h   | 65 ++
 src/mesa/main/varray.c | 43 --
 src/mesa/main/varray.h | 53 ---
 5 files changed, 109 insertions(+), 96 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 056a181c17..4392c4bbd8 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -42,6 +42,7 @@
 #include "main/buffers.h"
 #include "main/clear.h"
 #include "main/condrender.h"
+#include "main/draw.h"
 #include "main/depth.h"
 #include "main/enable.h"
 #include "main/fbobject.h"
diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c
index 85a9eedbc3..cceadf2613 100644
--- a/src/mesa/main/draw.c
+++ b/src/mesa/main/draw.c
@@ -2146,6 +2146,49 @@ _mesa_DrawTransformFeedback(GLenum mode, GLuint name)
 }
 
 
+/* GL_IBM_multimode_draw_arrays */
+void GLAPIENTRY
+_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
+  const GLsizei * count,
+  GLsizei primcount, GLint modestride )
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLint i;
+
+   FLUSH_VERTICES(ctx, 0);
+
+   for ( i = 0 ; i < primcount ; i++ ) {
+  if ( count[i] > 0 ) {
+ GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));
+ CALL_DrawArrays(ctx->CurrentServerDispatch, ( m, first[i], count[i] 
));
+  }
+   }
+}
+
+
+/* GL_IBM_multimode_draw_arrays */
+void GLAPIENTRY
+_mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count,
+GLenum type, const GLvoid * const * indices,
+GLsizei primcount, GLint modestride )
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLint i;
+
+   FLUSH_VERTICES(ctx, 0);
+
+   /* XXX not sure about ARB_vertex_buffer_object handling here */
+
+   for ( i = 0 ; i < primcount ; i++ ) {
+  if ( count[i] > 0 ) {
+ GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));
+ CALL_DrawElements(ctx->CurrentServerDispatch, ( m, count[i], type,
+ indices[i] ));
+  }
+   }
+}
+
+
 /*
  * Helper function for _mesa_draw_indirect below that additionally takes a zero
  * initialized array of _mesa_prim scratch space memory as the last argument.
diff --git a/src/mesa/main/draw.h b/src/mesa/main/draw.h
index 57b3ec9e7d..76d54f4822 100644
--- a/src/mesa/main/draw.h
+++ b/src/mesa/main/draw.h
@@ -87,6 +87,71 @@ _mesa_draw_indirect(struct gl_context *ctx, GLuint mode,
 const struct _mesa_index_buffer *ib);
 
 
+void GLAPIENTRY
+_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
+
+
+void GLAPIENTRY
+_mesa_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
+  GLsizei primcount);
+
+
+void GLAPIENTRY
+_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
+   const GLvoid *indices);
+
+
+void GLAPIENTRY
+_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
+GLenum type, const GLvoid *indices);
+
+
+void GLAPIENTRY
+_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid *indices, GLint basevertex);
+
+
+void GLAPIENTRY
+_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
+  GLsizei count, GLenum type,
+  const GLvoid *indices,
+  GLint basevertex);
+
+
+void GLAPIENTRY
+_mesa_DrawTransformFeedback(GLenum mode, GLuint name);
+
+
+
+void GLAPIENTRY
+_mesa_MultiDrawArrays(GLenum mode, const GLint *first,
+  const GLsizei *count, GLsizei primcount);
+
+
+void GLAPIENTRY
+_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
+   const GLvoid **indices, GLsizei primcount);
+
+
+void GLAPIENTRY
+_mesa_MultiDrawElementsBaseVertex(GLenum mode,
+  const GLsizei *count, GLenum type,
+  const GLvoid **indices, GLsizei primcount,
+  const GLint *basevertex);
+
+
+void GLAPIENTRY
+_mesa_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first,
+ const GLsizei * count,
+ GLsizei primcount, GLint modestride);
+
+
+void GLAPIENTRY
+_mesa_MultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count,
+   GLenum type, const GLvoid * const * indices,
+   GLsizei primcount, GLint modestride);
+
+
 #ifdef 

[Mesa-dev] [PATCH 13/14] mesa/vbo: Move _vbo_draw_indirect -> _mesa_draw_indirect

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/drivers/common/driverfuncs.c |  4 +-
 src/mesa/main/draw.c  | 74 +++
 src/mesa/main/draw.h  | 11 
 src/mesa/vbo/vbo.h| 10 
 src/mesa/vbo/vbo_context.c| 74 ---
 5 files changed, 87 insertions(+), 86 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index e783262773..bdfac61f34 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -28,6 +28,7 @@
 #include "main/accum.h"
 #include "main/arrayobj.h"
 #include "main/context.h"
+#include "main/draw.h"
 #include "main/formatquery.h"
 #include "main/framebuffer.h"
 #include "main/mipmap.h"
@@ -55,7 +56,6 @@
 #include "tnl/tnl.h"
 #include "swrast/swrast.h"
 #include "swrast/s_renderbuffer.h"
-#include "vbo/vbo.h"
 
 #include "driverfuncs.h"
 #include "meta.h"
@@ -122,7 +122,7 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
 
/* Draw functions */
driver->Draw = NULL;
-   driver->DrawIndirect = _vbo_draw_indirect;
+   driver->DrawIndirect = _mesa_draw_indirect;
 
/* simple state commands */
driver->AlphaFunc = NULL;
diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c
index 7729a860d0..85a9eedbc3 100644
--- a/src/mesa/main/draw.c
+++ b/src/mesa/main/draw.c
@@ -29,6 +29,7 @@
 #include 
 #include "arrayobj.h"
 #include "glheader.h"
+#include "c99_alloca.h"
 #include "context.h"
 #include "state.h"
 #include "draw.h"
@@ -2143,3 +2144,76 @@ _mesa_DrawTransformFeedback(GLenum mode, GLuint name)
 {
_mesa_exec_DrawTransformFeedback(mode, name);
 }
+
+
+/*
+ * Helper function for _mesa_draw_indirect below that additionally takes a zero
+ * initialized array of _mesa_prim scratch space memory as the last argument.
+ */
+static void
+draw_indirect(struct gl_context *ctx, GLuint mode,
+  struct gl_buffer_object *indirect_data,
+  GLsizeiptr indirect_offset, unsigned draw_count,
+  unsigned stride,
+  struct gl_buffer_object *indirect_draw_count_buffer,
+  GLsizeiptr indirect_draw_count_offset,
+  const struct _mesa_index_buffer *ib,
+  struct _mesa_prim *prim)
+{
+   prim[0].begin = 1;
+   prim[draw_count - 1].end = 1;
+   for (unsigned i = 0; i < draw_count; ++i, indirect_offset += stride) {
+  prim[i].mode = mode;
+  prim[i].indexed = !!ib;
+  prim[i].indirect_offset = indirect_offset;
+  prim[i].is_indirect = 1;
+  prim[i].draw_id = i;
+   }
+
+   /* This should always be true at this time */
+   assert(indirect_data == ctx->DrawIndirectBuffer);
+
+   ctx->Driver.Draw(ctx, prim, draw_count, ib, false, 0u, ~0u,
+NULL, 0, indirect_data);
+}
+
+
+/*
+ * Function to be put into dd_function_table::DrawIndirect as fallback.
+ * Calls into dd_function_table::Draw past adapting call arguments.
+ * See dd_function_table::DrawIndirect for call argument documentation.
+ */
+void
+_mesa_draw_indirect(struct gl_context *ctx, GLuint mode,
+struct gl_buffer_object *indirect_data,
+GLsizeiptr indirect_offset, unsigned draw_count,
+unsigned stride,
+struct gl_buffer_object *indirect_draw_count_buffer,
+GLsizeiptr indirect_draw_count_offset,
+const struct _mesa_index_buffer *ib)
+{
+   /* Use alloca for the prim space if we are somehow in bounds. */
+   if (draw_count*sizeof(struct _mesa_prim) < 1024) {
+  struct _mesa_prim *space = alloca(draw_count*sizeof(struct _mesa_prim));
+  memset(space, 0, draw_count*sizeof(struct _mesa_prim));
+
+  draw_indirect(ctx, mode, indirect_data, indirect_offset, draw_count,
+stride, indirect_draw_count_buffer,
+indirect_draw_count_offset, ib, space);
+   } else {
+  struct _mesa_prim *space = calloc(draw_count, sizeof(struct _mesa_prim));
+  if (space == NULL) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "gl%sDraw%sIndirect%s",
+ (draw_count > 1) ? "Multi" : "",
+ ib ? "Elements" : "Arrays",
+ indirect_data ? "CountARB" : "");
+ return;
+  }
+
+  draw_indirect(ctx, mode, indirect_data, indirect_offset, draw_count,
+stride, indirect_draw_count_buffer,
+indirect_draw_count_offset, ib, space);
+
+  free(space);
+   }
+}
diff --git a/src/mesa/main/draw.h b/src/mesa/main/draw.h
index 0200af6797..57b3ec9e7d 100644
--- a/src/mesa/main/draw.h
+++ b/src/mesa/main/draw.h
@@ -76,6 +76,17 @@ void
 _mesa_initialize_exec_dispatch(const struct gl_context *ctx,
struct _glapi_table *exec);
 
+
+void
+_mesa_draw_indirect(struct gl_context *ctx, GLuint mode,
+struct 

[Mesa-dev] [PATCH 07/14] vbo: Remove the now unused VBO_SAVE_PRIM_WEAK define.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/vbo/vbo_save.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index d00700166e..65293c93f0 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -137,7 +137,6 @@ _vbo_save_get_vertex_count(const struct 
vbo_save_vertex_list *node)
 #define VBO_SAVE_BUFFER_SIZE (256*1024) /* dwords */
 #define VBO_SAVE_PRIM_SIZE   128
 #define VBO_SAVE_PRIM_MODE_MASK 0x3f
-#define VBO_SAVE_PRIM_WEAK  0x40
 #define VBO_SAVE_PRIM_NO_CURRENT_UPDATE 0x80
 
 struct vbo_save_vertex_store {
-- 
2.17.2

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


[Mesa-dev] [PATCH 02/14] vbo: Remove the VBO_SAFE_FALLBACK flag.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

On finishing a display list playback the VBO_SAFE_FALLBACK bit
is still kept in vbo_save_context::replay_flags. But examining
replay_flags and the display list flags that feed this value
the corresponding bit is never set these days anymore.
So, since it is nowhere set or checked, we can safely remove it.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/vbo/vbo_save.h | 2 --
 src/mesa/vbo/vbo_save_api.c | 8 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 37f883e9de..d00700166e 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -140,8 +140,6 @@ _vbo_save_get_vertex_count(const struct 
vbo_save_vertex_list *node)
 #define VBO_SAVE_PRIM_WEAK  0x40
 #define VBO_SAVE_PRIM_NO_CURRENT_UPDATE 0x80
 
-#define VBO_SAVE_FALLBACK0x1000
-
 struct vbo_save_vertex_store {
struct gl_buffer_object *bufferobj;
fi_type *buffer_map;
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index d5b43d0684..975ba46c8e 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1804,12 +1804,8 @@ vbo_save_EndCallList(struct gl_context *ctx)
 {
struct vbo_save_context *save = _context(ctx)->save;
 
-   if (ctx->ListState.CallDepth == 1) {
-  /* This is correct: want to keep only the VBO_SAVE_FALLBACK
-   * flag, if it is set:
-   */
-  save->replay_flags &= VBO_SAVE_FALLBACK;
-   }
+   if (ctx->ListState.CallDepth == 1)
+  save->replay_flags = 0;
 }
 
 
-- 
2.17.2

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


[Mesa-dev] [PATCH 06/14] vbo: Remove the always false branch dlist replay.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

The previous patch left a constant if (0) in the code.
Clean that up now.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/vbo/vbo_save_loopback.c | 30 +-
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c
index 5d4d9c574e..eeb4580c54 100644
--- a/src/mesa/vbo/vbo_save_loopback.c
+++ b/src/mesa/vbo/vbo_save_loopback.c
@@ -133,30 +133,6 @@ loopback_prim(struct gl_context *ctx,
 }
 
 
-/**
- * Primitives generated by DrawArrays/DrawElements/Rectf may be
- * caught here.  If there is no primitive in progress, execute them
- * normally, otherwise need to track and discard the generated
- * primitives.
- */
-static void
-loopback_weak_prim(struct gl_context *ctx,
-   const struct _mesa_prim *prim)
-{
-   /* Use the prim_weak flag to ensure that if this primitive
-* wraps, we don't mistake future vertex_lists for part of the
-* surrounding primitive.
-*
-* While this flag is set, we are simply disposing of data
-* generated by an operation now known to be a noop.
-*/
-   if (prim->begin)
-  ctx->Driver.CurrentExecPrimitive |= VBO_SAVE_PRIM_WEAK;
-   if (prim->end)
-  ctx->Driver.CurrentExecPrimitive &= ~VBO_SAVE_PRIM_WEAK;
-}
-
-
 static inline void
 append_attr(GLuint *nr, struct loopback_attr la[], int i, int shift,
 const struct gl_vertex_array_object *vao)
@@ -227,10 +203,6 @@ _vbo_loopback_vertex_list(struct gl_context *ctx,
const struct _mesa_prim *prims = node->prims;
const GLuint prim_count = node->prim_count;
for (GLuint i = 0; i < prim_count; i++) {
-  if ((0) && _mesa_inside_begin_end(ctx)) {
- loopback_weak_prim(ctx, [i]);
-  } else {
- loopback_prim(ctx, buffer, [i], wrap_count, stride, la, nr);
-  }
+  loopback_prim(ctx, buffer, [i], wrap_count, stride, la, nr);
}
 }
-- 
2.17.2

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


[Mesa-dev] [PATCH 04/14] vbo: Remove VBO_SAVE_PRIM_WEAK from vbo_save_NotifyBegin calls.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

Now looking at the implementation of vbo_save_NotifyBegin.
The VBO_SAVE_PRIM_WEAK flag, delivered in the primitive mode
argument to vbo_save_NotifyBegin, is not evaluated anymore.
The two users of the mode argument are the primitive mode
itself, where the VBO_SAVE_PRIM_WEAK bit is masked out to
retrieve the underlying OpenGL primitive mode. The other
user is to check for the VBO_SAVE_PRIM_NO_CURRENT_UPDATE bit
which is different from VBO_SAVE_PRIM_WEAK.
So, since vbo_save_NotifyBegin does not care about
VBO_SAVE_PRIM_WEAK, we can savely remove it from the call
arguments of vbo_save_NotifyBegin.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/vbo/vbo_save_api.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index f1c8d5e4b1..4cc315136c 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1296,7 +1296,7 @@ static void GLAPIENTRY
 _save_OBE_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
 {
GET_CURRENT_CONTEXT(ctx);
-   vbo_save_NotifyBegin(ctx, GL_QUADS | VBO_SAVE_PRIM_WEAK);
+   vbo_save_NotifyBegin(ctx, GL_QUADS);
CALL_Vertex2f(GET_DISPATCH(), (x1, y1));
CALL_Vertex2f(GET_DISPATCH(), (x2, y1));
CALL_Vertex2f(GET_DISPATCH(), (x2, y2));
@@ -1329,8 +1329,7 @@ _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei 
count)
 
_ae_map_vbos(ctx);
 
-   vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_WEAK
-  | VBO_SAVE_PRIM_NO_CURRENT_UPDATE));
+   vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_NO_CURRENT_UPDATE));
 
for (i = 0; i < count; i++)
   CALL_ArrayElement(GET_DISPATCH(), (start + i));
@@ -1413,8 +1412,7 @@ _save_OBE_DrawElementsBaseVertex(GLenum mode, GLsizei 
count, GLenum type,
   indices =
  ADD_POINTERS(indexbuf->Mappings[MAP_INTERNAL].Pointer, indices);
 
-   vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_WEAK |
-  VBO_SAVE_PRIM_NO_CURRENT_UPDATE));
+   vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_NO_CURRENT_UPDATE));
 
switch (type) {
case GL_UNSIGNED_BYTE:
-- 
2.17.2

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


[Mesa-dev] [PATCH 03/14] vbo: Remove set but not used weak field from _mesa_prim.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

The only reader of the weak field in _mesa_prim is pretty
console printing. By that, remove the weak field from _mesa_prim.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/state_tracker/st_cb_rasterpos.c | 1 -
 src/mesa/vbo/vbo.h   | 3 +--
 src/mesa/vbo/vbo_exec_api.c  | 1 -
 src/mesa/vbo/vbo_exec_array.c| 3 ---
 src/mesa/vbo/vbo_exec_draw.c | 3 +--
 src/mesa/vbo/vbo_save_api.c  | 7 +--
 6 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c 
b/src/mesa/state_tracker/st_cb_rasterpos.c
index 13cc9a7f32..fecaaf77da 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -206,7 +206,6 @@ new_draw_rastpos_stage(struct gl_context *ctx, struct 
draw_context *draw)
rs->prim.indexed = 0;
rs->prim.begin = 1;
rs->prim.end = 1;
-   rs->prim.weak = 0;
rs->prim.start = 0;
rs->prim.count = 1;
 
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 4e3f15999c..eccef1a3ff 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -46,10 +46,9 @@ struct _mesa_prim
GLuint indexed:1;
GLuint begin:1;
GLuint end:1;
-   GLuint weak:1;
GLuint no_current_update:1;
GLuint is_indirect:1;
-   GLuint pad:18;
+   GLuint pad:19;
 
GLuint start;
GLuint count;
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 20148acce3..24bd1f0ba1 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -793,7 +793,6 @@ vbo_exec_Begin(GLenum mode)
exec->vtx.prim[i].begin = 1;
exec->vtx.prim[i].end = 0;
exec->vtx.prim[i].indexed = 0;
-   exec->vtx.prim[i].weak = 0;
exec->vtx.prim[i].pad = 0;
exec->vtx.prim[i].start = exec->vtx.vert_count;
exec->vtx.prim[i].count = 0;
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 51c000e7bd..9335a246ea 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -811,7 +811,6 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, 
GLenum mode,
 
prim.begin = 1;
prim.end = 1;
-   prim.weak = 0;
prim.pad = 0;
prim.mode = mode;
prim.start = 0;
@@ -1285,7 +1284,6 @@ vbo_validated_multidrawelements(struct gl_context *ctx, 
GLenum mode,
   for (i = 0; i < primcount; i++) {
  prim[i].begin = (i == 0);
  prim[i].end = (i == primcount - 1);
- prim[i].weak = 0;
  prim[i].pad = 0;
  prim[i].mode = mode;
  prim[i].start =
@@ -1317,7 +1315,6 @@ vbo_validated_multidrawelements(struct gl_context *ctx, 
GLenum mode,
 
  prim[0].begin = 1;
  prim[0].end = 1;
- prim[0].weak = 0;
  prim[0].pad = 0;
  prim[0].mode = mode;
  prim[0].start = 0;
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 8d74725db3..dc6e8d3b8a 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -54,10 +54,9 @@ vbo_exec_debug_verts(struct vbo_exec_context *exec)
 
for (i = 0 ; i < exec->vtx.prim_count ; i++) {
   struct _mesa_prim *prim = >vtx.prim[i];
-  printf("   prim %d: %s%s %d..%d %s %s\n",
+  printf("   prim %d: %s %d..%d %s %s\n",
  i,
  _mesa_lookup_prim_by_nr(prim->mode),
- prim->weak ? " (weak)" : "",
  prim->start,
  prim->start + prim->count,
  prim->begin ? "BEGIN" : "(wrap)",
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 975ba46c8e..f1c8d5e4b1 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -720,7 +720,6 @@ wrap_buffers(struct gl_context *ctx)
struct vbo_save_context *save = _context(ctx)->save;
GLint i = save->prim_count - 1;
GLenum mode;
-   GLboolean weak;
GLboolean no_current_update;
 
assert(i < (GLint) save->prim_max);
@@ -730,7 +729,6 @@ wrap_buffers(struct gl_context *ctx)
 */
save->prims[i].count = (save->vert_count - save->prims[i].start);
mode = save->prims[i].mode;
-   weak = save->prims[i].weak;
no_current_update = save->prims[i].no_current_update;
 
/* store the copied vertices, and allocate a new list.
@@ -740,7 +738,6 @@ wrap_buffers(struct gl_context *ctx)
/* Restart interrupted primitive
 */
save->prims[0].mode = mode;
-   save->prims[0].weak = weak;
save->prims[0].no_current_update = no_current_update;
save->prims[0].begin = 0;
save->prims[0].end = 0;
@@ -1208,7 +1205,6 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode)
save->prims[i].mode = mode & VBO_SAVE_PRIM_MODE_MASK;
save->prims[i].begin = 1;
save->prims[i].end = 0;
-   save->prims[i].weak = (mode & VBO_SAVE_PRIM_WEAK) ? 1 : 0;
save->prims[i].no_current_update =
   (mode & VBO_SAVE_PRIM_NO_CURRENT_UPDATE) ? 1 : 0;
save->prims[i].pad = 0;
@@ -1844,10 +1840,9 @@ vbo_print_vertex_list(struct 

[Mesa-dev] [PATCH 08/14] vbo: Move no_current_update out of _mesa_prim.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

The _mesa_prim::no_current_update flag should tell the compiled
display list if the current attributes that are placed in the dlists
vbo shall take a defined state past replay of a display list.
Immediate mode draws compiled into display lists should set the
current values. Array draws may leave the current values in
undefined state.
So finally this flag is not a property of every primitive
but it is a property of the compiled display list and there it
is a property of the last primitive compiled into the list.
So move the flag out of _mesa_prim into vbo_save.

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/vbo/vbo.h  |  3 +--
 src/mesa/vbo/vbo_save.c |  2 ++
 src/mesa/vbo/vbo_save.h |  2 ++
 src/mesa/vbo/vbo_save_api.c | 10 --
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index eccef1a3ff..ac0be5acf4 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -46,9 +46,8 @@ struct _mesa_prim
GLuint indexed:1;
GLuint begin:1;
GLuint end:1;
-   GLuint no_current_update:1;
GLuint is_indirect:1;
-   GLuint pad:19;
+   GLuint pad:20;
 
GLuint start;
GLuint count;
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index 7e77123ba8..55b7792b85 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -47,6 +47,8 @@ void vbo_save_init( struct gl_context *ctx )
for (gl_vertex_processing_mode vpm = VP_MODE_FF; vpm < VP_MODE_MAX; ++vpm)
   save->VAO[vpm] = NULL;
 
+   save->no_current_update = false;
+
ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
 }
 
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 65293c93f0..6f2cc5bad4 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -173,6 +173,8 @@ struct vbo_save_context {
struct _mesa_prim *prims;
GLuint prim_count, prim_max;
 
+   bool no_current_update;
+
struct vbo_save_vertex_store *vertex_store;
struct vbo_save_primitive_store *prim_store;
 
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 4cc315136c..28f8c46793 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -602,7 +602,7 @@ compile_vertex_list(struct gl_context *ctx)
 
node->prim_store->refcount++;
 
-   if (node->prims[0].no_current_update) {
+   if (save->no_current_update) {
   node->current_data = NULL;
}
else {
@@ -720,7 +720,6 @@ wrap_buffers(struct gl_context *ctx)
struct vbo_save_context *save = _context(ctx)->save;
GLint i = save->prim_count - 1;
GLenum mode;
-   GLboolean no_current_update;
 
assert(i < (GLint) save->prim_max);
assert(i >= 0);
@@ -729,7 +728,6 @@ wrap_buffers(struct gl_context *ctx)
 */
save->prims[i].count = (save->vert_count - save->prims[i].start);
mode = save->prims[i].mode;
-   no_current_update = save->prims[i].no_current_update;
 
/* store the copied vertices, and allocate a new list.
 */
@@ -738,7 +736,6 @@ wrap_buffers(struct gl_context *ctx)
/* Restart interrupted primitive
 */
save->prims[0].mode = mode;
-   save->prims[0].no_current_update = no_current_update;
save->prims[0].begin = 0;
save->prims[0].end = 0;
save->prims[0].pad = 0;
@@ -1205,8 +1202,6 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode)
save->prims[i].mode = mode & VBO_SAVE_PRIM_MODE_MASK;
save->prims[i].begin = 1;
save->prims[i].end = 0;
-   save->prims[i].no_current_update =
-  (mode & VBO_SAVE_PRIM_NO_CURRENT_UPDATE) ? 1 : 0;
save->prims[i].pad = 0;
save->prims[i].start = save->vert_count;
save->prims[i].count = 0;
@@ -1214,6 +1209,9 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode)
save->prims[i].base_instance = 0;
save->prims[i].is_indirect = 0;
 
+   save->no_current_update =
+  (mode & VBO_SAVE_PRIM_NO_CURRENT_UPDATE) ? 1 : 0;
+
if (save->out_of_memory) {
   _mesa_install_save_vtxfmt(ctx, >vtxfmt_noop);
}
-- 
2.17.2

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


[Mesa-dev] [PATCH 01/14] vbo: Remove unused vbo_save_fallback function.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

Signed-off-by: Mathias Fröhlich 
---
 src/mesa/vbo/vbo_save.c | 15 ---
 src/mesa/vbo/vbo_save.h |  1 -
 2 files changed, 16 deletions(-)

diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index 73bc49a24b..7e77123ba8 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -71,18 +71,3 @@ void vbo_save_destroy( struct gl_context *ctx )
   save->vertex_store = NULL;
}
 }
-
-
-
-
-/* Note that this can occur during the playback of a display list:
- */
-void vbo_save_fallback( struct gl_context *ctx, GLboolean fallback )
-{
-   struct vbo_save_context *save = _context(ctx)->save;
-
-   if (fallback)
-  save->replay_flags |= VBO_SAVE_FALLBACK;
-   else
-  save->replay_flags &= ~VBO_SAVE_FALLBACK;
-}
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h
index 2a1922461d..37f883e9de 100644
--- a/src/mesa/vbo/vbo_save.h
+++ b/src/mesa/vbo/vbo_save.h
@@ -197,7 +197,6 @@ struct vbo_save_context {
 
 void vbo_save_init(struct gl_context *ctx);
 void vbo_save_destroy(struct gl_context *ctx);
-void vbo_save_fallback(struct gl_context *ctx, GLboolean fallback);
 
 /* save_loopback.c:
  */
-- 
2.17.2

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


[Mesa-dev] [PATCH 00/14] Various cleanups on display lists and draw code.

2018-10-29 Thread Mathias . Froehlich
From: Mathias Fröhlich 

Hi,

The series collects some of that cleanup opportunities that I found while
working on the vao changes from this spring.
There are two groups of changes. The first bunch removes unreachable
code paths from the dlist code and removes related functions and flags.
That is all done step by step with hopefully easy to review and provable
steps.
The second bunch of changes clean up and centralize draw related code that
is no longer someting vbo module specific.

The series went through intels CI system without failures.

Please review!
thanks and best

Mathias


Mathias Fröhlich (14):
  vbo: Remove unused vbo_save_fallback function.
  vbo: Remove the VBO_SAFE_FALLBACK flag.
  vbo: Remove set but not used weak field from _mesa_prim.
  vbo: Remove VBO_SAVE_PRIM_WEAK from vbo_save_NotifyBegin calls.
  vbo: Test for VBO_SAVE_PRIM_WEAK in _mesa_prim::mode is false.
  vbo: Remove the always false branch dlist replay.
  vbo: Remove the now unused VBO_SAVE_PRIM_WEAK define.
  vbo: Move no_current_update out of _mesa_prim.
  vbo: Make no_current_update an argument to vbo_save_NotifyBegin.
  vbo: Preserve vbo_save::no_current_update on primitive restart.
  vbo: Pull the _mesa_set_draw_vao calls out of the if clauses.
  mesa/vbo: Move src/mesa/vbo/vbo_exec_array.c -> src/mesa/main/draw.c
  mesa/vbo: Move _vbo_draw_indirect -> _mesa_draw_indirect
  mesa: Collect all the draw functions in draw.{h,c}.

 src/mapi/glapi/gen/gl_genexec.py  |   4 +-
 src/mesa/Makefile.sources |   3 +-
 src/mesa/drivers/common/driverfuncs.c |   4 +-
 src/mesa/drivers/common/meta.c|   1 +
 src/mesa/main/dlist.c |   2 +-
 .../{vbo/vbo_exec_array.c => main/draw.c} | 721 ++
 src/mesa/main/draw.h  | 159 
 src/mesa/main/varray.c|  43 --
 src/mesa/main/varray.h|  53 --
 src/mesa/meson.build  |   3 +-
 src/mesa/state_tracker/st_cb_rasterpos.c  |   1 -
 src/mesa/vbo/vbo.h|  49 +-
 src/mesa/vbo/vbo_context.c|  74 --
 src/mesa/vbo/vbo_exec_api.c   |   1 -
 src/mesa/vbo/vbo_exec_draw.c  |   3 +-
 src/mesa/vbo/vbo_save.c   |  17 +-
 src/mesa/vbo/vbo_save.h   |   7 +-
 src/mesa/vbo/vbo_save_api.c   |  38 +-
 src/mesa/vbo/vbo_save_loopback.c  |  30 +-
 19 files changed, 590 insertions(+), 623 deletions(-)
 rename src/mesa/{vbo/vbo_exec_array.c => main/draw.c} (73%)
 create mode 100644 src/mesa/main/draw.h

-- 
2.17.2

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


[Mesa-dev] [PATCH] i965: Respect GL_TEXTURE_SRGB_DECODE_EXT in GenerateMipmaps()

2018-10-29 Thread Kenneth Graunke
Apparently, we're supposed to look at the texture object's built-in
sampler object's sRGB decode setting in order to decide whether to
decode/downsample/re-encode, or simply downsample as-is.  Previously,
I had always done the decoding/encoding.

Fixes SKQP's Skia_Unit_Tests.SRGBMipMaps test.
---
 .../drivers/dri/i965/brw_generate_mipmap.c| 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_generate_mipmap.c 
b/src/mesa/drivers/dri/i965/brw_generate_mipmap.c
index 32c2933f721..4125ae6e11c 100644
--- a/src/mesa/drivers/dri/i965/brw_generate_mipmap.c
+++ b/src/mesa/drivers/dri/i965/brw_generate_mipmap.c
@@ -105,6 +105,23 @@ brw_generate_mipmap(struct gl_context *ctx, GLenum target,
   last_layer = base_size->array_len - 1;
}
 
+   /* The GL_EXT_texture_sRGB_decode extension's issues section says:
+*
+*"10) How is mipmap generation of sRGB textures affected by the
+* TEXTURE_SRGB_DECODE_EXT parameter?
+*
+* RESOLVED:  When the TEXTURE_SRGB_DECODE parameter is DECODE_EXT
+* for an sRGB texture, mipmap generation should decode sRGB texels
+* to a linear RGB color space, perform downsampling, then encode
+* back to an sRGB color space.  (Issue 24 in the EXT_texture_sRGB
+* specification provides a rationale for why.)  When the parameter
+* is SKIP_DECODE_EXT instead, mipmap generation skips the encode
+* and decode steps during mipmap generation.  By skipping the
+* encode and decode steps, sRGB mipmap generation should match
+* the mipmap generation for a non-sRGB texture."
+*/
+   bool do_srgb = tex_obj->Sampler.sRGBDecode == GL_DECODE_EXT;
+
for (unsigned dst_level = base_level + 1;
 dst_level <= last_level;
 dst_level++) {
@@ -121,7 +138,7 @@ brw_generate_mipmap(struct gl_context *ctx, GLenum target,
  minify(base_size->width, dst_level),
  minify(base_size->height, dst_level),
  GL_LINEAR, false, false,
- true, true);
+ do_srgb, do_srgb);
   }
}
 }
-- 
2.19.0

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


Re: [Mesa-dev] [Mesa-stable] [PATCH 1/1] util: Change remaining uint32 cache ids to sha1

2018-10-29 Thread Timothy Arceri

On 26/10/18 9:18 pm, Juan A. Suarez Romero wrote:

On Fri, 2018-10-26 at 14:52 +1100, Timothy Arceri wrote:

Pushed. Thanks again!

Ccing stable in case the Fixes tag isnt enough for this to get picked up
(since the previous cache fix this fixes was also backported)



Enqueued for 18.2. I didn't apply cleanly, so I've fixed the conflicts. You can
check the fixed commit here:


https://gitlab.freedesktop.org/mesa/mesa/commit/37ba112d0772cb21ccbf1dd9abcdd3eefe692db7


Seems ok as far as I can tell.




J.A.

On 24/10/18 11:51 am, David McFarland wrote:

After discussion with Timothy Arceri. disk_cache_get_function_identifier
was using only the first byte of the sha1 build-id.  Replace
disk_cache_get_function_identifier with implementation from
radv_get_build_id.  Instead of writing a uint32_t it now writes to a
mesa_sha1.  All drivers using disk_cache_get_function_identifier are
updated accordingly.

Reviewed-by: Timothy Arceri 
Fixes: 83ea8dd99bb1 ("util: add disk_cache_get_function_identifier()")
---
   src/amd/vulkan/radv_device.c | 22 +--
   src/gallium/drivers/nouveau/nouveau_screen.c | 29 -
   src/gallium/drivers/r600/r600_pipe_common.c  | 43 ++---
   src/gallium/drivers/radeonsi/si_pipe.c   | 64 ++--
   src/util/disk_cache.h| 16 +++--
   5 files changed, 81 insertions(+), 93 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index cf1132098d..81b558b91c 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -49,24 +49,6 @@
   #include "util/debug.h"
   #include "util/mesa-sha1.h"
   
-static bool

-radv_get_build_id(void *ptr, struct mesa_sha1 *ctx)
-{
-   uint32_t timestamp;
-
-#ifdef HAVE_DL_ITERATE_PHDR
-   const struct build_id_note *note = NULL;
-   if ((note = build_id_find_nhdr_for_addr(ptr))) {
-   _mesa_sha1_update(ctx, build_id_data(note), 
build_id_length(note));
-   } else
-#endif
-   if (disk_cache_get_function_timestamp(ptr, )) {
-   _mesa_sha1_update(ctx, , sizeof(timestamp));
-   } else
-   return false;
-   return true;
-}
-
   static int
   radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
   {
@@ -77,8 +59,8 @@ radv_device_get_cache_uuid(enum radeon_family family, void 
*uuid)
memset(uuid, 0, VK_UUID_SIZE);
_mesa_sha1_init();
   
-	if (!radv_get_build_id(radv_device_get_cache_uuid, ) ||

-   !radv_get_build_id(LLVMInitializeAMDGPUTargetInfo, ))
+   if (!disk_cache_get_function_identifier(radv_device_get_cache_uuid, 
) ||
+   !disk_cache_get_function_identifier(LLVMInitializeAMDGPUTargetInfo, 
))
return -1;
   
   	_mesa_sha1_update(, , sizeof(family));

diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c 
b/src/gallium/drivers/nouveau/nouveau_screen.c
index eb184d3559..d7898ed58f 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -148,20 +148,21 @@ nouveau_screen_bo_get_handle(struct pipe_screen *pscreen,
   static void
   nouveau_disk_cache_create(struct nouveau_screen *screen)
   {
-   uint32_t mesa_id;
-   char *mesa_id_str;
-   int res;
-
-   if (disk_cache_get_function_identifier(nouveau_disk_cache_create,
-  _id)) {
-  res = asprintf(_id_str, "%u", mesa_id);
-  if (res != -1) {
- screen->disk_shader_cache =
-disk_cache_create(nouveau_screen_get_name(>base),
-  mesa_id_str, 0);
- free(mesa_id_str);
-  }
-   }
+   struct mesa_sha1 ctx;
+   unsigned char sha1[20];
+   char cache_id[20 * 2 + 1];
+
+   _mesa_sha1_init();
+   if (!disk_cache_get_function_identifier(nouveau_disk_cache_create,
+   ))
+  return;
+
+   _mesa_sha1_final(, sha1);
+   disk_cache_format_hex_id(cache_id, sha1, 20 * 2);
+
+   screen->disk_shader_cache =
+  disk_cache_create(nouveau_screen_get_name(>base),
+cache_id, 0);
   }
   
   int

diff --git a/src/gallium/drivers/r600/r600_pipe_common.c 
b/src/gallium/drivers/r600/r600_pipe_common.c
index 6b581242a1..e7c645611d 100644
--- a/src/gallium/drivers/r600/r600_pipe_common.c
+++ b/src/gallium/drivers/r600/r600_pipe_common.c
@@ -854,27 +854,28 @@ static void r600_disk_cache_create(struct 
r600_common_screen *rscreen)
if (rscreen->debug_flags & DBG_ALL_SHADERS)
return;
   
-	uint32_t mesa_id;

-   if (disk_cache_get_function_identifier(r600_disk_cache_create,
-  _id)) {
-   char *mesa_id_str;
-   int res = -1;
-
-   res = asprintf(_id_str, "%u", mesa_id);
-   if (res != -1) {
-   /* These flags affect shader compilation. */
-   uint64_t shader_debug_flags =
-

Re: [Mesa-dev] [PATCH] glsl/linker: Fix out variables linking during single stage

2018-10-29 Thread Timothy Arceri

On 29/10/18 10:05 pm, Vadim Shovkoplias wrote:

Hi Timothy,

Thanks for the review. Piglit patch is updated with the additional out 
var: https://patchwork.freedesktop.org/patch/258899/
Original reporter confirmed that issue is finally fixed with the current 
patch and closed it.


Can I ask to push the patch please ?


I've pushed both. Thanks for the patches!



Regards,
Vadym

сб, 27 окт. 2018 г. в 1:21, Timothy Arceri >:


On Wed, Oct 24, 2018, at 3:28 AM, Vadym Shovkoplias wrote:
 > Since out variables are copied from shader objects instruction
 > streams to linked shader instruction steam it should be cloned
 > at first to keep source instruction steam unaltered.
 >
 > Fixes: 966a797e433 glsl/linker: Link all out vars from a shader
 > objects on a single stage
 > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105731
 > Signed-off-by: Vadym Shovkoplias
mailto:vadym.shovkopl...@globallogic.com>>

Reviewed-by: Timothy Arceri mailto:tarc...@itsqueeze.com>>

Also please either update the existing piglit or add a new one to
better cover the use of the freed vars. From the bug report it seems
adding another out var is enough to do it. Thanks.

 > ---
 >  src/compiler/glsl/linker.cpp | 3 ++-
 >  1 file changed, 2 insertions(+), 1 deletion(-)
 >
 > diff --git a/src/compiler/glsl/linker.cpp
b/src/compiler/glsl/linker.cpp
 > index 7db34ebf95..8b1b03322a 100644
 > --- a/src/compiler/glsl/linker.cpp
 > +++ b/src/compiler/glsl/linker.cpp
 > @@ -2269,10 +2269,11 @@ link_output_variables(struct
gl_linked_shader
 > *linked_shader,
 >           if (ir->ir_type != ir_type_variable)
 >              continue;
 >
 > -         ir_variable *const var = (ir_variable *) ir;
 > +         ir_variable *var = (ir_variable *) ir;
 >
 >           if (var->data.mode == ir_var_shader_out &&
 >                 !symbols->get_variable(var->name)) {
 > +            var = var->clone(linked_shader, NULL);
 >              symbols->add_variable(var);
 >              linked_shader->ir->push_head(var);
 >           }
 > --
 > 2.18.0
 >


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


[Mesa-dev] [ANNOUNCE] Mesa 18.2.4 release candidate

2018-10-29 Thread Juan A. Suarez Romero
Hello list,

The candidate for the Mesa 18.2.4 is now available. Currently we have:
 - 22 queued
 - 0 nominated (outstanding)
 - and 1 rejected patch

The current queue consists of:

Different fixes for different drivers: freedreno, radeonsi, swr, anv and radv.

Also there are fixes for ac, gallium, spirv and blorp.

Take a look at section "Mesa stable queue" for more information


Testing reports/general approval

Any testing reports (or general approval of the state of the branch) will be
greatly appreciated.

The plan is to have 18.2.4 this Wednesday (31th October), around or shortly 
after 17:00
GMT.

If you have any questions or suggestions - be that about the current patch queue
or otherwise, please go ahead.


Trivial merge conflicts
---
commit 37ba112d0772cb21ccbf1dd9abcdd3eefe692db7 (gitlab/jasuarez/18.2)
Author: David McFarland 

util: Change remaining uint32 cache ids to sha1

(cherry picked from commit 07a00a8729d709a4c43c828c64242c226607f09a)


commit 14d61206eb5fc3b73a9eec686dc8423fe266286a
Author: Jason Ekstrand 

blorp: Emit a dummy 3DSTATE_WM prior to 3DSTATE_WM_HZ_OP

(cherry picked from commit b6b2b27809b9ce1cb8fdeb63fb4244c8a584434e)


commit aaff8c7a0ed55d71e9dd0a6fef6905d6a2536c3f
Author: Nanley Chery 

intel/blorp: Define the clear value bounds for HiZ clears

(cherry picked from commit 5bcf479524b96554cab7d2429dacf650b4054638)


commit b8ddd70d04837ef24d5f0d3aff8a89f12d14f925
Author: Rob Clark 

freedreno: fix inorder rendering case

(cherry picked from commit 12de415ad1abb67863f6efb7394552a12b9e3b4b)


Cheers,
J.A.


Mesa stable queue
-

Nominated (0)
==

Queued (22)
===
Alex Smith (2):
  ac/nir: Use context-specific LLVM types
  anv: Fix sanitization of stencil state when the depth test is disabled

Alok Hota (2):
  swr/rast: ignore CreateElementUnorderedAtomicMemCpy
  swr/rast: fix intrinsic/function for LLVM 7 compatibility

Andres Rodriguez (1):
  radv: fix check for perftest options size

Bas Nieuwenhuizen (1):
  radv: Emit enqueued pipeline barriers on event write.

Connor Abbott (2):
  ac: Introduce ac_build_expand()
  ac: Fix loading a dvec3 from an SSBO

David McFarland (1):
  util: Change remaining uint32 cache ids to sha1

Dylan Baker (1):
  meson: don't require libelf for r600 without LLVM

Elie Tournier (1):
  gallium: Correctly handle no config context creation

Eric Engestrom (1):
  radv: s/abs/fabsf/ for floats

Jan Vesely (1):
  radeonsi: Bump number of allowed global buffers to 32

Jason Ekstrand (3):
  spirv: Use the right bit-size for spec constant ops
  blorp: Emit a dummy 3DSTATE_WM prior to 3DSTATE_WM_HZ_OP
  anv: Flag semaphore BOs as external

Liviu Prodea (1):
  scons: Put to rest zombie texture_float build option.

Marek Olšák (1):
  radeonsi: fix a VGT hang with primitive restart on Polaris10 and later

Michel Dänzer (1):
  loader/dri3: Also wait for front buffer fence if we triggered it

Nanley Chery (1):
  intel/blorp: Define the clear value bounds for HiZ clears

Rob Clark (2):
  freedreno: fix inorder rendering case
  freedreno: don't flush when new and old pfb is identical


Rejected (1)
=
Jason Ekstrand (1):
  aa02d7e8781 Revert "anv/skylake: disable ForceThreadDispatchEnable"
Reason: This commit reverts 0fa9e6d7b30 which did not land in branch.


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


Re: [Mesa-dev] [PATCH 3/3] radeonsi: add support for Raven2

2018-10-29 Thread Marek Olšák
On Sat, Oct 27, 2018 at 4:35 AM Gustaw Smolarczyk 
wrote:

> sob., 27 paź 2018 o 04:28 Marek Olšák  napisał(a):
> >
> > From: Marek Olšák 
> >
> > ---
> >  src/amd/addrlib/amdgpu_asic_addr.h  | 2 ++
> >  src/amd/addrlib/gfx9/gfx9addrlib.cpp| 2 +-
> >  src/amd/common/ac_gpu_info.c| 6 ++
> >  src/amd/common/ac_llvm_util.c   | 1 +
> >  src/amd/common/ac_surface.c | 4 
> >  src/amd/common/amd_family.h | 1 +
> >  src/amd/common/gfx9d.h  | 3 +++
> >  src/gallium/drivers/radeonsi/si_pipe.c  | 6 --
> >  src/gallium/drivers/radeonsi/si_state.c | 4 +++-
> >  src/gallium/drivers/radeonsi/si_state_binning.c | 1 +
> >  10 files changed, 26 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/amd/addrlib/amdgpu_asic_addr.h
> b/src/amd/addrlib/amdgpu_asic_addr.h
> > index e5838d42a3c..7436c5493e1 100644
> > --- a/src/amd/addrlib/amdgpu_asic_addr.h
> > +++ b/src/amd/addrlib/amdgpu_asic_addr.h
> > @@ -83,20 +83,21 @@
> >
> >  #define AMDGPU_CARRIZO_RANGE0x01, 0x21
> >  #define AMDGPU_BRISTOL_RANGE0x10, 0x21
> >  #define AMDGPU_STONEY_RANGE 0x61, 0xFF
> >
> >  #define AMDGPU_VEGA10_RANGE 0x01, 0x14
> >  #define AMDGPU_VEGA12_RANGE 0x14, 0x28
> >  #define AMDGPU_VEGA20_RANGE 0x28, 0xFF
> >
> >  #define AMDGPU_RAVEN_RANGE  0x01, 0x81
> > +#define AMDGPU_RAVEN2_RANGE 0x81, 0xFF
> >
> >  #define AMDGPU_EXPAND_FIX(x) x
> >  #define AMDGPU_RANGE_HELPER(val, min, max) ((val >= min) && (val < max))
> >  #define AMDGPU_IN_RANGE(val, ...)
>  AMDGPU_EXPAND_FIX(AMDGPU_RANGE_HELPER(val, __VA_ARGS__))
> >
> >
> >  // ASICREV_IS(eRevisionId, revisionName)
> >  #define ASICREV_IS(r, rn)  AMDGPU_IN_RANGE(r,
> AMDGPU_##rn##_RANGE)
> >  #define ASICREV_IS_TAHITI_P(r) ASICREV_IS(r, TAHITI)
> >  #define ASICREV_IS_PITCAIRN_PM(r)  ASICREV_IS(r, PITCAIRN)
> > @@ -125,12 +126,13 @@
> >  #define ASICREV_IS_CARRIZO_BRISTOL(r)  ASICREV_IS(r, BRISTOL)
> >  #define ASICREV_IS_STONEY(r)   ASICREV_IS(r, STONEY)
> >
> >  #define ASICREV_IS_VEGA10_M(r) ASICREV_IS(r, VEGA10)
> >  #define ASICREV_IS_VEGA10_P(r) ASICREV_IS(r, VEGA10)
> >  #define ASICREV_IS_VEGA12_P(r) ASICREV_IS(r, VEGA12)
> >  #define ASICREV_IS_VEGA12_p(r) ASICREV_IS(r, VEGA12)
> >  #define ASICREV_IS_VEGA20_P(r) ASICREV_IS(r, VEGA20)
> >
> >  #define ASICREV_IS_RAVEN(r)ASICREV_IS(r, RAVEN)
> > +#define ASICREV_IS_RAVEN2(r)   ASICREV_IS(r, RAVEN2)
> >
> >  #endif // _AMDGPU_ASIC_ADDR_H
> > diff --git a/src/amd/addrlib/gfx9/gfx9addrlib.cpp
> b/src/amd/addrlib/gfx9/gfx9addrlib.cpp
> > index d27aabbb60c..f115242c89c 100644
> > --- a/src/amd/addrlib/gfx9/gfx9addrlib.cpp
> > +++ b/src/amd/addrlib/gfx9/gfx9addrlib.cpp
> > @@ -1284,21 +1284,21 @@ ChipFamily Gfx9Lib::HwlConvertChipFamily(
> >  m_settings.htileAlignFix = 1;
> >  m_settings.applyAliasFix = 1;
> >  }
> >
> >  m_settings.metaBaseAlignFix = 1;
> >
> >  m_settings.depthPipeXorDisable = 1;
> >  break;
> >  case FAMILY_RV:
> >  m_settings.isArcticIsland = 1;
> > -m_settings.isRaven= ASICREV_IS_RAVEN(uChipRevision);
> > +m_settings.isRaven= ASICREV_IS_RAVEN(uChipRevision)
> || ASICREV_IS_RAVEN2(uChipRevision);
> >
> >  if (m_settings.isRaven)
> >  {
> >  m_settings.isDcn1   = 1;
> >  }
> >
> >  m_settings.metaBaseAlignFix = 1;
> >
> >  if (ASICREV_IS_RAVEN(uChipRevision))
> >  {
> > diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
> > index 2c70fb2c721..689f544c18b 100644
> > --- a/src/amd/common/ac_gpu_info.c
> > +++ b/src/amd/common/ac_gpu_info.c
> > @@ -307,20 +307,26 @@ bool ac_query_gpu_info(int fd,
> amdgpu_device_handle dev,
> > info->name = #cfamily; \
> > break;
> >  #include "pci_ids/radeonsi_pci_ids.h"
> >  #undef CHIPSET
> >
> > default:
> > fprintf(stderr, "amdgpu: Invalid PCI ID.\n");
> > return false;
> > }
> >
> > +   /* Raven2 uses the same PCI IDs as Raven1, but different
> revision IDs. */
> > +   if (info->family == CHIP_RAVEN && amdinfo->chip_rev >= 0x8) {
> > +   info->family = CHIP_RAVEN2;
> > +   info->name = "RAVEN2";
> > +   }
> > +
> > if (info->family >= CHIP_VEGA10)
> > info->chip_class = GFX9;
> > else if (info->family >= CHIP_TONGA)
> > info->chip_class = VI;
> > else if (info->family >= CHIP_BONAIRE)
> > info->chip_class = CIK;
> > else if (info->family >= CHIP_TAHITI)
> > info->chip_class = SI;
> > else {
> > fprintf(stderr, "amdgpu: Unknown family.\n");

[Mesa-dev] [PATCH] radeonsi: add support for Raven2 (v2)

2018-10-29 Thread Marek Olšák
From: Marek Olšák 

v2: fix enabling primitive binning
---
 src/amd/addrlib/amdgpu_asic_addr.h  |  2 ++
 src/amd/addrlib/gfx9/gfx9addrlib.cpp|  2 +-
 src/amd/common/ac_gpu_info.c|  6 ++
 src/amd/common/ac_llvm_util.c   |  2 ++
 src/amd/common/ac_surface.c |  4 
 src/amd/common/amd_family.h |  1 +
 src/amd/common/gfx9d.h  |  3 +++
 src/gallium/drivers/radeonsi/si_pipe.c  | 10 ++
 src/gallium/drivers/radeonsi/si_state.c |  4 +++-
 src/gallium/drivers/radeonsi/si_state_binning.c |  1 +
 10 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/src/amd/addrlib/amdgpu_asic_addr.h 
b/src/amd/addrlib/amdgpu_asic_addr.h
index e5838d42a3c..7436c5493e1 100644
--- a/src/amd/addrlib/amdgpu_asic_addr.h
+++ b/src/amd/addrlib/amdgpu_asic_addr.h
@@ -83,20 +83,21 @@
 
 #define AMDGPU_CARRIZO_RANGE0x01, 0x21
 #define AMDGPU_BRISTOL_RANGE0x10, 0x21
 #define AMDGPU_STONEY_RANGE 0x61, 0xFF
 
 #define AMDGPU_VEGA10_RANGE 0x01, 0x14
 #define AMDGPU_VEGA12_RANGE 0x14, 0x28
 #define AMDGPU_VEGA20_RANGE 0x28, 0xFF
 
 #define AMDGPU_RAVEN_RANGE  0x01, 0x81
+#define AMDGPU_RAVEN2_RANGE 0x81, 0xFF
 
 #define AMDGPU_EXPAND_FIX(x) x
 #define AMDGPU_RANGE_HELPER(val, min, max) ((val >= min) && (val < max))
 #define AMDGPU_IN_RANGE(val, ...)   AMDGPU_EXPAND_FIX(AMDGPU_RANGE_HELPER(val, 
__VA_ARGS__))
 
 
 // ASICREV_IS(eRevisionId, revisionName)
 #define ASICREV_IS(r, rn)  AMDGPU_IN_RANGE(r, AMDGPU_##rn##_RANGE)
 #define ASICREV_IS_TAHITI_P(r) ASICREV_IS(r, TAHITI)
 #define ASICREV_IS_PITCAIRN_PM(r)  ASICREV_IS(r, PITCAIRN)
@@ -125,12 +126,13 @@
 #define ASICREV_IS_CARRIZO_BRISTOL(r)  ASICREV_IS(r, BRISTOL)
 #define ASICREV_IS_STONEY(r)   ASICREV_IS(r, STONEY)
 
 #define ASICREV_IS_VEGA10_M(r) ASICREV_IS(r, VEGA10)
 #define ASICREV_IS_VEGA10_P(r) ASICREV_IS(r, VEGA10)
 #define ASICREV_IS_VEGA12_P(r) ASICREV_IS(r, VEGA12)
 #define ASICREV_IS_VEGA12_p(r) ASICREV_IS(r, VEGA12)
 #define ASICREV_IS_VEGA20_P(r) ASICREV_IS(r, VEGA20)
 
 #define ASICREV_IS_RAVEN(r)ASICREV_IS(r, RAVEN)
+#define ASICREV_IS_RAVEN2(r)   ASICREV_IS(r, RAVEN2)
 
 #endif // _AMDGPU_ASIC_ADDR_H
diff --git a/src/amd/addrlib/gfx9/gfx9addrlib.cpp 
b/src/amd/addrlib/gfx9/gfx9addrlib.cpp
index d27aabbb60c..f115242c89c 100644
--- a/src/amd/addrlib/gfx9/gfx9addrlib.cpp
+++ b/src/amd/addrlib/gfx9/gfx9addrlib.cpp
@@ -1284,21 +1284,21 @@ ChipFamily Gfx9Lib::HwlConvertChipFamily(
 m_settings.htileAlignFix = 1;
 m_settings.applyAliasFix = 1;
 }
 
 m_settings.metaBaseAlignFix = 1;
 
 m_settings.depthPipeXorDisable = 1;
 break;
 case FAMILY_RV:
 m_settings.isArcticIsland = 1;
-m_settings.isRaven= ASICREV_IS_RAVEN(uChipRevision);
+m_settings.isRaven= ASICREV_IS_RAVEN(uChipRevision) || 
ASICREV_IS_RAVEN2(uChipRevision);
 
 if (m_settings.isRaven)
 {
 m_settings.isDcn1   = 1;
 }
 
 m_settings.metaBaseAlignFix = 1;
 
 if (ASICREV_IS_RAVEN(uChipRevision))
 {
diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index 2c70fb2c721..689f544c18b 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -307,20 +307,26 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
info->name = #cfamily; \
break;
 #include "pci_ids/radeonsi_pci_ids.h"
 #undef CHIPSET
 
default:
fprintf(stderr, "amdgpu: Invalid PCI ID.\n");
return false;
}
 
+   /* Raven2 uses the same PCI IDs as Raven1, but different revision IDs. 
*/
+   if (info->family == CHIP_RAVEN && amdinfo->chip_rev >= 0x8) {
+   info->family = CHIP_RAVEN2;
+   info->name = "RAVEN2";
+   }
+
if (info->family >= CHIP_VEGA10)
info->chip_class = GFX9;
else if (info->family >= CHIP_TONGA)
info->chip_class = VI;
else if (info->family >= CHIP_BONAIRE)
info->chip_class = CIK;
else if (info->family >= CHIP_TAHITI)
info->chip_class = SI;
else {
fprintf(stderr, "amdgpu: Unknown family.\n");
diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c
index cd3525187a0..69d9f7b9f3f 100644
--- a/src/amd/common/ac_llvm_util.c
+++ b/src/amd/common/ac_llvm_util.c
@@ -128,20 +128,22 @@ const char *ac_get_llvm_processor_name(enum radeon_family 
family)
case CHIP_VEGAM:
return "polaris11";
case CHIP_VEGA10:
return "gfx900";
case CHIP_RAVEN:
return "gfx902";
case CHIP_VEGA12:
   

Re: [Mesa-dev] [PATCH 05/15] ac: revert new LLVM 7.0 behavior for fdiv

2018-10-29 Thread Marek Olšák
Fixed in master.

Marek

On Mon, Oct 29, 2018 at 6:50 AM Connor Abbott  wrote:

> ctx->f32_1 probably needs to be replaced by the appropriately-sized
> float, like LLVMConstReal(1., ...)
> On Mon, Oct 29, 2018 at 11:45 AM Timothy Arceri 
> wrote:
> >
> > Hi Marek,
> >
> > It's late and I haven't dug into this any further but this patch causes
> > a whole bunch of f64 piglit tests to fail for the radeonsi nir backend.
> >
> > e.g.
> >
> > ./bin/shader_runner
> >
> generated_tests/spec/glsl-4.00/execution/built-in-functions/fs-inverse-dmat2.shader_test
> > -auto -fbo
> >
> >
> > LLVM ERROR: Cannot select: 0x7fbc48075aa8: f64 = bitcast 0x7fbc48077730
> >0x7fbc48077730: f32 = RCP 0x7fbc4806e788
> >  0x7fbc4806e788: f64 = fadd nsz 0x7fbc480757d0, 0x7fbc48075a40
> >0x7fbc480757d0: f64 = fmul nsz 0x7fbc4806f0e0, 0x7fbc4806f420
> >  0x7fbc4806f0e0: f64 = bitcast 0x7fbc4806f078
> >
> > On 30/8/18 6:13 am, Marek Olšák wrote:
> > > From: Marek Olšák 
> > >
> > > Cc: 18.1 18.2 
> > > ---
> > >   src/amd/common/ac_llvm_build.c | 9 -
> > >   1 file changed, 8 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/amd/common/ac_llvm_build.c
> b/src/amd/common/ac_llvm_build.c
> > > index c741a1ab62d..629cd2a7527 100644
> > > --- a/src/amd/common/ac_llvm_build.c
> > > +++ b/src/amd/common/ac_llvm_build.c
> > > @@ -554,21 +554,28 @@ LLVMValueRef ac_build_expand_to_vec4(struct
> ac_llvm_context *ctx,
> > >   chan[num_channels++] = LLVMGetUndef(elemtype);
> > >
> > >   return ac_build_gather_values(ctx, chan, 4);
> > >   }
> > >
> > >   LLVMValueRef
> > >   ac_build_fdiv(struct ac_llvm_context *ctx,
> > > LLVMValueRef num,
> > > LLVMValueRef den)
> > >   {
> > > - LLVMValueRef ret = LLVMBuildFDiv(ctx->builder, num, den, "");
> > > + /* If we do (num / den), LLVM >= 7.0 does:
> > > +  *return num * v_rcp_f32(den * (fabs(den) > 0x1.0p+96f ?
> 0x1.0p-32f : 1.0f));
> > > +  *
> > > +  * If we do (num * (1 / den)), LLVM does:
> > > +  *return num * v_rcp_f32(den);
> > > +  */
> > > + LLVMValueRef rcp = LLVMBuildFDiv(ctx->builder, ctx->f32_1, den,
> "");
> > > + LLVMValueRef ret = LLVMBuildFMul(ctx->builder, num, rcp, "");
> > >
> > >   /* Use v_rcp_f32 instead of precise division. */
> > >   if (!LLVMIsConstant(ret))
> > >   LLVMSetMetadata(ret, ctx->fpmath_md_kind,
> ctx->fpmath_md_2p5_ulp);
> > >   return ret;
> > >   }
> > >
> > >   /* Coordinates for cube map selection. sc, tc, and ma are as in
> Table 8.27
> > >* of the OpenGL 4.5 (Compatibility Profile) specification, except
> ma is
> > >* already multiplied by two. id is the cube face number.
> > >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/3] radeonsi/gfx9: set optimal OVERWRITE_COMBINER_WATERMARK

2018-10-29 Thread Marek Olšák
The values can't be set per CB.

Marek

On Mon, Oct 29, 2018 at 7:04 AM Samuel Pitoiset 
wrote:

> Are the values similar when they are set per CB instead of globally?
>
> On 10/27/18 4:28 AM, Marek Olšák wrote:
> > From: Marek Olšák 
> >
> > ---
> >   src/gallium/drivers/radeonsi/si_pipe.h  |  1 +
> >   src/gallium/drivers/radeonsi/si_state.c | 14 +-
> >   2 files changed, 14 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/gallium/drivers/radeonsi/si_pipe.h
> b/src/gallium/drivers/radeonsi/si_pipe.h
> > index dc95afb7421..0807c8ddacc 100644
> > --- a/src/gallium/drivers/radeonsi/si_pipe.h
> > +++ b/src/gallium/drivers/radeonsi/si_pipe.h
> > @@ -610,20 +610,21 @@ struct si_framebuffer {
> >   unsignedspi_shader_col_format_blend;
> >   unsignedspi_shader_col_format_blend_alpha;
> >   ubyte   nr_samples:5; /* at most 16xAA */
> >   ubyte   log_samples:3; /* at most 4 =
> 16xAA */
> >   ubyte   nr_color_samples; /* at most 8xAA
> */
> >   ubyte   compressed_cb_mask;
> >   ubyte   uncompressed_cb_mask;
> >   ubyte   color_is_int8;
> >   ubyte   color_is_int10;
> >   ubyte   dirty_cbufs;
> > + ubyte   dcc_overwrite_combiner_watermark;
> >   booldirty_zsbuf;
> >   boolany_dst_linear;
> >   boolCB_has_shader_readable_metadata;
> >   boolDB_has_shader_readable_metadata;
> >   };
> >
> >   enum si_quant_mode {
> >   /* This is the list we want to support. */
> >   SI_QUANT_MODE_16_8_FIXED_POINT_1_256TH,
> >   SI_QUANT_MODE_14_10_FIXED_POINT_1_1024TH,
> > diff --git a/src/gallium/drivers/radeonsi/si_state.c
> b/src/gallium/drivers/radeonsi/si_state.c
> > index 36dce381539..43d76d19916 100644
> > --- a/src/gallium/drivers/radeonsi/si_state.c
> > +++ b/src/gallium/drivers/radeonsi/si_state.c
> > @@ -106,26 +106,27 @@ static void si_emit_cb_render_state(struct
> si_context *sctx)
> >   if (sctx->chip_class >= VI) {
> >   /* DCC MSAA workaround for blending.
> >* Alternatively, we can set
> CB_COLORi_DCC_CONTROL.OVERWRITE_-
> >* COMBINER_DISABLE, but that would be more complicated.
> >*/
> >   bool oc_disable = (sctx->chip_class == VI ||
> >  sctx->chip_class == GFX9) &&
> > blend &&
> > blend->blend_enable_4bit &
> cb_target_mask &&
> > sctx->framebuffer.nr_samples >= 2;
> > + unsigned watermark =
> sctx->framebuffer.dcc_overwrite_combiner_watermark;
> >
> >   radeon_opt_set_context_reg(
> >   sctx, R_028424_CB_DCC_CONTROL,
> >   SI_TRACKED_CB_DCC_CONTROL,
> >
>  S_028424_OVERWRITE_COMBINER_MRT_SHARING_DISABLE(1) |
> > - S_028424_OVERWRITE_COMBINER_WATERMARK(4) |
> > +
>  S_028424_OVERWRITE_COMBINER_WATERMARK(watermark) |
> >
>  S_028424_OVERWRITE_COMBINER_DISABLE(oc_disable));
> >   }
> >
> >   /* RB+ register settings. */
> >   if (sctx->screen->rbplus_allowed) {
> >   unsigned spi_shader_col_format =
> >   sctx->ps_shader.cso ?
> >
>  sctx->ps_shader.current->key.part.ps.epilog.spi_shader_col_format : 0;
> >   unsigned sx_ps_downconvert = 0;
> >   unsigned sx_blend_opt_epsilon = 0;
> > @@ -2848,20 +2849,21 @@ static void si_set_framebuffer_state(struct
> pipe_context *ctx,
> >   sctx->framebuffer.color_is_int10 = 0;
> >
> >   sctx->framebuffer.compressed_cb_mask = 0;
> >   sctx->framebuffer.uncompressed_cb_mask = 0;
> >   sctx->framebuffer.nr_samples =
> util_framebuffer_get_num_samples(state);
> >   sctx->framebuffer.nr_color_samples = sctx->framebuffer.nr_samples;
> >   sctx->framebuffer.log_samples =
> util_logbase2(sctx->framebuffer.nr_samples);
> >   sctx->framebuffer.any_dst_linear = false;
> >   sctx->framebuffer.CB_has_shader_readable_metadata = false;
> >   sctx->framebuffer.DB_has_shader_readable_metadata = false;
> > + unsigned num_bpp64_colorbufs = 0;
> >
> >   for (i = 0; i < state->nr_cbufs; i++) {
> >   if (!state->cbufs[i])
> >   continue;
> >
> >   surf = (struct si_surface*)state->cbufs[i];
> >   tex = (struct si_texture*)surf->base.texture;
> >
> >   if (!surf->color_initialized) {
> >   si_initialize_color_surface(sctx, surf);
> > @@ -2894,35 +2896,45 @@ static void si_set_framebuffer_state(struct
> pipe_context *ctx,
> >

Re: [Mesa-dev] [PATCH 11/11] util: move u_cpu_detect to util

2018-10-29 Thread Dylan Baker
Quoting Brian Paul (2018-10-29 12:24:13)
> On 10/29/2018 12:57 PM, Dylan Baker wrote:
> > CC: v...@freedesktop.org
> > CC: Roland Scheidegger 
> > Bugzilla: 
> > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D107870data=02%7C01%7Cbrianp%40vmware.com%7Cc877b18570db4c38c0dc08d63dd09044%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636764363328904415sdata=ZHwiXmydLEpHfNFcQ2O5%2BbatXTk5zZAHLoGGolwiijw%3Dreserved=0
> > Fixes: 80825abb5d1a7491035880253ffd531c55acae6b
> > ("move u_math to src/util")
> > ---
> > 
> > Roland, you noticed that the previous attempt to fix this issue broke 
> > windows.
> > I've run scons with mingw cross compilation on Linux, but if you could test 
> > that
> > this doesn't break the build on windows I'd appreciate it.
> 
> I just applied the series to my tree and it seems to build and run fine 
> (with softpipe).
> 
> Tested-by: Brian Paul 
> 
> -Brian

Thank you!


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


Re: [Mesa-dev] [PATCH] i965/icl: Disable prefetching of sampler state entries

2018-10-29 Thread Kenneth Graunke
On Wednesday, October 24, 2018 11:33:53 AM PDT Anuj Phogat wrote:
> From: Topi Pohjolainen 
> 
> In the same spirit as commit a5889d70f2074201ceaeac4f96a9a0c0b1f68a31
> "i965/icl: Disable binding table prefetching". Fixes some 110+
> intermittent piglit failures with tex-miplevel-selection variants.
> 
> WA_1606682166:
> Incorrect TDL's SSP address shift in SARB for 16:6 & 18:8 modes.
> Disable the Sampler state prefetch functionality in the SARB by
> programming 0xB000[30] to '1'. This is to be done at boot time and
> the feature must remain disabled permanently.
> 
> Anuj: Set SamplerCount = 0 for vs, gs, hs, ds and wm units as well.
> 
> Signed-off-by: Topi Pohjolainen 
> Signed-off-by: Anuj Phogat 
> Cc: Mark Janes 
> ---
> Latest kernel from drm-tip  do have this workaround implemented
> but we're seeing few deqp regressions with that kernel. I'm
> adding this workaround to Mesa to make some progress in ICL
> testing on CI. We can always revert the patch when we don't
> need it anymore.
> ---
>  src/mesa/drivers/dri/i965/genX_state_upload.c | 15 ---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
> b/src/mesa/drivers/dri/i965/genX_state_upload.c
> index 740cb0c4d2e..319800934d5 100644
> --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
> +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
> @@ -2004,7 +2004,8 @@ genX(upload_wm)(struct brw_context *brw)
>if (wm_prog_data->base.use_alt_mode)
>   wm.FloatingPointMode = FLOATING_POINT_MODE_Alternate;
>  
> -  wm.SamplerCount = GEN_GEN == 5 ?
> +  /* WA_1606682166 */
> +  wm.SamplerCount = (GEN_GEN == 5 || GEN_GEN == 11) ?
>   0 : DIV_ROUND_UP(stage_state->sampler_count, 4);
>  
>wm.BindingTableEntryCount =
> @@ -2166,7 +2167,10 @@ static const struct brw_tracked_state genX(wm_state) = 
> {
>  
>  #define INIT_THREAD_DISPATCH_FIELDS(pkt, prefix) \
> pkt.KernelStartPointer = KSP(brw, stage_state->prog_offset);   \
> +   /* WA_1606682166 */\
> pkt.SamplerCount   =   \
> +  GEN_GEN == 11 ? \
> +  0 : \

 pkt.SamplerCount   = GEN_GEN == 11 ? 0 :   \

>DIV_ROUND_UP(CLAMP(stage_state->sampler_count, 0, 16), 4);  \
> /* Gen 11 workarounds table #2056 WABTPPrefetchDisable suggests to \
>  * disable prefetching of binding tables in A0 and B0 steppings.   \
> @@ -3977,8 +3981,13 @@ genX(upload_ps)(struct brw_context *brw)
> */
>ps.VectorMaskEnable = GEN_GEN >= 8;
>  
> -  ps.SamplerCount =
> - DIV_ROUND_UP(CLAMP(stage_state->sampler_count, 0, 16), 4);
> +   /* WA_1606682166:
> +* "Incorrect TDL's SSP address shift in SARB for 16:6 & 18:8 modes.
> +* Disable the Sampler state prefetch functionality in the SARB by
> +* programming 0xB000[30] to '1'."
> +*/

Indentation

Reviewed-by: Kenneth Graunke 

> +  ps.SamplerCount = GEN_GEN == 11 ?
> + 0 : DIV_ROUND_UP(CLAMP(stage_state->sampler_count, 0, 16), 4);
>  
>/* BRW_NEW_FS_PROG_DATA */
>/* Gen 11 workarounds table #2056 WABTPPrefetchDisable suggests to 
> disable
> 



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


Re: [Mesa-dev] [PATCH 11/11] util: move u_cpu_detect to util

2018-10-29 Thread Brian Paul
On 10/29/2018 12:57 PM, Dylan Baker wrote:
> CC: v...@freedesktop.org
> CC: Roland Scheidegger 
> Bugzilla: 
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D107870data=02%7C01%7Cbrianp%40vmware.com%7Cc877b18570db4c38c0dc08d63dd09044%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636764363328904415sdata=ZHwiXmydLEpHfNFcQ2O5%2BbatXTk5zZAHLoGGolwiijw%3Dreserved=0
> Fixes: 80825abb5d1a7491035880253ffd531c55acae6b
> ("move u_math to src/util")
> ---
> 
> Roland, you noticed that the previous attempt to fix this issue broke windows.
> I've run scons with mingw cross compilation on Linux, but if you could test 
> that
> this doesn't break the build on windows I'd appreciate it.

I just applied the series to my tree and it seems to build and run fine 
(with softpipe).

Tested-by: Brian Paul 

-Brian


> 
>   src/gallium/auxiliary/Makefile.sources  | 2 --
>   src/gallium/auxiliary/meson.build   | 2 --
>   src/util/Makefile.sources   | 2 ++
>   src/util/meson.build| 2 ++
>   src/{gallium/auxiliary => }/util/u_cpu_detect.c | 0
>   src/{gallium/auxiliary => }/util/u_cpu_detect.h | 0
>   6 files changed, 4 insertions(+), 4 deletions(-)
>   rename src/{gallium/auxiliary => }/util/u_cpu_detect.c (100%)
>   rename src/{gallium/auxiliary => }/util/u_cpu_detect.h (100%)
> 
> diff --git a/src/gallium/auxiliary/Makefile.sources 
> b/src/gallium/auxiliary/Makefile.sources
> index 72cf2ec6443..b60b25a0e4c 100644
> --- a/src/gallium/auxiliary/Makefile.sources
> +++ b/src/gallium/auxiliary/Makefile.sources
> @@ -222,8 +222,6 @@ C_SOURCES := \
>   util/u_box.h \
>   util/u_cache.c \
>   util/u_cache.h \
> - util/u_cpu_detect.c \
> - util/u_cpu_detect.h \
>   util/u_debug_gallium.h \
>   util/u_debug_gallium.c \
>   util/u_debug_describe.c \
> diff --git a/src/gallium/auxiliary/meson.build 
> b/src/gallium/auxiliary/meson.build
> index 1b5eb4d155d..e1497992b17 100644
> --- a/src/gallium/auxiliary/meson.build
> +++ b/src/gallium/auxiliary/meson.build
> @@ -242,8 +242,6 @@ files_libgallium = files(
> 'util/u_box.h',
> 'util/u_cache.c',
> 'util/u_cache.h',
> -  'util/u_cpu_detect.c',
> -  'util/u_cpu_detect.h',
> 'util/u_debug_gallium.h',
> 'util/u_debug_gallium.c',
> 'util/u_debug_describe.c',
> diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources
> index af2ad85da19..b4d23947ab7 100644
> --- a/src/util/Makefile.sources
> +++ b/src/util/Makefile.sources
> @@ -70,6 +70,8 @@ MESA_UTIL_FILES := \
>   u_vector.h \
>   u_debug.c \
>   u_debug.h \
> + u_cpu_detect.c \
> + u_cpu_detect.h \
>   vma.c \
>   vma.h
>   
> diff --git a/src/util/meson.build b/src/util/meson.build
> index 3b84f42..7caea27d660 100644
> --- a/src/util/meson.build
> +++ b/src/util/meson.build
> @@ -94,6 +94,8 @@ files_mesa_util = files(
> 'u_math.h',
> 'u_debug.c',
> 'u_debug.h',
> +  'u_cpu_detect.c',
> +  'u_cpu_detect.h',
> 'vma.c',
> 'vma.h',
>   )
> diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c 
> b/src/util/u_cpu_detect.c
> similarity index 100%
> rename from src/gallium/auxiliary/util/u_cpu_detect.c
> rename to src/util/u_cpu_detect.c
> diff --git a/src/gallium/auxiliary/util/u_cpu_detect.h 
> b/src/util/u_cpu_detect.h
> similarity index 100%
> rename from src/gallium/auxiliary/util/u_cpu_detect.h
> rename to src/util/u_cpu_detect.h
> 

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


[Mesa-dev] [PATCH] Revert "imx: make use of loader_open_render_node(..) helper"

2018-10-29 Thread Christian Gmeiner
This reverts commit 773d6ea6e715d207bda3a53a9dfc8acf686035b0.

Since kernel 4.17 (drm/etnaviv: remove the need for a gpu-subsystem DT
node) the etnaviv DRM driver doesn't have an associated DT node
anymore. This is technically correct, as the etnaviv device is a
virtual device driving multiple hardware devices.

Before 4.17 the userspace had access to the following information:
DRIVER=etnaviv
OF_NAME=gpu-subsystem
OF_FULLNAME=/gpu-subsystem
OF_COMPATIBLE_0=fsl,imx-gpu-subsystem
OF_COMPATIBLE_N=1
MODALIAS=of:Ngpu-subsystemTCfsl,imx-gpu-subsystem
DRIVER=imx-drm
OF_NAME=display-subsystem
OF_FULLNAME=/display-subsystem
OF_COMPATIBLE_0=fsl,imx-display-subsystem
OF_COMPATIBLE_N=1

Afer 4.17:
DRIVER=etnaviv
MODALIAS=platform:etnaviv

The OF node has never been part of the etnaviv UABI, simply due to the
fact that it's still possible to instantiate the etnaviv driver from a
platform file, instead of a devicetree node.

A patch set to fix this problem was send out [1] but it looks like
that a proper solution needs more time to bake.

[1] https://lists.freedesktop.org/archives/dri-devel/2018-October/194651.html

Suggested-by: Emil Velikov 
Signed-off-by: Christian Gmeiner 
---
 src/gallium/winsys/imx/drm/imx_drm_winsys.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/winsys/imx/drm/imx_drm_winsys.c 
b/src/gallium/winsys/imx/drm/imx_drm_winsys.c
index 4bd21250315..cd72610b955 100644
--- a/src/gallium/winsys/imx/drm/imx_drm_winsys.c
+++ b/src/gallium/winsys/imx/drm/imx_drm_winsys.c
@@ -26,7 +26,6 @@
 
 #include "imx_drm_public.h"
 #include "etnaviv/drm/etnaviv_drm_public.h"
-#include "loader/loader.h"
 #include "renderonly/renderonly.h"
 
 #include 
@@ -37,7 +36,7 @@ struct pipe_screen *imx_drm_screen_create(int fd)
struct renderonly ro = {
   .create_for_resource = renderonly_create_kms_dumb_buffer_for_resource,
   .kms_fd = fd,
-  .gpu_fd = loader_open_render_node("etnaviv")
+  .gpu_fd = open("/dev/dri/renderD128", O_RDWR | O_CLOEXEC)
};
 
if (ro.gpu_fd < 0)
-- 
2.17.2

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


Re: [Mesa-dev] Meson windows v5 (10/19/2018) review

2018-10-29 Thread Dylan Baker
Quoting Jose Fonseca (2018-10-25 04:02:42)
> On 21/10/18 20:54, Liviu Prodea wrote:
> > 1. When using Meson 0.48.x both -Dc_args -Dcpp_args and -Db_vscrt 
> > methods of selecting the CRT are ineffective on changing the CRT from MD 
> > to MT resulting in build failure if LLVM is built with MT CRT. This 
> > issue persists from last time I tested this WIP branch. However if MT 
> > built LLVM is indeed unsupported unlike Scons I am OK with it as long as 
> > it is documented.
> 
> > 2. Assuming no 1 has been worked around (we have LLVM built with MD CRT 
> > available), LLVM JIT-ed drivers like llvmpipe and swr cannot be selected 
> > despite resulted opengl32.dll being around 20MB and swr DLLs being built 
> > as well only when expected. Tested with GPU Caps Viewer (a 32-bit only 
> > software), it reports the driver as softpipe OpenGL 3.1 with 248 
> > extensions.  Since it's 32-bit app I did not attempt to build swr for 
> > this test as it's unsupported for 32-bit apps.  It appears this is a 
> > really persistent issue as I had it right from the first time I tested 
> > this branch. Maybe I need to change the recipe I use to build LLVM so 
> > that I use Meson instead of CMake. That would be really unpleasant if it 
> > turns out to be the root of this problem. I have this marked as optional 
> > and it is on least priority on my TODO list:
> > 
> > https://github.com/pal1000/mesa-dist-win/issues/7 
> > 

As an aside, I noticed that there was a bug in the llvm dependency handler on
windows that was stripping the \\ out of paths, that's been fixed in master now.

> > 3. More filename parity with Scons similar to
> > 
> > https://gitlab.freedesktop.org/dbaker/mesa/commit/f31d0802da6a20b3878a789bb38c9733c4b0ff24#bda6b0f93966e610f473867639a87adfc5437011
> >  
> > 
> > 
> > - swrAVX-0.dll should be swrAVX.dll
> > 
> > - swrAVX2-0.dll should be swrAVX2.dll
> > 
> > - libOsmesa.dll should be osmesa.dll
> > 
> > 4. opengl32.dll built with Meson depends on shared library z.dll. I have 
> > absolutely no problem with this but Jose Fonseca may not like this 
> > considering one of his replies from the Scons gles option conversations.
> 
> Yep, we really don't want opengl32.dll (or any Mesa based OpenGL ICD) to 
> depend on any DLL whatsoever besides Windows standard DLLs (this 
> excludes even MSVC runtime, hence the need of /MT /MTd.)  This is 
> because these drivers will be loaded onto arbitrary process are normally 
> installed into C:\Windows\system32, hence any dependencies will need to 
> be installed there, so depending on a z.dll could clash with z.dll 
> shipped by applications

To fix the z.dll (and expat.dll), set --default-library=static, this will make
any `library` calls into `static_library` instead of `shared_library`. Mesa
itself doesn't use `library`, we always set `static_library` and
`shared_library` explicitly.

Dylan

> 
> Regarding MT vs MTd, I've often considered just always use /MT and side 
> step the runtime mismatch issue completely, because I honestly don't 
> remember the debug C runtime ever helping debugging anything.  In fact, 
> we often use cross compiled MinGW binaries for day-to-day development 
> anyway.
> 
> 
> Jose


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


Re: [Mesa-dev] [PATCH 1/2] intel/icl: Disable combining of vertices from separate instances

2018-10-29 Thread Kenneth Graunke
On Monday, October 29, 2018 5:38:57 AM PDT Topi Pohjolainen wrote:
> This is new hardware feature, and should be disabled until it is
> clear our VS kernels are prepared for it. Thread payload has new
> bit (See Bspec: Pipeline Stages - 3D Pipeline Geometry -
> Vertex Shader (VS) Stage - Payloads - SIMD8 Payload [BDW+])
> that vertex shaders could consult.
> 
> CC: Jason Ekstrand 
> CC: Kenneth Graunke 
> CC: Anuj Phogat 
> Signed-off-by: Topi Pohjolainen 
> ---
>  src/intel/blorp/blorp_genX_exec.h | 6 ++
>  src/intel/vulkan/genX_pipeline.c  | 6 ++
>  src/mesa/drivers/dri/i965/genX_state_upload.c | 6 ++
>  3 files changed, 18 insertions(+)
> 
> diff --git a/src/intel/blorp/blorp_genX_exec.h 
> b/src/intel/blorp/blorp_genX_exec.h
> index 50341ab0ec..10865b9c15 100644
> --- a/src/intel/blorp/blorp_genX_exec.h
> +++ b/src/intel/blorp/blorp_genX_exec.h
> @@ -629,6 +629,12 @@ blorp_emit_vs_config(struct blorp_batch *batch,
>  #if GEN_GEN >= 8
>   vs.SIMD8DispatchEnable =
>  vs_prog_data->base.dispatch_mode == DISPATCH_MODE_SIMD8;
> +#endif
> +#if GEN_GEN >= 11
> + /* TODO: Disable combining of instances until it is clear VS kernels
> +  * are prepared for it.
> +  */
> + vs.SIMD8SingleInstanceDispatchEnable = vs.SIMD8DispatchEnable;
>  #endif
>}
> }
> diff --git a/src/intel/vulkan/genX_pipeline.c 
> b/src/intel/vulkan/genX_pipeline.c
> index 33f1f7832a..9762fc78b5 100644
> --- a/src/intel/vulkan/genX_pipeline.c
> +++ b/src/intel/vulkan/genX_pipeline.c
> @@ -1157,6 +1157,12 @@ emit_3dstate_vs(struct anv_pipeline *pipeline)
>vs.SIMD8DispatchEnable  =
>   vs_prog_data->base.dispatch_mode == DISPATCH_MODE_SIMD8;
>  #endif
> +#if GEN_GEN >= 11
> +  /* TODO: Disable combining of instances until it is clear VS kernels
> +   * are prepared for it.
> +   */
> +  vs.SIMD8SingleInstanceDispatchEnable = vs.SIMD8DispatchEnable;
> +#endif
>  
>assert(!vs_prog_data->base.base.use_alt_mode);
>  #if GEN_GEN < 11
> diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
> b/src/mesa/drivers/dri/i965/genX_state_upload.c
> index 740cb0c4d2..9198a2953a 100644
> --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
> +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
> @@ -2277,6 +2277,12 @@ genX(upload_vs_state)(struct brw_context *brw)
>  
>vs.UserClipDistanceCullTestEnableBitmask =
>   vue_prog_data->cull_distance_mask;
> +#endif
> +#if GEN_GEN >= 11
> +  /* TODO: Disable combining of instances until it is clear VS kernels
> +   * are prepared for it.
> +   */
> +  vs.SIMD8SingleInstanceDispatchEnable = vs.SIMD8DispatchEnable;
>  #endif
> }
>  
> 

Hey Topi,

I don't foresee any problems with dispatching multiple instances in
a single thread, today.

Ian and I tried to come up with some theoretical cases where you'd
hit problems, and we couldn't come up with much.  Our thinking was
that since instanced rendering is spec'd as a loop, if a shader has
side effects, it might be able to observe this.  But, I don't think
any ordering guarantees exist anyway.  In particular, the HW might
already dispatch threads for instance N and instance N+1, and have
them execute in parallel, even if they're separate threads.

It turns out there's a much more obvious reason.  If you have a
uniform array,

   uniform vec4 foo[...];

and read based on gl_InstanceID:

   foo[gl_InstanceID]

then, because of the thread-dispatch condition, you know that
gl_InstanceID is actually dynamically uniform, so you can do a
single load instead of loading all 8 channels.  More efficient.

The thread combining breaks that optimization.  So, you'd have
to set this bit to turn it off.

We ought to do that optimization!  But, we don't today, so we
should be OK to leave the Icelake feature enabled.

--Ken


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


[Mesa-dev] [Bug 107870] Undefined symbols for architecture x86_64: "_util_cpu_caps"

2018-10-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107870

--- Comment #4 from Dylan Baker  ---
New series sent out to fix this.

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


[Mesa-dev] [PATCH 03/11] gallium/util: move debug_print_usage_enum to the u_debug_gallium

2018-10-29 Thread Dylan Baker
This isn't used in mesa, maybe vmware uses this in a closed source state
tracker?
---
 src/gallium/auxiliary/util/u_debug.c | 19 ---
 src/gallium/auxiliary/util/u_debug.h |  3 ---
 src/gallium/auxiliary/util/u_debug_gallium.c | 19 +++
 src/gallium/auxiliary/util/u_debug_gallium.h |  9 +
 4 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug.c 
b/src/gallium/auxiliary/util/u_debug.c
index f17cb1b58f5..ece3cf74c18 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -491,23 +491,4 @@ debug_print_bind_flags(const char *msg, unsigned usage)
 }
 
 
-/**
- * Print PIPE_USAGE_x enum values with a message.
- */
-void
-debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage)
-{
-   static const struct debug_named_value names[] = {
-  DEBUG_NAMED_VALUE(PIPE_USAGE_DEFAULT),
-  DEBUG_NAMED_VALUE(PIPE_USAGE_IMMUTABLE),
-  DEBUG_NAMED_VALUE(PIPE_USAGE_DYNAMIC),
-  DEBUG_NAMED_VALUE(PIPE_USAGE_STREAM),
-  DEBUG_NAMED_VALUE(PIPE_USAGE_STAGING),
-  DEBUG_NAMED_VALUE_END
-   };
-
-   debug_printf("%s: %s\n", msg, debug_dump_enum(names, usage));
-}
-
-
 #endif
diff --git a/src/gallium/auxiliary/util/u_debug.h 
b/src/gallium/auxiliary/util/u_debug.h
index 6d1e92b7b97..6cacec6740d 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -467,9 +467,6 @@ debug_print_transfer_flags(const char *msg, unsigned usage);
 void
 debug_print_bind_flags(const char *msg, unsigned usage);
 
-void
-debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage);
-
 
 #ifdef __cplusplus
 }
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.c 
b/src/gallium/auxiliary/util/u_debug_gallium.c
index 977e19375ba..389c8f848a5 100644
--- a/src/gallium/auxiliary/util/u_debug_gallium.c
+++ b/src/gallium/auxiliary/util/u_debug_gallium.c
@@ -39,4 +39,23 @@ debug_print_format(const char *msg, unsigned fmt)
debug_printf("%s: %s\n", msg, util_format_name(fmt));
 }
 
+
+/**
+ * Print PIPE_USAGE_x enum values with a message.
+ */
+void
+debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage)
+{
+   static const struct debug_named_value names[] = {
+  DEBUG_NAMED_VALUE(PIPE_USAGE_DEFAULT),
+  DEBUG_NAMED_VALUE(PIPE_USAGE_IMMUTABLE),
+  DEBUG_NAMED_VALUE(PIPE_USAGE_DYNAMIC),
+  DEBUG_NAMED_VALUE(PIPE_USAGE_STREAM),
+  DEBUG_NAMED_VALUE(PIPE_USAGE_STAGING),
+  DEBUG_NAMED_VALUE_END
+   };
+
+   debug_printf("%s: %s\n", msg, debug_dump_enum(names, usage));
+}
+
 #endif
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.h 
b/src/gallium/auxiliary/util/u_debug_gallium.h
index 2e05e53c29d..1e725275834 100644
--- a/src/gallium/auxiliary/util/u_debug_gallium.h
+++ b/src/gallium/auxiliary/util/u_debug_gallium.h
@@ -29,6 +29,8 @@
 #ifndef _U_DEBUG_GALLIUM_H_
 #define _U_DEBUG_GALLIUM_H_
 
+#include "pipe/p_defines.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -39,6 +41,13 @@ void debug_print_format(const char *msg, unsigned fmt);
 #define debug_print_format(_msg, _fmt) ((void)0)
 #endif
 
+#ifdef DEBUG
+
+void
+debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage);
+
+#endif
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.19.1

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


[Mesa-dev] [PATCH 01/11] gallium: split u_prim_name out of u_debug.h

2018-10-29 Thread Dylan Baker
This allows us to pull u_prim.h out of u_debug.h
---
 src/gallium/auxiliary/Makefile.sources |  1 +
 src/gallium/auxiliary/meson.build  |  1 +
 src/gallium/auxiliary/util/u_debug.c   | 26 --
 src/gallium/auxiliary/util/u_prim.c| 48 ++
 4 files changed, 50 insertions(+), 26 deletions(-)
 create mode 100644 src/gallium/auxiliary/util/u_prim.c

diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index 33d58dedf28..94851210142 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -302,6 +302,7 @@ C_SOURCES := \
util/u_pack_color.h \
util/u_pointer.h \
util/u_prim.h \
+   util/u_prim.c \
util/u_prim_restart.c \
util/u_prim_restart.h \
util/u_pstipple.c \
diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index 9e3673a53c0..e79089a7d00 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -322,6 +322,7 @@ files_libgallium = files(
   'util/u_pack_color.h',
   'util/u_pointer.h',
   'util/u_prim.h',
+  'util/u_prim.c',
   'util/u_prim_restart.c',
   'util/u_prim_restart.h',
   'util/u_pstipple.c',
diff --git a/src/gallium/auxiliary/util/u_debug.c 
b/src/gallium/auxiliary/util/u_debug.c
index edfb27fc6f6..8962050b1d5 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -39,7 +39,6 @@
 #include "util/u_memory.h"
 #include "util/u_string.h"
 #include "util/u_math.h"
-#include "util/u_prim.h"
 #include 
 
 #include 
@@ -413,31 +412,6 @@ debug_print_format(const char *msg, unsigned fmt )
 #endif
 
 
-/** Return string name of given primitive type */
-const char *
-u_prim_name(enum pipe_prim_type prim)
-{
-   static const struct debug_named_value names[] = {
-  DEBUG_NAMED_VALUE(PIPE_PRIM_POINTS),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_LINES),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_LOOP),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_FAN),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_QUADS),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_QUAD_STRIP),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_POLYGON),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_LINES_ADJACENCY),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP_ADJACENCY),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES_ADJACENCY),
-  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY),
-  DEBUG_NAMED_VALUE_END
-   };
-   return debug_dump_enum(names, prim);
-}
-
-
 
 #ifdef DEBUG
 int fl_indent = 0;
diff --git a/src/gallium/auxiliary/util/u_prim.c 
b/src/gallium/auxiliary/util/u_prim.c
new file mode 100644
index 000..cbd48e26ab6
--- /dev/null
+++ b/src/gallium/auxiliary/util/u_prim.c
@@ -0,0 +1,48 @@
+/* Copyright (c) 2008 VMware, Inc.
+ * Copyright © 2018 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+ * SOFTWARE.
+ */
+
+#include "u_prim.h"
+
+
+/** Return string name of given primitive type */
+const char *
+u_prim_name(enum pipe_prim_type prim)
+{
+   static const struct debug_named_value names[] = {
+  DEBUG_NAMED_VALUE(PIPE_PRIM_POINTS),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_LINES),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_LOOP),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_FAN),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_QUADS),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_QUAD_STRIP),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_POLYGON),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_LINES_ADJACENCY),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_LINE_STRIP_ADJACENCY),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLES_ADJACENCY),
+  DEBUG_NAMED_VALUE(PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY),
+  DEBUG_NAMED_VALUE_END
+   };
+   

[Mesa-dev] [PATCH 08/11] gallium/util: remove u_inlines.h from u_debug.c

2018-10-29 Thread Dylan Baker
It's not used, and I'm not pulling u_inlines into src/util.
---
 src/gallium/auxiliary/util/u_debug.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_debug.c 
b/src/gallium/auxiliary/util/u_debug.c
index 2584a1f297d..f6ed0138c1f 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -33,7 +33,6 @@
 #include "util/u_debug.h"
 #include "pipe/p_format.h"
 #include "pipe/p_state.h"
-#include "util/u_inlines.h"
 #include "util/u_string.h"
 #include "util/u_math.h"
 #include 
-- 
2.19.1

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


[Mesa-dev] [PATCH 11/11] util: move u_cpu_detect to util

2018-10-29 Thread Dylan Baker
CC: v...@freedesktop.org
CC: Roland Scheidegger 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107870
Fixes: 80825abb5d1a7491035880253ffd531c55acae6b
   ("move u_math to src/util")
---

Roland, you noticed that the previous attempt to fix this issue broke windows.
I've run scons with mingw cross compilation on Linux, but if you could test that
this doesn't break the build on windows I'd appreciate it.

 src/gallium/auxiliary/Makefile.sources  | 2 --
 src/gallium/auxiliary/meson.build   | 2 --
 src/util/Makefile.sources   | 2 ++
 src/util/meson.build| 2 ++
 src/{gallium/auxiliary => }/util/u_cpu_detect.c | 0
 src/{gallium/auxiliary => }/util/u_cpu_detect.h | 0
 6 files changed, 4 insertions(+), 4 deletions(-)
 rename src/{gallium/auxiliary => }/util/u_cpu_detect.c (100%)
 rename src/{gallium/auxiliary => }/util/u_cpu_detect.h (100%)

diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index 72cf2ec6443..b60b25a0e4c 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -222,8 +222,6 @@ C_SOURCES := \
util/u_box.h \
util/u_cache.c \
util/u_cache.h \
-   util/u_cpu_detect.c \
-   util/u_cpu_detect.h \
util/u_debug_gallium.h \
util/u_debug_gallium.c \
util/u_debug_describe.c \
diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index 1b5eb4d155d..e1497992b17 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -242,8 +242,6 @@ files_libgallium = files(
   'util/u_box.h',
   'util/u_cache.c',
   'util/u_cache.h',
-  'util/u_cpu_detect.c',
-  'util/u_cpu_detect.h',
   'util/u_debug_gallium.h',
   'util/u_debug_gallium.c',
   'util/u_debug_describe.c',
diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources
index af2ad85da19..b4d23947ab7 100644
--- a/src/util/Makefile.sources
+++ b/src/util/Makefile.sources
@@ -70,6 +70,8 @@ MESA_UTIL_FILES := \
u_vector.h \
u_debug.c \
u_debug.h \
+   u_cpu_detect.c \
+   u_cpu_detect.h \
vma.c \
vma.h
 
diff --git a/src/util/meson.build b/src/util/meson.build
index 3b84f42..7caea27d660 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -94,6 +94,8 @@ files_mesa_util = files(
   'u_math.h',
   'u_debug.c',
   'u_debug.h',
+  'u_cpu_detect.c',
+  'u_cpu_detect.h',
   'vma.c',
   'vma.h',
 )
diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/util/u_cpu_detect.c
similarity index 100%
rename from src/gallium/auxiliary/util/u_cpu_detect.c
rename to src/util/u_cpu_detect.c
diff --git a/src/gallium/auxiliary/util/u_cpu_detect.h b/src/util/u_cpu_detect.h
similarity index 100%
rename from src/gallium/auxiliary/util/u_cpu_detect.h
rename to src/util/u_cpu_detect.h
-- 
2.19.1

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


[Mesa-dev] [PATCH 07/11] gallium/util: remove p_format.h from u_debug.h

2018-10-29 Thread Dylan Baker
---
 src/gallium/auxiliary/tgsi/tgsi_ureg.h | 1 +
 src/gallium/auxiliary/util/u_debug.h   | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h 
b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
index c974ed02069..f23e3fa98f8 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
@@ -28,6 +28,7 @@
 #ifndef TGSI_UREG_H
 #define TGSI_UREG_H
 
+#include "pipe/p_format.h"
 #include "pipe/p_compiler.h"
 #include "pipe/p_shader_tokens.h"
 #include "util/u_debug.h"
diff --git a/src/gallium/auxiliary/util/u_debug.h 
b/src/gallium/auxiliary/util/u_debug.h
index 05ee08d9214..bd946e6b01d 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -46,7 +46,6 @@
 #include 
 #endif
 
-#include "pipe/p_format.h"
 #include "pipe/p_defines.h"
 
 
-- 
2.19.1

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


[Mesa-dev] [PATCH 10/11] util: Move u_debug to utils

2018-10-29 Thread Dylan Baker
This needs to be tested with autotools and scons
---
 src/gallium/auxiliary/Makefile.sources  | 2 --
 src/gallium/auxiliary/meson.build   | 2 --
 src/gallium/auxiliary/util/u_cpu_detect.c   | 2 +-
 src/gallium/auxiliary/util/u_debug_stack.c  | 2 +-
 src/gallium/auxiliary/util/u_debug_symbol.c | 2 +-
 src/gallium/auxiliary/util/u_format_zs.c| 1 -
 src/gallium/auxiliary/util/u_log.h  | 2 +-
 src/util/Makefile.sources   | 2 ++
 src/util/meson.build| 2 ++
 src/{gallium/auxiliary => }/util/u_debug.c  | 0
 src/{gallium/auxiliary => }/util/u_debug.h  | 0
 11 files changed, 8 insertions(+), 9 deletions(-)
 rename src/{gallium/auxiliary => }/util/u_debug.c (100%)
 rename src/{gallium/auxiliary => }/util/u_debug.h (100%)

diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index 75df7d0717a..72cf2ec6443 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -224,8 +224,6 @@ C_SOURCES := \
util/u_cache.h \
util/u_cpu_detect.c \
util/u_cpu_detect.h \
-   util/u_debug.c \
-   util/u_debug.h \
util/u_debug_gallium.h \
util/u_debug_gallium.c \
util/u_debug_describe.c \
diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index 9c158b6b373..1b5eb4d155d 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -244,8 +244,6 @@ files_libgallium = files(
   'util/u_cache.h',
   'util/u_cpu_detect.c',
   'util/u_cpu_detect.h',
-  'util/u_debug.c',
-  'util/u_debug.h',
   'util/u_debug_gallium.h',
   'util/u_debug_gallium.c',
   'util/u_debug_describe.c',
diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c 
b/src/gallium/auxiliary/util/u_cpu_detect.c
index 751443f06f9..4dbb4d8fb58 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -34,7 +34,7 @@
 
 #include "pipe/p_config.h"
 
-#include "u_debug.h"
+#include "util/u_debug.h"
 #include "u_cpu_detect.h"
 #include "c11/threads.h"
 
diff --git a/src/gallium/auxiliary/util/u_debug_stack.c 
b/src/gallium/auxiliary/util/u_debug_stack.c
index b1d4cfea6c1..235e116671b 100644
--- a/src/gallium/auxiliary/util/u_debug_stack.c
+++ b/src/gallium/auxiliary/util/u_debug_stack.c
@@ -32,7 +32,7 @@
  * @author Jose Fonseca 
  */
 
-#include "u_debug.h"
+#include "util/u_debug.h"
 #include "u_debug_symbol.h"
 #include "u_debug_stack.h"
 
diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c 
b/src/gallium/auxiliary/util/u_debug_symbol.c
index 84760430489..22e6c8ce771 100644
--- a/src/gallium/auxiliary/util/u_debug_symbol.c
+++ b/src/gallium/auxiliary/util/u_debug_symbol.c
@@ -36,7 +36,7 @@
 #include "os/os_thread.h"
 #include "util/u_string.h"
 
-#include "u_debug.h"
+#include "util/u_debug.h"
 #include "u_debug_symbol.h"
 #include "u_hash_table.h"
 
diff --git a/src/gallium/auxiliary/util/u_format_zs.c 
b/src/gallium/auxiliary/util/u_format_zs.c
index 4b801d2dcf7..ff584769d12 100644
--- a/src/gallium/auxiliary/util/u_format_zs.c
+++ b/src/gallium/auxiliary/util/u_format_zs.c
@@ -26,7 +26,6 @@
  **/
 
 
-#include "u_debug.h"
 #include "u_format_zs.h"
 #include "util/u_math.h"
 
diff --git a/src/gallium/auxiliary/util/u_log.h 
b/src/gallium/auxiliary/util/u_log.h
index 09c47caee55..90f5d0f4de1 100644
--- a/src/gallium/auxiliary/util/u_log.h
+++ b/src/gallium/auxiliary/util/u_log.h
@@ -47,7 +47,7 @@
 
 #include 
 
-#include "u_debug.h"
+#include "util/u_debug.h"
 
 struct u_log_page;
 struct u_log_auto_logger;
diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources
index b1dad51cbe6..af2ad85da19 100644
--- a/src/util/Makefile.sources
+++ b/src/util/Makefile.sources
@@ -68,6 +68,8 @@ MESA_UTIL_FILES := \
u_thread.h \
u_vector.c \
u_vector.h \
+   u_debug.c \
+   u_debug.h \
vma.c \
vma.h
 
diff --git a/src/util/meson.build b/src/util/meson.build
index cf173ee2bd5..3b84f42 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -92,6 +92,8 @@ files_mesa_util = files(
   'u_vector.h',
   'u_math.c',
   'u_math.h',
+  'u_debug.c',
+  'u_debug.h',
   'vma.c',
   'vma.h',
 )
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/util/u_debug.c
similarity index 100%
rename from src/gallium/auxiliary/util/u_debug.c
rename to src/util/u_debug.c
diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/util/u_debug.h
similarity index 100%
rename from src/gallium/auxiliary/util/u_debug.h
rename to src/util/u_debug.h
-- 
2.19.1

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


[Mesa-dev] [PATCH 02/11] gallium/util: start splitting u_debug into generic and gallium specific components

2018-10-29 Thread Dylan Baker
In order to pull u_debug into src/util we need to break the generically
useful bits from the bits that are tightly coupled to gallium.
---
 src/gallium/auxiliary/Makefile.sources   |  2 +
 src/gallium/auxiliary/meson.build|  2 +
 src/gallium/auxiliary/util/u_debug.c | 10 -
 src/gallium/auxiliary/util/u_debug.h |  5 ---
 src/gallium/auxiliary/util/u_debug_gallium.c | 42 ++
 src/gallium/auxiliary/util/u_debug_gallium.h | 46 
 src/gallium/auxiliary/util/u_pack_color.h|  2 +-
 7 files changed, 93 insertions(+), 16 deletions(-)
 create mode 100644 src/gallium/auxiliary/util/u_debug_gallium.c
 create mode 100644 src/gallium/auxiliary/util/u_debug_gallium.h

diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index 94851210142..923ffb2383c 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -228,6 +228,8 @@ C_SOURCES := \
util/u_cpu_detect.h \
util/u_debug.c \
util/u_debug.h \
+   util/u_debug_gallium.h \
+   util/u_debug_gallium.c \
util/u_debug_describe.c \
util/u_debug_describe.h \
util/u_debug_flush.c \
diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index e79089a7d00..656955c621a 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -248,6 +248,8 @@ files_libgallium = files(
   'util/u_cpu_detect.h',
   'util/u_debug.c',
   'util/u_debug.h',
+  'util/u_debug_gallium.h',
+  'util/u_debug_gallium.c',
   'util/u_debug_describe.c',
   'util/u_debug_describe.h',
   'util/u_debug_flush.c',
diff --git a/src/gallium/auxiliary/util/u_debug.c 
b/src/gallium/auxiliary/util/u_debug.c
index 8962050b1d5..f17cb1b58f5 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -35,7 +35,6 @@
 #include "pipe/p_format.h"
 #include "pipe/p_state.h"
 #include "util/u_inlines.h"
-#include "util/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_string.h"
 #include "util/u_math.h"
@@ -403,15 +402,6 @@ debug_dump_flags(const struct debug_named_value *names, 
unsigned long value)
 }
 
 
-#ifdef DEBUG
-void
-debug_print_format(const char *msg, unsigned fmt )
-{
-   debug_printf("%s: %s\n", msg, util_format_name(fmt));
-}
-#endif
-
-
 
 #ifdef DEBUG
 int fl_indent = 0;
diff --git a/src/gallium/auxiliary/util/u_debug.h 
b/src/gallium/auxiliary/util/u_debug.h
index 4c3b8ba171c..6d1e92b7b97 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -131,13 +131,8 @@ debug_printf(const char *format, ...)
  * messages.
  */
 void debug_print_blob( const char *name, const void *blob, unsigned size );
-
-/* Print a message along with a prettified format string
- */
-void debug_print_format(const char *msg, unsigned fmt );
 #else
 #define debug_print_blob(_name, _blob, _size) ((void)0)
-#define debug_print_format(_msg, _fmt) ((void)0)
 #endif
 
 
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.c 
b/src/gallium/auxiliary/util/u_debug_gallium.c
new file mode 100644
index 000..977e19375ba
--- /dev/null
+++ b/src/gallium/auxiliary/util/u_debug_gallium.c
@@ -0,0 +1,42 @@
+/**
+ *
+ * Copyright 2008 VMware, Inc.
+ * Copyright (c) 2008 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * 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, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or 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 NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+
+#include "util/u_debug.h"
+#include "u_debug_gallium.h"
+#include "u_format.h"
+
+#ifdef DEBUG
+
+void
+debug_print_format(const char *msg, unsigned fmt)
+{
+   debug_printf("%s: %s\n", msg, util_format_name(fmt));
+}
+
+#endif
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.h 
b/src/gallium/auxiliary/util/u_debug_gallium.h

[Mesa-dev] [PATCH 09/11] util: Move os_misc to util

2018-10-29 Thread Dylan Baker
this is needed by u_debug
---
 src/gallium/auxiliary/Makefile.sources   | 2 --
 src/gallium/auxiliary/meson.build| 2 --
 src/gallium/auxiliary/util/u_debug.h | 2 +-
 src/gallium/drivers/i915/i915_screen.c   | 2 +-
 src/gallium/drivers/llvmpipe/lp_screen.c | 2 +-
 src/gallium/drivers/softpipe/sp_screen.c | 2 +-
 src/gallium/drivers/v3d/v3d_screen.c | 2 +-
 src/gallium/drivers/vc4/vc4_screen.c | 2 +-
 src/util/Makefile.sources| 2 ++
 src/util/meson.build | 2 ++
 src/{gallium/auxiliary/os => util}/os_misc.c | 0
 src/{gallium/auxiliary/os => util}/os_misc.h | 0
 12 files changed, 10 insertions(+), 10 deletions(-)
 rename src/{gallium/auxiliary/os => util}/os_misc.c (100%)
 rename src/{gallium/auxiliary/os => util}/os_misc.h (100%)

diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index 923ffb2383c..75df7d0717a 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -106,8 +106,6 @@ C_SOURCES := \
os/os_memory_debug.h \
os/os_memory_stdc.h \
os/os_memory.h \
-   os/os_misc.c \
-   os/os_misc.h \
os/os_mman.h \
os/os_process.c \
os/os_process.h \
diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index 656955c621a..9c158b6b373 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -126,8 +126,6 @@ files_libgallium = files(
   'os/os_memory_debug.h',
   'os/os_memory_stdc.h',
   'os/os_memory.h',
-  'os/os_misc.c',
-  'os/os_misc.h',
   'os/os_mman.h',
   'os/os_process.c',
   'os/os_process.h',
diff --git a/src/gallium/auxiliary/util/u_debug.h 
b/src/gallium/auxiliary/util/u_debug.h
index bd946e6b01d..b3505caebfd 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -39,7 +39,7 @@
 #define U_DEBUG_H_
 
 
-#include "os/os_misc.h"
+#include "util/os_misc.h"
 
 #if defined(PIPE_OS_HAIKU)
 /* Haiku provides debug_printf in libroot with OS.h */
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index 169f502f05a..a7b4a43c015 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -27,7 +27,7 @@
 
 
 #include "draw/draw_context.h"
-#include "os/os_misc.h"
+#include "util/os_misc.h"
 #include "util/u_format.h"
 #include "util/u_format_s3tc.h"
 #include "util/u_inlines.h"
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
b/src/gallium/drivers/llvmpipe/lp_screen.c
index f706bf9c9c4..c95016a6cbe 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -38,7 +38,7 @@
 #include "draw/draw_context.h"
 #include "gallivm/lp_bld_type.h"
 
-#include "os/os_misc.h"
+#include "util/os_misc.h"
 #include "util/os_time.h"
 #include "lp_texture.h"
 #include "lp_fence.h"
diff --git a/src/gallium/drivers/softpipe/sp_screen.c 
b/src/gallium/drivers/softpipe/sp_screen.c
index bd8f655838a..44e48cc7ee4 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -31,7 +31,7 @@
 #include "util/u_format_s3tc.h"
 #include "util/u_screen.h"
 #include "util/u_video.h"
-#include "os/os_misc.h"
+#include "util/os_misc.h"
 #include "util/os_time.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_screen.h"
diff --git a/src/gallium/drivers/v3d/v3d_screen.c 
b/src/gallium/drivers/v3d/v3d_screen.c
index 5a8400dcf01..1d59dbfc12a 100644
--- a/src/gallium/drivers/v3d/v3d_screen.c
+++ b/src/gallium/drivers/v3d/v3d_screen.c
@@ -22,7 +22,7 @@
  * IN THE SOFTWARE.
  */
 
-#include "os/os_misc.h"
+#include "util/os_misc.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_screen.h"
 #include "pipe/p_state.h"
diff --git a/src/gallium/drivers/vc4/vc4_screen.c 
b/src/gallium/drivers/vc4/vc4_screen.c
index 13fd5ac5440..14ee6cf09e5 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -22,7 +22,7 @@
  * IN THE SOFTWARE.
  */
 
-#include "os/os_misc.h"
+#include "util/os_misc.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_screen.h"
 #include "pipe/p_state.h"
diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources
index e8558f561f8..b1dad51cbe6 100644
--- a/src/util/Makefile.sources
+++ b/src/util/Makefile.sources
@@ -27,6 +27,8 @@ MESA_UTIL_FILES := \
mesa-sha1.h \
os_time.c \
os_time.h \
+   os_misc.c \
+   os_misc.h \
u_process.c \
u_process.h \
sha1/sha1.c \
diff --git a/src/util/meson.build b/src/util/meson.build
index 49d84c16ebe..cf173ee2bd5 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -51,6 +51,8 @@ files_mesa_util = files(
   'mesa-sha1.h',
   'os_time.c',
   'os_time.h',
+  'os_misc.c',
+  'os_misc.h',
   'u_process.c',
   'u_process.h',
   'sha1/sha1.c',
diff --git a/src/gallium/auxiliary/os/os_misc.c 

[Mesa-dev] [PATCH 00/11] Fix MacOS build

2018-10-29 Thread Dylan Baker
After pulling u_math into src/util to fix 32 bit windows builds of nir, I broke
the MacOS build. This series fixes that platform by pulling down cpu_info into
src/util as well. I would have liked to replace some of the duplication that
cpu_info has with core mesa bits, but this is really needed before the 18.3
branch point.

Dylan Baker (11):
  gallium: split u_prim_name out of u_debug.h
  gallium/util: start splitting u_debug into generic and gallium
specific components
  gallium/util: move debug_print_usage_enum to the u_debug_gallium
  gallium/util: move debug_print_bind_flags to u_debug_gallium
  gallium/util: move debug_print_tranfer_flags to u_debug_galilum
  gallium/util: move memory debug declarations into u_debug_gallium
  gallium/util: remove p_format.h from u_debug.h
  gallium/util: remove u_inlines.h from u_debug.c
  util: Move os_misc to util
  util: Move u_debug to utils
  util: move u_cpu_detect to util

 src/gallium/auxiliary/Makefile.sources|   9 +-
 src/gallium/auxiliary/meson.build |   9 +-
 src/gallium/auxiliary/tgsi/tgsi_ureg.h|   1 +
 src/gallium/auxiliary/util/u_debug_gallium.c  | 107 +
 .../{os/os_misc.h => util/u_debug_gallium.h}  |  79 -
 src/gallium/auxiliary/util/u_debug_memory.c   |   1 +
 src/gallium/auxiliary/util/u_debug_stack.c|   2 +-
 src/gallium/auxiliary/util/u_debug_symbol.c   |   2 +-
 src/gallium/auxiliary/util/u_format_zs.c  |   1 -
 src/gallium/auxiliary/util/u_log.h|   2 +-
 src/gallium/auxiliary/util/u_pack_color.h |   2 +-
 src/gallium/auxiliary/util/u_prim.c   |  48 
 src/gallium/drivers/i915/i915_screen.c|   2 +-
 src/gallium/drivers/llvmpipe/lp_screen.c  |   2 +-
 src/gallium/drivers/softpipe/sp_screen.c  |   2 +-
 src/gallium/drivers/v3d/v3d_screen.c  |   2 +-
 src/gallium/drivers/vc4/vc4_screen.c  |   2 +-
 src/gallium/state_trackers/wgl/stw_device.c   |   1 +
 src/util/Makefile.sources |   6 +
 src/util/meson.build  |   6 +
 src/{gallium/auxiliary/os => util}/os_misc.c  |   0
 src/{gallium/auxiliary/os => util}/os_misc.h  |   0
 .../auxiliary => }/util/u_cpu_detect.c|   2 +-
 .../auxiliary => }/util/u_cpu_detect.h|   0
 src/{gallium/auxiliary => }/util/u_debug.c| 108 --
 src/{gallium/auxiliary => }/util/u_debug.h|  25 +---
 26 files changed, 209 insertions(+), 212 deletions(-)
 create mode 100644 src/gallium/auxiliary/util/u_debug_gallium.c
 copy src/gallium/auxiliary/{os/os_misc.h => util/u_debug_gallium.h} (54%)
 create mode 100644 src/gallium/auxiliary/util/u_prim.c
 rename src/{gallium/auxiliary/os => util}/os_misc.c (100%)
 rename src/{gallium/auxiliary/os => util}/os_misc.h (100%)
 rename src/{gallium/auxiliary => }/util/u_cpu_detect.c (99%)
 rename src/{gallium/auxiliary => }/util/u_cpu_detect.h (100%)
 rename src/{gallium/auxiliary => }/util/u_debug.c (77%)
 rename src/{gallium/auxiliary => }/util/u_debug.h (95%)

-- 
2.19.1

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


[Mesa-dev] [PATCH 06/11] gallium/util: move memory debug declarations into u_debug_gallium

2018-10-29 Thread Dylan Baker
---
 src/gallium/auxiliary/util/u_debug.c | 1 -
 src/gallium/auxiliary/util/u_debug.h | 7 ---
 src/gallium/auxiliary/util/u_debug_gallium.h | 6 ++
 src/gallium/auxiliary/util/u_debug_memory.c  | 1 +
 src/gallium/state_trackers/wgl/stw_device.c  | 1 +
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug.c 
b/src/gallium/auxiliary/util/u_debug.c
index 081ff10f210..2584a1f297d 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -34,7 +34,6 @@
 #include "pipe/p_format.h"
 #include "pipe/p_state.h"
 #include "util/u_inlines.h"
-#include "util/u_memory.h"
 #include "util/u_string.h"
 #include "util/u_math.h"
 #include 
diff --git a/src/gallium/auxiliary/util/u_debug.h 
b/src/gallium/auxiliary/util/u_debug.h
index 5be648e3f20..05ee08d9214 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -454,13 +454,6 @@ debug_get_option_ ## sufix (void) \
 }
 
 
-unsigned long
-debug_memory_begin(void);
-
-void 
-debug_memory_end(unsigned long beginning);
-
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.h 
b/src/gallium/auxiliary/util/u_debug_gallium.h
index df4e919c803..0710ce2b703 100644
--- a/src/gallium/auxiliary/util/u_debug_gallium.h
+++ b/src/gallium/auxiliary/util/u_debug_gallium.h
@@ -35,6 +35,12 @@
 extern "C" {
 #endif
 
+unsigned long
+debug_memory_begin(void);
+
+void 
+debug_memory_end(unsigned long beginning);
+
 #ifdef DEBUG
 void debug_print_format(const char *msg, unsigned fmt);
 #else
diff --git a/src/gallium/auxiliary/util/u_debug_memory.c 
b/src/gallium/auxiliary/util/u_debug_memory.c
index 0a52daa5b47..0c822369a00 100644
--- a/src/gallium/auxiliary/util/u_debug_memory.c
+++ b/src/gallium/auxiliary/util/u_debug_memory.c
@@ -41,6 +41,7 @@
 #include "os/os_thread.h"
 
 #include "util/u_debug.h"
+#include "util/u_debug_gallium.h"
 #include "util/u_debug_stack.h"
 #include "util/list.h"
 
diff --git a/src/gallium/state_trackers/wgl/stw_device.c 
b/src/gallium/state_trackers/wgl/stw_device.c
index e43f12f7f2b..f04689a974d 100644
--- a/src/gallium/state_trackers/wgl/stw_device.c
+++ b/src/gallium/state_trackers/wgl/stw_device.c
@@ -29,6 +29,7 @@
 
 #include "glapi/glapi.h"
 #include "util/u_debug.h"
+#include "util/u_debug_gallium.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "pipe/p_screen.h"
-- 
2.19.1

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


[Mesa-dev] [PATCH 05/11] gallium/util: move debug_print_tranfer_flags to u_debug_galilum

2018-10-29 Thread Dylan Baker
This also appears to be unused.
---
 src/gallium/auxiliary/util/u_debug.c | 18 --
 src/gallium/auxiliary/util/u_debug.h |  3 ---
 src/gallium/auxiliary/util/u_debug_gallium.c | 13 +
 src/gallium/auxiliary/util/u_debug_gallium.h |  3 +++
 4 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug.c 
b/src/gallium/auxiliary/util/u_debug.c
index 7e28746890e..081ff10f210 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -31,7 +31,6 @@
 
 #include "pipe/p_compiler.h"
 #include "util/u_debug.h"
-#include "util/u_dump.h"
 #include "pipe/p_format.h"
 #include "pipe/p_state.h"
 #include "util/u_inlines.h"
@@ -442,20 +441,3 @@ debug_funclog_enter_exit(const char* f, UNUSED const int 
line,
debug_printf("%s\n", f);
 }
 #endif
-
-
-
-#ifdef DEBUG
-/**
- * Print PIPE_TRANSFER_x flags with a message.
- */
-void
-debug_print_transfer_flags(const char *msg, unsigned usage)
-{
-   debug_printf("%s: ", msg);
-   util_dump_transfer_usage(stdout, usage);
-   printf("\n");
-}
-
-
-#endif
diff --git a/src/gallium/auxiliary/util/u_debug.h 
b/src/gallium/auxiliary/util/u_debug.h
index 2b67a155482..5be648e3f20 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -461,9 +461,6 @@ void
 debug_memory_end(unsigned long beginning);
 
 
-void
-debug_print_transfer_flags(const char *msg, unsigned usage);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.c 
b/src/gallium/auxiliary/util/u_debug_gallium.c
index 0f2f86ec1cd..9dad0c27c55 100644
--- a/src/gallium/auxiliary/util/u_debug_gallium.c
+++ b/src/gallium/auxiliary/util/u_debug_gallium.c
@@ -29,6 +29,7 @@
 
 #include "util/u_debug.h"
 #include "u_debug_gallium.h"
+#include "u_dump.h"
 #include "u_format.h"
 
 #ifdef DEBUG
@@ -40,6 +41,18 @@ debug_print_format(const char *msg, unsigned fmt)
 }
 
 
+/**
+ * Print PIPE_TRANSFER_x flags with a message.
+ */
+void
+debug_print_transfer_flags(const char *msg, unsigned usage)
+{
+   debug_printf("%s: ", msg);
+   util_dump_transfer_usage(stdout, usage);
+   printf("\n");
+}
+
+
 /**
  * Print PIPE_BIND_x flags with a message.
  */
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.h 
b/src/gallium/auxiliary/util/u_debug_gallium.h
index 450137217b6..df4e919c803 100644
--- a/src/gallium/auxiliary/util/u_debug_gallium.h
+++ b/src/gallium/auxiliary/util/u_debug_gallium.h
@@ -43,6 +43,9 @@ void debug_print_format(const char *msg, unsigned fmt);
 
 #ifdef DEBUG
 
+void
+debug_print_transfer_flags(const char *msg, unsigned usage);
+
 void
 debug_print_bind_flags(const char *msg, unsigned usage);
 
-- 
2.19.1

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


[Mesa-dev] [PATCH 04/11] gallium/util: move debug_print_bind_flags to u_debug_gallium

2018-10-29 Thread Dylan Baker
This also appears to be unused.
---
 src/gallium/auxiliary/util/u_debug.c | 33 
 src/gallium/auxiliary/util/u_debug.h |  4 ---
 src/gallium/auxiliary/util/u_debug_gallium.c | 33 
 src/gallium/auxiliary/util/u_debug_gallium.h |  3 ++
 4 files changed, 36 insertions(+), 37 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug.c 
b/src/gallium/auxiliary/util/u_debug.c
index ece3cf74c18..7e28746890e 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -458,37 +458,4 @@ debug_print_transfer_flags(const char *msg, unsigned usage)
 }
 
 
-/**
- * Print PIPE_BIND_x flags with a message.
- */
-void
-debug_print_bind_flags(const char *msg, unsigned usage)
-{
-   static const struct debug_named_value names[] = {
-  DEBUG_NAMED_VALUE(PIPE_BIND_DEPTH_STENCIL),
-  DEBUG_NAMED_VALUE(PIPE_BIND_RENDER_TARGET),
-  DEBUG_NAMED_VALUE(PIPE_BIND_BLENDABLE),
-  DEBUG_NAMED_VALUE(PIPE_BIND_SAMPLER_VIEW),
-  DEBUG_NAMED_VALUE(PIPE_BIND_VERTEX_BUFFER),
-  DEBUG_NAMED_VALUE(PIPE_BIND_INDEX_BUFFER),
-  DEBUG_NAMED_VALUE(PIPE_BIND_CONSTANT_BUFFER),
-  DEBUG_NAMED_VALUE(PIPE_BIND_DISPLAY_TARGET),
-  DEBUG_NAMED_VALUE(PIPE_BIND_STREAM_OUTPUT),
-  DEBUG_NAMED_VALUE(PIPE_BIND_CURSOR),
-  DEBUG_NAMED_VALUE(PIPE_BIND_CUSTOM),
-  DEBUG_NAMED_VALUE(PIPE_BIND_GLOBAL),
-  DEBUG_NAMED_VALUE(PIPE_BIND_SHADER_BUFFER),
-  DEBUG_NAMED_VALUE(PIPE_BIND_SHADER_IMAGE),
-  DEBUG_NAMED_VALUE(PIPE_BIND_COMPUTE_RESOURCE),
-  DEBUG_NAMED_VALUE(PIPE_BIND_COMMAND_ARGS_BUFFER),
-  DEBUG_NAMED_VALUE(PIPE_BIND_SCANOUT),
-  DEBUG_NAMED_VALUE(PIPE_BIND_SHARED),
-  DEBUG_NAMED_VALUE(PIPE_BIND_LINEAR),
-  DEBUG_NAMED_VALUE_END
-   };
-
-   debug_printf("%s: %s\n", msg, debug_dump_flags(names, usage));
-}
-
-
 #endif
diff --git a/src/gallium/auxiliary/util/u_debug.h 
b/src/gallium/auxiliary/util/u_debug.h
index 6cacec6740d..2b67a155482 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -464,10 +464,6 @@ debug_memory_end(unsigned long beginning);
 void
 debug_print_transfer_flags(const char *msg, unsigned usage);
 
-void
-debug_print_bind_flags(const char *msg, unsigned usage);
-
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.c 
b/src/gallium/auxiliary/util/u_debug_gallium.c
index 389c8f848a5..0f2f86ec1cd 100644
--- a/src/gallium/auxiliary/util/u_debug_gallium.c
+++ b/src/gallium/auxiliary/util/u_debug_gallium.c
@@ -40,6 +40,39 @@ debug_print_format(const char *msg, unsigned fmt)
 }
 
 
+/**
+ * Print PIPE_BIND_x flags with a message.
+ */
+void
+debug_print_bind_flags(const char *msg, unsigned usage)
+{
+   static const struct debug_named_value names[] = {
+  DEBUG_NAMED_VALUE(PIPE_BIND_DEPTH_STENCIL),
+  DEBUG_NAMED_VALUE(PIPE_BIND_RENDER_TARGET),
+  DEBUG_NAMED_VALUE(PIPE_BIND_BLENDABLE),
+  DEBUG_NAMED_VALUE(PIPE_BIND_SAMPLER_VIEW),
+  DEBUG_NAMED_VALUE(PIPE_BIND_VERTEX_BUFFER),
+  DEBUG_NAMED_VALUE(PIPE_BIND_INDEX_BUFFER),
+  DEBUG_NAMED_VALUE(PIPE_BIND_CONSTANT_BUFFER),
+  DEBUG_NAMED_VALUE(PIPE_BIND_DISPLAY_TARGET),
+  DEBUG_NAMED_VALUE(PIPE_BIND_STREAM_OUTPUT),
+  DEBUG_NAMED_VALUE(PIPE_BIND_CURSOR),
+  DEBUG_NAMED_VALUE(PIPE_BIND_CUSTOM),
+  DEBUG_NAMED_VALUE(PIPE_BIND_GLOBAL),
+  DEBUG_NAMED_VALUE(PIPE_BIND_SHADER_BUFFER),
+  DEBUG_NAMED_VALUE(PIPE_BIND_SHADER_IMAGE),
+  DEBUG_NAMED_VALUE(PIPE_BIND_COMPUTE_RESOURCE),
+  DEBUG_NAMED_VALUE(PIPE_BIND_COMMAND_ARGS_BUFFER),
+  DEBUG_NAMED_VALUE(PIPE_BIND_SCANOUT),
+  DEBUG_NAMED_VALUE(PIPE_BIND_SHARED),
+  DEBUG_NAMED_VALUE(PIPE_BIND_LINEAR),
+  DEBUG_NAMED_VALUE_END
+   };
+
+   debug_printf("%s: %s\n", msg, debug_dump_flags(names, usage));
+}
+
+
 /**
  * Print PIPE_USAGE_x enum values with a message.
  */
diff --git a/src/gallium/auxiliary/util/u_debug_gallium.h 
b/src/gallium/auxiliary/util/u_debug_gallium.h
index 1e725275834..450137217b6 100644
--- a/src/gallium/auxiliary/util/u_debug_gallium.h
+++ b/src/gallium/auxiliary/util/u_debug_gallium.h
@@ -43,6 +43,9 @@ void debug_print_format(const char *msg, unsigned fmt);
 
 #ifdef DEBUG
 
+void
+debug_print_bind_flags(const char *msg, unsigned usage);
+
 void
 debug_print_usage_enum(const char *msg, enum pipe_resource_usage usage);
 
-- 
2.19.1

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


Re: [Mesa-dev] [PATCH] intel/blorp: Define the clear value bounds for HiZ clears

2018-10-29 Thread Juan A. Suarez Romero
On Mon, 2018-10-29 at 11:20 -0700, Nanley Chery wrote:
> On Mon, Oct 29, 2018 at 08:37:13AM -0500, Jason Ekstrand wrote:
> > That's likely because Nanley forgot to CC this one too stable:
> > 
> > https://cgit.freedesktop.org/mesa/mesa/commit/?id=5bcf479524b96554cab7d2429dacf650b4054638
> > 
> 
> Our submittingpatches.html doc says that using the Fixes tag should be
> enough. Did I miss something here?
> 

No, the fixes tag is correct. In fact the commit that Jason mentions is this
one.


> -Nanley
> 
> > On October 29, 2018 06:49:47 "Juan A. Suarez Romero" 
> > wrote:
> > 
> > > On Thu, 2018-10-25 at 16:25 -0700, nanleych...@gmail.com wrote:
> > > > From: Nanley Chery 
> > > > 
> > > > Follow the restriction of making sure the clear value is between the min
> > > > and max values defined in CC_VIEWPORT. Avoids a simulator warning for
> > > > some piglit tests, one of them being:
> > > > 
> > > > ./bin/depthstencil-render-miplevels 146 d=z32f_s8
> > > > 
> > > > Jason found this to make a GPU hang go away on SKL.
> > > > 
> > > > Fixes: 09948151ab1d5184b4dd9052bb1f710fa1e00a7b
> > > >("intel/blorp: Add the BDW+ optimized HZ_OP sequence to BLORP")
> > > 
> > > 
> > > As 09948151ab1 ("intel/blorp: Add the BDW+ optimized HZ_OP sequence to 
> > > BLORP")
> > > is included in 18.2 branch, adding this to 18.2 queue.
> > > 
> > > It doesn't apply cleanly, so I've fixed the conflicts. You can check the 
> > > fixed
> > > commit at:
> > > 
> > > 
> > > https://gitlab.freedesktop.org/mesa/mesa/commit/aaff8c7a0ed55d71e9dd0a6fef6905d6a2536c3f
> > > 
> > >   J.A.
> > > 
> > > > ---
> > > >  src/intel/blorp/blorp_genX_exec.h | 14 ++
> > > >  1 file changed, 14 insertions(+)
> > > > 
> > > > diff --git a/src/intel/blorp/blorp_genX_exec.h
> > > > b/src/intel/blorp/blorp_genX_exec.h
> > > > index 50341ab0ecf..7a8c45dbee5 100644
> > > > --- a/src/intel/blorp/blorp_genX_exec.h
> > > > +++ b/src/intel/blorp/blorp_genX_exec.h
> > > > @@ -1628,6 +1628,20 @@ blorp_emit_gen8_hiz_op(struct blorp_batch *batch,
> > > >  */
> > > > blorp_emit_3dstate_multisample(batch, params);
> > > > 
> > > > +   /* From the BDW PRM Volume 7, Depth Buffer Clear:
> > > > +*
> > > > +*The clear value must be between the min and max depth values
> > > > +*(inclusive) defined in the CC_VIEWPORT. If the depth buffer 
> > > > format is
> > > > +*D32_FLOAT, then +/-DENORM values are also allowed.
> > > > +*
> > > > +* Set the bounds to match our hardware limits, [0.0, 1.0].
> > > > +*/
> > > > +   if (params->depth.enabled && params->hiz_op == 
> > > > ISL_AUX_OP_FAST_CLEAR) {
> > > > +  assert(params->depth.clear_color.f32[0] >= 0.0f);
> > > > +  assert(params->depth.clear_color.f32[0] <= 1.0f);
> > > > +  blorp_emit_cc_viewport(batch);
> > > > +   }
> > > > +
> > > > /* If we can't alter the depth stencil config and multiple layers 
> > > > are
> > > >  * involved, the HiZ op will fail. This is because the op requires 
> > > > that a
> > > >  * new config is emitted for each additional layer.
> > > 
> > > ___
> > > mesa-dev mailing list
> > > mesa-dev@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > 
> > 
> > 
> 
> 

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


Re: [Mesa-dev] [PATCH] intel/blorp: Define the clear value bounds for HiZ clears

2018-10-29 Thread Nanley Chery
On Mon, Oct 29, 2018 at 12:48:50PM +0100, Juan A. Suarez Romero wrote:
> On Thu, 2018-10-25 at 16:25 -0700, nanleych...@gmail.com wrote:
> > From: Nanley Chery 
> > 
> > Follow the restriction of making sure the clear value is between the min
> > and max values defined in CC_VIEWPORT. Avoids a simulator warning for
> > some piglit tests, one of them being:
> > 
> > ./bin/depthstencil-render-miplevels 146 d=z32f_s8
> > 
> > Jason found this to make a GPU hang go away on SKL.
> > 
> > Fixes: 09948151ab1d5184b4dd9052bb1f710fa1e00a7b
> >("intel/blorp: Add the BDW+ optimized HZ_OP sequence to BLORP")
> 
> 
> As 09948151ab1 ("intel/blorp: Add the BDW+ optimized HZ_OP sequence to BLORP")
> is included in 18.2 branch, adding this to 18.2 queue.
> 
> It doesn't apply cleanly, so I've fixed the conflicts. You can check the fixed
> commit at:
> 
> 
> https://gitlab.freedesktop.org/mesa/mesa/commit/aaff8c7a0ed55d71e9dd0a6fef6905d6a2536c3f
> 

Looks good to me. The placement of this instruction in the batch is
different in the stable branch (after 3DSTATE_WM) vs the master branch
(before 3DSTATE_WM). This will cause some noise when diff'ing dumps of
the batches, but it's not a big deal.

-Nanley

>   J.A.
> 
> > ---
> >  src/intel/blorp/blorp_genX_exec.h | 14 ++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/src/intel/blorp/blorp_genX_exec.h 
> > b/src/intel/blorp/blorp_genX_exec.h
> > index 50341ab0ecf..7a8c45dbee5 100644
> > --- a/src/intel/blorp/blorp_genX_exec.h
> > +++ b/src/intel/blorp/blorp_genX_exec.h
> > @@ -1628,6 +1628,20 @@ blorp_emit_gen8_hiz_op(struct blorp_batch *batch,
> >  */
> > blorp_emit_3dstate_multisample(batch, params);
> >  
> > +   /* From the BDW PRM Volume 7, Depth Buffer Clear:
> > +*
> > +*The clear value must be between the min and max depth values
> > +*(inclusive) defined in the CC_VIEWPORT. If the depth buffer 
> > format is
> > +*D32_FLOAT, then +/-DENORM values are also allowed.
> > +*
> > +* Set the bounds to match our hardware limits, [0.0, 1.0].
> > +*/
> > +   if (params->depth.enabled && params->hiz_op == ISL_AUX_OP_FAST_CLEAR) {
> > +  assert(params->depth.clear_color.f32[0] >= 0.0f);
> > +  assert(params->depth.clear_color.f32[0] <= 1.0f);
> > +  blorp_emit_cc_viewport(batch);
> > +   }
> > +
> > /* If we can't alter the depth stencil config and multiple layers are
> >  * involved, the HiZ op will fail. This is because the op requires that 
> > a
> >  * new config is emitted for each additional layer.
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] intel/blorp: Define the clear value bounds for HiZ clears

2018-10-29 Thread Nanley Chery
On Mon, Oct 29, 2018 at 08:37:13AM -0500, Jason Ekstrand wrote:
> That's likely because Nanley forgot to CC this one too stable:
> 
> https://cgit.freedesktop.org/mesa/mesa/commit/?id=5bcf479524b96554cab7d2429dacf650b4054638
> 

Our submittingpatches.html doc says that using the Fixes tag should be
enough. Did I miss something here?

-Nanley

> On October 29, 2018 06:49:47 "Juan A. Suarez Romero" 
> wrote:
> 
> > On Thu, 2018-10-25 at 16:25 -0700, nanleych...@gmail.com wrote:
> > > From: Nanley Chery 
> > > 
> > > Follow the restriction of making sure the clear value is between the min
> > > and max values defined in CC_VIEWPORT. Avoids a simulator warning for
> > > some piglit tests, one of them being:
> > > 
> > > ./bin/depthstencil-render-miplevels 146 d=z32f_s8
> > > 
> > > Jason found this to make a GPU hang go away on SKL.
> > > 
> > > Fixes: 09948151ab1d5184b4dd9052bb1f710fa1e00a7b
> > >("intel/blorp: Add the BDW+ optimized HZ_OP sequence to BLORP")
> > 
> > 
> > As 09948151ab1 ("intel/blorp: Add the BDW+ optimized HZ_OP sequence to 
> > BLORP")
> > is included in 18.2 branch, adding this to 18.2 queue.
> > 
> > It doesn't apply cleanly, so I've fixed the conflicts. You can check the 
> > fixed
> > commit at:
> > 
> > 
> > https://gitlab.freedesktop.org/mesa/mesa/commit/aaff8c7a0ed55d71e9dd0a6fef6905d6a2536c3f
> > 
> > J.A.
> > 
> > > ---
> > >  src/intel/blorp/blorp_genX_exec.h | 14 ++
> > >  1 file changed, 14 insertions(+)
> > > 
> > > diff --git a/src/intel/blorp/blorp_genX_exec.h
> > > b/src/intel/blorp/blorp_genX_exec.h
> > > index 50341ab0ecf..7a8c45dbee5 100644
> > > --- a/src/intel/blorp/blorp_genX_exec.h
> > > +++ b/src/intel/blorp/blorp_genX_exec.h
> > > @@ -1628,6 +1628,20 @@ blorp_emit_gen8_hiz_op(struct blorp_batch *batch,
> > >  */
> > > blorp_emit_3dstate_multisample(batch, params);
> > > 
> > > +   /* From the BDW PRM Volume 7, Depth Buffer Clear:
> > > +*
> > > +*The clear value must be between the min and max depth values
> > > +*(inclusive) defined in the CC_VIEWPORT. If the depth buffer 
> > > format is
> > > +*D32_FLOAT, then +/-DENORM values are also allowed.
> > > +*
> > > +* Set the bounds to match our hardware limits, [0.0, 1.0].
> > > +*/
> > > +   if (params->depth.enabled && params->hiz_op == ISL_AUX_OP_FAST_CLEAR) 
> > > {
> > > +  assert(params->depth.clear_color.f32[0] >= 0.0f);
> > > +  assert(params->depth.clear_color.f32[0] <= 1.0f);
> > > +  blorp_emit_cc_viewport(batch);
> > > +   }
> > > +
> > > /* If we can't alter the depth stencil config and multiple layers are
> > >  * involved, the HiZ op will fail. This is because the op requires 
> > > that a
> > >  * new config is emitted for each additional layer.
> > 
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> 
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/4] intel/sanitize_gpu: add help/gdb options to wrapper

2018-10-29 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 src/intel/tools/intel_sanitize_gpu.in | 55 ++-
 1 file changed, 54 insertions(+), 1 deletion(-)

diff --git a/src/intel/tools/intel_sanitize_gpu.in 
b/src/intel/tools/intel_sanitize_gpu.in
index 3dac954c408..7e4c96d8738 100755
--- a/src/intel/tools/intel_sanitize_gpu.in
+++ b/src/intel/tools/intel_sanitize_gpu.in
@@ -1,4 +1,57 @@
 #!/bin/bash
 # -*- mode: sh -*-
 
-LD_PRELOAD="@install_libexecdir@/libintel_sanitize_gpu.so${LD_PRELOAD:+:$LD_PRELOAD}"
 exec "$@"
+function show_help() {
+cat 

[Mesa-dev] [PATCH 4/4] intel/sanitize_gpu: add debug message on mmap fail

2018-10-29 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 src/intel/tools/intel_sanitize_gpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/intel/tools/intel_sanitize_gpu.c 
b/src/intel/tools/intel_sanitize_gpu.c
index 4f1a2d2ead5..8f4f2ff8ec6 100644
--- a/src/intel/tools/intel_sanitize_gpu.c
+++ b/src/intel/tools/intel_sanitize_gpu.c
@@ -226,8 +226,10 @@ create_with_padding(int fd, struct drm_i915_gem_create 
*create)
};
 
ret = libc_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, _arg);
-   if (ret != 0)
+   if (ret != 0) {
+  intel_logd("Unable to map buffer %d for pad creation.\n", 
create->handle);
   return 0;
+   }
 
noise_values = (uint8_t*) (uintptr_t) mmap_arg.addr_ptr;
fill_noise_buffer(noise_values, create->handle & 0xFF,
-- 
2.19.1

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


[Mesa-dev] [PATCH 3/4] intel/sanitize_gpu: deal with non page multiple buffer sizes

2018-10-29 Thread Lionel Landwerlin
We can only map at page aligned offsets. We got that wrong with buffer
size where (size % 4096) != 0 (anv has a WA buffer of 1024).

Signed-off-by: Lionel Landwerlin 
---
 src/intel/tools/intel_sanitize_gpu.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/intel/tools/intel_sanitize_gpu.c 
b/src/intel/tools/intel_sanitize_gpu.c
index 9b49b0bbf22..4f1a2d2ead5 100644
--- a/src/intel/tools/intel_sanitize_gpu.c
+++ b/src/intel/tools/intel_sanitize_gpu.c
@@ -39,6 +39,7 @@
 #include 
 
 #include "util/hash_table.h"
+#include "util/u_math.h"
 
 #define INTEL_LOG_TAG "INTEL-SANITIZE-GPU"
 #include "common/intel_log.h"
@@ -165,7 +166,7 @@ padding_is_good(int fd, uint32_t handle)
 {
struct drm_i915_gem_mmap mmap_arg = {
   .handle = handle,
-  .offset = bo_size(fd, handle),
+  .offset = align64(bo_size(fd, handle), 4096),
   .size = PADDING_SIZE,
   .flags = 0,
};
@@ -207,9 +208,11 @@ padding_is_good(int fd, uint32_t handle)
 static int
 create_with_padding(int fd, struct drm_i915_gem_create *create)
 {
-   create->size += PADDING_SIZE;
+   uint64_t original_size = create->size;
+
+   create->size = align64(original_size, 4096) + PADDING_SIZE;
int ret = libc_ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, create);
-   create->size -= PADDING_SIZE;
+   create->size = original_size;
 
if (ret != 0)
   return ret;
@@ -217,7 +220,7 @@ create_with_padding(int fd, struct drm_i915_gem_create 
*create)
uint8_t *noise_values;
struct drm_i915_gem_mmap mmap_arg = {
   .handle = create->handle,
-  .offset = create->size,
+  .offset = align64(create->size, 4096),
   .size = PADDING_SIZE,
   .flags = 0,
};
-- 
2.19.1

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


[Mesa-dev] [PATCH 1/4] intel/dump_gpu: add missing gdb option

2018-10-29 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 src/intel/tools/intel_dump_gpu.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/intel/tools/intel_dump_gpu.in 
b/src/intel/tools/intel_dump_gpu.in
index aa187ba8614..a1d92bb9bfa 100755
--- a/src/intel/tools/intel_dump_gpu.in
+++ b/src/intel/tools/intel_dump_gpu.in
@@ -8,6 +8,8 @@ Usage: intel_dump_gpu [OPTION]... [--] COMMAND ARGUMENTS
 Run COMMAND with ARGUMENTS and dump an AUB file that captures buffer
 contents and execution of the GEM application.
 
+  -g, --gdb  Launch GDB
+
   -o, --output=FILE  Name of AUB file. Defaults to COMMAND.aub
 
   --device=IDOverride PCI ID of the reported device
-- 
2.19.1

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


Re: [Mesa-dev] [PATCH v2 2/3] i965/gen10+: Enable object level preemption.

2018-10-29 Thread Rafael Antognolli
On Mon, Oct 29, 2018 at 05:29:10PM +, Chris Wilson wrote:
> Quoting Rafael Antognolli (2018-10-29 17:19:53)
> > +void
> > +brw_enable_obj_preemption(struct brw_context *brw, bool enable)
> > +{
> > +   const struct gen_device_info *devinfo = >screen->devinfo;
> > +   assert(devinfo->gen >= 9);
> > +
> > +   if (enable == brw->object_preemption)
> > +  return;
> > +
> > +   /* A fixed function pipe flush is required before modifying this field 
> > */
> > +   brw_emit_pipe_control_flush(brw, PIPE_CONTROL_FLUSH_ENABLE);
> > +
> > +   bool replay_mode = enable ?
> > +  GEN9_REPLAY_MODE_MIDOBJECT : GEN9_REPLAY_MODE_MIDBUFFER;
> > +
> > +   /* enable object level preemption */
> > +   brw_load_register_imm32(brw, CS_CHICKEN1,
> > +   replay_mode | GEN9_REPLAY_MODE_MASK);
> > +
> > +   brw->object_preemption = enable;
> > +}
> > +
> >  static void
> >  brw_upload_initial_gpu_state(struct brw_context *brw)
> >  {
> > @@ -153,6 +175,9 @@ brw_upload_initial_gpu_state(struct brw_context *brw)
> >   ADVANCE_BATCH();
> >}
> > }
> > +
> > +   if (devinfo->gen >= 10)
> 
> brw->object_preemption = false;
> 
> > +  brw_enable_obj_preemption(brw, true);
> 
> To force the LRI despite what the context may believe. (To accommodate
> recreating a logical context following a GPU hang.)
> -Chris

Fixing it locally, thanks.

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


Re: [Mesa-dev] [PATCH] i965: Don't bother to call blorp if the blit is zero-sized

2018-10-29 Thread Jason Ekstrand
FYI, I don't consider this patch to be the correct approach for solving the
problem.  There are other callers that could run into trouble; in
particular any super-small blits like 0.5-wide.  I think we likely want to
either do a full audit of all blorp_blit callers or somehow solve it in
blorp_blit.  The fact that we're using floats at all bothers me quite a bit
because it means we're likely loosing some precision somewhere.

--Jason

On Mon, Oct 29, 2018 at 11:27 AM Vadim Shovkoplias <
vadim.shovkopl...@gmail.com> wrote:

> Hi Jason,
>
> Looks like there is an issue with the float comparison. It works perfectly
> fine for me if it is compared with some precision:
>
> if( (fabsf(*dstX1 - *dstX0) < 1e-8F) || (fabsf(*dstY1 - *dstY0) < 1e-8F) )
> {
>   return true;
>
>
>
> пн, 1 окт. 2018 г. в 19:24, Eric Engestrom :
>
>> On Monday, 2018-10-01 11:04:09 +0200, Juan A. Suarez Romero wrote:
>> > On Tue, 2018-09-11 at 11:15 -0500, Jason Ekstrand wrote:
>> > > Cc: mesa-sta...@lists.freedesktop.org
>> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107892
>> > > ---
>> > >  src/mesa/drivers/dri/i965/brw_meta_util.c | 3 +++
>> > >  1 file changed, 3 insertions(+)
>> > >
>> >
>> > This has been reviewed, but not pushed yet.
>> >
>> >
>> >   J.A.
>> >
>> > > diff --git a/src/mesa/drivers/dri/i965/brw_meta_util.c
>> b/src/mesa/drivers/dri/i965/brw_meta_util.c
>> > > index 908b0989769..6714d96237c 100644
>> > > --- a/src/mesa/drivers/dri/i965/brw_meta_util.c
>> > > +++ b/src/mesa/drivers/dri/i965/brw_meta_util.c
>> > > @@ -247,6 +247,9 @@ brw_meta_mirror_clip_and_scissor(const struct
>> gl_context *ctx,
>> > >  clip_src_y1, clip_dst_y1, clip_dst_y0,
>> > >  scaleY, false);
>> > >
>> > > +   if (*dstX0 == *dstX1 || *dstY0 == *dstY1)
>> > > +  return true;
>>
>> This comes right after this code (few lines above in the same function):
>>
>>   float scaleX = (float) (*srcX1 - *srcX0) / (*dstX1 - *dstX0);
>>   float scaleY = (float) (*srcY1 - *srcY0) / (*dstY1 - *dstY0);
>>
>> if *dstX0 == *dstX1, that would be a division by 0, so I don't think that
>> this new `if *dstX0 == *dstX1` is reachable (same for *dstY0 == *dstY1)
>>
>> > > +
>> > > /* Account for the fact that in the system framebuffer, the
>> origin is at
>> > >  * the lower left.
>> > >  */
>> >
>> > ___
>> > mesa-dev mailing list
>> > mesa-dev@lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 4/7] nir: Add a pass for lowering integer division by constants

2018-10-29 Thread Jason Ekstrand
On Mon, Oct 29, 2018 at 12:00 PM Daniel Schürmann <
daniel.schuerm...@campus.tu-berlin.de> wrote:

> Hi Jason,
>
> thx for doing this pass, I was about to do the same (then we'd have 3 :P).
> I'm not completely sure, but it looks like you're implementation is
> based on "Division by Invariant Integers using Multiplication" from T.
> Granlund and P. L. Montgomery? I think, it should be mentioned then.
> Although some things are done a bit different (like idiv by pow2)...
>

Ugh... I should drop that comment.  It's now based on the stuff from
rediculousfish.


> Do you also plan to do runtime-invariants or even general lowering of
> udiv and friends? What do you think about some kind of ircp_scaled
> opcode to get the scaled 1/d multiplicator for some specified bit-size?
> The idea would be that for architectures without udiv support, they'd
> only have to implement the first part of the lowering while this pass
> does the second.
>

That would be an interesting idea.  We could certainly look into it.  I'm
not sure exactly what the mechanics of it would look like.  It can be
pretty complicated to get a divisor in general and I'm not sure that we
could do better in our back-end than general NIR codegen so I don't know if
the extra opcode really gains us much.  (It's particularly tricky if you
have to handle division by powers of two in general.)  Maybe someone can do
better in their back-end?  I'm a bit skeptical.


>  >
>  > It's a reasonably well-known fact in the world of compilers that integer
>  > divisions by constants can be replaced by a multiply, an add, and some
>  > shifts.  This commit adds such an optimization to NIR for easiest case
>  > of udiv.  Other division operations will be added in following commits.
>  > In order to provide some additional driver control, the pass takes a
>  > minimum bit size to optimize.
>  > ---
>  >   src/compiler/Makefile.sources |   1 +
>  >   src/compiler/nir/meson.build  |   1 +
>  >   src/compiler/nir/nir.h|   2 +
>  >   src/compiler/nir/nir_opt_idiv_const.c | 215 ++
>  >   4 files changed, 219 insertions(+)
>  >   create mode 100644 src/compiler/nir/nir_opt_idiv_const.c
>  >
>  > diff --git a/src/compiler/Makefile.sources
> b/src/compiler/Makefile.sources
>  > index b65bb9b80b9..e44bce85ad9 100644
>  > --- a/src/compiler/Makefile.sources
>  > +++ b/src/compiler/Makefile.sources
>  > @@ -278,6 +278,7 @@ NIR_FILES = \
>  >   nir/nir_opt_find_array_copies.c \
>  >   nir/nir_opt_gcm.c \
>  >   nir/nir_opt_global_to_local.c \
>  > +nir/nir_opt_idiv_const.c \
>  >   nir/nir_opt_if.c \
>  >   nir/nir_opt_intrinsics.c \
>  >   nir/nir_opt_loop_unroll.c \
>  > diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build
>  > index d8f65640004..63f31e09870 100644
>  > --- a/src/compiler/nir/meson.build
>  > +++ b/src/compiler/nir/meson.build
>  > @@ -162,6 +162,7 @@ files_libnir = files(
>  > 'nir_opt_find_array_copies.c',
>  > 'nir_opt_gcm.c',
>  > 'nir_opt_global_to_local.c',
>  > +  'nir_opt_idiv_const.c',
>  > 'nir_opt_if.c',
>  > 'nir_opt_intrinsics.c',
>  > 'nir_opt_large_constants.c',
>  > diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
>  > index 96b437e7c82..4991c8c604c 100644
>  > --- a/src/compiler/nir/nir.h
>  > +++ b/src/compiler/nir/nir.h
>  > @@ -3081,6 +3081,8 @@ bool nir_opt_find_array_copies(nir_shader
> *shader);
>  >
>  >   bool nir_opt_gcm(nir_shader *shader, bool value_number);
>  >
>  > +bool nir_opt_idiv_const(nir_shader *shader, unsigned min_bit_size);
>  > +
>  >   bool nir_opt_if(nir_shader *shader);
>  >
>  >   bool nir_opt_intrinsics(nir_shader *shader);
>  > diff --git a/src/compiler/nir/nir_opt_idiv_const.c
>  > b/src/compiler/nir/nir_opt_idiv_const.c
>  > new file mode 100644
>  > index 000..7fa739161ba
>  > --- /dev/null
>  > +++ b/src/compiler/nir/nir_opt_idiv_const.c
>  > @@ -0,0 +1,215 @@
>  > +/*
>  > + * Copyright © 2018 Intel Corporation
>  > + *
>  > + * Permission is hereby granted, free of charge, to any person
> obtaining a
>  > + * copy of this software and associated documentation files (the
>  > "Software"),
>  > + * to deal in the Software without restriction, including without
>  > limitation
>  > + * the rights to use, copy, modify, merge, publish, distribute,
>  > sublicense,
>  > + * and/or sell copies of the Software, and to permit persons to whom
> the
>  > + * Software is furnished to do so, subject to the following conditions:
>  > + *
>  > + * The above copyright notice and this permission notice (including the
>  > next
>  > + * paragraph) 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 

Re: [Mesa-dev] [PATCH v2 2/3] i965/gen10+: Enable object level preemption.

2018-10-29 Thread Chris Wilson
Quoting Rafael Antognolli (2018-10-29 17:19:53)
> +void
> +brw_enable_obj_preemption(struct brw_context *brw, bool enable)
> +{
> +   const struct gen_device_info *devinfo = >screen->devinfo;
> +   assert(devinfo->gen >= 9);
> +
> +   if (enable == brw->object_preemption)
> +  return;
> +
> +   /* A fixed function pipe flush is required before modifying this field */
> +   brw_emit_pipe_control_flush(brw, PIPE_CONTROL_FLUSH_ENABLE);
> +
> +   bool replay_mode = enable ?
> +  GEN9_REPLAY_MODE_MIDOBJECT : GEN9_REPLAY_MODE_MIDBUFFER;
> +
> +   /* enable object level preemption */
> +   brw_load_register_imm32(brw, CS_CHICKEN1,
> +   replay_mode | GEN9_REPLAY_MODE_MASK);
> +
> +   brw->object_preemption = enable;
> +}
> +
>  static void
>  brw_upload_initial_gpu_state(struct brw_context *brw)
>  {
> @@ -153,6 +175,9 @@ brw_upload_initial_gpu_state(struct brw_context *brw)
>   ADVANCE_BATCH();
>}
> }
> +
> +   if (devinfo->gen >= 10)

brw->object_preemption = false;

> +  brw_enable_obj_preemption(brw, true);

To force the LRI despite what the context may believe. (To accommodate
recreating a logical context following a GPU hang.)
-Chris
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2018-10-29 Thread AppVeyor


Build mesa 9175 completed



Commit 9007c0ed26 by Brian Paul on 10/29/2018 5:15 PM:

nir: fix yet another MSVC build break\n\nTrivial.


Configure your notification preferences

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


Re: [Mesa-dev] [PATCH mesa 02/12] nouveau: remove unused class member

2018-10-29 Thread Ilia Mirkin
Reviewed-by: Ilia Mirkin 

I suspect this was to take advantage of the 32-bit addressing modes
available on Fermi. No code was ever written for this though (or if it
was, it's now long-deleted).
On Mon, Oct 29, 2018 at 1:16 PM Eric Engestrom  wrote:
>
> Signed-off-by: Eric Engestrom 
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h 
> b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
> index 4136b1ecfebcd7d7d1a5..e0f50ab0904289646c7c 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
> @@ -184,7 +184,6 @@ class NVC0LoweringPass : public Pass
>  private:
> const Target *const targ;
>
> -   Symbol *gMemBase;
> LValue *gpEmitAddress;
>  };
>
> --
> Cheers,
>   Eric
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2 2/3] i965/gen10+: Enable object level preemption.

2018-10-29 Thread Rafael Antognolli
Set bit when initializing context.

Signed-off-by: Rafael Antognolli 
---
 src/mesa/drivers/dri/i965/brw_context.h  |  2 ++
 src/mesa/drivers/dri/i965/brw_defines.h  |  5 
 src/mesa/drivers/dri/i965/brw_state.h|  3 ++-
 src/mesa/drivers/dri/i965/brw_state_upload.c | 25 
 4 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
b/src/mesa/drivers/dri/i965/brw_context.h
index 7fd15669eb9..9253386de7d 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -842,6 +842,8 @@ struct brw_context
 
GLuint primitive; /**< Hardware primitive, such as _3DPRIM_TRILIST. */
 
+   bool object_preemption; /**< Object level preemption enabled. */
+
GLenum reduced_primitive;
 
/**
diff --git a/src/mesa/drivers/dri/i965/brw_defines.h 
b/src/mesa/drivers/dri/i965/brw_defines.h
index 97a787a2ab3..affc690618e 100644
--- a/src/mesa/drivers/dri/i965/brw_defines.h
+++ b/src/mesa/drivers/dri/i965/brw_defines.h
@@ -1681,4 +1681,9 @@ enum brw_pixel_shader_coverage_mask_mode {
 # define HEADERLESS_MESSAGE_FOR_PREEMPTABLE_CONTEXTS(1 << 5)
 # define HEADERLESS_MESSAGE_FOR_PREEMPTABLE_CONTEXTS_MASK   REG_MASK(1 << 5)
 
+#define CS_CHICKEN10x2580 /* Gen9+ */
+# define GEN9_REPLAY_MODE_MIDBUFFER (0 << 0)
+# define GEN9_REPLAY_MODE_MIDOBJECT (1 << 0)
+# define GEN9_REPLAY_MODE_MASK  REG_MASK(1 << 0)
+
 #endif
diff --git a/src/mesa/drivers/dri/i965/brw_state.h 
b/src/mesa/drivers/dri/i965/brw_state.h
index f6acf81b899..546d103d1a4 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -128,7 +128,7 @@ void brw_disk_cache_write_compute_program(struct 
brw_context *brw);
 void brw_disk_cache_write_render_programs(struct brw_context *brw);
 
 /***
- * brw_state.c
+ * brw_state_upload.c
  */
 void brw_upload_render_state(struct brw_context *brw);
 void brw_render_state_finished(struct brw_context *brw);
@@ -138,6 +138,7 @@ void brw_init_state(struct brw_context *brw);
 void brw_destroy_state(struct brw_context *brw);
 void brw_emit_select_pipeline(struct brw_context *brw,
   enum brw_pipeline pipeline);
+void brw_enable_obj_preemption(struct brw_context *brw, bool enable);
 
 static inline void
 brw_select_pipeline(struct brw_context *brw, enum brw_pipeline pipeline)
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c 
b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 7f20579fb87..2e42dfb36d6 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -45,6 +45,28 @@
 #include "brw_cs.h"
 #include "main/framebuffer.h"
 
+void
+brw_enable_obj_preemption(struct brw_context *brw, bool enable)
+{
+   const struct gen_device_info *devinfo = >screen->devinfo;
+   assert(devinfo->gen >= 9);
+
+   if (enable == brw->object_preemption)
+  return;
+
+   /* A fixed function pipe flush is required before modifying this field */
+   brw_emit_pipe_control_flush(brw, PIPE_CONTROL_FLUSH_ENABLE);
+
+   bool replay_mode = enable ?
+  GEN9_REPLAY_MODE_MIDOBJECT : GEN9_REPLAY_MODE_MIDBUFFER;
+
+   /* enable object level preemption */
+   brw_load_register_imm32(brw, CS_CHICKEN1,
+   replay_mode | GEN9_REPLAY_MODE_MASK);
+
+   brw->object_preemption = enable;
+}
+
 static void
 brw_upload_initial_gpu_state(struct brw_context *brw)
 {
@@ -153,6 +175,9 @@ brw_upload_initial_gpu_state(struct brw_context *brw)
  ADVANCE_BATCH();
   }
}
+
+   if (devinfo->gen >= 10)
+  brw_enable_obj_preemption(brw, true);
 }
 
 static inline const struct brw_tracked_state *
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 1/3] intel/genxml: Add register for object preemption.

2018-10-29 Thread Rafael Antognolli
Signed-off-by: Rafael Antognolli 
---
 src/intel/genxml/gen10.xml | 8 
 src/intel/genxml/gen11.xml | 8 
 src/intel/genxml/gen9.xml  | 8 
 3 files changed, 24 insertions(+)

diff --git a/src/intel/genxml/gen10.xml b/src/intel/genxml/gen10.xml
index abd5da297d6..acded759335 100644
--- a/src/intel/genxml/gen10.xml
+++ b/src/intel/genxml/gen10.xml
@@ -3553,6 +3553,14 @@
 
   
 
+  
+
+  
+  
+
+
+  
+
   
 
   
diff --git a/src/intel/genxml/gen11.xml b/src/intel/genxml/gen11.xml
index c69d7dc89c2..d39bf09a5d7 100644
--- a/src/intel/genxml/gen11.xml
+++ b/src/intel/genxml/gen11.xml
@@ -3551,6 +3551,14 @@
 
   
 
+  
+
+  
+  
+
+
+  
+
   
 
   
diff --git a/src/intel/genxml/gen9.xml b/src/intel/genxml/gen9.xml
index ca268254503..b7ce3095ab4 100644
--- a/src/intel/genxml/gen9.xml
+++ b/src/intel/genxml/gen9.xml
@@ -3491,6 +3491,14 @@
 
   
 
+  
+
+  
+  
+
+
+  
+
   
 
   
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 0/3] Add object level preemption to i965.

2018-10-29 Thread Rafael Antognolli
Re-sending the series, this time adding preemption support only to i965,
since We still don't have vulkan tests for this.

The proposed piglit test for this series can be found here:
https://gitlab.freedesktop.org/rantogno/piglit/commits/review/context_preemption_v2

Cc: Kenneth Graunke 

Rafael Antognolli (3):
  intel/genxml: Add register for object preemption.
  i965/gen10+: Enable object level preemption.
  i965/gen9: Add workarounds for object preemption.

 src/intel/genxml/gen10.xml|  8 
 src/intel/genxml/gen11.xml|  8 
 src/intel/genxml/gen9.xml |  8 
 src/mesa/drivers/dri/i965/brw_context.h   |  2 +
 src/mesa/drivers/dri/i965/brw_defines.h   |  5 ++
 src/mesa/drivers/dri/i965/brw_state.h |  3 +-
 src/mesa/drivers/dri/i965/brw_state_upload.c  | 25 ++
 src/mesa/drivers/dri/i965/genX_state_upload.c | 47 +++
 8 files changed, 105 insertions(+), 1 deletion(-)

-- 
2.19.1

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


[Mesa-dev] [PATCH v2 3/3] i965/gen9: Add workarounds for object preemption.

2018-10-29 Thread Rafael Antognolli
Gen9 hardware requires some workarounds to disable preemption depending
on the type of primitive being emitted.

We implement this by adding a new atom that tracks BRW_NEW_PRIMITIVE.
Whenever it happens, we check the current type of primitive and
enable/disable object preemption.

For now, we just ignore blorp.  The only primitive it emits is
3DPRIM_RECTLIST, and since it's not listed in the workarounds, we can
safely leave preemption enabled when it happens. Or it will be disabled
by a previous 3DPRIMITIVE, which should be fine too.

Signed-off-by: Rafael Antognolli 
Cc: Kenneth Graunke 
---
 src/mesa/drivers/dri/i965/genX_state_upload.c | 47 +++
 1 file changed, 47 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
b/src/mesa/drivers/dri/i965/genX_state_upload.c
index 740cb0c4d2e..3a01bab1ae1 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -5563,6 +5563,50 @@ static const struct brw_tracked_state 
genX(blend_constant_color) = {
 
 /* -- */
 
+#if GEN_GEN == 9
+
+/**
+ * Implement workarounds for preemption:
+ *- WaDisableMidObjectPreemptionForGSLineStripAdj
+ *- WaDisableMidObjectPreemptionForTrifanOrPolygon
+ */
+static void
+gen9_emit_preempt_wa(struct brw_context *brw)
+{
+   /* WaDisableMidObjectPreemptionForGSLineStripAdj
+*
+*WA: Disable mid-draw preemption when draw-call is a linestrip_adj and
+*GS is enabled.
+*/
+   bool object_preemption =
+  !(brw->primitive == _3DPRIM_LINESTRIP_ADJ && brw->gs.enabled);
+
+   /* WaDisableMidObjectPreemptionForTrifanOrPolygon
+*
+*TriFan miscompare in Execlist Preemption test. Cut index that is on a
+*previous context. End the previous, the resume another context with a
+*tri-fan or polygon, and the vertex count is corrupted. If we prempt
+*again we will cause corruption.
+*
+*WA: Disable mid-draw preemption when draw-call has a tri-fan.
+*/
+   object_preemption =
+  object_preemption && !(brw->primitive == _3DPRIM_TRIFAN);
+
+   brw_enable_obj_preemption(brw, object_preemption);
+}
+
+static const struct brw_tracked_state gen9_preempt_wa = {
+   .dirty = {
+  .mesa = 0,
+  .brw = BRW_NEW_PRIMITIVE | BRW_NEW_GEOMETRY_PROGRAM,
+   },
+   .emit = gen9_emit_preempt_wa,
+};
+#endif
+
+/* -- */
+
 void
 genX(init_atoms)(struct brw_context *brw)
 {
@@ -5867,6 +5911,9 @@ genX(init_atoms)(struct brw_context *brw)
 
   (cut_index),
   _pma_fix,
+#if GEN_GEN == 9
+  _preempt_wa,
+#endif
};
 #endif
 
-- 
2.19.1

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


Re: [Mesa-dev] [PATCH mesa 03/12] nouveau: fix memset(0) of non-trivial structs

2018-10-29 Thread Ilia Mirkin
Is this legal in C++98? I don't think we require C++11 mesa-wide, at
least not yet...
On Mon, Oct 29, 2018 at 1:16 PM Eric Engestrom  wrote:
>
> Signed-off-by: Eric Engestrom 
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir.cpp| 3 +--
>  src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp 
> b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
> index 49425b98b9137058c986..b543f731db6f07ecab0d 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
> @@ -905,8 +905,7 @@ Instruction::isCommutationLegal(const Instruction *i) 
> const
>  TexInstruction::TexInstruction(Function *fn, operation op)
> : Instruction(fn, op, TYPE_F32)
>  {
> -   memset(, 0, sizeof(tex));
> -
> +   tex = {};
> tex.rIndirectSrc = -1;
> tex.sIndirectSrc = -1;
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp 
> b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
> index 9193a01f189874a7fb38..f9f4cf7e7a46532efce9 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
> @@ -454,7 +454,7 @@ CodeEmitter::addInterp(int ipa, int reg, FixupApply apply)
>if (!fixupInfo)
>   return false;
>if (n == 0)
> - memset(fixupInfo, 0, sizeof(FixupInfo));
> + *fixupInfo = {};
> }
> ++fixupInfo->count;
>
> --
> Cheers,
>   Eric
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH mesa 12/12] egl: add messages to a few assert() and turn a couple into unreachable()

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/egl/drivers/dri2/egl_dri2.c | 8 
 src/egl/main/eglconfig.c| 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 7d9e24d79ddf833802fb..93e34ff93aa5c96a8997 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -335,7 +335,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig 
*dri_config, int id,
   _eglLinkConfig(>base);
}
else {
-  assert(0);
+  unreachable("duplicates should not be possible");
   return NULL;
}
 
@@ -1102,7 +1102,7 @@ dri2_create_context_attribs_error(int dri_error)
   break;
 
default:
-  assert(0);
+  assert(!"unknown dri_error code");
   egl_error = EGL_BAD_MATCH;
   break;
}
@@ -1809,7 +1809,7 @@ dri2_release_tex_image(_EGLDriver *drv,
   target = GL_TEXTURE_2D;
   break;
default:
-  assert(0);
+  assert(!"missing texture target");
}
 
if (dri2_dpy->tex_buffer->base.version >= 3 &&
@@ -1872,7 +1872,7 @@ egl_error_from_dri_image_error(int dri_error)
case __DRI_IMAGE_ERROR_BAD_ACCESS:
   return EGL_BAD_ACCESS;
default:
-  assert(0);
+  assert(!"unknown dri_error code");
   return EGL_BAD_ALLOC;
}
 }
diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c
index 0456adf3caaa8df9d5fc..a346f937bf3e8ba09944 100644
--- a/src/egl/main/eglconfig.c
+++ b/src/egl/main/eglconfig.c
@@ -327,7 +327,7 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean 
for_matching)
valid = EGL_FALSE;
 break;
  default:
-assert(0);
+unreachable("check _eglValidationTable[]");
 break;
  }
  break;
@@ -353,7 +353,7 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean 
for_matching)
EGL_OPENGL_BIT;
 break;
  default:
-assert(0);
+unreachable("check _eglValidationTable[]");
 mask = 0;
 break;
  }
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 10/12] util: s/0/NULL/ for pointer

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/util/u_dynarray.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/u_dynarray.h b/src/util/u_dynarray.h
index c1aa79c8ac6ca8fce810..9bed2b9c25c879672e22 100644
--- a/src/util/u_dynarray.h
+++ b/src/util/u_dynarray.h
@@ -134,7 +134,7 @@ util_dynarray_trim(struct util_dynarray *buf)
  } else {
 free(buf->data);
  }
- buf->data = 0;
+ buf->data = NULL;
  buf->capacity = 0;
   }
}
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 07/12] i965: turn "unreachable" assert() into unreachable()

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/mesa/drivers/dri/i965/intel_tiled_memcpy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c 
b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
index b6bf96706f837606dcd6..627a18027cd13ada959b 100644
--- a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
+++ b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
@@ -604,7 +604,7 @@ choose_copy_function(mem_copy_fn_type copy_type)
   return _memcpy_streaming_load;
 #endif
default:
-  assert(!"unreachable");
+  unreachable("unhandled copy_type");
}
return NULL;
 }
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 09/12] i965: move #ifdef to fix -Wswitch when SSE 4.1 is not supported

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/mesa/drivers/dri/i965/intel_tiled_memcpy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c 
b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
index 836f83d4a43a45e76b48..89d7a69d217829742c01 100644
--- a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
+++ b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
@@ -599,8 +599,8 @@ choose_copy_function(mem_copy_fn_type copy_type)
   return memcpy;
case INTEL_COPY_RGBA8:
   return rgba8_copy;
-#if defined(INLINE_SSE41)
case INTEL_COPY_STREAMING_LOAD:
+#if defined(INLINE_SSE41)
   return _memcpy_streaming_load;
 #endif
case INTEL_COPY_INVALID:
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 04/12] r600: fix memset(0) of non-trivial structs

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/gallium/drivers/r600/sb/sb_expr.cpp  | 10 +-
 src/gallium/drivers/r600/sb/sb_if_conversion.cpp |  4 ++--
 src/gallium/drivers/r600/sb/sb_ir.h  |  2 +-
 src/gallium/drivers/r600/sb/sb_peephole.cpp  |  4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/r600/sb/sb_expr.cpp 
b/src/gallium/drivers/r600/sb/sb_expr.cpp
index 05674ff24b88eaaae523..ee54f49531541d7860e9 100644
--- a/src/gallium/drivers/r600/sb/sb_expr.cpp
+++ b/src/gallium/drivers/r600/sb/sb_expr.cpp
@@ -719,7 +719,7 @@ bool expr_handler::fold_assoc(alu_node *n) {
n->src[0] = n->src[2];
n->bc.src[0] = n->bc.src[2];
n->src[1] = sh.get_const_value(cr);
-   memset(>bc.src[1], 0, sizeof(bc_alu_src));
+   n->bc.src[1] = {};
 
n->src.resize(2);
n->bc.set_op(ALU_OP2_ADD);
@@ -729,7 +729,7 @@ bool expr_handler::fold_assoc(alu_node *n) {
n->bc.src[0] = a->bc.src[last_arg];
n->bc.src[0].neg ^= cur_neg;
n->src[1] = sh.get_const_value(cr);
-   memset(>bc.src[1], 0, sizeof(bc_alu_src));
+   n->bc.src[1] = {};
}
 
return false;
@@ -770,7 +770,7 @@ bool expr_handler::fold_alu_op2(alu_node& n) {
case ALU_OP2_ADD:  // (ADD x, x) => (MUL x, 2)
if (!sh.safe_math) {
n.src[1] = sh.get_const_value(2.0f);
-   memset([1], 0, 
sizeof(bc_alu_src));
+   n.bc.src[1] = {};
n.bc.set_op(ALU_OP2_MUL);
return fold_alu_op2(n);
}
@@ -1070,7 +1070,7 @@ bool expr_handler::fold_alu_op3(alu_node& n) {
}
 
n.src[1] = t;
-   memset([1], 0, sizeof(bc_alu_src));
+   n.bc.src[1] = {};
 
n.src.resize(2);
 
@@ -1101,7 +1101,7 @@ bool expr_handler::fold_alu_op3(alu_node& n) {
dv = cv0.f * cv1.f;
n.bc.set_op(ALU_OP2_ADD);
n.src[0] = sh.get_const_value(dv);
-   memset([0], 0, sizeof(bc_alu_src));
+   n.bc.src[0] = {};
n.src[1] = n.src[2];
n.bc.src[1] = n.bc.src[2];
n.src.resize(2);
diff --git a/src/gallium/drivers/r600/sb/sb_if_conversion.cpp 
b/src/gallium/drivers/r600/sb/sb_if_conversion.cpp
index 017153434fcaaf6e500f..42f934a1afa21638df60 100644
--- a/src/gallium/drivers/r600/sb/sb_if_conversion.cpp
+++ b/src/gallium/drivers/r600/sb/sb_if_conversion.cpp
@@ -99,8 +99,8 @@ void if_conversion::convert_kill_instructions(region_node *r,
a->src[0] = cnd;
a->src[1] = sh.get_const_value(0);
// clear modifiers
-   memset(>bc.src[0], 0, sizeof(bc_alu_src));
-   memset(>bc.src[1], 0, sizeof(bc_alu_src));
+   a->bc.src[0] = {};
+   a->bc.src[1] = {};
} else {
// kill with constant 'false' condition, this shouldn't 
happen
// but remove it anyway
diff --git a/src/gallium/drivers/r600/sb/sb_ir.h 
b/src/gallium/drivers/r600/sb/sb_ir.h
index c7a94fcb930ecd9d9570..6410d7147d7e986ebcf0 100644
--- a/src/gallium/drivers/r600/sb/sb_ir.h
+++ b/src/gallium/drivers/r600/sb/sb_ir.h
@@ -1012,7 +1012,7 @@ class cf_node : public container_node {
 
 class alu_node : public node {
 protected:
-   alu_node() : node(NT_OP, NST_ALU_INST) { memset(, 0, 
sizeof(bc_alu)); };
+   alu_node() : node(NT_OP, NST_ALU_INST) { bc = {}; };
 public:
bc_alu bc;
 
diff --git a/src/gallium/drivers/r600/sb/sb_peephole.cpp 
b/src/gallium/drivers/r600/sb/sb_peephole.cpp
index 4390a8f525c87749e2d4..b0b751d382c16193934f 100644
--- a/src/gallium/drivers/r600/sb/sb_peephole.cpp
+++ b/src/gallium/drivers/r600/sb/sb_peephole.cpp
@@ -131,8 +131,8 @@ void peephole::optimize_cc_op2(alu_node* a) {
std::swap(a->src[0],a->src[1]);
swapped = true;
// clear modifiers
-   memset(>bc.src[0], 0, sizeof(bc_alu_src));
-   memset(>bc.src[1], 0, sizeof(bc_alu_src));
+   a->bc.src[0] = {};
+   a->bc.src[1] = {};
}
 
if (swapped || (a->src[1]->is_const() &&
-- 
Cheers,
  Eric

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org

[Mesa-dev] [PATCH mesa 02/12] nouveau: remove unused class member

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
index 4136b1ecfebcd7d7d1a5..e0f50ab0904289646c7c 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
@@ -184,7 +184,6 @@ class NVC0LoweringPass : public Pass
 private:
const Target *const targ;
 
-   Symbol *gMemBase;
LValue *gpEmitAddress;
 };
 
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 11/12] egl: remove wayland special case which is also the default case

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/egl/drivers/dri2/egl_dri2.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index c5fa935657e8165be49c..7d9e24d79ddf833802fb 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -99,10 +99,9 @@ dri2_gl_flush()
 static GLboolean
 dri_is_thread_safe(void *loaderPrivate)
 {
+#ifdef HAVE_X11_PLATFORM
struct dri2_egl_surface *dri2_surf = loaderPrivate;
_EGLDisplay *display =  dri2_surf->base.Resource.Display;
-
-#ifdef HAVE_X11_PLATFORM
Display *xdpy = (Display*)display->PlatformDisplay;
 
/* Check Xlib is running in thread safe mode when running on EGL/X11-xlib
@@ -115,11 +114,6 @@ dri_is_thread_safe(void *loaderPrivate)
   return false;
 #endif
 
-#ifdef HAVE_WAYLAND_PLATFORM
-   if (display->Platform == _EGL_PLATFORM_WAYLAND)
-  return true;
-#endif
-
return true;
 }
 
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 08/12] i965: add missing case to fix -Wswitch

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/mesa/drivers/dri/i965/intel_tiled_memcpy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c 
b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
index 627a18027cd13ada959b..836f83d4a43a45e76b48 100644
--- a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
+++ b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
@@ -603,9 +603,10 @@ choose_copy_function(mem_copy_fn_type copy_type)
case INTEL_COPY_STREAMING_LOAD:
   return _memcpy_streaming_load;
 #endif
-   default:
-  unreachable("unhandled copy_type");
+   case INTEL_COPY_INVALID:
+  unreachable("invalid copy_type");
}
+   unreachable("unhandled copy_type");
return NULL;
 }
 
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 01/12] scons: drop unused HAVE_STDINT_H macro

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 scons/llvm.py  | 3 ---
 src/gallium/drivers/svga/SConscript| 4 
 src/gallium/drivers/svga/svga_hw_reg.h | 6 --
 src/gallium/winsys/svga/drm/SConscript | 1 -
 4 files changed, 14 deletions(-)

diff --git a/scons/llvm.py b/scons/llvm.py
index a34edfb4b67148f5ac90..a84ad51d97a7d06af107 100644
--- a/scons/llvm.py
+++ b/scons/llvm.py
@@ -99,9 +99,6 @@ def generate(env):
 return
 
 env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
-env.AppendUnique(CPPDEFINES = [
-'HAVE_STDINT_H',
-])
 env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
 # LIBS should match the output of `llvm-config --libs engine mcjit 
bitwriter x86asmprinter irreader`
 if llvm_version >= distutils.version.LooseVersion('5.0'):
diff --git a/src/gallium/drivers/svga/SConscript 
b/src/gallium/drivers/svga/SConscript
index 9c4806c715855b180d1c..efed9790b77d78ab85e4 100644
--- a/src/gallium/drivers/svga/SConscript
+++ b/src/gallium/drivers/svga/SConscript
@@ -8,10 +8,6 @@ if env['suncc']:
print('warning: not building svga')
Return()
 
-env.Append(CPPDEFINES = [
-   'HAVE_STDINT_H',
-])
-
 env.Prepend(CPPPATH = [
'include',
 ])
diff --git a/src/gallium/drivers/svga/svga_hw_reg.h 
b/src/gallium/drivers/svga/svga_hw_reg.h
index 183f4b918e0e72ce0648..91e50e4ee1d08d9e2846 100644
--- a/src/gallium/drivers/svga/svga_hw_reg.h
+++ b/src/gallium/drivers/svga/svga_hw_reg.h
@@ -28,12 +28,6 @@
 
 #include "pipe/p_compiler.h"
 
-#if defined(PIPE_CC_GCC)
-#ifndef HAVE_STDINT_H
-#define HAVE_STDINT_H
-#endif
-#endif
-
 #include "svga_types.h"
 
 #include "svga3d_reg.h"
diff --git a/src/gallium/winsys/svga/drm/SConscript 
b/src/gallium/winsys/svga/drm/SConscript
index 2cb11e610df2f867a952..73989685992e3e0ace33 100644
--- a/src/gallium/winsys/svga/drm/SConscript
+++ b/src/gallium/winsys/svga/drm/SConscript
@@ -5,7 +5,6 @@ env = env.Clone()
 env.PkgUseModules('DRM')
 
 env.Append(CPPDEFINES = [
-'HAVE_STDINT_H',
 '-D_FILE_OFFSET_BITS=64',
 ])
 
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 03/12] nouveau: fix memset(0) of non-trivial structs

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/gallium/drivers/nouveau/codegen/nv50_ir.cpp| 3 +--
 src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
index 49425b98b9137058c986..b543f731db6f07ecab0d 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
@@ -905,8 +905,7 @@ Instruction::isCommutationLegal(const Instruction *i) const
 TexInstruction::TexInstruction(Function *fn, operation op)
: Instruction(fn, op, TYPE_F32)
 {
-   memset(, 0, sizeof(tex));
-
+   tex = {};
tex.rIndirectSrc = -1;
tex.sIndirectSrc = -1;
 
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp 
b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
index 9193a01f189874a7fb38..f9f4cf7e7a46532efce9 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
@@ -454,7 +454,7 @@ CodeEmitter::addInterp(int ipa, int reg, FixupApply apply)
   if (!fixupInfo)
  return false;
   if (n == 0)
- memset(fixupInfo, 0, sizeof(FixupInfo));
+ *fixupInfo = {};
}
++fixupInfo->count;
 
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 05/12] mesa: fix memset(0) of non-trivial structs

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 11 +--
 src/mesa/state_tracker/st_glsl_to_tgsi_private.cpp |  7 ++-
 src/mesa/state_tracker/st_glsl_to_tgsi_private.h   |  1 +
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index dea91c7a189a26eea1f1..a61d4ddaf14f2fdaecdf 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2084,7 +2084,7 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* ir, 
st_src_reg *op)
 emit_asm(ir, TGSI_OPCODE_USHR, st_dst_reg(index_reg), offset,
  st_src_reg_for_int(4));
 cbuf.reladdr = ralloc(mem_ctx, st_src_reg);
-memcpy(cbuf.reladdr, _reg, sizeof(index_reg));
+*cbuf.reladdr = index_reg;
  }
 
  if (const_uniform_block) {
@@ -2093,7 +2093,7 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* ir, 
st_src_reg *op)
  } else {
 /* Relative/variable constant buffer */
 cbuf.reladdr2 = ralloc(mem_ctx, st_src_reg);
-memcpy(cbuf.reladdr2, [0], sizeof(st_src_reg));
+*cbuf.reladdr2 = op[0];
  }
  cbuf.has_index2 = true;
 
@@ -2804,12 +2804,12 @@ glsl_to_tgsi_visitor::visit(ir_dereference_array *ir)
 
   if (is_2D) {
  src.reladdr2 = ralloc(mem_ctx, st_src_reg);
- memcpy(src.reladdr2, _reg, sizeof(index_reg));
+ *src.reladdr2 = index_reg;
  src.index2D = 0;
  src.has_index2 = true;
   } else {
  src.reladdr = ralloc(mem_ctx, st_src_reg);
- memcpy(src.reladdr, _reg, sizeof(index_reg));
+ *src.reladdr = index_reg;
   }
}
 
@@ -4146,8 +4146,7 @@ glsl_to_tgsi_visitor::get_deref_offsets(ir_dereference 
*ir,
unsigned location = 0;
ir_variable *var = ir->variable_referenced();
 
-   memset(reladdr, 0, sizeof(*reladdr));
-   reladdr->file = PROGRAM_UNDEFINED;
+   reladdr->reset();
 
*base = 0;
*array_size = 1;
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_private.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi_private.cpp
index dabb0362a772414b076d..fd3941b3cc35310b6822 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi_private.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_private.cpp
@@ -116,7 +116,7 @@ st_src_reg::st_src_reg(gl_register_file file, int index, 
enum glsl_base_type typ
this->is_double_vertex_input = false;
 }
 
-st_src_reg::st_src_reg()
+void st_src_reg::reset()
 {
this->type = GLSL_TYPE_ERROR;
this->file = PROGRAM_UNDEFINED;
@@ -133,6 +133,11 @@ st_src_reg::st_src_reg()
this->is_double_vertex_input = false;
 }
 
+st_src_reg::st_src_reg()
+{
+   reset();
+}
+
 st_src_reg::st_src_reg(const st_src_reg )
 {
*this = reg;
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_private.h 
b/src/mesa/state_tracker/st_glsl_to_tgsi_private.h
index 356d029f470d44ac581b..c82de95142705010a705 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi_private.h
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_private.h
@@ -51,6 +51,7 @@ class st_src_reg {
st_src_reg();
st_src_reg(const st_src_reg );
void operator=(const st_src_reg );
+   void reset();
 
explicit st_src_reg(st_dst_reg reg);
 
-- 
Cheers,
  Eric

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


[Mesa-dev] [PATCH mesa 06/12] mesa: fix struct/class mismatch

2018-10-29 Thread Eric Engestrom
Signed-off-by: Eric Engestrom 
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
 src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp | 2 +-
 src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h   | 2 +-
 src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp  | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index a61d4ddaf14f2fdaecdf..ef3c370d4bcbfda9cf2e 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5594,7 +5594,7 @@ glsl_to_tgsi_visitor::split_arrays(void)
 void
 glsl_to_tgsi_visitor::merge_registers(void)
 {
-   struct array_live_range *arr_live_ranges = NULL;
+   class array_live_range *arr_live_ranges = NULL;
 
struct register_live_range *reg_live_ranges =
 rzalloc_array(mem_ctx, struct register_live_range, this->next_temp);
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp
index 1431824369e4b1f029ca..e54bb7b9f4d8b412d63f 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp
@@ -686,7 +686,7 @@ using namespace tgsi_array_merge;
 int  merge_arrays(int narrays,
  unsigned *array_sizes,
  exec_list *instructions,
- struct array_live_range *arr_live_ranges)
+ class array_live_range *arr_live_ranges)
 {
array_remapping *map= new array_remapping[narrays + 1];
 
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h 
b/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h
index 7d52d095cfb84b080d14..15738a817d342e562a0c 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h
@@ -184,5 +184,5 @@ int remap_arrays(int narrays, unsigned *array_sizes,
 int merge_arrays(int narrays,
 unsigned *array_sizes,
 exec_list *instructions,
-struct array_live_range *arr_live_ranges);
+class array_live_range *arr_live_ranges);
 #endif
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
index e1519ef3ca3027a610da..210c25e8ba8435966b51 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
@@ -1087,7 +1087,7 @@ void access_recorder::record_write(const st_dst_reg& dst, 
int line,
 }
 
 void access_recorder::get_required_live_ranges(struct register_live_range 
*register_live_ranges,
-  struct array_live_range 
*array_live_ranges)
+  class array_live_range 
*array_live_ranges)
 {
RENAME_DEBUG(debug_log << "== register live ranges ==\n");
for(int i = 0; i < ntemps; ++i) {
@@ -1122,7 +1122,7 @@ static void dump_instruction(ostream& os, int line, 
prog_scope *scope,
 bool
 get_temp_registers_required_live_ranges(void *mem_ctx, exec_list *instructions,
  int ntemps, struct register_live_range *register_live_ranges,
- int narrays, struct array_live_range *array_live_ranges)
+ int narrays, class array_live_range *array_live_ranges)
 {
int line = 0;
int loop_id = 1;
-- 
Cheers,
  Eric

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


Re: [Mesa-dev] [PATCH mesa 1/4] vulkan/wsi: simplify meson file tracking

2018-10-29 Thread Eric Engestrom
On Monday, 2018-10-29 10:11:53 -0700, Dylan Baker wrote:
> Quoting Eric Engestrom (2018-10-29 09:46:46)
> > On Monday, 2018-10-29 09:07:30 -0700, Dylan Baker wrote:
> > > Quoting Eric Engestrom (2018-10-28 06:45:05)
> > > > Meson already automatically tracks included headers, so there's no need
> > > > to add them everywhere; cleans up the code a bit.
> > > > 
> > > > Signed-off-by: Eric Engestrom 
> > > > ---
> > > >  src/vulkan/wsi/meson.build | 23 +--
> > > >  1 file changed, 5 insertions(+), 18 deletions(-)
> > > > 
> > > > diff --git a/src/vulkan/wsi/meson.build b/src/vulkan/wsi/meson.build
> > > > index d073b23dc2586a3fcc98..e9812b663e44dc82b896 100644
> > > > --- a/src/vulkan/wsi/meson.build
> > > > +++ b/src/vulkan/wsi/meson.build
> > > > @@ -21,12 +21,8 @@
> > > >  vulkan_wsi_args = []
> > > >  vulkan_wsi_deps = []
> > > >  
> > > > -files_vulkan_wsi = files(
> > > > -  'wsi_common.c',
> > > > -  'wsi_common.h',
> > > > -  'wsi_common_private.h',
> > > > -  'wsi_common_queue.h',
> > > > -)
> > > > +files_vulkan_wsi = files('wsi_common.c')
> > > > +
> > > >  if with_platform_x11
> > > >vulkan_wsi_args += ['-DVK_USE_PLATFORM_XCB_KHR', 
> > > > '-DVK_USE_PLATFORM_XLIB_KHR']
> > > >vulkan_wsi_deps += [
> > > > @@ -38,19 +34,13 @@ if with_platform_x11
> > > >  dep_xcb_sync,
> > > >  dep_xshmfence,
> > > >]
> > > > -  files_vulkan_wsi += files(
> > > > -'wsi_common_x11.c',
> > > > -'wsi_common_x11.h',
> > > > -  )
> > > > +  files_vulkan_wsi += files('wsi_common_x11.c')
> > > >  endif
> > > >  
> > > >  if with_platform_wayland
> > > >vulkan_wsi_deps += dep_wayland_client
> > > >vulkan_wsi_args += ['-DVK_USE_PLATFORM_WAYLAND_KHR']
> > > > -  files_vulkan_wsi += files(
> > > > -'wsi_common_wayland.c',
> > > > -'wsi_common_wayland.h',
> > > > -  )
> > > > +  files_vulkan_wsi += files('wsi_common_wayland.c')
> > > >files_vulkan_wsi += [
> > > >  wayland_drm_client_protocol_h,
> > > >  wayland_drm_protocol_c,
> > > > @@ -61,10 +51,7 @@ endif
> > > >  
> > > >  if with_platform_drm
> > > >vulkan_wsi_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
> > > > -  files_vulkan_wsi += files(
> > > > -'wsi_common_display.c',
> > > > -'wsi_common_display.h',
> > > > -  )
> > > > +  files_vulkan_wsi += files('wsi_common_display.c')
> > > >  endif
> > > >  
> > > >  if with_xlib_lease
> > > > -- 
> > > > Cheers,
> > > >   Eric
> > > > 
> > > 
> > > For this patch:
> > > Reviewed-by: Dylan Baker 
> > 
> > Thanks; pushed.
> > 
> > > 
> > > I've got a todo on my list for a boring day to go through and remove all 
> > > .h
> > > files from the meson lists, just haven't been bored enough yet :)
> > 
> > Same. I actually started looking at it once but got bored of that too :P
> > 
> > I'll need to write a script to figure out if a given file is already
> > included by a file in the list (or a file included by a file...) and
> > only if so remove it. Or maybe you'll beat me to it and save me the
> > trouble ;)
> 
> You're plan is much smarter than mine. I was just going to run it through
> a fast 72 core system and see if I could catch any races :)

Heh, this isn't a bad idea; it could catch other races :P
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] nir: Document the function inlining process

2018-10-29 Thread Jason Ekstrand
This has thrown a few people off recently and it's good to have the
process and all the rational for it documented somewhere.  A comment at
the top of nir_inline_functions seems as good a place as any.

Cc: Matt Turner 
Cc: Karol Herbst 
---
 src/compiler/nir/nir_inline_functions.c | 68 +
 1 file changed, 68 insertions(+)

diff --git a/src/compiler/nir/nir_inline_functions.c 
b/src/compiler/nir/nir_inline_functions.c
index 06c90d93956..29474bb417b 100644
--- a/src/compiler/nir/nir_inline_functions.c
+++ b/src/compiler/nir/nir_inline_functions.c
@@ -132,6 +132,74 @@ inline_function_impl(nir_function_impl *impl, struct set 
*inlined)
return progress;
 }
 
+/** A pass to inline all functions in a shader into their callers
+ *
+ * For most use-cases, function inlining is a multi-step process.  The general
+ * pattern employed by SPIR-V consumers and others is as follows:
+ *
+ *  1. nir_lower_constant_initializers(shader, nir_var_local)
+ *
+ * This is needed because local variables from the callee are simply added
+ * to the locals list for the caller and the information about where the
+ * constant initializer logically happens is lost.  If the callee is
+ * called in a loop, this can cause the variable to go from being
+ * initialized once per loop iteration to being initialized once at the
+ * top of the caller and values to persist from one invocation of the
+ * callee to the next.  The simple solution to this problem is to get rid
+ * of constant initializers before function inlining.
+ *
+ *  2. nir_lower_returns(shader)
+ *
+ * nir_inline_functions assumes that all functions end "naturally" by
+ * execution reaching the end of the function without any return
+ * instructions causing instant jumps to the end.  Thanks to NIR being
+ * structured, we can't represent arbitrary jumps to various points in the
+ * program which is what an early return in the callee would have to turn
+ * into when we inline it into the caller.  Instead, we require returns to
+ * be lowered which lets us just copy+paste the callee directly into the
+ * caller.
+ *
+ *  3. nir_inline_functions(shader)
+ *
+ * This does the actual function inlining and the resulting shader will
+ * contain no call instructions.
+ *
+ *  4. nir_copy_prop(shader)
+ *
+ * Most functions contain pointer parameters where the result of a deref
+ * instruction is passed in as a parameter, loaded via a load_param
+ * intrinsic, and then turned back into a deref via a cast.  Running copy
+ * propagation gets rid of the intermediate steps and results in a whole
+ * deref chain again.  This is currently required by a number of
+ * optimizations and lowering passes at least for certain variable modes.
+ *
+ *  5. Loop over the functions and delete all but the main entrypoint.
+ *
+ * In the Intel Vulkan driver this looks like this:
+ *
+ *foreach_list_typed_safe(nir_function, func, node, >functions) {
+ *   if (func != entry_point)
+ *  exec_node_remove(>node);
+ *}
+ *assert(exec_list_length(>functions) == 1);
+ *
+ *While nir_inline_functions does get rid of all call instructions, it
+ *doesn't get rid of any functions because it doesn't know what the "root
+ *function" is.  Instead, it's up to the individual driver to know how to
+ *decide on a root function and delete the rest.  With SPIR-V,
+ *spirv_to_nir returns the root function and so we can just use == whereas
+ *with GL, you may have to look for a function named "main".
+ *
+ *  6. nir_lower_constant_initializers(shader, ~nir_var_local)
+ *
+ * Lowering constant initializers on inputs, outputs, global variables,
+ * etc. requires that we know the main entrypoint so that we know where to
+ * initialize them.  Otherwise, we would have to assume that anything
+ * could be a main entrypoint and initialize them at the start of every
+ * function but that would clearly be wrong if any of those functions were
+ * ever called within another function.  Simply requiring a single-
+ * entrypoint function shader is the best way to make it well-defined.
+ */
 bool
 nir_inline_functions(nir_shader *shader)
 {
-- 
2.19.1

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


Re: [Mesa-dev] [PATCH mesa 1/4] vulkan/wsi: simplify meson file tracking

2018-10-29 Thread Dylan Baker
Quoting Eric Engestrom (2018-10-29 09:46:46)
> On Monday, 2018-10-29 09:07:30 -0700, Dylan Baker wrote:
> > Quoting Eric Engestrom (2018-10-28 06:45:05)
> > > Meson already automatically tracks included headers, so there's no need
> > > to add them everywhere; cleans up the code a bit.
> > > 
> > > Signed-off-by: Eric Engestrom 
> > > ---
> > >  src/vulkan/wsi/meson.build | 23 +--
> > >  1 file changed, 5 insertions(+), 18 deletions(-)
> > > 
> > > diff --git a/src/vulkan/wsi/meson.build b/src/vulkan/wsi/meson.build
> > > index d073b23dc2586a3fcc98..e9812b663e44dc82b896 100644
> > > --- a/src/vulkan/wsi/meson.build
> > > +++ b/src/vulkan/wsi/meson.build
> > > @@ -21,12 +21,8 @@
> > >  vulkan_wsi_args = []
> > >  vulkan_wsi_deps = []
> > >  
> > > -files_vulkan_wsi = files(
> > > -  'wsi_common.c',
> > > -  'wsi_common.h',
> > > -  'wsi_common_private.h',
> > > -  'wsi_common_queue.h',
> > > -)
> > > +files_vulkan_wsi = files('wsi_common.c')
> > > +
> > >  if with_platform_x11
> > >vulkan_wsi_args += ['-DVK_USE_PLATFORM_XCB_KHR', 
> > > '-DVK_USE_PLATFORM_XLIB_KHR']
> > >vulkan_wsi_deps += [
> > > @@ -38,19 +34,13 @@ if with_platform_x11
> > >  dep_xcb_sync,
> > >  dep_xshmfence,
> > >]
> > > -  files_vulkan_wsi += files(
> > > -'wsi_common_x11.c',
> > > -'wsi_common_x11.h',
> > > -  )
> > > +  files_vulkan_wsi += files('wsi_common_x11.c')
> > >  endif
> > >  
> > >  if with_platform_wayland
> > >vulkan_wsi_deps += dep_wayland_client
> > >vulkan_wsi_args += ['-DVK_USE_PLATFORM_WAYLAND_KHR']
> > > -  files_vulkan_wsi += files(
> > > -'wsi_common_wayland.c',
> > > -'wsi_common_wayland.h',
> > > -  )
> > > +  files_vulkan_wsi += files('wsi_common_wayland.c')
> > >files_vulkan_wsi += [
> > >  wayland_drm_client_protocol_h,
> > >  wayland_drm_protocol_c,
> > > @@ -61,10 +51,7 @@ endif
> > >  
> > >  if with_platform_drm
> > >vulkan_wsi_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
> > > -  files_vulkan_wsi += files(
> > > -'wsi_common_display.c',
> > > -'wsi_common_display.h',
> > > -  )
> > > +  files_vulkan_wsi += files('wsi_common_display.c')
> > >  endif
> > >  
> > >  if with_xlib_lease
> > > -- 
> > > Cheers,
> > >   Eric
> > > 
> > 
> > For this patch:
> > Reviewed-by: Dylan Baker 
> 
> Thanks; pushed.
> 
> > 
> > I've got a todo on my list for a boring day to go through and remove all .h
> > files from the meson lists, just haven't been bored enough yet :)
> 
> Same. I actually started looking at it once but got bored of that too :P
> 
> I'll need to write a script to figure out if a given file is already
> included by a file in the list (or a file included by a file...) and
> only if so remove it. Or maybe you'll beat me to it and save me the
> trouble ;)

You're plan is much smarter than mine. I was just going to run it through
a fast 72 core system and see if I could catch any races :)


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


[Mesa-dev] [Bug 108594] [RADV] Graphics distortion in Evil within 1 if reflections enabled

2018-10-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=108594

Vladimir  changed:

   What|Removed |Added

 CC||nickfa...@gmail.com

--- Comment #1 from Vladimir  ---
Created attachment 142261
  --> https://bugs.freedesktop.org/attachment.cgi?id=142261=edit
renderdoc capture

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


Re: [Mesa-dev] [PATCH v3 4/7] nir: Add a pass for lowering integer division by constants

2018-10-29 Thread Daniel Schürmann

Hi Jason,

thx for doing this pass, I was about to do the same (then we'd have 3 :P).
I'm not completely sure, but it looks like you're implementation is 
based on "Division by Invariant Integers using Multiplication" from T. 
Granlund and P. L. Montgomery? I think, it should be mentioned then.

Although some things are done a bit different (like idiv by pow2)...

Do you also plan to do runtime-invariants or even general lowering of 
udiv and friends? What do you think about some kind of ircp_scaled 
opcode to get the scaled 1/d multiplicator for some specified bit-size? 
The idea would be that for architectures without udiv support, they'd 
only have to implement the first part of the lowering while this pass 
does the second.


>
> It's a reasonably well-known fact in the world of compilers that integer
> divisions by constants can be replaced by a multiply, an add, and some
> shifts.  This commit adds such an optimization to NIR for easiest case
> of udiv.  Other division operations will be added in following commits.
> In order to provide some additional driver control, the pass takes a
> minimum bit size to optimize.
> ---
>   src/compiler/Makefile.sources |   1 +
>   src/compiler/nir/meson.build  |   1 +
>   src/compiler/nir/nir.h|   2 +
>   src/compiler/nir/nir_opt_idiv_const.c | 215 ++
>   4 files changed, 219 insertions(+)
>   create mode 100644 src/compiler/nir/nir_opt_idiv_const.c
>
> diff --git a/src/compiler/Makefile.sources 
b/src/compiler/Makefile.sources

> index b65bb9b80b9..e44bce85ad9 100644
> --- a/src/compiler/Makefile.sources
> +++ b/src/compiler/Makefile.sources
> @@ -278,6 +278,7 @@ NIR_FILES = \
>   nir/nir_opt_find_array_copies.c \
>   nir/nir_opt_gcm.c \
>   nir/nir_opt_global_to_local.c \
> +nir/nir_opt_idiv_const.c \
>   nir/nir_opt_if.c \
>   nir/nir_opt_intrinsics.c \
>   nir/nir_opt_loop_unroll.c \
> diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build
> index d8f65640004..63f31e09870 100644
> --- a/src/compiler/nir/meson.build
> +++ b/src/compiler/nir/meson.build
> @@ -162,6 +162,7 @@ files_libnir = files(
> 'nir_opt_find_array_copies.c',
> 'nir_opt_gcm.c',
> 'nir_opt_global_to_local.c',
> +  'nir_opt_idiv_const.c',
> 'nir_opt_if.c',
> 'nir_opt_intrinsics.c',
> 'nir_opt_large_constants.c',
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index 96b437e7c82..4991c8c604c 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -3081,6 +3081,8 @@ bool nir_opt_find_array_copies(nir_shader *shader);
>
>   bool nir_opt_gcm(nir_shader *shader, bool value_number);
>
> +bool nir_opt_idiv_const(nir_shader *shader, unsigned min_bit_size);
> +
>   bool nir_opt_if(nir_shader *shader);
>
>   bool nir_opt_intrinsics(nir_shader *shader);
> diff --git a/src/compiler/nir/nir_opt_idiv_const.c
> b/src/compiler/nir/nir_opt_idiv_const.c
> new file mode 100644
> index 000..7fa739161ba
> --- /dev/null
> +++ b/src/compiler/nir/nir_opt_idiv_const.c
> @@ -0,0 +1,215 @@
> +/*
> + * Copyright © 2018 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person 
obtaining a

> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> next
> + * paragraph) 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.
> + */
> +
> +#include "nir.h"
> +#include "nir_builder.h"
> +#include "util/fast_idiv_by_const.h"
> +#include "util/u_math.h"
> +
> +static nir_ssa_def *
> +build_udiv(nir_builder *b, nir_ssa_def *n, uint64_t d)
> +{
> +   if (d == 0) {
> +  return nir_imm_intN_t(b, 0, n->bit_size);
> +   } else if (util_is_power_of_two_or_zero64(d)) {
> +  return nir_ushr(b, n, nir_imm_int(b, util_logbase2_64(d)));
> +   } else {
> +  struct util_fast_udiv_info m =
> + util_compute_fast_udiv_info(d, n->bit_size, n->bit_size);
> +
> +  if (m.pre_shift)
> + n = nir_ushr(b, n, nir_imm_int(b, m.pre_shift));
> +  if (m.increment)
> +   

[Mesa-dev] [Bug 108594] [RADV] Graphics distortion in Evil within 1 if reflections enabled

2018-10-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=108594

Bug ID: 108594
   Summary: [RADV] Graphics distortion in Evil within 1 if
reflections enabled
   Product: Mesa
   Version: git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/Vulkan/radeon
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: nickfa...@gmail.com
QA Contact: mesa-dev@lists.freedesktop.org

Created attachment 142260
  --> https://bugs.freedesktop.org/attachment.cgi?id=142260=edit
screenshot

Evil within 1 + DXVK 
Reflections ON

System information

GPU: RX 580 8Gb
Driver: mesa-git + llvm-svn
Wine version: wine-staging 3.19-git
DXVK version: 0.90

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


Re: [Mesa-dev] [PATCH mesa 1/4] vulkan/wsi: simplify meson file tracking

2018-10-29 Thread Eric Engestrom
On Monday, 2018-10-29 09:07:30 -0700, Dylan Baker wrote:
> Quoting Eric Engestrom (2018-10-28 06:45:05)
> > Meson already automatically tracks included headers, so there's no need
> > to add them everywhere; cleans up the code a bit.
> > 
> > Signed-off-by: Eric Engestrom 
> > ---
> >  src/vulkan/wsi/meson.build | 23 +--
> >  1 file changed, 5 insertions(+), 18 deletions(-)
> > 
> > diff --git a/src/vulkan/wsi/meson.build b/src/vulkan/wsi/meson.build
> > index d073b23dc2586a3fcc98..e9812b663e44dc82b896 100644
> > --- a/src/vulkan/wsi/meson.build
> > +++ b/src/vulkan/wsi/meson.build
> > @@ -21,12 +21,8 @@
> >  vulkan_wsi_args = []
> >  vulkan_wsi_deps = []
> >  
> > -files_vulkan_wsi = files(
> > -  'wsi_common.c',
> > -  'wsi_common.h',
> > -  'wsi_common_private.h',
> > -  'wsi_common_queue.h',
> > -)
> > +files_vulkan_wsi = files('wsi_common.c')
> > +
> >  if with_platform_x11
> >vulkan_wsi_args += ['-DVK_USE_PLATFORM_XCB_KHR', 
> > '-DVK_USE_PLATFORM_XLIB_KHR']
> >vulkan_wsi_deps += [
> > @@ -38,19 +34,13 @@ if with_platform_x11
> >  dep_xcb_sync,
> >  dep_xshmfence,
> >]
> > -  files_vulkan_wsi += files(
> > -'wsi_common_x11.c',
> > -'wsi_common_x11.h',
> > -  )
> > +  files_vulkan_wsi += files('wsi_common_x11.c')
> >  endif
> >  
> >  if with_platform_wayland
> >vulkan_wsi_deps += dep_wayland_client
> >vulkan_wsi_args += ['-DVK_USE_PLATFORM_WAYLAND_KHR']
> > -  files_vulkan_wsi += files(
> > -'wsi_common_wayland.c',
> > -'wsi_common_wayland.h',
> > -  )
> > +  files_vulkan_wsi += files('wsi_common_wayland.c')
> >files_vulkan_wsi += [
> >  wayland_drm_client_protocol_h,
> >  wayland_drm_protocol_c,
> > @@ -61,10 +51,7 @@ endif
> >  
> >  if with_platform_drm
> >vulkan_wsi_args += '-DVK_USE_PLATFORM_DISPLAY_KHR'
> > -  files_vulkan_wsi += files(
> > -'wsi_common_display.c',
> > -'wsi_common_display.h',
> > -  )
> > +  files_vulkan_wsi += files('wsi_common_display.c')
> >  endif
> >  
> >  if with_xlib_lease
> > -- 
> > Cheers,
> >   Eric
> > 
> 
> For this patch:
> Reviewed-by: Dylan Baker 

Thanks; pushed.

> 
> I've got a todo on my list for a boring day to go through and remove all .h
> files from the meson lists, just haven't been bored enough yet :)

Same. I actually started looking at it once but got bored of that too :P

I'll need to write a script to figure out if a given file is already
included by a file in the list (or a file included by a file...) and
only if so remove it. Or maybe you'll beat me to it and save me the
trouble ;)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] gallium/util: don't let children of fork & exec inherit our thread affinity

2018-10-29 Thread Michel Dänzer
On 2018-10-28 11:27 a.m., Gustaw Smolarczyk wrote:
> pon., 17 wrz 2018 o 18:24 Michel Dänzer  napisał(a):
>>
>> On 2018-09-15 3:04 a.m., Marek Olšák wrote:
>>> On Fri, Sep 14, 2018 at 4:53 AM, Michel Dänzer  wrote:

 Last but not least, this doesn't solve the issue of apps such as
 blender, which spawn their own worker threads after initializing OpenGL
 (possibly not themselves directly, but via the toolkit or another
 library; e.g. GTK+4 uses OpenGL by default), inheriting the thread 
 affinity.


 Due to these issues, setting the thread affinity needs to be disabled by
 default, and only white-listed for applications where it's known safe
 and beneficial. This sucks, but I'm afraid that's the reality until
 there's better API available which allows solving these issues.
>>>
>>> We don't have the bandwidth to maintain whitelists. This will either
>>> have to be always on or always off.
>>>
>>> On the positive side, only Ryzens with multiple CCXs get all the
>>> benefits and disadvantages.
>>
>> In other words, only people who spent relatively large amounts of money
>> for relatively high-end CPUs will be affected (I'm sure they'll be glad
>> to know that "common people" aren't affected. ;). Affected applications
>> will see their performance decreased by a factor of 2-8 (the number of
>> CCXs in the CPU).
>>
>> OTOH, only a relatively small number of games will get a significant
>> benefit from the thread affinity, and the benefit will be smaller than a
>> factor of 2. This cannot justify risking a performance drop of up to a
>> factor of 8, no matter how small the risk.
>>
>> Therefore, the appropriate mechanism is a whitelist.
> 
> Hi,
> 
> What was the conclusion of this discussion? I don't see any
> whitelist/blacklist for this feature.
> 
> I have just tested blender and it still renders on only a single CCX
> on mesa from git master. Also, there is a bug report that suggests
> this regressed performance in at least one game [1].

I hooked up that bug report to the 18.3 blocker bug.


> If you think enabling it by default is the way to go, we should also
> implement a blacklist so that it can be turned off in such cases.

I stand by my opinion that a white-list is appropriate, not a
black-list. It's pretty much the same as mesa_glthread.


> [1] https://bugs.freedesktop.org/show_bug.cgi?id=108330


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH mesa v2 1/4] anv: add missing meson build dependency

2018-10-29 Thread Eric Engestrom
On Monday, 2018-10-29 09:08:06 -0700, Dylan Baker wrote:
> for the series:
> Reviewed-by: Dylan Baker 

Thanks; pushed

> 
> Quoting Eric Engestrom (2018-10-28 06:18:39)
> > Fixes: e4538b93f5d5177318f2 "anv: Implement VK_KHR_driver_properties"
> > Signed-off-by: Eric Engestrom 
> > ---
> >  src/intel/vulkan/meson.build | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build
> > index 941186d38ec7d325dce1..e1fccabaddd0e0804d73 100644
> > --- a/src/intel/vulkan/meson.build
> > +++ b/src/intel/vulkan/meson.build
> > @@ -176,7 +176,7 @@ endif
> >  
> >  libanv_common = static_library(
> >'anv_common',
> > -  [libanv_files, anv_entrypoints, anv_extensions_c, anv_extensions_h],
> > +  [libanv_files, anv_entrypoints, anv_extensions_c, anv_extensions_h, 
> > sha1_h],
> >include_directories : [
> >  inc_common, inc_intel, inc_compiler, inc_drm_uapi, inc_vulkan_util,
> >  inc_vulkan_wsi,
> > -- 
> > Cheers,
> >   Eric
> > 


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


Re: [Mesa-dev] [PATCH] i965: Don't bother to call blorp if the blit is zero-sized

2018-10-29 Thread Vadim Shovkoplias
Hi Jason,

Looks like there is an issue with the float comparison. It works perfectly
fine for me if it is compared with some precision:

if( (fabsf(*dstX1 - *dstX0) < 1e-8F) || (fabsf(*dstY1 - *dstY0) < 1e-8F) ) {
  return true;



пн, 1 окт. 2018 г. в 19:24, Eric Engestrom :

> On Monday, 2018-10-01 11:04:09 +0200, Juan A. Suarez Romero wrote:
> > On Tue, 2018-09-11 at 11:15 -0500, Jason Ekstrand wrote:
> > > Cc: mesa-sta...@lists.freedesktop.org
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107892
> > > ---
> > >  src/mesa/drivers/dri/i965/brw_meta_util.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> >
> > This has been reviewed, but not pushed yet.
> >
> >
> >   J.A.
> >
> > > diff --git a/src/mesa/drivers/dri/i965/brw_meta_util.c
> b/src/mesa/drivers/dri/i965/brw_meta_util.c
> > > index 908b0989769..6714d96237c 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_meta_util.c
> > > +++ b/src/mesa/drivers/dri/i965/brw_meta_util.c
> > > @@ -247,6 +247,9 @@ brw_meta_mirror_clip_and_scissor(const struct
> gl_context *ctx,
> > >  clip_src_y1, clip_dst_y1, clip_dst_y0,
> > >  scaleY, false);
> > >
> > > +   if (*dstX0 == *dstX1 || *dstY0 == *dstY1)
> > > +  return true;
>
> This comes right after this code (few lines above in the same function):
>
>   float scaleX = (float) (*srcX1 - *srcX0) / (*dstX1 - *dstX0);
>   float scaleY = (float) (*srcY1 - *srcY0) / (*dstY1 - *dstY0);
>
> if *dstX0 == *dstX1, that would be a division by 0, so I don't think that
> this new `if *dstX0 == *dstX1` is reachable (same for *dstY0 == *dstY1)
>
> > > +
> > > /* Account for the fact that in the system framebuffer, the origin
> is at
> > >  * the lower left.
> > >  */
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2018-10-29 Thread AppVeyor



Build mesa 9173 failed


Commit b4eb029062 by Samuel Pitoiset on 10/5/2018 4:04 PM:

radv: implement VK_EXT_transform_feedback\n\nThis implementation should work and potential bugs can be\nfixed during the release candidates window anyway.\n\nSigned-off-by: Samuel Pitoiset \nReviewed-by: Dave Airlie 


Configure your notification preferences

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


  1   2   >