Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c349eeb authored by Maheshwar Ajja's avatar Maheshwar Ajja Committed by Stephen Boyd
Browse files

vidc:vdec: Clean extradata portion and invalidate whole buffer



This commit will ensure to clean the extradata portion in
output buffer changed by the CPU before sending the buffer
to Video hardware and invalidate the output buffer changed
by Video hardware before CPU access the buffer.

Change-Id: I05ea24fb381a164f6cfd520bd9071a94349ed2df
CRs-fixed: 366446
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent 19eb46aa
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -168,6 +168,28 @@ u32 ddl_decoder_dpb_transact(struct ddl_decoder_data *decoder,
			} else if (operation == DDL_DPB_OP_MARK_FREE) {
				dpb_mask->client_mask |= (0x1 << loopc);
				*found_frame = *in_out_frame;
				if ((decoder->meta_data_enable_flag) &&
				    (in_out_frame->vcd_frm.buff_ion_handle)) {
					struct ddl_context *ddl_context =
						ddl_get_context();
					unsigned long *vaddr =
						(unsigned long *)((u32)
						in_out_frame->vcd_frm.virtual +
						decoder->meta_data_offset);
					DDL_MSG_LOW("%s: Cache clean: vaddr"\
						" (%p), offset %u, size %u",
						__func__,
						in_out_frame->vcd_frm.virtual,
						decoder->meta_data_offset,
						decoder->suffix);
					msm_ion_do_cache_op(
						ddl_context->video_ion_client,
						in_out_frame->vcd_frm.\
						buff_ion_handle,
						vaddr,
						(unsigned long)decoder->suffix,
						ION_IOC_CLEAN_CACHES);
				}
			}
		} else {
			in_out_frame->vcd_frm.physical = NULL;
+6 −1
Original line number Diff line number Diff line
@@ -348,10 +348,15 @@ static void vid_dec_output_frame_done(struct video_client_ctx *client_ctx,
				pmem_fd, kernel_vaddr, buffer_index,
				&buff_handle);
		if (ion_flag == CACHED && buff_handle) {
			DBG("%s: Cache invalidate: vaddr (%p), "\
				"size %u\n", __func__,
				(void *)kernel_vaddr,
				vcd_frame_data->alloc_len);
			msm_ion_do_cache_op(client_ctx->user_ion_client,
					buff_handle,
					(unsigned long *) kernel_vaddr,
					(unsigned long)vcd_frame_data->data_len,
					(unsigned long)vcd_frame_data->\
					alloc_len,
					ION_IOC_INV_CACHES);
		}
	}