From patchwork Mon Aug 6 14:49:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10558701 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 AF81A174A for ; Tue, 7 Aug 2018 13:09:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98DD029CAE for ; Tue, 7 Aug 2018 13:09:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C0C029D38; Tue, 7 Aug 2018 13:09:25 +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 1A9E029D0F for ; Tue, 7 Aug 2018 13:09:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E44866E3F0; Tue, 7 Aug 2018 13:08:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3094A6E2EF for ; Mon, 6 Aug 2018 14:46:13 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id k3-v6so6336920pgq.5 for ; Mon, 06 Aug 2018 07:46:13 -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=eQwj5isHeQ9gI+aneM2JDEHNLTC2hIfHAKk1f6sDIDk=; b=NqMTyVMVYriIXBHnbdOc6hEH751e3XOOBWNst2ivo7609XvAnrAZQpV8e13MtWwsrt banIY4L9Vhy5jc4UNMHhmVHLt2iCdR4WQDvoNfmmyqxDbNeWlP0oaMkAeJfDi/uxdtgB 7rvk37kvclJ6dUlnwtsaKv6c+L+O6KR+M5562ysmUBwT5i49ILX2WjwKjH+uNu9LUxDt lRiYE5hBCt2TPRyivMeScTe741a6RvD/vLtG8JLCcKK5htrafoxv3VIYKIZ2N200e5+7 WHUjv9yUS1AsCglm+7BXw3xTPc3y5B/oKO2ybBd/LNAhNCwTIgEVDIqkUg/8cg2I8jTS aTMQ== X-Gm-Message-State: AOUpUlHDmAgGP7d6C0uxs0l178H0cy9ChEeyyMDYjKmi+DGSN0ea0+Ef bkCqinsU8WmF4dLpotPYLtILMCwv X-Google-Smtp-Source: AAOMgpcGvSVj1oJGT66jLMbBpB3Qt/PuHJHWTJz6R9uQ7qCU5SNe47UnaKaAtNE8gvJsL9lnymWL9w== 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 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-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Tue, 07 Aug 2018 13:08:03 +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: sabyasachi.linux@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, brajeswar.linux@gmail.com 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(). 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;