Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp199695lqp; Tue, 11 Jun 2024 01:29:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4IJeXVMdsoPomY8Vo2QKNyWv1/UK+w0h7fzqqO+hT1vDAKczWzjC3Jdq0G6+4vQdzhYQiFzVUpwFtiPWcWTy78eBG0mT4EbNS+3eEAQ== X-Google-Smtp-Source: AGHT+IFF1xqPRsSPpqulVQ+2UUZE8ufoeBtUIWfswOMn9AiFmVg3ix31yb3PrwLUgMjylaBXEdSh X-Received: by 2002:a50:cd98:0:b0:57c:7435:d88d with SMTP id 4fb4d7f45d1cf-57c7435da18mr4303933a12.32.1718094580130; Tue, 11 Jun 2024 01:29:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718094580; cv=pass; d=google.com; s=arc-20160816; b=IicyVYAS/+q9NUpXC9e/roqtlaZ09A1Ykir3IlML14Bd2ujOsn4vW2ZgQ/W2K0+MIv GyOvcRVuwWWE3GHhmLax7zFKsEzMKxpxESVLAZcnN1HkvOJG1jlr5NQ714jRXnEVTe+V lPklAYe/IgWjwIDQilDiW92yA5bcjgMlZJ8P6AsPRnxjd5u5v2AG4YEGiSIhKI5O22NK oqhb4VDwC9/pGM+LWJIIQDNex2gZYFBxMNnDhm7/CT9Q0m/o3iFa88sEMcaT7xE7cP9q OUtJUi8W+W7Wrf0J/eNs5oc4fIRKaQQEgVp8W5wZKr+o+/adX+21N4gqTy8//aEHGseq Mtbw== 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=Lps/lRk8wCctrOa6SP4BXPly4zJgKTWCmfz8p38wU3c=; fh=njnadIT8WOiT4mhJvCXZ9o3Gb4RDnq/zGKjrE+awC2g=; b=chZpmy0j8vhHTKgWr8JmMEQCoJ5ZEyqJLNDeJMrNDrv4FKujtSa0DeQp2GCCNQj0eh 2EWJn5qEukbhk/GUJxzmW32yvTykG/XiDc9MIMkBdiz9KKRB5UewaaOfIkNNOF2okWsR h2bqLDBHyQcIYIX7GR4Qyi9Ks6z3DALjpNOPDQh2o5aEXzXwzOUtYzjzfzUBQJLAZwH7 cpjOnPhFw+PKBzIXhXj9AQHXGcpTzKf8fJz22u2i2GudmJ2r8HiGrtExrKwU3/G0Zjjh wV2qWP9GpkmO9gluCDiGDNIgNgc1/EEPzjsxp/A4KnhWi8eAwg41Cbf8xXaG+vKNaj4j V5Yg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=m6UNjadA; 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-209475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209475-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-57c60cffc8csi3992475a12.322.2024.06.11.01.29.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 01:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209475-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=m6UNjadA; 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-209475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209475-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 DF7EF1F26014 for ; Tue, 11 Jun 2024 08:29:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 224DA174EE8; Tue, 11 Jun 2024 08:28:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="m6UNjadA" 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 7B631176228; Tue, 11 Jun 2024 08:28:37 +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=1718094519; cv=none; b=TwRF7EQ5NGsu+XheBbCD4McsLkKpnooFwzdTStK8bXCr8/eiL+YT8MsNNv2zBd+aXd0BLUolqoSo5lO3qJR/eNLoEfl0oxFL+WPqsbQ0kiRY4ZfeUFo1tp9q7IJnO0ODORL7Qv7EDXj9xZRVlC6aYVmb09jXLvllnXmRW7JVuvg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718094519; c=relaxed/simple; bh=BQ7/CX8Uq5/AKnNECvrCCtGKQkQVNG4GKBrA7gIgU+I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Tb+6++T7t/VzH+zbLDH+8zZHnTSw6Q3QENvcoFjKVrpUo8vyyO+AtuH9xfQwQk1PniCpau69DnQ3MCKK0IpTZfzI7iRQ6/pLdRg+swDHGD/M2hXgnqw7FMruEmfnVZakoUupxXWQvRiI7mb9fur1VhtcwV4NMfrNwGKV6cuieso= 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=m6UNjadA; 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=1718094515; bh=BQ7/CX8Uq5/AKnNECvrCCtGKQkQVNG4GKBrA7gIgU+I=; h=From:To:Cc:Subject:Date:From; b=m6UNjadALp9vNMjng4ezSc+qmjluKDuvV8//3tnANUT2XVUStmFEcOfezarXPnLFQ aNeYb7X/rQog86Qo/IOwYW8HkbzFANHU+FRW9nRzhiB7+YGNFK7YuILqHt0EAsFdwN NL8Z2dq91ICRk8qaiBHtBMJhM03Gs2ILWZBOIdKwQ/W1HGMd+ffqE3MUah2axhMQHK 4wnmirilPpIJYCYAPQHVUrd5W+TXi3u2cDLbtBKkLT6Irya4UnPOJQMUg1/abb0mwQ QJoPKzXYGN1adKkyNC90lfEfuN6YaKcBykyPD+LRMVSMaCDvlrwh3ci1IW3UlMl8bX hQiLN3jTiYO6g== 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 CEE5F3781013; Tue, 11 Jun 2024 08:28:33 +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 v6 0/3] drm/mediatek: Add support for OF graphs Date: Tue, 11 Jun 2024 10:28:28 +0200 Message-ID: <20240611082831.477566-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 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