2 * Copyright © 2014 Broadcom
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:
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
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
27 #include "pipe/p_screen.h"
28 #include "os/os_thread.h"
29 #include "state_tracker/drm_driver.h"
30 #include "util/list.h"
34 #define VC4_DEBUG_CL 0x0001
35 #define VC4_DEBUG_QPU 0x0002
36 #define VC4_DEBUG_QIR 0x0004
37 #define VC4_DEBUG_TGSI 0x0008
38 #define VC4_DEBUG_SHADERDB 0x0010
39 #define VC4_DEBUG_PERF 0x0020
40 #define VC4_DEBUG_NORAST 0x0040
41 #define VC4_DEBUG_ALWAYS_FLUSH 0x0080
42 #define VC4_DEBUG_ALWAYS_SYNC 0x0100
43 #define VC4_DEBUG_NIR 0x0200
44 #define VC4_DEBUG_DUMP 0x0400
46 #define VC4_MAX_MIP_LEVELS 12
47 #define VC4_MAX_TEXTURE_SAMPLERS 16
50 struct pipe_screen base
;
53 void *simulator_mem_base
;
54 uint32_t simulator_mem_size
;
56 /** The last seqno we've completed a wait for.
58 * This lets us slightly optimize our waits by skipping wait syscalls
59 * if we know the job's already done.
61 uint64_t finished_seqno
;
64 /** List of struct vc4_bo freed, by age. */
65 struct list_head time_list
;
66 /** List of struct vc4_bo freed, per size, by age. */
67 struct list_head
*size_list
;
68 uint32_t size_list_size
;
80 static inline struct vc4_screen
*
81 vc4_screen(struct pipe_screen
*screen
)
83 return (struct vc4_screen
*)screen
;
86 struct pipe_screen
*vc4_screen_create(int fd
);
87 boolean
vc4_screen_bo_get_handle(struct pipe_screen
*pscreen
,
90 struct winsys_handle
*whandle
);
92 vc4_screen_bo_from_handle(struct pipe_screen
*pscreen
,
93 struct winsys_handle
*whandle
);
95 extern uint32_t vc4_debug
;
98 vc4_fence_init(struct vc4_screen
*screen
);
101 vc4_fence_create(struct vc4_screen
*screen
, uint64_t seqno
);
103 #endif /* VC4_SCREEN_H */