From patchwork Wed Sep 25 19:31:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 11161311 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81ADD912 for ; Wed, 25 Sep 2019 19:31:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A29821D7B for ; Wed, 25 Sep 2019 19:31:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A29821D7B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C12C76F534; Wed, 25 Sep 2019 19:31:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84A616F51E for ; Wed, 25 Sep 2019 19:31:54 +0000 (UTC) Received: from localhost (c-71-197-186-152.hsd1.wa.comcast.net [71.197.186.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 531D321D7A; Wed, 25 Sep 2019 19:31:54 +0000 (UTC) From: Kevin Hilman To: Neil Armstrong , dri-devel@lists.freedesktop.org Subject: [PATCH] drm/meson: enable runtime PM Date: Wed, 25 Sep 2019 12:31:54 -0700 Message-Id: <20190925193154.20732-1-khilman@kernel.org> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569439914; bh=tVJ3MnTdv85ltB6ucAQ46KlHKpnPNYJaGZPDutR3fp8=; h=From:To:Cc:Subject:Date:From; b=Jd9KEG6M9wIhSdq/pkhMiCLEGnUUrEvd/n5hgE/6vMLCwlxnCwwnVESoKRkVFnD9d eLdfreA03h5EA/fxmJlYh5I8+DuafRSO1ow8Jq8SRwnKGcHVjzmmHRvrG8Umz2v1Ob zXCEBpqOdLZxlSkcfIvKJDYbAGoGk+9t75R+9f8c= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Kevin Hilman Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Kevin Hilman On some SoCs, the VPU is in a power-domain and needs runtime PM enabled and used in order to keep the power domain on. Signed-off-by: Kevin Hilman --- drivers/gpu/drm/meson/meson_drv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index 2310c96fff46..256b6a0e9c6b 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -274,6 +275,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) /* Hardware Initialization */ + pm_runtime_get_sync(dev); meson_vpu_init(priv); meson_venc_init(priv); meson_vpp_init(priv); @@ -416,6 +418,7 @@ static int meson_drv_probe(struct platform_device *pdev) struct device_node *ep, *remote; int count = 0; + pm_runtime_enable(&pdev->dev); for_each_endpoint_of_node(np, ep) { remote = of_graph_get_remote_port_parent(ep); if (!remote || !of_device_is_available(remote)) { @@ -440,6 +443,7 @@ static int meson_drv_probe(struct platform_device *pdev) } /* If no output endpoints were available, simply bail out */ + pm_runtime_disable(&pdev->dev); return 0; };