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 <pengcheng.chen@amlogic.com>
This commit is contained in:
Pengcheng Chen
2019-06-28 18:30:41 +08:00
committed by Jianxin Pan
parent ce6d552378
commit d051919837
7 changed files with 16 additions and 7 deletions

View 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;
}

View 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

View File

@@ -14,10 +14,11 @@
* 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 */

View 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

View 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();

View 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;
};

View 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);