2017-01-16 15:09:51 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 Etnaviv Project
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 as published by
|
|
|
|
* the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ETNAVIV_CMDBUF_H__
|
|
|
|
#define __ETNAVIV_CMDBUF_H__
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
2017-01-16 16:29:57 +00:00
|
|
|
struct etnaviv_gpu;
|
|
|
|
struct etnaviv_cmdbuf_suballoc;
|
2017-09-24 13:15:23 +00:00
|
|
|
struct etnaviv_perfmon_request;
|
2017-01-16 16:29:57 +00:00
|
|
|
|
2017-01-16 15:09:51 +00:00
|
|
|
struct etnaviv_cmdbuf {
|
2017-01-16 16:29:57 +00:00
|
|
|
/* suballocator this cmdbuf is allocated from */
|
|
|
|
struct etnaviv_cmdbuf_suballoc *suballoc;
|
2017-01-16 15:09:51 +00:00
|
|
|
/* user context key, must be unique between all active users */
|
|
|
|
struct etnaviv_file_private *ctx;
|
|
|
|
/* cmdbuf properties */
|
2017-01-16 16:29:57 +00:00
|
|
|
int suballoc_offset;
|
2017-01-16 15:09:51 +00:00
|
|
|
void *vaddr;
|
|
|
|
u32 size;
|
|
|
|
u32 user_size;
|
|
|
|
/* fence after which this buffer is to be disposed */
|
|
|
|
struct dma_fence *fence;
|
|
|
|
/* target exec state */
|
|
|
|
u32 exec_state;
|
|
|
|
/* per GPU in-flight list */
|
|
|
|
struct list_head node;
|
2017-09-24 13:15:23 +00:00
|
|
|
/* perfmon requests */
|
|
|
|
unsigned int nr_pmrs;
|
|
|
|
struct etnaviv_perfmon_request *pmrs;
|
2017-01-16 15:09:51 +00:00
|
|
|
/* BOs attached to this command buffer */
|
|
|
|
unsigned int nr_bos;
|
|
|
|
struct etnaviv_vram_mapping *bo_map[0];
|
|
|
|
};
|
|
|
|
|
2017-01-16 16:29:57 +00:00
|
|
|
struct etnaviv_cmdbuf_suballoc *
|
|
|
|
etnaviv_cmdbuf_suballoc_new(struct etnaviv_gpu * gpu);
|
|
|
|
void etnaviv_cmdbuf_suballoc_destroy(struct etnaviv_cmdbuf_suballoc *suballoc);
|
|
|
|
|
|
|
|
struct etnaviv_cmdbuf *
|
|
|
|
etnaviv_cmdbuf_new(struct etnaviv_cmdbuf_suballoc *suballoc, u32 size,
|
2017-09-24 13:15:24 +00:00
|
|
|
size_t nr_bos, size_t nr_pmrs);
|
2017-01-16 16:29:57 +00:00
|
|
|
void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf);
|
|
|
|
|
2017-01-16 15:52:44 +00:00
|
|
|
u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf);
|
2017-01-16 16:00:08 +00:00
|
|
|
dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf);
|
2017-01-16 15:52:44 +00:00
|
|
|
|
2017-01-16 15:09:51 +00:00
|
|
|
#endif /* __ETNAVIV_CMDBUF_H__ */
|