diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2020-04-17 12:12:13 +0300 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2020-05-19 14:48:41 +0300 |
commit | 39b425170d35ff0841084007423f1b82f3b3e5ac (patch) | |
tree | c99803b8d363f1542ffcb7e4c2675f9ac664e257 /include/uapi/misc | |
parent | 8e708af2846fd1183ce2e5690e46155ee1342d25 (diff) | |
download | linux-39b425170d35ff0841084007423f1b82f3b3e5ac.tar.gz linux-39b425170d35ff0841084007423f1b82f3b3e5ac.tar.bz2 linux-39b425170d35ff0841084007423f1b82f3b3e5ac.zip |
habanalabs: leave space for 2xMSG_PROT in CB
The user must leave space for 2xMSG_PROT in the external CB, so adjust the
define of max size accordingly. The driver, however, can still create a CB
with the maximum size of 2MB. Therefore, we need to add a check
specifically for the user requested size.
Reviewed-by: Tomer Tayar <ttayar@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'include/uapi/misc')
-rw-r--r-- | include/uapi/misc/habanalabs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/uapi/misc/habanalabs.h b/include/uapi/misc/habanalabs.h index 4d593050c42b..523e511e6cff 100644 --- a/include/uapi/misc/habanalabs.h +++ b/include/uapi/misc/habanalabs.h @@ -209,7 +209,8 @@ struct hl_info_args { /* Opcode to destroy previously created command buffer */ #define HL_CB_OP_DESTROY 1 -#define HL_MAX_CB_SIZE 0x200000 /* 2MB */ +/* 2MB minus 32 bytes for 2xMSG_PROT */ +#define HL_MAX_CB_SIZE (0x200000 - 32) struct hl_cb_in { /* Handle of CB or 0 if we want to create one */ |