Files
mpp/osal/mpp_allocator_api.h
Herman Chen 6ce3007994 refactor[allocator]: Refactor allocator flow
1. Allocator api is determined by buffer type.
2. Allocator ctx is determined by both buffer type and buffer flags.
3. All allocator dma_heap / drm / ion / ext_dma should support different
buffer flags.
4. The buffer flag supports cacheable / 32-bit / contig options.
5. Add flags update flow on allocator create process.
6. Add mpp_dmabuf_has_partial_ops to disable dmabuf partial ops when the
kernel driver has bug.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: If36a05c6704112cad3ab46861023597ff02bf14c
2023-11-29 09:54:36 +08:00

30 lines
717 B
C

/* SPDX-License-Identifier: Apache-2.0 OR MIT */
/*
* Copyright (c) 2023 Rockchip Electronics Co., Ltd.
*/
#ifndef __MPP_ALLOCATOR_API_H__
#define __MPP_ALLOCATOR_API_H__
#include "mpp_allocator.h"
typedef MPP_RET (*OsAllocatorFunc)(void *ctx, MppBufferInfo *info);
typedef struct os_allocator_t {
MppBufferType type;
MPP_RET (*open)(void **ctx, size_t alignment, MppAllocFlagType flags);
MPP_RET (*close)(void *ctx);
OsAllocatorFunc alloc;
OsAllocatorFunc free;
OsAllocatorFunc import;
OsAllocatorFunc release;
OsAllocatorFunc mmap;
/* allocator real flag update callback */
MppAllocFlagType (*flags)(void *ctx);
} os_allocator;
#endif /* __MPP_ALLOCATOR_API_H__ */