From patchwork Thu Sep 27 11:48:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10617915 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 A7B5814BD for ; Thu, 27 Sep 2018 12:00:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9698C2B27E for ; Thu, 27 Sep 2018 12:00:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87D6E2B289; Thu, 27 Sep 2018 12:00:57 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AA9092B1A9 for ; Thu, 27 Sep 2018 12:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LBoO8/19d6eVNkEgP4vlHGWt9mGc4sJXgZpT62OIaCc=; b=U+p74mMdJgodtE 4plHVlilZ6Q5pEYZvX5WvRd5N3iy/pGuCAaGcnA4SvXmsfYrCv4OzZejMicQPDZoUQrmhZrK0IGRN lvKigfcfiw9NbGmoLiLqoyEn1TAVngQ9TSYm80srqfYev0avowG5NLqlmmflNFi88yBJ5IIQ/lQsP JijsMxRlD7ImpVmc7yD3bh8LJigQqPPAf9M90na10pqPqrwadhRnsVTs4P9QaFY7vjG+lcpqgVA24 lXYFpsCuHf4UUsMoyRxHBjLcJWv/xX8Hw0c/Bk8F97jUM8YUqm2U2sB82e1vdLy28FpuV3zrmmOxD 5MEeFfMfnuQawE7kFWww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5UyI-0002fH-3E; Thu, 27 Sep 2018 12:00:42 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5UoV-0003bJ-P8 for linux-arm-kernel@lists.infradead.org; Thu, 27 Sep 2018 11:51:26 +0000 Received: by mail-pg1-x543.google.com with SMTP id 85-v6so1781984pge.6 for ; Thu, 27 Sep 2018 04:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V0R68Y/KzwdIumM6zfyEnPevd749hoDtm4cNpSj8lHM=; b=UrQt3Oh+h3lHXl9yq+YbsI4BIj37f6E/418FWFbw2leiym7BkzqO0wDW7L66LC8hQH dMw3mR4yfjL0UttZBbUvKBghOkokwFcBlP/r9iRVIVqgQOD+sU9RiBOJc0oZH2Foweny Tf7Ckqitg+pcY9xhvI1zuRPmP4SQxg3XEpeu4= 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=V0R68Y/KzwdIumM6zfyEnPevd749hoDtm4cNpSj8lHM=; b=sHFp5gDYQZJDw3DE5wW2FPqCMoYNvO8JWelBy27ChGeW6lXMtuYXksKw4mKR7qXrci NKm+n6thZqCLks6ekYmHjBI19ubK+y5X5UurE3P61ZnwHECd71rAdnAdDN5q08JY0PR6 xcZc0p2c+pzetTkagVqMptEQeGP6/95i46ykYSoU6iXxauxq08NJtqbdo32qnZr/jpzu r5a7cRRZ0yOB7AoKEYglLuDQpuGoJmSp5ROY1LT8K0RF1ArK8bfDLQFasewSN7PUHFXd ON5bFZxN5DXlNlg3KuYw51aetOKc7RIWpBeUC31hXZDVDGAZLtmJZkZJKMLYlIkRvjCC 5/XA== X-Gm-Message-State: ABuFfoi1QadQNd2ixMzovd0IYMjUKqQVYOdxC9kUhccxOEu9TsGUTljQ sr3Zsh/ROTcB//AYgTMOFj0J7Q== X-Google-Smtp-Source: ACcGV62iZgr6a1wPuCr8fIWrr0mf1eoTyBfPRoHo5BLUU2Swc38AUSdthHx5XNtUnk+Nngsr4XPO7g== X-Received: by 2002:a62:8145:: with SMTP id t66-v6mr10902156pfd.192.1538049011667; Thu, 27 Sep 2018 04:50:11 -0700 (PDT) Received: from localhost.localdomain ([183.82.230.83]) by smtp.gmail.com with ESMTPSA id v36-v6sm3744872pgn.85.2018.09.27.04.50.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 04:50:10 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH 08/12] drm/sun4i: sun6i_mipi_dsi: Refactor vertical video start delay Date: Thu, 27 Sep 2018 17:18:46 +0530 Message-Id: <20180927114850.24565-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20180927114850.24565-1-jagan@amarulasolutions.com> References: <20180927114850.24565-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180927_045035_848727_9D6E84BB X-CRM114-Status: GOOD ( 15.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Accordingly to BPI-M64-bsp DE DSI code Video start delay can be computed by subtracting total vertical timing with front porch timing and with adding 1 delay line for TCON. This patch simply add the start_delay logic from BPI-M64-bsp, w/o this new computation, the DSI on A64 encounter vblank time out. [CRTC:36:crtc-0] vblank wait timed out Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 9918fdb990ff..217db74c6dc3 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -358,7 +358,17 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { - return mode->vtotal - (mode->vsync_end - mode->vdisplay) + 1; + u32 vfp = mode->vsync_start - mode->vdisplay; + u32 start_delay; + + start_delay = mode->vtotal - vfp + 1; + if (start_delay > mode->vtotal) + start_delay -= mode->vtotal; + + if (!start_delay) + start_delay = 1; + + return start_delay; } static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi,