Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325107
b: refs/heads/master
c: 119c081
h: refs/heads/master
i:
  325105: c9f63b0
  325103: e39ce7f
v: v3
  • Loading branch information
Rob Clark authored and Greg Kroah-Hartman committed Sep 10, 2012
1 parent d779885 commit a2c3631
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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: 1004689cd9ece7f613b48d351c6f00b7aec1bae3
refs/heads/master: 119c08149ab5135eda67a1503484aacbf2164af3
16 changes: 14 additions & 2 deletions trunk/drivers/staging/omapdrm/omap_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ static void page_flip_cb(void *arg)
struct drm_crtc *crtc = arg;
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
struct drm_framebuffer *old_fb = omap_crtc->old_fb;
struct drm_gem_object *bo;

omap_crtc->old_fb = NULL;

Expand All @@ -165,6 +166,9 @@ static void page_flip_cb(void *arg)
* cycle.. for now go for correctness and later figure out speed..
*/
omap_plane_on_endwin(omap_crtc->plane, vblank_cb, crtc);

bo = omap_framebuffer_bo(crtc->fb, 0);
drm_gem_object_unreference_unlocked(bo);
}

static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
Expand All @@ -173,6 +177,7 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
{
struct drm_device *dev = crtc->dev;
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
struct drm_gem_object *bo;

DBG("%d -> %d", crtc->fb ? crtc->fb->base.id : -1, fb->base.id);

Expand All @@ -185,8 +190,15 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
omap_crtc->event = event;
crtc->fb = fb;

omap_gem_op_async(omap_framebuffer_bo(fb, 0), OMAP_GEM_READ,
page_flip_cb, crtc);
/*
* Hold a reference temporarily until the crtc is updated
* and takes the reference to the bo. This avoids it
* getting freed from under us:
*/
bo = omap_framebuffer_bo(fb, 0);
drm_gem_object_reference(bo);

omap_gem_op_async(bo, OMAP_GEM_READ, page_flip_cb, crtc);

return 0;
}
Expand Down

0 comments on commit a2c3631

Please sign in to comment.