Skip to content

Commit

Permalink
Merge "msm: camera: util: Enabling logs to improve debugging" into de…
Browse files Browse the repository at this point in the history
…v/msm-4.14-camx
  • Loading branch information
Suresh Vankadara authored and Gerrit - the friendly Code Review server committed Jul 16, 2019
2 parents b815663 + 358fc0a commit f22ad65
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
52 changes: 46 additions & 6 deletions drivers/media/platform/msm/camera/cam_utils/cam_packet_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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;
Expand All @@ -206,26 +219,53 @@ 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;
}

if ((dst_buf_len < sizeof(void *)) ||
((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;
}

Expand Down

0 comments on commit f22ad65

Please sign in to comment.