From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 06 Jun 2023 09:01:43 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q6QhM-00CkCB-2Q for lore@lore.pengutronix.de; Tue, 06 Jun 2023 09:01:43 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1q6QhH-0006Pj-TL; Tue, 06 Jun 2023 09:01:39 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q6Qg8-0004ZG-2u; Tue, 06 Jun 2023 09:00:28 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q6Qg7-005Rbb-EI; Tue, 06 Jun 2023 09:00:27 +0200 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q6Qg6-001aj4-Mk; Tue, 06 Jun 2023 09:00:26 +0200 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Tue, 6 Jun 2023 09:00:26 +0200 Message-Id: <20230606070026.379391-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230602135903.694427-7-p.zabel@pengutronix.de> References: <20230602135903.694427-7-p.zabel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [ptxdist] [APPLIED] vulkan-validationlayers: version bump 1.3.246.1 -> 1.3.250.0 X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Philipp Zabel Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Thanks, applied as 51d702042185bec37022215b7ded0272c1673555. Michael [sent from post-receive hook] On Tue, 06 Jun 2023 09:00:26 +0200, Philipp Zabel wrote: > Signed-off-by: Philipp Zabel > Message-Id: <20230602135903.694427-7-p.zabel@pengutronix.de> > Signed-off-by: Michael Olbrich > > diff --git a/patches/vulkan-validationlayers-1.3.246.1/0002-layers-Fix-UB-for-VK_IMAGE_TILING_DRM_FORMAT_MODIFIE.patch b/patches/vulkan-validationlayers-1.3.246.1/0002-layers-Fix-UB-for-VK_IMAGE_TILING_DRM_FORMAT_MODIFIE.patch > deleted file mode 100644 > index 3b625e31120f..000000000000 > --- a/patches/vulkan-validationlayers-1.3.246.1/0002-layers-Fix-UB-for-VK_IMAGE_TILING_DRM_FORMAT_MODIFIE.patch > +++ /dev/null > @@ -1,201 +0,0 @@ > -From: Niklas Haas > -Date: Thu, 20 Apr 2023 11:51:49 +0200 > -Subject: [PATCH] layers: Fix UB for VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT > - > -Several codepaths in the layers called into > -vkGetPhysicalDeviceImageFormatProperties2KHR without including a valid > -VkPhysicalDeviceImageDrmFormatModifierInfoEXT, despite this being a > -requirement for images with DRM format modifier tiling. > - > -For the vkBindImageMemory check, there is a hypothetical possibility of > -the driver returning VK_ERROR_OUT_OF_HOST_MEMORY when querying the > -image's DRM format. In this case, for lack of anything better to do, we > -preserve the current behavior. > - > -It might make more sense to query the DRM format modifier immediately > -after image creation and cache it inside the image state, but I didn't > -want to make that (more invasive) change myself. > - > -As an aside, we also correctly specify the specified `sharingMode` when > -querying for DRM modifier support, which the current code failed to do > -properly. > - > -Co-authored-by: Simon Ser > - > -closes #5649 > -closes #5687 > - > -(cherry picked from commit ce2c6eff3457a331efd64da800c5ac393285cf40) > - > -Signed-off-by: Philipp Zabel > ---- > - layers/core_checks/device_memory_validation.cpp | 18 ++++++- > - layers/core_checks/image_validation.cpp | 72 ++++++++++++++++--------- > - 2 files changed, 62 insertions(+), 28 deletions(-) > - > -diff --git a/layers/core_checks/device_memory_validation.cpp b/layers/core_checks/device_memory_validation.cpp > -index 4a98d6f0922d..555985957dce 100644 > ---- a/layers/core_checks/device_memory_validation.cpp > -+++ b/layers/core_checks/device_memory_validation.cpp > -@@ -887,7 +887,7 @@ bool CoreChecks::PreCallValidateMapMemory(VkDevice device, VkDeviceMemory mem, V > - return skip; > - } > - > --bool CoreChecks::PreCallValidateMapMemory2KHR(VkDevice device, const VkMemoryMapInfoKHR* pMemoryMapInfo, void **ppData) const { > -+bool CoreChecks::PreCallValidateMapMemory2KHR(VkDevice device, const VkMemoryMapInfoKHR *pMemoryMapInfo, void **ppData) const { > - bool skip = false; > - auto mem_info = Get(pMemoryMapInfo->memory); > - if (mem_info) { > -@@ -905,7 +905,7 @@ bool CoreChecks::PreCallValidateUnmapMemory(VkDevice device, VkDeviceMemory mem) > - return skip; > - } > - > --bool CoreChecks::PreCallValidateUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo) const { > -+bool CoreChecks::PreCallValidateUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfoKHR *pMemoryUnmapInfo) const { > - bool skip = false; > - auto mem_info = Get(pMemoryUnmapInfo->memory); > - if (mem_info && !mem_info->mapped_range.size) { > -@@ -1269,6 +1269,10 @@ bool CoreChecks::ValidateBindImageMemory(uint32_t bindInfoCount, const VkBindIma > - > - // Validate export memory handles > - if (mem_info->export_handle_type_flags != 0) { > -+ auto drm_format_modifier = LvlInitStruct(); > -+ drm_format_modifier.sharingMode = image_state->createInfo.sharingMode; > -+ drm_format_modifier.queueFamilyIndexCount = image_state->createInfo.queueFamilyIndexCount; > -+ drm_format_modifier.pQueueFamilyIndices = image_state->createInfo.pQueueFamilyIndices; > - auto external_info = LvlInitStruct(); > - auto image_info = LvlInitStruct(&external_info); > - image_info.format = image_state->createInfo.format; > -@@ -1283,6 +1287,16 @@ bool CoreChecks::ValidateBindImageMemory(uint32_t bindInfoCount, const VkBindIma > - // Check export operation support > - auto check_export_support = [&](VkExternalMemoryHandleTypeFlagBits flag) { > - external_info.handleType = flag; > -+ external_info.pNext = NULL; > -+ if (image_state->createInfo.tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { > -+ auto drm_modifier_properties = LvlInitStruct(); > -+ auto result = > -+ DispatchGetImageDrmFormatModifierPropertiesEXT(device, bind_info.image, &drm_modifier_properties); > -+ if (result == VK_SUCCESS) { > -+ external_info.pNext = &drm_format_modifier; > -+ drm_format_modifier.drmFormatModifier = drm_modifier_properties.drmFormatModifier; > -+ } > -+ } > - auto result = > - DispatchGetPhysicalDeviceImageFormatProperties2(physical_device, &image_info, &image_properties); > - if (result != VK_SUCCESS) { > -diff --git a/layers/core_checks/image_validation.cpp b/layers/core_checks/image_validation.cpp > -index c56b5dabdd27..35a84c86f8ef 100644 > ---- a/layers/core_checks/image_validation.cpp > -+++ b/layers/core_checks/image_validation.cpp > -@@ -176,30 +176,35 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate > - } > - } > - > -- VkImageFormatProperties format_limits = {}; > -+ auto image_format_properties = LvlInitStruct(); > -+ auto image_format_info = LvlInitStruct(); > -+ image_format_info.type = pCreateInfo->imageType; > -+ image_format_info.format = pCreateInfo->format; > -+ image_format_info.tiling = pCreateInfo->tiling; > -+ image_format_info.usage = pCreateInfo->usage; > -+ image_format_info.flags = pCreateInfo->flags; > - VkResult result = VK_SUCCESS; > - if (pCreateInfo->tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { > -- result = DispatchGetPhysicalDeviceImageFormatProperties(physical_device, pCreateInfo->format, pCreateInfo->imageType, > -- pCreateInfo->tiling, pCreateInfo->usage, pCreateInfo->flags, > -- &format_limits); > -+ if (IsExtEnabled(device_extensions.vk_khr_get_physical_device_properties2)) { > -+ result = DispatchGetPhysicalDeviceImageFormatProperties2(physical_device, &image_format_info, &image_format_properties); > -+ } else { > -+ result = DispatchGetPhysicalDeviceImageFormatProperties(physical_device, pCreateInfo->format, pCreateInfo->imageType, > -+ pCreateInfo->tiling, pCreateInfo->usage, pCreateInfo->flags, > -+ &image_format_properties.imageFormatProperties); > -+ } > - } else { > - auto modifier_list = LvlFindInChain(pCreateInfo->pNext); > - auto explicit_modifier = LvlFindInChain(pCreateInfo->pNext); > -+ auto drm_format_modifier = LvlInitStruct(); > -+ image_format_info.pNext = &drm_format_modifier; > -+ drm_format_modifier.sharingMode = pCreateInfo->sharingMode; > -+ drm_format_modifier.queueFamilyIndexCount = pCreateInfo->queueFamilyIndexCount; > -+ drm_format_modifier.pQueueFamilyIndices = pCreateInfo->pQueueFamilyIndices; > - if (modifier_list) { > - for (uint32_t i = 0; i < modifier_list->drmFormatModifierCount; i++) { > -- auto drm_format_modifier = LvlInitStruct(); > - drm_format_modifier.drmFormatModifier = modifier_list->pDrmFormatModifiers[i]; > -- auto image_format_info = LvlInitStruct(&drm_format_modifier); > -- image_format_info.type = pCreateInfo->imageType; > -- image_format_info.format = pCreateInfo->format; > -- image_format_info.tiling = pCreateInfo->tiling; > -- image_format_info.usage = pCreateInfo->usage; > -- image_format_info.flags = pCreateInfo->flags; > -- auto image_format_properties = LvlInitStruct(); > -- > - result = > - DispatchGetPhysicalDeviceImageFormatProperties2(physical_device, &image_format_info, &image_format_properties); > -- format_limits = image_format_properties.imageFormatProperties; > - > - /* The application gives a list of modifier and the driver > - * selects one. If one is wrong, stop there. > -@@ -207,18 +212,8 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate > - if (result != VK_SUCCESS) break; > - } > - } else if (explicit_modifier) { > -- auto drm_format_modifier = LvlInitStruct(); > - drm_format_modifier.drmFormatModifier = explicit_modifier->drmFormatModifier; > -- auto image_format_info = LvlInitStruct(&drm_format_modifier); > -- image_format_info.type = pCreateInfo->imageType; > -- image_format_info.format = pCreateInfo->format; > -- image_format_info.tiling = pCreateInfo->tiling; > -- image_format_info.usage = pCreateInfo->usage; > -- image_format_info.flags = pCreateInfo->flags; > -- auto image_format_properties = LvlInitStruct(); > -- > - result = DispatchGetPhysicalDeviceImageFormatProperties2(physical_device, &image_format_info, &image_format_properties); > -- format_limits = image_format_properties.imageFormatProperties; > - } > - } > - > -@@ -238,6 +233,7 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate > - } > - #endif // VK_USE_PLATFORM_ANDROID_KHR > - } else { > -+ const auto format_limits = image_format_properties.imageFormatProperties; > - if (pCreateInfo->mipLevels > format_limits.maxMipLevels) { > - skip |= LogError(device, "VUID-VkImageCreateInfo-mipLevels-02255", > - "vkCreateImage(): Image mip levels=%d exceed image format maxMipLevels=%d for format %s.", > -@@ -468,8 +464,32 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate > - > - auto external_image_properties = LvlInitStruct(); > - auto image_properties = LvlInitStruct(&external_image_properties); > -- result = DispatchGetPhysicalDeviceImageFormatProperties2(physical_device, &image_info, &image_properties); > -- const auto compatible_types = external_image_properties.externalMemoryProperties.compatibleHandleTypes; > -+ VkExternalMemoryHandleTypeFlags compatible_types = 0; > -+ if (pCreateInfo->tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { > -+ result = DispatchGetPhysicalDeviceImageFormatProperties2(physical_device, &image_info, &image_properties); > -+ compatible_types = external_image_properties.externalMemoryProperties.compatibleHandleTypes; > -+ } else { > -+ auto modifier_list = LvlFindInChain(pCreateInfo->pNext); > -+ auto explicit_modifier = LvlFindInChain(pCreateInfo->pNext); > -+ auto drm_format_modifier = LvlInitStruct(); > -+ external_image_info.pNext = &drm_format_modifier; > -+ drm_format_modifier.sharingMode = pCreateInfo->sharingMode; > -+ drm_format_modifier.queueFamilyIndexCount = pCreateInfo->queueFamilyIndexCount; > -+ drm_format_modifier.pQueueFamilyIndices = pCreateInfo->pQueueFamilyIndices; > -+ if (modifier_list) { > -+ for (uint32_t i = 0; i < modifier_list->drmFormatModifierCount; i++) { > -+ drm_format_modifier.drmFormatModifier = modifier_list->pDrmFormatModifiers[i]; > -+ result = DispatchGetPhysicalDeviceImageFormatProperties2(physical_device, &image_info, &image_properties); > -+ compatible_types |= external_image_properties.externalMemoryProperties.compatibleHandleTypes; > -+ if (result != VK_SUCCESS) > -+ break; > -+ } > -+ } else if (explicit_modifier) { > -+ drm_format_modifier.drmFormatModifier = explicit_modifier->drmFormatModifier; > -+ result = DispatchGetPhysicalDeviceImageFormatProperties2(physical_device, &image_info, &image_properties); > -+ compatible_types = external_image_properties.externalMemoryProperties.compatibleHandleTypes; > -+ } > -+ } > - > - if (result != VK_SUCCESS) { > - skip |= LogError( > diff --git a/patches/vulkan-validationlayers-1.3.246.1/series b/patches/vulkan-validationlayers-1.3.246.1/series > deleted file mode 100644 > index 33102174e7c3..000000000000 > --- a/patches/vulkan-validationlayers-1.3.246.1/series > +++ /dev/null > @@ -1,5 +0,0 @@ > -# generated by git-ptx-patches > -#tag:base --start-number 1 > -0001-Revert-cmake-Fix-find_-support-when-cross-compiling.patch > -0002-layers-Fix-UB-for-VK_IMAGE_TILING_DRM_FORMAT_MODIFIE.patch > -# e0d6af34fb6700edc57f14684c9a4c44 - git-ptx-patches magic > diff --git a/patches/vulkan-validationlayers-1.3.246.1/0001-Revert-cmake-Fix-find_-support-when-cross-compiling.patch b/patches/vulkan-validationlayers-1.3.250.0/0001-Revert-cmake-Fix-find_-support-when-cross-compiling.patch > similarity index 92% > rename from patches/vulkan-validationlayers-1.3.246.1/0001-Revert-cmake-Fix-find_-support-when-cross-compiling.patch > rename to patches/vulkan-validationlayers-1.3.250.0/0001-Revert-cmake-Fix-find_-support-when-cross-compiling.patch > index c3e3338b0009..4716894cdd34 100644 > --- a/patches/vulkan-validationlayers-1.3.246.1/0001-Revert-cmake-Fix-find_-support-when-cross-compiling.patch > +++ b/patches/vulkan-validationlayers-1.3.250.0/0001-Revert-cmake-Fix-find_-support-when-cross-compiling.patch > @@ -17,10 +17,10 @@ Signed-off-by: Philipp Zabel > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt > -index f3536cc2a05e..a71de73111a2 100644 > +index 94c8528c83a4..b8aebdd6eca6 100644 > --- a/scripts/CMakeLists.txt > +++ b/scripts/CMakeLists.txt > -@@ -127,8 +127,4 @@ if (MIMALLOC_INSTALL_DIR) > +@@ -123,8 +123,4 @@ if (MIMALLOC_INSTALL_DIR) > list(APPEND CMAKE_PREFIX_PATH ${MIMALLOC_INSTALL_DIR}) > endif() > > diff --git a/patches/vulkan-validationlayers-1.3.250.0/series b/patches/vulkan-validationlayers-1.3.250.0/series > new file mode 100644 > index 000000000000..ac294ce4fb8b > --- /dev/null > +++ b/patches/vulkan-validationlayers-1.3.250.0/series > @@ -0,0 +1,4 @@ > +# generated by git-ptx-patches > +#tag:base --start-number 1 > +0001-Revert-cmake-Fix-find_-support-when-cross-compiling.patch > +# 6d856a1a207d0d3f7e4c957af59f9af8 - git-ptx-patches magic > diff --git a/rules/vulkan-validationlayers.make b/rules/vulkan-validationlayers.make > index a497ca942c37..1d9361a745fa 100644 > --- a/rules/vulkan-validationlayers.make > +++ b/rules/vulkan-validationlayers.make > @@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_VULKAN_VALIDATIONLAYERS) += vulkan-validationlayers > # > # Paths and names > # > -VULKAN_VALIDATIONLAYERS_VERSION := 1.3.246.1 > -VULKAN_VALIDATIONLAYERS_MD5 := beba63c5c96fadd027ee3c3bd230b19e > +VULKAN_VALIDATIONLAYERS_VERSION := 1.3.250.0 > +VULKAN_VALIDATIONLAYERS_MD5 := 6452bc13fe2b6cb2b69641f572cb0b7a > VULKAN_VALIDATIONLAYERS := vulkan-validationlayers-$(VULKAN_VALIDATIONLAYERS_VERSION) > VULKAN_VALIDATIONLAYERS_SUFFIX := tar.gz > VULKAN_VALIDATIONLAYERS_URL := https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/sdk-$(VULKAN_VALIDATIONLAYERS_VERSION).$(VULKAN_VALIDATIONLAYERS_SUFFIX)