Commit fb259545 authored by Colin Ian King's avatar Colin Ian King Committed by Mauro Carvalho Chehab

media: atomisp: make const arrays static, makes object smaller

Don't populate const arrays on the stack but instead make them
static. Makes the object code smaller by 150 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
 111083	  23692	     64	 134839	  20eb7	atomisp/pci/atomisp_compat_css20.o

After:
   text	   data	    bss	    dec	    hex	filename
 110773	  23852	     64	 134689	  20e21	atomisp/pci/atomisp_compat_css20.o

After:

(gcc version 9.3.0, amd64)
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 3a074460
...@@ -2414,13 +2414,13 @@ static void __configure_preview_pp_input(struct atomisp_sub_device *asd, ...@@ -2414,13 +2414,13 @@ static void __configure_preview_pp_input(struct atomisp_sub_device *asd,
struct ia_css_resolution *effective_res = struct ia_css_resolution *effective_res =
&stream_config->input_config.effective_res; &stream_config->input_config.effective_res;
const struct bayer_ds_factor bds_fct[] = {{2, 1}, {3, 2}, {5, 4} }; static const struct bayer_ds_factor bds_fct[] = {{2, 1}, {3, 2}, {5, 4} };
/* /*
* BZ201033: YUV decimation factor of 4 causes couple of rightmost * BZ201033: YUV decimation factor of 4 causes couple of rightmost
* columns to be shaded. Remove this factor to work around the CSS bug. * columns to be shaded. Remove this factor to work around the CSS bug.
* const unsigned int yuv_dec_fct[] = {4, 2}; * const unsigned int yuv_dec_fct[] = {4, 2};
*/ */
const unsigned int yuv_dec_fct[] = { 2 }; static const unsigned int yuv_dec_fct[] = { 2 };
unsigned int i; unsigned int i;
if (width == 0 && height == 0) if (width == 0 && height == 0)
...@@ -2540,7 +2540,7 @@ static void __configure_video_pp_input(struct atomisp_sub_device *asd, ...@@ -2540,7 +2540,7 @@ static void __configure_video_pp_input(struct atomisp_sub_device *asd,
struct ia_css_resolution *effective_res = struct ia_css_resolution *effective_res =
&stream_config->input_config.effective_res; &stream_config->input_config.effective_res;
const struct bayer_ds_factor bds_factors[] = { static const struct bayer_ds_factor bds_factors[] = {
{8, 1}, {6, 1}, {4, 1}, {3, 1}, {2, 1}, {3, 2} {8, 1}, {6, 1}, {4, 1}, {3, 1}, {2, 1}, {3, 2}
}; };
unsigned int i; unsigned int i;
......
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