Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205135
b: refs/heads/master
c: 96b099f
h: refs/heads/master
i:
  205133: 785c37d
  205131: 7b63f61
  205127: 7072ce6
  205119: 0329420
v: v3
  • Loading branch information
Chris Wilson authored and Eric Anholt committed Aug 2, 2010
1 parent 2c17daa commit 2efa747
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f35308bab7efd8c03e4bb4feea07f9b94138c3c
refs/heads/master: 96b099fd6d64389e619dbf7ca9059bf16e441f6b
35 changes: 21 additions & 14 deletions trunk/drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -4897,27 +4897,20 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,

mutex_lock(&dev->struct_mutex);
ret = intel_pin_and_fence_fb_obj(dev, obj);
if (ret != 0) {
mutex_unlock(&dev->struct_mutex);

spin_lock_irqsave(&dev->event_lock, flags);
intel_crtc->unpin_work = NULL;
spin_unlock_irqrestore(&dev->event_lock, flags);

kfree(work);

DRM_DEBUG_DRIVER("flip queue: %p pin & fence failed\n",
to_intel_bo(obj));
return ret;
}
if (ret)
goto cleanup_work;

/* Reference the objects for the scheduled work. */
drm_gem_object_reference(work->old_fb_obj);
drm_gem_object_reference(obj);

crtc->fb = fb;
i915_gem_object_flush_write_domain(obj);
drm_vblank_get(dev, intel_crtc->pipe);

ret = drm_vblank_get(dev, intel_crtc->pipe);
if (ret)
goto cleanup_objs;

obj_priv = to_intel_bo(obj);
atomic_inc(&obj_priv->pending_flip);
work->pending_flip_obj = obj;
Expand Down Expand Up @@ -4954,6 +4947,20 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
trace_i915_flip_request(intel_crtc->plane, obj);

return 0;

cleanup_objs:
drm_gem_object_unreference(work->old_fb_obj);
drm_gem_object_unreference(obj);
cleanup_work:
mutex_unlock(&dev->struct_mutex);

spin_lock_irqsave(&dev->event_lock, flags);
intel_crtc->unpin_work = NULL;
spin_unlock_irqrestore(&dev->event_lock, flags);

kfree(work);

return ret;
}

static const struct drm_crtc_helper_funcs intel_helper_funcs = {
Expand Down

0 comments on commit 2efa747

Please sign in to comment.