summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-03-02 17:37:52 +0100
committerMarek Olšák <[email protected]>2011-03-02 17:54:36 +0100
commitf6dbcb92bf4a3597c7b3da890ffafc84951f25df (patch)
treee12e17407d8883afdfe5bc793712199e0e4312d9 /src
parent8ad821df0a2d49964141f2ea4ef8179f4edc052f (diff)
r300g: do not use ioctl thread offloading on single-core machines
Diffstat (limited to 'src')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_common.c2
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_cs.c2
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_winsys.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_common.c b/src/gallium/winsys/radeon/drm/radeon_drm_common.c
index 4676c2a1ea9..c0044d399c4 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_common.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_common.c
@@ -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)
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
index a38b01048b2..9ee800f5950 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
@@ -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 {
diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h
index f8a89abcfe4..9ecbb074572 100644
--- a/src/gallium/winsys/radeon/drm/radeon_winsys.h
+++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h
@@ -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;