All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/14] staging: atomisp: use local variable to reduce number of references
@ 2017-04-12 18:20 Alan Cox
  2017-04-12 18:20 ` [PATCH 02/14] staging/atomisp: fix spelling mistake: "falied" -> "failed" Alan Cox
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:20 UTC (permalink / raw)
  To: greg, linux-media

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

Define new local variable to reduce the number of reference.
The new local variable is added to save the addess of dfs
and used in atomisp_freq_scaling() function.

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       |   37 +++++++++++---------
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 94bc793..9ad5146 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -251,6 +251,7 @@ int atomisp_freq_scaling(struct atomisp_device *isp,
 {
 	/* FIXME! Only use subdev[0] status yet */
 	struct atomisp_sub_device *asd = &isp->asd[0];
+	const struct atomisp_dfs_config *dfs;
 	unsigned int new_freq;
 	struct atomisp_freq_scaling_rule curr_rules;
 	int i, ret;
@@ -265,20 +266,22 @@ int atomisp_freq_scaling(struct atomisp_device *isp,
 		ATOMISP_PCI_DEVICE_SOC_CHT && ATOMISP_USE_YUVPP(asd))
 		isp->dfs = &dfs_config_cht_soc;
 
-	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) {
+	dfs = isp->dfs;
+
+	if (dfs->lowest_freq == 0 || dfs->max_freq_at_vmin == 0 ||
+	    dfs->highest_freq == 0 || dfs->dfs_table_size == 0 ||
+	    !dfs->dfs_table) {
 		dev_err(isp->dev, "DFS configuration is invalid.\n");
 		return -EINVAL;
 	}
 
 	if (mode == ATOMISP_DFS_MODE_LOW) {
-		new_freq = isp->dfs->lowest_freq;
+		new_freq = dfs->lowest_freq;
 		goto done;
 	}
 
 	if (mode == ATOMISP_DFS_MODE_MAX) {
-		new_freq = isp->dfs->highest_freq;
+		new_freq = dfs->highest_freq;
 		goto done;
 	}
 
@@ -304,26 +307,26 @@ int atomisp_freq_scaling(struct atomisp_device *isp,
 	}
 
 	/* search for the target frequency by looping freq rules*/
-	for (i = 0; i < isp->dfs->dfs_table_size; i++) {
-		if (curr_rules.width != isp->dfs->dfs_table[i].width &&
-		    isp->dfs->dfs_table[i].width != ISP_FREQ_RULE_ANY)
+	for (i = 0; i < dfs->dfs_table_size; i++) {
+		if (curr_rules.width != dfs->dfs_table[i].width &&
+		    dfs->dfs_table[i].width != ISP_FREQ_RULE_ANY)
 			continue;
-		if (curr_rules.height != isp->dfs->dfs_table[i].height &&
-		    isp->dfs->dfs_table[i].height != ISP_FREQ_RULE_ANY)
+		if (curr_rules.height != dfs->dfs_table[i].height &&
+		    dfs->dfs_table[i].height != ISP_FREQ_RULE_ANY)
 			continue;
-		if (curr_rules.fps != isp->dfs->dfs_table[i].fps &&
-		    isp->dfs->dfs_table[i].fps != ISP_FREQ_RULE_ANY)
+		if (curr_rules.fps != dfs->dfs_table[i].fps &&
+		    dfs->dfs_table[i].fps != ISP_FREQ_RULE_ANY)
 			continue;
-		if (curr_rules.run_mode != isp->dfs->dfs_table[i].run_mode &&
-		    isp->dfs->dfs_table[i].run_mode != ISP_FREQ_RULE_ANY)
+		if (curr_rules.run_mode != dfs->dfs_table[i].run_mode &&
+		    dfs->dfs_table[i].run_mode != ISP_FREQ_RULE_ANY)
 			continue;
 		break;
 	}
 
-	if (i == isp->dfs->dfs_table_size)
-		new_freq = isp->dfs->max_freq_at_vmin;
+	if (i == dfs->dfs_table_size)
+		new_freq = dfs->max_freq_at_vmin;
 	else
-		new_freq = isp->dfs->dfs_table[i].isp_freq;
+		new_freq = dfs->dfs_table[i].isp_freq;
 
 done:
 	dev_dbg(isp->dev, "DFS target frequency=%d.\n", new_freq);

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

* [PATCH 02/14] staging/atomisp: fix spelling mistake: "falied" -> "failed"
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
@ 2017-04-12 18:20 ` Alan Cox
  2017-04-12 18:20 ` [PATCH 03/14] staging: atomisp: remove enable_isp_irq function and add disable_isp_irq Alan Cox
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:20 UTC (permalink / raw)
  To: greg, linux-media

From: Colin Ian King <colin.king@canonical.com>

trivial fix to spelling mistake in dev_err error message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/hmm/hmm_bo_dev.c    |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo_dev.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo_dev.c
index 87090ce..d22a2d2 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo_dev.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo_dev.c
@@ -59,7 +59,7 @@ int hmm_bo_device_init(struct hmm_bo_device *bdev,
 
 	ret = hmm_vm_init(&bdev->vaddr_space, vaddr_start, size);
 	if (ret) {
-		dev_err(atomisp_dev, "hmm_vm_init falied. vaddr_start = 0x%x, size = %d\n",
+		dev_err(atomisp_dev, "hmm_vm_init failed. vaddr_start = 0x%x, size = %d\n",
 			vaddr_start, size);
 		goto vm_init_err;
 	}

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

* [PATCH 03/14] staging: atomisp: remove enable_isp_irq function and add disable_isp_irq
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
  2017-04-12 18:20 ` [PATCH 02/14] staging/atomisp: fix spelling mistake: "falied" -> "failed" Alan Cox
@ 2017-04-12 18:20 ` Alan Cox
  2017-04-12 18:20 ` [PATCH 04/14] staging: atomisp: replace "&isp->asd[i]" with "asd" in __get_asd_from_port() Alan Cox
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:20 UTC (permalink / raw)
  To: greg, linux-media

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

Enable/Disable ISP irq is switched with "enable" parameter of
enable_isp_irq(). It would be better splited to two such as
enable_isp_irq()/disable_isp_irq().

But the enable_isp_irq() is no use in atomisp_cmd.c file.
So remove the enable_isp_irq() function and add
disable_isp_irq function only.

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       |   36 +++++---------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 9ad5146..08606cb 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -376,34 +376,16 @@ int atomisp_reset(struct atomisp_device *isp)
 }
 
 /*
- * interrupt enable/disable functions
+ * interrupt disable functions
  */
