diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-08-01 09:18:52 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-05 13:04:16 -0400 |
commit | 26ec971e302c53b44cc5627ffe209a7d33199e28 (patch) | |
tree | 2b24bb6ff29ab80cb767d4d3c5b3f9f10886e586 /drivers/gpu/drm/i915/intel_pm.c | |
parent | 5b77da33c11b72d703382a93c402544186c7721e (diff) |
drm/i915: Print the watermark latencies during init
Seeing the watermark latency values in dmesg might help sometimes.
v2: Use DRM_ERROR() when expected latency values are missing
Note: We might hit the DRM_ERROR added in this patch and apparently
there's not much we can do about that. But I think it'd be interesting
to figure out whether that actually happens in the real world, so I
didn't apply a s/DRM_ERROR/DRM_DEBUG_KMS/ bikeshed while applying.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
[danvet: Add note about new error dmesg output.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 936c1628075a..8358d73ae468 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -2409,6 +2409,39 @@ static void intel_fixup_cur_wm_latency(struct drm_device *dev, uint16_t wm[5]) | |||
2409 | wm[3] *= 2; | 2409 | wm[3] *= 2; |
2410 | } | 2410 | } |
2411 | 2411 | ||
2412 | static void intel_print_wm_latency(struct drm_device *dev, | ||
2413 | const char *name, | ||
2414 | const uint16_t wm[5]) | ||
2415 | { | ||
2416 | int level, max_level; | ||
2417 | |||
2418 | /* how many WM levels are we expecting */ | ||
2419 | if (IS_HASWELL(dev)) | ||
2420 | max_level = 4; | ||
2421 | else if (INTEL_INFO(dev)->gen >= 6) | ||
2422 | max_level = 3; | ||
2423 | else | ||
2424 | max_level = 2; | ||
2425 | |||
2426 | for (level = 0; level <= max_level; level++) { | ||
2427 | unsigned int latency = wm[level]; | ||
2428 | |||
2429 | if (latency == 0) { | ||
2430 | DRM_ERROR("%s WM%d latency not provided\n", | ||
2431 | name, level); | ||
2432 | continue; | ||
2433 | } | ||
2434 | |||
2435 | /* WM1+ latency values in 0.5us units */ | ||
2436 | if (level > 0) | ||
2437 | latency *= 5; | ||
2438 | |||
2439 | DRM_DEBUG_KMS("%s WM%d latency %u (%u.%u usec)\n", | ||
2440 | name, level, wm[level], | ||
2441 | latency / 10, latency % 10); | ||
2442 | } | ||
2443 | } | ||
2444 | |||
2412 | static void intel_setup_wm_latency(struct drm_device *dev) | 2445 | static void intel_setup_wm_latency(struct drm_device *dev) |
2413 | { | 2446 | { |
2414 | struct drm_i915_private *dev_priv = dev->dev_private; | 2447 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -2422,6 +2455,10 @@ static void intel_setup_wm_latency(struct drm_device *dev) | |||
2422 | 2455 | ||
2423 | intel_fixup_spr_wm_latency(dev, dev_priv->wm.spr_latency); | 2456 | intel_fixup_spr_wm_latency(dev, dev_priv->wm.spr_latency); |
2424 | intel_fixup_cur_wm_latency(dev, dev_priv->wm.cur_latency); | 2457 | intel_fixup_cur_wm_latency(dev, dev_priv->wm.cur_latency); |
2458 | |||
2459 | intel_print_wm_latency(dev, "Primary", dev_priv->wm.pri_latency); | ||
2460 | intel_print_wm_latency(dev, "Sprite", dev_priv->wm.spr_latency); | ||
2461 | intel_print_wm_latency(dev, "Cursor", dev_priv->wm.cur_latency); | ||
2425 | } | 2462 | } |
2426 | 2463 | ||
2427 | static void hsw_compute_wm_parameters(struct drm_device *dev, | 2464 | static void hsw_compute_wm_parameters(struct drm_device *dev, |