GPU memory initialization will cause large boot time with 40ms.
If GPU memory is allocated from CMA, memset in cma kernel driver,
It is not necessary to add duplicated memset in GPU kernel driver.
Only GFP allocator need trigger a page fault with a simple write.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
addr = vmap(pages, numPages, 0, pgprot_writecombine(PAGE_KERNEL));
+ /* Trigger a page fault. */
+ for (i = 0; i < numPages; i++)
+ {
+ *(gctINT *)(addr + PAGE_SIZE * i) = 0;
+ }
+
if (free)
{
kfree(pages);
gcmkONERROR(allocator->ops->MapKernel(allocator, mdl, &addr));
- /* Trigger a page fault. */
- memset(addr, 0, numPages * PAGE_SIZE);
-
mdl->addr = addr;
if (InUserSpace)