summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-01-26Fix build error for riscvtizen_9.0_m2_releaseaccepted/tizen/unified/x/20240220.145956accepted/tizen/unified/toolchain/20240311.070107accepted/tizen/unified/dev/20240620.011202accepted/tizen/unified/20240219.160428accepted/tizen/9.0/unified/20241030.233251tizen_9.0tizenaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unifiedXuelian Bai1-1/+1
Change-Id: I95b17986164acb649d33aa3df25bf3bdaca87a59
2024-01-16Upgrade to latest versionXuelian Bai3-6/+12
Change-Id: I4e1cff2df4932b6525457ccf43a613b467c3fe0e
2024-01-16Fix some issues for pvr riscv & pixel phoneXuelian Bai10-34/+91
1. Fix dEQP-VK.api.info.get_physical_device_properties2.features. image_compression_control_swapchain_features_ext failed issue. 2. Add support for vkGetPhysicalDeviceSurfaceCapabilities2KHR 3. Call vkGetDeviceQueue2 only for VK_IMAGE_CREATE_PROTECTED_BIT, or pvr ICD and pixel phone ICD will crash Change-Id: Ia05100a3bb8159bce0ce93ebca225b4ac41ddfa5 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Fix issue for android-cts9 cases on pixel phoneXuelian Bai7-6/+37
1. Add support for vkGetSwapchainStatusKHR 2. Add support for queue with VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT 3. Fixed memory leak issue Change-Id: I51eb4fad07b4cba0dde89af7d77b3a3d1258a09a Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16fix the build error with including missing headers.Joonbum Ko1-0/+1
Change-Id: Ic4306eb719b0939b8e393e4ba38e831676e82a1c Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
2024-01-16fix new-delete mismatched errorJoonbum Ko1-1/+1
Change-Id: I290d6ecf772ea3d9c89d251f849f00238171b52b Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
2024-01-16Enable VK_EXT_image_compression_controlXuelian Bai5-10/+23
VK_EXT_image_compression_control is an extension for arm afbc. Change-Id: I7a018c82b369874d0a37b6ec16828021c770c39c Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Fix bugs for hybris vulkanXuelian Bai2-1/+55
1. fix failed case "dEQP-VK.api.version_check.entry_points" Check if extension is enabled before getting handle 2. Create image with protected bit from swapchain info 3. If queue is getting failed, return error 4. Don't use old pNext pointer to avoid crash Change-Id: I89426db18dbbd22cb39f0616990e1e3f0b021029 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Fix issue of vkGetPhysicalDeviceSurfaceFormats2KHRXuelian Bai1-1/+1
Fixed failed issue of cts case dEQP-VK.wsi.wayland.surface.query_formats2 Change-Id: I6a703e5c41812bced94073c562a4c0db710ae739 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Update to latest upstream versionXuelian Bai14-182/+406
Change-Id: Idaa93081d2f067085145cec4902bac45121a3ba1 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Fix crash when enable validation layerXuelian Bai1-10/+8
When creating surface, validation layer will call WrapNew() function to generate hash and return uint64_t hash id in returned VkSurfaceKHR, this will be an invalid address in 32-bit platform, and also we can't get correct pIcdSurface structure from it. So don't use VkSurfaceKHR surface parameter in get_surface_* functions. Change-Id: I4434295887431509ab99664ceb41edf0c154b361 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Fix red and blue inverted issueXuelian Bai2-5/+6
Non-packed 8-bit formats have an inverted channel order compared to the little endian DRM formats 1. Set supported surface format as VK_FORMAT_B8G8R8A8_* 2. Invert RGB to BGR in format map Change-Id: Iab05870d25a309f11666083fa3d56ca54a28b391 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Fix resize issueXuelian Bai2-7/+17
Fix error when running dEQP-VK.wsi.wayland.swapchain.modify.resize case. When running this case, it will pend on dequeue old swapchain. Change-Id: I831e22fe3d826f66b0df670e1df333e35dce1005 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Fix to support swapchain re-createJoonbum Ko2-7/+18
Change-Id: I062e7dbc138da2a25fa5aebc2c628a139f3bfe1c Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com> Fix to support swapchain re-create Change-Id: I062e7dbc138da2a25fa5aebc2c628a139f3bfe1c Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
2024-01-16Load implicit layer as defaultXuelian Bai1-5/+2
By removing enable_environment, implicit layer will be loaded as default Change-Id: I263421432fa0a68429dd4e615013d4175538c3e1 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Fix build warnings and errorsXuelian Bai8-25/+37
Manually add "Werror=shadow" for adapt different building environment Change-Id: I3bf38846dc3dce9e774de00f9c74883020577d56 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com> Fix build errors and warnings Add build options of TV Change-Id: If122d940e95d1e543b229306921e9eb5934867dd Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Remove deprecated code, add manifest&licenseXuelian Bai2-8/+5
1.USE_ICD_MALI_NIKEM is used for old mesa, after mesa upgraded, it's uselese. 2.Add manifest & license files in spec file. Change-Id: Ia5cbe4fe393e1d6bd2892fb9f3aa5bf742fba511 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
2024-01-16Fix coredump issue:Tianhao Ni1-0/+1
- m_present_region should be init with nullptr Change-Id: Ie4d871a746087a718cf337ac564ff876f63e899e Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
2024-01-16Add tizen platform in vulkan-wsi-layerTianhao Ni23-5/+1772
Change-Id: I34f8c7b909c54329e67ea8658b86f168c29ce28c Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com> Implement WSI layer swapchain functions for Tizen: 1. Create TPL swapchain for Tizen platform; 2. Alloc tbm buffer for vulkan image; 3. Acquire and present image via dequeue/enqueue tpl buffer queue. Change-Id: I5319c45fe0aa7f0f508b6279532412467d4fe438 Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com> Filter extensions supported by wsi layer: - When enable wsi layer, ICD should not enable the VK_KHR_wayland_surface_extension in the VkInstanceCreateInfo structure, if we pass VK_KHR_wayland_surface_extension name when calling ICD's vkCreateInstance API, it will cause "unspported extension" issue. So we remove the VK_KHR_wayland_surface_extension in the layer, and do not pass it to ICD. Check validation layer feature when validation layer is enabled: - Wsi layer is calling before validation layer, so if validation layer must disable the feature "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", otherwise wsi layer can not use handles with validation layer handle wrapper. So in wsi layer, we must check if this feature is disabled. Change-Id: I07fcffc01f0ffb59f5cc8d088edf3de57d9dc840 Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com> Add support for VK_KHR_incremental_present Read region information from VkPresentRegionsKHR. Change-Id: I60668599de5331108066a5ba8630867684cea92e Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com> Update for CTS test: - Upgrade wsi vulkan version to sync with vulkan loader & vulkan header - Implement vkCreateWaylandSurfaceKHR & vkDestroySurfaceKHR for TPL display management - Fix issues of CTS wsi cases Change-Id: I96a4e0bc9e36a8aa71819f886a293a4994629e6e Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com> Fix issues of CTS verificate - Fix incorrect TPL calling sequence, remove function: vkCreateWaylandSurfaceKHR vkDestroySurfaceKHR - Implement Functions vkAcquireNextImage2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceFormats2KHR vkGetPhysicalDevicePresentRectanglesKHR - Add dlog for debug Change-Id: I81b13173ff98dd268bb6ba8b6a2acd5231b7961d Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com> Fix CTS Coredump issue of "image_swapchain_create_info" cases on NikeM: Wsi layer and Mali has different swapchain defination, if we pass VkImageSwapchainCreateInfoKHR to Mali, Mali will handle swapchain object of wsi layer, which will cause SegmentFault issue. - Handle VkImageSwapchainCreateInfoKHR of vkCreateImage in wsi layer instead of Mali - Handle VkBindImageMemorySwapchainInfoKHR of vkBindImageMemory2 in wsi layer instead of Mali Change-Id: I85459c0d99409e34657673a64ae29985090bd20c Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com> Mesa 21.2.3 Now support VkExternalMemoryImageCreateInfoKHR Change-Id: Ia08011a571d804e4d62be11a550cff29f5c28113 Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com> Upgrade WSI Layer Change-Id: I6eb06fb17aa1d35d9eea661f9f128261ca3ae6ba Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
2024-01-05Fix issues flagged by static analysisupstreamDennis Tsiang1-3/+13
Add error handling to snprintf. Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com> Change-Id: Id0c0478254c57cb62af6f9cadde16f73b071f466
2023-11-01Fix validation error when importing sync fdsDennis Tsiang1-0/+1
Vulkan spec mandates that if handleType of VkImportSemaphoreFdInfoKHR refers to a handle type with copy payload transference semantics (which VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT is), then flags must contain VK_SEMAPHORE_IMPORT_TEMPORARY_BIT. Change-Id: I426bc4749da48aa12aee55eaa3a1739c7226e8e8 Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2023-10-31add missing <system_error> includeJiyu Yang1-0/+1
fix build error with GCC 13: ``` wsi/swapchain_base.cpp:150:35: error: expected unqualified-id before ‘&’ token 150 | catch (const std::system_error &) | ``` Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2023-10-31fix Use after freeJiyu Yang1-3/+3
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2023-10-31Use wayland-scanner public-codeDaniel Levin1-2/+2
2023-10-31Use find_program instead of pkg_get_variable for wayland-scannerDaniel Levin1-2/+1
2023-10-19Fix formatting long as %d in util/log.cppDaniel Levin2-5/+6
Changed log level type from long to int, since value is expected to be a small integer in range [0-3]. Since codebase requires C++17 also replaced strtol with std::from_chars(), which will parse string as int, and skip updating the defaut value if VULKAN_WSI_DEBUG_LEVEL env var does not represent int. Signed-off-by: Daniel Levin <daniel.levin@amd.com>
2023-09-28Enable instance extensionsAngeliki Agathi Tsintzira8-49/+118
Modify the layer so that instance extensions needed for Wayland are only enabled when Wayland is selected. In the past, the layer was changed to explicitly enable the instance extensions it needs in the intercepted calls to vkCreateInstance. Therefore, the layers always enabled the extension VK_KHR_external_memory_capabilities, despite this is only required by Wayland. In this patch, this extension is only enabled when Wayland is enabled, i.e. when VK_KHR_wayland_surface is part of the extensions passed to vkCreateInstance. Signed-off-by: Angeliki Agathi Tsintzira <angelikiagathi.tsintzira@arm.com> Change-Id: I57e98b36e42012ba46769e9dd760a628a09b9ba5
2023-04-20Avoid returning VK_ERROR_DEVICE_LOSTDennis Tsiang2-12/+6
VK_ERROR_DEVICE_LOST implies that the GPU device has entered an unrecoverable state and further API usage is considered invalid. Thus, it should be used sparingly. For the layer code, we were returning VK_ERROR_DEVICE_LOST for implementation specific errors as sort of a catch all, even when the GPU was still usable. Instead, it would be better to return other error codes to denote a failure somewhere. For the page_flip_thread, if we receive a VK_TIMEOUT waiting for the image's present fence, then we continously retry. All other error codes will still be propagated. For the wayland swapchain, instead of returning VK_ERROR_DEVICE_LOST when we encounter an error in the dispatch_queue call, return VK_ERROR_SURFACE_LOST_KHR, as this is more suitable. Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com> Change-Id: Iccc3e75b60fe9296b10963e7f0b3041fbcd29198
2023-04-17Replace VK_LAYER_EXPORT with VWL_VKAPI_EXPORTNormunds Rieksts2-3/+13
2023-02-16Move memory handle type setting into allocate_wsiallocDennis Tsiang1-3/+2
This keeps it closer to where the rest of the external_memory parameters are set. Change-Id: Ibc46e90cebc6d715003772cc78294e164085cfa6 Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2023-02-12Change vulkan wsi project to use "main" branchNir Ekhauz2-7/+7
Signed-off-by: Nir Ekhauz <nir.ekhauz@arm.com> Change-Id: I82fa871371bf025a5c181f3b55812a2bee80d566
2023-02-07Use strtol instead of std::atoi in loggingDennis Tsiang2-20/+15
strtol does not throw exceptions. Change-Id: I6d6d3c32c2b61ed0307370bbfc3ce333adb5c504 Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2023-01-10Fix a bug in queue submissionNormunds Rieksts1-3/+20
Fixes a bug in queue submission where the wrong amount of VkPipelineStageFlags were passed to vkQueueSubmit when the number of semaphores to wait on were more than 1. Change-Id: Ic66e0c6a5e4f60659a0fb31c64c565820d4708a8 Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2022-11-24Extend TRY macro to print out error messagesNormunds Rieksts8-202/+116
Extends the TRY macros exposed by the helper header to be able to print out error messages. Change-Id: I61c607376304ba744a95dd6782bb29653235096a Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2022-11-11Fix issues reported by static analysis toolsDennis Tsiang8-44/+67
Fix CERT C/CPP issues flagged by static analysis tools. Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com> Change-Id: I6758bb83bd0647e4e6b7ccbf84e94f05ba90e160
2022-10-31Add pre-commit hook to check for copyright headerBen Davis3-0/+198
Change-Id: I1d3b9d51305d257c9c322caf4cf4d97667fb687b Signed-off-by: Ben Davis <ben.davis@arm.com>
2022-10-21Decouple creation, allocation and binding of images from Wayland backendDennis Tsiang7-322/+561
A lot of the steps involved in creating a VkImage, allocating backing memory, and binding the VkImage to the memory do not rely specifically on Wayland features and could be common to other WSI backends. This commit attempts to decouple the create_and_bind_swapchain_image() function in the wsi/wayland/swapchain.cpp from Wayland and wsialloc specific parts, and instead move the independent parts related to external memory management to a new external_memory class. This will allow the independent code to be re-used in future WSI backends. Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com> Change-Id: I8c13ccbbfaef0d345fcd06192e6de484dd53645f
2022-10-20Add codebase guidelines to the projectNormunds Rieksts1-0/+29
2022-09-13Adding VK_KHR_shared_presentable_image basic supportLior Dekel1-0/+7
To comply with ICDs that expose the VK_KHR_shared_presentable_image extension, the Layer needs to handle VkSharedPresentSurfaceCapabilitiesKHR struct (holds sType=VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR) for queries on the VkSurfaces managed by the Layer. A simple implementation that sets the minimum required flags is provided in this commit. Since no WSI layer swapchain will support the shared presentable modes, no other functionality is required. VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT must be included in the sharedPresentSupportedUsageFlags field but implementations may support additional usages. Signed-off-by: Lior Dekel <lior.dekel@arm.com> Change-Id: I73b29e54a84376c663b3cada989c910d1ba27293
2022-08-25Add Pre-commit config and add to CI pipelineBen Davis2-24/+40
2022-08-19Update WSI layer to use C++17Aron Virginas-Tar9-233/+38
2022-08-15Increase max swapchain image countDennis Tsiang1-2/+2
3 is not enough for performance testing. Let us double the maximum number we can make. Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com> Change-Id: I11a055ede33c9d10311109085e59d3f8c1fbcb7e
2022-08-03Remove duplication of create_aliased_image_handle implementationsAron Virginas-Tar7-109/+44
Signed-off-by: Aron Virginas-Tar <aron.virginas-tar@arm.com> Change-Id: I37043259e349874a9a7eb495a0e3b939c144798f
2022-08-03Fix issue found by static analysisAron Virginas-Tar1-3/+6
Replaced call to unsafe function strcpy() with call to snprintf(). Signed-off-by: Aron Virginas-Tar <aron.virginas-tar@arm.com> Change-Id: I0de5f869200e74b6d0c8224da2e41d6c4b8b6f4d
2022-07-21Fix issues found by static analysisMatteo Franchin6-21/+34
All of the issues that this patch fixes should not occur in practice, but make the code a bit more robust. For example, this patch default-initializes structures passed to Vulkan for initialization. Normally, initialization should be done by the Vulkan entrypoint, so it should be fine not initializing the structure as long as the Vulkan API entrypoint exits with success status. It is still a good idea to default-initialize anyway to make the behaviour deterministic in cases where something is wrong in the system. All changes made should have a negligible impact on performance for typical applications. Change-Id: Ia606ad2d3ea1627f9dfef0cadf93c7468ab568d8 Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
2022-07-13Create common functions in surface_capabilities classLior Dekel4-93/+87
Signed-off-by: Lior Dekel <lior.dekel@arm.com> Change-Id: Ia5053b202f4e64fd7a255ede513653a951ab3d41
2022-07-12Update Khronos headers API versionRosen Zhelev1-1/+1
Change-Id: Ifa3f945a1216677c9410c09f4b4341a70d918514 Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
2022-07-07Remove swapchain from device_data after destructionIason Paraskevopoulos3-0/+20
Fixes an issue, where the swapchain addresses weren't removed from the device_private_data::swapchains member after swapchain destruction. This could cause clashes with swapchains handled by different components (e.g. ICD). Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com> Change-Id: I0e05734368ef6100b67ded973283f99ef248e540
2022-06-15Add WSI integration guideIason Paraskevopoulos3-0/+262
Adds a guide on implementing a WSI backend and extra documentation in a few functions in swapchain_base. Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com> Change-Id: Ibdc702a05605989940966aae168331268c1ce2ba
2022-05-30Enable instance extensions required by layerMatteo Franchin5-89/+110
The layer needs functionality that is not part of Vulkan 1.0 and is provided by either Vulkan 1.1 or separate Vulkan extensions. The layer used to solve this issue by bumping the API version passed by the application in VkCreateInfo to 1.1 if this was set to 1.0. This workaround does not seem to be working anymore with recent versions of the loader. Fortunately, the loader now allows layers to change the extension lists passed by the application. This patch changes the layer to use this approach and removes the API bump logic. Documentation is updated accordingly. Change-Id: I61c426311612c7f288a0f7d969782d6c5365acf5 Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>