atomisp: CSS/FW release from Synergy baseline of 11Apr2012
authorMichie Yamauchi <michie.yamauchi@intel.com>
Mon, 16 Apr 2012 12:56:33 +0000 (14:56 +0200)
committerbuildbot <buildbot@intel.com>
Sat, 21 Apr 2012 12:10:34 +0000 (05:10 -0700)
BZ: 27422 31660 31928

This release of CSS/FW addresses the following issues:
- Visible colorful blocks can be seen for QVGA video recording
- YUV upscaling
- 3A/DIS statistics verification error for YUV up-scaling in video

Change-Id: I274ea8495cd2e6d9aa2001758c0bed42cb518e12
Reviewed-on: http://android.intel.com:8080/43582
Reviewed-by: Yamauchi, Michie <michie.yamauchi@intel.com>
Reviewed-by: Kruger, Jozef <jozef.kruger@intel.com>
Reviewed-by: Lampila, KalleX <kallex.lampila@intel.com>
Tested-by: Lampila, KalleX <kallex.lampila@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/media/video/atomisp/css/hrt/sp.map.h
drivers/media/video/atomisp/css/sh_css_binary.c
drivers/media/video/atomisp/css/sh_css_defs.h
drivers/media/video/atomisp/css/sh_css_sp.c

index 7bec69d..3fd6c97 100644 (file)
@@ -83,7 +83,7 @@
 #define HIVE_MEM_vf_pp_args  scalar_processor_dmem
 #define HIVE_ADDR_vf_pp_args 0x2AE4
 #define HIVE_SIZE_vf_pp_args 76
-#define HIVE_ADDR_vf_pp_dynamic_entry 0x1A06
+#define HIVE_ADDR_vf_pp_dynamic_entry 0x1A1A
 #define HIVE_MEM_current_thread  scalar_processor_dmem
 #define HIVE_ADDR_current_thread 0x29C8
 #define HIVE_SIZE_current_thread 4
 #define HIVE_MEM_histogram_args  scalar_processor_dmem
 #define HIVE_ADDR_histogram_args 0x29C4
 #define HIVE_SIZE_histogram_args 4
-#define HIVE_ADDR_capture_pp_dynamic_entry 0x2A18
+#define HIVE_ADDR_capture_pp_dynamic_entry 0x2AA9
 #define HIVE_MEM_isp_sdis_horiproj_num  scalar_processor_dmem
 #define HIVE_ADDR_isp_sdis_horiproj_num 0x1580
 #define HIVE_SIZE_isp_sdis_horiproj_num 4
