// Copyright 2018-2021 The Khronos Group, Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

[open,refpage='vkAcquireDrmDisplayEXT',desc='Acquire access to a VkDisplayKHR using DRM',type='protos']
--
To acquire permission to directly a display in Vulkan from the Direct
Rendering Manager (DRM) interface, call:

include::{generated}/api/protos/vkAcquireDrmDisplayEXT.txt[]

  * pname:physicalDevice The physical device the display is on.
  * pname:drmFd DRM primary file descriptor.
  * pname:display The display the caller wishes Vulkan to control.

All permissions necessary to control the display are granted to the Vulkan
instance associated with the provided pname:physicalDevice until the display
is either released or the connector is unplugged.
The provided pname:drmFd must correspond to the one owned by the
pname:physicalDevice.
If not, the error code ename:VK_ERROR_UNKNOWN must be returned.
The DRM FD must have DRM master permissions.
If any error is encountered during the acquisition of the display, the call
must return the error code ename:VK_ERROR_INITIALIZATION_FAILED.

The provided DRM fd should not be closed before the display is released,
attempting to do it may result in undefined: behaviour.

include::{generated}/validity/protos/vkAcquireDrmDisplayEXT.txt[]
--

[open,refpage='vkGetDrmDisplayEXT',desc='Query the VkDisplayKHR corresponding to a DRM connector ID',type='protos']
--
Before acquiring a display from the DRM interface, the caller may want to
select a specific sname:VkDisplayKHR handle by identifying it using a
pname:connectorId.
To do so, call:

include::{generated}/api/protos/vkGetDrmDisplayEXT.txt[]

  * pname:physicalDevice The physical device to query the display from.
  * pname:drmFd DRM primary file descriptor.
  * pname:connectorId Identifier of the specified DRM connector.
  * pname:display The corresponding slink:VkDisplayKHR handle will be
    returned here.

If there is no slink:VkDisplayKHR corresponding to the pname:connectorId on
the pname:physicalDevice, the returning pname:display must be set to
dlink:VK_NULL_HANDLE.
The provided pname:drmFd must correspond to the one owned by the
pname:physicalDevice.
If not, the error code ename:VK_ERROR_UNKNOWN must be returned.
Master permissions are not required, because the file descriptor is just
used for information gathering purposes.
The given pname:connectorId must be a resource owned by the provided
pname:drmFd.
If not, the error code ename:VK_ERROR_UNKNOWN must be returned.
If any error is encountered during the identification of the display, the
call must return the error code ename:VK_ERROR_INITIALIZATION_FAILED.

include::{generated}/validity/protos/vkGetDrmDisplayEXT.txt[]
--
