From patchwork Sun Dec 12 18:14:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1819 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 356F63F071 for ; Sun, 12 Dec 2021 19:14:58 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id u4-20020a63ef04000000b0033ab2693122sf2160380pgh.3 for ; Sun, 12 Dec 2021 10:14:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639332897; cv=pass; d=google.com; s=arc-20160816; b=o6V2fqBamCzReQ54ol6+rynVZmn5vumaj/fuPvCAidvZ2T/iCY96VEJU4lhBvua/M9 irQvsYj2sCRgg42UsqxplDlElmuARexNlINqpGWnxQiB66lti2+/1fvTNrivMsUWAVt3 q3GbZvrDkBSQuDxUH3coDUE9+CJTRYtearDj7JrXTO0KL8zEZ17HSDpYGbYkYaC/GjZF 3p45A6/a9vFxB7/uuGWxw3MGsNAHiydQjNZdnmAjnnzwDnnZeJcdAtwAbkG52m8nDryc JFwOHsGoFoZz7bfWKGicOeEmlQkqqfREd7jZjrrfzyhrE43TIyLZHwrw9UOhlLj+sPmQ DZlQ== 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=O/u6NW3HVNfdF4Ysm15Vk2JEd1zYfFskrVjVBdCfz14=; b=FPcHjeeUKKBUwmTKTS5fwjVzteJ2zvj6l9xfk9U3E/0ChLZoczpHeNNFePgzsj1wTF b1kzUVRDeStqJ9PP8VwpO+KWnuVBkX9nzBEY7THutPUtedyTgATNJ1cpcxA7Vo7Fj8cj QXzOknz50N5mUH3uaucG2ozF4B5AANyuTYnLA8MrEFNGNZnaPVoDaBku6g/LYL1xvRyp QHLeTSnvnzRfx9I60JAAfCAKUI5xYLUE8J+V4UprV1+Jp1sQwFPc4TBqCYu4co6LM1f+ 2kl56mXDBiKAcKoa896VLUlVNQddiMvthojnIhBgNR9LQjryntCxRq5k+UoStD5ku8xj /yfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kXX2vyw6; 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=O/u6NW3HVNfdF4Ysm15Vk2JEd1zYfFskrVjVBdCfz14=; b=KmJc8qAQOKhrruaPhSWJm3HPqHv6ody4xaHFWiuK0EB4T1cthJ2oC+B2gNEwCSO2H+ Tg6wjldCp8xeI5K72ySprSZdT8NKIYKR1LX1fgD7ZSTsYBbvJmLHG2dlk33xus5PLrOL 3ImKyNMf56M0PHMrxsZe5cpzAFvMDjahoy9tg= 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=O/u6NW3HVNfdF4Ysm15Vk2JEd1zYfFskrVjVBdCfz14=; b=lANdnjTlwbVMmEojbSyc+d+nkDONB1axcgvGPG2v3meYwB00VmIYpOlpsgde7lL081 0yGwFLzhYt5oiAXVSf8dhgPs2tdd6ImcvYngTB0f3Chn2+Esi83AKV2i6dE1hO4y7Uyv fmAswcqgVoh/mJtNlQqzdTRawFHRXdXB5yO48A78I82bxzPDmM0XNJqD2l7sXVZ+qhXn q9+B89CJOVJBtAkn0F8raE3ZNXkIuwlJD5VBusTt4VkGG5Wo0OUq9/QTx/CZAqU2icrE RZcdWmPZks8PO4r/OT4jRwIt6jPSBvK9KHtr2IiYh41OG1eI96hQQfWeGpLjng3ubVyN vt6A== X-Gm-Message-State: AOAM531LF4BJPsDxkLgiElYJ31wYaVSi5cljSlVWNPbfva0tB/NWU26F jGNczfSMO858NJikGILZTOWT+ltk X-Google-Smtp-Source: ABdhPJwh1I/073EOLLJLGr0HCp0A42BiLF8znKpIqUIKUTnlEunXuD7FDrTxaNPbxpYqhokoEW/eoA== X-Received: by 2002:a17:903:2091:b0:142:8567:e794 with SMTP id d17-20020a170903209100b001428567e794mr90601306plc.50.1639332897056; Sun, 12 Dec 2021 10:14:57 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:73c2:: with SMTP id n2ls6053779pjk.0.gmail; Sun, 12 Dec 2021 10:14:56 -0800 (PST) X-Received: by 2002:a17:902:f691:b0:142:2f7a:308e with SMTP id l17-20020a170902f69100b001422f7a308emr89607117plg.19.1639332896267; Sun, 12 Dec 2021 10:14:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639332896; cv=none; d=google.com; s=arc-20160816; b=YGStjtN8AOgNXNlmfBBVe4SPM8s3aLWmD6hMAjNRMzTWGcW7PDWfhuG6A0VSS4I7+G Rtm8upnp4EjX+Qag6Nt8bo1JpbKOwAoki3tSVgEMEeiR3Epy/yKmJhhkV8OnwO4RaZfQ hOXXSby6ZPa/gjJ/W0Ou8212C8jYrepxmMOCWorSw0z3ZWVYsfmbihRDGZiLYTUvtl9v 8ApyeSRYVtlgcrL7Mufwicr81/64wSg0aN2/ohmw+jF1vBOBNGDqisQrib6PipxHILKU DGIhfx+q4846bY45EEtXOggdqJ2/U3ZEKiqG/lWhkOQXXTQO9Ry3+vihFaI/lfQz5kZd KNdw== 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=eZnu0zKaPclw3wwWZgzYVVA3tXdVJCczsVmIaW/074w=; b=Ih25d7YrmTYJqUpLTU7wIAC3/KmbMW6QkL0Ah8AL4RoRM9OofVZGRHPn0Jxand2wwY B7O4JmcRzjOZg5BzaTtJ+pbCfjMxioAveqFdjfoJHr/pkUi6wxfiWcLXPy0ECETdFvEo BpDDZbAP7HDx0Jqyt3WS70YSFXe71V/MMTKWetqDukFwiWT3rJJqgx2SwnEH8Vo6rzh+ VXkTUurKuCR7HUIXC+cGP8NBIP40CAmv0MzzhwyEG01nftXDx4157xWFj8DfGppSqwL0 KYjeXBkvH4c6vOtEyuVwq4T4uj2IVrkNamQe4un1oXC90JIXbkPIKfKClaK/vp+7097H cS/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kXX2vyw6; 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 lb16sor1999033pjb.3.2021.12.12.10.14.56 for (Google Transport Security); Sun, 12 Dec 2021 10:14:56 -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:ab47:b0:141:95b2:7eaf with SMTP id ij7-20020a170902ab4700b0014195b27eafmr89136606plb.40.1639332895973; Sun, 12 Dec 2021 10:14:55 -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.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Dec 2021 10:14:55 -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 4/7] drm: exynos: dsi: Separate pre_enable, post_disable code Date: Sun, 12 Dec 2021 23:44:13 +0530 Message-Id: <20211212181416.3312656-5-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=kXX2vyw6; 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: , Existing driver is calling manual bridge pre_enable, enable, disable and post_disable helpers with their enable and disable functions. Separate the enable code with pre_enable and enable helpers like enable the DSI in pre_enable and set the display in enable. Separate the disable code with disable and post_disable helpers like disable the DSI in disable and reset the display in post_disable. This way the bridge functions are compatible with respective downstream bridge and panel_bridge drivers. Example of enable bridge function calls with panel_bridge is, [ 2.079030] panel_bridge_pre_enable: start [ 2.079043] panel_bridge_pre_enable: end! [ 2.079045] exynos_dsi_atomic_pre_enable: start [ 2.079723] exynos_dsi_atomic_pre_enable: end! [ 2.079728] exynos_dsi_atomic_enable: start [ 2.102500] exynos_dsi_atomic_enable: end [ 2.146505] panel_bridge_enable: start [ 2.148547] panel_bridge_enable: enable Signed-off-by: Jagan Teki --- Changes for v3: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 1450187c1edc..07083a545948 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1377,10 +1377,9 @@ static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsi) } } -static void exynos_dsi_enable(struct drm_bridge *bridge) +static void exynos_dsi_pre_enable(struct drm_bridge *bridge) { struct exynos_dsi *dsi = bridge_to_dsi(bridge); - const struct drm_bridge_funcs *funcs = dsi->out_bridge->funcs; int ret; if (dsi->state & DSIM_STATE_ENABLED) @@ -1393,38 +1392,36 @@ static void exynos_dsi_enable(struct drm_bridge *bridge) } dsi->state |= DSIM_STATE_ENABLED; +} - if (dsi->out_bridge) - funcs->pre_enable(dsi->out_bridge); +static void exynos_dsi_enable(struct drm_bridge *bridge) +{ + struct exynos_dsi *dsi = bridge_to_dsi(bridge); exynos_dsi_set_display_mode(bridge); exynos_dsi_set_display_enable(dsi, true); - if (dsi->out_bridge) - funcs->enable(dsi->out_bridge); - dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; + return; } static void exynos_dsi_disable(struct drm_bridge *bridge) { struct exynos_dsi *dsi = bridge_to_dsi(bridge); - const struct drm_bridge_funcs *funcs = dsi->out_bridge->funcs; if (!(dsi->state & DSIM_STATE_ENABLED)) return; dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; +} - if (dsi->out_bridge) - funcs->disable(dsi->out_bridge); +static void exynos_dsi_post_disable(struct drm_bridge *bridge) +{ + struct exynos_dsi *dsi = bridge_to_dsi(bridge); exynos_dsi_set_display_enable(dsi, false); - if (dsi->out_bridge) - funcs->post_disable(dsi->out_bridge); - dsi->state &= ~DSIM_STATE_ENABLED; pm_runtime_put_sync(dsi->dev); } @@ -1438,8 +1435,10 @@ static int exynos_dsi_attach(struct drm_bridge *bridge, } static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { + .pre_enable = exynos_dsi_pre_enable, .enable = exynos_dsi_enable, .disable = exynos_dsi_disable, + .post_disable = exynos_dsi_post_disable, .attach = exynos_dsi_attach, };