summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-06-28 14:36:26 -0700
committerEric Anholt <[email protected]>2014-08-08 18:59:46 -0700
commit21db43021041e8dedc45bb232c10ece83fd09dd1 (patch)
tree692af36222549b888feb35b303848b4f23b1f2e9 /src/gallium/drivers/vc4/vc4_context.c
parent2e35981d4d625d951328ef5b8f95798112997fb3 (diff)
vc4: Add VC4_DEBUG env option
v2: Fix an accidental deletion of some characters from the copyright message (caught by Ilia Mirkin)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_context.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index 66cba1f33e0..032d606eb7a 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -110,13 +110,16 @@ vc4_flush(struct pipe_context *pctx)
submit.shader_record_len = vc4->shader_rec.next - vc4->shader_rec.base;
submit.shader_record_count = vc4->shader_rec_count;
+ if (!(vc4_debug & VC4_DEBUG_NORAST)) {
#ifndef USE_VC4_SIMULATOR
- int ret = drmIoctl(vc4->fd, DRM_IOCTL_VC4_SUBMIT_CL, &submit);
- if (ret)
- errx(1, "VC4 submit failed\n");
+ int ret = drmIoctl(vc4->fd, DRM_IOCTL_VC4_SUBMIT_CL, &submit);
+ if (ret)
+ errx(1, "VC4 submit failed\n");
#else
- vc4_simulator_flush(vc4, csurf);
+ vc4_simulator_flush(vc4, csurf);
#endif
+ }
+
vc4_reset_cl(&vc4->bcl);
vc4_reset_cl(&vc4->rcl);
vc4_reset_cl(&vc4->shader_rec);
@@ -158,6 +161,10 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv)
struct vc4_screen *screen = vc4_screen(pscreen);
struct vc4_context *vc4;
+ /* Prevent dumping of the shaders built during context setup. */
+ uint32_t saved_shaderdb_flag = vc4_debug & VC4_DEBUG_SHADERDB;
+ vc4_debug &= ~VC4_DEBUG_SHADERDB;
+
vc4 = CALLOC_STRUCT(vc4_context);
if (vc4 == NULL)
return NULL;
@@ -194,6 +201,8 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv)
if (!vc4->primconvert)
goto fail;
+ vc4_debug |= saved_shaderdb_flag;
+
return &vc4->base;
fail: