diff options
author | Iago Toral Quiroga <itoral@igalia.com> | 2023-04-04 12:25:11 +0200 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2023-04-05 13:14:05 -0700 |
commit | 761adfcab84403fae2788b01462a0645ffbf3f9f (patch) | |
tree | b51ce56135b038407c951c4dbe50d353fea16813 | |
parent | f33cca563adbb860d22411664fa136771dacf9f5 (diff) | |
download | mesa-761adfcab84403fae2788b01462a0645ffbf3f9f.tar.gz |
vulkan/wsi/display: set pDisplay to NULL on error
the spec for vkGetDrmDisplayEXT says:
"If there is no VkDisplayKHR corresponding to the connectorId on the
physicalDevice, the returning display must be set to VK_NULL_HANDLE.
The provided drmFd must correspond to the one owned by the physicalDevice.
If not, the error code VK_ERROR_UNKNOWN must be returned. (...)
The given connectorId must be a resource owned by the provided drmFd.
If not, the error code VK_ERROR_UNKNOWN must be returned"
We were only setting the display pointer to VK_NULL_HANDLE if the provided
drmFd was valid, however, there are CTS tests checking that it is also set
to NULL when it is not.
Fixes the following test on all drivers exposing EXT_acquire_drm_display
(tested with Intel and V3DV):
dEQP-VK.wsi.acquire_drm_display.acquire_drm_display_invalid_fd
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>
(cherry picked from commit 1bbbdbe6663a582150aff05f78f4b7ce36c69ce8)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common_display.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index 825cdc177bb..361adce07e8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -238,7 +238,7 @@ "description": "vulkan/wsi/display: set pDisplay to NULL on error", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c index c6f1a1568b4..0bca7e8efbe 100644 --- a/src/vulkan/wsi/wsi_common_display.c +++ b/src/vulkan/wsi/wsi_common_display.c @@ -3110,8 +3110,10 @@ wsi_GetDrmDisplayEXT(VkPhysicalDevice physicalDevice, VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice); struct wsi_device *wsi_device = pdevice->wsi_device; - if (!wsi_device_matches_drm_fd(wsi_device, drmFd)) + if (!wsi_device_matches_drm_fd(wsi_device, drmFd)) { + *pDisplay = VK_NULL_HANDLE; return VK_ERROR_UNKNOWN; + } struct wsi_display_connector *connector = wsi_display_get_connector(wsi_device, drmFd, connectorId); |