From patchwork Wed Mar 28 19:06:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10313909 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 18F4760212 for ; Wed, 28 Mar 2018 19:08:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0931A28F81 for ; Wed, 28 Mar 2018 19:08:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1E4628FBE; Wed, 28 Mar 2018 19:08:51 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 7F5C828F81 for ; Wed, 28 Mar 2018 19:08:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 50B536E628; Wed, 28 Mar 2018 19:08:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-x244.google.com (mail-yw0-x244.google.com [IPv6:2607:f8b0:4002:c05::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 61A186E248 for ; Wed, 28 Mar 2018 19:08:48 +0000 (UTC) Received: by mail-yw0-x244.google.com with SMTP id r145so1162431ywe.7 for ; Wed, 28 Mar 2018 12:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3WT57MkI++UqVBX1biLZVcrh+YuICzJfeG2YKkd+pmc=; b=iFE6qJn/o+KNQCsDkBYDbh/hIpd/5wrQBi6DEGJ2Th85UADUOGWWwcnY3p1XRAkXEI gYJlrqfon/eNi9l1oV0FSXBvLB2OL4QHvEpEdhlfO9pr/VF2PrUHSx3v/JVl36EkrWHj xO7soBY8hc058BSawKGXfN2XDglWJ1+p2RXMg= 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; bh=3WT57MkI++UqVBX1biLZVcrh+YuICzJfeG2YKkd+pmc=; b=DilMqyMyrcHGvCKtp834lGSqdXugJ319S+TcXSl8bHhOfoEy+Le2tNvBCLbOQLHG2z VIMlacBopzdLCmnL2o01UR0YuOoxvxirKD1m55naJEVgbyKC2a/5hJAN65wWLeCSdsYY nhooziGtDKuQlLdXeUfxYNqvl6B5kvGGWqyGtIVQbEe/LzynQUcBmAHMdv//g8bdOSGq R9hOw0iA0b5tBkJc24L5sKc0VpGLtE6dcVmiK7Q4Xiu2KJoxVvHS+6yGsyG1XmK/pfj4 FJi7K1fJriJbNtZ+gEix8QYpPXoxM+RZ0dhIW3Wn0CgtcsewkCWaP1ckB4tsmUkERfYl 63uA== X-Gm-Message-State: AElRT7F+rbRluaolKkPyEKiDQoRr0wE4UFbusyTIVdv83QRno/RbMaMH YmEMWMwsFNmQIvocQS2D8kEzfA== X-Google-Smtp-Source: AIpwx4+NLh01AWCsC3pPWIRl4QDFjd0e/qq950g0alLWJpUGeXyixz+AhkF1F5gJbysMEg5Acz+L6w== X-Received: by 10.129.159.195 with SMTP id w186mr3114327ywg.414.1522264127521; Wed, 28 Mar 2018 12:08:47 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id z6sm1621054ywb.95.2018.03.28.12.08.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 12:08:47 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 4/6] drm/msm: Issue queued events when disabling crtc Date: Wed, 28 Mar 2018 15:06:50 -0400 Message-Id: <20180328190657.218661-5-seanpaul@chromium.org> X-Mailer: git-send-email 2.17.0.rc1.321.gba9d0f2565-goog In-Reply-To: <20180328190657.218661-1-seanpaul@chromium.org> References: <20180328190657.218661-1-seanpaul@chromium.org> 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, abhinavk@codeaurora.org, hoegsberg@chromium.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Ensure that any queued events are issued when disabling the crtc. This avoids timeouts when we come back and wait for dependencies (like the previous frame's flip_done). Changes in v2: - None Signed-off-by: Sean Paul Reviewed-by: Archit Taneja --- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index 76b96081916f..10271359789e 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -430,6 +430,7 @@ static void mdp5_crtc_atomic_disable(struct drm_crtc *crtc, struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); struct mdp5_kms *mdp5_kms = get_kms(crtc); struct device *dev = &mdp5_kms->pdev->dev; + unsigned long flags; DBG("%s", crtc->name); @@ -445,6 +446,14 @@ static void mdp5_crtc_atomic_disable(struct drm_crtc *crtc, mdp_irq_unregister(&mdp5_kms->base, &mdp5_crtc->err); pm_runtime_put_sync(dev); + if (crtc->state->event && !crtc->state->active) { + WARN_ON(mdp5_crtc->event); + spin_lock_irqsave(&mdp5_kms->dev->event_lock, flags); + drm_crtc_send_vblank_event(crtc, crtc->state->event); + crtc->state->event = NULL; + spin_unlock_irqrestore(&mdp5_kms->dev->event_lock, flags); + } + mdp5_crtc->enabled = false; }