osd: adjust render kthreads priority [1/1]
authorJiyu Yang <Jiyu.Yang@amlogic.com>
Tue, 31 Jul 2018 03:34:43 +0000 (11:34 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 9 Aug 2018 11:53:19 +0000 (04:53 -0700)
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 <Jiyu.Yang@amlogic.com>
drivers/amlogic/media/osd/osd_hw.c

index 602a18cefc1d5e7f37d4f4d7c5fe35589d2ee424..d88b7f0c6b8a8f65fd245addef1130b1bcc2df38 100644 (file)
@@ -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, &param);
+                       kthread_init_work(
+                               &buffer_toggle_work, osd_toggle_buffer);
+                       timeline_created = 1;
+               }
+       }
+
 }
 
 void osd_init_viu2(void)