buildroot: fix buildroot compile error and ge2d crash issue [1/1]
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Fri, 28 Jun 2019 10:30:41 +0000 (18:30 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 2 Jul 2019 00:49:46 +0000 (17:49 -0700)
PD#SWPL-10483

Problem:
1. buildroot autobuild error
2. buildroot ge2d crash on s400

Solution:
1. fix buildroot compile error
2. move video_keep_init from _init to probe

Verify:
verified on s400,w400

Change-Id: I624fed9669387c94a50974f77b32a4730db08314
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
drivers/amlogic/media/common/ge2d/ge2d_wq.c
drivers/amlogic/media/osd/osd_sw_sync.c
drivers/amlogic/media/osd/osd_sw_sync.h
drivers/amlogic/media/video_sink/video.c
drivers/amlogic/media/video_sink/video_keeper.c
include/linux/amlogic/media/ge2d/ge2d.h
include/linux/amlogic/media/video_sink/video_keeper.h

index dc23224..3e35319 100644 (file)
@@ -2526,6 +2526,8 @@ struct ge2d_context_s *create_ge2d_work_queue(void)
        struct ge2d_context_s *ge2d_work_queue;
        int  empty;
 
+       if (!ge2d_manager.probe)
+               return NULL;
        ge2d_work_queue = kzalloc(sizeof(struct ge2d_context_s), GFP_KERNEL);
        ge2d_work_queue->config.h_scale_coef_type = FILTER_TYPE_BILINEAR;
        ge2d_work_queue->config.v_scale_coef_type = FILTER_TYPE_BILINEAR;
@@ -2644,7 +2646,7 @@ int ge2d_wq_init(struct platform_device *pdev,
                ge2d_log_err("ge2d create thread error\n");
                return -1;
        }
-
+       ge2d_manager.probe = 1;
        return 0;
 }
 
index 3e11669..bf99cfd 100644 (file)
@@ -14,6 +14,7 @@
  * more details.
  *
  */
+#ifdef CONFIG_SYNC_FILE
 
 #include <linux/file.h>
 #include <linux/fs.h>
@@ -296,3 +297,4 @@ void aml_sync_put_fence(struct fence *fence)
 {
        fence_put(fence);
 }
+#endif
index a9b958a..0c4407a 100644 (file)
  * more details.
  *
  */
-
 #ifndef _OSD_SW_SYNC_H
 #define _OSD_SW_SYNC_H
 
+#ifdef CONFIG_SYNC_FILE
+
 #include <linux/list.h>
 #include <linux/rbtree.h>
 #include <linux/spinlock.h>
@@ -57,4 +58,6 @@ void aml_sync_inc_timeline(void *timeline, unsigned int value);
 struct fence *aml_sync_get_fence(int syncfile_fd);
 int aml_sync_wait_fence(struct fence *fence, long timeout);
 void aml_sync_put_fence(struct fence *fence);
+#endif
+
 #endif /* _OSD_SW_SYNC_H */
index 2b4d322..d0ed11e 100644 (file)
@@ -13349,6 +13349,7 @@ static int amvideom_probe(struct platform_device *pdev)
 #ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
        register_early_suspend(&video_early_suspend_handler);
 #endif
+       video_keeper_init();
        return ret;
 }
 
@@ -13357,6 +13358,7 @@ static int amvideom_remove(struct platform_device *pdev)
 #ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
        unregister_early_suspend(&video_early_suspend_handler);
 #endif
+       video_keeper_exit();
        return 0;
 }
 
@@ -13620,7 +13622,6 @@ static int __init video_init(void)
        switch_dev_register(&video1_state_sdev);
        switch_set_state(&video1_state_sdev, 0);
 #endif
-       video_keeper_init();
 #ifdef CONFIG_AM_VIDEO2
        set_clone_frame_rate(android_clone_rate, 0);
 #endif
index 27dbfaa..c349d1c 100644 (file)
@@ -1185,7 +1185,7 @@ unsigned int vf_keep_current(
        return ret;
 }
 
-int __init video_keeper_init(void)
+int video_keeper_init(void)
 {
 #ifdef CONFIG_AMLOGIC_MEDIA_GE2D
        /* video_frame_getmem(); */
@@ -1193,7 +1193,7 @@ int __init video_keeper_init(void)
 #endif
        return 0;
 }
-void __exit video_keeper_exit(void)
+void video_keeper_exit(void)
 {
 #ifdef CONFIG_AMLOGIC_MEDIA_GE2D
        ge2d_videotask_release();
index a730ba4..82c8273 100644 (file)
@@ -729,6 +729,7 @@ struct ge2d_manager_s {
        int irq_num;
        int ge2d_state;
        int process_queue_state;
+       int probe;
        struct platform_device *pdev;
 };
 
index 8794407..4b4b138 100644 (file)
@@ -25,8 +25,8 @@ void video_pip_keeper_new_frame_notify(void);
 void try_free_keep_video(int flags);
 void try_free_keep_videopip(int flags);
 
-int __init video_keeper_init(void);
-void __exit video_keeper_exit(void);
+int video_keeper_init(void);
+void video_keeper_exit(void);
 unsigned int vf_keep_current(
        struct vframe_s *cur_dispbuf,
        struct vframe_s *cur_dispbuf2);