From patchwork Wed Dec 13 14:03:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 178039 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7797791dys; Wed, 13 Dec 2023 06:05:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0EB4M3Eai2Z6VsrGXfb+iWvv85lbCLufKzWC+dWQ6zbrGSmJmW57C8gD3B/8el2Z0Nnw+ X-Received: by 2002:a17:902:ea0e:b0:1d0:cec3:4568 with SMTP id s14-20020a170902ea0e00b001d0cec34568mr9734338plg.54.1702476358724; Wed, 13 Dec 2023 06:05:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702476358; cv=none; d=google.com; s=arc-20160816; b=wuAY+cNqu75kMCKMh+KlKyl5gi488iRcC+K7AGb5rNwEHKmxpF/eXBdwDdvh5Q+mZ0 AlHAa37L6rvl5Zoxjgu79p+zvsLW0vXiWN+YO3AT1WrHihht+XIOF5gyrfRwr/sEAYBN 3n/U4AbPMxM5CwgCUVnbEIhQUVp/K5l/7YNZMPCtLTKfgazU9ukuQjyDLDL3wEKYSX0R CsG9EwZb+9/MVqdmcktri6xNyReI4SzjIlJ3kZecaZ0/RX57llUJcVgrCwizMH+J8+ap MBXxRhZ19MB7rg20diH3o6OmqRijGGvGv5x8/WNk5z2ZFXEPneP6xsnRVuJC8attu0zM A6qQ== 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=UPLugLp3TGz/UFnnpIyweeCZZjgZZPvHfi+TCy9TH+Y=; b=k4miA83aZwo2bvaXYRgltPFDk3nXj6mbeec5xYZYFU8cRwIgPWgfg/OBJeM+u/Z7WK 70IQOoTPD7nTmFulmLCcPiP0Jn1srs8Aqwb9FmyCZ6HkXqx1RNdTv/F4ZiGLyzfZBocf VFADuyqp8tjlqKUqHl4syIRG1wYwTmIG0NV+m4/+I3sVWwTpB2X3xcLJ8Fj3a5n1polB P0DRtMqKGaX6mh1ZAdHy1wWgpst2ol8NdEVpwCGURwkwdSCZV3yD2+NFjk8WS5wg+WLs Rl43ZwelmDv4xyf6p8i7l4AvOJw1/zAu7ue/66MklhjsDzv/VaE6qAqXAb+P4DW13S3e ts3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rMuvyEAQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id j3-20020a170902c08300b001d0050e246bsi9702930pld.43.2023.12.13.06.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 06:05:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rMuvyEAQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id C5C188092480; Wed, 13 Dec 2023 06:05:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379445AbjLMOFT (ORCPT + 99 others); Wed, 13 Dec 2023 09:05:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379436AbjLMOE6 (ORCPT ); Wed, 13 Dec 2023 09:04:58 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E31012D for ; Wed, 13 Dec 2023 06:04:50 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a1db99cd1b2so881466066b.2 for ; Wed, 13 Dec 2023 06:04:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1702476288; x=1703081088; 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=rMuvyEAQf/UsTPnIKeSzHClhFGjiVsmTL732aETTNeFNrcDiJZnla+7Ec5rSpVNvGB fLj18cm8NZcjCEcVTUQ84dki8MeittW2StdKW6dOqOOrw+vbLrTQLQsAftFFAhkDTu0s OXhTnzPjNr0uE/nJe5gZv8ovacykUUh3mi844= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702476288; x=1703081088; 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=Enxdles8v6/8huSYzA3J9DMQHf4wEZmLa77triA22KCO4tMCP81OjKEbwmpusFHjVf EaWRN9d5CLtLhRiKTQ+oqLXmE3HrLvxZxXcLEpv02BIeDtJ+fhmwmdRJ1syqFJ1uZXSv Hel8cwtzIHtbqlP4TDAo+QqySRS2ITCBhlExKaHdxITbumJWDS+VGzdWB5Kh6Azq+OdF UcVpI8t3dsUp0ZeXRScUczIJ+tfcb34QqmuPVYq0x5OPkExJQtpYTx9/gl6kmixF0Ebj zFfNO7iPjmr3ilrr+VdkXNy45F9MzbCciINBPra4TMi5yZcl/mS0d1IeiCgRBB56E2b9 rkwQ== X-Gm-Message-State: AOJu0YxEcKXA4e7DYERh/eY9rbnimlPREnHjPxyhVuYQStlpuhSHDwMT oP6VQXYL75Lc8y9uJ8lCKrD0RE/U2rSJgCkv+d66HQ== X-Received: by 2002:a17:906:c141:b0:a18:abad:195a with SMTP id dp1-20020a170906c14100b00a18abad195amr3293903ejc.47.1702476288274; Wed, 13 Dec 2023 06:04:48 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-80-182-13-188.pool80182.interbusiness.it. [80.182.13.188]) by smtp.gmail.com with ESMTPSA id sf22-20020a1709078a9600b00a1ca020cdfasm7797635ejc.161.2023.12.13.06.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 06:04:47 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: michael@amarulasolutions.com, Amarula patchwork , 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 v6 1/4] drm: bridge: samsung-dsim: enter display mode in the enable() callback Date: Wed, 13 Dec 2023 15:03:42 +0100 Message-ID: <20231213140437.2769508-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213140437.2769508-1-dario.binacchi@amarulasolutions.com> References: <20231213140437.2769508-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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 13 Dec 2023 06:05:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785175850572478297 X-GMAIL-MSGID: 1785175850572478297 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);