intel: Add always_flush_batch driconf option for making small batchbuffers.
authorEric Anholt <eric@anholt.net>
Fri, 6 Mar 2009 01:18:49 +0000 (17:18 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 6 Mar 2009 03:42:18 +0000 (19:42 -0800)
This can improve debugging with INTEL_DEBUG=batch,sync by giving smaller
batchbuffers.

src/mesa/drivers/dri/common/xmlpool/options.h
src/mesa/drivers/dri/common/xmlpool/t_options.h
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_screen.c

index a3cb3747ebc4b77dfdf3ae8b76d1ea34eaf43058..d76595578c778e69c3e0ddc2a1cd29ea25118bf9 100644 (file)
@@ -547,6 +547,16 @@ DRI_CONF_OPT_BEGIN(nv_vertex_program,bool,def) \
         DRI_CONF_DESC(sv,"Aktivera tillägget GL_NV_vertex_program") \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_ALWAYS_FLUSH_BATCH(def) \
+DRI_CONF_OPT_BEGIN(always_flush_batch,bool,def) \
+        DRI_CONF_DESC(en,"Enable flushing batchbuffer after each draw call") \
+        DRI_CONF_DESC(de,"Enable flushing batchbuffer after each draw call") \
+        DRI_CONF_DESC(es,"Enable flushing batchbuffer after each draw call") \
+        DRI_CONF_DESC(nl,"Enable flushing batchbuffer after each draw call") \
+        DRI_CONF_DESC(fr,"Enable flushing batchbuffer after each draw call") \
+        DRI_CONF_DESC(sv,"Enable flushing batchbuffer after each draw call") \
+DRI_CONF_OPT_END
+
 #define DRI_CONF_ALWAYS_FLUSH_CACHE(def) \
 DRI_CONF_OPT_BEGIN(always_flush_cache,bool,def) \
         DRI_CONF_DESC(en,"Enable flushing GPU caches with each draw call") \
index e489ae9e875b9812d365438c47196838124dbe38..5fd6ec65bf8aa3fac1da8e630edb89fc49f7a13c 100644 (file)
@@ -238,6 +238,11 @@ DRI_CONF_OPT_BEGIN(nv_vertex_program,bool,def) \
         DRI_CONF_DESC(en,gettext("Enable extension GL_NV_vertex_program")) \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_ALWAYS_FLUSH_BATCH(def) \
+DRI_CONF_OPT_BEGIN(always_flush_batch,bool,def) \
+        DRI_CONF_DESC(en,gettext("Enable flushing batchbuffer after each draw call")) \
+DRI_CONF_OPT_END
+
 #define DRI_CONF_ALWAYS_FLUSH_CACHE(def) \
 DRI_CONF_OPT_BEGIN(always_flush_cache,bool,def) \
         DRI_CONF_DESC(en,gettext("Enable flushing GPU caches with each draw call")) \
index 715236d3dbdac4d4341c8cbce1ba67a83f5add68..5342622a737b9414c5f3e6f9aedb07764212bf1d 100644 (file)
@@ -411,6 +411,8 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
       retval = GL_TRUE;
    }
 
+   if (intel->always_flush_batch)
+      intel_batchbuffer_flush(intel->batch);
  out:
    UNLOCK_HARDWARE(intel);
 
index 8c74d946a01b309c4bcad36e2943b9eabd509016..888bb3f18f6fe2f6239b90e45592a03124d0bdd8 100644 (file)
@@ -618,6 +618,11 @@ intelInitContext(struct intel_context *intel,
       intel->no_rast = 1;
    }
 
+   if (driQueryOptionb(&intel->optionCache, "always_flush_batch")) {
+      fprintf(stderr, "flushing batchbuffer before/after each draw call\n");
+      intel->always_flush_batch = 1;
+   }
+
    if (driQueryOptionb(&intel->optionCache, "always_flush_cache")) {
       fprintf(stderr, "flushing GPU caches before/after each draw call\n");
       intel->always_flush_cache = 1;
index 063102d43a207da4a3fefa975bb6c7aa6f5f68a0..e520ecf220d1b508963b0434a58129bf9447a217 100644 (file)
@@ -228,6 +228,7 @@ struct intel_context
    GLboolean hw_stipple;
    GLboolean depth_buffer_is_float;
    GLboolean no_rast;
+   GLboolean always_flush_batch;
    GLboolean always_flush_cache;
 
    /* 0 - nonconformant, best performance;
index 5d8091aaaf1f174eed3d26fc2a061b27c0fbd18d..bccdd55f887d99703fcfb6a6e373377e61c691df 100644 (file)
@@ -71,11 +71,12 @@ PUBLIC const char __driConfigOptions[] =
    DRI_CONF_SECTION_END
    DRI_CONF_SECTION_DEBUG
      DRI_CONF_NO_RAST(false)
+     DRI_CONF_ALWAYS_FLUSH_BATCH(false)
      DRI_CONF_ALWAYS_FLUSH_CACHE(false)
    DRI_CONF_SECTION_END
 DRI_CONF_END;
 
-const GLuint __driNConfigOptions = 7;
+const GLuint __driNConfigOptions = 8;
 
 #ifdef USE_NEW_INTERFACE
 static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;