From patchwork Thu Feb 14 19:25:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10813583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 733C113B4 for ; Thu, 14 Feb 2019 19:26:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E8F72EEA3 for ; Thu, 14 Feb 2019 19:26:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51B2F2EEDD; Thu, 14 Feb 2019 19:26:26 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 09D112EEA3 for ; Thu, 14 Feb 2019 19:26:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E054F6EAAD; Thu, 14 Feb 2019 19:26:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7971E6EAAC for ; Thu, 14 Feb 2019 19:26:23 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id y4so3536453pgc.12 for ; Thu, 14 Feb 2019 11:26:23 -0800 (PST) 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=6PA7omnu5a1QEIw1FJbeZKYVUv3ytW4+L6xraVR/pk8=; b=BMFRFS12sJ8YvFqnoOcoSlNsMCjhTEZddTTuolaRDyqLSaOut1ki6XSxPViK26hqPl P6xL28To0TPLaWdR0839gLGrQlyV8v1aa1eylHyi2MLmi7pLbNzuUwZqJtClF8ZMocgH JAnDHAia96pvGC+bOvmaT9PEtAcuPodntZpUhSD2yXBJFdBpU3yfbZc5VvxGUBVbKa0j pjTIlBOnY8mLzMV04OGrYNgecxDNgci7B5afdj3rviQT87xiy9PaRFvcXx8hhVCQVTqO NIa1VA53Tov6BrUofusAlE46zAC4/y7K1ZSzp0hfkHC1FyDriCYma7xFCSqGxVp581TM Rg5Q== X-Gm-Message-State: AHQUAub5dljUX1p46zo1vMJWsAhQDWpJJ10lZkgFtHtjr9B7TGWAg8Tx PqfsEGBzPVRSB1NfA+kx9PB3OQ== X-Google-Smtp-Source: AHgI3IbaKLGN1hq/z5LYB5B808XAS18IAysXSaBZfFEbEqN8Uw/C0DjJD1mDDwX+NZEGlxX6a1y7ZQ== X-Received: by 2002:a63:d347:: with SMTP id u7mr1443184pgi.383.1550172383057; Thu, 14 Feb 2019 11:26:23 -0800 (PST) Received: from localhost.localdomain ([115.97.184.151]) by smtp.gmail.com with ESMTPSA id k71sm8390100pga.44.2019.02.14.11.26.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 11:26:22 -0800 (PST) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai Subject: [PATCH v8 5/8] drm/sun4i: sun6i_mipi_dsi: Add DSI hblk packet overhead Date: Fri, 15 Feb 2019 00:55:41 +0530 Message-Id: <20190214192544.7314-6-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-Mailman-Original-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=6PA7omnu5a1QEIw1FJbeZKYVUv3ytW4+L6xraVR/pk8=; b=KYg2QwY3pqecw/vKuQF3qTv4P53VS4HpwdC/ZE/zGzuSq9g976SGphyYcygNR8HyXf U/GL+Pr8XuW9N+85KQfr2kCXFa+TD1NXUZwwfyDpwvYze0DbmazlcDqdngc98o08pmXo HcNjMZrQd4Ep/OOF2pYvDZwm4zJkVKnZBvEho= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Like other dsi setup timings, hblk would also require to add packet overhead. Add 10 bytes packet overhead for hblk, so the blank is set using a blanking packet like (4 bytes + 4 bytes + payload + 2 bytes) The value 10 bytes are refereed from Allwinner BSP like how other dsi setup timings grabs in existing driver. This is according to BSP code from BPI-M64-bsp (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hblk = (ht-hspw)*dsi_pixel_bits[format]/8-(4+4+2); So, add 10 bytes packet overhead for DSI hblk. Tested on 2-lane, 4-lane MIPI-DSI LCD panels. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 6b26dba883e8..a64e6ec00f22 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -485,8 +485,13 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, /* * hblk seems to be the line + porches length. + * The blank is set using a blanking packet (4 bytes + 4 bytes + + * payload + 2 bytes). So minimal size is 10 bytes */ - hblk = (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp; +#define HBLK_PACKET_OVERHEAD 10 + hblk = max((unsigned int)HBLK_PACKET_OVERHEAD, + (mode->htotal - (mode->hsync_end - mode->hsync_start)) * + Bpp - HBLK_PACKET_OVERHEAD); /* * And I'm not entirely sure what vblk is about. The driver in