X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=nouveau%2Fpushbuf.c;h=6e703a44b6bc0498f8c96fafb5d977efa00e36f9;hb=56c4857f1763b40e566839bdc6fa14f873baf9b8;hp=0e37ce3d2a834560b2971976fb0846ba00096b8a;hpb=9e0026d35c56374b53a0b3837e24412bc9a4d8c9;p=platform%2Fupstream%2Flibdrm.git diff --git a/nouveau/pushbuf.c b/nouveau/pushbuf.c index 0e37ce3..6e703a4 100644 --- a/nouveau/pushbuf.c +++ b/nouveau/pushbuf.c @@ -347,8 +347,10 @@ pushbuf_submit(struct nouveau_pushbuf *push, struct nouveau_object *chan) &req, sizeof(req)); nvpb->suffix0 = req.suffix0; nvpb->suffix1 = req.suffix1; - dev->vram_limit = (req.vram_available * 80) / 100; - dev->gart_limit = (req.gart_available * 80) / 100; + dev->vram_limit = (req.vram_available * + nouveau_device(dev)->vram_limit_percent) / 100; + dev->gart_limit = (req.gart_available * + nouveau_device(dev)->gart_limit_percent) / 100; #else if (dbg_on(31)) ret = -EINVAL; @@ -524,10 +526,10 @@ pushbuf_validate(struct nouveau_pushbuf *push, bool retry) } } - return 0; + return ret; } -int +drm_public int nouveau_pushbuf_new(struct nouveau_client *client, struct nouveau_object *chan, int nr, uint32_t size, bool immediate, struct nouveau_pushbuf **ppush) @@ -574,13 +576,13 @@ nouveau_pushbuf_new(struct nouveau_client *client, struct nouveau_object *chan, push->client = client; push->channel = immediate ? chan : NULL; push->flags = NOUVEAU_BO_RD; - if (fifo->pushbuf & NOUVEAU_GEM_DOMAIN_VRAM) { - push->flags |= NOUVEAU_BO_VRAM; - nvpb->type = NOUVEAU_BO_VRAM; - } if (fifo->pushbuf & NOUVEAU_GEM_DOMAIN_GART) { push->flags |= NOUVEAU_BO_GART; nvpb->type = NOUVEAU_BO_GART; + } else + if (fifo->pushbuf & NOUVEAU_GEM_DOMAIN_VRAM) { + push->flags |= NOUVEAU_BO_VRAM; + nvpb->type = NOUVEAU_BO_VRAM; } nvpb->type |= NOUVEAU_BO_MAP; @@ -598,7 +600,7 @@ nouveau_pushbuf_new(struct nouveau_client *client, struct nouveau_object *chan, return 0; } -void +drm_public void nouveau_pushbuf_del(struct nouveau_pushbuf **ppush) { struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(*ppush); @@ -624,7 +626,7 @@ nouveau_pushbuf_del(struct nouveau_pushbuf **ppush) *ppush = NULL; } -struct nouveau_bufctx * +drm_public struct nouveau_bufctx * nouveau_pushbuf_bufctx(struct nouveau_pushbuf *push, struct nouveau_bufctx *ctx) { struct nouveau_bufctx *prev = push->bufctx; @@ -632,7 +634,7 @@ nouveau_pushbuf_bufctx(struct nouveau_pushbuf *push, struct nouveau_bufctx *ctx) return prev; } -int +drm_public int nouveau_pushbuf_space(struct nouveau_pushbuf *push, uint32_t dwords, uint32_t relocs, uint32_t pushes) { @@ -696,7 +698,7 @@ nouveau_pushbuf_space(struct nouveau_pushbuf *push, return flushed ? pushbuf_validate(push, false) : 0; } -void +drm_public void nouveau_pushbuf_data(struct nouveau_pushbuf *push, struct nouveau_bo *bo, uint64_t offset, uint64_t length) { @@ -726,27 +728,28 @@ nouveau_pushbuf_data(struct nouveau_pushbuf *push, struct nouveau_bo *bo, } } -int +drm_public int nouveau_pushbuf_refn(struct nouveau_pushbuf *push, struct nouveau_pushbuf_refn *refs, int nr) { return pushbuf_refn(push, true, refs, nr); } -void +drm_public void nouveau_pushbuf_reloc(struct nouveau_pushbuf *push, struct nouveau_bo *bo, uint32_t data, uint32_t flags, uint32_t vor, uint32_t tor) { - *push->cur++ = pushbuf_krel(push, bo, data, flags, vor, tor); + *push->cur = pushbuf_krel(push, bo, data, flags, vor, tor); + push->cur++; } -int +drm_public int nouveau_pushbuf_validate(struct nouveau_pushbuf *push) { return pushbuf_validate(push, true); } -uint32_t +drm_public uint32_t nouveau_pushbuf_refd(struct nouveau_pushbuf *push, struct nouveau_bo *bo) { struct drm_nouveau_gem_pushbuf_bo *kref; @@ -763,7 +766,7 @@ nouveau_pushbuf_refd(struct nouveau_pushbuf *push, struct nouveau_bo *bo) return flags; } -int +drm_public int nouveau_pushbuf_kick(struct nouveau_pushbuf *push, struct nouveau_object *chan) { if (!push->channel)