|
@@ -350,11 +350,15 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
|
|
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
|
|
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
|
|
struct drm_plane *primary = crtc->primary;
|
|
struct drm_plane *primary = crtc->primary;
|
|
struct drm_gem_object *bo;
|
|
struct drm_gem_object *bo;
|
|
|
|
+ unsigned long flags;
|
|
|
|
|
|
DBG("%d -> %d (event=%p)", primary->fb ? primary->fb->base.id : -1,
|
|
DBG("%d -> %d (event=%p)", primary->fb ? primary->fb->base.id : -1,
|
|
fb->base.id, event);
|
|
fb->base.id, event);
|
|
|
|
|
|
|
|
+ spin_lock_irqsave(&dev->event_lock, flags);
|
|
|
|
+
|
|
if (omap_crtc->old_fb) {
|
|
if (omap_crtc->old_fb) {
|
|
|
|
+ spin_unlock_irqrestore(&dev->event_lock, flags);
|
|
dev_err(dev->dev, "already a pending flip\n");
|
|
dev_err(dev->dev, "already a pending flip\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
@@ -362,6 +366,8 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
|
|
omap_crtc->event = event;
|
|
omap_crtc->event = event;
|
|
omap_crtc->old_fb = primary->fb = fb;
|
|
omap_crtc->old_fb = primary->fb = fb;
|
|
|
|
|
|
|
|
+ spin_unlock_irqrestore(&dev->event_lock, flags);
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Hold a reference temporarily until the crtc is updated
|
|
* Hold a reference temporarily until the crtc is updated
|
|
* and takes the reference to the bo. This avoids it
|
|
* and takes the reference to the bo. This avoids it
|