From patchwork Wed May 3 11:59:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 9709659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 96BBC60385 for ; Wed, 3 May 2017 12:05:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8117528613 for ; Wed, 3 May 2017 12:05:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74E6228616; Wed, 3 May 2017 12:05:05 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 F226D28613 for ; Wed, 3 May 2017 12:05:04 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=qE8p605zOh0TpFHqKr0SZCI6/+gsWVOwhhtEI69/H4Y=; b=jb9/Zd//OMZUGNZ8+GtKT69Aww kD8INj0zt5RpkqDlqOuXQHLJUkeVfBq4MjseHMEkQ5BZwou6Bk0KK1cwfcvdjeU8Ql3nT6Ux+QEZx FgURFABrB9C3B4MtVazTdfeVRHCPhhrUmx2ZE/4qNRSCv2sqzTTKFd51mcpNN7BS33CmYLEVOEvhT 2em6n6sMTNQWd0uu9M/XQ88vZDW9+BA1Dd0f9HnY/9yHK47FUflryQ7Yasui0t4szazLzQCAr5Oyv R3Yfv1vFiPZKHz4fpp8NPZHS7MZ18B11bKzzCZZPSLsfwXY/pr//RHfmiVje/EOj9Yq325taVnUyh i8cHuIaA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d5t1a-0003f5-W1; Wed, 03 May 2017 12:04:55 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d5sy8-0007zm-Qc for linux-arm-kernel@bombadil.infradead.org; Wed, 03 May 2017 12:01:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding: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=tF15bmUrmG23iGVQpI35jpZ/ny7vH159zBJPFMrOlns=; b=tzKyXD1LsH0t6KE5am4TGMY96 ZHi9CtZn2jYod3k1AIN9ot18JsiHGVNxlflojTyNsmIBvyYHyDlzBxNFY84faJirN1c2QTpvMULi9 Q6SIOn3S3hGjLUWljCPzt99ahTdceKdSIi6H73UOPIn6nllgS+iR3Yqe+tDF/F1stecajCEkllzcc fVKAUzD1B1PAbSEO9FOBbvRxQOEpm0betG4DcONcZjUxbICSEXtECA+5r7Hrs3miRT7TFyCZZ5cEP aZzZlwZkjot0L9YEekdjKUbv3Ie+JFgCkWwNrPShxbZzgc7xRE6qO8w4TVIvzxPJkqldwi1OI+Vgr x2V7xvIjg==; Received: from mail.free-electrons.com ([62.4.15.54]) by merlin.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d5sy7-0003sT-1y for linux-arm-kernel@lists.infradead.org; Wed, 03 May 2017 12:01:20 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 80127212EB; Wed, 3 May 2017 14:00:28 +0200 (CEST) Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 48E4520C5C; Wed, 3 May 2017 14:00:04 +0200 (CEST) From: Maxime Ripard To: Mike Turquette , Stephen Boyd , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v2 13/20] drm/sun4i: tcon: Change vertical total size computation inconsistency Date: Wed, 3 May 2017 13:59:50 +0200 Message-Id: <745b9fc450798635d50f449473e9263ab3ace48e.1493812478.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170503_080119_209861_B6934231 X-CRM114-Status: GOOD ( 13.98 ) 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: Mark Rutland , devicetree@vger.kernel.org, David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, Rob Herring , Daniel Vetter , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 Both TCON channels need to have the resolution doubled, since the size the hardware is going to use is whatever we put in the register divided by two. However, we handle it differently for the two channels: in the channel 0, our register access macro does the multiplication of the value passed as paremeter, while in the channel 1, the macro doesn't do this, and we need to do it before calling it. Make this consistent by aligning the channel 0 with the channel 1 behaviour. Signed-off-by: Maxime Ripard Acked-by: Chen-Yu Tsai --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +- drivers/gpu/drm/sun4i/sun4i_tcon.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 86a806fae9fb..0f91ec8a4b26 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -190,7 +190,7 @@ void sun4i_tcon0_mode_set(struct sun4i_tcon *tcon, /* Set vertical display timings */ regmap_write(tcon->regs, SUN4I_TCON0_BASIC2_REG, - SUN4I_TCON0_BASIC2_V_TOTAL(mode->crtc_vtotal) | + SUN4I_TCON0_BASIC2_V_TOTAL(mode->crtc_vtotal * 2) | SUN4I_TCON0_BASIC2_V_BACKPORCH(bp)); /* Set Hsync and Vsync length */ diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h index 0350936b413c..3517122ee679 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h @@ -51,7 +51,7 @@ #define SUN4I_TCON0_BASIC1_H_BACKPORCH(bp) (((bp) - 1) & 0xfff) #define SUN4I_TCON0_BASIC2_REG 0x50 -#define SUN4I_TCON0_BASIC2_V_TOTAL(total) ((((total) * 2) & 0x1fff) << 16) +#define SUN4I_TCON0_BASIC2_V_TOTAL(total) (((total) & 0x1fff) << 16) #define SUN4I_TCON0_BASIC2_V_BACKPORCH(bp) (((bp) - 1) & 0xfff) #define SUN4I_TCON0_BASIC3_REG 0x54