2018-05-08 22:20:54 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2017-01-16 23:09:51 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 Etnaviv Project
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ETNAVIV_CMDBUF_H__
|
|
|
|
#define __ETNAVIV_CMDBUF_H__
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
2017-01-17 00:29:57 +08:00
|
|
|
struct etnaviv_gpu;
|
|
|
|
struct etnaviv_cmdbuf_suballoc;
|
2017-09-24 21:15:23 +08:00
|
|
|
struct etnaviv_perfmon_request;
|
2017-01-17 00:29:57 +08:00
|
|
|
|
2017-01-16 23:09:51 +08:00
|
|
|
struct etnaviv_cmdbuf {
|
2017-01-17 00:29:57 +08:00
|
|
|
/* suballocator this cmdbuf is allocated from */
|
|
|
|
struct etnaviv_cmdbuf_suballoc *suballoc;
|
2017-01-16 23:09:51 +08:00
|
|
|
/* user context key, must be unique between all active users */
|
|
|
|
struct etnaviv_file_private *ctx;
|
|
|
|
/* cmdbuf properties */
|
2017-01-17 00:29:57 +08:00
|
|
|
int suballoc_offset;
|
2017-01-16 23:09:51 +08:00
|
|
|
void *vaddr;
|
|
|
|
u32 size;
|
|
|
|
u32 user_size;
|
|
|
|
};
|
|
|
|
|
2017-01-17 00:29:57 +08:00
|
|
|
struct etnaviv_cmdbuf_suballoc *
|
|
|
|
etnaviv_cmdbuf_suballoc_new(struct etnaviv_gpu * gpu);
|
|
|
|
void etnaviv_cmdbuf_suballoc_destroy(struct etnaviv_cmdbuf_suballoc *suballoc);
|
|
|
|
|
2017-11-24 23:56:37 +08:00
|
|
|
|
|
|
|
int etnaviv_cmdbuf_init(struct etnaviv_cmdbuf_suballoc *suballoc,
|
|
|
|
struct etnaviv_cmdbuf *cmdbuf, u32 size);
|
2017-01-17 00:29:57 +08:00
|
|
|
void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf);
|
|
|
|
|
2017-01-16 23:52:44 +08:00
|
|
|
u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf);
|
2017-01-17 00:00:08 +08:00
|
|
|
dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf);
|
2017-01-16 23:52:44 +08:00
|
|
|
|
2017-01-16 23:09:51 +08:00
|
|
|
#endif /* __ETNAVIV_CMDBUF_H__ */
|