Explorar o código

video: driver: Move all strict check into msm_vidc_driver

Move all __strict_check functions to msm_vidc_driver.

Change-Id: I74f3017f96f1426773698c1b44bca7b6d30df216
Signed-off-by: Vedang Nagar <[email protected]>
Vedang Nagar %!s(int64=2) %!d(string=hai) anos
pai
achega
6712a694be

+ 1 - 17
driver/variant/common/src/msm_vidc_variant.c

@@ -13,23 +13,7 @@
 #include "msm_vidc_debug.h"
 #include "msm_vidc_variant.h"
 #include "msm_vidc_platform.h"
-
-static void __fatal_error(bool fatal)
-{
-	WARN_ON(fatal);
-}
-
-static int __strict_check(struct msm_vidc_core *core, const char *function)
-{
-	bool fatal = !mutex_is_locked(&core->lock);
-
-	__fatal_error(fatal);
-
-	if (fatal)
-		d_vpr_e("%s: strict check failed\n", function);
-
-	return fatal ? -EINVAL : 0;
-}
+#include "venus_hfi.h"
 
 int __write_register(struct msm_vidc_core *core, u32 reg, u32 value)
 {

+ 2 - 0
driver/vidc/inc/venus_hfi.h

@@ -33,6 +33,8 @@ struct hfi_pending_packet {
 	void                  *data;
 };
 
+int __strict_check(struct msm_vidc_core *core,
+	const char *function);
 int venus_hfi_session_property(struct msm_vidc_inst *inst,
 	u32 pkt_type, u32 flags, u32 port,
 	u32 payload_type, void *payload, u32 payload_size);

+ 0 - 17
driver/vidc/src/msm_vidc_driver.c

@@ -224,23 +224,6 @@ static void print_buffer_stats(u32 tag, const char *tag_str, struct msm_vidc_ins
 		stats->data_size, stats->flags);
 }
 
-static void __fatal_error(bool fatal)
-{
-	WARN_ON(fatal);
-}
-
-static int __strict_check(struct msm_vidc_core *core, const char *function)
-{
-	bool fatal = !mutex_is_locked(&core->lock);
-
-	__fatal_error(fatal);
-
-	if (fatal)
-		d_vpr_e("%s: strict check failed\n", function);
-
-	return fatal ? -EINVAL : 0;
-}
-
 static u32 msm_vidc_get_buffer_stats_flag(struct msm_vidc_inst *inst)
 {
 	u32 flags = 0;

+ 1 - 12
driver/vidc/src/msm_vidc_state.c

@@ -12,6 +12,7 @@
 #include "msm_vidc_vb2.h"
 #include "msm_vidc.h"
 #include "msm_vidc_events.h"
+#include "venus_hfi.h"
 
 bool core_in_valid_state(struct msm_vidc_core *core)
 {
@@ -68,18 +69,6 @@ exit:
 	return name;
 }
 
-static int __strict_check(struct msm_vidc_core *core, const char *function)
-{
-	bool fatal = !mutex_is_locked(&core->lock);
-
-	WARN_ON(fatal);
-
-	if (fatal)
-		d_vpr_e("%s: strict check failed\n", function);
-
-	return fatal ? -EINVAL : 0;
-}
-
 static int __strict_inst_check(struct msm_vidc_inst *inst, const char *function)
 {
 	bool fatal = !mutex_is_locked(&inst->lock);

+ 1 - 1
driver/vidc/src/venus_hfi.c

@@ -48,7 +48,7 @@ static void __fatal_error(bool fatal)
 	WARN_ON(fatal);
 }
 
-static int __strict_check(struct msm_vidc_core *core, const char *function)
+int __strict_check(struct msm_vidc_core *core, const char *function)
 {
 	bool fatal = !mutex_is_locked(&core->lock);
 

+ 0 - 12
driver/vidc/src/venus_hfi_queue.c

@@ -11,18 +11,6 @@
 #include "msm_vidc_platform.h"
 #include "venus_hfi.h"
 
-static int __strict_check(struct msm_vidc_core *core, const char *function)
-{
-	bool fatal = !mutex_is_locked(&core->lock);
-
-	WARN_ON(fatal);
-
-	if (fatal)
-		d_vpr_e("%s: strict check failed\n", function);
-
-	return fatal ? -EINVAL : 0;
-}
-
 static void __set_queue_hdr_defaults(struct hfi_queue_header *q_hdr)
 {
 	q_hdr->qhdr_status = 0x1;