summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/ilo/ilo_common.h1
-rw-r--r--src/gallium/drivers/ilo/ilo_context.c8
-rw-r--r--src/gallium/drivers/ilo/ilo_cp.c4
-rw-r--r--src/gallium/drivers/ilo/ilo_cp.h2
-rw-r--r--src/gallium/drivers/ilo/ilo_screen.c1
5 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/ilo/ilo_common.h b/src/gallium/drivers/ilo/ilo_common.h
index cc17f76e243..ae7896efc27 100644
--- a/src/gallium/drivers/ilo/ilo_common.h
+++ b/src/gallium/drivers/ilo/ilo_common.h
@@ -68,6 +68,7 @@ enum ilo_debug {
struct ilo_dev_info {
/* these mirror intel_winsys_info */
int devid;
+ int max_batch_size;
bool has_llc;
bool has_gen7_sol_reset;
bool has_address_swizzling;
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);
diff --git a/src/gallium/drivers/ilo/ilo_cp.c b/src/gallium/drivers/ilo/ilo_cp.c
index 8bcb19625f8..cd94eec0fe5 100644
--- a/src/gallium/drivers/ilo/ilo_cp.c
+++ b/src/gallium/drivers/ilo/ilo_cp.c
@@ -272,7 +272,7 @@ ilo_cp_destroy(struct ilo_cp *cp)
* Create a command parser.
*/
struct ilo_cp *
-ilo_cp_create(struct intel_winsys *winsys, bool direct_map)
+ilo_cp_create(struct intel_winsys *winsys, int size, bool direct_map)
{
struct ilo_cp *cp;
@@ -286,7 +286,7 @@ ilo_cp_create(struct intel_winsys *winsys, bool direct_map)
cp->ring = ILO_CP_RING_RENDER;
cp->no_implicit_flush = false;
- cp->bo_size = 8192;
+ cp->bo_size = size;
if (!direct_map) {
cp->sys = MALLOC(cp->bo_size * 4);
diff --git a/src/gallium/drivers/ilo/ilo_cp.h b/src/gallium/drivers/ilo/ilo_cp.h
index 9a09ac9106a..1dcfab81cdf 100644
--- a/src/gallium/drivers/ilo/ilo_cp.h
+++ b/src/gallium/drivers/ilo/ilo_cp.h
@@ -85,7 +85,7 @@ struct ilo_cp_jmp_buf {
};
struct ilo_cp *
-ilo_cp_create(struct intel_winsys *winsys, bool direct_map);
+ilo_cp_create(struct intel_winsys *winsys, int size, bool direct_map);
void
ilo_cp_destroy(struct ilo_cp *cp);
diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c
index 55bbb3abaf0..11a5be2ebf1 100644
--- a/src/gallium/drivers/ilo/ilo_screen.c
+++ b/src/gallium/drivers/ilo/ilo_screen.c
@@ -648,6 +648,7 @@ static bool
init_dev(struct ilo_dev_info *dev, const struct intel_winsys_info *info)
{
dev->devid = info->devid;
+ dev->max_batch_size = info->max_batch_size;
dev->has_llc = info->has_llc;
dev->has_gen7_sol_reset = info->has_gen7_sol_reset;
dev->has_address_swizzling = info->has_address_swizzling;