Skip to content

Commit

Permalink
drm/nv50: enable page flipping
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Feb 24, 2011
1 parent 1d3fac0 commit d7117e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
11 changes: 10 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,14 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
mutex_lock(&chan->mutex);

/* Emit a page flip */
if (dev_priv->card_type >= NV_50) {
ret = nv50_display_flip_next(crtc, fb, chan);
if (ret) {
nouveau_channel_put(&chan);
goto fail_unreserve;
}
}

ret = nouveau_page_flip_emit(chan, old_bo, new_bo, s, &fence);
nouveau_channel_put(&chan);
if (ret)
Expand Down Expand Up @@ -347,7 +355,8 @@ nouveau_finish_page_flip(struct nouveau_channel *chan,
}

list_del(&s->head);
*ps = *s;
if (ps)
*ps = *s;
kfree(s);

spin_unlock_irqrestore(&dev->event_lock, flags);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data,
getparam->value = 1;
break;
case NOUVEAU_GETPARAM_HAS_PAGEFLIP:
getparam->value = (dev_priv->card_type < NV_50);
getparam->value = (dev_priv->card_type < NV_C0) ? 1 : 0;
break;
case NOUVEAU_GETPARAM_GRAPH_UNITS:
/* NV40 and NV50 versions are quite different, but register
Expand Down
7 changes: 1 addition & 6 deletions drivers/gpu/drm/nouveau/nv50_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,7 @@ static int
nv50_graph_nvsw_mthd_page_flip(struct nouveau_channel *chan,
u32 class, u32 mthd, u32 data)
{
struct nouveau_page_flip_state s;

if (!nouveau_finish_page_flip(chan, &s)) {
/* XXX - Do something here */
}

nouveau_finish_page_flip(chan, NULL);
return 0;
}

Expand Down

0 comments on commit d7117e0

Please sign in to comment.