ion: remove obsolete ion flags

The symbols CACHED and UNCACHED have been replaced by ION_FLAG_CACHED
upstream. This removes them from the kernel.

Change-Id: I90c33c293f56792131fc6bd490fe041b5798ac20
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This commit is contained in:
Mitchel Humpherys 2012-09-17 14:33:22 -07:00 committed by Stephen Boyd
parent b769cd0cdd
commit fefa905b39
19 changed files with 26 additions and 35 deletions

View file

@ -267,7 +267,7 @@ int adsp_ion_do_cache_op(struct msm_adsp_module *module,
module->name, vaddr, len);
return ret;
}
if ((region->ion_flag == CACHED) && region->handle) {
if ((region->ion_flag == ION_FLAG_CACHED) && region->handle) {
len = ((((len) + 31) & (~31)) + 32);
ret = msm_ion_do_cache_op(region->client, region->handle,
(void *)paddr, len, cmd);

View file

@ -829,7 +829,8 @@ int mpq_dmx_init_video_feed(struct dvb_demux_feed *feed)
ion_alloc(mpq_demux->ion_client,
actual_buffer_size,
SZ_4K,
(ION_HEAP(ION_CP_MM_HEAP_ID) | CACHED), 0);
ION_HEAP(ION_CP_MM_HEAP_ID),
ION_FLAG_CACHED);
if (IS_ERR_OR_NULL(feed_data->payload_buff_handle)) {
ret = PTR_ERR(feed_data->payload_buff_handle);

View file

@ -52,7 +52,7 @@ uint32_t msm_gemini_platform_v2p(int fd, uint32_t len, struct file **file_p,
return 0;
rc = ion_map_iommu(gemini_client, *ionhandle, CAMERA_DOMAIN, GEN_POOL,
SZ_4K, 0, &paddr, (unsigned long *)&size, UNCACHED, 0);
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);

View file

@ -58,7 +58,7 @@ 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, UNCACHED, 0);
(unsigned long *)&size, 0, 0);
#elif CONFIG_ANDROID_PMEM
unsigned long kvstart;
rc = get_pmem_file(fd, &paddr, &kvstart, &size, file_p);

View file

