Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1130190lqo; Sat, 11 May 2024 08:33:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUoKJ9m6ITRpUyde42qVveB24eIhzznLJIbpHHiaWH6Yw41Cx/Q2MCsH1Bw/PncNDhsv5KuLLKXtuiBPMEtstIBjncEuqwxh5fUnKcxXw== X-Google-Smtp-Source: AGHT+IGo7WUkxTjR/eRx4AwcdkOXZTMrEvQOcT0IoUeB9WGcnbuc19XEZuMrQWKJSi1Y+mnZCzy2 X-Received: by 2002:a05:6358:c015:b0:17e:2943:c75e with SMTP id e5c5f4694b2df-193bb5197b7mr545252555d.12.1715441597697; Sat, 11 May 2024 08:33:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715441597; cv=pass; d=google.com; s=arc-20160816; b=VlupZyUU044QNQbYipV9/lX3jVBgjK1XWEWyr4oQ9CvrnHOkoSKbp6c0261xTWJE6k 579SZDRewssrkMXPOp/+IXLlXpUT0hLW/K6QTe80YQDRZ9KKyTYNavk5E5FDzlKouF7i medBPWsSwiHFWR6w1YRb0v6tbMPNP9zNBDInsCKE7aDWGL8jVqgn0Z6GC5jeAtwzp6l8 5MBkjPf3XnhKnpVlLJpiMxcLCqF4GO3skkX6GrjNH6J8PBWEEigpny72/ZMs6rw2gQwh 9D1LNB2MzSd2pFSoQ4eRdX14/9Kkv5WyBMec6sIcNRYOjjXLTYMRfqFTa2g1k34X3dmM znjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ozwCR1H0ki9FJHXenTL7Gc8Qqb4D9tSdsATJFtrjixA=; fh=S9bpg2GSVUyHrOpz7OrTZKhBuXBWSWpC7FsdxUCOuBM=; b=a3I7gEY7rH/KFMnAcDvDXTBxFAQeHyOtCgHDU3xTXSpyRGSDJ5+P9QhX3vlEPBKhzu SRznzR3kjHLJnW/G3KDrCMdD3iuCWvVqNn6N61UlIECkidPqb0shssvjTaDxbrrfA+pt BMCiOR1NJr0moGNM/bjCOlmDmPB5vCwL6wFtI8kcgmzuWIqt5GVG2BwH+GKmmAd31SIG yy7e3JCiSzUkGwjlniFojRay2s3fisLENkozHhTcwjYOpA9BHQMlWRKGnoJf6SYQN1gC d+9r7pmf9DmokFT9uEJiAhd/qjqWk5/WPMYdBZWwLtDEeFnRC44FDEf/83OWVUAmGJTD IhbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SFhIkyUX; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-176611-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176611-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e82365si5757883a12.69.2024.05.11.08.33.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 08:33:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176611-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SFhIkyUX; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-176611-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176611-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4868A281FD1 for ; Sat, 11 May 2024 15:33:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 497D760882; Sat, 11 May 2024 15:31:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="SFhIkyUX" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA9F25DF3B for ; Sat, 11 May 2024 15:31:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715441503; cv=none; b=ESXi+jYwyRxe8gSTOGMz34AsQyNRSNg0H2h+WKYISjzu9OLQ2/8z7CRfgoVtZd3e89k7uD8B1R2tj60bTvfUvz38X4fl23+ECIb+Rny6QTxjlfRYAn3GBxxETTX+SPiIGhluzM/oR5gef2SKZ/JjiCQxUhkvowzgcEH1SjxUO+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715441503; c=relaxed/simple; bh=96Hp2q/0BSx+KHl1JFWPaenmct9ycFeBzIlOSeKGr+E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=k09Ji5/86l39Hl1J7vw1ARy84QXfrP0RjrjYAn8t22oehcypGPCDxhcNbg9Aku7uKUyjEdKxAxSL4M7w57Sp6vMJ7RYlR1zn3uElWAh8R4lNbQaxyqhDIBknVRgEHY78WrQwsFwMjHfmCPNgmROFbLmPkc/3z2+yM/QRogr1gsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=SFhIkyUX; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44BFV45V005155; Sat, 11 May 2024 10:31:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1715441464; bh=ozwCR1H0ki9FJHXenTL7Gc8Qqb4D9tSdsATJFtrjixA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=SFhIkyUXWcq5UhPlZoExQnxXigK2/1A3Meuo3tVq+MSLExleEzlPBGc+56Gd/3PMs eFZ44OHdP7aYWqLsYx89us+zdIQNZCKnIWqTmu/TKlAFpnEKKGgJ9URSjP3QLQwP/4 7Ahl+UVdAMBkoHGgYAbkg71aFrOgT7of6qL/vPyA= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44BFV34U098599 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 11 May 2024 10:31:04 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Sat, 11 May 2024 10:31:03 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Sat, 11 May 2024 10:31:03 -0500 Received: from localhost (uda0496377.dhcp.ti.com [172.24.227.31]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44BFV2Ph043490; Sat, 11 May 2024 10:31:02 -0500 From: Aradhya Bhatia To: Tomi Valkeinen , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Jyri Sarha , Thomas Zimmermann , David Airlie , Daniel Vetter CC: DRI Development List , Linux Kernel List , Sam Ravnborg , Thierry Reding , Kieran Bingham , Boris Brezillon , Nishanth Menon , Vignesh Raghavendra , Praneeth Bajjuri , Udit Kumar , Devarsh Thakkar , Jayesh Choudhary , Jai Luthra , Aradhya Bhatia Subject: [PATCH 7/7] drm/bridge: cdns-dsi: Implement early_enable and late_disable Date: Sat, 11 May 2024 21:00:51 +0530 Message-ID: <20240511153051.1355825-8-a-bhatia1@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240511153051.1355825-1-a-bhatia1@ti.com> References: <20240511153051.1355825-1-a-bhatia1@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 The cdsn-dsi controller requires that it be turned on completely before the input DPI's source has begun streaming. Since tidss's videoport starts streaming via crtc enable hooks, we need cdns-dsi to be up and running before that. Hence, use the early_enable and late_disable hooks to get pass the color issues. Signed-off-by: Aradhya Bhatia --- .../gpu/drm/bridge/cadence/cdns-dsi-core.c | 36 ++++--------------- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index c7519d18e94f..53fa20720089 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -656,8 +656,8 @@ cdns_dsi_bridge_mode_valid(struct drm_bridge *bridge, return MODE_OK; } -static void cdns_dsi_bridge_atomic_disable(struct drm_bridge *bridge, - struct drm_bridge_state *old_bridge_state) +static void cdns_dsi_bridge_atomic_late_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct cdns_dsi_input *input = bridge_to_cdns_dsi_input(bridge); struct cdns_dsi *dsi = input_to_dsi(input); @@ -677,15 +677,6 @@ static void cdns_dsi_bridge_atomic_disable(struct drm_bridge *bridge, pm_runtime_put(dsi->base.dev); } -static void cdns_dsi_bridge_post_disable(struct drm_bridge *bridge, - struct drm_bridge_state *old_bridge_state) -{ - struct cdns_dsi_input *input = bridge_to_cdns_dsi_input(bridge); - struct cdns_dsi *dsi = input_to_dsi(input); - - pm_runtime_put(dsi->base.dev); -} - static void cdns_dsi_hs_init(struct cdns_dsi *dsi) { struct cdns_dsi_output *output = &dsi->output; @@ -755,8 +746,8 @@ static void cdns_dsi_init_link(struct cdns_dsi *dsi) dsi->link_initialized = true; } -static void cdns_dsi_bridge_atomic_enable(struct drm_bridge *bridge, - struct drm_bridge_state *old_bridge_state) +static void cdns_dsi_bridge_atomic_early_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct cdns_dsi_input *input = bridge_to_cdns_dsi_input(bridge); struct cdns_dsi *dsi = input_to_dsi(input); @@ -907,19 +898,6 @@ static void cdns_dsi_bridge_atomic_enable(struct drm_bridge *bridge, writel(tmp, dsi->regs + MCTL_MAIN_EN); } -static void cdns_dsi_bridge_pre_enable(struct drm_bridge *bridge, - struct drm_bridge_state *old_bridge_state) -{ - struct cdns_dsi_input *input = bridge_to_cdns_dsi_input(bridge); - struct cdns_dsi *dsi = input_to_dsi(input); - - if (WARN_ON(pm_runtime_get_sync(dsi->base.dev) < 0)) - return; - - cdns_dsi_init_link(dsi); - cdns_dsi_hs_init(dsi); -} - static u32 *cdns_dsi_bridge_get_input_bus_fmts(struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, @@ -968,10 +946,8 @@ static u32 *cdns_dsi_bridge_get_input_bus_fmts(struct drm_bridge *bridge, static const struct drm_bridge_funcs cdns_dsi_bridge_funcs = { .attach = cdns_dsi_bridge_attach, .mode_valid = cdns_dsi_bridge_mode_valid, - .atomic_disable = cdns_dsi_bridge_atomic_disable, - .atomic_pre_enable = cdns_dsi_bridge_atomic_pre_enable, - .atomic_enable = cdns_dsi_bridge_atomic_enable, - .atomic_post_disable = cdns_dsi_bridge_atomic_post_disable, + .atomic_early_enable = cdns_dsi_bridge_atomic_early_enable, + .atomic_late_disable = cdns_dsi_bridge_atomic_late_disable, .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, -- 2.34.1