Files
Linux_Drivers/linux_5.10/kernel/sched/cvi_sched.h
wangliang.wang 4f810186ab [linux] porting cvitek asic chips.
1. update cv182x/cv183x configuration file
	2. update cv181x/cv180x configuration file
	3. update clk driver for cvitek
	4. update dma driver for cvitek
	5. update soc driver for cvitek
	6. porting cvitek ion driver from kernel-4.19
	7. compatible with riscv

Change-Id: Icff9fafe0ebe7d6bab824bbadb952e08bdc66c19
2023-03-10 20:33:10 +08:00

50 lines
1.5 KiB
C

#ifdef CONFIG_SCHED_CVITEK
struct cvi_priority_info {
char comm[TASK_COMM_LEN];
u32 sched_policy;
u32 sched_priority;
};
static struct cvi_priority_info priority_list[] = {
{ "cvitask_isp_pre", SCHED_FIFO, 90 },
{ "cvitask_isp_pos", SCHED_FIFO, 90 },
{ "cvitask_vc_sb0", SCHED_RR, 99 },
{ "cvitask_vc_wt0", SCHED_RR, 95 },
{ "cvitask_vc_wt1", SCHED_RR, 95 },
{ "cvitask_vc_bh0", SCHED_RR, 95 },
{ "cvitask_vpss_0", SCHED_FIFO, 90 },
{ "cvitask_vpss_1", SCHED_FIFO, 90 },
{ "cvitask_tpu_wor", SCHED_RR, 85 }
};
#define MAX_OPT_RT_PRIORITY 80
static inline void cvi_checkpriority(struct task_struct *p,
struct sched_attr *attr)
{
/*
* Set the priority for the tasks which are in the priority_list automatically.
* In the meantime, we will check the priority if the task is not belong cvitek soc driver,
* modify the priority if it's trying to set scheduler to realtime scheduler and
* priority higher than 80
* to make sure soc driver tasks are able to finish first.
*/
int i = 0;
if (!strncmp(p->comm, "cvitask_", 8)) {
for (i = 0; i < sizeof(priority_list) /
sizeof(struct cvi_priority_info);
i++) {
if (strcmp(priority_list[i].comm, p->comm))
continue;
attr->sched_policy = priority_list[i].sched_policy;
attr->sched_priority = priority_list[i].sched_priority;
break;
}
} else if (attr->sched_policy == SCHED_FIFO ||
attr->sched_policy == SCHED_RR) {
attr->sched_priority =
attr->sched_priority > MAX_OPT_RT_PRIORITY ?
MAX_OPT_RT_PRIORITY :
attr->sched_priority;
}
}
#endif