Skip to content

Commit 7483ce8

Browse files
andy-shevmchehab
authored andcommitted
media: atomisp: Simplify ia_css_pipe_create_cas_scaler_desc_single_output()
Make ia_css_pipe_create_cas_scaler_desc_single_output() easier to read by shortening parameter names. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 1f24d0b commit 7483ce8

File tree

1 file changed

+20
-24
lines changed
  • drivers/staging/media/atomisp/pci

1 file changed

+20
-24
lines changed

drivers/staging/media/atomisp/pci/sh_css.c

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5826,31 +5826,28 @@ need_yuv_scaler_stage(const struct ia_css_pipe *pipe)
58265826
* Later, merge this with ia_css_pipe_create_cas_scaler_desc
58275827
*/
58285828
static int ia_css_pipe_create_cas_scaler_desc_single_output(
5829-
struct ia_css_frame_info *cas_scaler_in_info,
5830-
struct ia_css_frame_info *cas_scaler_out_info,
5831-
struct ia_css_frame_info *cas_scaler_vf_info,
5829+
struct ia_css_frame_info *in_info,
5830+
struct ia_css_frame_info *out_info,
5831+
struct ia_css_frame_info *vf_info,
58325832
struct ia_css_cas_binary_descr *descr)
58335833
{
58345834
unsigned int i;
58355835
unsigned int hor_ds_factor = 0, ver_ds_factor = 0;
58365836
int err = 0;
58375837
struct ia_css_frame_info tmp_in_info;
5838-
58395838
unsigned int max_scale_factor_per_stage = MAX_PREFERRED_YUV_DS_PER_STEP;
58405839

5841-
assert(cas_scaler_in_info);
5842-
assert(cas_scaler_out_info);
5840+
assert(in_info);
5841+
assert(out_info);
58435842

58445843
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
58455844
"ia_css_pipe_create_cas_scaler_desc() enter:\n");
58465845

58475846
/* We assume that this function is used only for single output port case. */
58485847
descr->num_output_stage = 1;
58495848

5850-
hor_ds_factor = CEIL_DIV(cas_scaler_in_info->res.width,
5851-
cas_scaler_out_info->res.width);
5852-
ver_ds_factor = CEIL_DIV(cas_scaler_in_info->res.height,
5853-
cas_scaler_out_info->res.height);
5849+
hor_ds_factor = CEIL_DIV(in_info->res.width, out_info->res.width);
5850+
ver_ds_factor = CEIL_DIV(in_info->res.height, out_info->res.height);
58545851
/* use the same horizontal and vertical downscaling factor for simplicity */
58555852
assert(hor_ds_factor == ver_ds_factor);
58565853

@@ -5895,30 +5892,29 @@ static int ia_css_pipe_create_cas_scaler_desc_single_output(
58955892
goto ERR;
58965893
}
58975894

5898-
tmp_in_info = *cas_scaler_in_info;
5895+
tmp_in_info = *in_info;
58995896
for (i = 0; i < descr->num_stage; i++) {
59005897
descr->in_info[i] = tmp_in_info;
5901-
if ((tmp_in_info.res.width / max_scale_factor_per_stage) <=
5902-
cas_scaler_out_info->res.width) {
5898+
if ((tmp_in_info.res.width / max_scale_factor_per_stage) <= out_info->res.width) {
59035899
descr->is_output_stage[i] = true;
59045900
if ((descr->num_output_stage > 1) && (i != (descr->num_stage - 1))) {
5905-
descr->internal_out_info[i].res.width = cas_scaler_out_info->res.width;
5906-
descr->internal_out_info[i].res.height = cas_scaler_out_info->res.height;
5907-
descr->internal_out_info[i].padded_width = cas_scaler_out_info->padded_width;
5901+
descr->internal_out_info[i].res.width = out_info->res.width;
5902+
descr->internal_out_info[i].res.height = out_info->res.height;
5903+
descr->internal_out_info[i].padded_width = out_info->padded_width;
59085904
descr->internal_out_info[i].format = IA_CSS_FRAME_FORMAT_YUV420;
59095905
} else {
59105906
assert(i == (descr->num_stage - 1));
59115907
descr->internal_out_info[i].res.width = 0;
59125908
descr->internal_out_info[i].res.height = 0;
59135909
}
5914-
descr->out_info[i].res.width = cas_scaler_out_info->res.width;
5915-
descr->out_info[i].res.height = cas_scaler_out_info->res.height;
5916-
descr->out_info[i].padded_width = cas_scaler_out_info->padded_width;
5917-
descr->out_info[i].format = cas_scaler_out_info->format;
5918-
if (cas_scaler_vf_info) {
5919-
descr->vf_info[i].res.width = cas_scaler_vf_info->res.width;
5920-
descr->vf_info[i].res.height = cas_scaler_vf_info->res.height;
5921-
descr->vf_info[i].padded_width = cas_scaler_vf_info->padded_width;
5910+
descr->out_info[i].res.width = out_info->res.width;
5911+
descr->out_info[i].res.height = out_info->res.height;
5912+
descr->out_info[i].padded_width = out_info->padded_width;
5913+
descr->out_info[i].format = out_info->format;
5914+
if (vf_info) {
5915+
descr->vf_info[i].res.width = vf_info->res.width;
5916+
descr->vf_info[i].res.height = vf_info->res.height;
5917+
descr->vf_info[i].padded_width = vf_info->padded_width;
59225918
ia_css_frame_info_set_format(&descr->vf_info[i], IA_CSS_FRAME_FORMAT_YUV_LINE);
59235919
} else {
59245920
descr->vf_info[i].res.width = 0;

0 commit comments

Comments
 (0)