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

Commit 358fc0a1 authored by Prakasha Nayak's avatar Prakasha Nayak
Browse files

msm: camera: util: Enabling logs to improve debugging



Enable logs to improve debugging. This will print
desired information in the case of an error.

Change-Id: Ia0dcbdbf5b1babf1f2099ca7e39952f538c4aa27
Signed-off-by: default avatarPrakasha Nayak <pnayak@codeaurora.org>
parent 59f5a96c
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ int cam_isp_add_io_buffers(
		CAM_DBG(CAM_ISP, "======= io config idx %d ============", i);
		CAM_DBG(CAM_REQ,
			"i %d req_id %llu resource_type:%d fence:%d direction %d",
			i, prepare->packet->header.request_id,
			i, req_id,
			io_cfg[i].resource_type, io_cfg[i].fence,
			io_cfg[i].direction);
		CAM_DBG(CAM_ISP, "format: %d", io_cfg[i].format);
@@ -624,8 +624,16 @@ int cam_isp_add_io_buffers(
					mmu_hdl, &io_addr[plane_id], &size);
				if (rc) {
					CAM_ERR(CAM_ISP,
						"no io addr for plane%d",
						plane_id);
						"no io addr for plane%d Bufhdl:%d, Size =%d",
						plane_id,
						io_cfg[i].mem_handle[plane_id],
						(int)size);
					CAM_ERR(CAM_ISP,
						"Port i %d Reqid %llu res_type:%d fence:%d dir %d",
						i, req_id,
						io_cfg[i].resource_type,
						io_cfg[i].fence,
						io_cfg[i].direction);
					rc = -ENOMEM;
					return rc;
				}
+46 −6
Original line number Diff line number Diff line
@@ -182,11 +182,15 @@ int cam_packet_util_process_patches(struct cam_packet *packet,
	int        i;
	int        rc = 0;
	int32_t    hdl;
	uint64_t   requestId;
	uint32_t   num_patches;

	/* process patch descriptor */
	patch_desc = (struct cam_patch_desc *)
			((uint32_t *) &packet->payload +
			packet->patch_offset/4);
	requestId = packet->header.request_id;
	num_patches = packet->num_patches;
	CAM_DBG(CAM_UTIL, "packet = %pK patch_desc = %pK size = %lu",
			(void *)packet, (void *)patch_desc,
			sizeof(struct cam_patch_desc));
@@ -197,7 +201,16 @@ int cam_packet_util_process_patches(struct cam_packet *packet,
		rc = cam_mem_get_io_buf(patch_desc[i].src_buf_hdl,
			hdl, &iova_addr, &src_buf_size);
		if (rc < 0) {
			CAM_ERR(CAM_UTIL, "unable to get src buf address");
			CAM_ERR(CAM_UTIL,
				"unable to get src buf address ReqId: %llu, num_patches = %d",
				requestId, num_patches);
			CAM_ERR(CAM_UTIL,
				"i = %d patch info = %x %x %x %x src_bfsz:0x%x",
				i, patch_desc[i].dst_buf_hdl,
				patch_desc[i].dst_offset,
				patch_desc[i].src_buf_hdl,
				patch_desc[i].src_offset,
				(uint32_t)src_buf_size);
			return rc;
		}
		src_buf_iova_addr = (uint32_t *)iova_addr;
@@ -206,18 +219,37 @@ int cam_packet_util_process_patches(struct cam_packet *packet,
		rc = cam_mem_get_cpu_buf(patch_desc[i].dst_buf_hdl,
			&cpu_addr, &dst_buf_len);
		if (rc < 0 || !cpu_addr || (dst_buf_len == 0)) {
			CAM_ERR(CAM_UTIL, "unable to get dst buf address");
			CAM_ERR(CAM_UTIL,
				"unable to get dst buf address ReqId: %llu, num_patches = %d",
				requestId, num_patches);
			CAM_ERR(CAM_UTIL,
				"i = %d patch info = %x %x %x %x dst_bfsz:0x%x",
				i, patch_desc[i].dst_buf_hdl,
				patch_desc[i].dst_offset,
				patch_desc[i].src_buf_hdl,
				patch_desc[i].src_offset,
				(uint32_t)dst_buf_len);
			return rc;
		}
		dst_cpu_addr = (uint32_t *)cpu_addr;

		CAM_DBG(CAM_UTIL, "i = %d patch info = %x %x %x %x", i,
			patch_desc[i].dst_buf_hdl, patch_desc[i].dst_offset,
		CAM_DBG(CAM_UTIL,
			"ReqId: %llu, i = %d patch info = %x %x %x %x",
			requestId, i, patch_desc[i].dst_buf_hdl,
			patch_desc[i].dst_offset,
			patch_desc[i].src_buf_hdl, patch_desc[i].src_offset);

		if ((size_t)patch_desc[i].src_offset >= src_buf_size) {
			CAM_ERR(CAM_UTIL,
				"Invalid src buf patch offset");
				"Invalid src buf patch offset ReqId: %llu, num_patches = %d",
				requestId, num_patches);
			CAM_ERR(CAM_UTIL,
				"i = %d patch info = %x %x %x %x src_bfsz:0x%x",
				i, patch_desc[i].dst_buf_hdl,
				patch_desc[i].dst_offset,
				patch_desc[i].src_buf_hdl,
				patch_desc[i].src_offset,
				(uint32_t)src_buf_size);
			return -EINVAL;
		}

@@ -225,7 +257,15 @@ int cam_packet_util_process_patches(struct cam_packet *packet,
			((dst_buf_len - sizeof(void *)) <
			(size_t)patch_desc[i].dst_offset)) {
			CAM_ERR(CAM_UTIL,
				"Invalid dst buf patch offset");
				"Invalid dst buf patch offset ReqId: %llu, num_patches = %d",
				requestId, num_patches);
			CAM_ERR(CAM_UTIL,
				"i = %d patch info = %x %x %x %x dst_bfsz:0x%x",
				i, patch_desc[i].dst_buf_hdl,
				patch_desc[i].dst_offset,
				patch_desc[i].src_buf_hdl,
				patch_desc[i].src_offset,
				(uint32_t)dst_buf_len);
			return -EINVAL;
		}