Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp293405yba; Wed, 3 Apr 2019 08:51:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/ZDXM0sgPrD1lZLx9rktdwMQmfya/Fl0dde0Z7g1Mq9zR5Ebt0CNrzbACQ0IcvDnrw9dv X-Received: by 2002:a17:902:7d81:: with SMTP id a1mr683660plm.202.1554306672886; Wed, 03 Apr 2019 08:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554306672; cv=none; d=google.com; s=arc-20160816; b=YFvZfwLX68Y4MpGsXSrIlCMpU5hx45JsmEohpFsjEb4/WW6R+MqP0nAkfmnLKt8nFX M0TOyZr02Yn+caffZpiQQJO2e7cYLU/+qR0kEYrufTxup40LO929V9pqEAXlEzPFNM10 DyqMTSQU698qFs6CrjKv0snglBDF16ROdVyjGMoSUYHPe79mCYdRvIG1Oxuf7EtG9bNC /hB5mH9WtgLXcOYHHoYBxTvGXmytNC5YKn1YgD20Gn2GVmGdw32Kjb6lxVbisH2qroLJ U00DZFeCsMDT6CRv4+4lZt2LRWbBizFtBnVyxIhnx0lY2PlOuzbnQIm7uWRGzOaSmvma seMA== 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=mUX4n0u4G2xURV5wWrB6iqdA4Oun355s+a05zto55Is=; b=anjBGOj6oCBVz99oqXs23NPlEfKpbnMkeLsZJjOIB19fnhHc8QOkcoCzVvDdAnybra cO9vL6cAMeWsj8wLQJ21pTqHViKQEZtm5rUAfajPM90djwozfo5Wlh14zcgbYl2nW0tS eyrurVTa0X/OuFEaeTpRQ+bbentFYCKDCbewQoo4eXCFoYg7ZmbyNd95RTWmR8KwBwqL C9ZzmVUyFaw2f5p44S7/o+ZJAcjg3StPbV7cOE5V9Q1iIdiJMtXPCRRP1NtIj70vB6NE yl2XLV8DSl5nXXn2TuTmA0dDaRYG0FdX9j40RFaCEPeKZrPF6waKdcHnvMvefTF8J46Z o2CQ== 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 p2si10745305plr.69.2019.04.03.08.50.57; Wed, 03 Apr 2019 08:51:12 -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 S1727156AbfDCPuF (ORCPT + 99 others); Wed, 3 Apr 2019 11:50:05 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:57773 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbfDCPuC (ORCPT ); Wed, 3 Apr 2019 11:50:02 -0400 X-Originating-IP: 90.88.30.125 Received: from localhost.localdomain (aaubervilliers-681-1-89-125.w90-88.abo.wanadoo.fr [90.88.30.125]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id B1A681BF20A; Wed, 3 Apr 2019 15:49:58 +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 , Daniel Stone , Paul Kocialkowski Subject: [PATCH v4 1/4] drm/vc4: Reformat and export binner bo allocation helper Date: Wed, 3 Apr 2019 17:48:53 +0200 Message-Id: <20190403154856.9470-2-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190403154856.9470-1-paul.kocialkowski@bootlin.com> References: <20190403154856.9470-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_v3d.c | 11 +++++------ 1 file 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..fe091256800d 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_allocate_bin_bo() - 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_allocate_bin_bo(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_allocate_bin_bo(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_allocate_bin_bo(vc4); if (ret) { clk_disable_unprepare(v3d->clk); return ret; -- 2.21.0