From: Marek Szyprowski Date: Thu, 6 Aug 2015 07:43:41 +0000 (+0200) Subject: fimc-is: Remove ION integration code X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee7685da5216eb1d923ed9f63847491d74eb4e52;p=platform%2Fkernel%2Flinux-exynos.git fimc-is: Remove ION integration code Change-Id: I9b06e9479ee3028cce895f3f73b76d101c1572ac Signed-off-by: Marek Szyprowski --- diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-companion.c b/drivers/media/platform/exynos/fimc-is/fimc-is-companion.c index c6d05b56d184..83b631475f74 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-companion.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-companion.c @@ -15,11 +15,6 @@ #include "fimc-is-companion.h" #include "fimc-is-device-ischain.h" #include "fimc-is-fan53555.h" -#ifdef USE_ION_ALLOC -#include -#include -#include -#endif #define COMP_FW_EVT0 "companion_fw_evt0.bin" #define COMP_FW_EVT1 "companion_fw_evt1.bin" @@ -387,9 +382,6 @@ static int fimc_is_comp_load_binary(struct fimc_is_core *core, char *name) u16 addr1, addr2; char companion_ver[12] = {0, }; struct fimc_is_from_info *sysfs_finfo; -#ifdef USE_ION_ALLOC - struct ion_handle *handle = NULL; -#endif int retry_count = 0; BUG_ON(!core); @@ -397,9 +389,6 @@ static int fimc_is_comp_load_binary(struct fimc_is_core *core, char *name) BUG_ON(!core->companion); BUG_ON(!core->companion->pdev); BUG_ON(!name); -#ifdef USE_ION_ALLOC - BUG_ON(!core->fimc_ion_client); -#endif fimc_is_sec_get_sysfs_finfo(&sysfs_finfo); old_fs = get_fs(); @@ -414,29 +403,12 @@ static int fimc_is_comp_load_binary(struct fimc_is_core *core, char *name) size = fp->f_path.dentry->d_inode->i_size; pr_info("start read sdcard, file path %s, size %d Bytes\n", fw_name, size); -#ifdef USE_ION_ALLOC - handle = ion_alloc(core->fimc_ion_client, (size_t)size, 0, - EXYNOS_ION_HEAP_SYSTEM_MASK, 0); - if (IS_ERR_OR_NULL(handle)) { - err("fimc_is_comp_load_binary:failed to ioc_alloc\n"); - ret = -ENOMEM; - goto p_err; - } - - buf = (u8 *)ion_map_kernel(core->fimc_ion_client, handle); - if (IS_ERR_OR_NULL(buf)) { - err("fimc_is_comp_load_binary:fail to ion_map_kernle\n"); - ret = -ENOMEM; - goto p_err; - } -#else buf = vmalloc(size); if (!buf) { err("failed to allocate memory"); ret = -ENOMEM; goto p_err; } -#endif nread = vfs_read(fp, (char __user *)buf, size, &fp->f_pos); if (nread != size) { @@ -479,29 +451,12 @@ request_fw: } size = fw_blob->size; -#ifdef USE_ION_ALLOC - handle = ion_alloc(core->fimc_ion_client, (size_t)size, 0, - EXYNOS_ION_HEAP_SYSTEM_MASK, 0); - if (IS_ERR_OR_NULL(handle)) { - err("fimc_is_comp_load_binary:failed to ioc_alloc\n"); - ret = -ENOMEM; - goto p_err; - } - - buf = (u8 *)ion_map_kernel(core->fimc_ion_client, handle); - if (IS_ERR_OR_NULL(buf)) { - err("fimc_is_comp_load_binary:fail to ion_map_kernle\n"); - ret = -ENOMEM; - goto p_err; - } -#else buf = vmalloc(size); if (!buf) { err("failed to allocate memory"); ret = -ENOMEM; goto p_err; } -#endif memcpy((void *)buf, fw_blob->data, size); if ((!strcmp(name, COMP_FW_EVT0)) || (!strcmp(name, sysfs_finfo->load_c1_fw_name))) { memcpy((void *)companion_crc, fw_blob->data + size - 4, 4); @@ -596,19 +551,9 @@ request_fw: } p_err: -#ifdef USE_ION_ALLOC - if (!IS_ERR_OR_NULL(buf)) { - ion_unmap_kernel(core->fimc_ion_client, handle); - } - - if (!IS_ERR_OR_NULL(handle)) { - ion_free(core->fimc_ion_client, handle); - } -#else if (buf) { vfree(buf); } -#endif if (!fw_requested) { if (!IS_ERR_OR_NULL(fp)) { filp_close(fp, current->files); diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-core.c b/drivers/media/platform/exynos/fimc-is/fimc-is-core.c index b5ddf9e2d6ae..575dff9c0a01 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-core.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-core.c @@ -869,9 +869,6 @@ static int fimc_is_probe(struct platform_device *pdev) core->use_ois_hsi2c = pdata->use_ois_hsi2c; core->use_module_check = pdata->use_module_check; -#ifdef USE_ION_ALLOC - core->fimc_ion_client = ion_client_create(ion_exynos, "fimc-is"); -#endif core->pdev = pdev; core->pdata = pdata; core->id = pdev->id; diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-core.h b/drivers/media/platform/exynos/fimc-is/fimc-is-core.h index a73809d53705..720806e019e8 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-core.h +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-core.h @@ -282,19 +282,10 @@ struct fimc_is_core { bool ois_ver_read; bool use_ois_hsi2c; bool use_module_check; -#ifdef USE_ION_ALLOC - struct ion_client *fimc_ion_client; -#endif bool running_rear_camera; bool running_front_camera; }; -#if defined(CONFIG_VIDEOBUF2_CMA_PHYS) -extern const struct fimc_is_vb2 fimc_is_vb2_cma; -#elif defined(CONFIG_VIDEOBUF2_ION) -extern const struct fimc_is_vb2 fimc_is_vb2_ion; -#endif - extern struct device *fimc_is_dev; void fimc_is_mem_suspend(void *alloc_ctxes); diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-device-ischain.c b/drivers/media/platform/exynos/fimc-is/fimc-is-device-ischain.c index de61d7283161..78e0151eef63 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-device-ischain.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-device-ischain.c @@ -770,10 +770,6 @@ static int fimc_is_ischain_loadfirm(struct fimc_is_device_ischain *device) int location = 0; const struct firmware *fw_blob = NULL; u8 *buf = NULL; -#ifdef USE_ION_ALLOC - struct ion_handle *handle = NULL; - struct fimc_is_core *core = platform_get_drvdata(device->pdev); -#endif #ifdef SDCARD_FW struct file *fp = NULL; mm_segment_t old_fs; @@ -783,10 +779,6 @@ static int fimc_is_ischain_loadfirm(struct fimc_is_device_ischain *device) int retry_count = 0; mdbgd_ischain("%s\n", device, __func__); -#ifdef USE_ION_ALLOC - BUG_ON(!core); - BUG_ON(!core->fimc_ion_client); -#endif old_fs = get_fs(); set_fs(KERNEL_DS); fp = filp_open(FIMC_IS_FW_SDCARD, O_RDONLY, 0); @@ -811,22 +803,6 @@ static int fimc_is_ischain_loadfirm(struct fimc_is_device_ischain *device) fsize = fp->f_path.dentry->d_inode->i_size; pr_info("start, file path %s, size %ld Bytes\n", is_dumped_fw_loading_needed ? fw_path : FIMC_IS_FW_SDCARD, fsize); -#ifdef USE_ION_ALLOC - handle = ion_alloc(core->fimc_ion_client, (size_t)fsize, 0, - EXYNOS_ION_HEAP_SYSTEM_MASK, 0); - if (IS_ERR_OR_NULL(handle)) { - err("fimc_is_comp_load_binary:failed to ioc_alloc\n"); - ret = -ENOMEM; - goto out; - } - - buf = (u8 *)ion_map_kernel(core->fimc_ion_client, handle); - if (IS_ERR_OR_NULL(buf)) { - err("fimc_is_comp_load_binary:fail to ion_map_kernle\n"); - ret = -ENOMEM; - goto out; - } -#else buf = vmalloc(fsize); if (!buf) { dev_err(&device->pdev->dev, @@ -834,7 +810,6 @@ static int fimc_is_ischain_loadfirm(struct fimc_is_device_ischain *device) ret = -ENOMEM; goto out; } -#endif nread = vfs_read(fp, (char __user *)buf, fsize, &fp->f_pos); if (nread != fsize) { dev_err(&device->pdev->dev, @@ -887,22 +862,11 @@ request_fw: out: #ifdef SDCARD_FW -#ifdef USE_ION_ALLOC - if (!IS_ERR_OR_NULL(buf)) { - ion_unmap_kernel(core->fimc_ion_client, handle); - } - - if (!IS_ERR_OR_NULL(handle)) { - ion_free(core->fimc_ion_client, handle); - } -#endif if (!fw_requested) { -#ifndef USE_ION_ALLOC if (buf) { vfree(buf); } -#endif if (!IS_ERR_OR_NULL(fp)) { filp_close(fp, current->files); } @@ -995,10 +959,6 @@ static int fimc_is_ischain_loadsetf(struct fimc_is_device_ischain *device, void *address; const struct firmware *fw_blob = NULL; u8 *buf = NULL; -#ifdef USE_ION_ALLOC - struct ion_handle *handle = NULL; - struct fimc_is_core *core = platform_get_drvdata(device->pdev); -#endif #ifdef SDCARD_FW struct file *fp = NULL; @@ -1010,11 +970,6 @@ static int fimc_is_ischain_loadsetf(struct fimc_is_device_ischain *device, mdbgd_ischain("%s\n", device, __func__); -#ifdef USE_ION_ALLOC - BUG_ON(!core); - BUG_ON(!core->fimc_ion_client); -#endif - old_fs = get_fs(); set_fs(KERNEL_DS); memset(setfile_path, 0x00, sizeof(setfile_path)); @@ -1043,22 +998,6 @@ static int fimc_is_ischain_loadsetf(struct fimc_is_device_ischain *device, fsize = fp->f_path.dentry->d_inode->i_size; info("start, file path %s, size %ld Bytes\n", setfile_path, fsize); -#ifdef USE_ION_ALLOC - handle = ion_alloc(core->fimc_ion_client, (size_t)fsize, 0, - EXYNOS_ION_HEAP_SYSTEM_MASK, 0); - if (IS_ERR_OR_NULL(handle)) { - err("fimc_is_comp_load_binary:failed to ioc_alloc\n"); - ret = -ENOMEM; - goto out; - } - - buf = (u8 *)ion_map_kernel(core->fimc_ion_client, handle); - if (IS_ERR_OR_NULL(buf)) { - err("fimc_is_comp_load_binary:fail to ion_map_kernle\n"); - ret = -ENOMEM; - goto out; - } -#else buf = vmalloc(fsize); if (!buf) { dev_err(&device->pdev->dev, @@ -1066,7 +1005,6 @@ static int fimc_is_ischain_loadsetf(struct fimc_is_device_ischain *device, ret = -ENOMEM; goto out; } -#endif nread = vfs_read(fp, (char __user *)buf, fsize, &fp->f_pos); if (nread != fsize) { dev_err(&device->pdev->dev, @@ -1124,22 +1062,11 @@ request_fw: out: #ifdef SDCARD_FW -#ifdef USE_ION_ALLOC - if (!IS_ERR_OR_NULL(buf)) { - ion_unmap_kernel(core->fimc_ion_client, handle); - } - - if (!IS_ERR_OR_NULL(handle)) { - ion_free(core->fimc_ion_client, handle); - } -#endif if (!fw_requested) { -#ifndef USE_ION_ALLOC if (buf) { vfree(buf); } -#endif if (!IS_ERR_OR_NULL(fp)) { filp_close(fp, current->files); }