Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5336224rdb; Wed, 13 Dec 2023 06:06:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHN/vTPLy3rPIEhU4BysrEGFmnM7DK/gjjQfXiLACPCv7EJIOyfuZ4lD511TjaOTNkqrG0M X-Received: by 2002:a05:6a00:a23:b0:6d0:99da:3d32 with SMTP id p35-20020a056a000a2300b006d099da3d32mr5520868pfh.41.1702476364875; Wed, 13 Dec 2023 06:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702476364; cv=none; d=google.com; s=arc-20160816; b=qOEmNuUBdxIDlRwyK+UENNPFmHWhdn2Xegdr77EfE+krR49aYRScro6oXc5F+BIzXT Z6juUgtaPGpvRZUkG6NR0SV4alACoc4JOYeJPPPs6tj5dz7yFANWyNCTwSl3c/isQAuF fTVYwyLCSagpNmrDH67uXV9BnMblZ4CR+CgmZwrQAssO2xhdhht3C12XtBIdHRnVc7eg vmfoSi2itQzPkwKhhGuFAXnpVx5OZTwtRPh+tauESgEqR6PnzQl83u1J3zMQdtrRNMAy n7DAzFbEsULEp6Jjl3K+3+jGYztr/aOUQ8m52SuHgB6YKzesvTZkwJx9zNyZ0jwC7opl 9EFw== 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 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id q17-20020a056a0002b100b006ce0a508f30si9338052pfs.83.2023.12.13.06.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 06:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; 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 23.128.96.36 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 9BE74809A83F; Wed, 13 Dec 2023 06:05:36 -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 Content-Transfer-Encoding: 8bit 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:36 -0800 (PST) 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); -- 2.43.0