etnaviv_cmdbuf.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2017 Etnaviv Project
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License version 2 as published by
  6. * the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with
  14. * this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef __ETNAVIV_CMDBUF_H__
  17. #define __ETNAVIV_CMDBUF_H__
  18. #include <linux/types.h>
  19. struct etnaviv_gpu;
  20. struct etnaviv_cmdbuf_suballoc;
  21. struct etnaviv_perfmon_request;
  22. struct etnaviv_cmdbuf {
  23. /* suballocator this cmdbuf is allocated from */
  24. struct etnaviv_cmdbuf_suballoc *suballoc;
  25. /* user context key, must be unique between all active users */
  26. struct etnaviv_file_private *ctx;
  27. /* cmdbuf properties */
  28. int suballoc_offset;
  29. void *vaddr;
  30. u32 size;
  31. u32 user_size;
  32. };
  33. struct etnaviv_cmdbuf_suballoc *
  34. etnaviv_cmdbuf_suballoc_new(struct etnaviv_gpu * gpu);
  35. void etnaviv_cmdbuf_suballoc_destroy(struct etnaviv_cmdbuf_suballoc *suballoc);
  36. int etnaviv_cmdbuf_init(struct etnaviv_cmdbuf_suballoc *suballoc,
  37. struct etnaviv_cmdbuf *cmdbuf, u32 size);
  38. void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf);
  39. u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf);
  40. dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf);
  41. #endif /* __ETNAVIV_CMDBUF_H__ */