From patchwork Fri Feb 1 15:42:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10792985 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 124C9159A for ; Fri, 1 Feb 2019 15:42:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00A893220B for ; Fri, 1 Feb 2019 15:42:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8FDF322CE; Fri, 1 Feb 2019 15:42:56 +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 9F7AA3220B for ; Fri, 1 Feb 2019 15:42:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 897F56EEA0; Fri, 1 Feb 2019 15:42:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id C07CD6EE9F for ; Fri, 1 Feb 2019 15:42:51 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id k19-v6so6137701lji.11 for ; Fri, 01 Feb 2019 07:42:51 -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=9CvRh+lhKmHHKkuw4aE/avnLB9iVsPqvkmbgt9/tcc0=; b=ECuwlqpmURlIVWVOyra+PUkNkw3mjw1Gf+oLQb1XIRm0xoe7J9cBmeOotyIUWf/e0j MDMo7oyx3NDaIy9ilDylJHqnV0PD/pcMWqOwZVLTlS77pxf8hSvrKZkNPOzSDZ2RRPMa O5GL48elBIYdCv4Lpy2sV6i3jg/vsJaf7sWM7lYFyE2Xxb1AFJkevxa/pTZmOaiyO0SJ Z/88Kn5fLO5b4ANuOQrAAYigocf8zqsrabG23Ef6X2z14rUO/8+WTOBuDq5s3l1WOU/T ucTn6jGv4wdr6DmPo6wOBmyQ0FA6/seycLcOyvn37UCNdeGBcKS7LfXtWJwSzEkdcV84 Fz6A== X-Gm-Message-State: AHQUAuZS7PRCdrt8XUTWqRHBqi29ZXcQLlq9hT8wRPrre+5AoZN/clol Bn44CAQQSOLrDlpOo8tktqjEkg== X-Google-Smtp-Source: AHgI3IZSyZEjd/uuBNj8z5Gb1VKqc7/TdJVgFfWgCLRelTrh4xlWzq2odByzPCLT+9+tpu16YiiYYA== X-Received: by 2002:a2e:9ad0:: with SMTP id p16-v6mr6897329ljj.102.1549035769983; Fri, 01 Feb 2019 07:42:49 -0800 (PST) Received: from localhost.localdomain ([217.76.202.68]) by smtp.gmail.com with ESMTPSA id i13-v6sm1305712ljg.82.2019.02.01.07.42.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 07:42:49 -0800 (PST) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Subject: [PATCH v7 03/23] drm/sun4i: sun6i_mipi_dsi: Setup burst mode timings Date: Fri, 1 Feb 2019 21:12:12 +0530 Message-Id: <20190201154232.10505-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190201154232.10505-1-jagan@amarulasolutions.com> References: <20190201154232.10505-1-jagan@amarulasolutions.com> MIME-Version: 1.0 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: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, Jagan Teki , Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Burst mode display timings are different from conventional video mode. For burst mode most of the timings hsa, hbp, hfp, vblk are 0 and hblk is computed as (mode->hdisplay * Bpp) This patch simply add burst mode timings without touching existing mode timings. Reference code taken from BSP (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hsa = 0; dsi_hbp = 0; dsi_hact = x*dsi_pixel_bits[format]/8; dsi_hblk = dsi_hact; dsi_hfp = 0; dsi_vblk = 0; Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 813d5523f1c7..0f02bcc997a5 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -477,6 +477,12 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, /* Do all timing calculations up front to allocate buffer space */ + if (device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) { + hbp = hfp = hsa = vblk = 0; + hblk = (mode->hdisplay * Bpp); + goto alloc_buf; + } + /* * A sync period is composed of a blanking packet (4 bytes + * payload + 2 bytes) and a sync event packet (4 bytes). Its @@ -515,6 +521,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, */ vblk = 0; +alloc_buf: /* How many bytes do we need to send all payloads? */ bytes = max_t(size_t, max(max(hfp, hblk), max(hsa, hbp)), vblk); buffer = kmalloc(bytes, GFP_KERNEL);