From patchwork Wed Jul 18 20:49:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10533715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 388AD601D2 for ; Thu, 19 Jul 2018 07:06:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 251F02964C for ; Thu, 19 Jul 2018 07:06:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1918D2968D; Thu, 19 Jul 2018 07:06: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 BCE522964C for ; Thu, 19 Jul 2018 07:06:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E3926ECDA; Thu, 19 Jul 2018 07:04:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 27D856E13D for ; Wed, 18 Jul 2018 20:47:21 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id y4-v6so2522294pgp.9 for ; Wed, 18 Jul 2018 13:47:21 -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=sArlYhHE0ht3rYmY1PBkXgKCIRhIlweZX/pOCKxQkMg=; b=X4cvHICX+W5lKHHycG9Y5yXejOdkRbkdHhzHyrehpKPFL7uAvN6OHCkEU4pWlmt6oD OiDybxlbPuS9Qd4uQtxqxM9HeLBAD6kd+wHfGcUxNfixyy1iJygM2l7DM2BzF5lJA7dW XCZILIUmWrOetLZmL7NROsF1mnYyPfXxVsUOaG1SuY0zwVqus4DYZ7pxlTv+c0nLCdJ/ P/Ww48hpTGhHfP/at4bYMKpvXLWl+fBSP1auSvlnMA4d03Hc77h0rtJCQOMvDJm8tpjW dDOEbdPvYQI6QG4JIYsbDy6DyxM1tyqXes3VULbRajprZAGkx1tpuhD2PwJpIdD4d/ts CClw== X-Gm-Message-State: AOUpUlEVwRaZs+FEDV7B+bOYuKisM7FiqBzXbA7H9t5ijWfp08+iPHg5 JxJV0HksoQqzXTZYXoZ8e8s= X-Google-Smtp-Source: AAOMgpd7bWVAL21abZTIE4IQnYyIJR39tveel9jBQlS6BLV5uJaV5CBZ9/1Y5zExCvH6otmw+NxABw== X-Received: by 2002:a63:aa44:: with SMTP id x4-v6mr7328392pgo.120.1531946840705; Wed, 18 Jul 2018 13:47:20 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([183.82.19.142]) by smtp.gmail.com with ESMTPSA id g10-v6sm5676211pgs.17.2018.07.18.13.47.18 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Jul 2018 13:47:19 -0700 (PDT) Date: Thu, 19 Jul 2018 02:19:57 +0530 From: Souptick Joarder To: inki.dae@samsung.com, jy0922.shim@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, airlied@linux.ie, kgene@kernel.org, krzk@kernel.org, ajitn.linux@gmail.com Subject: [PATCH] gpu/drm/exynos: Convert drm_atomic_helper_suspend/resume() Message-ID: <20180718204957.GA14132@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, 19 Jul 2018 07:03:43 +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-samsung-soc@vger.kernel.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(). exynos_drm_fbdev_suspend/resume can be removed as drm_mode_config_helper_suspend/resume has implement the same in generic way. Signed-off-by: Souptick Joarder Signed-off-by: Ajit Negi --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 32 ++++++++++--------------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 17 ---------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.h | 10 ---------- 3 files changed, 10 insertions(+), 49 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index a81b4a5..1996ff7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -151,39 +151,27 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file) static int exynos_drm_suspend(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); - struct exynos_drm_private *private; + int ret = 0; - if (pm_runtime_suspended(dev) || !drm_dev) - return 0; + if (pm_runtime_suspended(dev)) + return ret; - private = drm_dev->dev_private; + ret = drm_mode_config_helper_suspend(drm_dev); - drm_kms_helper_poll_disable(drm_dev); - exynos_drm_fbdev_suspend(drm_dev); - private->suspend_state = drm_atomic_helper_suspend(drm_dev); - if (IS_ERR(private->suspend_state)) { - exynos_drm_fbdev_resume(drm_dev); - drm_kms_helper_poll_enable(drm_dev); - return PTR_ERR(private->suspend_state); - } - - return 0; + return ret; } static int exynos_drm_resume(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); - struct exynos_drm_private *private; + int ret = 0; - if (pm_runtime_suspended(dev) || !drm_dev) - return 0; + if (pm_runtime_suspended(dev)) + return ret; - private = drm_dev->dev_private; - drm_atomic_helper_resume(drm_dev, private->suspend_state); - exynos_drm_fbdev_resume(drm_dev); - drm_kms_helper_poll_enable(drm_dev); + ret = drm_mode_config_helper_resume(drm_dev); - return 0; + return ret; } #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 132dd52..918dd2c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -270,20 +270,3 @@ void exynos_drm_fbdev_fini(struct drm_device *dev) private->fb_helper = NULL; } -void exynos_drm_fbdev_suspend(struct drm_device *dev) -{ - struct exynos_drm_private *private = dev->dev_private; - - console_lock(); - drm_fb_helper_set_suspend(private->fb_helper, 1); - console_unlock(); -} - -void exynos_drm_fbdev_resume(struct drm_device *dev) -{ - struct exynos_drm_private *private = dev->dev_private; - - console_lock(); - drm_fb_helper_set_suspend(private->fb_helper, 0); - console_unlock(); -} diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h index b338472..6840b6a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h @@ -19,8 +19,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev); void exynos_drm_fbdev_fini(struct drm_device *dev); -void exynos_drm_fbdev_suspend(struct drm_device *drm); -void exynos_drm_fbdev_resume(struct drm_device *drm); #else @@ -39,14 +37,6 @@ static inline void exynos_drm_fbdev_restore_mode(struct drm_device *dev) #define exynos_drm_output_poll_changed (NULL) -static inline void exynos_drm_fbdev_suspend(struct drm_device *drm) -{ -} - -static inline void exynos_drm_fbdev_resume(struct drm_device *drm) -{ -} - #endif #endif