From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D97F1CA9ED3 for ; Mon, 4 Nov 2019 17:42:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B4C20214B2 for ; Mon, 4 Nov 2019 17:42:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WWOcBfzV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="jvjHe6OR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4C20214B2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GEy1qbZY15618mbM9Ho/PjubAGUDJH5QV1X6EHb+KZk=; b=WWOcBfzVI516SV srvzLAF+wOvdxMdej+H/8dLJU/4ZZdY/exL1VFq/axlJ1Ki5WzUyN1vygzN2FjMhCrvKfdp/dKz4c XdweZbKaRZoYJJox/RjhYiKsWq1eRSa9taCx1iMZJAP/eKABJ8ZYVNSatKIrtdrSGmOwtTDvQbugj 0t7WOzivjuUAPmvGSMBmwmmq0GkChVC4cEZiWGtekv92BtmvR7i6jkQrqSP9sj1N6RQklyFRgsvxQ w8ndsXHvnOIyhmST0+yoRMZJPVT0gYy1hMVwLkgU4XKIgPZUKRSSKDO5Uj/tlJvOMFUhpbt+srDQP ivNsgOkLlFFeCHSV+7oQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iRgN0-0003G4-3q; Mon, 04 Nov 2019 17:42:26 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iRgMx-0003F4-BM for linux-arm-kernel@lists.infradead.org; Mon, 04 Nov 2019 17:42:24 +0000 Received: by mail-wr1-x444.google.com with SMTP id a11so18105188wra.6 for ; Mon, 04 Nov 2019 09:42:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=5ogVv9yu3iXpW756OAqxBZcAaxMrrDVeZyf4/i652TM=; b=jvjHe6OReDuWCuVv2+9UAh0oNSew20Cf90E08ulRCvHLHeXfSPKJ1HoefQFlUG7hM8 cvxTxB0gdhOTdqmAYguK071cnJKBuGonRdGwubEbmvi30uVk49BVOBFvBbnXyV6fgY1B /GBBc6/JCDu4mXohl8A5LHq8adjS1+871lhRU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=5ogVv9yu3iXpW756OAqxBZcAaxMrrDVeZyf4/i652TM=; b=rbYUaBaw82rGpZ1dML5Sbbh+4Fn8mCtqYcjqVeoPz/REqgcL/OolUaCLZkKdeOVeGV ec2fukoK8XUvT37F/lcTlHUYf8QiLl6ma5u3imgtI/tPTpWaKm5Q5hmbb0l1J20CbBxQ VzO3J5qlVjvIOLDCrLhDbD4FnoER3UyfMAfLLtPjxlIZGs7INpjTSCsG9nKVctr57Bma tM5eHNWd+vzH83t0SZ2ujU4zjX9s4XCWI9zn6ruoBWcIM41pDEpSTIUaywfy1eIQ2ZLP VHiEwzdmtYkgnm3N6o6NN0A3JeDvPPhwM5yGVqc8tP54i7grSzjWVe2WFGewPKOzvmwb USCg== X-Gm-Message-State: APjAAAU5c+ocIzeFFs4OI5xuiwkNyGIUmyIOaGmkomX59DLI+45ZZQNF Wwy84vzUQ/VQk8Ajc+ECH/t5Jg== X-Google-Smtp-Source: APXvYqyo30Cx3N9aLHROc1bhJ+WNVO3huy0tpFL+gtfZWVC0nSZZlSOaRK2D60u0zqloh6U7cb3wBA== X-Received: by 2002:adf:e889:: with SMTP id d9mr26191161wrm.266.1572889341116; Mon, 04 Nov 2019 09:42:21 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id f13sm17424754wrq.96.2019.11.04.09.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 09:42:20 -0800 (PST) Date: Mon, 4 Nov 2019 18:42:18 +0100 From: Daniel Vetter To: Ondrej Jirman Subject: Re: [PATCH v2] drm: sun4i: Add support for suspending the display driver Message-ID: <20191104174218.GL10326@phenom.ffwll.local> Mail-Followup-To: Ondrej Jirman , linux-sunxi@googlegroups.com, Maxime Ripard , Chen-Yu Tsai , David Airlie , "open list:DRM DRIVERS FOR ALLWINNER A10" , "moderated list:ARM/Allwinner sunXi SoC support" , open list References: <20191029112846.3604925-1-megous@megous.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191029112846.3604925-1-megous@megous.com> X-Operating-System: Linux phenom 5.2.0-3-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191104_094223_389369_0F9B38AC X-CRM114-Status: GOOD ( 18.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Chen-Yu Tsai , "open list:DRM DRIVERS FOR ALLWINNER A10" , open list , linux-sunxi@googlegroups.com, Maxime Ripard , Daniel Vetter , "moderated list:ARM/Allwinner sunXi SoC support" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Oct 29, 2019 at 12:28:46PM +0100, Ondrej Jirman wrote: > Shut down the display engine during suspend. > > Signed-off-by: Ondrej Jirman > --- > Changes in v2: > - spaces -> tabs > > drivers/gpu/drm/sun4i/sun4i_drv.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c > index a5757b11b730..c519d7cfcf43 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_drv.c > +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c > @@ -346,6 +346,27 @@ static int sun4i_drv_add_endpoints(struct device *dev, > return count; > } > > +#ifdef CONFIG_PM_SLEEP > +static int sun4i_drv_drm_sys_suspend(struct device *dev) > +{ > + struct drm_device *drm = dev_get_drvdata(dev); > + > + return drm_mode_config_helper_suspend(drm); > +} > + > +static int sun4i_drv_drm_sys_resume(struct device *dev) > +{ > + struct drm_device *drm = dev_get_drvdata(dev); > + > + return drm_mode_config_helper_resume(drm); > +} > +#endif > + > +static const struct dev_pm_ops sun4i_drv_drm_pm_ops = { > + SET_SYSTEM_SLEEP_PM_OPS(sun4i_drv_drm_sys_suspend, > + sun4i_drv_drm_sys_resume) > +}; I wonder whether we should have these as default helpers somewhere, there's probably a few drivers that could use them? It's just a handful of lines we're saving here, but we have enough kms drivers to justify this kind of stuff nowadays ... -Daniel > + > static int sun4i_drv_probe(struct platform_device *pdev) > { > struct component_match *match = NULL; > @@ -418,6 +439,7 @@ static struct platform_driver sun4i_drv_platform_driver = { > .driver = { > .name = "sun4i-drm", > .of_match_table = sun4i_drv_of_table, > + .pm = &sun4i_drv_drm_pm_ops, > }, > }; > module_platform_driver(sun4i_drv_platform_driver); > -- > 2.23.0 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel