drm/i915: Fix type mismatch and accounting in i915_gem_shrink
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 4 Oct 2013 09:33:00 +0000 (10:33 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 10 Oct 2013 10:46:48 +0000 (12:46 +0200)
commitd9973b4356096e8b040d6eba02407bccdaf101af
tree13622285de53c4501af4e81709f10f692db2741c
parent5035c275af811b93dec5df6d064e0b2319cf59c8
drm/i915: Fix type mismatch and accounting in i915_gem_shrink

The interface uses an unsigned long, and we can use the unsigned counter
throughout our code, so do so. In the process, we notice one instance
where the shrink count is based on a heuristic rather than the result,
and another where we ask for too many pages to be purged.

v2: nr_to_scan needs to be promoted to a long as well, so just use
    sc->nr_to_scan directly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c