From patchwork Thu Sep 6 22:18:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Wu X-Patchwork-Id: 10591141 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 8C92C14BD for ; Thu, 6 Sep 2018 22:18:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 745762AD28 for ; Thu, 6 Sep 2018 22:18:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68C612AD2E; Thu, 6 Sep 2018 22:18:28 +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,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 2B4422AD28 for ; Thu, 6 Sep 2018 22:18:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BB406E781; Thu, 6 Sep 2018 22:18:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.lekensteyn.nl (mail.lekensteyn.nl [IPv6:2a02:2308::360:1:25]) by gabe.freedesktop.org (Postfix) with ESMTPS id 203526E77F for ; Thu, 6 Sep 2018 22:18:18 +0000 (UTC) Received: by lekensteyn.nl with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1fy2bM-0005Us-DR; Fri, 07 Sep 2018 00:18:12 +0200 From: Peter Wu To: Gerd Hoffmann Subject: [PATCH v2 1/4] bochs: use drm_fb_helper_set_suspend_unlocked in suspend/resume Date: Fri, 7 Sep 2018 00:18:07 +0200 Message-Id: <20180906221810.20170-2-peter@lekensteyn.nl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180906221810.20170-1-peter@lekensteyn.nl> References: <20180906221810.20170-1-peter@lekensteyn.nl> 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-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The "initialized" member is going away. suspend/resume still works (even if bochsfb_create is forced to fail). Signed-off-by: Peter Wu --- drivers/gpu/drm/bochs/bochs_drv.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index c61b40c72b62..0e79d9acf89e 100644 --- a/drivers/gpu/drm/bochs/bochs_drv.c +++ b/drivers/gpu/drm/bochs/bochs_drv.c @@ -107,11 +107,7 @@ static int bochs_pm_suspend(struct device *dev) drm_kms_helper_poll_disable(drm_dev); - if (bochs->fb.initialized) { - console_lock(); - drm_fb_helper_set_suspend(&bochs->fb.helper, 1); - console_unlock(); - } + drm_fb_helper_set_suspend_unlocked(&bochs->fb.helper, 1); return 0; } @@ -124,11 +120,7 @@ static int bochs_pm_resume(struct device *dev) drm_helper_resume_force_mode(drm_dev); - if (bochs->fb.initialized) { - console_lock(); - drm_fb_helper_set_suspend(&bochs->fb.helper, 0); - console_unlock(); - } + drm_fb_helper_set_suspend_unlocked(&bochs->fb.helper, 0); drm_kms_helper_poll_enable(drm_dev); return 0;