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.
This commit is contained in:
Eric Anholt 2018-11-02 11:51:58 -07:00
parent df9f574c13
commit f32ba7abd7
5 changed files with 13 additions and 19 deletions

View 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);

View 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. "

View 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:

View 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,

View 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,