Commit 1b6c3c6d authored by Tvrtko Ursulin's avatar Tvrtko Ursulin Committed by Lucas De Marchi

drm/i915: Move MOCS setup to intel_mocs.c

Hide the details of MOCS setup from i915_gem by moving both current calls
into one in intel_mocs_init.

Cc: Stuart Summers <stuart.summers@intel.com>
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarStuart Summers <stuart.summers@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190713010940.17711-21-lucas.demarchi@intel.com
Link: https://patchwork.freedesktop.org/patch/msgid/20190730180407.5993-6-lucas.demarchi@intel.com
parent a7a7a0e6
...@@ -426,14 +426,13 @@ void intel_mocs_init_engine(struct intel_engine_cs *engine) ...@@ -426,14 +426,13 @@ void intel_mocs_init_engine(struct intel_engine_cs *engine)
* *
* This function initializes the MOCS global registers. * This function initializes the MOCS global registers.
*/ */
void intel_mocs_init_global(struct intel_gt *gt) static void intel_mocs_init_global(struct intel_gt *gt)
{ {
struct intel_uncore *uncore = gt->uncore; struct intel_uncore *uncore = gt->uncore;
struct drm_i915_mocs_table table; struct drm_i915_mocs_table table;
unsigned int index; unsigned int index;
if (!HAS_GLOBAL_MOCS_REGISTERS(gt->i915)) GEM_BUG_ON(!HAS_GLOBAL_MOCS_REGISTERS(gt->i915));
return;
if (!get_mocs_settings(gt, &table)) if (!get_mocs_settings(gt, &table))
return; return;
...@@ -599,7 +598,7 @@ static int emit_mocs_l3cc_table(struct i915_request *rq, ...@@ -599,7 +598,7 @@ static int emit_mocs_l3cc_table(struct i915_request *rq,
* *
* Return: Nothing. * Return: Nothing.
*/ */
void intel_mocs_init_l3cc_table(struct intel_gt *gt) static void intel_mocs_init_l3cc_table(struct intel_gt *gt)
{ {
struct intel_uncore *uncore = gt->uncore; struct intel_uncore *uncore = gt->uncore;
struct drm_i915_mocs_table table; struct drm_i915_mocs_table table;
...@@ -678,3 +677,11 @@ int intel_mocs_emit(struct i915_request *rq) ...@@ -678,3 +677,11 @@ int intel_mocs_emit(struct i915_request *rq)
return 0; return 0;
} }
void intel_mocs_init(struct intel_gt *gt)
{
intel_mocs_init_l3cc_table(gt);
if (HAS_GLOBAL_MOCS_REGISTERS(gt->i915))
intel_mocs_init_global(gt);
}
...@@ -53,8 +53,7 @@ struct i915_request; ...@@ -53,8 +53,7 @@ struct i915_request;
struct intel_engine_cs; struct intel_engine_cs;
struct intel_gt; struct intel_gt;
void intel_mocs_init_l3cc_table(struct intel_gt *gt); void intel_mocs_init(struct intel_gt *gt);
void intel_mocs_init_global(struct intel_gt *gt);
void intel_mocs_init_engine(struct intel_engine_cs *engine); void intel_mocs_init_engine(struct intel_engine_cs *engine);
int intel_mocs_emit(struct i915_request *rq); int intel_mocs_emit(struct i915_request *rq);
......
...@@ -1247,8 +1247,7 @@ int i915_gem_init_hw(struct drm_i915_private *i915) ...@@ -1247,8 +1247,7 @@ int i915_gem_init_hw(struct drm_i915_private *i915)
goto out; goto out;
} }
intel_mocs_init_global(gt); intel_mocs_init(gt);
intel_mocs_init_l3cc_table(gt);
intel_engines_set_scheduler_caps(i915); intel_engines_set_scheduler_caps(i915);
......
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