drm/i915: Discard a misplaced GGTT vma
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 5 Jun 2020 16:52:58 +0000 (17:52 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 5 Jun 2020 17:29:15 +0000 (18:29 +0100)
commit9bdcaa5e3a2fb0a18d8c7a49bd64a52bce105bd2
tree216399f54e0231fc3b09baeb3a82f96978cd4b08
parent12b67c2e9c58f6c716efcd5cfc9411d7e5f45930
drm/i915: Discard a misplaced GGTT vma

Across the many users of the GGTT vma (internal objects, mmapings,
display etc), we may end up with conflicting requirements for the
placement. Currently, we try to resolve the conflict by unbinding the
vma and rebinding it to match the new constraints; over time we will end
up with a GGTT that matches the most strict constraints over all
concurrent users. However, this causes a problem if the vma is currently
in use as we must wait until it is idle before moving it. But there is
no restriction on the number of views we may use (apart from the limited
size of the GGTT itself), and so if the active vma does not meet our
requirements, try and build a new one!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200605165258.1483-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c