habanalabs: use enum for CB allocation options
authorTal Cohen <talcohen@habana.ai>
Wed, 3 Jun 2020 06:25:27 +0000 (09:25 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 30 Nov 2020 08:47:29 +0000 (10:47 +0200)
commit4bb1f2f3fb31ed60a23064a8fc4d5ecde5d1002d
tree731f8eb147c9746ad2f32701393cee1823ed8670
parent3c68157fb829a1b1c9615a6a78179a664602f96a
habanalabs: use enum for CB allocation options

In the future there will be situations where queues can accept either
kernel allocated CBs or user allocated CBs, depending on different
states.

Therefore, instead of using a boolean variable of kernel/user allocated
CB, we need to use a bitmask to indicate that, which will allow to
combine the two options.

Add a flag to the uapi so the user will be able to indicate whether
the CB was allocated by kernel or by user. Of course the driver
validates that.

Signed-off-by: Tal Cohen <talcohen@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/command_submission.c
drivers/misc/habanalabs/common/habanalabs.h
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c
include/uapi/misc/habanalabs.h