From patchwork Sat Dec 16 16:26:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179868 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp313183dyi; Sat, 16 Dec 2023 08:28:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoCEmH9fnPG3/qXPzbAlr15d8sKEiN+HevwsH2oPLk7vmYGI1566OwcEiLWJRuSD+BynBk X-Received: by 2002:a05:6a20:a1a1:b0:18f:9c4:d34f with SMTP id r33-20020a056a20a1a100b0018f09c4d34fmr11631784pzk.63.1702744085546; Sat, 16 Dec 2023 08:28:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744085; cv=none; d=google.com; s=arc-20160816; b=M8Dry2I6J1FO4UpNUR0Ng+SjrbLwR811JtamFNqnnZoxw95s7kG6c6FgIvXHS1eldL PO1dwfhf8qzj3GWzRb9lXtOLN6aDXGTmHjWl4MpJT+IwDd0XGY7TZM50AhjVMLimUCmy yVl150tOeMkOHBG1yISrbxtTHt9cA5m1dT8P6zhYFDtYlvtfYUKhVl5noYVzlGshBCSP wvPE3mLckzh7e1aI4k/+dG6tl5/7kNFwW3kKSsrI/Ovfl7lS10MSshA3oBOc0T3wKbQ/ GSHfbZwdPgYLoqrJpJLXaujI1YxFAMKPIYQzFVVhoFqrSnkF8ZTZgmE0mx4bix0e6d1U GkRw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=obq8YELyZEbke3rZFXNs+HxX85EVdqoEFqpud8UWY9A=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=nq1oVhBj/y4aLlNEE5AVee2WoBDLKZvvyhy2SDMaxkolp7ggPNn7rHuCK+qB+1i8gH 0lHcaIRJLhLEImka0RrZTULZpz03yucrbf20W6YD4Kru3kbHBoNSGmyYL5/+r48rPLzO kcXLEIXxzWXp8MCAxORsP5mz2kBku2HWLnZPuxyNIMge1IrydHt8AXPRD6AaYGz7qcUq cFHcTcgolHGfouz/yUC/7NeI6SoY9eBZCLH+NDCTeXa/afWTxswBWV4VPtwBLrcnEbYV MfMECaT2UIltjaGjEcatCjOt+MUNpg5GKsPfWMR567X8Fd7QXJxNnYttmDZ+0kF6UyQQ o8tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=InjvMp1u; spf=pass (google.com: domain of linux-kernel+bounces-2249-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2249-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 n14-20020a63f80e000000b005ca4098bf63si7475039pgh.645.2023.12.16.08.28.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:28:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2249-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=InjvMp1u; spf=pass (google.com: domain of linux-kernel+bounces-2249-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2249-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 4D797285551 for ; Sat, 16 Dec 2023 16:28:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65A4D31755; Sat, 16 Dec 2023 16:27:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="InjvMp1u" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 425C930657; Sat, 16 Dec 2023 16:27: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-f52.google.com with SMTP id 5b1f17b1804b1-40c6ea99429so12370485e9.3; 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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=obq8YELyZEbke3rZFXNs+HxX85EVdqoEFqpud8UWY9A=; b=InjvMp1uUR0NHOkuQAzAuWczkMefFNzt7gVR/8QLDdUggYFRsjrNxbhgeU8UQetO0x elrMGzoiOalbdSoqUqGlVrRrcJ/962Ky6GZl67a3CkQVSuHXQr5re/W1R1xt6eftm79N lstG6KDYfVhf7X/nSx1s4sqJzCPDq7A4ArtP7mnHLQbvmdB3ez9GLdeRrK9KaHEhZZUa KR45MptEyYnQrgC4cGxDD/kUfvwoHQEN8nltq1hdRou4/iScYh2Hpf2zHgLlhPNCUSRv BbFXhFObbPhl3Bl9TpUbdJJ8774Xg86k3oOb41kjx4OVFgsRTIEcfeAu7KhQ1G0kYrst JX7Q== 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:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=obq8YELyZEbke3rZFXNs+HxX85EVdqoEFqpud8UWY9A=; b=QrSqJe6fE0MWYLr08Tog8SK21BApy9G7Qqi3Sg0eFIOGeORuPWzihWu6I9uK+gEmo/ u4xxYU7JNNKRd39nU2Jd3YG1KZgPbcQPGM4SNQxtc2J1bICA7exuNAKRbBGx2ozHZEbC +GBEQd03KtIm1yG5+HWUrOjTmq3OpWW/BNGQ8wqmuV2z8ZXTJW1RTVFxi/eXOCvrp6Q4 lTNC1baXT5Jo4b+Oonu6ZKZ9zZfxWEmd/tg7YOOccJveTBwOpidltG66sWYFF985CAg2 BQmqeWTe6cxvbA9KCHVm6FcYibDeCPRH4vIbWZRKM3hjL+p5cjATphFo82iiDOzjhABN OrQA== X-Gm-Message-State: AOJu0YyCQz6tmPhfVnBX+ybEHQBxDHB+zu5hFzjNHe7cgBDlWbgsVixk gzl74yMeR9gztinGNtum8A== X-Received: by 2002:a7b:c4c7:0:b0:40c:6567:1d85 with SMTP id g7-20020a7bc4c7000000b0040c65671d85mr1569882wmk.232.1702744026333; Sat, 16 Dec 2023 08:27:06 -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:06 -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 01/27] dt-bindings: display: rockchip,inno-hdmi: Document RK3128 compatible Date: Sat, 16 Dec 2023 17:26:12 +0100 Message-ID: <20231216162639.125215-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456582230671817 X-GMAIL-MSGID: 1785456582230671817 The integration for this SoC is different from the currently existing: It needs it's PHY's reference clock rate to calculate the DDC bus frequency correctly. The controller is also part of a powerdomain, so this gets added as an mandatory property for this variant. Signed-off-by: Alex Bee Reviewed-by: Conor Dooley --- changes in v2: - clarify that the controller itself is part of the powerdomain - simplify clock-names - made power-domains property only allowed (and required) for new variant .../display/rockchip/rockchip,inno-hdmi.yaml | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml index 96889c86849a..be78dcfa1c76 100644 --- a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml @@ -14,6 +14,7 @@ properties: compatible: enum: - rockchip,rk3036-inno-hdmi + - rockchip,rk3128-inno-hdmi reg: maxItems: 1 @@ -22,10 +23,19 @@ properties: maxItems: 1 clocks: - maxItems: 1 + minItems: 1 + items: + - description: The HDMI controller main clock + - description: The HDMI PHY reference clock clock-names: - const: pclk + minItems: 1 + items: + - const: pclk + - const: ref + + power-domains: + maxItems: 1 ports: $ref: /schemas/graph.yaml#/properties/ports @@ -55,6 +65,32 @@ required: - pinctrl-names - ports +allOf: + - if: + properties: + compatible: + contains: + const: rockchip,rk3036-inno-hdmi + + then: + properties: + power-domains: false + + - if: + properties: + compatible: + contains: + const: rockchip,rk3128-inno-hdmi + + then: + properties: + clocks: + minItems: 2 + clock-names: + minItems: 2 + required: + - power-domains + additionalProperties: false examples: From patchwork Sat Dec 16 16:26:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179869 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp313578dyi; Sat, 16 Dec 2023 08:29:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuYRcxfykPkUS1kIdvkYSyyhmcpBF3F7UV+dA5Cyc2TsYbAQD1cPQhB4pSg6qpo5S6Hyqh X-Received: by 2002:a05:6a20:7fa0:b0:18f:97c:977e with SMTP id d32-20020a056a207fa000b0018f097c977emr19055291pzj.102.1702744151607; Sat, 16 Dec 2023 08:29:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744151; cv=none; d=google.com; s=arc-20160816; b=vnsAgjhYhVh8tEgxqegdj2hpBK8R7W1qBQQ8xjvpDgK3pZwF/sYICHbNnR5N2LmA4d Wj0sd8qK+jYpjz+2+8B+hndj46YCWPLLocGlIAOMr99tjUsLif22Lj6dqkKjeOFPwzdh 2wscKg2ZdZnIF7cFf/NjCiibYdvuJyP2e2RR1/+IdAxadjeIWRp4pPy4MbMOyaD+Sx+f 7/u1CHvg84XZ4+Js6Yq3bIj3KkM1XYEfA2tBbyKU9Y7Gq+djrdnF42I7CddNzfEcHUtS 3aCJoWj3SqEUPAyjzJQPKfwRScBj1iL+XngI6XmsTpbhtnFm4FcrHhAngi+pMGmUPGBG APaA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4Lm26+4tm6Q9dy5TiKyQzH1wZ/PMiBfYpwbeTXzDXzY=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=KIwPDvGBG3jNsst96c68FOwBusPtzalPGatmglhwZzpJLzzIIWXJ7aAsOUBcxbYH+1 RbrIUQgRYJhijbFRNDF6Eo1g/0nwCoZs0XzqpQNIe8FTVNrHtdFBumIwgBwI4YhmgWnu yxn/M+Dq2PzmW3VjWwuiKplmKh18T9iaNSitPaUOU0JTD+zFBhpB+ShUydZ7T2TeQLRB 7yXBxupoz+PCfbXrk0+J4wxW0vtHvII1WU8yCF1O8KJEMzWzJGMf5eA+1m4oVreGME+4 JfUEYSXS3+Hz8KwsXYkTs0/CiQjDJ8vN5JAPLPmMmlkdPRoMgydPUm8Txh9nskhwUpPS TnzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="NV/CDwrx"; spf=pass (google.com: domain of linux-kernel+bounces-2250-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2250-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t23-20020aa79397000000b006cd97ba7ccbsi14478317pfe.232.2023.12.16.08.29.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:29:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2250-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="NV/CDwrx"; spf=pass (google.com: domain of linux-kernel+bounces-2250-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2250-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 409F9B23FE3 for ; Sat, 16 Dec 2023 16:28:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F48031A83; Sat, 16 Dec 2023 16:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NV/CDwrx" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 D305F30662; Sat, 16 Dec 2023 16:27: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-ej1-f47.google.com with SMTP id a640c23a62f3a-a1f0616a15bso190965766b.2; Sat, 16 Dec 2023 08:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744027; x=1703348827; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4Lm26+4tm6Q9dy5TiKyQzH1wZ/PMiBfYpwbeTXzDXzY=; b=NV/CDwrxIKEOovhSvBgy9czdYvWrYP01xZCrxuRiYLtO5nn1ZRKtGUIWJ8g8WiDorU 0CU6hQfRm9F61WNNOT2NlAcW077SK0bM8nbiepAXWLLWInDGW0elbFq2mBvl7E1sEN10 wJJm+7aMHMPBbhZH9jdNs4tah3w8M/GrSoSFExQpSVazo5M/sdKk0DP8edCd9UU8F5t1 o6j6Db/7EBYDiXGpplV9LLdRe8Yj8qmF+HNTwKh5OqaYVWOH6Rdxl0Q/YnVDBK7Da4VF YH+yCdQAd2LefAkI7Ubt5Wi+MF0YhV/7l8HamY+OGWFmLq/uQZsHUdTL++G1QNpcM06q mgtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744027; x=1703348827; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Lm26+4tm6Q9dy5TiKyQzH1wZ/PMiBfYpwbeTXzDXzY=; b=ltMvoS280ieEK6oqfjCUGKwcZzFuDpz2LCJUXYyDEyucxtivhsJGN7APxzphY8kvXr uyV5hwAo82GUTlq9iSQQtgP4JtH+AtOtscSEgHyjDuzJ2ftHuQRQgWt26hZNz7ePLux7 +03NSpiBTbPtsoTkxRdMmum9AQsHiKRBfJ+dJNvX8iW533/qf/8PaaRTsqoX0ncR1Mk7 e/gwxw/KP/UAhMTczDXLRJ8EsLeAUuJTJnsZEJXi1VQiiAseqtY05Uk1hvThsvlPfmdL 0tKVgFUhGqX8ygX4+HVT7x8vVc/7hLUEMlIUT6ZM3dvhlG3QT+AIoOqyZhYUotjdxSbW ceTw== X-Gm-Message-State: AOJu0YyOcZFIlTumT5luhX0LShe8eLOAth+8GYB6ay2bdBeqF3QYvf6E 9MpT24lCYQy3C7iYoPVHaQ== X-Received: by 2002:a17:907:208f:b0:a19:a19b:78a7 with SMTP id pv15-20020a170907208f00b00a19a19b78a7mr7159079ejb.106.1702744027021; Sat, 16 Dec 2023 08:27:07 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:06 -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 02/27] drm/rockchip: vop: Add output selection registers for RK312x Date: Sat, 16 Dec 2023 17:26:13 +0100 Message-ID: <20231216162639.125215-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456651671138177 X-GMAIL-MSGID: 1785456651671138177 In contrast to RK3036, RK312x SoCs have multiple output channels such as RGB (i.e. LVDS TTL), LVDS, DSI and HDMI. In order to support that, this splits output from RK3036 and defines an separate one for RK3126 with the registers required to enable the appropriate output and setup the correct polarity. Signed-off-by: Alex Bee --- changes in v2: - rephrase commit message drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 13 ++++++++++++- drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index c51ca82320cb..b9ee02061d5b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -227,11 +227,22 @@ static const struct vop_win_data rk3126_vop_win_data[] = { .type = DRM_PLANE_TYPE_CURSOR }, }; +static const struct vop_output rk3126_output = { + .pin_pol = VOP_REG(RK3036_DSP_CTRL0, 0xf, 4), + .hdmi_pin_pol = VOP_REG(RK3126_INT_SCALER, 0x7, 4), + .hdmi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 22), + .hdmi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 23), + .rgb_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 24), + .rgb_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 25), + .mipi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 28), + .mipi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 29), +}; + static const struct vop_data rk3126_vop = { .intr = &rk3036_intr, .common = &rk3036_common, .modeset = &rk3036_modeset, - .output = &rk3036_output, + .output = &rk3126_output, .win = rk3126_vop_win_data, .win_size = ARRAY_SIZE(rk3126_vop_win_data), .max_output = { 1920, 1080 }, diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h index 406e981c75bd..fbf1bcc68625 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h @@ -872,6 +872,9 @@ /* rk3036 register definition end */ /* rk3126 register definition */ +#define RK3126_INT_SCALER 0x0c + +/* win1 register */ #define RK3126_WIN1_MST 0x4c #define RK3126_WIN1_DSP_INFO 0x50 #define RK3126_WIN1_DSP_ST 0x54 From patchwork Sat Dec 16 16:26: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: 179870 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp313605dyi; Sat, 16 Dec 2023 08:29:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAL8J42S91jExCHz/KE7uVaU45FVdHAFvdhbNE3v2wtw8q0cZQSfpiYh2winBsEXP5dxc1 X-Received: by 2002:a7b:c8c2:0:b0:40c:279d:31a3 with SMTP id f2-20020a7bc8c2000000b0040c279d31a3mr6983971wml.176.1702744154953; Sat, 16 Dec 2023 08:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744154; cv=none; d=google.com; s=arc-20160816; b=Y4lqHAljzpte4R8Pbr5vqEXQbj5K6WwXseU2x9FbcBoJmuzscoa3xlhKnVV33YFlMS UvaBPD2Q6E40XrxXwlw5jmRaO2j5WQlbMcUjYdsLAIlirdQwVIs0u/6Po9lLRQOhu1qj AxrU+kNSgi1qqJDEjSZMgJYo0lyYMATvjBhhJQoYYi65pFSv006fCTrj3n9bbmlZFR9D 0UWZfB8yMp8lJARrs/EmSNLXQCw5pYPvMzMB8OD2Z7azR/M+dppqGB6fNDCuuferSOA7 U/h2yr5OccBQxEiRs0K5W6QjLAdcRzgG2f5KCZbE4B4M4lnUI5vUEwIwuoMCb64HzziP B2Hw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qyAWfNkXQL+v/gZSDlmmFF5ztG5yHb26ZkJxvxzB8Hc=; fh=3pXLQkDnu6mfL79fDWl5gUQ2rlGZpcfH88MDE/DTze4=; b=VRUqMrSFVmyeB5azGu7ppXbzzYm3UauDrciKWtKIiGtdhl13/WEdtM8ZO6N44sAEyz wXdltQ3IIqwBmYsUCJUSimt1Qx+tyDh5uMQ5psYdHxxGQzkFYmsJ/FeigdFhKac24KNx AzGFhnvIYizWu6keBC1wla29BynysOQzjb4LpbU4iwJZ6Fge4FPl+HZTzA7vlO2N2C6+ bdLNVtWSYuQMBPDFPbsFKX6km9Xwwub4FGgiDEnqtbKAJ58Es0wOy2fQ/e2mXQrJ9sna DKMjjZLC12XBFmXyA5y5nz34xeEQkjAWxmgSY1fRxOAM6q4TXHDFhczKzbmLz26DQuS6 a8IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MTLyyQTy; spf=pass (google.com: domain of linux-kernel+bounces-2252-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2252-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ka8-20020a170907990800b00a230f36ad7dsi2616777ejc.54.2023.12.16.08.29.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:29:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2252-ouuuleilei=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=@gmail.com header.s=20230601 header.b=MTLyyQTy; spf=pass (google.com: domain of linux-kernel+bounces-2252-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2252-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 904641F237C8 for ; Sat, 16 Dec 2023 16:29:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25F7033CDC; Sat, 16 Dec 2023 16:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MTLyyQTy" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 90DB230D1B; Sat, 16 Dec 2023 16:27:09 +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-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-54c7744a93fso2051734a12.2; Sat, 16 Dec 2023 08:27:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744028; x=1703348828; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qyAWfNkXQL+v/gZSDlmmFF5ztG5yHb26ZkJxvxzB8Hc=; b=MTLyyQTyFUzMRpweOwN2a4P2t6HZlLsvqYYCzfi5ACj/FoJB7OPE/VxNKS1i5I1N7b UW3wpFOkZXX4uKUEhIMBuosEDvUZEKYA73lEESiZQy709pH1UAtjyT9bb6QVJv1MGmZL t3fPSVS6DJ4bJCSgFWvJ4vO5tTrVbDAeQ5lA+MJLGCmLfMatZ39zu//YbXMR5QAV2oga TbNw3EWQCsjReb0xOJpA9lZVjtGdHVZ5W98IDKxWeZpJ/TskKJWEprcWNUHBEXfPiC2T 5pl52dxrovT/7ZkgfEUFguRGimXLs5iMAmcx1Pza0sGv3asdSjpRQt5AuIST/6lWnwlb JbyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744028; x=1703348828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qyAWfNkXQL+v/gZSDlmmFF5ztG5yHb26ZkJxvxzB8Hc=; b=D2HDZ5F9xsi9ODeoGbuJuUcMpFXwDBa9XeSuFZXAAXFElI+JFWeME1aE5/HlWlrAOp tZpxl4ch/3ibwGywpb4gYlKqxLUlXzUFtkIhnaPagqtQSpYrg4XB0NSbBbs1BCx0Y/ZV nY6UR9UPCITb1eUWiBki9GyQ+eVbEa2F8K8I70InlxtOSV2oUkMmjoVRZvnm9KFFwE/B NJhavkr/4dNxGUc92F6XxtJdKCgObznpzpLZqr7B6y0Ue7ZtjWOZBS0fGIp8ZcLryAwM HUflKt7OFmsenPO2rD303zKet0aHlHI8FFZzsrdY3+3mJoYlSueBV03FRRb+HKg4p0Jh gujw== X-Gm-Message-State: AOJu0Yx3s3lFrHjkV6ROrWeAphS6T0TYitsuVrfWyMHKnKd0oF1Z584N 2xh6gpsD9Y8rRiUsdb2xYg== X-Received: by 2002:a17:906:6a1d:b0:9c2:2d0a:320c with SMTP id qw29-20020a1709066a1d00b009c22d0a320cmr8522242ejc.46.1702744027873; Sat, 16 Dec 2023 08:27:07 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:07 -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 , Zheng Yang Subject: [PATCH v2 03/27] drm/rockchip: inno_hdmi: Fix video timing Date: Sat, 16 Dec 2023 17:26:14 +0100 Message-ID: <20231216162639.125215-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456654782600542 X-GMAIL-MSGID: 1785456654782600542 The controller wants the difference between *total and *sync_start in the HDMI_VIDEO_EXT_*DELAY registers. Otherwise the signal is very unstable for certain non-VIC modes. See downstream commit [0]. [0] https://github.com/rockchip-linux/kernel/commit/8eb559f2502c Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support") Co-developed-by: Zheng Yang Signed-off-by: Zheng Yang Signed-off-by: Alex Bee --- changes in v2: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6e5b922a121e..345253e033c5 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -412,7 +412,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_H, (value >> 8) & 0xFF); - value = mode->hsync_start - mode->hdisplay; + value = mode->htotal - mode->hsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_H, (value >> 8) & 0xFF); @@ -427,7 +427,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, value = mode->vtotal - mode->vdisplay; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VBLANK, value & 0xFF); - value = mode->vsync_start - mode->vdisplay; + value = mode->vtotal - mode->vsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VDELAY, value & 0xFF); value = mode->vsync_end - mode->vsync_start; From patchwork Sat Dec 16 16:26:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179871 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp314073dyi; Sat, 16 Dec 2023 08:30:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IE42jmSB+vA5Z/Fb2yvZFnJYdpzfwqNNGYWbz16rl3vettM9B0YParhF6eimHQtXaBP88lO X-Received: by 2002:a17:902:b697:b0:1d2:f856:8575 with SMTP id c23-20020a170902b69700b001d2f8568575mr13194655pls.38.1702744221334; Sat, 16 Dec 2023 08:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744221; cv=none; d=google.com; s=arc-20160816; b=EiDJYGjirPpSN3c/gLwR24I4a44qX8Ax+XlkkkF1c7nm2AMy9xfe+pgadyEgGNhmda WEQHAe3h6zxSB59WKRrQ3aa8JeBOm71f0EsJ8NL0evDspSQD0ilsH3hKrmGetoFOnbi7 hnZjKNf/TsvfSINxAolFe9maXKysPWeV/9wh3iX++XnDWKWzd3tdWjBX2OTQ9QNYSp5u 8nENsbUc5Hj1Vx+XfKMFwGzjU3eAijkAyyANJEq9QKRJYZYjziTmBHPSi9Q/3OCLitso sKYS4UfyA17r8usPfPhvqY4RT54sOSGBs1mrxvyzMKPGZmNWC/kGCeNx/WSwMxlxqAAg c1Lw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ujhT/xhztHbY8JzCzlkbXu+iQMCJG+MMsIZQaYuJZKs=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=XloqAeovMe+P7lGi+K2Ayp6krMKBl18BJRiyxNKQH7T8zmLMR1qRWmJGgpd4rN0ITq nPul5ygDXoNBLsBOVATmM15PCqWOy+6nTKz5Ehnd/qACkZxYCroEX46vLTamQnEpbrrR eGUwuODhhZ42yfXgV6W+NpicAwdRHryUbrRUNqe0BSXB+OKzJ3ogNtANhIudtbbY5ODc QgyUlYs/BAI3wVyXDPouF8P2xP7ZeFhlNFE48o3mpdBuDFwKM/wtUv282NaTW6lPniW3 l+1I+t3rLpYMgyplfa2Hoicjv57S3BJ6P2UUsa28Z3JpyAIs37IelP2h1mdB+JofGd86 GAcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SuKt+QWw; spf=pass (google.com: domain of linux-kernel+bounces-2251-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2251-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c18-20020a170903235200b001d08a8c56a7si8401050plh.279.2023.12.16.08.30.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:30:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2251-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SuKt+QWw; spf=pass (google.com: domain of linux-kernel+bounces-2251-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2251-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 10844B244E3 for ; Sat, 16 Dec 2023 16:29:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C292532C75; Sat, 16 Dec 2023 16:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SuKt+QWw" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 91DE530F82; Sat, 16 Dec 2023 16:27:10 +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-lf1-f47.google.com with SMTP id 2adb3069b0e04-50e2d00f99cso316916e87.0; Sat, 16 Dec 2023 08:27:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744028; x=1703348828; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ujhT/xhztHbY8JzCzlkbXu+iQMCJG+MMsIZQaYuJZKs=; b=SuKt+QWwllwfQNJxmUaW56zDvhx/5cTx8u8lrzdrXaZo6u9+kOAMBmldhTWOkNkHeP xgBzALzo8XDjfLyjLesZwa4uQ4eNgdTrgCNMoxhQOB2/NMrznq9kI1D2fcC+ilMnH78t ujp9VolQ2ECcYITWu4lpqsvt9YLCAMlYUA4fflqDU7n1sBoCSF9pX4tKT9P3+TbIozJ+ HtcH81iUsKfFk9SMcabaPqky3MsCrgqaLOCNzjPqzJU3k12PO40y9b8ynIY15mAIGNdq dSgmJE9KMhcJY86dwajhZsctIXPUT9k7VjInFinXCs/2TQVlTx4P6sSIonnVAynIK2yF 4XFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744028; x=1703348828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ujhT/xhztHbY8JzCzlkbXu+iQMCJG+MMsIZQaYuJZKs=; b=vXQj2B//5gcKGTYPUzQi5/jGzrZSsFMWgkqDX+CMvB6rjViLQlRfQgA1NGJkOz84aO HOo6sk3pIPV6j2fZRrnIIXjQ/CS1wGSa0r7cEIgoTZLpJqNCXiDk5VC/tqIlC2/IyjMU SzQlafJLIBN8MXrJ0rERDTl5DcaQaQMS8LYn0mGGE6zys8uKylVcdBsDn+U82cUdCm5C HUY6tyj6rtyWZvkzCW0htzOCB8ijWLQRyXn6hIUkBNowwqfsQezKJPlZxmG4mXcz4O9w VIO7zrwpjQPq+FcDIvAOM2K6Z7X6dOzYKadfQLpxam+WplGqzguA3eng4oRGqV28NEa4 mK4g== X-Gm-Message-State: AOJu0Yw4RgkGmnYSw0azIYx44j4PiYPreqjjJf2QmBXhEMynRAlL3bxP j325iFlybXSGkpQ/3jgEKQ== X-Received: by 2002:a19:8c0d:0:b0:50b:f55b:abb9 with SMTP id o13-20020a198c0d000000b0050bf55babb9mr6923253lfd.94.1702744028520; Sat, 16 Dec 2023 08:27:08 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:08 -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 04/27] drm/rockchip: inno_hdmi: Remove useless mode_fixup Date: Sat, 16 Dec 2023 17:26:15 +0100 Message-ID: <20231216162639.125215-5-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456724651252544 X-GMAIL-MSGID: 1785456724651252544 From: Maxime Ripard The mode_fixup implementation doesn't do anything, so we can simply remove it. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 345253e033c5..0b1740b38c7b 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -517,13 +517,6 @@ static void inno_hdmi_encoder_disable(struct drm_encoder *encoder) inno_hdmi_set_pwr_mode(hdmi, LOWER_PWR); } -static bool inno_hdmi_encoder_mode_fixup(struct drm_encoder *encoder, - const struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) -{ - return true; -} - static int inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, @@ -540,7 +533,6 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { .enable = inno_hdmi_encoder_enable, .disable = inno_hdmi_encoder_disable, - .mode_fixup = inno_hdmi_encoder_mode_fixup, .mode_set = inno_hdmi_encoder_mode_set, .atomic_check = inno_hdmi_encoder_atomic_check, }; From patchwork Sat Dec 16 16:26:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp314942dyi; Sat, 16 Dec 2023 08:32:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+bnhLupmH6h0Pq6XVtL962oCf/90Tzk3WRbs4AKbU05D7/MkC72w3g5TNGXvT1g2wmcX4 X-Received: by 2002:a05:6a20:244f:b0:190:cbe:9ee7 with SMTP id t15-20020a056a20244f00b001900cbe9ee7mr16124804pzc.77.1702744328739; Sat, 16 Dec 2023 08:32:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744328; cv=none; d=google.com; s=arc-20160816; b=e/YghpAtU16iOz0W8E8D2XIThhMGolghlDaCIAVFlBwx+S965BZD/StjiL4Cecxe2M Lke+HJy+6egxScFfbE6I9IvLwDqmORx+0l16Q33wBRaphEOHjiOIBEwv898cMjDpw/Id CAmRZNSCOz4d0QXgYxXkcVM8mYAHZG0bxT7aP/tXl+RmhitnpG9yszE/muw2t9EyzNcD EV6n29+M8NIvMo2H9zOzC2xiBIUmp3iRzotmS4UHwynuz6b/mir1cfcsd9Pu48XfZHSN oBDRoH3qRncS94QaGuoWSWTHTKkqXkRXCzNMlMFkw0ot83atq2332qe/hwUHGcIBfiUb ljVA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+K0So3uuQGg3yr+y8AKU1btAl7C7H8qZH5jAq4CxfOw=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=jewQLHcsUC85p4RqbyFTNtANeSFqTHeNVJVpr+cEQ/eCRAgjAk8BObqbKv7sbV65ms YcQgQLrIiUc5zkdFklYNpjF1JCdNtU+q8eez6KPmHeLAoIdqQoS0+yxeuWIoza1vy2PA aMFSUSqI/HacnQEog7ygo8xd2iSY7Ur1HO9X5upl64aOJKYyoQ6vkVbg7HzfgAJuppaa UmLzCJadM+/g2TF3dEFz2EVj53Trvp6gFnKIpWywiJoItJiapyf6Z+sH7xsz45T9hl/o Q/+UoMI7BdDC9o5BP2ppvSsHh6gpKgd7KWb4mPrNu2kIVpRA5kY3yPv8J982yJN02XSQ QMiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L99+d5s8; spf=pass (google.com: domain of linux-kernel+bounces-2253-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2253-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bx2-20020a056a02050200b005c673abd811si15666118pgb.254.2023.12.16.08.32.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:32:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2253-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L99+d5s8; spf=pass (google.com: domain of linux-kernel+bounces-2253-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2253-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 13E88B23F8F for ; Sat, 16 Dec 2023 16:29:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06E4E34559; Sat, 16 Dec 2023 16:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="L99+d5s8" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.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 CEBF6315A7; Sat, 16 Dec 2023 16:27:11 +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-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-552d39ac3ccso2600942a12.0; Sat, 16 Dec 2023 08:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744030; x=1703348830; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+K0So3uuQGg3yr+y8AKU1btAl7C7H8qZH5jAq4CxfOw=; b=L99+d5s8N5i0IuxxU2/QkU436ajp4zsDVmF3cLTGp+R8PVfoxoD/4CVWgEHnML6wQZ 6pmffHQuSQn1VSy+7eMF6lZQSIvFYbSJwGDfLmYPoojxOdSPT67xaCiuXCpGkHHoD3Gm cT16eR5ujV/Zz+5cFgpGFfGYZ1UJ4gq3IxQMO9NqmsAOvXqiskl+VDYrLm09QruHboWJ T3qryLawYOzx2LZOmO7z2RuK1d2U5U8JkzMKk0ZoyWmpImXhlVcZZvd6ISBYweZwi9fi BwEl/BJZC8c+ylekfWf4NQD6XiPp+Q18DD0VZmnio8zWD51aGf8c6qZMgWmWQG8zB1aD mN0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744030; x=1703348830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+K0So3uuQGg3yr+y8AKU1btAl7C7H8qZH5jAq4CxfOw=; b=E9+3C7AA9IJfAtYsnp6TZ0PZzEKf3OLcr067DH4LKQfIuXI8XUoWYa25DBBYGSlpGM f3NaJcu3PEJV7j6Y0qtf7UX8AElQpo9RukUzX7CTpCGDEjH54GvSPmd5a9edSZn47Bnt y3HWqdlRoqEEeUCC1358WpbSg9hp2wn4SO7QVX/buTgjQ3EiO5aIp5Vg80zp+8tZuIqH hSw7QQnn+mpJ1wCmx0YdEU4TBVqD4K9ZTu9FtmZPyFMWcZT8s/QgZ3+OSjNyFi6GD2cb 9U6uC12RK/g6qWKn51MNwXejucdnimfA/C3G1oQkkYHgcHLrvhhSTE8wFI/CTSbGsiGR XmTg== X-Gm-Message-State: AOJu0YzxDhV65FC9H0J0Be7f6TcQzeLIhlKEK269lwaFjiqwLA9lITuR N3Ap4vH8fLdMvkkgTYEwoA== X-Received: by 2002:a17:906:101e:b0:a01:ae9a:c1d3 with SMTP id 30-20020a170906101e00b00a01ae9ac1d3mr13645179ejm.11.1702744029174; Sat, 16 Dec 2023 08:27:09 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:08 -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 05/27] drm/rockchip: inno_hdmi: Remove useless copy of drm_display_mode Date: Sat, 16 Dec 2023 17:26:16 +0100 Message-ID: <20231216162639.125215-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456837420452681 X-GMAIL-MSGID: 1785456837420452681 From: Maxime Ripard The driver maintains a copy of the adjusted mode but doesn't use it anywhere. Remove it. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 0b1740b38c7b..14d2ba92a606 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -62,7 +62,6 @@ struct inno_hdmi { unsigned int tmds_rate; struct hdmi_data_info hdmi_data; - struct drm_display_mode previous_mode; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -498,9 +497,6 @@ static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_setup(hdmi, adj_mode); - - /* Store the display mode for plugin/DPMS poweron events */ - drm_mode_copy(&hdmi->previous_mode, adj_mode); } static void inno_hdmi_encoder_enable(struct drm_encoder *encoder) From patchwork Sat Dec 16 16:26:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp315418dyi; Sat, 16 Dec 2023 08:33:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1MNXnsDP9bsKxaWrJRdTtvVofLrXt+LfRGNeeA4lJ5/tpFdtXpoMJhHQ5eXcpElKg3LcX X-Received: by 2002:a17:90a:6e05:b0:28b:24fb:8333 with SMTP id b5-20020a17090a6e0500b0028b24fb8333mr1862327pjk.38.1702744391279; Sat, 16 Dec 2023 08:33:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744391; cv=none; d=google.com; s=arc-20160816; b=lt4d9wxP8BRxQhaCgZur277qLOCW6OV/1uYmDcHPHuGOzpQSMuXjYskc99Z6brmzPU XpZ65hrQz0TMSQGhzKEETlyL4opdSF/PI5Kuw57DeCLzc3+gTxI32HIfvYikGsWQIDYB ODbA6ng+RCLFPyTVGvV1dBEOIBbBYP9fLRD1Y7hiibbZFAW2q+iwYZ8VHI/n4QByPd2q YCHMVx2f6Lu5I3nYni8MS09KAEgOpsstwkcA/4GsJSCzF+xkC22JzmRnDgN1LWWxHeqV FyRY51fVjdGmjTOm8/BmidhniZFMG4t9xubcX3j2hbD26JqHPpPsBRVhkUIegcrCSj34 I0aQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Hqi83IjE0rGQjBdIOPd+5QjMZSA3M3R/UCn49KPkLl0=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=RqP7LmYNQQik6hU433CafMzWaLq/IlaosCIOyb0G7K5IirPnGb+Fe0WGIGeidEQW1J +rqZe0fuQqoQGG8YHX5SwRHwxz1am1BMOBkbAL8aW/WWVDTdp7cMYvDOejb63iVi4hQY re12uzUlN1vnPZiFMOEUYmUh+rgTBGKV6MQBQfjNjfkLP4ETAqOqzdoOlqYTZWqQWtgl aEKXlJjxECslhHcAUk/EtPf8KiGDFhdq/Rez8yPi9pv9EeP2qp4jeAKmEvJMm0sE3Zcl 1HK86NNclfNWMRIwSGzf5YN/0DmJdhI6nWqM3eJe1zSDPc7Mh20pWaSYKqTN9mBTDDht OWjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hOAzxrEq; spf=pass (google.com: domain of linux-kernel+bounces-2255-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2255-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ci5-20020a17090afc8500b00286a2b05cb6si4824346pjb.145.2023.12.16.08.33.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:33:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2255-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hOAzxrEq; spf=pass (google.com: domain of linux-kernel+bounces-2255-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2255-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8AB80B240F2 for ; Sat, 16 Dec 2023 16:30:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3825934CFD; Sat, 16 Dec 2023 16:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hOAzxrEq" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.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 CD95A315A0; Sat, 16 Dec 2023 16:27:11 +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-f41.google.com with SMTP id a640c23a62f3a-a233a60f8feso5643166b.0; Sat, 16 Dec 2023 08:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744030; x=1703348830; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hqi83IjE0rGQjBdIOPd+5QjMZSA3M3R/UCn49KPkLl0=; b=hOAzxrEqOoacTmD5j+we/J3dDRZJUGN0NX9nQWXkenW6TNgsnyjeK7sR6pg6/dB/yU EYBWboLCZ/bSSfbGUZ3zKWB9+lCkvHVFM//qswj4KFFtY4XTKe3BIS2oE9kIeLm5P9rh MmMB3T+of09V92+b/qIqDBexhIToWoZ0/5jx+EGseEuK+vFERYICnqwXwWKWRH0Y0MFG EcKm/sUuas9sulsY6gzus+wWAjmIJ4ZtF/QStb8nB6nQJIiGDK/dBZJdedQrQGRfvsxl YxXYcfYrbOaEusO2Q4gSIX37vYOGPWAuOEUYUH88DG2TwkXV5sglpOysCbHJgu1yeBbl fXZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744030; x=1703348830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hqi83IjE0rGQjBdIOPd+5QjMZSA3M3R/UCn49KPkLl0=; b=uglRtmk5vQNcpn6kO8Mwd8ChHlmsldN/jiGXJeUNl5rFGvFtJk9GjJ6FhwEERCyLKo e63EuC1zq+0rvjgNSkWnxO5TcBC9fMYm3RzMlkKdBPVxqWblEyXZF0fLR90dQzIt14n2 buDU+w1Sg3WR5tNZJIW/94mO274cH88CzaLzs49Z0gRTlqQ+eB+aEo/KhmjX5siZIvaG 3jl62P3qHqlXkwqZKmurGdxYRIg7wvmZujfsf3/Qr6xQgAkVM67+Qeq2E4bMGiIahL5f DOzzTR38P0E/Pqvx1y8snDo2/p79l49EVzPBlu7s8nmVrYIiAD7xdOZYNirVv9P9sjra GhCw== X-Gm-Message-State: AOJu0YwDEfPac6YGR/SL0xyEV4KkjPe1a6KqXId39mZkJvsp0iE14IzF ay6xThSk7hHDVcDYALGLTg== X-Received: by 2002:a17:906:5352:b0:a1f:9617:99a with SMTP id j18-20020a170906535200b00a1f9617099amr4768328ejo.94.1702744029988; Sat, 16 Dec 2023 08:27:09 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:09 -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 06/27] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic Date: Sat, 16 Dec 2023 17:26:17 +0100 Message-ID: <20231216162639.125215-7-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456902760360542 X-GMAIL-MSGID: 1785456902760360542 From: Maxime Ripard The inno_hdmi encoder still uses the !atomic variants of enable, disable and modeset. Convert to their atomic equivalents. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 14d2ba92a606..48c4f010b260 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -491,22 +491,25 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, } static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) { + struct drm_display_mode *adj_mode = &crtc_state->adjusted_mode; struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_setup(hdmi, adj_mode); } -static void inno_hdmi_encoder_enable(struct drm_encoder *encoder) +static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static void inno_hdmi_encoder_disable(struct drm_encoder *encoder) +static void inno_hdmi_encoder_disable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); @@ -527,10 +530,10 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, } static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { - .enable = inno_hdmi_encoder_enable, - .disable = inno_hdmi_encoder_disable, - .mode_set = inno_hdmi_encoder_mode_set, - .atomic_check = inno_hdmi_encoder_atomic_check, + .atomic_check = inno_hdmi_encoder_atomic_check, + .atomic_enable = inno_hdmi_encoder_enable, + .atomic_disable = inno_hdmi_encoder_disable, + .atomic_mode_set = inno_hdmi_encoder_mode_set, }; static enum drm_connector_status From patchwork Sat Dec 16 16:26:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179878 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp315191dyi; Sat, 16 Dec 2023 08:32:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXF+9XTvMI1J5YNEery2aPMx63Wn/jL5j2IPEEBEsFk2KiFKtmLCNNFjoM8P5KIFEjpvA+ X-Received: by 2002:a17:90a:eb18:b0:28a:f23a:c504 with SMTP id j24-20020a17090aeb1800b0028af23ac504mr3522481pjz.47.1702744360425; Sat, 16 Dec 2023 08:32:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744360; cv=none; d=google.com; s=arc-20160816; b=JxIkNzDKYGG8aElqh4Q0EpFs8pBL71Lcdp0rJ80qj+xyvM0NoK7Mc6Fclb+FjvSra0 xvvrfl2IXhqP7lSjEl8mUEN4wQrw55tWN9jgUFemFRyLLT2bcabxaKDcxbn1jiewmjnX yvhsJdXhdthtiHgeqrB5zOLXHYVzVNKlOOmgEdn56rmuD8fDzOWN34WUjeC+tkiUNRm/ cyPK2Rn144x31XBmx/FVzGGfLIxeNPcP6sc306LCbiIfnkMPiOqQo3ADzNc4H3FJeeDX 9HkV76V+y5O/1BIrjcGPIFb1U7Ed8W8DDF+7H9EcaxcUBIUY3qGk4LYUCzUUaGtAFgor UGjg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=enGw8p8B5CzjGv0S8y8E93U6rzPMRXDY8CyOli66yco=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=qzQL9RBDx33P0dS8xjUhQenlRbjCbOxEoPRNUblULwxRWE40djk3siuehmq2v31YIM dhaMhKV+at+uGkQP5OEWFtnYHj3ufho96JzkufojQYPgmLGdSYzMImS44QcM3esQ6P/U gyKzzY0mVIwBg+ANyhmqB+SM7QJpAtxe1S5m6PR6yVfcEFipWmYgBRIkHy0KHWzDACJJ xCd6PpawGVe+wWb6YGqYCPZel3gfbuWoMp6DQyBTRR4/roPOlqXTuS6I8cSqxleLca/u gnOZyzcEEvtz7qZCgaiUNW9RGbAkDsch/vd3OgOYwmo1sZs7W8bdpI7X9wwwxJY7yDnu i+9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GPCSFiem; spf=pass (google.com: domain of linux-kernel+bounces-2254-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2254-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f4-20020a17090a664400b0028aead05a82si2694001pjm.133.2023.12.16.08.32.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:32:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2254-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GPCSFiem; spf=pass (google.com: domain of linux-kernel+bounces-2254-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2254-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 54AA5B2462F for ; Sat, 16 Dec 2023 16:29:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F94C347A0; Sat, 16 Dec 2023 16:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GPCSFiem" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 50ADF3174A; Sat, 16 Dec 2023 16:27:12 +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-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-552ff8d681aso883979a12.1; Sat, 16 Dec 2023 08:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744030; x=1703348830; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=enGw8p8B5CzjGv0S8y8E93U6rzPMRXDY8CyOli66yco=; b=GPCSFiem7awZ/Bq4UJclcJ+kSLCXPlRXaYcUyQ6FoObu64eXXspw0ZL9jdL0EwKRhk I8/C82sq6L44awNvcHCgvfk+vMqp2nHcKZmDqgo86KzFdnRNRxvrasZwUGbg0w/07om5 Yzh4AxVjxNgywk1NBZ2WQPER5iCVujf1guN/XcUhYhdH6SF5rKHvBKJsYE6AIf6Q4azT ffbqriX/GsC2vlwXC4mHeTg0GVH1lJTtFEGfmFYa/icnvR0olWUBCeKqkHn4cuAlOavF xy6DKpjOCgAdWyFr2m776TZz70rMYjw5q121+lutTEfoQuv9XRLemyvxpsfj6L4jgNlm H9hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744030; x=1703348830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=enGw8p8B5CzjGv0S8y8E93U6rzPMRXDY8CyOli66yco=; b=Gumm/dgEIAuOgjtEs8uBeRdAp1pQy1+Mm7mt1asMR2fPvpvPIvpM9m0DAcVoRZbo5t 8HxPyLgKIz5Va1ocSOymiKzgE445JBL7of+711POs1WoMd12XQtZHQAHCG84YXl+U+sA EikNid/FLVMFZtNxdPIBRr3m34cWve/F9ED9q4mpGcCyzJPF8FlFxxgzf5VaNaMbySra Jmifi7KaM3VEoKy3jce1tOVQs8qWCbjHhwQ2gLcLnFrHczkLikzHoD5/j6n4GGMn863F RkkXfx1v+WAeIkXO5EIQx5l3RyVaPcHNDRppAAynVyU8qLShGx8ac10m1i3rPm3W2tKd KQTw== X-Gm-Message-State: AOJu0YyV/VetTANOkCcxYPvK5JHLRuyMGSutSbVFET1mCi6FvSP9eskU aYyJbF3ZM4fwQmJFM88WGbXNoNu4KQ== X-Received: by 2002:a17:907:5c7:b0:a23:f56:98e1 with SMTP id wg7-20020a17090705c700b00a230f5698e1mr5449054ejb.18.1702744030650; Sat, 16 Dec 2023 08:27:10 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:10 -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 07/27] drm/rockchip: inno_hdmi: Get rid of mode_set Date: Sat, 16 Dec 2023 17:26:18 +0100 Message-ID: <20231216162639.125215-8-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456870237686443 X-GMAIL-MSGID: 1785456870237686443 From: Maxime Ripard We're not doing anything special in atomic_mode_set so we can simply merge it into atomic_enable. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 48c4f010b260..299770e481b7 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -490,21 +490,22 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, return 0; } -static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_crtc_state *crtc_state, - struct drm_connector_state *conn_state) -{ - struct drm_display_mode *adj_mode = &crtc_state->adjusted_mode; - struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); - - inno_hdmi_setup(hdmi, adj_mode); -} - static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); + struct drm_connector_state *conn_state; + struct drm_crtc_state *crtc_state; + + conn_state = drm_atomic_get_new_connector_state(state, &hdmi->connector); + if (WARN_ON(!conn_state)) + return; + + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); + if (WARN_ON(!crtc_state)) + return; + inno_hdmi_setup(hdmi, &crtc_state->adjusted_mode); inno_hdmi_set_pwr_mode(hdmi, NORMAL); } @@ -533,7 +534,6 @@ static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { .atomic_check = inno_hdmi_encoder_atomic_check, .atomic_enable = inno_hdmi_encoder_enable, .atomic_disable = inno_hdmi_encoder_disable, - .atomic_mode_set = inno_hdmi_encoder_mode_set, }; static enum drm_connector_status From patchwork Sat Dec 16 16:26:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179872 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp314080dyi; Sat, 16 Dec 2023 08:30:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IF56BCFxkbYPWsUMduIRS0UnP4DUFJ0WVRXCkZ8J/LGJgTKPFvhiHwrRnrd6VlhEb0g/s75 X-Received: by 2002:ad4:5d45:0:b0:67f:27be:51ec with SMTP id jk5-20020ad45d45000000b0067f27be51ecmr2805126qvb.100.1702744221953; Sat, 16 Dec 2023 08:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744221; cv=none; d=google.com; s=arc-20160816; b=ZgWcFErJ0zccjPU1xJcGX0Ou3Kfz6OXM6f/t96fFC7Zfq+eRZ+7j5VhmPcj2IOKVez WMXNvtSg5SUfMR1WeMTpv4jKFHaLpcumR4oBCC6+eo9htzsVOzcBrHt/Jy28EN2dHmEj 5N3vNnTdIkAbkXgLlJsh1N1IZ2AcEfohTqOwxbXB8/3ycECNsN+2diJmLbnjbmjjEXOC b/vbyT1J26qs/6hTs3HRHccaNhUT8hE2vrx3TKhhnpdNvpcCLcB9TcfXBeMS/YTFOCLk dvzFhFXmiLrE5zIap9uvzvCYcMfq1LzLWV2EQ7j+8V3hdGiDJLdrnvxBo02Rw6+866E7 qFig== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xnlt5lgm9qwa/3Pu0kcziAAeIBysCmQzwYaw/MNqgTo=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=sS7o+vmU9KXLh/LZKvWPYbmQyE2xAsyK/RGK5jpA8FPvLgvJtrmC6DXCFX7fmD/8e+ KW+c9at5XKBMZeY28IamkGuvoMqWDluLV7qavuwu2G7MUuFVURUyAvJI0mPaAx+EpBzl owJgSMPjC0ulMHsAQnpoMGYP4Re2yOg9FmzSejY2uvW9DNORkOP2Kdpq4pI91FCVK2cs P4QmuZd2mpA5l5RQ1biKzW+cfkyTsuGjfhdZBzBEzv3oVxxc6IXPLtgMk4pDBAw8bWiS u0bW8KOBDeNkujU5Qr2cL2aHRO9mOhOUX6p8A3m23HywcmlJ7jxwlCcofq3elugH+Nse emvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FBiMK0U4; spf=pass (google.com: domain of linux-kernel+bounces-2256-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2256-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 m16-20020a0cf190000000b0067f206711a9si3075436qvl.464.2023.12.16.08.30.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:30:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2256-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=FBiMK0U4; spf=pass (google.com: domain of linux-kernel+bounces-2256-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2256-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 BB8BC1C209FB for ; Sat, 16 Dec 2023 16:30:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54B6235269; Sat, 16 Dec 2023 16:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FBiMK0U4" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 0B37031A82; Sat, 16 Dec 2023 16:27:12 +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-f50.google.com with SMTP id a640c23a62f3a-a22f59c6ae6so214831566b.1; Sat, 16 Dec 2023 08:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744031; x=1703348831; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xnlt5lgm9qwa/3Pu0kcziAAeIBysCmQzwYaw/MNqgTo=; b=FBiMK0U4LEVnUWTLbgWevpBKncqA8DQFQG00i8TDAJHMhTEvsb60p8BPY4hqZfQ37F /iqcLMrLwAc3dppfWvZT/8+IlWR+W9WUlYYaaLQkrRw4QLOctXSUdfhMcxx9+OIz5btf dYJXhTf7QlTpihi8AwKJsJs5i934L1Kt0R4rp8M2oCZEvnb/kdAU/4xIxgHSrDQhuyiG GjBXwJEl8ZbPitIdIKmIKWN5X0AhPTSHjENGAW/+IIm0cJdd5sMk1Z0vJtvz9SycE4Pz i+1NamNvyok/LpWxMaP0FpOTkkgdg5e/M7kpNEk3MHXPaQm9X2xtObuSEEiwpPP0swB1 0n9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744031; x=1703348831; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xnlt5lgm9qwa/3Pu0kcziAAeIBysCmQzwYaw/MNqgTo=; b=TpG314+1OQSqss4+VnAjlKKY/8bKt2mHQ3N1XpMaOOtL3VT78f4oM1O5qU2ScBY4DQ xPmboPS7s2/PhGGDLz8oMuUsKawiyABB497RT8PZVqGOlC5F6CHPhkpDd1HhfiaGMd5L Zo2hTfQLs1YhNKqTCWJhCA/1hGwzMGAULYk7Fklv2A8Fdc9i9GCuAq+a+WCRO/LnKd2a kt0Qn1lBC0YmuC3Rsph2LymBOB/ClambOKc3Vy/+/C8dxQvdtG51cBN6D6eqjqeRease nxTIejBe8jnKrWkjXmsUJqVOeAcM1wFWr0WdUXyiX1mxdPgF3t+D/8QAiX5ekV5gnPN5 w2ng== X-Gm-Message-State: AOJu0Yz+0eCfAOGy6ug1eFCq6HGna4qAI/upp7PgbmqpFsuSkM8Wn/oI 4ilJQsOzQrvJf1PFEL/qrU0gx9ytcQ== X-Received: by 2002:a17:907:3da9:b0:a1c:898e:6a0c with SMTP id he41-20020a1709073da900b00a1c898e6a0cmr3708081ejc.210.1702744031312; Sat, 16 Dec 2023 08:27:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:11 -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 08/27] drm/rockchip: inno_hdmi: no need to store vic Date: Sat, 16 Dec 2023 17:26:19 +0100 Message-ID: <20231216162639.125215-9-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456725375621508 X-GMAIL-MSGID: 1785456725375621508 From: Maxime Ripard The mode's VIC is only ever used in the inno_hdmi_setup() function so there's no need to store it in the main structure. Signed-off-by: Maxime Ripard [made checkpatch happy] Signed-off-by: Alex Bee Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 299770e481b7..d99896f1a73a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - int vic; bool sink_has_audio; unsigned int enc_in_format; unsigned int enc_out_format; @@ -443,16 +442,15 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { struct drm_display_info *display = &hdmi->connector.display_info; - - hdmi->hdmi_data.vic = drm_match_cea_mode(mode); + u8 vic = drm_match_cea_mode(mode); hdmi->hdmi_data.enc_in_format = HDMI_COLORSPACE_RGB; hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; - if ((hdmi->hdmi_data.vic == 6) || (hdmi->hdmi_data.vic == 7) || - (hdmi->hdmi_data.vic == 21) || (hdmi->hdmi_data.vic == 22) || - (hdmi->hdmi_data.vic == 2) || (hdmi->hdmi_data.vic == 3) || - (hdmi->hdmi_data.vic == 17) || (hdmi->hdmi_data.vic == 18)) + if (vic == 6 || vic == 7 || + vic == 21 || vic == 22 || + vic == 2 || vic == 3 || + vic == 17 || vic == 18) hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; else hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; From patchwork Sat Dec 16 16:26:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp315698dyi; Sat, 16 Dec 2023 08:33:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEi09VvK1i0htali9LtTQGkjw4OEr0nAnx0Q7GCd/AQ7k2vkW2EKsQxS5Q3j3tBQpZYVyEp X-Received: by 2002:a05:6358:419d:b0:170:4168:8b91 with SMTP id w29-20020a056358419d00b0017041688b91mr16598888rwc.24.1702744427893; Sat, 16 Dec 2023 08:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744427; cv=none; d=google.com; s=arc-20160816; b=atF8g5jmM9Dmg4DdhW7HtVZBo5Sh0nyBPd3TpbaQIdPFesEFHnFkclMPza09rZVqiz nCUi5uEjiypq6bvrqOfp7hZGc5Br8V6tyFDv44b2itHXHVf3bKzrmO18fRK2UXO9gqlA 5FK7QE+R2+UVk7ADG3rjbABts8HoloGlxoKc4/s2wPZcu3+85Nys66herTO/5XOxTkIk G72hDlfEz9dbIs+H4W1xgLDfxUywI+43sJjc+G77o4D4Z4SXE6dxI+AW+UPl16Ju6jPz Kag/FERRKLjdy2VoHM0RXD0o0ASgfiS3VDUq54n05cx2V2dnqX31wu8ee3un8gJccItj v7kg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4O+Q+uG5M/KTzI1PKwCAfiw017Nj6I11OqkfEb5dgI8=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=wKJjzX7bX7BfYXVajJreyNb714fhl0dfknrz+rOxu0RknkrG6wqi81AG03Tsf8hytd RbA/7SWeGQBYtPJyd5wsyf4bWxVhbwfkdMMcqBBNh85iGQmhT2dJq/c0k59ZmuNE8yT4 Pj9q7Ymc05QSFNY+9ueIljfXUY7aXJ5HcR4aXWSr1cXFpZp0nkEjS2v4qcGm/2J52Af+ Vs5qa0BBdtN9Xg0Y/b6xsLkJolbRYsMWYui7v7e2aDBaiSxW4Rg+0G3rRaaqyueKHJ1J wWiXj9wl6RbHgMAV60BoaiqnFLU7H83noxgBdaiwlkZJx5GWP3XYklV3ioKLmh5vHd25 IgvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JYeTj5EW; spf=pass (google.com: domain of linux-kernel+bounces-2257-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2257-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id o3-20020a17090ac70300b0028b5c2cf10bsi639188pjt.124.2023.12.16.08.33.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:33:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2257-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JYeTj5EW; spf=pass (google.com: domain of linux-kernel+bounces-2257-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2257-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5DE69B241C4 for ; Sat, 16 Dec 2023 16:30:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D8B135288; Sat, 16 Dec 2023 16:27:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JYeTj5EW" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 CBF99321BB; Sat, 16 Dec 2023 16:27:13 +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-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-551c03ae050so1814246a12.2; Sat, 16 Dec 2023 08:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744032; x=1703348832; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4O+Q+uG5M/KTzI1PKwCAfiw017Nj6I11OqkfEb5dgI8=; b=JYeTj5EWxkrhr2sfmegs/9eU2KoXflDfvUqzy1lPV7/Ml9expVTbESaWbEjYkeGZLf UBnrnJhMGEJADigqZB/fOKtwg6d4gDzXK4lsp4gNk21UzuZpzIz2Ehq7FWtJvNYt9psw 8+5wPoPiwdcc7wTlT7r5GL1+mG0P9jtq+4DrvsEdS487DnCBJGFUMOVp74LJTNLQR/aK NsWD4QPqVc2BojU9z66FqfftdVYueU8FKd14t1bXiIHYABw2WIkLNEtBeGwzHGtwG21r Zas4eRFRQNZGLYF6jqS4/v9H0vpkiiHTD0qvmYBIk6I4jwRQdUN5q3wHtV0ErsvPHUn4 gVvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744032; x=1703348832; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4O+Q+uG5M/KTzI1PKwCAfiw017Nj6I11OqkfEb5dgI8=; b=IKcSO4cdl3WyZgLnqWqCc7IYKuGS6jwHNMu6saONIxKdEyze3hwByDMHFTGfml5/LV ft/rB1YtR5fnMAAiQfreOyQ+zAyg6ybCN+2o9Ifn/hIEhDuAd5utPEdJ4bmvMU53zEeP fwommXxiDlpRUSazsinLp9fh7ZkLU/RqdSPHtqx4TBKPgYDE50BtrrgGs/qh7XyGjw6F r0340Rt7n7pOnvSB3Nqm12KJazw8LDyg/Fet3PSMlgrzTV9lOnVqcU4r4dFWZ9f3Bhmq Uhd/EBZ9kAkVVO3xIq3LJh5AvAVctPIb3WB1naghtOTS2bqMYglIFdaw8+Wk7RWmLURT At4Q== X-Gm-Message-State: AOJu0YxulT+WANsmC5u3p693cUm3+G1e4SEfa7vL6ruJnP/Kg5Iatbzs 4jgBthav5lk8CJxQXQhZSQ== X-Received: by 2002:a17:906:d4:b0:a0a:f739:ad6e with SMTP id 20-20020a17090600d400b00a0af739ad6emr5182343eji.31.1702744032054; Sat, 16 Dec 2023 08:27:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:11 -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 09/27] drm/rockchip: inno_hdmi: Remove unneeded has audio flag Date: Sat, 16 Dec 2023 17:26:20 +0100 Message-ID: <20231216162639.125215-10-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456941167595894 X-GMAIL-MSGID: 1785456941167595894 From: Maxime Ripard The sink_has_audio flag is not used anywhere in the driver so let's get rid of it. It's redundant with drm_display_info.has_audio anyway. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index d99896f1a73a..58aff7a9c09a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - bool sink_has_audio; unsigned int enc_in_format; unsigned int enc_out_format; unsigned int colorimetry; @@ -554,7 +553,6 @@ static int inno_hdmi_connector_get_modes(struct drm_connector *connector) edid = drm_get_edid(connector, hdmi->ddc); if (edid) { - hdmi->hdmi_data.sink_has_audio = drm_detect_monitor_audio(edid); drm_connector_update_edid_property(connector, edid); ret = drm_add_edid_modes(connector, edid); kfree(edid); From patchwork Sat Dec 16 16:26:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179883 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp316000dyi; Sat, 16 Dec 2023 08:34:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfB5k5UdidPIA5stxrnORuwCmVhkw6T2eJ9dmD7uF+qaLm+LmVklqykKmDF4amQ7DtjnqT X-Received: by 2002:a05:6a00:a01:b0:6ce:82bd:93ea with SMTP id p1-20020a056a000a0100b006ce82bd93eamr17865554pfh.26.1702744464025; Sat, 16 Dec 2023 08:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744464; cv=none; d=google.com; s=arc-20160816; b=ydXaEFsUw/OaNzT3tYtApuxuJNBDMDq80Kh9r5DfY+Lyn04Ncs8ulDQC9XChpAsD73 9Y/zV2s2DNpew183eCch5tRCqRNRnHEwH9GPduf1VYkXAf0+T43+lRsiT5ocdOkPUyTA j4KC1LY7uktPdcMq8ncI9D6k8ISDLHfElyKf0DT770XH55h4pXFi1BuqF/wG+qMW1uVr BSFvv+VCG59KboHKgjXh9zqQTb1h1p/op/+Bwh6FNTG0ccauEExAcd1TyvwYDdT7P6KT Aup/Gq6v9XQb9exV++cPpaihGD8B+DKS+kbLX0j702GDIbrNVF60fAoHwRZd9bqMPoyJ RglQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KAoRz0wHCs8LYRbt4lNTAJ8vx4780AGy/20pu4Etj/0=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=qlDGQou7BKqmZXATASLroLnhvzHSOc2vhRVcKnGdbZOIdw6PjyTPlPBovCOFrcQDCi CKNm3R7e779SFXQhjKE9FMhZu5Rb59hAAuVrlRmTv2lTx9qbC5yNpnvt8vAQ+8UGjCT5 LfCdArDhX2OYrYTcHl09VyDjnC4vHbClF0rDWPYZGyZu/zw51jpwfb+0CKtqCwOWKn+X G5DMCKrsQrG38lpHimtF1LJEKsUYI57mM5wm4n/H8RhtJ4lnqFbm6nXQX0HMUNpCAulJ NK3aYLKnpjD6EreGcDDE3jhOevnz3PRIojdxfKhYGDmgxF2TM4PS2ULCowJ8XrLDkBor Dsug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gyg+l2bT; spf=pass (google.com: domain of linux-kernel+bounces-2258-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2258-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n28-20020a63591c000000b005cd60647c4dsi3354103pgb.766.2023.12.16.08.34.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:34:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2258-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gyg+l2bT; spf=pass (google.com: domain of linux-kernel+bounces-2258-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2258-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9C8B5B24538 for ; Sat, 16 Dec 2023 16:31:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3DA6358BD; Sat, 16 Dec 2023 16:27:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gyg+l2bT" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 9E01C32C67; Sat, 16 Dec 2023 16:27:14 +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-f54.google.com with SMTP id 5b1f17b1804b1-40c517d0de5so18402625e9.0; Sat, 16 Dec 2023 08:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744033; x=1703348833; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KAoRz0wHCs8LYRbt4lNTAJ8vx4780AGy/20pu4Etj/0=; b=gyg+l2bTeIwDBEi+sgVX2igib/bUciUDVznKwWMrQL8WS69i5FCUcUynsKlPOUHfOI Aoi/f0dAZfRfjZBi8w8uz6QPrGHovyICXAwwuLvJNK1HTrILEuylHgHx1AyCDXTGQTv+ 5sbPL6rF3QSuLPQYsWN7bBjGSqaUEaUuVC5uUbatxb+gKB3KWGIoFj5T5bwhL/n95u4W zXoRzG2mDaI/tIyJfWdKUNh/7+Pa9YUr78fqD4xTatZ/hWD1agvTrwu2uXICcjte68ng 6GPa1VNiB/qBzhNYygJxWIreu2jr4o4K0971O255hFaCTJnIkSuiLAB4vEIsPVg4smhw Qd9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744033; x=1703348833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KAoRz0wHCs8LYRbt4lNTAJ8vx4780AGy/20pu4Etj/0=; b=wMYDdbCtSbGTPOLmALcuBrC21HadwzSO0KhXoofu5iesZXCo6++iwZ/IWGFjswcha9 8G1S0PPrccO2XEZW5iywQSPBpy7b4H+PYM+VJdG5IctEv5dMdqPNmVk3ivo819cXSycv ZVdtKwJ+7hxb7BChhlfxYy5IBq++3+r7vV3sOAxob/k1n40GrGf4OUlJhQpzReJE6+Cl lPmMsMR73ilQ/hgqAEEbRsZHyiXdpg2BgDQnorWP1KGtlwfId5EJAEbD2DJbyHetY+oF 2z/A7agL3UYR7rb93sD/npn/5hSy9L0bsoskUj7Uh2zDLau9ZOGF4ua2HkGkCTFCmrhx RXSA== X-Gm-Message-State: AOJu0YzvDmt5jBFLgHCkANVnCD4+Hs6JYhDuOeEmWStA6lbvJXf41mzP /5FI+mwnZtH7/xu93VcOCQ== X-Received: by 2002:a05:600c:474e:b0:40c:4be1:be09 with SMTP id w14-20020a05600c474e00b0040c4be1be09mr4886690wmo.186.1702744032805; Sat, 16 Dec 2023 08:27:12 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:12 -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 10/27] drm/rockchip: inno_hdmi: Remove useless input format Date: Sat, 16 Dec 2023 17:26:21 +0100 Message-ID: <20231216162639.125215-11-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456979013451440 X-GMAIL-MSGID: 1785456979013451440 From: Maxime Ripard The driver has a lot of logic to deal with multiple input formats, but hardcodes it to RGB. This means that most of that code has been dead code, so let's get rid of it. Signed-off-by: Maxime Ripard [made checkpatch happy] Signed-off-by: Alex Bee Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 41 ++++++++-------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 58aff7a9c09a..7c75feedacad 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - unsigned int enc_in_format; unsigned int enc_out_format; unsigned int colorimetry; }; @@ -328,47 +327,30 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) v_VIDEO_INPUT_CSP(0); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); - if (data->enc_in_format == data->enc_out_format) { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) || - (data->enc_in_format >= HDMI_COLORSPACE_YUV444)) { - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); - - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, - m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, - v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | - v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); - return 0; - } + if (data->enc_out_format == HDMI_COLORSPACE_RGB) { + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); + hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); + + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, + m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, + v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | + v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); + return 0; } if (data->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) && - (data->enc_out_format == HDMI_COLORSPACE_YUV444)) { + if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; - } else if ((data->enc_in_format == HDMI_COLORSPACE_YUV444) && - (data->enc_out_format == HDMI_COLORSPACE_RGB)) { - csc_mode = CSC_ITU601_16_235_TO_RGB_0_255_8BIT; - auto_csc = AUTO_CSC_ENABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_DISABLE; } } else { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) && - (data->enc_out_format == HDMI_COLORSPACE_YUV444)) { + if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; - } else if ((data->enc_in_format == HDMI_COLORSPACE_YUV444) && - (data->enc_out_format == HDMI_COLORSPACE_RGB)) { - csc_mode = CSC_ITU709_16_235_TO_RGB_0_255_8BIT; - auto_csc = AUTO_CSC_ENABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_DISABLE; } } @@ -443,7 +425,6 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_info *display = &hdmi->connector.display_info; u8 vic = drm_match_cea_mode(mode); - hdmi->hdmi_data.enc_in_format = HDMI_COLORSPACE_RGB; hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; if (vic == 6 || vic == 7 || From patchwork Sat Dec 16 16:26:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp314519dyi; Sat, 16 Dec 2023 08:31:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEiizITG9E+tila3XDPDE/WmNRFnwNwrqG2PnTjYUO4i5OJvE35XEcT1r6IJIYCHYc4bmT X-Received: by 2002:a05:6e02:12e8:b0:35d:4ecb:1752 with SMTP id l8-20020a056e0212e800b0035d4ecb1752mr16148852iln.2.1702744278625; Sat, 16 Dec 2023 08:31:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744278; cv=none; d=google.com; s=arc-20160816; b=Mi36k+eveoF5n5zU/PhYoQ7NYG3dg+0ocQVQPtGuUg6UNzpvHBL/ddM0BHfyItIvsK 8Lv4YgomDvKYGYBXDnwwUfSGAZDqxXrELVro+390kPZNxOBMiFjljUusxFdLjfJJDsME IF+MuDq/r4Zq6Bg2o0f8RrXyp7OkL7d7JBOFOqrO7fjWk9z/pcIIcmSMarnYckJGPTjt tRaWGgfqDAVsjbvnn5HQ9BKmtKAVeagDrz5UatH5LKxxBY5Ar4X0YGoInMTZn+FIFWLX 64NRNe3BDCW5MElXO540pF1JEi5ZhA6rbHRsRY/ED9/jo7kVS6DtQv+vq/2Rw6GF+Mgv WvFA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=droXS1VwLjQHMIbiZwuYM0gMqlIpmFeRVQnM5SEX4co=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=xGdOwP5t2UFWKdQXanVXfsJjoA0h6fv6KqoxqbzQcNuItyzMUDh0wyGyB4g6wngr+S kOicz0UdcYS3cMwkTpa6a9sjxtBqIxFTBzcpo1urqhl1YQR+J0SK1BDZPlihsD6ERdKV N4SRwo1+hYyvKr0hecPa6kXckZOPdAenoH8iDHhWQNX4rfgm/Psyb3kqer0S1XvBs+wk Ntp6N6mEmQ9kvaf/SGuPwKl29X5kPki+uLkRjvBWdOGRn0gXBIkKGYfpXWXsb4tl0IZM DKOlMj8XIrvs2UYcdjoftVwv3iCUUlbdn67FDg6afXdu9FzEsKrp9j+0hNWno9Pm9Fpo iHbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UXIbdnTC; spf=pass (google.com: domain of linux-kernel+bounces-2259-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2259-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 h6-20020a170902704600b001d36d944044si4389785plt.119.2023.12.16.08.31.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:31:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2259-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=UXIbdnTC; spf=pass (google.com: domain of linux-kernel+bounces-2259-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2259-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 5FA9B2857C3 for ; Sat, 16 Dec 2023 16:31:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8D8237176; Sat, 16 Dec 2023 16:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UXIbdnTC" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 93BAC341BD; Sat, 16 Dec 2023 16:27:15 +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-f50.google.com with SMTP id a640c23a62f3a-a1d2f89ddabso191578366b.1; Sat, 16 Dec 2023 08:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744034; x=1703348834; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=droXS1VwLjQHMIbiZwuYM0gMqlIpmFeRVQnM5SEX4co=; b=UXIbdnTCCrMG+WGyY3sIj01f/52yFssZkolV4cef4XuAPGt7lQ9wye8gZ6mjhdh9SP VC+QhuEdx2Dw6uBmnjxCjZd1tY6PHPteCXcQEbyFmTJTXt3c70tHYzqAsp4h0bJ6/W1L 6iKNsOu8fcWalGXtl/cjZulBeLCfnfnCqImsvO+8VYBSbe6sMKcaDtcnldmx2UWGPw35 0Fr/uIWE1AskOI/zbscXmEBBEkf1Elv1jgsgkwQ8DebK14dtE9Ph+XFyR0bjGFOD24V+ rLNv9S2kdnHmOwL7xc4uehZGHQiiT9b2tzfZR8dFjFZEEWLbt8FITlbAAWAjsaEXK2gZ vojQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744034; x=1703348834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=droXS1VwLjQHMIbiZwuYM0gMqlIpmFeRVQnM5SEX4co=; b=ZaOWPG7KMJa553YrT7sPrCukKj41JY3wtUdIFqjstWEnCU2vEjLX4pNn12FgmRdsDw hkgGYcUABM28o2Pn8wSdml2YW5IM54Ng2+w+8A3/io7Y4q8ctWqoUchrNPHiTLUUgqy8 BPaNFX2sx6kaovddpTZHK56zmcQEd63ARGyhzFrXAys/A5lynB01a+Gr8ZplCatbLwH5 p2STZPYQpgx2fbFuYERI7I5mPm6obIjqgFYsCFOZGnLGlHINibCT9IqL4D9gzgonPscz cqkoei/3ruBQx7upKZ6KVS/OMIDTXbxUhmm722kwdEo+StkXbHOQu7XonGygzXnntV6k whkA== X-Gm-Message-State: AOJu0YxWvO0/PZXgM5sXQGrZSvwcEZhBmjdsreyTcaZBkbHYUMzhf0yM zRXH9nQcXvZetiDMeHiWwg== X-Received: by 2002:a17:906:142:b0:a22:faf0:3bbc with SMTP id 2-20020a170906014200b00a22faf03bbcmr3702764ejh.139.1702744033851; Sat, 16 Dec 2023 08:27:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:13 -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 11/27] drm/rockchip: inno_hdmi: Remove YUV-based csc coefficents Date: Sat, 16 Dec 2023 17:26:22 +0100 Message-ID: <20231216162639.125215-12-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456784786674808 X-GMAIL-MSGID: 1785456784786674808 Now that the unneeded support for YUV based input formats is gone, the csc coefficients for those formats can be dropped as well. Signed-off-by: Alex Bee --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 37 ---------------------------- 1 file changed, 37 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 7c75feedacad..04344ee1265d 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -74,49 +74,12 @@ static struct inno_hdmi *connector_to_inno_hdmi(struct drm_connector *connector) } enum { - CSC_ITU601_16_235_TO_RGB_0_255_8BIT, - CSC_ITU601_0_255_TO_RGB_0_255_8BIT, - CSC_ITU709_16_235_TO_RGB_0_255_8BIT, CSC_RGB_0_255_TO_ITU601_16_235_8BIT, CSC_RGB_0_255_TO_ITU709_16_235_8BIT, CSC_RGB_0_255_TO_RGB_16_235_8BIT, }; static const char coeff_csc[][24] = { - /* - * YUV2RGB:601 SD mode(Y[16:235], UV[16:240], RGB[0:255]): - * R = 1.164*Y + 1.596*V - 204 - * G = 1.164*Y - 0.391*U - 0.813*V + 154 - * B = 1.164*Y + 2.018*U - 258 - */ - { - 0x04, 0xa7, 0x00, 0x00, 0x06, 0x62, 0x02, 0xcc, - 0x04, 0xa7, 0x11, 0x90, 0x13, 0x40, 0x00, 0x9a, - 0x04, 0xa7, 0x08, 0x12, 0x00, 0x00, 0x03, 0x02 - }, - /* - * YUV2RGB:601 SD mode(YUV[0:255],RGB[0:255]): - * R = Y + 1.402*V - 248 - * G = Y - 0.344*U - 0.714*V + 135 - * B = Y + 1.772*U - 227 - */ - { - 0x04, 0x00, 0x00, 0x00, 0x05, 0x9b, 0x02, 0xf8, - 0x04, 0x00, 0x11, 0x60, 0x12, 0xdb, 0x00, 0x87, - 0x04, 0x00, 0x07, 0x16, 0x00, 0x00, 0x02, 0xe3 - }, - /* - * YUV2RGB:709 HD mode(Y[16:235],UV[16:240],RGB[0:255]): - * R = 1.164*Y + 1.793*V - 248 - * G = 1.164*Y - 0.213*U - 0.534*V + 77 - * B = 1.164*Y + 2.115*U - 289 - */ - { - 0x04, 0xa7, 0x00, 0x00, 0x07, 0x2c, 0x02, 0xf8, - 0x04, 0xa7, 0x10, 0xda, 0x12, 0x22, 0x00, 0x4d, - 0x04, 0xa7, 0x08, 0x74, 0x00, 0x00, 0x03, 0x21 - }, - /* * RGB2YUV:601 SD mode: * Cb = -0.291G - 0.148R + 0.439B + 128 From patchwork Sat Dec 16 16:26:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179874 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp314712dyi; Sat, 16 Dec 2023 08:31:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFEgQlpz1jRiWykOK7fq9De5VDFb4nJerNzn9gNyjZ5vvVa3pzTyXlbNxmRnw1FcFkaH7n X-Received: by 2002:a05:600c:54c5:b0:40b:5e21:e269 with SMTP id iw5-20020a05600c54c500b0040b5e21e269mr7283621wmb.86.1702744298600; Sat, 16 Dec 2023 08:31:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744298; cv=none; d=google.com; s=arc-20160816; b=CKPAtK7tuy8vkzTQ8gisYtv7a/VJMTl1NW74oqSbndur5JFOD5tqXLX/Ix3KtLqyQg abi2oPsGnb+7nnOFNJu/oGKgm6KlxAE4F8ky439kqlpQsJhWpsLMoVQR4J6yOOwS7YrM coqdlJ7/P40eZ4I4l0JIYyKxXSZ23FdK1fC/2az8XIwcFugs9bprLOD0doyNEwaP/8R4 ffeGIRs5PYfKjSGmq32scetLaLibLMdmqMN6eQS4XupfQCLQmTMk/W4HB7IcTNQQaSjy gam+ZtFzZZ9LuWK6lpl0WvfzwsNjreRmUnCEBBZUJRjy0jFcaATFKN+R4rxMKMhjJB4o DsNg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ECr4TU+4dWwEpyi0MRJHLZRYm5yt9s85NOlMMczFD3o=; fh=h0hxfDb/3ALWv9lShyWsVi6X20GLeNxytDNVL5tV8Gg=; b=ZXo6G90Niu71bPyaKLt3EMzOa5sg2f3l5lvzsG3Z0NP39cA+FFhBJdiqUJqfseHkBr Rj5Cko4M135mnxJ+yhiwUiWd5XAR8dkLc9GzzwQ1waO9C+E/k9PY3igbK/XuPM9Iqcon GFRa5hEJRNc/7BxCklzkFAFn2YsBlwf3Tp6NnfzuGPXR7cb75JqYnNB8fWMsDcdXOApG ALM6z7oZ87VIjB4hSmjW+GXcqiJCHpUkqT348WqrMhSUz2kvI06zYnoU0NpqoK8XiIYh pk0buosw7ouhqBaisjGyeyRntljENhUpxTTWZxtHp+ZHeBdD/fTvOFasrpMI4fHkNp9x BDGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nRsM2dgx; spf=pass (google.com: domain of linux-kernel+bounces-2260-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2260-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ka8-20020a170907990800b00a230f36ad7dsi2616777ejc.54.2023.12.16.08.31.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:31:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2260-ouuuleilei=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=@gmail.com header.s=20230601 header.b=nRsM2dgx; spf=pass (google.com: domain of linux-kernel+bounces-2260-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2260-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 126E51F23CE4 for ; Sat, 16 Dec 2023 16:31:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E12837D1D; Sat, 16 Dec 2023 16:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nRsM2dgx" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 6672E3457A; Sat, 16 Dec 2023 16:27:16 +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-f49.google.com with SMTP id a640c23a62f3a-a233bf14cafso3904266b.2; Sat, 16 Dec 2023 08:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744035; x=1703348835; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ECr4TU+4dWwEpyi0MRJHLZRYm5yt9s85NOlMMczFD3o=; b=nRsM2dgxziOh7IR/Ec0+3dhEvdlPxRuAShetYoQ4+ku8pSZoWLUF4HAkJjiWGUwoVX i8NKUJ7kZutYBqmji0Pa/Nrv0YhBEgjScztMRjj+6kvWqj6ydvIR176RRwg5yYHV3Uqf cSr+YBsX4UH6IFdyLCQ0n23E4vHcmz1C9nU6h2CFSK+1SjoYRHFoPa9iQzwRKudX1KYV ITleLTLdTbtiIWCFB8FwG/NHZTF9s/9Cj1WJNQlyqXszYMIUBs3FF55aPDoJXCFDUeIQ GF84dMArT868PtUJSx8kO685qhB6J0gIvJf5Rfq41JwYfO/3rfl5Ea4vVxF91ebjuDqF KT1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744035; x=1703348835; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ECr4TU+4dWwEpyi0MRJHLZRYm5yt9s85NOlMMczFD3o=; b=LTtBNN7LLoOJTUc29pZHTb19U6BFBXAvCct/MfVwvPHIkUHsAPMg4InDfGo7PILzB8 U82dsVF6wP8nLmiMeEG5UYawyWeknh5PwFvU+kAz/eN/JFJudRGuXRHXg04kdaoTKD+u QhWzIPmgII8H7lT1tNXwJW1eoZYel0TccyKR/w8cqGqWAy4sBeGfx46IkbbumvYx1+YQ QzhZaDoshrNof7qW1uS8ljZI37OPss699eWHm4hJmVkzHC/zjPzN/MxdHRIxE1eJ+qzP cJfsLzZ+hbS5qghvU1tKjSzSMEZFm/nlFuxXw/CI2QFRJnktBAh4/HCqGXyC3Rz0t+16 3aCg== X-Gm-Message-State: AOJu0YxWOdNvPrUrBZBry5K47q/UznndODZTUivtxIyk9usWjt3FcyU8 ua49CX6OIYd2OtgXvevkgw== X-Received: by 2002:a17:906:e8d:b0:a19:a19b:c736 with SMTP id p13-20020a1709060e8d00b00a19a19bc736mr6780924ejf.134.1702744034682; Sat, 16 Dec 2023 08:27:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:14 -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, Johan Jonker , Alex Bee Subject: [PATCH v2 12/27] drm/rockchip: inno_hdmi: Drop HDMI Vendor Infoframe support Date: Sat, 16 Dec 2023 17:26:23 +0100 Message-ID: <20231216162639.125215-13-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456805724388685 X-GMAIL-MSGID: 1785456805724388685 From: Maxime Ripard The HDMI vendor infoframe is only meant to be sent with 4k60 modes and higher, but the controller doesn't support them. Let's drop them from the kernel. Suggested-by: Johan Jonker Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 35 ++++++++-------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 04344ee1265d..1dd757845547 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -208,11 +208,15 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) } static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, int setup_rc, - union hdmi_infoframe *frame, u32 frame_index, - u32 mask, u32 disable, u32 enable) + union hdmi_infoframe *frame, u32 frame_index) { - if (mask) - hdmi_modb(hdmi, HDMI_PACKET_SEND_AUTO, mask, disable); + struct drm_connector *connector = &hdmi->connector; + + if (frame_index != INFOFRAME_AVI) { + drm_err(connector->dev, + "Unsupported infoframe type: %u\n", frame_index); + return 0; + } hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); @@ -228,28 +232,11 @@ static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, int setup_rc, for (i = 0; i < rc; i++) hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, packed_frame[i]); - - if (mask) - hdmi_modb(hdmi, HDMI_PACKET_SEND_AUTO, mask, enable); } return setup_rc; } -static int inno_hdmi_config_video_vsi(struct inno_hdmi *hdmi, - struct drm_display_mode *mode) -{ - union hdmi_infoframe frame; - int rc; - - rc = drm_hdmi_vendor_infoframe_from_display_mode(&frame.vendor.hdmi, - &hdmi->connector, - mode); - - return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_VSI, - m_PACKET_VSI_EN, v_PACKET_VSI_EN(0), v_PACKET_VSI_EN(1)); -} - static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { @@ -267,7 +254,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI, 0, 0, 0); + return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) @@ -410,10 +397,8 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, inno_hdmi_config_video_csc(hdmi); - if (display->is_hdmi) { + if (display->is_hdmi) inno_hdmi_config_video_avi(hdmi, mode); - inno_hdmi_config_video_vsi(hdmi, mode); - } /* * When IP controller have configured to an accurate video From patchwork Sat Dec 16 16:26:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179888 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp316513dyi; Sat, 16 Dec 2023 08:35:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/EgTn3dOTefTB4Lk3hV97rOOLofv/7ajGWaE3bOB4+yNf61zVIuNk5n+v+zHbWiGRB64Q X-Received: by 2002:a05:6359:4123:b0:170:c1a7:254 with SMTP id kh35-20020a056359412300b00170c1a70254mr12644679rwc.2.1702744542819; Sat, 16 Dec 2023 08:35:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744542; cv=none; d=google.com; s=arc-20160816; b=rGgwRMMa5tcb6ndk0cejOduYPZaSKnZf1jrkSeexcculP3nYPNny0f5QabNZvGkihh 2n9KoVzyI4MuuGMetzZDrYNthMT333FEimLujhTieFsaLRWWKYc2hA9jW5Jiy4go1Gcd ISgTgVOGLlbfjUyKYDptobtDwPlaxkkltn4aeIS1Knv6mG69HazIazCzxTS/9v39qlhc hObb+6Cp+m7muRpTCc8+cg+cwV697IHfUHJyEQ9doKSwV43gReCFH2SJ/hC+Kh1Hnt6l uE3jT+k5qyo4VueiGVTn5ZNfxAeutTAyJJ80a4QHz6HKeRI+gjVGWmH6BTGIUipj7Rj3 LEXg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=i9QZuywAC4EI3NrqImc1jlnBGMQF6PpPHDhHez7fyFw=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=tdGnEaQX/WlW6/PGxlkbQhj4AJtD1MIlAbfPsEPpNkNzDyJwS6zSZRRwHp8Z75bKtn 9ZQs+sbH/TDo1QNKgooOafFqU6n8BFLuENo75OMSCUsNwsbJqxRocoNjHoVUZa50TzO/ Od0P6awrl0nb0DvS+2G5q0+smfBP2dGZWEeEOEAVUhUHr2uuNVl01o5lA19c19NoU7mJ Hea/slABpoZlUUSRbAnCUWuXNhVBsuszkyDL1ZN0S3n4Pfl9pBhkf/fPR5+4tDVY1zft kODENeklrk418FKDR132pTFUPK/jUMA42I+HdZqFH+o5/SNPnpNZ6OiNPdr1Hxts3s28 WDdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lC6ELqZ6; spf=pass (google.com: domain of linux-kernel+bounces-2261-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2261-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t11-20020a17090abc4b00b0028b6aa45c29si50203pjv.59.2023.12.16.08.35.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:35:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2261-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lC6ELqZ6; spf=pass (google.com: domain of linux-kernel+bounces-2261-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2261-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CC812B25039 for ; Sat, 16 Dec 2023 16:31:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5520E3457A; Sat, 16 Dec 2023 16:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lC6ELqZ6" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 0D89334CF1; Sat, 16 Dec 2023 16:27:16 +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-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-552d39ac3ccso2601012a12.0; Sat, 16 Dec 2023 08:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744035; x=1703348835; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i9QZuywAC4EI3NrqImc1jlnBGMQF6PpPHDhHez7fyFw=; b=lC6ELqZ66HTWeSk1fO0gBvzesZIupydZdhYexTiF+MkbiTU5N/qM7wSmLB5pHdpTkS TjEtvBs9cF+Y8aAnIspe6BvXUxA0n2IFXhgAdZyA0kIGQ25adKkRD9l7PXAtuYIzYpnZ PqrT54vqL90GuU3BpIKvksbJUWFoHPZ4MjL1C8hsNDrPzEB2nel52fRdMjjcmjT5JN4z FeWilNCsbghNXjR6LZlWkcJua5jETJ0T/S4l9Ubmxa8h4Azn23WrxF+pt+Ul+CsgRiwV gXCdP1K4dZvuH0TBn4AIM9K33F+Z14Ym7++tj3xph6JuV1UBWjOfg0inKo5D1nErkBM5 Tmqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744035; x=1703348835; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i9QZuywAC4EI3NrqImc1jlnBGMQF6PpPHDhHez7fyFw=; b=syoHOsqdoK0Ofx0XWULxmx/Lv5d4HJgUUunuJHBSZeRk1eDbq2BCp9xddSezmitd3u DPtueQthTV2vZx0L/8VqdOz5VdTlDRcRDVpzelM/Bc4MOUBXftYL2V3SIsfPfEd0NvfQ iVulnx/FGNL9uS7TMaxDx35UA4IbLQotM6LmLvsFo/0omLY8l6etUo0MSH4sjWVYGjRq VW9x0AHCL6u5drOiOIJvqGdp8OV6nUg5W0s7Pm83Oqg+qw5BaGdQZ2kjRpwIp4G2pOWM FzADyGeIprYHIX2lZvJKGOjxpm4MuUjXKkpxYytu9H+fbVXZE/dWyTOFTTh2vyvf7gBs BoSA== X-Gm-Message-State: AOJu0YzaGLQoxMwzuu+rXghMdNFPU2Ea0+z00Uh+mqi5CHE/DnsKy8au uYMPrBDglQOFYyvty5P83sumhHz9KA== X-Received: by 2002:a17:906:610:b0:a19:a409:37dc with SMTP id s16-20020a170906061000b00a19a40937dcmr14010099ejb.53.1702744035357; Sat, 16 Dec 2023 08:27:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:15 -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 13/27] drm/rockchip: inno_hdmi: Move infoframe disable to separate function Date: Sat, 16 Dec 2023 17:26:24 +0100 Message-ID: <20231216162639.125215-14-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457061965725670 X-GMAIL-MSGID: 1785457061965725670 From: Maxime Ripard The code to upload infoframes to the controller uses a weird construct which, based on the previous function call return code, will either disable or enable that infoframe. In order to get rid of that argument, let's split the function to disable the infoframe into a separate function and make it obvious what we are doing in the error path. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 46 ++++++++++++++++++---------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 1dd757845547..6354949bfd8e 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -207,34 +207,44 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, int setup_rc, - union hdmi_infoframe *frame, u32 frame_index) +static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, u32 frame_index) { struct drm_connector *connector = &hdmi->connector; if (frame_index != INFOFRAME_AVI) { drm_err(connector->dev, "Unsupported infoframe type: %u\n", frame_index); - return 0; + return; } hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); +} - if (setup_rc >= 0) { - u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; - ssize_t rc, i; - - rc = hdmi_infoframe_pack(frame, packed_frame, - sizeof(packed_frame)); - if (rc < 0) - return rc; +static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, + union hdmi_infoframe *frame, u32 frame_index) +{ + struct drm_connector *connector = &hdmi->connector; + u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; + ssize_t rc, i; - for (i = 0; i < rc; i++) - hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, - packed_frame[i]); + if (frame_index != INFOFRAME_AVI) { + drm_err(connector->dev, + "Unsupported infoframe type: %u\n", frame_index); + return 0; } - return setup_rc; + inno_hdmi_disable_frame(hdmi, frame_index); + + rc = hdmi_infoframe_pack(frame, packed_frame, + sizeof(packed_frame)); + if (rc < 0) + return rc; + + for (i = 0; i < rc; i++) + hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, + packed_frame[i]); + + return 0; } static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, @@ -246,6 +256,10 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, &hdmi->connector, mode); + if (rc) { + inno_hdmi_disable_frame(hdmi, INFOFRAME_AVI); + return rc; + } if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) frame.avi.colorspace = HDMI_COLORSPACE_YUV444; @@ -254,7 +268,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI); + return inno_hdmi_upload_frame(hdmi, &frame, INFOFRAME_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) From patchwork Sat Dec 16 16:26:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179876 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp314985dyi; Sat, 16 Dec 2023 08:32:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5RF2kdgsvbfpPCaV3cVAt+rro2Azxa9J/lqW4z8vHhMF/r0l+eVr4MljBJtD9KoOjJru9 X-Received: by 2002:a17:90b:60b:b0:28b:26e4:890d with SMTP id gb11-20020a17090b060b00b0028b26e4890dmr1939801pjb.72.1702744334821; Sat, 16 Dec 2023 08:32:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744334; cv=none; d=google.com; s=arc-20160816; b=c6eGhOxyvrmH3u1H71so0uX0YHecTYKcnhtkKo6SVXlioTYl6+tGLs+rofvSffuDwk m1hp5hBoSJP7X5mCLTccmNRgxkgI+KCr+98r+B7+7QbG5k/WuOl55Sia+dBGuHVG3b5Y o4AZkaPJoIA7qamoKbR/A46XEiyc9kpt4xQj+YgABXrkHkBbKRBFmM/NiNPC65I+MrSC i69T3uQpXRh81En3AkKXaJS3ND+5I1DNeK0FLlaC26k2Yomw6eLGiywEE0cAEtL6SrhW Mr47z41TL3+r8f09Q9bojYM/VVgNP3KN5BNCt7BpnXVfdoeg95a+ZQa9nj4bCndJyYJq 5QvQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mG1054x2y8+5VXwex9KrJL2EhA9y28dmW4DfXU50wTY=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=M0fuw73B6Sqt5mo2HtJEsq4NCtS7s/nxdVSnZH7fHfzikeloQIaSEsKU2JKo32Jx8S fkkPzic+UZK5sVShknYWkIHOkh9EDJNtr5rwO++7auEPb0BLkSSmqR7TmIFIGmJYOZ99 Nj8nb38Z3eIczl8415RW5HPiiHnHKEj+V7bOCF7T7V2GSvH74CKU2bM1Lwui4j2wVZ6I bpRUp1+fQtcsP6cSHVVsonMRvcW+MEeJTHNico1YHpQIleec7N45hrbybGa2ov7jHkcw I8QTltS1GGnWHzBo/joSAMefZuF5SS4/P+5gnc/5RWKCWl0cB0GxxlN+9Ipvqk3wzVG7 Mv9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X6rqeUoM; spf=pass (google.com: domain of linux-kernel+bounces-2262-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2262-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 z10-20020a17090ad78a00b0028b08990987si4787514pju.168.2023.12.16.08.32.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:32:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2262-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=X6rqeUoM; spf=pass (google.com: domain of linux-kernel+bounces-2262-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2262-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 99216283185 for ; Sat, 16 Dec 2023 16:32:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 289DD39AEC; Sat, 16 Dec 2023 16:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X6rqeUoM" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 D6B3E3527F; Sat, 16 Dec 2023 16:27:17 +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-f47.google.com with SMTP id 5b1f17b1804b1-40c60dfa5bfso20167155e9.0; Sat, 16 Dec 2023 08:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744036; x=1703348836; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mG1054x2y8+5VXwex9KrJL2EhA9y28dmW4DfXU50wTY=; b=X6rqeUoMewdEbdxKdatXx/6CxrZQVCowouNMZNs0U1LuHiQIBWeTu+nMx5RjvJG5Yd dtIgfJbyyAnAohClB/CVXWUk9lrXH7HjlX5ss+KND56MWvffk8QNNlK4uEiQhDm+ImMF cxf/g1b7bfnMeDIuaUR/TRzsWnClyplK/9GYW0ND0gKE5wmx120n2lqx/gAVRojdwfW3 2uPGtIMQsI9bVl3RyNq/sAfH1nVTvHyoark/V9vodgmuB6WVJ70K7wv25qvUX4i6SHsK 4jeE00mXi7yFX3nAMclo5vMtwgTbinbCYq1Gjn2cprJm1s+JphpQBJcr8deF6/cq6JYi 3EYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744036; x=1703348836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mG1054x2y8+5VXwex9KrJL2EhA9y28dmW4DfXU50wTY=; b=VH/uP8gFV+/x1RnERivK4deyEpB2mnp68jiN1y8Oz790tPaIfLCRyCGPXCYOrhtVPn A6MhDAWv27yY0AIoP02wMymOIxZI2nhiObD8LDqxPeMgucqQhxyTth4iPS3uPJokjLe2 g7yl/7b0e7PFziZaoq/xTa4CJpIlDH90K9TyeqO9t5iG/UKCFWhn87r6fos+s4+iF7sE iOKwvAOyIOt3wQ0prX9qRdG+qsbV6vXA+aCzsJljCQ07aUcWosAux9MsmzvUCYMl7OGa kNvmeLHBYZEqIcsETWT53VebFwT7ThDPrdzeCaePtxWquwhshyvMyJFEnyE4hipV+Zxx Ljww== X-Gm-Message-State: AOJu0Yw5dEHac9g4m16xzfshND47HDV2SqV4YJijZms3pHX17r0UcDcq w7sM0kQrWtsfB9Z+iE0WjA== X-Received: by 2002:a05:600c:3596:b0:40c:ab87:9d9c with SMTP id p22-20020a05600c359600b0040cab879d9cmr547390wmq.53.1702744036134; Sat, 16 Dec 2023 08:27:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:15 -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 14/27] drm/rockchip: inno_hdmi: Switch to infoframe type Date: Sat, 16 Dec 2023 17:26:25 +0100 Message-ID: <20231216162639.125215-15-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456843153242608 X-GMAIL-MSGID: 1785456843153242608 From: Maxime Ripard The inno_hdmi driver relies on its own internal infoframe type matching the hardware. This works fine, but in order to make further reworks easier, let's switch to the HDMI spec definition of those types. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6354949bfd8e..b6b34f4b8cda 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -207,33 +207,34 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, u32 frame_index) +static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, + enum hdmi_infoframe_type type) { struct drm_connector *connector = &hdmi->connector; - if (frame_index != INFOFRAME_AVI) { + if (type != HDMI_INFOFRAME_TYPE_AVI) { drm_err(connector->dev, - "Unsupported infoframe type: %u\n", frame_index); + "Unsupported infoframe type: %u\n", type); return; } - hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); + hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, INFOFRAME_AVI); } static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, - union hdmi_infoframe *frame, u32 frame_index) + union hdmi_infoframe *frame, enum hdmi_infoframe_type type) { struct drm_connector *connector = &hdmi->connector; u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; ssize_t rc, i; - if (frame_index != INFOFRAME_AVI) { + if (type != HDMI_INFOFRAME_TYPE_AVI) { drm_err(connector->dev, - "Unsupported infoframe type: %u\n", frame_index); + "Unsupported infoframe type: %u\n", type); return 0; } - inno_hdmi_disable_frame(hdmi, frame_index); + inno_hdmi_disable_frame(hdmi, type); rc = hdmi_infoframe_pack(frame, packed_frame, sizeof(packed_frame)); @@ -257,7 +258,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, &hdmi->connector, mode); if (rc) { - inno_hdmi_disable_frame(hdmi, INFOFRAME_AVI); + inno_hdmi_disable_frame(hdmi, HDMI_INFOFRAME_TYPE_AVI); return rc; } @@ -268,7 +269,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, &frame, INFOFRAME_AVI); + return inno_hdmi_upload_frame(hdmi, &frame, HDMI_INFOFRAME_TYPE_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) From patchwork Sat Dec 16 16:26:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179877 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp315143dyi; Sat, 16 Dec 2023 08:32:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqSGa86PlNLuxRxFcWHsbEJDuDyVzSNMIS6NW1IHrb4SmxQy+ItSLtWtiY4QMWh5V7CNUN X-Received: by 2002:a17:902:db09:b0:1d0:6ffe:a04 with SMTP id m9-20020a170902db0900b001d06ffe0a04mr16396583plx.98.1702744352124; Sat, 16 Dec 2023 08:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744352; cv=none; d=google.com; s=arc-20160816; b=G0pI0E52eRs1+79ACUbLpYzKioin/JX0O3Q/pD8ZyZihCklQZTrXzxCy0HVBJYYQ5m vcbKk6wtRLIFzXOtx/qoZjoiaFJTIIuqCfKnYTiXZe5Cl5YYqsOBhJ74FKZYEXJCWHfW xOnRLzEgzxhwbxxDShQVcv0dtH3zQAQ8NYyb9pp/KKlpbbPkRm9Ag2g3EKjW3MRX/9+8 PrzOgMNpXhKfWKOjXFaBki8xnChGxs3gF9SW5N1Y3S15mc2/SH/+/pNMMGCT501f9eBw uWSIFvEU4K8FViPOnncskmZ0kaUKpnfxL/B2R2CBepPJTt9O2QY4mxuERP3ymGNq+ma5 Ev2g== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=73XUcSiZm29Hst8BGY/CNDIJrl23XpjPpmNwnFVb4KY=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=LB/UNPALkWS86RG5pkNpWqEgjoVn5bMuQpuRIhFKAld7XSG//q7BBGwxxod4FyqP/G pt9o8JsWKxk1VXKxLrLz88cdVDDSAU4VmOhRGEExvghpqgqXarCtLsG8mhZdb6sKs8mq Hi/TYj13oTb1dSY5CTw7LmMYsl9iLHVk4Xdso+jH+RpQ7D4ozEnYwqluSL33mu/wCgW7 Ey22CqipyuQY4mP3/9din0Fqc9IV+yyymOacJ/KFEJfzYuA/eBb/B164qoP7QFlgaRmY foYv99qxhir5UXCD4lmOws6BMNJvlFASAUJbDhwreaUz6w/1IarVeIBRAob/NvyYMo/k KnfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EjcS9X4K; spf=pass (google.com: domain of linux-kernel+bounces-2263-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2263-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 y17-20020a17090322d100b001d0a8bb96a5si15463577plg.411.2023.12.16.08.32.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:32:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2263-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=EjcS9X4K; spf=pass (google.com: domain of linux-kernel+bounces-2263-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2263-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 D9DFC2857EE for ; Sat, 16 Dec 2023 16:32:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D6F1F3B18A; Sat, 16 Dec 2023 16:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EjcS9X4K" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 B8FD4321BB; Sat, 16 Dec 2023 16:27:18 +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-f54.google.com with SMTP id a640c23a62f3a-a1ef2f5ed01so216691866b.0; Sat, 16 Dec 2023 08:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744037; x=1703348837; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=73XUcSiZm29Hst8BGY/CNDIJrl23XpjPpmNwnFVb4KY=; b=EjcS9X4KdVNULbVGSH9dKIdFJ+b2Be0IHxPzAGMQuIssww7sP2z/ouZIaRf1Zu8D0q 7iHBKO1rhMslEaofNfIUlyC5IQX8KINU2ETtmonBkHyNw6YGe8OM0DYbvsWTceHpv2ES WZ0/o8Np40jKWVjZxAXPXKG7RV9avQ8Ep1/hHR7VuF78fR26es8h5EWPisXU7+s1JMt/ lhCSr0oS5oKLllL1D+wqkdYQ1RcfXVjXSoH0g5XYsoLst2UaJrnbirfAbjh0dlX0DfHT LksCFtWEslvR/zAwDTn5R8aDpVv2Wk/nRvXhCRqISflRdgn7CFk/GFXg9g5sr5jsh7NW 73BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744037; x=1703348837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=73XUcSiZm29Hst8BGY/CNDIJrl23XpjPpmNwnFVb4KY=; b=T2iKX+KePhBmW3Ffs4yD0L3cgOpokuOSg1lnUg3/XMVfoNOShogVdGY1Jgq5zNVFiB rtSWe4YC7H+ChnhfXcGuWDoqlNU6FfGzYZy6L1S4b2zDdDOPJDiUKuA7RM6KvLo4mASe Ml2BFH890jFFSkAU72g117JjIk3yFW1StKqQ594b0Pxsx82+tcqZvrBQe450uNPKvK/k tKZFmMRi+wMLiTBGB9s+DEHlzfBECG10w1fqnHW+JIJD0lrb0jqi9No6XhDlPRTs5LT1 Zrj9zSY6OJJnezsPF2jcVe3JsySlcFEgzxJA5cwkgaXY07sISxv0WA5IwR6VaDg/m/Kq +8og== X-Gm-Message-State: AOJu0YwotkEfCBHcNAItpgE70QzNqq5DaLNmpwIrvWgjb2xX2CyfJJk6 ETa+/mp1AlFAFcIKYCKfdQ== X-Received: by 2002:a17:907:724d:b0:a1c:a39d:dcbd with SMTP id ds13-20020a170907724d00b00a1ca39ddcbdmr4339820ejc.232.1702744036964; Sat, 16 Dec 2023 08:27:16 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:16 -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 15/27] drm/rockchip: inno_hdmi: Remove unused drm device pointer Date: Sat, 16 Dec 2023 17:26:26 +0100 Message-ID: <20231216162639.125215-16-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456861416646315 X-GMAIL-MSGID: 1785456861416646315 From: Maxime Ripard The drm_dev field in the inno_hdmi struct stores a pointer to the DRM device but is never used anywhere in the driver. Let's remove it. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index b6b34f4b8cda..e37023d8fa39 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -44,7 +44,6 @@ struct inno_hdmi_i2c { struct inno_hdmi { struct device *dev; - struct drm_device *drm_dev; int irq; struct clk *pclk; @@ -760,7 +759,6 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, return -ENOMEM; hdmi->dev = dev; - hdmi->drm_dev = drm; hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) From patchwork Sat Dec 16 16:26:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp315281dyi; Sat, 16 Dec 2023 08:32:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHbdRTvfj/PLhKAayJTkuJF6Wp6aSp+E3ODR9hdMdyMNE8QjgmgeBg0cWK75DMywhd9z1NE X-Received: by 2002:a05:6808:e8d:b0:3ba:3cee:cf50 with SMTP id k13-20020a0568080e8d00b003ba3ceecf50mr4153409oil.111.1702744370664; Sat, 16 Dec 2023 08:32:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744370; cv=none; d=google.com; s=arc-20160816; b=EYFj7SG9mz9mWBsoG38fFBgiTJbedwqGHIcATQdW0Rq4lBXj3QQ/AbMSXIYm2N/E0s EiWElFiMPhYCNDGAVMVFGJD7REuBsUBSvh8Y5aGdmRqpC8FbVZwIvMqzAbL3ujropjG+ QNMDpa99nw9TPBwwYH2ngfvK7lVrtpG9ZFKScKiv0XBaY54jD9U0m1bHg5QCIxWdD14M j2mOCq6RmhS0dE9E8W/Tg9yrpS/3zGkq1cJSN+dthuiDXkpS1MbAwSqe2jc104dHLBT6 cdTQ3UXjnnt/EPPvBcVQxhyYlQUCympMlxYeoFH2+86tZ+Dx61ZP1q7zRLFx6qqwzpLh Ft4Q== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XVVbI3UTdjEdNjMJt0TLf0s4Teux8aF6Z8rzwOg5CSc=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=aVYf6zOAwth+m5wE640Sxx/PIjEyKmMOOnZFh8vFKtbTkCGGYlzT3fJ9FBHyFCLNyJ GVLgDOam9FsKa2d/QIyFapvIlHsWOAuDr74Du4nB5XIOnQPY9+UqTaFZEs/chUzni0TG XG9j37yne1gnE3TwxLDRYQfBJB9Ks9RqVlFH+tPKpxXRfDNuTdvcs0z/Ulg6Fnsztfq8 Gpd/X7mJwmRZ5jdLAuXH0EtYJ8OT7EVU1Iax5b1ceZA+yUBlY6nTpjICvd8Mi/wjEfae AcymFn8mPYITDGAiA2yHaTDxqB0MleygPDoRA1f3SknLWNfCmySih2rei6N1iy4ubgc3 SS7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=K0UQKqHi; spf=pass (google.com: domain of linux-kernel+bounces-2264-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2264-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 cm22-20020a056a020a1600b005c66d702780si15487408pgb.69.2023.12.16.08.32.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:32:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2264-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=K0UQKqHi; spf=pass (google.com: domain of linux-kernel+bounces-2264-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2264-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 6CF61285D9C for ; Sat, 16 Dec 2023 16:32:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8944C3D0AB; Sat, 16 Dec 2023 16:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K0UQKqHi" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 635DC36AFF; Sat, 16 Dec 2023 16:27:19 +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-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-54c7744a93fso2051844a12.2; Sat, 16 Dec 2023 08:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744038; x=1703348838; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XVVbI3UTdjEdNjMJt0TLf0s4Teux8aF6Z8rzwOg5CSc=; b=K0UQKqHiw9tDZDZT/KfV2Ussx8ubQuVhxW5BWsEgjx/C7ww9K6XZlFPbAcdUYoyc/B B3vnOwYoIhVSD+G88UNtMxuGwxoBk2Bb9LB+u12l0xsoB6fuLxzR5E8FEx45GTNHBEmP v6Ej0SruINPF5rMf29jkhMa+jQiHjlOkfhmpGV5QMbYmUOjYaDvgNq8tlly2cK6sTu/D tswcZ4pOjMJpfILGJWeO0L/5Cs7Q0o9uD8GU6JfIhxtW7uz4N0yxjsLnepsyZEvWNM3G eJNU2DzB1W5KXNbB4DH+5XLPeLs04Z5X983Yq62HP2GsPYjQuVPDpnoRMteufl6ImlBf gYMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744038; x=1703348838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XVVbI3UTdjEdNjMJt0TLf0s4Teux8aF6Z8rzwOg5CSc=; b=C9jMjErM25zwNX9J7jVXeT4V/CTfzXyI4XZziEJZCT73DOiOwr10n3blLnfU2NrTyv hFIT8Fwx9YpXGoTsORkhy9geNJsf/XSPCHspW1esnwUMarf+DysZLIbkFBe/gcKex3LR InxUCmlx5Ft8RF6IpY58kUnlB7narvklH48S81Ww72Zztb3SXs2yq24IsVcuFQh60FxE qxCTIsKYNw9fG38Vgjfbg7O3MNTIu39cX1uUQpTfw43PpvJel/V7IepFQoGrSmbffxZN jvixV7o2BKTc7QWdFFYmaIOCQyOQXRrvIZfWqEhihxuM6fbuftOtjhSzhG9BhTHvFzI/ W0Tg== X-Gm-Message-State: AOJu0Yzi5ON/kzJu3GWCLL62WX4/w80Q8km830TUxQ9iJ4l2Jwu1J4mr lr0XVQSgo9SzJzl6NweyEogEg4DG4A== X-Received: by 2002:a17:906:287:b0:a23:2ccc:8eb1 with SMTP id 7-20020a170906028700b00a232ccc8eb1mr368904ejf.134.1702744037655; Sat, 16 Dec 2023 08:27:17 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:17 -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 16/27] drm/rockchip: inno_hdmi: Drop irq struct member Date: Sat, 16 Dec 2023 17:26:27 +0100 Message-ID: <20231216162639.125215-17-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456880892297282 X-GMAIL-MSGID: 1785456880892297282 The struct member irq isn't used anywhere. Drop it. Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index e37023d8fa39..d9eb8cdc0148 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -45,7 +45,6 @@ struct inno_hdmi_i2c { struct inno_hdmi { struct device *dev; - int irq; struct clk *pclk; void __iomem *regs; From patchwork Sat Dec 16 16:26:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179889 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp317194dyi; Sat, 16 Dec 2023 08:37:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCBeXwrlQ69q8ex5T4jccqJDkpyG92fjKOn861nkFr1J+YbulOVyPNpaIeeqCypNL5Udhy X-Received: by 2002:a05:6871:2b06:b0:1fa:e5ad:201a with SMTP id dr6-20020a0568712b0600b001fae5ad201amr16957453oac.18.1702744639851; Sat, 16 Dec 2023 08:37:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744639; cv=none; d=google.com; s=arc-20160816; b=yWqFmtnWVsNJHE+AzTMU/CrnkrhbkEITE5nDDL2Jro76s5UjPYg2HABByQAxBhA93e e2wUFrzGaclVv9MELHdSFRTixpLnSLvyH2dQ1d+I/5Of//pLiJo45szeSzhEnK8XAl/w V5b0geov/VXGbYuoz+NeTVVLbB/JB196u3as/Tzgo55jf4IvzM39wqnp2tr/pUs1+E+1 qjMuoyKKtVNxogKhL2qfRXfLxU1w6EePoB9B985iNWvfgs4izuGj7J8g61DuNtqmR6cv EdaWlkCLhWeDqnnUHNDF1SC9NW3iMImhLth+FHqd/VCQAkR/Oh5oAQAxmrv/++MJan9r BMjA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uYVqczyH7NXnPG1SGiVfMuDstNC9AVi+qa/g94ih5J4=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=po+8aexg9v+cRoNWyYLoQ4WV8Ow9hBQWjIS6C+FrGFEsQR3GvMf/LKbFGfW3N7P5Us OK2WAkbSh6+R8D1xAKD3dq38DJV9zHCauBl/dcnRlc73X3KXJgYL7jNyyU2ym5udsjWw at4N6UeTFiOGxCeAD8cY8bAPburSLmvctn40uT3ql6rbtvHfzXlF/LT7cSceDkDUfheb 51OJLyZHKrpWQ8yT4OkYvuNaE0EcBHfLWbRU2To4v1kDhofQcAtIzAlYbGjRP9ejS6cA FfG/z+bqE92/u79ZEwC57nPkITumEwKBxlH9wdaJxkICUWf5a52b9HN3w2ONYZIikRr9 0sAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ORln11Q0; spf=pass (google.com: domain of linux-kernel+bounces-2265-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2265-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f20-20020a631014000000b005bdfd3a269fsi15025616pgl.581.2023.12.16.08.37.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:37:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2265-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ORln11Q0; spf=pass (google.com: domain of linux-kernel+bounces-2265-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2265-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9006BB2405C for ; Sat, 16 Dec 2023 16:33:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4E293D0BF; Sat, 16 Dec 2023 16:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ORln11Q0" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 E0AB13066C; Sat, 16 Dec 2023 16:27:19 +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-f42.google.com with SMTP id a640c23a62f3a-a1ca24776c3so523898566b.0; Sat, 16 Dec 2023 08:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744038; x=1703348838; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uYVqczyH7NXnPG1SGiVfMuDstNC9AVi+qa/g94ih5J4=; b=ORln11Q06AfwRwzKAvM8o7KJiraB3oCCa5aGGo5jVqP1cB4xe3f6thvQVeITtDUjq8 ZpzYllZEIGyr7dvdHbeDud22Zch7jNU/roOaxvB6b01rscPOgp/jbDZLLgzC5IPo8yzT +DeYXfr4X+SyZyDBp4stQObeZGq/AgEMoWUOzRqR842CbBQnJBpqKl55AIIu6znojW2F l1MjzX6rWvoyrJ6gTd2V59/xMqm0wQBq4Vk0ryfIWwHsR5oqK32qeqeDVF6/e1eWR+SD LPF8kV/hAtVKikxKqTa0zN0cXVNrD3b3ZyOkqG6p2aI9YRemeP91euqudwiyjKP+othv tNYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744038; x=1703348838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uYVqczyH7NXnPG1SGiVfMuDstNC9AVi+qa/g94ih5J4=; b=F4JBGOd6YQlZmK5tMoe72XZHUr0MVycZDqd7FhPaHwBOaCCQ9nE3U3saad1ZEqr54d /jxW3+ZQJE6tv9MuVlbdcKkS1wcFeTNK5ds+wVLnl5nKmPIbO0sAPG7Ggp1tVR7v3Hc5 v0rLgxKOuDkB/oAnyLYL+XCUhouAMNiJhvUtfBz4P6M10Sp1DAeo54g7ZqR9kvg3LgfN +UD14Xg2MBY/v9rEmWXoJMkof0nRBwSKvTf0wWGZWo8k9auOnbCEBv7EURBNHtQy9JEf lZvBMCxRHW3xH0cg2sPOvyH7TrwCpOubI2Zwbr9+Ukp/teMe+bEog0Yflk1OoD4nqjtV j3hw== X-Gm-Message-State: AOJu0YzqEQqOiijq5wgagfLQpYS09CrLPVYDgIbrw9fHrJQ3XzK+hCHZ 3ioGhI8yP19O3V5DOiWUyhr59MSLfA== X-Received: by 2002:a17:907:12d6:b0:a23:3828:573c with SMTP id vp22-20020a17090712d600b00a233828573cmr157926ejb.3.1702744038296; Sat, 16 Dec 2023 08:27:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:18 -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 17/27] drm/rockchip: inno_hdmi: Remove useless include Date: Sat, 16 Dec 2023 17:26:28 +0100 Message-ID: <20231216162639.125215-18-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457163295909778 X-GMAIL-MSGID: 1785457163295909778 The inclusion syscon.h isn't used anywhere. Remove it. Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index d9eb8cdc0148..62c7e2275246 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include From patchwork Sat Dec 16 16:26:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179890 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp317448dyi; Sat, 16 Dec 2023 08:37:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGS5RoG/CCip1ZijPGoDZw9NfPJBTQg2XXAfgfCfH+oHHppJPTDwRT8Ea1CXBKSQJ+dA1U7 X-Received: by 2002:a05:6870:c192:b0:1fb:75b:12f2 with SMTP id h18-20020a056870c19200b001fb075b12f2mr17197821oad.68.1702744675649; Sat, 16 Dec 2023 08:37:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744675; cv=none; d=google.com; s=arc-20160816; b=jOcx/KMLCbdrNgZrQyPu2LRwkFaIppLK+4Kn1jp0+/Hk2PBuW1YSMAOSnAhy6s+ii5 4YZVYOLCutjXduSvQ6Hq5Tc/MoxjC4KGKeMSYkhkoeHwZ8FP5urfkPcoNmUNocPjl/5B kTEJvQv+JqqygHvJaAFjTkQa9hmorH2k9lTCUvXyJlgt40Nh5PbhSa2vXFVIeNWNuDiZ rNFTJER3N3NEHavLbgkY3h0QEkN9XoRmOUeF4RatNrPirZ/pmxHd18ZKxeMYc0e5u0Fk +YTCqPs/mwX85atQoMV8q/Bplpsm7c8IO7Jb7TIxPlIlCUfrTaPno41/x4Nb2tULGva8 jyPA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=R/eFbXWfaMM0I74IrKyTPfTKiYx+jg35hR0AyiA/w9A=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=uehEGKxQF3D4zqULUWOZopgEQtihpms73ZDOj4CoqGTik2JdOyTB++YRYOIFm8CVQv sjw2AAEz9kVw6VRfGjKAJaBGDh/2Ugdhxc4OzEjGUz5To4sRkcWdXwi6LqMAcYH05ziQ 8iw4B/uSF8haz4HPAjKjn6ZIFEbf9+EcAl38wcJoVzoSh7w2AD005PxKw+A2mdXnaqWD QqaMhzsN3GifcsCBR6SkEt9YqoU3taAJ/XtywzrotJMxZwT8F9WJCRAoYLc+3iemxRgz TP8SFdU4ZapP5fyxESFKM/J3DbHbHo2tA+Mo8JCCNs3+AY8JEqeraRssvgdKViyUTtsN W8lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LlnoPjCR; spf=pass (google.com: domain of linux-kernel+bounces-2266-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2266-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id o2-20020a634e42000000b005c5e2c15169si14934563pgl.737.2023.12.16.08.37.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:37:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2266-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LlnoPjCR; spf=pass (google.com: domain of linux-kernel+bounces-2266-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2266-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 45F61B243E4 for ; Sat, 16 Dec 2023 16:33:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E862F30CE3; Sat, 16 Dec 2023 16:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LlnoPjCR" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 A457F37D1F; Sat, 16 Dec 2023 16:27:20 +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-f49.google.com with SMTP id a640c23a62f3a-a1ef2f5ed01so216693566b.0; Sat, 16 Dec 2023 08:27:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744039; x=1703348839; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R/eFbXWfaMM0I74IrKyTPfTKiYx+jg35hR0AyiA/w9A=; b=LlnoPjCRW5tMBVZSdBvvWV1668s2ZS1ltUQD0IaWBMQPxogH5zfNeqY7WdMscuOfe6 q9YM7hbPfzEVHp9qTVbjMWZ3OSPqqcemLW28X1uMAo75PRds71eVUHJJWN2olIv7D+zg F6/cvUBEWV6uc5/TS+u1iZ+bVAdCIB05fAYaO5nbENSbCBLfMzqcult+8Xn26om7B62d CttXnzZw4YG0dJIdT+RSv9z2uATw/ex+KaeeP6L030pI71V3gVhX/VJ9rKg9pRYRPV8Y a9P0yELvgjhrA0G+iaXbAUFDvG30bmtzvihVto8d3bE+qnGS4eSh5OAp6INtL5ObsWPJ xgow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744039; x=1703348839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R/eFbXWfaMM0I74IrKyTPfTKiYx+jg35hR0AyiA/w9A=; b=nDN4Q2qBXeQ3lETtZ6B8rGgn45n9ZLo7kTCL4yjkgzKe6jjiOBnvHGqr5mq3SSkmVv FY7rnumohx1nQ+0pv2GELl+BcZXOMu6jGYVc7fQcCKO+8l7d5s2JsBvH/YLrRRT+ZOK2 VYx8ANSu1/OriDEdCaL4vZOcQ0EYoQgd/SFafJmita9VeXNqFyPZzflWqUJLtzbCx7gR LvcMpM8UgcnmmAYm226d5XjvPi6AAAuMK/JWoqJ31A45YnqsYwduVQvno1FJJsdmtDY/ mqE+5SlVlLDUJhwpb+BJsor/7DileVJR3Vr1tNs9AvQFqQ1I9O0Ewf4NfCTSgDoOO8ih K0XA== X-Gm-Message-State: AOJu0YwTcRH16yX6YDujPFXg1f8pAR2Jy5BTs1okKoZUKjn2MqakW26K gQa1sT0AzlzY4D0cGWxlNw== X-Received: by 2002:a17:907:cbc8:b0:a19:a1ba:bae1 with SMTP id vk8-20020a170907cbc800b00a19a1babae1mr4432738ejc.135.1702744039030; Sat, 16 Dec 2023 08:27:19 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:18 -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 18/27] drm/rockchip: inno_hdmi: Subclass connector state Date: Sat, 16 Dec 2023 17:26:29 +0100 Message-ID: <20231216162639.125215-19-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457200793607582 X-GMAIL-MSGID: 1785457200793607582 The data which is currently hold in hdmi_data should not be part of device itself but of the connector state. Introduce a connector state subclass and move the data from hdmi_data in there. Suggested-by: Maxime Ripard Signed-off-by: Alex Bee --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 67 +++++++++++++++++++++------- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 62c7e2275246..f9bfae1e97a2 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -26,11 +26,6 @@ #include "inno_hdmi.h" -struct hdmi_data_info { - unsigned int enc_out_format; - unsigned int colorimetry; -}; - struct inno_hdmi_i2c { struct i2c_adapter adap; @@ -54,8 +49,12 @@ struct inno_hdmi { struct i2c_adapter *ddc; unsigned int tmds_rate; +}; - struct hdmi_data_info hdmi_data; +struct inno_hdmi_connector_state { + struct drm_connector_state base; + unsigned int enc_out_format; + unsigned int colorimetry; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -70,6 +69,9 @@ static struct inno_hdmi *connector_to_inno_hdmi(struct drm_connector *connector) return container_of(connector, struct inno_hdmi, connector); } +#define to_inno_hdmi_conn_state(_state) \ + container_of_const(_state, struct inno_hdmi_connector_state, base) + enum { CSC_RGB_0_255_TO_ITU601_16_235_8BIT, CSC_RGB_0_255_TO_ITU709_16_235_8BIT, @@ -248,6 +250,10 @@ static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); union hdmi_infoframe frame; int rc; @@ -259,9 +265,9 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, return rc; } - if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) frame.avi.colorspace = HDMI_COLORSPACE_YUV444; - else if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV422) + else if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV422) frame.avi.colorspace = HDMI_COLORSPACE_YUV422; else frame.avi.colorspace = HDMI_COLORSPACE_RGB; @@ -271,7 +277,10 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) { - struct hdmi_data_info *data = &hdmi->hdmi_data; + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); int c0_c2_change = 0; int csc_enable = 0; int csc_mode = 0; @@ -289,7 +298,7 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) v_VIDEO_INPUT_CSP(0); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); - if (data->enc_out_format == HDMI_COLORSPACE_RGB) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_RGB) { value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); @@ -300,15 +309,15 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) return 0; } - if (data->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { + if (inno_conn_state->colorimetry == HDMI_COLORIMETRY_ITU_601) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; } } else { - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; @@ -386,16 +395,20 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, { struct drm_display_info *display = &hdmi->connector.display_info; u8 vic = drm_match_cea_mode(mode); + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); - hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; + inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; if (vic == 6 || vic == 7 || vic == 21 || vic == 22 || vic == 2 || vic == 3 || vic == 17 || vic == 18) - hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_601; else - hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; /* Mute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, @@ -522,12 +535,32 @@ static void inno_hdmi_connector_destroy(struct drm_connector *connector) drm_connector_cleanup(connector); } +static struct drm_connector_state * +inno_hdmi_connector_duplicate_state(struct drm_connector *connector) +{ + struct inno_hdmi_connector_state *inno_conn_state; + + if (WARN_ON(!connector->state)) + return NULL; + + inno_conn_state = kmemdup(to_inno_hdmi_conn_state(connector->state), + sizeof(*inno_conn_state), GFP_KERNEL); + + if (!inno_conn_state) + return NULL; + + __drm_atomic_helper_connector_duplicate_state(connector, + &inno_conn_state->base); + + return &inno_conn_state->base; +} + static const struct drm_connector_funcs inno_hdmi_connector_funcs = { .fill_modes = inno_hdmi_probe_single_connector_modes, .detect = inno_hdmi_connector_detect, .destroy = inno_hdmi_connector_destroy, .reset = drm_atomic_helper_connector_reset, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_duplicate_state = inno_hdmi_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; From patchwork Sat Dec 16 16:26: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: 179881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp315643dyi; Sat, 16 Dec 2023 08:33:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHX+QWNZnl66VwkQlzdd8GNXUDZ0JTPvxGVlLOMWjSjgUZTVebO1PbBVRKHKCAYgPXH8Y6L X-Received: by 2002:a05:6102:956:b0:462:9eb3:9bdd with SMTP id a22-20020a056102095600b004629eb39bddmr10132907vsi.28.1702744422302; Sat, 16 Dec 2023 08:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744422; cv=none; d=google.com; s=arc-20160816; b=Ms4VT+JlzCvb+/q63OgbnZt606LaeUUOwe6mJeBNSotxYJDyrG/QPkWQ1z5eoRdUSC qW4MiozyUh95RQ53QuvU4T1T3nNyH1y8PT2NRNa6S0i7YUWLenHawfBb8TjlL7V6a0u7 hiWdcMe3LNC0G4QQPjXquE4rP5PyZswiu5wacla5ZDU9v2ORviPIU/o0cS1gs/RNLqWm uVlV5/2lFPHFdKcJ2qVP9KUu1+mrTnQV/JdZSa8KVm6SGG00wGXqmmqapXFw0f/j3uVI M7V42yTgS3k7cAQjdvaOMc9tb6TmbscG37VwoBDJA8UXM+F2A5QuWCwy5y5XwwgkpmMO UzRQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xquaKm3YPbbfHci/n27FNskS85Fe2FEHpYLHWs9wnrA=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=wVAowbTRIQ5OAQJ1765AkyTXiWnDjuJOqE3KdW411oHT5yxKQcMlKqRsGtmitSnIwy pvmhOgizXdRKPqIL8hZGKlDsENcWnYwWFx/464oUr1tSCDj7M+D3f/9wuLm1m8tIvohk ix/Gl3U6HHagPMiBPYXqQUDOK0dz7G1b3s8c2wW8Y8JJdRUyfSBVfFUg4P6QFV8Lv5SF uxmf1lywXzRKsZ7xg1B+0qt6VU2IhfBjxHYfjVX39gpmoZt2ydMxfQc9+I6I64VcD5MV Lgc1MJX6Fn0SzDqQmPVvFqa9Akj9h3pLZR227/ewe4ROC0RxRnd7bC4jhw6NgFSJRp/r dTKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="eunQT72/"; spf=pass (google.com: domain of linux-kernel+bounces-2267-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2267-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 m13-20020a0561023e8d00b004661fd499a7si3432673vsv.96.2023.12.16.08.33.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:33:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2267-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="eunQT72/"; spf=pass (google.com: domain of linux-kernel+bounces-2267-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2267-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 1791D1C21957 for ; Sat, 16 Dec 2023 16:33:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84F363FB12; Sat, 16 Dec 2023 16:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eunQT72/" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 51058381B2; Sat, 16 Dec 2023 16:27:21 +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-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-548ce39b101so1996812a12.2; Sat, 16 Dec 2023 08:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744039; x=1703348839; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xquaKm3YPbbfHci/n27FNskS85Fe2FEHpYLHWs9wnrA=; b=eunQT72/2oqPu2ddLmo+onfpQsJkJ+S4avC2v9wcjvAYsyllXxZfBaF4qgeojNea+V LQQs34MxoKsRJ2VsEtYuCdDRihDf2Nj0M6AQKlq+XWpspGVStDUI5kzCzzaam5DO5p+/ yttIxUjBd7s1HJ1LbxR8kJPzUuTABJ5O+zadxD7dIsE+R/oNYpFoxjKI+OqnEb/t9BGw hSNFYwDeKTO2wx2O/34DkdKdN4Cdz6eAcsHTjdq9J7Y2nUUHNBijJhx7LQUwpHsYvHQD 0G9u9KHA/LErvBLtehFl0nVdHv6eLDSrAzZueI1Q+jVTFfPgeiYBn7UTQvstuH5D4gjt hMNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744039; x=1703348839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xquaKm3YPbbfHci/n27FNskS85Fe2FEHpYLHWs9wnrA=; b=JMqEa71EEABFS1YanCvigLl6W3SFDM64FHkISUmV6bFsUUj8AEGi9cHTWEDsYWgH0i jJpAk02+AS5Qjqms1JPQF6JSBJ9yo1Tf7Q8vj0TmZ+rFlEOpU1Zk7LhZRS10M1WvQn8f Rp52sLWms78+iCmIUQueeuxc10TZz7grcphtVz03vQ69XtyrHBMqT6zBWO79dVAy72jL zPdp+NR0lB9d+UC1zOROYVxyoUK5Yo+0L5itRFycH82wEhF0bo3NGG/p+vD2VMXPIMyT lFU1IxKfNNYcFRq1AgKGon0+EM3i8zL7L19DAX/ohDf3fEi2whkrtxVIK/JJCye7RY1I sOrw== X-Gm-Message-State: AOJu0YwWqiwIgZfbPnmH4yh2kKw8AofO7gzn3DbXV7Pm13T088aknXR3 A2fc9A+w1M9augoE4u8KVw== X-Received: by 2002:a17:906:2c7:b0:a23:2aa7:d48b with SMTP id 7-20020a17090602c700b00a232aa7d48bmr212918ejk.14.1702744039643; Sat, 16 Dec 2023 08:27:19 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:19 -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 19/27] drm/rockchip: inno_hdmi: Move tmds rate to connector state subclass Date: Sat, 16 Dec 2023 17:26:30 +0100 Message-ID: <20231216162639.125215-20-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456935070051640 X-GMAIL-MSGID: 1785456935070051640 Similar to the othter members of inno_hdmi_connector_state the tmds_rate is not a property of the device, but of the connector state. Move it to inno_hdmi_connector_state and make it a long to comply with the clock framework. To get arround the issue of not having the connector state when inno_hdmi_i2c_init is called in the bind path, getting the tmds rate is wrapped in function which returns the fallback rate if the connector doesn't have a state yet. Signed-off-by: Alex Bee --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 36 +++++++++++++++++++--------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index f9bfae1e97a2..6799d24501b8 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -47,14 +47,13 @@ struct inno_hdmi { struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; - - unsigned int tmds_rate; }; struct inno_hdmi_connector_state { struct drm_connector_state base; unsigned int enc_out_format; unsigned int colorimetry; + unsigned long tmds_rate; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -133,11 +132,33 @@ static inline void hdmi_modb(struct inno_hdmi *hdmi, u16 offset, hdmi_writeb(hdmi, offset, temp); } +static unsigned long inno_hdmi_tmds_rate(struct inno_hdmi *hdmi) +{ + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state; + + if (conn_state) { + inno_conn_state = to_inno_hdmi_conn_state(conn_state); + return inno_conn_state->tmds_rate; + } + + /* + * When IP controller haven't configured to an accurate video + * timing, then the TMDS clock source would be switched to + * PCLK_HDMI, so we need to init the TMDS rate to PCLK rate, + * and reconfigure the DDC clock. + */ + + return clk_get_rate(hdmi->pclk); +} + static void inno_hdmi_i2c_init(struct inno_hdmi *hdmi) { int ddc_bus_freq; + unsigned long tmds_rate = inno_hdmi_tmds_rate(hdmi); - ddc_bus_freq = (hdmi->tmds_rate >> 2) / HDMI_SCL_RATE; + ddc_bus_freq = (tmds_rate >> 2) / HDMI_SCL_RATE; hdmi_writeb(hdmi, DDC_BUS_FREQ_L, ddc_bus_freq & 0xFF); hdmi_writeb(hdmi, DDC_BUS_FREQ_H, (ddc_bus_freq >> 8) & 0xFF); @@ -431,7 +452,7 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, * DCLK_LCDC, so we need to init the TMDS rate to mode pixel * clock rate, and reconfigure the DDC clock. */ - hdmi->tmds_rate = mode->clock * 1000; + inno_conn_state->tmds_rate = mode->clock * 1000; inno_hdmi_i2c_init(hdmi); /* Unmute video and audio output */ @@ -823,13 +844,6 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, goto err_disable_clk; } - /* - * When IP controller haven't configured to an accurate video - * timing, then the TMDS clock source would be switched to - * PCLK_HDMI, so we need to init the TMDS rate to PCLK rate, - * and reconfigure the DDC clock. - */ - hdmi->tmds_rate = clk_get_rate(hdmi->pclk); inno_hdmi_i2c_init(hdmi); ret = inno_hdmi_register(drm, hdmi); From patchwork Sat Dec 16 16:26:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179891 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp317705dyi; Sat, 16 Dec 2023 08:38:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IE9CEiBiesTexYucl0wYStuCe/ap4nh1Myjge9O9kQYIUgizVtPMSQ4/5mK+WREiZK9veC9 X-Received: by 2002:a17:902:ec84:b0:1cf:ffd7:7425 with SMTP id x4-20020a170902ec8400b001cfffd77425mr16375848plg.41.1702744718998; Sat, 16 Dec 2023 08:38:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744718; cv=none; d=google.com; s=arc-20160816; b=kbX6rcyRajG8sZm0UstMo2ew/lORmlu1RUPdnO5hKBOwNkBeSes6hMP/akamBnvSPn TpCCnxL5oT8yG9TrWGt8mP1vMc8jSyCeYjl2vSKChTP0LQGOhhXBrtkvfLaCqrZ7F/7+ 3E+D+ZP/QeflOxKvIL2qCxEnA8JMrqYYFxsYm2EfT26tHcauUiqw15ScR10QH3B0NGKG XBYiZWBHoiSK5yF284Gl4WKUvNDWmZhlbUUOb/urjrChxIhLUzgAw3rcKPQRoNOFE61j vxGpQzi7b7FJZE4IhlgGeZdSQldQwBXhcN6YLa0wkNBcuLnigrfjECmZyeynRs+yF7GS jt3Q== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eeP9TO9V+vEKe4+An2VukwFpdenqcBYIdbA3kdqXnt8=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=EIeFcFydeU7+Zbz3pL7IzW9jqKkBhXFlQJGtVcW63IKleOxf2YvQW3s+ypaK17gzrl Mou0xRFzvixXNTXvrEPM/TLeDEmG4V1LAZyS2G9qbs2JhYtVWLx0/M6IlTZkYWlqWAN8 6ZLrl5oUaZzD0+rKYGEGuEa9Mq6Kaqn5bDXUnu+MuhHdmo5jyWAsggUv4zgFfhVQoomz gLCUGZaaElUTTkgF5hGFmztUqoTWC8D53ytH/7U3L3tIAQoi7R+XBM8aRHqWp4Aquu7V CISQlMBeyeJcjiVoAH+UqUsO8mYd9Q4lnzSm0ejxcjJ0awSmrSSH+ceWoRzZHozehXVe nCLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ayixFSuC; spf=pass (google.com: domain of linux-kernel+bounces-2268-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2268-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u23-20020a17090ae01700b00288795e256fsi14766026pjy.120.2023.12.16.08.38.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:38:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2268-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ayixFSuC; spf=pass (google.com: domain of linux-kernel+bounces-2268-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2268-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AA927B237A6 for ; Sat, 16 Dec 2023 16:33:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FD2C405CA; Sat, 16 Dec 2023 16:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ayixFSuC" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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 DE56739ADF; Sat, 16 Dec 2023 16:27:21 +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-f48.google.com with SMTP id a640c23a62f3a-a22f59c6ae6so214841866b.1; Sat, 16 Dec 2023 08:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744040; x=1703348840; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eeP9TO9V+vEKe4+An2VukwFpdenqcBYIdbA3kdqXnt8=; b=ayixFSuC79q4Aon/eqqsjXLpWOzUbexVLV0QQk50ieBw8gmS+IUrfi5He+vzqlnD8t OCyp2Pt7aR06oGf//vj1pTCmBRJDBqPK9sCaJ1HuG1Q7pLgij1Br9XddV/ju5FILp70q Yrr/Bwi2fS6YWS0iwrRbQqxc9TytkWdoLvWTHM8do4SFDlwBVI0hmD1BWDgenKmG5h12 mLT+/kIanu6zQg9cVM+n96b/1CtoUBYll38vlx7uOG0X2uENXUqfL3gB1TQhrmTQnFe8 Nq+nfs/EEBerervkXU1W5W7PDHHknIPj2BxJbbcJ9iuHfB9Rt1KmZYTtnb8jlUsGLgKb 0TPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744040; x=1703348840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eeP9TO9V+vEKe4+An2VukwFpdenqcBYIdbA3kdqXnt8=; b=inBgFGBTHt2hpdnyhrUzRKaUpc4ulsx62uaf7Pc4ZxiRrAWB8qVgqsceaS6JYC97I3 RA5pMBhFKPuvUYxNu+RHQvobCVCXoSVVcEhPo8JKboS1UNbEPEwTj6fOsLhULxJSRwpD uqrcLKZLz4OSeaffjTqqAZlU490UVxaMoFSVuD6zS+ZrZ6psiEo5nqztxmhvbwqxiVhZ sbktkMbt4ZXe07Ln2+pjZP2CWI2pu7m8M9/zaernfpaO5fktC1lkp9gS8+cBYGGXMXId zR4ZNjiKNSH17LlQBalH/BzjmVWzI1en8F4zvV3D65xSdF/Q/dRlghcV2tuFTqgQLyUP DlEQ== X-Gm-Message-State: AOJu0Ywtc/7kiByhSHfOqOSJTgygC0uoZECA3ej5acQGM0/g92fT6guv Q4IDIvEctm7aorMTT4XOXw== X-Received: by 2002:a17:906:24e:b0:a1d:b7b9:3274 with SMTP id 14-20020a170906024e00b00a1db7b93274mr3725525ejl.169.1702744040255; Sat, 16 Dec 2023 08:27:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:20 -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 20/27] drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range Date: Sat, 16 Dec 2023 17:26:31 +0100 Message-ID: <20231216162639.125215-21-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457246785346393 X-GMAIL-MSGID: 1785457246785346393 The display controller will always give full range RGB regardless of the mode set, but HDMI requires certain modes to be transmitted in limited range RGB. This is especially required for HDMI sinks which do not support non-standard quantization ranges. This enables color space conversion for those modes and sets the quantization range accordingly in the AVI infoframe. Signed-off-by: Alex Bee --- changes in v2: - made rgb_limited_range part of the new custom connector state drivers/gpu/drm/rockchip/inno_hdmi.c | 60 +++++++++++++++++++--------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6799d24501b8..9f27a5faf12d 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -54,6 +54,7 @@ struct inno_hdmi_connector_state { unsigned int enc_out_format; unsigned int colorimetry; unsigned long tmds_rate; + bool rgb_limited_range; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -293,6 +294,18 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_RGB) { + drm_hdmi_avi_infoframe_quant_range(&frame.avi, + connector, mode, + inno_conn_state->rgb_limited_range ? + HDMI_QUANTIZATION_RANGE_LIMITED : + HDMI_QUANTIZATION_RANGE_FULL); + } else { + frame.avi.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT; + frame.avi.ycc_quantization_range = + HDMI_YCC_QUANTIZATION_RANGE_LIMITED; + } + return inno_hdmi_upload_frame(hdmi, &frame, HDMI_INFOFRAME_TYPE_AVI); } @@ -320,29 +333,37 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_RGB) { - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); - - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, - m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, - v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | - v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); - return 0; - } - - if (inno_conn_state->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { - csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; + if (inno_conn_state->rgb_limited_range) { + csc_mode = CSC_RGB_0_255_TO_RGB_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; + + } else { + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); + hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); + + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, + m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, + v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | + v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); + return 0; } } else { - if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { - csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; - auto_csc = AUTO_CSC_DISABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_ENABLE; + if (inno_conn_state->colorimetry == HDMI_COLORIMETRY_ITU_601) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { + csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; + auto_csc = AUTO_CSC_DISABLE; + c0_c2_change = C0_C2_CHANGE_DISABLE; + csc_enable = v_CSC_ENABLE; + } + } else { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { + csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; + auto_csc = AUTO_CSC_DISABLE; + c0_c2_change = C0_C2_CHANGE_DISABLE; + csc_enable = v_CSC_ENABLE; + } } } @@ -431,6 +452,9 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, else inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; + inno_conn_state->rgb_limited_range = + drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED; + /* Mute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, v_AUDIO_MUTE(1) | v_VIDEO_MUTE(1)); From patchwork Sat Dec 16 16:26:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179884 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp316004dyi; Sat, 16 Dec 2023 08:34:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IF798P66m5r7wtuwfSrgztIR913DK/KsDJQ6XpbEd0RkETACxP5+I0QRS/mMZm8ugDZkyad X-Received: by 2002:a17:902:6f08:b0:1d3:45c8:bc0f with SMTP id w8-20020a1709026f0800b001d345c8bc0fmr3631520plk.46.1702744464577; Sat, 16 Dec 2023 08:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744464; cv=none; d=google.com; s=arc-20160816; b=FJK+jR5pFfx7XNXsxoFryjdAlglcBI4nsl6RGzEty9kCWzSWBF8GnzlUD/8CUHeTd/ rCINSzAgfbcGiMwzAfyYUVlJC/tOoZiArJ5s3LEkQWsOebqaQ+sfm1z5QhL4s6LaHNDQ q43S6Pi78psX/rGaYSyY0H3e7aYBtUZaVgWVy7VhF97EGPhcM0HICWJdwinzg/Pwu2Qd 83SUTfxm/zNdD6nM87dSuQLhmRc4959yTsxsYwX1bG8Zj4bXdHefDoI4k6bzUEA+VdkU HCkt5gZc7lmMbG7WUB25DO9X1kbkyRkU82v2dCSKVLAtfZhTRrWPOl3UNlYiWdwjzI1m 3z2w== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PQiEPu38i3aFFXbXmZDuj9Z5I3dO6tjlHXJ/GQ5qAv8=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=Ke6AWZ66ggUDimhAbYZUDhhmt9IyrCt3VaD3f+KdSVtZZllbWoTLVdc89YmoBP0ZfG mPaT6fZiqJWqPku7iGgbRZT7XtUm7u/fcCEeNd7UIfQzUHKD9UOgLYkMfv1ukVGbWYTk JdZLH+GhKW2zrrrIySQQnsIgHWJh5Q96PgNtzuc3SoLfXImyaPr5hEoLMUo024JsS4BS NvVUJwhMM+R4Bj0NhLvb+CHLGULxZX8lwlhjC3pMYFKxfymtaKm2Knft+v1r6K0Adk2B iu89dGnOApy+9QK9lmB/mLpYWIiGDRV/yc9axF2IC2LKeKXhHJ3ZzLxiGcd68lp/85ig +ENQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Y/pwDwu1"; spf=pass (google.com: domain of linux-kernel+bounces-2269-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2269-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 y17-20020a17090322d100b001d0a8bb96a5si15463577plg.411.2023.12.16.08.34.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:34:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2269-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="Y/pwDwu1"; spf=pass (google.com: domain of linux-kernel+bounces-2269-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2269-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 4809C285FEC for ; Sat, 16 Dec 2023 16:34:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB74740BEF; Sat, 16 Dec 2023 16:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y/pwDwu1" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 AA7B23A8E4; Sat, 16 Dec 2023 16:27:22 +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-f48.google.com with SMTP id 5b1f17b1804b1-40c31f18274so20681285e9.0; Sat, 16 Dec 2023 08:27:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744041; x=1703348841; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PQiEPu38i3aFFXbXmZDuj9Z5I3dO6tjlHXJ/GQ5qAv8=; b=Y/pwDwu1SWujJS+mfrve8neCtZsuD4WmJyhhphEWSD/s3C6RcBe0nLFXBo7QrVAhQ5 kbi85GwxW6KDY0NDl5VfCGWnc8t/UNB9Edzqu1+J+gAOjQQ4YGO6Vnn5Zc9FiZdsV69z rU84Z51GYweEidt5wP7HJkciwmQHfAVu5DrVQBBtgbjpVQKWDz/p3LFcQ9LBmQolAivv sL396AGUqQoHQOja9VRtS1QCB18lzS+YU+NZQugrhPbIAWCKxGaSygAKJUF1SGJusOHx OFwPS5PX15ReAHNSbsapEAlkpJmbg90K9fXuiPgW5nUyKFVvxHpL2uZSt+p+s8qURyWz nBqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744041; x=1703348841; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PQiEPu38i3aFFXbXmZDuj9Z5I3dO6tjlHXJ/GQ5qAv8=; b=Y4M1gKLmw+P05c+iTlYgViibFuBIVGmiG23NfTsYGuTKurpqCuwA6xhkoYyFd4Pk8l 2l+aiI8+UyAKMJE+eEBlBLCrsBnloi1elXh5UtJl+WPxHrIi16wbTUZwiEW0k5IWJWam R1cm1SbJEwn6UJkxSpdkmdqtTx2SjU2YfxP2wyuFxM8EL1JHFWJzVkQcGKOUcPkPfik0 mK6eiKwc6DAWnWfrrz5aC3LVv2GmQ4QqrYAyKC/WI16Do0WpMXrjBhkckCH4U9X5pPMs Gseu9DK2/7YSOgOB55nCaTem4q2MUWeo1luLs1Gcj1k+yGKztawOJu8/HPJFr8iyD2Xw 5k+w== X-Gm-Message-State: AOJu0YzdT0TadIHxLdABXDpV5KWzLNKjU9PkV+8xX11k/m/Xh2xuMGmH QHmK7Y3miPZ9z9C3/lsRZg== X-Received: by 2002:a05:600c:524e:b0:40c:18e9:d610 with SMTP id fc14-20020a05600c524e00b0040c18e9d610mr6278994wmb.71.1702744040982; Sat, 16 Dec 2023 08:27:20 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:20 -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 21/27] drm/rockchip: inno_hdmi: Add variant support Date: Sat, 16 Dec 2023 17:26:32 +0100 Message-ID: <20231216162639.125215-22-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785456979630450383 X-GMAIL-MSGID: 1785456979630450383 In preparation to support RK3128's integration of the controller, this patch adds a simple variant implementation. They mainly differ in the phy configuration required, so those are part of the match_data. The values have been taken from downstream. The pixelclocks in there are meant to be max-inclusive. Signed-off-by: Alex Bee --- changes in v2: - no changes drivers/gpu/drm/rockchip/inno_hdmi.c | 69 +++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 9f27a5faf12d..579baba6a61b 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -26,6 +26,17 @@ #include "inno_hdmi.h" +struct inno_hdmi_phy_config { + unsigned long pixelclock; + u8 pre_emphasis; + u8 voltage_level_control; +}; + +struct inno_hdmi_variant { + struct inno_hdmi_phy_config *phy_configs; + struct inno_hdmi_phy_config *default_phy_config; +}; + struct inno_hdmi_i2c { struct i2c_adapter adap; @@ -47,6 +58,8 @@ struct inno_hdmi { struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; + + const struct inno_hdmi_variant *variant; }; struct inno_hdmi_connector_state { @@ -114,6 +127,30 @@ static const char coeff_csc[][24] = { }, }; +static struct inno_hdmi_phy_config rk3036_hdmi_phy_configs[] = { + { 74250000, 0x3f, 0xbb }, + { 165000000, 0x6f, 0xbb }, + { ~0UL, 0x00, 0x00 } +}; + +static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi, + unsigned long pixelclk) +{ + const struct inno_hdmi_phy_config *phy_configs = + hdmi->variant->phy_configs; + int i; + + for (i = 0; phy_configs[i].pixelclock != ~0UL; i++) { + if (pixelclk <= phy_configs[i].pixelclock) + return i; + } + + DRM_DEV_DEBUG(hdmi->dev, "No phy configuration for pixelclock %lu\n", + pixelclk); + + return -EINVAL; +} + static inline u8 hdmi_readb(struct inno_hdmi *hdmi, u16 offset) { return readl_relaxed(hdmi->regs + (offset) * 0x04); @@ -179,12 +216,26 @@ static void inno_hdmi_sys_power(struct inno_hdmi *hdmi, bool enable) static void inno_hdmi_set_pwr_mode(struct inno_hdmi *hdmi, int mode) { + struct inno_hdmi_phy_config *phy_config; + int ret; + unsigned long tmds_rate; + switch (mode) { case NORMAL: inno_hdmi_sys_power(hdmi, false); + tmds_rate = inno_hdmi_tmds_rate(hdmi); + ret = inno_hdmi_find_phy_config(hdmi, tmds_rate); + if (ret < 0) { + phy_config = hdmi->variant->default_phy_config; + DRM_DEV_ERROR(hdmi->dev, + "Using default phy configuration for TMDS rate %lu", + tmds_rate); + } else { + phy_config = &hdmi->variant->phy_configs[ret]; + } - hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x6f); - hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0xbb); + hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, phy_config->pre_emphasis); + hdmi_writeb(hdmi, HDMI_PHY_DRIVER, phy_config->voltage_level_control); hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x14); @@ -827,6 +878,8 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, struct platform_device *pdev = to_platform_device(dev); struct drm_device *drm = data; struct inno_hdmi *hdmi; + const struct inno_hdmi_variant *variant; + int irq; int ret; @@ -836,6 +889,12 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, hdmi->dev = dev; + variant = of_device_get_match_data(hdmi->dev); + if (!variant) + return -EINVAL; + + hdmi->variant = variant; + hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) return PTR_ERR(hdmi->regs); @@ -923,8 +982,14 @@ static void inno_hdmi_remove(struct platform_device *pdev) component_del(&pdev->dev, &inno_hdmi_ops); } +static const struct inno_hdmi_variant rk3036_inno_hdmi_variant = { + .phy_configs = rk3036_hdmi_phy_configs, + .default_phy_config = &rk3036_hdmi_phy_configs[1], +}; + static const struct of_device_id inno_hdmi_dt_ids[] = { { .compatible = "rockchip,rk3036-inno-hdmi", + .data = &rk3036_inno_hdmi_variant, }, {}, }; From patchwork Sat Dec 16 16:26:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179892 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp318277dyi; Sat, 16 Dec 2023 08:40:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGcsr71+d+Oudo8TYd4hSkQouQU0QsBmkFySO2gMqUZxX0TKUj0e2D9w97W4gMmJ4gPc85 X-Received: by 2002:a17:903:2282:b0:1d3:6c56:1d13 with SMTP id b2-20020a170903228200b001d36c561d13mr5554648plh.93.1702744802465; Sat, 16 Dec 2023 08:40:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744802; cv=none; d=google.com; s=arc-20160816; b=hTk7Ii0eHuCjCMmcAwlE97RtXgJZEiz6m+vEJ4dNREJeXBX7gAvh9aijcJkwFWuy0L KgceU98x2Y6atwFzSDJ2X8dQAaCsiErCtcGyANfW/E96lZnPZI+JN8q1VGsEG+atgbfm mhD1SgsVTaFaA3EAtukBCGAoZ6sSeoJ7EcnicrMEYyW0skXSIWxBQjxIBvp37TrkeklM ZpoD5UsESob6UR5cz282ZxpfxNf4pJtorWH+PKztGHgKlz2ZPaJnSvsG5A1ThYr9LJbG q/SmfCoON2YI6P12KcSy5mZ5aj2XIEDUM276/i2LhNkyRcbySFQF2CvyZh/dH34Z9yFM g+Og== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BFps/f+CAs2Nk6z2SsJd+Q0Norbs9x1sCDtq35o8jMc=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=zWCkFJmlZCtJ+U8GxP0ZO8Kl57uSoGgJ+ELpkEwkmEmykdrJhbvG7a12UVolwVA9Bi Wiu62LwFpBVFeUhlQj5M2vorKomLLZ+AS4T3RsnIjbcLFuN7ZaYgLRLnOz89K99R7Wkd txowJPIE6pqK0fF05gSYCKgznO8hCYKESjTNnArNl/irLdJkyA+tHiW3axfS3bCOLLX6 miwvNFAYmxuHRy0ukxdqotjIBlHfjjs1BhHfcvZ2tcRWi8mTvP8HOOIBNajBhkBWM1sy /Sf1QWCMRCCcwNO+dz2a2SL6PoyLWRCU11GXGcpPuJELqb/7vOspUWtlfYPQTAzUjYPn AXKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="YY/RmLFO"; spf=pass (google.com: domain of linux-kernel+bounces-2270-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2270-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a14-20020a170902ecce00b001d39b9540d6si1225967plh.400.2023.12.16.08.40.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:40:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2270-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="YY/RmLFO"; spf=pass (google.com: domain of linux-kernel+bounces-2270-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2270-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 59729B23D73 for ; Sat, 16 Dec 2023 16:34:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EB6C40C13; Sat, 16 Dec 2023 16:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YY/RmLFO" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 4EFD83C487; Sat, 16 Dec 2023 16:27:23 +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-f45.google.com with SMTP id 5b1f17b1804b1-40c6e2a47f6so13693595e9.0; Sat, 16 Dec 2023 08:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744041; x=1703348841; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BFps/f+CAs2Nk6z2SsJd+Q0Norbs9x1sCDtq35o8jMc=; b=YY/RmLFOGakkb7BP+E3CEnrzuRGnqDL1QzDYS6OAzpad1MPRYJ+YkP/feS9LnzHkMZ Zb4a+1n9CU6TphEDQM9tgpfZ5LC7umgIZ2KyywkDteqKSIfJFStIsOkQWxDbvSlPcLGK 3P+T/KCYBUSoDu+2pDI8astw1wa2oM5igk9Ma8JFUH8FyFGjbRn0w4JsUutcfTkG4wEt 3ZI0JwmJOGlAfGkrqoAM4AlZlEntAdVHS727w5peEXZ83YTMyHB+pW6vn01oj6EWnalP Zhz7bgsgi8PGmKKnbbplF0fabGf9fmGGN3StWf7gZWQB9E5FHjsbzNJGrKPuj6qA5Nc8 wErg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744041; x=1703348841; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BFps/f+CAs2Nk6z2SsJd+Q0Norbs9x1sCDtq35o8jMc=; b=RY2srUuwapDJKaRHEQ5wdMzTveF4GjRubJzjFVr8VV/x/r54Zs2CGhRNKMrsFRmf8H 7zPxoCyyFjmkzu3UydxSO3GvheLB8QnXCdA77mbta0t6NLlrWi6lnGJOcHjCDLYqjynY RmcvSnIaCxfQjgsNziMzA5Q0NRGJXo7Tfw6Q3ytFYij8yHA9jA8FOQToe9HDSTfec6Sw 2i+kpXa/43tu+ECYiq35vckn88Mm90kUkfJqpUXN9/poZRwMXl0WjD1Ms2bgc8F4je3Y CcyZkROiyczK6itKgaJKhh9kWXsXCD6gFOZMv7jsFqLGaqIKXVRiG8C8ovqLtjG21AJf 6Nzw== X-Gm-Message-State: AOJu0YwMwRKDsuhDq1hmRK1q7wQ6sDMHW87Pb7cL2CMeRyJ6SdMBuDDL fM+8imcc2O8fJIcP25o4xw== X-Received: by 2002:a05:600c:3d10:b0:40c:dda4:3582 with SMTP id bh16-20020a05600c3d1000b0040cdda43582mr264470wmb.314.1702744041618; Sat, 16 Dec 2023 08:27:21 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:21 -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 22/27] drm/rockchip: inno_hdmi: Add RK3128 support Date: Sat, 16 Dec 2023 17:26:33 +0100 Message-ID: <20231216162639.125215-23-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457334188334506 X-GMAIL-MSGID: 1785457334188334506 This variant requires the phy reference clock to be enabled before the DDC block can work and the (initial) DDC bus frequency is calculated based on the rate of this clock. Besides the only difference is phy configuration required to make the driver working for this variant as well. Signed-off-by: Alex Bee --- changes in v2: - no changes drivers/gpu/drm/rockchip/inno_hdmi.c | 46 +++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 579baba6a61b..792e5fad09bf 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -51,6 +51,7 @@ struct inno_hdmi { struct device *dev; struct clk *pclk; + struct clk *refclk; void __iomem *regs; struct drm_connector connector; @@ -133,6 +134,12 @@ static struct inno_hdmi_phy_config rk3036_hdmi_phy_configs[] = { { ~0UL, 0x00, 0x00 } }; +static struct inno_hdmi_phy_config rk3128_hdmi_phy_configs[] = { + { 74250000, 0x3f, 0xaa }, + { 165000000, 0x5f, 0xaa }, + { ~0UL, 0x00, 0x00 } +}; + static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi, unsigned long pixelclk) { @@ -182,13 +189,17 @@ static unsigned long inno_hdmi_tmds_rate(struct inno_hdmi *hdmi) } /* - * When IP controller haven't configured to an accurate video - * timing, then the TMDS clock source would be switched to - * PCLK_HDMI, so we need to init the TMDS rate to PCLK rate, - * and reconfigure the DDC clock. + * When IP controller isn't configured to an accurate + * video timing and there is no reference clock available, + * then the TMDS clock source would be switched to PCLK_HDMI, + * so we need to init the TMDS rate to PCLK rate, and + * reconfigure the DDC clock. */ - return clk_get_rate(hdmi->pclk); + if (hdmi->refclk) + return clk_get_rate(hdmi->refclk); + else + return clk_get_rate(hdmi->pclk); } static void inno_hdmi_i2c_init(struct inno_hdmi *hdmi) @@ -912,6 +923,20 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, return ret; } + hdmi->refclk = devm_clk_get_optional(hdmi->dev, "ref"); + if (IS_ERR(hdmi->refclk)) { + DRM_DEV_ERROR(hdmi->dev, "Unable to get HDMI reference clock\n"); + ret = PTR_ERR(hdmi->refclk); + goto err_disable_pclk; + } + + ret = clk_prepare_enable(hdmi->refclk); + if (ret) { + DRM_DEV_ERROR(hdmi->dev, + "Cannot enable HDMI reference clock: %d\n", ret); + goto err_disable_pclk; + } + irq = platform_get_irq(pdev, 0); if (irq < 0) { ret = irq; @@ -951,6 +976,8 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, err_put_adapter: i2c_put_adapter(hdmi->ddc); err_disable_clk: + clk_disable_unprepare(hdmi->refclk); +err_disable_pclk: clk_disable_unprepare(hdmi->pclk); return ret; } @@ -964,6 +991,7 @@ static void inno_hdmi_unbind(struct device *dev, struct device *master, hdmi->encoder.encoder.funcs->destroy(&hdmi->encoder.encoder); i2c_put_adapter(hdmi->ddc); + clk_disable_unprepare(hdmi->refclk); clk_disable_unprepare(hdmi->pclk); } @@ -987,10 +1015,18 @@ static const struct inno_hdmi_variant rk3036_inno_hdmi_variant = { .default_phy_config = &rk3036_hdmi_phy_configs[1], }; +static const struct inno_hdmi_variant rk3128_inno_hdmi_variant = { + .phy_configs = rk3128_hdmi_phy_configs, + .default_phy_config = &rk3128_hdmi_phy_configs[1], +}; + static const struct of_device_id inno_hdmi_dt_ids[] = { { .compatible = "rockchip,rk3036-inno-hdmi", .data = &rk3036_inno_hdmi_variant, }, + { .compatible = "rockchip,rk3128-inno-hdmi", + .data = &rk3128_inno_hdmi_variant, + }, {}, }; MODULE_DEVICE_TABLE(of, inno_hdmi_dt_ids); From patchwork Sat Dec 16 16:26:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179885 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp316213dyi; Sat, 16 Dec 2023 08:34:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxBe2Bsv5MzczqgOLlBzcONHRsz77rH1LdA2blgmXJhwcmiTA9vPvJH/zrwVRc/sIyMHks X-Received: by 2002:a05:6102:dcd:b0:464:93fd:f4a4 with SMTP id e13-20020a0561020dcd00b0046493fdf4a4mr11003400vst.25.1702744498304; Sat, 16 Dec 2023 08:34:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744498; cv=none; d=google.com; s=arc-20160816; b=OC1sYySpAiQZC/u5j8igPHWs0DMO0008GvVcOoRaXBNT6CHbOI2p9HorUTcHQl5O4F O7AyuhmBB2FHwc4wYNsv4tqngaOtAIKE5oINf3fYyd8YfhAM0VgLsdb+3LM9nVl3vLmb 2rdren4w7cMnitKnoXNcz7qkRaO8j3nimgqRseWxkW1ha/v4KE/lw1qpHu/DSChPpALn 2trJLk+svvrWK/Mtee1AdkPw1wvSykbwuA9naN97Z3RGsk0RsSb0TDEc3nmOUbzTx/Nq Eoy3cYjJXG6IYm33TO7JJhU2n3wAA48B/12Sgej1GDXTamPSfejfsBfLEi57FJMqFpMF CNAA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=E8OEv0l6dNVJqHF1ONziiRRjeg+pBs39OamlQeNnAzk=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=zni808bQ/cyg2DeKs9MenHQElqX9lEszndDKA2PppoTXPZBsVpzSQ8bCwkn4qASnT/ jDExgGgs+Nu3L1lmc+Bv/ADmc9+UFiwSwGqZl1pXzQmbFKEpUFoPJsG72M/Uqn4dgzLS H+GgeMlRE+y7Qy6SbwPSupD+0B0sfHMcLc/ZcaVj0sIuGUDbXCouj9QSlquuClqa4+Up TydFuFqSq4nGpUb7xQxpFMcdOLxUu3wgxcugM/ukS8zza5iNAK/llx5orsrMOQo8/p9s /zOa+TX9Bo5CPbxRMdI3Fg8l5vnyl8BaWdo2Vioo26AC8KY1P45MNLgAlaWt2+BQ+hko 611A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ElayTmm+; spf=pass (google.com: domain of linux-kernel+bounces-2271-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2271-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 y14-20020a05610207ce00b004663d322678si2136232vsg.792.2023.12.16.08.34.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:34:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2271-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=ElayTmm+; spf=pass (google.com: domain of linux-kernel+bounces-2271-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2271-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 08EEB1C21777 for ; Sat, 16 Dec 2023 16:34:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C13504185D; Sat, 16 Dec 2023 16:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ElayTmm+" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 633D73D0DD; Sat, 16 Dec 2023 16:27:24 +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-lf1-f44.google.com with SMTP id 2adb3069b0e04-50bf3efe2cbso1827092e87.2; Sat, 16 Dec 2023 08:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744042; x=1703348842; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E8OEv0l6dNVJqHF1ONziiRRjeg+pBs39OamlQeNnAzk=; b=ElayTmm+GXaHUkL7hbPK4rZxtF6XsrGsoQe0xrUK83FScyzB6U5XdkPgUowADgUBA0 swggymZAPhzNWNJB6ct/SsGrzwgf1MrKnerb+Td73qLH2n/HEHtcWSwbM9H1JQr72fyl /y4IUb3blKyRNI9EfbZySMxdoPC8BMFDGFofikCm2657Pd0o9ZFVP5As98PR8seNyJ3y +cKeVDXWG0b7RDn9AVONchVCKx/GjLg6gKmqdrDFT0qhOBReIQaKceIpbTUbNkmeW7SD 4ni9qc88HfB8acRanhzYFwdAofeTaTaSTIwpx6QERkXBH7Lu36U77S2ZSZ2cIc5fcA1X UCIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744042; x=1703348842; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E8OEv0l6dNVJqHF1ONziiRRjeg+pBs39OamlQeNnAzk=; b=C5ki7xYIWPvLYyyBRIsduTSeM9CWIG5wHsK1rnrs8pQ73WWpaN/pNx578zc69FAUf0 PB7HAnJbq+GlrKh4N/yQIa0ciEaoCRGxICObpMDaX9iLlM+xGPrUIEQ5tJDnvlgDUUT9 raDxiDSxrvKuMXKcM+VNhS/nU6drfkG4um7875OPkhbBEpGVfB/f5klL98xmEgMGGjh4 S3CaCe7D5C+ypi0FPNk4WEmhFYA8V04wOr2K6zVctBWS2tRUZ5JBfozHfzRFX91SRZ4J nBCS5UPw9KJaqslqh2B30tTVpsKZ+1aFO4znpaJpDLDruPY4wo5VjZNDnZw9WVHXSTRV +Wzw== X-Gm-Message-State: AOJu0YwvSolG/jSju4M/QoOrrda7JVoH/V718ETCHY2wlF3GAupBCSMq ItBZb2LBuFRC7+fLIBEX1A== X-Received: by 2002:a05:6512:1327:b0:50d:6249:17cc with SMTP id x39-20020a056512132700b0050d624917ccmr3309272lfu.245.1702744042393; Sat, 16 Dec 2023 08:27:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:22 -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 23/27] drm/rockchip: inno_hdmi: Add basic mode validation Date: Sat, 16 Dec 2023 17:26:34 +0100 Message-ID: <20231216162639.125215-24-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457015402698839 X-GMAIL-MSGID: 1785457015402698839 As per TRM this controller supports pixelclocks starting from 25 MHz. The maximum supported pixelclocks are defined by the phy configurations we have. Also it can't support modes that require doubled clocks. If the variant has a phy reference clock we can additionally validate against VESA DMT'srecommendations. Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - rename inno_mode_valid -> inno_hdmi_display_mode_valid - fixed max_tolerance calculation - use abs_diff() instead of abs() - call in inno_hdmi_display_mode_valid in atomic_check drivers/gpu/drm/rockchip/inno_hdmi.c | 42 ++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 792e5fad09bf..14473ca96e0f 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -26,6 +26,8 @@ #include "inno_hdmi.h" +#define INNO_HDMI_MIN_TMDS_CLOCK 25000000U + struct inno_hdmi_phy_config { unsigned long pixelclock; u8 pre_emphasis; @@ -548,6 +550,38 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, return 0; } +static enum drm_mode_status inno_hdmi_display_mode_valid(struct inno_hdmi *hdmi, + struct drm_display_mode *mode) +{ + unsigned long mpixelclk, max_tolerance; + long rounded_refclk; + + /* No support for double-clock modes */ + if (mode->flags & DRM_MODE_FLAG_DBLCLK) + return MODE_BAD; + + mpixelclk = mode->clock * 1000; + + if (mpixelclk < INNO_HDMI_MIN_TMDS_CLOCK) + return MODE_CLOCK_LOW; + + if (inno_hdmi_find_phy_config(hdmi, mpixelclk) < 0) + return MODE_CLOCK_HIGH; + + if (hdmi->refclk) { + rounded_refclk = clk_round_rate(hdmi->refclk, mpixelclk); + if (rounded_refclk < 0) + return MODE_BAD; + + /* Vesa DMT standard mentions +/- 0.5% max tolerance */ + max_tolerance = mpixelclk / 200; + if (abs_diff((unsigned long)rounded_refclk, mpixelclk) > max_tolerance) + return MODE_NOCLOCK; + } + + return MODE_OK; +} + static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { @@ -581,11 +615,13 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, struct drm_connector_state *conn_state) { struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state); + struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); s->output_mode = ROCKCHIP_OUT_MODE_P888; s->output_type = DRM_MODE_CONNECTOR_HDMIA; - return 0; + return inno_hdmi_display_mode_valid(hdmi, + &crtc_state->adjusted_mode) == MODE_OK ? 0 : -EINVAL; } static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { @@ -626,7 +662,9 @@ static enum drm_mode_status inno_hdmi_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - return MODE_OK; + struct inno_hdmi *hdmi = connector_to_inno_hdmi(connector); + + return inno_hdmi_display_mode_valid(hdmi, mode); } static int From patchwork Sat Dec 16 16:26:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp318572dyi; Sat, 16 Dec 2023 08:40:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnbk/LLEmLBi/DOpRfPTWLoOV9EVvcL1JmUcmsZR9DquP7P5a9QtgiYnwLIAFyVRG+R7Xq X-Received: by 2002:a05:6870:808e:b0:203:3680:6f75 with SMTP id q14-20020a056870808e00b0020336806f75mr6394762oab.15.1702744850250; Sat, 16 Dec 2023 08:40:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744850; cv=none; d=google.com; s=arc-20160816; b=jXIcFf+l0iBUOQZjVu6qmngj2VUQhNY6XWlYEoT3pEVDisA2NSnj+AMrX0Ll6sgN0e mm6Qa9bXUXYpoG/zfKfgHa3iub17l123h5unLsQJI3O4eL1gh3qqlIJO9+dUjdvKh/jF uREtYgBZYfS+pQOJC5cYrwmwx8y7fmMfoI7oylSak2/wEpYTYtKhhite+pmvGqPV7t30 avyHjP9ltMklddiBUXS7tnM/cajdrfRNlzOs9KQ4OK7QNig2TTTXQNbuiv9tij5LFRp7 SO8gGHglCJsBCzitxevfUrZbBAYcFnzGlTaGCQu6Ff7CEsKfsre+yg67IoPFE4Kzhq4F E0aw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EMBynW0XhMl+E8jO2xYw0fAFMrIK4HAqJAW8qk9Tvbk=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=pQMf2/raTiQdgjVQtbwvSIDMnHEdcfyF4cLx7Ii4E0a0HqNMSJvZRAu7UvNBrmwtt6 2GNNwZPZ5pR44FDIEHl5TLfCGlqUO35+iOg8ly0SZF6pglYYrzX8sQo60BmhGUc90iFY XyMZijAvzSYH/cAGUAqu8qI4BUjR4M1OY++AzphrMLOxzcQEKDInpPwgNVaO+73/s69H 9pcgS/lh4/4l9J39ediFli9MLAd7QkjAai+n5WlP/suHgLvynmx3ZrR813eI8s++ingP /7Gr9sqXc++SPArXmLe66dwoS1aFVYE+Y4i+I5ecp6G/02kNupdW3ZWjChNg0TfuGlbI /Jvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=C8jvLg2y; spf=pass (google.com: domain of linux-kernel+bounces-2272-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2272-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u8-20020a17090a400800b0028b271f14b7si3404551pjc.143.2023.12.16.08.40.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:40:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2272-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=C8jvLg2y; spf=pass (google.com: domain of linux-kernel+bounces-2272-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2272-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2467FB24D66 for ; Sat, 16 Dec 2023 16:35:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 195C841874; Sat, 16 Dec 2023 16:27:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C8jvLg2y" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 EB2103E49E; Sat, 16 Dec 2023 16:27:24 +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-lf1-f47.google.com with SMTP id 2adb3069b0e04-50bce78f145so1846987e87.0; Sat, 16 Dec 2023 08:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744043; x=1703348843; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EMBynW0XhMl+E8jO2xYw0fAFMrIK4HAqJAW8qk9Tvbk=; b=C8jvLg2yo94U0E3qS9G97SOZUwQSoR9mkAiQJal4CunhY7huXN23BLFT1+7I7MVpY8 7gN/nlMwq1PAVeXe5hlt0H0NAJPZmqfY6j6ez+WwUq8BTXW+WnRxOr0hTjYgP7ZgSU5L iWs0Dhl6bqOUXmLxTKEQ78kUTv1beq03q+IAMFG8cjoRBo3xL/24BbyaMvF2WbQ6HZb9 RIe/BZCHACsi+3gn3w/66HBI8LcjazSqEzQKzCigYMhgyGHsU3ZYoYXjF5C5PKwSZEsZ JdG+U3faZASuSIktIE3Yp+I4hPulwsKHSPpOykG/HAnGz3yKQGRgyhu0fCJWjXfAdGPG KIog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744043; x=1703348843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EMBynW0XhMl+E8jO2xYw0fAFMrIK4HAqJAW8qk9Tvbk=; b=YLpig4KoOOHYytrKbjmaYQjADg7h2SONDZ2QRJWerOSxTthUF+0xArpQVFET1ZdBJO SwrO9ajBgAWV9xXwpnrL1L8x46r28bC6AgAIgqgi6nO1j+xpyTX9Z8AHBhm8J6ICJKPx pRQl9Oi2/r18+r1Xes1gAO3Xj7K2gjgvmfgKuTAkENRA/+WNonl3M7yYIkMO4zZrnCkq D0lQOqN7qfJNSFBiK2BghVSy7ccikPddppWkOJrkCeDFZqsNVPjCZIzHjI9pHaDftZBb BYhFkDNDl36zY1c1BVJFkxokZ+d2GwyvZTJEI4meGz33WN3XylX3SyRe9n+vQXBXOprl CzXw== X-Gm-Message-State: AOJu0Yww4M9iAOc+pYKF3vr5uEg785bHtPXpxXUQp9ar0mu3e60fblop r896bmywoVl9Cq5arsvSQeKJfSoK2w== X-Received: by 2002:a05:6512:2352:b0:50e:1b0c:1143 with SMTP id p18-20020a056512235200b0050e1b0c1143mr1151682lfu.53.1702744043055; Sat, 16 Dec 2023 08:27:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:22 -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 24/27] drm/rockchip: inno_hdmi: Drop custom fill_modes hook Date: Sat, 16 Dec 2023 17:26:35 +0100 Message-ID: <20231216162639.125215-25-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457384184919232 X-GMAIL-MSGID: 1785457384184919232 Now that we have proper pixelclock-based mode validation we can drop the custom fill_modes hook. CRTC size validation for the display controller has been added with Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to hardware capabilities") Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - no changes drivers/gpu/drm/rockchip/inno_hdmi.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 14473ca96e0f..d477d2872195 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -667,13 +667,6 @@ inno_hdmi_connector_mode_valid(struct drm_connector *connector, return inno_hdmi_display_mode_valid(hdmi, mode); } -static int -inno_hdmi_probe_single_connector_modes(struct drm_connector *connector, - uint32_t maxX, uint32_t maxY) -{ - return drm_helper_probe_single_connector_modes(connector, 1920, 1080); -} - static void inno_hdmi_connector_destroy(struct drm_connector *connector) { drm_connector_unregister(connector); @@ -701,7 +694,7 @@ inno_hdmi_connector_duplicate_state(struct drm_connector *connector) } static const struct drm_connector_funcs inno_hdmi_connector_funcs = { - .fill_modes = inno_hdmi_probe_single_connector_modes, + .fill_modes = drm_helper_probe_single_connector_modes, .detect = inno_hdmi_connector_detect, .destroy = inno_hdmi_connector_destroy, .reset = drm_atomic_helper_connector_reset, From patchwork Sat Dec 16 16:26:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179886 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp316345dyi; Sat, 16 Dec 2023 08:35:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfCyqkVvucjFBKOo6nb7vwW3I45ULshbiU4AXUixHTYyosl0GB3ztKBQkzusvt7pnet0uH X-Received: by 2002:a05:6a20:9706:b0:18a:e86f:f246 with SMTP id hr6-20020a056a20970600b0018ae86ff246mr12837687pzc.10.1702744518291; Sat, 16 Dec 2023 08:35:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744518; cv=none; d=google.com; s=arc-20160816; b=Ft8KAzWl4gy59acPo01DBbXMmEt3QwKz14bp+YMSAOd1FC360qnW5KfheKz7gFvom7 aDQ6eqOYVocMPNaPKp9nwPSmMoxkeLzZ9L3v5Lpw24JQVjWkJjS1cvhRDqT+FEkjqLST kno9JsjPpMzm1PxWVv2GpkjG1t3oeDkQvDm2pmyFGV7W9cvHccWzotARHuvBZ3eXU60H h7m3qXSIsqaLK7y0ldb3M7sFIPgnJZkMoExVpI7dbAHQnIlSnk9xENE5Y+KVvaJN37qe G5sqb/k2Y+/b9SYiqFZqNykFUc3vlsE+V7FaYLNqE8yw+w345zuxXsomQHOztXNM0v3C gGzA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Hsk09sD/JLCR2XzE8w6SDzRrfieu6a8GLQCzTQyHXNU=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=QG+15ncHyWzMyfSxgvrH5r4Um4jLXA8FQE+87w4+nmqm3aYvJp3ZZQsqxrnyRJEfxQ 9DIMKDCoJaggZ9P7zmqXsuDUxwHK26CW3SBJVl14cLcpbpUjU1xvEOgt3zjKFeKMKBSU r5V6PYXoOtMC3j6iEHDQPQDrjOiuDbRGAduPfaB/menC71tdv5+F0QdFE/xJjGe9+fPe kQ7XsZJYBCZSIQ+Bhqn1ygLqf3Iu+icTp36sDJTb17kQKIcWUho1t+dVzRiCEt19cKYq xzAWb3GyWX+cHo6DhgTaI/DoXy2IYtANkO5zgRlNQaBSEqJikNXIGmruNCoYqo/6Msrw GTxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UmHbQRHi; spf=pass (google.com: domain of linux-kernel+bounces-2273-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2273-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 b2-20020a63eb42000000b005b99697d854si14733913pgk.673.2023.12.16.08.35.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:35:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2273-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=UmHbQRHi; spf=pass (google.com: domain of linux-kernel+bounces-2273-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2273-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 110EA282F49 for ; Sat, 16 Dec 2023 16:35:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C22B83E49E; Sat, 16 Dec 2023 16:27:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UmHbQRHi" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 98D493FB28; Sat, 16 Dec 2023 16:27:25 +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-lf1-f45.google.com with SMTP id 2adb3069b0e04-50dfac6c0beso2049402e87.2; Sat, 16 Dec 2023 08:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744044; x=1703348844; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hsk09sD/JLCR2XzE8w6SDzRrfieu6a8GLQCzTQyHXNU=; b=UmHbQRHiBqsmz6rv68has3iNL+fLsZ9Dg2eq3izLeazy7g86CbGog6ROe4hYN/RJXE 9XIeSQznefCbjJ4POnU2yGG/abb0oC469on+51pnuFfK9gYrjyRU5dj4WeVqat2GUsD8 PrJcBaNAJlTtwUa/FIuFq/tja1FYrBQpctOWBzynnU/ezoVKUzDAgtS9efWs/BGvTSYQ 8yzx7Xsxhc3bcF0sTNQk1desbZT0AwUI82E6zKHH5s/mgmfbOFOA1oqgr3dIRcKCjozc rdhqUpgM2Ja2/Z6bHJeIe+IGy6LmA6EiRPq4eL9yZtVPVSZh5QQWO7qyYTyKeRI89SXy eASQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744044; x=1703348844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hsk09sD/JLCR2XzE8w6SDzRrfieu6a8GLQCzTQyHXNU=; b=ND1xKsgCZNJxa6wH6SVqVJ6pKbQduDyJbHO1RscSHhR3t4WSgfjIijI+lrQokhfyfe O+V4+KcJWy1z7WwssLV7wnJnpkvoQ/ocTb6v8loJszsZ5NMJ+93J/CVu0dNbvBWlTlcu EUbDcgWCctorcIoVrsrMIAm6tYwZ7KYjbTQGloS/LpHgWt81K6m1KPexyi97DCgkmOWE jT+iVHO1/so5+ybWfaVWJ3zP42Es5Wmml0s6i0Pl/+b95qBaXu/3zHdQ9wyO+vHIJ7u6 2yMAOxvCqdSB31+doqZVNuwMpczL+CTRN8D7FzAtxz86Rfug180RChcI02fdT3E5aDvR +DZw== X-Gm-Message-State: AOJu0YzZybyaInWfRpaF6+KQIOBW33pdyU69v78uF97LygzOT/Ea24l6 jji66KDW9Ckti1zOHUhSNg== X-Received: by 2002:a05:6512:3b0d:b0:50e:d07:597c with SMTP id f13-20020a0565123b0d00b0050e0d07597cmr5112150lfv.66.1702744043722; Sat, 16 Dec 2023 08:27:23 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:23 -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 25/27] ARM: dts: rockchip: Add display subsystem for RK3128 Date: Sat, 16 Dec 2023 17:26:36 +0100 Message-ID: <20231216162639.125215-26-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457036333399877 X-GMAIL-MSGID: 1785457036333399877 Add vop and display-subsystem nodes to RK3128's device tree. Signed-off-by: Alex Bee --- changes in v2: - no changes arch/arm/boot/dts/rockchip/rk3128.dtsi | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index e2264c40b924..1a3bc8b2bc6e 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -115,6 +115,12 @@ opp-1200000000 { }; }; + display_subsystem: display-subsystem { + compatible = "rockchip,display-subsystem"; + ports = <&vop_out>; + status = "disabled"; + }; + gpu_opp_table: opp-table-1 { compatible = "operating-points-v2"; @@ -246,6 +252,27 @@ power-domain@RK3128_PD_GPU { }; }; + vop: vop@1010e000 { + compatible = "rockchip,rk3126-vop"; + reg = <0x1010e000 0x300>; + interrupts = ; + clocks = <&cru ACLK_LCDC0>, <&cru DCLK_VOP>, + <&cru HCLK_LCDC0>; + clock-names = "aclk_vop", "dclk_vop", + "hclk_vop"; + resets = <&cru SRST_VOP_A>, <&cru SRST_VOP_H>, + <&cru SRST_VOP_D>; + reset-names = "axi", "ahb", + "dclk"; + power-domains = <&power RK3128_PD_VIO>; + status = "disabled"; + + vop_out: port { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + qos_gpu: qos@1012d000 { compatible = "rockchip,rk3128-qos", "syscon"; reg = <0x1012d000 0x20>; From patchwork Sat Dec 16 16:26:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179894 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp318825dyi; Sat, 16 Dec 2023 08:41:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhv6RjkEM5dFX8+xDvA1juLQWe41c9Bmx9k5PQAwiySfBnHepm5amjdgFv8kANbWlrKlfa X-Received: by 2002:a17:903:32c8:b0:1bc:edd:e891 with SMTP id i8-20020a17090332c800b001bc0edde891mr18927033plr.1.1702744882533; Sat, 16 Dec 2023 08:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744882; cv=none; d=google.com; s=arc-20160816; b=RWmFtB9sX+7A45g6jWedDawK7XWeMH/D7AY6WbhE9Qff96dTcRNyG2kOG9MripIC6w Yu2konP2BRtx4ApiSd2OLyW73PtK4OIxI7M61WEGD8o7eDA0UrgX7RixJ0VqPjJVTjXK H0AoAEoePUL8OHXrRUfVabqSdv4bFvncMTsjVVEJ17h/ypmNBL/3AwErkfIuORz9HfSy 4X4cmU54pW0XhKMe01wV7pA/shY0MW8vEAA//Gfko5LaW+6F9CbPDrkn1fJqjPPO0kGQ XRry64JaKbgdBZZML47jVcLOPtG3fcjzk8Fq2vPmTOvIkJTcpP8ZESpsT7dPnkSYu9sc g8MA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=gBYs3PhPVI6eUxnSZWKmlMF4qjz6lpemR7OHeO6knFA=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=BYbF8kL3ZjZGAYwioTV/adFOCSAufqjEcAVM9OBqXxBMvBy7S4cf282zBJcSa3HSDn CS516QpH8oFYfT7hnfb2F5jo9TVZcelt+SLklrj2Le/938YZ03lKz7EU4+0liaQ+oayu lnYvsL8kuEKVdT0bkoZui09Dicp1LrN92f5sRY1rqmuWaueCfYw/NdLSAEoOcToHpsbK SHmAf2R8cnj/c3gFH1XCaOfdOzY7sivYs98A5fL+zlU5e6ZQWFBTyqicjq5lbBC9ZtY5 On9Izr/tDhMMKRMJuRVulY2J9YFNpJe3EmK/uw0fGCNrOK4D++LvOb62RP3Xy7yD+7fE 2C3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X4vwsXgm; spf=pass (google.com: domain of linux-kernel+bounces-2274-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2274-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m5-20020a635805000000b005c661524f67si14917824pgb.26.2023.12.16.08.41.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:41:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2274-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X4vwsXgm; spf=pass (google.com: domain of linux-kernel+bounces-2274-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2274-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2AD6EB24FC5 for ; Sat, 16 Dec 2023 16:35:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45B0042A9A; Sat, 16 Dec 2023 16:27:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X4vwsXgm" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 287D3405C9; Sat, 16 Dec 2023 16:27:25 +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-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-54f4f7e88feso2226137a12.3; Sat, 16 Dec 2023 08:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744044; x=1703348844; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gBYs3PhPVI6eUxnSZWKmlMF4qjz6lpemR7OHeO6knFA=; b=X4vwsXgmJtdXN2FoJGkbpqnZwDCti0O6EOx0bwYTIR/bUATGMAXRdJvtmRSSquE8Cg PzjcQznfsaUL+OYvcAquvgd4wqAbvIxzAnsqttJxZhftXmBClB5jA4slHlC7qPeNLRGN 8iJNu7oDS5yjyQ4xNMNjRrAOYmxgUhXFvwQ+SmVNesz+a9Sap3axX1E5O7ibtJeQFtiN XE5EkPX0ROGsI/QlTK7eXmLNZCY4oFSRUWUr0H+5SLaw16uMpbVmEgf+4aErHGvoM7yS XIsy6jSBT5V9XpEPaZoN7EF/8kgbNvP27/i2b0F0PgRWDIyUaOkZ3+RMdSRow6PeB1TB Drow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744044; x=1703348844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gBYs3PhPVI6eUxnSZWKmlMF4qjz6lpemR7OHeO6knFA=; b=Sq6g29FfBYJ2M/QmDSZoXCQGGmzklRkSqNf7iaF3GJeVrqUDEPo1AHncxFBZoXXmGW cktyNeqfHMQcemYMhk6YHmQDGtPhnXpSkEgTKgWbdwa4x96o3BT7DFzeslqHAXecDszK iPUdifIAJMU4hbxL6HP+WtY/ppnKQNJSFH5r9eaOt+Tpn0k1RWfg7asjsj/FgKWske7z pFH0wkgfQMFZwMyfDlYFVUQmjBZM20sXM7r40Tc7Xj64V6ua4zPNaZgYIKB59q5w1Cbq SS0ASBNLwjkAinGmS5wtwMEfV3TbguNFi9/YeYt2iiTkUilPwQ0WLu7kkBW8z3SqGzzD Hztw== X-Gm-Message-State: AOJu0YxqZmKAevokw+mUo65tqe/ouvAnHxWIQhzJdO/rsnKtJn/66bYF S5KKK7M1WTV9O45NGbuYLw== X-Received: by 2002:a17:906:3199:b0:a23:2e05:8465 with SMTP id 25-20020a170906319900b00a232e058465mr339276ejy.6.1702744044454; Sat, 16 Dec 2023 08:27:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:24 -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 26/27] ARM: dts: rockchip: Add HDMI node for RK3128 Date: Sat, 16 Dec 2023 17:26:37 +0100 Message-ID: <20231216162639.125215-27-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457417871322365 X-GMAIL-MSGID: 1785457417871322365 RK3128 has Innosilicon based HDMI TX controller similar to the one found in RK3036. Add it and the respective port nodes to the SoC device tree. Signed-off-by: Alex Bee --- changes in v2: - no changes arch/arm/boot/dts/rockchip/rk3128.dtsi | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index 1a3bc8b2bc6e..fb98873fd94e 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -270,6 +270,11 @@ vop: vop@1010e000 { vop_out: port { #address-cells = <1>; #size-cells = <0>; + + vop_out_hdmi: endpoint@0 { + reg = <0>; + remote-endpoint = <&hdmi_in_vop>; + }; }; }; @@ -463,6 +468,34 @@ usb2phy_otg: otg-port { }; }; + hdmi: hdmi@20034000 { + compatible = "rockchip,rk3128-inno-hdmi"; + reg = <0x20034000 0x4000>; + interrupts = ; + clocks = <&cru PCLK_HDMI>, <&cru DCLK_VOP>; + clock-names = "pclk", "ref"; + pinctrl-names = "default"; + pinctrl-0 = <&hdmii2c_xfer &hdmi_hpd &hdmi_cec>; + power-domains = <&power RK3128_PD_VIO>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + hdmi_in: port@0 { + reg = <0>; + hdmi_in_vop: endpoint { + remote-endpoint = <&vop_out_hdmi>; + }; + }; + + hdmi_out: port@1 { + reg = <1>; + }; + }; + }; + timer0: timer@20044000 { compatible = "rockchip,rk3128-timer", "rockchip,rk3288-timer"; reg = <0x20044000 0x20>; From patchwork Sat Dec 16 16:26:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179887 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp316473dyi; Sat, 16 Dec 2023 08:35:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYe/wgKitzt5gtFFg+H2dGJAagZ9igXjIu8GvhmkixIHMS3ZGLfhBtAngC210+9sQwNHYc X-Received: by 2002:a05:6870:9619:b0:1fb:f89:5b31 with SMTP id d25-20020a056870961900b001fb0f895b31mr12577201oaq.111.1702744537290; Sat, 16 Dec 2023 08:35:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744537; cv=none; d=google.com; s=arc-20160816; b=ejbxjT99Pa8RolfxangAfcepd6VRISPFDokLrn4b4G9G3RdTC9h0Q/7GcQyDO35u5Q dC8qroLKzhchbyHruMX6MrzZuCohuv0Y/8dvY1gI4deb8FgqR8B3lCvqOjZzmOjcVktz KsfLbYAL4ZJiwqnMwXno+gVjnfez5BoB4CgPHnboeAIN2KPPDefRLWJ6YbTEM1gsOIOz B4rBfAFhqhKJRqZ6WfbQE2+KWgmGxb3DLCOg7Gcaok3oIpHP6Ih7/1FgNlnskpWkmMEG Dxzgbj3RN5N6lpcY6Z/kLTGglPygAn+mGz+ZO8s/AVN8PGjiaXXeK7XDeaYOV7WCdZti /RDg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=S3iOjCbwZExjH9kB2lsGfCX5u0yghPXFIA3BH7zrUI8=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=TfL7VE8dj+4h7cVcHR05IQhA/d+oNaf/FqURhOprRojJEa4j2NdZePEPiJ1hXWKXa+ xO9s34Y/GyoBPX9BnCk19d5+AkT4/NMrHfhYxLjn2cQM0YGEGec3WCZ/y9flU5d2tK9s elgHe5D7EtLuO8KUKO8n8owkaygl3F5eidLiaGAZ+yLlFfyYwvky0xq6egIqmgRfQY1R Xvs4qGk9tR6FenfZ4+pggncGIOO1A3kIiYfUV/S9hsYg6n+2aMmEGb7bWogRlJJo8Fxl HQWKtY86+gw41Cgtie31U3V4Dz9Wosx39U8Enlo37+Me9/USzINzrOzfR8aZexNPrLOm W4uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ob16htJb; spf=pass (google.com: domain of linux-kernel+bounces-2275-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2275-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 o10-20020a0561020e0a00b004649d204cb5si4197497vst.613.2023.12.16.08.35.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:35:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2275-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=Ob16htJb; spf=pass (google.com: domain of linux-kernel+bounces-2275-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2275-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 047C21C2189A for ; Sat, 16 Dec 2023 16:35:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3B2542AAD; Sat, 16 Dec 2023 16:27:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ob16htJb" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 D84C539ADF; Sat, 16 Dec 2023 16:27:26 +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-f45.google.com with SMTP id 5b1f17b1804b1-40c824b199fso5376535e9.1; Sat, 16 Dec 2023 08:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744045; x=1703348845; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S3iOjCbwZExjH9kB2lsGfCX5u0yghPXFIA3BH7zrUI8=; b=Ob16htJbCr6zZfzQ0CQbBguVoUb6B6dcKsLpJGMRIg647BLuWhFzv11zII2A7aqgJ3 NJz3aJzyCI1ayN8+zzl1QzxoJI3LxNpVeCiYUmaV2EltIaEZ9yjdU3K5h48rf+mQ34+Y OboqVgo5q05DIOSCaR0VT6JSQnM7eFRpW8SZFpQCe8IOXPIpJJKiRu2Lnu3sLTsqkvry +bgbhHBT4gMS9vW0bt/9B/6QBXrE4TIkSXCdCPJpzoI3V2neoz+q3/Y5IBkB8JCGQQRq WP9iLyjo1o/p7wD8SfNE5itA1gxeXuE8keao8fNMu79Ttm3UPO4PkgBh6QD+c9Sv8kEP emLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744045; x=1703348845; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S3iOjCbwZExjH9kB2lsGfCX5u0yghPXFIA3BH7zrUI8=; b=LYiOCEW8Ja20X0jTBv9Z7AgIyzAbPlMkw17CFwVYer7ZvbDD7EH/XN07ybqx0bNWjj 3XpJiifUlasPslD/gz2F2LDqyPvdOcml2YlxVUb3KpTqNRxzXq9sZb2zSZJgX5AVJTDQ 6G5EFCbS4QBPDWjgUScpyBxFQqv0oSp1FU+adYr/qXvOF+c9EdzySkAufzEcc+FBegt9 P1Nf622/uoMCQiUBU+bSO2bw4Ow5nknJpc8MfLJfq+JBztdmdUOwB6yyGxwWR7Ald2rc mx4fLDg7KcvMonxTR3b7nUbiKnxt2zb8C7yG0Ku6rvIPaoda6101jb3MmZhBGFtYnqzi LIzQ== X-Gm-Message-State: AOJu0Yx4ZOkqUyCriTQXEyZrmKz5ERiJ9CLjV/2wk/v9SVozncUpScdm r8HuVwXRBzHm+eIjfi2bGw== X-Received: by 2002:a05:600c:4ca7:b0:40c:2871:9729 with SMTP id g39-20020a05600c4ca700b0040c28719729mr7088382wmp.188.1702744045068; Sat, 16 Dec 2023 08:27:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:24 -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 27/27] ARM: dts: rockchip: Enable HDMI output for XPI-3128 Date: Sat, 16 Dec 2023 17:26:38 +0100 Message-ID: <20231216162639.125215-28-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> 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: 1785457056196721263 X-GMAIL-MSGID: 1785457056196721263 Add an hdmi-connector node and enable the hdmi, display-subsystem and vop nodes. Signed-off-by: Alex Bee --- changes in v2: - no changes .../arm/boot/dts/rockchip/rk3128-xpi-3128.dts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts b/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts index 03a97881519a..21c1678f4e91 100644 --- a/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts +++ b/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts @@ -47,6 +47,17 @@ dc_5v: dc-5v-regulator { regulator-boot-on; }; + hdmi-connnector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&hdmi_connector_out>; + }; + }; + }; + /* * This is a vbus-supply, which also supplies the GL852G usb hub, * thus has to be always-on @@ -239,6 +250,10 @@ &cpu0 { cpu-supply = <&vdd_arm>; }; +&display_subsystem { + status = "okay"; +}; + &emmc { bus-width = <8>; vmmc-supply = <&vcc_io>; @@ -328,6 +343,16 @@ &gpu { status = "okay"; }; +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_connector_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; +}; + &mdio { phy0: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22"; @@ -423,3 +448,7 @@ &usb2phy_host { &usb2phy_otg { status = "okay"; }; + +&vop { + status = "okay"; +};