From patchwork Thu Jul 26 15:54:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10546097 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 B73A9112E for ; Thu, 26 Jul 2018 15:52:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2D7D2B7A7 for ; Thu, 26 Jul 2018 15:52:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9653E2B7FB; Thu, 26 Jul 2018 15:52:34 +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=unavailable 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 41F022B7A7 for ; Thu, 26 Jul 2018 15:52:34 +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=O8rgDWjw/sUoSkrrTXMWuOLYJVQpSO3c6C62nEi+tgk=; b=POFXuPULRUIpuf lPgOQ1JGv9ueK7ezSGbh1paaYjUqN568xSB1EB3uEzWQvNSDRtcV+cNnYKdiRTn3IZqsB3uJ6trbD Z8LwacFWvEL6AtzLk4lG1MdjhVCH+U5bIfsHn35feWxB+fyp09RK9pfDJFwxGYTMKIEO9MOUS3OQY AIHu0AP5KeYv/8ahMtv6GWOEPhxvgJUPMQhWymoId9x1tWhqDEUE/QBWVHrax/iPMwcU5lisY9Vul WpZQGhengAa3mvKkw/QA9CAmgwuX9Wx9ISFjlrnukRolTmVWkqSzuAAPUhJDAwU8GTiavz9Ho/OLj q1qkTxE1NpFLQS9edNtg==; 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 1fiiZ4-0007pH-Ks; Thu, 26 Jul 2018 15:52:30 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiiZ1-0007np-Rw for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2018 15:52:29 +0000 Received: by mail-pf1-x441.google.com with SMTP id k21-v6so718474pff.11 for ; Thu, 26 Jul 2018 08:52:17 -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=AeDt/GpAfzOMrkrlRIMneLTkkm1bS5veHSM4fjYpZTA=; b=CN+kS7A2AEziQpBlyFP0yMZpXv2ntazyJJh8oi5MOkcCS+YC0huSleuVA9zOmg74zR FtAC1GUMRqujYXY/vHZ4X8hFGM1v0Kp9ZyxIlf6JohJOAR7XlAAvid4xSDWPT2JBiiWQ Z6sXpEXJQrXaA1nIcUvQGetR7TpcKlvITnruKeSB9ioFz6Ex9P9hETdULU440bkm9haJ /aoLFsNh2DAEVpzMS2AVCETRWOZAi91DFfwKsSegRA48OTsd0e2QEMkZ6OhmIhoBsjhM H6IY3FP/J0r3jYMc0eLnKge6mnxDLy8IEkv/KLIHnHCLJ4D7I+0vLL9W4fwf0/pgRfTh 3gsw== 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=AeDt/GpAfzOMrkrlRIMneLTkkm1bS5veHSM4fjYpZTA=; b=pwhGhXz8R7KO0JRd1TOr5Vkx7/zvoMJ7NcZZJm0ewQlbWJLu9FmRVAX2YGWX4AS4xP QfWocjuBhFMj5OxkNDTv7VKSDQkYP3sCNa6HgV8HIz+GwJrXhz+hoJeBJqGvfEvXVfDX a1LFhL8+MwTG4fC05p8eDWK0vrrvKh6mnMIV+kOgEu6SoooRQ29OancM3z7E2g13+6mn qHPxt4rJIr7O1zZVjYuhLEVv0Pf7WKL+3pzZDbTOS+vh1FsIus0vTPOxOl4qrUQ3/OtV ARKWkLzwnhALkKftOdrg+j6BD/KWOIulsw88lJz1WdGXWDFuOMSfscDONAgOYG+KhWSn Sk/A== X-Gm-Message-State: AOUpUlFmsgvRa0sMjZv1kpgJvpen67Syf3IEX+czoGUzz9sDgKmEDt1B ByLtxebaSFFRZKdkdOXfFmTgy6Cp X-Google-Smtp-Source: AAOMgpdfDcBFV1l6CP80ibBtsXAx/Xwt3HO3hXfmJR7DLT7H02armsEHoBeTWU3+rQWV3C3nd0OTZQ== X-Received: by 2002:a62:1815:: with SMTP id 21-v6mr2661102pfy.227.1532620336936; Thu, 26 Jul 2018 08:52:16 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.219.162]) by smtp.gmail.com with ESMTPSA id v3-v6sm8771309pgb.54.2018.07.26.08.52.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Jul 2018 08:52:15 -0700 (PDT) Date: Thu, 26 Jul 2018 21:24:59 +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, daniel@ffwll.ch Subject: [PATCH v2] gpu/drm/exynos: Convert drm_atomic_helper_suspend/resume() Message-ID: <20180726155459.GA30138@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-20180726_085227_909061_EC85BFCC X-CRM114-Status: GOOD ( 13.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ajitn.linux@gmail.com, linux-samsung-soc@vger.kernel.org, sabyasachi.linux@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, brajeswar.linux@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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(). 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 Tested-by: Marek Szyprowski --- v2: Address Inki Dae's comment. Remove ret variable from both suspend/resume function. drivers/gpu/drm/exynos/exynos_drm_drv.c | 26 ++++---------------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 17 ----------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.h | 10 ---------- 3 files changed, 4 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..46d28cd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -151,39 +151,21 @@ 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; - if (pm_runtime_suspended(dev) || !drm_dev) + if (pm_runtime_suspended(dev)) return 0; - private = drm_dev->dev_private; - - 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 drm_mode_config_helper_suspend(drm_dev); } static int exynos_drm_resume(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); - struct exynos_drm_private *private; - if (pm_runtime_suspended(dev) || !drm_dev) + if (pm_runtime_suspended(dev)) return 0; - 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); - - return 0; + return drm_mode_config_helper_resume(drm_dev); } #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