From patchwork Tue Jul 31 20:07:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10553293 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 AAF8D15E2 for ; Thu, 2 Aug 2018 07:21:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92B332A6E5 for ; Thu, 2 Aug 2018 07:21:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86A5D2AF77; Thu, 2 Aug 2018 07:21:17 +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 358CB2A6E5 for ; Thu, 2 Aug 2018 07:21:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C6A256E371; Thu, 2 Aug 2018 07:19:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id E191E6E10F for ; Tue, 31 Jul 2018 20:04:20 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id d4-v6so6387365pfn.0 for ; Tue, 31 Jul 2018 13:04:20 -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=sEE9CUkse8pz+BACRudKwfsWTWfB2imbK5IEGi39cUs=; b=rvl/iR4KKnrtRrSTjy5x7TDkmxJ1+5nPu6hhV3Nt1BX65kw8B3tG7Jz1xZU7EnAhzk MQNEzxaNo5QOG7Ux3grcv/9x2icTl9U4z43HdxlxClCv1Tq2uckypUdh+yh8t6A0w5+4 hK4Ymu3DfVeEIRWivBHJ8dNps/V4ck8bVS8t7dvVjQP/h9medtLdZSKf5PG6xCA6wDRJ neg25CjmGUTyNRmLQddWG7opP54abg4vBPJXHVQjLxYEq0vsMvQH+19VxXRfkzBHLoIN 5TyNI2SFsSiC9Q3rz9UH4q8O3nXjCoQRB1mIPX4X0WL9DH7dDxV43M0g/LIVcE3v0SRP vE6w== X-Gm-Message-State: AOUpUlHr3OpDBQwYXnpK8Vs4dO2tNU/uKGXRxDCIkwkOD/Diw8Yy+XeL d1fSy3GR4RrLDN2wu3evxEU= X-Google-Smtp-Source: AAOMgpcjdhaGLZWVoWNYF0CHFbzMru3Xr+L8n0k93z6A22wrrHqtup9q3ZvoXmRJArWRzhw1FlMFxg== X-Received: by 2002:a62:d94a:: with SMTP id s71-v6mr23431943pfg.164.1533067459958; Tue, 31 Jul 2018 13:04:19 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.216.188]) by smtp.gmail.com with ESMTPSA id h132-v6sm22007969pfc.100.2018.07.31.13.04.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 13:04:18 -0700 (PDT) Date: Wed, 1 Aug 2018 01:37:05 +0530 From: Souptick Joarder To: thierry.reding@gmail.com, airlied@linux.ie, jonathanh@nvidia.com, ajitn.linux@gmail.com Subject: [PATCH] drm/tegra: Convert drm_atomic_helper_suspend/resume() Message-ID: <20180731200705.GA21510@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-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.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, tegra_drm_fb_suspend() and tegra_drm_fb_resume() wil not be used anymore. Both of these functions can be removed. Also, in tegra_drm struct's member state will not be used anymore. So this can be removed forever. Fixed one sparse warning. Signed-off-by: Souptick Joarder Signed-off-by: Ajit Negi --- drivers/gpu/drm/tegra/drm.c | 20 ++------------------ drivers/gpu/drm/tegra/drm.h | 4 ---- drivers/gpu/drm/tegra/fb.c | 24 +----------------------- 3 files changed, 3 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index a2bd587..9a0efce 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1212,31 +1212,15 @@ static int host1x_drm_remove(struct host1x_device *dev) static int host1x_drm_suspend(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); - struct tegra_drm *tegra = drm->dev_private; - - drm_kms_helper_poll_disable(drm); - tegra_drm_fb_suspend(drm); - - tegra->state = drm_atomic_helper_suspend(drm); - if (IS_ERR(tegra->state)) { - tegra_drm_fb_resume(drm); - drm_kms_helper_poll_enable(drm); - return PTR_ERR(tegra->state); - } - return 0; + return drm_mode_config_helper_suspend(drm); } static int host1x_drm_resume(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); - struct tegra_drm *tegra = drm->dev_private; - drm_atomic_helper_resume(drm, tegra->state); - tegra_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/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h index 92d2487..1012335 100644 --- a/drivers/gpu/drm/tegra/drm.h +++ b/drivers/gpu/drm/tegra/drm.h @@ -60,8 +60,6 @@ struct tegra_drm { unsigned int pitch_align; struct tegra_display_hub *hub; - - struct drm_atomic_state *state; }; struct tegra_drm_client; @@ -186,8 +184,6 @@ struct drm_framebuffer *tegra_fb_create(struct drm_device *drm, void tegra_drm_fb_free(struct drm_device *drm); int tegra_drm_fb_init(struct drm_device *drm); void tegra_drm_fb_exit(struct drm_device *drm); -void tegra_drm_fb_suspend(struct drm_device *drm); -void tegra_drm_fb_resume(struct drm_device *drm); extern struct platform_driver tegra_display_hub_driver; extern struct platform_driver tegra_dc_driver; diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c index 4c22cdd..b947e82 100644 --- a/drivers/gpu/drm/tegra/fb.c +++ b/drivers/gpu/drm/tegra/fb.c @@ -356,7 +356,7 @@ static void tegra_fbdev_exit(struct tegra_fbdev *fbdev) /* Undo the special mapping we made in fbdev probe. */ if (bo && bo->pages) { vunmap(bo->vaddr); - bo->vaddr = 0; + bo->vaddr = NULL; } drm_framebuffer_remove(fbdev->fb); @@ -412,25 +412,3 @@ void tegra_drm_fb_exit(struct drm_device *drm) tegra_fbdev_exit(tegra->fbdev); #endif } - -void tegra_drm_fb_suspend(struct drm_device *drm) -{ -#ifdef CONFIG_DRM_FBDEV_EMULATION - struct tegra_drm *tegra = drm->dev_private; - - console_lock(); - drm_fb_helper_set_suspend(&tegra->fbdev->base, 1); - console_unlock(); -#endif -} - -void tegra_drm_fb_resume(struct drm_device *drm) -{ -#ifdef CONFIG_DRM_FBDEV_EMULATION - struct tegra_drm *tegra = drm->dev_private; - - console_lock(); - drm_fb_helper_set_suspend(&tegra->fbdev->base, 0); - console_unlock(); -#endif -}