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

Commit 874d6dfc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Add trace events"

parents 475f4d98 41caebbf
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -667,6 +667,12 @@ int create_pkt_cmd_session_etb_decoder(
	pkt->filled_len = input_frame->filled_len;
	pkt->input_tag = input_frame->clnt_data;
	pkt->packet_buffer = (u32)input_frame->device_addr;

	trace_msm_v4l2_vidc_buffer_event_start("ETB",
		input_frame->device_addr, input_frame->timestamp,
		input_frame->alloc_len, input_frame->filled_len,
		input_frame->offset);

	if (!pkt->packet_buffer)
		rc = -EINVAL;
	return rc;
@@ -696,6 +702,12 @@ int create_pkt_cmd_session_etb_encoder(
	pkt->input_tag = input_frame->clnt_data;
	pkt->packet_buffer = (u32)input_frame->device_addr;
	pkt->extra_data_buffer = (u32)input_frame->extradata_addr;

	trace_msm_v4l2_vidc_buffer_event_start("ETB",
		input_frame->device_addr, input_frame->timestamp,
		input_frame->alloc_len, input_frame->filled_len,
		input_frame->offset);

	if (!pkt->packet_buffer)
		rc = -EINVAL;
	return rc;
@@ -727,6 +739,11 @@ int create_pkt_cmd_session_ftb(struct hfi_cmd_session_fill_buffer_packet *pkt,
	pkt->filled_len = output_frame->filled_len;
	pkt->offset = output_frame->offset;
	pkt->rgData[0] = output_frame->extradata_size;

	trace_msm_v4l2_vidc_buffer_event_start("FTB",
		output_frame->device_addr, output_frame->timestamp,
		output_frame->alloc_len, output_frame->filled_len,
		output_frame->offset);
	dprintk(VIDC_DBG, "### Q OUTPUT BUFFER ###: %d, %d, %d\n",
			pkt->alloc_len, pkt->filled_len, pkt->offset);

+11 −0
Original line number Diff line number Diff line
@@ -984,6 +984,10 @@ static void hfi_process_session_etb_done(msm_vidc_callback callback,
		(ion_phys_addr_t)pkt->extra_data_buffer;
	data_done.input_done.status =
		hfi_map_err_status(pkt->error_type);

	trace_msm_v4l2_vidc_buffer_event_end("ETB",
		(u32)pkt->packet_buffer, -1, -1,
		 pkt->filled_len, pkt->offset);
	callback(SESSION_ETB_DONE, &data_done);
}

@@ -1083,6 +1087,13 @@ static void hfi_process_session_ftb_done(msm_vidc_callback callback,
		else if (pkt->stream_id == 1)
			data_done.output_done.buffer_type = HAL_BUFFER_OUTPUT2;
		}
	trace_msm_v4l2_vidc_buffer_event_end("FTB",
		(u32)data_done.output_done.packet_buffer1,
		(((u64)data_done.output_done.timestamp_hi) << 32)
		+ ((u64)data_done.output_done.timestamp_lo),
		data_done.output_done.alloc_len1,
		data_done.output_done.filled_len1,
		data_done.output_done.offset1);
	callback(SESSION_FTB_DONE, &data_done);
}

+20 −1
Original line number Diff line number Diff line
@@ -90,8 +90,12 @@ static int get_device_address(struct smem_client *smem_client,
		dprintk(VIDC_DBG,
				"Calling ion_map_iommu - domain: %d, partition: %d\n",
				domain, partition);
		trace_msm_smem_buffer_iommu_op_start("MAP", domain, partition,
			align, *iova, *buffer_size);
		rc = ion_map_iommu(clnt, hndl, domain, partition, align,
				0, iova, buffer_size, 0, 0);
		trace_msm_smem_buffer_iommu_op_end("MAP", domain, partition,
			align, *iova, *buffer_size);
	} else {
		dprintk(VIDC_DBG, "Using physical memory address\n");
		rc = ion_phys(clnt, hndl, iova, (size_t *)buffer_size);
@@ -129,7 +133,12 @@ static void put_device_address(struct smem_client *smem_client,
		dprintk(VIDC_DBG,
				"Calling ion_unmap_iommu - domain: %d, parition: %d\n",
				domain_num, partition_num);

		trace_msm_smem_buffer_iommu_op_start("UNMAP", domain_num,
				partition_num, 0, 0, 0);
		ion_unmap_iommu(clnt, hndl, domain_num, partition_num);
		trace_msm_smem_buffer_iommu_op_end("UNMAP", domain_num,
				partition_num, 0, 0, 0);
	}
	if (flags & SMEM_SECURE) {
		if (msm_ion_unsecure_buffer(clnt, hndl))
@@ -221,6 +230,8 @@ static int alloc_ion_mem(struct smem_client *client, size_t size, u32 align,
	if (flags & SMEM_SECURE)
		heap_mask = ION_HEAP(ION_CP_MM_HEAP_ID);

	trace_msm_smem_buffer_ion_op_start("ALLOC", (u32)buffer_type,
		heap_mask, size, align, flags, map_kernel);
	hndl = ion_alloc(client->clnt, size, align, heap_mask, flags);
	if (IS_ERR_OR_NULL(hndl)) {
		dprintk(VIDC_ERR,
@@ -229,6 +240,8 @@ static int alloc_ion_mem(struct smem_client *client, size_t size, u32 align,
		rc = -ENOMEM;
		goto fail_shared_mem_alloc;
	}
	trace_msm_smem_buffer_ion_op_end("ALLOC", (u32)buffer_type,
		heap_mask, size, align, flags, map_kernel);
	mem->mem_type = client->mem_type;
	mem->smem_priv = hndl;
	mem->flags = flags;
@@ -293,8 +306,14 @@ static void free_ion_mem(struct smem_client *client, struct msm_smem *mem)
			mem->smem_priv, domain, partition, mem->flags);
	if (mem->kvaddr)
		ion_unmap_kernel(client->clnt, mem->smem_priv);
	if (mem->smem_priv)
	if (mem->smem_priv) {
		trace_msm_smem_buffer_ion_op_start("FREE",
				(u32)mem->buffer_type, -1, mem->size, -1,
				mem->flags, -1);
		ion_free(client->clnt, mem->smem_priv);
		trace_msm_smem_buffer_ion_op_end("FREE", (u32)mem->buffer_type,
			-1, mem->size, -1, mem->flags, -1);
	}
}

static void *ion_new_client(void)
+5 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ static int msm_v4l2_open(struct file *filp)
	struct msm_vidc_core *core = video_drvdata(filp);
	struct msm_vidc_inst *vidc_inst;

	trace_msm_v4l2_vidc_open_start("msm_v4l2_open start");
	vidc_inst = msm_vidc_open(core->id, vid_dev->type);
	if (!vidc_inst) {
		dprintk(VIDC_ERR,
@@ -59,6 +60,7 @@ static int msm_v4l2_open(struct file *filp)
	}
	clear_bit(V4L2_FL_USES_V4L2_FH, &vdev->flags);
	filp->private_data = &(vidc_inst->event_handler);
	trace_msm_v4l2_vidc_open_end("msm_v4l2_open end");
	return 0;
}

@@ -66,6 +68,8 @@ static int msm_v4l2_close(struct file *filp)
{
	int rc = 0;
	struct msm_vidc_inst *vidc_inst;

	trace_msm_v4l2_vidc_close_start("msm_v4l2_close start");
	vidc_inst = get_vidc_inst(filp, NULL);
	rc = msm_vidc_release_buffers(vidc_inst,
			V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
@@ -74,6 +78,7 @@ static int msm_v4l2_close(struct file *filp)
			"Failed in %s for release output buffers\n", __func__);

	rc = msm_vidc_close(vidc_inst);
	trace_msm_v4l2_vidc_close_end("msm_v4l2_close end");
	return rc;
}

+3 −0
Original line number Diff line number Diff line
@@ -2960,6 +2960,9 @@ exit:
		dprintk(VIDC_ERR,
				"Failed to move from state: %d to %d\n",
				inst->state, state);
	else
		trace_msm_vidc_common_state_change((void *)inst,
				inst->state, state);
	return rc;
}

Loading