From patchwork Tue Oct 23 15:50:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10653447 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 5EBB814BD for ; Tue, 23 Oct 2018 16:47:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CDCB2A111 for ; Tue, 23 Oct 2018 16:47:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 407B22A139; Tue, 23 Oct 2018 16:47:39 +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 CFE082A111 for ; Tue, 23 Oct 2018 16:47:38 +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=aH7Ky6pv2wUj3SkPgiBr4VyrmW8M23h4+TZrl46Lh98=; b=gjU0Gavcnp8Hdw Ze3cGN7540d9NMFiNPfuZco6kn6JXKFyXuGEFXeScTRgTmO57DdS0iMfpdRhKwuIrROYSC6pkQZKX scEGAIAit2Wc32ll8yYB4qZOpYRmgMbHc8ZzNXuQOAzvjxkkYT0FqATxj/vUjghIZ0AqnaLdmBwAA kI2OuHBjplxOWJHX7zDoaLymk0IShCXfmh1LqCNdcgDRnF12hEYrb9wjD6rjsTCX6BDP4v6G3H0md ClEHEou2o0nmy4jmOHtWSs41s15b8gQcoBHbLfu6J4z2t4pq07fQ+uMGFEXUt8nSVQmIdBeNBZKWU dBdx56VbGHR9C/NMYLqA==; 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 1gEzq9-0005Nq-I5; Tue, 23 Oct 2018 16:47:33 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEzpZ-000579-EB for linux-arm-kernel@bombadil.infradead.org; Tue, 23 Oct 2018 16:46:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mgo287Yan4wJCzR1Tu9+/fvGRpj2dOPV0KdcK2/NbdY=; b=gl5VWK9/BldbMuVS6IQXYtwS87 XAkyETgAgaDDy459umxWOL7sKDtphenYRB0QFGYbELMk3s6eUTyueq5Vu3ZRGw4+xYz6vKsm5JlXe s5ZP9AI+eM7QabfHIpL+oCTqnMz2dPjSSH/7foxA3nEwMbRn9Woer3Nukxqjr1u0Suz72ygCuIPOQ wj71uc3oOXfWlL1zrxDH0O67NI1+wEr15OuVFfXK5XlQD0M3mphb37ZQyRDTn/9zPcCesM3ALEBev LDWeim77+2fPCoctGyjJulzhoCDD+gyVo2/06TnVJ2GocIFIVbSg6k9RL912xTuGyUU2UeR0EJ6c3 R1U9J1dA==; Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEyyM-0002sH-NA for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:51:59 +0000 Received: by mail-pg1-x544.google.com with SMTP id s3-v6so842173pga.12 for ; Tue, 23 Oct 2018 08:51:46 -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=mgo287Yan4wJCzR1Tu9+/fvGRpj2dOPV0KdcK2/NbdY=; b=ioly+0z7xD9HR2uoTZWvPZlsyWFjvRAbAMYpCBou5yJk/KkAcuLCjJu6n6f8PE3HD/ JR1cOvdXZIMLsv1o76e2HqcVGXsyQiSgVlbCI2XehtkLvWo4g5peg9439v+g05KDq4yw OiMTFaah+Hd9zOJe0tTc43KlCqPzXs4/XhXvA= 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=mgo287Yan4wJCzR1Tu9+/fvGRpj2dOPV0KdcK2/NbdY=; b=mhoXgQ0WS1z4pG1mBpE6lW7iZ6zCnzVtBTT1xcM0CC/b+AfFNd0QuUVyqOyZrT5Dd3 ErcGxGTf/+gVZvJ4LaXtctw+cRn8xYdjRG738Dkt0Wh6GZKMS7D3VSKYcogH+6eRFMzH JryJPYEk7RbgFvweiauTTb7XNUWgRI+9oM3Al2UEznW7glp/+grxAIrKnPp7bx/FNEy9 5qoZYoN8G6jJUunWmTP1m5W1o95NnvtUKTKLyIMH6UEGHavbSmH0Zn28j700OFm2N/hP x5RqtE0dDB/7DJwFy+qsMrsOH/jwvshSJuNjoCEAe4kMa5fiTvob9IiVBFKNMTsORaLy J3+A== X-Gm-Message-State: ABuFfojKz/O8OrANIN3R4vcRO4ts3kpjGh6dIMTd33YQCAJiSY7vtdfb 2bJkJxKDhP7CoGuF0WISeIxvTg== X-Google-Smtp-Source: ACcGV61EWJA4KzZg5ExM6xaHV5J0VPKvzVF0Z7lMPLRI9Bt/Uagm3c3METIhZxqn+WafjU3zV5u10w== X-Received: by 2002:a62:808c:: with SMTP id j134-v6mr49709353pfd.47.1540309904196; Tue, 23 Oct 2018 08:51:44 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:43 -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 v2 08/15] drm/sun4i: sun6i_mipi_dsi: Fix TCON DRQ set bits Date: Tue, 23 Oct 2018 21:20:28 +0530 Message-Id: <20181023155035.9101-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_115158_785263_8CCB992E X-CRM114-Status: GOOD ( 16.44 ) 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 TCON DRQ set bits for non-burst DSI mode can computed via horizontal front porch instead of front porch + sync timings. According to BSP code form BPI-M64-bsp in linux-sunxi/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c TCON DRQ set bits are computed for non-burst mode as => panel->lcd_ht - panel->lcd_x - panel->lcd_hbp => (timmings->hor_front_porch + panel->lcd_hbp + panel->lcd_x) - panel->lcd_x - panel->hbp => timmings->hor_front_porch => mode->hsync_start - mode->hdisplay So, update the DRQ set bits accordingly. Signed-off-by: Jagan Teki --- Changes for v2: - Add detailed commit message drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 3a1d48bc1996..8d154cf2e6d6 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -367,9 +367,9 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, struct mipi_dsi_device *device = dsi->device; u32 val = 0; - if ((mode->hsync_end - mode->hdisplay) > 20) { + if ((mode->hsync_start - mode->hdisplay) > 20) { /* Maaaaaagic */ - u16 drq = (mode->hsync_end - mode->hdisplay) - 20; + u16 drq = (mode->hsync_start - mode->hdisplay) - 20; drq *= mipi_dsi_pixel_format_to_bpp(device->format); drq /= 32;