Commit d7117e0d authored by Ben Skeggs's avatar Ben Skeggs

drm/nv50: enable page flipping

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 1d3fac0c
...@@ -297,6 +297,14 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, ...@@ -297,6 +297,14 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
mutex_lock(&chan->mutex); mutex_lock(&chan->mutex);
/* Emit a page flip */ /* 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); ret = nouveau_page_flip_emit(chan, old_bo, new_bo, s, &fence);
nouveau_channel_put(&chan); nouveau_channel_put(&chan);
if (ret) if (ret)
...@@ -347,6 +355,7 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, ...@@ -347,6 +355,7 @@ nouveau_finish_page_flip(struct nouveau_channel *chan,
} }
list_del(&s->head); list_del(&s->head);
if (ps)
*ps = *s; *ps = *s;
kfree(s); kfree(s);
......
...@@ -1118,7 +1118,7 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data, ...@@ -1118,7 +1118,7 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data,
getparam->value = 1; getparam->value = 1;
break; break;
case NOUVEAU_GETPARAM_HAS_PAGEFLIP: case NOUVEAU_GETPARAM_HAS_PAGEFLIP:
getparam->value = (dev_priv->card_type < NV_50); getparam->value = (dev_priv->card_type < NV_C0) ? 1 : 0;
break; break;
case NOUVEAU_GETPARAM_GRAPH_UNITS: case NOUVEAU_GETPARAM_GRAPH_UNITS:
/* NV40 and NV50 versions are quite different, but register /* NV40 and NV50 versions are quite different, but register
......
...@@ -409,12 +409,7 @@ static int ...@@ -409,12 +409,7 @@ static int
nv50_graph_nvsw_mthd_page_flip(struct nouveau_channel *chan, nv50_graph_nvsw_mthd_page_flip(struct nouveau_channel *chan,
u32 class, u32 mthd, u32 data) u32 class, u32 mthd, u32 data)
{ {
struct nouveau_page_flip_state s; nouveau_finish_page_flip(chan, NULL);
if (!nouveau_finish_page_flip(chan, &s)) {
/* XXX - Do something here */
}
return 0; return 0;
} }
......
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