From patchwork Sat Aug 11 20:11:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10565121 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 A57AF1815 for ; Tue, 14 Aug 2018 06:55:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9637A293C9 for ; Tue, 14 Aug 2018 06:55:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 884D1294C9; Tue, 14 Aug 2018 06:55:48 +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 36360293C9 for ; Tue, 14 Aug 2018 06:55:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 581876E23F; Tue, 14 Aug 2018 06:55:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9736B6E065 for ; Sat, 11 Aug 2018 20:08:58 +0000 (UTC) Received: by mail-pl0-x243.google.com with SMTP id t17-v6so5346069ply.13 for ; Sat, 11 Aug 2018 13:08:58 -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=CtbgM/NTlNYiBS2GbCvGWHgIJawlE9w7f17w5mGE2FU=; b=rxsxTxgo2GjJeutRU3f93J16zugpbQcgRZin2QMkagFZcYBpKxwdhQ3n4Mt3Iqjtgi pj9cB3VCvh61XMIcLbSWzmSASNRG+LBN4+apBulUTj2S666w60dVAM/YzlVlPoV4Q22c qSyzqQqwc7eGlWsRwqxNKKIKQF/iVSMjSna4Kn42vMN+Tn5WBgA9umBUXam2Wrv/Btk9 bf+hIgFwQKUrrSC0SYkAt0p+0GGyUQrnH4PYaJpSnEE8yuwxisnslPPIXbLAiAxipYAO 4X1Ls9R08mqZkDzSxl+4d3Q0FeKLwxoBcapkW8Nor3OnGz34zqmPv7YcT9EqxPPk1vde dHCQ== X-Gm-Message-State: AOUpUlGNX7J0j1dPMHC9z1/B6O+s8+kH07hGiNFNhPGchWav8Puh3Jqw dzpoLck6M3Ej+NxBGf/x9oI= X-Google-Smtp-Source: AA+uWPxc75kY/OfXOHDZcyS4skJJHf2XNv8Y0WoXIZpN8QV4IulCo4x3NbQdV+Hk9mRuUWlttq7Wgg== X-Received: by 2002:a17:902:4124:: with SMTP id e33-v6mr10896600pld.48.1534018138184; Sat, 11 Aug 2018 13:08:58 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([183.82.16.163]) by smtp.gmail.com with ESMTPSA id d19-v6sm38561409pfm.48.2018.08.11.13.08.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 11 Aug 2018 13:08:56 -0700 (PDT) Date: Sun, 12 Aug 2018 01:41:48 +0530 From: Souptick Joarder To: linux-graphics-maintainer@vmware.com, syeh@vmware.com, thellstrom@vmware.com, airlied@linux.ie, ajitn.linux@gmail.com, daniel@ffwll.ch Subject: [PATCH] drm/vmwgfx: Convert drm_atomic_helper_suspend/resume() Message-ID: <20180811201147.GA14169@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: Tue, 14 Aug 2018 06:55:00 +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-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(). suspend_state can be removed from vmw_private as it will not be used anymore. Signed-off-by: Ajit Negi Signed-off-by: Souptick Joarder --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 25 ++----------------------- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index bb6dbbe..a317cda 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -1521,7 +1521,7 @@ static int vmw_pm_freeze(struct device *kdev) WARN_ON(vmw_request_device_late(dev_priv)); dev_priv->suspend_locked = false; ttm_suspend_unlock(&dev_priv->reservation_sem); - if (dev_priv->suspend_state) + if (dev->mode_config.suspend_state) vmw_kms_resume(dev); if (dev_priv->enable_fb) vmw_fb_on(dev_priv); @@ -1558,8 +1558,8 @@ static int vmw_pm_restore(struct device *kdev) vmw_fence_fifo_up(dev_priv->fman); dev_priv->suspend_locked = false; ttm_suspend_unlock(&dev_priv->reservation_sem); - if (dev_priv->suspend_state) - vmw_kms_resume(dev_priv->dev); + if (dev->mode_config.suspend_state) + vmw_kms_resume(dev); if (dev_priv->enable_fb) vmw_fb_on(dev_priv); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 1abe217..b8e200b 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -438,7 +438,6 @@ struct vmw_private { struct vmw_framebuffer *implicit_fb; struct mutex global_kms_state_mutex; spinlock_t cursor_lock; - struct drm_atomic_state *suspend_state; /* * Context and surface management. diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 23beff5..2d011a1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -3028,19 +3028,7 @@ int vmw_kms_set_config(struct drm_mode_set *set, */ int vmw_kms_suspend(struct drm_device *dev) { - struct vmw_private *dev_priv = vmw_priv(dev); - - dev_priv->suspend_state = drm_atomic_helper_suspend(dev); - if (IS_ERR(dev_priv->suspend_state)) { - int ret = PTR_ERR(dev_priv->suspend_state); - - DRM_ERROR("Failed kms suspend: %d\n", ret); - dev_priv->suspend_state = NULL; - - return ret; - } - - return 0; + return drm_mode_config_helper_suspend(dev); } @@ -3055,16 +3043,7 @@ int vmw_kms_suspend(struct drm_device *dev) */ int vmw_kms_resume(struct drm_device *dev) { - struct vmw_private *dev_priv = vmw_priv(dev); - int ret; - - if (WARN_ON(!dev_priv->suspend_state)) - return 0; - - ret = drm_atomic_helper_resume(dev, dev_priv->suspend_state); - dev_priv->suspend_state = NULL; - - return ret; + return drm_mode_config_helper_resume(dev); } /**