From patchwork Wed Dec 15 10:15:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1832 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 327E33F18E for ; Wed, 15 Dec 2021 11:16:08 +0100 (CET) Received: by mail-pj1-f69.google.com with SMTP id j16-20020a17090a841000b001b0e90738a8sf2568856pjn.7 for ; Wed, 15 Dec 2021 02:16:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639563367; cv=pass; d=google.com; s=arc-20160816; b=MuVzlRBRELhBkon9VUD+S55cl5c+bB22JJeDZvK0BvqPvqCqQBpV3vJ4vU3SI2KXXo /zEOv8oF38jOm/TRu+mRWDGlDJoVWV3iHCctEPYgv5KeiOMryCvA32fQeg2YApy1XE5h hyi2c1OCcwZozOiIr7/hHKijse5iIfIZlWv1+lqgumRKkeO3UL9RneM0CFu3rUjNzLtc fdWIiyh4cV5w4fW5fGBz9tZpyBL9ztdL0GQi5GllFiXs9k3PdQVYdHtm4bqQ5Evg0R8G /DtLy9isyNQxBOM+X7XP1UdhIUW7eVHRL+GtEBshMpCo6vkHkXvuhVMiStKlPwEooWtp RZKQ== 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=4v2j1vbWKSV/PnV2ZLw00D72it4PDU4qTWU2pDvgar8=; b=Q/S1YpeAakWwfftJXI+Wov8AHg023C3i0o4098Gc8L9QAGultHmmhhrcdnrdXWtqx7 GEE3k8lr0hFpakKSQJqAhAvVnkvaz48nmIq4gJzS90NNlEVDrZw0Q9qOh4E98C6ptKMc kenbzV+t16jbFXNhzAOFRv8sA6OJacJpfEGUYmqZynzX89w1p7+OAogWKRHkz08M6mLD Gh6OcL6qOhT9YvhGRSWXDkJ4atMGiSkM4DXCDttKFaadZFX0DUc4odqV4o5qi/zb76Xc Itru3DPBCngH1/auFn3eDphdRysC0yi2/F7lsOOpWn4Z5H2hJB1mdN4JBNv/I+DqCLV4 5s6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BIUrIsUX; 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=4v2j1vbWKSV/PnV2ZLw00D72it4PDU4qTWU2pDvgar8=; b=AbpzNu0TgkOr77ZGGNSL8kel17dcgBgiVM3NRIvosqIU39AC9VrJ41lYoB0AjAG9zo au4lYDMxiiJhgCIVSibQALmrAgWRlWdY84KZqU7YJk+fRZoeuZrtVVT+qsSMr3H7+B+j rMTuW1PeTw1QHvmrDkLSLFzj1UPXOpViOddW8= 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=4v2j1vbWKSV/PnV2ZLw00D72it4PDU4qTWU2pDvgar8=; b=LqDTm1QJTTmVtsCui+WwqxiE69SFAaxGyFjaP8UEqUvA7W3y+5vVSxuooeoMafWtsY YiMW/tPriMdje8kZZSCxbw/nwQXzHXeFT7hL+TVz6xWmB1Q8GtU5pzZM7jcRDMnOKoBm MPh6OrftBDlWR/Hw1oMR9nS5vJY/+X2oS6H5Bg2DDf0XEbXX09fIk5+nNNyk+0ZQxuRi heEZZK0Qtk4mybWvL0rlVxVRYysywmcmcAuzTtZVocjR0M7yUfm/1XGOfOX8kVi0L//Y /XsWn72bmzt8ypAj6cQp9IxFFI9s3f0IkT2ixXvg4rLFKitLEfuSFoTYQoQRrOk1Y6ir 6GaQ== X-Gm-Message-State: AOAM530fjZSHWMtLJLylaHD1SabFh94XODOKPFQ8EwYaY2Jn8yxOs9hi Drf9fOp1J0ngJD6wM5o1sHrtjZes X-Google-Smtp-Source: ABdhPJxewh3F0GFag6TyPHW9v25d3VxOT4ewQF1ML7sm2ewTinILSUkQ8mDN3TzSXCkaAnoOiII/2A== X-Received: by 2002:a17:90b:1b07:: with SMTP id nu7mr11013660pjb.140.1639563367062; Wed, 15 Dec 2021 02:16:07 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:e5d0:: with SMTP id u16ls1213580plf.0.gmail; Wed, 15 Dec 2021 02:16:06 -0800 (PST) X-Received: by 2002:a17:90b:1c81:: with SMTP id oo1mr11136598pjb.137.1639563366312; Wed, 15 Dec 2021 02:16:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639563366; cv=none; d=google.com; s=arc-20160816; b=PwelsatTbBwxy+3yUDozkk4SFh50G/jGaZCFsbYE8WUCCBRElbtj0e3+WcsdHxV75j XrN588oqm/lRif4iO/G2fYRFM/0TEdvqAlStdkMjZaNQnlj79jm5RSInJaQgb8fJUyw4 Wp1XYmaaPbKljZiycYXbRHki3IXh/Ut56law/6qnUZnCTNL3H3DIAzK6Rk47VdbaSEYD KtKXdlyygagLVkhXpKg8lgovl5d+VVrASc6INNyPDfFb2IGXmFCMAtv5Ub3aW9pWaDyD RXhzOWijYdBHcahwMroFnk4ytBdXGApmozdwB6uEE3eDJ42KH6GMfqV6veH+QCIqxSs7 nneQ== 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=7mwCQQOx25soOzwU54V6juPjb/T8Ui/I/Y0mS6KWFZw=; b=lilF1gtBLQmzyL9n3WhCH0kRFKLw1AqPuzn4ok4t/40fFG7YhASvxV2q9vM+OCcZkc AB9tEBhynG5m9AAici2O/5Bj+v550CN+kcNGyGlHFHPoDR1qqMNhd9xZWP18bI0TK9xr +tivgTj16XDwAqTJTsRQ86RN9rKVU+o4pquDPSBHL2YOB5ler4MYHSZEKThR8EjK1Puu BcDc8M0XSm/1A2j4O6//j3BXOxhqnW4WSnotVMBElgIdXTBcLB2o0woUUnr01uWDH+tv VbEZM7onyZvSbrZtXWFkIBv+XNqO/+FBGzVFhIW2GNRINBt4KNFzCVMNn8/oGL3AOgva LdoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BIUrIsUX; 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 s4sor1792976plq.38.2021.12.15.02.16.06 for (Google Transport Security); Wed, 15 Dec 2021 02:16:06 -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:902:b210:b0:143:789a:7418 with SMTP id t16-20020a170902b21000b00143789a7418mr10193966plr.38.1639563366055; Wed, 15 Dec 2021 02:16:06 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:a7:8328:d9c4:5bc9]) by smtp.gmail.com with ESMTPSA id v11sm2408149pfu.184.2021.12.15.02.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 02:16:05 -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 v4 6/6] drm: exynos: dsi: Move DSI init in bridge enable Date: Wed, 15 Dec 2021 15:45:34 +0530 Message-Id: <20211215101534.45003-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211215101534.45003-1-jagan@amarulasolutions.com> References: <20211215101534.45003-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=BIUrIsUX; 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 v4: - none 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 774ca265ed3b..d853dd8d1271 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1397,6 +1397,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;