mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-11 17:50:32 +01:00
Merge branch 'steamvr-836-mesa-14382' into 'main'
wsi/display: make sure Xlib display connectors have property IDs See merge request mesa/mesa!39166
This commit is contained in:
commit
dc75bc851b
1 changed files with 19 additions and 10 deletions
|
|
@ -667,6 +667,7 @@ wsi_display_alloc_connector(struct wsi_display *wsi,
|
|||
/* XXX use EDID name */
|
||||
connector->name = "monitor";
|
||||
list_inithead(&connector->display_modes);
|
||||
list_addtail(&connector->list, &wsi->connectors);
|
||||
|
||||
return connector;
|
||||
}
|
||||
|
|
@ -693,14 +694,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);
|
||||
|
||||
|
|
@ -716,7 +709,6 @@ wsi_display_get_connector(struct wsi_device *wsi_device,
|
|||
drmModeFreeConnector(drm_connector);
|
||||
return NULL;
|
||||
}
|
||||
list_addtail(&connector->list, &wsi->connectors);
|
||||
}
|
||||
|
||||
if (!find_connector_properties(connector, drm_connector, drm_fd)) {
|
||||
|
|
@ -3954,7 +3946,6 @@ wsi_display_get_randr_output(struct wsi_device *wsi_device,
|
|||
if (!connector) {
|
||||
return NULL;
|
||||
}
|
||||
list_addtail(&connector->list, &wsi->connectors);
|
||||
}
|
||||
connector->output = output;
|
||||
}
|
||||
|
|
@ -4117,6 +4108,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
|
||||
|
||||
|
|
@ -4456,6 +4463,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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue