Loading asoc/msm-pcm-host-voice-v2.c +9 −22 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ struct session { struct tap_point rx_tap_point; phys_addr_t sess_paddr; void *sess_kvaddr; struct ion_handle *ion_handle; struct dma_buf *dma_buf; struct mem_map_table tp_mem_table; }; Loading @@ -145,7 +145,6 @@ struct hpcm_drv { struct mutex lock; struct session session[MAX_SESSION]; struct mixer_conf mixer_conf; struct ion_client *ion_client; struct start_cmd start_cmd; }; Loading Loading @@ -452,19 +451,12 @@ static void hpcm_free_allocated_mem(struct hpcm_drv *prtd) paddr = sess->sess_paddr; if (paddr) { msm_audio_ion_free(prtd->ion_client, sess->ion_handle); prtd->ion_client = NULL; sess->ion_handle = NULL; msm_audio_ion_free(sess->tp_mem_table.client, sess->tp_mem_table.handle); sess->tp_mem_table.client = NULL; sess->tp_mem_table.handle = NULL; msm_audio_ion_free(sess->dma_buf); sess->dma_buf = NULL; msm_audio_ion_free(sess->tp_mem_table.dma_buf); sess->tp_mem_table.dma_buf = NULL; sess->sess_paddr = 0; sess->sess_kvaddr = 0; sess->ion_handle = 0; prtd->ion_client = 0; sess->tp_mem_table.client = 0; sess->tp_mem_table.handle = 0; txtp->capture_dai_data.vocpcm_ion_buffer.paddr = 0; txtp->capture_dai_data.vocpcm_ion_buffer.kvaddr = 0; Loading Loading @@ -531,9 +523,7 @@ static int hpcm_allocate_shared_memory(struct hpcm_drv *prtd) txtp = &sess->tx_tap_point; rxtp = &sess->rx_tap_point; result = msm_audio_ion_alloc("host_pcm_buffer", &prtd->ion_client, &sess->ion_handle, result = msm_audio_ion_alloc(&sess->dma_buf, VHPCM_BLOCK_SIZE, &sess->sess_paddr, &mem_len, Loading @@ -549,9 +539,7 @@ static int hpcm_allocate_shared_memory(struct hpcm_drv *prtd) pr_debug("%s: Host PCM memory block allocated\n", __func__); /* Allocate mem_map_table for tap point */ result = msm_audio_ion_alloc("host_pcm_table", &sess->tp_mem_table.client, &sess->tp_mem_table.handle, result = msm_audio_ion_alloc(&sess->tp_mem_table.dma_buf, sizeof(struct vss_imemory_table_t), &sess->tp_mem_table.phys, &len, Loading @@ -560,9 +548,8 @@ static int hpcm_allocate_shared_memory(struct hpcm_drv *prtd) if (result) { pr_err("%s: msm_audio_ion_alloc error, rc = %d\n", __func__, result); msm_audio_ion_free(prtd->ion_client, sess->ion_handle); prtd->ion_client = NULL; sess->ion_handle = NULL; msm_audio_ion_free(sess->dma_buf); sess->dma_buf = NULL; sess->sess_paddr = 0; sess->sess_kvaddr = 0; ret = -ENOMEM; Loading asoc/msm-pcm-q6-noirq.c +8 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <linux/slab.h> #include <linux/of_device.h> #include <linux/dma-mapping.h> #include <linux/dma-buf.h> #include <sound/core.h> #include <sound/soc.h> Loading Loading @@ -451,7 +452,13 @@ static int msm_pcm_mmap_fd(struct snd_pcm_substream *substream, apd = prtd->audio_client->port; ab = &(apd[dir].buf[0]); mmap_fd->fd = ion_share_dma_buf_fd(ab->client, ab->handle); /* * Passing O_CLOEXEC as flag passed to fd, to be in sync with * previous implimentation. * This was the flag used by previous internal wrapper API, which * used to call dma_buf_fd internally. */ mmap_fd->fd = dma_buf_fd(ab->dma_buf, O_CLOEXEC); if (mmap_fd->fd >= 0) { mmap_fd->dir = dir; mmap_fd->actual_size = ab->actual_size; Loading dsp/audio_cal_utils.c +7 −13 Original line number Diff line number Diff line /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -442,11 +442,9 @@ static void delete_cal_block(struct cal_block_data *cal_block) cal_block->client_info = NULL; kfree(cal_block->cal_info); cal_block->cal_info = NULL; if (cal_block->map_data.ion_client != NULL) { msm_audio_ion_free(cal_block->map_data.ion_client, cal_block->map_data.ion_handle); cal_block->map_data.ion_client = NULL; cal_block->map_data.ion_handle = NULL; if (cal_block->map_data.dma_buf != NULL) { msm_audio_ion_free(cal_block->map_data.dma_buf); cal_block->map_data.dma_buf = NULL; } kfree(cal_block); done: Loading Loading @@ -604,9 +602,7 @@ static int cal_block_ion_alloc(struct cal_block_data *cal_block) goto done; } ret = msm_audio_ion_import("audio_cal_client", &cal_block->map_data.ion_client, &cal_block->map_data.ion_handle, ret = msm_audio_ion_import(&cal_block->map_data.dma_buf, cal_block->map_data.ion_map_handle, NULL, 0, &cal_block->cal_data.paddr, Loading Loading @@ -736,10 +732,8 @@ static int realloc_memory(struct cal_block_data *cal_block) { int ret = 0; msm_audio_ion_free(cal_block->map_data.ion_client, cal_block->map_data.ion_handle); cal_block->map_data.ion_client = NULL; cal_block->map_data.ion_handle = NULL; msm_audio_ion_free(cal_block->map_data.dma_buf); cal_block->map_data.dma_buf = NULL; cal_block->cal_data.size = 0; ret = cal_block_ion_alloc(cal_block); Loading dsp/codecs/audio_utils_aio.c +9 −22 Original line number Diff line number Diff line /* Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2009-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2009-2018, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and Loading Loading @@ -420,7 +420,7 @@ void audio_aio_reset_ion_region(struct q6audio_aio *audio) list_for_each_safe(ptr, next, &audio->ion_region_queue) { region = list_entry(ptr, struct audio_aio_ion_region, list); list_del(®ion->list); msm_audio_ion_free_legacy(audio->client, region->handle); msm_audio_ion_free(region->dma_buf); kfree(region); } } Loading Loading @@ -614,7 +614,6 @@ int audio_aio_release(struct inode *inode, struct file *file) audio_aio_disable(audio); audio_aio_unmap_ion_region(audio); audio_aio_reset_ion_region(audio); msm_audio_ion_client_destroy(audio->client); audio->event_abort = 1; wake_up(&audio->event_wait); audio_aio_reset_event_queue(audio); Loading Loading @@ -960,11 +959,11 @@ static int audio_aio_ion_check(struct q6audio_aio *audio, static int audio_aio_ion_add(struct q6audio_aio *audio, struct msm_audio_ion_info *info) { ion_phys_addr_t paddr = 0; dma_addr_t paddr = 0; size_t len = 0; struct audio_aio_ion_region *region; int rc = -EINVAL; struct ion_handle *handle = NULL; struct dma_buf *dma_buf = NULL; unsigned long ionflag; void *kvaddr = NULL; Loading @@ -976,8 +975,7 @@ static int audio_aio_ion_add(struct q6audio_aio *audio, goto end; } rc = msm_audio_ion_import_legacy("Audio_Dec_Client", audio->client, &handle, info->fd, &ionflag, rc = msm_audio_ion_import(&dma_buf, info->fd, &ionflag, 0, &paddr, &len, &kvaddr); if (rc) { pr_err("%s: msm audio ion alloc failed\n", __func__); Loading @@ -990,7 +988,7 @@ static int audio_aio_ion_add(struct q6audio_aio *audio, goto ion_error; } region->handle = handle; region->dma_buf = dma_buf; region->vaddr = info->vaddr; region->fd = info->fd; region->paddr = paddr; Loading @@ -1012,7 +1010,7 @@ static int audio_aio_ion_add(struct q6audio_aio *audio, mmap_error: list_del(®ion->list); ion_error: msm_audio_ion_free_legacy(audio->client, handle); msm_audio_ion_free(dma_buf); import_error: kfree(region); end: Loading Loading @@ -1049,8 +1047,7 @@ static int audio_aio_ion_remove(struct q6audio_aio *audio, __func__, audio); list_del(®ion->list); msm_audio_ion_free_legacy(audio->client, region->handle); msm_audio_ion_free(region->dma_buf); kfree(region); rc = 0; break; Loading Loading @@ -1378,22 +1375,12 @@ int audio_aio_open(struct q6audio_aio *audio, struct file *file) goto cleanup; } } audio->client = msm_audio_ion_client_create("Audio_Dec_Client"); if (IS_ERR_OR_NULL(audio->client)) { pr_err("Unable to create ION client\n"); rc = -ENOMEM; goto cleanup; } pr_debug("Ion client create in audio_aio_open %pK", audio->client); rc = register_volume_listener(audio); if (rc < 0) goto ion_cleanup; goto cleanup; return 0; ion_cleanup: msm_audio_ion_client_destroy(audio->client); audio->client = NULL; cleanup: list_for_each_safe(ptr, next, &audio->free_event_queue) { e_node = list_first_entry(&audio->free_event_queue, Loading dsp/codecs/audio_utils_aio.h +2 −3 Original line number Diff line number Diff line /* Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2009-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2009-2018, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and Loading Loading @@ -119,7 +119,7 @@ struct ws_mgr { struct audio_aio_ion_region { struct list_head list; struct ion_handle *handle; struct dma_buf *dma_buf; int fd; void *vaddr; phys_addr_t paddr; Loading Loading @@ -182,7 +182,6 @@ struct q6audio_aio { struct list_head free_event_queue; struct list_head event_queue; struct list_head ion_region_queue; /* protected by lock */ struct ion_client *client; struct audio_aio_drv_operations drv_ops; union msm_audio_event_payload eos_write_payload; uint32_t device_events; Loading Loading
asoc/msm-pcm-host-voice-v2.c +9 −22 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ struct session { struct tap_point rx_tap_point; phys_addr_t sess_paddr; void *sess_kvaddr; struct ion_handle *ion_handle; struct dma_buf *dma_buf; struct mem_map_table tp_mem_table; }; Loading @@ -145,7 +145,6 @@ struct hpcm_drv { struct mutex lock; struct session session[MAX_SESSION]; struct mixer_conf mixer_conf; struct ion_client *ion_client; struct start_cmd start_cmd; }; Loading Loading @@ -452,19 +451,12 @@ static void hpcm_free_allocated_mem(struct hpcm_drv *prtd) paddr = sess->sess_paddr; if (paddr) { msm_audio_ion_free(prtd->ion_client, sess->ion_handle); prtd->ion_client = NULL; sess->ion_handle = NULL; msm_audio_ion_free(sess->tp_mem_table.client, sess->tp_mem_table.handle); sess->tp_mem_table.client = NULL; sess->tp_mem_table.handle = NULL; msm_audio_ion_free(sess->dma_buf); sess->dma_buf = NULL; msm_audio_ion_free(sess->tp_mem_table.dma_buf); sess->tp_mem_table.dma_buf = NULL; sess->sess_paddr = 0; sess->sess_kvaddr = 0; sess->ion_handle = 0; prtd->ion_client = 0; sess->tp_mem_table.client = 0; sess->tp_mem_table.handle = 0; txtp->capture_dai_data.vocpcm_ion_buffer.paddr = 0; txtp->capture_dai_data.vocpcm_ion_buffer.kvaddr = 0; Loading Loading @@ -531,9 +523,7 @@ static int hpcm_allocate_shared_memory(struct hpcm_drv *prtd) txtp = &sess->tx_tap_point; rxtp = &sess->rx_tap_point; result = msm_audio_ion_alloc("host_pcm_buffer", &prtd->ion_client, &sess->ion_handle, result = msm_audio_ion_alloc(&sess->dma_buf, VHPCM_BLOCK_SIZE, &sess->sess_paddr, &mem_len, Loading @@ -549,9 +539,7 @@ static int hpcm_allocate_shared_memory(struct hpcm_drv *prtd) pr_debug("%s: Host PCM memory block allocated\n", __func__); /* Allocate mem_map_table for tap point */ result = msm_audio_ion_alloc("host_pcm_table", &sess->tp_mem_table.client, &sess->tp_mem_table.handle, result = msm_audio_ion_alloc(&sess->tp_mem_table.dma_buf, sizeof(struct vss_imemory_table_t), &sess->tp_mem_table.phys, &len, Loading @@ -560,9 +548,8 @@ static int hpcm_allocate_shared_memory(struct hpcm_drv *prtd) if (result) { pr_err("%s: msm_audio_ion_alloc error, rc = %d\n", __func__, result); msm_audio_ion_free(prtd->ion_client, sess->ion_handle); prtd->ion_client = NULL; sess->ion_handle = NULL; msm_audio_ion_free(sess->dma_buf); sess->dma_buf = NULL; sess->sess_paddr = 0; sess->sess_kvaddr = 0; ret = -ENOMEM; Loading
asoc/msm-pcm-q6-noirq.c +8 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <linux/slab.h> #include <linux/of_device.h> #include <linux/dma-mapping.h> #include <linux/dma-buf.h> #include <sound/core.h> #include <sound/soc.h> Loading Loading @@ -451,7 +452,13 @@ static int msm_pcm_mmap_fd(struct snd_pcm_substream *substream, apd = prtd->audio_client->port; ab = &(apd[dir].buf[0]); mmap_fd->fd = ion_share_dma_buf_fd(ab->client, ab->handle); /* * Passing O_CLOEXEC as flag passed to fd, to be in sync with * previous implimentation. * This was the flag used by previous internal wrapper API, which * used to call dma_buf_fd internally. */ mmap_fd->fd = dma_buf_fd(ab->dma_buf, O_CLOEXEC); if (mmap_fd->fd >= 0) { mmap_fd->dir = dir; mmap_fd->actual_size = ab->actual_size; Loading
dsp/audio_cal_utils.c +7 −13 Original line number Diff line number Diff line /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -442,11 +442,9 @@ static void delete_cal_block(struct cal_block_data *cal_block) cal_block->client_info = NULL; kfree(cal_block->cal_info); cal_block->cal_info = NULL; if (cal_block->map_data.ion_client != NULL) { msm_audio_ion_free(cal_block->map_data.ion_client, cal_block->map_data.ion_handle); cal_block->map_data.ion_client = NULL; cal_block->map_data.ion_handle = NULL; if (cal_block->map_data.dma_buf != NULL) { msm_audio_ion_free(cal_block->map_data.dma_buf); cal_block->map_data.dma_buf = NULL; } kfree(cal_block); done: Loading Loading @@ -604,9 +602,7 @@ static int cal_block_ion_alloc(struct cal_block_data *cal_block) goto done; } ret = msm_audio_ion_import("audio_cal_client", &cal_block->map_data.ion_client, &cal_block->map_data.ion_handle, ret = msm_audio_ion_import(&cal_block->map_data.dma_buf, cal_block->map_data.ion_map_handle, NULL, 0, &cal_block->cal_data.paddr, Loading Loading @@ -736,10 +732,8 @@ static int realloc_memory(struct cal_block_data *cal_block) { int ret = 0; msm_audio_ion_free(cal_block->map_data.ion_client, cal_block->map_data.ion_handle); cal_block->map_data.ion_client = NULL; cal_block->map_data.ion_handle = NULL; msm_audio_ion_free(cal_block->map_data.dma_buf); cal_block->map_data.dma_buf = NULL; cal_block->cal_data.size = 0; ret = cal_block_ion_alloc(cal_block); Loading
dsp/codecs/audio_utils_aio.c +9 −22 Original line number Diff line number Diff line /* Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2009-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2009-2018, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and Loading Loading @@ -420,7 +420,7 @@ void audio_aio_reset_ion_region(struct q6audio_aio *audio) list_for_each_safe(ptr, next, &audio->ion_region_queue) { region = list_entry(ptr, struct audio_aio_ion_region, list); list_del(®ion->list); msm_audio_ion_free_legacy(audio->client, region->handle); msm_audio_ion_free(region->dma_buf); kfree(region); } } Loading Loading @@ -614,7 +614,6 @@ int audio_aio_release(struct inode *inode, struct file *file) audio_aio_disable(audio); audio_aio_unmap_ion_region(audio); audio_aio_reset_ion_region(audio); msm_audio_ion_client_destroy(audio->client); audio->event_abort = 1; wake_up(&audio->event_wait); audio_aio_reset_event_queue(audio); Loading Loading @@ -960,11 +959,11 @@ static int audio_aio_ion_check(struct q6audio_aio *audio, static int audio_aio_ion_add(struct q6audio_aio *audio, struct msm_audio_ion_info *info) { ion_phys_addr_t paddr = 0; dma_addr_t paddr = 0; size_t len = 0; struct audio_aio_ion_region *region; int rc = -EINVAL; struct ion_handle *handle = NULL; struct dma_buf *dma_buf = NULL; unsigned long ionflag; void *kvaddr = NULL; Loading @@ -976,8 +975,7 @@ static int audio_aio_ion_add(struct q6audio_aio *audio, goto end; } rc = msm_audio_ion_import_legacy("Audio_Dec_Client", audio->client, &handle, info->fd, &ionflag, rc = msm_audio_ion_import(&dma_buf, info->fd, &ionflag, 0, &paddr, &len, &kvaddr); if (rc) { pr_err("%s: msm audio ion alloc failed\n", __func__); Loading @@ -990,7 +988,7 @@ static int audio_aio_ion_add(struct q6audio_aio *audio, goto ion_error; } region->handle = handle; region->dma_buf = dma_buf; region->vaddr = info->vaddr; region->fd = info->fd; region->paddr = paddr; Loading @@ -1012,7 +1010,7 @@ static int audio_aio_ion_add(struct q6audio_aio *audio, mmap_error: list_del(®ion->list); ion_error: msm_audio_ion_free_legacy(audio->client, handle); msm_audio_ion_free(dma_buf); import_error: kfree(region); end: Loading Loading @@ -1049,8 +1047,7 @@ static int audio_aio_ion_remove(struct q6audio_aio *audio, __func__, audio); list_del(®ion->list); msm_audio_ion_free_legacy(audio->client, region->handle); msm_audio_ion_free(region->dma_buf); kfree(region); rc = 0; break; Loading Loading @@ -1378,22 +1375,12 @@ int audio_aio_open(struct q6audio_aio *audio, struct file *file) goto cleanup; } } audio->client = msm_audio_ion_client_create("Audio_Dec_Client"); if (IS_ERR_OR_NULL(audio->client)) { pr_err("Unable to create ION client\n"); rc = -ENOMEM; goto cleanup; } pr_debug("Ion client create in audio_aio_open %pK", audio->client); rc = register_volume_listener(audio); if (rc < 0) goto ion_cleanup; goto cleanup; return 0; ion_cleanup: msm_audio_ion_client_destroy(audio->client); audio->client = NULL; cleanup: list_for_each_safe(ptr, next, &audio->free_event_queue) { e_node = list_first_entry(&audio->free_event_queue, Loading
dsp/codecs/audio_utils_aio.h +2 −3 Original line number Diff line number Diff line /* Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2009-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2009-2018, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and Loading Loading @@ -119,7 +119,7 @@ struct ws_mgr { struct audio_aio_ion_region { struct list_head list; struct ion_handle *handle; struct dma_buf *dma_buf; int fd; void *vaddr; phys_addr_t paddr; Loading Loading @@ -182,7 +182,6 @@ struct q6audio_aio { struct list_head free_event_queue; struct list_head event_queue; struct list_head ion_region_queue; /* protected by lock */ struct ion_client *client; struct audio_aio_drv_operations drv_ops; union msm_audio_event_payload eos_write_payload; uint32_t device_events; Loading