From patchwork Thu Jun 4 09:02:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 6545631 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1AEDA9F6CE for ; Thu, 4 Jun 2015 11:06:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83BC82077E for ; Thu, 4 Jun 2015 11:06:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 39013207BD for ; Thu, 4 Jun 2015 11:06:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B2B5F6EA80; Thu, 4 Jun 2015 04:06:35 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by gabe.freedesktop.org (Postfix) with ESMTP id 5627B6EA73 for ; Thu, 4 Jun 2015 02:11:53 -0700 (PDT) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t5494Lmc010389; Thu, 4 Jun 2015 04:04:21 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5494LZk012134; Thu, 4 Jun 2015 04:04:21 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Thu, 4 Jun 2015 04:04:21 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5493Ywa014785; Thu, 4 Jun 2015 04:04:20 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCHv2 34/45] drm: omapdrm: Simplify DSS power management Date: Thu, 4 Jun 2015 12:02:51 +0300 Message-ID: <1433408582-9828-35-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433408582-9828-1-git-send-email-tomi.valkeinen@ti.com> References: <1433408582-9828-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 04 Jun 2015 04:06:34 -0700 Cc: Tomi Valkeinen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 From: Laurent Pinchart Instead of sprinkling dispc_runtime_get() and dispc_runtime_put() calls in various CRTC operations, move all power management code to the atomic commit function. Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_crtc.c | 11 ----------- drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++++ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 16f9c07dc4f6..3a5e68a06af3 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -429,8 +429,6 @@ static void omap_crtc_enable(struct drm_crtc *crtc) DBG("%s", omap_crtc->name); - dispc_runtime_get(); - /* Enable all planes associated with the CRTC. */ for (i = 0; i < priv->num_planes; i++) { struct drm_plane *plane = priv->planes[i]; @@ -443,8 +441,6 @@ static void omap_crtc_enable(struct drm_crtc *crtc) omap_crtc_flush(crtc); drm_crtc_vblank_on(crtc); - - dispc_runtime_put(); } static void omap_crtc_disable(struct drm_crtc *crtc) @@ -456,7 +452,6 @@ static void omap_crtc_disable(struct drm_crtc *crtc) DBG("%s", omap_crtc->name); omap_crtc_wait_page_flip(crtc); - dispc_runtime_get(); drm_crtc_vblank_off(crtc); /* Disable all planes associated with the CRTC. */ @@ -469,8 +464,6 @@ static void omap_crtc_disable(struct drm_crtc *crtc) omap_crtc_encoder_setup(crtc, false); omap_crtc_flush(crtc); - - dispc_runtime_put(); } static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc) @@ -495,8 +488,6 @@ static void omap_crtc_atomic_begin(struct drm_crtc *crtc) struct drm_device *dev = crtc->dev; unsigned long flags; - dispc_runtime_get(); - if (event) { WARN_ON(omap_crtc->event); WARN_ON(drm_crtc_vblank_get(crtc) != 0); @@ -511,8 +502,6 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc) { omap_crtc_flush(crtc); - dispc_runtime_put(); - crtc->invert_dimensions = !!(crtc->primary->state->rotation & (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270))); } diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 2e7706355eb6..50f555530e55 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -73,6 +73,8 @@ static void omap_atomic_complete(struct omap_atomic_state_commit *commit) struct drm_atomic_state *old_state = commit->state; /* Apply the atomic update. */ + dispc_runtime_get(); + drm_atomic_helper_commit_modeset_disables(dev, old_state); drm_atomic_helper_commit_planes(dev, old_state); drm_atomic_helper_commit_modeset_enables(dev, old_state); @@ -81,6 +83,8 @@ static void omap_atomic_complete(struct omap_atomic_state_commit *commit) drm_atomic_helper_cleanup_planes(dev, old_state); + dispc_runtime_put(); + drm_atomic_state_free(old_state); /* Complete the commit, wake up any waiter. */