mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 19:50:12 +01:00
Merge branch 'main' into 'main'
amdgpu: Add an api amdgpu_device_dup_fd See merge request mesa/drm!271
This commit is contained in:
commit
2e47ee44d2
3 changed files with 29 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ amdgpu_cs_query_fence_status
|
||||||
amdgpu_cs_query_reset_state
|
amdgpu_cs_query_reset_state
|
||||||
amdgpu_cs_query_reset_state2
|
amdgpu_cs_query_reset_state2
|
||||||
amdgpu_query_sw_info
|
amdgpu_query_sw_info
|
||||||
|
amdgpu_device_dup_fd
|
||||||
amdgpu_cs_signal_semaphore
|
amdgpu_cs_signal_semaphore
|
||||||
amdgpu_cs_submit
|
amdgpu_cs_submit
|
||||||
amdgpu_cs_submit_raw
|
amdgpu_cs_submit_raw
|
||||||
|
|
|
||||||
|
|
@ -1942,6 +1942,18 @@ int amdgpu_vm_reserve_vmid(amdgpu_device_handle dev, uint32_t flags);
|
||||||
*/
|
*/
|
||||||
int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev, uint32_t flags);
|
int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev, uint32_t flags);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a DRM render node FD Returns a duplicate of the render node file descriptor used by the device.
|
||||||
|
* It is the caller's responsibility to close this file descriptor when it is
|
||||||
|
* no longer needed.
|
||||||
|
*
|
||||||
|
* \param dev - \c [in] Opaque device handle returned by amdgpu_device_initialize
|
||||||
|
*
|
||||||
|
* \return render node file descriptor on success\n
|
||||||
|
* <0 - Negative POSIX error code
|
||||||
|
*/
|
||||||
|
int amdgpu_device_dup_fd(amdgpu_device_handle dev);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -325,3 +325,19 @@ drm_public int amdgpu_query_sw_info(amdgpu_device_handle dev,
|
||||||
}
|
}
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drm_public int amdgpu_device_dup_fd(amdgpu_device_handle dev)
|
||||||
|
{
|
||||||
|
struct amdgpu_device *dev_tmp;
|
||||||
|
|
||||||
|
pthread_mutex_lock(&dev_mutex);
|
||||||
|
for (dev_tmp = dev_list; dev_tmp; dev_tmp = dev_tmp->next){
|
||||||
|
if (dev_tmp == dev){
|
||||||
|
pthread_mutex_unlock(&dev_mutex);
|
||||||
|
return fcntl(dev_tmp->fd, F_DUPFD_CLOEXEC, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pthread_mutex_unlock(&dev_mutex);
|
||||||
|
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue