diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-10-14 19:15:26 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-12-03 00:06:51 -0500 |
commit | 9100468d1be26063aa25ecd667ea922c101d203f (patch) | |
tree | 666e642afa5d21fa135546ced3c79a7d9985f87c | |
parent | 0541324abce0225a795222558fdfe35c8dbc5b4f (diff) |
drm/nouveau: pass gpuobj alignment request down into backing allocator
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_object.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_instmem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_instmem.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvc0_instmem.c | 6 |
5 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index d152bc334fd6..1d474f526986 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -265,7 +265,7 @@ struct nouveau_instmem_engine { | |||
265 | void (*resume)(struct drm_device *dev); | 265 | void (*resume)(struct drm_device *dev); |
266 | 266 | ||
267 | int (*populate)(struct drm_device *, struct nouveau_gpuobj *, | 267 | int (*populate)(struct drm_device *, struct nouveau_gpuobj *, |
268 | uint32_t *size); | 268 | u32 *size, u32 align); |
269 | void (*clear)(struct drm_device *, struct nouveau_gpuobj *); | 269 | void (*clear)(struct drm_device *, struct nouveau_gpuobj *); |
270 | int (*bind)(struct drm_device *, struct nouveau_gpuobj *); | 270 | int (*bind)(struct drm_device *, struct nouveau_gpuobj *); |
271 | int (*unbind)(struct drm_device *, struct nouveau_gpuobj *); | 271 | int (*unbind)(struct drm_device *, struct nouveau_gpuobj *); |
@@ -1121,7 +1121,7 @@ extern void nv04_instmem_takedown(struct drm_device *); | |||
1121 | extern int nv04_instmem_suspend(struct drm_device *); | 1121 | extern int nv04_instmem_suspend(struct drm_device *); |
1122 | extern void nv04_instmem_resume(struct drm_device *); | 1122 | extern void nv04_instmem_resume(struct drm_device *); |
1123 | extern int nv04_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, | 1123 | extern int nv04_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, |
1124 | uint32_t *size); | 1124 | u32 *size, u32 align); |
1125 | extern void nv04_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); | 1125 | extern void nv04_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); |
1126 | extern int nv04_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); | 1126 | extern int nv04_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); |
1127 | extern int nv04_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); | 1127 | extern int nv04_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); |
@@ -1133,7 +1133,7 @@ extern void nv50_instmem_takedown(struct drm_device *); | |||
1133 | extern int nv50_instmem_suspend(struct drm_device *); | 1133 | extern int nv50_instmem_suspend(struct drm_device *); |
1134 | extern void nv50_instmem_resume(struct drm_device *); | 1134 | extern void nv50_instmem_resume(struct drm_device *); |
1135 | extern int nv50_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, | 1135 | extern int nv50_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, |
1136 | uint32_t *size); | 1136 | u32 *size, u32 align); |
1137 | extern void nv50_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); | 1137 | extern void nv50_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); |
1138 | extern int nv50_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); | 1138 | extern int nv50_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); |
1139 | extern int nv50_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); | 1139 | extern int nv50_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); |
@@ -1147,7 +1147,7 @@ extern void nvc0_instmem_takedown(struct drm_device *); | |||
1147 | extern int nvc0_instmem_suspend(struct drm_device *); | 1147 | extern int nvc0_instmem_suspend(struct drm_device *); |
1148 | extern void nvc0_instmem_resume(struct drm_device *); | 1148 | extern void nvc0_instmem_resume(struct drm_device *); |
1149 | extern int nvc0_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, | 1149 | extern int nvc0_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, |
1150 | uint32_t *size); | 1150 | u32 *size, u32 align); |
1151 | extern void nvc0_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); | 1151 | extern void nvc0_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); |
1152 | extern int nvc0_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); | 1152 | extern int nvc0_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); |
1153 | extern int nvc0_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); | 1153 | extern int nvc0_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c index ce9958a30175..0b8183edfcd7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_object.c +++ b/drivers/gpu/drm/nouveau/nouveau_object.c | |||
@@ -112,7 +112,7 @@ nouveau_gpuobj_new(struct drm_device *dev, struct nouveau_channel *chan, | |||
112 | NV_DEBUG(dev, "global heap\n"); | 112 | NV_DEBUG(dev, "global heap\n"); |
113 | 113 | ||
114 | /* allocate backing pages, sets vinst */ | 114 | /* allocate backing pages, sets vinst */ |
115 | ret = engine->instmem.populate(dev, gpuobj, &size); | 115 | ret = engine->instmem.populate(dev, gpuobj, &size, align); |
116 | if (ret) { | 116 | if (ret) { |
117 | nouveau_gpuobj_ref(NULL, &gpuobj); | 117 | nouveau_gpuobj_ref(NULL, &gpuobj); |
118 | return ret; | 118 | return ret; |
diff --git a/drivers/gpu/drm/nouveau/nv04_instmem.c b/drivers/gpu/drm/nouveau/nv04_instmem.c index 0b5ae297abde..554e55d0ec48 100644 --- a/drivers/gpu/drm/nouveau/nv04_instmem.c +++ b/drivers/gpu/drm/nouveau/nv04_instmem.c | |||
@@ -99,7 +99,7 @@ nv04_instmem_takedown(struct drm_device *dev) | |||
99 | 99 | ||
100 | int | 100 | int |
101 | nv04_instmem_populate(struct drm_device *dev, struct nouveau_gpuobj *gpuobj, | 101 | nv04_instmem_populate(struct drm_device *dev, struct nouveau_gpuobj *gpuobj, |
102 | uint32_t *sz) | 102 | u32 *size, u32 align) |
103 | { | 103 | { |
104 | return 0; | 104 | return 0; |
105 | } | 105 | } |
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c index 0651e7629235..2c98eb176d64 100644 --- a/drivers/gpu/drm/nouveau/nv50_instmem.c +++ b/drivers/gpu/drm/nouveau/nv50_instmem.c | |||
@@ -322,19 +322,19 @@ nv50_instmem_resume(struct drm_device *dev) | |||
322 | 322 | ||
323 | int | 323 | int |
324 | nv50_instmem_populate(struct drm_device *dev, struct nouveau_gpuobj *gpuobj, | 324 | nv50_instmem_populate(struct drm_device *dev, struct nouveau_gpuobj *gpuobj, |
325 | uint32_t *sz) | 325 | u32 *size, u32 align) |
326 | { | 326 | { |
327 | int ret; | 327 | int ret; |
328 | 328 | ||
329 | if (gpuobj->im_backing) | 329 | if (gpuobj->im_backing) |
330 | return -EINVAL; | 330 | return -EINVAL; |
331 | 331 | ||
332 | *sz = ALIGN(*sz, 4096); | 332 | *size = ALIGN(*size, 4096); |
333 | if (*sz == 0) | 333 | if (*size == 0) |
334 | return -EINVAL; | 334 | return -EINVAL; |
335 | 335 | ||
336 | ret = nouveau_bo_new(dev, NULL, *sz, 0, TTM_PL_FLAG_VRAM, 0, 0x0000, | 336 | ret = nouveau_bo_new(dev, NULL, *size, align, TTM_PL_FLAG_VRAM, |
337 | true, false, &gpuobj->im_backing); | 337 | 0, 0x0000, true, false, &gpuobj->im_backing); |
338 | if (ret) { | 338 | if (ret) { |
339 | NV_ERROR(dev, "error getting PRAMIN backing pages: %d\n", ret); | 339 | NV_ERROR(dev, "error getting PRAMIN backing pages: %d\n", ret); |
340 | return ret; | 340 | return ret; |
diff --git a/drivers/gpu/drm/nouveau/nvc0_instmem.c b/drivers/gpu/drm/nouveau/nvc0_instmem.c index 13a0f78a9088..7b4e71f5c274 100644 --- a/drivers/gpu/drm/nouveau/nvc0_instmem.c +++ b/drivers/gpu/drm/nouveau/nvc0_instmem.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | int | 29 | int |
30 | nvc0_instmem_populate(struct drm_device *dev, struct nouveau_gpuobj *gpuobj, | 30 | nvc0_instmem_populate(struct drm_device *dev, struct nouveau_gpuobj *gpuobj, |
31 | uint32_t *size) | 31 | u32 *size, u32 align) |
32 | { | 32 | { |
33 | int ret; | 33 | int ret; |
34 | 34 | ||
@@ -36,8 +36,8 @@ nvc0_instmem_populate(struct drm_device *dev, struct nouveau_gpuobj *gpuobj, | |||
36 | if (*size == 0) | 36 | if (*size == 0) |
37 | return -EINVAL; | 37 | return -EINVAL; |
38 | 38 | ||
39 | ret = nouveau_bo_new(dev, NULL, *size, 0, TTM_PL_FLAG_VRAM, 0, 0x0000, | 39 | ret = nouveau_bo_new(dev, NULL, *size, align, TTM_PL_FLAG_VRAM, |
40 | true, false, &gpuobj->im_backing); | 40 | 0, 0x0000, true, false, &gpuobj->im_backing); |
41 | if (ret) { | 41 | if (ret) { |
42 | NV_ERROR(dev, "error getting PRAMIN backing pages: %d\n", ret); | 42 | NV_ERROR(dev, "error getting PRAMIN backing pages: %d\n", ret); |
43 | return ret; | 43 | return ret; |