Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp256667lqp; Tue, 11 Jun 2024 23:57:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVl584Z+mlTydmD9OXgfQi2cMA8QqUcU280TKJqTEyHuD19wM67GYiXos7BXEmo9XaWcC6hCCpwIaD6vHIn1JlLVpAF+WGZoXUHGe9fXw== X-Google-Smtp-Source: AGHT+IFTUL97xf9xfljS2DbyyUCpuzG6q5f/1JiwJ4uaU/SvzXv4Q7c6mOS3bjuvCRRBVa5His7p X-Received: by 2002:a50:96cf:0:b0:57c:4867:6738 with SMTP id 4fb4d7f45d1cf-57ca973f532mr703904a12.2.1718175423030; Tue, 11 Jun 2024 23:57:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718175423; cv=pass; d=google.com; s=arc-20160816; b=KNTNqOnkof6taRTgqgdEWT8kA7mfcDfxFWwqj0SOE+1ahRQfbOaPqmyiy87yihAyfp k2b92r3LQLKTqw7MINKTYVVq0MArgsdLE2ZExQjrMO1ICMgBNNPw9vEzYrvSHfpq0pgx WLtV0g6h0vITQbbt/WTkESh9wVSD2xkHko/aPVNq2CvCRdEVimSrmIKC4tVmnq/hANw0 16H7hP30OSwqdYvsC7aDcbPrBwlcL5rQ/Y6BKKAEgA92cFAwoQHfsrlyhpCDKgwJiFvP uoglBKSXdvo9HJrTisJqg/24Bi05UKRca9w1wHaezr14Lz23Y4XFXuDjcG16AhLPNMKg IYgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=wG03wPZUyFCnpqjPuTJO29SWc//FX6AIu54qOV7+JmE=; fh=njnadIT8WOiT4mhJvCXZ9o3Gb4RDnq/zGKjrE+awC2g=; b=PlYo492bO7X8nQqL5Ey7/8Cqlv3QT17wabEFX4NHOCkAulEE78wQ+is92fVTQbNlNB KpAOzH5csuwe0Op+jwjLOyt9nXL/wmEhvksSlztU+XkiVt0v/FRTyoJZJdZNTQjqjXiJ YvH5PX+QaYKZxVBYJggMoqr6WApnY66ulmAy7tooGPIb/PHGru7+2nLSA8o88bwVFAmq bNDTOfChQ8QVD4vS4fgqjM/ngwEnxywji6dumzdz1XSp1gpoT5RdALXLjQXOTF4rp+SU dY068pVe64hjY91eTWWmWcq62X686rKwWsLB1CxCsDYpEsoKV/PPdmf4Iwa50g8w1bZA vztQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=0lxL3cTu; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-211013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c823ad0dbsi2871844a12.621.2024.06.11.23.57.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 23:57:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=0lxL3cTu; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-211013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 905F31F225FC for ; Wed, 12 Jun 2024 06:57:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45F2416C43B; Wed, 12 Jun 2024 06:56:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="0lxL3cTu" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B69DF16B74A; Wed, 12 Jun 2024 06:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718175407; cv=none; b=EGqEoIKlu9nfYUeQPEy0hXiRXaaWwxsaV/KN6P+mqZm35jT+9qkDPyNdblVGi6pA1I5ysiov5PqcMZEFlGsbQX7KTSynnm2SY+XgS1BDQr6Zkt599yqsAnjB+0Gm4G886o4ptoh603g/HbbnnvWjVVQnM9Z4w0ouGNxsa2apPMw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718175407; c=relaxed/simple; bh=RqWoePL1Q6iU3sdu9DKboclLb+W9to1PhVkie/Lx2vc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Xe7Adof5cEnwlF7vE2O0U9eRyPlxWmNzspyqm0wzofkJcO0Adwo8OpxBjWyjz7lwobX06hqM7K3AbySLGhOvnxqCuXicVeik7f3MxJcih8C+z2T7kX1xwqjymj1D+vvK7VGQ58GAIbfCb1CG8BE7Wa17jM63JS3hvR7mzYPoAHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=0lxL3cTu; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718175398; bh=RqWoePL1Q6iU3sdu9DKboclLb+W9to1PhVkie/Lx2vc=; h=From:To:Cc:Subject:Date:From; b=0lxL3cTu3MRLgAJZar68JUNLvYRfJAuN6G9BLUXmRtDF3t7/68lxb8itLbdFeAfvk pWWe0xwXY4cAgKtVDEz1LYTkKnvpHhyGWmCnu6xATgxTu5n3gBML23mxs33Jkgwiuy Fm+Dr86cLAtTZZsKfu2naEBbZKa7lZGvugEChqy+L+F4xoE/3WJtmBpCrmUNI6WYMg VoODz5tGkfiLABkXiD6dWXhpUSCNQh4Bz4ep8RP72Fi+MMSLSd7z2USclcd5fMzeps GcHM2/z/h5ZjkuRbC1rHylOT9Vj1dCdqXn4PgyzSkYv67JfChp1DbNXE95vXKCkcKz NVeO4g7D5YB7w== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id EAD163780016; Wed, 12 Jun 2024 06:56:36 +0000 (UTC) From: AngeloGioacchino Del Regno To: chunkuang.hu@kernel.org Cc: robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, shawn.sung@mediatek.com, yu-chang.lee@mediatek.com, ck.hu@mediatek.com, jitao.shi@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, kernel@collabora.com, sui.jinfeng@linux.dev, michael@walle.cc Subject: [PATCH v7 0/3] drm/mediatek: Add support for OF graphs Date: Wed, 12 Jun 2024 08:56:31 +0200 Message-ID: <20240612065634.26569-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Changes in v7: - Fix typo in patch 3/3 Changes in v6: - Added EPROBE_DEFER check to fix dsi/dpi false positive DT fallback case - Dropped refcount of ep_out in mtk_drm_of_get_ddp_ep_cid() - Fixed double refcount drop during path building - Removed failure upon finding a DT-disabled path as requested - Tested again on MT8195, MT8395 boards Changes in v5: - Fixed commit [2/3], changed allOf -> anyOf to get the intended allowance in the binding Changes in v4: - Fixed a typo that caused pure OF graphs pipelines multiple concurrent outputs to not get correctly parsed (port->id); - Added OVL_ADAPTOR support for OF graph specified pipelines; - Now tested with fully OF Graph specified pipelines on MT8195 Chromebooks and MT8395 boards; - Rebased on next-20240516 Changes in v3: - Rebased on next-20240502 because of renames in mediatek-drm Changes in v2: - Fixed wrong `required` block indentation in commit [2/3] The display IPs in MediaTek SoCs are *VERY* flexible and those support being interconnected with different instances of DDP IPs (for example, merge0 or merge1) and/or with different DDP IPs (for example, rdma can be connected with either color, dpi, dsi, merge, etc), forming a full Display Data Path that ends with an actual display. This series was born because of an issue that I've found while enabling support for MT8195/MT8395 boards with DSI output as main display: the current mtk_drm_route variations would not work as currently, the driver hardcodes a display path for Chromebooks, which have a DisplayPort panel with DSC support, instead of a DSI panel without DSC support. There are other reasons for which I wrote this series, and I find that hardcoding those paths - when a HW path is clearly board-specific - is highly suboptimal. Also, let's not forget about keeping this driver from becoming a huge list of paths for each combination of SoC->board->disp and... this and that. For more information, please look at the commit description for each of the commits included in this series. This series is essential to enable support for the MT8195/MT8395 EVK, Kontron i1200, Radxa NIO-12L and, mainly, for non-Chromebook boards and Chromebooks to co-exist without conflicts. Besides, this is also a valid option for MT8188 Chromebooks which might have different DSI-or-eDP displays depending on the model (as far as I can see from the mtk_drm_route attempt for this SoC that is already present in this driver). This series was tested on MT8195 Cherry Tomato and on MT8395 Radxa NIO-12L with both hardcoded paths, OF graph support and partially hardcoded paths, and pure OF graph support including pipelines that require OVL_ADAPTOR support. AngeloGioacchino Del Regno (3): dt-bindings: display: mediatek: Add OF graph support for board path dt-bindings: arm: mediatek: mmsys: Add OF graph support for board path drm/mediatek: Implement OF graphs support for display paths .../bindings/arm/mediatek/mediatek,mmsys.yaml | 28 ++ .../display/mediatek/mediatek,aal.yaml | 40 +++ .../display/mediatek/mediatek,ccorr.yaml | 21 ++ .../display/mediatek/mediatek,color.yaml | 22 ++ .../display/mediatek/mediatek,dither.yaml | 22 ++ .../display/mediatek/mediatek,dpi.yaml | 25 +- .../display/mediatek/mediatek,dsc.yaml | 24 ++ .../display/mediatek/mediatek,dsi.yaml | 27 +- .../display/mediatek/mediatek,ethdr.yaml | 22 ++ .../display/mediatek/mediatek,gamma.yaml | 19 ++ .../display/mediatek/mediatek,merge.yaml | 23 ++ .../display/mediatek/mediatek,od.yaml | 22 ++ .../display/mediatek/mediatek,ovl-2l.yaml | 22 ++ .../display/mediatek/mediatek,ovl.yaml | 22 ++ .../display/mediatek/mediatek,postmask.yaml | 21 ++ .../display/mediatek/mediatek,rdma.yaml | 22 ++ .../display/mediatek/mediatek,ufoe.yaml | 21 ++ drivers/gpu/drm/mediatek/mtk_disp_drv.h | 1 + .../gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 40 ++- drivers/gpu/drm/mediatek/mtk_dpi.c | 21 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 301 ++++++++++++++++-- drivers/gpu/drm/mediatek/mtk_drm_drv.h | 2 +- drivers/gpu/drm/mediatek/mtk_dsi.c | 14 +- 23 files changed, 741 insertions(+), 41 deletions(-) -- 2.45.2