diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_tiling.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_tiling.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index 2cefb597df6d..2b1eaa29ada4 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c | |||
@@ -364,22 +364,9 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, | |||
364 | * has to also include the unfenced register the GPU uses | 364 | * has to also include the unfenced register the GPU uses |
365 | * whilst executing a fenced command for an untiled object. | 365 | * whilst executing a fenced command for an untiled object. |
366 | */ | 366 | */ |
367 | 367 | if (obj->map_and_fenceable && | |
368 | obj->map_and_fenceable = | 368 | !i915_gem_object_fence_ok(obj, args->tiling_mode)) |
369 | !i915_gem_obj_ggtt_bound(obj) || | 369 | ret = i915_gem_object_ggtt_unbind(obj); |
370 | (i915_gem_obj_ggtt_offset(obj) + | ||
371 | obj->base.size <= dev_priv->gtt.mappable_end && | ||
372 | i915_gem_object_fence_ok(obj, args->tiling_mode)); | ||
373 | |||
374 | /* Rebind if we need a change of alignment */ | ||
375 | if (!obj->map_and_fenceable) { | ||
376 | u32 unfenced_align = | ||
377 | i915_gem_get_gtt_alignment(dev, obj->base.size, | ||
378 | args->tiling_mode, | ||
379 | false); | ||
380 | if (i915_gem_obj_ggtt_offset(obj) & (unfenced_align - 1)) | ||
381 | ret = i915_gem_object_ggtt_unbind(obj); | ||
382 | } | ||
383 | 370 | ||
384 | if (ret == 0) { | 371 | if (ret == 0) { |
385 | obj->fence_dirty = | 372 | obj->fence_dirty = |