index d16a3f9..dfcf46b 100644 (file)
@@ -318,6 +318,9 @@ fill_binary_info(const struct sh_css_binary_info *info,
                     isp_output_width  = out_info->padded_width,
                     isp_output_height = out_info->height,
                     s3a_isp_width;
+       bool enable_ds = info->enable_ds;
+       bool enable_hus = in_info->width < out_info->width;
+       bool enable_vus = in_info->height < out_info->height;
 
        if (info->enable_dvs_envelope) {
                sh_css_video_get_dis_envelope(&dvs_env_width, &dvs_env_height);
@@ -337,10 +340,13 @@ fill_binary_info(const struct sh_css_binary_info *info,
                bits_per_pixel = sh_css_input_format_bits_per_pixel(
                                        stream_format, two_ppc);
        }
-       if (info->enable_ds) {
-               ds_input_width  = in_info->padded_width + info->left_cropping;
-               ds_input_height = in_info->height + info->top_cropping;
-       }
+       ds_input_width  = in_info->padded_width + info->left_cropping;
+       ds_input_height = in_info->height + info->top_cropping;
+       if (enable_hus)
+               ds_input_width  += dvs_env_width;
+       if (enable_vus)
+               ds_input_height += dvs_env_height;
+
        /* We first calculate the resolutions used by the ISP. After that,
         * we use those resolutions to compute sizes for tables etc. */
        isp_internal_width  =
@@ -354,12 +360,14 @@ fill_binary_info(const struct sh_css_binary_info *info,
                __ISP_INTERNAL_HEIGHT(isp_output_height, info->top_cropping,
                                      dvs_env_height);
        isp_input_width = _ISP_INPUT_WIDTH(isp_internal_width,
-                                          ds_input_width, info->enable_ds);
+                                          ds_input_width,
+                                          enable_ds || enable_hus);
        isp_input_height = _ISP_INPUT_HEIGHT(isp_internal_height,
-                                            ds_input_height, info->enable_ds);
+                                            ds_input_height,
+                                            enable_ds || enable_vus);
 
-       s3a_isp_width = _ISP_S3A_ISP_WIDTH(isp_input_width,
-               info->left_cropping);
+       s3a_isp_width = _ISP_S3A_ELEMS_ISP_WIDTH(isp_input_width,
+               isp_internal_width, enable_hus, info->left_cropping);
        if (info->fixed_s3a_deci_log)
                s3a_log_deci = info->fixed_s3a_deci_log;
        else
@@ -435,12 +443,18 @@ fill_binary_info(const struct sh_css_binary_info *info,
                        _ISP_S3ATBL_WIDTH(binary->in_frame_info.width,
                                s3a_log_deci);
                binary->s3atbl_height =
-                       _ISP_S3ATBL_HEIGHT(isp_input_height, s3a_log_deci);
+                       _ISP_S3ATBL_HEIGHT(binary->in_frame_info.height,
+                               s3a_log_deci);
                binary->s3atbl_isp_width =
-                       _ISP_S3ATBL_ISP_WIDTH(isp_input_width, s3a_log_deci,
-                                         info->left_cropping);
+                       _ISP_S3ATBL_ISP_WIDTH(
+                               _ISP_S3A_ELEMS_ISP_WIDTH(isp_input_width,
+                               isp_internal_width, enable_hus,
+                               info->left_cropping),
+                               s3a_log_deci);
                binary->s3atbl_isp_height =
-                       _ISP_S3ATBL_ISP_HEIGHT(isp_input_height, s3a_log_deci);
+                       _ISP_S3ATBL_ISP_HEIGHT(
+                               _ISP_S3A_ELEMS_ISP_HEIGHT(isp_input_height,
+                               isp_internal_height, enable_vus), s3a_log_deci);
        } else {
                binary->s3atbl_width  = 0;
                binary->s3atbl_height = 0;
@@ -467,23 +481,31 @@ fill_binary_info(const struct sh_css_binary_info *info,
                        _ISP_SDIS_HOR_COEF_NUM_3A(binary->in_frame_info.width,
                                                  SH_CSS_DIS_DECI_FACTOR_LOG2);
                binary->dis_ver_coef_num_3a  =
-                       _ISP_SDIS_VER_COEF_NUM_3A(isp_input_height,
+                       _ISP_SDIS_VER_COEF_NUM_3A(binary->in_frame_info.height,
                                                  SH_CSS_DIS_DECI_FACTOR_LOG2);
                binary->dis_hor_coef_num_isp =
-                       _ISP_SDIS_HOR_COEF_NUM_ISP(isp_input_width);
+                       _ISP_SDIS_HOR_COEF_NUM_ISP(
+                               _ISP_SDIS_ELEMS_ISP(isp_input_width,
+                               isp_internal_width, enable_hus));
                binary->dis_ver_coef_num_isp =
-                       _ISP_SDIS_VER_COEF_NUM_ISP(isp_input_height);
+                       _ISP_SDIS_VER_COEF_NUM_ISP(
+                               _ISP_SDIS_ELEMS_ISP(isp_input_height,
+                               isp_internal_height, enable_vus));
                binary->dis_hor_proj_num_3a  =
-                       _ISP_SDIS_HOR_PROJ_NUM_3A(isp_input_height,
+                       _ISP_SDIS_HOR_PROJ_NUM_3A(binary->in_frame_info.height,
                                                  SH_CSS_DIS_DECI_FACTOR_LOG2);
                binary->dis_ver_proj_num_3a  =
                        _ISP_SDIS_VER_PROJ_NUM_3A(binary->in_frame_info.width,
                                                  SH_CSS_DIS_DECI_FACTOR_LOG2);
                binary->dis_hor_proj_num_isp =
-                       __ISP_SDIS_HOR_PROJ_NUM_ISP(isp_input_height,
+                       __ISP_SDIS_HOR_PROJ_NUM_ISP(
+                               _ISP_SDIS_ELEMS_ISP(isp_input_height,
+                               isp_internal_height, enable_vus),
                                                SH_CSS_DIS_DECI_FACTOR_LOG2);
                binary->dis_ver_proj_num_isp =
-                       __ISP_SDIS_VER_PROJ_NUM_ISP(isp_input_width,
+                       __ISP_SDIS_VER_PROJ_NUM_ISP(
+                               _ISP_SDIS_ELEMS_ISP(isp_input_width,
+                               isp_internal_width, enable_hus),
                                                SH_CSS_DIS_DECI_FACTOR_LOG2);
        } else {
                binary->dis_deci_factor_log2 = 0;
index a9cf295..c969b33 100644 (file)
 #define _SDIS_VER_COEF_TBL_USE_DMEM(mode, enable_sdis) \
        (mode == SH_CSS_BINARY_MODE_VIDEO && enable_sdis)
 
+/* For YUV upscaling, the internal size is used for DIS statistics */
+#define _ISP_SDIS_ELEMS_ISP(input, internal, enable_us) \
+       ((enable_us) ? (internal) : (input))
+
 /* SDIS Projections:
  * Horizontal projections are calculated for each line.
  * Vertical projections are calculated for each column.
        (_ISP_BQS(in_width) >> deci_factor_log2)
 #define _ISP_S3ATBL_HEIGHT(in_height, deci_factor_log2) \
        (_ISP_BQS(in_height) >> deci_factor_log2)
-#define _ISP_S3A_ISP_WIDTH(in_width, left_crop) \
-       ((in_width) - ((left_crop) ? 2*ISP_VEC_NELEMS : 0))
-#define _ISP_S3ATBL_ISP_WIDTH(in_width, deci_log2, left_crop) \
-       CEIL_SHIFT(_ISP_BQS(_ISP_S3A_ISP_WIDTH(in_width, left_crop)), deci_log2)
+
+#define _ISP_S3A_ELEMS_ISP_WIDTH(in_width, int_width, enable_hus, left_crop) \
+       (((enable_hus) ? (int_width) : (in_width)) \
+        - ((left_crop) ? 2 * ISP_VEC_NELEMS : 0))
+#define _ISP_S3A_ELEMS_ISP_HEIGHT(in_height, int_height, enable_vus) \
+       ((enable_vus) ? (int_height) : (in_height))
+
+#define _ISP_S3ATBL_ISP_WIDTH(in_width, deci_factor_log2) \
+       CEIL_SHIFT(_ISP_BQS(in_width), deci_factor_log2)
 #define _ISP_S3ATBL_ISP_HEIGHT(in_height, deci_factor_log2) \
        CEIL_SHIFT(_ISP_BQS(in_height), deci_factor_log2)
 #define ISP_S3ATBL_VECTORS \
index afb6b60..7072db3 100644 (file)
@@ -318,6 +318,10 @@ sh_css_sp_configure_dvs(const struct sh_css_binary *binary,
        int half_env_x, half_env_y,
            motion_x = args->dvs_vector_x,
            motion_y = args->dvs_vector_y;
+       bool upscale_x = binary->in_frame_info.width <
+                        binary->out_frame_info.width;
+       bool upscale_y = binary->in_frame_info.height <
+                        binary->out_frame_info.height;
 
        if (binary->info->enable_uds) {
                /* we calculate with the envelope that we can actually use,
@@ -331,10 +335,20 @@ sh_css_sp_configure_dvs(const struct sh_css_binary *binary,
                /* for digital zoom, we use the dvs envelope and make sure
                   that we don't include the 8 leftmost pixels or 8 topmost
                   rows. */
-               uds_xc = (binary->out_frame_info.width + env_width) / 2 +
-                        SH_CSS_MIN_DVS_ENVELOPE;
-               uds_yc = (binary->out_frame_info.height + env_height) / 2 +
-                        SH_CSS_MIN_DVS_ENVELOPE;
+               if (upscale_x) {
+                       uds_xc = (binary->in_frame_info.width + env_width
+                                       + SH_CSS_MIN_DVS_ENVELOPE) / 2;
+               } else {
+                       uds_xc = (binary->out_frame_info.width + env_width)
+                                       / 2 + SH_CSS_MIN_DVS_ENVELOPE;
+               }
+               if (upscale_y) {
+                       uds_yc = (binary->in_frame_info.height + env_height
+                                       + SH_CSS_MIN_DVS_ENVELOPE) / 2;
+               } else {
+                       uds_yc = (binary->out_frame_info.height + env_height)
+                                       / 2 + SH_CSS_MIN_DVS_ENVELOPE;
+               }
                /* clip the motion vector to +/- half the envelope */
                motion_x = clamp(motion_x, -half_env_x, half_env_x);
                motion_y = clamp(motion_y, -half_env_y, half_env_y);