#define DRM_VIV_GEM_CACHED (1u << 1)
#define DRM_VIV_GEM_SECURE (1u << 2)
#define DRM_VIV_GEM_CMA_LIMIT (1u << 3)
+#define DRM_VIV_GEM_VIRTUAL_POOL (1u << 4)
struct drm_viv_gem_create {
__u64 size;
gckVIDMEM_NODE nodeObject;
gctUINT32 flags = gcvALLOC_FLAG_DMABUF_EXPORTABLE;
gceSTATUS status = gcvSTATUS_OK;
+ gcePOOL pool = gcvPOOL_DEFAULT;
gal_dev = (gckGALDEVICE)drm->dev_private;
if (!gal_dev)
{
flags |= gcvALLOC_FLAG_CMA_LIMIT;
}
+ if (args->flags & DRM_VIV_GEM_VIRTUAL_POOL) {
+ flags &= ~(gcvALLOC_FLAG_CMA_LIMIT | gcvALLOC_FLAG_CONTIGUOUS);
+ pool = gcvPOOL_VIRTUAL;
+ }
gckOS_ZeroMemory(&iface, sizeof(iface));
iface.command = gcvHAL_ALLOCATE_LINEAR_VIDEO_MEMORY;
iface.u.AllocateLinearVideoMemory.alignment = 256;
iface.u.AllocateLinearVideoMemory.type = gcvSURF_RENDER_TARGET; /* should be general */
iface.u.AllocateLinearVideoMemory.flag = flags;
- iface.u.AllocateLinearVideoMemory.pool = gcvPOOL_DEFAULT;
+ iface.u.AllocateLinearVideoMemory.pool = pool;
gcmkONERROR(gckDEVICE_Dispatch(gal_dev->device, &iface));
kernel = gal_dev->device->map[gal_dev->device->defaultHwType].kernels[0];