X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=nouveau%2Fabi16.c;h=f34175e02b2904658d39a5b222f9fa0f407ebb75;hb=b26dc002f7834f49b99822a1608a99de2fbac74e;hp=688a9ac6c6e8c821fb86a724ee29079a8d66b1a1;hpb=292da616fe1f936ca78a3fa8e1b1b19883e343b6;p=platform%2Fupstream%2Flibdrm.git diff --git a/nouveau/abi16.c b/nouveau/abi16.c index 688a9ac..f34175e 100644 --- a/nouveau/abi16.c +++ b/nouveau/abi16.c @@ -24,20 +24,19 @@ #include #include +#include #include "private.h" + int abi16_chan_nv04(struct nouveau_object *obj) { struct nouveau_device *dev = (struct nouveau_device *)obj->parent; - struct drm_nouveau_channel_alloc req; struct nv04_fifo *nv04 = obj->data; + struct drm_nouveau_channel_alloc req = {nv04->vram, nv04->gart}; int ret; - req.fb_ctxdma_handle = nv04->vram; - req.tt_ctxdma_handle = nv04->gart; - ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC, &req, sizeof(req)); if (ret) @@ -55,7 +54,7 @@ int abi16_chan_nvc0(struct nouveau_object *obj) { struct nouveau_device *dev = (struct nouveau_device *)obj->parent; - struct drm_nouveau_channel_alloc req; + struct drm_nouveau_channel_alloc req = {}; struct nvc0_fifo *nvc0 = obj->data; int ret; @@ -66,12 +65,39 @@ abi16_chan_nvc0(struct nouveau_object *obj) nvc0->base.channel = req.channel; nvc0->base.pushbuf = req.pushbuf_domains; + nvc0->notify = req.notifier_handle; nvc0->base.object->handle = req.channel; nvc0->base.object->length = sizeof(*nvc0); return 0; } int +abi16_chan_nve0(struct nouveau_object *obj) +{ + struct nouveau_device *dev = (struct nouveau_device *)obj->parent; + struct drm_nouveau_channel_alloc req = {}; + struct nve0_fifo *nve0 = obj->data; + int ret; + + if (obj->length > offsetof(struct nve0_fifo, engine)) { + req.fb_ctxdma_handle = 0xffffffff; + req.tt_ctxdma_handle = nve0->engine; + } + + ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC, + &req, sizeof(req)); + if (ret) + return ret; + + nve0->base.channel = req.channel; + nve0->base.pushbuf = req.pushbuf_domains; + nve0->notify = req.notifier_handle; + nve0->base.object->handle = req.channel; + nve0->base.object->length = sizeof(*nve0); + return 0; +} + +int abi16_engobj(struct nouveau_object *obj) { struct drm_nouveau_grobj_alloc req = {