From patchwork Sun Mar 3 17:35:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10837177 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 521071399 for ; Sun, 3 Mar 2019 17:36:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35FBE29B73 for ; Sun, 3 Mar 2019 17:36:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25AFB29CBF; Sun, 3 Mar 2019 17:36: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 9D6FA29B73 for ; Sun, 3 Mar 2019 17:36: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=9glDHG/1UR06GicqvGuhVlXWDzgF9kCO9laNElhqvT8=; b=cH4+XS9KTcpw2J 1WZoqmqpRoZvTa4UNTDC+gbpkSB9WhnrHmLC4B6vAM3H2SqdoEGrRBhB+gyofy3gFVALEYCaZXT8T jMEo5mV+LZLdIOrWRUNtvulY7wpRd7tmPR3RSBi4wJV2y6p3xk102GAdNsRsaWXwA46WvzFCe/eoL RJ24ML/DjOfbo1Ors3WPv21bb9Xyb6VVDXR2/PSj+YOy5E2zi4KqQkMyHu2dKHUf3KWdxTe4JyS5r Bh+2J1CcTdDfEO3CCHkQ5hj/fYCK38OO5BOSx18t2XadqSUHirSE/QGv0dhgg9BTXMDdSBZQfSarM a35TcNCqFhBbGh5ugFSA==; 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 1h0V2P-00028T-NA; Sun, 03 Mar 2019 17:36:33 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0V2C-0001o9-Lv for linux-arm-kernel@lists.infradead.org; Sun, 03 Mar 2019 17:36:24 +0000 Received: by mail-pf1-x441.google.com with SMTP id d25so1294187pfn.8 for ; Sun, 03 Mar 2019 09:36:20 -0800 (PST) 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=D+mNFlao6tHpPYybFt0Tr/cBREXotgdAIz+jZKUMM8c=; b=Q8DwfqBNMv5PqaAtlE0XmZxgdpp/cRJy5iNPf8b3ivLstJdfrhcCcaWdYGko5ulXzr 9WHzPMpHLrbhfgp71WTn91Nqke6SKxrsrSoI4IQa/wOST9+8m3ry4ld60oJV3luDkTW4 0bCHt/xqh/DhxGPwSZr6BZKnmuPhL7+pGT6aA= 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=D+mNFlao6tHpPYybFt0Tr/cBREXotgdAIz+jZKUMM8c=; b=SIgun2rainMFGBQGKtPU+TUSwvHM2BufWhKF72dAcX6hK/2uL6ri8YBrKfyOJY+k8+ ydCn3H0HOlNt7N9eWXgknSXfG9OqycP/RGapTAA7kvkgKJgCuxxaKzz3paGez3EjWMa0 HOnIcmDaOxQwd/T80L5+CbWAvhpcHAwVmf1v80IhIIoZ4/4koW4Ivf9yl4rYnZYyg3P4 bKs+pOWX01DVoi+EhJv5cZZ5bYFIAa2VnloPzoFxI0CRpLm19WmXJphxlGO5svKwGKUU jyd6IkwCoDFG5KmvoXCVN8Ceu4HUE+AImB3uQMNBn009y8tz5ZJ5YIFApaH+XZyeg9r2 CntA== X-Gm-Message-State: APjAAAVWXcQAlJRyRshdm+GK0Z8wOCPoh8LFoQCUZsD+eKvkoSOxKKsm rpQrw3Iy91CmT4CD4NStrO8wzw== X-Google-Smtp-Source: APXvYqw/rVw52JfOtprvCQ9ajiMytcLnTP3ioHWwc0DoRpGUzVox9uFCiT03q1KAGX5Vu5OA3vgNcw== X-Received: by 2002:a63:eb56:: with SMTP id b22mr14828169pgk.287.1551634579844; Sun, 03 Mar 2019 09:36:19 -0800 (PST) Received: from localhost.localdomain ([115.97.184.151]) by smtp.gmail.com with ESMTPSA id d129sm5614737pgc.59.2019.03.03.09.36.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Mar 2019 09:36:19 -0800 (PST) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai Subject: [PATCH v9 2/5] drm/sun4i: sun6i_mipi_dsi: Fix TCON DRQ set bits Date: Sun, 3 Mar 2019 23:05:24 +0530 Message-Id: <20190303173527.31055-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190303173527.31055-1-jagan@amarulasolutions.com> References: <20190303173527.31055-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190303_093621_163611_9FD0BE8E X-CRM114-Status: GOOD ( 13.45 ) 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: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, Jagan Teki , Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-arm-kernel@lists.infradead.org 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 for non-burst DSI mode can computed based on horizontal front porch value, but the current driver trying to include sync timings along with front porch resulting wrong drq. This patch is trying to update the drq by subtracting hsync_start with hdisplay, which is horizontal front porch. Current code: ------------ mode->hsync_end - mode->hdisplay => horizontal front porch + sync With this patch: ---------------- mode->hsync_start - mode->hdisplay => horizontal front porch BSP code form BPI-M64-bsp is computing TCON DRQ set bits for non-burts as (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) => 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 Tested-by: Merlijn Wajer --- 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 465e7fc57899..140e55f5ed2e 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -436,9 +436,9 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, SUN6I_DSI_BURST_LINE_SYNC_POINT(SUN6I_DSI_SYNC_POINT)); val = SUN6I_DSI_TCON_DRQ_ENABLE_MODE; - } else if ((mode->hsync_end - mode->hdisplay) > 20) { + } else 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;