--- initial
+++ final
@@ -1,80 +1,80 @@
 int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event, uint32_t page_flip_flags, uint32_t target, struct drm_modeset_acquire_ctx *ctx) {
   struct drm_device *dev = crtc->dev;
   struct amdgpu_device *adev = dev->dev_private;
   struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
   struct drm_gem_object *obj;
   struct amdgpu_flip_work *work;
   struct amdgpu_bo *new_abo;
   unsigned long flags;
   u64 tiling_flags;
   u64 base;
   int i, r;
   work = kzalloc(sizeof *work, GFP_KERNEL);
   if (work == NULL) return -ENOMEM;
   INIT_DELAYED_WORK(&work->flip_work, amdgpu_display_flip_work_func);
   INIT_WORK(&work->unpin_work, amdgpu_display_unpin_work_func);
   work->event = event;
   work->adev = adev;
   work->crtc_id = amdgpu_crtc->crtc_id;
   work->async = (page_flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0;
   /* schedule unpin of the old buffer */
   obj = crtc->primary->fb->obj[0];
   /* take a reference to the old object */
   work->old_abo = gem_to_amdgpu_bo(obj);
   amdgpu_bo_ref(work->old_abo);
   obj = fb->obj[0];
   new_abo = gem_to_amdgpu_bo(obj);
   /* pin the new buffer */
   r = amdgpu_bo_reserve(new_abo, false);
   if (unlikely(r != 0)) {
     DRM_ERROR("failed to reserve new abo buffer before flip\n");
     goto cleanup;
   }
-  r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev), &base);
+  r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev));
   if (unlikely(r != 0)) {
     DRM_ERROR("failed to pin new abo buffer before flip\n");
     goto unreserve;
   }
   r = reservation_object_get_fences_rcu(new_abo->tbo.resv, &work->excl, &work->shared_count, &work->shared);
   if (unlikely(r != 0)) {
     DRM_ERROR("failed to get fences for buffer\n");
     goto unpin;
   }
   amdgpu_bo_get_tiling_flags(new_abo, &tiling_flags);
   amdgpu_bo_unreserve(new_abo);
-  work->base = base;
+  work->base = amdgpu_bo_gpu_offset(new_abo);
   work->target_vblank = target - (uint32_t)drm_crtc_vblank_count(crtc) + amdgpu_get_vblank_counter_kms(dev, work->crtc_id);
   /* we borrow the event spin lock for protecting flip_wrok */
   spin_lock_irqsave(&crtc->dev->event_lock, flags);
   if (amdgpu_crtc->pflip_status != AMDGPU_FLIP_NONE) {
     DRM_DEBUG_DRIVER("flip queue: crtc already busy\n");
     spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
     r = -EBUSY;
     goto pflip_cleanup;
   }
   amdgpu_crtc->pflip_status = AMDGPU_FLIP_PENDING;
   amdgpu_crtc->pflip_works = work;
   DRM_DEBUG_DRIVER("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_PENDING, work: %p,\n", amdgpu_crtc->crtc_id, amdgpu_crtc, work);
   /* update crtc fb */
   crtc->primary->fb = fb;
   spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
   amdgpu_display_flip_work_func(&work->flip_work.work);
   return 0;
 pflip_cleanup:
   if (unlikely(amdgpu_bo_reserve(new_abo, false) != 0)) {
     DRM_ERROR("failed to reserve new abo in error path\n");
     goto cleanup;
   }
 unpin:
   if (unlikely(amdgpu_bo_unpin(new_abo) != 0)) { DRM_ERROR("failed to unpin new abo in error path\n"); }
 unreserve:
   amdgpu_bo_unreserve(new_abo);
 cleanup:
   amdgpu_bo_unref(&work->old_abo);
   dma_fence_put(work->excl);
   for (i = 0; i < work->shared_count; ++i)
     dma_fence_put(work->shared[i]);
   kfree(work->shared);
   kfree(work);
   return r;
 }<sep>@@
expression e1,e2,r;
local idexpression i;
@@

        r = amdgpu_bo_pin(e1,e2
-                     ,&i
                     );
	...
-	i
+	amdgpu_bo_gpu_offset(e1)
	... when != i