-
Notifications
You must be signed in to change notification settings - Fork 111
Added debug queue support #1054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b966f40
adcaa62
57b10be
ba96187
b923c2f
40baa8c
1b6f9d0
55da3b2
0785f22
5e9d36e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,8 @@ | |||||
| #include "amdxdna_error.h" | ||||||
| #include "amdxdna_drm.h" | ||||||
|
|
||||||
| extern int enable_debug_queue; | ||||||
|
|
||||||
| static int ve2_query_ctx_status_array(struct amdxdna_client *client, | ||||||
| struct amdxdna_drm_hwctx_entry *tmp, | ||||||
| pid_t pid, u32 ctx_id) | ||||||
|
|
@@ -151,6 +153,53 @@ static int ve2_get_array_hwctx(struct amdxdna_client *client, | |||||
| return ret; | ||||||
| } | ||||||
|
|
||||||
| static int ve2_dbg_queue_data_rw(struct amdxdna_dev *xdev, struct amdxdna_ctx *hwctx, | ||||||
| u32 col, u32 row, u32 addr, void *data, size_t size, | ||||||
| int cmd_type) | ||||||
| { | ||||||
| struct platform_device *pdev = to_platform_device(xdev->ddev.dev); | ||||||
| dma_addr_t dma_handle; | ||||||
| void *virt_ptr = NULL; | ||||||
| int ret = 0; | ||||||
|
|
||||||
| if (size % 4 != 0) { | ||||||
| XDNA_ERR(xdev, "Size (%zu) must be a multiple of 4 bytes", size); | ||||||
| return -EINVAL; | ||||||
| } | ||||||
| /*Allocate phy memory and pass it to submit function*/ | ||||||
chvamshi-xilinx marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| /*Allocate phy memory and pass it to submit function*/ | |
| /* Allocate phy memory and pass it to submit function */ |
khalshai-xilinx marked this conversation as resolved.
Show resolved
Hide resolved
khalshai-xilinx marked this conversation as resolved.
Show resolved
Hide resolved
khalshai-xilinx marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Feb 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TODO comment style is inconsistent with Linux kernel coding style. The comment should be formatted as "/* TODO: This is temporary fix to exit the debug queue. */" with a space after the comment delimiter, colon after TODO, and proper ending.
| //TODO This is temporary fix to exit the debug queue. | |
| /* TODO: This is temporary fix to exit the debug queue. */ |
khalshai-xilinx marked this conversation as resolved.
Show resolved
Hide resolved
khalshai-xilinx marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -123,6 +123,35 @@ struct ve2_hsa_queue { | |||||
| struct device *alloc_dev; | ||||||
| }; | ||||||
|
|
||||||
| enum dbg_cmd_type { | ||||||
| DBG_CMD_EXIT = 11, | ||||||
| DBG_CMD_READ = 12, | ||||||
| DBG_CMD_WRITE = 13, | ||||||
| }; | ||||||
|
|
||||||
| struct rw_mem { | ||||||
| u32 aie_addr; | ||||||
| u32 length; | ||||||
| u32 host_addr_high; | ||||||
| u32 host_addr_low; | ||||||
| }; | ||||||
|
|
||||||
| struct dbg_queue { | ||||||
| struct host_queue_header hq_header; | ||||||
| struct host_queue_packet hq_entry[HOST_QUEUE_ENTRY]; | ||||||
| }; | ||||||
|
|
||||||
| struct ve2_dbg_queue { | ||||||
| struct dbg_queue *dbg_queue_p; | ||||||
| struct ve2_mem dbg_queue_mem; | ||||||
| struct ve2_hq_complete hq_complete; | ||||||
| // hq_lock protects [read | write]_index and reserved_write_index | ||||||
| struct mutex hq_lock; | ||||||
| u64 reserved_write_index; | ||||||
| /* Device used for host queue allocation */ | ||||||
|
||||||
| /* Device used for host queue allocation */ | |
| /* Device used for host queue allocation */ |
Uh oh!
There was an error while loading. Please reload this page.