Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49798eb2 authored by Jesse Barnes's avatar Jesse Barnes Committed by Daniel Vetter
Browse files

drm/i915/vlv: use lower precision RC6 counter



And add some reg defines while we're at it.  Since the units of the RC6
residency counter are actually in CZ clocks, we want to just use the
high bits or we'll overflow too frequently.

Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 5de56df5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4729,6 +4729,10 @@
						 GEN6_PM_RP_DOWN_TIMEOUT)

#define GEN6_GT_GFX_RC6_LOCKED			0x138104
#define VLV_COUNTER_CONTROL			0x138104
#define   VLV_COUNT_RANGE_HIGH			(1<<15)
#define   VLV_MEDIA_RC6_COUNT_EN		(1<<1)
#define   VLV_RENDER_RC6_COUNT_EN		(1<<0)
#define GEN6_GT_GFX_RC6				0x138108
#define GEN6_GT_GFX_RC6p			0x13810C
#define GEN6_GT_GFX_RC6pp			0x138110
+4 −1
Original line number Diff line number Diff line
@@ -3837,7 +3837,10 @@ static void valleyview_enable_rps(struct drm_device *dev)
	I915_WRITE(GEN6_RC6_THRESHOLD, 0xc350);

	/* allows RC6 residency counter to work */
	I915_WRITE(0x138104, _MASKED_BIT_ENABLE(0x3));
	I915_WRITE(VLV_COUNTER_CONTROL,
		   _MASKED_BIT_ENABLE(VLV_COUNT_RANGE_HIGH |
				      VLV_MEDIA_RC6_COUNT_EN |
				      VLV_RENDER_RC6_COUNT_EN));
	if (intel_enable_rc6(dev) & INTEL_RC6_ENABLE)
		rc6_mode = GEN7_RC_CTL_TO_MODE;
	I915_WRITE(GEN6_RC_CONTROL, rc6_mode);