-static void enable_isp_irq(enum hrt_isp_css_irq irq, bool enable)
-{
-	if (enable) {
-		irq_enable_channel(IRQ0_ID, irq);
-		/*sh_css_hrt_irq_enable(irq, true, false);*/
-		switch (irq) { /*We only have sp interrupt right now*/
-		case hrt_isp_css_irq_sp:
-			/*sh_css_hrt_irq_enable_sp(true);*/
-			cnd_sp_irq_enable(SP0_ID, true);
-			break;
-		default:
-			break;
-		}
+static void disable_isp_irq(enum hrt_isp_css_irq irq)
+{
+	irq_disable_channel(IRQ0_ID, irq);
 
-	} else {
-		/*sh_css_hrt_irq_disable(irq);*/
-		irq_disable_channel(IRQ0_ID, irq);
-		switch (irq) {
-		case hrt_isp_css_irq_sp:
-			/*sh_css_hrt_irq_enable_sp(false);*/
-			cnd_sp_irq_enable(SP0_ID, false);
-			break;
-		default:
-			break;
-		}
-	}
+	if (irq != hrt_isp_css_irq_sp)
+		return;
+
+	cnd_sp_irq_enable(SP0_ID, false);
 }
 
 /*
@@ -1416,7 +1398,7 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout)
 	}
 
 	/* clear irq */
-	enable_isp_irq(hrt_isp_css_irq_sp, false);
+	disable_isp_irq(hrt_isp_css_irq_sp);
 	clear_isp_irq(hrt_isp_css_irq_sp);
 
 	/* Set the SRSE to 3 before resetting */

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

* [PATCH 04/14] staging: atomisp: replace "&isp->asd[i]" with "asd" in __get_asd_from_port()
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
  2017-04-12 18:20 ` [PATCH 02/14] staging/atomisp: fix spelling mistake: "falied" -> "failed" Alan Cox
  2017-04-12 18:20 ` [PATCH 03/14] staging: atomisp: remove enable_isp_irq function and add disable_isp_irq Alan Cox
@ 2017-04-12 18:20 ` Alan Cox
  2017-04-12 18:20 ` [PATCH 05/14] staging: atomisp: move mipi_info assignment to next line " Alan Cox
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:20 UTC (permalink / raw)
  To: greg, linux-media

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

The address of isp->asd[i] is already assigned to
local "asd" variable. "&isp->asd[i]" would be replaced with
just "asd".

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       |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 08606cb..d98a6ea 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -536,9 +536,9 @@ __get_asd_from_port(struct atomisp_device *isp, mipi_port_ID_t port)
 		struct camera_mipi_info *mipi_info =
 				atomisp_to_sensor_mipi_info(
 					isp->inputs[asd->input_curr].camera);
-		if (isp->asd[i].streaming == ATOMISP_DEVICE_STREAMING_ENABLED &&
+		if (asd->streaming == ATOMISP_DEVICE_STREAMING_ENABLED &&
 		    __get_mipi_port(isp, mipi_info->port) == port) {
-			return &isp->asd[i];
+			return asd;
 		}
 	}
 

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

* [PATCH 05/14] staging: atomisp: move mipi_info assignment to next line in __get_asd_from_port()
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (2 preceding siblings ...)
  2017-04-12 18:20 ` [PATCH 04/14] staging: atomisp: replace "&isp->asd[i]" with "asd" in __get_asd_from_port() Alan Cox
@ 2017-04-12 18:20 ` Alan Cox
  2017-04-12 18:21 ` [PATCH 06/14] atomisp: remove most of the uses of atomisp_kernel_malloc Alan Cox
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:20 UTC (permalink / raw)
  To: greg, linux-media

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

The line which is initializing mipi_info variable is too long
to read. It would be placed in next line.

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       |    8 +++++---
 1 file changed, 5 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 d98a6ea..a8614a9 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -533,9 +533,11 @@ __get_asd_from_port(struct atomisp_device *isp, mipi_port_ID_t port)
 	/* Check which isp subdev to send eof */
 	for (i = 0; i < isp->num_of_streams; i++) {
 		struct atomisp_sub_device *asd = &isp->asd[i];
-		struct camera_mipi_info *mipi_info =
-				atomisp_to_sensor_mipi_info(
-					isp->inputs[asd->input_curr].camera);
+		struct camera_mipi_info *mipi_info;
+
+		mipi_info = atomisp_to_sensor_mipi_info(
+				isp->inputs[asd->input_curr].camera);
+
 		if (asd->streaming == ATOMISP_DEVICE_STREAMING_ENABLED &&
 		    __get_mipi_port(isp, mipi_info->port) == port) {
 			return asd;

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

* [PATCH 06/14] atomisp: remove most of the uses of atomisp_kernel_malloc
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (3 preceding siblings ...)
  2017-04-12 18:20 ` [PATCH 05/14] staging: atomisp: move mipi_info assignment to next line " Alan Cox
@ 2017-04-12 18:21 ` Alan Cox
  2017-04-12 18:21 ` [PATCH 07/14] atomisp: unwrap the _ex malloc/free functions Alan Cox
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:21 UTC (permalink / raw)
  To: greg, linux-media

They can be replaced by kmalloc. There are a few that do need to pick kmalloc
or vmalloc. Those we leave for the moment.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../atomisp/pci/atomisp2/atomisp_compat_css20.c    |    4 --
 .../media/atomisp/pci/atomisp2/hmm/hmm_bo.c        |   34 ++++++++++----------
 .../atomisp/pci/atomisp2/hmm/hmm_dynamic_pool.c    |    8 ++---
 .../atomisp/pci/atomisp2/hmm/hmm_reserved_pool.c   |   14 ++++----
 4 files changed, 28 insertions(+), 32 deletions(-)

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 2e20a81..6586842 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
@@ -1669,11 +1669,7 @@ int atomisp_alloc_dis_coef_buf(struct atomisp_sub_device *asd)
 
 int atomisp_alloc_metadata_output_buf(struct atomisp_sub_device *asd)
 {
-#ifndef ISP2401
-	int i; /* Coverity CID 298003 - index var must be signed */
-#else
 	int i;
-#endif
 
 	/* We allocate the cpu-side buffer used for communication with user
 	 * space */
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 a51a27b..11162f5 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
@@ -725,8 +725,8 @@ static int alloc_private_pages(struct hmm_buffer_object *bo,
 
 	pgnr = bo->pgnr;
 
-	bo->page_obj = atomisp_kernel_malloc(
-				sizeof(struct hmm_page_object) * pgnr);
+	bo->page_obj = kmalloc(sizeof(struct hmm_page_object) * pgnr,
+				GFP_KERNEL);
 	if (unlikely(!bo->page_obj)) {
 		dev_err(atomisp_dev, "out of memory for bo->page_obj\n");
 		return -ENOMEM;
@@ -860,7 +860,7 @@ static int alloc_private_pages(struct hmm_buffer_object *bo,
 	alloc_pgnr = i;
 	free_private_bo_pages(bo, dypool, repool, alloc_pgnr);
 
-	atomisp_kernel_free(bo->page_obj);
+	kfree(bo->page_obj);
 
 	return -ENOMEM;
 }
@@ -871,7 +871,7 @@ static void free_private_pages(struct hmm_buffer_object *bo,
 {
 	free_private_bo_pages(bo, dypool, repool, bo->pgnr);
 
-	atomisp_kernel_free(bo->page_obj);
+	kfree(bo->page_obj);
 }
 
 /*
@@ -990,17 +990,17 @@ static int alloc_user_pages(struct hmm_buffer_object *bo,
 	struct vm_area_struct *vma;
 	struct page **pages;
 
-	pages = atomisp_kernel_malloc(sizeof(struct page *) * bo->pgnr);
+	pages = kmalloc(sizeof(struct page *) * bo->pgnr, GFP_KERNEL);
 	if (unlikely(!pages)) {
 		dev_err(atomisp_dev, "out of memory for pages...\n");
 		return -ENOMEM;
 	}
 
-	bo->page_obj = atomisp_kernel_malloc(
-				sizeof(struct hmm_page_object) * bo->pgnr);
+	bo->page_obj = kmalloc(sizeof(struct hmm_page_object) * bo->pgnr,
+		GFP_KERNEL);
 	if (unlikely(!bo->page_obj)) {
 		dev_err(atomisp_dev, "out of memory for bo->page_obj...\n");
-		atomisp_kernel_free(pages);
+		kfree(pages);
 		return -ENOMEM;
 	}
 
@@ -1010,8 +1010,8 @@ static int alloc_user_pages(struct hmm_buffer_object *bo,
 	up_read(&current->mm->mmap_sem);
 	if (vma == NULL) {
 		dev_err(atomisp_dev, "find_vma failed\n");
-		atomisp_kernel_free(bo->page_obj);
-		atomisp_kernel_free(pages);
+		kfree(bo->page_obj);
+		kfree(pages);
 		mutex_lock(&bo->mutex);
 		return -EFAULT;
 	}
@@ -1051,15 +1051,15 @@ static int alloc_user_pages(struct hmm_buffer_object *bo,
 		bo->page_obj[i].type = HMM_PAGE_TYPE_GENERAL;
 	}
 	hmm_mem_stat.usr_size += bo->pgnr;
-	atomisp_kernel_free(pages);
+	kfree(pages);
 
 	return 0;
 
 out_of_mem:
 	for (i = 0; i < page_nr; i++)
 		put_page(pages[i]);
-	atomisp_kernel_free(pages);
-	atomisp_kernel_free(bo->page_obj);
+	kfree(pages);
+	kfree(bo->page_obj);
 
 	return -ENOMEM;
 }
@@ -1072,7 +1072,7 @@ static void free_user_pages(struct hmm_buffer_object *bo)
 		put_page(bo->page_obj[i].page);
 	hmm_mem_stat.usr_size -= bo->pgnr;
 
-	atomisp_kernel_free(bo->page_obj);
+	kfree(bo->page_obj);
 }
 
 /*
@@ -1363,7 +1363,7 @@ void *hmm_bo_vmap(struct hmm_buffer_object *bo, bool cached)
 		bo->status &= ~(HMM_BO_VMAPED | HMM_BO_VMAPED_CACHED);
 	}
 
-	pages = atomisp_kernel_malloc(sizeof(*pages) * bo->pgnr);
+	pages = kmalloc(sizeof(*pages) * bo->pgnr, GFP_KERNEL);
 	if (unlikely(!pages)) {
 		mutex_unlock(&bo->mutex);
 		dev_err(atomisp_dev, "out of memory for pages...\n");
@@ -1376,14 +1376,14 @@ void *hmm_bo_vmap(struct hmm_buffer_object *bo, bool cached)
 	bo->vmap_addr = vmap(pages, bo->pgnr, VM_MAP,
 		cached ? PAGE_KERNEL : PAGE_KERNEL_NOCACHE);
 	if (unlikely(!bo->vmap_addr)) {
-		atomisp_kernel_free(pages);
+		kfree(pages);
 		mutex_unlock(&bo->mutex);
 		dev_err(atomisp_dev, "vmap failed...\n");
 		return NULL;
 	}
 	bo->status |= (cached ? HMM_BO_VMAPED_CACHED : HMM_BO_VMAPED);
 
-	atomisp_kernel_free(pages);
+	kfree(pages);
 
 	mutex_unlock(&bo->mutex);
 	return bo->vmap_addr;
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_dynamic_pool.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_dynamic_pool.c
index 9b35980..19e0e9e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_dynamic_pool.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_dynamic_pool.c
@@ -149,8 +149,8 @@ static int hmm_dynamic_pool_init(void **pool, unsigned int pool_size)
 	if (pool_size == 0)
 		return 0;
 
-	dypool_info = atomisp_kernel_malloc(
-					sizeof(struct hmm_dynamic_pool_info));
+	dypool_info = kmalloc(sizeof(struct hmm_dynamic_pool_info),
+		GFP_KERNEL);
 	if (unlikely(!dypool_info)) {
 		dev_err(atomisp_dev, "out of memory for repool_info.\n");
 		return -ENOMEM;
@@ -160,7 +160,7 @@ static int hmm_dynamic_pool_init(void **pool, unsigned int pool_size)
 						sizeof(struct hmm_page), 0,
 						SLAB_HWCACHE_ALIGN, NULL);
 	if (!dypool_info->pgptr_cache) {
-		atomisp_kernel_free(dypool_info);
+		kfree(dypool_info);
 		return -ENOMEM;
 	}
 
@@ -217,7 +217,7 @@ static void hmm_dynamic_pool_exit(void **pool)
 
 	kmem_cache_destroy(dypool_info->pgptr_cache);
 
-	atomisp_kernel_free(dypool_info);
+	kfree(dypool_info);
 
 	*pool = NULL;
 }
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_reserved_pool.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_reserved_pool.c
index b51b619..bf65868 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_reserved_pool.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_reserved_pool.c
@@ -90,18 +90,18 @@ static int hmm_reserved_pool_setup(struct hmm_reserved_pool_info **repool_info,
 {
 	struct hmm_reserved_pool_info *pool_info;
 
-	pool_info = atomisp_kernel_malloc(
-					sizeof(struct hmm_reserved_pool_info));
+	pool_info = kmalloc(sizeof(struct hmm_reserved_pool_info),
+				GFP_KERNEL);
 	if (unlikely(!pool_info)) {
 		dev_err(atomisp_dev, "out of memory for repool_info.\n");
 		return -ENOMEM;
 	}
 
-	pool_info->pages = atomisp_kernel_malloc(
-					sizeof(struct page *) * pool_size);
+	pool_info->pages = kmalloc(sizeof(struct page *) * pool_size,
+			GFP_KERNEL);
 	if (unlikely(!pool_info->pages)) {
 		dev_err(atomisp_dev, "out of memory for repool_info->pages.\n");
-		atomisp_kernel_free(pool_info);
+		kfree(pool_info);
 		return -ENOMEM;
 	}
 
@@ -234,8 +234,8 @@ static void hmm_reserved_pool_exit(void **pool)
 			__free_pages(repool_info->pages[i], 0);
 	}
 
-	atomisp_kernel_free(repool_info->pages);
-	atomisp_kernel_free(repool_info);
+	kfree(repool_info->pages);
+	kfree(repool_info);
 
 	*pool = NULL;
 }

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

* [PATCH 07/14] atomisp: unwrap the _ex malloc/free functions
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (4 preceding siblings ...)
  2017-04-12 18:21 ` [PATCH 06/14] atomisp: remove most of the uses of atomisp_kernel_malloc Alan Cox
@ 2017-04-12 18:21 ` Alan Cox
  2017-04-12 18:21 ` [PATCH 08/14] atomisp: remove indirection from sh_css_malloc Alan Cox
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:21 UTC (permalink / raw)
  To: greg, linux-media

We are not using these for debugging or debug logging so remove the defines,
trim and rename the functions.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |   15 +++------------
 .../atomisp/pci/atomisp2/css2400/sh_css_internal.h |   17 ++++-------------
 2 files changed, 7 insertions(+), 25 deletions(-)

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 7e337e0..aa19419 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -2015,34 +2015,25 @@ ia_css_enable_isys_event_queue(bool enable)
 	return IA_CSS_SUCCESS;
 }
 
-void *
-sh_css_malloc_ex(size_t size, const char *caller_func, int caller_line)
+void *sh_css_malloc(size_t size)
 {
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "sh_css_malloc() enter: size=%d\n",size);
-	(void)caller_func;
-	(void)caller_line;
 	if (size > 0 && my_css.malloc)
 		return my_css.malloc(size, false);
 	return NULL;
 }
 
-void *
-sh_css_calloc_ex(size_t N, size_t size, const char *caller_func, int caller_line)
+void *sh_css_calloc(size_t N, size_t size)
 {
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "sh_css_calloc() enter: N=%d, size=%d\n",N,size);
-	(void)caller_func;
-	(void)caller_line;
 	if (size > 0 && my_css.malloc)
 		return my_css.malloc(N*size, true);		
 	return NULL;
 }
 
-void
-sh_css_free_ex(void *ptr, const char *caller_func, int caller_line)
+void sh_css_free(void *ptr)
 {
 	IA_CSS_ENTER_PRIVATE("ptr = %p", ptr);
-	(void)caller_func;
-	(void)caller_line;
 	if (ptr && my_css.free)
 		my_css.free(ptr);
 	IA_CSS_LEAVE_PRIVATE("void");
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 a108923..e2b6f06 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
@@ -1002,23 +1002,14 @@ sh_css_params_init(void);
 void
 sh_css_params_uninit(void);
 
-#define sh_css_malloc(size) sh_css_malloc_ex(size, __func__, __LINE__)
-#define sh_css_calloc(N, size) sh_css_calloc_ex(N, size, __func__, __LINE__)
-#define sh_css_free(ptr) sh_css_free_ex(ptr, __func__, __LINE__)
+void *sh_css_malloc(size_t size);
 
+void *sh_css_calloc(size_t N, size_t size);
 
-void *
-sh_css_malloc_ex(size_t size, const char *caller_func, int caller_line);
-
-void *
-sh_css_calloc_ex(size_t N, size_t size, const char *caller_func, int caller_lin);
-
-void
-sh_css_free_ex(void *ptr, const char *caller_func, int caller_line);
+void sh_css_free(void *ptr);
 
 /* For Acceleration API: Flush FW (shared buffer pointer) arguments */
-void
-sh_css_flush(struct ia_css_acc_fw *fw);
+void sh_css_flush(struct ia_css_acc_fw *fw);
 
 
 void

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

* [PATCH 08/14] atomisp: remove indirection from sh_css_malloc
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (5 preceding siblings ...)
  2017-04-12 18:21 ` [PATCH 07/14] atomisp: unwrap the _ex malloc/free functions Alan Cox
@ 2017-04-12 18:21 ` Alan Cox
  2017-04-12 18:21 ` [PATCH 09/14] atomisp: remove sh_css_malloc indirections where we can Alan Cox
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:21 UTC (permalink / raw)
  To: greg, linux-media

We have one hard coded set of behaviour so unpick the indirection and function
pointers. This isn't the whole story. A lot of the callers are known sizes and
use cases so we can switch them directly to kmalloc later on.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../atomisp/pci/atomisp2/atomisp_compat_css20.c    |    3 -
 .../atomisp/pci/atomisp2/css2400/ia_css_env.h      |   19 -------
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |   52 +++++++++-----------
 3 files changed, 25 insertions(+), 49 deletions(-)

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 6586842..b830b24 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
@@ -923,9 +923,6 @@ int atomisp_css_load_firmware(struct atomisp_device *isp)
 	isp->css_env.isp_css_fw.data = (void *)isp->firmware->data;
 	isp->css_env.isp_css_fw.bytes = isp->firmware->size;
 
-	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.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/ia_css_env.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_env.h
index 4d54aea..1ae9daf 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
@@ -39,25 +39,8 @@ enum ia_css_mem_attr {
  *  This is never expected to allocate more than one page of memory (4K bytes).
  */
 struct ia_css_cpu_mem_env {
-	void * (*alloc)(size_t bytes, bool zero_mem);
-	/**< Allocation function with boolean argument to indicate whether
-	     the allocated memory should be zeroed out or not, true (or 1)
-	     meaning the memory given to CSS must be zeroed */
-	void (*free)(void *ptr);
-	/**< Corresponding free function. The function must also accept
-	     a NULL argument, similar to C89 free(). */
 	void (*flush)(struct ia_css_acc_fw *fw);
 	/**< Flush function to flush the cache for given accelerator. */
-#ifdef ISP2401
-
-	#if !defined(__SVOS__)
-	/* a set of matching functions with additional debug params */
-	void * (*alloc_ex)(size_t bytes, bool zero_mem, const char *caller_func, int caller_line);
-	/**< same as alloc above, only with additional debug parameters */
-	void (*free_ex)(void *ptr, const char *caller_func, int caller_line);
-	/**< same as free above, only with additional debug parameters */
-	#endif
-#endif
 };
 
 /** Environment with function pointers to access the CSS hardware. This includes
@@ -103,7 +86,7 @@ struct ia_css_print_env {
  *  Windows and several simulation environments.
  */
 struct ia_css_env {
-	struct ia_css_cpu_mem_env   cpu_mem_env;   /**< local malloc and free. */
+	struct ia_css_cpu_mem_env   cpu_mem_env;   /**< local flush. */
 	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/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index aa19419..30f7196 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -13,6 +13,10 @@
  */
 
 /*! \file */
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+
 #include "ia_css.h"
 #include "sh_css_hrt.h"		/* only for file 2 MIPI */
 #include "ia_css_buffer.h"
@@ -1679,15 +1683,8 @@ ia_css_load_firmware(const struct ia_css_env *env,
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_load_firmware() enter\n");
 
 	/* make sure we initialize my_css */
-	if ((my_css.malloc != env->cpu_mem_env.alloc) ||
-		(my_css.free != env->cpu_mem_env.free) ||
-		(my_css.flush != env->cpu_mem_env.flush)
-		)
-	{
+	if (my_css.flush != env->cpu_mem_env.flush) {
 		ia_css_reset_defaults(&my_css);
-
-		my_css.malloc = env->cpu_mem_env.alloc;
-		my_css.free = env->cpu_mem_env.free;
 		my_css.flush = env->cpu_mem_env.flush;
 	}
 
@@ -1715,8 +1712,6 @@ ia_css_init(const struct ia_css_env *env,
 	ia_css_blctrl_cfg blctrl_cfg;
 #endif
 
-	void *(*malloc_func)(size_t size, bool zero_mem);
-	void (*free_func)(void *ptr);
 	void (*flush_func)(struct ia_css_acc_fw *fw);
 	hrt_data select, enable;
 
@@ -1765,8 +1760,6 @@ ia_css_init(const struct ia_css_env *env,
 
 	IA_CSS_ENTER("void");
 
-	malloc_func    = env->cpu_mem_env.alloc;
-	free_func      = env->cpu_mem_env.free;
 	flush_func     = env->cpu_mem_env.flush;
 
 	pipe_global_init();
@@ -1786,16 +1779,9 @@ ia_css_init(const struct ia_css_env *env,
 	ia_css_save_mmu_base_addr(mmu_l1_base);
 #endif
 
-	if (malloc_func == NULL || free_func == NULL) {
-		IA_CSS_LEAVE_ERR(IA_CSS_ERR_INVALID_ARGUMENTS);
-		return IA_CSS_ERR_INVALID_ARGUMENTS;
-	}
-
 	ia_css_reset_defaults(&my_css);
 
 	my_css_save.driver_env = *env;
-	my_css.malloc    = malloc_func;
-	my_css.free      = free_func;
 	my_css.flush     = flush_func;
 
 	err = ia_css_rmgr_init();
@@ -2018,25 +2004,35 @@ ia_css_enable_isys_event_queue(bool enable)
 void *sh_css_malloc(size_t size)
 {
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "sh_css_malloc() enter: size=%d\n",size);
-	if (size > 0 && my_css.malloc)
-		return my_css.malloc(size, false);
-	return NULL;
+	/* FIXME: This first test can probably go away */
+	if (size == 0)
+		return NULL;
+	if (size > PAGE_SIZE)
+		return vmalloc(size);
+	return kmalloc(size, GFP_KERNEL);
 }
 
 void *sh_css_calloc(size_t N, size_t size)
 {
+	void *p;
+
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "sh_css_calloc() enter: N=%d, size=%d\n",N,size);
-	if (size > 0 && my_css.malloc)
-		return my_css.malloc(N*size, true);		
+
+	/* FIXME: this test can probably go away */
+	if (size > 0) {
+		p = sh_css_malloc(N*size);
+		if (p)
+			memset(p, 0, size);
+	}
 	return NULL;
 }
 
 void sh_css_free(void *ptr)
 {
-	IA_CSS_ENTER_PRIVATE("ptr = %p", ptr);
-	if (ptr && my_css.free)
-		my_css.free(ptr);
-	IA_CSS_LEAVE_PRIVATE("void");
+	if (is_vmalloc_addr(ptr))
+		vfree(ptr);
+	else
+		kfree(ptr);
 }
 
 /* For Acceleration API: Flush FW (shared buffer pointer) arguments */

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

* [PATCH 09/14] atomisp: remove sh_css_malloc indirections where we can
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (6 preceding siblings ...)
  2017-04-12 18:21 ` [PATCH 08/14] atomisp: remove indirection from sh_css_malloc Alan Cox
@ 2017-04-12 18:21 ` Alan Cox
  2017-04-12 18:21 ` [PATCH 10/14] atomisp: remove contiguous handling Alan Cox
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:21 UTC (permalink / raw)
  To: greg, linux-media

Where we know the buffer size is reasonably constrained we can just use kmalloc,
and where it will be large vmalloc. This still leaves a pile in the middle.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../media/atomisp/pci/atomisp2/css2400/sh_css.c    |   92 ++++++++++----------
 .../atomisp/pci/atomisp2/css2400/sh_css_firmware.c |   29 +++---
 .../pci/atomisp2/css2400/sh_css_host_data.c        |    8 +-
 .../pci/atomisp2/css2400/sh_css_param_shading.c    |    8 +-
 4 files changed, 72 insertions(+), 65 deletions(-)

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 30f7196..2359449 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -2492,19 +2492,19 @@ create_pipe(enum ia_css_pipe_mode mode,
 		return IA_CSS_ERR_INVALID_ARGUMENTS;
 	}
 
-	me = sh_css_malloc(sizeof(*me));
+	me = kmalloc(sizeof(*me), GFP_KERNEL);
 	if (!me)
 		return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 
 	err = init_pipe_defaults(mode, me, copy_pipe);
 	if (err != IA_CSS_SUCCESS) {
-		sh_css_free(me);
+		kfree(me);
 		return err;
 	}
 
 	err = pipe_generate_pipe_num(me, &(me->pipe_num));
 	if (err != IA_CSS_SUCCESS) {
-		sh_css_free(me);
+		kfree(me);
 		return err;
 	}
 
@@ -2631,7 +2631,7 @@ ia_css_pipe_destroy(struct ia_css_pipe *pipe)
 	if (pipe->config.acc_extension) {
 		ia_css_pipe_unload_extension(pipe, pipe->config.acc_extension);
 	}
-	sh_css_free(pipe);
+	kfree(pipe);
 	IA_CSS_LEAVE("err = %d", err);
 	return err;
 }
@@ -5764,14 +5764,14 @@ static enum ia_css_err load_video_binaries(struct ia_css_pipe *pipe)
 		if (err != IA_CSS_SUCCESS)
 			return err;
 		mycs->num_yuv_scaler = cas_scaler_descr.num_stage;
-		mycs->yuv_scaler_binary = sh_css_calloc(cas_scaler_descr.num_stage,
-			sizeof(struct ia_css_binary));
+		mycs->yuv_scaler_binary = kzalloc(cas_scaler_descr.num_stage *
+			sizeof(struct ia_css_binary), GFP_KERNEL);
 		if (mycs->yuv_scaler_binary == NULL) {
 			err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 			return err;
 		}
-		mycs->is_output_stage = sh_css_calloc(cas_scaler_descr.num_stage,
-			sizeof(bool));
+		mycs->is_output_stage = kzalloc(cas_scaler_descr.num_stage
+					* sizeof(bool), GFP_KERNEL);
 		if (mycs->is_output_stage == NULL) {
 			err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 			return err;
@@ -5787,7 +5787,7 @@ static enum ia_css_err load_video_binaries(struct ia_css_pipe *pipe)
 			err = ia_css_binary_find(&yuv_scaler_descr,
 						&mycs->yuv_scaler_binary[i]);
 			if (err != IA_CSS_SUCCESS) {
-				sh_css_free(mycs->is_output_stage);
+				kfree(mycs->is_output_stage);
 				mycs->is_output_stage = NULL;
 				return err;
 			}
@@ -6008,9 +6008,9 @@ unload_video_binaries(struct ia_css_pipe *pipe)
 	for (i = 0; i < pipe->pipe_settings.video.num_yuv_scaler; i++)
 		ia_css_binary_unload(&pipe->pipe_settings.video.yuv_scaler_binary[i]);
 
-	sh_css_free(pipe->pipe_settings.video.is_output_stage);
+	kfree(pipe->pipe_settings.video.is_output_stage);
 	pipe->pipe_settings.video.is_output_stage = NULL;
-	sh_css_free(pipe->pipe_settings.video.yuv_scaler_binary);
+	kfree(pipe->pipe_settings.video.yuv_scaler_binary);
 	pipe->pipe_settings.video.yuv_scaler_binary = NULL;
 
 	IA_CSS_LEAVE_ERR_PRIVATE(IA_CSS_SUCCESS);
@@ -6418,15 +6418,15 @@ static enum ia_css_err load_primary_binaries(
 			return err;
 		}
 		mycs->num_yuv_scaler = cas_scaler_descr.num_stage;
-		mycs->yuv_scaler_binary = sh_css_calloc(cas_scaler_descr.num_stage,
-			sizeof(struct ia_css_binary));
+		mycs->yuv_scaler_binary = kzalloc(cas_scaler_descr.num_stage *
+			sizeof(struct ia_css_binary), GFP_KERNEL);
 		if (mycs->yuv_scaler_binary == NULL) {
 			err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 			IA_CSS_LEAVE_ERR_PRIVATE(err);
 			return err;
 		}
-		mycs->is_output_stage = sh_css_calloc(cas_scaler_descr.num_stage,
-			sizeof(bool));
+		mycs->is_output_stage = kzalloc(cas_scaler_descr.num_stage *
+			sizeof(bool), GFP_KERNEL);
 		if (mycs->is_output_stage == NULL) {
 			err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 			IA_CSS_LEAVE_ERR_PRIVATE(err);
@@ -7068,9 +7068,9 @@ unload_capture_binaries(struct ia_css_pipe *pipe)
 	for (i = 0; i < pipe->pipe_settings.capture.num_yuv_scaler; i++)
 		ia_css_binary_unload(&pipe->pipe_settings.capture.yuv_scaler_binary[i]);
 
-	sh_css_free(pipe->pipe_settings.capture.is_output_stage);
+	kfree(pipe->pipe_settings.capture.is_output_stage);
 	pipe->pipe_settings.capture.is_output_stage = NULL;
-	sh_css_free(pipe->pipe_settings.capture.yuv_scaler_binary);
+	kfree(pipe->pipe_settings.capture.yuv_scaler_binary);
 	pipe->pipe_settings.capture.yuv_scaler_binary = NULL;
 
 	IA_CSS_LEAVE_ERR_PRIVATE(IA_CSS_SUCCESS);
@@ -7159,27 +7159,27 @@ static enum ia_css_err ia_css_pipe_create_cas_scaler_desc_single_output(
 		i *= max_scale_factor_per_stage;
 	}
 
-	descr->in_info = sh_css_malloc(descr->num_stage * sizeof(struct ia_css_frame_info));
+	descr->in_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info), GFP_KERNEL);
 	if (descr->in_info == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
 	}
-	descr->internal_out_info = sh_css_malloc(descr->num_stage * sizeof(struct ia_css_frame_info));
+	descr->internal_out_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info), GFP_KERNEL);
 	if (descr->internal_out_info == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
 	}
-	descr->out_info = sh_css_malloc(descr->num_stage * sizeof(struct ia_css_frame_info));
+	descr->out_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info), GFP_KERNEL);
 	if (descr->out_info == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
 	}
