drm/i915: Always mark the writer as also a read for busy ioctl
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 9 Aug 2016 17:08:25 +0000 (18:08 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 10 Aug 2016 09:37:21 +0000 (10:37 +0100)
commit70cb472c6d7a3575a9b3fc7e0188384b7ca3d705
tree3057a2634c302974a2246789f4d155915222ceb8
parentaac440ff22a27155ae08f4d0fd6ac2971bfc5f3d
drm/i915: Always mark the writer as also a read for busy ioctl

One of the few guarantees we want the busy ioctl to provide is that the
reported busy writer is included in the set of busy read engines. This
should be provided by the ordering of setting and retiring the active
trackers, but we can do better by explicitly setting the busy read
engine flag for the last writer.

v2: More comments inside __busy_write_id() to explain why both fields
are set.

Fixes: 3fdc13c7a3cb ("drm/i915: Remove (struct_mutex) locking for busy-ioctl")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470762505-12799-1-git-send-email-chris@chris-wilson.co.uk
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c