Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1423557imm; Sat, 11 Aug 2018 13:10:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzfQJKP5w94LzRP2nAYprOjSsasap75hB5YHY3rvY4zbAZGHVA69B7mZ7O/fE9TXI/tYyU+ X-Received: by 2002:a17:902:6ac3:: with SMTP id i3-v6mr10959161plt.252.1534018242795; Sat, 11 Aug 2018 13:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534018242; cv=none; d=google.com; s=arc-20160816; b=MdAJ+jVIj3UfeDBrPC6+dLA8eVYGBkO6QAjozPAC+gqbZhFCdOPCTs1RJpz6k4uIwx Qq+EQkYKOthqbumMAkL10yP2x/1iqh9hbx3ZHbbtmudSxh50ipPZlkqOO3w+Kk+EKXE/ w6/XqnO8aa9PwSMkgRoYMutSNRXdF0dfpPeQGf9OC9h0Z0sVMfbBmdgG98Qk3IHpyu5K /Irx3PWXAjsAYoDi0lnky0lUyLXyeEiXFCF0ovI+GQZzenpIr8Z2lz63s6akR9fQof5w jInoVGLARqwrjDn+Lh9/B5FCq8nw/QTlp1HbAM6pKUgTSsjHwBzjkDuaNWZixsCFAOru ivDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=CtbgM/NTlNYiBS2GbCvGWHgIJawlE9w7f17w5mGE2FU=; b=LXfMlXIp7KX8+BOEQj4Cmbzn9kMFMVkomivGSKV6mDp3cuBOl9j/Jhbg1EWAAvrXhf iPeszj+ciLBa0Ls/WF6ISV1pTZZMQeN4VlZw51F3ANGxoXv4C1qi2QUTOtqxdzErXE6B DRYt1zqQdBdlAG4IKCACz10HtlkxHTtgbD5KAhhWYl5M0w8pUWIe66sxbwhL4HUkXItX tYEarwu0KZlGhNyvh+0xE/c1vlXq7W1a7TCflw4hZWAZPN618JZX2YDeCURa7UQNtD64 t5jokMTZP7RsK4mLXXoaMMUEvnJK0ql8Cew/BFlg0j7dLPrhgrh1CvL0+M9KK7C9UUMK 1gxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qBa+GiVf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4-v6si13726452pgg.537.2018.08.11.13.10.28; Sat, 11 Aug 2018 13:10:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qBa+GiVf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727700AbeHKWoO (ORCPT + 99 others); Sat, 11 Aug 2018 18:44:14 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:35036 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727441AbeHKWoO (ORCPT ); Sat, 11 Aug 2018 18:44:14 -0400 Received: by mail-pl0-f67.google.com with SMTP id w3-v6so5370357plq.2 for ; Sat, 11 Aug 2018 13:08:58 -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=CtbgM/NTlNYiBS2GbCvGWHgIJawlE9w7f17w5mGE2FU=; b=qBa+GiVfooIUlcgUC0My3Zm5pHoPNbNPSkOVTLoB/J+oEXB08pcGO1Ev5w/f+eLKrc P+5701UAuSukHnpjj2T+EO+tX/UAdyQxEtBbJ3of+y+QFwI1yg0lahOob+Y2pacJ3KLh IkF93Z1NpNmCSzncdJTvKKGfjsTSRTIWfs57hVs2gbOL8AoRw+mY1bAVIM1kFX2gYFOw ZOHH2cw5wNCVXMMc1Z8sQKwOq47u7VW1THPSu7IW017zU89dt90HcffWmJzXDssl0/xY azHaEpICMhN6Q82l2YsCiZseLmx1XkfitoXJ7bjaaRGkYfiwYGh5wpXWn+nVt4cJePaP ohPQ== 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=OP0hUA6lqTLH+kxbul2MKS7u8ZcXwLUUAXaeAgS0aOhzls09BjpKVIIiktE9l4pTyQ NFKn/rczyJ8lsF37vN+NIs85gVZuaD4BKQSd0bB+uLtgtYJ2bN6S1MoHdgahCYj0I4b7 TN5f8zFyR3zDSUmM/jMJz0pzbJKtBglkYu+RSdvvjSa+Uw9qdmDNWx5jostXq9l6gdOO ukgPQgaXRfB+Hry10ulU2+24qPVM0wtYCy0yuUE6OEkGofFVQCnEKtmDdkkrcCe0HMiJ X22s2/12A5X3sAmj9tyYPH49edK3J9iHsFTcpXdJWlRVdSz98+HnENFKWirYn0YYnCk6 lklQ== X-Gm-Message-State: AOUpUlFo7RrbKayTICKSw6kBY+q73L/gHMkM3KdISQN0D2l2EOBvZ1/B 0riNi1xrv44vz25jFkXsnyaINT51 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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/vmwgfx: Convert drm_atomic_helper_suspend/resume() Message-ID: <20180811201147.GA14169@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } /** -- 1.9.1