Build fail with:
ERROR: "memblock_free" [drivers/gpu/drm/rockchip/rockchipdrm.ko] undefined!
memblok_free fuction not export symbol, and use the flag __init, so it
can't be used on modules.
the memblock_free function only used for loader memory manager, not use
on modules context, so just use it when build-in drm/rockchip.
Change-Id: Ib88b6ca6c61f7ef85b4126d705a4911e207b57e5
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drm_gem_object_unreference_unlocked(obj);
}
+#ifndef MODULE
if (rockchip_fb->sgt) {
void *start = phys_to_virt(rockchip_fb->start);
void *end = phys_to_virt(rockchip_fb->size);
memblock_free(rockchip_fb->start, rockchip_fb->size);
free_reserved_area(start, end, -1, "drm_fb");
}
+#else
+ WARN_ON(rockchip_fb->sgt);
+#endif
drm_framebuffer_cleanup(fb);
kfree(rockchip_fb);
rk_obj = to_rockchip_obj(obj[i]);
rockchip_fb->dma_addr[i] = rk_obj->dma_addr;
}
+#ifndef MODULE
} else if (res) {
unsigned long nr_pages;
struct page **pages;
rockchip_fb->sgt = sgt;
rockchip_fb->start = res->start;
rockchip_fb->size = size;
+#endif
} else {
ret = -EINVAL;
dev_err(dev->dev, "Failed to find available buffer\n");