From: John Harrison <John.C.Harrison@xxxxxxxxx> It can be useful to be able to disable certain features (e.g. the entire scheduler) via a module parameter for debugging purposes. A parameter has the advantage of not being a compile time switch but without implying that it can be changed dynamically at runtime. Change-Id: I92f4c832be88f5b34b49b90d6a9903fac68f7004 For: VIZ-1587 Signed-off-by: John Harrison <John.C.Harrison@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_params.c | 4 ++++ drivers/gpu/drm/i915/i915_scheduler.c | 5 ++++- drivers/gpu/drm/i915/i915_scheduler.h | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5ed600c..5b893a6 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2717,6 +2717,7 @@ struct i915_params { bool verbose_state_checks; bool nuclear_pageflip; int edp_vswing; + int scheduler_override; }; extern struct i915_params i915 __read_mostly; diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c index ba7274a..be2e16c 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -54,6 +54,7 @@ struct i915_params i915 __read_mostly = { .edp_vswing = 0, .enable_guc_submission = true, .guc_log_level = -1, + .scheduler_override = 1, }; module_param_named(modeset, i915.modeset, int, 0400); @@ -191,3 +192,6 @@ MODULE_PARM_DESC(enable_guc_submission, "Enable GuC submission (default:false)") module_param_named(guc_log_level, i915.guc_log_level, int, 0400); MODULE_PARM_DESC(guc_log_level, "GuC firmware logging level (-1:disabled (default), 0-3:enabled)"); + +module_param_named(scheduler_override, i915.scheduler_override, int, 0600); +MODULE_PARM_DESC(scheduler_override, "Scheduler override mask (0 = none, 1 = direct submission [default])"); diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c index 232f48a..f51676b 100644 --- a/drivers/gpu/drm/i915/i915_scheduler.c +++ b/drivers/gpu/drm/i915/i915_scheduler.c @@ -44,6 +44,9 @@ bool i915_scheduler_is_enabled(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; + if (i915.scheduler_override & i915_so_direct_submit) + return false; + return dev_priv->scheduler != NULL; } @@ -90,7 +93,7 @@ int i915_scheduler_queue_execbuffer(struct i915_scheduler_queue_entry *qe) BUG_ON(!scheduler); - if (1/*i915.scheduler_override & i915_so_direct_submit*/) { + if (i915.scheduler_override & i915_so_direct_submit) { int ret; intel_ring_reserved_space_cancel(qe->params.request->ringbuf); diff --git a/drivers/gpu/drm/i915/i915_scheduler.h b/drivers/gpu/drm/i915/i915_scheduler.h index 29f7248..7e85f80 100644 --- a/drivers/gpu/drm/i915/i915_scheduler.h +++ b/drivers/gpu/drm/i915/i915_scheduler.h @@ -83,6 +83,11 @@ enum { i915_sf_submitting = (1 << 1), }; +/* Options for 'scheduler_override' module parameter: */ +enum { + i915_so_direct_submit = (1 << 0), +}; + bool i915_scheduler_is_enabled(struct drm_device *dev); int i915_scheduler_init(struct drm_device *dev); int i915_scheduler_closefile(struct drm_device *dev, -- 1.9.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx