From patchwork Sat Dec 16 16:26:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 18181 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp313097dyi; Sat, 16 Dec 2023 08:27:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHT/1pLSVxIWWtktEmcr+lYTCrdeSw5tZXtnKsuMMhrgnjznwaHpqSlQ1PN+4+1TdNW2Qld X-Received: by 2002:a17:903:41c4:b0:1d0:4cde:6e23 with SMTP id u4-20020a17090341c400b001d04cde6e23mr14951438ple.53.1702744074932; Sat, 16 Dec 2023 08:27:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744074; cv=none; d=google.com; s=arc-20160816; b=GqMMo7YKxa0YPASlMqa508VZ8MdMTRCJe1fAg4xACMVVyQu6BDksnVWh/r6XUue+uJ mf3bX8lM3vz0ZNeC+ObVAq8UozD+Pup7aP/u5ZdVqgOM5179Vpvh0w4RynJKVBNMQZ1n MOSx1lnWhq3u4wYHflznUsRWUaCp8dl3rKBg9BIHXKhwQ2Z15AZDo6bDjSKKo2ygW/bD bGdWRiG2HFcRbHxIey+qZdIrNFMzdx3ZQ3l+byJMK2JOCiVp8oYn0V5/MNWoRNEdglmK gThDZid9lMRWXicgvDWVFLFB/GSlL79vdV2vGCgZsFr7lRA4DE+s1RsEhXWOEu1ECQan uMHw== 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=O0spUUbJmjQwgFVWf1CEudZTaYU98S6ce2Q20/X/yT4=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=K/l2EiyVUCa1SqVKdMA4+w5lWYtu69v25yQz9XukSumsFz4UWou5cTDcNmtpwvzgGk DZD6EZDMdmC4roHJlQYdHVD9P33AYSddqElwbWFLvV8jtFNW/qrdbgtRRoaUDpMkZTCE GfMdDpVFGIGF9N3X1owdW1M4R4wE89F3mWp1/IJAYFnZZbmzrCmisW8L/mjm563Tg9A4 zsfDrdDmfJ5Y+v8Ori0Xnr0ssm7M/23A1vNVyEHmycvQ9Q3a458eO9tz3sSJ3nc68KrE Hk9NCXTwlW4gsj1MJC6YfHlIc7PZZ6nso4dx6gGnBnpVRRy3sXHIv5DMLYihKfhMKpZQ Ux3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=S1MD+Ofo; spf=pass (google.com: domain of linux-kernel+bounces-2248-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2248-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9-20020a170903230900b001d06819a68esi15351977plh.134.2023.12.16.08.27.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2248-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=S1MD+Ofo; spf=pass (google.com: domain of linux-kernel+bounces-2248-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2248-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B435828546C for ; Sat, 16 Dec 2023 16:27:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E08C6315B5; Sat, 16 Dec 2023 16:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S1MD+Ofo" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 9E2E73035F; Sat, 16 Dec 2023 16:27:07 +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-ej1-f46.google.com with SMTP id a640c23a62f3a-a22ed5f0440so204924366b.1; Sat, 16 Dec 2023 08:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744026; x=1703348826; 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=O0spUUbJmjQwgFVWf1CEudZTaYU98S6ce2Q20/X/yT4=; b=S1MD+OfoA1hhMKWAVQthnXx7z4Vc8n5ivNKZ8mNZcSqFpI6qn2mhS3I4PUbQyrW21W s7Kzf8ffgac92pdMQ6VTnlpnRwBnMHMz4ed+R4TQluHlmI1e3VtwikImEufbbXRtjlvS 1qBOfgginfyD5GN5a0u3aVPcwb58zKIqJCQj3sJzEf4v4WXhyS14z4FVehdX0v7M6Odf 6vt9IX+8purdHDzOTxfhb16xGvzHXom3xfm2xAje1hkykHl/A4x5QGTuXP6x1YCOJ4Pm 72OhLQRMKslv/DFPeXOHhpmh0QrzZQPaUezLAkZ5rMvsy2bpAb2l3NyxRDu2IjsH8teP /70w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744026; x=1703348826; 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=O0spUUbJmjQwgFVWf1CEudZTaYU98S6ce2Q20/X/yT4=; b=Eu23nn3YSOUfYR5n0kZOJbM3bz0NHi3BSDENS6RGZ2BfmIkS+N/p5xAPtb+ElJ9d/W I4fbvkcIrggStN3ufG/d1takrwas/GVKnMwbmnhk3uG6ja7IkzNlp1BEUyg1/j7kjPxM wkg9hu9UEvvq06wX3jdyjSJPH+IJPI7jOqHC+c4TwXDwdw97S+7ZHHwSIjHlbr09i4GK Zi9XJ53IvtJUhQjRZ+/ugnOnhI4MGWGqjtE1jy+qpniUlplNaRkqrUefD111LBtQDemb bNc6yfAymCbo2mKJCyR1nC1HUEjzt2vRatHAxJFNd1c+NjScDNhIg8rsWq+mxalLLBKC UWfA== X-Gm-Message-State: AOJu0YzMolI/0pSEYMmESI+P7J39sXquiuUTprrCRbZCcI2I5CXxrHqc mCBo4OTiASU4vQVte8zx7g== X-Received: by 2002:a17:906:284d:b0:9ff:1dea:83b6 with SMTP id s13-20020a170906284d00b009ff1dea83b6mr4318104ejc.4.1702744025687; Sat, 16 Dec 2023 08:27:05 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:05 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 00/27] Add HDMI support for RK3128 Date: Sat, 16 Dec 2023 17:26:11 +0100 Message-ID: <20231216162639.125215-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: 1785456571260935217 X-GMAIL-MSGID: 1785456571260935217 This is version 2 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 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]. 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/ Alex Bee (16): 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: Move tmds rate to connector state subclass drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range 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 (11): 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: 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 | 482 +++++++++++------- drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 13 +- drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 3 + 6 files changed, 448 insertions(+), 179 deletions(-) base-commit: 48e8992e33abf054bcc0bb2e77b2d43bb899212e