-	descr->vf_info = sh_css_malloc(descr->num_stage * sizeof(struct ia_css_frame_info));
+	descr->vf_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info), GFP_KERNEL);
 	if (descr->vf_info == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
 	}
-	descr->is_output_stage = sh_css_malloc(descr->num_stage * sizeof(bool));
+	descr->is_output_stage = kmalloc(descr->num_stage * sizeof(bool), GFP_KERNEL);
 	if (descr->is_output_stage == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
@@ -7237,6 +7237,7 @@ static enum ia_css_err ia_css_pipe_create_cas_scaler_desc_single_output(
 	return err;
 }
 
+/* FIXME: merge most of this and single output version */
 static enum ia_css_err ia_css_pipe_create_cas_scaler_desc(struct ia_css_pipe *pipe,
 	struct ia_css_cas_binary_descr *descr)
 {
@@ -7294,27 +7295,27 @@ static enum ia_css_err ia_css_pipe_create_cas_scaler_desc(struct ia_css_pipe *pi
 
 	descr->num_stage = num_stages;
 
-	descr->in_info = sh_css_malloc(descr->num_stage * sizeof(struct ia_css_frame_info));
+	descr->in_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info), GFP_KERNEL);
 	if (descr->in_info == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
 	}
-	descr->internal_out_info = sh_css_malloc(descr->num_stage * sizeof(struct ia_css_frame_info));
+	descr->internal_out_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info), GFP_KERNEL);
 	if (descr->internal_out_info == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
 	}
