From patchwork Tue Jul 31 19:28:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10553297 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 8E50215E2 for ; Thu, 2 Aug 2018 07:21:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7818E2A6E5 for ; Thu, 2 Aug 2018 07:21:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C0CE2AF77; Thu, 2 Aug 2018 07:21:39 +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 239F12A6E5 for ; Thu, 2 Aug 2018 07:21:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 802876E43D; Thu, 2 Aug 2018 07:19:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 10D1389C6B for ; Tue, 31 Jul 2018 19:25:49 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id d17-v6so5127535pgv.10 for ; Tue, 31 Jul 2018 12:25:48 -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=ikNDl+7elGUJ2d3kCdplxvF3vjVOSBtnYK2Ma/4s7Bg=; b=TG89vXbFOAePQwlPob+Ab++/A9HQppQdlJ8mZCUiPcffM0Ei8c4Zglk0zAgat51teA W7OIk/5Fm9hiilr2ZTowgpUFh9ZB+mGRsPFj5WOl6LFqSbTRew446RaG879MV6X93Pkw gYm+qheXnmhl/8QiWMP3GgMmBp+fgA+K3VsVZBIH4bchtPmOwV8+fKyLYu9SPAjFkuOu wJ6BQuVCbb3sjKc2DbJ0UoLt2zYtq+uLLcQtywQ/F2ZK/swoPPcieHxoy4euwZDciC3B NiDUDPHS0u4ZwpY3u70y+cmSTM+xNET3jw3B9CSOtBtD8MGwrgHK/shx9ue2m24YUR3u yxPg== X-Gm-Message-State: AOUpUlFgLKuoXpIapRPuqvnbdmClHUyneuIcvjNse87M9KuFTb5/KaVf sHs95bDa98iBON5G8P5v6FU= X-Google-Smtp-Source: AAOMgpcRJii1MmLfQ7dJDit/m97xn8nF56RbW1kO4ELK1l99gWq0zDaBGxGFTQ9uA6NdhCycWF3tCQ== X-Received: by 2002:a62:ee06:: with SMTP id e6-v6mr23446947pfi.2.1533065148071; Tue, 31 Jul 2018 12:25:48 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.216.188]) by smtp.gmail.com with ESMTPSA id o4-v6sm40300611pgq.16.2018.07.31.12.25.45 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 12:25:46 -0700 (PDT) Date: Wed, 1 Aug 2018 00:58:33 +0530 From: Souptick Joarder To: p.zabel@pengutronix.de, airlied@linux.ie, ajitn.linux@gmail.com, leonard.crestez@nxp.com Subject: [PATCH v2] drm/imx: Convert drm_atomic_helper_suspend/resume() Message-ID: <20180731192832.GA12073@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: Thu, 02 Aug 2018 07:19:10 +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(). with this conversion, both the members of struct imx_drm_device pipes and state will be no more useful and it could be removed forever. Signed-off-by: Souptick Joarder Signed-off-by: Ajit Negi --- v2: Address Philipp's comment. Remove struct imx_drm_device. drivers/gpu/drm/imx/imx-drm-core.c | 43 ++------------------------------------ 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index 1d053bb..a692d68 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -35,12 +35,6 @@ #define MAX_CRTC 4 -struct imx_drm_device { - struct drm_device *drm; - unsigned int pipes; - struct drm_atomic_state *state; -}; - #if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) static int legacyfb_depth = 16; module_param(legacyfb_depth, int, 0444); @@ -219,22 +213,12 @@ static int compare_of(struct device *dev, void *data) static int imx_drm_bind(struct device *dev) { struct drm_device *drm; - struct imx_drm_device *imxdrm; int ret; drm = drm_dev_alloc(&imx_drm_driver, dev); if (IS_ERR(drm)) return PTR_ERR(drm); - imxdrm = devm_kzalloc(dev, sizeof(*imxdrm), GFP_KERNEL); - if (!imxdrm) { - ret = -ENOMEM; - goto err_unref; - } - - imxdrm->drm = drm; - drm->dev_private = imxdrm; - /* * enable drm irq mode. * - with irq_enabled = true, we can use the vblank feature. @@ -306,7 +290,6 @@ static int imx_drm_bind(struct device *dev) component_unbind_all(drm->dev, drm); err_kms: drm_mode_config_cleanup(drm); -err_unref: drm_dev_unref(drm); return ret; @@ -355,37 +338,15 @@ static int imx_drm_platform_remove(struct platform_device *pdev) static int imx_drm_suspend(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); - struct imx_drm_device *imxdrm; - - /* The drm_dev is NULL before .load hook is called */ - if (drm_dev == NULL) - return 0; - - drm_kms_helper_poll_disable(drm_dev); - imxdrm = drm_dev->dev_private; - imxdrm->state = drm_atomic_helper_suspend(drm_dev); - if (IS_ERR(imxdrm->state)) { - drm_kms_helper_poll_enable(drm_dev); - return PTR_ERR(imxdrm->state); - } - - return 0; + return drm_mode_config_helper_suspend(drm_dev); } static int imx_drm_resume(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); - struct imx_drm_device *imx_drm; - if (drm_dev == NULL) - return 0; - - imx_drm = drm_dev->dev_private; - drm_atomic_helper_resume(drm_dev, imx_drm->state); - drm_kms_helper_poll_enable(drm_dev); - - return 0; + return drm_mode_config_helper_resume(drm_dev); } #endif