mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 09:50:08 +01:00
vulkan: Make sure we've loaded our connectors when querying plane props.
If you hadn't already called wsi_GetPhysicalDeviceDisplayProperties2KHR or
wsi_GetDrmDisplayEXT before calling
GetPhysicalDeviceDisplayPlaneProperties2KHR, then the connectors list
wouldn't be populated and you'd get no plane properties. Fixes failure of
dEQP-VK.wsi.display.get_display_plane_capabilities when run on its own.
Fixes: #4575
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15353>
(cherry picked from commit da834a12cf)
This commit is contained in:
parent
f17ebb138f
commit
78b826a235
3 changed files with 54 additions and 25 deletions
|
|
@ -6,9 +6,6 @@
|
|||
# reliable to be run in parallel with other tests due to CPU-side timing.
|
||||
dEQP-GLES[0-9]*.functional.flush_finish.*
|
||||
|
||||
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/4575
|
||||
dEQP-VK.wsi.display.get_display_plane_capabilities
|
||||
|
||||
# piglit: WGL is Windows-only
|
||||
wgl@.*
|
||||
|
||||
|
|
|
|||
|
|
@ -1147,7 +1147,7 @@
|
|||
"description": "vulkan: Make sure we've loaded our connectors when querying plane props.",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -460,6 +460,37 @@ wsi_GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice,
|
|||
}
|
||||
}
|
||||
|
||||
static VkResult
|
||||
wsi_get_connectors(VkPhysicalDevice physicalDevice)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice);
|
||||
struct wsi_device *wsi_device = pdevice->wsi_device;
|
||||
struct wsi_display *wsi =
|
||||
(struct wsi_display *) wsi_device->wsi[VK_ICD_WSI_PLATFORM_DISPLAY];
|
||||
|
||||
if (wsi->fd < 0)
|
||||
return VK_SUCCESS;
|
||||
|
||||
drmModeResPtr mode_res = drmModeGetResources(wsi->fd);
|
||||
|
||||
if (!mode_res)
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
|
||||
/* Get current information */
|
||||
for (int c = 0; c < mode_res->count_connectors; c++) {
|
||||
struct wsi_display_connector *connector =
|
||||
wsi_display_get_connector(wsi_device, wsi->fd,
|
||||
mode_res->connectors[c]);
|
||||
if (!connector) {
|
||||
drmModeFreeResources(mode_res);
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
drmModeFreeResources(mode_res);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
wsi_GetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice,
|
||||
uint32_t *pPropertyCount,
|
||||
|
|
@ -470,28 +501,14 @@ wsi_GetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice,
|
|||
struct wsi_display *wsi =
|
||||
(struct wsi_display *) wsi_device->wsi[VK_ICD_WSI_PLATFORM_DISPLAY];
|
||||
|
||||
if (wsi->fd < 0)
|
||||
goto bail;
|
||||
|
||||
drmModeResPtr mode_res = drmModeGetResources(wsi->fd);
|
||||
|
||||
if (!mode_res)
|
||||
/* Get current information */
|
||||
VkResult result = wsi_get_connectors(physicalDevice);
|
||||
if (result != VK_SUCCESS)
|
||||
goto bail;
|
||||
|
||||
VK_OUTARRAY_MAKE(conn, pProperties, pPropertyCount);
|
||||
|
||||
/* Get current information */
|
||||
|
||||
for (int c = 0; c < mode_res->count_connectors; c++) {
|
||||
struct wsi_display_connector *connector =
|
||||
wsi_display_get_connector(wsi_device, wsi->fd,
|
||||
mode_res->connectors[c]);
|
||||
|
||||
if (!connector) {
|
||||
drmModeFreeResources(mode_res);
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
||||
wsi_for_each_connector(connector, wsi) {
|
||||
if (connector->connected) {
|
||||
vk_outarray_append(&conn, prop) {
|
||||
wsi_display_fill_in_display_properties(wsi_device,
|
||||
|
|
@ -501,13 +518,11 @@ wsi_GetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice,
|
|||
}
|
||||
}
|
||||
|
||||
drmModeFreeResources(mode_res);
|
||||
|
||||
return vk_outarray_status(&conn);
|
||||
|
||||
bail:
|
||||
*pPropertyCount = 0;
|
||||
return VK_SUCCESS;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -541,6 +556,10 @@ wsi_GetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice,
|
|||
struct wsi_display *wsi =
|
||||
(struct wsi_display *) wsi_device->wsi[VK_ICD_WSI_PLATFORM_DISPLAY];
|
||||
|
||||
VkResult result = wsi_get_connectors(physicalDevice);
|
||||
if (result != VK_SUCCESS)
|
||||
goto bail;
|
||||
|
||||
VK_OUTARRAY_MAKE(conn, pProperties, pPropertyCount);
|
||||
|
||||
wsi_for_each_connector(connector, wsi) {
|
||||
|
|
@ -554,6 +573,10 @@ wsi_GetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice,
|
|||
}
|
||||
}
|
||||
return vk_outarray_status(&conn);
|
||||
|
||||
bail:
|
||||
*pPropertyCount = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
|
|
@ -566,6 +589,11 @@ wsi_GetPhysicalDeviceDisplayPlaneProperties2KHR(VkPhysicalDevice physicalDevice,
|
|||
struct wsi_display *wsi =
|
||||
(struct wsi_display *) wsi_device->wsi[VK_ICD_WSI_PLATFORM_DISPLAY];
|
||||
|
||||
/* Get current information */
|
||||
VkResult result = wsi_get_connectors(physicalDevice);
|
||||
if (result != VK_SUCCESS)
|
||||
goto bail;
|
||||
|
||||
VK_OUTARRAY_MAKE(conn, pProperties, pPropertyCount);
|
||||
|
||||
wsi_for_each_connector(connector, wsi) {
|
||||
|
|
@ -575,6 +603,10 @@ wsi_GetPhysicalDeviceDisplayPlaneProperties2KHR(VkPhysicalDevice physicalDevice,
|
|||
}
|
||||
}
|
||||
return vk_outarray_status(&conn);
|
||||
|
||||
bail:
|
||||
*pPropertyCount = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue