diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/fb_gv11b.c | 421 |
1 files changed, 405 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c index 51ee55f8..35227576 100644 --- a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c | |||
@@ -30,12 +30,11 @@ | |||
30 | #include "gv11b/fb_gv11b.h" | 30 | #include "gv11b/fb_gv11b.h" |
31 | #include "gv11b/ce_gv11b.h" | 31 | #include "gv11b/ce_gv11b.h" |
32 | 32 | ||
33 | #include <nvgpu/hw/gv11b/hw_gmmu_gv11b.h> | ||
34 | #include <nvgpu/hw/gv11b/hw_fb_gv11b.h> | 33 | #include <nvgpu/hw/gv11b/hw_fb_gv11b.h> |
35 | #include <nvgpu/hw/gv11b/hw_mc_gv11b.h> | 34 | #include <nvgpu/hw/gv11b/hw_mc_gv11b.h> |
36 | #include <nvgpu/hw/gv11b/hw_fifo_gv11b.h> | 35 | #include <nvgpu/hw/gv11b/hw_fifo_gv11b.h> |
37 | #include <nvgpu/hw/gv11b/hw_ram_gv11b.h> | 36 | #include <nvgpu/hw/gv11b/hw_ram_gv11b.h> |
38 | 37 | #include <nvgpu/hw/gv11b/hw_gmmu_gv11b.h> | |
39 | 38 | ||
40 | static int gv11b_fb_fix_page_fault(struct gk20a *g, | 39 | static int gv11b_fb_fix_page_fault(struct gk20a *g, |
41 | struct mmu_fault_info *mmfault); | 40 | struct mmu_fault_info *mmfault); |
@@ -252,50 +251,440 @@ static const char *const gpc_client_descs_gv11b[] = { | |||
252 | "t1 36", "t1 37", "t1 38", "t1 39", | 251 | "t1 36", "t1 37", "t1 38", "t1 39", |
253 | }; | 252 | }; |
254 | 253 | ||
255 | static void gv11b_init_uncompressed_kind_map(void) | 254 | static noinline_for_stack void gv11b_init_uncompressed_kind_map(void) |
256 | { | 255 | { |
256 | int i; | ||
257 | |||
258 | for (i = 0; i < 256; i++) | ||
259 | gk20a_uc_kind_map[i] = gmmu_pte_kind_invalid_v(); | ||
260 | |||
261 | /* From gv11b */ | ||
257 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms2_4cbra_v()] = | 262 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms2_4cbra_v()] = |
258 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms2_4cbra_v()] = | 263 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms2_4cbra_v()] = |
259 | gmmu_pte_kind_generic_16bx2_v(); | 264 | gmmu_pte_kind_generic_16bx2_v(); |
265 | |||
266 | /* From gp10b */ | ||
267 | gk20a_uc_kind_map[gmmu_pte_kind_z16_2cz_v()] = | ||
268 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms2_2cz_v()] = | ||
269 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms4_2cz_v()] = | ||
270 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms8_2cz_v()] = | ||
271 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms16_2cz_v()] = | ||
272 | gmmu_pte_kind_z16_v(); | ||
273 | |||
274 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms4_4cbra_v()] = | ||
275 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms4_4cbra_v()] = | ||
276 | gmmu_pte_kind_generic_16bx2_v(); | ||
277 | |||
278 | /* From gm20b */ | ||
279 | gk20a_uc_kind_map[gmmu_pte_kind_s8_v()] = | ||
280 | gk20a_uc_kind_map[gmmu_pte_kind_s8_2s_v()] = | ||
281 | gmmu_pte_kind_s8_v(); | ||
282 | |||
283 | /* From gk20a */ | ||
284 | gk20a_uc_kind_map[gmmu_pte_kind_z16_v()] = | ||
285 | gk20a_uc_kind_map[gmmu_pte_kind_z16_2c_v()] = | ||
286 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms2_2c_v()] = | ||
287 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms4_2c_v()] = | ||
288 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms8_2c_v()] = | ||
289 | gk20a_uc_kind_map[gmmu_pte_kind_z16_2z_v()] = | ||
290 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms2_2z_v()] = | ||
291 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms4_2z_v()] = | ||
292 | gk20a_uc_kind_map[gmmu_pte_kind_z16_ms8_2z_v()] = | ||
293 | gmmu_pte_kind_z16_v(); | ||
294 | |||
295 | gk20a_uc_kind_map[gmmu_pte_kind_s8z24_v()] = | ||
296 | gk20a_uc_kind_map[gmmu_pte_kind_s8z24_2cz_v()] = | ||
297 | gk20a_uc_kind_map[gmmu_pte_kind_s8z24_ms2_2cz_v()] = | ||
298 | gk20a_uc_kind_map[gmmu_pte_kind_s8z24_ms4_2cz_v()] = | ||
299 | gk20a_uc_kind_map[gmmu_pte_kind_s8z24_ms8_2cz_v()] = | ||
300 | gk20a_uc_kind_map[gmmu_pte_kind_s8z24_2cs_v()] = | ||
301 | gk20a_uc_kind_map[gmmu_pte_kind_s8z24_ms2_2cs_v()] = | ||
302 | gk20a_uc_kind_map[gmmu_pte_kind_s8z24_ms4_2cs_v()] = | ||
303 | gk20a_uc_kind_map[gmmu_pte_kind_s8z24_ms8_2cs_v()] = | ||
304 | gmmu_pte_kind_s8z24_v(); | ||
305 | |||
306 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms4_vc4_v()] = | ||
307 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms4_vc4_2cs_v()] = | ||
308 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms4_vc4_2czv_v()] = | ||
309 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms4_vc4_2zv_v()] = | ||
310 | gmmu_pte_kind_v8z24_ms4_vc4_v(); | ||
311 | |||
312 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms8_vc8_v()] = | ||
313 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms8_vc8_2cs_v()] = | ||
314 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms8_vc8_2czv_v()] = | ||
315 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms8_vc8_2zv_v()] = | ||
316 | gmmu_pte_kind_v8z24_ms8_vc8_v(); | ||
317 | |||
318 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms4_vc12_v()] = | ||
319 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms4_vc12_2cs_v()] = | ||
320 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms4_vc12_2czv_v()] = | ||
321 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms4_vc12_2zv_v()] = | ||
322 | gmmu_pte_kind_v8z24_ms4_vc12_v(); | ||
323 | |||
324 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms8_vc24_v()] = | ||
325 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms8_vc24_2cs_v()] = | ||
326 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms8_vc24_2czv_v()] = | ||
327 | gk20a_uc_kind_map[gmmu_pte_kind_v8z24_ms8_vc24_2zv_v()] = | ||
328 | gmmu_pte_kind_v8z24_ms8_vc24_v(); | ||
329 | |||
330 | gk20a_uc_kind_map[gmmu_pte_kind_z24s8_v()] = | ||
331 | gk20a_uc_kind_map[gmmu_pte_kind_z24s8_2cs_v()] = | ||
332 | gk20a_uc_kind_map[gmmu_pte_kind_z24s8_ms2_2cs_v()] = | ||
333 | gk20a_uc_kind_map[gmmu_pte_kind_z24s8_ms4_2cs_v()] = | ||
334 | gk20a_uc_kind_map[gmmu_pte_kind_z24s8_ms8_2cs_v()] = | ||
335 | gk20a_uc_kind_map[gmmu_pte_kind_z24s8_2cz_v()] = | ||
336 | gk20a_uc_kind_map[gmmu_pte_kind_z24s8_ms2_2cz_v()] = | ||
337 | gk20a_uc_kind_map[gmmu_pte_kind_z24s8_ms4_2cz_v()] = | ||
338 | gk20a_uc_kind_map[gmmu_pte_kind_z24s8_ms8_2cz_v()] = | ||
339 | gmmu_pte_kind_z24s8_v(); | ||
340 | |||
341 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_v()] = | ||
342 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_2cs_v()] = | ||
343 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_ms2_2cs_v()] = | ||
344 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_ms4_2cs_v()] = | ||
345 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_ms8_2cs_v()] = | ||
346 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_2cz_v()] = | ||
347 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_ms2_2cz_v()] = | ||
348 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_ms4_2cz_v()] = | ||
349 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_ms8_2cz_v()] = | ||
350 | gmmu_pte_kind_zf32_v(); | ||
351 | |||
352 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_v()] = | ||
353 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cs_v()] = | ||
354 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cszv_v()] = | ||
355 | gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_v(); | ||
356 | |||
357 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_v()] = | ||
358 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cs_v()] = | ||
359 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cszv_v()] = | ||
360 | gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_v(); | ||
361 | |||
362 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_v()] = | ||
363 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cs_v()] = | ||
364 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cszv_v()] = | ||
365 | gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_v(); | ||
366 | |||
367 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_v()] = | ||
368 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cs_v()] = | ||
369 | gk20a_uc_kind_map[gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cszv_v()] = | ||
370 | gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_v(); | ||
371 | |||
372 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_v()] = | ||
373 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cs_v()] = | ||
374 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cszv_v()] = | ||
375 | gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_v(); | ||
376 | |||
377 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_v()] = | ||
378 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cs_v()] = | ||
379 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cszv_v()] = | ||
380 | gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_v(); | ||
381 | |||
382 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_v()] = | ||
383 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cs_v()] = | ||
384 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cszv_v()] = | ||
385 | gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_v(); | ||
386 | |||
387 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_v()] = | ||
388 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cs_v()] = | ||
389 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cszv_v()] = | ||
390 | gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_v(); | ||
391 | |||
392 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x24s8_v()] = | ||
393 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x24s8_2cszv_v()] = | ||
394 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x24s8_ms2_2cszv_v()] = | ||
395 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x24s8_ms4_2cszv_v()] = | ||
396 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x24s8_ms8_2cszv_v()] = | ||
397 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x24s8_2cs_v()] = | ||
398 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x24s8_ms2_2cs_v()] = | ||
399 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x24s8_ms4_2cs_v()] = | ||
400 | gk20a_uc_kind_map[gmmu_pte_kind_zf32_x24s8_ms8_2cs_v()] = | ||
401 | gmmu_pte_kind_zf32_x24s8_v(); | ||
402 | |||
403 | gk20a_uc_kind_map[gmmu_pte_kind_c32_2c_v()] = | ||
404 | gk20a_uc_kind_map[gmmu_pte_kind_c32_2cba_v()] = | ||
405 | gk20a_uc_kind_map[gmmu_pte_kind_c32_2cra_v()] = | ||
406 | gk20a_uc_kind_map[gmmu_pte_kind_c32_2bra_v()] = | ||
407 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms2_2c_v()] = | ||
408 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms4_2c_v()] = | ||
409 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms4_2cbr_v()] = | ||
410 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms4_2cba_v()] = | ||
411 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms4_2cra_v()] = | ||
412 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms4_2bra_v()] = | ||
413 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms8_ms16_2c_v()] = | ||
414 | gk20a_uc_kind_map[gmmu_pte_kind_c32_ms8_ms16_2cra_v()] = | ||
415 | gk20a_uc_kind_map[gmmu_pte_kind_c64_2c_v()] = | ||
416 | gk20a_uc_kind_map[gmmu_pte_kind_c64_2cbr_v()] = | ||
417 | gk20a_uc_kind_map[gmmu_pte_kind_c64_2cba_v()] = | ||
418 | gk20a_uc_kind_map[gmmu_pte_kind_c64_2cra_v()] = | ||
419 | gk20a_uc_kind_map[gmmu_pte_kind_c64_2bra_v()] = | ||
420 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms2_2c_v()] = | ||
421 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms4_2c_v()] = | ||
422 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms4_2cbr_v()] = | ||
423 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms4_2cba_v()] = | ||
424 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms4_2cra_v()] = | ||
425 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms4_2bra_v()] = | ||
426 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms8_ms16_2c_v()] = | ||
427 | gk20a_uc_kind_map[gmmu_pte_kind_c64_ms8_ms16_2cra_v()] = | ||
428 | gk20a_uc_kind_map[gmmu_pte_kind_c128_2c_v()] = | ||
429 | gk20a_uc_kind_map[gmmu_pte_kind_c128_2cr_v()] = | ||
430 | gk20a_uc_kind_map[gmmu_pte_kind_c128_ms2_2c_v()] = | ||
431 | gk20a_uc_kind_map[gmmu_pte_kind_c128_ms2_2cr_v()] = | ||
432 | gk20a_uc_kind_map[gmmu_pte_kind_c128_ms4_2c_v()] = | ||
433 | gk20a_uc_kind_map[gmmu_pte_kind_c128_ms4_2cr_v()] = | ||
434 | gk20a_uc_kind_map[gmmu_pte_kind_c128_ms8_ms16_2c_v()] = | ||
435 | gk20a_uc_kind_map[gmmu_pte_kind_c128_ms8_ms16_2cr_v()] = | ||
436 | gmmu_pte_kind_generic_16bx2_v(); | ||
437 | |||
438 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms4_vc4_2czv_v()] = | ||
439 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms4_vc4_2cs_v()] = | ||
440 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms4_vc4_2zv_v()] = | ||
441 | gmmu_pte_kind_z24v8_ms4_vc4_v(); | ||
442 | |||
443 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms4_vc12_2czv_v()] = | ||
444 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms4_vc12_2cs_v()] = | ||
445 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms4_vc12_2zv_v()] = | ||
446 | gmmu_pte_kind_z24v8_ms4_vc12_v(); | ||
447 | |||
448 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms8_vc8_2cs_v()] = | ||
449 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms8_vc8_2czv_v()] = | ||
450 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms8_vc8_2zv_v()] = | ||
451 | gmmu_pte_kind_z24v8_ms8_vc8_v(); | ||
452 | |||
453 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms8_vc24_2cs_v()] = | ||
454 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms8_vc24_2czv_v()] = | ||
455 | gk20a_uc_kind_map[gmmu_pte_kind_z24v8_ms8_vc24_2zv_v()] = | ||
456 | gmmu_pte_kind_z24v8_ms8_vc24_v(); | ||
457 | |||
458 | gk20a_uc_kind_map[gmmu_pte_kind_x8c24_v()] = | ||
459 | gmmu_pte_kind_x8c24_v(); | ||
460 | } | ||
461 | |||
462 | static noinline_for_stack bool gv11b_kind_supported(u8 k) | ||
463 | { | ||
464 | return /* From gv11b */ | ||
465 | k == gmmu_pte_kind_c32_ms2_4cbra_v() | ||
466 | || k == gmmu_pte_kind_c64_ms2_4cbra_v() | ||
467 | /* From gp10b */ | ||
468 | || (k >= gmmu_pte_kind_z16_2cz_v() && | ||
469 | k <= gmmu_pte_kind_z16_ms8_2cz_v()) | ||
470 | || k == gmmu_pte_kind_z16_ms16_2cz_v() | ||
471 | || k == gmmu_pte_kind_c32_ms4_4cbra_v() | ||
472 | || k == gmmu_pte_kind_c64_ms4_4cbra_v() | ||
473 | /* From gm20b */ | ||
474 | || (k == gmmu_pte_kind_smsked_message_v()) | ||
475 | || (k >= gmmu_pte_kind_s8_v() && | ||
476 | k <= gmmu_pte_kind_s8_2s_v()) | ||
477 | /* From gk20a */ | ||
478 | || gk20a_kind_work_creation(k) | ||
479 | || (k == gmmu_pte_kind_invalid_v()) | ||
480 | || (k == gmmu_pte_kind_pitch_v()) | ||
481 | || (k >= gmmu_pte_kind_z16_v() && | ||
482 | k <= gmmu_pte_kind_z16_ms8_2c_v()) | ||
483 | || (k >= gmmu_pte_kind_z16_2z_v() && | ||
484 | k <= gmmu_pte_kind_z16_ms8_2z_v()) | ||
485 | || (k == gmmu_pte_kind_s8z24_v()) | ||
486 | || (k >= gmmu_pte_kind_s8z24_2cz_v() && | ||
487 | k <= gmmu_pte_kind_s8z24_ms8_2cz_v()) | ||
488 | || (k >= gmmu_pte_kind_v8z24_ms4_vc12_v() && | ||
489 | k <= gmmu_pte_kind_v8z24_ms8_vc24_v()) | ||
490 | || (k >= gmmu_pte_kind_v8z24_ms4_vc12_2czv_v() && | ||
491 | k <= gmmu_pte_kind_v8z24_ms8_vc24_2zv_v()) | ||
492 | || (k == gmmu_pte_kind_z24s8_v()) | ||
493 | || (k >= gmmu_pte_kind_z24s8_2cz_v() && | ||
494 | k <= gmmu_pte_kind_z24s8_ms8_2cz_v()) | ||
495 | || (k == gmmu_pte_kind_zf32_v()) | ||
496 | || (k >= gmmu_pte_kind_zf32_2cz_v() && | ||
497 | k <= gmmu_pte_kind_zf32_ms8_2cz_v()) | ||
498 | || (k >= gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_v() && | ||
499 | k <= gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_v()) | ||
500 | || (k >= gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cszv_v() && | ||
501 | k <= gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_v()) | ||
502 | || (k >= gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cszv_v() && | ||
503 | k <= gmmu_pte_kind_zf32_x24s8_v()) | ||
504 | || (k >= gmmu_pte_kind_zf32_x24s8_2cszv_v() && | ||
505 | k <= gmmu_pte_kind_zf32_x24s8_ms8_2cszv_v()) | ||
506 | || (k == gmmu_pte_kind_generic_16bx2_v()) | ||
507 | || (k == gmmu_pte_kind_c32_2c_v()) | ||
508 | || (k == gmmu_pte_kind_c32_2cra_v()) | ||
509 | || (k == gmmu_pte_kind_c32_ms2_2c_v()) | ||
510 | || (k >= gmmu_pte_kind_c32_ms4_2c_v() && | ||
511 | k <= gmmu_pte_kind_c32_ms4_2cbr_v()) | ||
512 | || (k >= gmmu_pte_kind_c32_ms4_2cra_v() && | ||
513 | k <= gmmu_pte_kind_c64_2c_v()) | ||
514 | || (k == gmmu_pte_kind_c64_2cra_v()) | ||
515 | || (k == gmmu_pte_kind_c64_ms2_2c_v()) | ||
516 | || (k >= gmmu_pte_kind_c64_ms4_2c_v() && | ||
517 | k <= gmmu_pte_kind_c64_ms4_2cbr_v()) | ||
518 | || (k >= gmmu_pte_kind_c64_ms4_2cra_v() && | ||
519 | k <= gmmu_pte_kind_c128_ms8_ms16_2cr_v()) | ||
520 | || (k == gmmu_pte_kind_pitch_no_swizzle_v()); | ||
260 | } | 521 | } |
261 | 522 | ||
262 | static bool gv11b_kind_supported(u8 k) | 523 | static noinline_for_stack bool gv11b_kind_z(u8 k) |
263 | { | 524 | { |
264 | return (k == gmmu_pte_kind_c32_ms2_4cbra_v() | 525 | return /* From gv11b */ |
265 | || k == gmmu_pte_kind_c64_ms2_4cbra_v()); | 526 | (k == gmmu_pte_kind_c32_ms2_4cbra_v()) |
527 | || (k == gmmu_pte_kind_c64_ms2_4cbra_v()) | ||
528 | /* From gp10b */ | ||
529 | || (k >= gmmu_pte_kind_z16_2cz_v() && | ||
530 | k <= gmmu_pte_kind_z16_ms8_2cz_v()) | ||
531 | || (k == gmmu_pte_kind_z16_ms16_2cz_v()) | ||
532 | /* From gm20b */ | ||
533 | || (k >= gmmu_pte_kind_s8_v() && | ||
534 | k <= gmmu_pte_kind_s8_2s_v()) | ||
535 | /* From gk20a */ | ||
536 | || (k >= gmmu_pte_kind_z16_v() && | ||
537 | k <= gmmu_pte_kind_v8z24_ms8_vc24_v()) | ||
538 | || (k >= gmmu_pte_kind_v8z24_ms4_vc12_1zv_v() && | ||
539 | k <= gmmu_pte_kind_v8z24_ms8_vc24_2cs_v()) | ||
540 | || (k >= gmmu_pte_kind_v8z24_ms4_vc12_2czv_v() && | ||
541 | k <= gmmu_pte_kind_z24v8_ms8_vc24_v()) | ||
542 | || (k >= gmmu_pte_kind_z24v8_ms4_vc12_1zv_v() && | ||
543 | k <= gmmu_pte_kind_z24v8_ms8_vc24_2cs_v()) | ||
544 | || (k >= gmmu_pte_kind_z24v8_ms4_vc12_2czv_v() && | ||
545 | k <= gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1cs_v()) | ||
546 | || (k >= gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1zv_v() && | ||
547 | k <= gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1cs_v()) | ||
548 | || (k >= gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1zv_v() && | ||
549 | k <= gmmu_pte_kind_zf32_x24s8_ms16_1cs_v()); | ||
266 | } | 550 | } |
267 | 551 | ||
268 | static bool gv11b_kind_z(u8 k) | 552 | static noinline_for_stack bool gv11b_kind_c(u8 k) |
269 | { | 553 | { |
270 | return (k == gmmu_pte_kind_c32_ms2_4cbra_v() | 554 | return gk20a_kind_work_creation(k) |
271 | || k == gmmu_pte_kind_c64_ms2_4cbra_v()); | 555 | || (k == gmmu_pte_kind_pitch_v()) |
556 | || (k == gmmu_pte_kind_generic_16bx2_v()) | ||
557 | || (k >= gmmu_pte_kind_c32_2c_v() && | ||
558 | k <= gmmu_pte_kind_c32_ms2_2cbr_v()) | ||
559 | || (k >= gmmu_pte_kind_c32_ms4_2c_v() && | ||
560 | k <= gmmu_pte_kind_c64_ms2_2cbr_v()) | ||
561 | || (k >= gmmu_pte_kind_c64_ms4_2c_v() && | ||
562 | k <= gmmu_pte_kind_pitch_no_swizzle_v()); | ||
272 | } | 563 | } |
273 | 564 | ||
274 | static bool gv11b_kind_compressible(u8 k) | 565 | static noinline_for_stack bool gv11b_kind_compressible(u8 k) |
275 | { | 566 | { |
276 | 567 | ||
277 | return (k == gmmu_pte_kind_c32_ms2_4cbra_v() | 568 | return /* From gv11b */ |
278 | || k == gmmu_pte_kind_c64_ms2_4cbra_v()); | 569 | (k == gmmu_pte_kind_c32_ms2_4cbra_v()) |
570 | || (k == gmmu_pte_kind_c64_ms2_4cbra_v()) | ||
571 | /* From gp10b */ | ||
572 | || (k >= gmmu_pte_kind_z16_2cz_v() && | ||
573 | k <= gmmu_pte_kind_z16_ms8_2cz_v()) | ||
574 | || (k == gmmu_pte_kind_z16_ms16_2cz_v()) | ||
575 | || (k == gmmu_pte_kind_c32_ms4_4cbra_v()) | ||
576 | || (k == gmmu_pte_kind_c64_ms4_4cbra_v()) | ||
577 | /* From gm20b */ | ||
578 | || (k >= gmmu_pte_kind_s8_v() && | ||
579 | k <= gmmu_pte_kind_s8_2s_v()) | ||
580 | /* From gk20a */ | ||
581 | || (k >= gmmu_pte_kind_s8z24_1z_v() && | ||
582 | k <= gmmu_pte_kind_s8z24_ms16_4cszv_v()) | ||
583 | || (k >= gmmu_pte_kind_v8z24_ms4_vc12_1zv_v() && | ||
584 | k <= gmmu_pte_kind_v8z24_ms8_vc24_2cs_v()) | ||
585 | || (k >= gmmu_pte_kind_v8z24_ms4_vc12_2czv_v() && | ||
586 | k <= gmmu_pte_kind_v8z24_ms8_vc24_4cszv_v()) | ||
587 | || (k >= gmmu_pte_kind_z24s8_1z_v() && | ||
588 | k <= gmmu_pte_kind_z24s8_ms16_4cszv_v()) | ||
589 | || (k >= gmmu_pte_kind_z24v8_ms4_vc12_1zv_v() && | ||
590 | k <= gmmu_pte_kind_z24v8_ms8_vc24_2cs_v()) | ||
591 | || (k >= gmmu_pte_kind_z24v8_ms4_vc12_2czv_v() && | ||
592 | k <= gmmu_pte_kind_z24v8_ms8_vc24_4cszv_v()) | ||
593 | || (k >= gmmu_pte_kind_zf32_1z_v() && | ||
594 | k <= gmmu_pte_kind_zf32_ms16_2cz_v()) | ||
595 | || (k >= gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1cs_v() && | ||
596 | k <= gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1cs_v()) | ||
597 | || (k >= gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1zv_v() && | ||
598 | k <= gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cszv_v()) | ||
599 | || (k >= gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1cs_v() && | ||
600 | k <= gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1cs_v()) | ||
601 | || (k >= gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1zv_v() && | ||
602 | k <= gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cszv_v()) | ||
603 | || (k >= gmmu_pte_kind_zf32_x24s8_1cs_v() && | ||
604 | k <= gmmu_pte_kind_zf32_x24s8_ms16_1cs_v()) | ||
605 | || (k >= gmmu_pte_kind_zf32_x24s8_2cszv_v() && | ||
606 | k <= gmmu_pte_kind_c32_ms2_2cbr_v()) | ||
607 | || (k >= gmmu_pte_kind_c32_ms4_2c_v() && | ||
608 | k <= gmmu_pte_kind_c64_ms2_2cbr_v()) | ||
609 | || (k >= gmmu_pte_kind_c64_ms4_2c_v() && | ||
610 | k <= gmmu_pte_kind_c128_ms8_ms16_2cr_v()); | ||
279 | } | 611 | } |
280 | 612 | ||
281 | static bool gv11b_kind_zbc(u8 k) | 613 | static noinline_for_stack bool gv11b_kind_zbc(u8 k) |
282 | { | 614 | { |
283 | 615 | ||
284 | return (k == gmmu_pte_kind_c32_ms2_4cbra_v() | 616 | return /* From gv11b */ |
285 | || k == gmmu_pte_kind_c64_ms2_4cbra_v()); | 617 | (k == gmmu_pte_kind_c32_ms2_4cbra_v()) |
618 | || (k == gmmu_pte_kind_c64_ms2_4cbra_v()) | ||
619 | /* From gp10b */ | ||
620 | || (k >= gmmu_pte_kind_z16_2cz_v() && | ||
621 | k <= gmmu_pte_kind_z16_ms8_2cz_v()) | ||
622 | || (k == gmmu_pte_kind_z16_ms16_2cz_v()) | ||
623 | || (k == gmmu_pte_kind_c32_ms4_4cbra_v()) | ||
624 | || (k == gmmu_pte_kind_c64_ms4_4cbra_v()) | ||
625 | /* From gm20b */ | ||
626 | || (k >= gmmu_pte_kind_s8_v() && | ||
627 | k <= gmmu_pte_kind_s8_2s_v()) | ||
628 | /* From gk20a */ | ||
629 | || (k >= gmmu_pte_kind_z16_2c_v() && | ||
630 | k <= gmmu_pte_kind_z16_ms16_2c_v()) | ||
631 | || (k >= gmmu_pte_kind_s8z24_2cz_v() && | ||
632 | k <= gmmu_pte_kind_s8z24_ms16_4cszv_v()) | ||
633 | || (k >= gmmu_pte_kind_v8z24_ms4_vc12_2cs_v() && | ||
634 | k <= gmmu_pte_kind_v8z24_ms8_vc24_2cs_v()) | ||
635 | || (k >= gmmu_pte_kind_v8z24_ms4_vc12_2czv_v() && | ||
636 | k <= gmmu_pte_kind_v8z24_ms8_vc24_2czv_v()) | ||
637 | || (k >= gmmu_pte_kind_v8z24_ms4_vc12_4cszv_v() && | ||
638 | k <= gmmu_pte_kind_v8z24_ms8_vc24_4cszv_v()) | ||
639 | || (k >= gmmu_pte_kind_z24s8_2cs_v() && | ||
640 | k <= gmmu_pte_kind_z24s8_ms16_4cszv_v()) | ||
641 | || (k >= gmmu_pte_kind_z24v8_ms4_vc12_2cs_v() && | ||
642 | k <= gmmu_pte_kind_z24v8_ms8_vc24_2cs_v()) | ||
643 | || (k >= gmmu_pte_kind_z24v8_ms4_vc12_2czv_v() && | ||
644 | k <= gmmu_pte_kind_z24v8_ms8_vc24_2czv_v()) | ||
645 | || (k >= gmmu_pte_kind_z24v8_ms4_vc12_4cszv_v() && | ||
646 | k <= gmmu_pte_kind_z24v8_ms8_vc24_4cszv_v()) | ||
647 | || (k >= gmmu_pte_kind_zf32_2cs_v() && | ||
648 | k <= gmmu_pte_kind_zf32_ms16_2cz_v()) | ||
649 | || (k >= gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1cs_v() && | ||
650 | k <= gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1cs_v()) | ||
651 | || (k >= gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1czv_v() && | ||
652 | k <= gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cszv_v()) | ||
653 | || (k >= gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1cs_v() && | ||
654 | k <= gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1cs_v()) | ||
655 | || (k >= gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1czv_v() && | ||
656 | k <= gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cszv_v()) | ||
657 | || (k >= gmmu_pte_kind_zf32_x24s8_1cs_v() && | ||
658 | k <= gmmu_pte_kind_zf32_x24s8_ms16_1cs_v()) | ||
659 | || (k >= gmmu_pte_kind_zf32_x24s8_2cszv_v() && | ||
660 | k <= gmmu_pte_kind_c32_2cra_v()) | ||
661 | || (k >= gmmu_pte_kind_c32_ms2_2c_v() && | ||
662 | k <= gmmu_pte_kind_c32_ms2_2cbr_v()) | ||
663 | || (k >= gmmu_pte_kind_c32_ms4_2c_v() && | ||
664 | k <= gmmu_pte_kind_c32_ms4_2cra_v()) | ||
665 | || (k >= gmmu_pte_kind_c32_ms8_ms16_2c_v() && | ||
666 | k <= gmmu_pte_kind_c64_2cra_v()) | ||
667 | || (k >= gmmu_pte_kind_c64_ms2_2c_v() && | ||
668 | k <= gmmu_pte_kind_c64_ms2_2cbr_v()) | ||
669 | || (k >= gmmu_pte_kind_c64_ms4_2c_v() && | ||
670 | k <= gmmu_pte_kind_c64_ms4_2cra_v()) | ||
671 | || (k >= gmmu_pte_kind_c64_ms8_ms16_2c_v() && | ||
672 | k <= gmmu_pte_kind_c128_ms8_ms16_2cr_v()); | ||
286 | } | 673 | } |
287 | 674 | ||
288 | static void gv11b_init_kind_attr(void) | 675 | static void gv11b_init_kind_attr(void) |
289 | { | 676 | { |
290 | u16 k; | 677 | u16 k; |
291 | 678 | ||
292 | for (k = 0; k < 256; k++) { | 679 | for (k = 0; k < NV_KIND_ATTR_SIZE; k++) { |
293 | if (gv11b_kind_supported((u8)k)) | 680 | if (gv11b_kind_supported((u8)k)) |
294 | gk20a_kind_attr[k] |= GK20A_KIND_ATTR_SUPPORTED; | 681 | gk20a_kind_attr[k] |= GK20A_KIND_ATTR_SUPPORTED; |
295 | if (gv11b_kind_compressible((u8)k)) | 682 | if (gv11b_kind_compressible((u8)k)) |
296 | gk20a_kind_attr[k] |= GK20A_KIND_ATTR_COMPRESSIBLE; | 683 | gk20a_kind_attr[k] |= GK20A_KIND_ATTR_COMPRESSIBLE; |
297 | if (gv11b_kind_z((u8)k)) | 684 | if (gv11b_kind_z((u8)k)) |
298 | gk20a_kind_attr[k] |= GK20A_KIND_ATTR_Z; | 685 | gk20a_kind_attr[k] |= GK20A_KIND_ATTR_Z; |
686 | if (gv11b_kind_c((u8)k)) | ||
687 | gk20a_kind_attr[k] |= GK20A_KIND_ATTR_C; | ||
299 | if (gv11b_kind_zbc((u8)k)) | 688 | if (gv11b_kind_zbc((u8)k)) |
300 | gk20a_kind_attr[k] |= GK20A_KIND_ATTR_ZBC; | 689 | gk20a_kind_attr[k] |= GK20A_KIND_ATTR_ZBC; |
301 | } | 690 | } |