From patchwork Thu Oct 3 06:45:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11172211 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2912416B1 for ; Thu, 3 Oct 2019 06:46:39 +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 9FB7420842 for ; Thu, 3 Oct 2019 06:46:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZeBpOzah"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="Si2+eXmQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FB7420842 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+patchwork-linux-arm=patchwork.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=tfWz9IJFvglZgDs0VDM/wNlIWVv0SncfFxkRyA6h2Ts=; b=ZeBpOzah+V9YW2 vQ/m+sD/9whj4PFrAyaMuKUDHDzIPL2uCCyjS2WesVH1cVL889m8du/reQfhHEZSZpZTCrvIsrixt jxxmTGEox2PZeIRx8dLh9o0fWuZ5AxCp2rb9FkPVxZwYKtQ4GPrw79yCyMX7Ocr77WLUaeLiqPris vXgwtD3fH5BoEPfi88050czKwv1qnEEavldmgh3GdV0fHyrIqw8+iBPReZDaw5mOwWk+7471X9vZJ WcysoxwqHKoUwQ9YYHo1rNZA2GELHbbHB85hq3qPYluXaZJ9isG51Pw5v6lP2gf0FiHyph0+tmbGW Je3XposdwLgfZOd50sdA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFusn-0004dC-Ce; Thu, 03 Oct 2019 06:46:37 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFusK-0003oZ-Vo for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2019 06:46:10 +0000 Received: by mail-pg1-x544.google.com with SMTP id a24so1147131pgj.2 for ; Wed, 02 Oct 2019 23:46:08 -0700 (PDT) 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=w0yjLoFJnnDpb4/0vl3aNO6o/4TykC3cym0JUZE/NWI=; b=Si2+eXmQ4tcfJciRfx3CwhRpPXA1JiV+W1GJTimvxDMNK3lHB5GB1DKRqKqkq2v5To ViXdDa6X3dmqW6zM60QUIAIwGhahe5s7TDDut4p/5QQyC+VgWjVmL2LPOiQF2M02U5tX xiaXCQ6Ok7/yKjuji2H8ZRYGDKqwCilkgEtiY= 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=w0yjLoFJnnDpb4/0vl3aNO6o/4TykC3cym0JUZE/NWI=; b=FMFNGL7UwZ4XjGm5oA+UVzTYkksWE2SIg2xtapfWTVjKjsNbtAZOUfGVXJ+I3EWi7L DGwBkQPB7e0FMCabApPegKD+P34U7KrZqkqFjz+Zn7e4+S6OfXEs1S7hTY6h+epxIoGx H5BuXej02eoJ2iMgdommBcDrJLQnDllPmVcsDoFyDkZTSA3MNCKf62UIv79tGJGaGyju k68mjcXJMt0OuXtHD9x09hamLXsA7MA1lsfI3SYYxWUPjDjQPfnJTujtz0FluYNQWCLg lhtBbdG2DfaGPoLYlmZiJPc29pvfoLvrn9J27lwabbFmp5iTAEdvJHJhtdCOQQ/fQaGK +8Iw== X-Gm-Message-State: APjAAAVjK9N8Q2VGZS4s1CMn2ghaEWW2TdmFCvuZHAzRMg48j5CWIDBb FCspXA1NBjQeeMmoQ5qmz3nD4Q== X-Google-Smtp-Source: APXvYqyyOaCYtLD4fAd0lPGKoG6yL6GHPaCr7dwsq7YBZDAnyPzGVLp/zBgtASm5hUnqoozLCx2olQ== X-Received: by 2002:aa7:90c7:: with SMTP id k7mr9413941pfk.39.1570085167861; Wed, 02 Oct 2019 23:46:07 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.121]) by smtp.gmail.com with ESMTPSA id b18sm1423294pfi.157.2019.10.02.23.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 23:46:07 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , David Airlie , Daniel Vetter Subject: [PATCH v11 2/7] drm/sun4i: dsi: Update start value in video start delay Date: Thu, 3 Oct 2019 12:15:22 +0530 Message-Id: <20191003064527.15128-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20191003064527.15128-1-jagan@amarulasolutions.com> References: <20191003064527.15128-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191002_234609_171460_C1268731 X-CRM114-Status: GOOD ( 16.32 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 , Jagan Teki , michael@amarulasolutions.com, linux-arm-kernel@lists.infradead.org, Icenowy Zheng Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org start value in video start delay was changed in commit da676c6aa641 ("drm/sun4i: dsi: Change the start delay calculation") to match the legacy BSP driver [1]. So, using this existing start delay computation gives the wrong start delay value for the "bananapi,s070wv20-ct16" panel. Due to this the panel trigger below flip_done timed out as during kernel bootup: WARNING: CPU: 0 PID: 31 at drivers/gpu/drm/drm_atomic_helper.c:1429 drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0 [CRTC:46:crtc-0] vblank wait timed out Modules linked in: CPU: 0 PID: 31 Comm: kworker/0:1 Tainted: G W 5.1.0-next-20190514-00025-gf928bc7cc146 #15 Hardware name: Allwinner sun8i Family Workqueue: events deferred_probe_work_func [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x84/0x98) [] (dump_stack) from [] (__warn+0xfc/0x114) [] (__warn) from [] (warn_slowpath_fmt+0x44/0x68) [] (warn_slowpath_fmt) from [] (drm_atomic_helper_wait_for_vblanks.part.1+0x298/0x2a0) [] (drm_atomic_helper_wait_for_vblanks.part.1) from [] (drm_atomic_helper_commit_tail_rpm+0x5c/0x6c) [] (drm_atomic_helper_commit_tail_rpm) from [] (commit_tail+0x40/0x6c) [] (commit_tail) from [] (drm_atomic_helper_commit+0xbc/0x128) [] (drm_atomic_helper_commit) from [] (restore_fbdev_mode_atomic+0x1cc/0x1dc) [] (restore_fbdev_mode_atomic) from [] (drm_fb_helper_pan_display+0xac/0x1d0) [] (drm_fb_helper_pan_display) from [] (fb_pan_display+0xcc/0x134) [] (fb_pan_display) from [] (bit_update_start+0x14/0x30) [] (bit_update_start) from [] (fbcon_switch+0x3d8/0x4e0) [] (fbcon_switch) from [] (redraw_screen+0x174/0x238) [] (redraw_screen) from [] (fbcon_prepare_logo+0x3c4/0x400) [] (fbcon_prepare_logo) from [] (fbcon_init+0x3c8/0x5ac) [] (fbcon_init) from [] (visual_init+0xbc/0x104) [] (visual_init) from [] (do_bind_con_driver+0x1b0/0x390) [] (do_bind_con_driver) from [] (do_take_over_console+0x13c/0x1c4) [] (do_take_over_console) from [] (do_fbcon_takeover+0x74/0xcc) [] (do_fbcon_takeover) from [] (notifier_call_chain+0x44/0x84) [] (notifier_call_chain) from [] (__blocking_notifier_call_chain+0x48/0x60) [] (__blocking_notifier_call_chain) from [] (blocking_notifier_call_chain+0x18/0x20) [] (blocking_notifier_call_chain) from [] (register_framebuffer+0x1e0/0x2f8) [] (register_framebuffer) from [] (__drm_fb_helper_initial_config_and_unlock+0x2fc/0x50c) [] (__drm_fb_helper_initial_config_and_unlock) from [] (drm_fbdev_client_hotplug+0xe8/0x1b8) [] (drm_fbdev_client_hotplug) from [] (drm_fbdev_generic_setup+0x88/0x118) [] (drm_fbdev_generic_setup) from [] (sun4i_drv_bind+0x128/0x160) [] (sun4i_drv_bind) from [] (try_to_bring_up_master+0x164/0x1a0) [] (try_to_bring_up_master) from [] (__component_add+0x94/0x140) [] (__component_add) from [] (sun6i_dsi_probe+0x144/0x234) [] (sun6i_dsi_probe) from [] (platform_drv_probe+0x48/0x9c) [] (platform_drv_probe) from [] (really_probe+0x1dc/0x2c8) [] (really_probe) from [] (driver_probe_device+0x60/0x160) [] (driver_probe_device) from [] (bus_for_each_drv+0x74/0xb8) [] (bus_for_each_drv) from [] (__device_attach+0xd0/0x13c) [] (__device_attach) from [] (bus_probe_device+0x84/0x8c) [] (bus_probe_device) from [] (deferred_probe_work_func+0x64/0x90) [] (deferred_probe_work_func) from [] (process_one_work+0x204/0x420) [] (process_one_work) from [] (worker_thread+0x274/0x5a0) [] (worker_thread) from [] (kthread+0x11c/0x14c) [] (kthread) from [] (ret_from_fork+0x14/0x2c) Exception stack(0xde539fb0 to 0xde539ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 755e10f62b83f396 ]--- Console: switching to colour frame buffer device 100x30 [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:46:crtc-0] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:48:DSI-1] flip_done timed out [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:30:plane-0] flip_done timed out To fix this, adjust the start delay computation according to the new BSP code [2]. Unfortunately we don't have any evidence or documentation for this reassignment to 1 in new bsp, but it is working with below mainline supported panels in A33, A64. - bananapi,s070wv20-ct16 - feiyang,fy07024di26a30d - techstar,ts8550b So, use the start as per new bsp code since it is working in all the supported panels. [1] https://github.com/BPI-SINOVOIP/BPI-M2M-bsp/blob/master/linux-sunxi/drivers/video/sunxi/legacy/disp/de_bsp/de/ebios/de_dsi.c#L682 [2] https://github.com/BPI-SINOVOIP/BPI-M2M-bsp/blob/master/linux-sunxi/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_dsi.c#L807 Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index f83522717488..c9c99c52bf1e 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -365,7 +365,17 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { - u16 start = clamp(mode->vtotal - mode->vdisplay - 10, 8, 100); + /** + * Allwinner legacy (drivers/video/sunxi/legacy), + * new (drivers/video/sunxi/disp/de/lowlevel_sun8iw5) bsp drivers + * are evaluating start as: + * + * vtotal - vdisplay - 10 + * + * but the new drivers are reassigning start to 1, which seems to be + * working in DSI panels available in mainline. + */ + u8 start = 1; u16 delay = mode->vtotal - (mode->vsync_end - mode->vdisplay) + start; if (delay > mode->vtotal)