aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYuanhan Liu <yuanhan.liu@linux.intel.com>2010-12-23 03:35:40 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-11 15:36:15 -0500
commita0fa62d3b6afaa260cad8ccd6944e81ad01c7cf3 (patch)
tree88f6e83c0333e6fb2f2de4a4ef15410caf04822b /drivers
parentb79d4990226defc3789f9ba492b27e9e56790857 (diff)
drm/i915: fix the wrong latency value while computing wm0
On Ironlake, the LP0 latency is hardcoded and in ns unit, while on Sandybridge, it comes from a register and with unit 0.1 us. So, fix the wrong latency value while computing wm0 on Ironlake and Sandybridge. Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 79753b8ac797..75c433e6f457 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3418,9 +3418,9 @@ static void i830_update_wm(struct drm_device *dev, int planea_clock, int unused,
3418static bool ironlake_compute_wm0(struct drm_device *dev, 3418static bool ironlake_compute_wm0(struct drm_device *dev,
3419 int pipe, 3419 int pipe,
3420 const struct intel_watermark_params *display, 3420 const struct intel_watermark_params *display,
3421 int display_latency, 3421 int display_latency_ns,
3422 const struct intel_watermark_params *cursor, 3422 const struct intel_watermark_params *cursor,
3423 int cursor_latency, 3423 int cursor_latency_ns,
3424 int *plane_wm, 3424 int *plane_wm,
3425 int *cursor_wm) 3425 int *cursor_wm)
3426{ 3426{
@@ -3438,7 +3438,7 @@ static bool ironlake_compute_wm0(struct drm_device *dev,
3438 pixel_size = crtc->fb->bits_per_pixel / 8; 3438 pixel_size = crtc->fb->bits_per_pixel / 8;
3439 3439
3440 /* Use the small buffer method to calculate plane watermark */ 3440 /* Use the small buffer method to calculate plane watermark */
3441 entries = ((clock * pixel_size / 1000) * display_latency * 100) / 1000; 3441 entries = ((clock * pixel_size / 1000) * display_latency_ns) / 1000;
3442 entries = DIV_ROUND_UP(entries, display->cacheline_size); 3442 entries = DIV_ROUND_UP(entries, display->cacheline_size);
3443 *plane_wm = entries + display->guard_size; 3443 *plane_wm = entries + display->guard_size;
3444 if (*plane_wm > (int)display->max_wm) 3444 if (*plane_wm > (int)display->max_wm)
@@ -3446,7 +3446,7 @@ static bool ironlake_compute_wm0(struct drm_device *dev,
3446 3446
3447 /* Use the large buffer method to calculate cursor watermark */ 3447 /* Use the large buffer method to calculate cursor watermark */
3448 line_time_us = ((htotal * 1000) / clock); 3448 line_time_us = ((htotal * 1000) / clock);
3449 line_count = (cursor_latency * 100 / line_time_us + 1000) / 1000; 3449 line_count = (cursor_latency_ns / line_time_us + 1000) / 1000;
3450 entries = line_count * 64 * pixel_size; 3450 entries = line_count * 64 * pixel_size;
3451 entries = DIV_ROUND_UP(entries, cursor->cacheline_size); 3451 entries = DIV_ROUND_UP(entries, cursor->cacheline_size);
3452 *cursor_wm = entries + cursor->guard_size; 3452 *cursor_wm = entries + cursor->guard_size;
@@ -3644,7 +3644,7 @@ static void sandybridge_update_wm(struct drm_device *dev,
3644 int pixel_size) 3644 int pixel_size)
3645{ 3645{
3646 struct drm_i915_private *dev_priv = dev->dev_private; 3646 struct drm_i915_private *dev_priv = dev->dev_private;
3647 int latency = SNB_READ_WM0_LATENCY(); 3647 int latency = SNB_READ_WM0_LATENCY() * 100; /* In unit 0.1us */
3648 int fbc_wm, plane_wm, cursor_wm, enabled; 3648 int fbc_wm, plane_wm, cursor_wm, enabled;
3649 int clock; 3649 int clock;
3650 3650