2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 #include "ia_css_pipe_stagedesc.h"
16 #include "assert_support.h"
17 #include "ia_css_debug.h"
19 void ia_css_pipe_get_generic_stage_desc(
20 struct ia_css_pipeline_stage_desc *stage_desc,
21 struct ia_css_binary *binary,
22 struct ia_css_frame *out_frame[],
23 struct ia_css_frame *in_frame,
24 struct ia_css_frame *vf_frame)
27 IA_CSS_ENTER_PRIVATE("stage_desc = %p, binary = %p, out_frame = %p, in_frame = %p, vf_frame = %p",
28 stage_desc, binary, out_frame, in_frame, vf_frame);
30 assert(stage_desc != NULL && binary != NULL && binary->info != NULL);
31 if (stage_desc == NULL || binary == NULL || binary->info == NULL) {
32 IA_CSS_ERROR("invalid arguments");
36 stage_desc->binary = binary;
37 stage_desc->firmware = NULL;
38 stage_desc->sp_func = IA_CSS_PIPELINE_NO_FUNC;
39 stage_desc->max_input_width = 0;
40 stage_desc->mode = binary->info->sp.pipeline.mode;
41 stage_desc->in_frame = in_frame;
42 for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
43 stage_desc->out_frame[i] = out_frame[i];
45 stage_desc->vf_frame = vf_frame;
47 IA_CSS_LEAVE_PRIVATE("");
50 void ia_css_pipe_get_firmwares_stage_desc(
51 struct ia_css_pipeline_stage_desc *stage_desc,
52 struct ia_css_binary *binary,
53 struct ia_css_frame *out_frame[],
54 struct ia_css_frame *in_frame,
55 struct ia_css_frame *vf_frame,
56 const struct ia_css_fw_info *fw,
61 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_pipe_get_firmwares_stage_desc() enter:\n");
62 stage_desc->binary = binary;
63 stage_desc->firmware = fw;
64 stage_desc->sp_func = IA_CSS_PIPELINE_NO_FUNC;
65 stage_desc->max_input_width = 0;
66 stage_desc->mode = mode;
67 stage_desc->in_frame = in_frame;
68 for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
69 stage_desc->out_frame[i] = out_frame[i];
71 stage_desc->vf_frame = vf_frame;
74 void ia_css_pipe_get_acc_stage_desc(
75 struct ia_css_pipeline_stage_desc *stage_desc,
76 struct ia_css_binary *binary,
77 struct ia_css_fw_info *fw)
81 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_pipe_get_acc_stage_desc() enter:\n");
82 stage_desc->binary = binary;
83 stage_desc->firmware = fw;
84 stage_desc->sp_func = IA_CSS_PIPELINE_NO_FUNC;
85 stage_desc->max_input_width = 0;
86 stage_desc->mode = IA_CSS_BINARY_MODE_VF_PP;
87 stage_desc->in_frame = NULL;
88 for (i = 0; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
89 stage_desc->out_frame[i] = NULL;
91 stage_desc->vf_frame = NULL;
94 void ia_css_pipe_get_sp_func_stage_desc(
95 struct ia_css_pipeline_stage_desc *stage_desc,
96 struct ia_css_frame *out_frame,
97 enum ia_css_pipeline_stage_sp_func sp_func,
98 unsigned max_input_width)
102 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_pipe_get_sp_func_stage_desc() enter:\n");
103 stage_desc->binary = NULL;
104 stage_desc->firmware = NULL;
105 stage_desc->sp_func = sp_func;
106 stage_desc->max_input_width = max_input_width;
107 stage_desc->mode = (unsigned int)-1;
108 stage_desc->in_frame = NULL;
109 stage_desc->out_frame[0] = out_frame;
110 for (i = 1; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++) {
111 stage_desc->out_frame[i] = NULL;
113 stage_desc->vf_frame = NULL;