[Mesa-dev] [PATCH 6/7] broadcom/vc4: Expose syncobj import
Eric Anholt
eric at anholt.net
Mon Apr 23 19:10:41 UTC 2018
Stefan Schake <stschake at gmail.com> writes:
> Our submit ioctl allows to optionally specify a syncobj that will be
> waited on before job execution. Expose this in our job submission
> interface. Since every uint32_t could be a valid syncobj handle, pass
> the handle as a pointer so we can make it optional.
>
> Signed-off-by: Stefan Schake <stschake at gmail.com>
> ---
> src/gallium/drivers/vc4/vc4_context.h | 2 ++
> src/gallium/drivers/vc4/vc4_job.c | 24 +++++++++++++++++++++++-
> 2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/vc4/vc4_context.h b/src/gallium/drivers/vc4/vc4_context.h
> index d094957bb5..ac72a14008 100644
> --- a/src/gallium/drivers/vc4/vc4_context.h
> +++ b/src/gallium/drivers/vc4/vc4_context.h
> @@ -512,6 +512,8 @@ struct vc4_job *vc4_get_job(struct vc4_context *vc4,
> struct vc4_job *vc4_get_job_for_fbo(struct vc4_context *vc4);
>
> void vc4_job_submit(struct vc4_context *vc4, struct vc4_job *job);
> +void vc4_job_submit_sync(struct vc4_context *vc4, struct vc4_job *job,
> + uint32_t* in_sync);
> void vc4_flush_jobs_writing_resource(struct vc4_context *vc4,
> struct pipe_resource *prsc);
> void vc4_flush_jobs_reading_resource(struct vc4_context *vc4,
> diff --git a/src/gallium/drivers/vc4/vc4_job.c b/src/gallium/drivers/vc4/vc4_job.c
> index 2b68ea7b74..1084d39b1f 100644
> --- a/src/gallium/drivers/vc4/vc4_job.c
> +++ b/src/gallium/drivers/vc4/vc4_job.c
> @@ -368,10 +368,22 @@ vc4_submit_setup_rcl_msaa_surface(struct vc4_job *job,
> }
>
> /**
> - * Submits the job to the kernel and then reinitializes it.
> + * Wrapper for vc4_job_submit_sync omitting the rarely needed syncobj import
> + * parameter.
> */
> void
> vc4_job_submit(struct vc4_context *vc4, struct vc4_job *job)
> +{
> + vc4_job_submit_sync(vc4, job, NULL);
> +}
> +
> +/**
> + * Submits the job to the kernel and then reinitializes it, optionally passing
> + * a syncobj that will be waited on before job execution.
> + */
> +void
> +vc4_job_submit_sync(struct vc4_context *vc4, struct vc4_job *job,
> + uint32_t* in_sync)
Could we call this "vc4_job_submit_with_sync()" or something?
job_submit_sync() sounds to me like "submit this synchronously, so block
on completion."
Style nit: * goes next to the variable name rather than the type.
However, I think you can just use uint32_ts instead of pointers
throughout, with 0 meaning no sync obj.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180423/4273046b/attachment.sig>
More information about the mesa-dev
mailing list