-	descr->out_info = sh_css_malloc(descr->num_stage * sizeof(struct ia_css_frame_info));
+	descr->out_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info), GFP_KERNEL);
 	if (descr->out_info == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
 	}
-	descr->vf_info = sh_css_malloc(descr->num_stage * sizeof(struct ia_css_frame_info));
+	descr->vf_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info), GFP_KERNEL);
 	if (descr->vf_info == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
 	}
-	descr->is_output_stage = sh_css_malloc(descr->num_stage * sizeof(bool));
+	descr->is_output_stage = kmalloc(descr->num_stage * sizeof(bool), GFP_KERNEL);
 	if (descr->is_output_stage == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
@@ -7388,15 +7389,15 @@ static enum ia_css_err ia_css_pipe_create_cas_scaler_desc(struct ia_css_pipe *pi
 static void ia_css_pipe_destroy_cas_scaler_desc(struct ia_css_cas_binary_descr *descr)
 {
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_pipe_destroy_cas_scaler_desc() enter:\n");
-	sh_css_free(descr->in_info);
+	kfree(descr->in_info);
 	descr->in_info = NULL;
-	sh_css_free(descr->internal_out_info);
+	kfree(descr->internal_out_info);
 	descr->internal_out_info = NULL;
-	sh_css_free(descr->out_info);
+	kfree(descr->out_info);
 	descr->out_info = NULL;
-	sh_css_free(descr->vf_info);
+	kfree(descr->vf_info);
 	descr->vf_info = NULL;
-	sh_css_free(descr->is_output_stage);
+	kfree(descr->is_output_stage);
 	descr->is_output_stage = NULL;
 	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_pipe_destroy_cas_scaler_desc() leave\n");
 }
@@ -7451,14 +7452,14 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe)
 			goto ERR;
 		mycs->num_output = cas_scaler_descr.num_output_stage;
 		mycs->num_yuv_scaler = cas_scaler_descr.num_stage;
-		mycs->yuv_scaler_binary = sh_css_calloc(cas_scaler_descr.num_stage,
-			sizeof(struct ia_css_binary));
+		mycs->yuv_scaler_binary = kzalloc(cas_scaler_descr.num_stage *
+			sizeof(struct ia_css_binary), GFP_KERNEL);
 		if (mycs->yuv_scaler_binary == NULL) {
 			err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 			goto ERR;
 		}
-		mycs->is_output_stage = sh_css_calloc(cas_scaler_descr.num_stage,
-			sizeof(bool));
+		mycs->is_output_stage = kzalloc(cas_scaler_descr.num_stage *
+			sizeof(bool), GFP_KERNEL);
 		if (mycs->is_output_stage == NULL) {
 			err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 			goto ERR;
@@ -7558,7 +7559,8 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe)
 		}
 		mycs->num_vf_pp = 1;
 	}
-	mycs->vf_pp_binary = sh_css_calloc(mycs->num_vf_pp, sizeof(struct ia_css_binary));
+	mycs->vf_pp_binary = kzalloc(mycs->num_vf_pp * sizeof(struct ia_css_binary),
+						GFP_KERNEL);
 	if (mycs->vf_pp_binary == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		goto ERR;
@@ -7607,11 +7609,11 @@ unload_yuvpp_binaries(struct ia_css_pipe *pipe)
 	for (i = 0; i < pipe->pipe_settings.yuvpp.num_vf_pp; i++) {
 		ia_css_binary_unload(&pipe->pipe_settings.yuvpp.vf_pp_binary[i]);
 	}
-	sh_css_free(pipe->pipe_settings.yuvpp.is_output_stage);
+	kfree(pipe->pipe_settings.yuvpp.is_output_stage);
 	pipe->pipe_settings.yuvpp.is_output_stage = NULL;
-	sh_css_free(pipe->pipe_settings.yuvpp.yuv_scaler_binary);
+	kfree(pipe->pipe_settings.yuvpp.yuv_scaler_binary);
 	pipe->pipe_settings.yuvpp.yuv_scaler_binary = NULL;
-	sh_css_free(pipe->pipe_settings.yuvpp.vf_pp_binary);
+	kfree(pipe->pipe_settings.yuvpp.vf_pp_binary);
 	pipe->pipe_settings.yuvpp.vf_pp_binary = NULL;
 
 	IA_CSS_LEAVE_ERR_PRIVATE(IA_CSS_SUCCESS);
@@ -9625,7 +9627,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
 	}
 
 	/* allocate the stream instance */
-	curr_stream = sh_css_malloc(sizeof(struct ia_css_stream));
+	curr_stream = kmalloc(sizeof(struct ia_css_stream), GFP_KERNEL);
 	if (curr_stream == NULL) {
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		IA_CSS_LEAVE_ERR(err);
@@ -9637,10 +9639,10 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
 
 	/* allocate pipes */
 	curr_stream->num_pipes = num_pipes;
-	curr_stream->pipes = sh_css_malloc(num_pipes * sizeof(struct ia_css_pipe *));
+	curr_stream->pipes = kzalloc(num_pipes * sizeof(struct ia_css_pipe *), GFP_KERNEL);
 	if (curr_stream->pipes == NULL) {
 		curr_stream->num_pipes = 0;
-		sh_css_free(curr_stream);
+		kfree(curr_stream);
 		curr_stream = NULL;
 		err = IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 		IA_CSS_LEAVE_ERR(err);
@@ -10103,7 +10105,7 @@ ia_css_stream_destroy(struct ia_css_stream *stream)
 		}
 	}
 	/* free associated memory of stream struct */
-	sh_css_free(stream->pipes);
+	kfree(stream->pipes);
 	stream->pipes = NULL;
 	stream->num_pipes = 0;
 #ifndef ISP2401
@@ -10121,7 +10123,7 @@ ia_css_stream_destroy(struct ia_css_stream *stream)
 
 	err1 = (err != IA_CSS_SUCCESS) ? err : err2;
 #endif
-	sh_css_free(stream);
+	kfree(stream);
 #ifndef ISP2401
 	IA_CSS_LEAVE_ERR(err);
 #else
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
index 95f72e5..34cc56f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
@@ -12,6 +12,9 @@
  * more details.
  */
 
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+
 #include <math_support.h>
 #include "platform_support.h"
 #include "sh_css_firmware.h"
@@ -93,9 +96,9 @@ setup_binary(struct ia_css_fw_info *fw, const char *fw_data, struct ia_css_fw_in
 	*sh_css_fw = *fw;
 
 #if defined(HRT_UNSCHED)
-	sh_css_fw->blob.code = sh_css_malloc(1);
+	sh_css_fw->blob.code = vmalloc(1);
 #else
-	sh_css_fw->blob.code = sh_css_malloc(fw->blob.size);
+	sh_css_fw->blob.code = vmalloc(fw->blob.size);
 #endif
 
 	if (sh_css_fw->blob.code == NULL)
@@ -143,11 +146,11 @@ sh_css_load_blob_info(const char *fw, const struct ia_css_fw_info *bi, struct ia
 		char *namebuffer;
 		int namelength = (int)strlen(name);
 
-		namebuffer = (char *) sh_css_malloc(namelength+1);
+		namebuffer = (char *) kmalloc(namelength + 1, GFP_KERNEL);
 		if (namebuffer == NULL)
 			return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 
-		memcpy(namebuffer, name, namelength+1);
+		memcpy(namebuffer, name, namelength + 1);
 
 		bd->name = fw_minibuffer[index].name = namebuffer;
 	} else {
@@ -159,7 +162,8 @@ sh_css_load_blob_info(const char *fw, const struct ia_css_fw_info *bi, struct ia
 		size_t configstruct_size = sizeof(struct ia_css_config_memory_offsets);
 		size_t statestruct_size = sizeof(struct ia_css_state_memory_offsets);
 
-		char *parambuf = (char *) sh_css_malloc(paramstruct_size + configstruct_size + statestruct_size);
+		char *parambuf = (char *)kmalloc(paramstruct_size + configstruct_size + statestruct_size,
+							GFP_KERNEL);
 		if (parambuf == NULL)
 			return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 
@@ -239,19 +243,18 @@ sh_css_load_firmware(const char *fw_data,
 	sh_css_num_binaries = file_header->binary_nr;
 	/* Only allocate memory for ISP blob info */
 	if (sh_css_num_binaries > (NUM_OF_SPS + NUM_OF_BLS)) {
-		sh_css_blob_info = sh_css_malloc(
+		sh_css_blob_info = kmalloc(
 					(sh_css_num_binaries - (NUM_OF_SPS + NUM_OF_BLS)) *
-					sizeof(*sh_css_blob_info));
+					sizeof(*sh_css_blob_info), GFP_KERNEL);
 		if (sh_css_blob_info == NULL)
 			return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 	} else {
 		sh_css_blob_info = NULL;
 	}
 
-	fw_minibuffer = sh_css_malloc(sh_css_num_binaries * sizeof(struct fw_param));
+	fw_minibuffer = kzalloc(sh_css_num_binaries * sizeof(struct fw_param), GFP_KERNEL);
 	if (fw_minibuffer == NULL)
 		return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
-	memset(fw_minibuffer, 0, sh_css_num_binaries * sizeof(struct fw_param));
 
 	for (i = 0; i < sh_css_num_binaries; i++) {
 		struct ia_css_fw_info *bi = &binaries[i];
@@ -309,17 +312,17 @@ void sh_css_unload_firmware(void)
 		unsigned int i = 0;
 		for (i = 0; i < sh_css_num_binaries; i++) {
 			if (fw_minibuffer[i].name)
-				sh_css_free((void *)fw_minibuffer[i].name);
+				kfree((void *)fw_minibuffer[i].name);
 			if (fw_minibuffer[i].buffer)
-				sh_css_free((void *)fw_minibuffer[i].buffer);
+				vfree((void *)fw_minibuffer[i].buffer);
 		}
-		sh_css_free(fw_minibuffer);
+		kfree(fw_minibuffer);
 		fw_minibuffer = NULL;
 	}
 
 	memset(&sh_css_sp_fw, 0, sizeof(sh_css_sp_fw));
 	if (sh_css_blob_info) {
-		sh_css_free(sh_css_blob_info);
+		kfree(sh_css_blob_info);
 		sh_css_blob_info = NULL;
 	}
 	sh_css_num_binaries = 0;
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_host_data.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_host_data.c
index 1919497..348183a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_host_data.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_host_data.c
@@ -12,7 +12,7 @@
  * more details.
  */
 
-#include <stddef.h>
+#include <linux/slab.h>
 #include <ia_css_host_data.h>
 #include <sh_css_internal.h>
 
@@ -20,13 +20,13 @@ struct ia_css_host_data *ia_css_host_data_allocate(size_t size)
 {
 	struct ia_css_host_data *me;
 
-	me =  sh_css_malloc(sizeof(struct ia_css_host_data));
+	me =  kmalloc(sizeof(struct ia_css_host_data), GFP_KERNEL);
 	if (!me)
 		return NULL;
 	me->size = (uint32_t)size;
 	me->address = sh_css_malloc(size);
 	if (!me->address) {
-		sh_css_free(me);
+		kfree(me);
 		return NULL;
 	}
 	return me;
@@ -37,6 +37,6 @@ void ia_css_host_data_free(struct ia_css_host_data *me)
 	if (me) {
 		sh_css_free(me->address);
 		me->address = NULL;
-		sh_css_free(me);
+		kfree(me);
 	}
 }
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_param_shading.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_param_shading.c
index 7c600fa..eaf60e7 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_param_shading.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_param_shading.c
@@ -12,6 +12,8 @@
  * more details.
  */
 
+#include <linux/slab.h>
+
 #include <math_support.h>
 #include "sh_css_param_shading.h"
 #include "ia_css_shading.h"
@@ -362,7 +364,7 @@ ia_css_shading_table_alloc(
 
 	IA_CSS_ENTER("");
 
-	me = sh_css_malloc(sizeof(*me));
+	me = kmalloc(sizeof(*me), GFP_KERNEL);
 	if (me == NULL) {
 		IA_CSS_ERROR("out of memory");
 		return me;
@@ -382,7 +384,7 @@ ia_css_shading_table_alloc(
 				sh_css_free(me->data[j]);
 				me->data[j] = NULL;
 			}
-			sh_css_free(me);
+			kfree(me);
 			return NULL;
 		}
 	}
@@ -410,7 +412,7 @@ ia_css_shading_table_free(struct ia_css_shading_table *table)
 			table->data[i] = NULL;
 		}
 	}
-	sh_css_free(table);
+	kfree(table);
 
 	IA_CSS_LEAVE("");
 }

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

* [PATCH 10/14] atomisp: remove contiguous handling
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (7 preceding siblings ...)
  2017-04-12 18:21 ` [PATCH 09/14] atomisp: remove sh_css_malloc indirections where we can Alan Cox
@ 2017-04-12 18:21 ` Alan Cox
  2017-04-12 18:22 ` [PATCH 11/14] atomisp: remove satm kernel Alan Cox
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:21 UTC (permalink / raw)
  To: greg, linux-media

The base hmm MMU code doesn't support contiguous allocations (they BUG), so
remove support from them from the higher levels of the heirarchy.

We still need to unwind all these layers but it turns out that some of the init
order stuff is rather sensitive and the simple cleanup breaks everything

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../pci/atomisp2/css2400/ia_css_memory_access.c    |   31 ++++++--------------
 .../atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.c |   11 -------
 .../atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.h |    3 --
 .../media/atomisp/pci/atomisp2/hrt/memory_access.c |   31 ++++----------------
 4 files changed, 15 insertions(+), 61 deletions(-)

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 8d559aa..1f6ae20 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
@@ -31,31 +31,18 @@ mmgr_malloc(const size_t size)
 hrt_vaddress mmgr_alloc_attr(const size_t size, const uint16_t attrs)
 {
 	uint16_t masked_attrs = attrs & MMGR_ATTRIBUTE_MASK;
+	WARN_ON(attrs & MMGR_ATTRIBUTE_CONTIGUOUS);
 
 	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);
-		}
+		if (masked_attrs & MMGR_ATTRIBUTE_CACHED)
+			return (ia_css_ptr) hrt_isp_css_mm_calloc_cached(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);
-		}
+		if (masked_attrs & MMGR_ATTRIBUTE_CACHED)
+			return (ia_css_ptr) hrt_isp_css_mm_alloc_cached(size);
+		else
+			return (ia_css_ptr) hrt_isp_css_mm_alloc(size);
 	}
 }
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.c b/drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.c
index 9f8267a..78b4709 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.c
@@ -180,14 +180,3 @@ phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr)
 	return hmm_virt_to_phys(virt_addr);
 }
 
-ia_css_ptr hrt_isp_css_mm_alloc_contiguous(size_t bytes)
-{
-	BUG_ON(false);
-	return 0;
-}
-ia_css_ptr hrt_isp_css_mm_calloc_contiguous(size_t bytes)
-{
-	BUG_ON(false);
-	return 0;
-}
-
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.h b/drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.h
index 41c6d14..4783206 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.h
@@ -81,8 +81,5 @@ int hrt_isp_css_mm_store_int(ia_css_ptr virt_addr, int data);
    the display driver on  the FPGA system */
 phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr);
 
-ia_css_ptr hrt_isp_css_mm_alloc_contiguous(size_t bytes);
-ia_css_ptr hrt_isp_css_mm_calloc_contiguous(size_t bytes);
-
 void hrt_isp_css_mm_clear(void);
 #endif /* _hive_isp_css_mm_hrt_h_ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hrt/memory_access.c b/drivers/staging/media/atomisp/pci/atomisp2/hrt/memory_access.c
index dcc4c91..7694ee4 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hrt/memory_access.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hrt/memory_access.c
@@ -60,42 +60,23 @@ ia_css_ptr mmgr_alloc_attr(const size_t	size, const uint16_t attribute)
 
 	assert(page_table_base_address != (sys_address)-1);
 	assert((attribute & MMGR_ATTRIBUTE_UNUSED) == 0);
+	WARN_ON(attribute & MMGR_ATTRIBUTE_CONTIGUOUS);
 
 	if (attribute & MMGR_ATTRIBUTE_CLEARED) {
 		if (attribute & MMGR_ATTRIBUTE_CACHED) {
-			if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
-				ptr = hrt_isp_css_mm_calloc_contiguous(
+			ptr = hrt_isp_css_mm_calloc_cached(
 						aligned_size + extra_space);
-			/* } */ else /* { */
-				ptr = hrt_isp_css_mm_calloc_cached(
-						aligned_size + extra_space);
-			/* } */
 		} else { /* !MMGR_ATTRIBUTE_CACHED */
-			if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
-				ptr = hrt_isp_css_mm_calloc_contiguous(
-						aligned_size + extra_space);
-			/* } */ else /* { */
-				ptr = hrt_isp_css_mm_calloc(
+			ptr = hrt_isp_css_mm_calloc(
 						aligned_size + extra_space);
-			/* } */
 		}
 	} else { /* MMGR_ATTRIBUTE_CLEARED */
 		if (attribute & MMGR_ATTRIBUTE_CACHED) {
-			if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
-				ptr = hrt_isp_css_mm_alloc_contiguous(
-						aligned_size + extra_space);
-			/* } */ else /* { */
-				ptr = hrt_isp_css_mm_alloc_cached(
+			ptr = hrt_isp_css_mm_alloc_cached(
 						aligned_size + extra_space);
-			/* } */
 		} else { /* !MMGR_ATTRIBUTE_CACHED */
-			if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
-				ptr = hrt_isp_css_mm_alloc_contiguous(
-						aligned_size + extra_space);
-			/* } */ else /* { */
-				ptr = hrt_isp_css_mm_alloc(
-						aligned_size + extra_space);
-			/* } */
+			ptr = hrt_isp_css_mm_alloc(
+					aligned_size + extra_space);
 		}
 	}
 	return ptr;

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

* [PATCH 11/14] atomisp: remove satm kernel
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (8 preceding siblings ...)
  2017-04-12 18:21 ` [PATCH 10/14] atomisp: remove contiguous handling Alan Cox
@ 2017-04-12 18:22 ` Alan Cox
  2017-04-12 18:22 ` [PATCH 12/14] atomisp: remove fixedbds kernel code Alan Cox
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:22 UTC (permalink / raw)
  To: greg, linux-media

This isn't used so it can go in the bitbucket.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../staging/media/atomisp/pci/atomisp2/Makefile    |    1 -
 .../css2400/isp/kernels/satm/ia_css_satm.host.c    |   27 ---------------
 .../css2400/isp/kernels/satm/ia_css_satm.host.h    |   29 -----------------
 .../css2400/isp/kernels/satm/ia_css_satm_param.h   |   30 -----------------
 .../css2400/isp/kernels/satm/ia_css_satm_types.h   |   35 --------------------
 5 files changed, 122 deletions(-)
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm.host.c
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm.host.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm_param.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm_types.h

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/Makefile b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
index ab10fc0..8780914 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/Makefile
+++ b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
@@ -80,7 +80,6 @@ atomisp-objs += \
 	css2400/isp/kernels/sdis/sdis_2/ia_css_sdis2.host.o \
 	css2400/isp/kernels/cnr/cnr_2/ia_css_cnr2.host.o \
 	css2400/isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.o \
-	css2400/isp/kernels/satm/ia_css_satm.host.o \
 	css2400/isp/kernels/xnr/xnr_1.0/ia_css_xnr.host.o \
 	css2400/isp/kernels/xnr/xnr_1.0/ia_css_xnr_table.host.o \
 	css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.o \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm.host.c
deleted file mode 100644
index d35194b..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm.host.c
+++ /dev/null
@@ -1,27 +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_satm.host.h"
-
-
-void
-ia_css_satm_init_config(
-	struct sh_css_isp_satm_params *to,
-	const struct ia_css_satm_config *from,
-	unsigned size)
-{
-	(void) size;
-
-	to->params.test_satm = from->params.test_satm;
-}
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm.host.h
deleted file mode 100644
index 807b716..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm.host.h
+++ /dev/null
@@ -1,29 +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_SATM_HOST_H
-#define __IA_CSS_SATM_HOST_H
-
-#include "ia_css_satm_param.h"
-#include "ia_css_satm_types.h"
-
-extern const struct ia_css_satm_config default_satm_config;
-
-void
-ia_css_satm_init_config(
-	struct sh_css_isp_satm_params *to,
-	const struct ia_css_satm_config *from,
-	unsigned size);
-
-#endif /* __IA_CSS_SATM_HOST_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm_param.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm_param.h
deleted file mode 100644
index 062f79aa4..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm_param.h
+++ /dev/null
@@ -1,30 +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_SATM_PARAMS_H
-#define __IA_CSS_SATM_PARAMS_H
-
-#include "type_support.h"
-
-/* SATM parameters on ISP. */
-struct sh_css_satm_params {
-	int32_t test_satm;
-};
-
-/* SATM ISP parameters */
-struct sh_css_isp_satm_params {
-	struct sh_css_satm_params params;
-};
-
-#endif /* __IA_CSS_SATM_PARAMS_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm_types.h
deleted file mode 100644
index 94f10e3..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/satm/ia_css_satm_types.h
+++ /dev/null
@@ -1,35 +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_SATM_TYPES_H
-#define __IA_CSS_SATM_TYPES_H
-
-/**
- * \brief SATM Parameters
- * \detail Currently SATM paramters are used only for testing purposes
- */
-struct ia_css_satm_params {
-	int test_satm; /**< Test parameter */
-};
-
-/**
- * \brief SATM public paramterers.
- * \details Struct with all paramters for SATM that can be seet from
- * the CSS API. Currenly, only test paramters are defined.
- */
-struct ia_css_satm_config {
-	struct ia_css_satm_params params; /**< SATM paramaters */
-};
-
-#endif /* __IA_CSS_SATM_TYPES_H */

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

* [PATCH 12/14] atomisp: remove fixedbds kernel code
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (9 preceding siblings ...)
  2017-04-12 18:22 ` [PATCH 11/14] atomisp: remove satm kernel Alan Cox
@ 2017-04-12 18:22 ` Alan Cox
  2017-04-13 11:53   ` kbuild test robot
  2017-04-12 18:22 ` [PATCH 13/14] atomisp: remove xnr3_0_5 and xnr3_0_11 Alan Cox
  2017-04-12 18:22 ` [PATCH 14/14] atomisp: remove UDS kernel code Alan Cox
  12 siblings, 1 reply; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:22 UTC (permalink / raw)
  To: greg, linux-media

This is a whole pile of code that wraps a single assignment. Remove it and
put the assignment in the caller. Once we have the kernels sorted we should
revisit these and remove all the pointless 1 item structs that go with it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../ia_css_isp_params.c                            |   11 +++--
 .../ia_css_isp_params.c                            |   11 +++--
 .../ia_css_isp_params.c                            |   11 +++--
 .../fixedbds/fixedbds_1.0/ia_css_fixedbds.host.c   |   47 --------------------
 .../fixedbds/fixedbds_1.0/ia_css_fixedbds.host.h   |   37 ----------------
 .../atomisp/pci/atomisp2/css2400/sh_css_params.c   |    2 -
 6 files changed, 19 insertions(+), 100 deletions(-)
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.c
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.h

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 3246d99..49a5cdf 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
@@ -28,7 +28,7 @@
 #include "isp/kernels/de/de_1.0/ia_css_de.host.h"
 #include "isp/kernels/de/de_2/ia_css_de2.host.h"
 #include "isp/kernels/dp/dp_1.0/ia_css_dp.host.h"
-#include "isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.h"
+#include "isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds_param.h"
 #include "isp/kernels/fpn/fpn_1.0/ia_css_fpn.host.h"
 #include "isp/kernels/gc/gc_1.0/ia_css_gc.host.h"
 #include "isp/kernels/gc/gc_2/ia_css_gc2.host.h"
@@ -924,12 +924,13 @@ ia_css_process_bds(
 		unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.bds.offset;
 
 		if (size) {
+			struct sh_css_isp_bds_params *p;
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_bds() enter:\n");
 
-			ia_css_bds_encode((struct sh_css_isp_bds_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset],
-					&params->bds_config,
-size);
+			p = (struct sh_css_isp_bds_params *)
+				&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset];
+			p->baf_strength = params->bds_config.strength;
+
 			params->isp_params_changed = true;
 			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = 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 4c79a31..41b8a5f 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
@@ -29,7 +29,7 @@
 #include "isp/kernels/de/de_1.0/ia_css_de.host.h"
 #include "isp/kernels/de/de_2/ia_css_de2.host.h"
 #include "isp/kernels/dp/dp_1.0/ia_css_dp.host.h"
-#include "isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.h"
+#include "isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds_param.h"
 #include "isp/kernels/fpn/fpn_1.0/ia_css_fpn.host.h"
 #include "isp/kernels/gc/gc_1.0/ia_css_gc.host.h"
 #include "isp/kernels/gc/gc_2/ia_css_gc2.host.h"
@@ -923,12 +923,13 @@ ia_css_process_bds(
 		unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.bds.offset;
 
 		if (size) {
+			struct sh_css_isp_bds_params *p;
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_bds() enter:\n");
 
-			ia_css_bds_encode((struct sh_css_isp_bds_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset],
-					&params->bds_config,
-size);
+			p = (struct sh_css_isp_bds_params *)
+				&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset];
+			p->baf_strength = params->bds_config.strength;
+
 			params->isp_params_changed = true;
 			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = 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 4c79a31..41b8a5f 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
@@ -29,7 +29,7 @@
 #include "isp/kernels/de/de_1.0/ia_css_de.host.h"
 #include "isp/kernels/de/de_2/ia_css_de2.host.h"
 #include "isp/kernels/dp/dp_1.0/ia_css_dp.host.h"
-#include "isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.h"
+#include "isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds_param.h"
 #include "isp/kernels/fpn/fpn_1.0/ia_css_fpn.host.h"
 #include "isp/kernels/gc/gc_1.0/ia_css_gc.host.h"
 #include "isp/kernels/gc/gc_2/ia_css_gc2.host.h"
@@ -923,12 +923,13 @@ ia_css_process_bds(
 		unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.bds.offset;
 
 		if (size) {
+			struct sh_css_isp_bds_params *p;
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_bds() enter:\n");
 
-			ia_css_bds_encode((struct sh_css_isp_bds_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset],
-					&params->bds_config,
-size);
+			p = (struct sh_css_isp_bds_params *)
+				&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset];
+			p->baf_strength = params->bds_config.strength;
+
 			params->isp_params_changed = true;
 			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = true;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.c
deleted file mode 100644
index 0ce5ace..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.c
+++ /dev/null
@@ -1,47 +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_types.h"
-#include "sh_css_defs.h"
-#include "ia_css_debug.h"
-
-#include "ia_css_fixedbds.host.h"
-
-void
-ia_css_bds_encode(
-	struct sh_css_isp_bds_params *to,
-	const struct ia_css_aa_config *from,
-	unsigned size)
-{
-	(void)size;
-	to->baf_strength = from->strength;
-}
-
-void
-ia_css_bds_dump(
-	const struct sh_css_isp_bds_params *bds,
-	unsigned level)
-{
-	(void)bds;
-	(void)level;
-}
-
-void
-ia_css_bds_debug_dtrace(
-	const struct ia_css_aa_config *config,
-	unsigned level)
-{
-  (void)config;
-  (void)level;
-}
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.h
deleted file mode 100644
index fdc27ca..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.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_FIXEDBDS_HOST_H
-#define __IA_CSS_FIXEDBDS_HOST_H
-
-#include "ia_css_binary.h"
-#include "ia_css_fixedbds_param.h"
-
-void
-ia_css_bds_encode(
-	struct sh_css_isp_bds_params *to,
-	const struct ia_css_aa_config *from,
-	unsigned size);
-
-void
-ia_css_bds_dump(
-	const struct sh_css_isp_bds_params *bds,
-	unsigned level);
-
-void
-ia_css_bds_debug_dtrace(
-	const struct ia_css_aa_config *config,
-	unsigned level);
-
-#endif /* __IA_CSS_FIXEDBDS_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 2807bb8..36d9177 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
@@ -75,7 +75,7 @@
 #include "ctc/ctc_1.0/ia_css_ctc.host.h"
 #include "ob/ob_1.0/ia_css_ob.host.h"
 #include "raw/raw_1.0/ia_css_raw.host.h"
-#include "fixedbds/fixedbds_1.0/ia_css_fixedbds.host.h"
+#include "fixedbds/fixedbds_1.0/ia_css_fixedbds_param.h"
 #include "s3a/s3a_1.0/ia_css_s3a.host.h"
 #include "sc/sc_1.0/ia_css_sc.host.h"
 #include "sdis/sdis_1.0/ia_css_sdis.host.h"

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

* [PATCH 13/14] atomisp: remove xnr3_0_5 and xnr3_0_11
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (10 preceding siblings ...)
  2017-04-12 18:22 ` [PATCH 12/14] atomisp: remove fixedbds kernel code Alan Cox
@ 2017-04-12 18:22 ` Alan Cox
  2017-04-12 18:22 ` [PATCH 14/14] atomisp: remove UDS kernel code Alan Cox
  12 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:22 UTC (permalink / raw)
  To: greg, linux-media

These are not used in the driver so can go away.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../staging/media/atomisp/pci/atomisp2/Makefile    |    4 -
 .../kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.c  |  155 --------------------
 .../kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.h  |   58 -------
 .../kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_param.h |   50 ------
 .../kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_types.h |   33 ----
 .../kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.c    |  154 --------------------
 .../kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.h    |   59 --------
 .../kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_param.h   |   50 ------
 .../kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_types.h   |   33 ----
 9 files changed, 596 deletions(-)
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.c
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_param.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_types.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.c
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_param.h
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_types.h

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/Makefile b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
index 8780914..f6d01c2 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/Makefile
+++ b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
@@ -82,9 +82,7 @@ atomisp-objs += \
 	css2400/isp/kernels/cnr/cnr_1.0/ia_css_cnr.host.o \
 	css2400/isp/kernels/xnr/xnr_1.0/ia_css_xnr.host.o \
 	css2400/isp/kernels/xnr/xnr_1.0/ia_css_xnr_table.host.o \
-	css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.o \
 	css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.o \
-	css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.o \
 	css2400/isp/kernels/de/de_1.0/ia_css_de.host.o \
 	css2400/isp/kernels/de/de_2/ia_css_de2.host.o \
 	css2400/isp/kernels/gc/gc_2/ia_css_gc2.host.o \
@@ -328,8 +326,6 @@ INCLUDES += \
 	-I$(atomisp)/css2400/isp/kernels/xnr/ \
 	-I$(atomisp)/css2400/isp/kernels/xnr/xnr_1.0/ \
 	-I$(atomisp)/css2400/isp/kernels/xnr/xnr_3.0/ \
-	-I$(atomisp)/css2400/isp/kernels/xnr/xnr3_0_11 \
-	-I$(atomisp)/css2400/isp/kernels/xnr/xnr3_0_5/ \
 	-I$(atomisp)/css2400/isp/kernels/ynr/ \
 	-I$(atomisp)/css2400/isp/kernels/ynr/ynr_1.0/ \
 	-I$(atomisp)/css2400/isp/kernels/ynr/ynr_2/ \
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.c
deleted file mode 100644
index 7e86bc8..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.c
+++ /dev/null
@@ -1,155 +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 "type_support.h"
-#include "math_support.h"
-#include "sh_css_defs.h"
-#include "assert_support.h"
-#include "ia_css_xnr3_0_11.host.h"
-
-/*
- * XNR 3.0.11 division look-up table
- */
-#define XNR3_0_11_LOOK_UP_TABLE_POINTS 16
-
-static const int16_t x[XNR3_0_11_LOOK_UP_TABLE_POINTS] = {
-512, 637, 782, 952, 1147, 1372, 1627, 1917, 2242,
-2597, 2992, 3427, 3907, 4432, 5007, 5632};
-
-static const int16_t a[XNR3_0_11_LOOK_UP_TABLE_POINTS] = {
--6587, -4309, -2886, -1970, -1362, -7710, -5508,
--4008, -2931, -2219, -1676, -1280, -999, -769, -616, 0};
-
-static const int16_t b[XNR3_0_11_LOOK_UP_TABLE_POINTS] = {
-4096, 3292, 2682, 2203, 1828, 1529, 1289, 1094,
-935, 808, 701, 612, 537, 473, 419, 372};
-
-static const int16_t c[XNR3_0_11_LOOK_UP_TABLE_POINTS] = {
-1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
-
-/*
- * Default kernel parameters (weights). In general, default is bypass mode or as close
- * to the ineffective values as possible. Due to the chroma down+upsampling,
- * perfect bypass mode is not possible for xnr3.
- */
-const struct ia_css_xnr3_0_11_config default_xnr3_0_11_config = {
-	7, 7, 7, 7, 7, 2 };
-
-
-/* (void) = ia_css_xnr3_0_11_vmem_encode(*to, *from)
- * -----------------------------------------------
- * VMEM Encode Function to translate UV parameters from userspace into ISP space
-*/
-void
-ia_css_xnr3_0_11_vmem_encode(
-	struct sh_css_isp_xnr3_0_11_vmem_params *to,
-	const struct ia_css_xnr3_0_11_config *from,
-	unsigned size)
-{
-	unsigned i, j, base;
-	const unsigned total_blocks = 4;
-	const unsigned shuffle_block = 16;
-
-	(void)from;
-	(void)size;
-
-	/* Init */
-	for (i = 0; i < ISP_VEC_NELEMS; i++) {
-		to->x[0][i] = 0;
-		to->a[0][i] = 0;
-		to->b[0][i] = 0;
-		to->c[0][i] = 0;
-	}
-
-
-	/* Constraints on "x":
-	 * - values should be greater or equal to 0.
-	 * - values should be ascending.
-	 */
-	assert(x[0] >= 0);
-
-	for (j = 1; j < XNR3_0_11_LOOK_UP_TABLE_POINTS; j++) {
-		assert(x[j] >= 0);
-		assert(x[j] > x[j-1]);
-
-	}
-
-
-	/* The implementation of the calulating 1/x is based on the availability
-	 * of the OP_vec_shuffle16 operation.
-	 * 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.
-	 */
-	/* TODO: guard this code with above assumptions */
-	for(i = 0; i < total_blocks; i++) {
-		base = shuffle_block * i;
-
-		for (j = 0; j < XNR3_0_11_LOOK_UP_TABLE_POINTS; j++) {
-			to->x[0][base + j] = x[j];
-			to->a[0][base + j] = a[j];
-			to->b[0][base + j] = b[j];
-			to->c[0][base + j] = c[j];
-		}
-	}
-
-}
-
-
-
-/* (void) = ia_css_xnr3_0_11_encode(*to, *from)
- * -----------------------------------------------
- * DMEM Encode Function to translate UV parameters from userspace into ISP space
- */
-void
-ia_css_xnr3_0_11_encode(
-	struct sh_css_isp_xnr3_0_11_params *to,
-	const struct ia_css_xnr3_0_11_config *from,
-	unsigned size)
-{
-	int kernel_size = XNR_FILTER_SIZE;
-	/* The adjust factor is the next power of 2
-	   w.r.t. the kernel size*/
-	int adjust_factor = ceil_pow2(kernel_size);
-
-	int32_t weight_y0 = from->weight_y0;
-	int32_t weight_y1 = from->weight_y1;
-	int32_t weight_u0 = from->weight_u0;
-	int32_t weight_u1 = from->weight_u1;
-	int32_t weight_v0 = from->weight_v0;
-	int32_t weight_v1 = from->weight_v1;
-
-	(void)size;
-
-	to->weight_y0 = weight_y0;
-	to->weight_u0 = weight_u0;
-	to->weight_v0 = weight_v0;
-	to->weight_ydiff = (weight_y1 - weight_y0) * adjust_factor / kernel_size;
-	to->weight_udiff = (weight_u1 - weight_u0) * adjust_factor / kernel_size;
-	to->weight_vdiff = (weight_v1 - weight_v0) * adjust_factor / kernel_size;
-}
-
-/* (void) = ia_css_xnr3_0_11_debug_dtrace(*config, level)
- * -----------------------------------------------
- * Dummy Function added as the tool expects it
- */
-void
-ia_css_xnr3_0_11_debug_dtrace(
-	const struct ia_css_xnr3_0_11_config *config,
-	unsigned level)
-{
-	(void)config;
-	(void)level;
-}
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.h
deleted file mode 100644
index 8e8b85f..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11.host.h
+++ /dev/null
@@ -1,58 +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_XNR3_0_11_HOST_H
-#define __IA_CSS_XNR3_0_11_HOST_H
-
-#include "ia_css_xnr3_0_11_param.h"
-#include "ia_css_xnr3_0_11_types.h"
-
-/*
- * Default kernel parameters (weights). In general, default is bypass mode or as close
- * to the ineffective values as possible. Due to the chroma down+upsampling,
- * perfect bypass mode is not possible for xnr3.
- */
-extern const struct ia_css_xnr3_0_11_config default_xnr3_0_11_config;
-
-
-/* (void) = ia_css_xnr3_0_11_vmem_encode(*to, *from)
- * -----------------------------------------------
- * VMEM Encode Function to translate UV parameters from userspace into ISP space
-*/
-void
-ia_css_xnr3_0_11_vmem_encode(
-	struct sh_css_isp_xnr3_0_11_vmem_params *to,
-	const struct ia_css_xnr3_0_11_config *from,
-	unsigned size);
-
-/* (void) = ia_css_xnr3_0_11_encode(*to, *from)
- * -----------------------------------------------
- * DMEM Encode Function to translate UV parameters from userspace into ISP space
- */
-void
-ia_css_xnr3_0_11_encode(
-	struct sh_css_isp_xnr3_0_11_params *to,
-	const struct ia_css_xnr3_0_11_config *from,
-	unsigned size);
-
-/* (void) = ia_css_xnr3_0_11_debug_dtrace(*config, level)
- * -----------------------------------------------
- * Dummy Function added as the tool expects it
- */
-void
-ia_css_xnr3_0_11_debug_dtrace(
-	const struct ia_css_xnr3_0_11_config *config,
-	unsigned level);
-
-#endif /* __IA_CSS_XNR3_0_11_HOST_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_param.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_param.h
deleted file mode 100644
index a28cfd4..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_param.h
+++ /dev/null
@@ -1,50 +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_XNR3_0_11_PARAM_H
-#define __IA_CSS_XNR3_0_11_PARAM_H
-
-#include "type_support.h"
-#include "vmem.h" /* needed for VMEM_ARRAY */
-
-/* XNR3.0.11 filter size */
-#define XNR_FILTER_SIZE             11
-
-/*
- * STRUCT sh_css_isp_xnr3_0_11_vmem_params
- * -----------------------------------------------
- * XNR3.0.11 ISP VMEM parameters
- */
-struct sh_css_isp_xnr3_0_11_vmem_params {
-	VMEM_ARRAY(x, ISP_VEC_NELEMS);
-	VMEM_ARRAY(a, ISP_VEC_NELEMS);
-	VMEM_ARRAY(b, ISP_VEC_NELEMS);
-	VMEM_ARRAY(c, ISP_VEC_NELEMS);
-};
-
- /*
- * STRUCT sh_css_isp_xnr3_0_11_params
- * -----------------------------------------------
- * XNR3.0.11 ISP parameters
- */
-struct sh_css_isp_xnr3_0_11_params {
-	int32_t weight_y0;
-	int32_t weight_u0;
-	int32_t weight_v0;
-	int32_t weight_ydiff;
-	int32_t weight_udiff;
-	int32_t weight_vdiff;
-};
-
-#endif  /*__IA_CSS_XNR3_0_11_PARAM_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_types.h
deleted file mode 100644
index b6bf449..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_11/ia_css_xnr3_0_11_types.h
+++ /dev/null
@@ -1,33 +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_XNR3_0_11_TYPES_H
-#define __IA_CSS_XNR3_0_11_TYPES_H
-
- /*
- * STRUCT ia_css_xnr3_0_11_config
- * -----------------------------------------------
- * Struct with all parameters for the XNR3.0.11 kernel that can be set
- * from the CSS API
- */
-struct ia_css_xnr3_0_11_config {
-	int32_t weight_y0;     /**< Weight for Y range similarity in dark area */
-	int32_t weight_y1;     /**< Weight for Y range similarity in bright area */
-	int32_t weight_u0;     /**< Weight for U range similarity in dark area */
-	int32_t weight_u1;     /**< Weight for U range similarity in bright area */
-	int32_t weight_v0;     /**< Weight for V range similarity in dark area */
-	int32_t weight_v1;     /**< Weight for V range similarity in bright area */
-};
-
-#endif /* __IA_CSS_XNR3_0_11_TYPES_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.c
deleted file mode 100644
index d29b314..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.c
+++ /dev/null
@@ -1,154 +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 "type_support.h"
-#include "math_support.h"
-#include "sh_css_defs.h"
-#include "assert_support.h"
-#include "ia_css_xnr3_0_5.host.h"
-
-/*
- * XNR 3.0.5 division look-up table
- */
-#define XNR3_0_5_LOOK_UP_TABLE_POINTS 16
-
-static const int16_t x[XNR3_0_5_LOOK_UP_TABLE_POINTS] = {
-1024, 1164, 1320, 1492, 1680, 1884, 2108, 2352,
-2616, 2900, 3208, 3540, 3896, 4276, 4684, 5120};
-
-static const int16_t a[XNR3_0_5_LOOK_UP_TABLE_POINTS] = {
--7213, -5580, -4371, -3421, -2722, -2159, -6950, -5585,
--4529, -3697, -3010, -2485, -2070, -1727, -1428, 0};
-
-static const int16_t b[XNR3_0_5_LOOK_UP_TABLE_POINTS] = {
-4096, 3603, 3178, 2811, 2497, 2226, 1990, 1783,
-1603, 1446, 1307, 1185, 1077, 981, 895, 819};
-
-static const int16_t c[XNR3_0_5_LOOK_UP_TABLE_POINTS] = {
-1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
-/*
- * Default kernel parameters(weights). In general, default is bypass mode or as close
- * to the ineffective values as possible. Due to the chroma down+upsampling,
- * perfect bypass mode is not possible for xnr3.
- */
-const struct ia_css_xnr3_0_5_config default_xnr3_0_5_config = {
-	8191, 8191, 8191, 8191, 8191, 8191 };
-
-
-/* (void) = ia_css_xnr3_0_5_vmem_encode(*to, *from)
- * -----------------------------------------------
- * VMEM Encode Function to translate UV parameters from userspace into ISP space
-*/
-void
-ia_css_xnr3_0_5_vmem_encode(
-	struct sh_css_isp_xnr3_0_5_vmem_params *to,
-	const struct ia_css_xnr3_0_5_config *from,
-	unsigned size)
-{
-	unsigned i, j, base;
-	const unsigned total_blocks = 4;
-	const unsigned shuffle_block = 16;
-
-	(void)from;
-	(void)size;
-
-	/* Init */
-	for (i = 0; i < ISP_VEC_NELEMS; i++) {
-		to->x[0][i] = 0;
-		to->a[0][i] = 0;
-		to->b[0][i] = 0;
-		to->c[0][i] = 0;
-	}
-
-
-	/* Constraints on "x":
-	 * - values should be greater or equal to 0.
-	 * - values should be ascending.
-	 */
-	assert(x[0] >= 0);
-
-	for (j = 1; j < XNR3_0_5_LOOK_UP_TABLE_POINTS; j++) {
-		assert(x[j] >= 0);
-		assert(x[j] > x[j-1]);
-
-	}
-
-
-	/* The implementation of the calulating 1/x is based on the availability
-	 * of the OP_vec_shuffle16 operation.
-	 * 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.
-	 */
-	/* TODO: guard this code with above assumptions */
-	for(i = 0; i < total_blocks; i++) {
-		base = shuffle_block * i;
-
-		for (j = 0; j < XNR3_0_5_LOOK_UP_TABLE_POINTS; j++) {
-			to->x[0][base + j] = x[j];
-			to->a[0][base + j] = a[j];
-			to->b[0][base + j] = b[j];
-			to->c[0][base + j] = c[j];
-		}
-	}
-
-}
-
-
-
-/* (void) = ia_css_xnr3_0_5_encode(*to, *from)
- * -----------------------------------------------
- * DMEM Encode Function to translate UV parameters from userspace into ISP space
- */
-void
-ia_css_xnr3_0_5_encode(
-	struct sh_css_isp_xnr3_0_5_params *to,
-	const struct ia_css_xnr3_0_5_config *from,
-	unsigned size)
-{
-	int kernel_size = XNR_FILTER_SIZE;
-	/* The adjust factor is the next power of 2
-	   w.r.t. the kernel size*/
-	int adjust_factor = ceil_pow2(kernel_size);
-
-	int32_t weight_y0 = from->weight_y0;
-	int32_t weight_y1 = from->weight_y1;
-	int32_t weight_u0 = from->weight_u0;
-	int32_t weight_u1 = from->weight_u1;
-	int32_t weight_v0 = from->weight_v0;
-	int32_t weight_v1 = from->weight_v1;
-
-	(void)size;
-
-	to->weight_y0 = weight_y0;
-	to->weight_u0 = weight_u0;
-	to->weight_v0 = weight_v0;
-	to->weight_ydiff = (weight_y1 - weight_y0) * adjust_factor / kernel_size;
-	to->weight_udiff = (weight_u1 - weight_u0) * adjust_factor / kernel_size;
-	to->weight_vdiff = (weight_v1 - weight_v0) * adjust_factor / kernel_size;
-}
-
-/* (void) = ia_css_xnr3_0_5_debug_dtrace(*config, level)
- * -----------------------------------------------
- * Dummy Function added as the tool expects it
- */
-void
-ia_css_xnr3_0_5_debug_dtrace(
-	const struct ia_css_xnr3_0_5_config *config,
-	unsigned level)
-{
-	(void)config;
-	(void)level;
-}
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.h
deleted file mode 100644
index 69817a6..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5.host.h
+++ /dev/null
@@ -1,59 +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_XNR3_0_5_HOST_H
-#define __IA_CSS_XNR3_0_5_HOST_H
-
-#include "ia_css_xnr3_0_5_param.h"
-#include "ia_css_xnr3_0_5_types.h"
-
-/*
- * Default kernel parameters (weights). In general, default is bypass mode or as close
- * to the ineffective values as possible. Due to the chroma down+upsampling,
- * perfect bypass mode is not possible for xnr3.
-*/
-extern const struct ia_css_xnr3_0_5_config default_xnr3_0_5_config;
-
-
-
-/* (void) = ia_css_xnr3_0_5_vmem_encode(*to, *from)
- * -----------------------------------------------
- * VMEM Encode Function to translate UV parameters from userspace into ISP space
-*/
-void
-ia_css_xnr3_0_5_vmem_encode(
-	struct sh_css_isp_xnr3_0_5_vmem_params *to,
-	const struct ia_css_xnr3_0_5_config *from,
-	unsigned size);
-
-/* (void) = ia_css_xnr3_0_5_encode(*to, *from)
- * -----------------------------------------------
- * DMEM Encode Function to translate UV parameters from userspace into ISP space
-*/
-void
-ia_css_xnr3_0_5_encode(
-	struct sh_css_isp_xnr3_0_5_params *to,
-	const struct ia_css_xnr3_0_5_config *from,
-	unsigned size);
-
-/* (void) = ia_css_xnr3_0_5_debug_dtrace(*config, level)
- * -----------------------------------------------
- * Dummy Function added as the tool expects it
- */
-void
-ia_css_xnr3_0_5_debug_dtrace(
-	const struct ia_css_xnr3_0_5_config *config,
-	unsigned level);
-
-#endif /* __IA_CSS_XNR3_0_5_HOST_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_param.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_param.h
deleted file mode 100644
index fc1d9cc..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_param.h
+++ /dev/null
@@ -1,50 +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_XNR3_0_5_PARAM_H
-#define __IA_CSS_XNR3_0_5_PARAM_H
-
-#include "type_support.h"
-#include "vmem.h" /* needed for VMEM_ARRAY */
-
-/* XNR3.0.5 filter size */
-#define XNR_FILTER_SIZE             5
-
-/*
- * STRUCT sh_css_isp_xnr3_0_5_vmem_params
- * -----------------------------------------------
- * XNR3.0.5 ISP VMEM parameters
- */
-struct sh_css_isp_xnr3_0_5_vmem_params {
-	VMEM_ARRAY(x, ISP_VEC_NELEMS);
-	VMEM_ARRAY(a, ISP_VEC_NELEMS);
-	VMEM_ARRAY(b, ISP_VEC_NELEMS);
-	VMEM_ARRAY(c, ISP_VEC_NELEMS);
-};
-
-/*
- * STRUCT sh_css_isp_xnr3_0_5_params
- * -----------------------------------------------
- * XNR3.0.5 ISP parameters
- */
-struct sh_css_isp_xnr3_0_5_params {
-	int32_t weight_y0;
-	int32_t weight_u0;
-	int32_t weight_v0;
-	int32_t weight_ydiff;
-	int32_t weight_udiff;
-	int32_t weight_vdiff;
-};
-
-#endif  /*__IA_CSS_XNR3_0_5_PARAM_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_types.h
deleted file mode 100644
index ba7c81e..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr3_0_5/ia_css_xnr3_0_5_types.h
+++ /dev/null
@@ -1,33 +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_XNR3_0_5_TYPES_H
-#define __IA_CSS_XNR3_0_5_TYPES_H
-
-/*
- * STRUCT ia_css_xnr3_0_5_config
- * -----------------------------------------------
- * Struct with all parameters for the XNR3.0.5 kernel that can be set
- * from the CSS API
-*/
-struct ia_css_xnr3_0_5_config {
-	int32_t weight_y0;     /**< Weight for Y range similarity in dark area */
-	int32_t weight_y1;     /**< Weight for Y range similarity in bright area */
-	int32_t weight_u0;     /**< Weight for U range similarity in dark area */
-	int32_t weight_u1;     /**< Weight for U range similarity in bright area */
-	int32_t weight_v0;     /**< Weight for V range similarity in dark area */
-	int32_t weight_v1;     /**< Weight for V range similarity in bright area */
-};
-
-#endif /* __IA_CSS_XNR3_0_5_TYPES_H */

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

* [PATCH 14/14] atomisp: remove UDS kernel code
  2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
                   ` (11 preceding siblings ...)
  2017-04-12 18:22 ` [PATCH 13/14] atomisp: remove xnr3_0_5 and xnr3_0_11 Alan Cox
@ 2017-04-12 18:22 ` Alan Cox
  2017-04-13 19:27   ` kbuild test robot
  12 siblings, 1 reply; 18+ messages in thread
From: Alan Cox @ 2017-04-12 18:22 UTC (permalink / raw)
  To: greg, linux-media

UDS is another layer which actually boils down to some trivial assignments so
remove it so inline the code.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 .../ia_css_isp_params.c                            |   12 ++++---
 .../ia_css_isp_params.c                            |   12 ++++---
 .../ia_css_isp_params.c                            |   12 ++++---
 .../isp/kernels/uds/uds_1.0/ia_css_uds.host.c      |   35 --------------------
 .../isp/kernels/uds/uds_1.0/ia_css_uds.host.h      |   33 -------------------
 .../css2400/runtime/debug/src/ia_css_debug.c       |    2 +
 .../atomisp/pci/atomisp2/css2400/sh_css_params.c   |    2 +
 7 files changed, 23 insertions(+), 85 deletions(-)
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.c
 delete mode 100644 drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.h

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 49a5cdf..d418e76 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
@@ -43,7 +43,7 @@
 #include "isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.h"
 #include "isp/kernels/sdis/sdis_2/ia_css_sdis2.host.h"
 #include "isp/kernels/tnr/tnr_1.0/ia_css_tnr.host.h"
-#include "isp/kernels/uds/uds_1.0/ia_css_uds.host.h"
+#include "isp/kernels/uds/uds_1.0/ia_css_uds_param.h"
 #include "isp/kernels/wb/wb_1.0/ia_css_wb.host.h"
 #include "isp/kernels/xnr/xnr_1.0/ia_css_xnr.host.h"
 #include "isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.h"
@@ -719,12 +719,14 @@ ia_css_process_uds(
 		unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.uds.offset;
 
 		if (size) {
+			struct sh_css_sp_uds_params *p;
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_uds() enter:\n");
 
-			ia_css_uds_encode((struct sh_css_sp_uds_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset],
-					&params->uds_config,
-size);
+			p = (struct sh_css_sp_uds_params *)
+				&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset];
+			p->crop_pos = params->uds_config.crop_pos;
+			p->uds = params->uds_config.uds;
+
 			params->isp_params_changed = true;
 			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = 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 41b8a5f..11e4463 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
@@ -44,7 +44,7 @@
 #include "isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.h"
 #include "isp/kernels/sdis/sdis_2/ia_css_sdis2.host.h"
 #include "isp/kernels/tnr/tnr_1.0/ia_css_tnr.host.h"
-#include "isp/kernels/uds/uds_1.0/ia_css_uds.host.h"
+#include "isp/kernels/uds/uds_1.0/ia_css_uds_param.h"
 #include "isp/kernels/wb/wb_1.0/ia_css_wb.host.h"
 #include "isp/kernels/xnr/xnr_1.0/ia_css_xnr.host.h"
 #include "isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.h"
@@ -718,12 +718,14 @@ ia_css_process_uds(
 		unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.uds.offset;
 
 		if (size) {
+			struct sh_css_sp_uds_params *p;
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_uds() enter:\n");
 
-			ia_css_uds_encode((struct sh_css_sp_uds_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset],
-					&params->uds_config,
-size);
+			p = (struct sh_css_sp_uds_params *)
+				&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset];
+			p->crop_pos = params->uds_config.crop_pos;
+			p->uds = params->uds_config.uds;
+
 			params->isp_params_changed = true;
 			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = 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 41b8a5f..11e4463 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
@@ -44,7 +44,7 @@
 #include "isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.h"
 #include "isp/kernels/sdis/sdis_2/ia_css_sdis2.host.h"
 #include "isp/kernels/tnr/tnr_1.0/ia_css_tnr.host.h"
-#include "isp/kernels/uds/uds_1.0/ia_css_uds.host.h"
+#include "isp/kernels/uds/uds_1.0/ia_css_uds_param.h"
 #include "isp/kernels/wb/wb_1.0/ia_css_wb.host.h"
 #include "isp/kernels/xnr/xnr_1.0/ia_css_xnr.host.h"
 #include "isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.h"
@@ -718,12 +718,14 @@ ia_css_process_uds(
 		unsigned offset = stage->binary->info->mem_offsets.offsets.param->dmem.uds.offset;
 
 		if (size) {
+			struct sh_css_sp_uds_params *p;
 			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_process_uds() enter:\n");
 
-			ia_css_uds_encode((struct sh_css_sp_uds_params *)
-					&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset],
-					&params->uds_config,
-size);
+			p = (struct sh_css_sp_uds_params *)
+				&stage->binary->mem_params.params[IA_CSS_PARAM_CLASS_PARAM][IA_CSS_ISP_DMEM].address[offset];
+			p->crop_pos = params->uds_config.crop_pos;
+			p->uds = params->uds_config.uds;
+
 			params->isp_params_changed = true;
 			params->isp_mem_params_changed[pipe_id][stage->stage_num][IA_CSS_ISP_DMEM] = true;
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.c
deleted file mode 100644
index 20fd68b..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.c
+++ /dev/null
@@ -1,35 +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_types.h"
-#include "sh_css_defs.h"
-#include "ia_css_debug.h"
-
-#include "ia_css_uds.host.h"
-
-void
-ia_css_uds_encode(
-	struct sh_css_sp_uds_params *to,
-	const struct ia_css_uds_config *from,
-	unsigned size)
-{
-	(void)size;
-	to->crop_pos = from->crop_pos;
-	to->uds      = from->uds;
-}
-
-void
-ia_css_uds_dump(
-	const struct sh_css_sp_uds_params *uds,
-	unsigned level);
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.h
deleted file mode 100644
index 984c5bd..0000000
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.h
+++ /dev/null
@@ -1,33 +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_UDS_HOST_H
-#define __IA_CSS_UDS_HOST_H
-
-#include "sh_css_params.h"
-
-#include "ia_css_uds_param.h"
-
-void
-ia_css_uds_encode(
-	struct sh_css_sp_uds_params *to,
-	const struct ia_css_uds_config *from,
-	unsigned size);
-
-void
-ia_css_uds_dump(
-	const struct sh_css_sp_uds_params *uds,
-	unsigned level);
-
-#endif /* __IA_CSS_UDS_HOST_H */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
index 7d64318..030810b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
@@ -95,7 +95,7 @@
 #include "s3a/s3a_1.0/ia_css_s3a.host.h"
 #include "sc/sc_1.0/ia_css_sc.host.h"
 #include "tnr/tnr_1.0/ia_css_tnr.host.h"
-#include "uds/uds_1.0/ia_css_uds.host.h"
+#include "uds/uds_1.0/ia_css_uds_param.h"
 #include "wb/wb_1.0/ia_css_wb.host.h"
 #include "ynr/ynr_1.0/ia_css_ynr.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 36d9177..6674f96 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
@@ -80,7 +80,7 @@
 #include "sc/sc_1.0/ia_css_sc.host.h"
 #include "sdis/sdis_1.0/ia_css_sdis.host.h"
 #include "tnr/tnr_1.0/ia_css_tnr.host.h"
-#include "uds/uds_1.0/ia_css_uds.host.h"
+#include "uds/uds_1.0/ia_css_uds_param.h"
 #include "wb/wb_1.0/ia_css_wb.host.h"
 #include "ynr/ynr_1.0/ia_css_ynr.host.h"
 #include "xnr/xnr_1.0/ia_css_xnr.host.h"

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

* Re: [PATCH 12/14] atomisp: remove fixedbds kernel code
  2017-04-12 18:22 ` [PATCH 12/14] atomisp: remove fixedbds kernel code Alan Cox
@ 2017-04-13 11:53   ` kbuild test robot
  2017-04-14  8:09     ` Greg KH
  0 siblings, 1 reply; 18+ messages in thread
From: kbuild test robot @ 2017-04-13 11:53 UTC (permalink / raw)
  To: Alan Cox; +Cc: kbuild-all, greg, linux-media

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

Hi Alan,

[auto build test ERROR on next-20170412]
[cannot apply to linuxtv-media/master v4.9-rc8 v4.9-rc7 v4.9-rc6 v4.11-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Alan-Cox/staging-atomisp-use-local-variable-to-reduce-number-of-references/20170413-112312
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> make[7]: *** No rule to make target 'drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.o', needed by 'drivers/staging/media/atomisp/pci/atomisp2/atomisp.o'.
   make[7]: Target '__build' not remade because of errors.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 59770 bytes --]

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

* Re: [PATCH 14/14] atomisp: remove UDS kernel code
  2017-04-12 18:22 ` [PATCH 14/14] atomisp: remove UDS kernel code Alan Cox
@ 2017-04-13 19:27   ` kbuild test robot
  2017-04-14  8:11     ` Greg KH
  0 siblings, 1 reply; 18+ messages in thread
From: kbuild test robot @ 2017-04-13 19:27 UTC (permalink / raw)
  To: Alan Cox; +Cc: kbuild-all, greg, linux-media

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

Hi Alan,

[auto build test ERROR on next-20170412]
[cannot apply to linuxtv-media/master v4.9-rc8 v4.9-rc7 v4.9-rc6 v4.11-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Alan-Cox/staging-atomisp-use-local-variable-to-reduce-number-of-references/20170413-112312
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> make[7]: *** No rule to make target 'drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.o', needed by 'drivers/staging/media/atomisp/pci/atomisp2/atomisp.o'.
   make[7]: *** No rule to make target 'drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.o', needed by 'drivers/staging/media/atomisp/pci/atomisp2/atomisp.o'.
   make[7]: Target '__build' not remade because of errors.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 59770 bytes --]

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

* Re: [PATCH 12/14] atomisp: remove fixedbds kernel code
  2017-04-13 11:53   ` kbuild test robot
@ 2017-04-14  8:09     ` Greg KH
  0 siblings, 0 replies; 18+ messages in thread
From: Greg KH @ 2017-04-14  8:09 UTC (permalink / raw)
  To: kbuild test robot; +Cc: Alan Cox, kbuild-all, linux-media

On Thu, Apr 13, 2017 at 07:53:58PM +0800, kbuild test robot wrote:
> Hi Alan,
> 
> [auto build test ERROR on next-20170412]
> [cannot apply to linuxtv-media/master v4.9-rc8 v4.9-rc7 v4.9-rc6 v4.11-rc6]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Alan-Cox/staging-atomisp-use-local-variable-to-reduce-number-of-references/20170413-112312
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> All errors (new ones prefixed by >>):
> 
> >> make[7]: *** No rule to make target 'drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.o', needed by 'drivers/staging/media/atomisp/pci/atomisp2/atomisp.o'.
>    make[7]: Target '__build' not remade because of errors.

That's an odd error, this works fine for me here.

greg k-h

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

* Re: [PATCH 14/14] atomisp: remove UDS kernel code
  2017-04-13 19:27   ` kbuild test robot
@ 2017-04-14  8:11     ` Greg KH
  0 siblings, 0 replies; 18+ messages in thread
From: Greg KH @ 2017-04-14  8:11 UTC (permalink / raw)
  To: kbuild test robot; +Cc: Alan Cox, kbuild-all, linux-media

On Fri, Apr 14, 2017 at 03:27:08AM +0800, kbuild test robot wrote:
> Hi Alan,
> 
> [auto build test ERROR on next-20170412]
> [cannot apply to linuxtv-media/master v4.9-rc8 v4.9-rc7 v4.9-rc6 v4.11-rc6]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Alan-Cox/staging-atomisp-use-local-variable-to-reduce-number-of-references/20170413-112312
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> All errors (new ones prefixed by >>):
> 
> >> make[7]: *** No rule to make target 'drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/uds/uds_1.0/ia_css_uds.host.o', needed by 'drivers/staging/media/atomisp/pci/atomisp2/atomisp.o'.
>    make[7]: *** No rule to make target 'drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds.host.o', needed by 'drivers/staging/media/atomisp/pci/atomisp2/atomisp.o'.
>    make[7]: Target '__build' not remade because of errors.

This too is odd, are you not rebuilding everything properly when a file
is removed?  This works for me here.

thanks,

greg k-h

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

end of thread, other threads:[~2017-04-14  8:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 18:20 [PATCH 01/14] staging: atomisp: use local variable to reduce number of references Alan Cox
2017-04-12 18:20 ` [PATCH 02/14] staging/atomisp: fix spelling mistake: "falied" -> "failed" Alan Cox
2017-04-12 18:20 ` [PATCH 03/14] staging: atomisp: remove enable_isp_irq function and add disable_isp_irq Alan Cox
2017-04-12 18:20 ` [PATCH 04/14] staging: atomisp: replace "&isp->asd[i]" with "asd" in __get_asd_from_port() Alan Cox
2017-04-12 18:20 ` [PATCH 05/14] staging: atomisp: move mipi_info assignment to next line " Alan Cox
2017-04-12 18:21 ` [PATCH 06/14] atomisp: remove most of the uses of atomisp_kernel_malloc Alan Cox
2017-04-12 18:21 ` [PATCH 07/14] atomisp: unwrap the _ex malloc/free functions Alan Cox
2017-04-12 18:21 ` [PATCH 08/14] atomisp: remove indirection from sh_css_malloc Alan Cox
2017-04-12 18:21 ` [PATCH 09/14] atomisp: remove sh_css_malloc indirections where we can Alan Cox
2017-04-12 18:21 ` [PATCH 10/14] atomisp: remove contiguous handling Alan Cox
2017-04-12 18:22 ` [PATCH 11/14] atomisp: remove satm kernel Alan Cox
2017-04-12 18:22 ` [PATCH 12/14] atomisp: remove fixedbds kernel code Alan Cox
2017-04-13 11:53   ` kbuild test robot
2017-04-14  8:09     ` Greg KH
2017-04-12 18:22 ` [PATCH 13/14] atomisp: remove xnr3_0_5 and xnr3_0_11 Alan Cox
2017-04-12 18:22 ` [PATCH 14/14] atomisp: remove UDS kernel code Alan Cox
2017-04-13 19:27   ` kbuild test robot
2017-04-14  8:11     ` Greg KH

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.