2 * Copyright © 2014-2017 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 "renderonly/renderonly.h"
29 #include "os/os_thread.h"
30 #include "state_tracker/drm_driver.h"
31 #include "util/list.h"
32 #include "util/slab.h"
33 #include "broadcom/common/v3d_debug.h"
34 #include "broadcom/common/v3d_device_info.h"
38 /* These are tunable parameters in the HW design, but all the V3D
39 * implementations agree.
41 #define VC5_UIFCFG_BANKS 8
42 #define VC5_UIFCFG_PAGE_SIZE 4096
43 #define VC5_UIFCFG_XOR_VALUE (1 << 4)
44 #define VC5_PAGE_CACHE_SIZE (VC5_UIFCFG_PAGE_SIZE * VC5_UIFCFG_BANKS)
45 #define VC5_UBLOCK_SIZE 64
46 #define VC5_UIFBLOCK_SIZE (4 * VC5_UBLOCK_SIZE)
47 #define VC5_UIFBLOCK_ROW_SIZE (4 * VC5_UIFBLOCK_SIZE)
49 struct v3d_simulator_file
;
52 struct pipe_screen base
;
53 struct renderonly
*ro
;
56 struct v3d_device_info devinfo
;
60 struct slab_parent_pool transfer_pool
;
63 /** List of struct v3d_bo freed, by age. */
64 struct list_head time_list
;
65 /** List of struct v3d_bo freed, per size, by age. */
66 struct list_head
*size_list
;
67 uint32_t size_list_size
;
72 const struct v3d_compiler
*compiler
;
74 struct util_hash_table
*bo_handles
;
75 mtx_t bo_handles_mutex
;
81 bool nonmsaa_texture_size_limit
;
83 struct v3d_simulator_file
*sim_file
;
86 static inline struct v3d_screen
*
87 v3d_screen(struct pipe_screen
*screen
)
89 return (struct v3d_screen
*)screen
;
92 struct pipe_screen
*v3d_screen_create(int fd
,
93 const struct pipe_screen_config
*config
,
94 struct renderonly
*ro
);
97 v3d_fence_init(struct v3d_screen
*screen
);
99 #endif /* VC5_SCREEN_H */