From patchwork Sun Dec 12 18:14:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1815 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4D4E83F071 for ; Sun, 12 Dec 2021 19:14:46 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id t1-20020a6564c1000000b002e7f31cf59fsf7722790pgv.14 for ; Sun, 12 Dec 2021 10:14:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639332883; cv=pass; d=google.com; s=arc-20160816; b=SNErfgrANEs1FZLCQHCs+TpjHF/qXl6C6DjNBrCvjnc54OU7cz2ZxEwebvjPh5vJfg ag2wYh3qGxqudUupeQmSvzJVJivcNnZaoBWJwMBBk8x2r9c3CaoDW3HelmaSi5DvRJoo 2CMfo19NQz402Yt4hSKMiH8JwQteOdRBNRrZLonSuMLjkJQcQmEDoiHQ1Vmw+7f1Z3ru e7rDngNJhAk5Xuox8x/KzG/ojqHJhLXFKqT8xZzS7q/zEw6dzYYyYMFFJuBNAt3oKXxJ n1pTNVlDMv5KAIP+UExnl5vfzmgN+5CVmo5KSqlLT1w3DrwBoiVxcy5icKvP/Wcq9qop TiKA== 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=wBERMExaS7VPCDHAgqKmQDDKUalFSMsVWRyrPmznXeo=; b=ufFHkX7BUUT3XOJFVI4SN3QtKKbvE1zQ7DyYBMBVvXdJq9Tw782/U+v5J5dy6zpuDc /Q3qVPw4o78Hl13eoMm/pFF0/1iId8qyf3qEF2RDCkYDTvz/79J3ldkMGbRmsn9RFJCO GdijG89k9ua7PklAJSUsWFxMke4UWb3xg9TQDB9JyH6/2Pb4D3n85Lk7CBnPZx8Jz9aq vCzExkjyTQnUee6sbXK1St418NcPpjEka4vIY0gxWUNQiD49oFTnGjavLknrOliSQqQu WhWgKk7Xy0b7sTNIBbQyaYGsNL5hlzA/s15vKA+fOQNeioaJemZuqo+jWqOCFQUf8Cl3 99Ig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d91d7+MZ; 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=wBERMExaS7VPCDHAgqKmQDDKUalFSMsVWRyrPmznXeo=; b=MMOnMi8vb/OlZ0nwtKa51ovz2Rs1Idbxpza4J+n1379B9WZkp4STpTXxjX+LExlcG1 7S/hdYoG/Fdn59slMZtRrIXfPu4B1EvDUryqdRVjhxRYMmkXonIPfP6aATbMfF9KKOVN HcHMv3+xEa5CQ88uCdS0qrppFcOUZGxEJ1Ftk= 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=wBERMExaS7VPCDHAgqKmQDDKUalFSMsVWRyrPmznXeo=; b=Pxj90ixiHafRGxa9+ZIYA9ujNSL/IPToWGk1QHwQ0vikl/lRjEpTFlvr7slX/g764Z x9E3fq51yW3xHWjRAZaurCOMMjKSgKiOt3zM3wyktlLiQpJ0phqWmzNBOFQSsgDoXZk7 C/+x4eMNWlPjJDMIAiA+4cHkbt7tQkcb0a9KM3cs/yUMeGnFjYRLwvGVmnqLKJF4jE3O Mibj6VGsIvPFyK0hh83EVQX2vDBK6WwlXjvABDHWEPo+40qf/I0CqIy1bY3lXuOSJMlK 18efMwtKepp6delQMaHAobv99EzW4hH6TeY0T3aGdfy0WDH81OmI5/UKAIqQAqP5MArJ pN4w== X-Gm-Message-State: AOAM532hXPa6DxgjRPgQiQfuWV+84KntsaegCideWoEUjGcCuC0CUtKu /uC4LjJfa4s5j+yzqMLoxs++MUv6 X-Google-Smtp-Source: ABdhPJxMpUZwfGJ0jBwC+IdIxyk3iBKBdjcHOSLO9ateaouic1jya4G2RAIBpXTfmlxZW12CVn5jvw== X-Received: by 2002:a63:5622:: with SMTP id k34mr13587277pgb.457.1639332883481; Sun, 12 Dec 2021 10:14:43 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:1c2:: with SMTP id e2ls7082116plh.9.gmail; Sun, 12 Dec 2021 10:14:43 -0800 (PST) X-Received: by 2002:a17:902:6506:b0:143:84c4:6555 with SMTP id b6-20020a170902650600b0014384c46555mr89980727plk.8.1639332882800; Sun, 12 Dec 2021 10:14:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639332882; cv=none; d=google.com; s=arc-20160816; b=m7rc1iWT/IHE44KIR9JDitugfQpQ2j1+gWc1vukr/0QI1KkBvTcZ6CMwTMXIiZH6Ji MJQMwuCTPU2n9+JfXoRft6ThkPaxyWHmxDaQ8e0lJfLLzd/8NG5FGJWcH+iJRgGcBXds qybu3inAItXdGKubM3RtG18l56SicDzeIduRJuzZRUEauNlk6+tb2wPw3IUncvAkl0CO 8q1ZSg79cAlqAlYZAJxKoOQy4YaPUZvaNz9T5HoUWBWYB3Km2ygZhc4raI4LBteOIXzy fmSS40s02aNEi/0GrfgyohcwSyBWZsf3Dl2XgEL/kDER5DzIj29R3FuElu3B4QZF6eIc jPww== 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=Rs7mrpbyprSOj5xGG1AZsz4IjzgBk2UIZRJDxcV2DW8=; b=jpV5RW/vtyNTFX5DufCFZMMwr075vrareOwLKQ/AoS0BhjkJK2qurphPdUt4GlgMId 09L9VMFxoVMj7T1ceaYUtn931qnbhPfAmoFqPR/44OWFASYc+5yDMnsE8Fxrr35jM8df BdnlhYgq9F6vJUe6uI/KmjO3E6jTQp9LdLrkBWhlqXhQ7STck+PhhFk37PLn2iLmtia1 cQcB5/50Oyf1GSeLTGXlKTA0OFIuvA1LjqthucQQ+WNJo941oHOcUOO6EY4C6EA/oPNr oZs6GpQSoE6NtVhodELyX0AS4KAi9aDr8b4ODSuaUI//XBEL+mdZCbLc/rUruC8xyC08 mpYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d91d7+MZ; 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 b6sor4170753pgt.3.2021.12.12.10.14.42 for (Google Transport Security); Sun, 12 Dec 2021 10:14:42 -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:a63:6b81:: with SMTP id g123mr49803210pgc.140.1639332882514; Sun, 12 Dec 2021 10:14:42 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Dec 2021 10:14:42 -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 1/7] drm: exynos: dsi: Check panel for panel helpers Date: Sun, 12 Dec 2021 23:44:10 +0530 Message-Id: <20211212181416.3312656-2-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=d91d7+MZ; 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: , Trigger the panel operation helpers only if host found the panel. Add check. Signed-off-by: Jagan Teki --- Changes for v3: - none Changes for v2: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 8d137857818c..0bb44e476633 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1439,7 +1439,8 @@ static void exynos_dsi_disable(struct drm_encoder *encoder) dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; - drm_panel_disable(dsi->panel); + if (dsi->panel) + drm_panel_disable(dsi->panel); list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) { if (iter->funcs->disable) @@ -1447,7 +1448,8 @@ static void exynos_dsi_disable(struct drm_encoder *encoder) } exynos_dsi_set_display_enable(dsi, false); - drm_panel_unprepare(dsi->panel); + if (dsi->panel) + drm_panel_unprepare(dsi->panel); list_for_each_entry(iter, &dsi->bridge_chain, chain_node) { if (iter->funcs->post_disable) From patchwork Sun Dec 12 18:14:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1817 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 AD3F13F071 for ; Sun, 12 Dec 2021 19:14:49 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id q82-20020a627555000000b004a4f8cadb6fsf9162651pfc.20 for ; Sun, 12 Dec 2021 10:14:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639332888; cv=pass; d=google.com; s=arc-20160816; b=BgJ7WxySiYBzyTE6hAHNkZBuZJaiTGoeiIX9QlRkocf97SoyShyvo+mpIK650y8u34 lMkivDAjuFU40jG+2BYhk4uHhi+TQVJDK4OXkLM7ZL41D2olDyficH5Zr79/svoLw9nJ snF1e1Dg4yCREGoVi4IY6cemyNLuJ0QfbBCAPSn09ZxtpVK1FnoqoVIM6Tg0cnyBFKvA NeWiRp6tyv3j0xEa0+jY84XocM+UPO7hPdWc+7kAA/EVsHUHGdOoiLdlQmUemZMRua8D zp+INJLfk+qbWGQDW+i+IwbxlYn4EyGyWgBSR7bzRCThjiues49oc9td2TplT8usRbFZ oj1g== 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=7ecpDNWVJ3iD6vkiYN9cY8e/Ck/Irr5R1b0pgC0T9m0=; b=bz9pte0p4Tvq6iJiIi8OyTq2KxQpf8ky2VtdZfnWZoMw6Fd+uTpvCy2hwl/JIjGKKU wu0yEcfSTY6ZGhm3Mi2McImv//qBviEJUjfCX7bCaqpjn1CiQis2GafObBjyAUKyjS8y A8thQiyhMyB6QVziojzVEUl4mqEjE9Ql2D5wunorG2Bn/t3zQnqlDu4Sp/w0RmZZ1pcy srN3/hx1xiCBQXBurzHZf6weLAZGqGCqWOfDO2YRzA7IPW3e4AaasA/6DRE5De1JtgmX SXsFax9Z0N9xi0pCXNUEpUlILDq7l1KWzpgmx0uRqZ3mESkW3xSeFroYpxHX5Dn71VPK HMJg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Z8von0bz; 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=7ecpDNWVJ3iD6vkiYN9cY8e/Ck/Irr5R1b0pgC0T9m0=; b=GdgTg+stG55HsuYlqVOB3dbpOygCX/hNOdv8u4ZAfJI8FQUM4RXazhKncEZ+RP/cBr jVe0GveDhdiYaaXIPaEpSVlj/skMbsrpnu1ruqTg1gQOT/pCSjNV9cpEv+YMB0baRu2+ myqjczTCgCKdWael83/UnUBjqgazQbqKJmlh0= 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=7ecpDNWVJ3iD6vkiYN9cY8e/Ck/Irr5R1b0pgC0T9m0=; b=kdQCqAlb4JyYS+oDVSRDZUjzA0dg38SMyVIbKVuiu/6WMB/+kakXk2MAYK3F6jYM8H 9LTjqdZJopQWGjrPxC0lFGcg5qkL1BbGNJdZmCKvrsFOtoMIBfxq/aMDGQuyCAQ7qHeK 6jpMxnE4YFwDPX16B7bx7NwHsJWZCRnv4/3UiEr64LKIqrDuBryZsbaA3knRrEL+6fHj c/cRmxKDNPPAcM7Qwvura/BWtQDrUyu5XymmY8lAm99SmbqljEyOuItZZzfeLkesyKQ6 Ru6DhL+v0PnvmalHgBtdHzKUlMIyZCpSpLH4B55caxw5zD2myu8lWcD2vilMIX7W8omR 9JKQ== X-Gm-Message-State: AOAM531gsKLEjQuuf3CCckLhxIEBKaohonSdPY7QApkHruiVL6jFI4HM ybceHI8hOCrgumYDJjzaZoRnFWY3 X-Google-Smtp-Source: ABdhPJyX2/qZEDxGiApdVPHPhVRR4VzJPU9hiauGNx1lP2ypsBBjlPOsdgYdtrFeF0zHVt3S+4rx5g== X-Received: by 2002:a17:902:694b:b0:143:722f:91c1 with SMTP id k11-20020a170902694b00b00143722f91c1mr90562377plt.68.1639332888251; Sun, 12 Dec 2021 10:14:48 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:f687:: with SMTP id l7ls7078629plg.10.gmail; Sun, 12 Dec 2021 10:14:47 -0800 (PST) X-Received: by 2002:a17:90a:1913:: with SMTP id 19mr38720637pjg.174.1639332887493; Sun, 12 Dec 2021 10:14:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639332887; cv=none; d=google.com; s=arc-20160816; b=C3QtSHRfN9BJyMZRCLIuql+CBOyS25mTSYO+v9wr4paaJDWxayjwKS7kA6C3bK8lEa CvjwDAMMFtb0G8h+y4CfaCH6MFW+2RNa50TWfToGUfnryXlUPRH15bpJ5JiMTdF7LEqH /zESr77GcAlfLfHRhXL4mwmR/jv0Qhj2PfuNG0fk3xuhbJkmS3ekx8T04VPN19NHm4PU oBKQypWZebSOWC7brsjZJ5vR2e2aIfx8tkI96lxoZo5NaZ6y3U3kvADuZaML31QvXNjM 7JrgIkdMPX/6wto6tKZOVOmFegUHMiehWWVz/tyCofewbwNDW1+X2rfVBzv1DNKnJtE9 +Quw== 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=nndxS3DBXwds0GdG4+eUAhTHP19wWLCxCMUGMS1dL44=; b=0Vp1AkHPsw5e68TZAMHfGPv4clfMmxFdzBqtnyObgImA+P59KLpmjwzaB1VkQhbg+b bxIVdJRj8xogVp5qPbr9O9VX89WfA4lgYhI+djCnGOkAPerU8o2H/kQ7WR51+a9raDVr fnhDh905QPehE66wu27vtyXbiGnri5H7SWnfRqD9AbCJ9u/9VOlEZgcGKr2Oluoi2W1M IGeMpm8X6GoOHBYaYjr/7a8nYxpW5aNzPyevW9PE+80K+ghv0QPPfhDQ6Kv+8VAYrhxm 2MXqVljBUQOXqkWw37Pc9VCq0dx6thQd1z2e7QGmahycw3Ab+vBrvwcDVaOwogt8SiEW Zf4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Z8von0bz; 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 k11sor4098980pgj.81.2021.12.12.10.14.47 for (Google Transport Security); Sun, 12 Dec 2021 10:14:47 -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:a63:82c2:: with SMTP id w185mr42246113pgd.390.1639332887181; Sun, 12 Dec 2021 10:14:47 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Dec 2021 10:14:46 -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 2/7] drm: exynos: dsi: Use drm panel_bridge API Date: Sun, 12 Dec 2021 23:44:11 +0530 Message-Id: <20211212181416.3312656-3-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=Z8von0bz; 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: , Replace the manual panel handling code by a drm panel_bridge via devm_drm_of_get_bridge(). Adding panel_bridge handling, - Drops drm_connector and related operations as drm_bridge_attach creates connector during attachment. - Drops panel pointer and iterate the bridge, so-that it can operate the normal bridge and panel_bridge in constitutive callbacks. This simplifies the driver and allows all components in the display pipeline to be treated as bridges. Signed-off-by: Jagan Teki --- Changes for v3: - fix port number - add print for attached device Changes for v2: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 165 ++++-------------------- 1 file changed, 26 insertions(+), 139 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 0bb44e476633..d1039628b6f2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -221,6 +221,11 @@ enum exynos_dsi_transfer_type { EXYNOS_DSI_RX, }; +enum { + DSI_PORT_IN, + DSI_PORT_OUT +}; + struct exynos_dsi_transfer { struct list_head list; struct completion completed; @@ -254,8 +259,6 @@ struct exynos_dsi_driver_data { struct exynos_dsi { struct drm_encoder encoder; struct mipi_dsi_host dsi_host; - struct drm_connector connector; - struct drm_panel *panel; struct list_head bridge_chain; struct drm_bridge *out_bridge; struct device *dev; @@ -285,7 +288,6 @@ struct exynos_dsi { }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) -#define connector_to_dsi(c) container_of(c, struct exynos_dsi, connector) static inline struct exynos_dsi *encoder_to_dsi(struct drm_encoder *e) { @@ -1391,42 +1393,21 @@ static void exynos_dsi_enable(struct drm_encoder *encoder) dsi->state |= DSIM_STATE_ENABLED; - if (dsi->panel) { - ret = drm_panel_prepare(dsi->panel); - if (ret < 0) - goto err_put_sync; - } else { - list_for_each_entry_reverse(iter, &dsi->bridge_chain, - chain_node) { - if (iter->funcs->pre_enable) - iter->funcs->pre_enable(iter); - } + list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) { + if (iter->funcs->pre_enable) + iter->funcs->pre_enable(iter); } exynos_dsi_set_display_mode(dsi); exynos_dsi_set_display_enable(dsi, true); - if (dsi->panel) { - ret = drm_panel_enable(dsi->panel); - if (ret < 0) - goto err_display_disable; - } else { - list_for_each_entry(iter, &dsi->bridge_chain, chain_node) { - if (iter->funcs->enable) - iter->funcs->enable(iter); - } + list_for_each_entry(iter, &dsi->bridge_chain, chain_node) { + if (iter->funcs->enable) + iter->funcs->enable(iter); } dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; return; - -err_display_disable: - exynos_dsi_set_display_enable(dsi, false); - drm_panel_unprepare(dsi->panel); - -err_put_sync: - dsi->state &= ~DSIM_STATE_ENABLED; - pm_runtime_put(dsi->dev); } static void exynos_dsi_disable(struct drm_encoder *encoder) @@ -1439,17 +1420,12 @@ static void exynos_dsi_disable(struct drm_encoder *encoder) dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; - if (dsi->panel) - drm_panel_disable(dsi->panel); - list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) { if (iter->funcs->disable) iter->funcs->disable(iter); } exynos_dsi_set_display_enable(dsi, false); - if (dsi->panel) - drm_panel_unprepare(dsi->panel); list_for_each_entry(iter, &dsi->bridge_chain, chain_node) { if (iter->funcs->post_disable) @@ -1460,70 +1436,6 @@ static void exynos_dsi_disable(struct drm_encoder *encoder) pm_runtime_put_sync(dsi->dev); } -static enum drm_connector_status -exynos_dsi_detect(struct drm_connector *connector, bool force) -{ - return connector->status; -} - -static void exynos_dsi_connector_destroy(struct drm_connector *connector) -{ - drm_connector_unregister(connector); - drm_connector_cleanup(connector); - connector->dev = NULL; -} - -static const struct drm_connector_funcs exynos_dsi_connector_funcs = { - .detect = exynos_dsi_detect, - .fill_modes = drm_helper_probe_single_connector_modes, - .destroy = exynos_dsi_connector_destroy, - .reset = drm_atomic_helper_connector_reset, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, -}; - -static int exynos_dsi_get_modes(struct drm_connector *connector) -{ - struct exynos_dsi *dsi = connector_to_dsi(connector); - - if (dsi->panel) - return drm_panel_get_modes(dsi->panel, connector); - - return 0; -} - -static const struct drm_connector_helper_funcs exynos_dsi_connector_helper_funcs = { - .get_modes = exynos_dsi_get_modes, -}; - -static int exynos_dsi_create_connector(struct drm_encoder *encoder) -{ - struct exynos_dsi *dsi = encoder_to_dsi(encoder); - struct drm_connector *connector = &dsi->connector; - struct drm_device *drm = encoder->dev; - int ret; - - connector->polled = DRM_CONNECTOR_POLL_HPD; - - ret = drm_connector_init(drm, connector, &exynos_dsi_connector_funcs, - DRM_MODE_CONNECTOR_DSI); - if (ret) { - DRM_DEV_ERROR(dsi->dev, - "Failed to initialize connector with drm\n"); - return ret; - } - - connector->status = connector_status_disconnected; - drm_connector_helper_add(connector, &exynos_dsi_connector_helper_funcs); - drm_connector_attach_encoder(connector, encoder); - if (!drm->registered) - return 0; - - connector->funcs->reset(connector); - drm_connector_register(connector); - return 0; -} - static const struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = { .enable = exynos_dsi_enable, .disable = exynos_dsi_disable, @@ -1537,31 +1449,20 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct exynos_dsi *dsi = host_to_dsi(host); struct drm_encoder *encoder = &dsi->encoder; struct drm_device *drm = encoder->dev; - struct drm_bridge *out_bridge; - - out_bridge = of_drm_find_bridge(device->dev.of_node); - if (out_bridge) { - drm_bridge_attach(encoder, out_bridge, NULL, 0); - dsi->out_bridge = out_bridge; - list_splice_init(&encoder->bridge_chain, &dsi->bridge_chain); - } else { - int ret = exynos_dsi_create_connector(encoder); - - if (ret) { - DRM_DEV_ERROR(dsi->dev, - "failed to create connector ret = %d\n", - ret); - drm_encoder_cleanup(encoder); - return ret; - } + int ret; - dsi->panel = of_drm_find_panel(device->dev.of_node); - if (IS_ERR(dsi->panel)) - dsi->panel = NULL; - else - dsi->connector.status = connector_status_connected; + dsi->out_bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev->of_node, DSI_PORT_OUT, 0); + if (IS_ERR(dsi->out_bridge)) { + ret = PTR_ERR(dsi->out_bridge); + DRM_DEV_ERROR(dsi->dev, "failed to find the bridge: %d\n", ret); + return ret; } + DRM_DEV_INFO(dsi->dev, "Attached %s device\n", device->name); + + drm_bridge_attach(encoder, dsi->out_bridge, NULL, 0); + list_splice_init(&encoder->bridge_chain, &dsi->bridge_chain); + /* * This is a temporary solution and should be made by more generic way. * @@ -1569,7 +1470,7 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, * TE interrupt handler. */ if (!(device->mode_flags & MIPI_DSI_MODE_VIDEO)) { - int ret = exynos_dsi_register_te_irq(dsi, &device->dev); + ret = exynos_dsi_register_te_irq(dsi, &device->dev); if (ret) return ret; } @@ -1596,18 +1497,9 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct exynos_dsi *dsi = host_to_dsi(host); struct drm_device *drm = dsi->encoder.dev; - if (dsi->panel) { - mutex_lock(&drm->mode_config.mutex); - exynos_dsi_disable(&dsi->encoder); - dsi->panel = NULL; - dsi->connector.status = connector_status_disconnected; - mutex_unlock(&drm->mode_config.mutex); - } else { - if (dsi->out_bridge->funcs->detach) - dsi->out_bridge->funcs->detach(dsi->out_bridge); - dsi->out_bridge = NULL; - INIT_LIST_HEAD(&dsi->bridge_chain); - } + if (dsi->out_bridge->funcs->detach) + dsi->out_bridge->funcs->detach(dsi->out_bridge); + INIT_LIST_HEAD(&dsi->bridge_chain); if (drm->mode_config.poll_enabled) drm_kms_helper_hotplug_event(drm); @@ -1663,11 +1555,6 @@ static int exynos_dsi_of_read_u32(const struct device_node *np, return ret; } -enum { - DSI_PORT_IN, - DSI_PORT_OUT -}; - static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) { struct device *dev = dsi->dev; From patchwork Sun Dec 12 18:14:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1818 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BC6363F071 for ; Sun, 12 Dec 2021 19:14:53 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id z13-20020a63e10d000000b0033b165097ccsf854053pgh.6 for ; Sun, 12 Dec 2021 10:14:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639332892; cv=pass; d=google.com; s=arc-20160816; b=DCQJFTzFH1xLgloJOnxaKvPDfQB1UGNadSZFrW1m0zmAjVcT4mPDGraZsMISXgfRYQ PFzZ6sj9AJ0iv8qyj2CAqXUBQ1YMbcmhGRoCmcjgnEB/aloc8NnX8nOLr0Bdq5CtVTUa yEOBLrExWxyC2wmKGMt8gP2IT6mqztq6T+IZbxcTdnE8vQs0UXU3rflp/pUN5tTsT2wc GfOjan+rcU9nIjelkUg16ibMfbKhwd41NAfseuIEMRcbkRH3FscwmtSVEUpsCjXYyhzB zjYwy2D7B5BA0TjNia03MH2ToqBRwhdHOn/yNAxY8lLmK2LxC5D3GeXGctoOqN9lu6qR nP8g== 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=e3by6WC0BAL7R0io38qMyyzTep3TuVxCkMEzDTq5U58=; b=TlWONUdts7ALo4DWdaPGYu6te3y1nOKRMFKrBHIOyRKrA/7wATgF+88003MPj3aCX7 jXfFw2ZtziRYoCY9LiIHEqxE8HZHWqvs134vrSbhnXqmkdat994Jis75+BSTq3hlRcSI lEMmI1GHFwv97yBZ8sOxKlOkEg1UCERYiyLDGfSMqR5RbmO1U23xeVezT7hAq2M49vva MssmGCPMeWGGvjisuIOWqMaGQEP3FfiFRhakuojN9xnymDMtXedSm94zqAdMJyfKOxxs Li/6nO7Z4UZrpFyeAg+HoW+uODm5QJgErdhW2CBerl7Qi2/w0vLJ23GQZbQ2lEIF1Xw0 Wf3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="qfR6c/TY"; 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=e3by6WC0BAL7R0io38qMyyzTep3TuVxCkMEzDTq5U58=; b=JPPIuyr5CX0nRrDXhoBc5y6MkL/EDW7gzc09sf8XcK6qngTDUR5EjPvQWKf9b+j4sK 3aW2rlr5QdY4y6ihosa+S3ULdq+w7BXY0UDj5DwuIC/IxBGQ8CRNwd/G+Jnsl6hsQBmi u9369sgWCAl6m4Opdy9iNRmULBjL3OGoGi2Vg= 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=e3by6WC0BAL7R0io38qMyyzTep3TuVxCkMEzDTq5U58=; b=BEYZjOqJ5gdp00skJLqH0NFEhu3xtJ0wXeN6gmYOO6foaLclCZdp7cn2P4spHTF8LL xzfiXO2gOsQB8rABi4cU+8DnwAJIYPy4rczmPr5Z6bJofTzI+5T3ool8zXjcvd8ggYmB lf2JH1LxDIY7xMzCCMTSSJemT50xV3x4umHcZBiMZJ4UpMomRDBkVM1JzwAtVC7O72TK KGHAy2DF2O+h07+a1dVcpfxOEMTr3vXbQIIKiItCkh8s5/JAeP0FX9K8thKtC+InZKqu E4jVkWb/1U8i1f1BilNBTbIIxlnefEXPPjB83hn+21v0moIusO5YKudP/OTJi2Gj5gOm zUZg== X-Gm-Message-State: AOAM5326+OEcBbY/qEchiazHl5esBkYh7iP6kTTpc1WQzyEHpHLjDkrM T8A1h9wUz4uAV+VmV3Kk1RFDGt0k X-Google-Smtp-Source: ABdhPJyvCiEGAjaD5MI1gBnn3IHNJnQxvYodsuYNDjCaMdVYghqszlxdoKY6lgVrowL9F9NLHLdNzg== X-Received: by 2002:a17:902:7005:b0:142:4452:25de with SMTP id y5-20020a170902700500b00142445225demr91004922plk.3.1639332892576; Sun, 12 Dec 2021 10:14:52 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:84c:: with SMTP id q12ls3512273pfk.4.gmail; Sun, 12 Dec 2021 10:14:52 -0800 (PST) X-Received: by 2002:aa7:870d:0:b0:49f:e41d:4f8d with SMTP id b13-20020aa7870d000000b0049fe41d4f8dmr30121224pfo.16.1639332891867; Sun, 12 Dec 2021 10:14:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639332891; cv=none; d=google.com; s=arc-20160816; b=wGRCjCc3Toi6h/+nCetpSgRy/6NiAa83FPPSb3u9BkGad9z09ZHz0yWLI21XViDzDb xUnrZvVWKMWQwc4FKStiMXRtLS0ZZ0mXWNPormgEoMgDE7/nIl5O5CkhL+/IjjReSQNa Ick3+rB2D86tH2ngkZtvgNJL7TUm1w66swmHb54WtlaH35Nnt5Rts6arxTzNcFFKjjVA v7mXLMjI98VUg74Eo837ABRQAnaIc0EfczQr4wHi5zVS1l7ngg8n6QnnThR2il892g8I b9b4m2R/rU5Til81NOinUu8MP8KBgsEgf0ei4JgUDm7Vr6Y3cpW1WpNet28V0q/a+xAN pmsA== 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=tFBdWXWRLumKPbljQcPfLHxrbq6FvQTLeBP3tnX7MWM=; b=WnwikfP5HV/dUbt8nUJE+QP/X8PIGCE65OYXEFPceqMnyxFjYbOC7QoI0FgWa7VICJ bNAcmvfVPZrs5Xaz57KKYLF7iOVL8rQEB6UYi39PV1mi/VRbTHGn6JtB8c1An8O7dhhD ercf6TQvbH0swpGwmkZ5KSb6kOKi4ZijatllSOg30cfES5d2Zv4p/TqvdfnHPt3qd3V6 MIvOvHAy4P6T794vhCTW0a9TmctiZjo0BV0bVTmSjPfdmaxcEnXgandtwlMOeWoex3ne wLkI7qIT83s8nCkn/Es8TznI4HVvEfVGiymdgFRPLfjXwBAVWqLOJBRcuadwJevznNPp Qgiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="qfR6c/TY"; 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 x9sor4230052pgc.2.2021.12.12.10.14.51 for (Google Transport Security); Sun, 12 Dec 2021 10:14:51 -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:a63:951b:: with SMTP id p27mr28326382pgd.524.1639332891536; Sun, 12 Dec 2021 10:14:51 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Dec 2021 10:14:51 -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 3/7] drm: exynos: dsi: Convert to bridge driver Date: Sun, 12 Dec 2021 23:44:12 +0530 Message-Id: <20211212181416.3312656-4-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="qfR6c/TY"; 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: , Convert the encoders to bridge drivers in order to standardize on a single API with built-in dumb encoder support for compatibility with existing component drivers. Driver bridge conversion will help to reuse the same bridge on different platforms as exynos dsi driver can be used as a Samsung DSIM and use it for i.MX8MM platform. Bridge conversion, - Drops drm_encoder_helper_funcs, bridge_chain. - Adds drm_bridge_funcs and register a drm bridge. Convert it. Signed-off-by: Jagan Teki --- Changes for v3: - move bridge add in host_attach - move bridge remove in host_detach - use flags, bridge in drm_bridge_attach in attch Changes for v2: - drop bridge_chain drivers/gpu/drm/exynos/exynos_drm_dsi.c | 82 +++++++++++++------------ 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index d1039628b6f2..1450187c1edc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -259,7 +259,7 @@ struct exynos_dsi_driver_data { struct exynos_dsi { struct drm_encoder encoder; struct mipi_dsi_host dsi_host; - struct list_head bridge_chain; + struct drm_bridge bridge; struct drm_bridge *out_bridge; struct device *dev; @@ -289,9 +289,9 @@ struct exynos_dsi { #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) -static inline struct exynos_dsi *encoder_to_dsi(struct drm_encoder *e) +static inline struct exynos_dsi *bridge_to_dsi(struct drm_bridge *b) { - return container_of(e, struct exynos_dsi, encoder); + return container_of(b, struct exynos_dsi, bridge); } enum reg_idx { @@ -882,9 +882,10 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) return 0; } -static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi) +static void exynos_dsi_set_display_mode(struct drm_bridge *bridge) { - struct drm_display_mode *m = &dsi->encoder.crtc->state->adjusted_mode; + struct exynos_dsi *dsi = bridge_to_dsi(bridge); + struct drm_display_mode *m = &bridge->encoder->crtc->state->adjusted_mode; unsigned int num_bits_resol = dsi->driver_data->num_bits_resol; u32 reg; @@ -1376,10 +1377,10 @@ static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsi) } } -static void exynos_dsi_enable(struct drm_encoder *encoder) +static void exynos_dsi_enable(struct drm_bridge *bridge) { - struct exynos_dsi *dsi = encoder_to_dsi(encoder); - struct drm_bridge *iter; + 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,52 +1394,53 @@ static void exynos_dsi_enable(struct drm_encoder *encoder) dsi->state |= DSIM_STATE_ENABLED; - list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) { - if (iter->funcs->pre_enable) - iter->funcs->pre_enable(iter); - } + if (dsi->out_bridge) + funcs->pre_enable(dsi->out_bridge); - exynos_dsi_set_display_mode(dsi); + exynos_dsi_set_display_mode(bridge); exynos_dsi_set_display_enable(dsi, true); - list_for_each_entry(iter, &dsi->bridge_chain, chain_node) { - if (iter->funcs->enable) - iter->funcs->enable(iter); - } + if (dsi->out_bridge) + funcs->enable(dsi->out_bridge); dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; return; } -static void exynos_dsi_disable(struct drm_encoder *encoder) +static void exynos_dsi_disable(struct drm_bridge *bridge) { - struct exynos_dsi *dsi = encoder_to_dsi(encoder); - struct drm_bridge *iter; + 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; - list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) { - if (iter->funcs->disable) - iter->funcs->disable(iter); - } + if (dsi->out_bridge) + funcs->disable(dsi->out_bridge); exynos_dsi_set_display_enable(dsi, false); - list_for_each_entry(iter, &dsi->bridge_chain, chain_node) { - if (iter->funcs->post_disable) - iter->funcs->post_disable(iter); - } + if (dsi->out_bridge) + funcs->post_disable(dsi->out_bridge); dsi->state &= ~DSIM_STATE_ENABLED; pm_runtime_put_sync(dsi->dev); } -static const struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = { - .enable = exynos_dsi_enable, - .disable = exynos_dsi_disable, +static int exynos_dsi_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct exynos_dsi *dsi = bridge_to_dsi(bridge); + + return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge, flags); +} + +static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { + .enable = exynos_dsi_enable, + .disable = exynos_dsi_disable, + .attach = exynos_dsi_attach, }; MODULE_DEVICE_TABLE(of, exynos_dsi_of_match); @@ -1460,8 +1462,9 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, DRM_DEV_INFO(dsi->dev, "Attached %s device\n", device->name); - drm_bridge_attach(encoder, dsi->out_bridge, NULL, 0); - list_splice_init(&encoder->bridge_chain, &dsi->bridge_chain); + drm_bridge_add(&dsi->bridge); + + drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); /* * This is a temporary solution and should be made by more generic way. @@ -1499,13 +1502,14 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, if (dsi->out_bridge->funcs->detach) dsi->out_bridge->funcs->detach(dsi->out_bridge); - INIT_LIST_HEAD(&dsi->bridge_chain); if (drm->mode_config.poll_enabled) drm_kms_helper_hotplug_event(drm); exynos_dsi_unregister_te_irq(dsi); + drm_bridge_remove(&dsi->bridge); + return 0; } @@ -1591,8 +1595,6 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, drm_simple_encoder_init(drm_dev, encoder, DRM_MODE_ENCODER_TMDS); - drm_encoder_helper_add(encoder, &exynos_dsi_encoder_helper_funcs); - ret = exynos_drm_set_possible_crtcs(encoder, EXYNOS_DISPLAY_TYPE_LCD); if (ret < 0) return ret; @@ -1612,9 +1614,8 @@ static void exynos_dsi_unbind(struct device *dev, struct device *master, void *data) { struct exynos_dsi *dsi = dev_get_drvdata(dev); - struct drm_encoder *encoder = &dsi->encoder; - exynos_dsi_disable(encoder); + exynos_dsi_disable(&dsi->bridge); mipi_dsi_host_unregister(&dsi->dsi_host); } @@ -1640,7 +1641,6 @@ static int exynos_dsi_probe(struct platform_device *pdev) init_completion(&dsi->completed); spin_lock_init(&dsi->transfer_lock); INIT_LIST_HEAD(&dsi->transfer_list); - INIT_LIST_HEAD(&dsi->bridge_chain); dsi->dsi_host.ops = &exynos_dsi_ops; dsi->dsi_host.dev = dev; @@ -1708,6 +1708,10 @@ static int exynos_dsi_probe(struct platform_device *pdev) pm_runtime_enable(dev); + dsi->bridge.funcs = &exynos_dsi_bridge_funcs; + dsi->bridge.of_node = dev->of_node; + dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; + ret = component_add(dev, &exynos_dsi_component_ops); if (ret) goto err_disable_runtime; 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, }; From patchwork Sun Dec 12 18:14:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1820 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C91AB3F071 for ; Sun, 12 Dec 2021 19:15:02 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id x18-20020a17090a789200b001a7317f995csf12110373pjk.4 for ; Sun, 12 Dec 2021 10:15:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639332901; cv=pass; d=google.com; s=arc-20160816; b=cSImiP/c972QMRPQglOpiHv1mCMQtTqGHVZ8ybxN2ptp5sZiz1zhz92Bu1QYofhki/ 4NoNf4K6uc1Gkb0Gd7gyJKaQPYOl7gy2lRdPS3WU0yY2elWb0szEHSzxMRiK9U7FrnCn 3rlJSzr0RXjhPA3rw/sBhzH6UcQ4fb9NkK1ya1gzldgoGCU2Iq5HZaHlPRjCtrEk6/Yl emnnAdFSzq/2h3VkcP0tBFDlRB+IxzgRm0hYvogRXbhk1YdW2n+/qbItFYEnZVc7/dMO XcYGtjn3AdDZtlZHMZzzL/fQ7lVzH+H2gPY2H5/puG3DjeI43F4mD9NgdwVRlGTFvIu6 2QWg== 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=NqI5w3jPrIiHw+Ql1ZvraydQw5GuZto2M1dMy27CdSw=; b=cMOH8fwLmK0+b3br+NlhGmgYeS1pAgVzkHfKPMfw1GCwgRUNM+v/44VZG5qHdUV2nI sD506Yc3MZVdhihxUmGLCd/R3vLcDjzZgB7YF1FzE1vEWJ+Sx9oU45oE3fmC4KV4i1mI QYF8yTj30tv4treBU0/yMLuzQtfK9DxPe3ZZM+UbJ7isxyMDU2AfmCTcLnFQBvZZ67ir Ce1JpbePRcTUSnNDJIf9Rf3nWfFOxqK+5mU9VtiXvWacr1ThKbAC23hQqvYzT60PFx+p AQ5xnqgh7pKoWGruYrTc1T69cItVm1GTQ+4I7fTWA7e24woGJowPor2m+M/T9mbMQEqp 5h1g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=q9mnqUDF; 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=NqI5w3jPrIiHw+Ql1ZvraydQw5GuZto2M1dMy27CdSw=; b=OcGx+lX2u+7EkkuY1ROuuS++I+u/laoPdNxl4j5iBHB4AF++S+YWtFaSdlLGD9Zdpo qQ+P1Y2EoHgcCy9EeCC0iTvZyXM9qObungxbqDRh2R2V5iQow8sBhfAzEA41jvP8fIDn Y2NAigmVuWVUKWTJgw4zU0WYDhxkaFd6pC/M0= 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=NqI5w3jPrIiHw+Ql1ZvraydQw5GuZto2M1dMy27CdSw=; b=cV9jX9Zz21aedFCcGwPbS2pcamnNZk1Pm4MMYJJKJ/uhhR0WlNJVOJoqsaNWeFhYyv R8X4/c/9AwBhDZ0wcOK/1hHtDFmArkXINj8lWT9PgrfKWHvTEgsVptCdBsirPQL5j1Zm TowxhnmIA22kBcX8QsoY3RE3SCI50q81F3mVZm2UmQGRHu9Gr73VPdwMOKawLtJ56uhA 8fOzGdyKuQEDHcGecEeKuvFVu5tHRqLOB9TdUiK6wq0d1JAA4jPY4rKB/D0H9ErX7yQK 2HL0m5+E+avY8q5kMygrkyZkpv/VCNg1SYF/0p+lOTKFgLcGyr8EUdXWWWasxYb1ZXpt ockw== X-Gm-Message-State: AOAM533/gFXkyyGZhprdQpcKZ4I64yEQgYAqvwkVxo2jx/o3Vmwc/FJe uM28uUr2AKeVjQZ3PKP7qbyd9xZ9 X-Google-Smtp-Source: ABdhPJxGm2tMQNRpoLO+piKqpcqgLJ+28TyYaggBw/3X/8nuWkWs/xISuayb1fV8wjNyYEYd8lpjvA== X-Received: by 2002:a62:7952:0:b0:4ac:9a13:5563 with SMTP id u79-20020a627952000000b004ac9a135563mr29876725pfc.17.1639332901492; Sun, 12 Dec 2021 10:15:01 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:3ece:: with SMTP id rm14ls7885279pjb.2.canary-gmail; Sun, 12 Dec 2021 10:15:01 -0800 (PST) X-Received: by 2002:a17:902:744b:b0:142:46fe:7fbf with SMTP id e11-20020a170902744b00b0014246fe7fbfmr89930314plt.83.1639332900796; Sun, 12 Dec 2021 10:15:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639332900; cv=none; d=google.com; s=arc-20160816; b=oXn4kIs5IIegVzLrxtvTY6ssb+A9lN2y5KXE+o334ieWa90bk2gUZQl48ZbTnbKB+S ntZOPC5+nfCyD7lDy635EjTCIOn23WuJyM50QNp4PctzCHFkgdFw9WCZvfUnp41OQigu ydBPXqCoA5ILdHnCqtV5VfQinrbKCGdwIx05lhBdy/Isu+NuRFlojIEOu5OA7XzcSiim hcYaEadjinlkobwDlTghOjxfJ9TKaYfnHQNtaQoFj4Dpc7u+mKdNn+XLfmQwjdhf6Wep 436JhiLXxyIOPfNNGYY/Au56j6ENUoVc+ldRX5uEyJ2EPrNuNcpjoYIDKU6zWhrLy5m8 69CA== 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=N1uoqDXeyfdCAC0lQdnBUabP+VrBthgp4IIjRoUqZK8=; b=BCBvrCaLv5xa3ih7qeuF4Q9mwgo9yz8BYQZZutrqnZPRH2afQnYutIAcnL4aVoCB6V OXdmT2Ff4iGGBzZXIQl6brOl8rgBTKWxNKhEOnweIRFrbddxo95anfCNIve7uRlOGB0c UbMsam1SMznKwLOizCxyFAIGm9uzNOHwJadUy2zUMs5i2sX1/PRuY0fd56BR78Mr+0eb YtT+SAMnJGdLMGXl0dZgYRjaaUFI7OhvHniMRoyofYokxwVfSMcbKN9RRd6B+yO3nVZU ZwKZpd1NzsV/nokkpqas1K8KOm/eWIQI6OnnDgTVoiycsmvawAVhB9/+NSx1eabqdYFP +k/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=q9mnqUDF; 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 y14sor2033643pjr.1.2021.12.12.10.15.00 for (Google Transport Security); Sun, 12 Dec 2021 10:15:00 -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:90a:9a8e:: with SMTP id e14mr38986185pjp.231.1639332900479; Sun, 12 Dec 2021 10:15:00 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Dec 2021 10:15:00 -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 5/7] drm: exynos: dsi: Switch to atomic funcs Date: Sun, 12 Dec 2021 23:44:14 +0530 Message-Id: <20211212181416.3312656-6-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=q9mnqUDF; 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: , The new support drm bridges are moving towards atomic functions. Replace atomic version of functions to continue the transition to the atomic API. Signed-off-by: Jagan Teki --- Changes for v3: - none drivers/gpu/drm/exynos/exynos_drm_dsi.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 07083a545948..feb36a5dc646 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1377,7 +1377,8 @@ static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsi) } } -static void exynos_dsi_pre_enable(struct drm_bridge *bridge) +static void exynos_dsi_atomic_pre_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct exynos_dsi *dsi = bridge_to_dsi(bridge); int ret; @@ -1394,7 +1395,8 @@ static void exynos_dsi_pre_enable(struct drm_bridge *bridge) dsi->state |= DSIM_STATE_ENABLED; } -static void exynos_dsi_enable(struct drm_bridge *bridge) +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); @@ -1406,7 +1408,8 @@ static void exynos_dsi_enable(struct drm_bridge *bridge) return; } -static void exynos_dsi_disable(struct drm_bridge *bridge) +static void exynos_dsi_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct exynos_dsi *dsi = bridge_to_dsi(bridge); @@ -1416,7 +1419,8 @@ static void exynos_dsi_disable(struct drm_bridge *bridge) dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; } -static void exynos_dsi_post_disable(struct drm_bridge *bridge) +static void exynos_dsi_atomic_post_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct exynos_dsi *dsi = bridge_to_dsi(bridge); @@ -1435,10 +1439,13 @@ 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, + .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_pre_enable = exynos_dsi_atomic_pre_enable, + .atomic_enable = exynos_dsi_atomic_enable, + .atomic_disable = exynos_dsi_atomic_disable, + .atomic_post_disable = exynos_dsi_atomic_post_disable, .attach = exynos_dsi_attach, }; @@ -1614,7 +1621,7 @@ static void exynos_dsi_unbind(struct device *dev, struct device *master, { struct exynos_dsi *dsi = dev_get_drvdata(dev); - exynos_dsi_disable(&dsi->bridge); + exynos_dsi_atomic_disable(&dsi->bridge, NULL); mipi_dsi_host_unregister(&dsi->dsi_host); } From patchwork Sun Dec 12 18:14:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1821 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 0D4483F071 for ; Sun, 12 Dec 2021 19:15:08 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id n22-20020a6563d6000000b0029261ffde9bsf7715726pgv.22 for ; Sun, 12 Dec 2021 10:15:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639332907; cv=pass; d=google.com; s=arc-20160816; b=hdMImXmwn1zWQeePeDQKcu1F6eynW/cr+LfHLTc5+ts1jqrGvP1GTHSvfPpor4734O +aFflDroi2+oZOo+CCnfe1LBgPkn4lpr2vXkYHNNL6vA4XAqEBqOkjqo4IBxflimZIKC k482jxkpEHgM3xW8MWcglSeeyFhePC2TeCnxdSdp+ZuVHAhyqGDYfDLl4TkOG2NDFfjP 59+zWlNCerOXRgO0b6a1/q5/Ao4z42CPxRZ6ArafK/nyQkXbytnIHPGRieW2OiIkK58X qNwJMiTa+ySNz3aaQvXCn7bqSvVN7JN/qGA+aeMecze8rbPc00bfMG6n/OOsONP+Ljkx P3QA== 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=Nwkf6oArF8cy+QfimmV9frUtVi9jPxaN1+xXZ9juF5U=; b=DL+8IXt62yJflCf7Wp9ye3FYxQOq8SZyCr88z1Q7gfgMgTvSOGN+Dj1r6P4+Oq//jA 7iP2d54u5rJEzs2rjQF8hsZdykc+ymDLt9IZ5G5GF88wWIlWWxKinJFBrWaS2GIBYmVj QhRmSjad/fXkuRT3QH/FFjONoJpa5NQJke9655GJLxjmMHuK86N5kw5dOxTYdQ/suYgc L+OylqGvjSPG8VJmiq3r7JZ3Jc1VyF6E1v3gAYNFnDHwB7ATyrZRmPzlXbW3LcutIDii VNFcc46nQp7R3iHONye4W89QP87kx0OoycsCU8IuSOwvLiz+F7KTpCESr4sw9zTM2VIU JWDA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CPENh9t1; 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=Nwkf6oArF8cy+QfimmV9frUtVi9jPxaN1+xXZ9juF5U=; b=OKucd8yLfmoBZ+vyGHfzcgzI5ZkAVXzNfwRN3ruK1wrcDgK3wOL0p2qzPVSITQkMxQ 4+xwSbHpABCVRVjCnXgCnzn6DfDwEssOrzJH+GbKAoDV2RLAvIydiCl2u8mm/N59XAWe 7oiJCC8pbZopmnin10t4T+uboXthoxltHMK2E= 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=Nwkf6oArF8cy+QfimmV9frUtVi9jPxaN1+xXZ9juF5U=; b=u7h17JvMezJAi6QHt4pYbn7+9+E6Uo8GxJEJoNghHLy5QckFcCc86UuL8frIjmBwB9 g+L89A2IqtAE+DniwvjV6lods7mK78nqiVsUrEPUYJC+Q20H63CxEMAZv2wZX1HO4+8Z vlOxf3kmoTHBSgcJHbGTsr3z7oH21/BJHNj7MwmH1Q3kpYPp6txS08TrOQ/K+HNoMxUE 2D0ofX1kLgzqbR33fn1KuYTMFdmLma2QFTnnZhtpsL0jtU5WH2H4h63Pde2aNxRhYs3Y cIka9ex3CaHfekDQijEcMo8q0egGElpTaR4gHehwXnvH9XHIsRKseoYqmoyqsEjOuGBM jYoQ== X-Gm-Message-State: AOAM530DHroSyfAmdzVgCtrow13FF+ZkkWtDge4PzPo73k7zIe17c6IJ OBIr26ztdcKyaR3DAxN9+eJPIDq7 X-Google-Smtp-Source: ABdhPJxGXDMsz3N9q5O1Kp4oqyTeJ6gAMe4RFlqc4WITc7HgkfFN+KSxCjo0ZzH8tVDPZhdQFTVzpg== X-Received: by 2002:a63:141d:: with SMTP id u29mr42942859pgl.412.1639332906622; Sun, 12 Dec 2021 10:15:06 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:181e:: with SMTP id y30ls5037388pfa.8.gmail; Sun, 12 Dec 2021 10:15:06 -0800 (PST) X-Received: by 2002:a05:6a00:170d:b0:4a0:c6a9:622b with SMTP id h13-20020a056a00170d00b004a0c6a9622bmr28673618pfc.41.1639332905918; Sun, 12 Dec 2021 10:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639332905; cv=none; d=google.com; s=arc-20160816; b=fgkfxqiCSyOaXqpks8kYPaGXT4jCvR/Ip9BeUAclCTY1jfo7V6qAFVqkeTO4zJTJZi RKKmfaV6YIE82Ml+NFeoI7O67QsZOJlA1tWERChlQXYYtmM0aaRC4kLeNRbBs6L0vElI d5APlu1lHNvTOb/CvF8h54vDPpDJaM3Mm36NUTUDus5D9EuykHxGRfzd6Ki/a9NNTVKN 5z3m1i36N6ySaV+IpOiREjM0Q48a4lI/DfT++g2D3jD8lhdoTHP7WJp1HVIt24Ouh73C rMezKTmTUbfT4/g5cDIIy4hVJO2OjAwMrhSKrcjjQiV7hnz4yr/O5MwJ2Xo1/U8jVJDb w1OQ== 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=AcqL/1AAMwG1X29U8NMxgk5ik806Z4Dgf7qHxGXF4Tg=; b=KlzTDkvhEes1/5W7ggkA7Fd0P4ZWIQGiJlwQrcdU2W6+52edONNYmZks0rj7UQcGOj goSDZdhEGMUhlV8Diqg2+4EPdIIjwLZdhRhwft9a8JnuckhFHVPzp3QGy1S6czSXqUWH MaCGLg3HeFOuo6UI6Dv437fi5Y3pwDJ5My6LUYfA3Bg3sFwamlsh3icZ9NY2DgM77j0R wq7TEGMVSjCSe1L9m2lCawUnUaGWaxFIyVpRgMsBSta+zISTzdVDrKgGSiS2SkwJMGnk 7Gpwu6LJCkP/3KU1XzxTcfodZSbwomYX4IYMk3jKKZtd4V9LKMxyARfioIm1Sk1X1ClQ om3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CPENh9t1; 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 n5sor4209238pgt.76.2021.12.12.10.15.05 for (Google Transport Security); Sun, 12 Dec 2021 10:15:05 -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:a63:fc0a:: with SMTP id j10mr48421414pgi.36.1639332905452; Sun, 12 Dec 2021 10:15:05 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Dec 2021 10:15: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 v3 6/7] drm: exynos: dsi: Get the mode from bridge Date: Sun, 12 Dec 2021 23:44:15 +0530 Message-Id: <20211212181416.3312656-7-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=CPENh9t1; 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: , Now the exynos dsi driver is fully aware of bridge handling, so get the display mode from bridge, mode_set API instead of legacy encoder crtc. This makes bridge usage more efficient instead of relying on encoder stack. Add mode_set in drm_bridge_funcs. Signed-off-by: Jagan Teki --- Changes for v3: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index feb36a5dc646..a2eb82bbb30f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -278,6 +278,7 @@ struct exynos_dsi { u32 format; int state; + struct drm_display_mode mode; struct drm_property *brightness; struct completion completed; @@ -882,10 +883,9 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) return 0; } -static void exynos_dsi_set_display_mode(struct drm_bridge *bridge) +static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi) { - struct exynos_dsi *dsi = bridge_to_dsi(bridge); - struct drm_display_mode *m = &bridge->encoder->crtc->state->adjusted_mode; + struct drm_display_mode *m = &dsi->mode; unsigned int num_bits_resol = dsi->driver_data->num_bits_resol; u32 reg; @@ -1400,7 +1400,7 @@ static void exynos_dsi_atomic_enable(struct drm_bridge *bridge, { struct exynos_dsi *dsi = bridge_to_dsi(bridge); - exynos_dsi_set_display_mode(bridge); + exynos_dsi_set_display_mode(dsi); exynos_dsi_set_display_enable(dsi, true); dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; @@ -1430,6 +1430,15 @@ static void exynos_dsi_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +static void exynos_dsi_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct exynos_dsi *dsi = bridge_to_dsi(bridge); + + drm_mode_copy(&dsi->mode, adjusted_mode); +} + static int exynos_dsi_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags) { @@ -1446,6 +1455,7 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .atomic_enable = exynos_dsi_atomic_enable, .atomic_disable = exynos_dsi_atomic_disable, .atomic_post_disable = exynos_dsi_atomic_post_disable, + .mode_set = exynos_dsi_mode_set, .attach = exynos_dsi_attach, }; 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;