@@ -2597,7 +2597,6 @@ i915_gem_clear_fence_reg(struct drm_gem_object *obj)
int
i915_gem_object_put_fence_reg(struct drm_gem_object *obj)
{
- struct drm_device *dev = obj->dev;
struct drm_i915_gem_object *obj_priv = obj->driver_private;
if (obj_priv->fence_reg == I915_FENCE_REG_NONE)
@@ -2609,11 +2608,7 @@ i915_gem_object_put_fence_reg(struct drm_gem_object *obj)
*/
i915_gem_release_mmap(obj);
- /* On the i915, GPU access to tiled buffers is via a fence,
- * therefore we must wait for any outstanding access to complete
- * before clearing the fence.
- */
- if (!IS_I965G(dev)) {
+ if (obj_priv->fenced_gpu_access) {
int ret;
ret = i915_gem_object_flush_gpu_write_domain(obj, 0);