fimc-is: Remove ION integration code
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 6 Aug 2015 07:43:41 +0000 (09:43 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 27 Apr 2018 08:25:07 +0000 (10:25 +0200)
Change-Id: I9b06e9479ee3028cce895f3f73b76d101c1572ac
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
drivers/media/platform/exynos/fimc-is/fimc-is-companion.c
drivers/media/platform/exynos/fimc-is/fimc-is-core.c
drivers/media/platform/exynos/fimc-is/fimc-is-core.h
drivers/media/platform/exynos/fimc-is/fimc-is-device-ischain.c

index c6d05b56d184326c76ce1e50f9d49905ac9ac6b9..83b631475f741046e8f79d3f3a5387174d8ec4e6 100644 (file)
 #include "fimc-is-companion.h"
 #include "fimc-is-device-ischain.h"
 #include "fimc-is-fan53555.h"
-#ifdef USE_ION_ALLOC
-#include <linux/dma-buf.h>
-#include <linux/exynos_ion.h>
-#include <linux/ion.h>
-#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);
index b5ddf9e2d6aea5d4f42fcd766143b06a242d74ce..575dff9c0a01ced4c2bedb2d862e3de8c5ea04fb 100644 (file)
@@ -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;
index a73809d53705be55abacf1015e4114c351f4382f..720806e019e8a8929d48fd3e06cb6da02ea5cbb9 100644 (file)
@@ -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);
index de61d728316164ba6246aad735a4fea9d7c419ce..78e0151eef63054c393c7de7980167a15e69a400 100644 (file)
@@ -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);
                }