diff options
author | Chia-I Wu <[email protected]> | 2014-03-09 02:07:18 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-03-10 16:42:42 +0800 |
commit | 42c1ce4c03c0c5f4fb61b981143cf2638d87c834 (patch) | |
tree | 6d8abba785d1602df5813b0598fe6f0efbb16d24 /src/gallium/drivers/ilo/ilo_context.c | |
parent | a434ac045eb2e0333ee8bb6e44aa0a46de2e7438 (diff) |
ilo: winsys may limit the batch buffer size
The maximum batch buffer size is determined at the time of
drm_intel_bufmgr_gem_init(). Make sure the pipe driver does not exceed the
limit.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_context.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_context.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/ilo/ilo_context.c b/src/gallium/drivers/ilo/ilo_context.c index faf29c22778..a01934c9154 100644 --- a/src/gallium/drivers/ilo/ilo_context.c +++ b/src/gallium/drivers/ilo/ilo_context.c @@ -120,6 +120,7 @@ ilo_context_create(struct pipe_screen *screen, void *priv) { struct ilo_screen *is = ilo_screen(screen); struct ilo_context *ilo; + int cp_size; ilo = CALLOC_STRUCT(ilo_context); if (!ilo) @@ -135,7 +136,12 @@ ilo_context_create(struct pipe_screen *screen, void *priv) util_slab_create(&ilo->transfer_mempool, sizeof(struct ilo_transfer), 64, UTIL_SLAB_SINGLETHREADED); - ilo->cp = ilo_cp_create(ilo->winsys, is->dev.has_llc); + /* 8192 DWords */ + cp_size = 8192; + if (cp_size * 4 > is->dev.max_batch_size) + cp_size = is->dev.max_batch_size / 4; + + ilo->cp = ilo_cp_create(ilo->winsys, cp_size, is->dev.has_llc); ilo->shader_cache = ilo_shader_cache_create(); if (ilo->cp) ilo->hw3d = ilo_3d_create(ilo->cp, ilo->dev); |