Преглед изворни кода

msm: eva: handle SoC fencing returning MSG

Needs to unmap frame buffer and avoid enqueue the MSG
in session queue. In SoC fencing cases, session queue
will not be drained by UMD. It can lead to session
stop error.

Change-Id: I980689ae16286712df704f94385ca0ccfc64488a
Signed-off-by: George Shen <[email protected]>
George Shen пре 2 година
родитељ
комит
991c1ebc43
2 измењених фајлова са 24 додато и 4 уклоњено
  1. 21 4
      msm/eva/msm_cvp.c
  2. 3 0
      msm/eva/msm_cvp_synx.c

+ 21 - 4
msm/eva/msm_cvp.c

@@ -591,9 +591,6 @@ static int cvp_populate_fences( struct eva_kmd_hfi_packet *in_pkt,
 		goto exit;
 	}
 
-	if (!cvp_kernel_fence_enabled)
-		goto exit;
-
 	cmd_hdr = (struct cvp_hfi_cmd_session_hdr *)in_pkt;
 	rc = cvp_alloc_fence_data((&f), cmd_hdr->size);
 	if (rc)
@@ -603,9 +600,28 @@ static int cvp_populate_fences( struct eva_kmd_hfi_packet *in_pkt,
 	f->mode = OP_NORMAL;
 	f->signature = 0xFEEDFACE;
 	f->num_fences = 0;
+	f->output_index = 0;
+	buf_offset = offset;
+
+	if (!cvp_kernel_fence_enabled) {
+		for (i = 0; i < num; i++) {
+			buf = (struct cvp_buf_type *)&in_pkt->pkt_data[buf_offset];
+			buf_offset += sizeof(*buf) >> 2;
+
+			if (buf->input_handle || buf->output_handle) {
+				f->num_fences++;
+				if (buf->input_handle)
+					f->output_index++;
+			}
+		}
+		f->signature = 0xB0BABABE;
+		if (f->num_fences)
+			goto fence_cmd_queue;
+
+		goto free_exit;
+	}
 
 	/* First pass to find INPUT synx handles */
-	buf_offset = offset;
 	for (i = 0; i < num; i++) {
 		buf = (struct cvp_buf_type *)&in_pkt->pkt_data[buf_offset];
 		buf_offset += sizeof(*buf) >> 2;
@@ -652,6 +668,7 @@ static int cvp_populate_fences( struct eva_kmd_hfi_packet *in_pkt,
 	if (rc)
 			goto free_exit;
 
+fence_cmd_queue:
 	memcpy(f->pkt, cmd_hdr, cmd_hdr->size);
 	f->pkt->client_data.kdata |= FENCE_BIT;
 

+ 3 - 0
msm/eva/msm_cvp_synx.c

@@ -254,6 +254,9 @@ static int cvp_synx_ops_v2(struct msm_cvp_inst *inst, enum cvp_synx_type type,
 {
 	struct synx_session *ssid;
 
+	if (fc->signature == 0xB0BABABE)
+		return 0;
+
 	ssid = inst->synx_session_id;
 
 	if (type == CVP_INPUT_SYNX) {