diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/cde.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/cde.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/cde.c b/drivers/gpu/nvgpu/common/linux/cde.c index c4f678b6..b48c498d 100644 --- a/drivers/gpu/nvgpu/common/linux/cde.c +++ b/drivers/gpu/nvgpu/common/linux/cde.c | |||
@@ -759,12 +759,16 @@ static int gk20a_cde_execute_buffer(struct gk20a_cde_ctx *cde_ctx, | |||
759 | } else if (op == TYPE_BUF_COMMAND_CONVERT) { | 759 | } else if (op == TYPE_BUF_COMMAND_CONVERT) { |
760 | gpfifo = cde_ctx->convert_cmd; | 760 | gpfifo = cde_ctx->convert_cmd; |
761 | num_entries = cde_ctx->convert_cmd_num_entries; | 761 | num_entries = cde_ctx->convert_cmd_num_entries; |
762 | } else if (op == TYPE_BUF_COMMAND_NOOP) { | ||
763 | /* Any non-null gpfifo will suffice with 0 num_entries */ | ||
764 | gpfifo = cde_ctx->init_convert_cmd; | ||
765 | num_entries = 0; | ||
762 | } else { | 766 | } else { |
763 | nvgpu_warn(g, "cde: unknown buffer"); | 767 | nvgpu_warn(g, "cde: unknown buffer"); |
764 | return -EINVAL; | 768 | return -EINVAL; |
765 | } | 769 | } |
766 | 770 | ||
767 | if (gpfifo == NULL || num_entries == 0) { | 771 | if (gpfifo == NULL) { |
768 | nvgpu_warn(g, "cde: buffer not available"); | 772 | nvgpu_warn(g, "cde: buffer not available"); |
769 | return -ENOSYS; | 773 | return -ENOSYS; |
770 | } | 774 | } |
@@ -990,6 +994,7 @@ __releases(&l->cde_app->mutex) | |||
990 | u32 flags; | 994 | u32 flags; |
991 | int err, i; | 995 | int err, i; |
992 | const s16 compbits_kind = 0; | 996 | const s16 compbits_kind = 0; |
997 | u32 submit_op; | ||
993 | 998 | ||
994 | gk20a_dbg(gpu_dbg_cde, "compbits_byte_offset=%llu scatterbuffer_byte_offset=%llu", | 999 | gk20a_dbg(gpu_dbg_cde, "compbits_byte_offset=%llu scatterbuffer_byte_offset=%llu", |
995 | compbits_byte_offset, scatterbuffer_byte_offset); | 1000 | compbits_byte_offset, scatterbuffer_byte_offset); |
@@ -1162,15 +1167,29 @@ __releases(&l->cde_app->mutex) | |||
1162 | /* gk20a_cde_execute_buffer() will grab a power reference of it's own */ | 1167 | /* gk20a_cde_execute_buffer() will grab a power reference of it's own */ |
1163 | gk20a_idle(g); | 1168 | gk20a_idle(g); |
1164 | 1169 | ||
1165 | /* execute the conversion buffer, combined with init first if it's the | 1170 | if (comptags.lines == 0) { |
1166 | * first time */ | 1171 | /* |
1167 | err = gk20a_cde_execute_buffer(cde_ctx, | 1172 | * Nothing to do on the buffer, but do a null kickoff for |
1168 | cde_ctx->init_cmd_executed | 1173 | * managing the pre and post fences. |
1169 | ? TYPE_BUF_COMMAND_CONVERT | 1174 | */ |
1170 | : TYPE_BUF_COMMAND_INIT, | 1175 | submit_op = TYPE_BUF_COMMAND_NOOP; |
1176 | } else if (!cde_ctx->init_cmd_executed) { | ||
1177 | /* | ||
1178 | * First time, so include the init pushbuf too in addition to | ||
1179 | * the conversion code. | ||
1180 | */ | ||
1181 | submit_op = TYPE_BUF_COMMAND_INIT; | ||
1182 | } else { | ||
1183 | /* | ||
1184 | * The usual condition: execute just the conversion. | ||
1185 | */ | ||
1186 | submit_op = TYPE_BUF_COMMAND_CONVERT; | ||
1187 | } | ||
1188 | err = gk20a_cde_execute_buffer(cde_ctx, submit_op, | ||
1171 | fence, flags, fence_out); | 1189 | fence, flags, fence_out); |
1172 | 1190 | ||
1173 | cde_ctx->init_cmd_executed = true; | 1191 | if (comptags.lines != 0 && !err) |
1192 | cde_ctx->init_cmd_executed = true; | ||
1174 | 1193 | ||
1175 | /* unmap the buffers - channel holds references to them now */ | 1194 | /* unmap the buffers - channel holds references to them now */ |
1176 | nvgpu_vm_unmap(cde_ctx->vm, map_vaddr, NULL); | 1195 | nvgpu_vm_unmap(cde_ctx->vm, map_vaddr, NULL); |