mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
msm: adsprpc: Adding inrout buffer cache maintenance support
Adding inrout buffer CMO support with new cache flush logic involving offsets and overlaps. Acked-by: Deepika Singh <dsi@qti.qualcomm.com> Change-Id: I1e5ac1e3c52c80d40b6c3a0c9207e7a73d06bf65 Signed-off-by: Mohammed Nayeem Ur Rahman <mohara@codeaurora.org>
This commit is contained in:
parent
3a82802e7b
commit
2973e84157
1 changed files with 13 additions and 7 deletions
|
|
@ -273,6 +273,7 @@ struct overlap {
|
|||
uintptr_t mstart;
|
||||
uintptr_t mend;
|
||||
uintptr_t offset;
|
||||
int do_cmo; /*used for cache maintenance of inrout buffers*/
|
||||
};
|
||||
|
||||
struct smq_invoke_ctx {
|
||||
|
|
@ -1318,6 +1319,9 @@ static int context_build_overlap(struct smq_invoke_ctx *ctx)
|
|||
if (ctx->overps[i]->end > max.end) {
|
||||
max.end = ctx->overps[i]->end;
|
||||
} else {
|
||||
if (max.raix + 1 <= inbufs &&
|
||||
ctx->overps[i]->raix + 1 > inbufs)
|
||||
ctx->overps[i]->do_cmo = 1;
|
||||
ctx->overps[i]->mend = 0;
|
||||
ctx->overps[i]->mstart = 0;
|
||||
}
|
||||
|
|
@ -1966,11 +1970,12 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx)
|
|||
if (map && (map->attr & FASTRPC_ATTR_FORCE_NOFLUSH))
|
||||
continue;
|
||||
|
||||
if (rpra && rpra[i].buf.len &&
|
||||
ctx->overps[oix]->mstart) {
|
||||
if (rpra && rpra[i].buf.len && (ctx->overps[oix]->mstart ||
|
||||
ctx->overps[oix]->do_cmo == 1)) {
|
||||
if (map && map->buf) {
|
||||
if ((buf_page_size(ctx->overps[oix]->mend -
|
||||
ctx->overps[oix]->mstart)) == map->size) {
|
||||
if (((buf_page_size(ctx->overps[oix]->mend -
|
||||
ctx->overps[oix]->mstart)) == map->size) ||
|
||||
ctx->overps[oix]->do_cmo) {
|
||||
dma_buf_begin_cpu_access(map->buf,
|
||||
DMA_TO_DEVICE);
|
||||
dma_buf_end_cpu_access(map->buf,
|
||||
|
|
@ -2105,10 +2110,11 @@ static void inv_args(struct smq_invoke_ctx *ctx)
|
|||
buf_page_start(rpra[over].buf.pv)) {
|
||||
continue;
|
||||
}
|
||||
if (ctx->overps[i]->mstart) {
|
||||
if (ctx->overps[i]->mstart || ctx->overps[i]->do_cmo == 1) {
|
||||
if (map && map->buf) {
|
||||
if ((buf_page_size(ctx->overps[i]->mend -
|
||||
ctx->overps[i]->mstart)) == map->size) {
|
||||
if (((buf_page_size(ctx->overps[i]->mend -
|
||||
ctx->overps[i]->mstart)) == map->size) ||
|
||||
ctx->overps[i]->do_cmo) {
|
||||
dma_buf_begin_cpu_access(map->buf,
|
||||
DMA_TO_DEVICE);
|
||||
dma_buf_end_cpu_access(map->buf,
|
||||
|
|
|
|||
Loading…
Reference in a new issue