@@ -138,6 +138,12 @@ bool virtio_gpu_is_vram(struct virtio_gpu_object *bo)
return bo->base.base.funcs == &virtio_gpu_vram_funcs;
}
+#if defined(__powerpc64__) || defined(__aarch64__) || defined(__mips__) || defined(__loongarch__)
+#define MAX_PAGE_SIZE 65536
+#else
+#define MAX_PAGE_SIZE PAGE_SIZE
+#endif
+
static int virtio_gpu_vram_map(struct virtio_gpu_object *bo)
{
int ret;
@@ -150,8 +156,8 @@ static int virtio_gpu_vram_map(struct virtio_gpu_object *bo)
return -EINVAL;
spin_lock(&vgdev->host_visible_lock);
- ret = drm_mm_insert_node(&vgdev->host_visible_mm, &vram->vram_node,
- bo->base.base.size);
+ ret = drm_mm_insert_node_generic(&vgdev->host_visible_mm, &vram->vram_node,
+ bo->base.base.size, MAX_PAGE_SIZE, 0, 0);
spin_unlock(&vgdev->host_visible_lock);
if (ret)