From patchwork Wed Sep 10 14:10:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4877951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1593C9F32F for ; Wed, 10 Sep 2014 14:14:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 363F0200E0 for ; Wed, 10 Sep 2014 14:14:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 96270200DE for ; Wed, 10 Sep 2014 14:14:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRicV-0003lh-5G; Wed, 10 Sep 2014 14:11:39 +0000 Received: from mail-bn1on0117.outbound.protection.outlook.com ([157.56.110.117] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRicR-0003gY-86 for linux-arm-kernel@lists.infradead.org; Wed, 10 Sep 2014 14:11:37 +0000 Received: from BN3PR0301CA0067.namprd03.prod.outlook.com (25.160.152.163) by BLUPR03MB344.namprd03.prod.outlook.com (10.141.48.24) with Microsoft SMTP Server (TLS) id 15.0.1024.9; Wed, 10 Sep 2014 14:11:11 +0000 Received: from BL2FFO11FD031.protection.gbl (2a01:111:f400:7c09::136) by BN3PR0301CA0067.outlook.office365.com (2a01:111:e400:401e::35) with Microsoft SMTP Server (TLS) id 15.0.1024.12 via Frontend Transport; Wed, 10 Sep 2014 14:11:10 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD031.mail.protection.outlook.com (10.173.160.71) with Microsoft SMTP Server (TLS) id 15.0.1019.14 via Frontend Transport; Wed, 10 Sep 2014 14:11:10 +0000 Received: from dragon.ap.freescale.net ([10.192.185.80]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s8AEB3dn031985; Wed, 10 Sep 2014 07:11:04 -0700 From: Shawn Guo To: Greg Kroah-Hartman Subject: [PATCH] imx-drm: ipuv3-plane: remove function ipu_plane_dpms() Date: Wed, 10 Sep 2014 22:10:43 +0800 Message-ID: <1410358243-10527-1-git-send-email-shawn.guo@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019019)(6009001)(199003)(189002)(84676001)(74662001)(74502001)(31966008)(104016003)(87286001)(97736003)(77156001)(106466001)(81156004)(104166001)(105606002)(50986999)(99396002)(26826002)(62966002)(64706001)(87936001)(88136002)(80022001)(47776003)(77982001)(110136001)(20776003)(79102001)(102836001)(89996001)(21056001)(69596002)(68736004)(76482001)(19580405001)(83322001)(19580395003)(48376002)(44976005)(229853001)(81542001)(6806004)(81342001)(95666004)(107046002)(92726001)(85306004)(50466002)(33646002)(92566001)(83072002)(85852003)(86362001)(46102001)(575784001)(4396001)(90102001)(50226001)(36756003)(93916002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB344; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 033054F29A Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Shawn.Guo@freescale.com; X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140910_071135_460805_F7B0BF6B X-CRM114-Status: GOOD ( 10.69 ) X-Spam-Score: -1.8 (-) Cc: devel@driverdev.osuosl.org, Russell King , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All those ipu_*_put() calls in ipu_plane_dpms() are unnecessary, because the only occurrence of ipu_plane_dpms() with 'mode' not being DRM_MODE_DPMS_ON is in function ipu_disable_plane(), which already has a ipu_plane_put_resources() call to put those ipu resources right after ipu_plane_dpms(). So with those redundant ipu_*_put() calls removed from ipu_plane_dpms(), the only left code in the function is ipu_plane_enable|disable(). Thus, we can just call ipu_plane_enable|disable() as needed directly and remove the ipu_plane_dpms() function completely. Suggested-by: Philipp Zabel Signed-off-by: Shawn Guo --- Greg, This cleanup patch is based on Russell's fix -'imx-drm: ipuv3-plane: fix ipu_plane_dpms()'. Shawn drivers/staging/imx-drm/ipuv3-plane.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/drivers/staging/imx-drm/ipuv3-plane.c b/drivers/staging/imx-drm/ipuv3-plane.c index 50de10a550e9..06a0cb9c6b26 100644 --- a/drivers/staging/imx-drm/ipuv3-plane.c +++ b/drivers/staging/imx-drm/ipuv3-plane.c @@ -263,29 +263,6 @@ void ipu_plane_disable(struct ipu_plane *ipu_plane) ipu_dp_disable(ipu_plane->ipu); } -static void ipu_plane_dpms(struct ipu_plane *ipu_plane, int mode) -{ - bool enable; - - DRM_DEBUG_KMS("mode = %d", mode); - - enable = (mode == DRM_MODE_DPMS_ON); - - if (enable == ipu_plane->enabled) - return; - - if (enable) { - ipu_plane_enable(ipu_plane); - } else { - ipu_plane_disable(ipu_plane); - - ipu_idmac_put(ipu_plane->ipu_ch); - ipu_dmfc_put(ipu_plane->dmfc); - if (ipu_plane->dp) - ipu_dp_put(ipu_plane->dp); - } -} - /* * drm_plane API */ @@ -319,7 +296,8 @@ static int ipu_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, plane->crtc, crtc); plane->crtc = crtc; - ipu_plane_dpms(ipu_plane, DRM_MODE_DPMS_ON); + if (!ipu_plane->enabled) + ipu_plane_enable(ipu_plane); return 0; } @@ -330,7 +308,8 @@ static int ipu_disable_plane(struct drm_plane *plane) DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); - ipu_plane_dpms(ipu_plane, DRM_MODE_DPMS_OFF); + if (ipu_plane->enabled) + ipu_plane_disable(ipu_plane); ipu_plane_put_resources(ipu_plane);