mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
wsi/display: initialize Xlib display connector property IDs in all cases
Usually connector property IDs are acquired in wsi_display_get_connector, which is called by wsi_get_connectors, and in turn by vkGetPhysicalDeviceDisplayProperties2KHR and vkGetPhysicalDeviceDisplayPlanePropertiesKHR. Except if the drm fd is not available when these functions are called. Which will be the case if vkAcquireXlibDisplayEXT is not called first. So it goes like this. First, the display is created in vkGetRandROutputDisplayEXT. Then it's used in vkGetPhysicalDeviceDisplayPlanePropertiesKHR, but since the drm fd is not available at this point, connector property IDs are not initialized. Later, this display is used in vkAcquireXlibDisplayEXT, which also doesn't touch the property IDs. Finally in drm_atomic_commit, the atomic commit fails with EINVAL, specifically because of the uninitialized ID of the "CRTC_ID" property. Since it's one of the properties drm_atomic_commit tries to set. This commit makes sure that find_connector_properties is called in vkAcquireXlibDisplayEXT to initialize the property IDs. Fixes:513ffea1d3("wsi/display: use atomic mode setting") Signed-off-by: Yuxuan Shui <yshui@codeweavers.com> (cherry picked from commit37a1986691) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40979>
This commit is contained in:
parent
18115a5df5
commit
035be8e042
2 changed files with 17 additions and 1 deletions
|
|
@ -1324,7 +1324,7 @@
|
|||
"description": "wsi/display: initialize Xlib display connector property IDs in all cases",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "513ffea1d366c82e50975fd430d012ff8e652a79",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -3802,6 +3802,22 @@ wsi_AcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice,
|
|||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
|
||||
drmSetClientCap(fd, DRM_CLIENT_CAP_ATOMIC, 1);
|
||||
|
||||
drmModeConnectorPtr drm_connector =
|
||||
drmModeGetConnector(fd, connector->id);
|
||||
|
||||
if (!drm_connector) {
|
||||
close(fd);
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
}
|
||||
|
||||
bool success = find_connector_properties(connector, drm_connector, fd);
|
||||
drmModeFreeConnector(drm_connector);
|
||||
if (!success) {
|
||||
close(fd);
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
}
|
||||
|
||||
wsi->fd = fd;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue