All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/24] atomisp: remove the iefd2 kernel
@ 2017-03-20 14:38 Alan Cox
  2017-03-20 14:38 ` [PATCH 02/24] atomisp: remove aa kernel wrappers Alan Cox
                   ` (22 more replies)
  0 siblings, 23 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:38 UTC (permalink / raw)
  To: greg, linux-media

While this is included and the headers pulled in nothing actually uses this
functionality in the driver, so remove it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../staging/media/atomisp/pci/atomisp2/Makefile    |    3 
 .../ia_css_isp_params.c                            |    1 
 .../ia_css_isp_states.h                            |    1 
 .../ia_css_isp_params.c                            |    1 
 .../ia_css_isp_states.h                            |    1 
 .../ia_css_isp_params.c                            |    1 
 .../ia_css_isp_states.h                            |    1 
 .../isp/kernels/iefd2_6/ia_css_iefd2_6.host.c      |  200 --------------------
 .../isp/kernels/iefd2_6/ia_css_iefd2_6.host.h      |   46 -----
 .../kernels/iefd2_6/ia_css_iefd2_6_default.host.c  |  144 --------------
 .../kernels/iefd2_6/ia_css_iefd2_6_default.host.h  |   23 --
 .../isp/kernels/iefd2_6/ia_css_iefd2_6_param.h     |   83 --------
 .../isp/kernels/iefd2_6/ia_css_iefd2_6_state.h     |   32 ---
 .../isp/kernels/iefd2_6/ia_css_iefd2_6_types.h     |  164 ----------------
 14 files changed, 701 deletions(-)
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6.host.c
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6.host.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_default.host.c
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_default.host.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_param.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_state.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_types.h

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/Makefile b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
index f538e56..162bcbf 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/Makefile
+++ b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
@@ -56,8 +56,6 @@ atomisp-objs += \
 	css2400/isp/kernels/macc/macc_1.0/ia_css_macc.host.o \
 	css2400/isp/kernels/macc/macc_1.0/ia_css_macc_table.host.o \
 	css2400/isp/kernels/csc/csc_1.0/ia_css_csc.host.o \
-	css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_default.host.o \
-	css2400/isp/kernels/iefd2_6/ia_css_iefd2_6.host.o \
 	css2400/isp/kernels/bnr/bnr_1.0/ia_css_bnr.host.o \
 	css2400/isp/kernels/bnr/bnr2_2/ia_css_bnr2_2.host.o \
 	css2400/isp/kernels/dpc2/ia_css_dpc2.host.o \
@@ -274,7 +272,6 @@ INCLUDES += \
 	-I$(atomisp)/css2400/isp/kernels/gc/gc_1.0/ \
 	-I$(atomisp)/css2400/isp/kernels/gc/gc_2/ \
 	-I$(atomisp)/css2400/isp/kernels/hdr/ \
-	-I$(atomisp)/css2400/isp/kernels/iefd2_6/ \
 	-I$(atomisp)/css2400/isp/kernels/io_ls/ \
 	-I$(atomisp)/css2400/isp/kernels/io_ls/bayer_io_ls/ \
 	-I$(atomisp)/css2400/isp/kernels/io_ls/common/ \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c
index 744e56e..8a35750 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c
@@ -51,7 +51,6 @@
 #include "isp/kernels/ynr/ynr_2/ia_css_ynr2.host.h"
 #include "isp/kernels/fc/fc_1.0/ia_css_formats.host.h"
 #include "isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.h"
-#include "isp/kernels/iefd2_6/ia_css_iefd2_6.host.h"
 #include "isp/kernels/dpc2/ia_css_dpc2.host.h"
 #include "isp/kernels/eed1_8/ia_css_eed1_8.host.h"
 #include "isp/kernels/bnlm/ia_css_bnlm.host.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.h
index d658a00..939dc36 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.h
@@ -22,7 +22,6 @@
 #include "isp/kernels/ref/ref_1.0/ia_css_ref.host.h"
 #include "isp/kernels/tnr/tnr_1.0/ia_css_tnr.host.h"
 #include "isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.h"
-#include "isp/kernels/iefd2_6/ia_css_iefd2_6.host.h"
 #include "isp/kernels/dpc2/ia_css_dpc2.host.h"
 #include "isp/kernels/eed1_8/ia_css_eed1_8.host.h"
 /* Generated code: do not edit or commmit. */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c
index fcc37d1..2672137 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c
@@ -52,7 +52,6 @@
 #include "isp/kernels/ynr/ynr_2/ia_css_ynr2.host.h"
 #include "isp/kernels/fc/fc_1.0/ia_css_formats.host.h"
 #include "isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.h"
-#include "isp/kernels/iefd2_6/ia_css_iefd2_6.host.h"
 #include "isp/kernels/dpc2/ia_css_dpc2.host.h"
 #include "isp/kernels/eed1_8/ia_css_eed1_8.host.h"
 #include "isp/kernels/bnlm/ia_css_bnlm.host.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.h
index d658a00..939dc36 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.h
@@ -22,7 +22,6 @@
 #include "isp/kernels/ref/ref_1.0/ia_css_ref.host.h"
 #include "isp/kernels/tnr/tnr_1.0/ia_css_tnr.host.h"
 #include "isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.h"
-#include "isp/kernels/iefd2_6/ia_css_iefd2_6.host.h"
 #include "isp/kernels/dpc2/ia_css_dpc2.host.h"
 #include "isp/kernels/eed1_8/ia_css_eed1_8.host.h"
 /* Generated code: do not edit or commmit. */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c
index fcc37d1..2672137 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c
@@ -52,7 +52,6 @@
 #include "isp/kernels/ynr/ynr_2/ia_css_ynr2.host.h"
 #include "isp/kernels/fc/fc_1.0/ia_css_formats.host.h"
 #include "isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.h"
-#include "isp/kernels/iefd2_6/ia_css_iefd2_6.host.h"
 #include "isp/kernels/dpc2/ia_css_dpc2.host.h"
 #include "isp/kernels/eed1_8/ia_css_eed1_8.host.h"
 #include "isp/kernels/bnlm/ia_css_bnlm.host.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.h
index d658a00..939dc36 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.h
@@ -22,7 +22,6 @@
 #include "isp/kernels/ref/ref_1.0/ia_css_ref.host.h"
 #include "isp/kernels/tnr/tnr_1.0/ia_css_tnr.host.h"
 #include "isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.h"
-#include "isp/kernels/iefd2_6/ia_css_iefd2_6.host.h"
 #include "isp/kernels/dpc2/ia_css_dpc2.host.h"
 #include "isp/kernels/eed1_8/ia_css_eed1_8.host.h"
 /* Generated code: do not edit or commmit. */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6.host.c
deleted file mode 100644
index 270f423..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6.host.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * 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_NO_DEBUG
-#include "ia_css_debug.h"
-#endif
-#include "ia_css_iefd2_6.host.h"
-
-/* Copy parameters to VMEM
- */
-void
-ia_css_iefd2_6_vmem_encode(
-	struct iefd2_6_vmem_params *to,
-	const struct ia_css_iefd2_6_config *from,
-	size_t size)
-{
-	const unsigned total_blocks = 4;
-	const unsigned shuffle_block = 16;
-	unsigned i, j, base;
-	(void)size;
-
-	/* For configurable units parameters are copied to vmem. Per CU 3 arrays are copied:
-	 * x containing the x coordinates
-	 * a containing the slopes
-	 * b containing the intercept values.
-	 *
-	 * A 64 element vector is split up in 4 blocks of 16 element. Each array is copied to
-	 * a vector 4 times, (starting at 0, 16, 32 and 48). All array elements are copied or
-	 * initialised as described in the KFS. The remaining elements of a vector are set to 0.
-	 */
-	/* first init the vectors */
-	for(i = 0; i < total_blocks*shuffle_block; i++) {
-		to->e_cued_x[0][i] = 0;
-		to->e_cued_a[0][i] = 0;
-		to->e_cued_b[0][i] = 0;
-
-		to->e_cu_dir_x[0][i] = 0;
-		to->e_cu_dir_a[0][i] = 0;
-		to->e_cu_dir_b[0][i] = 0;
-
-		to->e_cu_non_dir_x[0][i] = 0;
-		to->e_cu_non_dir_a[0][i] = 0;
-		to->e_cu_non_dir_b[0][i] = 0;
-
-		to->e_curad_x[0][i] = 0;
-		to->e_curad_a[0][i] = 0;
-		to->e_curad_b[0][i] = 0;
-	}
-
-	/* Copy all data */
-	for(i = 0; i < total_blocks; i++) {
-		base = shuffle_block*i;
-
-
-		to->e_cued_x[0][base] = 0;
-		to->e_cued_a[0][base] = 0;
-		to->e_cued_b[0][base] = from->cu_ed_slopes_b[0];
-
-		to->e_cu_dir_x[0][base] = 0;
-		to->e_cu_dir_a[0][base] = 0;
-		to->e_cu_dir_b[0][base] = from->cu_dir_sharp_slopes_b[0];
-
-		to->e_cu_non_dir_x[0][base] = 0;
-		to->e_cu_non_dir_a[0][base] = 0;
-		to->e_cu_non_dir_b[0][base] = from->cu_non_dir_sharp_slopes_b[0];
-
-		to->e_curad_x[0][base] = 0;
-		to->e_curad_a[0][base] = 0;
-		to->e_curad_b[0][base] = from->cu_radial_slopes_b[0];
-
-		for (j = 1; j < 4; j++) {
-			to->e_cu_dir_a[0][base+j] = from->cu_dir_sharp_slopes_a[j-1];
-			to->e_cu_dir_b[0][base+j] = from->cu_dir_sharp_slopes_b[j-1];
-			to->e_cu_non_dir_a[0][base+j] = from->cu_non_dir_sharp_slopes_a[j-1];
-			to->e_cu_non_dir_b[0][base+j] = from->cu_non_dir_sharp_slopes_b[j-1];
-		}
-
-		for (j = 1; j < 5; j++) {
-			to->e_cu_dir_x[0][base+j] = from->cu_dir_sharp_points_x[j-1];
-			to->e_cu_non_dir_x[0][base+j] = from->cu_non_dir_sharp_points_x[j-1];
-		}
-
-
-		for (j = 1; j < 6; j++) {
-			to->e_cued_x[0][base+j] = from->cu_ed_points_x[j-1];
-			to->e_cued_a[0][base+j] = from->cu_ed_slopes_a[j-1];
-			to->e_cued_b[0][base+j] = from->cu_ed_slopes_b[j-1];
-		}
-		to->e_cued_x[0][base+6] = from->cu_ed_points_x[5];
-
-		for (j = 1; j < 6; j++) {
-			to->e_curad_x[0][base+j] = from->cu_radial_points_x[j-1];
-			to->e_curad_a[0][base+j] = from->cu_radial_slopes_a[j-1];
-			to->e_curad_b[0][base+j] = from->cu_radial_slopes_b[j-1];
-		}
-		to->e_curad_x[0][base+6] = from->cu_radial_points_x[5];
-
-		/* Init asrrnd_lut */
-		to->asrrnd_lut[0][base] = 8192;
-		to->asrrnd_lut[0][base+1] = 4096;
-		to->asrrnd_lut[0][base+2] = 2048;
-		to->asrrnd_lut[0][base+3] = 1024;
-		to->asrrnd_lut[0][base+4] = 512;
-		to->asrrnd_lut[0][base+5] = 256;
-		to->asrrnd_lut[0][base+6] = 128;
-		to->asrrnd_lut[0][base+7] = 64;
-		to->asrrnd_lut[0][base+8] = 32;
-	}
-
-}
-
-void
-ia_css_iefd2_6_encode(
-	struct iefd2_6_dmem_params *to,
-	const struct ia_css_iefd2_6_config *from,
-	size_t size)
-{
-	(void)size;
-
-	/* Copy parameters to dmem, as described in the KFS
-	 */
-	to->horver_diag_coeff		= from->horver_diag_coeff;
-	to->ed_horver_diag_coeff	= from->ed_horver_diag_coeff;
-	to->dir_smooth_enable		= from->dir_smooth_enable;
-	to->dir_metric_update		= from->dir_metric_update;
-	to->unsharp_c00			= from->unsharp_c00;
-	to->unsharp_c01			= from->unsharp_c01;
-	to->unsharp_c02			= from->unsharp_c02;
-	to->unsharp_c11			= from->unsharp_c11;
-	to->unsharp_c12			= from->unsharp_c12;
-	to->unsharp_c22			= from->unsharp_c22;
-	to->unsharp_weight		= from->unsharp_weight;
-	to->unsharp_amount		= from->unsharp_amount;
-	to->cu_dir_sharp_pow		= from->cu_dir_sharp_pow;
-	to->cu_dir_sharp_pow_bright	= from->cu_dir_sharp_pow_bright;
-	to->cu_non_dir_sharp_pow	= from->cu_non_dir_sharp_pow;
-	to->cu_non_dir_sharp_pow_bright	= from->cu_non_dir_sharp_pow_bright;
-	to->dir_far_sharp_weight	= from->dir_far_sharp_weight;
-	to->rad_cu_dir_sharp_x1		= from->rad_cu_dir_sharp_x1;
-	to->rad_cu_non_dir_sharp_x1	= from->rad_cu_non_dir_sharp_x1;
-	to->rad_dir_far_sharp_weight	= from->rad_dir_far_sharp_weight;
-	to->sharp_nega_lmt_txt		= from->sharp_nega_lmt_txt;
-	to->sharp_posi_lmt_txt		= from->sharp_posi_lmt_txt;
-	to->sharp_nega_lmt_dir		= from->sharp_nega_lmt_dir;
-	to->sharp_posi_lmt_dir		= from->sharp_posi_lmt_dir;
-	to->clamp_stitch		= from->clamp_stitch;
-	to->rad_enable			= from->rad_enable;
-	to->rad_x_origin		= from->rad_x_origin;
-	to->rad_y_origin		= from->rad_y_origin;
-	to->rad_nf			= from->rad_nf;
-	to->rad_inv_r2			= from->rad_inv_r2;
-	to->vssnlm_enable		= from->vssnlm_enable;
-	to->vssnlm_x0			= from->vssnlm_x0;
-	to->vssnlm_x1			= from->vssnlm_x1;
-	to->vssnlm_x2			= from->vssnlm_x2;
-	to->vssnlm_y1			= from->vssnlm_y1;
-	to->vssnlm_y2			= from->vssnlm_y2;
-	to->vssnlm_y3			= from->vssnlm_y3;
-
-	/* Setup for configurable units */
-	to->e_cued2_a		= from->cu_ed2_slopes_a;
-	to->e_cu_vssnlm_a	= from->cu_vssnlm_slopes_a;
-	to->e_cued2_x1		= from->cu_ed2_points_x[0];
-	to->e_cued2_x_diff	= from->cu_ed2_points_x[1] - from->cu_ed2_points_x[0];
-	to->e_cu_vssnlm_x1	= from->cu_vssnlm_points_x[0];
-	to->e_cu_vssnlm_x_diff  = from->cu_vssnlm_points_x[1] - from->cu_vssnlm_points_x[0];
-}
-
-/* TODO: AM: This needs a proper implementation. */
-void
-ia_css_init_iefd2_6_state(
-	void *state,
-	size_t size)
-{
-	(void)state;
-	(void)size;
-}
-
-#ifndef IA_CSS_NO_DEBUG
-/* TODO: AM: This needs a proper implementation. */
-void
-ia_css_iefd2_6_debug_dtrace(
-	const struct ia_css_iefd2_6_config *config,
-	unsigned level)
-{
-	(void)config;
-	(void)level;
-}
-#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6.host.h
deleted file mode 100644
index 580d51fe..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6.host.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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_IEFD2_6_HOST_H
-#define __IA_CSS_IEFD2_6_HOST_H
-
-#include "ia_css_iefd2_6_types.h"
-#include "ia_css_iefd2_6_param.h"
-#include "ia_css_iefd2_6_default.host.h"
-
-void
-ia_css_iefd2_6_vmem_encode(
-	struct iefd2_6_vmem_params *to,
-	const struct ia_css_iefd2_6_config *from,
-	size_t size);
-
-void
-ia_css_iefd2_6_encode(
-	struct iefd2_6_dmem_params *to,
-	const struct ia_css_iefd2_6_config *from,
-	size_t size);
-
-void
-ia_css_init_iefd2_6_state(
-	void *state,
-	size_t size);
-
-#ifndef IA_CSS_NO_DEBUG
-void
-ia_css_iefd2_6_debug_dtrace(
-	const struct ia_css_iefd2_6_config *config, unsigned level)
-;
-#endif
-
-#endif /* __IA_CSS_IEFD2_6_HOST_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_default.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_default.host.c
deleted file mode 100644
index b43ffd8..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_default.host.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * 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_iefd2_6_types.h"
-
-const struct ia_css_iefd2_6_config default_iefd2_6_config = {
-	.horver_diag_coeff = 45,
-	.ed_horver_diag_coeff = 64,
-	.dir_smooth_enable = true,
-	.dir_metric_update = 16,
-	.unsharp_c00 = 60,
-	.unsharp_c01 = 30,
-	.unsharp_c02 = 16,
-	.unsharp_c11 = 1,
-	.unsharp_c12 = 2,
-	.unsharp_c22 = 0,
-	.unsharp_weight = 32,
-	.unsharp_amount = 128,
-	.cu_dir_sharp_pow = 20,
-	.cu_dir_sharp_pow_bright = 20,
-	.cu_non_dir_sharp_pow = 24,
-	.cu_non_dir_sharp_pow_bright = 24,
-	.dir_far_sharp_weight = 2,
-	.rad_cu_dir_sharp_x1 = 0,
-	.rad_cu_non_dir_sharp_x1 = 128,
-	.rad_dir_far_sharp_weight = 8,
-	.sharp_nega_lmt_txt = 1024,
-	.sharp_posi_lmt_txt = 1024,
-	.sharp_nega_lmt_dir = 128,
-	.sharp_posi_lmt_dir = 128,
-	.clamp_stitch = 0,
-	.rad_enable = true,
-	.rad_x_origin = 0,
-	.rad_y_origin = 0,
-	.rad_nf = 7,
-	.rad_inv_r2 = 157,
-	.vssnlm_enable = true,
-	.vssnlm_x0 = 24,
-	.vssnlm_x1 = 96,
-	.vssnlm_x2 = 172,
-	.vssnlm_y1 = 1,
-	.vssnlm_y2 = 3,
-	.vssnlm_y3 = 8,
-	.cu_ed_points_x = {
-		0,
-		256,
-		656,
-		2456,
-		3272,
-		4095
-		},
-	.cu_ed_slopes_a = {
-		4,
-		160,
-		0,
-		0,
-		0
-		},
-	.cu_ed_slopes_b = {
-		0,
-		9,
-		510,
-		511,
-		511
-		},
-	.cu_ed2_points_x = {
-		218,
-		308
-		},
-	.cu_ed2_slopes_a = 11,
-	.cu_ed2_slopes_b = 0,
-	.cu_dir_sharp_points_x = {
-		247,
-		298,
-		342,
-		448
-		},
-	.cu_dir_sharp_slopes_a = {
-		14,
-		4,
-		0
-		},
-	.cu_dir_sharp_slopes_b = {
-		1,
-		46,
-		58
-		},
-	.cu_non_dir_sharp_points_x = {
-		26,
-		45,
-		81,
-		500
-		},
-	.cu_non_dir_sharp_slopes_a = {
-		39,
-		7,
-		0
-		},
-	.cu_non_dir_sharp_slopes_b = {
-		1,
-		47,
-		63
-		},
-	.cu_radial_points_x = {
-		50,
-		86,
-		142,
-		189,
-		224,
-		255
-		},
-	.cu_radial_slopes_a = {
-		713,
-		278,
-		295,
-		286,
-		-1
-		},
-	.cu_radial_slopes_b = {
-		1,
-		101,
-		162,
-		216,
-		255
-		},
-	.cu_vssnlm_points_x = {
-		100,
-		141
-		},
-	.cu_vssnlm_slopes_a = 25,
-	.cu_vssnlm_slopes_b = 0
-};
-
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_default.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_default.host.h
deleted file mode 100644
index 38f06de..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_default.host.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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_IEFD2_6_DEFAULT_HOST_H
-#define __IA_CSS_IEFD2_6_DEFAULT_HOST_H
-
-#include "ia_css_iefd2_6_types.h"
-
-extern const struct ia_css_iefd2_6_config default_iefd2_6_config;
-
-#endif /* __IA_CSS_IEFD2_6_DEFAULT_HOST_H */
-
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_param.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_param.h
deleted file mode 100644
index 3079096..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_param.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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_IEFD2_6_PARAM_H
-#define __IA_CSS_IEFD2_6_PARAM_H
-
-#include "type_support.h"
-#include "vmem.h" /* needed for VMEM_ARRAY */
-
-struct iefd2_6_vmem_params {
-	VMEM_ARRAY(e_cued_x, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_cued_a, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_cued_b, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_cu_dir_x, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_cu_dir_a, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_cu_dir_b, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_cu_non_dir_x, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_cu_non_dir_a, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_cu_non_dir_b, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_curad_x, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_curad_a, ISP_VEC_NELEMS);
-	VMEM_ARRAY(e_curad_b, ISP_VEC_NELEMS);
-	VMEM_ARRAY(asrrnd_lut, ISP_VEC_NELEMS);
-};
-
-struct iefd2_6_dmem_params {
-	int32_t horver_diag_coeff;
-	int32_t ed_horver_diag_coeff;
-	bool dir_smooth_enable;
-	int32_t dir_metric_update;
-	int32_t unsharp_c00;
-	int32_t unsharp_c01;
-	int32_t unsharp_c02;
-	int32_t unsharp_c11;
-	int32_t unsharp_c12;
-	int32_t unsharp_c22;
-	int32_t unsharp_weight;
-	int32_t unsharp_amount;
-	int32_t cu_dir_sharp_pow;
-	int32_t cu_dir_sharp_pow_bright;
-	int32_t cu_non_dir_sharp_pow;
-	int32_t cu_non_dir_sharp_pow_bright;
-	int32_t dir_far_sharp_weight;
-	int32_t rad_cu_dir_sharp_x1;
-	int32_t rad_cu_non_dir_sharp_x1;
-	int32_t rad_dir_far_sharp_weight;
-	int32_t sharp_nega_lmt_txt;
-	int32_t sharp_posi_lmt_txt;
-	int32_t sharp_nega_lmt_dir;
-	int32_t sharp_posi_lmt_dir;
-	int32_t clamp_stitch;
-	bool rad_enable;
-	int32_t rad_x_origin;
-	int32_t rad_y_origin;
-	int32_t rad_nf;
-	int32_t rad_inv_r2;
-	bool vssnlm_enable;
-	int32_t vssnlm_x0;
-	int32_t vssnlm_x1;
-	int32_t vssnlm_x2;
-	int32_t vssnlm_y1;
-	int32_t vssnlm_y2;
-	int32_t vssnlm_y3;
-	int32_t e_cued2_a;
-	int32_t e_cued2_x1;
-	int32_t e_cued2_x_diff;
-	int32_t e_cu_vssnlm_a;
-	int32_t e_cu_vssnlm_x1;
-	int32_t e_cu_vssnlm_x_diff;
-};
-
-#endif /* __IA_CSS_IEFD2_6_PARAM_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_state.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_state.h
deleted file mode 100644
index 0915f14..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_state.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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_IEFD2_6_STATE_H
-#define _IA_CSS_IEFD2_6_STATE_H
-
-#include "type_support.h"
-#include "vmem.h" /* for VMEM_ARRAY*/
-#include "iefd2_6_vssnlm.isp.h"
-#include "iefd2_6.isp.h"
-
-struct iefd2_6_vmem_state {
-	/* State buffers required for main IEFD2_6 */
-	VMEM_ARRAY(iefd2_6_input_lines[IEFD2_6_STATE_INPUT_BUFFER_HEIGHT], IEFD2_6_STATE_INPUT_BUFFER_WIDTH*ISP_NWAY);
-	/* State buffers required for VSSNLM sub-kernel */
-	VMEM_ARRAY(vssnlm_input_y[VSSNLM_STATE_INPUT_BUFFER_HEIGHT], VSSNLM_STATE_INPUT_BUFFER_WIDTH*ISP_NWAY);
-	VMEM_ARRAY(vssnlm_input_diff_grad[1], VSSNLM_STATE_INPUT_BUFFER_WIDTH*ISP_NWAY);
-};
-
-#endif /* _IA_CSS_IEFD2_6_STATE_H */
-
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_types.h
deleted file mode 100644
index b0eadab..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/iefd2_6/ia_css_iefd2_6_types.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * 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_IEFD2_6_TYPES_H
-#define __IA_CSS_IEFD2_6_TYPES_H
-
-/** @file
-* CSS-API header file for Image Enhancement Filter directed algorithm parameters.
-*/
-
-#include "type_support.h"
-
-/** Image Enhancement Filter directed configuration
- *
- * ISP2.6.1: IEFd2_6 is used.
- */
-
-struct ia_css_iefd2_6_config {
-	int32_t horver_diag_coeff;	   /**< Coefficient that compensates for different
-						distance for vertical/horizontal and
-						diagonal gradient calculation (~1/sqrt(2)).
-						u1.6, [0,64], default 45, ineffective 0 */
-	int32_t ed_horver_diag_coeff;	   /**< Radial Coefficient that compensates for
-						different distance for vertical/horizontal
-						and diagonal gradient calculation (~1/sqrt(2)).
-						u1.6, [0,64], default 64, ineffective 0 */
-	bool dir_smooth_enable;		   /**< Enable smooth best direction with second best.
-						bool, [false, true], default true, ineffective false */
-	int32_t dir_metric_update;	   /**< Update coefficient for direction metric.
-						u1.4, [0,31], default 16, ineffective 0 */
-	int32_t unsharp_c00;		   /**< Unsharp Mask filter coefs 0,0 (center).
-						s0.8, [-256,255], default 60, ineffective 255 */
-	int32_t unsharp_c01;		   /**< Unsharp Mask filter coefs 0,1.
-						s0.8, [-256,255], default 30, ineffective 0 */
-	int32_t unsharp_c02;		   /**< Unsharp Mask filter coefs 0,2.
-						s0.8, [-256,255], default 16, ineffective 0 */
-	int32_t unsharp_c11;		   /**< Unsharp Mask filter coefs 1,1.
-						s0.8, [-256,255], default 1, ineffective 0 */
-	int32_t unsharp_c12;		   /**< Unsharp Mask filter coefs 1,2.
-						s1.8, [-512,511], default 2, ineffective 0 */
-	int32_t unsharp_c22;		   /**< Unsharp Mask filter coefs 2,2.
-						s0.8, [-256,255], default 0, ineffective 0 */
-	int32_t unsharp_weight;		   /**< Unsharp Mask blending weight.
-						u1.12, [0,4096], default 32, ineffective 0 */
-	int32_t unsharp_amount;		   /**< Unsharp Mask amount.
-						u3.6, [0,511], default 128, ineffective 0 */
-	int32_t cu_dir_sharp_pow;	   /**< Power of cu_dir_sharp (power of direct sharpening).
-						u2.4, [0,63], default 20, ineffective 0 */
-	int32_t cu_dir_sharp_pow_bright;   /**< Power of cu_dir_sharp (power of direct sharpening) for
-						Bright.
-						u2.4, [0,63], default 20, ineffective 0 */
-	int32_t cu_non_dir_sharp_pow;	   /**< Power of cu_non_dir_sharp (power of unsharp mask).
-						u2.4, [0,63], default 24, ineffective 0 */
-	int32_t cu_non_dir_sharp_pow_bright;	   /**< Power of cu_non_dir_sharp (power of unsharp mask)
-							for Bright.
-							u2.4, [0,63], default 24, ineffective 0 */
-	int32_t dir_far_sharp_weight;	   /**< Weight of wide direct sharpening.
-						u1.12, [0,4096], default 2, ineffective 0 */
-	int32_t rad_cu_dir_sharp_x1;	   /**< X1point of cu_dir_sharp for radial/corner point.
-						u9.0, [0,511], default 0, ineffective 0 */
-	int32_t rad_cu_non_dir_sharp_x1;   /**< X1 point for cu_non_dir_sharp for radial/corner point.
-						u9.0, [0,511], default 128, ineffective 0 */
-	int32_t rad_dir_far_sharp_weight;  /**< Weight of wide direct sharpening.
-						u1.12, [0,4096], default 8, ineffective 0 */
-	int32_t sharp_nega_lmt_txt;	   /**< Sharpening limit for negative overshoots for texture.
-						u13.0, [0,8191], default 1024, ineffective 0 */
-	int32_t sharp_posi_lmt_txt;	   /**< Sharpening limit for positive overshoots for texture.
-						u13.0, [0,8191], default 1024, ineffective 0 */
-	int32_t sharp_nega_lmt_dir;	   /**< Sharpening limit for negative overshoots for direction
-						(edge).
-						u13.0, [0,8191], default 128, ineffective 0 */
-	int32_t sharp_posi_lmt_dir;	   /**< Sharpening limit for positive overshoots for direction
-						(edge).
-						u13.0, [0,8191], default 128, ineffective 0 */
-	int32_t clamp_stitch;		   /**< Slope to stitch between clamped and unclamped edge values.
-						u6.0, [0,63], default 0, ineffective 0 */
-	bool rad_enable;		   /**< Enable bit to update radial dependent parameters.
-						bool, [false,true], default true, ineffective false */
-	int32_t rad_x_origin;		   /**< Initial x coord. for radius computation.
-						s13.0, [-8192,8191], default 0, ineffective 0 */
-	int32_t rad_y_origin;		   /**< Initial y coord. for radius computation.
-						s13.0, [-8192,8191], default 0, ineffective 0 */
-	int32_t rad_nf;			   /**< Radial. R^2 normalization factor is scale down by
-						2^-(15+scale).
-						u4.0, [0,15], default 7, ineffective 0 */
-	int32_t rad_inv_r2;		   /**< Radial R^-2 normelized to (0.5..1).
-						u(8-m_rad_NF).m_rad_NF, [0,255], default 157,
-						ineffective 0 */
-	bool vssnlm_enable;		   /**< Enable bit to use VSSNLM output filter.
-						bool, [false, true], default true, ineffective false */
-	int32_t vssnlm_x0;		   /**< Vssnlm LUT x0.
-						u8.0, [0,255], default 24, ineffective 0 */
-	int32_t vssnlm_x1;		   /**< Vssnlm LUT x1.
-						u8.0, [0,255], default 96, ineffective 0 */
-	int32_t vssnlm_x2;		   /**< Vssnlm LUT x2.
-						u8.0, [0,255], default 172, ineffective 0 */
-	int32_t vssnlm_y1;		   /**< Vssnlm LUT y1.
-						u4.0, [0,8], default 1, ineffective 8 */
-	int32_t vssnlm_y2;		   /**< Vssnlm LUT y2.
-						u4.0, [0,8], default 3, ineffective 8 */
-	int32_t vssnlm_y3;		   /**< Vssnlm LUT y3.
-						u4.0, [0,8], default 8, ineffective 8 */
-	int32_t cu_ed_points_x[6];	   /**< PointsX of config unit ED.
-						u0.12, [0,4095], default 0,256,656,2456,3272,4095,
-						ineffective 0,0,0,0,0,0 */
-	int32_t cu_ed_slopes_a[5];	   /**< SlopesA of config unit ED.
-						s6.7, [-8192, 8191], default 4,160,0,0,0,
-						ineffective 0,0,0,0,0 */
-	int32_t cu_ed_slopes_b[5];	   /**< SlopesB of config unit ED.
-						u0.9, [0,511], default 0,9,510,511,511,
-						ineffective 0,0,0,0,0 */
-	int32_t cu_ed2_points_x[2];	   /**< PointsX of config unit ED2..
-						u0.9, [0,511], default 218,308, ineffective 0,0 */
-	int32_t cu_ed2_slopes_a;	   /**< SlopesA of config unit ED2.
-						s7,4, [-1024, 1024]. default 11, ineffective 0 */
-	int32_t cu_ed2_slopes_b;	   /**< SlopesB of config unit ED2.
-						u1.6, [0,0], default 0, ineffective 0 */
-	int32_t cu_dir_sharp_points_x[4];  /**< PointsX of config unit DirSharp.
-						u0.9, [0,511], default 247,298,342,448,
-						ineffective 0,0,0,0 */
-	int32_t cu_dir_sharp_slopes_a[3];  /**< SlopesA of config unit DirSharp
-						s7,4, [0,511], default 14,4,0, ineffective 0,0,0 */
-	int32_t cu_dir_sharp_slopes_b[3];  /**< SlopesB of config unit DirSharp.
-						u1.6, [0,64], default 1,46,58, ineffective 0,0,0 */
-	int32_t cu_non_dir_sharp_points_x[4];	   /**< PointsX of config unit NonDirSharp.
-							u0.9, [0,511], default 26,45,81,500,
-							ineffective 0,0,0,0 */
-	int32_t cu_non_dir_sharp_slopes_a[3];	   /**< SlopesA of config unit NonDirSharp.
-							s7.4, [-1024, 1024], default 39,7,0,
-							ineffective 0,0,0 */
-	int32_t cu_non_dir_sharp_slopes_b[3];	   /**< SlopesB of config unit NonDirSharp.
-							u1.6, [0,64], default 1,47,63,
-							ineffective 0,0,0 */
-	int32_t cu_radial_points_x[6];	   /**< PointsX of Config Unit Radial.
-						u0.8, [0,255], default 50,86,142,189,224,255,
-						ineffective 0,0,0,0,0,0 */
-	int32_t cu_radial_slopes_a[5];	   /**< SlopesA of Config Unit Radial.
-						s5.8, [-8192, 8191], default 713,278,295,286,-1,
-						ineffective 0,0,0,0,0 */
-	int32_t cu_radial_slopes_b[5];	   /**< SlopesB of Config Unit Radial.
-						u0.8, [0,255], default 1,101,162,216,255,
-						ineffective 0,0,0,0,0 */
-	int32_t cu_vssnlm_points_x[2];	   /**< PointsX of config unit VSSNLM.
-						u0.9, [0,511], default 100,141, ineffective 0,0 */
-	int32_t cu_vssnlm_slopes_a;	   /**< SlopesA of config unit VSSNLM.
-						s7.4, [-1024,1024], default 25, ineffective 0 */
-	int32_t cu_vssnlm_slopes_b;	   /**< SlopesB of config unit VSSNLM.
-						u1.6, [0,0], default 0, ineffective 0 */
-};
-
-
-#endif /* __IA_CSS_IEFD2_6_TYPES_H */
-

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 02/24] atomisp: remove aa kernel wrappers
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
@ 2017-03-20 14:38 ` Alan Cox
  2017-03-20 14:38 ` [PATCH 03/24] atomisp: remove the unused debug wrapping from the mmgr layer Alan Cox
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:38 UTC (permalink / raw)
  To: greg, linux-media

The aa kernel is used but it consists of nothing more than a set of wrappers
for a memset and an assignment. Replace these at the calling points with the
memset and assignment.

Keep the structures for now - those should disappear as the next layer up
gets unwrapped.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../ia_css_isp_params.c                            |   29 +++++------------
 .../ia_css_isp_states.c                            |    7 +---
 .../ia_css_isp_params.c                            |   27 ++++------------
 .../ia_css_isp_states.c                            |    8 +----
 .../ia_css_isp_params.c                            |   27 ++++------------
 .../ia_css_isp_states.c                            |    8 +----
 .../css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.c  |   34 --------------------
 .../css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.h  |   23 --------------
 .../atomisp/pci/atomisp2/css2400/sh_css_params.c   |    2 -
 9 files changed, 26 insertions(+), 139 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c
index 8a35750..9620bc3 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c
@@ -70,27 +70,16 @@ ia_css_process_aa(
 	const struct ia_css_pipeline_stage *stage,
 	struct ia_css_isp_parameters *params)
 {
-	assert(params != NULL);
-
-	{
-		unsigned size   = stage->binary->info->mem_offsets.offsets.param->dmem.aa.size;
-
-		unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.aa.offset;
-
-		if (size) {
-			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_aa() enter:\n");
-
-			ia_css_aa_encode((struct sh_css_isp_aa_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset],
-					&params->aa_config,
-size);
-			params->isp_params_changed = true;
-			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = true;
-
-			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_aa() leave:\n");
-		}
+	unsigned size   = stage->binary->info->mem_offsets.offsets.param->dmem.aa.size;
+	unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.aa.offset;
 
+	if (size) {
+		struct sh_css_isp_aa_params *t =  (struct sh_css_isp_aa_params *)
+				&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset];
+		t->strength = params->aa_config.strength;
 	}
+	params->isp_params_changed = true;
+	params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = true;
 }
 
 /* Code generated by genparam/gencode.c:gen_process_function() */
@@ -2214,7 +2203,6 @@ ia_css_get_aa_config(const struct ia_css_isp_parameters *params,
 	*config = params->aa_config;
 
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_get_aa_config() leave\n");
-	ia_css_aa_debug_dtrace(config, IA_CSS_DEBUG_TRACE);
 }
 
 /* Code generated by genparam/gencode.c:gen_set_function() */
@@ -2228,7 +2216,6 @@ ia_css_set_aa_config(struct ia_css_isp_parameters *params,
 
 	assert(params != NULL);
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_set_aa_config() enter:\n");
-	ia_css_aa_debug_dtrace(config, IA_CSS_DEBUG_TRACE);
 	params->aa_config = *config;
 	params->config_changed[IA_CSS_AA_ID] = true;
 #ifndef ISP2401
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.c
index 471ceba..fb3ba08 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.c
@@ -31,11 +31,8 @@ ia_css_initialize_aa_state(
 
 		unsigned offset = binary->info->mem_offsets.offsets.state->vmem.aa.offset;
 
-		if (size) {
-			ia_css_init_aa_state(
-				&binary->mem_params.params[IA_CSS_PARAM_CLASS_STATE][IA_CSS_ISP_VMEM].address[offset],
-				size);
-		}
+		if (size)
+			memset(&binary->mem_params.params[IA_CSS_PARAM_CLASS_STATE][IA_CSS_ISP_VMEM].address[offset], 0, size);
 
 	}
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_initialize_aa_state() leave:\n");
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c
index 2672137..87a3308 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c
@@ -71,26 +71,13 @@ ia_css_process_aa(
 	const struct ia_css_pipeline_stage *stage,
 	struct ia_css_isp_parameters *params)
 {
-	assert(params != NULL);
-
-	{
-		unsigned size   = stage->binary->info->mem_offsets.offsets.param->dmem.aa.size;
-
-		unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.aa.offset;
-
-		if (size) {
-			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_aa() enter:\n");
-
-			ia_css_aa_encode((struct sh_css_isp_aa_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset],
-					&params->aa_config,
-size);
-			params->isp_params_changed = true;
-			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = true;
-
-			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_aa() leave:\n");
-		}
+	unsigned size   = stage->binary->info->mem_offsets.offsets.param->dmem.aa.size;
+	unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.aa.offset;
 
+	if (size) {
+		struct sh_css_isp_aa_params *t =  (struct sh_css_isp_aa_params *)
+			&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset];
+		t->strength = params->aa_config.strength;
 	}
 }
 
@@ -2215,7 +2202,6 @@ ia_css_get_aa_config(const struct ia_css_isp_parameters *params,
 	*config = params->aa_config;
 
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_get_aa_config() leave\n");
-	ia_css_aa_debug_dtrace(config, IA_CSS_DEBUG_TRACE);
 }
 
 /* Code generated by genparam/gencode.c:gen_set_function() */
@@ -2229,7 +2215,6 @@ ia_css_set_aa_config(struct ia_css_isp_parameters *params,
 
 	assert(params != NULL);
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_set_aa_config() enter:\n");
-	ia_css_aa_debug_dtrace(config, IA_CSS_DEBUG_TRACE);
 	params->aa_config = *config;
 	params->config_changed[IA_CSS_AA_ID] = true;
 #ifndef ISP2401
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.c
index a445d4f..e87d05b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.c
@@ -29,14 +29,10 @@ ia_css_initialize_aa_state(
 
 	{
 		unsigned size   = binary->info->mem_offsets.offsets.state->vmem.aa.size;
-
 		unsigned offset = binary->info->mem_offsets.offsets.state->vmem.aa.offset;
 
-		if (size) {
-			ia_css_init_aa_state(
-				&binary->mem_params.params[IA_CSS_PARAM_CLASS_STATE][IA_CSS_ISP_VMEM].address[offset],
-				size);
-		}
+		if (size)
+			memset(&binary->mem_params.params[IA_CSS_PARAM_CLASS_STATE][IA_CSS_ISP_VMEM].address[offset], 0, size);
 
 	}
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_initialize_aa_state() leave:\n");
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c
index 2672137..87a3308 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c
@@ -71,26 +71,13 @@ ia_css_process_aa(
 	const struct ia_css_pipeline_stage *stage,
 	struct ia_css_isp_parameters *params)
 {
-	assert(params != NULL);
-
-	{
-		unsigned size   = stage->binary->info->mem_offsets.offsets.param->dmem.aa.size;
-
-		unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.aa.offset;
-
-		if (size) {
-			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_aa() enter:\n");
-
-			ia_css_aa_encode((struct sh_css_isp_aa_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset],
-					&params->aa_config,
-size);
-			params->isp_params_changed = true;
-			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = true;
-
-			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_aa() leave:\n");
-		}
+	unsigned size   = stage->binary->info->mem_offsets.offsets.param->dmem.aa.size;
+	unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.aa.offset;
 
+	if (size) {
+		struct sh_css_isp_aa_params *t =  (struct sh_css_isp_aa_params *)
+			&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset];
+		t->strength = params->aa_config.strength;
 	}
 }
 
@@ -2215,7 +2202,6 @@ ia_css_get_aa_config(const struct ia_css_isp_parameters *params,
 	*config = params->aa_config;
 
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_get_aa_config() leave\n");
-	ia_css_aa_debug_dtrace(config, IA_CSS_DEBUG_TRACE);
 }
 
 /* Code generated by genparam/gencode.c:gen_set_function() */
@@ -2229,7 +2215,6 @@ ia_css_set_aa_config(struct ia_css_isp_parameters *params,
 
 	assert(params != NULL);
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_set_aa_config() enter:\n");
-	ia_css_aa_debug_dtrace(config, IA_CSS_DEBUG_TRACE);
 	params->aa_config = *config;
 	params->config_changed[IA_CSS_AA_ID] = true;
 #ifndef ISP2401
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.c
index a445d4f..e87d05b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.c
@@ -29,14 +29,10 @@ ia_css_initialize_aa_state(
 
 	{
 		unsigned size   = binary->info->mem_offsets.offsets.state->vmem.aa.size;
-
 		unsigned offset = binary->info->mem_offsets.offsets.state->vmem.aa.offset;
 
-		if (size) {
-			ia_css_init_aa_state(
-				&binary->mem_params.params[IA_CSS_PARAM_CLASS_STATE][IA_CSS_ISP_VMEM].address[offset],
-				size);
-		}
+		if (size)
+			memset(&binary->mem_params.params[IA_CSS_PARAM_CLASS_STATE][IA_CSS_ISP_VMEM].address[offset], 0, size);
 
 	}
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_initialize_aa_state() leave:\n");
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.c
index 942ebe0..f7dd256 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.c
@@ -30,37 +30,3 @@ const struct ia_css_aa_config default_baa_config = {
 	8191 /* default should be 0 */
 };
 
-void
-ia_css_aa_encode(
-	struct sh_css_isp_aa_params *to,
-	const struct ia_css_aa_config *from,
-	unsigned size)
-{
-	(void)size;
-	to->strength = from->strength;
-}
-
-void
-ia_css_init_aa_state(
-	void *state,
-	size_t size)
-{
-	memset(state, 0, size);
-}
-
-#ifndef IA_CSS_NO_DEBUG
-void
-ia_css_aa_dump(
-	const struct sh_css_isp_aa_params *aa,
-	unsigned level);
-
-void
-ia_css_aa_debug_dtrace(
-	const struct ia_css_aa_config *config,
-	unsigned level)
-{
-	ia_css_debug_dtrace(level,
-		"config.strength=%d\n",
-		config->strength);
-}
-#endif /* IA_CSS_NO_DEBUG */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.h
index c3785e0..71587d8 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/aa/aa_2/ia_css_aa2.host.h
@@ -24,27 +24,4 @@ extern const struct ia_css_aa_config default_aa_config;
 /* Bayer Anti-Aliasing configuration. */
 extern const struct ia_css_aa_config default_baa_config;
 
-void
-ia_css_aa_encode(
-	struct sh_css_isp_aa_params *to,
-	const struct ia_css_aa_config *from,
-	unsigned size);
-
-void
-ia_css_init_aa_state(
-	void *state,
-	size_t size);
-
-#ifndef IA_CSS_NO_DEBUG
-void
-ia_css_aa_dump(
-	const struct sh_css_isp_aa_params *aa,
-	unsigned level);
-
-void
-ia_css_aa_debug_dtrace(
-	const struct ia_css_aa_config *config,
-	unsigned level);
-#endif /* IA_CSS_NO_DEBUG */
-
 #endif /* __IA_CSS_AA_HOST_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c
index 9d51f1c..e4599f7 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c
@@ -2326,7 +2326,6 @@ sh_css_set_baa_config(struct ia_css_isp_parameters *params,
 	assert(params != NULL);
 
 	IA_CSS_ENTER_PRIVATE("config=%p", config);
-	ia_css_aa_debug_dtrace(config, IA_CSS_DEBUG_TRACE);
 
 	params->bds_config = *config;
 	params->config_changed[IA_CSS_BDS_ID] = true;
@@ -2346,7 +2345,6 @@ sh_css_get_baa_config(const struct ia_css_isp_parameters *params,
 
 	*config = params->bds_config;
 
-	ia_css_aa_debug_dtrace(config, IA_CSS_DEBUG_TRACE);
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 03/24] atomisp: remove the unused debug wrapping from the mmgr layer
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
  2017-03-20 14:38 ` [PATCH 02/24] atomisp: remove aa kernel wrappers Alan Cox
@ 2017-03-20 14:38 ` Alan Cox
  2017-03-20 14:38 ` [PATCH 04/24] atomisp: remove another layer of allocator indirection Alan Cox
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:38 UTC (permalink / raw)
  To: greg, linux-media

We don't need this layer of indirection and the debugging information is not used. With
this removed we can then go on to try and remove the abstraction layer entirely.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../memory_access/memory_access.h                  |   80 +++-----------------
 .../pci/atomisp2/css2400/ia_css_memory_access.c    |   30 ++------
 2 files changed, 20 insertions(+), 90 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_access/memory_access.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_access/memory_access.h
index e78d462..54ab3d9 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_access/memory_access.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/memory_access/memory_access.h
@@ -1,6 +1,6 @@
 /*
  * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
+ * Copyright (c) 2015-2017, 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,
@@ -74,7 +74,7 @@
  * within the allocation referencable from the
  * returned pointer/address.
  */
-#define MMGR_ATTRIBUTE_MASK			0x000f
+#define MMGR_ATTRIBUTE_MASK		0x000f
 #define MMGR_ATTRIBUTE_CACHED		0x0001
 #define MMGR_ATTRIBUTE_CONTIGUOUS	0x0002
 #define MMGR_ATTRIBUTE_PAGEALIGN	0x0004
@@ -87,78 +87,43 @@
 extern const hrt_vaddress	mmgr_NULL;
 extern const hrt_vaddress	mmgr_EXCEPTION;
 
-/*! Set the (sub)system virtual memory page table base address
-
- \param	base_addr[in]		The address where page table 0 is located
-
- \Note: The base_addr is an absolute system address, thus it is not
-        relative to the DDR base address
-
- \return none,
- */
-extern void mmgr_set_base_address(
-	const sys_address		base_addr);
-
 /*! Return the address of an allocation in memory
 
- \param	size[in]			Size in bytes of the allocation
+ \param	size[in]		Size in bytes of the allocation
  \param	caller_func[in]		Caller function name
  \param	caller_line[in]		Caller function line number
 
  \return vaddress
  */
-#define mmgr_malloc(__size) mmgr_malloc_ex(__size, __func__, __LINE__)
-extern hrt_vaddress mmgr_malloc_ex(
-	const size_t			size,
-	const char				*caller_func,
-	int						caller_line);
+extern hrt_vaddress mmgr_malloc(const size_t size);
 
 /*! Return the address of a zero initialised allocation in memory
 
  \param	N[in]			Horizontal dimension of array
  \param	size[in]		Vertical dimension of array  Total size is N*size
- \param	caller_func[in]		Caller function name
- \param	caller_line[in]		Caller function line number
 
  \return vaddress
  */
-#define mmgr_calloc(__N, __size) mmgr_calloc_ex(__N, __size, __func__, __LINE__)
-extern hrt_vaddress mmgr_calloc_ex(
-	const size_t			N,
-	const size_t			size,
-	const char				*caller_func,
-	int						caller_line);
+extern hrt_vaddress mmgr_calloc(const size_t N, const size_t size);
 
 /*! Free the memory allocation identified by the address
 
  \param	vaddr[in]		Address of the allocation
- \param	caller_func[in]		Caller function name
- \param	caller_line[in]		Caller function line number
 
  \return vaddress
  */
-#define mmgr_free(__vaddr) mmgr_free_ex(__vaddr, __func__, __LINE__)
-extern void mmgr_free_ex(
-	hrt_vaddress			vaddr,
-	const char				*caller_func,
-	int						caller_line);
+extern void mmgr_free(hrt_vaddress vaddr);
 
 /*! Return the address of an allocation in memory
 
  \param	size[in]		Size in bytes of the allocation
  \param	attribute[in]		Bit vector specifying the properties
 				of the allocation including zero initialisation
- \param	caller_func[in]		Caller function name
- \param	caller_line[in]		Caller function line number
 
  \return vaddress
  */
-#define mmgr_alloc_attr(__size, __attribute) mmgr_alloc_attr_ex(__size, __attribute, __func__, __LINE__)
-extern hrt_vaddress mmgr_alloc_attr_ex(
-	const size_t			size,
-	const uint16_t			attribute,
-	const char				*caller_func,
-	int						caller_line);
+
+extern hrt_vaddress mmgr_alloc_attr(const size_t size, const uint16_t attribute);
 
 /*! Return the address of a mapped existing allocation in memory
 
@@ -187,52 +152,29 @@ extern hrt_vaddress mmgr_mmap(
 
  \param	vaddr[in]		Address of an allocation
  \param	size[in]		Size in bytes of the area to be cleared
- \param	caller_func[in]		Caller function name
- \param	caller_line[in]		Caller function line number
 
  \return none
  */
-#define mmgr_clear(__vaddr, __size) mmgr_clear_ex(__vaddr, __size, __func__, __LINE__)
-extern void mmgr_clear_ex(
-	hrt_vaddress			vaddr,
-	const size_t			size,
-	const char			*caller_func,
-	int				caller_line);
+extern void mmgr_clear(hrt_vaddress vaddr, const size_t	size);
 
 /*! Read an array of bytes from a virtual memory address
 
  \param	vaddr[in]		Address of an allocation
  \param	data[out]		pointer to the destination array
  \param	size[in]		number of bytes to read
- \param	caller_func[in]		Caller function name
- \param	caller_line[in]		Caller function line number
 
  \return none
  */
-#define mmgr_load(__vaddr, __data, __size) mmgr_load_ex(__vaddr, __data, __size, __func__, __LINE__)
-extern void mmgr_load_ex(
-	const hrt_vaddress		vaddr,
-	void				*data,
-	const size_t			size,
-	const char			*caller_func,
-	int				caller_line);
+extern void mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size);
 
 /*! Write an array of bytes to device registers or memory in the device
 
  \param	vaddr[in]		Address of an allocation
  \param	data[in]		pointer to the source array
  \param	size[in]		number of bytes to write
- \param	caller_func[in]		Caller function name
- \param	caller_line[in]		Caller function line number
 
  \return none
  */
-#define mmgr_store(__vaddr, __data, __size) mmgr_store_ex(__vaddr, __data, __size, __func__, __LINE__)
-extern void mmgr_store_ex(
-	const hrt_vaddress		vaddr,
-	const void				*data,
-	const size_t			size,
-	const char				*caller_func,
-	int						caller_line);
+extern void mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size);
 
 #endif /* __MEMORY_ACCESS_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c
index 8dfb670..a140cec 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c
@@ -1,6 +1,6 @@
 /*
  * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
+ * Copyright (c) 2015-2017, 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,
@@ -33,12 +33,12 @@ ia_css_memory_access_init(const struct ia_css_css_mem_env *env)
 }
 
 hrt_vaddress
-mmgr_malloc_ex(const size_t size, const char *caller_func, int caller_line)
+mmgr_malloc(const size_t size)
 {
-	return mmgr_alloc_attr_ex(size, 0, caller_func, caller_line);
+	return mmgr_alloc_attr(size, 0);
 }
 
-hrt_vaddress mmgr_alloc_attr_ex(const size_t size, const uint16_t attrs, const char *caller_func, int caller_line)
+hrt_vaddress mmgr_alloc_attr(const size_t size, const uint16_t attrs)
 {
 	uint32_t my_attrs = 0;
 	uint16_t masked_attrs = attrs & MMGR_ATTRIBUTE_MASK;
@@ -53,49 +53,37 @@ hrt_vaddress mmgr_alloc_attr_ex(const size_t size, const uint16_t attrs, const c
 	if (masked_attrs & MMGR_ATTRIBUTE_PAGEALIGN)
 		my_attrs |= IA_CSS_MEM_ATTR_PAGEALIGN;
 
-	(void)caller_func;
-	(void)caller_line;
 	ptr = my_env.alloc(size, my_attrs);
 	return ptr;
 }
 
 hrt_vaddress
-mmgr_calloc_ex(const size_t N, const size_t size, const char *caller_func, int caller_line)
+mmgr_calloc(const size_t N, const size_t size)
 {
-	(void)caller_func;
-	(void)caller_line;
 	return mmgr_alloc_attr(size * N, MMGR_ATTRIBUTE_CLEARED);
 }
 
 void
-mmgr_free_ex(hrt_vaddress vaddr, const char *caller_func, int caller_line)
+mmgr_free(hrt_vaddress vaddr)
 {
-	(void)caller_func;
-	(void)caller_line;
 	my_env.free(vaddr);
 }
 
 void
-mmgr_clear_ex(hrt_vaddress vaddr, const size_t size, const char *caller_func, int caller_line)
+mmgr_clear(hrt_vaddress vaddr, const size_t size)
 {
-	(void)caller_func;
-	(void)caller_line;
 	my_env.set(vaddr, 0, size);
 }
 
 void
-mmgr_load_ex(const hrt_vaddress vaddr, void *data, const size_t size, const char *caller_func, int caller_line)
+mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size)
 {
-	(void)caller_func;
-	(void)caller_line;
 	my_env.load(vaddr, data, size);
 }
 
 void
-mmgr_store_ex(const hrt_vaddress vaddr, const void *data, const size_t size, const char *caller_func, int caller_line)
+mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size)
 {
-	(void)caller_func;
-	(void)caller_line;
 	my_env.store(vaddr, data, size);
 }
 

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 04/24] atomisp: remove another layer of allocator indirection
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
  2017-03-20 14:38 ` [PATCH 02/24] atomisp: remove aa kernel wrappers Alan Cox
  2017-03-20 14:38 ` [PATCH 03/24] atomisp: remove the unused debug wrapping from the mmgr layer Alan Cox
@ 2017-03-20 14:38 ` Alan Cox
  2017-03-20 14:39 ` [PATCH 05/24] atomisp: ia_css_bh_hmem_encode is a no-op so remove it Alan Cox
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:38 UTC (permalink / raw)
  To: greg, linux-media

Our driver only ever uses one set of routines for the allocators used by the CSS layer to
manage memory and the memory management on the ISP. We can thus remove the function vectors
and simply call the intended routines directly.

These routines in turn are simply wrappers around another layer of code so remove this
second layer of wrappers and call the hrt methods directly. In time we can remove this layer
of indirection as well.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../atomisp/pci/atomisp2/atomisp_compat_css20.c    |   66 --------------------
 .../ia_css_isp_states.h                            |    1 
 .../ia_css_isp_states.h                            |    1 
 .../ia_css_isp_states.h                            |    1 
 .../atomisp/pci/atomisp2/css2400/ia_css_env.h      |   48 ---------------
 .../pci/atomisp2/css2400/ia_css_memory_access.c    |   64 +++++++++++--------
 .../pci/atomisp2/css2400/ia_css_memory_access.h    |   24 -------
 .../css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c   |    1 
 .../raw_aa_binning_1.0/ia_css_raa.host.c           |    1 
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |    4 -
 10 files changed, 35 insertions(+), 176 deletions(-)
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.h

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
index 760f06d..2e20a81 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
@@ -92,65 +92,6 @@ unsigned int atomisp_css_debug_get_dtrace_level(void)
 	return ia_css_debug_trace_level;
 }
 
-static ia_css_ptr atomisp_css2_mm_alloc(size_t bytes, uint32_t attr)
-{
-	if (attr & IA_CSS_MEM_ATTR_ZEROED) {
-		if (attr & IA_CSS_MEM_ATTR_CACHED) {
-			if (attr & IA_CSS_MEM_ATTR_CONTIGUOUS)
-				return (ia_css_ptr) hrt_isp_css_mm_calloc_contiguous(bytes);
-			else
-				return (ia_css_ptr) hrt_isp_css_mm_calloc_cached(bytes);
-		} else {
-			if (attr & IA_CSS_MEM_ATTR_CONTIGUOUS)
-				return (ia_css_ptr) hrt_isp_css_mm_calloc_contiguous(bytes);
-			else
-				return (ia_css_ptr) hrt_isp_css_mm_calloc(bytes);
-		}
-	} else {
-		if (attr & IA_CSS_MEM_ATTR_CACHED) {
-			if (attr & IA_CSS_MEM_ATTR_CONTIGUOUS)
-				return (ia_css_ptr) hrt_isp_css_mm_alloc_contiguous(bytes);
-			else
-				return (ia_css_ptr) hrt_isp_css_mm_alloc_cached(bytes);
-		} else {
-			if (attr & IA_CSS_MEM_ATTR_CONTIGUOUS)
-				return (ia_css_ptr) hrt_isp_css_mm_alloc_contiguous(bytes);
-			else
-				return (ia_css_ptr) hrt_isp_css_mm_alloc(bytes);
-		}
-	}
-}
-
-static void atomisp_css2_mm_free(ia_css_ptr ptr)
-{
-	hrt_isp_css_mm_free(ptr);
-}
-
-static int atomisp_css2_mm_load(ia_css_ptr ptr, void *data, size_t bytes)
-{
-	return hrt_isp_css_mm_load(ptr, data, bytes);
-}
-
-static int atomisp_css2_mm_store(ia_css_ptr ptr, const void *data, size_t bytes)
-{
-	return hrt_isp_css_mm_store(ptr, data, bytes);
-}
-
-static int atomisp_css2_mm_set(ia_css_ptr ptr, int c, size_t bytes)
-{
-	return hrt_isp_css_mm_set(ptr, c, bytes);
-}
-
-static ia_css_ptr atomisp_css2_mm_mmap(const void *ptr, const size_t size,
-		   uint16_t attribute, void *context)
-{
-	struct hrt_userbuffer_attr *userbuffer_attr = context;
-	return hrt_isp_css_mm_alloc_user_ptr(
-			size, (void *)ptr, userbuffer_attr->pgnr,
-			userbuffer_attr->type,
-			attribute & HRT_BUF_FLAG_CACHED);
-}
-
 void atomisp_css2_hw_store_8(hrt_address addr, uint8_t data)
 {
 	unsigned long flags;
@@ -985,13 +926,6 @@ int atomisp_css_load_firmware(struct atomisp_device *isp)
 	isp->css_env.isp_css_env.cpu_mem_env.alloc = atomisp_kernel_zalloc;
 	isp->css_env.isp_css_env.cpu_mem_env.free = atomisp_kernel_free;
 
-	isp->css_env.isp_css_env.css_mem_env.alloc = atomisp_css2_mm_alloc;
-	isp->css_env.isp_css_env.css_mem_env.free = atomisp_css2_mm_free;
-	isp->css_env.isp_css_env.css_mem_env.load = atomisp_css2_mm_load;
-	isp->css_env.isp_css_env.css_mem_env.store = atomisp_css2_mm_store;
-	isp->css_env.isp_css_env.css_mem_env.set = atomisp_css2_mm_set;
-	isp->css_env.isp_css_env.css_mem_env.mmap = atomisp_css2_mm_mmap;
-
 	isp->css_env.isp_css_env.hw_access_env.store_8 =
 							atomisp_css2_hw_store_8;
 	isp->css_env.isp_css_env.hw_access_env.store_16 =
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.h
index 939dc36..732adaf 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_states.h
@@ -13,7 +13,6 @@
  */
 
 #define IA_CSS_INCLUDE_STATES
-#include "ia_css_memory_access.h"
 #include "isp/kernels/aa/aa_2/ia_css_aa2.host.h"
 #include "isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.h"
 #include "isp/kernels/cnr/cnr_2/ia_css_cnr2.host.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.h
index 939dc36..732adaf 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.h
@@ -13,7 +13,6 @@
  */
 
 #define IA_CSS_INCLUDE_STATES
-#include "ia_css_memory_access.h"
 #include "isp/kernels/aa/aa_2/ia_css_aa2.host.h"
 #include "isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.h"
 #include "isp/kernels/cnr/cnr_2/ia_css_cnr2.host.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.h
index 939dc36..732adaf 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.h
@@ -13,7 +13,6 @@
  */
 
 #define IA_CSS_INCLUDE_STATES
-#include "ia_css_memory_access.h"
 #include "isp/kernels/aa/aa_2/ia_css_aa2.host.h"
 #include "isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.h"
 #include "isp/kernels/cnr/cnr_2/ia_css_cnr2.host.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_env.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_env.h
index b4bf842..4d54aea 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_env.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_env.h
@@ -60,53 +60,6 @@ struct ia_css_cpu_mem_env {
 #endif
 };
 
-/** Environment with function pointers for allocation of memory for the CSS.
- *  The CSS uses its own MMU which has its own set of page tables. These
- *  functions are expected to use and/or update those page tables.
- *  This type of memory allocation is expected to be used for large buffers
- *  for images and statistics.
- *  ISP pointers are always 32 bits whereas IA pointer widths will depend
- *  on the platform.
- *  Attributes can be a combination (OR'ed) of ia_css_mem_attr values.
- */
-struct ia_css_css_mem_env {
-	ia_css_ptr(*alloc)(size_t bytes, uint32_t attributes);
-	/**< Allocate memory, cached or uncached, zeroed out or not. */
-	void (*free)(ia_css_ptr ptr);
-	/**< Free ISP shared memory. The function must also accept
-	     a NULL argument, similar to C89 free(). */
-	int (*load)(ia_css_ptr ptr, void *data, size_t bytes);
-	/**< Load from ISP shared memory. This function is necessary because
-	     the IA MMU does not share page tables with the ISP MMU. This means
-	     that the IA needs to do the virtual-to-physical address
-	     translation in software. This function performs this translation.*/
-	int (*store)(ia_css_ptr ptr, const void *data, size_t bytes);
-	/**< Same as the above load function but then to write data into ISP
-	     shared memory. */
-	int (*set)(ia_css_ptr ptr, int c, size_t bytes);
-	/**< Set an ISP shared memory region to a particular value. Each byte
-	     in this region will be set to this value. In most cases this is
-	     used to zero-out memory sections in which case the argument c
-	     would have the value zero. */
-	ia_css_ptr (*mmap)(const void *ptr, const size_t size,
-			   uint16_t attribute, void *context);
-	/**< Map an pre-allocated memory region to an address. */
-#ifdef ISP2401
-
-	/* a set of matching functions with additional debug params */
-	ia_css_ptr(*alloc_ex)(size_t bytes, uint32_t attributes, const char *caller_func, int caller_line);
-	/**< same as alloc above, only with additional debug parameters */
-	void (*free_ex)(ia_css_ptr ptr, const char *caller_func, int caller_line);
-	/**< same as free above, only with additional debug parameters */
-	int (*load_ex)(ia_css_ptr ptr, void *data, size_t bytes, const char *caller_func, int caller_line);
-	/**< same as load above, only with additional debug parameters */
-	int (*store_ex)(ia_css_ptr ptr, const void *data, size_t bytes, const char *caller_func, int caller_line);
-	/**< same as store above, only with additional debug parameters */
-	int (*set_ex)(ia_css_ptr ptr, int c, size_t bytes, const char *caller_func, int caller_line);
-	/**< same as set above, only with additional debug parameters */
-#endif
-};
-
 /** Environment with function pointers to access the CSS hardware. This includes
  *  registers and local memories.
  */
@@ -151,7 +104,6 @@ struct ia_css_print_env {
  */
 struct ia_css_env {
 	struct ia_css_cpu_mem_env   cpu_mem_env;   /**< local malloc and free. */
-	struct ia_css_css_mem_env   css_mem_env;   /**< CSS/ISP buffer alloc/free */
 	struct ia_css_hw_access_env hw_access_env; /**< CSS HW access functions */
 	struct ia_css_print_env     print_env;     /**< Message printing env. */
 };
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c
index a140cec..8d559aa 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c
@@ -12,26 +12,16 @@
  * more details.
  */
 
-#include "ia_css_memory_access.h"
 #include <type_support.h>
 #include <system_types.h>
 #include <assert_support.h>
 #include <memory_access.h>
 #include <ia_css_env.h>
+#include <hrt/hive_isp_css_mm_hrt.h>
 
 const hrt_vaddress mmgr_NULL = (hrt_vaddress)0;
 const hrt_vaddress mmgr_EXCEPTION = (hrt_vaddress)-1;
 
-static struct ia_css_css_mem_env my_env;
-
-void
-ia_css_memory_access_init(const struct ia_css_css_mem_env *env)
-{
-	assert(env != NULL);
-
-	my_env = *env;
-}
-
 hrt_vaddress
 mmgr_malloc(const size_t size)
 {
@@ -40,21 +30,33 @@ mmgr_malloc(const size_t size)
 
 hrt_vaddress mmgr_alloc_attr(const size_t size, const uint16_t attrs)
 {
-	uint32_t my_attrs = 0;
 	uint16_t masked_attrs = attrs & MMGR_ATTRIBUTE_MASK;
-	hrt_vaddress ptr;
-
-	if (masked_attrs & MMGR_ATTRIBUTE_CACHED)
-		my_attrs |= IA_CSS_MEM_ATTR_CACHED;
-	if (masked_attrs & MMGR_ATTRIBUTE_CLEARED)
-		my_attrs |= IA_CSS_MEM_ATTR_ZEROED;
-	if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
-		my_attrs |= IA_CSS_MEM_ATTR_CONTIGUOUS;
-	if (masked_attrs & MMGR_ATTRIBUTE_PAGEALIGN)
-		my_attrs |= IA_CSS_MEM_ATTR_PAGEALIGN;
 
-	ptr = my_env.alloc(size, my_attrs);
-	return ptr;
+	if (masked_attrs & MMGR_ATTRIBUTE_CLEARED) {
+		if (masked_attrs & MMGR_ATTRIBUTE_CACHED) {
+			if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
+				return (ia_css_ptr) hrt_isp_css_mm_calloc_contiguous(size);
+			else
+				return (ia_css_ptr) hrt_isp_css_mm_calloc_cached(size);
+		} else {
+			if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
+				return (ia_css_ptr) hrt_isp_css_mm_calloc_contiguous(size);
+			else
+				return (ia_css_ptr) hrt_isp_css_mm_calloc(size);
+		}
+	} else {
+		if (masked_attrs & MMGR_ATTRIBUTE_CACHED) {
+			if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
+				return (ia_css_ptr) hrt_isp_css_mm_alloc_contiguous(size);
+			else
+				return (ia_css_ptr) hrt_isp_css_mm_alloc_cached(size);
+		} else {
+			if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
+				return (ia_css_ptr) hrt_isp_css_mm_alloc_contiguous(size);
+			else
+				return (ia_css_ptr) hrt_isp_css_mm_alloc(size);
+		}
+	}
 }
 
 hrt_vaddress
@@ -66,30 +68,34 @@ mmgr_calloc(const size_t N, const size_t size)
 void
 mmgr_free(hrt_vaddress vaddr)
 {
-	my_env.free(vaddr);
+	hrt_isp_css_mm_free(vaddr);
 }
 
 void
 mmgr_clear(hrt_vaddress vaddr, const size_t size)
 {
-	my_env.set(vaddr, 0, size);
+	hrt_isp_css_mm_set(vaddr, 0, size);
 }
 
 void
 mmgr_load(const hrt_vaddress vaddr, void *data, const size_t size)
 {
-	my_env.load(vaddr, data, size);
+	hrt_isp_css_mm_load(vaddr, data, size);
 }
 
 void
 mmgr_store(const hrt_vaddress vaddr, const void *data, const size_t size)
 {
-	my_env.store(vaddr, data, size);
+	hrt_isp_css_mm_store(vaddr, data, size);
 }
 
 hrt_vaddress
 mmgr_mmap(const void *ptr, const size_t size,
 	  uint16_t attribute, void *context)
 {
-	return my_env.mmap(ptr, size, attribute, context);
+	struct hrt_userbuffer_attr *userbuffer_attr = context;
+	return hrt_isp_css_mm_alloc_user_ptr(
+			size, (void *)ptr, userbuffer_attr->pgnr,
+			userbuffer_attr->type,
+			attribute & HRT_BUF_FLAG_CACHED);
 }
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.h
deleted file mode 100644
index 1d6db0b..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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_MEMORY_ACCESS_H_
-#define _IA_CSS_MEMORY_ACCESS_H_
-
-#include "ia_css_env.h"
-
-void
-ia_css_memory_access_init(const struct ia_css_css_mem_env *env);
-
-#endif /* _IA_CSS_MEMORY_ACCESS_H_ */
-
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c
index 69e708f..0dcafad 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c
@@ -14,7 +14,6 @@
 
 #if !defined(HAS_NO_HMEM)
 
-#include "ia_css_memory_access.h"
 #include "memory_access.h"
 #include "ia_css_types.h"
 #include "sh_css_internal.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw_aa_binning/raw_aa_binning_1.0/ia_css_raa.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw_aa_binning/raw_aa_binning_1.0/ia_css_raa.host.c
index 74521c9..9216821 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw_aa_binning/raw_aa_binning_1.0/ia_css_raa.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw_aa_binning/raw_aa_binning_1.0/ia_css_raa.host.c
@@ -14,7 +14,6 @@
 
 #if !defined(HAS_NO_HMEM)
 
-#include "ia_css_memory_access.h"
 #include "memory_access.h"
 #include "ia_css_types.h"
 #include "sh_css_internal.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index 2eab07d..3cbdcef 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -33,7 +33,6 @@
 #include "ia_css_rmgr.h"
 #include "ia_css_debug.h"
 #include "ia_css_debug_pipe.h"
-#include "ia_css_memory_access.h"
 #include "ia_css_device_access.h"
 #include "device_access.h"
 #include "sh_css_legacy.h"
@@ -1690,8 +1689,6 @@ ia_css_load_firmware(const struct ia_css_env *env,
 
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_load_firmware() enter\n");
 
-	ia_css_memory_access_init(&env->css_mem_env);
-
 	/* make sure we initialize my_css */
 	if ((my_css.malloc != env->cpu_mem_env.alloc) ||
 		(my_css.free != env->cpu_mem_env.free) ||
@@ -1791,7 +1788,6 @@ ia_css_init(const struct ia_css_env *env,
 	ia_css_queue_map_init();
 
 	ia_css_device_access_init(&env->hw_access_env);
-	ia_css_memory_access_init(&env->css_mem_env);
 
 	select = gpio_reg_load(GPIO0_ID, _gpio_block_reg_do_select)
 						& (~GPIO_FLASH_PIN_MASK);

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 05/24] atomisp: ia_css_bh_hmem_encode is a no-op so remove it
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (2 preceding siblings ...)
  2017-03-20 14:38 ` [PATCH 04/24] atomisp: remove another layer of allocator indirection Alan Cox
@ 2017-03-20 14:39 ` Alan Cox
  2017-03-20 14:39 ` [PATCH 06/24] atomisp: kill another define Alan Cox
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:39 UTC (permalink / raw)
  To: greg, linux-media

This is a do nothing function so we can replace it with nothing and eliminate it entirely.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../ia_css_isp_params.c                            |    6 ------
 .../ia_css_isp_params.c                            |    6 ------
 .../ia_css_isp_params.c                            |    6 ------
 .../css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c   |   11 -----------
 .../css2400/isp/kernels/bh/bh_2/ia_css_bh.host.h   |    6 ------
 5 files changed, 35 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c
index 9620bc3..3246d99 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2400_system/hive_isp_css_2400_system_generated/ia_css_isp_params.c
@@ -176,15 +176,9 @@ size);
 	{
 		unsigned size   = stage->binary->info->mem_offsets.offsets.param->hmem0.bh.size;
 
-		unsigned offset = stage->binary->info->mem_offsets.offsets.param->hmem0.bh.offset;
-
 		if (size) {
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_bh() enter:\n");
 
-			ia_css_bh_hmem_encode((struct sh_css_isp_bh_hmem_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_HMEM0].address[offset],
-					&params->s3a_config,
-size);
 			params->isp_params_changed = true;
 			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_HMEM0] = true;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c
index 87a3308..4c79a31 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_params.c
@@ -175,15 +175,9 @@ size);
 	{
 		unsigned size   = stage->binary->info->mem_offsets.offsets.param->hmem0.bh.size;
 
-		unsigned offset = stage->binary->info->mem_offsets.offsets.param->hmem0.bh.offset;
-
 		if (size) {
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_bh() enter:\n");
 
-			ia_css_bh_hmem_encode((struct sh_css_isp_bh_hmem_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_HMEM0].address[offset],
-					&params->s3a_config,
-size);
 			params->isp_params_changed = true;
 			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_HMEM0] = true;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c
index 87a3308..4c79a31 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_params.c
@@ -175,15 +175,9 @@ size);
 	{
 		unsigned size   = stage->binary->info->mem_offsets.offsets.param->hmem0.bh.size;
 
-		unsigned offset = stage->binary->info->mem_offsets.offsets.param->hmem0.bh.offset;
-
 		if (size) {
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_bh() enter:\n");
 
-			ia_css_bh_hmem_encode((struct sh_css_isp_bh_hmem_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_HMEM0].address[offset],
-					&params->s3a_config,
-size);
 			params->isp_params_changed = true;
 			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_HMEM0] = true;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c
index 0dcafad..99c80d2 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.c
@@ -63,15 +63,4 @@ ia_css_bh_encode(
 	    uDIGIT_FITTING(from->ae_y_coef_b, 16, SH_CSS_AE_YCOEF_SHIFT);
 }
 
-void
-ia_css_bh_hmem_encode(
-	struct sh_css_isp_bh_hmem_params *to,
-	const struct ia_css_3a_config *from,
-	unsigned size)
-{
-	(void)size;
-	(void)from;
-	(void)to;
-}
-
 #endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.h
index 339e954..cbb0929 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bh/bh_2/ia_css_bh.host.h
@@ -29,10 +29,4 @@ ia_css_bh_encode(
 	const struct ia_css_3a_config *from,
 	unsigned size);
 
-void
-ia_css_bh_hmem_encode(
-	struct sh_css_isp_bh_hmem_params *to,
-	const struct ia_css_3a_config *from,
-	unsigned size);
-
 #endif /* __IA_CSS_BH_HOST_H */

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 06/24] atomisp: kill another define
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (3 preceding siblings ...)
  2017-03-20 14:39 ` [PATCH 05/24] atomisp: ia_css_bh_hmem_encode is a no-op so remove it Alan Cox
@ 2017-03-20 14:39 ` Alan Cox
  2017-03-21  7:05   ` Greg KH
  2017-03-20 14:39 ` [PATCH 07/24] ov5693: remove unused function Alan Cox
                   ` (17 subsequent siblings)
  22 siblings, 1 reply; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:39 UTC (permalink / raw)
  To: greg, linux-media

We don't need an ifdef for the sake of 8-12 bytes. This undoes the ifdef added by
fde469701c7efabebf885e785edf367bfb1a8f3f. Instead turn it into a single const string
array at a fixed location thereby saving even more memory.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../staging/media/atomisp/pci/atomisp2/hmm/hmm.c   |   23 +++++++++-----------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
index e78f02f..1f07c7a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
@@ -1,7 +1,7 @@
 /*
  * Support for Medifield PNW Camera Imaging ISP subsystem.
  *
- * Copyright (c) 2010 Intel Corporation. All Rights Reserved.
+ * Copyright (c) 2010-2017 Intel Corporation. All Rights Reserved.
  *
  * Copyright (c) 2010 Silicon Hive www.siliconhive.com.
  *
@@ -45,14 +45,11 @@ struct hmm_pool	reserved_pool;
 static ia_css_ptr dummy_ptr;
 struct _hmm_mem_stat hmm_mem_stat;
 
-const char *hmm_bo_type_strings[HMM_BO_LAST] = {
-	"p", /* private */
-	"s", /* shared */
-	"u", /* user */
-#ifdef CONFIG_ION
-	"i", /* ion */
-#endif
-};
+/* p: private
+   s: shared
+   u: user
+   i: ion */
+static const char hmm_bo_type_string[] = "psui";
 
 static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
 			char *buf, struct list_head *bo_list, bool active)
@@ -77,8 +74,8 @@ static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
 		if ((active && (bo->status & HMM_BO_ALLOCED)) ||
 			(!active && !(bo->status & HMM_BO_ALLOCED))) {
 			ret = scnprintf(buf + index1, PAGE_SIZE - index1,
-				"%s %d\n",
-				hmm_bo_type_strings[bo->type], bo->pgnr);
+				"%c %d\n",
+				hmm_bo_type_string[bo->type], bo->pgnr);
 
 			total[bo->type] += bo->pgnr;
 			count[bo->type]++;
@@ -92,8 +89,8 @@ static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
 		if (count[i]) {
 			ret = scnprintf(buf + index1 + index2,
 				PAGE_SIZE - index1 - index2,
-				"%ld %s buffer objects: %ld KB\n",
-				count[i], hmm_bo_type_strings[i], total[i] * 4);
+				"%ld %c buffer objects: %ld KB\n",
+				count[i], hmm_bo_type_string[i], total[i] * 4);
 			if (ret > 0)
 				index2 += ret;
 		}

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 07/24] ov5693: remove unused function
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (4 preceding siblings ...)
  2017-03-20 14:39 ` [PATCH 06/24] atomisp: kill another define Alan Cox
@ 2017-03-20 14:39 ` Alan Cox
  2017-03-20 14:40 ` [PATCH 08/24] atomisp/imx: Fix locking bug on error path Alan Cox
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:39 UTC (permalink / raw)
  To: greg, linux-media

It's commented out in the tree with a note saying to remove it. So let's remove it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 drivers/staging/media/atomisp/i2c/ov5693/ov5693.c |   23 ---------------------
 1 file changed, 23 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
index ac75982..5e9dafe 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
+++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
@@ -82,30 +82,7 @@ static int vcm_ad_i2c_wr8(struct i2c_client *client, u8 reg, u8 val)
 	}
 	return 0;
 }
-/*TODO: remove this unuseful i2c writer helper*/
-/*
-static int vcm_ad_i2c_wr16(struct i2c_client *client, u8 reg, u16 val)
-{
-	int err;
-	struct i2c_msg msg;
-	u8 buf[3];
-	buf[0] = reg;
-	buf[1] = (u8)(val >> 8);
-	buf[2] = (u8)(val & 0xff);
-	msg.addr = VCM_ADDR;
-	msg.flags = 0;
-	msg.len = 3;
-	msg.buf = &buf[0];
 
-	err = i2c_transfer(client->adapter, &msg, 1);
-	if (err != 1) {
-		dev_err(&client->dev, "%s: vcm i2c fail, err code = %d\n",
-			__func__, err);
-		return -EIO;
-	}
-	return 0;
-}
-*/
 static int ad5823_i2c_write(struct i2c_client *client, u8 reg, u8 val)
 {
 	struct i2c_msg msg;

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 08/24] atomisp/imx: Fix locking bug on error path
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (5 preceding siblings ...)
  2017-03-20 14:39 ` [PATCH 07/24] ov5693: remove unused function Alan Cox
@ 2017-03-20 14:40 ` Alan Cox
  2017-03-20 14:40 ` [PATCH 09/24] atomisp: remove another pair of 2400/2401 differences Alan Cox
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:40 UTC (permalink / raw)
  To: greg, linux-media

This was reported by Dan Carpenter. When we error with an IMX 227 we don't release
the lock and the sensor would then hang.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 drivers/staging/media/atomisp/i2c/imx/imx.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/imx/imx.c b/drivers/staging/media/atomisp/i2c/imx/imx.c
index a73f902..408a7b9 100644
--- a/drivers/staging/media/atomisp/i2c/imx/imx.c
+++ b/drivers/staging/media/atomisp/i2c/imx/imx.c
@@ -454,8 +454,10 @@ static int imx_set_exposure_gain(struct v4l2_subdev *sd, u16 coarse_itg,
 
 	if (dev->sensor_id == IMX227_ID) {
 		ret = imx_write_reg_array(client, imx_param_hold);
-		if (ret)
+		if (ret) {
+			mutex_unlock(&dev->input_lock);
 			return ret;
+		}
 	}
 
 	/* For imx175, setting gain must be delayed by one */

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 09/24] atomisp: remove another pair of 2400/2401 differences
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (6 preceding siblings ...)
  2017-03-20 14:40 ` [PATCH 08/24] atomisp/imx: Fix locking bug on error path Alan Cox
@ 2017-03-20 14:40 ` Alan Cox
  2017-03-20 14:40 ` [PATCH 10/24] Staging: atomisp: fix locking in alloc_user_pages() Alan Cox
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:40 UTC (permalink / raw)
  To: greg, linux-media

The first of these checks the PCI identifier in order to decide what to do so needs no
ifdef. The other is simply a variation on what is dumped for debug - so favour dumping the
most.

Signed-off-by Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/atomisp_cmd.c       |    7 -------
 .../atomisp/pci/atomisp2/atomisp_dfs_tables.h      |    4 ----
 2 files changed, 11 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index d97a8df..08da8ea 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -263,12 +263,10 @@ int atomisp_freq_scaling(struct atomisp_device *isp,
 		return -EINVAL;
 	}
 
-#ifdef ISP2401
 	if ((isp->pdev->device & ATOMISP_PCI_DEVICE_SOC_MASK) ==
 		ATOMISP_PCI_DEVICE_SOC_CHT && ATOMISP_USE_YUVPP(asd))
 		isp->dfs = &dfs_config_cht_soc;
 
-#endif
 	if (isp->dfs->lowest_freq == 0 || isp->dfs->max_freq_at_vmin == 0 ||
 	    isp->dfs->highest_freq == 0 || isp->dfs->dfs_table_size == 0 ||
 	    !isp->dfs->dfs_table) {
@@ -654,13 +652,8 @@ irqreturn_t atomisp_isr(int irq, void *dev)
 			}
 
 			atomisp_eof_event(asd, eof_event.event.exp_id);
-#ifndef ISP2401
-			dev_dbg(isp->dev, "%s EOF exp_id %d\n", __func__,
-				eof_event.event.exp_id);
-#else
 			dev_dbg(isp->dev, "%s EOF exp_id %d, asd %d\n",
 				__func__, eof_event.event.exp_id, asd->index);
-#endif
 		}
 
 		irq_infos &= ~IA_CSS_IRQ_INFO_ISYS_EVENTS_READY;
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_dfs_tables.h b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_dfs_tables.h
index dfb94e6..204d941 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_dfs_tables.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_dfs_tables.h
@@ -340,7 +340,6 @@ static const struct atomisp_freq_scaling_rule dfs_rules_cht[] = {
 		.run_mode = ATOMISP_RUN_MODE_PREVIEW,
 	},
 	{
-#ifdef ISP2401
 		.width = 1280,
 		.height = 720,
 		.fps = ISP_FREQ_RULE_ANY,
@@ -386,7 +385,6 @@ static const struct atomisp_freq_scaling_rule dfs_rules_cht_soc[] = {
 		.run_mode = ATOMISP_RUN_MODE_PREVIEW,
 	},
 	{
-#endif
 		.width = ISP_FREQ_RULE_ANY,
 		.height = ISP_FREQ_RULE_ANY,
 		.fps = ISP_FREQ_RULE_ANY,
@@ -403,7 +401,6 @@ static const struct atomisp_dfs_config dfs_config_cht = {
 	.dfs_table_size = ARRAY_SIZE(dfs_rules_cht),
 };
 
-#ifdef ISP2401
 static const struct atomisp_dfs_config dfs_config_cht_soc = {
 	.lowest_freq = ISP_FREQ_100MHZ,
 	.max_freq_at_vmin = ISP_FREQ_356MHZ,
@@ -412,5 +409,4 @@ static const struct atomisp_dfs_config dfs_config_cht_soc = {
 	.dfs_table_size = ARRAY_SIZE(dfs_rules_cht_soc),
 };
 
-#endif
 #endif /* __ATOMISP_DFS_TABLES_H__ */

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 10/24] Staging: atomisp: fix locking in alloc_user_pages()
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (7 preceding siblings ...)
  2017-03-20 14:40 ` [PATCH 09/24] atomisp: remove another pair of 2400/2401 differences Alan Cox
@ 2017-03-20 14:40 ` Alan Cox
  2017-03-20 14:40 ` [PATCH 11/24] Staging: atomisp: fix an uninitialized variable bug Alan Cox
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:40 UTC (permalink / raw)
  To: greg, linux-media

From: Dan Carpenter <dan.carpenter@oracle.com>

We call this function with the lock held and should also return with the
lock held as well.  This one error path is not-consistent because we
should return without the lock held.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/hmm/hmm_bo.c        |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
index fd3bd5c..d1a609d2 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
@@ -1012,6 +1012,7 @@ static int alloc_user_pages(struct hmm_buffer_object *bo,
 		dev_err(atomisp_dev, "find_vma failed\n");
 		atomisp_kernel_free(bo->page_obj);
 		atomisp_kernel_free(pages);
+		mutex_lock(&bo->mutex);
 		return -EFAULT;
 	}
 	mutex_lock(&bo->mutex);

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 11/24] Staging: atomisp: fix an uninitialized variable bug
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (8 preceding siblings ...)
  2017-03-20 14:40 ` [PATCH 10/24] Staging: atomisp: fix locking in alloc_user_pages() Alan Cox
@ 2017-03-20 14:40 ` Alan Cox
  2017-03-20 14:40 ` [PATCH 12/24] staging: media: atomisp: select REGMAP_I2C needed by ap1302.c Alan Cox
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:40 UTC (permalink / raw)
  To: greg, linux-media

From: Dan Carpenter <dan.carpenter@oracle.com>

There are some error paths in atomisp_css_frame_allocate() which don't
initialize "res" so it could lead us to try release random memory.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/atomisp_cmd.c       |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 08da8ea..37d334e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -4722,7 +4722,7 @@ static int
 atomisp_v4l2_framebuffer_to_css_frame(const struct v4l2_framebuffer *arg,
 					 struct atomisp_css_frame **result)
 {
-	struct atomisp_css_frame *res;
+	struct atomisp_css_frame *res = NULL;
 	unsigned int padded_width;
 	enum atomisp_css_frame_format sh_format;
 	char *tmp_buf = NULL;

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 12/24] staging: media: atomisp: select REGMAP_I2C needed by ap1302.c
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (9 preceding siblings ...)
  2017-03-20 14:40 ` [PATCH 11/24] Staging: atomisp: fix an uninitialized variable bug Alan Cox
@ 2017-03-20 14:40 ` Alan Cox
  2017-03-20 14:41 ` [PATCH 13/24] staging: media: atomisp: add missing dependencies in Kconfig Alan Cox
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:40 UTC (permalink / raw)
  To: greg, linux-media

From: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>

REGMAP_I2C should be enabled to build the driver ap1302 because it uses
regmap functions.

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 drivers/staging/media/atomisp/i2c/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/atomisp/i2c/Kconfig b/drivers/staging/media/atomisp/i2c/Kconfig
index 30b0bb9..b80d29d 100644
--- a/drivers/staging/media/atomisp/i2c/Kconfig
+++ b/drivers/staging/media/atomisp/i2c/Kconfig
@@ -62,6 +62,7 @@ config VIDEO_MT9M114
 config VIDEO_AP1302
        tristate "AP1302 external ISP support"
        depends on I2C && VIDEO_V4L2
+       select REGMAP_I2C
        ---help---
          This is a Video4Linux2 sensor-level driver for the external
          ISP AP1302.

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 13/24] staging: media: atomisp: add missing dependencies in Kconfig
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (10 preceding siblings ...)
  2017-03-20 14:40 ` [PATCH 12/24] staging: media: atomisp: select REGMAP_I2C needed by ap1302.c Alan Cox
@ 2017-03-20 14:41 ` Alan Cox
  2017-03-20 14:41 ` [PATCH 14/24] staging/atomisp: include linux/io.h where needed Alan Cox
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:41 UTC (permalink / raw)
  To: greg, linux-media

From: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>

Two dependencies were missing to build atomisp drivers:

_ MEDIA_CONTROLLER: to use the entity field of v4l2_subdev structure. Since
every atomisp driver needs MEDIA_CONTROLLER has a dependency, let's add it
to INTEL_ATOMISP

_ EFI: to use efivar_entry_get:
drivers/built-in.o: In function `gmin_get_config_var':
(.text+0xe062b): undefined reference to `efivar_entry_get'

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 drivers/staging/media/atomisp/Kconfig            |    2 +-
 drivers/staging/media/atomisp/i2c/ov5693/Kconfig |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/Kconfig b/drivers/staging/media/atomisp/Kconfig
index f7d8a84..28615aa 100644
--- a/drivers/staging/media/atomisp/Kconfig
+++ b/drivers/staging/media/atomisp/Kconfig
@@ -1,6 +1,6 @@
 menuconfig INTEL_ATOMISP
         bool "Enable support to Intel MIPI camera drivers"
-        depends on X86
+        depends on X86 && EFI && MEDIA_CONTROLLER
         help
           Enable support for the Intel ISP2 camera interfaces and MIPI
           sensor drivers.
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/Kconfig b/drivers/staging/media/atomisp/i2c/ov5693/Kconfig
index 3954b8c..9fb1bff 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/Kconfig
+++ b/drivers/staging/media/atomisp/i2c/ov5693/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_OV5693
        tristate "Omnivision ov5693 sensor support"
-       depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
+       depends on I2C && VIDEO_V4L2
        ---help---
          This is a Video4Linux2 sensor-level driver for the Micron
          ov5693 5 Mpixel camera.

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 14/24] staging/atomisp: include linux/io.h where needed
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (11 preceding siblings ...)
  2017-03-20 14:41 ` [PATCH 13/24] staging: media: atomisp: add missing dependencies in Kconfig Alan Cox
@ 2017-03-20 14:41 ` Alan Cox
  2017-03-20 14:41 ` [PATCH 15/24] staging/atomisp: fix empty-body warning Alan Cox
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:41 UTC (permalink / raw)
  To: greg, linux-media

From: Arnd Bergmann <arnd@arndb.de>

The plat_clock implementation fails ot build in some configurations:

platform/clock/vlv2_plat_clock.c: In function 'vlv2_plat_set_clock_freq':
platform/clock/vlv2_plat_clock.c:88:2: error: implicit declaration of function 'writel';did you mean 'wrmsrl'? [-Werror=implicit-function-declaration]
platform/clock/vlv2_plat_clock.c:88:12: error: implicit declaration of function 'readl' [-Werror=implicit-function-declaration]
platform/clock/vlv2_plat_clock.c: In function 'vlv2_plat_clk_probe':
platform/clock/vlv2_plat_clock.c:193:13: error: implicit declaration of function 'ioremap_nocache' [-Werror=implicit-function-declaration]
platform/clock/vlv2_plat_clock.c:193:11: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
platform/clock/vlv2_plat_clock.c: In function 'vlv2_plat_clk_remove':
platform/clock/vlv2_plat_clock.c:209:2: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]

This includes the required header file.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/platform/clock/vlv2_plat_clock.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
index a8ca93d..25e939c 100644
--- a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
+++ b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
@@ -20,6 +20,7 @@
  */
 
 #include <linux/err.h>
+#include <linux/io.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include "../../include/linux/vlv2_plat_clock.h"

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 15/24] staging/atomisp: fix empty-body warning
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (12 preceding siblings ...)
  2017-03-20 14:41 ` [PATCH 14/24] staging/atomisp: include linux/io.h where needed Alan Cox
@ 2017-03-20 14:41 ` Alan Cox
  2017-03-20 14:41 ` [PATCH 16/24] stating/atomisp: fix -Wold-style-definition warning Alan Cox
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:41 UTC (permalink / raw)
  To: greg, linux-media

From: Arnd Bergmann <arnd@arndb.de>

Defining a debug function to nothing causes a warning with an empty block
after if()/else():

drivers/staging/media/atomisp/i2c/ov2680.c: In function 'ov2680_s_stream':
drivers/staging/media/atomisp/i2c/ov2680.c:1208:55: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]

This changes the empty debug statement to dev_dbg(), which by default also
does nothing, but avoids this warning and also checks the format string.
As a side-effect, we can now use dynamic debugging to turn on the
output at runtime.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 drivers/staging/media/atomisp/i2c/ov2680.c |   37 ++++++++++++++--------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/ov2680.c b/drivers/staging/media/atomisp/i2c/ov2680.c
index 58d2a07..c08dd0b 100644
--- a/drivers/staging/media/atomisp/i2c/ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/ov2680.c
@@ -35,7 +35,6 @@
 
 #include "ov2680.h"
 
-#define ov2680_debug(...) //dev_err(__VA_ARGS__)
 static int h_flag = 0;
 static int v_flag = 0;
 static enum atomisp_bayer_order ov2680_bayer_order_mapping[] = {
@@ -99,7 +98,7 @@ static int ov2680_read_reg(struct i2c_client *client,
 		*val = be16_to_cpu(*(u16 *)&data[0]);
 	else
 		*val = be32_to_cpu(*(u32 *)&data[0]);
-	//ov2680_debug(&client->dev,  "++++i2c read adr%x = %x\n", reg,*val);
+	//dev_dbg(&client->dev,  "++++i2c read adr%x = %x\n", reg,*val);
 	return 0;
 }
 
@@ -114,7 +113,7 @@ static int ov2680_i2c_write(struct i2c_client *client, u16 len, u8 *data)
 	msg.len = len;
 	msg.buf = data;
 	ret = i2c_transfer(client->adapter, &msg, 1);
-	//ov2680_debug(&client->dev,  "+++i2c write reg=%x->%x\n", data[0]*256 +data[1],data[2]);
+	//dev_dbg(&client->dev,  "+++i2c write reg=%x->%x\n", data[0]*256 +data[1],data[2]);
 	return ret == num_msg ? 0 : -EIO;
 }
 
@@ -235,7 +234,7 @@ static int ov2680_write_reg_array(struct i2c_client *client,
 	const struct ov2680_reg *next = reglist;
 	struct ov2680_write_ctrl ctrl;
 	int err;
-	ov2680_debug(&client->dev,  "++++write reg array\n");
+	dev_dbg(&client->dev,  "++++write reg array\n");
 	ctrl.index = 0;
 	for (; next->type != OV2680_TOK_TERM; next++) {
 		switch (next->type & OV2680_TOK_MASK) {
@@ -250,7 +249,7 @@ static int ov2680_write_reg_array(struct i2c_client *client,
 			 * If next address is not consecutive, data needs to be
 			 * flushed before proceed.
 			 */
-			 ov2680_debug(&client->dev,  "+++ov2680_write_reg_array reg=%x->%x\n", next->reg,next->val);
+			 dev_dbg(&client->dev,  "+++ov2680_write_reg_array reg=%x->%x\n", next->reg,next->val);
 			if (!__ov2680_write_reg_is_consecutive(client, &ctrl,
 								next)) {
 				err = __ov2680_flush_reg_array(client, &ctrl);
@@ -296,7 +295,8 @@ static int ov2680_g_fnumber_range(struct v4l2_subdev *sd, s32 *val)
 static int ov2680_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
 {
 	struct ov2680_device *dev = to_ov2680_sensor(sd);
-	ov2680_debug(dev,  "++++ov2680_g_bin_factor_x\n");
+	struct i2c_client *client = v4l2_get_subdevdata(sd);
+	dev_dbg(&client->dev,  "++++ov2680_g_bin_factor_x\n");
 	*val = ov2680_res[dev->fmt_idx].bin_factor_x;
 
 	return 0;
@@ -305,9 +305,10 @@ static int ov2680_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
 static int ov2680_g_bin_factor_y(struct v4l2_subdev *sd, s32 *val)
 {
 	struct ov2680_device *dev = to_ov2680_sensor(sd);
+	struct i2c_client *client = v4l2_get_subdevdata(sd);
 	
 	*val = ov2680_res[dev->fmt_idx].bin_factor_y;
-	ov2680_debug(dev,  "++++ov2680_g_bin_factor_y\n");
+	dev_dbg(&client->dev,  "++++ov2680_g_bin_factor_y\n");
 	return 0;
 }
 
@@ -322,7 +323,7 @@ static int ov2680_get_intg_factor(struct i2c_client *client,
 	unsigned int pix_clk_freq_hz;
 	u16 reg_val;
 	int ret;
-	ov2680_debug(dev,  "++++ov2680_get_intg_factor\n");
+	dev_dbg(&client->dev,  "++++ov2680_get_intg_factor\n");
 	if (!info)
 		return -EINVAL;
 
@@ -399,7 +400,7 @@ static long __ov2680_set_exposure(struct v4l2_subdev *sd, int coarse_itg,
 	u16 vts,hts;
 	int ret,exp_val;
 	
-       ov2680_debug(dev, "+++++++__ov2680_set_exposure coarse_itg %d, gain %d, digitgain %d++\n",coarse_itg, gain, digitgain);
+       dev_dbg(&client->dev, "+++++++__ov2680_set_exposure coarse_itg %d, gain %d, digitgain %d++\n",coarse_itg, gain, digitgain);
 
 	hts = ov2680_res[dev->fmt_idx].pixels_per_line;
 	vts = ov2680_res[dev->fmt_idx].lines_per_frame;
@@ -605,7 +606,7 @@ static int ov2680_v_flip(struct v4l2_subdev *sd, s32 value)
 	int ret;
 	u16 val;
 	u8 index;
-	ov2680_debug(&client->dev, "@%s: value:%d\n", __func__, value);
+	dev_dbg(&client->dev, "@%s: value:%d\n", __func__, value);
 	ret = ov2680_read_reg(client, OV2680_8BIT, OV2680_FLIP_REG, &val);
 	if (ret)
 		return ret;
@@ -636,7 +637,7 @@ static int ov2680_h_flip(struct v4l2_subdev *sd, s32 value)
 	int ret;
 	u16 val;
 	u8 index;
-	ov2680_debug(&client->dev, "@%s: value:%d\n", __func__, value);
+	dev_dbg(&client->dev, "@%s: value:%d\n", __func__, value);
 
 	ret = ov2680_read_reg(client, OV2680_8BIT, OV2680_MIRROR_REG, &val);
 	if (ret)
@@ -1069,7 +1070,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
 	struct camera_mipi_info *ov2680_info = NULL;
 	int ret = 0;
 	int idx = 0;
-	ov2680_debug(&client->dev, "+++++ov2680_s_mbus_fmt+++++l\n");
+	dev_dbg(&client->dev, "+++++ov2680_s_mbus_fmt+++++l\n");
 	if (format->pad)
 		return -EINVAL;
 
@@ -1097,7 +1098,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
 		return 0;
 		}
 	dev->fmt_idx = get_resolution_index(fmt->width, fmt->height);
-	ov2680_debug(&client->dev, "+++++get_resolution_index=%d+++++l\n",
+	dev_dbg(&client->dev, "+++++get_resolution_index=%d+++++l\n",
 		     dev->fmt_idx);
 	if (dev->fmt_idx == -1) {
 		dev_err(&client->dev, "get resolution fail\n");
@@ -1106,7 +1107,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
 	}
 	v4l2_info(client, "__s_mbus_fmt i=%d, w=%d, h=%d\n", dev->fmt_idx,
 		  fmt->width, fmt->height);
-	ov2680_debug(&client->dev, "__s_mbus_fmt i=%d, w=%d, h=%d\n",
+	dev_dbg(&client->dev, "__s_mbus_fmt i=%d, w=%d, h=%d\n",
 		     dev->fmt_idx, fmt->width, fmt->height);
 
 	ret = ov2680_write_reg_array(client, ov2680_res[dev->fmt_idx].regs);
@@ -1203,9 +1204,9 @@ static int ov2680_s_stream(struct v4l2_subdev *sd, int enable)
 
 	mutex_lock(&dev->input_lock);
 	if(enable )
-		ov2680_debug(&client->dev, "ov2680_s_stream one \n");
+		dev_dbg(&client->dev, "ov2680_s_stream one \n");
 	else
-		ov2680_debug(&client->dev, "ov2680_s_stream off \n");
+		dev_dbg(&client->dev, "ov2680_s_stream off \n");
 	
 	ret = ov2680_write_reg(client, OV2680_8BIT, OV2680_SW_STREAM,
 				enable ? OV2680_START_STREAMING :
@@ -1508,11 +1509,11 @@ static int ov2680_probe(struct i2c_client *client,
 	if (ret)
 	{
 		ov2680_remove(client);
-		ov2680_debug(&client->dev, "+++ remove ov2680 \n");
+		dev_dbg(&client->dev, "+++ remove ov2680 \n");
 	}
 	return ret;
 out_free:
-	ov2680_debug(&client->dev, "+++ out free \n");
+	dev_dbg(&client->dev, "+++ out free \n");
 	v4l2_device_unregister_subdev(&dev->sd);
 	kfree(dev);
 	return ret;

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 16/24] stating/atomisp: fix -Wold-style-definition warning
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (13 preceding siblings ...)
  2017-03-20 14:41 ` [PATCH 15/24] staging/atomisp: fix empty-body warning Alan Cox
@ 2017-03-20 14:41 ` Alan Cox
  2017-03-20 14:41 ` [PATCH 17/24] staging/atomisp: remove sh_css_lace_stat code Alan Cox
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:41 UTC (permalink / raw)
  To: greg, linux-media

From: Arnd Bergmann <arnd@arndb.de>

ia_css_dequeue_param_buffers does not have an arguement type, causing a warning:

drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c: In function 'ia_css_dequeue_param_buffers':
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:3728:6: error: old-style function definition [-Werror=old-style-definition]

This adds a 'void' keywork to silence the warning.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../atomisp/pci/atomisp2/css2400/sh_css_params.c   |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c
index e4599f7..36a0c6b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c
@@ -3723,7 +3723,7 @@ static void sh_css_update_isp_mem_params_to_ddr(
 	IA_CSS_LEAVE_PRIVATE("void");
 }
 
-void ia_css_dequeue_param_buffers(/*unsigned int pipe_num*/)
+void ia_css_dequeue_param_buffers(/*unsigned int pipe_num*/ void)
 {
 	unsigned int i;
 	hrt_vaddress cpy;

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 17/24] staging/atomisp: remove sh_css_lace_stat code
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (14 preceding siblings ...)
  2017-03-20 14:41 ` [PATCH 16/24] stating/atomisp: fix -Wold-style-definition warning Alan Cox
@ 2017-03-20 14:41 ` Alan Cox
  2017-03-20 14:41 ` [PATCH 18/24] staging/atomisp: add VIDEO_V4L2_SUBDEV_API dependency Alan Cox
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:41 UTC (permalink / raw)
  To: greg, linux-media

From: Arnd Bergmann <arnd@arndb.de>

I ran into a build warning on my randconfig build box:

drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c: In function 'ia_css_lace_statistics_free':
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c:2845:64: error: parameter 'me' set but not used [-Werror=unused-but-set-parameter]

It turns out that not only the parameter is unused but the entire function has no
caller. Let's just remove it.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../staging/media/atomisp/pci/atomisp2/Makefile    |    1 -
 .../media/atomisp/pci/atomisp2/css2400/ia_css.h    |    1 -
 .../atomisp/pci/atomisp2/css2400/ia_css_buffer.h   |    1 -
 .../pci/atomisp2/css2400/ia_css_lace_stat.h        |   37 --------------------
 .../atomisp/pci/atomisp2/css2400/sh_css_internal.h |    1 -
 .../pci/atomisp2/css2400/sh_css_lace_stat.c        |   16 ---------
 .../atomisp/pci/atomisp2/css2400/sh_css_params.c   |   15 --------
 7 files changed, 72 deletions(-)
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_lace_stat.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_lace_stat.c

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/Makefile b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
index 162bcbf..ab10fc0 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/Makefile
+++ b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
@@ -106,7 +106,6 @@ atomisp-objs += \
 	css2400/isp/kernels/ipu2_io_ls/bayer_io_ls/ia_css_bayer_io.host.o \
 	css2400/isp/kernels/ipu2_io_ls/yuv444_io_ls/ia_css_yuv444_io.host.o \
 	css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a.host.o \
-	css2400/sh_css_lace_stat.o \
 	css2400/sh_css_pipe.o \
 	css2400/ia_css_device_access.o \
 	css2400/sh_css_host_data.o \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css.h
index f67626f..2458b37 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css.h
@@ -42,7 +42,6 @@
 #include "ia_css_stream_format.h"
 #include "ia_css_stream_public.h"
 #include "ia_css_tpg.h"
-#include "ia_css_lace_stat.h"
 #include "ia_css_version.h"
 #include "ia_css_mmu.h"
 #include "ia_css_morph.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_buffer.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_buffer.h
index 26b16f4..b2ecf36 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_buffer.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_buffer.h
@@ -60,7 +60,6 @@ struct ia_css_buffer {
 		struct ia_css_isp_3a_statistics  *stats_3a;    /**< 3A statistics & optionally RGBY statistics. */
 		struct ia_css_isp_dvs_statistics *stats_dvs;   /**< DVS statistics. */
 		struct ia_css_isp_skc_dvs_statistics *stats_skc_dvs;  /**< SKC DVS statistics. */
-		struct ia_css_isp_lace_statistics *stats_lace; /**< LACE statistics. */
 		struct ia_css_frame              *frame;       /**< Frame buffer. */
 		struct ia_css_acc_param          *custom_data; /**< Custom buffer. */
 		struct ia_css_metadata           *metadata;    /**< Sensor metadata. */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_lace_stat.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_lace_stat.h
deleted file mode 100644
index 6fee1e2..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_lace_stat.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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_LACE_STAT_H
-#define __IA_CSS_LACE_STAT_H
-
-/** @file
- * This file contains types used for LACE statistics
- */
-
-struct ia_css_isp_lace_statistics;
-
-/** @brief Allocate mem for the LACE statistics on the ISP
- * @return	Pointer to the allocated LACE statistics
- *         buffer on the ISP
-*/
-struct ia_css_isp_lace_statistics *ia_css_lace_statistics_allocate(void);
-
-/** @brief Free the ACC LACE statistics memory on the isp
- * @param[in]	me Pointer to the LACE statistics buffer on the
- *       ISP.
- * @return		None
-*/
-void ia_css_lace_statistics_free(struct ia_css_isp_lace_statistics *me);
-
-#endif /*  __IA_CSS_LACE_STAT_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_internal.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_internal.h
index a70a72a..9a3fe2b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_internal.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_internal.h
@@ -44,7 +44,6 @@
 #include "ia_css_frame_comm.h"
 #include "ia_css_3a.h"
 #include "ia_css_dvs.h"
-#include "ia_css_lace_stat.h"
 #include "ia_css_metadata.h"
 #include "runtime/bufq/interface/ia_css_bufq.h"
 #include "ia_css_timer.h"
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_lace_stat.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_lace_stat.c
deleted file mode 100644
index 850aa5e..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_lace_stat.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * 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.
- */
-
-/* This file will contain the code to implement the functions declared in ia_css_lace_stat.h
-   and associated helper functions */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c
index 36a0c6b..2807bb8 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c
@@ -1225,10 +1225,6 @@ struct ia_css_isp_skc_dvs_statistics {
 	ia_css_ptr p_data;
 };
 
-struct ia_css_isp_lace_statistics {
-	ia_css_ptr p_data;
-};
-
 static enum ia_css_err
 ref_sh_css_ddr_address_map(
 		struct sh_css_ddr_address_map *map,
@@ -2839,17 +2835,6 @@ struct ia_css_isp_skc_dvs_statistics *ia_css_skc_dvs_statistics_allocate(void)
 	return NULL;
 }
 
-void
-ia_css_lace_statistics_free(struct ia_css_isp_lace_statistics *me)
-{
-	me = NULL;
-}
-
-struct ia_css_isp_lace_statistics *ia_css_lace_statistics_allocate(void)
-{
-	return NULL;
-}
-
 struct ia_css_metadata *
 ia_css_metadata_allocate(const struct ia_css_metadata_info *metadata_info)
 {

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 18/24] staging/atomisp: add VIDEO_V4L2_SUBDEV_API dependency
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (15 preceding siblings ...)
  2017-03-20 14:41 ` [PATCH 17/24] staging/atomisp: remove sh_css_lace_stat code Alan Cox
@ 2017-03-20 14:41 ` Alan Cox
  2017-03-20 14:41 ` [PATCH 19/24] staging/atomisp: add PCI dependency Alan Cox
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:41 UTC (permalink / raw)
  To: greg, linux-media

From: Arnd Bergmann <arnd@arndb.de>

The driver fails to build if this is disabled, so we need an explicit
Kconfig dependency:

drivers/staging/media/atomisp/pci/atomisp2/./atomisp_cmd.c:6085:48: error: 'struct v4l2_subdev_fh' has no member named 'pad'

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 drivers/staging/media/atomisp/pci/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/Kconfig b/drivers/staging/media/atomisp/pci/Kconfig
index e8f6783..a724214 100644
--- a/drivers/staging/media/atomisp/pci/Kconfig
+++ b/drivers/staging/media/atomisp/pci/Kconfig
@@ -4,7 +4,7 @@
 
 config VIDEO_ATOMISP
        tristate "Intel Atom Image Signal Processor Driver"
-       depends on VIDEO_V4L2
+       depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
        select VIDEOBUF_VMALLOC
         ---help---
           Say Y here if your platform supports Intel Atom SoC

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 19/24] staging/atomisp: add PCI dependency
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (16 preceding siblings ...)
  2017-03-20 14:41 ` [PATCH 18/24] staging/atomisp: add VIDEO_V4L2_SUBDEV_API dependency Alan Cox
@ 2017-03-20 14:41 ` Alan Cox
  2017-03-20 14:42 ` [PATCH 20/24] staging/atomisp: add ACPI dependency Alan Cox
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:41 UTC (permalink / raw)
  To: greg, linux-media

From: Arnd Bergmann <arnd@arndb.de>

Without CONFIG_PCI, config space reads never return any data,
leading to undefined behavior that gcc warns about:

platform/intel-mid/intel_mid_pcihelpers.c: In function 'intel_mid_msgbus_read32_raw':
platform/intel-mid/intel_mid_pcihelpers.c:66:9: error: 'data' is used uninitialized in this function [-Werror=uninitialized]
platform/intel-mid/intel_mid_pcihelpers.c: In function 'intel_mid_msgbus_read32_raw_ext':
platform/intel-mid/intel_mid_pcihelpers.c:84:9: error: 'data' is used uninitialized in this function [-Werror=uninitialized]
platform/intel-mid/intel_mid_pcihelpers.c: In function 'intel_mid_msgbus_read32':
platform/intel-mid/intel_mid_pcihelpers.c:137:9: error: 'data' is used uninitialized in this function [-Werror=uninitialized]

With a dependency on CONFIG_PCI, we don't get this warning. This seems
safe as PCI config space accessors should always return something
when PCI is enabled.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 drivers/staging/media/atomisp/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/Kconfig b/drivers/staging/media/atomisp/Kconfig
index 28615aa..8b172ed 100644
--- a/drivers/staging/media/atomisp/Kconfig
+++ b/drivers/staging/media/atomisp/Kconfig
@@ -1,6 +1,6 @@
 menuconfig INTEL_ATOMISP
         bool "Enable support to Intel MIPI camera drivers"
-        depends on X86 && EFI && MEDIA_CONTROLLER
+        depends on X86 && EFI && MEDIA_CONTROLLER && PCI
         help
           Enable support for the Intel ISP2 camera interfaces and MIPI
           sensor drivers.

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 20/24] staging/atomisp: add ACPI dependency
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (17 preceding siblings ...)
  2017-03-20 14:41 ` [PATCH 19/24] staging/atomisp: add PCI dependency Alan Cox
@ 2017-03-20 14:42 ` Alan Cox
  2017-03-20 14:42 ` [PATCH 21/24] staging: atomisp: remove else statement after return Alan Cox
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:42 UTC (permalink / raw)
  To: greg, linux-media

From: Arnd Bergmann <arnd@arndb.de>

Without ACPI, some of the code fails to build:

media/atomisp/platform/intel-mid/atomisp_gmin_platform.c: In function 'atomisp_register_i2c_module':
media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:174:7: error: dereferencing pointer to incomplete type 'struct acpi_device'

We could work around that in the code, but since we already have a hard
dependency on x86, adding the ACPI dependency seems to be the easiest
solution.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 drivers/staging/media/atomisp/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/Kconfig b/drivers/staging/media/atomisp/Kconfig
index 8b172ed..8eb13c3 100644
--- a/drivers/staging/media/atomisp/Kconfig
+++ b/drivers/staging/media/atomisp/Kconfig
@@ -1,6 +1,6 @@
 menuconfig INTEL_ATOMISP
         bool "Enable support to Intel MIPI camera drivers"
-        depends on X86 && EFI && MEDIA_CONTROLLER && PCI
+        depends on X86 && EFI && MEDIA_CONTROLLER && PCI && ACPI
         help
           Enable support for the Intel ISP2 camera interfaces and MIPI
           sensor drivers.

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 21/24] staging: atomisp: remove else statement after return
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (18 preceding siblings ...)
  2017-03-20 14:42 ` [PATCH 20/24] staging/atomisp: add ACPI dependency Alan Cox
@ 2017-03-20 14:42 ` Alan Cox
  2017-03-20 14:42 ` [PATCH 22/24] staging: atomisp: remove redudant condition in if-statement Alan Cox
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:42 UTC (permalink / raw)
  To: greg, linux-media

From: Daeseok Youn <daeseok.youn@gmail.com>

It doesn't need to have else statement after return.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/atomisp_cmd.c       |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 37d334e..036413b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -2951,11 +2951,11 @@ int atomisp_get_metadata(struct atomisp_sub_device *asd, int flag,
 		dev_err(isp->dev, "copy to user failed: copied %d bytes\n",
 			ret);
 		return -EFAULT;
-	} else {
-		list_del_init(&md_buf->list);
-		list_add_tail(&md_buf->list, &asd->metadata[md_type]);
 	}
 
+	list_del_init(&md_buf->list);
+	list_add_tail(&md_buf->list, &asd->metadata[md_type]);
+
 	dev_dbg(isp->dev, "%s: HAL de-queued metadata type %d with exp_id %d\n",
 		__func__, md_type, md->exp_id);
 	return 0;

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 22/24] staging: atomisp: remove redudant condition in if-statement
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (19 preceding siblings ...)
  2017-03-20 14:42 ` [PATCH 21/24] staging: atomisp: remove else statement after return Alan Cox
@ 2017-03-20 14:42 ` Alan Cox
  2017-03-20 14:42 ` [PATCH 23/24] atomisp: remove a sysfs error message that can be used to log spam Alan Cox
  2017-03-20 14:42 ` [PATCH 24/24] staging: atomisp: simplify if statement in atomisp_get_sensor_fps() Alan Cox
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:42 UTC (permalink / raw)
  To: greg, linux-media

From: Daeseok Youn <daeseok.youn@gmail.com>

The V4L2_FIELD_ANY is zero, so the (!field) is same meaning
with (field == V4L2_FIELD_ANY) in if-statement.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/atomisp_cmd.c       |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 036413b..0a2df3d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -5081,7 +5081,7 @@ atomisp_try_fmt_file(struct atomisp_device *isp, struct v4l2_format *f)
 
 	depth = get_pixel_depth(pixelformat);
 
-	if (!field || field == V4L2_FIELD_ANY)
+	if (field == V4L2_FIELD_ANY)
 		field = V4L2_FIELD_NONE;
 	else if (field != V4L2_FIELD_NONE) {
 		dev_err(isp->dev, "Wrong output field\n");

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 23/24] atomisp: remove a sysfs error message that can be used to log spam
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (20 preceding siblings ...)
  2017-03-20 14:42 ` [PATCH 22/24] staging: atomisp: remove redudant condition in if-statement Alan Cox
@ 2017-03-20 14:42 ` Alan Cox
  2017-03-20 14:42 ` [PATCH 24/24] staging: atomisp: simplify if statement in atomisp_get_sensor_fps() Alan Cox
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:42 UTC (permalink / raw)
  To: greg, linux-media

Instead of logging this just report ERANGE as an error, which will give something close to the
right user space report.

The others of these were already removed by Dan Carpenter's patch.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/atomisp_drvfs.c     |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
index 7f7c6d5..fcfe8d7 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
@@ -107,9 +107,7 @@ static ssize_t iunit_dbglvl_store(struct device_driver *drv, const char *buf,
 	if (kstrtouint(buf, 10, &iunit_debug.dbglvl)
 		|| iunit_debug.dbglvl < 1
 		|| iunit_debug.dbglvl > 9) {
-		dev_err(atomisp_dev, "%s setting %d value invalid, should be [1,9]\n",
-			__func__, iunit_debug.dbglvl);
-		return -EINVAL;
+		return -ERANGE;
 	}
 	atomisp_css_debug_set_dtrace_level(iunit_debug.dbglvl);
 

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 24/24] staging: atomisp: simplify if statement in atomisp_get_sensor_fps()
  2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
                   ` (21 preceding siblings ...)
  2017-03-20 14:42 ` [PATCH 23/24] atomisp: remove a sysfs error message that can be used to log spam Alan Cox
@ 2017-03-20 14:42 ` Alan Cox
  22 siblings, 0 replies; 25+ messages in thread
From: Alan Cox @ 2017-03-20 14:42 UTC (permalink / raw)
  To: greg, linux-media

From: Daeseok Youn <daeseok.youn@gmail.com>

If v4l2_subdev_call() gets the global frame interval values,
it returned 0 and it could be checked whether numerator is zero or not.

If the numerator is not zero, the fps could be calculated in this function.
If not, it just returns 0.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/atomisp_cmd.c       |   22 +++++++++-----------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 0a2df3d..9d44a1d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -153,20 +153,18 @@ struct atomisp_acc_pipe *atomisp_to_acc_pipe(struct video_device *dev)
 
 static unsigned short atomisp_get_sensor_fps(struct atomisp_sub_device *asd)
 {
-	struct v4l2_subdev_frame_interval frame_interval;
+	struct v4l2_subdev_frame_interval fi;
 	struct atomisp_device *isp = asd->isp;
-	unsigned short fps;
 
-	if (v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
-	    video, g_frame_interval, &frame_interval)) {
-		fps = 0;
-	} else {
-		if (frame_interval.interval.numerator)
-			fps = frame_interval.interval.denominator /
-			    frame_interval.interval.numerator;
-		else
-			fps = 0;
-	}
+	unsigned short fps = 0;
+	int ret;
+
+	ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
+			       video, g_frame_interval, &fi);
+
+	if (!ret && fi.interval.numerator)
+		fps = fi.interval.denominator / fi.interval.numerator;
+
 	return fps;
 }
 

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH 06/24] atomisp: kill another define
  2017-03-20 14:39 ` [PATCH 06/24] atomisp: kill another define Alan Cox
@ 2017-03-21  7:05   ` Greg KH
  0 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2017-03-21  7:05 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-media

On Mon, Mar 20, 2017 at 02:39:38PM +0000, Alan Cox wrote:
> We don't need an ifdef for the sake of 8-12 bytes. This undoes the ifdef added by
> fde469701c7efabebf885e785edf367bfb1a8f3f. Instead turn it into a single const string
> array at a fixed location thereby saving even more memory.
> 
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>  .../staging/media/atomisp/pci/atomisp2/hmm/hmm.c   |   23 +++++++++-----------
>  1 file changed, 10 insertions(+), 13 deletions(-)
> 

This patch didn't apply to my tree, can you rebase it and resend?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2017-03-21  7:06 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20 14:38 [PATCH 01/24] atomisp: remove the iefd2 kernel Alan Cox
2017-03-20 14:38 ` [PATCH 02/24] atomisp: remove aa kernel wrappers Alan Cox
2017-03-20 14:38 ` [PATCH 03/24] atomisp: remove the unused debug wrapping from the mmgr layer Alan Cox
2017-03-20 14:38 ` [PATCH 04/24] atomisp: remove another layer of allocator indirection Alan Cox
2017-03-20 14:39 ` [PATCH 05/24] atomisp: ia_css_bh_hmem_encode is a no-op so remove it Alan Cox
2017-03-20 14:39 ` [PATCH 06/24] atomisp: kill another define Alan Cox
2017-03-21  7:05   ` Greg KH
2017-03-20 14:39 ` [PATCH 07/24] ov5693: remove unused function Alan Cox
2017-03-20 14:40 ` [PATCH 08/24] atomisp/imx: Fix locking bug on error path Alan Cox
2017-03-20 14:40 ` [PATCH 09/24] atomisp: remove another pair of 2400/2401 differences Alan Cox
2017-03-20 14:40 ` [PATCH 10/24] Staging: atomisp: fix locking in alloc_user_pages() Alan Cox
2017-03-20 14:40 ` [PATCH 11/24] Staging: atomisp: fix an uninitialized variable bug Alan Cox
2017-03-20 14:40 ` [PATCH 12/24] staging: media: atomisp: select REGMAP_I2C needed by ap1302.c Alan Cox
2017-03-20 14:41 ` [PATCH 13/24] staging: media: atomisp: add missing dependencies in Kconfig Alan Cox
2017-03-20 14:41 ` [PATCH 14/24] staging/atomisp: include linux/io.h where needed Alan Cox
2017-03-20 14:41 ` [PATCH 15/24] staging/atomisp: fix empty-body warning Alan Cox
2017-03-20 14:41 ` [PATCH 16/24] stating/atomisp: fix -Wold-style-definition warning Alan Cox
2017-03-20 14:41 ` [PATCH 17/24] staging/atomisp: remove sh_css_lace_stat code Alan Cox
2017-03-20 14:41 ` [PATCH 18/24] staging/atomisp: add VIDEO_V4L2_SUBDEV_API dependency Alan Cox
2017-03-20 14:41 ` [PATCH 19/24] staging/atomisp: add PCI dependency Alan Cox
2017-03-20 14:42 ` [PATCH 20/24] staging/atomisp: add ACPI dependency Alan Cox
2017-03-20 14:42 ` [PATCH 21/24] staging: atomisp: remove else statement after return Alan Cox
2017-03-20 14:42 ` [PATCH 22/24] staging: atomisp: remove redudant condition in if-statement Alan Cox
2017-03-20 14:42 ` [PATCH 23/24] atomisp: remove a sysfs error message that can be used to log spam Alan Cox
2017-03-20 14:42 ` [PATCH 24/24] staging: atomisp: simplify if statement in atomisp_get_sensor_fps() Alan Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.