From d05191983741fc4f0d06caa93f38d4fdb7265d65 Mon Sep 17 00:00:00 2001 From: Pengcheng Chen Date: Fri, 28 Jun 2019 18:30:41 +0800 Subject: [PATCH] buildroot: fix buildroot compile error and ge2d crash issue [1/1] 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 --- drivers/amlogic/media/common/ge2d/ge2d_wq.c | 4 +++- drivers/amlogic/media/osd/osd_sw_sync.c | 2 ++ drivers/amlogic/media/osd/osd_sw_sync.h | 5 ++++- drivers/amlogic/media/video_sink/video.c | 3 ++- drivers/amlogic/media/video_sink/video_keeper.c | 4 ++-- include/linux/amlogic/media/ge2d/ge2d.h | 1 + include/linux/amlogic/media/video_sink/video_keeper.h | 4 ++-- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/amlogic/media/common/ge2d/ge2d_wq.c b/drivers/amlogic/media/common/ge2d/ge2d_wq.c index dc2322487e26..3e35319206f3 100644 --- a/drivers/amlogic/media/common/ge2d/ge2d_wq.c +++ b/drivers/amlogic/media/common/ge2d/ge2d_wq.c @@ -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; } diff --git a/drivers/amlogic/media/osd/osd_sw_sync.c b/drivers/amlogic/media/osd/osd_sw_sync.c index 3e11669f4c36..bf99cfde89fd 100644 --- a/drivers/amlogic/media/osd/osd_sw_sync.c +++ b/drivers/amlogic/media/osd/osd_sw_sync.c @@ -14,6 +14,7 @@ * more details. * */ +#ifdef CONFIG_SYNC_FILE #include #include @@ -296,3 +297,4 @@ void aml_sync_put_fence(struct fence *fence) { fence_put(fence); } +#endif diff --git a/drivers/amlogic/media/osd/osd_sw_sync.h b/drivers/amlogic/media/osd/osd_sw_sync.h index a9b958a98160..0c4407affae7 100644 --- a/drivers/amlogic/media/osd/osd_sw_sync.h +++ b/drivers/amlogic/media/osd/osd_sw_sync.h @@ -14,10 +14,11 @@ * more details. * */ - #ifndef _OSD_SW_SYNC_H #define _OSD_SW_SYNC_H +#ifdef CONFIG_SYNC_FILE + #include #include #include @@ -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 */ diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 2b4d322fc575..d0ed11e427f2 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -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 diff --git a/drivers/amlogic/media/video_sink/video_keeper.c b/drivers/amlogic/media/video_sink/video_keeper.c index 27dbfaadc8fd..c349d1c5af0a 100644 --- a/drivers/amlogic/media/video_sink/video_keeper.c +++ b/drivers/amlogic/media/video_sink/video_keeper.c @@ -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(); diff --git a/include/linux/amlogic/media/ge2d/ge2d.h b/include/linux/amlogic/media/ge2d/ge2d.h index a730ba41ca6c..82c82739387a 100644 --- a/include/linux/amlogic/media/ge2d/ge2d.h +++ b/include/linux/amlogic/media/ge2d/ge2d.h @@ -729,6 +729,7 @@ struct ge2d_manager_s { int irq_num; int ge2d_state; int process_queue_state; + int probe; struct platform_device *pdev; }; diff --git a/include/linux/amlogic/media/video_sink/video_keeper.h b/include/linux/amlogic/media/video_sink/video_keeper.h index 8794407be2dc..4b4b13855f67 100644 --- a/include/linux/amlogic/media/video_sink/video_keeper.h +++ b/include/linux/amlogic/media/video_sink/video_keeper.h @@ -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);