History

habanalabs: add DRAM default page size to HW info

When using the device memory allocation API the user ought to know what is the default allocation page size.

Ohad Sharabi committed 4 years ago

Commit 1359fcb1 parent 378b02d2 files · +4 −0Browse files

Unified · Split

2 files
  1. drivers/misc/habanalabs/common/habanalabs_ioctl.c +1 −0
  2. include/uapi/misc/habanalabs.h +3 −0
drivers/misc/habanalabs/common/habanalabs_ioctl.c+1−0
@@ -76,6 +76,7 @@ static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args) · 75 unmodified lines
76 if (hw_ip.dram_size > PAGE_SIZE)76 if (hw_ip.dram_size > PAGE_SIZE)
77 hw_ip.dram_enabled = 1;77 hw_ip.dram_enabled = 1;
78 hw_ip.dram_page_size = prop->dram_page_size;78 hw_ip.dram_page_size = prop->dram_page_size;
79 hw_ip.device_mem_alloc_default_page_size = prop->device_mem_alloc_default_page_size;
79 hw_ip.num_of_events = prop->num_of_events;80 hw_ip.num_of_events = prop->num_of_events;
80 81
81 memcpy(hw_ip.cpucp_version, prop->cpucp_info.cpucp_version,82 memcpy(hw_ip.cpucp_version, prop->cpucp_info.cpucp_version,
include/uapi/misc/habanalabs.h+3−0
@@ -409,6 +409,7 @@ enum hl_server_type { · 408 unmodified lines
409 * @dram_page_size: The DRAM physical page size.409 * @dram_page_size: The DRAM physical page size.
410 * @number_of_user_interrupts: The number of interrupts that are available to the userspace410 * @number_of_user_interrupts: The number of interrupts that are available to the userspace
411 * application to use. Relevant for Gaudi2 and later.411 * application to use. Relevant for Gaudi2 and later.
412 * @device_mem_alloc_default_page_size: default page size used in device memory allocation.
412 */413 */
413struct hl_info_hw_ip_info {414struct hl_info_hw_ip_info {
414 __u64 sram_base_address;415 __u64 sram_base_address;
@@ -436,6 +437,8 @@ struct hl_info_hw_ip_info { · 21 unmodified lines
436 __u32 reserved3;437 __u32 reserved3;
437 __u16 number_of_user_interrupts;438 __u16 number_of_user_interrupts;
438 __u16 pad2;439 __u16 pad2;
440 __u64 reserved4;
441 __u64 device_mem_alloc_default_page_size;
439};442};
440 443
441struct hl_info_dram_usage {444struct hl_info_dram_usage {