vulkan/wsi: add drm_fd param to wsi_display_get_connector
Modifies the signature on `wsi_display_get_connector` to retrieve the connector of an arbitrary DRM FD instead of the one taken from the wsi_display. Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca> Reviewed-by: Simon Ser <contact@emersion.fr> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11014>
This commit is contained in:
parent
7fb70ee2d5
commit
fdf22aad73
1 changed files with 6 additions and 4 deletions
|
|
@ -282,16 +282,17 @@ wsi_display_alloc_connector(struct wsi_display *wsi,
|
|||
|
||||
static struct wsi_display_connector *
|
||||
wsi_display_get_connector(struct wsi_device *wsi_device,
|
||||
int drm_fd,
|
||||
uint32_t connector_id)
|
||||
{
|
||||
struct wsi_display *wsi =
|
||||
(struct wsi_display *) wsi_device->wsi[VK_ICD_WSI_PLATFORM_DISPLAY];
|
||||
|
||||
if (wsi->fd < 0)
|
||||
if (drm_fd < 0)
|
||||
return NULL;
|
||||
|
||||
drmModeConnectorPtr drm_connector =
|
||||
drmModeGetConnector(wsi->fd, connector_id);
|
||||
drmModeGetConnector(drm_fd, connector_id);
|
||||
|
||||
if (!drm_connector)
|
||||
return NULL;
|
||||
|
|
@ -314,7 +315,7 @@ wsi_display_get_connector(struct wsi_device *wsi_device,
|
|||
for (int p = 0; connector->dpms_property == 0 &&
|
||||
p < drm_connector->count_props; p++)
|
||||
{
|
||||
drmModePropertyPtr prop = drmModeGetProperty(wsi->fd,
|
||||
drmModePropertyPtr prop = drmModeGetProperty(drm_fd,
|
||||
drm_connector->props[p]);
|
||||
if (!prop)
|
||||
continue;
|
||||
|
|
@ -480,7 +481,8 @@ wsi_display_get_physical_device_display_properties2(
|
|||
|
||||
for (int c = 0; c < mode_res->count_connectors; c++) {
|
||||
struct wsi_display_connector *connector =
|
||||
wsi_display_get_connector(wsi_device, mode_res->connectors[c]);
|
||||
wsi_display_get_connector(wsi_device, wsi->fd,
|
||||
mode_res->connectors[c]);
|
||||
|
||||
if (!connector) {
|
||||
drmModeFreeResources(mode_res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue