Commit e9eb8039 authored by Oscar Mateo's avatar Oscar Mateo Committed by Chris Wilson

drm/i915/guc: Name the default GuC scheduling policy

The default values for the default scheduling policy come from the
GuC firmware itself. Transform the magic numbers into defines.
Suggested-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: default avatarOscar Mateo <oscar.mateo@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1505252197-27696-1-git-send-email-oscar.mateo@intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 2013ddeb
...@@ -996,22 +996,27 @@ static void guc_client_free(struct i915_guc_client *client) ...@@ -996,22 +996,27 @@ static void guc_client_free(struct i915_guc_client *client)
kfree(client); kfree(client);
} }
static void guc_policy_init(struct guc_policy *policy)
{
policy->execution_quantum = POLICY_DEFAULT_EXECUTION_QUANTUM_US;
policy->preemption_time = POLICY_DEFAULT_PREEMPTION_TIME_US;
policy->fault_time = POLICY_DEFAULT_FAULT_TIME_US;
policy->policy_flags = 0;
}
static void guc_policies_init(struct guc_policies *policies) static void guc_policies_init(struct guc_policies *policies)
{ {
struct guc_policy *policy; struct guc_policy *policy;
u32 p, i; u32 p, i;
policies->dpc_promote_time = 500000; policies->dpc_promote_time = POLICY_DEFAULT_DPC_PROMOTE_TIME_US;
policies->max_num_work_items = POLICY_MAX_NUM_WI; policies->max_num_work_items = POLICY_MAX_NUM_WI;
for (p = 0; p < GUC_CLIENT_PRIORITY_NUM; p++) { for (p = 0; p < GUC_CLIENT_PRIORITY_NUM; p++) {
for (i = GUC_RENDER_ENGINE; i < GUC_MAX_ENGINES_NUM; i++) { for (i = GUC_RENDER_ENGINE; i < GUC_MAX_ENGINES_NUM; i++) {
policy = &policies->policy[p][i]; policy = &policies->policy[p][i];
policy->execution_quantum = 1000000; guc_policy_init(policy);
policy->preemption_time = 500000;
policy->fault_time = 250000;
policy->policy_flags = 0;
} }
} }
......
...@@ -389,6 +389,10 @@ struct guc_ct_buffer_desc { ...@@ -389,6 +389,10 @@ struct guc_ct_buffer_desc {
#define POLICY_PREEMPT_TO_IDLE (1<<1) #define POLICY_PREEMPT_TO_IDLE (1<<1)
#define POLICY_MAX_NUM_WI 15 #define POLICY_MAX_NUM_WI 15
#define POLICY_DEFAULT_DPC_PROMOTE_TIME_US 500000
#define POLICY_DEFAULT_EXECUTION_QUANTUM_US 1000000
#define POLICY_DEFAULT_PREEMPTION_TIME_US 500000
#define POLICY_DEFAULT_FAULT_TIME_US 250000
struct guc_policy { struct guc_policy {
/* Time for one workload to execute. (in micro seconds) */ /* Time for one workload to execute. (in micro seconds) */
......
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