r300g: do not use ioctl thread offloading on single-core machines

This commit is contained in:
Marek Olšák 2011-03-02 17:37:52 +01:00
parent 8ad821df0a
commit f6dbcb92bf
3 changed files with 4 additions and 1 deletions

View File

@ -157,6 +157,8 @@ static void do_ioctls(struct radeon_drm_winsys *winsys)
winsys->vram_size = gem_info.vram_size;
drmFreeVersion(version);
winsys->num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
}
static void radeon_winsys_destroy(struct r300_winsys_screen *rws)

View File

@ -384,7 +384,7 @@ void radeon_drm_cs_flush(struct r300_winsys_cs *rcs)
for (i = 0; i < crelocs; i++)
p_atomic_inc(&cs->csc->relocs_bo[i]->num_active_ioctls);
if (debug_get_option_thread()) {
if (cs->ws->num_cpus > 1 && debug_get_option_thread()) {
cs->thread = pipe_thread_create(radeon_drm_cs_emit_ioctl, cs->csc);
assert(cs->thread);
} else {

View File

@ -46,6 +46,7 @@ struct radeon_drm_winsys {
uint32_t z_pipes; /* Z pipe count (rv530 only) */
uint32_t gart_size; /* GART size. */
uint32_t vram_size; /* VRAM size. */
uint32_t num_cpus; /* Number of CPUs. */
unsigned drm_major;
unsigned drm_minor;