vc4: Allow submitting jobs with no bin CL in validation.

For blitting, we want to fire off an RCL-only job.  This takes a bit of
tweaking in our validation and the simulator support (and corresponding
new code in the kernel).
This commit is contained in:
Eric Anholt 2015-04-09 13:35:57 -07:00
parent 43b20795b7
commit 76d56752cc
4 changed files with 19 additions and 11 deletions

View File

@ -162,6 +162,7 @@ vc4_validate_cl(struct drm_device *dev,
void *unvalidated,
uint32_t len,
bool is_bin,
bool has_bin,
struct vc4_exec_info *exec);
int

View File

@ -130,6 +130,7 @@ vc4_cl_validate(struct drm_device *dev, struct vc4_exec_info *exec)
bin,
args->bin_cl_size,
true,
args->bin_cl_size != 0,
exec);
if (ret)
goto fail;
@ -139,6 +140,7 @@ vc4_cl_validate(struct drm_device *dev, struct vc4_exec_info *exec)
render,
args->render_cl_size,
false,
args->bin_cl_size != 0,
exec);
if (ret)
goto fail;

View File

@ -702,6 +702,7 @@ vc4_validate_cl(struct drm_device *dev,
void *unvalidated,
uint32_t len,
bool is_bin,
bool has_bin,
struct vc4_exec_info *exec)
{
uint32_t dst_offset = 0;
@ -772,7 +773,7 @@ vc4_validate_cl(struct drm_device *dev,
if (is_bin) {
exec->ct0ea = exec->ct0ca + dst_offset;
if (!exec->found_start_tile_binning_packet) {
if (has_bin && !exec->found_start_tile_binning_packet) {
DRM_ERROR("Bin CL missing VC4_PACKET_START_TILE_BINNING\n");
return -EINVAL;
}
@ -786,8 +787,10 @@ vc4_validate_cl(struct drm_device *dev,
* increment from the bin CL. Otherwise a later submit would
* have render execute immediately.
*/
if (!exec->found_wait_on_semaphore_packet) {
DRM_ERROR("Render CL missing VC4_PACKET_WAIT_ON_SEMAPHORE\n");
if (exec->found_wait_on_semaphore_packet != has_bin) {
DRM_ERROR("Render CL %s VC4_PACKET_WAIT_ON_SEMAPHORE\n",
exec->found_wait_on_semaphore_packet ?
"has" : "missing");
return -EINVAL;
}
exec->ct1ea = exec->ct1ca + dst_offset;

View File

@ -151,14 +151,16 @@ vc4_simulator_flush(struct vc4_context *vc4, struct drm_vc4_submit_cl *args)
if (ret)
return ret;
int bfc = simpenrose_do_binning(exec.ct0ca, exec.ct0ea);
if (bfc != 1) {
fprintf(stderr, "Binning returned %d flushes, should be 1.\n",
bfc);
fprintf(stderr, "Relocated binning command list:\n");
vc4_dump_cl(screen->simulator_mem_base + exec.ct0ca,
exec.ct0ea - exec.ct0ca, false);
abort();
if (exec.ct0ca != exec.ct0ea) {
int bfc = simpenrose_do_binning(exec.ct0ca, exec.ct0ea);
if (bfc != 1) {
fprintf(stderr, "Binning returned %d flushes, should be 1.\n",
bfc);
fprintf(stderr, "Relocated binning command list:\n");
vc4_dump_cl(screen->simulator_mem_base + exec.ct0ca,
exec.ct0ea - exec.ct0ca, false);
abort();
}
}
int rfc = simpenrose_do_rendering(exec.ct1ca, exec.ct1ea);
if (rfc != 1) {