video: driver: add memory ops support

add memory ops support so that different
implementations can exist for memory_alloc,
memory_free, memory_map and memory_unmap,
dma buf attach, detach, map, unmap and
get buffer region in upstream and downstream
drivers.

Change-Id: Ifabc34e7a8b0284579c1bc4a8f477fe558d068f4
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
此提交包含在:
Darshana Patil
2022-10-19 16:30:45 -07:00
提交者 Gerrit - the friendly Code Review server
父節點 02ed467c8a
當前提交 4250372925
共有 18 個檔案被更改,包括 776 行新增610 行删除

查看文件

@@ -16,6 +16,7 @@
#include "msm_vidc_debug.h"
#include "msm_vidc_internal.h"
#include "msm_vidc_control_ext.h"
#include "msm_vidc_memory_ext.h"
#include "hfi_property.h"
#include "msm_vidc_iris33.h"
#include "hfi_command.h"
@@ -2720,6 +2721,25 @@ static const struct msm_vidc_platform_data pineapple_data = {
.format_data = &format_data_pineapple,
};
static struct msm_vidc_memory_ops pineapple_msm_mem_ops = {
.dma_buf_attach = msm_vidc_dma_buf_attach_ext,
.dma_buf_detach = msm_vidc_dma_buf_detach,
.dma_buf_map_attachment = msm_vidc_dma_buf_map_attachment,
.dma_buf_unmap_attachment = msm_vidc_dma_buf_unmap_attachment,
.memory_alloc = msm_vidc_memory_alloc_ext,
.memory_free = msm_vidc_memory_free_ext,
.memory_map = msm_vidc_memory_map_ext,
.memory_unmap = msm_vidc_memory_unmap,
.buffer_region = msm_vidc_buffer_region_ext,
.dma_buf_get = msm_vidc_dma_buf_get,
.dma_buf_put = msm_vidc_dma_buf_put,
.dma_buf_put_completely = msm_vidc_dma_buf_put_completely,
.pools_init = msm_vidc_pools_init,
.pools_deinit = msm_vidc_pools_deinit,
.pool_alloc = msm_vidc_pool_alloc,
.pool_free = msm_vidc_pool_free,
};
int msm_vidc_pineapple_check_ddr_type(void)
{
u32 ddr_type;
@@ -2746,6 +2766,7 @@ static int msm_vidc_init_data(struct msm_vidc_core *core)
d_vpr_h("%s: initialize pineapple data\n", __func__);
core->platform->data = pineapple_data;
core->mem_ops = &pineapple_msm_mem_ops;
rc = msm_vidc_pineapple_check_ddr_type();
if (rc)
return rc;