CHROMIUM: drm/i915: repin bound framebuffers on resume
authorStéphane Marchesin <marcheu@chromium.org>
Fri, 12 Apr 2013 00:23:44 +0000 (17:23 -0700)
committerChromeBot <chrome-bot@google.com>
Fri, 12 Apr 2013 04:20:13 +0000 (21:20 -0700)
commitee65bbd9b2c754c1a5e7c241eb41c8d8ffd1a71a
tree1169e32978bdf5a4b3fb8f010f15f81df023b1dd
parent390a06b1ad53e8214db97205c59634137423901d
CHROMIUM: drm/i915: repin bound framebuffers on resume

During suspend/resume all fences are reset, including their pin
count which is reset to 0. However a framebuffer can be bound across
suspend/resume, which means that after the buffer is unbound on
resume, the pin count for the buffer will be negative. Since the
fence pin count is now negative when available and zero when in use,
the buffer's fence will get recycled when the fence is in use which
is the opposite of what we want. The adverse effect is that since the
fence is recycled the tiling mode goes away while the buffer is being
displayed and we get lines/screens of garbage.

To fix this, we reallocate and repin the fences for all bound fbs on
resume, which ensures the pin count is right.

BUG=chromium:219172,chromium:225056
TEST=by hand, suspend/resume on alex, the artifacts are gone

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Change-Id: I9113078b0eb56e671dcca8dc9557a0c0c37f12e0
Reviewed-on: https://gerrit.chromium.org/gerrit/47933
drivers/gpu/drm/i915/i915_drv.c