diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
index b18cad0..d2ce47e 100644
--- a/include/drm/nouveau_drm.h
+++ b/include/drm/nouveau_drm.h
@@ -49,6 +49,10 @@ struct drm_nouveau_channel_free {
        int channel;
 };
 
+struct drm_nouveau_channel_wait {
+       int channel;
+};
+
 struct drm_nouveau_grobj_alloc {
        int      channel;
        uint32_t handle;
@@ -204,5 +208,6 @@ struct drm_nouveau_sarea {
 #define DRM_NOUVEAU_GEM_CPU_PREP       0x42
 #define DRM_NOUVEAU_GEM_CPU_FINI       0x43
 #define DRM_NOUVEAU_GEM_INFO           0x44
+#define DRM_NOUVEAU_CHANNEL_WAIT       0x45
 
 #endif /* __NOUVEAU_DRM_H__ */
diff --git a/nouveau/nouveau_channel.c b/nouveau/nouveau_channel.c
index 96fa03b..1f03732 100644
--- a/nouveau/nouveau_channel.c
+++ b/nouveau/nouveau_channel.c
@@ -139,4 +139,20 @@ nouveau_channel_free(struct nouveau_channel **chan)
        free(nvchan);
 }
 
+int
+nouveau_channel_wait(struct nouveau_channel *chan)
+{
+       struct nouveau_channel_priv *nvchan;
+       struct nouveau_device_priv *nvdev;
+       struct drm_nouveau_channel_wait cw;
+       int ret;
+
+       if (!chan)
+               return 0;
+       nvchan = nouveau_channel(chan);
+       nvdev = nouveau_device(nvchan->base.device);
+       cw.channel = chan->id;
+       ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_CHANNEL_WAIT, &cw, 
sizeof(cw));
+       return ret;
 
+}
diff --git a/nouveau/nouveau_channel.h b/nouveau/nouveau_channel.h
index d61a4c0..f7caf64 100644
--- a/nouveau/nouveau_channel.h
+++ b/nouveau/nouveau_channel.h
@@ -54,4 +54,7 @@ nouveau_channel_alloc(struct nouveau_device *, uint32_t fb, 
uint32_t tt,
 void
 nouveau_channel_free(struct nouveau_channel **);
 
+int
+nouveau_channel_wait(struct nouveau_channel *);
+
 #endif
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to