wsi/display: move set atomic cap out of wsi_display_get_connector

In all other cases, we immediately set atomic cap after acquiring a drm
fd:

- wsi_init
- AcquireXlib
- AcquireDrm

wsi_GetDrmDisplayEXT is the only function left where the atomic cap is
set by wsi_display_get_connector. This commit moves the set atomic cap
into wsi_GetDrmDisplayEXT.

Signed-off-by: Yuxuan Shui <yshui@codeweavers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39166>
This commit is contained in:
Yuxuan Shui 2026-01-05 19:13:14 +00:00 committed by Marge Bot
parent 37a1986691
commit 4200ab60ff

View file

@ -719,14 +719,6 @@ wsi_display_get_connector(struct wsi_device *wsi_device,
if (drm_fd < 0)
return NULL;
/* We set this flag because this is the common entrypoint before we start
* using atomic capabilities -- it's a simple bool setting in the kernel to
* make the properties we start querying be available, and re-setting it is
* harmless. Otherwise, we'd need to push it up to all the entrypoints that
* a drm FD comes thorugh.
*/
drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1);
drmModeConnectorPtr drm_connector =
drmModeGetConnector(drm_fd, connector_id);
@ -4553,6 +4545,8 @@ wsi_GetDrmDisplayEXT(VkPhysicalDevice physicalDevice,
return VK_ERROR_UNKNOWN;
}
drmSetClientCap(drmFd, DRM_CLIENT_CAP_ATOMIC, 1);
struct wsi_display_connector *connector =
wsi_display_get_connector(wsi_device, drmFd, connectorId);