Commit 80b685e6 authored by Jonathan Bergh's avatar Jonathan Bergh Committed by Mauro Carvalho Chehab

media: staging: media: atomisp: Remove old commented code and fix multiple block comment style

This patch fixes the following minor code and code style issues:
 * Removes a block of commented out (unused) code from the src
 * Reformats various multiline block comments to meet the kernel code
   style guidelines for block comments

Link: https://lore.kernel.org/r/20240226194023.69070-7-bergh.jonathan@gmail.comSigned-off-by: default avatarJonathan Bergh <bergh.jonathan@gmail.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 8654983c
...@@ -108,11 +108,6 @@ copy_isp_stage_to_sp_stage(void) ...@@ -108,11 +108,6 @@ copy_isp_stage_to_sp_stage(void)
sh_css_isp_stage.binary_info.iterator.row_stripes_overlap_lines; sh_css_isp_stage.binary_info.iterator.row_stripes_overlap_lines;
sh_css_sp_stage.top_cropping = (uint16_t) sh_css_sp_stage.top_cropping = (uint16_t)
sh_css_isp_stage.binary_info.pipeline.top_cropping; sh_css_isp_stage.binary_info.pipeline.top_cropping;
/* moved to sh_css_sp_init_stage
sh_css_sp_stage.enable.vf_output =
sh_css_isp_stage.binary_info.enable.vf_veceven ||
sh_css_isp_stage.binary_info.num_output_pins > 1;
*/
sh_css_sp_stage.enable.sdis = sh_css_isp_stage.binary_info.enable.dis; sh_css_sp_stage.enable.sdis = sh_css_isp_stage.binary_info.enable.dis;
sh_css_sp_stage.enable.s3a = sh_css_isp_stage.binary_info.enable.s3a; sh_css_sp_stage.enable.s3a = sh_css_isp_stage.binary_info.enable.s3a;
} }
...@@ -411,14 +406,15 @@ sh_css_copy_buffer_attr_to_spbuffer(struct ia_css_buffer_sp *dest_buf, ...@@ -411,14 +406,15 @@ sh_css_copy_buffer_attr_to_spbuffer(struct ia_css_buffer_sp *dest_buf,
*/ */
assert(queue_id < SH_CSS_MAX_NUM_QUEUES); assert(queue_id < SH_CSS_MAX_NUM_QUEUES);
/* Klocwork assumes assert can be disabled; /*
Since we can get there with any type, and it does not * Klocwork assumes assert can be disabled;
know that frame_in->dynamic_data_index can only be set * Since we can get there with any type, and it does not
for one of the types in the assert) it has to assume we * know that frame_in->dynamic_data_index can only be set
can get here for any type. however this could lead to an * for one of the types in the assert) it has to assume we
out of bounds reference when indexing buf_type about 10 * can get here for any type. however this could lead to an
lines below. In order to satisfy KW an additional if * out of bounds reference when indexing buf_type about 10
has been added. This one will always yield true. * lines below. In order to satisfy KW an additional if
* has been added. This one will always yield true.
*/ */
if (queue_id < SH_CSS_MAX_NUM_QUEUES) if (queue_id < SH_CSS_MAX_NUM_QUEUES)
dest_buf->buf_src.queue_id = queue_id; dest_buf->buf_src.queue_id = queue_id;
...@@ -514,7 +510,8 @@ sh_css_copy_frame_to_spframe(struct ia_css_frame_sp *sp_frame_out, ...@@ -514,7 +510,8 @@ sh_css_copy_frame_to_spframe(struct ia_css_frame_sp *sp_frame_out,
frame_in->planes.binary.data.offset; frame_in->planes.binary.data.offset;
break; break;
default: default:
/* This should not happen, but in case it does, /*
* This should not happen, but in case it does,
* nullify the planes * nullify the planes
*/ */
memset(&sp_frame_out->planes, 0, sizeof(sp_frame_out->planes)); memset(&sp_frame_out->planes, 0, sizeof(sp_frame_out->planes));
...@@ -951,9 +948,10 @@ sh_css_sp_init_stage(struct ia_css_binary *binary, ...@@ -951,9 +948,10 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
sh_css_sp_stage.isp_copy_output = (uint8_t)args->copy_output; sh_css_sp_stage.isp_copy_output = (uint8_t)args->copy_output;
sh_css_sp_stage.enable.vf_output = (args->out_vf_frame != NULL); sh_css_sp_stage.enable.vf_output = (args->out_vf_frame != NULL);
/* Copy the frame infos first, to be overwritten by the frames, /*
if these are present. * Copy the frame infos first, to be overwritten by the frames,
*/ * if these are present.
*/
sh_css_sp_stage.frames.effective_in_res.width = binary->effective_in_frame_res.width; sh_css_sp_stage.frames.effective_in_res.width = binary->effective_in_frame_res.width;
sh_css_sp_stage.frames.effective_in_res.height = binary->effective_in_frame_res.height; sh_css_sp_stage.frames.effective_in_res.height = binary->effective_in_frame_res.height;
...@@ -1030,10 +1028,12 @@ sh_css_sp_init_stage(struct ia_css_binary *binary, ...@@ -1030,10 +1028,12 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
initialize_isp_states(binary); initialize_isp_states(binary);
/* we do this only for preview pipe because in fill_binary_info function /*
* We do this only for preview pipe because in fill_binary_info function
* we assign vf_out res to out res, but for ISP internal processing, we need * we assign vf_out res to out res, but for ISP internal processing, we need
* the original out res. for video pipe, it has two output pins --- out and * the original out res. for video pipe, it has two output pins --- out and
* vf_out, so it can keep these two resolutions already. */ * vf_out, so it can keep these two resolutions already.
*/
if (binary->info->sp.pipeline.mode == IA_CSS_BINARY_MODE_PREVIEW && if (binary->info->sp.pipeline.mode == IA_CSS_BINARY_MODE_PREVIEW &&
(binary->vf_downscale_log2 > 0)) { (binary->vf_downscale_log2 > 0)) {
/* TODO: Remove this after preview output decimation is fixed /* TODO: Remove this after preview output decimation is fixed
...@@ -1069,20 +1069,23 @@ sp_init_stage(struct ia_css_pipeline_stage *stage, ...@@ -1069,20 +1069,23 @@ sp_init_stage(struct ia_css_pipeline_stage *stage,
*/ */
const char *binary_name = ""; const char *binary_name = "";
const struct ia_css_binary_xinfo *info = NULL; const struct ia_css_binary_xinfo *info = NULL;
/* note: the var below is made static as it is quite large; /*
if it is not static it ends up on the stack which could * Note: the var below is made static as it is quite large;
cause issues for drivers * if it is not static it ends up on the stack which could
*/ * cause issues for drivers
*/
static struct ia_css_binary tmp_binary; static struct ia_css_binary tmp_binary;
const struct ia_css_blob_info *blob_info = NULL; const struct ia_css_blob_info *blob_info = NULL;
struct ia_css_isp_param_css_segments isp_mem_if; struct ia_css_isp_param_css_segments isp_mem_if;
/* LA: should be ia_css_data, should not contain host pointer. /*
However, CSS/DDR pointer is not available yet. * LA: should be ia_css_data, should not contain host pointer.
Hack is to store it in params->ddr_ptrs and then copy it late in the SP just before vmem init. * However, CSS/DDR pointer is not available yet.
TODO: Call this after CSS/DDR allocation and store that pointer. * Hack is to store it in params->ddr_ptrs and then copy it late in
Best is to allocate it at stage creation time together with host pointer. * the SP just before vmem init.
Remove vmem from params. * TODO: Call this after CSS/DDR allocation and store that pointer.
*/ * Best is to allocate it at stage creation time together with host
* pointer. Remove vmem from params.
*/
struct ia_css_isp_param_css_segments *mem_if = &isp_mem_if; struct ia_css_isp_param_css_segments *mem_if = &isp_mem_if;
int err = 0; int err = 0;
...@@ -1122,10 +1125,12 @@ sp_init_stage(struct ia_css_pipeline_stage *stage, ...@@ -1122,10 +1125,12 @@ sp_init_stage(struct ia_css_pipeline_stage *stage,
} else { } else {
/* SP stage */ /* SP stage */
assert(stage->sp_func != IA_CSS_PIPELINE_NO_FUNC); assert(stage->sp_func != IA_CSS_PIPELINE_NO_FUNC);
/* binary and blob_info are now NULL. /*
These will be passed to sh_css_sp_init_stage * binary and blob_info are now NULL.
and dereferenced there, so passing a NULL * These will be passed to sh_css_sp_init_stage
pointer is no good. return an error */ * and dereferenced there, so passing a NULL
* pointer is no good. return an error
*/
return -EINVAL; return -EINVAL;
} }
...@@ -1259,8 +1264,10 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me, ...@@ -1259,8 +1264,10 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS << thread_id; SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS << thread_id;
} }
/* For continuous use-cases, SP copy is responsible for sampling the /*
* parameters */ * For continuous use-cases, SP copy is responsible for sampling the
* parameters
*/
if (continuous) if (continuous)
sh_css_sp_group.pipe[thread_id].pipe_config = 0; sh_css_sp_group.pipe[thread_id].pipe_config = 0;
...@@ -1542,7 +1549,8 @@ ia_css_pipe_set_irq_mask(struct ia_css_pipe *pipe, ...@@ -1542,7 +1549,8 @@ ia_css_pipe_set_irq_mask(struct ia_css_pipe *pipe,
assert(pipe); assert(pipe);
assert(IA_CSS_PIPE_ID_NUM == NR_OF_PIPELINES); assert(IA_CSS_PIPE_ID_NUM == NR_OF_PIPELINES);
/* Linux kernel does not have UINT16_MAX /*
* Linux kernel does not have UINT16_MAX
* Therefore decided to comment out these 2 asserts for Linux * Therefore decided to comment out these 2 asserts for Linux
* Alternatives that were not chosen: * Alternatives that were not chosen:
* - add a conditional #define for UINT16_MAX * - add a conditional #define for UINT16_MAX
...@@ -1641,7 +1649,8 @@ sh_css_sp_start_isp(void) ...@@ -1641,7 +1649,8 @@ sh_css_sp_start_isp(void)
(unsigned int)sp_address_of(sp_sw_state), (unsigned int)sp_address_of(sp_sw_state),
(uint32_t)(IA_CSS_SP_SW_TERMINATED)); (uint32_t)(IA_CSS_SP_SW_TERMINATED));
/* Note 1: The sp_start_isp function contains a wait till /*
* Note 1: The sp_start_isp function contains a wait till
* the input network is configured by the SP. * the input network is configured by the SP.
* Note 2: Not all SP binaries supports host2sp_commands. * Note 2: Not all SP binaries supports host2sp_commands.
* In case a binary does support it, the host2sp_command * In case a binary does support it, the host2sp_command
...@@ -1651,7 +1660,8 @@ sh_css_sp_start_isp(void) ...@@ -1651,7 +1660,8 @@ sh_css_sp_start_isp(void)
* received, the SP starts configuring the input network. * received, the SP starts configuring the input network.
*/ */
/* we need to set sp_running before we call ia_css_mmu_invalidate_cache /*
* We need to set sp_running before we call ia_css_mmu_invalidate_cache
* as ia_css_mmu_invalidate_cache checks on sp_running to * as ia_css_mmu_invalidate_cache checks on sp_running to
* avoid that it accesses dmem while the SP is not powered * avoid that it accesses dmem while the SP is not powered
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment