aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c136
1 files changed, 85 insertions, 51 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
index 6327cfc36805..37c093c0c7b8 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
@@ -30,66 +30,101 @@
30#include <drm/ttm/ttm_placement.h> 30#include <drm/ttm/ttm_placement.h>
31#include <drm/ttm/ttm_page_alloc.h> 31#include <drm/ttm/ttm_page_alloc.h>
32 32
33static uint32_t vram_placement_flags = TTM_PL_FLAG_VRAM | 33static struct ttm_place vram_placement_flags = {
34 TTM_PL_FLAG_CACHED; 34 .fpfn = 0,
35 35 .lpfn = 0,
36static uint32_t vram_ne_placement_flags = TTM_PL_FLAG_VRAM | 36 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
37 TTM_PL_FLAG_CACHED | 37};
38 TTM_PL_FLAG_NO_EVICT;
39 38
40static uint32_t sys_placement_flags = TTM_PL_FLAG_SYSTEM | 39static struct ttm_place vram_ne_placement_flags = {
41 TTM_PL_FLAG_CACHED; 40 .fpfn = 0,
41 .lpfn = 0,
42 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
43};
42 44
43static uint32_t sys_ne_placement_flags = TTM_PL_FLAG_SYSTEM | 45static struct ttm_place sys_placement_flags = {
44 TTM_PL_FLAG_CACHED | 46 .fpfn = 0,
45 TTM_PL_FLAG_NO_EVICT; 47 .lpfn = 0,
48 .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED
49};
46 50
47static uint32_t gmr_placement_flags = VMW_PL_FLAG_GMR | 51static struct ttm_place sys_ne_placement_flags = {
48 TTM_PL_FLAG_CACHED; 52 .fpfn = 0,
53 .lpfn = 0,
54 .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
55};
49 56
50static uint32_t gmr_ne_placement_flags = VMW_PL_FLAG_GMR | 57static struct ttm_place gmr_placement_flags = {
51 TTM_PL_FLAG_CACHED | 58 .fpfn = 0,
52 TTM_PL_FLAG_NO_EVICT; 59 .lpfn = 0,
60 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
61};
53 62
54static uint32_t mob_placement_flags = VMW_PL_FLAG_MOB | 63static struct ttm_place gmr_ne_placement_flags = {
55 TTM_PL_FLAG_CACHED; 64 .fpfn = 0,
65 .lpfn = 0,
66 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
67};
56 68
57struct ttm_placement vmw_vram_placement = { 69static struct ttm_place mob_placement_flags = {
58 .fpfn = 0, 70 .fpfn = 0,
59 .lpfn = 0, 71 .lpfn = 0,
72 .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED
73};
74
75struct ttm_placement vmw_vram_placement = {
60 .num_placement = 1, 76 .num_placement = 1,
61 .placement = &vram_placement_flags, 77 .placement = &vram_placement_flags,
62 .num_busy_placement = 1, 78 .num_busy_placement = 1,
63 .busy_placement = &vram_placement_flags 79 .busy_placement = &vram_placement_flags
64}; 80};
65 81
66static uint32_t vram_gmr_placement_flags[] = { 82static struct ttm_place vram_gmr_placement_flags[] = {
67 TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED, 83 {
68 VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED 84 .fpfn = 0,
85 .lpfn = 0,
86 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
87 }, {
88 .fpfn = 0,
89 .lpfn = 0,
90 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
91 }
69}; 92};
70 93
71static uint32_t gmr_vram_placement_flags[] = { 94static struct ttm_place gmr_vram_placement_flags[] = {
72 VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED, 95 {
73 TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED 96 .fpfn = 0,
97 .lpfn = 0,
98 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
99 }, {
100 .fpfn = 0,
101 .lpfn = 0,
102 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
103 }
74}; 104};
75 105
76struct ttm_placement vmw_vram_gmr_placement = { 106struct ttm_placement vmw_vram_gmr_placement = {
77 .fpfn = 0,
78 .lpfn = 0,
79 .num_placement = 2, 107 .num_placement = 2,
80 .placement = vram_gmr_placement_flags, 108 .placement = vram_gmr_placement_flags,
81 .num_busy_placement = 1, 109 .num_busy_placement = 1,
82 .busy_placement = &gmr_placement_flags 110 .busy_placement = &gmr_placement_flags
83}; 111};
84 112
85static uint32_t vram_gmr_ne_placement_flags[] = { 113static struct ttm_place vram_gmr_ne_placement_flags[] = {
86 TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT, 114 {
87 VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT 115 .fpfn = 0,
116 .lpfn = 0,
117 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED |
118 TTM_PL_FLAG_NO_EVICT
119 }, {
120 .fpfn = 0,
121 .lpfn = 0,
122 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED |
123 TTM_PL_FLAG_NO_EVICT
124 }
88}; 125};
89 126
90struct ttm_placement vmw_vram_gmr_ne_placement = { 127struct ttm_placement vmw_vram_gmr_ne_placement = {
91 .fpfn = 0,
92 .lpfn = 0,
93 .num_placement = 2, 128 .num_placement = 2,
94 .placement = vram_gmr_ne_placement_flags, 129 .placement = vram_gmr_ne_placement_flags,
95 .num_busy_placement = 1, 130 .num_busy_placement = 1,
@@ -97,8 +132,6 @@ struct ttm_placement vmw_vram_gmr_ne_placement = {
97}; 132};
98 133
99struct ttm_placement vmw_vram_sys_placement = { 134struct ttm_placement vmw_vram_sys_placement = {
100 .fpfn = 0,
101 .lpfn = 0,
102 .num_placement = 1, 135 .num_placement = 1,
103 .placement = &vram_placement_flags, 136 .placement = &vram_placement_flags,
104 .num_busy_placement = 1, 137 .num_busy_placement = 1,
@@ -106,8 +139,6 @@ struct ttm_placement vmw_vram_sys_placement = {
106}; 139};
107 140
108struct ttm_placement vmw_vram_ne_placement = { 141struct ttm_placement vmw_vram_ne_placement = {
109 .fpfn = 0,
110 .lpfn = 0,
111 .num_placement = 1, 142 .num_placement = 1,
112 .placement = &vram_ne_placement_flags, 143 .placement = &vram_ne_placement_flags,
113 .num_busy_placement = 1, 144 .num_busy_placement = 1,
@@ -115,8 +146,6 @@ struct ttm_placement vmw_vram_ne_placement = {
115}; 146};
116 147
117struct ttm_placement vmw_sys_placement = { 148struct ttm_placement vmw_sys_placement = {
118 .fpfn = 0,
119 .lpfn = 0,
120 .num_placement = 1, 149 .num_placement = 1,
121 .placement = &sys_placement_flags, 150 .placement = &sys_placement_flags,
122 .num_busy_placement = 1, 151 .num_busy_placement = 1,
@@ -124,24 +153,33 @@ struct ttm_placement vmw_sys_placement = {
124}; 153};
125 154
126struct ttm_placement vmw_sys_ne_placement = { 155struct ttm_placement vmw_sys_ne_placement = {
127 .fpfn = 0,
128 .lpfn = 0,
129 .num_placement = 1, 156 .num_placement = 1,
130 .placement = &sys_ne_placement_flags, 157 .placement = &sys_ne_placement_flags,
131 .num_busy_placement = 1, 158 .num_busy_placement = 1,
132 .busy_placement = &sys_ne_placement_flags 159 .busy_placement = &sys_ne_placement_flags
133}; 160};
134 161
135static uint32_t evictable_placement_flags[] = { 162static struct ttm_place evictable_placement_flags[] = {
136 TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED, 163 {
137 TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED, 164 .fpfn = 0,
138 VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED, 165 .lpfn = 0,
139 VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED 166 .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED
167 }, {
168 .fpfn = 0,
169 .lpfn = 0,
170 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
171 }, {
172 .fpfn = 0,
173 .lpfn = 0,
174 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
175 }, {
176 .fpfn = 0,
177 .lpfn = 0,
178 .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED
179 }
140}; 180};
141 181
142struct ttm_placement vmw_evictable_placement = { 182struct ttm_placement vmw_evictable_placement = {
143 .fpfn = 0,
144 .lpfn = 0,
145 .num_placement = 4, 183 .num_placement = 4,
146 .placement = evictable_placement_flags, 184 .placement = evictable_placement_flags,
147 .num_busy_placement = 1, 185 .num_busy_placement = 1,
@@ -149,8 +187,6 @@ struct ttm_placement vmw_evictable_placement = {
149}; 187};
150 188
151struct ttm_placement vmw_srf_placement = { 189struct ttm_placement vmw_srf_placement = {
152 .fpfn = 0,
153 .lpfn = 0,
154 .num_placement = 1, 190 .num_placement = 1,
155 .num_busy_placement = 2, 191 .num_busy_placement = 2,
156 .placement = &gmr_placement_flags, 192 .placement = &gmr_placement_flags,
@@ -158,8 +194,6 @@ struct ttm_placement vmw_srf_placement = {
158}; 194};
159 195
160struct ttm_placement vmw_mob_placement = { 196struct ttm_placement vmw_mob_placement = {
161 .fpfn = 0,
162 .lpfn = 0,
163 .num_placement = 1, 197 .num_placement = 1,
164 .num_busy_placement = 1, 198 .num_busy_placement = 1,
165 .placement = &mob_placement_flags, 199 .placement = &mob_placement_flags,