From patchwork Mon Jun 16 13:35:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 4359261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0DB8C9F314 for ; Mon, 16 Jun 2014 13:43:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 68D922025A for ; Mon, 16 Jun 2014 13:43:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A06B20123 for ; Mon, 16 Jun 2014 13:43:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwX5P-0000my-1H; Mon, 16 Jun 2014 13:36:35 +0000 Received: from mail-we0-x22b.google.com ([2a00:1450:400c:c03::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwX58-0000f2-W4 for linux-arm-kernel@lists.infradead.org; Mon, 16 Jun 2014 13:36:19 +0000 Received: by mail-we0-f171.google.com with SMTP id q58so5663350wes.2 for ; Mon, 16 Jun 2014 06:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=db4fpfvjoMHu9CR20xO79KM8piuFWkI8u3W8lRKbIgQ=; b=dC8lmowApZLjgn5wTLLd7OmazaMoO9c4Q2/NEcuskDNQABCKEvpkm7f3ay755bHNxh vn7Y39odPMIoc/hJ5V+kTyAdteiyqyMNyCoTrn/FH3RIdQa7prtQNyf7Kv7mgQ+vscKo k8kIRE5PVeVM1gSWwfjwj0z5U6Gx//oX5K+bo+6oODKCJSfz194vd3NvfN4irDYj0sSS hszpzZ63cgpHesw1VafhDCJO1vVsMTkPguvgKZHIzd8oWKQT9olpI4s8K6T4hszC7r3o BSS2z8zEeE4Ce0QFgJCJE6L2ybx/+OuSJb5FwQ+4hRsXhHmgB5YOWdwo2r73b8sm1TuF bglA== X-Received: by 10.180.149.175 with SMTP id ub15mr27275592wib.53.1402925760242; Mon, 16 Jun 2014 06:36:00 -0700 (PDT) Received: from localhost.localdomain (37-48-45-80.tmcz.cz. [37.48.45.80]) by mx.google.com with ESMTPSA id w9sm28980205eep.39.2014.06.16.06.35.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jun 2014 06:35:59 -0700 (PDT) From: Tomeu Vizoso To: Stephen Warren , Thierry Reding , "Rafael J. Wysocki" , David Airlie , Mike Turquette , myungjoo.ham@samsung.com, kyungmin.park@samsung.com, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC PATCH 3/4] drm/tegra: Request memory bandwidth for the display controller Date: Mon, 16 Jun 2014 15:35:12 +0200 Message-Id: <1402925713-25426-4-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1402925713-25426-1-git-send-email-tomeu.vizoso@collabora.com> References: <1402925713-25426-1-git-send-email-tomeu.vizoso@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140616_063619_221831_C3F5DA05 X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -0.7 (/) Cc: Tomeu Vizoso X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Request it based solely on the current mode's refresh rate. More accurate requirements can be requested in future patches. Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/tegra/dc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index ef40381..6739d69 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "dc.h" #include "drm.h" @@ -683,6 +684,8 @@ static void tegra_crtc_disable(struct drm_crtc *crtc) } drm_vblank_off(drm, dc->pipe); + + tegra124_emc_reserve_bandwidth(TEGRA_EMC_CONSUMER_DISP1, 0); } static bool tegra_crtc_mode_fixup(struct drm_crtc *crtc, @@ -769,6 +772,7 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc, struct tegra_dc *dc = to_tegra_dc(crtc); struct tegra_dc_window window; u32 value; + unsigned long bandwidth; int err; drm_vblank_pre_modeset(crtc->dev, dc->pipe); @@ -809,6 +813,11 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc, if (err < 0) dev_err(dc->dev, "failed to enable root plane\n"); + bandwidth = mode->clock * window.bits_per_pixel / 8; + err = tegra124_emc_reserve_bandwidth(TEGRA_EMC_CONSUMER_DISP1, bandwidth); + if (err) + dev_err(dc->dev, "failed to reserve EMC bandwidth: %d\n", err); + return 0; }