@ -905,7 +905,7 @@ static int __msm_mctl_map_user_frame(struct msm_cam_meta_frame *meta_frame,
meta_frame->map[i].handle);
if (ion_map_iommu(client, meta_frame->map[i].handle,
domain_num, 0, SZ_4K,
0, &paddr, &len, UNCACHED, 0) < 0) {
0, &paddr, &len, 0, 0) < 0) {
pr_err("%s: cannot map address plane %d", __func__, i);
ion_free(client, meta_frame->map[i].handle);
/* Roll back previous plane mappings, if any */

View file

@ -136,7 +136,7 @@ static int msm_pmem_table_add(struct hlist_head *ptype,
if (IS_ERR_OR_NULL(region->handle))
goto out1;
if (ion_map_iommu(client, region->handle, domain_num, 0,
SZ_4K, 0, &paddr, &len, UNCACHED, 0) < 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);

View file

@ -221,7 +221,7 @@ static int msm_stats_buf_prepare(struct msm_stats_bufq_ctrl *stats_ctrl,
}
if (ion_map_iommu(client, stats_buf->handle,
domain_num, 0, SZ_4K,
0, &paddr, &len, UNCACHED, 0) < 0) {
0, &paddr, &len, 0, 0) < 0) {
rc = -EINVAL;
pr_err("%s: cannot map address", __func__);
goto out2;

View file

@ -23,7 +23,7 @@ struct smem_client {
static int get_device_address(struct ion_client *clnt,
struct ion_handle *hndl, int domain_num, int partition_num,
unsigned long align, unsigned long *iova,
unsigned long *buffer_size, unsigned long flags)
unsigned long *buffer_size)
{
int rc;
@ -34,11 +34,10 @@ static int get_device_address(struct ion_client *clnt,
}
if (align < 4096)
align = 4096;
flags |= UNCACHED;
pr_debug("\n In %s domain: %d, Partition: %d\n",
__func__, domain_num, partition_num);
rc = ion_map_iommu(clnt, hndl, domain_num, partition_num, align,
0, iova, buffer_size, flags, 0);
0, iova, buffer_size, 0, 0);
if (rc)
pr_err("ion_map_iommu failed(%d).domain: %d,partition: %d\n",
rc, domain_num, partition_num);
@ -82,7 +81,7 @@ static int ion_user_to_kernel(struct smem_client *client,
mem->domain = domain;
mem->partition_num = partition;
rc = get_device_address(client->clnt, hndl, mem->domain,
mem->partition_num, 4096, &iova, &buffer_size, UNCACHED);
mem->partition_num, 4096, &iova, &buffer_size);
if (rc) {
pr_err("Failed to get device address: %d\n", rc);
goto fail_device_address;
@ -143,7 +142,7 @@ static int alloc_ion_mem(struct smem_client *client, size_t size,
goto fail_map;
}
rc = get_device_address(client->clnt, hndl, mem->domain,
mem->partition_num, align, &iova, &buffer_size, UNCACHED);
mem->partition_num, align, &iova, &buffer_size);
if (rc) {
pr_err("Failed to get device address: %d\n", rc);
goto fail_device_address;

View file

@ -64,7 +64,7 @@ static unsigned long msm_mem_allocate(struct videobuf2_contig_pmem *mem)
rc = ion_map_iommu(mem->client, mem->ion_handle,
-1, 0, SZ_4K, 0,
(unsigned long *)&phyaddr,
(unsigned long *)&len, UNCACHED, 0);
(unsigned long *)&len, 0, 0);
if (rc < 0) {
pr_err("%s Could not get physical address\n", __func__);
goto phys_failed;
@ -192,7 +192,7 @@ int videobuf2_pmem_contig_user_get(struct videobuf2_contig_pmem *mem,
return PTR_ERR(mem->ion_handle);
}
rc = ion_map_iommu(client, mem->ion_handle, domain_num, 0,
SZ_4K, 0, (unsigned long *)&mem->phyaddr, &len, UNCACHED, 0);
SZ_4K, 0, (unsigned long *)&mem->phyaddr, &len, 0, 0);
if (rc < 0)
ion_free(client, mem->ion_handle);
#elif CONFIG_ANDROID_PMEM

View file

@ -278,7 +278,8 @@ u32 ddl_decoder_dpb_init(struct ddl_client_context *ddl)
memset(frame[i].vcd_frm.virtual + luma_size,
0x80808080,
frame[i].vcd_frm.alloc_len - luma_size);
if (frame[i].vcd_frm.ion_flag == CACHED) {
if (frame[i].vcd_frm.ion_flag
== ION_FLAG_CACHED) {
msm_ion_do_cache_op(
ddl_context->video_ion_client,
frame[i].vcd_frm.buff_ion_handle,

View file

@ -45,7 +45,6 @@ void *ddl_pmem_alloc(struct ddl_buf_addr *addr, size_t sz, u32 alignment)
unsigned long iova = 0;
unsigned long buffer_size = 0;
unsigned long *kernel_vaddr = NULL;
unsigned long ionflag = 0;
unsigned long flags = 0;
int ret = 0;
ion_phys_addr_t phyaddr = 0;
@ -77,11 +76,6 @@ void *ddl_pmem_alloc(struct ddl_buf_addr *addr, size_t sz, u32 alignment)
__func__);
goto bail_out;
}
if (res_trk_check_for_sec_session() ||
addr->mem_type == DDL_FW_MEM)
ionflag = UNCACHED;
else
ionflag = CACHED;
kernel_vaddr = (unsigned long *) ion_map_kernel(
ddl_context->video_ion_client,
addr->alloc_handle, ionflag);
@ -111,7 +105,7 @@ void *ddl_pmem_alloc(struct ddl_buf_addr *addr, size_t sz, u32 alignment)
0,
&iova,
&buffer_size,
UNCACHED, 0);
0, 0);
if (ret || !iova) {
DDL_MSG_ERROR(
"%s():DDL ION ion map iommu failed, ret = %d iova = 0x%lx\n",

View file

@ -84,7 +84,7 @@ static void *res_trk_pmem_map
0,
&iova,
&buffer_size,
UNCACHED, 0);
0, 0);
if (ret || !iova) {
DDL_MSG_ERROR(
"%s():DDL ION client iommu map failed, ret = %d iova = 0x%lx\n",

View file

@ -347,7 +347,7 @@ static void vid_dec_output_frame_done(struct video_client_ctx *client_ctx,
ion_flag = vidc_get_fd_info(client_ctx, BUFFER_TYPE_OUTPUT,
pmem_fd, kernel_vaddr, buffer_index,
&buff_handle);
if (ion_flag == CACHED && buff_handle) {
if (ion_flag == ION_FLAG_CACHED && buff_handle) {
DBG("%s: Cache invalidate: vaddr (%p), "\
"size %u\n", __func__,
(void *)kernel_vaddr,
@ -935,7 +935,7 @@ static u32 vid_dec_set_h264_mv_buffers(struct video_client_ctx *client_ctx,
VIDEO_DOMAIN, VIDEO_MAIN_POOL,
SZ_4K, 0, (unsigned long *)&iova,
(unsigned long *)&buffer_size,
UNCACHED, 0);
0, 0);
if (rc || !iova) {
ERR(
"%s():get_ION_kernel physical addr fail, rc = %d iova = 0x%lx\n",
@ -1298,7 +1298,7 @@ static u32 vid_dec_decode_frame(struct video_client_ctx *client_ctx,
kernel_vaddr,
buffer_index,
&buff_handle);
if (ion_flag == CACHED && buff_handle) {
if (ion_flag == ION_FLAG_CACHED && buff_handle) {
msm_ion_do_cache_op(client_ctx->user_ion_client,
buff_handle,
(unsigned long *)kernel_vaddr,

View file

@ -267,7 +267,7 @@ static void vid_enc_output_frame_done(struct video_client_ctx *client_ctx,
ion_flag = vidc_get_fd_info(client_ctx, BUFFER_TYPE_OUTPUT,
pmem_fd, kernel_vaddr, buffer_index,
&buff_handle);
if (ion_flag == CACHED && buff_handle) {
if (ion_flag == ION_FLAG_CACHED && buff_handle) {
msm_ion_do_cache_op(client_ctx->user_ion_client,
buff_handle,
(unsigned long *) kernel_vaddr,

View file

@ -1688,7 +1688,7 @@ u32 vid_enc_encode_frame(struct video_client_ctx *client_ctx,
&buff_handle);
if (vcd_input_buffer.data_len > 0) {
if (ion_flag == CACHED && buff_handle) {
if (ion_flag == ION_FLAG_CACHED && buff_handle) {
msm_ion_do_cache_op(
client_ctx->user_ion_client,
buff_handle,
@ -1867,7 +1867,7 @@ u32 vid_enc_set_recon_buffers(struct video_client_ctx *client_ctx,
0,
(unsigned long *)&iova,
(unsigned long *)&buffer_size,
UNCACHED, 0);
0, 0);
if (rc || !iova) {
ERR(
"%s():ION map iommu addr fail, rc = %d, iova = 0x%lx\n",

View file

@ -678,7 +678,7 @@ u32 vidc_insert_addr_table(struct video_client_ctx *client_ctx,
length,
(unsigned long *) &iova,
(unsigned long *) &buffer_size,
UNCACHED,
0,
ION_IOMMU_UNMAP_DELAYED);
if (ret || !iova) {
ERR(

View file

@ -120,7 +120,7 @@ static int vcd_pmem_alloc(size_t sz, u8 **kernel_vaddr, u8 **phy_addr,
0,
(unsigned long *)&iova,
(unsigned long *)&buffer_size,
UNCACHED, 0);
0, 0);
if (ret || !iova) {
pr_err(
"%s() ION iommu map failed, ret = %d, iova = 0x%lx",

View file

@ -123,9 +123,6 @@ enum cp_mem_usage {
#define ION_QSECOM_HEAP_NAME "qsecom"
#define ION_FMEM_HEAP_NAME "fmem"
#define CACHED 1
#define UNCACHED 0
#define ION_SET_CACHED(__cache) (__cache | ION_FLAG_CACHED)
#define ION_SET_UNCACHED(__cache) (__cache & ~ION_FLAG_CACHED)

View file

@ -1,5 +1,4 @@
/*
* include/linux/ion.h
*
* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
*