summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-07-18 13:06:01 -0700
committerEric Anholt <[email protected]>2014-08-11 14:40:45 -0700
commita3cd3c0d198374647df3db83198e8ce0cddcb6b7 (patch)
treead6f36cbf7b4c8bf081b0ea4c62620ef62e97282 /src/gallium/drivers/vc4/vc4_context.c
parenta02c658908384b81e9d27e2555ba2fce2cc0f6a8 (diff)
vc4: Switch simulator to using kernel validator
This ensures that when I'm using the simulator, I get a closer match to what behavior on real hardware will be. It lets me rapidly iterate on the kernel validation code (which otherwise has a several-minute turnaround time), and helps catch buffer overflow bugs in the userspace driver faster.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_context.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index 032d606eb7a..a9fa7ef70f1 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -32,8 +32,6 @@
#include "indices/u_primconvert.h"
#include "pipe/p_screen.h"
-#define __user
-#include "vc4_drm.h"
#include "vc4_screen.h"
#include "vc4_context.h"
#include "vc4_resource.h"
@@ -111,19 +109,24 @@ vc4_flush(struct pipe_context *pctx)
submit.shader_record_count = vc4->shader_rec_count;
if (!(vc4_debug & VC4_DEBUG_NORAST)) {
+ int ret;
+
#ifndef USE_VC4_SIMULATOR
- int ret = drmIoctl(vc4->fd, DRM_IOCTL_VC4_SUBMIT_CL, &submit);
- if (ret)
- errx(1, "VC4 submit failed\n");
+ ret = drmIoctl(vc4->fd, DRM_IOCTL_VC4_SUBMIT_CL, &submit);
#else
- vc4_simulator_flush(vc4, csurf);
+ ret = vc4_simulator_flush(vc4, &submit, csurf);
#endif
+ if (ret)
+ errx(1, "VC4 submit failed\n");
}
vc4_reset_cl(&vc4->bcl);
vc4_reset_cl(&vc4->rcl);
vc4_reset_cl(&vc4->shader_rec);
vc4_reset_cl(&vc4->bo_handles);
+#ifdef USE_VC4_SIMULATOR
+ vc4_reset_cl(&vc4->bo_pointers);
+#endif
vc4->shader_rec_count = 0;
vc4->needs_flush = false;