v2: Removing checks for vma obj and kmap_atomic validity. (Chris) Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx> --- drivers/gpu/drm/i915/intel_slpc.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_slpc.c b/drivers/gpu/drm/i915/intel_slpc.c index 5ab8362..7062d8b 100644 --- a/drivers/gpu/drm/i915/intel_slpc.c +++ b/drivers/gpu/drm/i915/intel_slpc.c @@ -293,6 +293,10 @@ void intel_slpc_disable(struct drm_i915_private *dev_priv) void intel_slpc_enable(struct drm_i915_private *dev_priv) { + struct drm_i915_gem_object *obj; + struct page *page; + void *pv = NULL; + struct slpc_shared_data data; u64 val; host2guc_slpc_reset(dev_priv); @@ -336,6 +340,25 @@ void intel_slpc_enable(struct drm_i915_private *dev_priv) intel_slpc_set_param(dev_priv, SLPC_PARAM_GLOBAL_ENABLE_BALANCER_IN_NON_GAMING_MODE, 0); + + obj = dev_priv->guc.slpc.vma->obj; + intel_slpc_query_task_state(dev_priv); + + pv = kmap_atomic(i915_gem_object_get_page(obj, 0)); + data = *(struct slpc_shared_data *) pv; + kunmap_atomic(pv); + + /* + * TODO: Define separate variables for slice and unslice + * frequencies for driver state variable. + */ + dev_priv->rps.max_freq_softlimit = + data.task_state_data.freq_unslice_max; + dev_priv->rps.min_freq_softlimit = + data.task_state_data.freq_unslice_min; + + dev_priv->rps.max_freq_softlimit *= GEN9_FREQ_SCALER; + dev_priv->rps.min_freq_softlimit *= GEN9_FREQ_SCALER; } void intel_slpc_reset(struct drm_i915_private *dev_priv) -- 1.9.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx