From: Eric Anholt Date: Fri, 2 Nov 2018 18:51:58 +0000 (-0700) Subject: v3d: Remove the special path for simulaton of the submit ioctl. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f32ba7abd774a0b09805da582a97e1a1eb5efd75;p=mesa.git v3d: Remove the special path for simulaton of the submit ioctl. Now that it doesn't need to find the struct v3d_bos, it can just take the normal v3d_ioctl() path. --- diff --git a/src/gallium/drivers/v3d/v3d_context.h b/src/gallium/drivers/v3d/v3d_context.h index 8e44bbae906..4c3779a4990 100644 --- a/src/gallium/drivers/v3d/v3d_context.h +++ b/src/gallium/drivers/v3d/v3d_context.h @@ -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); diff --git a/src/gallium/drivers/v3d/v3d_job.c b/src/gallium/drivers/v3d/v3d_job.c index d45f89d0962..604e9730902 100644 --- a/src/gallium/drivers/v3d/v3d_job.c +++ b/src/gallium/drivers/v3d/v3d_job.c @@ -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. " diff --git a/src/gallium/drivers/v3d/v3d_simulator.c b/src/gallium/drivers/v3d/v3d_simulator.c index 86c31db6cb7..9e66065b500 100644 --- a/src/gallium/drivers/v3d/v3d_simulator.c +++ b/src/gallium/drivers/v3d/v3d_simulator.c @@ -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: diff --git a/src/gallium/drivers/v3d/v3dx_context.h b/src/gallium/drivers/v3d/v3dx_context.h index bb90e1ccf15..ab826af6c29 100644 --- a/src/gallium/drivers/v3d/v3dx_context.h +++ b/src/gallium/drivers/v3d/v3dx_context.h @@ -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, diff --git a/src/gallium/drivers/v3d/v3dx_simulator.c b/src/gallium/drivers/v3d/v3dx_simulator.c index a1e72e0e1d9..27cc3732344 100644 --- a/src/gallium/drivers/v3d/v3dx_simulator.c +++ b/src/gallium/drivers/v3d/v3dx_simulator.c @@ -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,