From patchwork Thu Dec 7 14:16:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 175171 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4813654vqy; Thu, 7 Dec 2023 06:20:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEa/jPgdyYKHHSHqd0+s2flhhqwOjN7qjVxI/BaAaitzTFSsYoZpZ1g+0TYB1CUdSUewc39 X-Received: by 2002:a17:90b:4d0b:b0:286:3b18:592a with SMTP id mw11-20020a17090b4d0b00b002863b18592amr3520909pjb.7.1701958839121; Thu, 07 Dec 2023 06:20:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701958839; cv=none; d=google.com; s=arc-20160816; b=Bf6kRAWlvCXpCiqNKsQPkv0CUGiW/gv6s/GvVrd1PMCmNarUM2kjVYbpEawSdW1hRA ozcQ+T1kYJ72xkAcNZ6r36A92jXDEirMyF0T4kd+0F6p6tpv3uG8sntyQRwi2YubTNr9 IN8O25aeS+wy8NGko32CgYoYhqToBtNrC7muaoOnCQdxH6nZZ0wOJAZ7Xfx9S/Fu7rso cQIyDrr87MeH+DUwaTNhb8QJkdJFRg1oio5t61ieqW3F5hShaPxFV8KipEPO0qo0eD03 yX7m2m8RmkKtieg/8Tp7cgOO/vxBuuTfbw27tk+MR4NJY8BDugqI+G50KYsIcTyFVzX6 qXjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3CX2gA6r/dtvGkH0YEYWwI6mzbAd5lMyIJziHnyg55Q=; fh=m6aHy4GVWeiYcahcFfIzqNn3pzsQZUVlVWbThwuybpU=; b=tuM9DVo61s54B8BSHaNhmrxK+3BT61gqR1e7dQ4aF+FAQvWNrPiruX+Ns073Rq/DHx rNy1VX7JTPqA61kfh8EztqO8nlbqH91fSQ6RFNYlCJ6ks0y9uncFKCaDllA1FaEHPTEy aZabXQMvxc02bg2hnkdk5b19C3kPhbLylM3GTOnspwvrP9UO22v53MF2wRMxiSACsLbc 0Q2+1FUfFzxOcBL9P21Nmww4iZNY+o3bZrsBndxTYYbNNq8BkPjGzMTQlWvQxI5nnpsL s6JKY8zR8QpVeojcTKrYKl6h+6v5aterbXDQf8MXAMs1243gcUeuhvkjXtNPgCNMHrIF gaDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LyFm8gys; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id pl12-20020a17090b268c00b00286ba59e1d0si1173290pjb.186.2023.12.07.06.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:20:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LyFm8gys; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 042D580B41A3; Thu, 7 Dec 2023 06:20:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443199AbjLGOUE (ORCPT + 99 others); Thu, 7 Dec 2023 09:20:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443337AbjLGOTe (ORCPT ); Thu, 7 Dec 2023 09:19:34 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 948EC2118 for ; Thu, 7 Dec 2023 06:17:42 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c9c18e7990so10957461fa.2 for ; Thu, 07 Dec 2023 06:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1701958652; x=1702563452; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3CX2gA6r/dtvGkH0YEYWwI6mzbAd5lMyIJziHnyg55Q=; b=LyFm8gysVyjKxyarwrURNnVailE8OnFrIk5WbQr/OI7VEfDdtwpp8UlKiugL2Dg+Bs 2pU7wV3sBs6R5R1Ofy5+R25JqYIahn8w405Cb20AVZAaw2RURigQgSgRyi8bggt+1PW+ xB+n2vGrwO6edzNXsHJdXQh0kkDy6kEQns6I8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701958652; x=1702563452; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3CX2gA6r/dtvGkH0YEYWwI6mzbAd5lMyIJziHnyg55Q=; b=d7qq/D4sw7NrhsBjibomBNoTWsxDEpTttbqIa4H5zJ/6xwLrpoIcXPljnGxVstmG5q scsRu3L61LNQ/yQSDUdoh1j0Pz0TES7ygEhh4yLd/4ajCpRBNv9hYiEgg/8m7VOSRZqe /DANXArgDNx65NjOLEbIiaoUrEJdvcCU4b3gErPfIyY7Avq/gkNYwOpS1elRKB9XqTQY cJXOowgerPx+TyOP7w8umMqrh4CqENYU0T/bc+UKZAdS/HCZlGgAdgHGEmAGakAOVT3D vKj2vSk26vvRn1btu7YrwTymzb7aV+23UVAk7EoFt4yJy+XU0kinkCOdGA9EKnArqwEU fepg== X-Gm-Message-State: AOJu0YwYrNWwyct3CzvJIMHNU/0/HV/16l5Pj/lyqWMy1EkyWQDU/fKK 4RvsJEkHcf+ybW2lnoNK1N3PRbMu/N9gdk5aJDsJXg== X-Received: by 2002:a2e:9250:0:b0:2ca:1030:f695 with SMTP id v16-20020a2e9250000000b002ca1030f695mr1517835ljg.78.1701958651744; Thu, 07 Dec 2023 06:17:31 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6474:ebbf:9bf:959c:3c66:46c2]) by smtp.gmail.com with ESMTPSA id f24-20020a170906c09800b00a1e814b7155sm885421ejz.62.2023.12.07.06.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:17:31 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Andrzej Hajda , Daniel Vetter , David Airlie , Inki Dae , Jagan Teki , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Maarten Lankhorst , Marek Szyprowski , Maxime Ripard , Neil Armstrong , Robert Foss , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: [PATCH v5 03/10] drm: bridge: samsung-dsim: enter display mode in the enable() callback Date: Thu, 7 Dec 2023 15:16:32 +0100 Message-ID: <20231207141723.108004-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231207141723.108004-1-dario.binacchi@amarulasolutions.com> References: <20231207141723.108004-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 07 Dec 2023 06:20:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784633191443007171 X-GMAIL-MSGID: 1784633191443007171 The synaptics-r63353 (panel-bridge) can only be configured in command mode. So, samsung-dsim (bridge) must not be in display mode during the prepare()/unprepare() of the panel-bridge. Setting the "pre_enable_prev_first" flag to true allows the prepare() of the panel-bridge to be called between the pre_enabled() and enabled() of the bridge. So, the bridge can enter display mode only in the enabled(). The unprepare() of the panel-bridge is instead called between the disable() and post_disable() of the bridge. So, the disable() must exit the display mode (i .e. enter command mode) to allow the panel-bridge to receive DSI commands. samsung_dsim_atomic_pre_enable -> command mode r63353_panel_prepare -> send DSI commands samsung_dsim_atomic_enable -> enter display mode samsung_dsim_atomic_disable -> exit display mode (command mode) r63353_panel_unprepare -> send DSI commands samsung_dsim_atomic_post_disable Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/gpu/drm/bridge/samsung-dsim.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index be5914caa17d..15bf05b2bbe4 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1494,7 +1494,6 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, return; samsung_dsim_set_display_mode(dsi); - samsung_dsim_set_display_enable(dsi, true); } } @@ -1507,6 +1506,7 @@ static void samsung_dsim_atomic_enable(struct drm_bridge *bridge, samsung_dsim_set_display_mode(dsi); samsung_dsim_set_display_enable(dsi, true); } else { + samsung_dsim_set_display_enable(dsi, true); samsung_dsim_set_stop_state(dsi, false); } @@ -1524,6 +1524,8 @@ static void samsung_dsim_atomic_disable(struct drm_bridge *bridge, if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type)) samsung_dsim_set_stop_state(dsi, true); + samsung_dsim_set_display_enable(dsi, false); + dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; } @@ -1532,7 +1534,8 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, { struct samsung_dsim *dsi = bridge_to_dsi(bridge); - samsung_dsim_set_display_enable(dsi, false); + if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type)) + samsung_dsim_set_stop_state(dsi, true); dsi->state &= ~DSIM_STATE_ENABLED; pm_runtime_put_sync(dsi->dev);