From patchwork Sat Nov 3 10:08:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666599 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 AD0673E9D for ; Sat, 3 Nov 2018 10:09:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 957B72AC6B for ; Sat, 3 Nov 2018 10:09:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86EAB2AC73; Sat, 3 Nov 2018 10:09:52 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW 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 36F512AC6B for ; Sat, 3 Nov 2018 10:09:52 +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=N8R60jvh81IZ4ZDnSCYjBfBd6W4iChgzrOZVFZbp24g=; b=aYfDkJZfdXyNpt DUU/WHo7ncipY2yNQFsSoyP6s3xGHc4zfwgVQiZ6YugrMLb6D5Qbc3qXi5vPWDgrvDagOmuBnkTAr PeCO4k9u2gJW8ih+LkoaKW51UPQBx4iVNFmBIGqenG/fuZ5wJBCzVDvO7kT/onf9Hn9YN4tjqffPe +YpHPMzqOzGHSr7D0ge+KVLp4iQxSJmS91GlzyOrfj3gDvbvW+wH2z5u4eQZhzhAcELWF9bLI/007 j7ECrNo+fAkdS93j9VZkSseYgtvZ3mMSESa+3RZmlEeIyefphLjDbG1EylQQOLs3OQayUpTVI5SW2 P7X9GCT2a1ilNzABhSyQ==; 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 1gIssD-0002nD-Lh; Sat, 03 Nov 2018 10:09:45 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIss8-0002YH-ER for linux-arm-kernel@lists.infradead.org; Sat, 03 Nov 2018 10:09:43 +0000 Received: by mail-pl1-x641.google.com with SMTP id p6-v6so2130348pll.4 for ; Sat, 03 Nov 2018 03:09:30 -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=ItiKdY/aqQ72CaiAvq/zBxi6LN6Pf1wyAwPGh/IMHHQ=; b=oP4oHcl3zRwyD7AEbNu3WwJ/L5SL4JweeBHJviTFRgDzWF2QjkMl7dsUpMId3phf1R 9QCZ1l7pWSW3UK//1MAgXzqYzZyUN6+QhJ4LPyckL5dG5QO3aSTTkUN+e2PDf1rR05AO tVgA3tYbD984GBtlvujRlQJhOiLIhMA5H3NzE= 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=ItiKdY/aqQ72CaiAvq/zBxi6LN6Pf1wyAwPGh/IMHHQ=; b=tr0VeCpzNk0VaZiy9kyuSzAxEuck58T5Wu1VecZetpgZJP0yjEyRhfX+xupyEm+prt XtooXI1fdHUoEw8oVFi25na0wHIfr52G9ZmR96rkAE+nirreYy1yQWu0loUJ6vwWCZay Ru5NSPZDhZN3Vnv58MzPNGSfijXPyHE21HLN9uvkCNQbiV0KEgKaIXQKlZyAHiK4S0Ma NHeBhbCGQz3Moq8qUvGBRs7gEJm/bjKyIv9cpsiQKBWK+1HSFfAx8s8XIVfuSrCxLhqh m5A++/5QxAlZJAEM3Chno+BuT9mM5SCmM24P+34SzaBee3zm/Rjm/lhcmD9DmAcONhZE DSkw== X-Gm-Message-State: AGRZ1gIatc1wIpxPU08/4FCnv+g6iUIy8Q7XBRO3VHd72Rc/Z4lFyxmT +boJuBsOIUizIqZSd+U14uR84A== X-Google-Smtp-Source: AJdET5dxiNozwBzE8xGf4Wfx+GgIdBkafQgF7rhrQSqStOEiVgqWI00de4qC41PL68yFC/tWW3INXA== X-Received: by 2002:a17:902:f097:: with SMTP id go23mr14566114plb.328.1541239769647; Sat, 03 Nov 2018 03:09:29 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.09.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:09:29 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 01/10] drm/sun4i: sun6i_mipi_dsi: Compute burst mode loop N1 instruction delay Date: Sat, 3 Nov 2018 15:38:51 +0530 Message-Id: <20181103100900.30313-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181103_030940_779367_63F1C7F5 X-CRM114-Status: GOOD ( 13.96 ) 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 Loop N1 instruction delay for burst mode lcd panel are computed as per BSP code. Reference code is available in BSP (in drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_dev[sel]->dsi_inst_loop_num.bits.loop_n1= (panel->lcd_ht-panel->lcd_x)*(150)/(panel->lcd_dclk_freq*8) - 50; => (((mode->htotal - mode->hdisplay) * 150) / ((mode->clock / 1000) * 8)) - 50; So use the similar computation for loop N1 delay. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 86430efd9054..da152c21ec62 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -394,7 +394,14 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { - u16 delay = 50 - 1; + struct mipi_dsi_device *device = dsi->device; + u16 delay; + + if (device->mode_flags == MIPI_DSI_MODE_VIDEO_BURST) + delay = (((mode->htotal - mode->hdisplay) * 150) / + ((mode->clock / 1000) * 8)) - 50; + else + delay = 50 - 1; regmap_write(dsi->regs, SUN6I_DSI_INST_LOOP_NUM_REG(0), SUN6I_DSI_INST_LOOP_NUM_N0(50 - 1) |