gpu: nvgpu: don't run cde shader for 0 ctaglines

If the associated buffer is not compressed, it would be invalid to call
the cde swizzler shader with zero lines. The fences in
PREPARE_COMPRESSIBLE_READ still need to be managed, so just do a dummy
submit with zero entries when lines is zero for the buffer.

Bug 1856088

Change-Id: Ia68c2ffff21e5e8077d5c550b0ca44090f88bf80
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1590055
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Konsta Holtta
2017-11-06 15:20:50 +02:00
committed by mobile promotions
parent 8fe633449f
commit b0dee2f26c
2 changed files with 29 additions and 9 deletions

View File

@@ -759,12 +759,16 @@ static int gk20a_cde_execute_buffer(struct gk20a_cde_ctx *cde_ctx,
} else if (op == TYPE_BUF_COMMAND_CONVERT) {
gpfifo = cde_ctx->convert_cmd;
num_entries = cde_ctx->convert_cmd_num_entries;
} else if (op == TYPE_BUF_COMMAND_NOOP) {
/* Any non-null gpfifo will suffice with 0 num_entries */
gpfifo = cde_ctx->init_convert_cmd;
num_entries = 0;
} else {
nvgpu_warn(g, "cde: unknown buffer");
return -EINVAL;
}
if (gpfifo == NULL || num_entries == 0) {
if (gpfifo == NULL) {
nvgpu_warn(g, "cde: buffer not available");
return -ENOSYS;
}
@@ -990,6 +994,7 @@ __releases(&l->cde_app->mutex)
u32 flags;
int err, i;
const s16 compbits_kind = 0;
u32 submit_op;
gk20a_dbg(gpu_dbg_cde, "compbits_byte_offset=%llu scatterbuffer_byte_offset=%llu",
compbits_byte_offset, scatterbuffer_byte_offset);
@@ -1162,15 +1167,29 @@ __releases(&l->cde_app->mutex)
/* gk20a_cde_execute_buffer() will grab a power reference of it's own */
gk20a_idle(g);
/* execute the conversion buffer, combined with init first if it's the
* first time */
err = gk20a_cde_execute_buffer(cde_ctx,
cde_ctx->init_cmd_executed
? TYPE_BUF_COMMAND_CONVERT
: TYPE_BUF_COMMAND_INIT,
if (comptags.lines == 0) {
/*
* Nothing to do on the buffer, but do a null kickoff for
* managing the pre and post fences.
*/
submit_op = TYPE_BUF_COMMAND_NOOP;
} else if (!cde_ctx->init_cmd_executed) {
/*
* First time, so include the init pushbuf too in addition to
* the conversion code.
*/
submit_op = TYPE_BUF_COMMAND_INIT;
} else {
/*
* The usual condition: execute just the conversion.
*/
submit_op = TYPE_BUF_COMMAND_CONVERT;
}
err = gk20a_cde_execute_buffer(cde_ctx, submit_op,
fence, flags, fence_out);
cde_ctx->init_cmd_executed = true;
if (comptags.lines != 0 && !err)
cde_ctx->init_cmd_executed = true;
/* unmap the buffers - channel holds references to them now */
nvgpu_vm_unmap(cde_ctx->vm, map_vaddr, NULL);