From patchwork Sun Dec 12 18:14:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1822 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5ED053F071 for ; Sun, 12 Dec 2021 19:15:12 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id q2-20020a056a00084200b004a2582fcec1sf9178495pfk.15 for ; Sun, 12 Dec 2021 10:15:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639332911; cv=pass; d=google.com; s=arc-20160816; b=EEl1yvKQGDjMHDA+JwegRyqrQuhraZOfa0cY70YTUvi+E+gu344qG25imbkifPjHuE QpzyWLE+t1hYzyfJzMP79MVSUZ0hSBgTzkVKD1U4qPTcNB38s/7In1m4ukIhVQEZ4voi 6aWdldL18t+2JrgCAr66WhoNbWQs2MpcPsJC1EVMBxyx5yjPIX44XQgPEU1EAJUC7h5F GsZxVTTtnW1yjbxn8imRQgTScukTOHRId82JcKTtA+/sos/3LHRWg10ngtw9ah0ys+8x EK9rcIjMicVy0mAoGvvkz7Goe9Zy0ktDv7vqNYzykwE0I4IiOttiJBnBX9pisOLFeKmy Ac0Q== 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=KNxjmpj+0mg7dkmz/sCFCjDBe83oCvnhtr7XKoWLD8A=; b=ZiznagljHZWRfC3bLUSBBAbdOQjedxis4v8Y8WuXMXxrmZakinggmUPwBwGl5sBlrT I2c3GPfX7HpFVPqXs9i9s/wi15L/cxfETd0cWH/WuN7j3nZC9jxrRpPHUrqEyu9uFsny e/IgrJj/PZuwP1l7jWbR0y8J34EmfWAcPLK0d+ChM7sXdH+4GQfWjwhyaDg/heapzAx8 G9agM3vLq6/7ah9zsauxrvqvkrVecizrXlufFgHQ9RY1NXCY2sHqYJxl8JPn/mAUMv11 VzIhip2Vrva/hIORLqb+2YKbQ3l25g/OMLChcncEgcYo+r0hc+25jcAcRRuuBJsfShQ4 FY6Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rvx7uEYs; 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: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=KNxjmpj+0mg7dkmz/sCFCjDBe83oCvnhtr7XKoWLD8A=; b=AkfWn3VkV9dSj9s/JJ5qeRMlgmx7Q8jJuWDTVUtfMpjY9Zs0SW/Tb6vo4YVyGP7T9p n3+JRHMZsr574XTTPEXsxjEjkbWGYAfqwbhQwWtVyaauVfp5aszSQSu7eVc1lG5XEW/5 uVciBWyHtC6bq8NsePDOWJdXI8MqJw6aLnFlc= 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=KNxjmpj+0mg7dkmz/sCFCjDBe83oCvnhtr7XKoWLD8A=; b=T/oSitjVGTOGUm1dnpUocTWLWPUB7z900My3XMamFnMdx92dRkvYtTwlKPyxqKsx3Q /sczTN+OdtOR7T6EXbj0jMHnyilFDxjJKvN54XIWPNGH/YkAYw+WS9G9jZ3kPkUD3S0z PlqAL68r39PL5XJIPeUJISfJe37jQul+wNiS2qeOgkL+CeRLYsR9wrmcpQced/wP6UVO 9FtGhIapiKhPRoYUTPPyKK7RNI/HounC4UZAKnKVukYoRNcpuHDMDzcMTQNZXZszAgvu aE6M2OdtlngB/3OI8XFpFeJJ/xgEMJ1tivO+O4pu3tGxkgo124chvwi/4LDpfo4kUg/M GcGw== X-Gm-Message-State: AOAM533BNdkeMVOa8LgWgj/U0KrN9Fe/RZqSokSQHAoRSqZzenp1sRZl dzKZQ4CsYKTet2LSdPC8WMBVwrZC X-Google-Smtp-Source: ABdhPJxjt1zYOvF2VGK8m7roRNUyBY3v8TIntL413wLrmnzwSzDYvNRcmGDZBrfxB0PWPcmh0FrMcw== X-Received: by 2002:a05:6a00:888:b0:4a8:56c:d2c with SMTP id q8-20020a056a00088800b004a8056c0d2cmr29375075pfj.40.1639332911209; Sun, 12 Dec 2021 10:15:11 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:da8c:: with SMTP id j12ls7086999plx.4.gmail; Sun, 12 Dec 2021 10:15:10 -0800 (PST) X-Received: by 2002:a17:90b:17cf:: with SMTP id me15mr38696999pjb.125.1639332910494; Sun, 12 Dec 2021 10:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639332910; cv=none; d=google.com; s=arc-20160816; b=JGu7mCovaexbf919bbCMss5bbYdjMqpNfXJgZOSgkhgruEX+I3kccuR7aL1DBOoVHI JwloSiWEUhD/wgOx4tD1aqzZrBOugYY+k/Hrj6tjjmgkIteTGqMYn+02u+uRY/iMaehZ cXtf6RKGNiauj4uBHciCxB3wCM+3TBteF30kKXDa8YCtrDolxWbpFv0Pf2hwsgpnXIYa hCWD8pAZdaO385mQUV6uZW8qDTznAfQtYgzlwuX8obaJWDCo7BzZLnDnd3H6RE1PdRcs 3xkRbrvJ+zvQXKUwOQcijnVzXRtkrbUhiAbdMP0vXSaBQM6BCGtcFVVSARxbdYSw3DuI YUmg== 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=CFCMhVXTF6/uuspSPtdl/2kwHfDa2KBaiMMJzN8Xns8=; b=sk70BUPwShvqyxLghadrVNa+L7JZaZh/ZQuScH6zkyhR1MHsRGjEnRsmnqRvbfslCz 4iKBWRvz/35qe4LW1TaSYRCJaed4r/LPBszAbzh1kIZSXR4hRig0DDU1TiNxqvqO1JI5 39aTeJ6M3eAfSKoEu0DH+1XwNisNoox8OW+v0ekfgzVFNOd/MnYdsmJOpfxZbCHHieAl QuTjeSFedc8hSr6Ip7jegZZxSpV8EOR/g1IsSHopbP/ZeVDSRuYSYJsT7XQLMU1yU3Zi gkgenoMahaNgCTito2yqNRTkZhNtDx65CDpy/bx8o/OqO7tw+tGZudOVKXTkwsrBCf80 5rBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rvx7uEYs; 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 s1sor1986307pjk.38.2021.12.12.10.15.10 for (Google Transport Security); Sun, 12 Dec 2021 10:15:10 -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:a17:90b:3848:: with SMTP id nl8mr38148602pjb.221.1639332910224; Sun, 12 Dec 2021 10:15:10 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:264b:de7a:bc69:cfbd]) by smtp.gmail.com with ESMTPSA id bt2sm4567904pjb.33.2021.12.12.10.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Dec 2021 10:15:09 -0800 (PST) From: Jagan Teki To: Marek Szyprowski , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Sam Ravnborg , Michael Nazzareno Trimarchi , Inki Dae Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 7/7] drm: exynos: dsi: Move DSI init in bridge enable Date: Sun, 12 Dec 2021 23:44:16 +0530 Message-Id: <20211212181416.3312656-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211212181416.3312656-1-jagan@amarulasolutions.com> References: <20211212181416.3312656-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=rvx7uEYs; 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: , Host transfer in DSI master will invoke only when the DSI commands sent from DSI devices like DSI Panel or DSI bridges and this host transfer wouldn't invoke I2C based DSI bridge drivers. Handling DSI host initialization in transfer calls might miss the controller setup for I2C configured DSI bridges. So, move the DSI initialization from transfer to bridge enable as the bridge enable API as it is common across all classes of DSI device drivers. Signed-off-by: Jagan Teki --- Changes for v3: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index a2eb82bbb30f..29d4eaaff5e8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1399,6 +1399,14 @@ static void exynos_dsi_atomic_enable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { struct exynos_dsi *dsi = bridge_to_dsi(bridge); + int ret; + + if (!(dsi->state & DSIM_STATE_INITIALIZED)) { + ret = exynos_dsi_init(dsi); + if (ret) + return; + dsi->state |= DSIM_STATE_INITIALIZED; + } exynos_dsi_set_display_mode(dsi); exynos_dsi_set_display_enable(dsi, true); @@ -1539,13 +1547,6 @@ static ssize_t exynos_dsi_host_transfer(struct mipi_dsi_host *host, if (!(dsi->state & DSIM_STATE_ENABLED)) return -EINVAL; - if (!(dsi->state & DSIM_STATE_INITIALIZED)) { - ret = exynos_dsi_init(dsi); - if (ret) - return ret; - dsi->state |= DSIM_STATE_INITIALIZED; - } - ret = mipi_dsi_create_packet(&xfer.packet, msg); if (ret < 0) return ret;