mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
dsp: unmap cma memory before hyp unassign during adm close
unmap memory before hyp unassign during adm close for handset/speaker FNN usecase. Change-Id: I1d4d335c5179e42af4dcf7cf8e82e48669b32830 Signed-off-by: Akhil Karuturi <akarutur@codeaurora.org>
This commit is contained in:
parent
dec796e30a
commit
62eca6d27b
1 changed files with 25 additions and 0 deletions
25
dsp/q6adm.c
25
dsp/q6adm.c
|
|
@ -4005,6 +4005,20 @@ int adm_close(int port_id, int perf_mode, int copp_idx)
|
|||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
/**
|
||||
* call unmap CMA before hyp unassign during
|
||||
* end of handset/speaker usecase.
|
||||
*/
|
||||
if (cal_block->map_data.q6map_handle != 0) {
|
||||
atomic_set(&this_adm.mem_map_handles[cal_index],
|
||||
cal_block->map_data.q6map_handle);
|
||||
atomic_set(&this_adm.mem_map_index, cal_index);
|
||||
ret = adm_memory_unmap_regions();
|
||||
if (ret < 0)
|
||||
pr_err("%s: unmap did not work! cal_type %i ret %d\n",
|
||||
__func__, cal_index, ret);
|
||||
cal_block->map_data.q6map_handle = 0;
|
||||
}
|
||||
ret = hyp_assign_phys(
|
||||
cal_block->cal_data.paddr,
|
||||
cal_block->map_data.map_size,
|
||||
|
|
@ -4076,6 +4090,17 @@ int adm_close(int port_id, int perf_mode, int copp_idx)
|
|||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
/* call unmap CMA before hyp unassign during end of handset/speaker usecase */
|
||||
if (cal_block->map_data.q6map_handle != 0) {
|
||||
atomic_set(&this_adm.mem_map_handles[cal_index],
|
||||
cal_block->map_data.q6map_handle);
|
||||
atomic_set(&this_adm.mem_map_index, cal_index);
|
||||
ret = adm_memory_unmap_regions();
|
||||
if (ret < 0)
|
||||
pr_err("%s: unmap did not work! cal_type %i ret %d\n",
|
||||
__func__, cal_index, ret);
|
||||
cal_block->map_data.q6map_handle = 0;
|
||||
}
|
||||
ret = hyp_assign_phys(cal_block->cal_data.paddr,
|
||||
cal_block->map_data.map_size,
|
||||
source_vm, 2, dest_vm,
|
||||
|
|
|
|||
Loading…
Reference in a new issue