Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vc4_screen.h 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright © 2014 Broadcom
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  21. * IN THE SOFTWARE.
  22. */
  23. #ifndef VC4_SCREEN_H
  24. #define VC4_SCREEN_H
  25. #include "pipe/p_screen.h"
  26. #include "state_tracker/drm_driver.h"
  27. struct vc4_bo;
  28. #define VC4_DEBUG_CL 0x0001
  29. #define VC4_DEBUG_QPU 0x0002
  30. #define VC4_DEBUG_QIR 0x0004
  31. #define VC4_DEBUG_TGSI 0x0008
  32. #define VC4_DEBUG_SHADERDB 0x0010
  33. #define VC4_DEBUG_PERF 0x0020
  34. #define VC4_DEBUG_NORAST 0x0040
  35. #define VC4_MAX_MIP_LEVELS 12
  36. struct vc4_screen {
  37. struct pipe_screen base;
  38. int fd;
  39. void *simulator_mem_base;
  40. uint32_t simulator_mem_size;
  41. };
  42. static inline struct vc4_screen *
  43. vc4_screen(struct pipe_screen *screen)
  44. {
  45. return (struct vc4_screen *)screen;
  46. }
  47. struct pipe_screen *vc4_screen_create(int fd);
  48. boolean vc4_screen_bo_get_handle(struct pipe_screen *pscreen,
  49. struct vc4_bo *bo,
  50. unsigned stride,
  51. struct winsys_handle *whandle);
  52. struct vc4_bo *
  53. vc4_screen_bo_from_handle(struct pipe_screen *pscreen,
  54. struct winsys_handle *whandle,
  55. unsigned *out_stride);
  56. uint8_t vc4_get_texture_format(enum pipe_format format);
  57. extern uint32_t vc4_debug;
  58. #endif /* VC4_SCREEN_H */