Commit de489844 authored by Andrey Lebedev's avatar Andrey Lebedev Committed by Qiang Yu

drm/lima: Expose job_hang_limit module parameter

Some pp or gp jobs can be successfully repeated even after they time outs.
Introduce lima module parameter to specify number of times a job can hang
before being dropped.
Signed-off-by: default avatarAndrey Lebedev <andrey@lebedev.lt>
Signed-off-by: default avatarQiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200619075900.3030696-1-andrey.lebedev@gmail.com
parent 06a28f90
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
int lima_sched_timeout_ms; int lima_sched_timeout_ms;
uint lima_heap_init_nr_pages = 8; uint lima_heap_init_nr_pages = 8;
uint lima_max_error_tasks; uint lima_max_error_tasks;
uint lima_job_hang_limit;
MODULE_PARM_DESC(sched_timeout_ms, "task run timeout in ms"); MODULE_PARM_DESC(sched_timeout_ms, "task run timeout in ms");
module_param_named(sched_timeout_ms, lima_sched_timeout_ms, int, 0444); module_param_named(sched_timeout_ms, lima_sched_timeout_ms, int, 0444);
...@@ -29,6 +30,9 @@ module_param_named(heap_init_nr_pages, lima_heap_init_nr_pages, uint, 0444); ...@@ -29,6 +30,9 @@ module_param_named(heap_init_nr_pages, lima_heap_init_nr_pages, uint, 0444);
MODULE_PARM_DESC(max_error_tasks, "max number of error tasks to save"); MODULE_PARM_DESC(max_error_tasks, "max number of error tasks to save");
module_param_named(max_error_tasks, lima_max_error_tasks, uint, 0644); module_param_named(max_error_tasks, lima_max_error_tasks, uint, 0644);
MODULE_PARM_DESC(job_hang_limit, "number of times to allow a job to hang before dropping it (default 0)");
module_param_named(job_hang_limit, lima_job_hang_limit, uint, 0444);
static int lima_ioctl_get_param(struct drm_device *dev, void *data, struct drm_file *file) static int lima_ioctl_get_param(struct drm_device *dev, void *data, struct drm_file *file)
{ {
struct drm_lima_get_param *args = data; struct drm_lima_get_param *args = data;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
extern int lima_sched_timeout_ms; extern int lima_sched_timeout_ms;
extern uint lima_heap_init_nr_pages; extern uint lima_heap_init_nr_pages;
extern uint lima_max_error_tasks; extern uint lima_max_error_tasks;
extern uint lima_job_hang_limit;
struct lima_vm; struct lima_vm;
struct lima_bo; struct lima_bo;
......
...@@ -503,8 +503,9 @@ int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name) ...@@ -503,8 +503,9 @@ int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name)
INIT_WORK(&pipe->recover_work, lima_sched_recover_work); INIT_WORK(&pipe->recover_work, lima_sched_recover_work);
return drm_sched_init(&pipe->base, &lima_sched_ops, 1, 0, return drm_sched_init(&pipe->base, &lima_sched_ops, 1,
msecs_to_jiffies(timeout), name); lima_job_hang_limit, msecs_to_jiffies(timeout),
name);
} }
void lima_sched_pipe_fini(struct lima_sched_pipe *pipe) void lima_sched_pipe_fini(struct lima_sched_pipe *pipe)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment