Subversion Repositories Kolibri OS

Rev

Rev 6660 | Rev 6937 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6660 Rev 6935
Line 2100... Line 2100...
2100
				GEN9_MEM_LATENCY_LEVEL_MASK;
2100
				GEN9_MEM_LATENCY_LEVEL_MASK;
2101
		wm[7] = (val >> GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT) &
2101
		wm[7] = (val >> GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT) &
2102
				GEN9_MEM_LATENCY_LEVEL_MASK;
2102
				GEN9_MEM_LATENCY_LEVEL_MASK;
Line 2103... Line 2103...
2103
 
2103
 
-
 
2104
		/*
-
 
2105
		 * If a level n (n > 1) has a 0us latency, all levels m (m >= n)
-
 
2106
		 * need to be disabled. We make sure to sanitize the values out
-
 
2107
		 * of the punit to satisfy this requirement.
-
 
2108
		 */
-
 
2109
		for (level = 1; level <= max_level; level++) {
-
 
2110
			if (wm[level] == 0) {
-
 
2111
				for (i = level + 1; i <= max_level; i++)
-
 
2112
					wm[i] = 0;
-
 
2113
				break;
-
 
2114
			}
-
 
2115
		}
-
 
2116
 
2104
		/*
2117
		/*
2105
		 * WaWmMemoryReadLatency:skl
2118
		 * WaWmMemoryReadLatency:skl
2106
		 *
2119
		 *
2107
		 * punit doesn't take into account the read latency so we need
2120
		 * punit doesn't take into account the read latency so we need
2108
		 * to add 2us to the various latency levels we retrieve from
-
 
2109
		 * the punit.
-
 
2110
		 *   - W0 is a bit special in that it's the only level that
-
 
2111
		 *   can't be disabled if we want to have display working, so
-
 
2112
		 *   we always add 2us there.
-
 
2113
		 *   - For levels >=1, punit returns 0us latency when they are
-
 
2114
		 *   disabled, so we respect that and don't add 2us then
-
 
2115
		 *
-
 
2116
		 * Additionally, if a level n (n > 1) has a 0us latency, all
-
 
2117
		 * levels m (m >= n) need to be disabled. We make sure to
2121
		 * to add 2us to the various latency levels we retrieve from the
2118
		 * sanitize the values out of the punit to satisfy this
-
 
2119
		 * requirement.
2122
		 * punit when level 0 response data us 0us.
-
 
2123
		 */
2120
		 */
2124
		if (wm[0] == 0) {
2121
		wm[0] += 2;
2125
		wm[0] += 2;
2122
		for (level = 1; level <= max_level; level++)
2126
			for (level = 1; level <= max_level; level++) {
2123
			if (wm[level] != 0)
-
 
2124
				wm[level] += 2;
-
 
2125
			else {
-
 
2126
				for (i = level + 1; i <= max_level; i++)
-
 
2127
					wm[i] = 0;
-
 
2128
 
2127
				if (wm[level] == 0)
-
 
2128
					break;
-
 
2129
				wm[level] += 2;
2129
				break;
2130
			}
-
 
2131
		}
2130
			}
2132
 
2131
	} else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
2133
	} else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
Line 2132... Line 2134...
2132
		uint64_t sskpd = I915_READ64(MCH_SSKPD);
2134
		uint64_t sskpd = I915_READ64(MCH_SSKPD);
2133
 
2135
 
Line 4377... Line 4379...
4377
		ei_down = 32000;
4379
		ei_down = 32000;
4378
		threshold_down = 60;
4380
		threshold_down = 60;
4379
		break;
4381
		break;
4380
	}
4382
	}
Line -... Line 4383...
-
 
4383
 
-
 
4384
	/* When byt can survive without system hang with dynamic
-
 
4385
	 * sw freq adjustments, this restriction can be lifted.
-
 
4386
	 */
-
 
4387
	if (IS_VALLEYVIEW(dev_priv))
-
 
4388
		goto skip_hw_write;
4381
 
4389
 
4382
	I915_WRITE(GEN6_RP_UP_EI,
4390
	I915_WRITE(GEN6_RP_UP_EI,
4383
		GT_INTERVAL_FROM_US(dev_priv, ei_up));
4391
		GT_INTERVAL_FROM_US(dev_priv, ei_up));
4384
	I915_WRITE(GEN6_RP_UP_THRESHOLD,
4392
	I915_WRITE(GEN6_RP_UP_THRESHOLD,
Line 4395... Line 4403...
4395
		    GEN6_RP_MEDIA_IS_GFX |
4403
		    GEN6_RP_MEDIA_IS_GFX |
4396
		    GEN6_RP_ENABLE |
4404
		    GEN6_RP_ENABLE |
4397
		    GEN6_RP_UP_BUSY_AVG |
4405
		    GEN6_RP_UP_BUSY_AVG |
4398
		    GEN6_RP_DOWN_IDLE_AVG);
4406
		    GEN6_RP_DOWN_IDLE_AVG);
