Skip to content

fix hunk failure and resolve compilation issue against supported osv's - #554

Open
akanksh5-intc wants to merge 3 commits into
intel-gpu:oot-backport/mainfrom
akanksh5-intc:oot-backport/main
Open

akanksh5-intc wants to merge 3 commits into
intel-gpu:oot-backport/mainfrom
akanksh5-intc:oot-backport/main

Conversation

@akanksh5-intc

@akanksh5-intc akanksh5-intc commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@akanksh5-intc akanksh5-intc changed the title Reapply "patches: fix hunk offsets to resolve hunk failures" xekmd-backport: fix hunk failure and compilation issue against supported osv's Sep 7, 2026
vres->flags |= GPU_BUDDY_RANGE_ALLOCATION;
@@ -164,28 +163,12 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,
goto error_unlock;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since trimming is happening after "xe_ttm_vram_buddy_alloc" due to this older approach is treating as rounded memory, then trimming is happening.
In latest post trimming guc initialization is happening.

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.

Yes, as you correctly mentioned earlier first vram size is rounded up two and then trimming was happening. But in current approach the requested vram block is trimmed prior returning to xe_ttm_vram_buddy_alloc()

--- a/src/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
+++ b/src/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
@@ -130,10 +130,9 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Instead of adding new please remove the existing
patches/0001-drm-xe-firmware-signature-failure-plus-vram-mgr-follow-up.patch
and FYI this patch doesnt apply directly since src is there in path

Patches update for rebase

Reviewed-by: Kanaka Raju Nayana <kanaka.raju.nayana@intel.com>
Signed-off-by: Akanksha Hotta <akanksha.hotta@intel.com>
…ck fallback

gpu_buddy_allocated_addr_to_block() was introduced as a helper for GPU buddy
manager. So the kernels using the older interface for drm_buddy will
lack with this helper, causing the compilation error.

error:
-------------------------------------------------------------------------------
error: implicit declaration of function gpu_buddy_allocated_addr_to_block
-------------------------------------------------------------------------------

Therefore, added no-ops with drm_buddy mappings which will maintain the
backport compatability against the older kernels.

Reviewed-by: Kanaka Raju Nayana <kanaka.raju.nayana@intel.com>
Signed-off-by: Akanksha Hotta <akanksha.hotta@intel.com>
…uddy compat layer

Older kernel versions lack native contiguous allocation support in
drm_buddy (DRM_BUDDY_CONTIGUOUS_ALLOCATION), which supports power-of-two
block sizes. Consequently, when kernel requests for an arbitrary memory-size which
is non-power-of-two buffer size, it will fail and return fragmented blocks,
preventing firmware initialization with -EINVAL.

error:
-------------------------------------------------------------------------------
xe: [drm] *ERROR* Tile0: GT0: GuC init failed with -EINVAL
xe: [drm] *ERROR* Tile0: GT0: Failed to initialize uC (-EINVAL)
-------------------------------------------------------------------------------

But, now when we use xe_ttm_vram_buddy_alloc() helper, if we probe the rounding sizes
upto powers of two and trimming after the function call, this will break
vram_allocation path.

So to resolve this, implemented backport_gpu_buddy_alloc_blocks() in the
compat layer under BPM_DRM_BUDDY_CONTIGUOUS_ALLOCATION_NOT_PRESENT,
which will allocate contiguous memory of power-of-two block size by  using
the underlying drm_buddy_alloc_blocks() and trim excess memory using
gpu_buddy_block_trim() back to the requested size.

Signed-off-by: Akanksha Hotta <akanksha.hotta@intel.com>
@akanksh5-intc akanksh5-intc changed the title xekmd-backport: fix hunk failure and compilation issue against supported osv's fix hunk failure and resolve compilation issue against supported osv's Sep 15, 2026
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.

2 participants