From patchwork Fri Nov 16 16:39:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10687501 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 2721F13B5 for ; Sat, 17 Nov 2018 14:56:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16B8C2B902 for ; Sat, 17 Nov 2018 14:56:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0ADC62B905; Sat, 17 Nov 2018 14:56:57 +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 B47702B902 for ; Sat, 17 Nov 2018 14:56:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7BF56E974; Sat, 17 Nov 2018 14:56:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id CAE826E7CC for ; Fri, 16 Nov 2018 16:40:45 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id c72so6970849pfc.6 for ; Fri, 16 Nov 2018 08:40:45 -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=MRo42Xf+FQpuD9HBlP4kHgZ6kHSlZrL0EE25YHygWMY=; b=CNF9itd95nZsa4Ro5OgNboKRyjL4K82OZ/YaEbkYPLT814lYWQN0YSTisLpvhlozO2 +Qjd4Prb6JHeWXqJl3pUwCMD1yP+9cQvVsqSQPHCk+TOy89JG+ejNAgPfx4HozTaIBd6 WW+sdgphBbadlDf7sU6WcZDKZ9jjbDrLaTZ7RQd+27eHwGvnCX+7aOLkDjrNlrgnQEA9 WFl6hhkxlToIUyTJ+3PYO9j33gZZxZMD3/pZUPQRwWxvkfTmW7+UcCiNXygZbIA6IuDV zdzZwox1hVwTWew54fC2mbk8NMgSIvKWUpKAttuNibKDw3op1AuWttQhbLYM32sr1s5u +C3A== X-Gm-Message-State: AGRZ1gJTyIsyHNELTMZVAbTVzBZQkOFlWOP6pK14lTZXj8ilHN8+3z7A PxhmUemhKcnTZ0y29KDK7qIKSA== X-Google-Smtp-Source: AJdET5dZ5SU50zmOjkRJkoJuTE+S0902DCIO0+YdWzY+sLBUXEOUSOcfG/pI+yUb0aZoOL90/n2p9Q== X-Received: by 2002:a62:528e:: with SMTP id g136mr7747262pfb.111.1542386445340; Fri, 16 Nov 2018 08:40:45 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id p5-v6sm34622213pfb.109.2018.11.16.08.40.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:40:44 -0800 (PST) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com Subject: [PATCH v2 09/12] drm/sun4i: sun6i_mipi_dsi: Enable burst mode HBP, HSA_HSE Date: Fri, 16 Nov 2018 22:09:13 +0530 Message-Id: <20181116163916.29621-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181116163916.29621-1-jagan@amarulasolutions.com> References: <20181116163916.29621-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 17 Nov 2018 14:56:24 +0000 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: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Horizontal back porch, sync active and sync end bits are needed to disable for burst mode panel operations. So, disable them via dsi base control register. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 22d2987c3298..20a1de8493e0 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -644,15 +644,21 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, struct sun6i_dsi_timings timings; size_t bytes; u8 *buffer; + u32 val = 0; /* Do all timing calculations up front to allocate buffer space */ memset(&timings, 0, sizeof(timings)); - if (device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) + if (device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) { timings.hblk = (mode->hdisplay * Bpp); - else + + regmap_read(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, &val); + val |= SUN6I_DSI_BASIC_CTL_HBP_DIS; + val |= SUN6I_DSI_BASIC_CTL_HSA_HSE_DIS; + } else { sun6i_dsi_get_timings(dsi, mode, &timings); + } /* How many bytes do we need to send all payloads? */ bytes = max_t(size_t, max(max(timings.hfp, timings.hblk), @@ -661,7 +667,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, if (WARN_ON(!buffer)) return; - regmap_write(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, 0); + regmap_write(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, val); regmap_write(dsi->regs, SUN6I_DSI_SYNC_HSS_REG, sun6i_dsi_build_sync_pkt(MIPI_DSI_H_SYNC_START,