habanalabs: Add CB IOCTL opcode to retrieve CB information
Add a new CB IOCTL opcode that enables a user to query about a CB and get its usage count. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
This commit is contained in:
@@ -483,6 +483,8 @@ struct hl_info_args {
|
||||
#define HL_CB_OP_CREATE 0
|
||||
/* Opcode to destroy previously created command buffer */
|
||||
#define HL_CB_OP_DESTROY 1
|
||||
/* Opcode to retrieve information about a command buffer */
|
||||
#define HL_CB_OP_INFO 2
|
||||
|
||||
/* 2MB minus 32 bytes for 2xMSG_PROT */
|
||||
#define HL_MAX_CB_SIZE (0x200000 - 32)
|
||||
@@ -506,8 +508,17 @@ struct hl_cb_in {
|
||||
};
|
||||
|
||||
struct hl_cb_out {
|
||||
/* Handle of CB */
|
||||
__u64 cb_handle;
|
||||
union {
|
||||
/* Handle of CB */
|
||||
__u64 cb_handle;
|
||||
|
||||
/* Information about CB */
|
||||
struct {
|
||||
/* Usage count of CB */
|
||||
__u32 usage_cnt;
|
||||
__u32 pad;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
union hl_cb_args {
|
||||
|
||||
Reference in New Issue
Block a user