From patchwork Wed May 4 11:40:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1937 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2C1A43F110 for ; Wed, 4 May 2022 13:41:42 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id t70-20020a638149000000b0039daafb0a84sf623818pgd.7 for ; Wed, 04 May 2022 04:41:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651664501; cv=pass; d=google.com; s=arc-20160816; b=F6yMeQ7seos1tSnoQGrGSsqUgcouK69XVSbOqegySZCj4/CWmJfbR+IthSsOQNqEfL mfhaH0Dxu6pzjLX9quGn5MpdmEmh51Z7OoGGfivo1ijZcfFu8uE85rhTyvPAvH97sRyt Q96ClExiWOdMQeU9LpecvW9i0DKsFHa7mFYy6bjo0hC5BtlotqIBs2M+oNqKtS/OvQf4 xvbfaEsMaPoFO1W/B85bkaLWxEdIQzXC8+AEVSmT5xJ5NqSiOaBuiQuob8y8nHbQAG6k upwGeQ1MLk0U+jKhvaSFLLJOYCIHJrq9C62XacAchrz9UQu6CKbevUxGo5eIodEqvgfE eB1w== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=iQ2PDtOsb3inViysi1lgrp1ZIwbo1Uq0Cnczz8MWgqQ=; b=HTTRYbyFDRkVFynN9qZsJQtOgjBgh56Sotx7QJddAiZWHAfY5nq3NyBFlSmZt9L034 OatMO2aeGCWYeN2WlL4+QrL+HLjegu3dHYjjcae7W6hjx6MsO1KayrTIBQStEa7QNizl V10vJVeHkkr7L3S6QDaMsaD3i1vPSgtvnPS82cDxOIKDl/I4aeAIAtkBeBGN1/EjSos7 JRXk6uZyyN+WHbM4RuQR1A8NMreT3FjBeu93enuy99J5RqtprLpa4xb8doFx/XiGYGs1 YC6TEGaR6TLZxD4h5n36v29YvQ84hYdNyBsRcve+XndqOCLQq5g4WdrGPR60HfSSogWs wOHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=W23KQ0We; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=iQ2PDtOsb3inViysi1lgrp1ZIwbo1Uq0Cnczz8MWgqQ=; b=q4GR/tg3X3mSprw1nCKWT0CyXpY8o9v9beODaKVB2BieJzG/IO+eBFpjRM7/uPFLeW shIuFqrdGBnDg2gi/dJG4guDcmjuCq14l3LZrfjt0x5IDTFG1fykWtyJCYof2zGUWS4H 8rX2lL2Toi0NPDtRV/mC1BWZ55U/fB4X3x6KI= 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:in-reply-to :references: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=iQ2PDtOsb3inViysi1lgrp1ZIwbo1Uq0Cnczz8MWgqQ=; b=Edl7S9w+ilkeLm8t+PIMfwIYFLQE9pyhdEl3Nc8Yzgh509exqZR6bVBiXl7ZtKIdBT OCXputDTGcB0qqQl0E8lCb1BHi7aeAnXA8tNvI6ltX4FSiPDSTFVvxtDxxPTAhcKhP3D QnEEs3sA3GoX0mA9L+IXKVDwEdrGayGyWAtKHgrhwiN/tVDGJoyo6iQYwH8s9Rl1X50U 08UsbMx8BvOJlA/gNkTElGvnnLuCvxKhTQBJP+irC69A+FY0n1dgde9Ra1+J4N9hMjYK tDI6sjVs1hJq56dInSGdYBw5aDIlBudxYXceKsQPIklhoIduoSYSqXIk0yFMUM54ClLM njjg== X-Gm-Message-State: AOAM530Ve20QFb2DrfCkf/VnJzLkxzUDOZ93bGhHKsSGGml+IqZwvqep 2ApTez2dN1qQA3nhyBhewRPJgB4Y X-Google-Smtp-Source: ABdhPJx+wexOT0/xU+sIX25KlwAtoDbNcM8DBN/pULhwXfrfltHwHzqIeR2o/SSPt/ePbvKrWy4m3g== X-Received: by 2002:a63:6bc4:0:b0:3c1:e5d5:61d7 with SMTP id g187-20020a636bc4000000b003c1e5d561d7mr14835469pgc.418.1651664501026; Wed, 04 May 2022 04:41:41 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:179d:b0:505:9501:adc5 with SMTP id s29-20020a056a00179d00b005059501adc5ls777465pfg.2.gmail; Wed, 04 May 2022 04:41:40 -0700 (PDT) X-Received: by 2002:a05:6a00:a1e:b0:50d:bb0c:2e27 with SMTP id p30-20020a056a000a1e00b0050dbb0c2e27mr20269658pfh.49.1651664500331; Wed, 04 May 2022 04:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651664500; cv=none; d=google.com; s=arc-20160816; b=TOgrSyDqnJyhbC251ge4x7bGkQgq9ROBL0Tk3YNSSa63SUAxR2vNf16h+l7ZUmTUXT IGzluqHfyYJkUwyWOOL+9e5d3j6omS9NXfazj9NbqgH6UVD/YUXlDn6G3svGC6qrnnJr bOtvk1y9vV6kdLU0Vla1nznBOv2NoioK/ksrtR2L7hoV19EAIcbZ2Z4C8TFiSHeWuXb1 w5jz2wRWccALwosyT6RSrX+NTXMHpTbDo4B/EEnyz5ljwAOWReCjf/YH1hS+GPc8hGOj sSY3xqJNBWEc9BTf/0DvRw68kj7ylt7dGkjd2O/Dmtq85FeX7p0bNhofqZDMbnwiMz2u b49Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=TNPlXaEmj37H/XyiSN7nG521CkkUGoBXiE5YF2Z5qG0=; b=HvuiO2eJOdLeHxzNZozPZyG6loFnO394pIfN+3ARzRlcMFs4atv4HFAE85P/DDCR8V Ajk2oqnqURgagk+vvB5KuZUF+kda/N+aelhC6lEqb0nsZD1S5nKni4T1lCI4vXBqFOgD Ev2xaDyOo2R8f17NsyPPiFkQsCWAL/CziCoSyuN6cFXqcr5HPmUqbjBcElCkc3WhB5/y A1VcyxpR4WCqovo+MZejdc0RWpJuhz3giTjNFMmS4xNZGiqkwuxy8AHEs8WhMewi3EgS Rp69w7DG5Qp8bTWs49H9UqhkjobBGGJqMrfBJK4K5DevzVRrDQzGV8zVD4NzKU2AKFfe rKdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=W23KQ0We; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 r84-20020a632b57000000b003a1c17ee06csor9731876pgr.80.2022.05.04.04.41.40 for (Google Transport Security); Wed, 04 May 2022 04:41:40 -0700 (PDT) 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:a63:8a43:0:b0:3c2:2b52:848a with SMTP id y64-20020a638a43000000b003c22b52848amr11078595pgd.1.1651664499987; Wed, 04 May 2022 04:41:39 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41:39 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v2 08/12] drm: bridge: samsung-dsim: Add atomic_check Date: Wed, 4 May 2022 17:10:17 +0530 Message-Id: <20220504114021.33265-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> 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=W23KQ0We; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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: , Fixing up the mode flags is required in order to correlate the correct sync flags of the surrounding components in the chain to make sure the whole pipeline can work properly. So, handle the mode flags via bridge, atomic_check. v2: * none v1: * fix mode flags in atomic_check instead of mode_fixup Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index b618e52d0ee3..bd78cef890e4 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1340,6 +1340,19 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +static int samsung_dsim_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; + + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + + return 0; +} + static void samsung_dsim_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) @@ -1361,6 +1374,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = { .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_check = samsung_dsim_atomic_check, .atomic_pre_enable = samsung_dsim_atomic_pre_enable, .atomic_enable = samsung_dsim_atomic_enable, .atomic_disable = samsung_dsim_atomic_disable,