From 643608390238d564bd432bd896520f2fea3d8c8e Mon Sep 17 00:00:00 2001 From: Lokesh Gupta Date: Wed, 4 Jan 2012 14:41:07 +0100 Subject: [PATCH] [PORT FROM R2] atomisp: CSS release from Synergy BL 03Jan2012 BZ: 20531 This release solves the following issues: - Critical races test in ANR - Enable MACC in primary - Don't reallocate DDR buffer for ISP FW Change-Id: I518f1a370967fa22aa820bb6895d0e11ab141d5d Orig-Change-Id: Icfbe4641c8b07496ac75dced755aeb17f5254c30 Signed-off-by: Lokesh Gupta Reviewed-on: http://android.intel.com:8080/30568 Reviewed-by: Kruger, Jozef Tested-by: Koski, Anttu Reviewed-by: buildbot Tested-by: buildbot Reviewed-on: http://android.intel.com:8080/32447 Reviewed-by: Lampila, KalleX Tested-by: Lampila, KalleX --- drivers/media/video/atomisp/css/hrt/sp.map.h | 2 +- drivers/media/video/atomisp/css/sh_css.c | 3 +++ drivers/media/video/atomisp/css/sh_css_hw.h | 2 ++ drivers/media/video/atomisp/css/sh_css_params.c | 6 +++--- drivers/media/video/atomisp/css/sh_css_sp.c | 16 +++++++++++----- drivers/media/video/atomisp/css/sh_css_sp.h | 3 +++ 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/media/video/atomisp/css/hrt/sp.map.h b/drivers/media/video/atomisp/css/hrt/sp.map.h index 7c5b442..0e45924 100644 --- a/drivers/media/video/atomisp/css/hrt/sp.map.h +++ b/drivers/media/video/atomisp/css/hrt/sp.map.h @@ -126,7 +126,7 @@ #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 0x2A5E +#define HIVE_ADDR_capture_pp_dynamic_entry 0x2A59 #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 diff --git a/drivers/media/video/atomisp/css/sh_css.c b/drivers/media/video/atomisp/css/sh_css.c index 72e2b90..197a503 100644 --- a/drivers/media/video/atomisp/css/sh_css.c +++ b/drivers/media/video/atomisp/css/sh_css.c @@ -1703,6 +1703,9 @@ sh_css_init(void *(*malloc_func) (size_t size), err = sh_css_params_init(); if (err != sh_css_success) return err; + err = sh_css_sp_init(); + if (err != sh_css_success) + return err; err = sh_css_load_firmware(fw_data, fw_size); if (err != sh_css_success) return err; diff --git a/drivers/media/video/atomisp/css/sh_css_hw.h b/drivers/media/video/atomisp/css/sh_css_hw.h index 5b11667..9805e37 100644 --- a/drivers/media/video/atomisp/css/sh_css_hw.h +++ b/drivers/media/video/atomisp/css/sh_css_hw.h @@ -58,6 +58,8 @@ #define GP_FIFO_BASE ((void *)0x10200304) #define CSS_RX_BASE ((void *)0x10260000) +#define SP_DMEM_SIZE (0x4000) + /* SP Registers */ #define SP_PC_REG 0x9 #define SP_SC_REG 0x0 diff --git a/drivers/media/video/atomisp/css/sh_css_params.c b/drivers/media/video/atomisp/css/sh_css_params.c index ffa1b64..804d015 100644 --- a/drivers/media/video/atomisp/css/sh_css_params.c +++ b/drivers/media/video/atomisp/css/sh_css_params.c @@ -45,7 +45,7 @@ min(max((((v)>>sSHIFT) >> (sFRACTION_BITS_FITTING(a)-(b))), \ sISP_VAL_MIN), sISP_VAL_MAX) #define uDIGIT_FITTING(v, a, b) \ - min(max((((v)>>uSHIFT) >> (uFRACTION_BITS_FITTING(a)-(b))), \ + min((unsigned)max((unsigned)(((v)>>uSHIFT) >> (uFRACTION_BITS_FITTING(a)-(b))), \ uISP_VAL_MIN), uISP_VAL_MAX) #define FPNTBL_BYTES(binary) \ @@ -1247,9 +1247,9 @@ static void sh_css_process_gc(void) { isp_parameters.gamma_gain_k1 = - sDIGIT_FITTING(gc_config->gain_k1, 16, SH_CSS_GAMMA_GAIN_K_SHIFT); + uDIGIT_FITTING(gc_config->gain_k1, 16, SH_CSS_GAMMA_GAIN_K_SHIFT); isp_parameters.gamma_gain_k2 = - sDIGIT_FITTING(gc_config->gain_k2, 16, SH_CSS_GAMMA_GAIN_K_SHIFT); + uDIGIT_FITTING(gc_config->gain_k2, 16, SH_CSS_GAMMA_GAIN_K_SHIFT); isp_params_changed = true; gc_config_changed = false; } diff --git a/drivers/media/video/atomisp/css/sh_css_sp.c b/drivers/media/video/atomisp/css/sh_css_sp.c index 498c9b5..87a2bba 100644 --- a/drivers/media/video/atomisp/css/sh_css_sp.c +++ b/drivers/media/video/atomisp/css/sh_css_sp.c @@ -28,6 +28,7 @@ #include "sh_css_hrt.h" #include "sh_css_defs.h" #include "sh_css_internal.h" +#include "sh_css_hw.h" #define HRT_NO_BLOB_sp #include "sp.map.h" @@ -64,11 +65,6 @@ sh_css_sp_store_init_dmem(const struct sh_css_sp_fw *fw) { struct sh_css_sp_init_dmem_cfg init_dmem_cfg; - /* store data section to DDR */ - if (init_dmem_ddr) - hrt_isp_css_mm_free(init_dmem_ddr); - - init_dmem_ddr = hrt_isp_css_mm_alloc(fw->data_size); hrt_isp_css_mm_store(init_dmem_ddr, fw->data, fw->data_size); /* Configure the data structure to initialize dmem */ @@ -84,6 +80,16 @@ sh_css_sp_store_init_dmem(const struct sh_css_sp_fw *fw) } +enum sh_css_err +sh_css_sp_init(void) +{ + init_dmem_ddr = hrt_isp_css_mm_alloc(SP_DMEM_SIZE); + if (!init_dmem_ddr) + return sh_css_err_cannot_allocate_memory; + + return sh_css_success; +} + void sh_css_sp_uninit(void) { diff --git a/drivers/media/video/atomisp/css/sh_css_sp.h b/drivers/media/video/atomisp/css/sh_css_sp.h index 3c211f0..21ee56a 100644 --- a/drivers/media/video/atomisp/css/sh_css_sp.h +++ b/drivers/media/video/atomisp/css/sh_css_sp.h @@ -38,6 +38,9 @@ struct sh_css_sp_frame_data { void sh_css_sp_store_init_dmem(const struct sh_css_sp_fw *fw); +enum sh_css_err +sh_css_sp_init(void); + void sh_css_sp_uninit(void); -- 2.7.4