v3d: Remove the special path for simulaton of the submit ioctl.
authorEric Anholt <eric@anholt.net>
Fri, 2 Nov 2018 18:51:58 +0000 (11:51 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 2 Nov 2018 21:26:38 +0000 (14:26 -0700)
Now that it doesn't need to find the struct v3d_bos, it can just take the
normal v3d_ioctl() path.

src/gallium/drivers/v3d/v3d_context.h
src/gallium/drivers/v3d/v3d_job.c
src/gallium/drivers/v3d/v3d_simulator.c
src/gallium/drivers/v3d/v3dx_context.h
src/gallium/drivers/v3d/v3dx_simulator.c

index 8e44bbae9066d8f3a17abb37ab5568506fcb17fb..4c3779a49908e28d78067e0b4e9641035daf189d 100644 (file)
@@ -476,9 +476,6 @@ void v3d_query_init(struct pipe_context *pctx);
 
 void v3d_simulator_init(struct v3d_screen *screen);
 void v3d_simulator_destroy(struct v3d_screen *screen);
-int v3d_simulator_flush(struct v3d_context *v3d,
-                        struct drm_v3d_submit_cl *args,
-                        struct v3d_job *job);
 int v3d_simulator_ioctl(int fd, unsigned long request, void *arg);
 void v3d_simulator_open_from_handle(int fd, int handle, uint32_t size);
 
index d45f89d096248503a8b3842e1b341d4d510849c6..604e97309029c59298998002eb924303b14b01d1 100644 (file)
@@ -406,11 +406,7 @@ v3d_job_submit(struct v3d_context *v3d, struct v3d_job *job)
         if (!(V3D_DEBUG & V3D_DEBUG_NORAST)) {
                 int ret;
 
-#ifndef USE_V3D_SIMULATOR
-                ret = drmIoctl(v3d->fd, DRM_IOCTL_V3D_SUBMIT_CL, &job->submit);
-#else
-                ret = v3d_simulator_flush(v3d, &job->submit, job);
-#endif
+                ret = v3d_ioctl(v3d->fd, DRM_IOCTL_V3D_SUBMIT_CL, &job->submit);
                 static bool warned = false;
                 if (ret && !warned) {
                         fprintf(stderr, "Draw call returned %s.  "
index 86c31db6cb716c8cd0391a124f7184e0a4822714..9e66065b5002904735c16071f4b223130bd84dfc 100644 (file)
@@ -284,12 +284,9 @@ v3d_simulator_unpin_bos(struct v3d_simulator_file *file,
         return 0;
 }
 
-int
-v3d_simulator_flush(struct v3d_context *v3d,
-                    struct drm_v3d_submit_cl *submit, struct v3d_job *job)
+static int
+v3d_simulator_submit_cl_ioctl(int fd, struct drm_v3d_submit_cl *submit)
 {
-        struct v3d_screen *screen = v3d->screen;
-        int fd = screen->fd;
         struct v3d_simulator_file *file = v3d_get_simulator_file_for_fd(fd);
         int ret;
 
@@ -298,9 +295,9 @@ v3d_simulator_flush(struct v3d_context *v3d,
                 return ret;
 
         if (sim_state.ver >= 41)
-                v3d41_simulator_flush(sim_state.v3d, submit, file->gmp->ofs);
+                v3d41_simulator_submit_cl_ioctl(sim_state.v3d, submit, file->gmp->ofs);
         else
-                v3d33_simulator_flush(sim_state.v3d, submit, file->gmp->ofs);
+                v3d33_simulator_submit_cl_ioctl(sim_state.v3d, submit, file->gmp->ofs);
 
         ret = v3d_simulator_unpin_bos(file, submit);
         if (ret)
@@ -407,6 +404,8 @@ int
 v3d_simulator_ioctl(int fd, unsigned long request, void *args)
 {
         switch (request) {
+        case DRM_IOCTL_V3D_SUBMIT_CL:
+                return v3d_simulator_submit_cl_ioctl(fd, args);
         case DRM_IOCTL_V3D_CREATE_BO:
                 return v3d_simulator_create_bo_ioctl(fd, args);
         case DRM_IOCTL_V3D_MMAP_BO:
index bb90e1ccf1539b0094c2701c34fe88dc18be58c5..ab826af6c29e1415ccc6735540ad35bfc761b0d2 100644 (file)
@@ -39,8 +39,9 @@ void v3dX(bcl_epilogue)(struct v3d_context *v3d, struct v3d_job *job);
 void v3dX(simulator_init_regs)(struct v3d_hw *v3d);
 int v3dX(simulator_get_param_ioctl)(struct v3d_hw *v3d,
                                     struct drm_v3d_get_param *args);
-void v3dX(simulator_flush)(struct v3d_hw *v3d, struct drm_v3d_submit_cl *submit,
-                           uint32_t gmp_ofs);
+void v3dX(simulator_submit_cl_ioctl)(struct v3d_hw *v3d,
+                                     struct drm_v3d_submit_cl *args,
+                                     uint32_t gmp_offset);
 const struct v3d_format *v3dX(get_format_desc)(enum pipe_format f);
 void v3dX(get_internal_type_bpp_for_output_format)(uint32_t format,
                                                    uint32_t *type,
index a1e72e0e1d9ba60d2b96612d8929a148828e3797..27cc3732344965d5b53fcfed6054db40428fdbc8 100644 (file)
@@ -139,8 +139,9 @@ v3dX(simulator_init_regs)(struct v3d_hw *v3d)
 }
 
 void
-v3dX(simulator_flush)(struct v3d_hw *v3d, struct drm_v3d_submit_cl *submit,
-                      uint32_t gmp_ofs)
+v3dX(simulator_submit_cl_ioctl)(struct v3d_hw *v3d,
+                                struct drm_v3d_submit_cl *submit,
+                                uint32_t gmp_ofs)
 {
         /* Completely reset the GMP. */
         V3D_WRITE(V3D_GMP_0_CFG,