Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2130310yba; Mon, 15 Apr 2019 05:40:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfuZNMmzi+9D/F9SyTIjs2lvD5+VUDSWRvZZmaTLSPrBnvM2ENvHpvobptAkMFV5R6SfQe X-Received: by 2002:a17:902:b60d:: with SMTP id b13mr76026416pls.100.1555332049999; Mon, 15 Apr 2019 05:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555332049; cv=none; d=google.com; s=arc-20160816; b=VDm4JaxFSSXA8IRzg7wRFeIi6EXoQcNd6N3Lj7BcSb9W7ityI9OwgpGSTK/u04EjRR s4KobVHQzo8XGzT25FYK/C+yoUXV6jrVdyN6QpTDMrWxGqIH+rDOFsO2Q9bgcplrG+eb lDn8+JJZ2Taqrcw0V9JueiktcUdBLsfd4x7VnhemE44uS/Wjd72eBtdrRyXyciZIb0Lo wfI57bNkkmDJZedq3Tn8i5d0LZumG/LZxJcSHcv6/N/0w2JsJiqXFpUsXrA6RVN4WOeN /XK2lFbWtR4W7jn6i8gLfOScA7/9RSrci95w6cN/R61X/TXFxPwoBTmBlEIkK1rm07KI EPEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=daU5KsFp7adVjxsnzCuaQiJVux+Lp56czJTPvSQk3nU=; b=FpFitiFoHFcdRlVS6yvt0x0/WHqzpsT6+jEh65azundMsfnVvNhTy/uehdtdsMUcBp bUw16S1M+adwLlJyO12/63z+bPuVd5bQB1zqLhLynpZlL/XP2eNOq1HPVtUsrwdgqW0m q8YLC1vvPKkN4O1afIwgxC//FKAM4+xtG8tZD92yUfefzBhJFXmFpAJNRljIMxTEuGxU 1hWlfVPEcDtyMK3f7wvkeNkvZ2YDxoPJd8Ab85fgQzdlpoU/45ENKK04avNHM6NtZrgr UvfQTEOCsbY6vO41MEVSCMdclR4vdpZ5syGb5SwE/TwYZ7DIscOtviFMPk4FdBi1jPgk 80LQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si46512364pgj.46.2019.04.15.05.40.33; Mon, 15 Apr 2019 05:40:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727506AbfDOMjT (ORCPT + 99 others); Mon, 15 Apr 2019 08:39:19 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:44545 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727486AbfDOMjS (ORCPT ); Mon, 15 Apr 2019 08:39:18 -0400 X-Originating-IP: 90.88.18.121 Received: from localhost.localdomain (aaubervilliers-681-1-63-121.w90-88.abo.wanadoo.fr [90.88.18.121]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 08C261C0011; Mon, 15 Apr 2019 12:39:14 +0000 (UTC) From: Paul Kocialkowski To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Eric Anholt , David Airlie , Daniel Vetter , Thomas Petazzoni , Maxime Ripard , Eben Upton , Paul Kocialkowski Subject: [PATCH v5 1/4] drm/vc4: Reformat and export binner bo allocation helper Date: Mon, 15 Apr 2019 14:39:05 +0200 Message-Id: <20190415123908.28986-2-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415123908.28986-1-paul.kocialkowski@bootlin.com> References: <20190415123908.28986-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since we'll be using the binner bo allocation helper in other parts of the driver, reformat it with a vc4_v3d prefix and pass the vc4 dev directly to match other functions. Make the function visible to the whole driver too. Signed-off-by: Paul Kocialkowski --- drivers/gpu/drm/vc4/vc4_drv.h | 1 + drivers/gpu/drm/vc4/vc4_v3d.c | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index e61734af059b..1f0f529169a1 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -833,6 +833,7 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, extern struct platform_driver vc4_v3d_driver; extern const struct of_device_id vc4_v3d_dt_match[]; int vc4_v3d_get_bin_slot(struct vc4_dev *vc4); +int vc4_v3d_bin_bo_alloc(struct vc4_dev *vc4); int vc4_v3d_pm_get(struct vc4_dev *vc4); void vc4_v3d_pm_put(struct vc4_dev *vc4); diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c index a4b6859e3af6..9c73fad77449 100644 --- a/drivers/gpu/drm/vc4/vc4_v3d.c +++ b/drivers/gpu/drm/vc4/vc4_v3d.c @@ -213,7 +213,7 @@ int vc4_v3d_get_bin_slot(struct vc4_dev *vc4) } /** - * vc4_allocate_bin_bo() - allocates the memory that will be used for + * vc4_v3d_bin_bo_alloc() - allocates the memory that will be used for * tile binning. * * The binner has a limitation that the addresses in the tile state @@ -234,9 +234,8 @@ int vc4_v3d_get_bin_slot(struct vc4_dev *vc4) * overall CMA pool before they make scenes complicated enough to run * out of bin space. */ -static int vc4_allocate_bin_bo(struct drm_device *drm) +int vc4_v3d_bin_bo_alloc(struct vc4_dev *vc4) { - struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_v3d *v3d = vc4->v3d; uint32_t size = 16 * 1024 * 1024; int ret = 0; @@ -251,7 +250,7 @@ static int vc4_allocate_bin_bo(struct drm_device *drm) INIT_LIST_HEAD(&list); while (true) { - struct vc4_bo *bo = vc4_bo_create(drm, size, true, + struct vc4_bo *bo = vc4_bo_create(vc4->dev, size, true, VC4_BO_TYPE_BIN); if (IS_ERR(bo)) { @@ -333,7 +332,7 @@ static int vc4_v3d_runtime_resume(struct device *dev) struct vc4_dev *vc4 = v3d->vc4; int ret; - ret = vc4_allocate_bin_bo(vc4->dev); + ret = vc4_v3d_bin_bo_alloc(vc4); if (ret) return ret; @@ -403,7 +402,7 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) if (ret != 0) return ret; - ret = vc4_allocate_bin_bo(drm); + ret = vc4_v3d_bin_bo_alloc(vc4); if (ret) { clk_disable_unprepare(v3d->clk); return ret; -- 2.21.0