Browse Source

msm: eva: Remove warning during buf unmapping

Persistent buffer unmap is different than frame buffer. It's
expected to be released at the end of session instead of at
frame boundary. Remove the warning of "unexpected unmapping".

Change-Id: I24bfae0b67b1a8989e6a710556d94c8bc4e90aff
Signed-off-by: George Shen <sqiao@codeaurora.org>
George Shen 3 years ago
parent
commit
966d521450
2 changed files with 4 additions and 2 deletions
  1. 2 1
      msm/eva/msm_cvp_buf.c
  2. 2 1
      msm/eva/msm_cvp_buf.h

+ 2 - 1
msm/eva/msm_cvp_buf.c

@@ -484,6 +484,7 @@ static u32 msm_cvp_map_user_persist_buf(struct msm_cvp_inst *inst,
 	if (!smem)
 		goto exit;
 
+	smem->flags |= SMEM_PERSIST;
 	pbuf->smem = smem;
 	pbuf->fd = buf->fd;
 	pbuf->size = buf->size;
@@ -819,7 +820,7 @@ int msm_cvp_session_deinit_buffers(struct msm_cvp_inst *inst)
 		smem = inst->dma_cache.entries[i];
 		if (atomic_read(&smem->refcount) == 0) {
 			print_smem(CVP_MEM, "free", inst, smem);
-		} else {
+		} else if (!(smem->flags & SMEM_PERSIST)) {
 			print_smem(CVP_WARN, "in use", inst, smem);
 		}
 		msm_cvp_unmap_smem(inst, smem, "unmap cpu");

+ 2 - 1
msm/eva/msm_cvp_buf.h

@@ -35,7 +35,8 @@ enum smem_prop {
 	SMEM_ADSP = 0x8,
 	SMEM_NON_PIXEL = 0x10,
 	SMEM_PIXEL = 0x20,
-	SMEM_CAMERA = 0x40
+	SMEM_CAMERA = 0x40,
+	SMEM_PERSIST = 0x100,
 };
 
 struct msm_cvp_list {