[Mesa-dev] [PATCH 05/18] winsys/amdgpu: add amdgpu_cs_has_user_fence
Marek Olšák
maraeo at gmail.com
Wed May 11 21:20:27 UTC 2016
On Tue, May 10, 2016 at 1:21 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> ---
> src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
> index 075d791..0bd776d 100644
> --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
> +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
> @@ -215,6 +215,11 @@ amdgpu_ctx_query_reset_status(struct radeon_winsys_ctx *rwctx)
>
> /* COMMAND SUBMISSION */
>
> +static bool amdgpu_cs_has_user_fence(struct amdgpu_cs_context *cs)
> +{
> + return cs->request.ip_type != AMDGPU_HW_IP_UVD && cs->request.ip_type != AMDGPU_HW_IP_VCE;
Bikeshedding: This would be nicer if it was on two lines as below.
Marek
> +}
> +
> static bool amdgpu_get_new_ib(struct radeon_winsys *ws, struct amdgpu_ib *ib,
> struct amdgpu_cs_ib_info *info, unsigned ib_type)
> {
> @@ -677,8 +682,7 @@ void amdgpu_cs_submit_ib(struct amdgpu_cs *acs)
> int i, r;
>
> cs->request.fence_info.handle = NULL;
> - if (cs->request.ip_type != AMDGPU_HW_IP_UVD &&
> - cs->request.ip_type != AMDGPU_HW_IP_VCE) {
> + if (amdgpu_cs_has_user_fence(cs)) {
> cs->request.fence_info.handle = acs->ctx->user_fence_bo;
> cs->request.fence_info.offset = acs->ring_type;
> }
> @@ -735,8 +739,7 @@ void amdgpu_cs_submit_ib(struct amdgpu_cs *acs)
> } else {
> /* Success. */
> uint64_t *user_fence = NULL;
> - if (cs->request.ip_type != AMDGPU_HW_IP_UVD &&
> - cs->request.ip_type != AMDGPU_HW_IP_VCE)
> + if (amdgpu_cs_has_user_fence(cs))
> user_fence = acs->ctx->user_fence_cpu_address_base +
> cs->request.fence_info.offset;
> amdgpu_fence_submitted(cs->fence, &cs->request, user_fence);
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list