From 76382d549bd3e421542e8a27d234ec6cd77d472b Mon Sep 17 00:00:00 2001 From: Jiyu Yang Date: Tue, 31 Jul 2018 11:34:43 +0800 Subject: [PATCH] osd: adjust render kthreads priority [1/1] PD#170791: by default, it is SCHED_NORMAL. https://android.googlesource.com/kernel/msm/+/1a7a93bd33f48a369de29f6f2b56251127bf6ab4%5E!/ AOSP suggested to use SCHED_FIFO , 2, in Qcom platform. there are another 2 sleeping point for osd_toggle_buffer. need to adjust it still. Change-Id: Ic94a4e1cfee218fc95b53358d2c2e72bbde7bfdd Signed-off-by: Jiyu Yang --- drivers/amlogic/media/osd/osd_hw.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index 602a18c..d88b7f0 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -814,20 +814,6 @@ static int out_fence_create(int *release_fence_fd) { int out_fence_fd = -1; - - if (!timeline_created) { - /* timeline has not been created */ - if (osd_timeline_create()) { - kthread_init_worker(&buffer_toggle_worker); - buffer_toggle_thread = kthread_run( - kthread_worker_fn, - &buffer_toggle_worker, - "aml_buf_toggle"); - kthread_init_work( - &buffer_toggle_work, osd_toggle_buffer); - timeline_created = 1; - } - } /* hwc_enable disable create fence every time */ if (!osd_hw.hwc_enable) { out_fence_fd = osd_timeline_create_fence(); @@ -7195,6 +7181,7 @@ void osd_init_hw(u32 logo_loaded, u32 osd_probe, { u32 idx, data32; int err_num = 0; + struct sched_param param = {.sched_priority = 2}; osd_hw.fb_drvier_probe = osd_probe; @@ -7505,6 +7492,27 @@ void osd_init_hw(u32 logo_loaded, u32 osd_probe, } if (osd_hw.hw_rdma_en) osd_rdma_enable(1); + + if (!timeline_created) { + /* timeline has not been created */ + if (osd_timeline_create()) { + kthread_init_worker(&buffer_toggle_worker); + buffer_toggle_thread = kthread_run( + kthread_worker_fn, + &buffer_toggle_worker, + "aml_buf_toggle"); + if (IS_ERR(buffer_toggle_thread)) { + osd_log_err("create osd toggle kthread failed"); + return; + } + sched_setscheduler(buffer_toggle_thread, + SCHED_FIFO, ¶m); + kthread_init_work( + &buffer_toggle_work, osd_toggle_buffer); + timeline_created = 1; + } + } + } void osd_init_viu2(void) -- 2.7.4