UPSTREAM: drm/rockchip: don't wait for vblank if fb hasn't changed
authorJohn Keeping <john@metanate.com>
Tue, 19 Jan 2016 10:46:59 +0000 (10:46 +0000)
committerMark Yao <mark.yao@rock-chips.com>
Thu, 17 Mar 2016 01:42:05 +0000 (09:42 +0800)
commitba63cef87ff8443c05fb38de7e98be894b01f80e
tree3da1e23cf371980935fccfdabf4885dec2ff3300
parentb498b62d7644f0e0795c5c63ec2b6fbddbb76d14
UPSTREAM: drm/rockchip: don't wait for vblank if fb hasn't changed

As commented in drm_atomic_helper_wait_for_vblanks(), userspace relies
on cursor ioctls being unsynced.  Converting the rockchip driver to
atomic has significantly impacted cursor performance by making every
cursor update wait for vblank.

By skipping the vblank sync when the framebuffer has not changed (as is
done in drm_atomic_helper_wait_for_vblanks()) we can avoid this for the
common case of moving the cursor and only need to delay the cursor ioctl
when the cursor icon changes.

We cannot add the check on legacy_cursor_update since that results in
the cursor bo being unreferenced while the hardware may still be reading
it.  Fully supporting unsynced cursor updates is left for the future
when the atomic helper framework supports async updates.

Change-Id: I4c0e4b51ec7441fb7b7342eac5d4b98f9ca5ee62
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: John Keeping <john@metanate.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit f2227f469782e55765deacb8ebcc7ec05fe04013)
drivers/gpu/drm/rockchip/rockchip_drm_fb.c