summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2014-02-10 14:57:01 +0900
committerBen Skeggs <bskeggs@redhat.com>2014-02-18 10:40:22 +1000
commitbdddee2167998c9def89d595e95697dd549f53d5 (patch)
treefd58e6bad08a3e56a94a59aa31345d333135ff38
parenta330e9444a19d59bf4498a08ae928f66dd8d5482 (diff)
fifo/nve0: allocate usermem as needed
Memory was always allocated for 4096 channels. Change this to allocate what we actually need according to the number of channels we use. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--nvkm/engine/fifo/nve0.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nvkm/engine/fifo/nve0.c b/nvkm/engine/fifo/nve0.c
index 54c1b5b4..dbc3ff63 100644
--- a/nvkm/engine/fifo/nve0.c
+++ b/nvkm/engine/fifo/nve0.c
@@ -852,8 +852,8 @@ nve0_fifo_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return ret;
}
- ret = nouveau_gpuobj_new(nv_object(priv), NULL, 4096 * 0x200, 0x1000,
- NVOBJ_FLAG_ZERO_ALLOC, &priv->user.mem);
+ ret = nouveau_gpuobj_new(nv_object(priv), NULL, impl->channels * 0x200,
+ 0x1000, NVOBJ_FLAG_ZERO_ALLOC, &priv->user.mem);
if (ret)
return ret;