Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3787111imm; Mon, 6 Aug 2018 10:33:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpexwZI3vu8NbtYvSDLRPDHngignq+s8bHEDyYrAUkeBIOqeW2vQbxyG2YnqDr8SoTKoRKVE X-Received: by 2002:a63:2e09:: with SMTP id u9-v6mr15138504pgu.294.1533576829842; Mon, 06 Aug 2018 10:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533576829; cv=none; d=google.com; s=arc-20160816; b=KNdgYi0Y+lY+jm6CW63iKR5LNg0NApNqYrXvrdKyWfyqlnfT8OmWwhS2gdTpP6zl+W Q5oTTYawg0uFxM7yCXIwhg6MmS7f6cxciWigYVkOVUohxH/qy6uCrRX9+ceLznWMdflr k6p+6+6CsVCTh8l9RZ0XsuwrkbuIu50D8aM+o/bCkvoIOfKSECbtFDeIh5Ad5ZqC4HAK CFDvYemdkPdIhOdLZxNZFi2qRhD6D4GiCyfXNKqz8uP1/YPQNhJugf0F+3Ov7BPTzhgO E4fYyQjNPrptrXPlzeJkgMsykUnmoHToIzrgsUUUnmbywROPe+PkwWfLqugGrGRtbSlR 50qw== 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=eQwj5isHeQ9gI+aneM2JDEHNLTC2hIfHAKk1f6sDIDk=; b=MXOZjFsHncHhB9fQmd8w+Kd/rJK9bZHDZnJrawQIYA/CKYbRL8Abo71vBPQcLHn3nN Jc4hTLyEwWkEIxlvtQUIyCP1oxom7gM5KVojFpbQwLtlrP9eYeiiyI1/PuPK9mn/KIWR /037EFAkYlNxdfBVMxXSCtNDdIBOAECmfR6LhZtCEZEIFRKfAgT/hHUHf2yk/FM2ntWr PCOxRLMdSzbU6uErtIBxh3lB/ytCXlSEWCVWNNGelKLbl9vU2c4vbhgKGUHrYyoU7/rF rsIOrRBjyquybPP1/eyHX7ZXA3OKRVYFoJn+a8snaLpdKZSpBifjX6tv0xsznjyw8nbD ig4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MmL6rUjF; 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 l123-v6si6665782pfd.223.2018.08.06.10.33.34; Mon, 06 Aug 2018 10:33:49 -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=MmL6rUjF; 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 S1732338AbeHFQzj (ORCPT + 99 others); Mon, 6 Aug 2018 12:55:39 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:45938 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732258AbeHFQzj (ORCPT ); Mon, 6 Aug 2018 12:55:39 -0400 Received: by mail-pg1-f195.google.com with SMTP id f1-v6so6321200pgq.12 for ; Mon, 06 Aug 2018 07:46: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=eQwj5isHeQ9gI+aneM2JDEHNLTC2hIfHAKk1f6sDIDk=; b=MmL6rUjFcnS+erhI52bHd8DP4Eb9Ybg5eZ8NNNC6Z/kjgjByaD0ebgw8VylP3Ce/KT K9CcaCaK2pkFX+gN8ZQvbfhacbNPuPV7rACO3aiLIjuqgB1n+ro8DN84kX1u24AkEnIg Y/LJSy9050b3EoBvns0W1+z4ECKTVxV8K+iJYk/Mu+IZYAOzoHSWA9HO/B981YwGOpFV epVpY68FbNwbPSQWHmcciJvAa46ev32zKOqjj700HRTYl+DlbIP4oFVdwBL1IyR+OLUu 0lwRUWhLZRt9NDaloWMpmm1//at1Cz4Lxf++2lP3yW6yxCj8MC4NKV1Veds/K4OCRry0 lftg== 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=eQwj5isHeQ9gI+aneM2JDEHNLTC2hIfHAKk1f6sDIDk=; b=AWAevZ7ZaucgaMt1o2Udj2p+6BPqJPIjzsafhIoYVAbG9BGUmBGAz3Ge53ZXi6CEfE reNOg53+r4mmQYWo9iUNsDDh/BB29rFHs4DbRd/MYDM8sVSs15PICcKMM06a5FMw2Oet 8gbYQhm9z9bvXgzz+R+kaGt4WtKjahug0I9qE9Tl1q0C02vBrGd6gU9GCov0KVIx1xgS 5dSLGSJqYDPJ5x1Ih+pWkJKdRe9vJZv1AfY9enOd3a/5WXFhp1bQoWjQoyh7bl9tntbn YRNBWsAX13nAj2SDw8s/cA5BrNMae9JbhPmjceZyWj0qJRkbraSj7Oe8YembYG+EReoU kyAg== X-Gm-Message-State: AOUpUlHpMKtIbkF4dllNncm+aICBIv6kl7fxKuN2cBdgpeVbha6lsXuq QYuzbFE4b0th90z/F4PrJlY= X-Received: by 2002:a63:df50:: with SMTP id h16-v6mr14027672pgj.300.1533566772698; Mon, 06 Aug 2018 07:46:12 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.219.203]) by smtp.gmail.com with ESMTPSA id s66-v6sm11860812pgc.67.2018.08.06.07.46.10 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Aug 2018 07:46:11 -0700 (PDT) Date: Mon, 6 Aug 2018 20:19:01 +0530 From: Souptick Joarder To: z.liuxinliang@hisilicon.com, zourongrong@gmail.com, kong.kongxinwei@hisilicon.com, puck.chen@hisilicon.com, airlied@linux.ie, ajitn.linux@gmail.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, brajeswar.linux@gmail.com, sabyasachi.linux@gmail.com, daniel@ffwll.ch Subject: [PATCH] gpu/drm/hisilicon: Convert drm_atomic_helper_suspend/resume() Message-ID: <20180806144900.GA13925@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(). Fixed one sparse warning by making hibmc_drm_interrupt static. Signed-off-by: Ajit Negi Signed-off-by: Souptick Joarder Reviewed-by: Xinliang Liu --- v2: remove ret variable from both suspend and resume. remove suspend_state from hibmc_drm_private struct. drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 20 +++----------------- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 - 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index d4f6f1f..ee24480 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -37,7 +37,7 @@ .llseek = no_llseek, }; -irqreturn_t hibmc_drm_interrupt(int irq, void *arg) +static irqreturn_t hibmc_drm_interrupt(int irq, void *arg) { struct drm_device *dev = (struct drm_device *)arg; struct hibmc_drm_private *priv = @@ -74,30 +74,16 @@ static int __maybe_unused hibmc_pm_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct drm_device *drm_dev = pci_get_drvdata(pdev); - struct hibmc_drm_private *priv = drm_dev->dev_private; - - drm_kms_helper_poll_disable(drm_dev); - priv->suspend_state = drm_atomic_helper_suspend(drm_dev); - if (IS_ERR(priv->suspend_state)) { - DRM_ERROR("drm_atomic_helper_suspend failed: %ld\n", - PTR_ERR(priv->suspend_state)); - drm_kms_helper_poll_enable(drm_dev); - return PTR_ERR(priv->suspend_state); - } - return 0; + return drm_mode_config_helper_suspend(drm_dev); } static int __maybe_unused hibmc_pm_resume(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct drm_device *drm_dev = pci_get_drvdata(pdev); - struct hibmc_drm_private *priv = drm_dev->dev_private; - drm_atomic_helper_resume(drm_dev, priv->suspend_state); - drm_kms_helper_poll_enable(drm_dev); - - return 0; + return drm_mode_config_helper_resume(drm_dev); } static const struct dev_pm_ops hibmc_pm_ops = { diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h index e195521..45c25a4 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h @@ -47,7 +47,6 @@ struct hibmc_drm_private { /* drm */ struct drm_device *dev; bool mode_config_initialized; - struct drm_atomic_state *suspend_state; /* ttm */ struct drm_global_reference mem_global_ref; -- 1.9.1