From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EF46C433ED for ; Wed, 5 May 2021 13:53:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E60961182 for ; Wed, 5 May 2021 13:53:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233325AbhEENyS (ORCPT ); Wed, 5 May 2021 09:54:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232541AbhEENyQ (ORCPT ); Wed, 5 May 2021 09:54:16 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AD33C061574 for ; Wed, 5 May 2021 06:53:19 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id c21so1851828pgg.3 for ; Wed, 05 May 2021 06:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=Key2mtimVz3Ms9QHFbm4+H7mGJ0Ryu2plYuVDFRZjpPSMAdAD5nCBdXFdPFEFUJIvf QsPqFq2nTQv3zsXqVfDIqgtf/Q7ma8W2BEtCjCaq2veefFeg9Zf5iFSuhQWPe/MRYHhO J+pT6zBwMfMpXE2z4H0pWtMDJRH0kOnIGMH5JKuz7O31W0CVIV0iefAiDshNHsUT8KUw ys6ywYxzupKjoqkEv9sW1YvBER5/JV2MYPXmDnJq6hKgQe3DETrS0fuI4a+ZbH6vHx2T yU0Iv7KK9687KoatwGwgtHpGT5v4//KWks/yMgZfx4fHaRGcUHdf+eUFpqYT3bF8afEW hkGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=ch/pdFV7uX8QlcxPMyRSWAnjRlwwx4IuJ3N1qtdDHvOveoqomrA7slZRMhUfpS0aqz BaGk1D3r6nQPKJ1lkiljxzpwRyqR4mZ8qvsE8Pwuqx9SRjfHQ3rXCEokCc6Oyocxakag DRcElpP8p6Q/C/BAoGFpEIoBm4vYK/rPp7d2jqv1n72z1HbthdrDFm9zZ+es9oqgNUr3 e7Kq29ZVVX6VHVRmrkf0ksL1EBy4s3/NrLmUxp8XV4W3wnRMBKCuUHnoFdMVEPPC394A i9jJAu35EZzY0BsqE0Wsv7be4/pHnrRwB2cGjp/GPP6sTTqFi2zfyG3rqmkE/c3/XjMm HZ4A== X-Gm-Message-State: AOAM531NdOWq81Z+1JTbjS2DO7mGApGSEbZ0nYT+hxjuyHwJHy1Ckj9W wDDBGR7GMNzsj2H1p8dy2PF/e16MB4q9BauqbOrHT1tMk0JQvg== X-Google-Smtp-Source: ABdhPJyluxFRTo8fdiox4JZ/YBjp7C3OIiVJ3YAHoNyjb+ElKi+tqlmQFHxdzj08K6nCwubf+VSVhH2i0N/I2jSnzsg= X-Received: by 2002:a65:4c8e:: with SMTP id m14mr27753924pgt.377.1620222798644; Wed, 05 May 2021 06:53:18 -0700 (PDT) MIME-Version: 1.0 References: <55fe7f3454d8c91dc3837ba5aa741d4a0e67378f.1618797813.git.tommyhebb@gmail.com> In-Reply-To: <55fe7f3454d8c91dc3837ba5aa741d4a0e67378f.1618797813.git.tommyhebb@gmail.com> From: Jonathan Liu Date: Wed, 5 May 2021 23:53:07 +1000 Message-ID: Subject: Re: [RESEND PATCH] drm/rockchip: dsi: move all lane config except LCDC mux to bind() To: Thomas Hebb Cc: linux-kernel , Nickey Yang , Heiko Stuebner , Andrzej Hajda , Brian Norris , Daniel Vetter , David Airlie , Sandy Huang , Sean Paul , dri-devel , linux-arm-kernel , linux-rockchip@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Apr 2021 at 02:04, Thomas Hebb wrote: > > When we first enable the DSI encoder, we currently program some per-chip > configuration that we look up in rk3399_chip_data based on the device > tree compatible we match. This data configures various parameters of the > MIPI lanes, including on RK3399 whether DSI1 is slaved to DSI0 in a > dual-mode configuration. It also selects which LCDC (i.e. VOP) to scan > out from. > > This causes a problem in RK3399 dual-mode configurations, though: panel > prepare() callbacks run before the encoder gets enabled and expect to be > able to write commands to the DSI bus, but the bus isn't fully > functional until the lane and master/slave configuration have been > programmed. As a result, dual-mode panels (and possibly others too) fail > to turn on when the rockchipdrm driver is initially loaded. > > Because the LCDC mux is the only thing we don't know until enable time > (and is the only thing that can ever change), we can actually move most > of the initialization to bind() and get it out of the way early. That's > what this change does. (Rockchip's 4.4 BSP kernel does it in mode_set(), > which also avoids the issue, but bind() seems like the more correct > place to me.) > > Tested on a Google Scarlet board (Acer Chromebook Tab 10), which has a > Kingdisplay KD097D04 dual-mode panel. Prior to this change, the panel's > backlight would turn on but no image would appear when initially loading > rockchipdrm. If I kept rockchipdrm loaded and reloaded the panel driver, > it would come on. With this change, the panel successfully turns on > during initial rockchipdrm load as expected. > > Fixes: 2d4f7bdafd70 ("drm/rockchip: dsi: migrate to use dw-mipi-dsi bridge driver") > Signed-off-by: Thomas Hebb Tested-by: Jonathan Liu Fixes MIPI-DSI panel initialization for me on RK3399 too. Regards, Jonathan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82956C433ED for ; Wed, 5 May 2021 13:53:43 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 D8AAA6101C for ; Wed, 5 May 2021 13:53:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8AAA6101C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=T0XzbislkAl4voYOHyA92F0fQmlAzPa/ODBxwpiJGAI=; b=Qs3mCobz5o7gtgac0Xa30znSS yMCkA+k/Iqyrd46IA62gUgHstWl70YMhsIJi4imJrJamSq8btReaAIZj0S2pocQQCZsovjffnM4D6 iNZXmCRIoCuAaDrdcWQgSUA11FtbwjkC5xPfZ4gcSrXn8YqRocKzFqvUA4dsTp1Y2+dsnZftNYDOb SKvrdW3Anw1ci4dGN68MivKSFIqpjSP4M0ZHPYORYtHKKvWVkdhpS2ugMNdam/0wbZe4FUmZo2BTA Rk2ioU1vZlSjxLl3QJxbTpsyrG2T7dvEvCS+qxYmHdlzuVGlvzPVJsgwNQYJ3dxIo6TM0DewiIft1 aC7hqyBQA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leHy7-001M8b-9d; Wed, 05 May 2021 13:53:39 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leHxq-001M6Y-Uz; Wed, 05 May 2021 13:53:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=Grqip2ym8kxySPanEjBOVEPgx4 5BQyDYKCfqyJkPsrivMRggafJa0RT5Mqb/5rmRpHZ/cfYtjjBkGqhY3NFU4fM3Z49qBw8+E2KGi8O NQ9ROiZYDUoCov4QXqrStWavJLcU6bpZacDKIMbcoQ8Vt82i5eB76BCSX2EoNMo4JtmcCl2yjBAUr smj1pgWugrXRBFvLH3L/tGCgP1uuES7OvhX/415aOLiTJRqcALXNvB4UUO24F2eFZRI+oK/ad4Xo3 xsv6J+x/E6bz0FL3nz28MkjFE+tdISFNgiuMvQufu0/4hFCcgCesN0D719Jrerd7ZxKoE/BqnZ4Ue Wiu2kCcQ==; Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leHxo-004nHi-4e; Wed, 05 May 2021 13:53:21 +0000 Received: by mail-pg1-x52d.google.com with SMTP id t22so1914177pgu.0; Wed, 05 May 2021 06:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=Key2mtimVz3Ms9QHFbm4+H7mGJ0Ryu2plYuVDFRZjpPSMAdAD5nCBdXFdPFEFUJIvf QsPqFq2nTQv3zsXqVfDIqgtf/Q7ma8W2BEtCjCaq2veefFeg9Zf5iFSuhQWPe/MRYHhO J+pT6zBwMfMpXE2z4H0pWtMDJRH0kOnIGMH5JKuz7O31W0CVIV0iefAiDshNHsUT8KUw ys6ywYxzupKjoqkEv9sW1YvBER5/JV2MYPXmDnJq6hKgQe3DETrS0fuI4a+ZbH6vHx2T yU0Iv7KK9687KoatwGwgtHpGT5v4//KWks/yMgZfx4fHaRGcUHdf+eUFpqYT3bF8afEW hkGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=jfbHlUpB8X9pTN4xoxYbqkdEd7sn48YFjhWcsDVDWCbwyPhsM4hmrVFsDV3GO7RCms 0GvwYWgdZCI7Mhjm4KOMJHCc2XjheGQsogN0qxcvrqmQ2hR6CAbCcPgEa4mhGo1k/Fsv +3rXkVZ4ViO4B6jao3udK+5Rb1ZZko7A2sKZ4mP3NIWIeV+dc3V3mmryMrkWymV8MtGI D9xwub5WC4lvHLYmDIGsKu406cdCcTulapM+RA58XAx+VzLvieTKSApv29YeQhrExdyP od1y1v1S7c8/bV4qTYnZS9jWZDSSPAzg2O80ig7qNekvxvtKLnxJVL2eP5knRKRYSail JNYQ== X-Gm-Message-State: AOAM532ph2aIkL6jVOcuACrTtYzWAswpeq7+p1ztvozrRoqrk1U0xwan dztIwwPfO+mG5Lkq5eTodhQnqs91j4x9SeFSR3Q= X-Google-Smtp-Source: ABdhPJyluxFRTo8fdiox4JZ/YBjp7C3OIiVJ3YAHoNyjb+ElKi+tqlmQFHxdzj08K6nCwubf+VSVhH2i0N/I2jSnzsg= X-Received: by 2002:a65:4c8e:: with SMTP id m14mr27753924pgt.377.1620222798644; Wed, 05 May 2021 06:53:18 -0700 (PDT) MIME-Version: 1.0 References: <55fe7f3454d8c91dc3837ba5aa741d4a0e67378f.1618797813.git.tommyhebb@gmail.com> In-Reply-To: <55fe7f3454d8c91dc3837ba5aa741d4a0e67378f.1618797813.git.tommyhebb@gmail.com> From: Jonathan Liu Date: Wed, 5 May 2021 23:53:07 +1000 Message-ID: Subject: Re: [RESEND PATCH] drm/rockchip: dsi: move all lane config except LCDC mux to bind() To: Thomas Hebb Cc: linux-kernel , Nickey Yang , Heiko Stuebner , Andrzej Hajda , Brian Norris , Daniel Vetter , David Airlie , Sandy Huang , Sean Paul , dri-devel , linux-arm-kernel , linux-rockchip@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210505_065320_206459_738B2AA4 X-CRM114-Status: GOOD ( 20.02 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On Mon, 19 Apr 2021 at 02:04, Thomas Hebb wrote: > > When we first enable the DSI encoder, we currently program some per-chip > configuration that we look up in rk3399_chip_data based on the device > tree compatible we match. This data configures various parameters of the > MIPI lanes, including on RK3399 whether DSI1 is slaved to DSI0 in a > dual-mode configuration. It also selects which LCDC (i.e. VOP) to scan > out from. > > This causes a problem in RK3399 dual-mode configurations, though: panel > prepare() callbacks run before the encoder gets enabled and expect to be > able to write commands to the DSI bus, but the bus isn't fully > functional until the lane and master/slave configuration have been > programmed. As a result, dual-mode panels (and possibly others too) fail > to turn on when the rockchipdrm driver is initially loaded. > > Because the LCDC mux is the only thing we don't know until enable time > (and is the only thing that can ever change), we can actually move most > of the initialization to bind() and get it out of the way early. That's > what this change does. (Rockchip's 4.4 BSP kernel does it in mode_set(), > which also avoids the issue, but bind() seems like the more correct > place to me.) > > Tested on a Google Scarlet board (Acer Chromebook Tab 10), which has a > Kingdisplay KD097D04 dual-mode panel. Prior to this change, the panel's > backlight would turn on but no image would appear when initially loading > rockchipdrm. If I kept rockchipdrm loaded and reloaded the panel driver, > it would come on. With this change, the panel successfully turns on > during initial rockchipdrm load as expected. > > Fixes: 2d4f7bdafd70 ("drm/rockchip: dsi: migrate to use dw-mipi-dsi bridge driver") > Signed-off-by: Thomas Hebb Tested-by: Jonathan Liu Fixes MIPI-DSI panel initialization for me on RK3399 too. Regards, Jonathan _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4221EC433ED for ; Wed, 5 May 2021 13:55:47 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 7E1916101C for ; Wed, 5 May 2021 13:55:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E1916101C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0Xaer6MaFWM8GK3YayLkzwTvFJppr5h36gOla4wWv0E=; b=bHM4ujkEz+SLoJvnJiyZwTZgl eocNJJ4hiyeh1aQKROc+fH80SO8NSRKRyYFrHcXJW+Q+cPnXjjbc9s9OFnBMzksr26xE1OFwr6+8p mm3HTNrIU5xCh4LsPTIyqfkhIid32r2cG8rt+uqguvddEjqMcSLow9I1W/8bqCSNFWDW/VgPd1lJf bw6oYsC1yOQ8w0YQtVuhuwr96+wVXHrDcKdgWiwaNE507XPpgXG8bjchkr05CBRFm12+6dlaKr/Xc LEHouflu+0bYQ5j6PvrSB57FWrNH79tF6BR6bVBx18GKg43PnPTPbP7SK2ZCuZcxPkRehA804/WSk tDrTeeVZQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leHxt-001M6t-Hz; Wed, 05 May 2021 13:53:25 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leHxq-001M6Y-Uz; Wed, 05 May 2021 13:53:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=Grqip2ym8kxySPanEjBOVEPgx4 5BQyDYKCfqyJkPsrivMRggafJa0RT5Mqb/5rmRpHZ/cfYtjjBkGqhY3NFU4fM3Z49qBw8+E2KGi8O NQ9ROiZYDUoCov4QXqrStWavJLcU6bpZacDKIMbcoQ8Vt82i5eB76BCSX2EoNMo4JtmcCl2yjBAUr smj1pgWugrXRBFvLH3L/tGCgP1uuES7OvhX/415aOLiTJRqcALXNvB4UUO24F2eFZRI+oK/ad4Xo3 xsv6J+x/E6bz0FL3nz28MkjFE+tdISFNgiuMvQufu0/4hFCcgCesN0D719Jrerd7ZxKoE/BqnZ4Ue Wiu2kCcQ==; Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leHxo-004nHi-4e; Wed, 05 May 2021 13:53:21 +0000 Received: by mail-pg1-x52d.google.com with SMTP id t22so1914177pgu.0; Wed, 05 May 2021 06:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=Key2mtimVz3Ms9QHFbm4+H7mGJ0Ryu2plYuVDFRZjpPSMAdAD5nCBdXFdPFEFUJIvf QsPqFq2nTQv3zsXqVfDIqgtf/Q7ma8W2BEtCjCaq2veefFeg9Zf5iFSuhQWPe/MRYHhO J+pT6zBwMfMpXE2z4H0pWtMDJRH0kOnIGMH5JKuz7O31W0CVIV0iefAiDshNHsUT8KUw ys6ywYxzupKjoqkEv9sW1YvBER5/JV2MYPXmDnJq6hKgQe3DETrS0fuI4a+ZbH6vHx2T yU0Iv7KK9687KoatwGwgtHpGT5v4//KWks/yMgZfx4fHaRGcUHdf+eUFpqYT3bF8afEW hkGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=jfbHlUpB8X9pTN4xoxYbqkdEd7sn48YFjhWcsDVDWCbwyPhsM4hmrVFsDV3GO7RCms 0GvwYWgdZCI7Mhjm4KOMJHCc2XjheGQsogN0qxcvrqmQ2hR6CAbCcPgEa4mhGo1k/Fsv +3rXkVZ4ViO4B6jao3udK+5Rb1ZZko7A2sKZ4mP3NIWIeV+dc3V3mmryMrkWymV8MtGI D9xwub5WC4lvHLYmDIGsKu406cdCcTulapM+RA58XAx+VzLvieTKSApv29YeQhrExdyP od1y1v1S7c8/bV4qTYnZS9jWZDSSPAzg2O80ig7qNekvxvtKLnxJVL2eP5knRKRYSail JNYQ== X-Gm-Message-State: AOAM532ph2aIkL6jVOcuACrTtYzWAswpeq7+p1ztvozrRoqrk1U0xwan dztIwwPfO+mG5Lkq5eTodhQnqs91j4x9SeFSR3Q= X-Google-Smtp-Source: ABdhPJyluxFRTo8fdiox4JZ/YBjp7C3OIiVJ3YAHoNyjb+ElKi+tqlmQFHxdzj08K6nCwubf+VSVhH2i0N/I2jSnzsg= X-Received: by 2002:a65:4c8e:: with SMTP id m14mr27753924pgt.377.1620222798644; Wed, 05 May 2021 06:53:18 -0700 (PDT) MIME-Version: 1.0 References: <55fe7f3454d8c91dc3837ba5aa741d4a0e67378f.1618797813.git.tommyhebb@gmail.com> In-Reply-To: <55fe7f3454d8c91dc3837ba5aa741d4a0e67378f.1618797813.git.tommyhebb@gmail.com> From: Jonathan Liu Date: Wed, 5 May 2021 23:53:07 +1000 Message-ID: Subject: Re: [RESEND PATCH] drm/rockchip: dsi: move all lane config except LCDC mux to bind() To: Thomas Hebb Cc: linux-kernel , Nickey Yang , Heiko Stuebner , Andrzej Hajda , Brian Norris , Daniel Vetter , David Airlie , Sandy Huang , Sean Paul , dri-devel , linux-arm-kernel , linux-rockchip@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210505_065320_206459_738B2AA4 X-CRM114-Status: GOOD ( 20.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 19 Apr 2021 at 02:04, Thomas Hebb wrote: > > When we first enable the DSI encoder, we currently program some per-chip > configuration that we look up in rk3399_chip_data based on the device > tree compatible we match. This data configures various parameters of the > MIPI lanes, including on RK3399 whether DSI1 is slaved to DSI0 in a > dual-mode configuration. It also selects which LCDC (i.e. VOP) to scan > out from. > > This causes a problem in RK3399 dual-mode configurations, though: panel > prepare() callbacks run before the encoder gets enabled and expect to be > able to write commands to the DSI bus, but the bus isn't fully > functional until the lane and master/slave configuration have been > programmed. As a result, dual-mode panels (and possibly others too) fail > to turn on when the rockchipdrm driver is initially loaded. > > Because the LCDC mux is the only thing we don't know until enable time > (and is the only thing that can ever change), we can actually move most > of the initialization to bind() and get it out of the way early. That's > what this change does. (Rockchip's 4.4 BSP kernel does it in mode_set(), > which also avoids the issue, but bind() seems like the more correct > place to me.) > > Tested on a Google Scarlet board (Acer Chromebook Tab 10), which has a > Kingdisplay KD097D04 dual-mode panel. Prior to this change, the panel's > backlight would turn on but no image would appear when initially loading > rockchipdrm. If I kept rockchipdrm loaded and reloaded the panel driver, > it would come on. With this change, the panel successfully turns on > during initial rockchipdrm load as expected. > > Fixes: 2d4f7bdafd70 ("drm/rockchip: dsi: migrate to use dw-mipi-dsi bridge driver") > Signed-off-by: Thomas Hebb Tested-by: Jonathan Liu Fixes MIPI-DSI panel initialization for me on RK3399 too. Regards, Jonathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D672C433ED for ; Wed, 5 May 2021 19:15:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 DB543613BF for ; Wed, 5 May 2021 19:15:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB543613BF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5256D6E4FE; Wed, 5 May 2021 19:15:26 +0000 (UTC) Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2EEE088C3D for ; Wed, 5 May 2021 13:53:19 +0000 (UTC) Received: by mail-pg1-x529.google.com with SMTP id y30so1830744pgl.7 for ; Wed, 05 May 2021 06:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=Key2mtimVz3Ms9QHFbm4+H7mGJ0Ryu2plYuVDFRZjpPSMAdAD5nCBdXFdPFEFUJIvf QsPqFq2nTQv3zsXqVfDIqgtf/Q7ma8W2BEtCjCaq2veefFeg9Zf5iFSuhQWPe/MRYHhO J+pT6zBwMfMpXE2z4H0pWtMDJRH0kOnIGMH5JKuz7O31W0CVIV0iefAiDshNHsUT8KUw ys6ywYxzupKjoqkEv9sW1YvBER5/JV2MYPXmDnJq6hKgQe3DETrS0fuI4a+ZbH6vHx2T yU0Iv7KK9687KoatwGwgtHpGT5v4//KWks/yMgZfx4fHaRGcUHdf+eUFpqYT3bF8afEW hkGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n1bbsdQFslUe2/D8fiyQmt7GT8BuGOrH6bymhVpBYX0=; b=im8UxGovN4EFYFyxAl2jqgLC7NcWFEgbwSUDdnqaeI1OY1ht9X4gF1hH1lRq96XawT 3d88iqsKCBjRXzBF0uTZIRGg8unNaCftahi/MRPkI3YSEYKAoTDYIcWCSQ3a/qweaHwS F3cWCc8c1qB0i8vQPgucef1PlU601XkXCcARxnhzAzZwgs/iWdBHdKBCxWPJQ30/5Q9M pPl2VGeK/OYnCrw7ki0/enjj0DqyJubtsIvGFwZHGeCzTtjIkVQnBRkKwhvSJv6F+uQX ZjbEXjWMlYHwg4k31Zn+8VPWuNv+7Vp5Z9xwnaFjwVpgyNWY8ueWh+dptgoCZxLJS+tN YBrw== X-Gm-Message-State: AOAM530Q7n8RbPMRHgksW2H72zo8mm/gAUGA0JOzjcVl0tVxiBKgGHf4 /nrG7hLGXOzhgsu88AdgHgU0N2bhP8UoVT1ObcI= X-Google-Smtp-Source: ABdhPJyluxFRTo8fdiox4JZ/YBjp7C3OIiVJ3YAHoNyjb+ElKi+tqlmQFHxdzj08K6nCwubf+VSVhH2i0N/I2jSnzsg= X-Received: by 2002:a65:4c8e:: with SMTP id m14mr27753924pgt.377.1620222798644; Wed, 05 May 2021 06:53:18 -0700 (PDT) MIME-Version: 1.0 References: <55fe7f3454d8c91dc3837ba5aa741d4a0e67378f.1618797813.git.tommyhebb@gmail.com> In-Reply-To: <55fe7f3454d8c91dc3837ba5aa741d4a0e67378f.1618797813.git.tommyhebb@gmail.com> From: Jonathan Liu Date: Wed, 5 May 2021 23:53:07 +1000 Message-ID: Subject: Re: [RESEND PATCH] drm/rockchip: dsi: move all lane config except LCDC mux to bind() To: Thomas Hebb Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Wed, 05 May 2021 19:15:25 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, David Airlie , Brian Norris , linux-kernel , dri-devel , Sandy Huang , Andrzej Hajda , Nickey Yang , Sean Paul , linux-arm-kernel Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, 19 Apr 2021 at 02:04, Thomas Hebb wrote: > > When we first enable the DSI encoder, we currently program some per-chip > configuration that we look up in rk3399_chip_data based on the device > tree compatible we match. This data configures various parameters of the > MIPI lanes, including on RK3399 whether DSI1 is slaved to DSI0 in a > dual-mode configuration. It also selects which LCDC (i.e. VOP) to scan > out from. > > This causes a problem in RK3399 dual-mode configurations, though: panel > prepare() callbacks run before the encoder gets enabled and expect to be > able to write commands to the DSI bus, but the bus isn't fully > functional until the lane and master/slave configuration have been > programmed. As a result, dual-mode panels (and possibly others too) fail > to turn on when the rockchipdrm driver is initially loaded. > > Because the LCDC mux is the only thing we don't know until enable time > (and is the only thing that can ever change), we can actually move most > of the initialization to bind() and get it out of the way early. That's > what this change does. (Rockchip's 4.4 BSP kernel does it in mode_set(), > which also avoids the issue, but bind() seems like the more correct > place to me.) > > Tested on a Google Scarlet board (Acer Chromebook Tab 10), which has a > Kingdisplay KD097D04 dual-mode panel. Prior to this change, the panel's > backlight would turn on but no image would appear when initially loading > rockchipdrm. If I kept rockchipdrm loaded and reloaded the panel driver, > it would come on. With this change, the panel successfully turns on > during initial rockchipdrm load as expected. > > Fixes: 2d4f7bdafd70 ("drm/rockchip: dsi: migrate to use dw-mipi-dsi bridge driver") > Signed-off-by: Thomas Hebb Tested-by: Jonathan Liu Fixes MIPI-DSI panel initialization for me on RK3399 too. Regards, Jonathan