diff options
author | 2010-04-16 16:33:33 +0000 | |
---|---|---|
committer | 2010-04-16 16:33:33 +0000 | |
commit | afbedb0fac2b1d05b238a2a826810db5bdd98db2 (patch) | |
tree | ad867c436c80127c9e3470320081fe4f687497c3 /sys | |
parent | Correct reversed test in set_tiling. this should deal with the fence (diff) | |
download | wireguard-openbsd-afbedb0fac2b1d05b238a2a826810db5bdd98db2.tar.xz wireguard-openbsd-afbedb0fac2b1d05b238a2a826810db5bdd98db2.zip |
Additional gtt alignment paranoia:
when we go to pin, additionally check alignment against that required
for tiling and unbind/rebind if needed. We shouldn't hit this case, but
it is a good to check (would have found the bug in the last commit).
tested by mlarkin and matthieu (and myself, of course)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/i915_drv.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index 21db523a421..2abcda9d60c 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -3170,9 +3170,11 @@ i915_gem_object_pin(struct drm_obj *obj, uint32_t alignment, int needs_fence) * otherwise, so just fail the pin (with a printf so we can fix a * wrong userland). */ - if ((alignment && obj_priv->dmamap != NULL && - obj_priv->gtt_offset & (alignment - 1)) || (needs_fence && - !i915_gem_object_fence_offset_ok(obj, obj_priv->tiling_mode))) { + if (obj_priv->dmamap != NULL && + ((alignment && obj_priv->gtt_offset & (alignment - 1)) || + obj_priv->gtt_offset & (i915_gem_get_gtt_alignment(obj) - 1) || + (needs_fence && !i915_gem_object_fence_offset_ok(obj, + obj_priv->tiling_mode)))) { if (obj_priv->pin_count == 0) { ret = i915_gem_object_unbind(obj, 1); if (ret) |