From patchwork Thu Aug 2 13:21:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10553607 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 B187B13BB for ; Thu, 2 Aug 2018 13:19:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A007A28CD1 for ; Thu, 2 Aug 2018 13:19:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9310D2A7B8; Thu, 2 Aug 2018 13:19:36 +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 3962F28CD1 for ; Thu, 2 Aug 2018 13:19:36 +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=0Bu495diYOKKxDBahZWuUS5p6eAH0TjmWkmVtxcgLks=; b=DA6T+trOpoNk8S MCUfYOvX/pYiBF7WY/eKASRGCGfMj48kCmeCzG+QGMZ+HdPUNYVckArMGGT+6ZVRTvUPp5rVql8xK UklMLh6Z1n/XeRDanqrVnzUU3p+DIf3aYKXmlF9ctEqPG1s0Ijk6TrR6NUU9hbkedgoN9MAyJ/41y THw8pkN2lz+3VnLxcULabJ8N8BHYuvakf4M7i0lx8rX/ANt2l30+B0jGSxNX+KiU4nKNgzgDOJK4J Ml626beMCkcE2a85cw6suhCmahdZ+eMBDXDVOIekei6TfDD4N691j8ExkNybUwUuX1YmyNXJGFc9t xXBdin0T15ij5WqBiY7w==; 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 1flDVn-0005uD-J7; Thu, 02 Aug 2018 13:19:27 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1flDVk-0005tL-1L for linux-arm-kernel@lists.infradead.org; Thu, 02 Aug 2018 13:19:25 +0000 Received: by mail-pf1-x444.google.com with SMTP id i26-v6so1293537pfo.12 for ; Thu, 02 Aug 2018 06:19:13 -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=2vzQXCsiE8PuLnNZu34sY/6jMMftxW9L1acSr/qU3MU=; b=OCk/B2fAjAVeKuVb2s+Q7x89M61yKgKHSjt/GrvAqZPmbYs2EB9crqH4SnzX1Z6qsT 47fGEVVPlpeUrOJ2+SOohaUDx1sia1G3O+85LpivUOl/z/SF8f4cR8eJqBM//aZAYKWW Q2hdywTBoxlFcYZxmIRV4ObsHJvu7p4gSv7n6mObgH1BmzODqGK+TrH8tSg32TkbF3FZ 3K9cSIBq971zQk06Vwja725mtBbJ26c3B8oTMjA7GG1cl92dlLauyL5ClPjc1Cr+j4TU XWe6lYWIpyxjV2p1tJqHprDN/ynlwquthr1qbLAQzT4ZFUjobHJm1wNOhgouxHyyFZcv C0UA== 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=2vzQXCsiE8PuLnNZu34sY/6jMMftxW9L1acSr/qU3MU=; b=llSN7TWRHuYn3WbH1agGhoMmtWAmhavuD+aLW7jM0Stsn9HKQDyucjG38FwgEErUPL lqpo2Lr7jLeKCA/e/+dHehBJ26PfNuttqmXJK/Q8uG330W7o4LA1sPo2dDdUy1Xhe/lZ tu84kVfSn0AQ0alQv+0I1l7EbeU0Fu6l3JgLCBtBRguS2HV8Sa7SaYBEC9cK5yOaSIRI MZI6zvq4W8EGMeJkV+DM+z7/MK9xhR0+O9XNzsrPaqFbCxaPxzwQTGvPDy7YKa+ZynII WmJiqWIw05g8zhGgYZ86Q1099IGCklyc+RbQATy2dpmbj0SvooZawBEkY0/MFw14Q1Q3 mTCQ== X-Gm-Message-State: AOUpUlHP4b/vuhepE11y6XdObh/jYTG0sPyfbDsATOlRJOOYFJ4BbA9m dwLZFrtUtcaMdXsYOFaH6Y4= X-Google-Smtp-Source: AAOMgpenX6Y3ouzp5muve8RPf77iOaav6h/lalPdc5jMq6fNFf8JcZ0pJS/MGpeta9iUYGCvw7q/iA== X-Received: by 2002:a62:3b03:: with SMTP id i3-v6mr2963432pfa.197.1533215953543; Thu, 02 Aug 2018 06:19:13 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.216.237]) by smtp.gmail.com with ESMTPSA id u1-v6sm6723974pgk.25.2018.08.02.06.19.10 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Aug 2018 06:19:11 -0700 (PDT) Date: Thu, 2 Aug 2018 18:51:53 +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, m.szyprowski@samsung.com, ajitn.linux@gmail.com Subject: [PATCH v3] gpu/drm/exynos: Convert drm_atomic_helper_suspend/resume() Message-ID: <20180802132152.GA2833@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-20180802_061924_083826_A5280A8C X-CRM114-Status: GOOD ( 15.95 ) 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: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.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. Remove suspend_state from exynos_drm_private struct as it is no more useful. Signed-off-by: Ajit Negi Signed-off-by: Souptick Joarder Tested-by: Marek Szyprowski --- v2: Address Inki Dae's comment. Remove ret variable from both suspend/resume function. v3: Tested by Marek. Updated the change log. drivers/gpu/drm/exynos/exynos_drm_drv.c | 26 ++------------------------ drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 - drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 17 ----------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.h | 10 ---------- 4 files changed, 2 insertions(+), 52 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index b599f74..d86dd81 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -149,37 +149,15 @@ 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 (!drm_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 void exynos_drm_resume(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); - struct exynos_drm_private *private; - - if (!drm_dev) - return; - 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 drm_mode_config_helper_resume(drm_dev); } static const struct dev_pm_ops exynos_drm_pm_ops = { diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index c737c4b..7349e7c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -195,7 +195,6 @@ struct drm_exynos_file_private { */ struct exynos_drm_private { struct drm_fb_helper *fb_helper; - struct drm_atomic_state *suspend_state; struct device *g2d_dev; struct device *dma_dev; 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