summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf')
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf.host.c84
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf.host.h37
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf_param.h62
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf_types.h54
4 files changed, 237 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf.host.c
new file mode 100644
index 0000000..79ddef6
--- /dev/null
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf.host.c
@@ -0,0 +1,84 @@
+#ifdef ISP2600
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ */
+
+#include "ia_css_types.h"
+#include "sh_css_defs.h"
+#include "sh_css_frac.h"
+#include "ia_css_pdaf.host.h"
+
+const struct ia_css_pdaf_config default_pdaf_config;
+
+void
+ia_css_pdaf_dmem_encode(
+ struct isp_pdaf_dmem_params *to,
+ const struct ia_css_pdaf_config *from,
+ unsigned size)
+{
+ (void)size;
+ to->frm_length = from->frm_length;
+ to->frm_width = from->frm_width;
+
+ to->ext_cfg_l_data.num_valid_patterns = from->ext_cfg_data.l_pixel_grid.num_valid_patterns;
+
+ to->ext_cfg_r_data.num_valid_patterns = from->ext_cfg_data.r_pixel_grid.num_valid_patterns;
+
+ to->stats_calc_data.num_valid_elm = from->stats_calc_cfg_data.num_valid_elm;
+}
+
+void
+ia_css_pdaf_vmem_encode(
+ struct isp_pdaf_vmem_params *to,
+ const struct ia_css_pdaf_config *from,
+ unsigned size)
+{
+
+ unsigned int i;
+ (void)size;
+ /* Initialize left pixel grid */
+ for ( i=0 ; i < from->ext_cfg_data.l_pixel_grid.num_valid_patterns ; i++) {
+
+ to->ext_cfg_l_data.y_offset[0][i] = from->ext_cfg_data.l_pixel_grid.y_offset[i];
+ to->ext_cfg_l_data.x_offset[0][i] = from->ext_cfg_data.l_pixel_grid.x_offset[i];
+ to->ext_cfg_l_data.y_step_size[0][i] = from->ext_cfg_data.l_pixel_grid.y_step_size[i];
+ to->ext_cfg_l_data.x_step_size[0][i] = from->ext_cfg_data.l_pixel_grid.x_step_size[i];
+ }
+
+ for ( ; i < ISP_NWAY ; i++) {
+
+ to->ext_cfg_l_data.y_offset[0][i] = PDAF_INVALID_VAL;
+ to->ext_cfg_l_data.x_offset[0][i] = PDAF_INVALID_VAL;
+ to->ext_cfg_l_data.y_step_size[0][i] = PDAF_INVALID_VAL;
+ to->ext_cfg_l_data.x_step_size[0][i] = PDAF_INVALID_VAL;
+ }
+
+ /* Initialize left pixel grid */
+
+ for ( i=0 ; i < from->ext_cfg_data.r_pixel_grid.num_valid_patterns ; i++) {
+
+ to->ext_cfg_r_data.y_offset[0][i] = from->ext_cfg_data.r_pixel_grid.y_offset[i];
+ to->ext_cfg_r_data.x_offset[0][i] = from->ext_cfg_data.r_pixel_grid.x_offset[i];
+ to->ext_cfg_r_data.y_step_size[0][i] = from->ext_cfg_data.r_pixel_grid.y_step_size[i];
+ to->ext_cfg_r_data.x_step_size[0][i] = from->ext_cfg_data.r_pixel_grid.x_step_size[i];
+ }
+
+ for ( ; i < ISP_NWAY ; i++) {
+
+ to->ext_cfg_r_data.y_offset[0][i] = PDAF_INVALID_VAL;
+ to->ext_cfg_r_data.x_offset[0][i] = PDAF_INVALID_VAL;
+ to->ext_cfg_r_data.y_step_size[0][i] = PDAF_INVALID_VAL;
+ to->ext_cfg_r_data.x_step_size[0][i] = PDAF_INVALID_VAL;
+ }
+}
+#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf.host.h
new file mode 100644
index 0000000..e0e9155
--- /dev/null
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf.host.h
@@ -0,0 +1,37 @@
+#ifndef ISP2401
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __IA_CSS_PDAF_HOST_H
+#define __IA_CSS_PDAF_HOST_H
+
+#include "ia_css_pdaf_types.h"
+#include "ia_css_pdaf_param.h"
+
+extern const struct ia_css_pdaf_config default_pdaf_config;
+
+void
+ia_css_pdaf_dmem_encode(
+ struct isp_pdaf_dmem_params *to,
+ const struct ia_css_pdaf_config *from,
+ unsigned size);
+
+void
+ia_css_pdaf_vmem_encode(
+ struct isp_pdaf_vmem_params *to,
+ const struct ia_css_pdaf_config *from,
+ unsigned size);
+
+#endif /* __IA_CSS_PDAF_HOST_H */
+#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf_param.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf_param.h
new file mode 100644
index 0000000..8535c9f
--- /dev/null
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf_param.h
@@ -0,0 +1,62 @@
+#ifndef ISP2401
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __IA_CSS_PDAF_PARAM_H
+#define __IA_CSS_PDAF_PARAM_H
+
+#define PDAF_INVALID_VAL 0x7FFF
+#include "vmem.h"
+
+struct isp_stats_calc_dmem_params {
+
+ uint16_t num_valid_elm;
+};
+/*
+ * Extraction configuration parameters
+ */
+
+struct isp_extraction_dmem_params {
+
+ uint8_t num_valid_patterns;
+};
+
+struct isp_extraction_vmem_params {
+
+ VMEM_ARRAY(y_step_size, ISP_VEC_NELEMS);
+ VMEM_ARRAY(y_offset, ISP_VEC_NELEMS);
+ VMEM_ARRAY(x_step_size, ISP_VEC_NELEMS);
+ VMEM_ARRAY(x_offset, ISP_VEC_NELEMS);
+};
+
+/*
+ * PDAF configuration parameters
+ */
+struct isp_pdaf_vmem_params {
+
+ struct isp_extraction_vmem_params ext_cfg_l_data;
+ struct isp_extraction_vmem_params ext_cfg_r_data;
+};
+
+struct isp_pdaf_dmem_params {
+
+ uint16_t frm_length;
+ uint16_t frm_width;
+ struct isp_stats_calc_dmem_params stats_calc_data;
+ struct isp_extraction_dmem_params ext_cfg_l_data;
+ struct isp_extraction_dmem_params ext_cfg_r_data;
+};
+
+#endif /* __IA_CSS_PDAF_PARAM_H */
+#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf_types.h
new file mode 100644
index 0000000..3e42877
--- /dev/null
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/pdaf/ia_css_pdaf_types.h
@@ -0,0 +1,54 @@
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __IA_CSS_PDAF_TYPES_H
+#define __IA_CSS_PDAF_TYPES_H
+
+#include "type_support.h"
+#include "isp2600_config.h"
+/*
+ * Header file for PDAF parameters
+ * These parameters shall be filled by host/driver
+ * and will be converted to ISP parameters in encode
+ * function.
+ */
+
+struct ia_css_statistics_calc_config {
+
+ uint16_t num_valid_elm;
+};
+struct ia_css_pixel_grid_config {
+
+ uint8_t num_valid_patterns;
+ int16_t y_step_size[ISP_NWAY];
+ int16_t y_offset[ISP_NWAY];
+ int16_t x_step_size[ISP_NWAY];
+ int16_t x_offset[ISP_NWAY];
+};
+
+struct ia_css_extraction_config {
+
+ struct ia_css_pixel_grid_config l_pixel_grid; /* Left PDAF pixel grid */
+ struct ia_css_pixel_grid_config r_pixel_grid; /* Right PDAF pixel grid */
+};
+
+struct ia_css_pdaf_config {
+
+ uint16_t frm_length;
+ uint16_t frm_width;
+ struct ia_css_extraction_config ext_cfg_data;
+ struct ia_css_statistics_calc_config stats_calc_cfg_data;
+};
+
+#endif /* __IA_CSS_PDAF_TYPES_H */
OpenPOWER on IntegriCloud