Lines Matching full:table
40 const struct drm_i915_mocs_entry *table; member
118 * entries will remain constant and the table will only be updated by
283 struct drm_i915_mocs_table *table) in get_mocs_settings() argument
289 table->size = ARRAY_SIZE(tigerlake_mocs_table); in get_mocs_settings()
290 table->table = tigerlake_mocs_table; in get_mocs_settings()
291 table->n_entries = GEN11_NUM_MOCS_ENTRIES; in get_mocs_settings()
294 table->size = ARRAY_SIZE(icelake_mocs_table); in get_mocs_settings()
295 table->table = icelake_mocs_table; in get_mocs_settings()
296 table->n_entries = GEN11_NUM_MOCS_ENTRIES; in get_mocs_settings()
299 table->size = ARRAY_SIZE(skylake_mocs_table); in get_mocs_settings()
300 table->n_entries = GEN9_NUM_MOCS_ENTRIES; in get_mocs_settings()
301 table->table = skylake_mocs_table; in get_mocs_settings()
304 table->size = ARRAY_SIZE(broxton_mocs_table); in get_mocs_settings()
305 table->n_entries = GEN9_NUM_MOCS_ENTRIES; in get_mocs_settings()
306 table->table = broxton_mocs_table; in get_mocs_settings()
310 "Platform that should have a MOCS table does not.\n"); in get_mocs_settings()
317 for (i = 0; i < table->size; i++) in get_mocs_settings()
318 if (WARN_ON(table->table[i].l3cc_value & in get_mocs_settings()
351 static u32 get_entry_control(const struct drm_i915_mocs_table *table, in get_entry_control() argument
354 if (table->table[index].used) in get_entry_control()
355 return table->table[index].control_value; in get_entry_control()
357 return table->table[I915_MOCS_PTE].control_value; in get_entry_control()
361 * intel_mocs_init_engine() - emit the mocs control table
365 * given table starting at the given address.
371 struct drm_i915_mocs_table table; in intel_mocs_init_engine() local
382 if (!get_mocs_settings(gt, &table)) in intel_mocs_init_engine()
386 unused_value = table.table[I915_MOCS_PTE].control_value; in intel_mocs_init_engine()
388 for (index = 0; index < table.size; index++) { in intel_mocs_init_engine()
389 u32 value = get_entry_control(&table, index); in intel_mocs_init_engine()
397 for (; index < table.n_entries; index++) in intel_mocs_init_engine()
406 struct drm_i915_mocs_table table; in intel_mocs_init_global() local
411 if (!get_mocs_settings(gt, &table)) in intel_mocs_init_global()
414 if (GEM_DEBUG_WARN_ON(table.size > table.n_entries)) in intel_mocs_init_global()
417 for (index = 0; index < table.size; index++) in intel_mocs_init_global()
420 table.table[index].control_value); in intel_mocs_init_global()
427 for (; index < table.n_entries; index++) in intel_mocs_init_global()
430 table.table[0].control_value); in intel_mocs_init_global()
434 const struct drm_i915_mocs_table *table) in emit_mocs_control_table() argument
441 if (GEM_WARN_ON(table->size > table->n_entries)) in emit_mocs_control_table()
445 unused_value = table->table[I915_MOCS_PTE].control_value; in emit_mocs_control_table()
447 cs = intel_ring_begin(rq, 2 + 2 * table->n_entries); in emit_mocs_control_table()
451 *cs++ = MI_LOAD_REGISTER_IMM(table->n_entries); in emit_mocs_control_table()
453 for (index = 0; index < table->size; index++) { in emit_mocs_control_table()
454 u32 value = get_entry_control(table, index); in emit_mocs_control_table()
461 for (; index < table->n_entries; index++) { in emit_mocs_control_table()
476 static u16 get_entry_l3cc(const struct drm_i915_mocs_table *table, in get_entry_l3cc() argument
479 if (table->table[index].used) in get_entry_l3cc()
480 return table->table[index].l3cc_value; in get_entry_l3cc()
482 return table->table[I915_MOCS_PTE].l3cc_value; in get_entry_l3cc()
485 static inline u32 l3cc_combine(const struct drm_i915_mocs_table *table, in l3cc_combine() argument
493 const struct drm_i915_mocs_table *table) in emit_mocs_l3cc_table() argument
499 if (GEM_WARN_ON(table->size > table->n_entries)) in emit_mocs_l3cc_table()
503 unused_value = table->table[I915_MOCS_PTE].l3cc_value; in emit_mocs_l3cc_table()
505 cs = intel_ring_begin(rq, 2 + table->n_entries); in emit_mocs_l3cc_table()
509 *cs++ = MI_LOAD_REGISTER_IMM(table->n_entries / 2); in emit_mocs_l3cc_table()
511 for (i = 0; i < table->size / 2; i++) { in emit_mocs_l3cc_table()
512 u16 low = get_entry_l3cc(table, 2 * i); in emit_mocs_l3cc_table()
513 u16 high = get_entry_l3cc(table, 2 * i + 1); in emit_mocs_l3cc_table()
516 *cs++ = l3cc_combine(table, low, high); in emit_mocs_l3cc_table()
519 /* Odd table size - 1 left over */ in emit_mocs_l3cc_table()
520 if (table->size & 0x01) { in emit_mocs_l3cc_table()
521 u16 low = get_entry_l3cc(table, 2 * i); in emit_mocs_l3cc_table()
524 *cs++ = l3cc_combine(table, low, unused_value); in emit_mocs_l3cc_table()
529 for (; i < table->n_entries / 2; i++) { in emit_mocs_l3cc_table()
531 *cs++ = l3cc_combine(table, unused_value, unused_value); in emit_mocs_l3cc_table()
543 struct drm_i915_mocs_table table; in intel_mocs_init_l3cc_table() local
547 if (!get_mocs_settings(gt, &table)) in intel_mocs_init_l3cc_table()
551 unused_value = table.table[I915_MOCS_PTE].l3cc_value; in intel_mocs_init_l3cc_table()
553 for (i = 0; i < table.size / 2; i++) { in intel_mocs_init_l3cc_table()
554 u16 low = get_entry_l3cc(&table, 2 * i); in intel_mocs_init_l3cc_table()
555 u16 high = get_entry_l3cc(&table, 2 * i + 1); in intel_mocs_init_l3cc_table()
559 l3cc_combine(&table, low, high)); in intel_mocs_init_l3cc_table()
562 /* Odd table size - 1 left over */ in intel_mocs_init_l3cc_table()
563 if (table.size & 0x01) { in intel_mocs_init_l3cc_table()
564 u16 low = get_entry_l3cc(&table, 2 * i); in intel_mocs_init_l3cc_table()
568 l3cc_combine(&table, low, unused_value)); in intel_mocs_init_l3cc_table()
573 for (; i < table.n_entries / 2; i++) in intel_mocs_init_l3cc_table()
576 l3cc_combine(&table, unused_value, in intel_mocs_init_l3cc_table()