aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>2019-05-16 10:55:41 -0400
committerPaul Kocialkowski <paul.kocialkowski@bootlin.com>2019-05-23 11:31:41 -0400
commit66fafd338780cb5adb7f290b384d9d3c6c7f6bb5 (patch)
tree026700b38f101e518caab309a4629d99cc5513dc
parent1f1635b187112e800350a4b33f4d3d2ad82b40b2 (diff)
drm/vc4: Reformat and the binner bo allocation helper
In preparation for wrapping the binner bo allocation helper with put/get helpers, pass the vc4 dev directly and drop the vc4 prefix. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/20190516145544.29051-2-paul.kocialkowski@bootlin.com
-rw-r--r--drivers/gpu/drm/vc4/vc4_v3d.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index a4b6859e3af6..7c490106e185 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -213,7 +213,7 @@ try_again:
213} 213}
214 214
215/** 215/**
216 * vc4_allocate_bin_bo() - allocates the memory that will be used for 216 * bin_bo_alloc() - allocates the memory that will be used for
217 * tile binning. 217 * tile binning.
218 * 218 *
219 * The binner has a limitation that the addresses in the tile state 219 * The binner has a limitation that the addresses in the tile state
@@ -234,9 +234,8 @@ try_again:
234 * overall CMA pool before they make scenes complicated enough to run 234 * overall CMA pool before they make scenes complicated enough to run
235 * out of bin space. 235 * out of bin space.
236 */ 236 */
237static int vc4_allocate_bin_bo(struct drm_device *drm) 237static int bin_bo_alloc(struct vc4_dev *vc4)
238{ 238{
239 struct vc4_dev *vc4 = to_vc4_dev(drm);
240 struct vc4_v3d *v3d = vc4->v3d; 239 struct vc4_v3d *v3d = vc4->v3d;
241 uint32_t size = 16 * 1024 * 1024; 240 uint32_t size = 16 * 1024 * 1024;
242 int ret = 0; 241 int ret = 0;
@@ -251,7 +250,7 @@ static int vc4_allocate_bin_bo(struct drm_device *drm)
251 INIT_LIST_HEAD(&list); 250 INIT_LIST_HEAD(&list);
252 251
253 while (true) { 252 while (true) {
254 struct vc4_bo *bo = vc4_bo_create(drm, size, true, 253 struct vc4_bo *bo = vc4_bo_create(vc4->dev, size, true,
255 VC4_BO_TYPE_BIN); 254 VC4_BO_TYPE_BIN);
256 255
257 if (IS_ERR(bo)) { 256 if (IS_ERR(bo)) {
@@ -333,7 +332,7 @@ static int vc4_v3d_runtime_resume(struct device *dev)
333 struct vc4_dev *vc4 = v3d->vc4; 332 struct vc4_dev *vc4 = v3d->vc4;
334 int ret; 333 int ret;
335 334
336 ret = vc4_allocate_bin_bo(vc4->dev); 335 ret = bin_bo_alloc(vc4);
337 if (ret) 336 if (ret)
338 return ret; 337 return ret;
339 338
@@ -403,7 +402,7 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data)
403 if (ret != 0) 402 if (ret != 0)
404 return ret; 403 return ret;
405 404
406 ret = vc4_allocate_bin_bo(drm); 405 ret = bin_bo_alloc(vc4);
407 if (ret) { 406 if (ret) {
408 clk_disable_unprepare(v3d->clk); 407 clk_disable_unprepare(v3d->clk);
409 return ret; 408 return ret;