From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 27 Sep 2018 18:58:53 +0200 From: Maxime Ripard To: Jagan Teki Cc: Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH 07/12] drm/sun4i: sun6i_mipi_dsi: Fix TCON DRQ set bits Message-ID: <20180927165853.dpluekbqzat663q7@flea> References: <20180927114850.24565-1-jagan@amarulasolutions.com> <20180927114850.24565-8-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180927114850.24565-8-jagan@amarulasolutions.com> List-ID: On Thu, Sep 27, 2018 at 05:18:45PM +0530, Jagan Teki wrote: > TCON DRQ set bits for non-burst DSI mode can computed via > horizontal front porch instead of front porch + sync timings. > > Since there no documentation for TCON_DRQ_REG(0x7c) register > this change is taken as reference from BPI-M64-bsp. Detailing more what the issue is would be great. > Signed-off-by: Jagan Teki > --- > drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun= 4i/sun6i_mipi_dsi.c > index 599284971ab6..9918fdb990ff 100644 > --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > @@ -367,9 +367,9 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *d= si, > struct mipi_dsi_device *device =3D dsi->device; > u32 val =3D 0; The computation here is in the A64 driver: if ((panel->lcd_ht - panel->lcd_x - panel->lcd_hbp) < 21) { dsi_dev[sel]->dsi_tcon_drq.bits.drq_mode =3D 0; } else { dsi_dev[sel]->dsi_tcon_drq.bits.drq_set =3D (panel->lcd_ht-panel->lcd_x-panel->lcd_hbp-20) * dsi_pixel_bits[panel->lcd_dsi_format]/(8*4); } It is testing that the sync + front porch is smaller than 21, and otherwise sets the drq. > - if ((mode->hsync_end - mode->hdisplay) > 20) { My code here is testing that the difference between hsync_end and hdisplay is superior to 20, and sets the DRQ if true. The condition is reversed, but otherwise, that difference is the front porch plus the sync length. > + if ((mode->hsync_start - mode->hdisplay) > 20) { However, you are testing for just the front porch, unlike what your commit log is saying, and unlike what allwinner's code is saying. So this deserves some explanation. Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_NEOMUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2118FC43382 for ; Thu, 27 Sep 2018 16:58:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDD572152F for ; Thu, 27 Sep 2018 16:58:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDD572152F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-clk-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727599AbeI0XSH convert rfc822-to-8bit (ORCPT ); Thu, 27 Sep 2018 19:18:07 -0400 Received: from mail.bootlin.com ([62.4.15.54]:60494 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727522AbeI0XSH (ORCPT ); Thu, 27 Sep 2018 19:18:07 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id E0F8C20795; Thu, 27 Sep 2018 18:58:53 +0200 (CEST) Received: from localhost (unknown [91.116.141.28]) by mail.bootlin.com (Postfix) with ESMTPSA id 98FDB20730; Thu, 27 Sep 2018 18:58:53 +0200 (CEST) Date: Thu, 27 Sep 2018 18:58:53 +0200 From: Maxime Ripard To: Jagan Teki Cc: Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH 07/12] drm/sun4i: sun6i_mipi_dsi: Fix TCON DRQ set bits Message-ID: <20180927165853.dpluekbqzat663q7@flea> References: <20180927114850.24565-1-jagan@amarulasolutions.com> <20180927114850.24565-8-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20180927114850.24565-8-jagan@amarulasolutions.com> User-Agent: NeoMutt/20180716 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org Message-ID: <20180927165853.a19_UFZK5HCV2mTb9VKljCZp1OLAIPe4VN7t-JUD7UY@z> On Thu, Sep 27, 2018 at 05:18:45PM +0530, Jagan Teki wrote: > TCON DRQ set bits for non-burst DSI mode can computed via > horizontal front porch instead of front porch + sync timings. > > Since there no documentation for TCON_DRQ_REG(0x7c) register > this change is taken as reference from BPI-M64-bsp. Detailing more what the issue is would be great. > Signed-off-by: Jagan Teki > --- > 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 599284971ab6..9918fdb990ff 100644 > --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > @@ -367,9 +367,9 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, > struct mipi_dsi_device *device = dsi->device; > u32 val = 0; The computation here is in the A64 driver: if ((panel->lcd_ht - panel->lcd_x - panel->lcd_hbp) < 21) { dsi_dev[sel]->dsi_tcon_drq.bits.drq_mode = 0; } else { dsi_dev[sel]->dsi_tcon_drq.bits.drq_set = (panel->lcd_ht-panel->lcd_x-panel->lcd_hbp-20) * dsi_pixel_bits[panel->lcd_dsi_format]/(8*4); } It is testing that the sync + front porch is smaller than 21, and otherwise sets the drq. > - if ((mode->hsync_end - mode->hdisplay) > 20) { My code here is testing that the difference between hsync_end and hdisplay is superior to 20, and sets the DRQ if true. The condition is reversed, but otherwise, that difference is the front porch plus the sync length. > + if ((mode->hsync_start - mode->hdisplay) > 20) { However, you are testing for just the front porch, unlike what your commit log is saying, and unlike what allwinner's code is saying. So this deserves some explanation. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com