accel/amdxdna: Revise device bo creation and free
authorLizhi Hou <lizhi.hou@amd.com>
Mon, 16 Jun 2025 09:14:16 +0000 (02:14 -0700)
committerLizhi Hou <lizhi.hou@amd.com>
Tue, 17 Jun 2025 05:29:09 +0000 (22:29 -0700)
commite252e3f3488a49267e08ea7d972ac5ba3f2f1763
treed6a64543b2765ef2c19380a2acf1981fa4f06a63
parent98df1626ae036c1ba8c844c9fd995ab8f23bbe37
accel/amdxdna: Revise device bo creation and free

The device bo is allocated from the device heap memory. (a trunk of
memory dedicated to device)

Rename amdxdna_gem_insert_node_locked to amdxdna_gem_heap_alloc
and move related sanity checks into it.

Add amdxdna_gem_dev_obj_free and move device bo free code into it.

Calculate the kernel virtual address of device bo by the device
heap memory address and offset.

Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://lore.kernel.org/r/20250616091418.2605476-1-lizhi.hou@amd.com
drivers/accel/amdxdna/aie2_ctx.c
drivers/accel/amdxdna/amdxdna_gem.c
drivers/accel/amdxdna/amdxdna_gem.h