Loading drivers/cam_fd/fd_hw_mgr/cam_fd_hw_mgr.c +2 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/module.h> Loading Loading @@ -54,7 +55,7 @@ static int cam_fd_mgr_util_packet_validate(struct cam_packet *packet, } /* All buffers must come through io config, do not support patching */ if (packet->num_patches || !packet->num_io_configs) { if (packet->num_patches || !packet->num_io_configs || !packet->num_cmd_buf) { CAM_ERR(CAM_FD, "wrong number of cmd/patch info: %u %u", packet->num_cmd_buf, packet->num_patches); return -EINVAL; Loading drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c +2 −2 Original line number Diff line number Diff line Loading @@ -4189,13 +4189,13 @@ static int cam_icp_mgr_pkt_validation(struct cam_packet *packet) return -EINVAL; } if (packet->num_io_configs > IPE_IO_IMAGES_MAX) { if (!packet->num_io_configs || packet->num_io_configs > IPE_IO_IMAGES_MAX) { CAM_ERR(CAM_ICP, "Invalid number of io configs: %d %d", IPE_IO_IMAGES_MAX, packet->num_io_configs); return -EINVAL; } if (packet->num_cmd_buf > CAM_ICP_CTX_MAX_CMD_BUFFERS) { if (!packet->num_cmd_buf || packet->num_cmd_buf > CAM_ICP_CTX_MAX_CMD_BUFFERS) { CAM_ERR(CAM_ICP, "Invalid number of cmd buffers: %d %d", CAM_ICP_CTX_MAX_CMD_BUFFERS, packet->num_cmd_buf); return -EINVAL; Loading drivers/cam_isp/cam_isp_context.c +60 −1 Original line number Diff line number Diff line Loading @@ -4305,6 +4305,65 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state( return 0; } static int __cam_isp_ctx_rdi_only_reg_upd_in_applied_state( struct cam_isp_context *ctx_isp, void *evt_data) { struct cam_ctx_request *req = NULL; struct cam_context *ctx = ctx_isp->base; struct cam_isp_ctx_req *req_isp; uint64_t request_id = 0; if (list_empty(&ctx->wait_req_list)) { CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request"); goto end; } ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_EPOCH; req = list_first_entry(&ctx->wait_req_list, struct cam_ctx_request, list); list_del_init(&req->list); req_isp = (struct cam_isp_ctx_req *) req->req_priv; request_id = (req_isp->hw_update_data.packet_opcode_type == CAM_ISP_PACKET_INIT_DEV) ? 0 : req->request_id; if (req_isp->num_fence_map_out != 0) { list_add_tail(&req->list, &ctx->active_req_list); ctx_isp->active_req_cnt++; request_id = req->request_id; CAM_DBG(CAM_REQ, "move request %lld to active list(cnt = %d), ctx %u", req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); __cam_isp_ctx_update_event_record(ctx_isp, CAM_ISP_CTX_EVENT_RUP, req); } else { /* no io config, so the request is completed. */ list_add_tail(&req->list, &ctx->free_req_list); CAM_DBG(CAM_ISP, "move active request %lld to free list(cnt = %d), ctx %u", req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); } CAM_DBG(CAM_ISP, "next Substate[%s]", __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated)); __cam_isp_ctx_update_event_record(ctx_isp, CAM_ISP_CTX_EVENT_RUP, req); return 0; end: __cam_isp_ctx_update_event_record(ctx_isp, CAM_ISP_CTX_EVENT_RUP, NULL); /* * There is no request in the pending list, move the sub state machine * to SOF sub state */ ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; return 0; } static struct cam_isp_ctx_irq_ops cam_isp_ctx_rdi_only_activated_state_machine_irq [CAM_ISP_CTX_ACTIVATED_MAX] = { Loading @@ -4324,7 +4383,7 @@ static struct cam_isp_ctx_irq_ops .irq_ops = { __cam_isp_ctx_handle_error, __cam_isp_ctx_rdi_only_sof_in_applied_state, NULL, __cam_isp_ctx_rdi_only_reg_upd_in_applied_state, NULL, __cam_isp_ctx_notify_eof_in_activated_state, __cam_isp_ctx_buf_done_in_applied, Loading drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c +4 −3 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/uaccess.h> Loading Loading @@ -769,8 +769,9 @@ static int cam_jpeg_mgr_prepare_hw_update(void *hw_mgr_priv, return rc; } if ((packet->num_cmd_buf > 5) || !packet->num_patches || !packet->num_io_configs || if (!packet->num_cmd_buf || (packet->num_cmd_buf > 5) || !packet->num_patches || !packet->num_io_configs || (packet->num_io_configs > CAM_JPEG_IMAGE_MAX)) { CAM_ERR(CAM_JPEG, "wrong number of cmd/patch/io_configs info: %u %u %u", Loading drivers/cam_lrme/lrme_hw_mgr/cam_lrme_hw_mgr.c +6 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/module.h> Loading Loading @@ -113,6 +114,11 @@ static int cam_lrme_mgr_util_packet_validate(struct cam_packet *packet, return -EINVAL; } if (!packet->num_cmd_buf) { CAM_ERR(CAM_LRME, "no cmd bufs"); return -EINVAL; } cmd_desc = (struct cam_cmd_buf_desc *)((uint8_t *)&packet->payload + packet->cmd_buf_offset); Loading Loading
drivers/cam_fd/fd_hw_mgr/cam_fd_hw_mgr.c +2 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/module.h> Loading Loading @@ -54,7 +55,7 @@ static int cam_fd_mgr_util_packet_validate(struct cam_packet *packet, } /* All buffers must come through io config, do not support patching */ if (packet->num_patches || !packet->num_io_configs) { if (packet->num_patches || !packet->num_io_configs || !packet->num_cmd_buf) { CAM_ERR(CAM_FD, "wrong number of cmd/patch info: %u %u", packet->num_cmd_buf, packet->num_patches); return -EINVAL; Loading
drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c +2 −2 Original line number Diff line number Diff line Loading @@ -4189,13 +4189,13 @@ static int cam_icp_mgr_pkt_validation(struct cam_packet *packet) return -EINVAL; } if (packet->num_io_configs > IPE_IO_IMAGES_MAX) { if (!packet->num_io_configs || packet->num_io_configs > IPE_IO_IMAGES_MAX) { CAM_ERR(CAM_ICP, "Invalid number of io configs: %d %d", IPE_IO_IMAGES_MAX, packet->num_io_configs); return -EINVAL; } if (packet->num_cmd_buf > CAM_ICP_CTX_MAX_CMD_BUFFERS) { if (!packet->num_cmd_buf || packet->num_cmd_buf > CAM_ICP_CTX_MAX_CMD_BUFFERS) { CAM_ERR(CAM_ICP, "Invalid number of cmd buffers: %d %d", CAM_ICP_CTX_MAX_CMD_BUFFERS, packet->num_cmd_buf); return -EINVAL; Loading
drivers/cam_isp/cam_isp_context.c +60 −1 Original line number Diff line number Diff line Loading @@ -4305,6 +4305,65 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state( return 0; } static int __cam_isp_ctx_rdi_only_reg_upd_in_applied_state( struct cam_isp_context *ctx_isp, void *evt_data) { struct cam_ctx_request *req = NULL; struct cam_context *ctx = ctx_isp->base; struct cam_isp_ctx_req *req_isp; uint64_t request_id = 0; if (list_empty(&ctx->wait_req_list)) { CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request"); goto end; } ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_EPOCH; req = list_first_entry(&ctx->wait_req_list, struct cam_ctx_request, list); list_del_init(&req->list); req_isp = (struct cam_isp_ctx_req *) req->req_priv; request_id = (req_isp->hw_update_data.packet_opcode_type == CAM_ISP_PACKET_INIT_DEV) ? 0 : req->request_id; if (req_isp->num_fence_map_out != 0) { list_add_tail(&req->list, &ctx->active_req_list); ctx_isp->active_req_cnt++; request_id = req->request_id; CAM_DBG(CAM_REQ, "move request %lld to active list(cnt = %d), ctx %u", req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); __cam_isp_ctx_update_event_record(ctx_isp, CAM_ISP_CTX_EVENT_RUP, req); } else { /* no io config, so the request is completed. */ list_add_tail(&req->list, &ctx->free_req_list); CAM_DBG(CAM_ISP, "move active request %lld to free list(cnt = %d), ctx %u", req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); } CAM_DBG(CAM_ISP, "next Substate[%s]", __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated)); __cam_isp_ctx_update_event_record(ctx_isp, CAM_ISP_CTX_EVENT_RUP, req); return 0; end: __cam_isp_ctx_update_event_record(ctx_isp, CAM_ISP_CTX_EVENT_RUP, NULL); /* * There is no request in the pending list, move the sub state machine * to SOF sub state */ ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; return 0; } static struct cam_isp_ctx_irq_ops cam_isp_ctx_rdi_only_activated_state_machine_irq [CAM_ISP_CTX_ACTIVATED_MAX] = { Loading @@ -4324,7 +4383,7 @@ static struct cam_isp_ctx_irq_ops .irq_ops = { __cam_isp_ctx_handle_error, __cam_isp_ctx_rdi_only_sof_in_applied_state, NULL, __cam_isp_ctx_rdi_only_reg_upd_in_applied_state, NULL, __cam_isp_ctx_notify_eof_in_activated_state, __cam_isp_ctx_buf_done_in_applied, Loading
drivers/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c +4 −3 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/uaccess.h> Loading Loading @@ -769,8 +769,9 @@ static int cam_jpeg_mgr_prepare_hw_update(void *hw_mgr_priv, return rc; } if ((packet->num_cmd_buf > 5) || !packet->num_patches || !packet->num_io_configs || if (!packet->num_cmd_buf || (packet->num_cmd_buf > 5) || !packet->num_patches || !packet->num_io_configs || (packet->num_io_configs > CAM_JPEG_IMAGE_MAX)) { CAM_ERR(CAM_JPEG, "wrong number of cmd/patch/io_configs info: %u %u %u", Loading
drivers/cam_lrme/lrme_hw_mgr/cam_lrme_hw_mgr.c +6 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/module.h> Loading Loading @@ -113,6 +114,11 @@ static int cam_lrme_mgr_util_packet_validate(struct cam_packet *packet, return -EINVAL; } if (!packet->num_cmd_buf) { CAM_ERR(CAM_LRME, "no cmd bufs"); return -EINVAL; } cmd_desc = (struct cam_cmd_buf_desc *)((uint8_t *)&packet->payload + packet->cmd_buf_offset); Loading