accel/habanalabs: add missing offset handling for dma-buf
authorTomer Tayar <ttayar@habana.ai>
Sun, 20 Aug 2023 12:33:43 +0000 (15:33 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 9 Oct 2023 09:37:22 +0000 (12:37 +0300)
commitd16945f60274d5826a1c7c6581dc5878247a5951
tree3562de276f05219e4489306c06b357f65a83e472
parent878ebc14db049ae85225756b187fec81df8108b3
accel/habanalabs: add missing offset handling for dma-buf

On devices with virtual device memory (Gaudi2 onwards), user can provide
an offset within an allocated device memory from which he wants to
export a dma-buf object.
The offset value is verified by driver, but it is not taken into
consideration when the importer driver maps the dma-buf and the SG table
it prepared.
Add the missing offset handling.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/common/habanalabs.h
drivers/accel/habanalabs/common/memory.c