diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-13 17:03:02 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-13 17:03:01 -0800 |
commit | bdf70d6dd40ea3ec69e87f31fe3baa617ef25b92 (patch) | |
tree | b3a4a92794dcaad0edab9c8a1596bb82823360e0 | |
parent | 96698897d2ba218abb92f7591c815f954994fae9 (diff) | |
parent | 80818060880d98d26c2833a44d4948c3948e6845 (diff) |
Merge "mm: camera: isp: send PD stats buffer earlier"
4 files changed, 57 insertions, 12 deletions
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h index 4b881f4fd7b6..39688df93474 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -451,7 +451,7 @@ struct msm_vfe_axi_stream { uint32_t runtime_num_burst_capture; uint32_t runtime_output_format; - enum msm_stream_memory_input_t memory_input; + enum msm_stream_rdi_input_type rdi_input_type; struct msm_isp_sw_framskip sw_skip; uint8_t sw_ping_pong_bit; @@ -820,6 +820,8 @@ struct vfe_device { uint32_t bus_err_ign_mask; uint32_t recovery_irq0_mask; uint32_t recovery_irq1_mask; + /* Store the buf_idx for pd stats RDI stream */ + uint8_t pd_buf_idx; }; struct vfe_parent_device { diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c index 60801ff6be0a..0db901de4562 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -921,6 +921,37 @@ void msm_isp_increment_frame_id(struct vfe_device *vfe_dev, } } +static void msm_isp_update_pd_stats_idx(struct vfe_device *vfe_dev, + enum msm_vfe_input_src frame_src) +{ + struct msm_vfe_axi_stream *pd_stream_info = NULL; + uint32_t pingpong_status = 0, pingpong_bit = 0; + struct msm_isp_buffer *done_buf = NULL; + int vfe_idx = -1; + + if (frame_src < VFE_RAW_0 || frame_src > VFE_RAW_2) + return; + + pd_stream_info = msm_isp_get_stream_common_data(vfe_dev, + RDI_INTF_0 + frame_src - VFE_RAW_0); + + if (pd_stream_info && (pd_stream_info->state == ACTIVE) && + (pd_stream_info->rdi_input_type == + MSM_CAMERA_RDI_PDAF)) { + vfe_idx = msm_isp_get_vfe_idx_for_stream( + vfe_dev, pd_stream_info); + pingpong_status = vfe_dev->hw_info->vfe_ops.axi_ops. + get_pingpong_status(vfe_dev); + pingpong_bit = ((pingpong_status >> + pd_stream_info->wm[vfe_idx][0]) & 0x1); + done_buf = pd_stream_info->buf[pingpong_bit]; + if (done_buf) + vfe_dev->pd_buf_idx = done_buf->buf_idx; + else + vfe_dev->pd_buf_idx = 0xF; + } +} + void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type, enum msm_vfe_input_src frame_src, struct msm_isp_timestamp *ts) { @@ -955,9 +986,8 @@ void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type, vfe_dev->isp_raw2_debug++; } - ISP_DBG("%s: vfe %d frame_src %d frame id: %u\n", __func__, - vfe_dev->pdev->id, frame_src, - vfe_dev->axi_data.src_info[frame_src].frame_id); + ISP_DBG("%s: vfe %d frame_src %d\n", __func__, + vfe_dev->pdev->id, frame_src); /* * Cannot support dual_cam and framedrop same time in union. @@ -1002,6 +1032,12 @@ void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type, if (frame_src == VFE_PIX_0) msm_isp_check_for_output_error(vfe_dev, ts, &event_data.u.sof_info); + /* + * Get and store the buf idx for PD stats + * this is to send the PD stats buffer address + * in BF stats done. + */ + msm_isp_update_pd_stats_idx(vfe_dev, frame_src); break; default: @@ -1174,7 +1210,7 @@ int msm_isp_request_axi_stream(struct vfe_device *vfe_dev, void *arg) return rc; } - stream_info->memory_input = stream_cfg_cmd->memory_input; + stream_info->rdi_input_type = stream_cfg_cmd->rdi_input_type; vfe_dev->reg_update_requested &= ~(BIT(SRC_TO_INTF(stream_info->stream_src))); diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c index 72703c9590ed..f40af6e95272 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -224,6 +224,11 @@ static int32_t msm_isp_stats_buf_divert(struct vfe_device *vfe_dev, stats_event->stats_buf_idxs [stream_info->stats_type] = done_buf->buf_idx; + + stats_event->pd_stats_idx = 0xF; + if (stream_info->stats_type == MSM_ISP_STATS_BF) + stats_event->pd_stats_idx = vfe_dev->pd_buf_idx; + if (comp_stats_type_mask == NULL) { stats_event->stats_mask = 1 << stream_info->stats_type; diff --git a/include/uapi/media/msmb_isp.h b/include/uapi/media/msmb_isp.h index 44d75aa107d9..fac254c4361b 100644 --- a/include/uapi/media/msmb_isp.h +++ b/include/uapi/media/msmb_isp.h @@ -293,9 +293,10 @@ struct msm_vfe_axi_plane_cfg { uint8_t rdi_cid;/*CID 1-16*/ }; -enum msm_stream_memory_input_t { - MEMORY_INPUT_DISABLED, - MEMORY_INPUT_ENABLED +enum msm_stream_rdi_input_type { + MSM_CAMERA_RDI_MIN, + MSM_CAMERA_RDI_PDAF, + MSM_CAMERA_RDI_MAX, }; struct msm_vfe_axi_stream_request_cmd { @@ -318,7 +319,7 @@ struct msm_vfe_axi_stream_request_cmd { uint32_t controllable_output; uint32_t burst_len; /* Flag indicating memory input stream */ - enum msm_stream_memory_input_t memory_input; + enum msm_stream_rdi_input_type rdi_input_type; }; struct msm_vfe_axi_stream_release_cmd { @@ -726,6 +727,7 @@ struct msm_isp_fetch_eng_event { struct msm_isp_stats_event { uint32_t stats_mask; /* 4 bytes */ uint8_t stats_buf_idxs[MSM_ISP_STATS_MAX]; /* 11 bytes */ + uint8_t pd_stats_idx; }; struct msm_isp_stream_ack { |