iowrite32_native(data, chan->user + addr);
 }
 
+int
+nouveau_fifo_chid(struct nouveau_fifo *priv, struct nouveau_object *object)
+{
+       int engidx = nv_hclass(priv) & 0xff;
+
+       while (object && object->parent) {
+               if ( nv_iclass(object->parent, NV_ENGCTX_CLASS) &&
+                   (nv_hclass(object->parent) & 0xff) == engidx)
+                       return nouveau_fifo_chan(object)->chid;
+               object = object->parent;
+       }
+
+       return -1;
+}
+
 void
 nouveau_fifo_destroy(struct nouveau_fifo *priv)
 {
        if (!priv->channel)
                return -ENOMEM;
 
+       priv->chid = nouveau_fifo_chid;
        spin_lock_init(&priv->lock);
        return 0;
 }
 
        u16 min;
        u16 max;
 
+       int  (*chid)(struct nouveau_fifo *, struct nouveau_object *);
        void (*pause)(struct nouveau_fifo *, unsigned long *);
        void (*start)(struct nouveau_fifo *, unsigned long *);
 };