2 * Copyright © 2014-2017 Broadcom
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26 * V3D version-specific functions for submitting VC5 render jobs to the
30 #include "v3d_context.h"
31 #include "broadcom/cle/v3dx_pack.h"
33 void v3dX(bcl_epilogue
)(struct vc5_context
*vc5
, struct vc5_job
*job
)
35 vc5_cl_ensure_space_with_branch(&job
->bcl
,
36 cl_packet_length(OCCLUSION_QUERY_COUNTER
) +
38 cl_packet_length(TRANSFORM_FEEDBACK_SPECS
) +
40 cl_packet_length(INCREMENT_SEMAPHORE
) +
41 cl_packet_length(FLUSH_ALL_STATE
));
43 if (job
->oq_enabled
) {
44 /* Disable the OQ at the end of the CL, so that the
45 * draw calls at the start of the CL don't inherit the
48 cl_emit(&job
->bcl
, OCCLUSION_QUERY_COUNTER
, counter
);
51 /* Disable TF at the end of the CL, so that the next job to be
52 * run doesn't start out trying to write TF primitives. On
53 * V3D 3.x, it's only the TF primitive mode that triggers TF
57 if (job
->tf_enabled
) {
58 cl_emit(&job
->bcl
, TRANSFORM_FEEDBACK_SPECS
, tfe
) {
62 #endif /* V3D_VERSION >= 41 */
64 /* Increment the semaphore indicating that binning is done and
65 * unblocking the render thread. Note that this doesn't act
66 * until the FLUSH completes.
68 cl_emit(&job
->bcl
, INCREMENT_SEMAPHORE
, incr
);
70 /* The FLUSH_ALL emits any unwritten state changes in each
71 * tile. We can use this to reset any state that needs to be
72 * present at the start of the next tile, as we do with
73 * OCCLUSION_QUERY_COUNTER above.
75 cl_emit(&job
->bcl
, FLUSH_ALL_STATE
, flush
);