From patchwork Fri Nov 13 15:53:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 7612401 Return-Path: X-Original-To: patchwork-linux-omap@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 D1BA09F2E2 for ; Fri, 13 Nov 2015 15:53:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0D78207C3 for ; Fri, 13 Nov 2015 15:53:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FF3F207E6 for ; Fri, 13 Nov 2015 15:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932399AbbKMPx3 (ORCPT ); Fri, 13 Nov 2015 10:53:29 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:34848 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932332AbbKMPx1 (ORCPT ); Fri, 13 Nov 2015 10:53:27 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id tADFrO4A021894; Fri, 13 Nov 2015 09:53:24 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id tADFrOtx004790; Fri, 13 Nov 2015 09:53:24 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Fri, 13 Nov 2015 09:53:24 -0600 Received: from imryr.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id tADFrHJv023368; Fri, 13 Nov 2015 09:53:22 -0600 From: Jyri Sarha To: , CC: , , , , Jyri Sarha Subject: [PATCH RFC v2 2/2] drm/atomic: Disable planes on blanked CRTC and enable on unblank Date: Fri, 13 Nov 2015 17:53:15 +0200 Message-ID: <43567a2449ed676194303f879e90feac9bf53f24.1447428525.git.jsarha@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Disable planes if they are on to be blanked CRTC and enable them when the CRTC is turned back on by DMPS. This is desirable on HW that loses its context on blanking. When planes are enabled and disabled with the associated CRTCs, there is no need to restore the plane context in runtime_resume callback. Signed-off-by: Jyri Sarha --- drivers/gpu/drm/drm_atomic_helper.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index d03e2ac..5cd8016 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2027,8 +2027,8 @@ EXPORT_SYMBOL(drm_atomic_helper_page_flip); * * This is the main helper function provided by the atomic helper framework for * implementing the legacy DPMS connector interface. It computes the new desired - * ->active state for the corresponding CRTC (if the connector is enabled) and - * updates it. + * ->active state for the corresponding CRTC and planes on it (if the connector + * is enabled) and updates it. * * Returns: * Returns 0 on success, negative errno numbers on failure. @@ -2041,6 +2041,7 @@ int drm_atomic_helper_connector_dpms(struct drm_connector *connector, struct drm_crtc_state *crtc_state; struct drm_crtc *crtc; struct drm_connector *tmp_connector; + struct drm_plane *tmp_plane; int ret; bool active = false; int old_mode = connector->dpms; @@ -2079,6 +2080,20 @@ retry: } crtc_state->active = active; + /* Collect associated plane states to global state object. */ + list_for_each_entry(tmp_plane, &config->plane_list, head) { + struct drm_plane_state *plane_state; + + if (tmp_plane->state->crtc != crtc) + continue; + + plane_state = drm_atomic_get_plane_state(state, tmp_plane); + if (IS_ERR(plane_state)) { + ret = PTR_ERR(plane_state); + goto fail; + } + } + ret = drm_atomic_commit(state); if (ret != 0) goto fail;