vc4: Use the normal simulator ioctl path for CL submit as well.
authorEric Anholt <eric@anholt.net>
Fri, 2 Nov 2018 19:33:04 +0000 (12:33 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 2 Nov 2018 21:26:38 +0000 (14:26 -0700)
The simulator no longer needs to look back into the gallium structs.

src/gallium/drivers/vc4/vc4_context.h
src/gallium/drivers/vc4/vc4_job.c
src/gallium/drivers/vc4/vc4_simulator.c

index 3f1dac3a2f046b7d37291d831b86ab48fa239a8e..8a8d3b6d5b0caa6158865c72ba8a09c3ae9981e6 100644 (file)
@@ -486,9 +486,6 @@ void vc4_program_fini(struct pipe_context *pctx);
 void vc4_query_init(struct pipe_context *pctx);
 void vc4_simulator_init(struct vc4_screen *screen);
 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);
 void vc4_simulator_open_from_handle(int fd, int handle, uint32_t size);
 
index f38c464754117703f5f3fe891f48656134442ff4..2b87a00df0f7d3abe0911a8a246a17bff3b9d860 100644 (file)
@@ -492,11 +492,7 @@ vc4_job_submit(struct vc4_context *vc4, struct vc4_job *job)
         if (!(vc4_debug & VC4_DEBUG_NORAST)) {
                 int ret;
 
-#ifndef USE_VC4_SIMULATOR
-                ret = drmIoctl(vc4->fd, DRM_IOCTL_VC4_SUBMIT_CL, &submit);
-#else
-                ret = vc4_simulator_flush(vc4, &submit, job);
-#endif
+                ret = vc4_ioctl(vc4->fd, DRM_IOCTL_VC4_SUBMIT_CL, &submit);
                 static bool warned = false;
                 if (ret && !warned) {
                         fprintf(stderr, "Draw call returned %s.  "
index 46fed7bcdb875a84a4055278e6a0c6c8761931a3..2ce5a759633b0a6dbbe39d1c87e25f63dd112726 100644 (file)
@@ -364,12 +364,9 @@ vc4_dump_to_file(struct vc4_exec_info *exec)
         fclose(f);
 }
 
-int
-vc4_simulator_flush(struct vc4_context *vc4,
-                    struct drm_vc4_submit_cl *args, struct vc4_job *job)
+static int
+vc4_simulator_submit_cl_ioctl(int fd, struct drm_vc4_submit_cl *args)
 {
-        struct vc4_screen *screen = vc4->screen;
-        int fd = screen->fd;
         struct vc4_simulator_file *file = vc4_get_simulator_file_for_fd(fd);
         struct vc4_exec_info exec;
         struct drm_device *dev = &file->dev;
@@ -583,6 +580,8 @@ int
 vc4_simulator_ioctl(int fd, unsigned long request, void *args)
 {
         switch (request) {
+        case DRM_IOCTL_VC4_SUBMIT_CL:
+                return vc4_simulator_submit_cl_ioctl(fd, args);
         case DRM_IOCTL_VC4_CREATE_BO:
                 return vc4_simulator_create_bo_ioctl(fd, args);
         case DRM_IOCTL_VC4_CREATE_SHADER_BO: