From patchwork Wed Apr 11 01:54:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Kumar X-Patchwork-Id: 10334743 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 6BE0A6053F for ; Wed, 11 Apr 2018 01:54:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B69A285E8 for ; Wed, 11 Apr 2018 01:54:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F948285FB; Wed, 11 Apr 2018 01:54:23 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 D3BFD285EC for ; Wed, 11 Apr 2018 01:54:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 717226E08B; Wed, 11 Apr 2018 01:54:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id D35BA6E03A; Wed, 11 Apr 2018 01:54:17 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 764F560C65; Wed, 11 Apr 2018 01:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523411657; bh=zD6mG/bbJfTNs5xiNLUomtBIrfXXZ4Sh5yYjlM/66bw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ho1dbVzYT1BbseN8g8z1WpinorypOs8hu59KzmrRCeX4otvgU0Eas7WNuS9ODjdMb lRT8TKyRLl0WyREOeOBqVNKCLz9QeqGJh1b4rtuMTc825xjHQ4DLD9SMdrfmZdiEnf sQOMHyhYDnuHQOQKEWLELqWVbF2Ptvlc8oMQF6pE= Received: from abhinavk-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: abhinavk@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 710D360249; Wed, 11 Apr 2018 01:54:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523411656; bh=zD6mG/bbJfTNs5xiNLUomtBIrfXXZ4Sh5yYjlM/66bw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IdW54g2pECqCvZuO1FMfQMQfFR3XXLzUKOS0b1JOwrj9FyF0rKQUyHykSDA6raf0K ejAe4ZILQ6pR/ALB21LrCbvypKKj80PkrcI4PRga0J4ofQOeOiPX8do6q9UPMZoPcb hz5q5DA8NlQIj8kqxr5+swPVCLLzuguYl6usO/RY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 710D360249 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=abhinavk@codeaurora.org From: Abhinav Kumar To: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Subject: [DPU PATCH v2 1/2] drm/msm/dsi: check video mode engine status before waiting Date: Tue, 10 Apr 2018 18:54:06 -0700 Message-Id: <1523411647-16840-1-git-send-email-abhinavk@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523087405-18877-1-git-send-email-abhinavk@codeaurora.org> References: <1523087405-18877-1-git-send-email-abhinavk@codeaurora.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: jeykumar@quicinc.com, Abhinav Kumar , hoegsberg@google.com, chandanu@codeaurora.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Make sure the video mode engine is on before waiting for the video done interrupt. Otherwise it leads to silent timeouts increasing display turn ON time. Changes in v2: - Replace pr_err with dev_err - Changed error message Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi_host.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 7a03a94..5b7b290 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -173,6 +173,7 @@ struct msm_dsi_host { bool registered; bool power_on; + bool enabled; int irq; }; @@ -986,13 +987,19 @@ static void dsi_set_tx_power_mode(int mode, struct msm_dsi_host *msm_host) static void dsi_wait4video_done(struct msm_dsi_host *msm_host) { + u32 ret = 0; + struct device *dev = &msm_host->pdev->dev; + dsi_intr_ctrl(msm_host, DSI_IRQ_MASK_VIDEO_DONE, 1); reinit_completion(&msm_host->video_comp); - wait_for_completion_timeout(&msm_host->video_comp, + ret = wait_for_completion_timeout(&msm_host->video_comp, msecs_to_jiffies(70)); + if (ret <= 0) + dev_err(dev, "wait for video done timed out\n"); + dsi_intr_ctrl(msm_host, DSI_IRQ_MASK_VIDEO_DONE, 0); } @@ -1001,7 +1008,7 @@ static void dsi_wait4video_eng_busy(struct msm_dsi_host *msm_host) if (!(msm_host->mode_flags & MIPI_DSI_MODE_VIDEO)) return; - if (msm_host->power_on) { + if (msm_host->power_on && msm_host->enabled) { dsi_wait4video_done(msm_host); /* delay 4 ms to skip BLLP */ usleep_range(2000, 4000); @@ -2203,7 +2210,7 @@ int msm_dsi_host_enable(struct mipi_dsi_host *host) * pm_runtime_put_autosuspend(&msm_host->pdev->dev); * } */ - + msm_host->enabled = true; return 0; } @@ -2219,7 +2226,7 @@ int msm_dsi_host_disable(struct mipi_dsi_host *host) * Reset to disable video engine so that we can send off cmd. */ dsi_sw_reset(msm_host); - + msm_host->enabled = false; return 0; }