From patchwork Tue Jul 31 20:34:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10551363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A33E613B8 for ; Tue, 31 Jul 2018 20:32:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 880BD2B41E for ; Tue, 31 Jul 2018 20:32:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B8A32B426; Tue, 31 Jul 2018 20:32:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 277DC2B41E for ; Tue, 31 Jul 2018 20:32:02 +0000 (UTC) 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:MIME-Version: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:In-Reply-To:References: List-Owner; bh=XY2J2hfQKSPlTr2TH3j2H2oG5vHG/pbRVXnIZvs7t+I=; b=kU6m0ggO7EkJSv ydzuEVYwl+z8d1y2/tk28tWzdF1yfwhyq6L1XH8lB/AbDOwtXZQmlA3O3QqGknlQhLfXiDwUM+3Z1 O/fOdu4y3CfQCHvffu2ZgS7+MWhQR5Iky1T49qBHjK1wiN0UgXrl0jOAAIfvrdNOOxQKpsbPdgD6Y FYcFTQd8Zg1dQ/GHieWlL3RBBV7Lnm9Rhpbb+i0UeidzSveYo+pABpPsHFiew2f/2mVkKhhn7fB28 sOX8xt++po8hs7VHxBPVWIhhpH7V8WiRDEmE/w2ZyjvEYeEvoYk9RbRIcYLYG+cU4ZE/hYv9/2wBV /kSvOyMqUAsmzzB9d4dg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkbJG-0000nf-PY; Tue, 31 Jul 2018 20:31:58 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkbJE-0000mj-8S; Tue, 31 Jul 2018 20:31:57 +0000 Received: by mail-pg1-x541.google.com with SMTP id f1-v6so9628038pgq.12; Tue, 31 Jul 2018 13:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=FQiyQ0vCg+5LOSTEbnQABBEQ95HMKLY6NZOuxHOY8II=; b=piE2p9ypc3EUPZS9AjPcNJ6B3HF5LU9sF4wmJI5CxQyYkMK0aHkadRFonela1HHbl0 ggxRSooDdZ7Hq7xvxDtuiEJ9DwdLw68lk597BHSfhmz2pTzKUqmcHl4zqJMz/w1FUks7 +8efOyklcqyXmG+6CvknS/vcmxIs9wg766YR4iWZkpKzjVTNtULfaZcd3Jx2bMRA6tb8 JMiOHxuxHuyMnBGCojY90XsMJe+zzmdRMIdWJzubqHVNRrHndzn7EnWIPKPQcjix2M6D wyJiFT2TiTNT/kS1dKm/zA5J8Xhbxx4Y03oNHhAHILLVSr+MhKTipbEdpldnBdcEMIf8 hfFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=FQiyQ0vCg+5LOSTEbnQABBEQ95HMKLY6NZOuxHOY8II=; b=L4Ohv0EKs3q6KOrb7JhwjIAwVmacWqvC/n25in4KandRaLDhIhfzw2LEFpdRcrzZhW efntqGAaPQpZkyAaFZV/pdKbuGJr6RjCD6QxAVb2y0YxpKndDLEmmRMWDIs+t7TNK04c 15WJdqBbEU/TLoUVQWcZlgyEk9j2mQvH7gFMbpAuwK2i8V4vS1T0Bcz4c0Td2d3LBmRn 7gjhH26LuCENY7w7VLzqcmOukTR2JEj5aa+5BdWnOww91ySPTpvQYpgTqCz0qJ61LHKc XJPMxTcqrJLI+bHbpqmtc0c1LxsMLzqGrsJIdMQS9aZJqi3bhtp3ONd8yomM7+cwn3RA pnEg== X-Gm-Message-State: AOUpUlFKcvpPAd+auti4TpgaufXXiUNx+7h9EGvib5bHI1RAu8aHQuNs N0+0HyQUPq2iZy+f/fshVFc= X-Google-Smtp-Source: AAOMgpc1mw8o+Xyd+KTmrNMLTUFn+qfAYvUFMTC3nA9b3pJt0Uh6lUcPGuj4T6H28IU+95Ew21av7Q== X-Received: by 2002:a62:1f8c:: with SMTP id l12-v6mr24146584pfj.143.1533069105055; Tue, 31 Jul 2018 13:31:45 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.216.188]) by smtp.gmail.com with ESMTPSA id h4-v6sm16225103pgp.13.2018.07.31.13.31.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 13:31:43 -0700 (PDT) Date: Wed, 1 Aug 2018 02:04:30 +0530 From: Souptick Joarder To: hjc@rock-chips.com, heiko@sntech.de, airlied@linux.ie, ajitn.linux@gmail.com, daniel@ffwll.ch Subject: [PATCH] drm/rockchip: Convert drm_atomic_helper_suspend/resume() Message-ID: <20180731203430.GA30136@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180731_133156_304865_9C8B1C92 X-CRM114-Status: GOOD ( 14.06 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP convert drm_atomic_helper_suspend/resume() to use drm_mode_config_helper_suspend/resume(). With this conversion, rockchip_drm_fb_resume() and rockchip_drm_fb_suspend() will not be used anymore. Both of these functions can be removed. Also, in struct rockchip_drm_private state will not be used anymore. So this can be removed forever. Signed-off-by: Souptick Joarder Signed-off-by: Ajit Negi --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 46 ++--------------------------- drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 1 - 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index f814d37..dd12390 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -243,60 +243,18 @@ static void rockchip_drm_unbind(struct device *dev) }; #ifdef CONFIG_PM_SLEEP -static void rockchip_drm_fb_suspend(struct drm_device *drm) -{ - struct rockchip_drm_private *priv = drm->dev_private; - - console_lock(); - drm_fb_helper_set_suspend(&priv->fbdev_helper, 1); - console_unlock(); -} - -static void rockchip_drm_fb_resume(struct drm_device *drm) -{ - struct rockchip_drm_private *priv = drm->dev_private; - - console_lock(); - drm_fb_helper_set_suspend(&priv->fbdev_helper, 0); - console_unlock(); -} - static int rockchip_drm_sys_suspend(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); - struct rockchip_drm_private *priv; - - if (!drm) - return 0; - - drm_kms_helper_poll_disable(drm); - rockchip_drm_fb_suspend(drm); - priv = drm->dev_private; - priv->state = drm_atomic_helper_suspend(drm); - if (IS_ERR(priv->state)) { - rockchip_drm_fb_resume(drm); - drm_kms_helper_poll_enable(drm); - return PTR_ERR(priv->state); - } - - return 0; + return drm_mode_config_helper_suspend(drm); } static int rockchip_drm_sys_resume(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); - struct rockchip_drm_private *priv; - if (!drm) - return 0; - - priv = drm->dev_private; - drm_atomic_helper_resume(drm, priv->state); - rockchip_drm_fb_resume(drm); - drm_kms_helper_poll_enable(drm); - - return 0; + return drm_mode_config_helper_resume(drm); } #endif diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h index 3a6ebfc..d67ad0a 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h @@ -51,7 +51,6 @@ struct rockchip_crtc_state { struct rockchip_drm_private { struct drm_fb_helper fbdev_helper; struct drm_gem_object *fbdev_bo; - struct drm_atomic_state *state; struct iommu_domain *domain; struct mutex mm_lock; struct drm_mm mm;