diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index da3c82e301b1..5791ecd908a5 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -3522,14 +3522,15 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data, | |||
3522 | goto out; | 3522 | goto out; |
3523 | } | 3523 | } |
3524 | 3524 | ||
3525 | obj->user_pin_count++; | 3525 | if (obj->user_pin_count == 0) { |
3526 | obj->pin_filp = file; | ||
3527 | if (obj->user_pin_count == 1) { | ||
3528 | ret = i915_gem_object_pin(obj, args->alignment, true, false); | 3526 | ret = i915_gem_object_pin(obj, args->alignment, true, false); |
3529 | if (ret) | 3527 | if (ret) |
3530 | goto out; | 3528 | goto out; |
3531 | } | 3529 | } |
3532 | 3530 | ||
3531 | obj->user_pin_count++; | ||
3532 | obj->pin_filp = file; | ||
3533 | |||
3533 | /* XXX - flush the CPU caches for pinned objects | 3534 | /* XXX - flush the CPU caches for pinned objects |
3534 | * as the X server doesn't manage domains yet | 3535 | * as the X server doesn't manage domains yet |
3535 | */ | 3536 | */ |