From patchwork Mon Apr 2 15:11:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10319983 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 301E5602C8 for ; Mon, 2 Apr 2018 15:13:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EAE528B53 for ; Mon, 2 Apr 2018 15:13:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1342F28B5B; Mon, 2 Apr 2018 15:13:29 +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 A860628B53 for ; Mon, 2 Apr 2018 15:13:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFE9C6E19D; Mon, 2 Apr 2018 15:13:27 +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 5C6386E174 for ; Mon, 2 Apr 2018 15:13:26 +0000 (UTC) Received: by mail-yw0-x244.google.com with SMTP id e17so5089012ywa.1 for ; Mon, 02 Apr 2018 08:13:26 -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=i5euJovbzcxO+XdBoPDQZy7kzL3lokNGHN0lWN5Hx1g=; b=nq1mkBHn74/t4aFBq5wJTHvkTpUFBKzzP63MagtYuKtE+TFnlC/Ob1/uCorPVeX7Pc hNRXUTBAsB22CoFV/MmvlGMm4swXXis6bO5K37BPALzqYCBzodkqqNXf+X7cKd555mLg /aXxJEujgoiZLqf8D8RzNcuoFe8WNk+5834RE= 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=i5euJovbzcxO+XdBoPDQZy7kzL3lokNGHN0lWN5Hx1g=; b=fmmr/Y0afZZuXsna4SxVLi8Q5TNDEqpSTinWcOH3S7Wz/aagM7EPXsR0ly+sxLpvzc Leoqm4p6ndE79uuQDFmsx7rL3m+1ug2j5KQ//hqYO+DCzlmWD6sDFH4lvPMc1ASiFDvf DDjdM30vaDcLGRFhLH7NE6bHRg32m0qry1nN+Hp6kXnpBDsp9UjScLV9EgoGyavQfIBb siGPDxKhUhQFU1tRSR5a4xkvO9poUoHbiWixOArOs0rPT/GJjy5Hh6kgIT4jtq1SJY64 bl/kWjr/1tUTi/7TN0aDGSnp9ZVlLCkh5RS+KlceO/DIA5HAqdDSfwYqXaGj1nzwIfBD NC6Q== X-Gm-Message-State: AElRT7ExqvXNG8kCa0rQ3c2hNFqx95fxn76KaoIfKyILe5zvK6YlTpEA AMcVyXmXInf508LOtYnmHBpSpQ== X-Google-Smtp-Source: AIpwx4/1NWS3NY03A8u4f5RcD1OtgiNwaGwdCdZqjPw6X5dHjfg4tPoUUsnhVRNnWZw6SvpPPSDl8w== X-Received: by 10.129.38.132 with SMTP id m126mr5547809ywm.481.1522682005441; Mon, 02 Apr 2018 08:13:25 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id n26sm226983ywh.16.2018.04.02.08.13.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Apr 2018 08:13:24 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v3 6/8] drm/msm: Issue queued events when disabling crtc Date: Mon, 2 Apr 2018 11:11:30 -0400 Message-Id: <20180402151136.192869-7-seanpaul@chromium.org> X-Mailer: git-send-email 2.17.0.rc1.321.gba9d0f2565-goog In-Reply-To: <20180402151136.192869-1-seanpaul@chromium.org> References: <20180402151136.192869-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 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; }