From patchwork Mon Dec 10 16:17:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 82 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 6C4612E54AF for ; Mon, 10 Dec 2018 17:18:02 +0100 (CET) Received: by mail-wm1-f72.google.com with SMTP id p16sf4861507wmc.5 for ; Mon, 10 Dec 2018 08:18:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1544458682; cv=pass; d=google.com; s=arc-20160816; b=bfY2O3b88t7qJL4ToeSc4PTD2caVZ18NpmW6LJuq+5jj7Y1yHHRuz2UMrrHl9MzEK9 TQ63WaPSbpHk2pnDP4htmyBdZQE4PwtBbwOZH/wTO7ZuYpr4xj5pbLrK4MKpCTPLotuS HBuyNHyqTXHiwNO/G78XNEWZXpjMb5UARD/+IS/jmfdsGkbLyu9wgHvGHMG4kz0SvXyy CJ5W9lTmRDdQeFyybJjObYFdTttsks2Ul5SAD9MFsoosmyKBhaTHHANTOjvJ+CpkEuEd V/a8qRN3xlkQDG2sUXFf2JhSoQNS9mE3qXF2MCQA1op1kzMLT2ugBFayZIY9eUmAwZTp iQ5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7B7/bFXR+1ggUu89xO8Gq2xSzsCKM6R16uBfSc/xhAo=; b=wFMiTRH8Oapj69ws6Mx/5/WX4hAdGl1y2xHu11+mZZ6wB2ux33ZFtD1hP3vP4/oo5C bcX5Ix1FcoA+Cpak8IeyUPVSkbMCBz5fZ5JtOq13Uoq7ee8G3DgBEqFoXNJ7LA2MwVIb CJxpH02O0IlXUQuHBy+dQWb4sx4PtY6KMOLCiPjpnJ/ovX8SpnI8cd6mIojCUuPFgPK/ LBS2sVcenzCs+u7ircZ8nW4r4Ikd+CXP3SfVmhPqRBWqS8tkNoWam1Rm6nS/cUZdvO7j rt3onBqlacYP1ExrQCdqE9XUSzEC8IU2vFXvZCbDDT/FI1BhhLYQM9kjLJ0eKZcDPja+ 1Y6A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=j64vC5c9; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=7B7/bFXR+1ggUu89xO8Gq2xSzsCKM6R16uBfSc/xhAo=; b=qoCO0KpsRPkulLOkpaEXKwl/2a6JPier4a2U1nnbF5uqFFnNiMAevGDwJdk7IZkEVW uEUWfOY71VVCtyc+Z1qezsteafPxoMfmAuYBrKyR7tAWKWYnaTptG2ao2R9aRZ/wHV1c 3D3ITiVQuikFPLgLcosT0Q7CtvjkRWcOfti1E= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=7B7/bFXR+1ggUu89xO8Gq2xSzsCKM6R16uBfSc/xhAo=; b=rXeyy5r5xuqyoJnJpchIja68wrjfjfAlrBQtQPozLXvR4WlDX7P1cy5+c836Iuife5 IvcXgvV0dBWAhGDV9/AVEUzeMckc4qVq6AHzRSBSqhLj0xkx1D0jQ47VgTI17D04C72E Y455DWkgUzl5JkL4Q3vprvi3MFAeDxsF6EsDuK4VAUwLLo2m677E3bLocHFpB1FLWNPm xdUT28KIMo/ZKwrXw+gr0TcqxCPvEv72dueStKb7z7R1sQJYhLJe8uP5DHiXVvGzoAq5 +fe93YCmfWsUu0WXkjsLZVd3F40nXkLw41CHr/nYAOAiE5bXvWzmjcEuoEcRNNwBnVMv oA3w== X-Gm-Message-State: AA+aEWZiFadbOnLHkP6MMHqErWVmWE+SLD1YjPlbrS50Fc8M0jT5qBey J75AYvBAn8pNYnGei+urvuxNwPy8 X-Google-Smtp-Source: AFSGD/UkP02urXd7DBLePWrLVZxLFIsrlA2iNHMMqhLPhkf9Fg7vXEXma/IDS0C1fsSV1y9vp0fDxw== X-Received: by 2002:a1c:7e45:: with SMTP id z66mr1336914wmc.12.1544458682129; Mon, 10 Dec 2018 08:18:02 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a1c:b584:: with SMTP id e126ls1885571wmf.11.canary-gmail; Mon, 10 Dec 2018 08:18:01 -0800 (PST) X-Received: by 2002:a1c:ae15:: with SMTP id x21mr5550471wme.146.1544458681732; Mon, 10 Dec 2018 08:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544458681; cv=none; d=google.com; s=arc-20160816; b=kuC1Znz28vb6HY9rRZ3bxCGflEMgSaeFEOMCiJJ22CnjvRwuYlNp2PO1v5I3WT45rG gJvO4ld49taj3NA3d/6e6Q0gDbeHRrUQnGHvmokXUqKmi47W9VrVzzG5dhjfMXsCPvkg Trnyddqf8j9GFXZG4M6W/EuzI/XXYCkkAMuggq2Mb9ZGoSCE19rKvwCw1zgzWC0GymFE rcO0pmq75xL3A1QG0fq4g0D757xWuqy6byGCI/7/uzrB/f68QfUJFMtO+e1BoQR5Dvds NTP2Hl2FiD4eneEUICNECMs+3LIK4RC4hvs24RQFdMuQEpJirNDev+hJ7rFpCU/OjE6U Mdiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7B7/bFXR+1ggUu89xO8Gq2xSzsCKM6R16uBfSc/xhAo=; b=0+RgdpVnEwTpJ9NdSufjgkqA90SYneFOzxiHJ2uSOT1afrGAf4m8y5eNoPMwyDqeIV l4ApVeo1HJhGZ7qhzpk+NW8p0wcB2cwjs/0FeNs79BHT70R3KRphuGu2x+U6oDyQLtzx 9k1Kb64e25zOiurwiLMXP+gt1CfvH+LZ8BT3sEMicuiE0GQLguVx7bPmm33wyLqpEcbJ oqEwnPG+Cy30um+2pLwSZ4W8HD2pPpSIpvVgcmBXj4mQnqd9pJQewls4XS706xjULAHp HTsPE8PpFXp++8Bq4LmnyVo8xJ8SEB1yPgfYtgjjzB4USzM5RIqJ72scdWx8IJ+0vm0l oqGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=j64vC5c9; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c190sor7642312wma.21.2018.12.10.08.18.01 for (Google Transport Security); Mon, 10 Dec 2018 08:18:01 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a1c:d7d3:: with SMTP id o202mr11936226wmg.135.1544458681432; Mon, 10 Dec 2018 08:18:01 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:18:00 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 10/17] drm/sun4i: sun6i_mipi_dsi: Add DSI hblk packet overhead Date: Mon, 10 Dec 2018 21:47:22 +0530 Message-Id: <20181210161729.29720-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=j64vC5c9; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add 10 bytes packet overhead for hblk where blank is set using a blanking packet like (4 bytes + 4 bytes + payload + 2 bytes) 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 4c95b3384ed9..07eba9ec469b 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -494,8 +494,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