mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39166>
This commit is contained in:
parent
1e53a7f052
commit
37a1986691
1 changed files with 16 additions and 0 deletions
|
|
@ -4198,6 +4198,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