LF-13727 [#ccc] fix Bytes alignment issue of gpu video memory node

Meet split failure of video memory node when running gfxbench gles for
a long time on 8QXP, leading to GPU dump.
Move Bytes alignment to ensure to find a video memory node with
sufficient memory to avoid split failure.

Signed-off-by: Guangliu Ding <guangliu.ding@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
This commit is contained in:
Guangliu Ding 2024-11-28 10:30:03 +08:00 committed by Jason Liu
parent 8555a7698a
commit 6ed0fd23b8

View File

@ -893,6 +893,11 @@ gckVIDMEM_AllocateLinear(IN gckKERNEL Kernel, IN gckVIDMEM Memory,
}
}
#endif
if (Alignment > 0) {
/* Ensure the size is aligned */
Bytes = gcmALIGN(Bytes, Alignment);
}
if (Bytes > Memory->freeBytes) {
/* Not enough memory. */
status = gcvSTATUS_OUT_OF_MEMORY;
@ -951,9 +956,6 @@ gckVIDMEM_AllocateLinear(IN gckKERNEL Kernel, IN gckVIDMEM Memory,
/* Do we have an alignment? */
if (alignment > 0) {
/* Ensure the size is aligned */
Bytes = gcmALIGN(Bytes, alignment);
/* Split the node so it is aligned. */
if (_Split(Memory->os, node, alignment)) {
/* Successful split, move to aligned node. */