summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-10-11 16:47:58 -0700
committerEric Anholt <[email protected]>2016-10-21 14:12:22 -0700
commit78087676c98aa8884ba92e75a0a5306a8f78ad43 (patch)
treeccb82acf61036bcc8d72198a247baad2f0c5f9ef /src/gallium/drivers/vc4/vc4_context.h
parent1d7874fa7b4683cba8f8bc78c139402b989dd9df (diff)
vc4: Restructure the simulator mode.
Rather than having simulator mode changes scattered around vc4_bufmgr.c and vc4_screen.c, make vc4_bufmgr.c just call a vc4_simulator_ioctl, which then dispatches to a corresponding implementation. This will give the simulator support a centralized place to do tricks like storing most BOs directly in simulator memory rather than copying in and out. This leaves special casing of mmaping BOs and execution, because of the winsys mapping.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.h')
-rw-r--r--src/gallium/drivers/vc4/vc4_context.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.h b/src/gallium/drivers/vc4/vc4_context.h
index 313630a7e2f..249caebc1bc 100644
--- a/src/gallium/drivers/vc4/vc4_context.h
+++ b/src/gallium/drivers/vc4/vc4_context.h
@@ -30,6 +30,7 @@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "util/slab.h"
+#include "xf86drm.h"
#define __user
#include "vc4_drm.h"
@@ -427,6 +428,16 @@ void vc4_simulator_destroy(struct vc4_screen *screen);
int vc4_simulator_flush(struct vc4_context *vc4,
struct drm_vc4_submit_cl *args,
struct vc4_job *job);
+int vc4_simulator_ioctl(int fd, unsigned long request, void *arg);
+
+static inline int
+vc4_ioctl(int fd, unsigned long request, void *arg)
+{
+ if (using_vc4_simulator)
+ return vc4_simulator_ioctl(fd, request, arg);
+ else
+ return drmIoctl(fd, request, arg);
+}
void vc4_set_shader_uniform_dirty_flags(struct vc4_compiled_shader *shader);
void vc4_write_uniforms(struct vc4_context *vc4,