Lines Matching refs:at

40  * however we change the table only in a single thread at the submission
87 get_autotune_fence(struct tu_autotune *at)
89 const struct tu6_global *global = at->device->global_bo->map;
94 create_submission_data(struct tu_device *dev, struct tu_autotune *at)
98 submission_data->fence = at->fence_counter;
107 tu_cs_emit(fence_cs, at->fence_counter);
111 list_addtail(&submission_data->node, &at->pending_submission_data);
177 get_history(struct tu_autotune *at, uint64_t rp_key, uint32_t *avg_samples)
184 u_rwlock_rdlock(&at->ht_lock);
186 _mesa_hash_table_search(at->ht, &rp_key);
194 u_rwlock_rdunlock(&at->ht_lock);
200 create_history_result(struct tu_autotune *at, uint64_t rp_key)
240 process_results(struct tu_autotune *at, uint32_t current_fence)
242 struct tu_device *dev = at->device;
245 &at->pending_results, node) {
257 &at->pending_submission_data, node) {
266 queue_pending_results(struct tu_autotune *at, struct tu_cmd_buffer *cmdbuf)
274 &at->pending_results);
283 list_addtail(&copy->node, &at->pending_results);
290 struct tu_autotune *at,
296 const uint32_t gpu_fence = get_autotune_fence(at);
298 process_results(at, gpu_fence);
301 uint32_t new_fence = ++at->fence_counter;
313 _mesa_hash_table_search(at->ht, &result->rp_key);
319 u_rwlock_wrlock(&at->ht_lock);
320 _mesa_hash_table_insert(at->ht, &history->key, history);
321 u_rwlock_wrunlock(&at->ht_lock);
338 create_submission_data(dev, at);
346 queue_pending_results(at, cmdbuf);
350 mesa_logi("Total history entries: %u", at->ht->entries);
356 hash_table_foreach(at->ht, entry) {
366 u_rwlock_wrlock(&at->ht_lock);
367 _mesa_hash_table_remove_key(at->ht, &history->key);
368 u_rwlock_wrunlock(&at->ht_lock);
391 tu_autotune_init(struct tu_autotune *at, struct tu_device *dev)
393 at->enabled = true;
394 at->device = dev;
395 at->ht = _mesa_hash_table_create(NULL,
398 u_rwlock_init(&at->ht_lock);
400 list_inithead(&at->pending_results);
401 list_inithead(&at->pending_submission_data);
407 tu_autotune_fini(struct tu_autotune *at, struct tu_device *dev)
410 while (!list_is_empty(&at->pending_results)) {
411 const uint32_t gpu_fence = get_autotune_fence(at);
412 process_results(at, gpu_fence);
415 hash_table_foreach(at->ht, entry) {
423 tu_autotune_free_results(dev, &at->pending_results);
426 hash_table_foreach(at->ht, entry) {
433 &at->pending_submission_data, node) {
437 _mesa_hash_table_destroy(at->ht, NULL);
438 u_rwlock_destroy(&at->ht_lock);
509 tu_autotune_use_bypass(struct tu_autotune *at,
530 * we would have to allocate GPU memory at the submit time and copy
538 if (!at->enabled || simultaneous_use)
552 *autotune_result = create_history_result(at, renderpass_key);
555 if (get_history(at, renderpass_key, &avg_samples)) {