From patchwork Fri Nov 16 18:42:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10686843 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 690161747 for ; Fri, 16 Nov 2018 18:44:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C0DD2895F for ; Fri, 16 Nov 2018 18:44:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 501CB2D804; Fri, 16 Nov 2018 18:44:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAC032895F for ; Fri, 16 Nov 2018 18:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729444AbeKQE5q (ORCPT ); Fri, 16 Nov 2018 23:57:46 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:33223 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729377AbeKQE5q (ORCPT ); Fri, 16 Nov 2018 23:57:46 -0500 Received: by mail-yw1-f65.google.com with SMTP id z72-v6so10540301ywa.0 for ; Fri, 16 Nov 2018 10:44:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x3B9JF+rT53JTawnN7UkUtvH2ZNKLq9wqoiNCmOLnFE=; b=Sf9PUwA/5oFBe6i/tin6l9zQWzG4e90SDRL3PMDEt4o9FV63AzlDFTGvDy71ZBxvgg yIkNZ8TR477B7kgGG8a7TvFrTnbcFAD7RI8smgWV+SmBpdTd7EYVwx2diiMrJzaNYOoO ErVcQ3pqGV55Lb5R09wXaRzapDy0tX7svWdDBal5sONgmHDHX3Y8qQv62CU+h6E8Rb5f nPM5Ct1oXl4wl1OMHACSBUFj3bdlX2W9lB3ndHeQhrVlq42qmf/TtMUaay7OLqKqBNuV Vwj9wrM+elrNkCuQri1+LwKo3ozsQS4VJHL5/gc6l/eLXGRqUwxMDAz1lkTz+ug27Vuq naYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x3B9JF+rT53JTawnN7UkUtvH2ZNKLq9wqoiNCmOLnFE=; b=AKt23fg4nZ7Zo8Po7HsOUEMvJBSWYhlwd7c1VjGf439qZi3qm4hLQu3M9LYYJ6vsob aSnKtTd+GINK8zoakqU6jhItEAFd6llA7crIbHwXyYrr0vlu+IqdewdZke3LlfSv2Z7n 1t00qboS5HgXxblB3wRy35S5sdbpMi3OYqOWsjM+tXMAQCm4Sts44b6iMF7lnY+eJleU Aa4IaZHDDmcpLCpShgmYFyOlEMwZOt0IuzLXk4XBCzQT1A2sWkniS5Ta84i30ejzm12u 2wgy8Y4hsKSRInicaRno79bS+MYjwfp566SvePhU9zl4gLQS7YYo2tNjtnTorCGzl/BC xkuA== X-Gm-Message-State: AGRZ1gI3oP+yYGZOx0RyI4O5388QMsyMKKAgigMA9DQyFZkN8CH5WV3y CVpMoNNbw+x70DnUx2Udyj8FDQ== X-Google-Smtp-Source: AJdET5fsnueizbOiQq72mupVVCxgiZqkt4LoSEwOfdkGaQTU0N5bgiK5hVLlnTiVXG3hB6IU1yOONQ== X-Received: by 2002:a81:160e:: with SMTP id 14-v6mr11306200yww.187.1542393853391; Fri, 16 Nov 2018 10:44:13 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id b144sm5359134ywa.33.2018.11.16.10.44.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 10:44:13 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: robdclark@gmail.com, jsanka@codeaurora.org, Sean Paul Subject: [PATCH v2 17/24] drm/msm: dpu: Move pm_runtime_(get|put) from vblank_enable Date: Fri, 16 Nov 2018 13:42:27 -0500 Message-Id: <20181116184238.170034-18-sean@poorly.run> X-Mailer: git-send-email 2.19.1.1215.g8438c0b245-goog In-Reply-To: <20181116184238.170034-1-sean@poorly.run> References: <20181116184238.170034-1-sean@poorly.run> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul There are 4 times that _dpu_crtc_vblank_enable_no_lock() is called: 1- crtc enable 2- crtc disable 3- crtc vblank enable 4- crtc vblank disable When we enable or disable the crtc, we call drm_crtc_vblank_on and drm_crtc_vblank_off respectively. That will gate vblank enables and disables to only being called when the crtc is active. That means that we can just enable/disable pm runtime in crtc enable/disable. This will be beneficial in trying to eliminate blocking calls from the vblank call chain. Changes in v2: - None Signed-off-by: Sean Paul Reviewed-by: Jeykumar Sankaran --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index cd0a0bea4335..c49aaf412b6e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -769,8 +769,6 @@ static void _dpu_crtc_vblank_enable_no_lock( struct drm_encoder *enc; if (enable) { - pm_runtime_get_sync(dev->dev); - list_for_each_entry(enc, &dev->mode_config.encoder_list, head) { if (enc->crtc != crtc) continue; @@ -793,8 +791,6 @@ static void _dpu_crtc_vblank_enable_no_lock( dpu_encoder_register_vblank_callback(enc, NULL, NULL); } - - pm_runtime_put_sync(dev->dev); } } @@ -891,6 +887,8 @@ static void dpu_crtc_disable(struct drm_crtc *crtc) crtc->state->event = NULL; spin_unlock_irqrestore(&crtc->dev->event_lock, flags); } + + pm_runtime_put_sync(crtc->dev->dev); } static void dpu_crtc_enable(struct drm_crtc *crtc, @@ -906,6 +904,8 @@ static void dpu_crtc_enable(struct drm_crtc *crtc, } priv = crtc->dev->dev_private; + pm_runtime_get_sync(crtc->dev->dev); + DRM_DEBUG_KMS("crtc%d\n", crtc->base.id); dpu_crtc = to_dpu_crtc(crtc);