diff options
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 3fa0d63c83b9..890f7108e723 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1674,7 +1674,7 @@ static unsigned long intel_calculate_wm(unsigned long clock_in_khz, | |||
1674 | int pixel_size, | 1674 | int pixel_size, |
1675 | unsigned long latency_ns) | 1675 | unsigned long latency_ns) |
1676 | { | 1676 | { |
1677 | unsigned long entries_required, wm_size; | 1677 | long entries_required, wm_size; |
1678 | 1678 | ||
1679 | entries_required = (clock_in_khz * pixel_size * latency_ns) / 1000000; | 1679 | entries_required = (clock_in_khz * pixel_size * latency_ns) / 1000000; |
1680 | entries_required /= wm->cacheline_size; | 1680 | entries_required /= wm->cacheline_size; |
@@ -1685,9 +1685,10 @@ static unsigned long intel_calculate_wm(unsigned long clock_in_khz, | |||
1685 | 1685 | ||
1686 | DRM_DEBUG("FIFO watermark level: %d\n", wm_size); | 1686 | DRM_DEBUG("FIFO watermark level: %d\n", wm_size); |
1687 | 1687 | ||
1688 | if (wm_size > wm->max_wm) | 1688 | /* Don't promote wm_size to unsigned... */ |
1689 | if (wm_size > (long)wm->max_wm) | ||
1689 | wm_size = wm->max_wm; | 1690 | wm_size = wm->max_wm; |
1690 | if (wm_size == 0) | 1691 | if (wm_size <= 0) |
1691 | wm_size = wm->default_wm; | 1692 | wm_size = wm->default_wm; |
1692 | return wm_size; | 1693 | return wm_size; |
1693 | } | 1694 | } |