Skip to content

accel/amdxdna: Increase max ctx id for aie4/umq#1453

Open
hlaccabu wants to merge 1 commit into
amd:mainfrom
hlaccabu:max_ctx
Open

accel/amdxdna: Increase max ctx id for aie4/umq#1453
hlaccabu wants to merge 1 commit into
amd:mainfrom
hlaccabu:max_ctx

Conversation

@hlaccabu

Copy link
Copy Markdown
Contributor

@NishadSaraf fw for umq supports > 255 ctxs, I am assuming we want to keep 255 as max for kmq? Let me know.

Comment thread drivers/accel/amdxdna/amdxdna_ctx.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the AMD XDNA DRM driver’s hardware-context handle allocation limit so UMQ (notably AIE4 UMQ/PF variants) can create more than 255 contexts, while keeping the smaller 255-handle space for KMQ devices.

Changes:

  • Make the maximum allocatable hwctx handle depend on dev_info->device_type (KMQ: 255, non-KMQ: 1024).
  • Add <linux/sizes.h> to use SZ_1K for the UMQ handle limit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Hayden Laccabue <hlaccabu@amd.com>

#define MAX_HWCTX_ID 255
/* KMQ has a smaller hw context id space than UMQ */
#define MAX_HWCTX_ID(xdna) ((xdna)->dev_info->device_type == AMDXDNA_DEV_TYPE_KMQ ? 255 : 1023)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks better but it doesn't address my another concern.
The KMQ will be enabled soon for aie4.

My question is:
Should aie2 also keep 255 and aie4 use 1023? If yes, the new code won't work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I said before the device type of aie4 won't change to KMQ though, it will still have device type UMQ with kernel mode submission enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants