msm: camera: Remove references to CONFIG_ANDROID_PMEM

CONFIG_ANDROID_PMEM is completely deprecated. Remove
all references to it.

Change-Id: I5033f51458d71fe8afcda3faa937c3da1ba31900
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
This commit is contained in:
Laura Abbott 2013-03-09 15:59:25 -08:00
parent fc283008ab
commit 17b7dbe25d
16 changed files with 20 additions and 264 deletions

View file

@ -15,7 +15,7 @@
#include <linux/clk.h>
#include <mach/clk.h>
#include <linux/io.h>
#include <linux/android_pmem.h>
#include <mach/camera.h>
#include <mach/iommu_domains.h>
@ -35,8 +35,6 @@ void msm_gemini_platform_p2v(struct file *file,
ion_unmap_iommu(gemini_client, *ionhandle, CAMERA_DOMAIN, GEN_POOL);
ion_free(gemini_client, *ionhandle);
*ionhandle = NULL;
#elif CONFIG_ANDROID_PMEM
put_pmem_file(file);
#endif
}
@ -53,9 +51,6 @@ uint32_t msm_gemini_platform_v2p(int fd, uint32_t len, struct file **file_p,
rc = ion_map_iommu(gemini_client, *ionhandle, CAMERA_DOMAIN, GEN_POOL,
SZ_4K, 0, &paddr, (unsigned long *)&size, 0, 0);
#elif CONFIG_ANDROID_PMEM
unsigned long kvstart;
rc = get_pmem_file(fd, &paddr, &kvstart, &size, file_p);
#else
rc = 0;
paddr = 0;

View file

@ -13,7 +13,7 @@
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/android_pmem.h>
#include <mach/clk.h>
#include <mach/camera.h>
#include <mach/msm_subsystem_map.h>
@ -39,8 +39,6 @@ void msm_mercury_platform_p2v(struct file *file,
GEN_POOL);
ion_free(mercury_client, *ionhandle);
*ionhandle = NULL;
#elif CONFIG_ANDROID_PMEM
put_pmem_file(file);
#endif
}
@ -59,10 +57,6 @@ uint32_t msm_mercury_platform_v2p(int fd, uint32_t len,
rc = ion_map_iommu(mercury_client, *ionhandle, CAMERA_DOMAIN,
GEN_POOL, SZ_4K, 0, &paddr,
(unsigned long *)&size, 0, 0);
#elif CONFIG_ANDROID_PMEM
unsigned long kvstart;
rc = get_pmem_file(fd, &paddr, &kvstart, &size, file_p);
#else
rc = 0;
paddr = 0;
size = 0;

View file

@ -28,7 +28,7 @@
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/uaccess.h>
#include <linux/android_pmem.h>
#include <linux/poll.h>
#include <media/msm_camera.h>
#include <mach/camera.h>
@ -319,15 +319,6 @@ static int msm_pmem_table_add(struct hlist_head *ptype,
goto out1;
ion_phys(client_for_ion, region->handle,
&paddr, (size_t *)&len);
#else
rc = get_pmem_file(info->fd, &paddr, &kvstart, &len, &file);
if (rc < 0) {
pr_err("%s: get_pmem_file fd %d error %d\n",
__func__,
info->fd, rc);
goto out1;
}
region->file = file;
#endif
if (!info->len)
info->len = len;
@ -364,8 +355,6 @@ static int msm_pmem_table_add(struct hlist_head *ptype,
out2:
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
ion_free(client_for_ion, region->handle);
#else
put_pmem_file(region->file);
#endif
out1:
kfree(region);
@ -649,8 +638,6 @@ static int __msm_pmem_table_del(struct msm_sync *sync,
hlist_del(node);
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
ion_free(client_for_ion, region->handle);
#else
put_pmem_file(region->file);
#endif
kfree(region);
CDBG("%s: type %d, vaddr 0x%p\n",
@ -673,8 +660,6 @@ static int __msm_pmem_table_del(struct msm_sync *sync,
hlist_del(node);
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
ion_free(client_for_ion, region->handle);
#else
put_pmem_file(region->file);
#endif
kfree(region);
CDBG("%s: type %d, vaddr 0x%p\n",
@ -696,8 +681,6 @@ static int __msm_pmem_table_del(struct msm_sync *sync,
hlist_del(node);
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
ion_free(client_for_ion, region->handle);
#else
put_pmem_file(region->file);
#endif
kfree(region);
CDBG("%s: type %d, vaddr 0x%p\n",
@ -3012,8 +2995,6 @@ static int __msm_release(struct msm_sync *sync)
hlist_del(hnode);
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
ion_free(client_for_ion, region->handle);
#else
put_pmem_file(region->file);
#endif
kfree(region);
}
@ -3023,8 +3004,6 @@ static int __msm_release(struct msm_sync *sync)
hlist_del(hnode);
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
ion_free(client_for_ion, region->handle);
#else
put_pmem_file(region->file);
#endif
kfree(region);
}

View file

@ -21,7 +21,7 @@
#include <linux/videodev2.h>
#include <linux/proc_fs.h>
#include <linux/vmalloc.h>
#include <linux/android_pmem.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-ioctl.h>

View file

@ -26,7 +26,7 @@
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include <linux/android_pmem.h>
#include "msm.h"
#include "msm_cam_server.h"

View file

@ -23,7 +23,7 @@
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include <linux/android_pmem.h>
#include "msm.h"
#include "msm_cam_server.h"
@ -1015,78 +1015,6 @@ static int __msm_mctl_map_user_frame(struct msm_cam_meta_frame *meta_frame,
D("%s Frame mapped successfully ", __func__);
return 0;
}
#else
/* Unmap using PMEM APIs */
static int __msm_mctl_unmap_user_frame(struct msm_cam_meta_frame *meta_frame,
struct ion_client *client, int domain_num)
{
int i = 0, rc = 0;
for (i = 0; i < meta_frame->frame.num_planes; i++) {
D("%s Plane %d handle %p", __func__, i,
meta_frame->map[i].handle);
put_pmem_file(meta_frame->map[i].file);
}
}
/* Map using PMEM APIs */
static int __msm_mctl_map_user_frame(struct msm_cam_meta_frame *meta_frame,
struct ion_client *client, int domain_num)
{
unsigned long kvstart = 0;
unsigned long paddr = 0;
struct file *file = NULL;
unsigned long len;
int i = 0, j = 0;
for (i = 0; i < meta_frame->frame.num_planes; i++) {
rc = get_pmem_file(meta_frame->frame.mp[i].fd,
&paddr, &kvstart, &len, &file);
if (rc < 0) {
pr_err("%s: get_pmem_file fd %d error %d\n",
__func__, meta_frame->frame.mp[i].fd, rc);
/* Roll back previous plane mappings, if any */
for (j = i-1; j >= 0; j--)
if (meta_frame->map[j].file)
put_pmem_file(meta_frame->map[j].file);
return -EACCES;
}
D("%s Got pmem file for fd %d plane %d as %p", __func__,
meta_frame->frame.mp[i].fd, i, file);
meta_frame->map[i].file = file;
/* Validate the offsets with the mapped length. */
if ((meta_frame->frame.mp[i].addr_offset > len) ||
(meta_frame->frame.mp[i].data_offset +
meta_frame->frame.mp[i].length > len)) {
pr_err("%s: Invalid offsets A %d D %d L %d len %ld",
__func__, meta_frame->frame.mp[i].addr_offset,
meta_frame->frame.mp[i].data_offset,
meta_frame->frame.mp[i].length, len);
/* Roll back previous plane mappings, if any */
for (j = i; j >= 0; j--)
if (meta_frame->map[j].file)
put_pmem_file(meta_frame->map[j].file);
return -EINVAL;
}
meta_frame->map[i].data_offset =
meta_frame->frame.mp[i].data_offset;
/* Add the addr_offset to the paddr here itself. The addr_offset
* will be non-zero only if the user has allocated a buffer with
* a single fd, but logically partitioned it into
* multiple planes or buffers.*/
paddr += meta_frame->frame.mp[i].addr_offset;
meta_frame->map[i].paddr = paddr;
meta_frame->map[i].len = len;
D("%s Plane %d fd %d handle %p paddr %x", __func__,
i, meta_frame->frame.mp[i].fd,
meta_frame->map[i].handle,
(uint32_t)meta_frame->map[i].paddr);
}
D("%s Frame mapped successfully ", __func__);
return 0;
}
#endif
int msm_mctl_map_user_frame(struct msm_cam_meta_frame *meta_frame,

View file

@ -25,7 +25,7 @@
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include <linux/android_pmem.h>
#include "msm.h"
#include "msm_vpe.h"

View file

@ -25,7 +25,7 @@
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include <linux/android_pmem.h>
#include "msm.h"
@ -71,26 +71,6 @@
static DEFINE_MUTEX(hlist_mut);
#ifdef CONFIG_ANDROID_PMEM
static int check_pmem_info(struct msm_pmem_info *info, int len)
{
if (info->offset < len &&
info->offset + info->len <= len &&
info->planar0_off < len &&
info->planar1_off < len)
return 0;
pr_err("%s: check failed: off %d len %d y %d cbcr %d (total len %d)\n",
__func__,
info->offset,
info->len,
info->planar0_off,
info->planar1_off,
len);
return -EINVAL;
}
#endif
static int check_overlap(struct hlist_head *ptype,
unsigned long paddr,
unsigned long len)
@ -138,14 +118,6 @@ static int msm_pmem_table_add(struct hlist_head *ptype,
if (ion_map_iommu(client, region->handle, domain_num, 0,
SZ_4K, 0, &paddr, &len, 0, 0) < 0)
goto out2;
#elif CONFIG_ANDROID_PMEM
rc = get_pmem_file(info->fd, &paddr, &kvstart, &len, &file);
if (rc < 0) {
pr_err("%s: get_pmem_file fd %d error %d\n",
__func__, info->fd, rc);
goto out1;
}
region->file = file;
#else
paddr = 0;
file = NULL;
@ -153,9 +125,6 @@ static int msm_pmem_table_add(struct hlist_head *ptype,
#endif
if (!info->len)
info->len = len;
rc = check_pmem_info(info, len);
if (rc < 0)
goto out3;
paddr += info->offset;
len = info->len;
@ -185,8 +154,6 @@ out3:
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
out2:
ion_free(client, region->handle);
#elif CONFIG_ANDROID_PMEM
put_pmem_file(region->file);
#endif
out1:
kfree(region);
@ -256,8 +223,6 @@ static int __msm_pmem_table_del(struct hlist_head *ptype,
ion_unmap_iommu(client, region->handle,
domain_num, 0);
ion_free(client, region->handle);
#else
put_pmem_file(region->file);
#endif
kfree(region);
}

View file

@ -14,7 +14,7 @@
#include <linux/msm_adsp.h>
#include <linux/uaccess.h>
#include <linux/fs.h>
#include <linux/android_pmem.h>
#include <linux/slab.h>
#include <mach/msm_adsp.h>
#include <mach/clk.h>

View file

@ -13,7 +13,7 @@
#include <linux/msm_adsp.h>
#include <linux/uaccess.h>
#include <linux/fs.h>
#include <linux/android_pmem.h>
#include <linux/slab.h>
#include <linux/pm_qos.h>
#include <linux/delay.h>

View file

@ -13,7 +13,7 @@
#include <linux/msm_adsp.h>
#include <linux/uaccess.h>
#include <linux/fs.h>
#include <linux/android_pmem.h>
#include <linux/slab.h>
#include <linux/pm_qos.h>
#include <linux/delay.h>

View file

@ -25,7 +25,7 @@
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include <linux/android_pmem.h>
#include <media/msm_camera.h>
#include <media/msm_isp.h>
#include "msm.h"
@ -162,25 +162,6 @@ static int msm_stats_deinit(struct msm_stats_bufq_ctrl *stats_ctrl)
return rc;
}
#ifdef CONFIG_ANDROID_PMEM
static int msm_stats_check_pmem_info(struct msm_stats_buf_info *info, int len)
{
if (info->offset < len &&
info->offset + info->len <= len &&
info->planar0_off < len && info->planar1_off < len)
return 0;
pr_err("%s: check failed: off %d len %d y %d cbcr %d (total len %d)\n",
__func__,
info->offset,
info->len,
info->planar0_off,
info->planar1_off,
len);
return -EINVAL;
}
#endif
static int msm_stats_buf_prepare(struct msm_stats_bufq_ctrl *stats_ctrl,
struct msm_stats_buf_info *info, struct ion_client *client,
int domain_num)
@ -226,14 +207,6 @@ static int msm_stats_buf_prepare(struct msm_stats_bufq_ctrl *stats_ctrl,
pr_err("%s: cannot map address", __func__);
goto out2;
}
#elif CONFIG_ANDROID_PMEM
rc = get_pmem_file(info->fd, &paddr, &kvstart, &len, &file);
if (rc < 0) {
pr_err("%s: get_pmem_file fd %d error %d\n",
__func__, info->fd, rc);
goto out1;
}
stats_buf->file = file;
#else
paddr = 0;
file = NULL;
@ -241,11 +214,6 @@ static int msm_stats_buf_prepare(struct msm_stats_bufq_ctrl *stats_ctrl,
#endif
if (!info->len)
info->len = len;
rc = msm_stats_check_pmem_info(info, len);
if (rc < 0) {
pr_err("%s: msm_stats_check_pmem_info err = %d", __func__, rc);
goto out3;
}
paddr += info->offset;
len = info->len;
stats_buf->paddr = paddr;
@ -256,15 +224,12 @@ static int msm_stats_buf_prepare(struct msm_stats_bufq_ctrl *stats_ctrl,
D("%s pmem_stats address is 0x%ld\n", __func__, paddr);
stats_buf->state = MSM_STATS_BUFFER_STATE_PREPARED;
return 0;
out3:
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
ion_unmap_iommu(client, stats_buf->handle, domain_num, 0);
#endif
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
out2:
ion_free(client, stats_buf->handle);
#elif CONFIG_ANDROID_PMEM
put_pmem_file(stats_buf->file);
#endif
out1:
return rc;
@ -295,8 +260,6 @@ static int msm_stats_buf_unprepare(struct msm_stats_bufq_ctrl *stats_ctrl,
ion_unmap_iommu(client, stats_buf->handle,
domain_num, 0);
ion_free(client, stats_buf->handle);
#else
put_pmem_file(stats_buf->file);
#endif
if (stats_buf->state == MSM_STATS_BUFFER_STATE_QUEUED) {
/* buf queued need delete from list */

View file

@ -20,7 +20,7 @@
#include <linux/proc_fs.h>
#include <linux/videodev2.h>
#include <linux/vmalloc.h>
#include <linux/android_pmem.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-ioctl.h>

View file

@ -17,7 +17,7 @@
#include <linux/clk.h>
#include <mach/clk.h>
#include <linux/io.h>
#include <linux/android_pmem.h>
#include <mach/camera.h>
#include <mach/iommu_domains.h>
#include <mach/msm_bus.h>

View file

@ -24,7 +24,7 @@
#include <linux/pagemap.h>
#include <linux/sched.h>
#include <linux/io.h>
#include <linux/android_pmem.h>
#include <linux/memory_alloc.h>
#include <media/videobuf-msm-mem.h>
#include <media/msm_camera.h>
@ -140,55 +140,6 @@ static const struct vm_operations_struct videobuf_vm_ops = {
.close = videobuf_vm_close,
};
/**
* videobuf_pmem_contig_user_put() - reset pointer to user space buffer
* @mem: per-buffer private videobuf-contig-pmem data
*
* This function resets the user space pointer
*/
static void videobuf_pmem_contig_user_put(struct videobuf_contig_pmem *mem)
{
if (mem->phyaddr) {
put_pmem_file(mem->file);
mem->is_userptr = 0;
mem->phyaddr = 0;
mem->size = 0;
}
}
/**
* videobuf_pmem_contig_user_get() - setup user space memory pointer
* @mem: per-buffer private videobuf-contig-pmem data
* @vb: video buffer to map
*
* This function validates and sets up a pointer to user space memory.
* Only physically contiguous pfn-mapped memory is accepted.
*
* Returns 0 if successful.
*/
static int videobuf_pmem_contig_user_get(struct videobuf_contig_pmem *mem,
struct videobuf_buffer *vb)
{
unsigned long kvstart;
unsigned long len;
int rc;
mem->size = PAGE_ALIGN(vb->size);
rc = get_pmem_file(vb->baddr, (unsigned long *)&mem->phyaddr,
&kvstart, &len, &mem->file);
if (rc < 0) {
pr_err("%s: get_pmem_file fd %lu error %d\n",
__func__, vb->baddr,
rc);
return rc;
}
mem->phyaddr += vb->boff;
mem->y_off = 0;
mem->cbcr_off = (vb->size)*2/3;
mem->is_userptr = 1;
return rc;
}
static struct videobuf_buffer *__videobuf_alloc(size_t size)
{
struct videobuf_contig_pmem *mem;
@ -229,12 +180,6 @@ static int __videobuf_iolock(struct videobuf_queue *q,
/* All handling should be done by __videobuf_mmap_mapper() */
break;
case V4L2_MEMORY_USERPTR:
D("%s memory method USERPTR\n", __func__);
/* handle pointer from user space */
rc = videobuf_pmem_contig_user_get(mem, vb);
break;
case V4L2_MEMORY_OVERLAY:
default:
pr_err("%s memory method OVERLAY/unknown\n", __func__);
@ -383,7 +328,6 @@ int videobuf_pmem_contig_free(struct videobuf_queue *q,
/* handle user space pointer case */
if (buf->baddr) {
videobuf_pmem_contig_user_put(mem);
return 0;
} else {
/* don't support read() method */

View file

@ -24,7 +24,7 @@
#include <linux/pagemap.h>
#include <linux/sched.h>
#include <linux/io.h>
#include <linux/android_pmem.h>
#include <linux/memory_alloc.h>
#include <media/videobuf2-msm-mem.h>
#include <media/msm_camera.h>
@ -177,15 +177,14 @@ int videobuf2_pmem_contig_user_get(struct videobuf2_contig_pmem *mem,
struct ion_client *client,
int domain_num)
{
unsigned long len;
int rc = 0;
#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
unsigned long kvstart;
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
unsigned long len;
#endif
unsigned long paddr = 0;
if (mem->phyaddr != 0)
return 0;
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
#if defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
mem->ion_handle = ion_import_dma_buf(client, (int)mem->vaddr);
if (IS_ERR_OR_NULL(mem->ion_handle)) {
pr_err("%s ION import failed\n", __func__);
@ -195,17 +194,8 @@ int videobuf2_pmem_contig_user_get(struct videobuf2_contig_pmem *mem,
SZ_4K, 0, (unsigned long *)&mem->phyaddr, &len, 0, 0);
if (rc < 0)
ion_free(client, mem->ion_handle);
#elif CONFIG_ANDROID_PMEM
rc = get_pmem_file((int)mem->vaddr, (unsigned long *)&mem->phyaddr,
&kvstart, &len, &mem->file);
if (rc < 0) {
pr_err("%s: get_pmem_file fd %d error %d\n",
__func__, (int)mem->vaddr, rc);
return rc;
}
#else
paddr = 0;
kvstart = 0;
#endif
if (offset)
mem->offset = *offset;
@ -224,12 +214,10 @@ void videobuf2_pmem_contig_user_put(struct videobuf2_contig_pmem *mem,
struct ion_client *client, int domain_num)
{
if (mem->is_userptr) {
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
#if defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
ion_unmap_iommu(client, mem->ion_handle,
domain_num, 0);
ion_free(client, mem->ion_handle);
#elif CONFIG_ANDROID_PMEM
put_pmem_file(mem->file);
#endif
}
mem->is_userptr = 0;