From patchwork Fri Apr 8 16:21:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1908 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A827F3F0D5 for ; Fri, 8 Apr 2022 18:23:07 +0200 (CEST) Received: by mail-pj1-f69.google.com with SMTP id g14-20020a17090a4b0e00b001cb1363ae99sf3205864pjh.1 for ; Fri, 08 Apr 2022 09:23:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649434986; cv=pass; d=google.com; s=arc-20160816; b=uO4U3t8I1NQvV115M0hP8FqszJfopUrdvQePmlYpAbWi4Doc37cH+vHDIZT8u4zK03 AV6TGUhOE9sB+RjmT0xiWvyvM85hgNqW6Y+XpQtAkj6b5a5KqwbEPIRDdcMY/umzVHfs b4VgwboI6FYcz8Q8oKj1VB3LstQ7DUVNIzdS9+21wBfk7fkfq9FgObsTiHkUhlXVRKvS QM0RDwM4JgQ6jfKxWM1LxNw7gCKgFam1oeFbWDsyYPnEhsjEH3dXsAg/64C4dU0mIos4 6beEGpOe5ypxEQR2QZVqOQrlLm24fZXq08WdeVaKIF60KdJqGeqk3kFQGd1PnyslTMsF 6fPw== 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=QAbt8PW5BOLmpQgmOZThfWs/fdW4LdwPtPaK3dlPBDU=; b=ibZgXeDU5gWMp6DtZwjMQ3YTp9QSYh9QIjv/uaLTJH0zeSJtCi5oFFkJfF0q3LeC3/ jMuKez394GI4k1SoV9XS4JfwmtASX/MDANZhKC6N/OyVlq3/OeOrsyThmL/xAZdQ1Hw4 iEOc/5GDGRAsTJ09RAqApQAP2a2Bpz+Vkn5FWisDsrOrAxeHVWE2wPdUrEG1jX/rowh/ 5fqzE23fd35HhZDVmfSRkkr3rmDBnSCRqSFefDj57zzVPSs4Lg5uucvbwpl0rvQMkH24 XODq6SZLXQe5nZFxBVWHPF6yNiGuxZhAp/OqYpSRwpcRT+/Qh7rGBkkPRiUfqfN+D4WJ 0sZg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rDDE8uCI; 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=QAbt8PW5BOLmpQgmOZThfWs/fdW4LdwPtPaK3dlPBDU=; b=PJGJFJQ4LtMQucT2il1kev7ftgP/RF/3BWcoUju62H1AjTrVLdSkE9kqI0VOIAewjf aalt0gyIOtpTJoXPlSzndjeuEqj3lS2NH+IkONTostLxtr0zbBiPZHa4KbXkjcfPQ7ty JdBfkeSktpd0liHUohI754ZPdkvtVw7WKHevs= 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=QAbt8PW5BOLmpQgmOZThfWs/fdW4LdwPtPaK3dlPBDU=; b=wyGa4PK1/z+aDTWZLBG9uL4hF1gzguMNV0wTt9j6ZMyGNy9vrMAe/rm3lWceURR0d2 /GuYlbkqff8jEj59eOzJ6gEAWCCmPiqaBF0m1mUmeZokDcJt181ebwAHsETmInPIgt9b 5VHpN3hAWrAOxNhiGlsT1VtmaIP/ty+/6w0mW19O4/H5m5dr2SOTKoOD8xlUwnhoYCIH wl7jqqQ29xUTi7x/CtLNR53eRlvmgkfTf/Cf3Hx9cg7ntyJRcwc7h3NBAArQGRDUnwOW ODqD/HWJDep42HjCyR8pt6md+WLqj3GnpeT2ig/KhfBn+OZlyL5yGAV3KNRzl5oan1dj 4ZUw== X-Gm-Message-State: AOAM531ElTs+CbBbuCcUB4/Jw9aEruapFfaK6/XU+bW5julgNKHL1gpg /W2N30TprzGwjkpMatDyxCtfpsF/ X-Google-Smtp-Source: ABdhPJw4184GXfD+n4XV2yshC7WfwLaqYe3GNrrg+E4ldB1EfxNO3cJtoEtDzsY3maMd3Xq4/pbaxw== X-Received: by 2002:a17:902:ce02:b0:153:bd65:5c0e with SMTP id k2-20020a170902ce0200b00153bd655c0emr19842514plg.160.1649434986489; Fri, 08 Apr 2022 09:23:06 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:1b64:b0:1ca:ab17:e0fc with SMTP id q91-20020a17090a1b6400b001caab17e0fcls2079439pjq.1.gmail; Fri, 08 Apr 2022 09:23:06 -0700 (PDT) X-Received: by 2002:a17:90b:4ad2:b0:1c7:cee:b126 with SMTP id mh18-20020a17090b4ad200b001c70ceeb126mr22399460pjb.219.1649434985701; Fri, 08 Apr 2022 09:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649434985; cv=none; d=google.com; s=arc-20160816; b=OoXsS2sObSWk9DGxarN1lGxlugXHBNOtqTKyv0Oc//iVEFcxvgITZF96PkDNvLq0na oDzhYSYTufn21tRouKrYhzAN2ZrueI7RqAZYX0EJGNtwpBwPXEriqFO7nD4HhYlCLy4v Lc7WhEvnOw7+33ZIlSSZW18rSOwBHezde/chDMEsdyokEbZgfkLQHbBaEL52W0pQiW+V 7VxpuXFUYj26ptqfQDq9Pnjhc38zWKf9dFitomicWao+FtvGxHUcjqFdjtCih319dkkh VvF6ZWjoCFjNc41lPQaLleqDlfja+I2YR4ZHpk8xpww1//L9FGN5p9Xds/gUB+hhfGjf fdZA== 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=QPxziLerI0UxR876U+YKww6O14nhkPwPhp+Yk2SkNsw=; b=YNYt80UdD9Di0eDNK6pB8cps4Jkp+RRsjc4e0sz966AUsNb5Wq40C1D5CJi9jqySJP 17umj6q/C7RD5b0gTMR346gZjvxNTYHWbtGiVqrq+K6sqM1riC/C3XSE09t+Jihiaxwr XHse0FSrEC6lvwXGE71SioK1lLKqmbWaJxcUXNs+B39pXWB+SaP0K+M7PXThEmfbBbBY 55W5FEtG9Q39o4wCuwd27juMq2mw0XnhmfpK+8/IVADalxByaWmXvJzPEPOifKcWqYo+ d9F/2ziMknUOwQUfqhYzJoMkDEufaHWz4cKqT7pLoXrHH/DJMKvn+1vxvVs4EsNTaOWS 1cPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rDDE8uCI; 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 128-20020a620486000000b004fa8e92e2f8sor956538pfe.18.2022.04.08.09.23.05 for (Google Transport Security); Fri, 08 Apr 2022 09:23:05 -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:d955:0:b0:398:b864:ab71 with SMTP id e21-20020a63d955000000b00398b864ab71mr16413922pgj.515.1649434985368; Fri, 08 Apr 2022 09:23:05 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:23:04 -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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 07/11] drm: bridge: samsung-dsim: Add atomic_check Date: Fri, 8 Apr 2022 21:51:04 +0530 Message-Id: <20220408162108.184583-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-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=rDDE8uCI; 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. 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 1fe4b8e737a4..38db1f93ed51 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1338,6 +1338,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) @@ -1359,6 +1372,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,