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=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 C8E3FC4360F for ; Thu, 14 Feb 2019 19:26:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94988222D7 for ; Thu, 14 Feb 2019 19:26:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SYA9M0cV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="Vyk+rJ8H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94988222D7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=ZKEAjVKYz7Tzm5xv/W2kA+A5AMSVzv4oT7Rb/Wm7pQM=; b=SYA9M0cVGUNjBx x63SrgCcPZpgFGFv2fZOhgJu0M+Kadj7dKXFSMV8ukJhFr6TpV/VaZBH6aHlVDIWemgGgm5MXj9Aq UmszyMubjofIiqiIDkswY22E/D0bjJL6VGvmTYMW8Bh4nF7ZFHN3pMOMxiRblitVYnl3d8nEUCLkF g5wwgSEq1KeQIcCKpGWcUGWuw6G18wjh9QSoghlouDWFt/uHdDdXMxeGvuUHQW/PzvjT8yieQk6rM WSosyY++F/1o4DKX5u8rTmLw6luQwLXMy0XPFp2O+qwSJtd3MOvuWudBI5GYt8YTgmu1YTiojUKu0 M6SpCNAnO5nH4q34dbnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1guMeh-0001u4-MS; Thu, 14 Feb 2019 19:26:43 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1guMeG-0001GM-8u for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2019 19:26:18 +0000 Received: by mail-pf1-x442.google.com with SMTP id u6so3568950pfh.11 for ; Thu, 14 Feb 2019 11:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pAS7zvIWI8WLdUvyOqbvv5PR0m69rmeaJXwVeXQOXIs=; b=Vyk+rJ8HvVAw95K6i0er3o3GNantkwwsjUiLABTAEq6sF0u+4mSOsSfAZ/oI4R7WgP /iJ5gbUmN04+hyYNrPzcHSe32um4i+w4XAccxMIUx/wGn+D5SC7j62hQfUdX4aE6ADDS ZM9FaE3AAv09SKXRnMRi9uQZsv/g5QHruIiO8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pAS7zvIWI8WLdUvyOqbvv5PR0m69rmeaJXwVeXQOXIs=; b=MZ+2bhUUpQrAzybeCq47X8QPJTK5nNs7b2NWCi2HXQMZzkU7aiDG4OAtlpZ/5LyXmc Xz7TlXM/rxVr/p74X5/uMeqt5kjZCWWBxQk+PnHTnsfRuMD/AJeHlvGjMYY1siHgRzfn rOim7FplwMhdIHq2bu6rwBDrVtcFG8GnxUQ76b6x95uVRpr9d4FuXf+WeykyX+Ls5+7Y biZI6ziB0rg+ymN44kY+Y0XnUgithue2cgLD3P9qyMn36Cn+YhuAhGeUQz/jA7eIQuZS us1LJIC/nap8QXIVyAlpcSaPhAlEWOQPdZ7ZRkw9CQZ3VaK5gNsvo3oKJsNZX17c0inl 52hA== X-Gm-Message-State: AHQUAualXtZsZ+4qTcX8i89DtMfN6K4lY9/80/zCWFYzx+3MagiW8Lmm fb9VvTG2KB2ppw4/+Tsv3zc82w== X-Google-Smtp-Source: AHgI3IZW3Ke01qP/UcsGyJ+t0jFHnf1csxubvY1+0IvrmamyU3fpmC2bQHR9lusbB5SS1SjeFuh2FQ== X-Received: by 2002:a63:7402:: with SMTP id p2mr1397042pgc.360.1550172375719; Thu, 14 Feb 2019 11:26:15 -0800 (PST) Received: from localhost.localdomain ([115.97.184.151]) by smtp.gmail.com with ESMTPSA id k71sm8390100pga.44.2019.02.14.11.26.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 11:26:15 -0800 (PST) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai Subject: [PATCH v8 3/8] drm/sun4i: sun6i_mipi_dsi: Fix DSI hfp timing value Date: Fri, 15 Feb 2019 00:55:39 +0530 Message-Id: <20190214192544.7314-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190214192544.7314-1-jagan@amarulasolutions.com> References: <20190214192544.7314-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190214_112616_532520_E74EC372 X-CRM114-Status: GOOD ( 14.36 ) 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: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jagan Teki , Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Current driver is calculating hfp maximum value by subtracting htotal with hsync_end which is back porch value, but the hfp refers to front porch. Front porch value is calculating by subtracting hsync_start with hdisplay as per drm_mode timings, and BSP code from BPI-M64-bsp is eventually following the same. BPI-M64-bsp is computing hfp as (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hbp = (hbp-hspw)*dsi_pixel_bits[format]/8 - (4+2); dsi_hact = x * dsi_pixel_bits[format]/8; dsi_hblk = (ht-hspw)*dsi_pixel_bits[format]/8-(4+4+2); dsi_hfp = dsi_hblk - (4+dsi_hact+2) - (4+dsi_hbp+2); Example, u32 fmt = dsi_pixel_bits[format]/8; => ((ht-hspw)*fmt - 10) - (6 + x * fmt) - (6 + (hbp-hspw)*fmt - 6) => (ht - hspw - x - (hbp - hspw)) * fmt - 16 => (ht - x - hbp) * fmt - 16 => (ht - x - (timmings->hor_total_time - timmings->hor_front_porch - x) * fmt - 16 => (timmings->hor_total_time - x - timmings->hor_total_time + timmings->hor_front_porch + x) * fmt - 16 => timmings->hor_front_porch * fmt - 16 So, update the hfp value accordingly in sun6i_dsi_setup_timings. Tested on 2-lane, 4-lane MIPI-DSI LCD panels. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 982ae6b17654..21f39f11a8de 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -480,7 +480,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, */ #define HFP_PACKET_OVERHEAD 6 hfp = max((unsigned int)HFP_PACKET_OVERHEAD, - (mode->htotal - mode->hsync_end) * Bpp - HFP_PACKET_OVERHEAD); + (mode->hsync_start - mode->hdisplay) * Bpp - + HFP_PACKET_OVERHEAD); /* * hblk seems to be the line + porches length. -- 2.18.0.321.gffc6fa0e3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel