Commit c313d567 authored by Dave Airlie's avatar Dave Airlie

Merge remote-tracking branch 'pfdo/drm-fixes' into drm-next

Pull the vblank event changes into a Linus master tree to make merging
easier.
parents b91fd4d5 0eca56f9
...@@ -638,17 +638,8 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, ...@@ -638,17 +638,8 @@ nouveau_finish_page_flip(struct nouveau_channel *chan,
} }
s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head); s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head);
if (s->event) { if (s->event)
struct drm_pending_vblank_event *e = s->event; drm_send_vblank_event(dev, -1, s->event);
struct timeval now;
do_gettimeofday(&now);
e->event.sequence = 0;
e->event.tv_sec = now.tv_sec;
e->event.tv_usec = now.tv_usec;
list_add_tail(&e->base.link, &e->base.file_priv->event_list);
wake_up_interruptible(&e->base.file_priv->event_wait);
}
list_del(&s->head); list_del(&s->head);
if (ps) if (ps)
......
...@@ -271,8 +271,6 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) ...@@ -271,8 +271,6 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
{ {
struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
struct radeon_unpin_work *work; struct radeon_unpin_work *work;
struct drm_pending_vblank_event *e;
struct timeval now;
unsigned long flags; unsigned long flags;
u32 update_pending; u32 update_pending;
int vpos, hpos; int vpos, hpos;
...@@ -328,14 +326,9 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) ...@@ -328,14 +326,9 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
radeon_crtc->unpin_work = NULL; radeon_crtc->unpin_work = NULL;
/* wakeup userspace */ /* wakeup userspace */
if (work->event) { if (work->event)
e = work->event; drm_send_vblank_event(rdev->ddev, crtc_id, work->event);
e->event.sequence = drm_vblank_count_and_time(rdev->ddev, crtc_id, &now);
e->event.tv_sec = now.tv_sec;
e->event.tv_usec = now.tv_usec;
list_add_tail(&e->base.link, &e->base.file_priv->event_list);
wake_up_interruptible(&e->base.file_priv->event_wait);
}
spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); spin_unlock_irqrestore(&rdev->ddev->event_lock, flags);
drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id);
......
...@@ -451,27 +451,16 @@ void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) ...@@ -451,27 +451,16 @@ void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc)
{ {
struct drm_pending_vblank_event *event; struct drm_pending_vblank_event *event;
struct drm_device *dev = scrtc->crtc.dev; struct drm_device *dev = scrtc->crtc.dev;
struct timeval vblanktime;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&dev->event_lock, flags); spin_lock_irqsave(&dev->event_lock, flags);
event = scrtc->event; event = scrtc->event;
scrtc->event = NULL; scrtc->event = NULL;
if (event) {
drm_send_vblank_event(dev, 0, event);
drm_vblank_put(dev, 0);
}
spin_unlock_irqrestore(&dev->event_lock, flags); spin_unlock_irqrestore(&dev->event_lock, flags);
if (event == NULL)
return;
event->event.sequence = drm_vblank_count_and_time(dev, 0, &vblanktime);
event->event.tv_sec = vblanktime.tv_sec;
event->event.tv_usec = vblanktime.tv_usec;
spin_lock_irqsave(&dev->event_lock, flags);
list_add_tail(&event->base.link, &event->base.file_priv->event_list);
wake_up_interruptible(&event->base.file_priv->event_wait);
spin_unlock_irqrestore(&dev->event_lock, flags);
drm_vblank_put(dev, 0);
} }
static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc, static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc,
......
...@@ -316,31 +316,14 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc, ...@@ -316,31 +316,14 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc) static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc)
{ {
struct drm_pending_vblank_event *e;
struct timeval now;
unsigned long flags; unsigned long flags;
struct drm_device *drm = ipu_crtc->base.dev; struct drm_device *drm = ipu_crtc->base.dev;
spin_lock_irqsave(&drm->event_lock, flags); spin_lock_irqsave(&drm->event_lock, flags);
if (ipu_crtc->page_flip_event)
e = ipu_crtc->page_flip_event; drm_send_vblank_event(drm, -1, ipu_crtc->page_flip_event);
if (!e) {
spin_unlock_irqrestore(&drm->event_lock, flags);
return;
}
do_gettimeofday(&now);
e->event.sequence = 0;
e->event.tv_sec = now.tv_sec;
e->event.tv_usec = now.tv_usec;
ipu_crtc->page_flip_event = NULL; ipu_crtc->page_flip_event = NULL;
imx_drm_crtc_vblank_put(ipu_crtc->imx_crtc); imx_drm_crtc_vblank_put(ipu_crtc->imx_crtc);
list_add_tail(&e->base.link, &e->base.file_priv->event_list);
wake_up_interruptible(&e->base.file_priv->event_wait);
spin_unlock_irqrestore(&drm->event_lock, flags); spin_unlock_irqrestore(&drm->event_lock, flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment