From patchwork Tue Dec 19 17:00:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 18313 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2078236dyi; Tue, 19 Dec 2023 09:01:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9CisIVxDfhWWlmlI7fYqZZHL2G+kKldpQO3TaAS2GojxALYWqm1y9WHSZ4ILX1WCOoGXi X-Received: by 2002:a9d:7a89:0:b0:6d9:d715:1196 with SMTP id l9-20020a9d7a89000000b006d9d7151196mr16377289otn.46.1703005313469; Tue, 19 Dec 2023 09:01:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005313; cv=none; d=google.com; s=arc-20160816; b=Ri+ImjWjHmpEAlo+nXFSM6EgIDYU7SVhd8qVwmFvCNy4krFkBEFH3CSqVoO09UQkF+ xIivAXfvNoc9qLWoMIzqc98zP54tgPDcsM3JGjhqelWRzEq9DBuJnlBTwr3D+xhvKO9p Y2mbuXCXfCWxA5zwH4j5cCh+0WOWqV2wq3FBInJa03Sm6Pre7nn4ATB+8LQQC3/m/Miq 0m6D68kUmbC9ZRqiYHuI8oLd0HytXs3nxeHp+SffnLiLQ37cjGniCxzWFvYDDzc2ghCa 2EfnOrCOvwRVIN1YWhICgcFUmTXOlqDB+HK80Y8YO4GD49RI+KVwtc+qasfk+SGUjUDt VQhQ== ARC-Message-Signature: i=1; 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=N8PJRoWBXdJr6P9kQaOUuh4wo+XEtKpMrItz+79btFw=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=SPnZRkAAp95DVzTDjhYYGDet+2DCo9e7aCaeo9r031TirFem02N4Y3lcNwEI/dJQFg BC9aHInGHdkx1ZD3sYxpBGHLPDRkMhThBUAuooLLnYaN0M4ev2ASvNzHmSiQgUxiPVCW 8B5bFJS6lbf8nppmni0waM8dczhmxjlVEu5tNcAxvet6wtPJToSVdzb/VvSKwv/0tKPN M+OkEL/wbmWxgHe/QE0dZRUQlVVHng57sJpzJgB53JEs6Y62bECrGwxkjbN4R4TA+z3A YZdqbSbvH4GrubM0BTT0RGaWgH91zkwmx6MfHLBy6P0WGI/f2bOhZdnurfLJRdZZ22mb nsLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Lv4H5WVm; spf=pass (google.com: domain of linux-kernel+bounces-5618-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5618-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y8-20020ab077c8000000b007cb71baed5csi2228052uar.41.2023.12.19.09.01.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5618-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Lv4H5WVm; spf=pass (google.com: domain of linux-kernel+bounces-5618-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5618-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 924B31C24CD7 for ; Tue, 19 Dec 2023 17:01:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D40A3174A; Tue, 19 Dec 2023 17:01:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Lv4H5WVm" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D90593528A; Tue, 19 Dec 2023 17:01:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40c39e936b4so54776015e9.1; Tue, 19 Dec 2023 09:01:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005267; x=1703610067; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=N8PJRoWBXdJr6P9kQaOUuh4wo+XEtKpMrItz+79btFw=; b=Lv4H5WVmmHjh6FDocZ0EcTxko9sxjkyxDbsrCzCj2kh3aZTFchU4GRUo5edZt8LhGX M+a2OvOas3yGhk8BUZsdLAIbr1jntK3/UzrUCM2U3ArflkJFIbRca/yDGUljNRfdHG7S SnNu8MWpBUktqdpQUREtTnTFAVTu/HM7Vp9AWVfLJYck4AFhxoo+EoprHqJyNj/a2WIv hxqJzoh4XfZUgf1imDh+MoEp95rqeQLlClv+GiEL/Jtd6er9txvwAmSPhjvku2rvxdid Tx1AD2sLamyeu3oGsuSLIlJN2lGTb0ur6ezLTZHZTqDjxSEhEXN7+Axmc0LuOiNr9BAD qOWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005267; x=1703610067; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=N8PJRoWBXdJr6P9kQaOUuh4wo+XEtKpMrItz+79btFw=; b=oOHwRGzGgav97DACkUs6wA1icavZtJYf9oEZklh7zILQG4PtIc3lcUuSQauMlV6jtQ 8rMtBf1sSSrciRuetHND32f1eCJzIs9lvPgVVOD7DNL4wKHFXFvB4o6zkVxwSZK/QzSE TbdRPJB/UEZe4amda3DSUNloQhEs0ZiG16VCllNRTqA6mIyZba2ZCIe6evUtcfxFnAjl Z1fNzU4p9bylRLnBz5aAMaD9gOkZnQaYpsTyJAIx6DtrmTWnXtNOlTT+1db7+Fa3Si7I 9Y4LEb2xGCIRuVi0Jb8jevbH3at8h6GJ+tdtnzCK1ExFwCAqEnDBzV/5mFfm1JV4heDD 6V6g== X-Gm-Message-State: AOJu0YyrQAf9Eh94XBoVQKkdFAylfF5QgQPSC0k5WLM8YEJe/KPRgnDS LOQ8aj3ftt/+BZ/OkMg+9A== X-Received: by 2002:a05:600c:4706:b0:40c:6a6b:ceed with SMTP id v6-20020a05600c470600b0040c6a6bceedmr1998676wmo.259.1703005267112; Tue, 19 Dec 2023 09:01:07 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:06 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 00/29] Add HDMI support for RK3128 Date: Tue, 19 Dec 2023 18:00:30 +0100 Message-ID: <20231219170100.188800-1-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785730499444757636 X-GMAIL-MSGID: 1785730499444757636 This is version 3 of my series that aims to add support for the display controller (VOP) and the HDMI controller block of RK3128 (which is very similar to the one found in RK3036). The original intention of this series was to add support for this slightly different integration but is by now, driven by maintainer's feedback, exploded to be a rework of inno-hdmi driver in large parts. The VOP part is very simple - everything we need for HDMI support is already there. I only needed to split the output selection registers from RK3036. The VOP has an IOMMU attached, but it has a serious silicon bug: Registers can only be written, but not be read. As it's not possible to use it with the IOMMU driver in it's current state I'm not adding it here and we have to live with CMA for now - which works fine also. I got response from the vendor, that there is no possibility to read the registers and an workaround must be implemented in software in order to use it. The inno-hdmi driver currently gets a lot of attention [0-2] and I'm hooking in now also. As requested I incorporated some of Maxime's series [0] (and tested them). I have intentionally not removed any code dealing with output format conversion in this series. In contrast to the input format, which is always RGB on this platform and certainly can be dropped, that can be implemented later. And secondly I need the conversion for RGB full range to RGB limited range for this series. I did also some smaller driver cleanups from my side and implemented a custom connector state which now holds the data that belongs there and it is not longer in the device structure and, of course, addressed the feedback from v1 [3] and v2 [4]. Please see individual patches for changelog. Note: Patches are based and tested on next-20231213. [0] https://lore.kernel.org/all/20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org [1] https://lore.kernel.org/all/20231204123315.28456-1-keith.zhao@starfivetech.com [2] https://lore.kernel.org/all/2601b669-c570-f39d-8cf9-bff56c939912@gmail.com [3] https://lore.kernel.org/all/20231213195125.212923-1-knaerzche@gmail.com/ [4] https://lore.kernel.org/all/20231216162639.125215-1-knaerzche@gmail.com/ Alex Bee (17): dt-bindings: display: rockchip,inno-hdmi: Document RK3128 compatible drm/rockchip: vop: Add output selection registers for RK312x drm/rockchip: inno_hdmi: Fix video timing drm/rockchip: inno_hdmi: Remove YUV-based csc coefficents drm/rockchip: inno_hdmi: Drop irq struct member drm/rockchip: inno_hdmi: Remove useless include drm/rockchip: inno_hdmi: Subclass connector state drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range drm/rockchip: inno_hdmi: Don't power up the phy after resetting drm/rockchip: inno_hdmi: Split power mode setting drm/rockchip: inno_hdmi: Add variant support drm/rockchip: inno_hdmi: Add RK3128 support drm/rockchip: inno_hdmi: Add basic mode validation drm/rockchip: inno_hdmi: Drop custom fill_modes hook ARM: dts: rockchip: Add display subsystem for RK3128 ARM: dts: rockchip: Add HDMI node for RK3128 ARM: dts: rockchip: Enable HDMI output for XPI-3128 Maxime Ripard (12): drm/rockchip: inno_hdmi: Remove useless mode_fixup drm/rockchip: inno_hdmi: Remove useless copy of drm_display_mode drm/rockchip: inno_hdmi: Switch encoder hooks to atomic drm/rockchip: inno_hdmi: Get rid of mode_set drm/rockchip: inno_hdmi: no need to store vic drm/rockchip: inno_hdmi: Remove unneeded has audio flag drm/rockchip: inno_hdmi: Remove useless input format drm/rockchip: inno_hdmi: Remove tmds rate from structure drm/rockchip: inno_hdmi: Drop HDMI Vendor Infoframe support drm/rockchip: inno_hdmi: Move infoframe disable to separate function drm/rockchip: inno_hdmi: Switch to infoframe type drm/rockchip: inno_hdmi: Remove unused drm device pointer .../display/rockchip/rockchip,inno-hdmi.yaml | 40 +- .../arm/boot/dts/rockchip/rk3128-xpi-3128.dts | 29 + arch/arm/boot/dts/rockchip/rk3128.dtsi | 60 ++ drivers/gpu/drm/rockchip/inno_hdmi.c | 543 +++++++++++------- drivers/gpu/drm/rockchip/inno_hdmi.h | 5 - drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 13 +- drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 3 + 7 files changed, 478 insertions(+), 215 deletions(-) base-commit: 48e8992e33abf054bcc0bb2e77b2d43bb899212e