From patchwork Wed Apr 4 16:40:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10322907 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 ABC2B6032A for ; Wed, 4 Apr 2018 16:41:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A62128791 for ; Wed, 4 Apr 2018 16:41:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F4C628F7F; Wed, 4 Apr 2018 16:41:11 +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 2D89528791 for ; Wed, 4 Apr 2018 16:41:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 39A536E4AF; Wed, 4 Apr 2018 16:40:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb0-x243.google.com (mail-yb0-x243.google.com [IPv6:2607:f8b0:4002:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3800C6E478 for ; Wed, 4 Apr 2018 16:40:57 +0000 (UTC) Received: by mail-yb0-x243.google.com with SMTP id f5-v6so4725173ybg.0 for ; Wed, 04 Apr 2018 09:40:57 -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=78FGXSQHmfJW+4jWhvoNqyQQpeiq1Z8wJy74qkUJoss=; b=cviWGq7ba108wSGV8g0Jhty9OvkHgNV6+2rTOlSsN8vUToOVACwVTgfsfoWwEjulEA dlsnXgvIVn0QZhxga7hUiVC+mbvTKHL3vuDuE6W/idwwuVPm9008RkheYE9ROeYCY5vu ocHreGQagAYQq1EK7ujX9eqHNRNUvRfgQ+888= 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=78FGXSQHmfJW+4jWhvoNqyQQpeiq1Z8wJy74qkUJoss=; b=fcM2xVHQvtuSrxWgro/TXwvwbDTisA6wCclHPk2ApOCh6Z58mPR8HxXrBxX8OFS43z zdUxcQay7q7jd/9zyVFQaUrdODOwY8FEfveXAppRr35dZKC8mkdH0UUXO92N/rkgApwv lLCFnLb/Vi5Ig/GC8M4nxHUXRNB6slFgdhQTuKydUUIjwPbtk2pDin2Z/CZm6xZPMNZy ONrj74spv8x2qU7f9Gg0lavKJZ3JlH6IRo/89NDJenSQ0MBgYPJPhT2lwKam2tIrUZiF 1fv/qdmlauWajP0DqsnF5woSZG1c5Z7YDFGnJJmgCdiodVd3aMTuNlgXc9zMGphBV/nI cXTQ== X-Gm-Message-State: ALQs6tA4fyBXr8FChAtlzBO9jg4p51qisqtuBtcCcq+ZB/dKO2ViagJ6 SwYIVe55f4yN/ERhlMpZeA4cOg== X-Google-Smtp-Source: AIpwx48wLUzCzbcJ6sj6zbGrgFjJYHptFr1z/wvfkf1hdyhybc9WKBzTK+zMS5HN3nj5YYKCuoSaEg== X-Received: by 10.13.223.207 with SMTP id i198mr2446380ywe.263.1522860056497; Wed, 04 Apr 2018 09:40:56 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id p124sm2221027ywf.20.2018.04.04.09.40.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 09:40:56 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v4 7/9] drm/msm: Issue queued events when disabling crtc Date: Wed, 4 Apr 2018 12:40:46 -0400 Message-Id: <20180404164048.42126-8-seanpaul@chromium.org> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog In-Reply-To: <20180404164048.42126-1-seanpaul@chromium.org> References: <20180404164048.42126-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: 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 Changes in v3: - Rebased on Archit's private_obj set Changes in v4: - None Reviewed-by: Archit Taneja Signed-off-by: Sean Paul --- 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; }