Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7994119ybn; Tue, 1 Oct 2019 01:13:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4RYzCyDHATkZLpoFZJVJ+20GM5P34jmdPzqBzM3aSHAtBKz1DKDtffGLAdWjkLHxzSMvD X-Received: by 2002:a05:6402:a50:: with SMTP id bt16mr23726006edb.114.1569917621541; Tue, 01 Oct 2019 01:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569917621; cv=none; d=google.com; s=arc-20160816; b=r6NM4fTcKNrl/iBgqRJElXRYgVctnbJaTbXfMGXDGT5kVTzUfqsOho8CnF8C9rob1a ddMFTj8d3F7Q9GcjChl7GvItJ5no2AgB+cUhZgrUi49OUpQMxdkEXy5m53KPYkEQ/puO /x8kpV8RAXIEFebB8mJB35ndpWgiw6Tx/HZodyXy2af+uxn6zbkso76uO64tFrw9nsuw P/ajJ85y4h/V3i4e7fCm5ug8HQ3yl0Jcu8rnZjFdtDdBEtxt13dZpiQAmGNweKHT/KU2 36WKjcq4Zw9T7xvYclQbR57mNc/BRZ0zSQS0UOSPo7yMtnAl1HnPs39meuJzyImEuXhX HVKw== 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=NIkppADh042dedOlXZj9OneVBPHmukn03udIOzFNGNQ=; b=uFtPJLIIjenrpcjmleJ72vurSxrZ6eNyjwU6yQ3kCjfIPD3U/LA6pHt4d13jVrt7ay C+VrUxaKduMACQzyvQNTVyEVQRvaOMH3+2YClQrk6wav2eLVZHVjbxLgfK0Q4lR+kxuv 9RzXqkX/ruXwZkex/YTMRhP2mY3FjrRdRSlfRSh9VUtax2AMeFnd3ZWvE8LQI/HvyMi9 WFGITbEVGtPW2T1cNllF3EGo7SrhiH6J0tsD2g7wZ4yIngHMpAMWOgXIlSTdD19dW0fN IBcH/dSUPgcHWKiJZWD0X24/fqZbermnvQUbK7mdRR2TnzcYwi5rOPhIDHinVgvd+//O ByCg== 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 e1si8464493ede.268.2019.10.01.01.13.16; Tue, 01 Oct 2019 01:13:41 -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 S1732910AbfJAILG (ORCPT + 99 others); Tue, 1 Oct 2019 04:11:06 -0400 Received: from hermes.aosc.io ([199.195.250.187]:51108 "EHLO hermes.aosc.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727511AbfJAILG (ORCPT ); Tue, 1 Oct 2019 04:11:06 -0400 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id 7F4E782AFC; Tue, 1 Oct 2019 08:03:58 +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 2/3] drm/sun4i: dsi: fix DRQ calculation Date: Tue, 1 Oct 2019 16:02:52 +0800 Message-Id: <20191001080253.6135-3-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 According to the BSP source code, when calculating the magic DRQ value outside burst mode, a formula of "lcd_ht - lcd_x - lcd_hbp", which is interpreted as right margin (HFP value). However, currently the sun6i_mipi_dsi driver code calculates it wrongly as HFP + sync length, which lead to timing error. Fix the DRQ calculation by change it to use HFP. Signed-off-by: Icenowy Zheng --- 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 c86e11631ebc..2d3e822a7739 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; -- 2.21.0