From patchwork Fri Nov 12 06:17:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1758 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A85253F07B for ; Fri, 12 Nov 2021 07:17:59 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id 76-20020a63054f000000b002c9284978aasf4467996pgf.10 for ; Thu, 11 Nov 2021 22:17:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636697877; cv=pass; d=google.com; s=arc-20160816; b=T4Y/1MLu7JZZSOtM5bE8fyO1sxkQz2EbZLUc2VXDTrIo48AUWSw9Wq3SPQVHLgAkdC +2QZg2CpiV9CgXVUFQxjIrM75WJHW4nPJzTIwE0CnnIlezW6FmrcM/vok7OCedhgTfAZ +2qnxdvb5dHXS6ySw/pbAxlhIX8pBNUfoEXXr5ZPP8Xirflm2wcPtDLd+SwuX9gb4cwo VJ4J06ZZZhRWglouRzN3aMbW8c/N0Ir2nIXNwsQ84EmC7BgsFhlj+md7i2GyNQvH0XZT y+X3FpMoTXOoWMmNMOjLTmqcOSvGPnwEtnNKGJSCrl8jMIEinghoLIqlMJvrmS+osihn KFAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=yOOni4c5hAcaj3b9E5l2ER4V6I4khOFV8WtBakD01iE=; b=twUvMzwedI11uRLULJtz2ofC7emohKSnrssOoF73o4QUL5k5BYNZ2QRmSEg1uUDiUH 9zPKn+gCeIm9N1KfLx37YHHreK6D5gpTH4/ZPaLiQrfqcbBicMMaWrW+xQwoyGjnChsE kPWUTTlSPNmgIb3b2aSMWSZGqwaz86Dhp8ApVFR7ZS3H7W6hMivWqDFL1v2eglZyCmv2 8K1VZVGLb0mOxoFgUt2BYiaPAZ3HmoOq4+UluUA+HinuGXKh2kP/t7RMWWzPf+yaJVQM sSY5Ze1e83m0JWwOhokPSWfOOrRN1/RTM2dL/S8ZUwWyHtlM4A/6SZszvGXFS9O2oLIv 4wAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XBsjNUuy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=yOOni4c5hAcaj3b9E5l2ER4V6I4khOFV8WtBakD01iE=; b=OOlb30KyfsRPVVtmhkSzH3ZcIVc5jpsgAPfSYaVfxKMEVZ/bAQphC2l1ZAx7tv2xV/ RxS1nlgbSUsMGK2zlrh1eFtntGgaC0SX1cd0r9HByVr1eWZcme9D3Ts/TAUOAbuJ1IaX N66gnSP4sNxrIp3JmIpXpED4/GxG0sASB1S60= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=yOOni4c5hAcaj3b9E5l2ER4V6I4khOFV8WtBakD01iE=; b=wciAu83Y2Sm270xMDe6KdvOllsbY3SIvoJKcCdAgS7pujh4pu2/8qvkolN0YivV/M8 itvkqe8+F3QXUmhPPMeAt6jMmV4D9K3x9QJ1fnPZn3hSAgXVuUYt+yO+Z6A3A+em3Kb7 JM/yl6zCMgZzyatl0rHl/cwGJPuiRYRcYdqWp23DuEvxCfVdOO3nzRXuLKBm83XLnaAv eoSGSPrTv3BSKVJvpJ+hq21dulAiRG2p515GNM6+ByBk3YHpqxOL7cNjUmmnBUcxG/Kr WsTdNdvYcy1ej5c9LSz+QZNX95Z87Gc0sotu/vnLmz1UpGAfNNI8higOOXIfvoRxDQ3/ aT2w== X-Gm-Message-State: AOAM530uR9fr0e3D6aUSheHa62tJnp9mLGhaHBwVXCRWh91uJZGhvwu0 awnUHhuGYtPGbj0ig1iq/9sTJ8rm X-Google-Smtp-Source: ABdhPJyEozgvA9WQGeNiv9K5as46gj6+oDCNXYtNpMVKA7f5KhzaMP/waSwM8GjYqjcqtehcsassOg== X-Received: by 2002:a17:902:860b:b0:143:87bf:648f with SMTP id f11-20020a170902860b00b0014387bf648fmr5453872plo.11.1636697877448; Thu, 11 Nov 2021 22:17:57 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:24cc:: with SMTP id d12ls2170485pfv.1.gmail; Thu, 11 Nov 2021 22:17:57 -0800 (PST) X-Received: by 2002:a63:ea4e:: with SMTP id l14mr8473708pgk.406.1636697876655; Thu, 11 Nov 2021 22:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636697876; cv=none; d=google.com; s=arc-20160816; b=dSDKmf7sP3TraYLr7PXV4fXAUEZjjTvuhpuytv8vRJOMNEK7TJ/9q0+RWwvLNGr63x C5J7ZYyQN8J6Wel+XjaAiGzkmpexDRbWKXyb3WzCBA+bcNMWgRYGLzhVunnWq2UOxdv7 83D0SFg9nNXCQLO49uwyS8+uGMFbA7rBUu4i0g3RJFEL8FsVothtM3riTBqNAvICmLm+ RW+MLpkZvzc49imHImzFeji5g1CLz3ctN85J7MH/9IWhq4vpaWp9lgAZ14MeR5YRKtt0 2dber5q3B7q9pZcNJkls1R8z5wvGtnQ1/XmwVfMQjG/HdLGOkk0RIaB62SBjpDcTkqnf Th8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=Wad9gm8CW+7Vaw+M+Mr+ioYMu34NOVqzp5WCaNgwVbY=; b=iUgmurUMxpFI/yarnuDYoNcA21U9eZEbRwQuF9NHj4DSAPCLVQSrhHir0t0ANhLEAM 3lAhi5gwIXqOqRf8vWr5G+n22CUOWe5tX5Zn43CTk289bdS7RnSUQKzE2eMn5m/U6Rtq 4I3fo755cqmjTbmhDFS7SJ0/8Zw2RXrnv6oFnf2IKEjY1u6K35b/IX6NlkJZT+lCWxLg uD/D7aOVxcg5VTLrbzhMnNKSvtgUU46BykRKGshnHA2iwYO9zH1nLg5pJlBe9IxsZvkq jFNm/DFNFoGbdlwj3/Cc+X7uP7W3BuHvaPbngS2pVrmFhq+bVVPHeRBh+1s2xCHnVNaD h3iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XBsjNUuy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id y36sor2767487pfa.101.2021.11.11.22.17.55 for (Google Transport Security); Thu, 11 Nov 2021 22:17:55 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a00:158a:b0:49f:be86:c78f with SMTP id u10-20020a056a00158a00b0049fbe86c78fmr12004616pfk.56.1636697875509; Thu, 11 Nov 2021 22:17:55 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:de19:8cdf:97cf:a6b1]) by smtp.gmail.com with ESMTPSA id p3sm4727856pfb.205.2021.11.11.22.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 22:17:55 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Sam Ravnborg , Heiko Stubner , Yannick Fertre Cc: dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH] drm/bridge: dw-mipi-dsi: Switch to atomic operations Date: Fri, 12 Nov 2021 11:47:41 +0530 Message-Id: <20211112061741.120898-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XBsjNUuy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Replace atomic version of the enable/disable operations to continue the transition to the atomic API. Also added default drm atomic operations for duplicate, destroy and reset state API's in order to have smooth transition on atomic API's. Tested on Engicam i.Core STM32MP1 SoM. Signed-off-by: Jagan Teki Reviewed-by: Robert Foss --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index e44e18a0112a..ff0db96dfcd5 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -871,7 +871,8 @@ static void dw_mipi_dsi_clear_err(struct dw_mipi_dsi *dsi) dsi_write(dsi, DSI_INT_MSK1, 0); } -static void dw_mipi_dsi_bridge_post_disable(struct drm_bridge *bridge) +static void dw_mipi_dsi_bridge_post_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); const struct dw_mipi_dsi_phy_ops *phy_ops = dsi->plat_data->phy_ops; @@ -978,7 +979,8 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge, dw_mipi_dsi_mode_set(dsi->slave, adjusted_mode); } -static void dw_mipi_dsi_bridge_enable(struct drm_bridge *bridge) +static void dw_mipi_dsi_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); @@ -1032,11 +1034,14 @@ static int dw_mipi_dsi_bridge_attach(struct drm_bridge *bridge, } static const struct drm_bridge_funcs dw_mipi_dsi_bridge_funcs = { - .mode_set = dw_mipi_dsi_bridge_mode_set, - .enable = dw_mipi_dsi_bridge_enable, - .post_disable = dw_mipi_dsi_bridge_post_disable, - .mode_valid = dw_mipi_dsi_bridge_mode_valid, - .attach = dw_mipi_dsi_bridge_attach, + .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, + .atomic_enable = dw_mipi_dsi_bridge_atomic_enable, + .atomic_post_disable = dw_mipi_dsi_bridge_post_atomic_disable, + .mode_set = dw_mipi_dsi_bridge_mode_set, + .mode_valid = dw_mipi_dsi_bridge_mode_valid, + .attach = dw_mipi_dsi_bridge_attach, }; #ifdef CONFIG_DEBUG_FS