1 #ifndef NOUVEAU_DEVICE 2 #define NOUVEAU_DEVICE 1 3 4 #include "nouveau_private.h" 5 #include "nv_device_info.h" 6 #include "util/simple_mtx.h" 7 #include "util/vma.h" 8 9 #include <stddef.h> 10 11 struct _drmDevice; 12 struct hash_table; 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif 17 18 19 enum nvk_debug { 20 /* dumps all push buffers after submission */ 21 NVK_DEBUG_PUSH_DUMP = 1ull << 0, 22 23 /* push buffer submissions wait on completion 24 * 25 * This is useful to find the submission killing the GPU context. For easier debugging it also 26 * dumps the buffer leading to that. 27 */ 28 NVK_DEBUG_PUSH_SYNC = 1ull << 1, 29 30 /* Zero all client memory allocations 31 */ 32 NVK_DEBUG_ZERO_MEMORY = 1ull << 2, 33 34 /* Dump VM bind/unbinds 35 */ 36 NVK_DEBUG_VM = 1ull << 3, 37 38 /* Disable most cbufs 39 * 40 * Root descriptors still end up in a cbuf 41 */ 42 NVK_DEBUG_NO_CBUF = 1ull << 5, 43 }; 44 45 struct nouveau_ws_device { 46 int fd; 47 48 struct nv_device_info info; 49 50 uint32_t max_push; 51 uint32_t local_mem_domain; 52 53 enum nvk_debug debug_flags; 54 55 simple_mtx_t bos_lock; 56 struct hash_table *bos; 57 58 bool has_vm_bind; 59 struct util_vma_heap vma_heap; 60 struct util_vma_heap bda_heap; 61 simple_mtx_t vma_mutex; 62 }; 63 64 struct nouveau_ws_device *nouveau_ws_device_new(struct _drmDevice *drm_device); 65 void nouveau_ws_device_destroy(struct nouveau_ws_device *); 66 67 uint64_t nouveau_ws_device_vram_used(struct nouveau_ws_device *); 68 69 #ifdef __cplusplus 70 } 71 #endif 72 73 #endif 74