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: 10553307 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 6B2AA13BB for ; Thu, 2 Aug 2018 07:23:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 543DC2AF7A for ; Thu, 2 Aug 2018 07:23:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 482272AF8B; Thu, 2 Aug 2018 07:23:38 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 008962AF7A for ; Thu, 2 Aug 2018 07:23:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F0FC6E369; Thu, 2 Aug 2018 07:19:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDCD56E10F for ; Tue, 31 Jul 2018 20:31:45 +0000 (UTC) Received: by mail-pg1-x541.google.com with SMTP id p23-v6so9623992pgv.13 for ; Tue, 31 Jul 2018 13:31:45 -0700 (PDT) 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=L9k8AoQEd1cXzahMaaDCrDQhY6Ae455TG3yihh5MXA6wRyn0mxAOIED6g+InjiHTCu twHlSMqlFPPEz1AJA7IyNg99P7UKBcI8VuZZakaY3WyIEzxYEl9jAXlhvjNHTP91OO+H jTKbROSBU2uIEggatgh6a8iVLIiQZEHbh7rOht7c3QKrH4WLPALuSgpPkLUzDQTLGUkR SR2xWbqH6laPCH1/YHEiFohA8i1b6vvHZkfPEmWD0aaGSpE3woTVZzMHvN6yPqRhyZJx cB8dnytHX4DDNC7B7rnZhknhf3/VxDUKBc/juc3Vf0XeedAm6EQ2DUFegP1x4tRDbJbK /5Yw== X-Gm-Message-State: AOUpUlHdNskiXOcTtOR20wm56gMR4Cr8aMszpE8b8oLQ/CgkfrOTJEPV 3gvSzZypq/urm5/ZuX7AG2Qu9RBp 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-Mailman-Approved-At: Thu, 02 Aug 2018 07:19:10 +0000 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-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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;