Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1676961ybn; Wed, 2 Oct 2019 21:25:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzU5VqoSjRx8BMvFZP+MVCbuzXHo3MUoFiPaKsqDBk2bChdfevBPiRm++hBhEJIf7sTOZSe X-Received: by 2002:a17:906:3615:: with SMTP id q21mr5968305ejb.201.1570076724465; Wed, 02 Oct 2019 21:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570076724; cv=none; d=google.com; s=arc-20160816; b=pYsubsmnlrWiDzZkKgHbIpIF4SZf0IQRIAIkasY7cwejpHU7N1hGhFjHBYOXxVZ1Br 31cfxPxW//alK2RviS6/ezk8NvDbuCgLe58ONIZOTbQcMWlB38l9b+t9zEs3UuuI+alA M/QYKHBzn2lyKWPcaZGHz4DxfKZUnBcZv+ez0DBR4RKiXIhZJRa9mMiZqpJEspCVhxkP 2hNEE3lXx/eY5Nql+91ONBhs1XO2EZ/0b7BGBOtNX2PQGCYnXqAnGKF4FvSUJdoTJyr3 JBnNHL/JfEjj/vdT6Wygnvxh68tLEb1taYp3NrjH2zuaGxsGIR1Q8dNJRxaHvdm4FaFE 7y/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xXxgss0qRr38ViNhIsY4E48BXxGon0iuPdHcJHwqwhc=; b=mI5t7kFUr3Iyyutx4Ywd7GWukReXyoBe2AWFdW80U38XIRDkeydxd8whpntZI6OEZz 1mEb7qolA4HbT3Qm5L2WrKf2bxYzAWvVnzDGWtt+wIvEfbh0JzqcJbjKBpG8HLp/NmzZ mWnoTCLfgqXZf8FGEiD28gtnzYmqvo7qpB2vYSKEePx8tt2TqzUalEZSQOZCAVP4Kou0 ZfbBu4KrQm0CWymmjKr9UL+Jzh2zB/hINfEpjMaf6BReOglEohg+mUcJhDw0leUl/GGn EW/ve2bJfHN7AotCPTwGZ0bIbfIdYPLdHpfCuehDcEC6a8m/93/22DTDtoH1IktCuvTY YJ0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SjYfr4ci; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ym1si578298ejb.263.2019.10.02.21.25.00; Wed, 02 Oct 2019 21:25:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SjYfr4ci; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726048AbfJCEYH (ORCPT + 99 others); Thu, 3 Oct 2019 00:24:07 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:46570 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbfJCEYH (ORCPT ); Thu, 3 Oct 2019 00:24:07 -0400 Received: by mail-io1-f67.google.com with SMTP id c6so2338941ioo.13 for ; Wed, 02 Oct 2019 21:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xXxgss0qRr38ViNhIsY4E48BXxGon0iuPdHcJHwqwhc=; b=SjYfr4ci/wu2v5HJdhvG5VWQ0L+nAwZxsH1u0w5kKILfPjaBnSDE0XQZ0s4eJoryIW As8fGKd6gSiZcy6eQNhCL56xGXObLVRxQ0ZedLXEOMrpa3zxChhoO6OGH2dnWZOBl6u3 mQx5xJ9LM+t6NZp1NyL2uHQ16yh56mtV4nZYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xXxgss0qRr38ViNhIsY4E48BXxGon0iuPdHcJHwqwhc=; b=ZRs1bqu/ZhfU+UHQbQnlatGvM0FXQuS+TD0QzaiMclpPvcU+1tgQL0zVjTcygd2TSv uckKbmvtMGncuR4NYyLI6i8N3NyQaKdN7C1+GWDmmMWRKzoDs1aeiugBDzxmONv0r6vE 7wMjjeItT3TyVx1Us1YnZH8S8UMbFvSgHjNq/oVXdw5Jn3sD4I6Xx8jk6zspSaCZp7FW qdT0o34PuLREs2wNTPWxsKzyTTo03dEED2SfT2LsseLgQfjNWLAP7wZ3OQaUNPsCV7hC 5VlJFsLA0DepkJN+xkw3BbxXILXQXRddRyhwi/TSzWzJRIyPBtpgJDYNWU77oV72R423 21CA== X-Gm-Message-State: APjAAAXtEev7zY6hCmXmh2609maNt+TzEovG0sYszePJcgBPPZQPOZ2p EWj5CEjL4rFb2D+bzeL6CR1rPjuLVhdckhq1th1X5A== X-Received: by 2002:a02:6284:: with SMTP id d126mr7511832jac.51.1570076645543; Wed, 02 Oct 2019 21:24:05 -0700 (PDT) MIME-Version: 1.0 References: <20191001080253.6135-1-icenowy@aosc.io> <20191001080253.6135-4-icenowy@aosc.io> In-Reply-To: <20191001080253.6135-4-icenowy@aosc.io> From: Jagan Teki Date: Thu, 3 Oct 2019 09:53:54 +0530 Message-ID: Subject: Re: [linux-sunxi] [PATCH 3/3] Revert "drm/sun4i: dsi: Rework a bit the hblk calculation" To: Icenowy Zheng Cc: Maxime Ripard , Chen-Yu Tsai , David Airlie , Daniel Vetter , dri-devel , linux-arm-kernel , linux-kernel , linux-sunxi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wens, On Tue, Oct 1, 2019 at 1:34 PM Icenowy Zheng wrote: > > This reverts commit 62e7511a4f4dcf07f753893d3424decd9466c98b. > > This commit, although claimed as a refactor, in fact changed the > formula. > > By expanding the original formula, we can find that the const 10 is not > substracted, instead it's added to the value (because 10 is negative > when calculating hsa, and hsa itself is negative when calculating hblk). > This breaks the similar pattern to other formulas, so restoring the > original formula is more proper. > > Signed-off-by: Icenowy Zheng > --- > drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > index 2d3e822a7739..cb5fd19c0d0d 100644 > --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > @@ -577,14 +577,9 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, > (mode->hsync_start - mode->hdisplay) * Bpp - HFP_PACKET_OVERHEAD); > > /* > - * The blanking is set using a sync event (4 bytes) > - * and a blanking packet (4 bytes + payload + 2 > - * bytes). Its minimal size is therefore 10 bytes. > + * hblk seems to be the line + porches length. > */ > -#define HBLK_PACKET_OVERHEAD 10 > - hblk = max((unsigned int)HBLK_PACKET_OVERHEAD, > - (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp - > - HBLK_PACKET_OVERHEAD); > + hblk = mode->htotal * Bpp - hsa; The original formula is correct according to BSP [1] and work with my panels which I have tested before. May be the horizontal timings on panels you have leads to negative value. [1] https://github.com/ayufan-pine64/linux-pine64/blob/my-hacks-1.2-with-drm/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c#L919