ppmgr: use light reg for video decoder local reset [1/1]
authorHui Zhang <hui.zhang@amlogic.com>
Fri, 1 Mar 2019 01:02:26 +0000 (09:02 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 4 Mar 2019 06:29:00 +0000 (22:29 -0800)
PD#SWPL-5014

Problem:
ppmgr provider error sometimes in long time run under poor signal

Solution:
use light reg for video decoder local reset

Verify:
X301

Change-Id: I1500c9ddfdce76b3e9cb2b24a35cdee765f82d5f
Signed-off-by: Hui Zhang <hui.zhang@amlogic.com>
drivers/amlogic/media/common/vfm/vframe_provider.c
drivers/amlogic/media/video_processor/ppmgr/ppmgr_vpp.c
include/linux/amlogic/media/vfm/vframe_provider.h

index e208060..af6d1bd 100644 (file)
@@ -367,6 +367,33 @@ void vf_unreg_provider(struct vframe_provider_s *prov)
        }
 }
 EXPORT_SYMBOL(vf_unreg_provider);
+void vf_light_reg_provider(struct vframe_provider_s *prov)
+{
+       struct vframe_provider_s *p = NULL;
+       struct vframe_receiver_s *receiver = NULL;
+       int i;
+
+       for (i = 0; i < MAX_PROVIDER_NUM; i++) {
+               p = provider_table[i];
+               if (p && !strcmp(p->name, prov->name)) {
+                       if (vfm_debug_flag & 1)
+                               pr_err("%s:%s\n", __func__, prov->name);
+                       receiver = vf_get_receiver(prov->name);
+                       if (receiver && receiver->ops
+                               && receiver->ops->event_cb) {
+                               receiver->ops->event_cb(
+                                               VFRAME_EVENT_PROVIDER_REG,
+                                               (void *)prov->name,
+                                               receiver->op_arg);
+                       } else{
+                               pr_err("%s Error to notify receiver\n",
+                                               __func__);
+                       }
+                       break;
+               }
+       }
+}
+EXPORT_SYMBOL(vf_light_reg_provider);
 
 void vf_light_unreg_provider(struct vframe_provider_s *prov)
 {
index 664ad0b..42cc0a6 100644 (file)
@@ -3248,7 +3248,7 @@ SKIP_DETECT:
                        vf_local_init();
                        vf_light_unreg_provider(&ppmgr_vf_prov);
                        msleep(30);
-                       vf_reg_provider(&ppmgr_vf_prov);
+                       vf_light_reg_provider(&ppmgr_vf_prov);
                        ppmgr_blocking = false;
                        up(&thread_sem);
                        PPMGRVPP_WARN("ppmgr rebuild from light-unregister\n");
index 157359a..014f163 100644 (file)
@@ -92,6 +92,7 @@ extern int vf_notify_provider(const char *receiver_name, int event_type,
 extern int vf_notify_provider_by_name(const char *provider_name,
                                int event_type, void *data);
 
+void vf_light_reg_provider(struct vframe_provider_s *prov);
 void vf_light_unreg_provider(struct vframe_provider_s *prov);
 void vf_ext_light_unreg_provider(struct vframe_provider_s *prov);
 struct vframe_provider_s *vf_get_provider(const char *name);