Files
RedLintu16andClaude Opus 5.5 6e587a5630 Import from Sony 73.1.A.2.74 open source archive
Source: opendevices.sony.net, "Open source archive for 73.1.A.2.74" (Xperia 1 VIII: XQ-GE74, XQ-GE54, SO-51G, SOG17, A601SO, XQ-GE44), unmodified.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 22:52:53 +00:00

59 lines
1.8 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _MEM_BUF_ALTMAP_H
#define _MEM_BUF_ALTMAP_H
#include <linux/dma-buf.h>
#include <linux/mem-buf.h>
#include <uapi/linux/mem-buf.h>
#include <linux/gunyah/gh_rm_drv.h>
#include "../../drivers/dma-buf/heaps/qcom_sg_ops.h"
extern struct gen_pool *dmabuf_mem_pool;
/*
* mem_buf_dmabuf_obj
* A dmabuf object representing memory shared/lent by another Virtual machine
* and obtained via mem_buf_retrieve().
* @buffer: data type expected by qcom_sg_buf_ops
* @pgmap: Arguments to memremap_pages
* @memmap: alternate memmap for the dmabuf if present
* @memmap_base: base ipa address of alternate memmap memory
* @memmap_size: ipa size of alternate memmap memory
*/
struct mem_buf_dmabuf_obj {
struct qcom_sg_buffer buffer;
struct dev_pagemap pgmap;
void *memmap;
unsigned long memmap_base;
size_t memmap_size;
};
struct dmabuf_membuf_helper {
void *(*dmabuf_membuf_alloc)(struct mem_buf_allocation_data *alloc_data);
void (*dmabuf_membuf_free)(void *__membuf);
struct gh_sgl_desc *(*dmabuf_membuf_get_sgl)(void *__membuf);
int (*dmabuf_membuf_prepare_altmap)(struct mem_buf_dmabuf_obj *obj,
struct gh_sgl_desc **__sgl_desc, size_t dmabuf_size);
size_t (*dmabuf_membuf_determine_memmap_size)(size_t dmabuf_size);
};
#if IS_ENABLED(CONFIG_QCOM_DMABUF_HEAPS_TVM_CARVEOUT)
void register_helper(struct dmabuf_membuf_helper *helper_obj);
#else
static inline void register_helper(struct dmabuf_membuf_helper *helper_obj)
{
}
#endif /* CONFIG_QCOM_DMABUF_HEAPS_TVM_CARVEOUT */
int prepare_altmap(struct mem_buf_dmabuf_obj *obj,
struct gh_sgl_desc **__sgl_desc, size_t dmabuf_size);
size_t determine_memmap_size(size_t dmabuf_size);
#endif /* _MEM_BUF_ALTMAP_H */