Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5837474rdb; Thu, 14 Dec 2023 00:26:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeU5cHSCdGkUtyr/S1eTOap6Z+KfrXVa1VW+mvkF5ELQFhjIfzh2BP+sMnQ1Uq0i59h7Zh X-Received: by 2002:a17:90b:30d5:b0:28a:c38a:5bcb with SMTP id hi21-20020a17090b30d500b0028ac38a5bcbmr3119872pjb.32.1702542380674; Thu, 14 Dec 2023 00:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702542380; cv=none; d=google.com; s=arc-20160816; b=tuC9wo4MgS1jl/r9EexWhO8RZgGq7gWCMn+2AELyPcAVX/7q+rh66gnRYJQdawNI6T dyOYOLBrxALEvqlFxx0pNO07QCMtwaBimqMD9jCIocRL9WtTShRneD2dTwbxFXjSgI3s kMK/yAiMwXt48d0ERShVmvgwkZiutBfu6JUIbV3LbyThdxMQeMP9hdMc2BNmU3nh4zWU rkweEHg4ulZmUoiZWk8EEKkgDlXr3F3iYcPIlwx3gwAmV6mUjiQQT1lbU62LJP22fs5m iini9WSF0Nv2l9szJAABR6KbGUie5eE0rijKdT8KFnVUmiXs5PH5ySo/FFt8g9fJGhZi gJyg== 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=c66OqvZ0+5159f/lITcx9r1nYjdgbLaAWj5lrqPGCdvN8u5G5NqNo45Ee0somMLyKj ONffXjJB3OuGaidxpPxTtuYTEDUtO+qcDZjmCJ7LFtl7IdF3HXTOVltviVkvcPoWwPN5 fKtyEW1jM5qhLHCHFWS5AN7vBShFE65GMK8gHOxQ9JRqsL7kD6js3NkbLk4zNJoNhsGP R4Yyq+JfDyqisb1ygsLr2MAcOm8W0IP3a+3ZLKjYg65xAfGl+DQXFikvHSBQgyZeXrJY RyN5jTqCPVWGwJeNZbX21omsravC0yu/No0fzqBaqZqtrPJxFM604NN1W4JhYW7D2fg9 1jfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MJ+SQkjp; 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 Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id pf6-20020a17090b1d8600b0028881bb2b5bsi12436199pjb.188.2023.12.14.00.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 00:26:20 -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=MJ+SQkjp; 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 BD3138080C5F; Thu, 14 Dec 2023 00:25:37 -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 S234396AbjLNIZK (ORCPT + 99 others); Thu, 14 Dec 2023 03:25:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbjLNIZI (ORCPT ); Thu, 14 Dec 2023 03:25:08 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3239E3 for ; Thu, 14 Dec 2023 00:25:14 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a1e2ded3d9fso940816366b.0 for ; Thu, 14 Dec 2023 00:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1702542313; x=1703147113; 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=MJ+SQkjpyCcUp8ubIT0KamxoE0vYGvzOSne6fk6aWzrH9NB7+9QoFImYcGVSIzJ1n1 13PIhmTE9r5/J94t/VDy2S6tEtSg5OavuO3ilcG3ZFcZyuhAvULycAUoI7jgLPwPXNuJ PU2GWwzicfTZqa8MA2nirR6PXwL68rwW0z+s0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702542313; x=1703147113; 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=P5oHt4j+N0hdaFcXS89E8IHjRWKCvKCkP2UN5yv/KM6EmtFnDbBB3e9otQqAwLz51G wHHC3smKW7sLA9XBe/aglcU0GwQDi2qFQG/jTKAjlclrYQOzTVgw4bw9fP/Av2eZR0Qv R1aPetO06NvhzcPAp45TDqe7AR4dg0FGB/4i8Y2enrjyW7eZku1rgdcNUGPWRkFemmo5 dy+e5ZnFI8n0boog42+wVDeiKM+5uJkcDwBPszYiBHASJB0HtYxP29ADvLn/cCbS4xNY UJXrjyw5OMMyTJg8zFR8+2f9qHXcJbV1/xccIcVol2BDZBAvArfBlUBRCFXDfnJJ7h+B bvSg== X-Gm-Message-State: AOJu0YzIUh4E/O9X8EzNrOOjKVgBNgQYtXO9eUWNBJ0sDJ2hMYZ1a8RA PLtu4z3UHM8ZGtks51CtE9vm1PozcmKzZ2UlahOhWQ== X-Received: by 2002:a17:907:94c9:b0:a18:4cf3:c8d0 with SMTP id dn9-20020a17090794c900b00a184cf3c8d0mr5637071ejc.49.1702542313003; Thu, 14 Dec 2023 00:25:13 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-80-182-13-188.retail.telecomitalia.it. [80.182.13.188]) by smtp.gmail.com with ESMTPSA id hw18-20020a170907a0d200b00a1cbe52300csm9026226ejc.56.2023.12.14.00.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 00:25:12 -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 v8 1/3] drm: bridge: samsung-dsim: enter display mode in the enable() callback Date: Thu, 14 Dec 2023 09:24:04 +0100 Message-ID: <20231214082457.18737-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231214082457.18737-1-dario.binacchi@amarulasolutions.com> References: <20231214082457.18737-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 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, 14 Dec 2023 00:25:37 -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