From patchwork Wed Dec 13 19:51:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 18010 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8030294dys; Wed, 13 Dec 2023 11:51:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFENN/lH16rhn1d3nn5dHviHz1Jo3GGHi5phpaG/qTbab1C0dThUmCyfOIe+QnU6kxOa+YU X-Received: by 2002:a05:6a20:8f2a:b0:191:618a:6146 with SMTP id b42-20020a056a208f2a00b00191618a6146mr4956773pzk.40.1702497102117; Wed, 13 Dec 2023 11:51:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702497102; cv=none; d=google.com; s=arc-20160816; b=LvWVN2o0mNK8QDbKTdyKKY06uj5r8CIac99ojV6sT1hfmbCBMmMCFg57loLR0qN9J8 /Y9Elpdnfa7tBTb/3216HQtT+u5SzJMRGDrSuWTgDiBZo73B59JV0+NW1oQmrbqGuOv3 t9f2B/EkbaDvPqqKxoRuFjuxNcyE/km+lJu8baBy0CNpoEhG2Q7FdRp72wmfupQZdj70 8q2w0Nb287XS2VmjspKXy9n1ZNoKRQ5bnX8YZ2q/eHQx6LB6BD9Ai7au4oDShJafO4gf B2NVHtb34F5+bj8xztyB9C6jJVOX6O7ET+nwfBuWtZWZcRwWOUCZM/uDaaufWNETjQVz 4woQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QQ00PVQEEsbBDsAiHtNgQwoZD5SKSh4mT5UUe1TRdHc=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=iccPDMIcG9T3AV76maeAtVSfs1h08nwKMZQK7BMv0gTBZgXqBoar5Gmt2Vb5IHNJeb WyJhnOTafRom4+BsTx36ls1qqKnuJB3hlGKFtPxtjZlGFUE+6AeTnSAfDpLB2OkA+03d DjG/ol4SstPFuXuuUtmNCnfckjT1nOyYPNxPnkYjAQfwAteyuqheqbS7a831AtCzbmgL rXRDGNX3ZJ+khzobkcRp24SbgdLgP3+Dljd7cjskyh4KS4vhLJ753cPXedkGlC5lFcVr MhTD5eWam5imRF7hLP33czdTRylpGExClVB+k+7wEKFh0SqfBxkOyMtvkhVQbsNpyxVR kcWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=i9MenSoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id q13-20020a056a00084d00b006b7b42fe43asi10192627pfk.185.2023.12.13.11.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:51:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=i9MenSoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D52AE80BD526; Wed, 13 Dec 2023 11:51:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233803AbjLMTvZ (ORCPT + 99 others); Wed, 13 Dec 2023 14:51:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbjLMTvW (ORCPT ); Wed, 13 Dec 2023 14:51:22 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34BE9C; Wed, 13 Dec 2023 11:51:28 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-336460c22feso59942f8f.3; Wed, 13 Dec 2023 11:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702497087; x=1703101887; 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=QQ00PVQEEsbBDsAiHtNgQwoZD5SKSh4mT5UUe1TRdHc=; b=i9MenSoq+S27p6EzkdVt6PoHi4c17XnWcXOTriSJz+4SquG6SUgS/WD1bHhf5GVrzc CZmGwvp41tja5QZI7zwkC1iJ/7YwDxvdNHjORKS5Q8ni6kFfllarwjpq/JRuLquQjNPV cbLybRJ0n784+FPefsXgIsJEaNA6Po/M2XApxbIhLYIXH/cEJladXgr3+PBy+9rymHjn ctuXh6M2mZeMjtnMPEn5BN7UOdHZw4jiXb3IKv1H+Nj/5uKVTgaILaLJOg4+QAAwVPMV V1RjDjcU8gXaea/T4xJ9ob1KSV8JjOuro0iUtwVJcxuHAkPFm9WGkcZH29RiTS5p+NJi Cr7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702497087; x=1703101887; 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=QQ00PVQEEsbBDsAiHtNgQwoZD5SKSh4mT5UUe1TRdHc=; b=Csg5Z4omRBOTqGEckbhk+VSoRA+x1Q1xOj0SvpriYqX/Gs9bSbC8BHP8agEweQyiY2 auX5OkERs49air3hTkPeTcAxEgcT00q/jsjpjlmBF+n8Xdseu0jwbCFflkf7JCwy3txt x3FqIo6JQ3/Y58QBZWNCFIOSeWC3RnsnhhlVk7y9sk2Cm1myq09n0H6mnoYrF58GhHIQ LJ4OS3RkZdfZTEuBrA9lbijVePkVHciHbCgSw38YkByHKiQeUkdLYRDYo9RJpxEgLSa5 K/BmScMroD5bl6BjWSnRDbM/4aElhioeJbriocKN9uqYSRhZu8DBkS1UUobKkMIg443c kRzQ== X-Gm-Message-State: AOJu0Yw8nPJBlDjVbtTrLJKlaDgAQ/I+RcyqDVl21O45MHdvx72alTBG qkuEuzj2eKx3q4FX9GnzpQ== X-Received: by 2002:a05:600c:4f05:b0:40b:5e59:ccdb with SMTP id l5-20020a05600c4f0500b0040b5e59ccdbmr4822082wmq.188.1702497086918; Wed, 13 Dec 2023 11:51:26 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:92dc:8b1c:e01c:b93c]) by smtp.gmail.com with ESMTPSA id fm14-20020a05600c0c0e00b00407b93d8085sm24050698wmb.27.2023.12.13.11.51.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:51:26 -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 00/11] Add HDMI support for RK3128 Date: Wed, 13 Dec 2023 20:51:14 +0100 Message-ID: <20231213195125.212923-1-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:51:39 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785197601575558904 X-GMAIL-MSGID: 1785197601575558904 This series 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. Andy, maybe you can shed a light on whether there is any way to not have to write the registers only and hope for the best (a.k.a rockchip,skip-mmu-read). I have it working here locally - but nothing for upstream (yet). The inno-hdmi driver currently gets a lot of attention [0-2] and I'm hooking in now also. I did only the bare minimum to get a correctly colored picture and a stable signal for RK3128. I leave the cleanups to those other series and will come back with sound/CEC support later. It shouldn't interfere to much, only the csc-part must not get dropped completely and the mode-check-hooks are no longer dead. 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 Alex Bee (11): 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: 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 .../display/rockchip/rockchip,inno-hdmi.yaml | 30 ++- .../arm/boot/dts/rockchip/rk3128-xpi-3128.dts | 29 +++ arch/arm/boot/dts/rockchip/rk3128.dtsi | 60 ++++++ drivers/gpu/drm/rockchip/inno_hdmi.c | 203 +++++++++++++++--- drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 13 +- drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 3 + 6 files changed, 309 insertions(+), 29 deletions(-) base-commit: 48e8992e33abf054bcc0bb2e77b2d43bb899212e