Lines Matching refs:at

49 get_history(struct fd_autotune *at, struct fd_batch *batch)
53 /* draw batches should still have their key at this point. */
59 _mesa_hash_table_search_pre_hashed(at->ht, batch->hash, batch->key);
66 history = rzalloc_size(at->ht, sizeof(*history));
72 /* Note: We cap # of cached GMEM states at 20.. so assuming double-
75 if (at->ht->entries >= 40) {
77 list_last_entry(&at->lru, struct fd_batch_history, node);
78 _mesa_hash_table_remove_key(at->ht, last->key);
83 _mesa_hash_table_insert_pre_hashed(at->ht, batch->hash, history->key,
89 list_add(&history->node, &at->lru);
104 get_result(struct fd_autotune *at, struct fd_batch_history *history)
109 ++at->fence_counter; /* pre-increment so zero isn't valid fence */
110 result->idx = at->idx_counter++;
112 if (at->idx_counter >= ARRAY_SIZE(at->results->result))
113 at->idx_counter = 0;
116 list_addtail(&result->node, &at->pending_results);
124 process_results(struct fd_autotune *at)
126 uint32_t current_fence = at->results->fence;
129 &at->pending_results, node) {
135 result->samples_passed = at->results->result[result->idx].samples_end -
136 at->results->result[result->idx].samples_start;
174 fd_autotune_use_bypass(struct fd_autotune *at, struct fd_batch *batch)
178 process_results(at);
198 struct fd_batch_history *history = get_history(at, batch);
202 batch->autotune_result = get_result(at, history);
249 fd_autotune_init(struct fd_autotune *at, struct fd_device *dev)
251 at->ht =
253 list_inithead(&at->lru);
255 at->results_mem = fd_bo_new(dev, sizeof(struct fd_autotune_results),
257 at->results = fd_bo_map(at->results_mem);
259 list_inithead(&at->pending_results);
263 fd_autotune_fini(struct fd_autotune *at)
265 _mesa_hash_table_destroy(at->ht, NULL);
266 fd_bo_del(at->results_mem);