mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: implement GET_BUFFER_INFO ioctl
Userspace applications will need to query buffer information such as size, comptags allocation status, user associated metadata etc. for enabling newer IPC mechanisms. Add support for this new ioctl. Bug 200586313 Change-Id: I87607eb306afa0cce1bec7a1fb2925ec3bc33e50 Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2480763 Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
ed16377983
commit
79fb97100d
@@ -503,6 +503,27 @@ struct nvgpu_gpu_vsms_mapping {
|
||||
__u64 vsms_map_buf_addr;
|
||||
};
|
||||
|
||||
/*
|
||||
* get buffer information ioctl.
|
||||
*
|
||||
* Note: Additional metadata is available with the buffer only for supporting
|
||||
* legacy userspace APIs and for compatibility with desktop RM. Usage of this
|
||||
* API should be avoided.
|
||||
*
|
||||
* This ioctl returns information about buffer to libnvrm_gpu. This information
|
||||
* includes buffer registration status, comptags allocation status, size of the
|
||||
* buffer, copy of the metadata blob associated with the buffer during
|
||||
* registration based on input size and size of the metadata blob
|
||||
* registered.
|
||||
*
|
||||
* return 0 on success, < 0 in case of failure. Note that If the buffer
|
||||
* has no privdata allocated or if it is not registered, this
|
||||
* devctl returns 0 with only size.
|
||||
* retval -EINVAL if the enabled flag NVGPU_SUPPORT_BUFFER_METADATA isn't
|
||||
* set or invalid params.
|
||||
* retval -EFAULT if the metadata blob copy fails.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If the buffer registration is done, this flag is set in the output flags in
|
||||
* the buffer info query ioctl.
|
||||
@@ -510,11 +531,24 @@ struct nvgpu_gpu_vsms_mapping {
|
||||
#define NVGPU_GPU_BUFFER_INFO_FLAGS_METADATA_REGISTERED (1ULL << 0)
|
||||
|
||||
/*
|
||||
* If the comptags are allocated for the buffer, this flag is set in the output
|
||||
* flags in the buffer info query ioctl.
|
||||
* If the comptags are allocated and enabled for the buffer, this flag is set
|
||||
* in the output flags in the buffer info query ioctl.
|
||||
*/
|
||||
#define NVGPU_GPU_BUFFER_INFO_FLAGS_COMPTAGS_ALLOCATED (1ULL << 1)
|
||||
|
||||
/*
|
||||
* If the metadata state (blob and comptags) of the buffer can be redefined,
|
||||
* this flag is set in the output flags in the buffer info query ioctl.
|
||||
*/
|
||||
#define NVGPU_GPU_BUFFER_INFO_FLAGS_MUTABLE_METADATA (1ULL << 2)
|
||||
|
||||
/*
|
||||
* get buffer info ioctl arguments struct.
|
||||
*
|
||||
* Note: Additional metadata is available with the buffer only for supporting
|
||||
* legacy userspace APIs and for compatibility with desktop RM. Usage of this
|
||||
* API should be avoided.
|
||||
*/
|
||||
struct nvgpu_gpu_get_buffer_info_args {
|
||||
union {
|
||||
struct {
|
||||
|
||||
Reference in New Issue
Block a user