uint32_t flags;
};
-struct panfrost_memory {
- /* Backing for the slab in memory */
- struct panfrost_bo *bo;
- int stack_bottom;
-};
-
struct panfrost_transfer
panfrost_allocate_transient(struct panfrost_context *ctx, size_t sz);
mali_ptr
panfrost_upload_transient(struct panfrost_context *ctx, const void *data, size_t sz);
-static inline mali_ptr
-panfrost_reserve(struct panfrost_memory *mem, size_t sz)
-{
- mem->stack_bottom += sz;
- return mem->bo->gpu + (mem->stack_bottom - sz);
-}
-
#endif /* __PAN_ALLOCATE_H__ */
ralloc_free(bo);
}
-void
-panfrost_drm_allocate_slab(struct panfrost_screen *screen,
- struct panfrost_memory *mem,
- size_t pages,
- bool same_va,
- int extra_flags,
- int commit_count,
- int extent)
-{
- // TODO cache allocations
- // TODO properly handle errors
- // TODO take into account extra_flags
- mem->bo = panfrost_drm_create_bo(screen, pages * 4096, extra_flags);
- mem->stack_bottom = 0;
-}
-
-void
-panfrost_drm_free_slab(struct panfrost_screen *screen, struct panfrost_memory *mem)
-{
- panfrost_bo_unreference(&screen->base, mem->bo);
- mem->bo = NULL;
-}
-
struct panfrost_bo *
panfrost_drm_import_bo(struct panfrost_screen *screen, int fd)
{
return (struct panfrost_screen *)p;
}
-void
-panfrost_drm_allocate_slab(struct panfrost_screen *screen,
- struct panfrost_memory *mem,
- size_t pages,
- bool same_va,
- int extra_flags,
- int commit_count,
- int extent);
-void
-panfrost_drm_free_slab(struct panfrost_screen *screen,
- struct panfrost_memory *mem);
struct panfrost_bo *
panfrost_drm_create_bo(struct panfrost_screen *screen, size_t size,
uint32_t flags);