Commit b3c5841
drm/gpuvm: Add DRM_GPUVA_REPEAT flag and logic
To be able to support "fake sparse" mappings without relying on GPU page
fault handling, drivers may need to create large (e.g. 4GiB) mappings of
the same page repeatedly (or same range of pages). Doing this through
individual mappings would be very wasteful. This can be handled better
by using a flag on map creation, but to do it safely, drm_gpuvm needs to
be aware of this special case.
Add a flag that signals that a given mapping is a page mapping, which is
repeated all over the entire requested VA range. This tweaks the
sm_map() logic to treat the GEM offsets differently when mappings are
a repeated ones so they are not incremented as they would be with regular
mappings.
The size of the GEM portion to repeat is passed through
drm_gpuva::gem::range. Most of the time it will be a page size, but
it can be bigger as long as it's less than drm_gpuva::va::range, and
drm_gpuva::va::range is a multiple of drm_gpuva::gem::range.
Signed-off-by: Asahi Lina <lina+kernel@asahilina.net>
Signed-off-by: Caterina Shablia <caterina.shablia@collabora.com>1 parent a08eeb2 commit b3c5841
2 files changed
Lines changed: 90 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2202 | 2202 | | |
2203 | 2203 | | |
2204 | 2204 | | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
2205 | 2225 | | |
2206 | 2226 | | |
2207 | 2227 | | |
| |||
2222 | 2242 | | |
2223 | 2243 | | |
2224 | 2244 | | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
2225 | 2266 | | |
2226 | 2267 | | |
2227 | 2268 | | |
| |||
2237 | 2278 | | |
2238 | 2279 | | |
2239 | 2280 | | |
2240 | | - | |
| 2281 | + | |
| 2282 | + | |
2241 | 2283 | | |
2242 | 2284 | | |
2243 | 2285 | | |
| |||
2274 | 2316 | | |
2275 | 2317 | | |
2276 | 2318 | | |
2277 | | - | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
2278 | 2322 | | |
2279 | 2323 | | |
2280 | 2324 | | |
| |||
2296 | 2340 | | |
2297 | 2341 | | |
2298 | 2342 | | |
| 2343 | + | |
2299 | 2344 | | |
2300 | 2345 | | |
2301 | 2346 | | |
| |||
2339 | 2384 | | |
2340 | 2385 | | |
2341 | 2386 | | |
2342 | | - | |
2343 | | - | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
2344 | 2390 | | |
2345 | 2391 | | |
2346 | 2392 | | |
| |||
2378 | 2424 | | |
2379 | 2425 | | |
2380 | 2426 | | |
2381 | | - | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
2382 | 2430 | | |
2383 | 2431 | | |
2384 | 2432 | | |
| |||
2430 | 2478 | | |
2431 | 2479 | | |
2432 | 2480 | | |
| 2481 | + | |
2433 | 2482 | | |
2434 | 2483 | | |
2435 | 2484 | | |
| |||
2440 | 2489 | | |
2441 | 2490 | | |
2442 | 2491 | | |
2443 | | - | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
2444 | 2495 | | |
2445 | 2496 | | |
2446 | 2497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
62 | | - | |
| 71 | + | |
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
| |||
111 | 120 | | |
112 | 121 | | |
113 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
114 | 135 | | |
115 | 136 | | |
116 | 137 | | |
| |||
866 | 887 | | |
867 | 888 | | |
868 | 889 | | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
869 | 901 | | |
870 | 902 | | |
871 | 903 | | |
| |||
0 commit comments