Procházet zdrojové kódy

msm: eva: Add LE support

Define CONFIG_EVA_LE compiler flag.
Add separate VM support module.
Define stub functions to initialize synx function table in case
SYNX is disabled.

Change-Id: I0f6b28cbd2a43cbb7f464629a329581a73c4de89
Signed-off-by: George Shen <[email protected]>
George Shen před 3 roky
rodič
revize
6492155ccc

+ 6 - 1
msm/Kbuild

@@ -28,6 +28,10 @@ KBUILD_CPPFLAGS += -DCONFIG_EVA_KALAMA=1
 ccflags-y += -DCONFIG_EVA_KALAMA=1
 endif
 
+ifeq ($(CONFIG_EVA_LE), 1)
+ccflags-y += -DCONFIG_EVA_LE=1
+endif
+
 msm-eva-objs := eva/cvp.o \
         eva/msm_cvp_ioctl.o \
         eva/msm_cvp_platform.o \
@@ -46,6 +50,7 @@ msm-eva-objs := eva/cvp.o \
         eva/msm_cvp_dsp.o \
         eva/msm_cvp_buf.o \
         eva/msm_cvp_synx.o \
-		eva/cvp_fw_load.o
+	eva/cvp_fw_load.o \
+	eva/msm_cvp_vm.o
 obj-m += msm-eva.o
 

+ 7 - 0
msm/eva/cvp_comm_def.h

@@ -23,11 +23,18 @@ enum queue_state {
 	QUEUE_INVALID,
 };
 
+#ifdef CONFIG_EVA_LE
+
+#else	/* LA target starts here */
+
 #define CVP_SYNX_ENABLED 1
 #define CVP_MMRM_ENABLED 1
 #define CVP_FASTRPC_ENABLED 1
+
 #ifdef CONFIG_EVA_WAIPIO
 #define CVP_MINIDUMP_ENABLED 1
 #endif
 
+#endif	/* End CONFIG_EVA_LE */
+
 #endif

+ 3 - 1
msm/eva/msm_cvp_buf.c

@@ -1104,7 +1104,9 @@ static int msm_cvp_session_add_smem(struct msm_cvp_inst *inst,
 			smem->bitmap_index = i;
 			SET_USE_BITMAP(i, inst);
 		} else {
-			dprintk(CVP_WARN, "%s: not enough memory\n", __func__);
+			dprintk(CVP_WARN,
+			"%s: reached limit, fallback to frame mapping list\n"
+			, __func__);
 			mutex_unlock(&inst->dma_cache.lock);
 			return -ENOMEM;
 		}

+ 43 - 2
msm/eva/msm_cvp_synx.c

@@ -68,7 +68,8 @@ static void cvp_dump_fence_queue_v1(struct msm_cvp_inst *inst)
 	mutex_unlock(&q->lock);
 }
 
-static int cvp_import_synx_v1(struct msm_cvp_inst *inst, struct cvp_fence_command *fc,
+static int cvp_import_synx_v1(struct msm_cvp_inst *inst,
+		struct cvp_fence_command *fc,
 		u32 *fence)
 {
 	int rc = 0, rr = 0;
@@ -107,7 +108,8 @@ static int cvp_import_synx_v1(struct msm_cvp_inst *inst, struct cvp_fence_comman
 	return rr;
 }
 
-static int cvp_release_synx_v1(struct msm_cvp_inst *inst, struct cvp_fence_command *fc)
+static int cvp_release_synx_v1(struct msm_cvp_inst *inst,
+		struct cvp_fence_command *fc)
 {
 	int rc = 0;
 	int i;
@@ -266,6 +268,45 @@ static int cvp_synx_ops_v1(struct msm_cvp_inst *inst, enum cvp_synx_type type,
 		return -EINVAL;
 	}
 }
+#else
+static int cvp_sess_init_synx_v1(struct msm_cvp_inst *inst)
+{
+	return 0;
+}
+
+static int cvp_sess_deinit_synx(struct msm_cvp_inst *inst)
+{
+	return 0;
+}
+
+static int cvp_release_synx_v1(struct msm_cvp_inst *inst,
+		struct cvp_fence_command *fc)
+{
+	return 0;
+}
+
+static int cvp_import_synx_v1(struct msm_cvp_inst *inst,
+		struct cvp_fence_command *fc,
+		u32 *fence)
+{
+	return 0;
+}
+
+static int cvp_synx_ops_v1(struct msm_cvp_inst *inst, enum cvp_synx_type type,
+		struct cvp_fence_command *fc, u32 *synx_state)
+{
+	return 0;
+}
+
+static int cvp_cancel_synx(struct msm_cvp_inst *inst, enum cvp_synx_type type,
+		struct cvp_fence_command *fc, int synx_state)
+{
+	return 0;
+}
+
+static void cvp_dump_fence_queue_v1(struct msm_cvp_inst *inst)
+{
+}
 #endif
 
 struct msm_cvp_synx_ops cvp_synx_v1 = {

+ 13 - 0
msm/eva/msm_cvp_vm.c

@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only
+ *
+ * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#include "msm_cvp_vm.h"
+
+int msm_cvp_vm_init(struct msm_cvp_core *core)
+{
+	return 0;
+}
+
+

+ 16 - 0
msm/eva/msm_cvp_vm.h

@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only
+ *
+ * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#ifndef _MSM_CVP_VM_H_
+#define _MSM_CVP_VM_H_
+
+#include <linux/types.h>
+#include "cvp_comm_def.h"
+#include "msm_cvp_core.h"
+#include "msm_cvp_internal.h"
+
+int msm_cvp_vm_init(struct msm_cvp_core *core);
+
+#endif