Line -... Line 4407...
-
 
4407
 
4399
 
4408
skip_hw_write:
4400
	dev_priv->rps.power = new_power;
4409
	dev_priv->rps.power = new_power;
4401
	dev_priv->rps.up_threshold = threshold_up;
4410
	dev_priv->rps.up_threshold = threshold_up;
4402
	dev_priv->rps.down_threshold = threshold_down;
4411
	dev_priv->rps.down_threshold = threshold_down;
4403
	dev_priv->rps.last_adj = 0;
4412
	dev_priv->rps.last_adj = 0;
Line 4404... Line 4413...
4404
}
4413
}
4405
 
4414
 
4406
static u32 gen6_rps_pm_mask(struct drm_i915_private *dev_priv, u8 val)
4415
static u32 gen6_rps_pm_mask(struct drm_i915_private *dev_priv, u8 val)
Line -... Line 4416...
-
 
4416
{
4407
{
4417
	u32 mask = 0;
4408
	u32 mask = 0;
4418
 
4409
 
4419
	/* We use UP_EI_EXPIRED interupts for both up/down in manual mode */
4410
	if (val > dev_priv->rps.min_freq_softlimit)
4420
	if (val > dev_priv->rps.min_freq_softlimit)
Line 4411... Line 4421...
4411
		mask |= GEN6_PM_RP_DOWN_EI_EXPIRED | GEN6_PM_RP_DOWN_THRESHOLD | GEN6_PM_RP_DOWN_TIMEOUT;
4421
		mask |= GEN6_PM_RP_UP_EI_EXPIRED | GEN6_PM_RP_DOWN_THRESHOLD | GEN6_PM_RP_DOWN_TIMEOUT;
Line 4510... Line 4520...
4510
 
4520
 
4511
void gen6_rps_busy(struct drm_i915_private *dev_priv)
4521
void gen6_rps_busy(struct drm_i915_private *dev_priv)
4512
{
4522
{
4513
	mutex_lock(&dev_priv->rps.hw_lock);
4523
	mutex_lock(&dev_priv->rps.hw_lock);
4514
	if (dev_priv->rps.enabled) {
4524
	if (dev_priv->rps.enabled) {
4515
		if (dev_priv->pm_rps_events & (GEN6_PM_RP_DOWN_EI_EXPIRED | GEN6_PM_RP_UP_EI_EXPIRED))
4525
		if (dev_priv->pm_rps_events & GEN6_PM_RP_UP_EI_EXPIRED)
4516
			gen6_rps_reset_ei(dev_priv);
4526
			gen6_rps_reset_ei(dev_priv);
4517
		I915_WRITE(GEN6_PMINTRMSK,
4527
		I915_WRITE(GEN6_PMINTRMSK,
4518
			   gen6_rps_pm_mask(dev_priv, dev_priv->rps.cur_freq));
4528
			   gen6_rps_pm_mask(dev_priv, dev_priv->rps.cur_freq));
4519
	}
4529
	}
Line 6799... Line 6809...
6799
	gen6_check_mch_setup(dev);
6809
	gen6_check_mch_setup(dev);
6800
}
6810
}
Line 6801... Line 6811...
6801
 
6811
 
6802
static void vlv_init_display_clock_gating(struct drm_i915_private *dev_priv)
6812
static void vlv_init_display_clock_gating(struct drm_i915_private *dev_priv)
-
 
6813
{
-
 
6814
        u32 val;
-
 
6815
 
-
 
6816
        /*
-
 
6817
        * On driver load, a pipe may be active and driving a DSI display.
-
 
6818
        * Preserve DPOUNIT_CLOCK_GATE_DISABLE to avoid the pipe getting stuck
-
 
6819
        * (and never recovering) in this case. intel_dsi_post_disable() will
-
 
6820
        * clear it when we turn off the display.
-
 
6821
        */
-
 
6822
        val = I915_READ(DSPCLK_GATE_D);
6803
{
6823
        val &= DPOUNIT_CLOCK_GATE_DISABLE;
-
 
6824
        val |= VRHUNIT_CLOCK_GATE_DISABLE;
Line 6804... Line 6825...
6804
	I915_WRITE(DSPCLK_GATE_D, VRHUNIT_CLOCK_GATE_DISABLE);
6825
        I915_WRITE(DSPCLK_GATE_D, val);
6805
 
6826
 
6806
	/*
6827
	/*
6807
	 * Disable trickle feed and enable pnd deadline calculation
6828
	 * Disable trickle feed and enable pnd deadline calculation