Loading drivers/media/platform/msm/camera/cam_core/cam_context_utils.c +58 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,64 @@ int32_t cam_context_release_dev_to_hw(struct cam_context *ctx, return 0; } int32_t cam_context_config_dev_to_hw( struct cam_context *ctx, struct cam_config_dev_cmd *cmd) { int rc = 0; size_t len; struct cam_hw_stream_setttings cfg; uintptr_t packet_addr; struct cam_packet *packet; if (!ctx || !cmd) { CAM_ERR(CAM_CTXT, "Invalid input params %pK %pK", ctx, cmd); return -EINVAL; } if (!ctx->hw_mgr_intf->hw_config_stream_settings) { CAM_ERR(CAM_CTXT, "[%s][%d] HW interface is not ready", ctx->dev_name, ctx->ctx_id); rc = -EFAULT; return rc; } rc = cam_context_validate_thread(); if (rc) { CAM_ERR(CAM_CTXT, "Not executing in the right context"); return rc; } rc = cam_mem_get_cpu_buf((int32_t) cmd->packet_handle, &packet_addr, &len); if (rc) { CAM_ERR(CAM_CTXT, "[%s][%d] Can not get packet address", ctx->dev_name, ctx->ctx_id); rc = -EINVAL; return rc; } packet = (struct cam_packet *) ((uint8_t *)packet_addr + (uint32_t)cmd->offset); memset(&cfg, 0, sizeof(cfg)); cfg.packet = packet; cfg.ctxt_to_hw_map = ctx->ctxt_to_hw_map; cfg.priv = NULL; CAM_DBG(CAM_CTXT, "Processing config settings"); rc = ctx->hw_mgr_intf->hw_config_stream_settings( ctx->hw_mgr_intf->hw_mgr_priv, &cfg); if (rc) { CAM_ERR(CAM_CTXT, "[%s][%d] Config failed stream settings", ctx->dev_name, ctx->ctx_id); rc = -EFAULT; } return rc; } int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, struct cam_config_dev_cmd *cmd) { Loading drivers/media/platform/msm/camera/cam_core/cam_context_utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ int32_t cam_context_release_dev_to_hw(struct cam_context *ctx, struct cam_release_dev_cmd *cmd); int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, struct cam_config_dev_cmd *cmd); int32_t cam_context_config_dev_to_hw( struct cam_context *ctx, struct cam_config_dev_cmd *cmd); int32_t cam_context_acquire_dev_to_hw(struct cam_context *ctx, struct cam_acquire_dev_cmd *cmd); int32_t cam_context_start_dev_to_hw(struct cam_context *ctx, Loading drivers/media/platform/msm/camera/cam_core/cam_hw_mgr_intf.h +34 −16 Original line number Diff line number Diff line Loading @@ -183,6 +183,20 @@ struct cam_hw_prepare_update_args { struct cam_hw_mgr_dump_pf_data *pf_data; }; /** * struct cam_hw_stream_setttings - Payload for config stream command * * @packet: CSL packet from user mode driver * @ctxt_to_hw_map: HW context from the acquire * @priv: Private pointer of hw update * */ struct cam_hw_stream_setttings { struct cam_packet *packet; void *ctxt_to_hw_map; void *priv; }; /** * struct cam_hw_config_args - Payload for config command * Loading Loading @@ -282,14 +296,16 @@ struct cam_hw_cmd_args { * args = cam_hw_start_args * @hw_stop: Function pointer for stop hw devices * args = cam_hw_stop_args * @hw_prepare_update: Function pointer for prepare hw update for hw devices * args = cam_hw_prepare_update_args * @hw_prepare_update: Function pointer for prepare hw update for hw * devices args = cam_hw_prepare_update_args * @hw_config_stream_settings: Function pointer for configure stream for hw * devices args = cam_hw_stream_setttings * @hw_config: Function pointer for configure hw devices * args = cam_hw_config_args * @hw_read: Function pointer for read hardware registers * @hw_write: Function pointer for Write hardware registers * @hw_cmd: Function pointer for any customized commands for the * hardware manager * @hw_cmd: Function pointer for any customized commands for * the hardware manager * @hw_open: Function pointer for HW init * @hw_close: Function pointer for HW deinit * @hw_flush: Function pointer for HW flush Loading @@ -304,6 +320,8 @@ struct cam_hw_mgr_intf { int (*hw_start)(void *hw_priv, void *hw_start_args); int (*hw_stop)(void *hw_priv, void *hw_stop_args); int (*hw_prepare_update)(void *hw_priv, void *hw_prepare_update_args); int (*hw_config_stream_settings)(void *hw_priv, void *hw_stream_settings); int (*hw_config)(void *hw_priv, void *hw_config_args); int (*hw_read)(void *hw_priv, void *read_args); int (*hw_write)(void *hw_priv, void *write_args); Loading drivers/media/platform/msm/camera/cam_icp/cam_icp_context.c +24 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <linux/uaccess.h> #include <media/cam_sync.h> #include <media/cam_defs.h> #include <media/cam_icp.h> #include "cam_sync_api.h" #include "cam_node.h" #include "cam_context.h" Loading Loading @@ -123,8 +124,30 @@ static int __cam_icp_config_dev_in_ready(struct cam_context *ctx, struct cam_config_dev_cmd *cmd) { int rc; size_t len; uintptr_t packet_addr; struct cam_packet *packet; rc = cam_mem_get_cpu_buf((int32_t) cmd->packet_handle, &packet_addr, &len); if (rc) { CAM_ERR(CAM_ICP, "[%s][%d] Can not get packet address", ctx->dev_name, ctx->ctx_id); rc = -EINVAL; return rc; } packet = (struct cam_packet *) ((uint8_t *)packet_addr + (uint32_t)cmd->offset); if (((packet->header.op_code & 0xff) == CAM_ICP_OPCODE_IPE_SETTINGS) || ((packet->header.op_code & 0xff) == CAM_ICP_OPCODE_BPS_SETTINGS)) rc = cam_context_config_dev_to_hw(ctx, cmd); else rc = cam_context_prepare_dev_to_hw(ctx, cmd); if (rc) CAM_ERR(CAM_ICP, "Failed to prepare device"); Loading drivers/media/platform/msm/camera/cam_icp/fw_inc/hfi_session_defs.h +41 −0 Original line number Diff line number Diff line Loading @@ -30,10 +30,51 @@ #define HFI_IPEBPS_CMD_OPCODE_IPE_WAIT_FOR_BPS 0xb #define HFI_IPEBPS_CMD_OPCODE_IPE_WAIT_FOR_IPE 0xc #define HFI_IPEBPS_CMD_OPCODE_MEM_MAP 0xe #define HFI_IPEBPS_CMD_OPCODE_MEM_UNMAP 0xf #define HFI_IPEBPS_HANDLE_TYPE_BPS 0x1 #define HFI_IPEBPS_HANDLE_TYPE_IPE_RT 0x2 #define HFI_IPEBPS_HANDLE_TYPE_IPE_NON_RT 0x3 /** * struct mem_map_region_data * @start_addr: cmd buffer region start addr * @len : length of the region * * create mem_map_region_data */ struct mem_map_region_data { uint32_t start_addr; uint32_t len; }; /** * struct hfi_cmd_ipe_bps_map * @user_data : user arg * @mem_map_request_num: number of mappings * @mem_map_region_sets: array of all map/unmap info * * create hfi_cmd_ipe_bps_map */ struct hfi_cmd_ipe_bps_map { uint64_t user_data; uint32_t mem_map_request_num; struct mem_map_region_data mem_map_region_sets[1]; } __packed; /** * struct hfi_cmd_ipe_bps_map_ack * @rc : Async return code * @user_data: user_arg * * create hfi_cmd_ipe_bps_map_ack */ struct hfi_cmd_ipe_bps_map_ack { uint32_t rc; uint64_t user_data; }; /** * struct abort_data * @num_req_ids: Number of req ids Loading Loading
drivers/media/platform/msm/camera/cam_core/cam_context_utils.c +58 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,64 @@ int32_t cam_context_release_dev_to_hw(struct cam_context *ctx, return 0; } int32_t cam_context_config_dev_to_hw( struct cam_context *ctx, struct cam_config_dev_cmd *cmd) { int rc = 0; size_t len; struct cam_hw_stream_setttings cfg; uintptr_t packet_addr; struct cam_packet *packet; if (!ctx || !cmd) { CAM_ERR(CAM_CTXT, "Invalid input params %pK %pK", ctx, cmd); return -EINVAL; } if (!ctx->hw_mgr_intf->hw_config_stream_settings) { CAM_ERR(CAM_CTXT, "[%s][%d] HW interface is not ready", ctx->dev_name, ctx->ctx_id); rc = -EFAULT; return rc; } rc = cam_context_validate_thread(); if (rc) { CAM_ERR(CAM_CTXT, "Not executing in the right context"); return rc; } rc = cam_mem_get_cpu_buf((int32_t) cmd->packet_handle, &packet_addr, &len); if (rc) { CAM_ERR(CAM_CTXT, "[%s][%d] Can not get packet address", ctx->dev_name, ctx->ctx_id); rc = -EINVAL; return rc; } packet = (struct cam_packet *) ((uint8_t *)packet_addr + (uint32_t)cmd->offset); memset(&cfg, 0, sizeof(cfg)); cfg.packet = packet; cfg.ctxt_to_hw_map = ctx->ctxt_to_hw_map; cfg.priv = NULL; CAM_DBG(CAM_CTXT, "Processing config settings"); rc = ctx->hw_mgr_intf->hw_config_stream_settings( ctx->hw_mgr_intf->hw_mgr_priv, &cfg); if (rc) { CAM_ERR(CAM_CTXT, "[%s][%d] Config failed stream settings", ctx->dev_name, ctx->ctx_id); rc = -EFAULT; } return rc; } int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, struct cam_config_dev_cmd *cmd) { Loading
drivers/media/platform/msm/camera/cam_core/cam_context_utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ int32_t cam_context_release_dev_to_hw(struct cam_context *ctx, struct cam_release_dev_cmd *cmd); int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, struct cam_config_dev_cmd *cmd); int32_t cam_context_config_dev_to_hw( struct cam_context *ctx, struct cam_config_dev_cmd *cmd); int32_t cam_context_acquire_dev_to_hw(struct cam_context *ctx, struct cam_acquire_dev_cmd *cmd); int32_t cam_context_start_dev_to_hw(struct cam_context *ctx, Loading
drivers/media/platform/msm/camera/cam_core/cam_hw_mgr_intf.h +34 −16 Original line number Diff line number Diff line Loading @@ -183,6 +183,20 @@ struct cam_hw_prepare_update_args { struct cam_hw_mgr_dump_pf_data *pf_data; }; /** * struct cam_hw_stream_setttings - Payload for config stream command * * @packet: CSL packet from user mode driver * @ctxt_to_hw_map: HW context from the acquire * @priv: Private pointer of hw update * */ struct cam_hw_stream_setttings { struct cam_packet *packet; void *ctxt_to_hw_map; void *priv; }; /** * struct cam_hw_config_args - Payload for config command * Loading Loading @@ -282,14 +296,16 @@ struct cam_hw_cmd_args { * args = cam_hw_start_args * @hw_stop: Function pointer for stop hw devices * args = cam_hw_stop_args * @hw_prepare_update: Function pointer for prepare hw update for hw devices * args = cam_hw_prepare_update_args * @hw_prepare_update: Function pointer for prepare hw update for hw * devices args = cam_hw_prepare_update_args * @hw_config_stream_settings: Function pointer for configure stream for hw * devices args = cam_hw_stream_setttings * @hw_config: Function pointer for configure hw devices * args = cam_hw_config_args * @hw_read: Function pointer for read hardware registers * @hw_write: Function pointer for Write hardware registers * @hw_cmd: Function pointer for any customized commands for the * hardware manager * @hw_cmd: Function pointer for any customized commands for * the hardware manager * @hw_open: Function pointer for HW init * @hw_close: Function pointer for HW deinit * @hw_flush: Function pointer for HW flush Loading @@ -304,6 +320,8 @@ struct cam_hw_mgr_intf { int (*hw_start)(void *hw_priv, void *hw_start_args); int (*hw_stop)(void *hw_priv, void *hw_stop_args); int (*hw_prepare_update)(void *hw_priv, void *hw_prepare_update_args); int (*hw_config_stream_settings)(void *hw_priv, void *hw_stream_settings); int (*hw_config)(void *hw_priv, void *hw_config_args); int (*hw_read)(void *hw_priv, void *read_args); int (*hw_write)(void *hw_priv, void *write_args); Loading
drivers/media/platform/msm/camera/cam_icp/cam_icp_context.c +24 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <linux/uaccess.h> #include <media/cam_sync.h> #include <media/cam_defs.h> #include <media/cam_icp.h> #include "cam_sync_api.h" #include "cam_node.h" #include "cam_context.h" Loading Loading @@ -123,8 +124,30 @@ static int __cam_icp_config_dev_in_ready(struct cam_context *ctx, struct cam_config_dev_cmd *cmd) { int rc; size_t len; uintptr_t packet_addr; struct cam_packet *packet; rc = cam_mem_get_cpu_buf((int32_t) cmd->packet_handle, &packet_addr, &len); if (rc) { CAM_ERR(CAM_ICP, "[%s][%d] Can not get packet address", ctx->dev_name, ctx->ctx_id); rc = -EINVAL; return rc; } packet = (struct cam_packet *) ((uint8_t *)packet_addr + (uint32_t)cmd->offset); if (((packet->header.op_code & 0xff) == CAM_ICP_OPCODE_IPE_SETTINGS) || ((packet->header.op_code & 0xff) == CAM_ICP_OPCODE_BPS_SETTINGS)) rc = cam_context_config_dev_to_hw(ctx, cmd); else rc = cam_context_prepare_dev_to_hw(ctx, cmd); if (rc) CAM_ERR(CAM_ICP, "Failed to prepare device"); Loading
drivers/media/platform/msm/camera/cam_icp/fw_inc/hfi_session_defs.h +41 −0 Original line number Diff line number Diff line Loading @@ -30,10 +30,51 @@ #define HFI_IPEBPS_CMD_OPCODE_IPE_WAIT_FOR_BPS 0xb #define HFI_IPEBPS_CMD_OPCODE_IPE_WAIT_FOR_IPE 0xc #define HFI_IPEBPS_CMD_OPCODE_MEM_MAP 0xe #define HFI_IPEBPS_CMD_OPCODE_MEM_UNMAP 0xf #define HFI_IPEBPS_HANDLE_TYPE_BPS 0x1 #define HFI_IPEBPS_HANDLE_TYPE_IPE_RT 0x2 #define HFI_IPEBPS_HANDLE_TYPE_IPE_NON_RT 0x3 /** * struct mem_map_region_data * @start_addr: cmd buffer region start addr * @len : length of the region * * create mem_map_region_data */ struct mem_map_region_data { uint32_t start_addr; uint32_t len; }; /** * struct hfi_cmd_ipe_bps_map * @user_data : user arg * @mem_map_request_num: number of mappings * @mem_map_region_sets: array of all map/unmap info * * create hfi_cmd_ipe_bps_map */ struct hfi_cmd_ipe_bps_map { uint64_t user_data; uint32_t mem_map_request_num; struct mem_map_region_data mem_map_region_sets[1]; } __packed; /** * struct hfi_cmd_ipe_bps_map_ack * @rc : Async return code * @user_data: user_arg * * create hfi_cmd_ipe_bps_map_ack */ struct hfi_cmd_ipe_bps_map_ack { uint32_t rc; uint64_t user_data; }; /** * struct abort_data * @num_req_ids: Number of req ids Loading