Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7993538ybn; Tue, 1 Oct 2019 01:13:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYgs/J9w3ESjJlxFF6P6j6q63VWTHO9Asxh9YLFMcVZX4jpnnP+g/YVo1a5XYN9ZpzqV5y X-Received: by 2002:a50:8a21:: with SMTP id i30mr23691373edi.229.1569917581029; Tue, 01 Oct 2019 01:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569917581; cv=none; d=google.com; s=arc-20160816; b=YtTyIzzOrPx7yuxI4oZAZ/bL3kfQTDZ5Kf+yomJ05WBTI8q3fM0EryNewCvMHV9n+j QSN5BB2rT6tlp4nV+IbP7ASO5uHr+bXxESFqoKf2qiu5B8GLwDNZdlnuDdwgwIR7aWps +mvmUuGNrOgLQ8UFePNyz1ooldUHbQEkDLTealEEEJdyhwwCJw3JvDk5dL9Z2h7v87aR xxCejwpzhZByLjsW5A2c1O8zpe2MOWkkBfsHZNL5/BrmbRRN0YoYw1414YsLgX4el4uS cqIrtIFsw/3Y4g5vujupNx3HpfK+q5X9qlcTQyt/l+y6aBNAoC6onTx2rchUGgqvZ9fk yLTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ElI9M0vf5BzSl95s7OVzzTm8Bh/y6gQ7cuOhaoodUHU=; b=Jw0kcLP43RDd3F1QLuzAAlILOFsb/caUXcIYFC7zavCm5SiPz13Tdpop1w3moUsKKU Mmbgp+A8tMeOlETuUAgbRy4ZuWkBizlxVLzgRYWkX16JMZBM93KtkNim2zKTnNInzFeL RBQqj17aTfg6KkRE3LhTEt8OMBT7suXXEo2ZjmeYZuneMAdOrTMoT/L1goC+siEhgwVj M58pm9vr6syPlnHTp6r4YkZeziV3NxAtAKOhCIRJbcfCiuT72uYeU8lyEZLSeIT1w9h9 2GoQp/tGKIH1Vx0AaDF3KqtdDJ+4PebojEC+mtjW0E3RicqgEtxlsPrmj5Xlo2xEVIUH +lAw== ARC-Authentication-Results: i=1; mx.google.com; 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 l26si8699474edb.258.2019.10.01.01.12.36; Tue, 01 Oct 2019 01:13:01 -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; 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 S1732876AbfJAILG (ORCPT + 99 others); Tue, 1 Oct 2019 04:11:06 -0400 Received: from hermes.aosc.io ([199.195.250.187]:51107 "EHLO hermes.aosc.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726822AbfJAILF (ORCPT ); Tue, 1 Oct 2019 04:11:05 -0400 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id B02AC82B00; Tue, 1 Oct 2019 08:04:03 +0000 (UTC) From: Icenowy Zheng To: Maxime Ripard , Chen-Yu Tsai , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Icenowy Zheng Subject: [PATCH 3/3] Revert "drm/sun4i: dsi: Rework a bit the hblk calculation" Date: Tue, 1 Oct 2019 16:02:53 +0800 Message-Id: <20191001080253.6135-4-icenowy@aosc.io> In-Reply-To: <20191001080253.6135-1-icenowy@aosc.io> References: <20191001080253.6135-1-icenowy@aosc.io> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; /* * And I'm not entirely sure what vblk is about. The driver in -- 2.21.0