#include "u_queue.h"
#include "u_memory.h"
+#include "u_string.h"
#include "os/os_time.h"
static void
FREE(input);
+ if (queue->name) {
+ char name[16];
+ util_snprintf(name, sizeof(name), "%s:%i", queue->name, thread_index);
+ pipe_thread_setname(name);
+ }
+
while (1) {
struct util_queue_job job;
bool
util_queue_init(struct util_queue *queue,
+ const char *name,
unsigned max_jobs,
unsigned num_threads,
void (*execute_job)(void *, int))
unsigned i;
memset(queue, 0, sizeof(*queue));
+ queue->name = name;
queue->num_threads = num_threads;
queue->max_jobs = max_jobs;
/* Put this into your context. */
struct util_queue {
+ const char *name;
pipe_mutex lock;
pipe_semaphore has_space;
pipe_semaphore queued;
};
bool util_queue_init(struct util_queue *queue,
+ const char *name,
unsigned max_jobs,
unsigned num_threads,
void (*execute_job)(void *, int));
pipe_mutex_init(ws->bo_fence_lock);
if (sysconf(_SC_NPROCESSORS_ONLN) > 1 && debug_get_option_thread())
- util_queue_init(&ws->cs_queue, 8, 1, amdgpu_cs_submit_ib);
+ util_queue_init(&ws->cs_queue, "amdgpu_cs", 8, 1, amdgpu_cs_submit_ib);
/* Create the screen at the end. The winsys must be initialized
* completely.
ws->info.gart_page_size = sysconf(_SC_PAGESIZE);
if (ws->num_cpus > 1 && debug_get_option_thread())
- util_queue_init(&ws->cs_queue, 8, 1,
+ util_queue_init(&ws->cs_queue, "radeon_cs", 8, 1,
radeon_drm_cs_emit_ioctl_oneshot);
/* Create the screen at the end. The winsys must be initialized