From patchwork Tue Dec 19 17:00: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: 181101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2078414dyi; Tue, 19 Dec 2023 09:02:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQnr74q1waTIUyokXiHoNRbeyYm65SGjLRdRXOP9rarC3Hqw9vJK24MOVZ/8eHNffFKdsy X-Received: by 2002:a17:902:db02:b0:1d3:d8eb:f8a5 with SMTP id m2-20020a170902db0200b001d3d8ebf8a5mr1335629plx.17.1703005324354; Tue, 19 Dec 2023 09:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005324; cv=none; d=google.com; s=arc-20160816; b=wLRlfWlyW3/5dW3CxbG44CHiZ0S/PeAfwvf4wH2sAzrl96iqNAnNqXjjbd80iL1jT/ UTa61croBCpe/k0ACH3RQLr11yJEsFvTS4M3fJomvgoNMb8aE3g4RoXv8toKQy5ZGkne cWIDHgyD0lPiwO/hCZW+piE8eS6snMsm2h+hb51sf8xrebaaYveo5wY7naoOja4mjjgI ZvlXkxuxW+Pl6Lu1MNeQInJXmJ0GCxV5R+owGNoGetuT4wFtxHsEGxogsOfcuhgDkGak sXFfDVPnWFXF3KRoanJvGSFArxD/O+SCH4LztOuCV+O+spzG6r3hU6tibs4hsBBbZVXt YGhA== 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=LuKwY9nW5+R7DeHCNpC77KMqCvSYagjOBXGDTeiO2JI=; fh=AI7vKBwTnYJSXpanaofkzZCBO2pgxuTrrwjgcPUJ6tU=; b=k23QqeFVDY1xMKajKdzn78jlbHgbIMkhzsx1NhUnSWl0oqXW56l6uP4DxvXfb/Z0XN vFJ98XmJuijZB5zHneZr/7tuuzgqZISKzoBo5Kr+gUocqzh6t4Ismk6Y4uT1H8tI1+VJ xh+vnmHZV1DKOBNde4tAAsxBzqDFCOgCCTc9jDWsrSV1NtiT3329wK5kCORFzQ/DH1Hs 3lXydmj9e9XiY1NRVro6oJJQjYDMGCYraaM5sj2wQb1W31kGKQbf2f9eoiBZYRr0ES7k /FhScAGA9T+L2SxztVUhgUA3n8hSZzM1mC18UQxrwhdsftmRh0SehBXcsKKv1m8W/nvt BkLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aCKPCWwF; spf=pass (google.com: domain of linux-kernel+bounces-5619-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5619-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 e3-20020a17090301c300b001d3bb33b4c0si1433660plh.150.2023.12.19.09.02.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:02:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5619-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=aCKPCWwF; spf=pass (google.com: domain of linux-kernel+bounces-5619-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5619-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 13889283E78 for ; Tue, 19 Dec 2023 17:02:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66B602E647; Tue, 19 Dec 2023 17:01:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aCKPCWwF" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D908F35295; Tue, 19 Dec 2023 17:01: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-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40b5155e154so60381055e9.3; Tue, 19 Dec 2023 09:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005268; x=1703610068; 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=LuKwY9nW5+R7DeHCNpC77KMqCvSYagjOBXGDTeiO2JI=; b=aCKPCWwFAIn0DirJIaeFdefNIuMSwxFOFd0C3HuKU7TB57A6dN3TlntUSuZQ0d9KSY vJzX6VeBEk4NA8WH9ngm1xxJx7CePA5OIq5MMnefF3gcKA9TqgbRN5rU2ZDjWTaLFXdH K2vJUABGtraa2cv+4/zLqGv5boBiYyl+C/oBlET7z8vg7Th7sHwgWgKZDNESg4fcSg9X XzI5aoXBwnE+8vRtIunIe/363C7ZGI3nrlVIQ1Sq2ZKYtmTsjc3bO55UIdUYqxGBFF3A Ag+1jJ6XuVaOxTvyywD0sUewh07DVWVwfRn81PQiJM7WIiSCj3R9kpqec5M2oaXjDTtR Gugg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005268; x=1703610068; 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=LuKwY9nW5+R7DeHCNpC77KMqCvSYagjOBXGDTeiO2JI=; b=vRqctI+jvMeD5EVcdkJkBDuIBme9FNoAwtg97Xd6p43DTvTjC1+3Tj1HmBFReOBn97 Ju1zhc/8Pun5gwVM1gQJKDMyGThckyqlKY8Q5hWFUf9lxufzghzWxEiDLYceFTacUuBm RLsm4h3It7Ck1a6Y9zqZbyhvgoGoFvVSaj98N5L1q4i4J0G8q6aYNy1HWxpWLhhdZBZB zws2C732J5wU5YVyym6+BrY3F1BqQYNwsmf++cHC4THJ+bCvzs2k5Uw7UedbvYF4hHKr 2zqRIOVOMZy1JFm0WyKAF8T8Tj/8hVjd1oGMyx2RVWgbWCz/dnyHf9HE0wwzc2gDyGM7 XFZw== X-Gm-Message-State: AOJu0YwsRVTJhDFn6otHsbRFhVCS2hEFaQZpPAgMvki53+qmXygS0H8u VvOSxZJysqDj8nR7ZvuR9Q== X-Received: by 2002:a05:600c:5408:b0:40d:3084:e66b with SMTP id he8-20020a05600c540800b0040d3084e66bmr127509wmb.163.1703005267997; Tue, 19 Dec 2023 09:01:07 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:07 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee , Conor Dooley Subject: [PATCH v3 01/29] dt-bindings: display: rockchip,inno-hdmi: Document RK3128 compatible Date: Tue, 19 Dec 2023 18:00:31 +0100 Message-ID: <20231219170100.188800-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730511358320852 X-GMAIL-MSGID: 1785730511358320852 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 changes in v3: - collect RB .../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 Tue Dec 19 17:00: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: 181102 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2078644dyi; Tue, 19 Dec 2023 09:02:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGnBhcvOKfV+E3l2jd+TdcDRMwpRRCvm50K2TVqVLxcb+0zofkaHUrELsj/Gn7/8SB4fL0 X-Received: by 2002:a05:6102:150e:b0:466:b8f7:11e9 with SMTP id f14-20020a056102150e00b00466b8f711e9mr460280vsv.19.1703005336351; Tue, 19 Dec 2023 09:02:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005336; cv=none; d=google.com; s=arc-20160816; b=01UHWUivpXh6D7LI5wehoh7z7WFhXjAwXfayOfw99lAOQsuN7Zde60f3/Nv+Esnq0j iTXUNhmg8B5zRO4QWol5n7vJJJzMxr3GqHmKTkOWVDASzXRMvpSf2SpcW6HGyESg0ZZY vVwWV0fMPui42EfRSQM9rH9Mwjg5XPwYGn4TmULqac2xjh1/H6KaOefROnNSkwl/Y7J3 FMsB/mXC/BaA0B/OOCFQLN3vG+c6sr4V/SjMnwR30YSFV6RjAq1YZbtmxd7t+P7IolI4 lKLi7ha4p/Za9s5OEngSkIMoQLMq0L37zMS4FQSddkNGPZmeUbKarBZKBabzbSsllUT/ JxOA== 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=tvxDLNOYjKdWlkXmI7fVu1cGUQmdpgYMh9GlbetV5JM=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=TRjd5/DVfVIzFGUD4tHiAvKmUBAkZ4u1rD76sfqLbu/Vm+xRYWC0VoMjTLaWcb0QxP b/yQ6lQQoIg/nfGmIl04EC8v6HclsBYgvxvYxnqGct4bVp4AqfkepkYDRYC2biwGZEJa o0pV7G1TZsHdTQcKiYOU3UwGJh9LVVq8n4LXkOolR5M3hPUqKAqONXX1rEz9YCZTlFiW K1HUjdHw57tSdob1VvZj76UwptWZfw8WTjC1B2AKamNzYPL7Wo1OvJ/2gcs9dYWtfnXh HG7bGwew1ir6ZBC43rirwEDZIe/Ww2fhnL716V+TjSJsMGAetofdCNHL6p5WqQci4EcK w44Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Co3vCXU7; spf=pass (google.com: domain of linux-kernel+bounces-5620-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5620-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l22-20020a056102051600b00466952db989si819883vsa.703.2023.12.19.09.02.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:02:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5620-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Co3vCXU7; spf=pass (google.com: domain of linux-kernel+bounces-5620-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5620-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 F227D1C24CA5 for ; Tue, 19 Dec 2023 17:02:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 307FC347B2; Tue, 19 Dec 2023 17:01:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Co3vCXU7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.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 7E6C235282; Tue, 19 Dec 2023 17:01: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-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40c3fe6c1b5so52521435e9.2; Tue, 19 Dec 2023 09:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005269; x=1703610069; 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=tvxDLNOYjKdWlkXmI7fVu1cGUQmdpgYMh9GlbetV5JM=; b=Co3vCXU7dJYa1o7tTkeZLSAlruhBwV0IYqLPnN9vesnMrvLbO/EjzMkEjR/JgaUpyy BFyHy+gHl6YyJEsKjHtnXiCIwwylNXygeYYPj5Z8/mRlZ7ob9EYxP0ykRZdWE/gx/Xgs TEc8zYvzVihsF/tglIFfK79slhw5O28p3fPBRPJRWy9IjhVS6Xi+/uHH+ivTM/Fu2dWs g7K8Nevf2YrXoiOI5oKndxrtGLyWcLlAo52pgjBs5qcuBE1jx53IhPqBQz699OKmz1Rk 4dypbTbXdKjrrbHDvYhaZED6PX/iBFatbTNOHWL4YCYxQoygJgpyesehBmKvVu2tCD8y l4TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005269; x=1703610069; 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=tvxDLNOYjKdWlkXmI7fVu1cGUQmdpgYMh9GlbetV5JM=; b=wFVchY4bumpzVka9ynjajLQYxeKuD9Q95LnlnFUoDlxYvWQDlA8LHgDOl821lRM4n+ If3wGPqnH4P8Z3dtOIv2W4ERrZ/Pmt+Zdau3Glv3fe85OVn5z+SZ1qD1KXVwEc+kfGHG NYcAmzpEKwJtgIbDKOH05HYq3M646rAcXq8ufPn9JQ4Ze2pjdba6Lae8Jhy79w6rEhg9 aIdFcNMyossnqhM3O1QSUBSppymJg4webSYD2C/EmWSlQlqTfMq4K0dGasIVySpPFKpx 9CScz7G0wWsLambMQEgzm7l2gPhaWcR1OKyXV0738SpM+r6YNiUOBJqK8H2f6+3DxFbp OaVQ== X-Gm-Message-State: AOJu0YzA2+oTDqMd+VmZ3Suns+fPdjI7Xf1+Bm92hVOLWKcNpQ3nUjer xRxk2d4Q7yuTGp6qIW7fCA== X-Received: by 2002:a05:600c:1d1f:b0:40c:f7b:67e5 with SMTP id l31-20020a05600c1d1f00b0040c0f7b67e5mr8969956wms.37.1703005268722; Tue, 19 Dec 2023 09:01:08 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:08 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 02/29] drm/rockchip: vop: Add output selection registers for RK312x Date: Tue, 19 Dec 2023 18:00:32 +0100 Message-ID: <20231219170100.188800-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730523678939036 X-GMAIL-MSGID: 1785730523678939036 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 changes in v3: - none 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 Tue Dec 19 17:00: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: 181103 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2079247dyi; Tue, 19 Dec 2023 09:02:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2+V1BNUBNjQ60ha2cZAJu1iC69x+zBsh+ja6noHGQBl2iV/UarBJKO+h4UKA/RQdnb5JT X-Received: by 2002:a05:6870:3d96:b0:203:1c21:75e0 with SMTP id lm22-20020a0568703d9600b002031c2175e0mr12884267oab.15.1703005373328; Tue, 19 Dec 2023 09:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005373; cv=none; d=google.com; s=arc-20160816; b=gfdhQWfOBnOUeY7CGiWrA8loZwYnrv3JRyYSu9ZreXxuczkXxoBSAfFFfD/7TNMRJp 6xdvFWcUtJeSiCq2D5RsibymkaguW/kTU8uOFCPZSFPlgvzDHBM7fpQd64ybWc3lnYvE DRRYouBGn7dNp/9nI6e1MQMiBMtR11zTK7NHAe4kjvunHTKBa8/QZIGfcMiAqb5pJjh6 pY2b0cYuXF5vUUgNtjIoPLpJsyDVLpHFsmKaPvb/ZSrBd8R4W2Uv8Gnvb3LKab7XZEDE 0txnMk6HE8/b7I/9K8GtvWRaibVEHZy00526pI678oEH73ZeohK2XGgaTJO/L2zAL/vj OJog== 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=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; fh=ofylbV+bzQmJfsy0tRuyz0Yfc9dw4CDRyyw48UzeJ8A=; b=j+sHS5mRe4luvd5a+0S1RZpEWkWyi0Lgi+PT06BRuKn5SA6CbWqNRAfiTJbGvh8QKz Gd71r0G7gOSa7ZyrqIc4Vh/VZYqBJV/AtlMoKGOOO7OEGNgylBsiyGcwDVKNppqgXn4b yQQRC5A5zYuaBDWZ7G1GW4NMRx4QgAi13Xmw9rJTHYCXnHJCOWiVLWgoM5gjUSbYUkhQ ABjoFjBgCYxr9SDHOHIeSf6hG/Gbq7I8SaXx3WqHBpXINQnsz1d6kx1NtCjVnNZJNiLH H4HPncm9b/Wy3M1b91c3hdAxBxzo2fs/csLbhVwuJJtcojmflBXeTu1VGTvuQj9EWRNb YlGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PTe2ZN4f; spf=pass (google.com: domain of linux-kernel+bounces-5621-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5621-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d2-20020a1fcd02000000b004b6a3f04e7dsi1667356vkg.301.2023.12.19.09.02.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:02:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5621-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PTe2ZN4f; spf=pass (google.com: domain of linux-kernel+bounces-5621-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5621-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 197701C24BEC for ; Tue, 19 Dec 2023 17:02:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0428E37178; Tue, 19 Dec 2023 17:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PTe2ZN4f" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.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 41BF620DE0; Tue, 19 Dec 2023 17:01: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-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40c60dfa5bfso56957465e9.0; Tue, 19 Dec 2023 09:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005269; x=1703610069; 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=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; b=PTe2ZN4fgiZ06579gZZOQFCsE+SlG3Kij9e/UIQ0/9apXPXF3/qbWInkmFuULsScDJ /Re70XvtGsOHayTMEat3Wug0ZYmpW6viRawc/uYAa8ZCxr0g9h6Zny+N6OD/EZWCyz1G CDB4N3FbQZsOighRD/LmQLQG3g33jn0a3GkY54bkoy6B2KD8VUpeExziEtB7Cdrf0SNC 9oEJ9a5umSP//bXTpGHL5EOuDvJzMYogUrbUYPmXpf6EO7/JNbiftG0vTJST7f71J497 N0vjT0SEQ3ntGASc/R78xhEDmBx6kddHwPBvffBbi3iWYs644/iC9h6UjvCNm2GoFBDf PjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005269; x=1703610069; 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=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; b=bW1Y65SCECURu4e5Hk+Gyu4Qe72iTlumu8XIFwur5D46l4YFU0wj9xUrU3YqNeX/7G r9ioULlKeY/5AtaSQhtkzdXDAzJBtiEW3/bpkndu1NsWYdbA8GgQyBGH7wI7JpDdAv2j KXTWj+lWVXI64WsQ45uonK0hkH/Z3eY/DKHR2QOHV/5lT+Jg32sriJ9LLVSrVCqLgUaX CzEnZScMHhjYXA7W8/QMtFdU61RwHrpC6jSRodQTKCfHQywpIcVBJ+VY7qzNXMW+CTRe E9znlWCIXCEUapxF/1BQyUKBkRZyAFh+shIbS2y9SJ9pD9EFX+RQAs/HN/+QU4XXZLBA bVSg== X-Gm-Message-State: AOJu0Ywh4o0msj5XGWrm1S+alNffA7+NGDrLEC7IKXQ9K221eYWiSOER XzAAPtAltf0vsjZoEqJW3g== X-Received: by 2002:a05:600c:2212:b0:40c:6160:98f7 with SMTP id z18-20020a05600c221200b0040c616098f7mr5158875wml.17.1703005269466; Tue, 19 Dec 2023 09:01:09 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:09 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee , Zheng Yang Subject: [PATCH v3 03/29] drm/rockchip: inno_hdmi: Fix video timing Date: Tue, 19 Dec 2023 18:00:33 +0100 Message-ID: <20231219170100.188800-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730561970953323 X-GMAIL-MSGID: 1785730561970953323 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 changes in v3: - 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 Tue Dec 19 17:00: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: 181104 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2079581dyi; Tue, 19 Dec 2023 09:03:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPkaA6bDYiuyytQO0LUV9ow4ltib/o8wn8t63MuKKDBMXUNkD7gapsQF1aquMgjlYI63QR X-Received: by 2002:a17:902:d184:b0:1d3:e575:4e52 with SMTP id m4-20020a170902d18400b001d3e5754e52mr799492plb.5.1703005395933; Tue, 19 Dec 2023 09:03:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005395; cv=none; d=google.com; s=arc-20160816; b=hVcOLd34rnRrO2UZxnnNJx1MouDcD88IWJzvg1rz7kJLAgy6apxgQxucnteMUwi52K 13uUv+P/x6YaCB6X9JwmtZoUMrmHURgUaIGzWyOzcutqDmMtSmvQyJFMzS+yXBJwk1b4 E6+EfNs7EUxQf3Csf/AKestZnwIeGyiA1O6+us11JUisWbDk7PfQ2VBOGT9v7lWj8eb1 P1junXbNCCBZgfAs+gH8b8hWYbQc96G+vqI2ALXSNNokyYyBcRmQKasoi/sgsLROeo+7 Gg1PmSDdJQatge0gGJ/JakIZ9T98QAI+gga+BLkcq8HhfCGK/cXl7kCr4o0yZ8t6DKLx gCBw== 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=qH39RMJfndGmJ2yo6EAj0TEb5im2nG8g4/g1kbQG1h8=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=q8DbqIxFZu3ISpTatS6cjaPy3WdKxwvaG+Rl59xLBIybMgWN8GbcodwJLuFDw32L9v fdcpIJuDFmwXcxGrJAp6IkyUyE+831aFgjUe9rSON3aeOqXCEi2Ecs7NCdWaAyd0FBd1 Xnk+IXSKMounUdW9jjSE0ys7mGh3biHEQwv0s8rGHxgT8xPbY5IJsXw53bDYKM1eA3xI KpXdvCHmmx6vPFKshkXZpClNV5gqS7Xirn9gfNhxXEgByd8DvX4SJ++4UXQjQ9FW+stA N52drgiDEbTew4IFvqWk83oPsY4QI427dWRWftRztQWmoV5bUQihENoufKxY7KuN21r2 NhJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mZMaMjCZ; spf=pass (google.com: domain of linux-kernel+bounces-5623-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5623-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 c32-20020a634e20000000b005b95ccd1b4dsi19624987pgb.82.2023.12.19.09.03.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:03:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5623-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=mZMaMjCZ; spf=pass (google.com: domain of linux-kernel+bounces-5623-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5623-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 90C36283EA7 for ; Tue, 19 Dec 2023 17:03:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28A5224A17; Tue, 19 Dec 2023 17:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mZMaMjCZ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.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 AC57031A74; Tue, 19 Dec 2023 17:01: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-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40c236624edso52670395e9.1; Tue, 19 Dec 2023 09:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005272; x=1703610072; 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=qH39RMJfndGmJ2yo6EAj0TEb5im2nG8g4/g1kbQG1h8=; b=mZMaMjCZvrsGp5stWFYqLD6tBEGoQjtF5o0m8xa7fWwjseseKxvWUlZCHvl2jXPXEZ ZKLhC0yw2+4FwBgH+MfcLGmcBjxpcslkLQ5V2+AfQ1hUQAIeAn3wtxSArKQcIBQ1ZkMt ARwUAaMiE1vYgbCGMlNmvRYcgL8AB4vLctwbcA/EC5FVbj4BuqByRIvcQPL+iDYN2Lry 6F1s6VmbgPMMMbyFnfsPF5RLxtzQu0Ihu/lN6v5AaMlvN++DU0UixTrRDs8o0AyygCbo iya/vFCFRqRdPZSeE3V+MKrmFaMrQxEO2dBBlhym+/Fj4rkI5HiUtbLbpNXRz6iLmBNz OPNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005272; x=1703610072; 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=qH39RMJfndGmJ2yo6EAj0TEb5im2nG8g4/g1kbQG1h8=; b=idxCJ6Ouos622kj35jcGZQaGYRz9w4x17VMJQJGw7Qz/5Vm9dnBsw6exQnn7XoCecC rT8OKAw1jdOdl1/BUEzi/J2i1qbE7OY0lZ0jStLObDrqso9Uhb8nBXQNEyJgsgryb6Xt +MYQvZ6nhqrfSEoeHo7c6C5GnnVwj0n7Pt+Wd/e7BgFm5zQnNetYKFzYX8arw4A0ip9Y 9OdtIrO70d9ssdtFFZETRszEykm8zSVD6+Be7aQk+D/qKwlYqKWsDt7drd+Mz2wnAIBI B/D5nPV4IMTyJnGecwhIyBSUZqdfTCpQkW8LorCWBlEiLWdniZog7Zhq25RRB08ol43f rimA== X-Gm-Message-State: AOJu0Yw+/1CSPE2GKnFxCj4VFr168M9KbGLK0KrNYJ7BTWraYESGiX5V JVBx5rwUlTwR8guXD7dGlg== X-Received: by 2002:a05:600c:b99:b0:40d:27fb:2f27 with SMTP id fl25-20020a05600c0b9900b0040d27fb2f27mr601599wmb.111.1703005271769; Tue, 19 Dec 2023 09:01:11 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:11 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 05/29] drm/rockchip: inno_hdmi: Remove useless copy of drm_display_mode Date: Tue, 19 Dec 2023 18:00:35 +0100 Message-ID: <20231219170100.188800-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730585788374103 X-GMAIL-MSGID: 1785730585788374103 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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 Tue Dec 19 17:00: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: 181105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2079830dyi; Tue, 19 Dec 2023 09:03:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/1oYiG6Ekt8SLzuhXYEWd2llZrXN3+V17PCzsE+zzGGsloIq1ZwMKqt0S+Kbq69tj5IlV X-Received: by 2002:aa7:87d7:0:b0:6d6:d7f7:d016 with SMTP id i23-20020aa787d7000000b006d6d7f7d016mr2328034pfo.4.1703005413343; Tue, 19 Dec 2023 09:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005413; cv=none; d=google.com; s=arc-20160816; b=srKHX//UkIY0QslksKDqRqjSf8TXQx4KP9SpwSxtaTtUOLUv6vSLtzCiL7gWrbVyyh IKh/duKDQAzYLdlyWJ7HqxOfUVpsCSxjJs/baL1P212Z6JePJcl7y608+DLSPp32Cx7i NFaIsspkuE++ogl14f1cFxnzlqoESiPz820/Dv8jrEmpzak6n3e8Vk3zIkrzM3K1xNn6 r9DkY43v5P+BG3VFsHNJfBcUUTYH5AFvd1M2dRVJGlmNpopNWm57iLVGLt8yjvmeeKER EBCS+uSCo+BHYcKePf8qq1EYEOIRQQy4KINaKEXKczkjx+pnXV95J/lizBGPOvseNiVQ u4dA== 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=RIgfmp308cBqMuCcRmTUeRZ4zCPkbcPIGR4mbqru0jg=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=r/Ego/YBLtZIyFkQ65lcXREwS0U/T4s6htlbvxJxKSVWCKggHom1q6kOjsjf+bK3/T 0C+Mbhwxj+fX0YkgkEoEYqgnPppRsCFPAgVuOZeziAE8KvBy1oUbr6n8Mrm0NDtL/rnp GCqn4IkAEIG628pGcAlzXx993Ex8mMd5aqAiLnXkql4C2JdTH21gTBUgxWxOZfoEogwR sHuKwvqPHnUdjp27kalGG6vSs+eEwKkjhixJR074qag4YbhHJ9oREr16327DOd11ovPY WKcf6PPpyt08zIyRhdY0HBIJVQKi36hJ1AglRY7XQs34kqdoc1uyLXd2eRAMs/tynRUo CPdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HPQJhtNY; spf=pass (google.com: domain of linux-kernel+bounces-5624-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5624-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 h5-20020a62b405000000b00690f9e835d8si19682099pfn.132.2023.12.19.09.03.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:03:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5624-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=HPQJhtNY; spf=pass (google.com: domain of linux-kernel+bounces-5624-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5624-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 D807B283EA7 for ; Tue, 19 Dec 2023 17:03:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE58D37D2A; Tue, 19 Dec 2023 17:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HPQJhtNY" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DE8D23761; Tue, 19 Dec 2023 17:01: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-f46.google.com with SMTP id 5b1f17b1804b1-40c3f68b69aso45412815e9.1; Tue, 19 Dec 2023 09:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005272; x=1703610072; 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=RIgfmp308cBqMuCcRmTUeRZ4zCPkbcPIGR4mbqru0jg=; b=HPQJhtNYrcGFiWNPTnSDajoC0fLio4HfJH+Kgtq+sxm5amV0Cu2TdFGLw/pie9tDQt lC+gUSrkzA/EbqfhFYqkcH/9fclCnGp0cip4h6nn5VDnwASZ/BK5ItKZZ+Rh3PUQ0sGi Unu5VzXKOcIMHno7TcfJjSCdliEmrCtDui23JCkR8YTzpiyhtb0IYWLtxuuQYkFVnyT3 ja4wO+F94HTidSVZ7B4xGzc9KDv7aZ5Ro3/eOM0E4YkQTKpb5e6qXO8T6n/k6dK7PYqj wXLeRfY3uvKQfs4Am9GLaAv5S1+Zdbf0hzRQZYDPTsjsFZ7k9dm8eewR+psXaP2CISve WLxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005272; x=1703610072; 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=RIgfmp308cBqMuCcRmTUeRZ4zCPkbcPIGR4mbqru0jg=; b=gpp9zw/s6jiFbFlIwec5UzlaZ+PEL00LUGAzwl/uWMj138La2LCQXiAKGfzI1nZ4iC DKDO/JS2MfZLjAbZDyOekLJqn/AnGxMd8ycFx3T065HZOoFp6oH09A3DWYtoqt3WjBGU EM8qUvKE9Pkmshysy4XZ9oDm0BLNNAPkaqgIAjhUIVNN+REJXgDSzpn9goCJFRycMqKl cvOSjUuZdeAVxbudC6UNdd3Jx2/9A/4kBNaM1HDmg1nu937Xelno3T65F4+YnYt32cwo o5HnEhQQXZxUuJKzPk146CEE83L4eoB7Oobm9JJPwF5hXUCiLPo2BVZc2Ms+oc6aDjZz 1uCw== X-Gm-Message-State: AOJu0YxGlBBwFZAswu/RFxhXX9y7VkdMedISh8bK3yQH/IS5z/qTfXZe Jb/P8ssRUJ7jNtbp8SRWrg== X-Received: by 2002:a7b:c7ca:0:b0:40b:5e1b:54ac with SMTP id z10-20020a7bc7ca000000b0040b5e1b54acmr11372528wmk.56.1703005272560; Tue, 19 Dec 2023 09:01:12 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:12 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 06/29] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic Date: Tue, 19 Dec 2023 18:00:36 +0100 Message-ID: <20231219170100.188800-7-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730604220011533 X-GMAIL-MSGID: 1785730604220011533 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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 Tue Dec 19 17:00: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: 181109 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2081400dyi; Tue, 19 Dec 2023 09:05:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmacROXEwMG6/AtFaxArUdysL3FAcfxFstgV7/cf3ZeInb25bK20xAyWtGr7KEgzsytqWE X-Received: by 2002:a05:6358:c12f:b0:170:79b1:bda0 with SMTP id fh47-20020a056358c12f00b0017079b1bda0mr9203862rwb.56.1703005511359; Tue, 19 Dec 2023 09:05:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005511; cv=none; d=google.com; s=arc-20160816; b=k7NI+hUHN9yK/9oRpntgcCk/QcPx0uEL+5EKHf1jbCDiSu+O53cR/fSFxHAd9TV4e6 pxCPvBpulpA9+EmIga9C7gh12fGsiUlEE+ZEIomsiPUrI4cvC2zcd2hFjiXEH/UGX1V8 TXNBwyixMCsawPdI8Emy3NjPIGejjXR60LJ+uWSFRlZyn1J30oY3Jh6CJQ3+q+KBZvf5 dt/OfCA71xk4ahuUSJZDiqIpJws0/nPCrFzah/dBqXzdAvgqwjhhCWVDpiy91KJti4em HzVPRQjzkKsVtNIgEICU/5pZ2kCztBsGD0SpYvxY7kSYvFSJfYnkUHWT1juc8UkvcerX 9YGA== 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=15Kg5P/kPo3OprJxF+EVJ+2okgIdyNf3FbH+CrQD8yI=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=1BiPcpECxX3VSvfYEJN4TmKixMKqi2uvREUo/J/GOJkrDsh++c49xtyJ3ihsQHFRu3 G/v67e1P4RhZg4QsZGKV4OpJ6tsmcmpPmA0Inp7lpO+tMgh+d/cvgyrZGvJXePMgQ/W2 NNYAaeMxG1sKVcdcTkI1cbroW2AhjKpKpQIvXfAILz4M7BIYk7i/P/sWr5ozkz/DwCnw ++MZ4y+RmkmnDaM2ljgcPTiiqJGZGV+z+foN5DwUBI28aPp/iRieomidTpWGOVl2FC0/ EsoV5PFgGqWyayNFPLPS8hmttmV9PvwKIKw2IExh0e7Dk5djrlRivvOjLdWJsxrcigxC CIhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FRUDjZDE; spf=pass (google.com: domain of linux-kernel+bounces-5625-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5625-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 u17-20020a631411000000b00585999a38a6si19382768pgl.793.2023.12.19.09.05.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:05:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5625-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=FRUDjZDE; spf=pass (google.com: domain of linux-kernel+bounces-5625-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5625-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 87D04B213D8 for ; Tue, 19 Dec 2023 17:03:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C18DB381B2; Tue, 19 Dec 2023 17:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FRUDjZDE" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 447FF2EB12; Tue, 19 Dec 2023 17:01: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-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40c48d7a7a7so45243185e9.3; Tue, 19 Dec 2023 09:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005273; x=1703610073; 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=15Kg5P/kPo3OprJxF+EVJ+2okgIdyNf3FbH+CrQD8yI=; b=FRUDjZDEjovrt1xIwCkp1lRhmHoMSPGZU//xVVN1+F6q6/7pAAeI7hrSnm02XyBrK0 Z36CquvYkTyWVkss8GI4rGm0s0eppPZlxGfj0PBGBG8cp9MmFgL2UlS+WpJHeML2i75E cNQHEMAqQ/DoJ1t6LOFzGej1tG9Hyml2+YsYpb10vupiSbauB+P57Ryn6H5QpFS9tw+1 uMa6oAsZVPVq23YceEg5wBCVH+asJp9xDFCutCUTTEfE4VRzg9ciIE9GZzS/Qm9m2g5v RAHJd9jN5MGCXU8ua4LuKkwet2IGuFrsbp43zCLGSS99RkwauaMbMIbV9VyB9zhqxQl5 PpPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005273; x=1703610073; 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=15Kg5P/kPo3OprJxF+EVJ+2okgIdyNf3FbH+CrQD8yI=; b=h9hT6dJso3UJ22WEtvdVcqYvVcAdDfPD44zgcZ5RBZBwsGXnAhcFGM8nEGApF56S9V PLyxD4W0RtZJBvBV33fA3UXI6GQcnjyhEAGh25yUEE6CY9NKS8ZU3ez6DsWaw6GL+znJ nEynQ+JKrQvFHJnJ2faddLtOeCZ8QB9BQh2/g6sUaV9oYfS/bS4MRsj8tB9yrmCWzApn Iky68eYuy3IAXDv+0RIyhY2WifVs+x6VwyyblqCjB0Z1zlGKyn+R/+Q4expTgy0x/vVw BLZyCnZjneBQmZFk7DxcahMYwtJtdnylgcIl0HInb696u3QGCVoQkwthpvqeEVVfrCcF hcYw== X-Gm-Message-State: AOJu0YzaifUs/iBr9K8wzpX/1rOU5sN+yGxqPBvN3wzDDPFNfkpFI3u4 ZfGO6t+6ymuiTiS1pLKr/g== X-Received: by 2002:a05:600c:4595:b0:40d:129f:d59c with SMTP id r21-20020a05600c459500b0040d129fd59cmr3033478wmo.79.1703005273480; Tue, 19 Dec 2023 09:01:13 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:13 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 07/29] drm/rockchip: inno_hdmi: Get rid of mode_set Date: Tue, 19 Dec 2023 18:00:37 +0100 Message-ID: <20231219170100.188800-8-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730707341836703 X-GMAIL-MSGID: 1785730707341836703 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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 Tue Dec 19 17:00: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: 181106 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2080677dyi; Tue, 19 Dec 2023 09:04:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaw3z/YL8sw3ng1XZ5Vqe0ZTyXxuv6slu9Eze1gpGa/T00SzikTJQdvGC74kQOOvXI6xiM X-Received: by 2002:a05:6358:9486:b0:170:f38b:dc14 with SMTP id i6-20020a056358948600b00170f38bdc14mr14775429rwb.11.1703005464529; Tue, 19 Dec 2023 09:04:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005464; cv=none; d=google.com; s=arc-20160816; b=Lh0b149hkqccv5qoOhSSYKfqGcr4T5QfhJ8jUhiqBvvfsFBBUNDvXfpmaYrheQt1eR 4xZeF+Kx67K2QeA6fmnLqk9yQ07e2U8GZXGKV6VPLX0lBkX5ak2kOtm88OjerAqOB/0v axO9IapKP24IyrlMhCyz6ZPnP+ZhwlL7AAFVLnEhnZao5bjEqWTzHOOqh0W1+x4TYwhe rUn5Jz8xMABfZZsv77DXrhl40luR7sa306MGO0MRIt7AjDFbBKFUBGvt8k+kgapkPmkf cdiWOFX43qgEsdt6T+uu5vAoDK8JRJ1QTbxviQFto5LUWyl5EV/TOK42Yjv6Ws/sQxnA ukgg== 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=VvJhWTUaZ1kAS2FjYOCcewK/+2L6xqjKsMInEMuEacc=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=OYRvBowX/kfeFNKp8zaAmxNqYXdHVvUC9AUUwIJAUEtG77xzs2nCi343wsxGuRUoh7 i1P6BH44I0hEdnvm2nIEkc5R9t1rckHJtTDeoINjMgMNiCG81/6bQpYdmIh1AyiGxbeZ lbAhICjmOlr4CtLgbfPXBSeDImxVv8fml7NQbc9jfsyABDWQWUYzdUdJ8WwcUlvcPF3l eZNtYCMduQYy4ncbb6jeeD3+QANHXl4bVx4AXzl/Qp9p2ouYa4Y9soY5R9KI6XyC9du8 mfEEXBzKls4TpsITXE9/7+lbptg8RnmtpC2oq420RcWg8Cta987+oDhphZncugimpxoS PFAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YUZZgW+A; spf=pass (google.com: domain of linux-kernel+bounces-5626-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5626-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 k7-20020a63d847000000b005bd70a177a3si19185632pgj.876.2023.12.19.09.04.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:04:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5626-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=YUZZgW+A; spf=pass (google.com: domain of linux-kernel+bounces-5626-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5626-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 0D408285D48 for ; Tue, 19 Dec 2023 17:04:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D20839842; Tue, 19 Dec 2023 17:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YUZZgW+A" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 8054536B09; Tue, 19 Dec 2023 17:01: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-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40c2bb872e2so54679255e9.3; Tue, 19 Dec 2023 09:01:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005275; x=1703610075; 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=VvJhWTUaZ1kAS2FjYOCcewK/+2L6xqjKsMInEMuEacc=; b=YUZZgW+ACrnUlHzbpSAvOAbc6Rf3T92GNxJ6eikJLhAFB2OjIX4NrIcZUpiMMNt8iW e/9j0aeOdiUJagwZ5WplDvDkYO5LZ0CY45VY9Mzhru9UFCMLAR14a1UZ8IvVgW2w6ygY FYS1Naa3VgWrtYbwAncEO6Ue20lGe9VqEoaaNYi/um8XJoE6Fvbq4rGXL/ZpQDihLiyM e4RdBPFY5iL8v9dH7mubknAgBQLB0+CjmNkEybI7QG9dlvMXVgrD7zXBJ/uZA5ynooUz RB18d425ZynI01LbeFzELVcUqvUqQ3rWlACK46w3vTFLplUr7fVkqgA7lSTFDAw9Qffs y5vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005275; x=1703610075; 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=VvJhWTUaZ1kAS2FjYOCcewK/+2L6xqjKsMInEMuEacc=; b=B2ywCuxCF7zviMwzvopm7U1Rn5pPh8sl/hLjppr4NH87Ml/jEB1KjG/dHBbSOplLGs 89/BJUiBHJ6uz7I/ETIeibmN3XMRY918jPvIhbzdQsbPvT6FziPzZEClHhWzaQvMAJaJ 1ZLzQQ85JGB859ud8WWMAhKCZp/fPrS/f3S2tQARQOWhVpx5TKwrzQ1HZP/SnPhE2Mhs oFgkEaXXhg1uMT9Xs3usd7MKpyJr5pS5DZkwVTu8FdkuYWhHjXGyakdSdfMnmWlKjkCo nzvUGBpC/crvCxKOypaG+Ul5b+3LBmLijLkQnsNvtwQlYyC5XqbpbirJ/0OstEWl5h3R FKEw== X-Gm-Message-State: AOJu0Yy/Q5pBXRLma0G0WE82mRROd7m4Fx3KR7M5B6HlyOBUnAbda9X0 q75uvmMsNwJjtZgmnUnxFA== X-Received: by 2002:a7b:ce8f:0:b0:40c:2205:e5f6 with SMTP id q15-20020a7bce8f000000b0040c2205e5f6mr5185131wmj.293.1703005274526; Tue, 19 Dec 2023 09:01:14 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:14 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 08/29] drm/rockchip: inno_hdmi: no need to store vic Date: Tue, 19 Dec 2023 18:00:38 +0100 Message-ID: <20231219170100.188800-9-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730657684342507 X-GMAIL-MSGID: 1785730657684342507 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 Tested-by: Alex Bee [made checkpatch happy] Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - none 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 Tue Dec 19 17:00:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181107 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2080803dyi; Tue, 19 Dec 2023 09:04:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdGnnFeCjnpzI33X6KQzxneCiPZWUuDqqRT9nnvFDlLWoYtds/rP8hIPz8T8dJ2+vx1Tn3 X-Received: by 2002:a17:90b:1113:b0:286:6cc1:289 with SMTP id gi19-20020a17090b111300b002866cc10289mr8410111pjb.84.1703005475200; Tue, 19 Dec 2023 09:04:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005475; cv=none; d=google.com; s=arc-20160816; b=cYeeuP92Q9L2AQxPWhJ+yvjpCo6Q7l+P5mpgG9uKbaeCSSRdI5eKuEc83fYQ7y7i0s DVfXokpXN7W4pnY+QIo+mX9rzsbhYS/8if8eCYX+y4hJ6hbqu9kdkaoxcBZZWlk6Ky1I AK4JXAfQZ7EHLEB2LBMtzVtPQjE5lMV4A4dvoeaTRdWG6LZYJhq+LIhPEG7X3/9umJb2 7zfJTnsWUcoXuxC5ohRPbSd1IoqTB14Isejib13lV1s0vflCp3zxyH+6eO8sX878poYx Ab6tfUkEGbtmksKaSyS1Ai76Q0XEc7B0xRG6Pr/G5CLLdpPDVI5ONtGHzqDOsqvqarnC q+CQ== 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=SMIbD+dY7Kjgg6ECXdMxWD6N2Rzqy4kZE/eQIX1m8rA=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=fNzow6Xx72zCgy75MFrpVNMGkZLNDIPm0sHYBa8tp+d5gzxk7KavHwn/bbZRREeCX9 fy0Qh3yasn3TMDcItTgb3drSVWXsFE5ENUca2A0YDYErXQyO7NSpNSf4rHvoS4BOFsNg MrI9k6RxZPgxXnli5489YoJAUKvkAYEElYPFaQvjhgoJciaPRJ73wU1z2EZkqmGob8FD hR/3PBehewfSw+2DXIe6kDFlwLFItCIGU37+2ki+/NFYTrDHrcTkdTOEruvLmiK1hl9w xYk4vWY/E40MHVbaVu9xcUjqF+p2gf3lR9rhGdaDso94sOXDj19SDmTljqMQE444dfRY GiLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=N2wiOP4l; spf=pass (google.com: domain of linux-kernel+bounces-5627-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5627-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 h20-20020a17090acf1400b0028bbbc85937si1422244pju.22.2023.12.19.09.04.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:04:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5627-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=N2wiOP4l; spf=pass (google.com: domain of linux-kernel+bounces-5627-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5627-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 BBFCD2837AE for ; Tue, 19 Dec 2023 17:04:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5C2B39879; Tue, 19 Dec 2023 17:01:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N2wiOP4l" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.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 43CC7374D6; Tue, 19 Dec 2023 17:01: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-f53.google.com with SMTP id 5b1f17b1804b1-40d2e56f3a6so2740315e9.1; Tue, 19 Dec 2023 09:01:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005275; x=1703610075; 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=SMIbD+dY7Kjgg6ECXdMxWD6N2Rzqy4kZE/eQIX1m8rA=; b=N2wiOP4l4aUAfqAZSwo1LPcCMf/dqsKI0fl+SYWpkz1g2kKsWeebO9pL/F51Jjqg1t y41X7SZ57umzATIaH0/DbUjRBXtIrzDVjAeS2qsPmaA532HVE28m/Ix1ue/gOo9S/5Gz UlH/yNtPMxLQRGC2Vp2LtCKvo2sS3ZN+HlzaUv3FNkb3bSRA9jtyr1geRyNPyPZviD6L WIrUdxBbBvXeKRYAgQCOUPemBgSlqPuALFeruMxQ95CRtI4k/P4ZFewiCztReV5tXLmE +djTloKC7PrCypugqLbbAt2fGBu4RbEb9IIsPgX2laGn2a6eodk0N2VQsi73GaDRs9rg rugQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005275; x=1703610075; 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=SMIbD+dY7Kjgg6ECXdMxWD6N2Rzqy4kZE/eQIX1m8rA=; b=VnU3bkYRxOu+XCTEWn24Blz71ghYyL38KlyMlFe9IFYGO9NLBhKC7Ee6YWlP83gNcM 5tOyckJdG4YtHCQLyQJ6epdxJ0dMZX1XSmOV4m2QumyIrErDHuFDZ++5F1VlXy+57o9L ajDuE0rYI0gWxpHfslJbpFYWMc/KqmZlevUE/MPPoq3Gc6JblnvoUhCoEdUfTH7mnm9k WaHUYLrBLPGi91GXsQWqSm/fp4LNjHaF3PhOToEmGjLiFSNbo8ieksmkivCnevulLAwx YguZnBaCQVyWQbvq2benbirqafcFf+hxZoTY90pR6YGdpPbAlsuVrTM7VFdtUzLvwYvG DyMg== X-Gm-Message-State: AOJu0Yx2C2cU94CMzycf0gIHvi6RixRiTmwycOYu21CM84bbcR+7t8rF Bp89WllE6d05LjI1ksFp9V/jcE51yA== X-Received: by 2002:a05:600c:6988:b0:40b:5e4a:233e with SMTP id fp8-20020a05600c698800b0040b5e4a233emr768909wmb.64.1703005275517; Tue, 19 Dec 2023 09:01:15 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:15 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 09/29] drm/rockchip: inno_hdmi: Remove unneeded has audio flag Date: Tue, 19 Dec 2023 18:00:39 +0100 Message-ID: <20231219170100.188800-10-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730668797117185 X-GMAIL-MSGID: 1785730668797117185 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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 Tue Dec 19 17:00:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181108 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2081116dyi; Tue, 19 Dec 2023 09:04:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGbLPGghyA2llk+rdMEWJHPM0LR9SssxYNkwSt7clykUdB//wqC/Q5mmGBtMaavwdEI1A6 X-Received: by 2002:a17:90a:880e:b0:286:9b25:1c66 with SMTP id s14-20020a17090a880e00b002869b251c66mr13608845pjn.24.1703005495248; Tue, 19 Dec 2023 09:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005495; cv=none; d=google.com; s=arc-20160816; b=XmIA4+ifnvBYjgX8mg0qoZ1C15IFqH8kQ3c760IJ+3UNI7JFd/I1kbJcOA0RG+YOAG 5jyeRz+Mr6TB6xvQrngGZclN5smPZfUr7deBwIc1zry5nkYnB/f4qxDCLqrIIg8TIOb1 j+d8yNX3PlQAxzgYz0JcHnnrEDUFpFKKpUnXK+PO/LwKLi3Gddsar/4w2WWOnXwb4aNx BD55mWHUZY6UVRaNrx5OwbgiaE0TuY2dhSe/gYenGtCMv0tyCeoaEtx6D3chHvQr3Bbw tymV1Y4C5Xv0ogpVFt2hKV0QNWT/Kfk5hftr7tqXnPUb/Nu/FqD2Ruf3BQIjMVJCochc cJ1w== 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=iFJnc/mxwT7AOuXgJJftqh12jwZWWgTZW7pO4s+kLaU=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=MNfwp/Viwn8FsMQ2wJBvb6bz9Up4T1wh4XJuG+p+31Pp5HyC6PGGhJqvgL+T7otUN2 IRRH2edUsmKudo+EyZnBWpaWxCvHHB8Ay7f3cdVDyWd4Ejg1Y8wHh1e56XvnlZKnPWTw 1d4wS7kLXHDMrzLAEP662AO/p5yoizXK1rZSZfiohaEU/MJsDbuiVrtvjC4HzHB/PUa+ QCuCq0Bksv3sQujLfuDkxUDaBHiXVH9koVnctTp6SNi1a/Gbn987/ICqPVAeUR+4KdTq +DIflz/gpV8/4UNfk66Yg65inRv34pJ/esZmczV70YjwS13pwhP0w7gsbw9QAFd8BV+U WtHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XHxo+8Lf; spf=pass (google.com: domain of linux-kernel+bounces-5628-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5628-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 e9-20020aa78c49000000b006d6b2cfe4d5si4121035pfd.279.2023.12.19.09.04.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:04:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5628-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=XHxo+8Lf; spf=pass (google.com: domain of linux-kernel+bounces-5628-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5628-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 DF09B2809A7 for ; Tue, 19 Dec 2023 17:04:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 318F939AF0; Tue, 19 Dec 2023 17:01:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XHxo+8Lf" 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 3B0553786D; Tue, 19 Dec 2023 17:01: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-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40c517d0de5so51733575e9.0; Tue, 19 Dec 2023 09:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005276; x=1703610076; 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=iFJnc/mxwT7AOuXgJJftqh12jwZWWgTZW7pO4s+kLaU=; b=XHxo+8LftE011jjBYKpPYPoBCfsLydq5UUstv9tpuHJr3kXNzz8Il7HsPZR25u6vQ+ t5dInGxo6gh7CWdEF1PmjWWTfOXRPBd9DXemqDxpZBIllkSfalOQQmCG0KcOQA6Jy0E4 tLDq9Y6ptRILFJu6iJQaCooZja56ImWAYsSc9DPY9lsjrDRf8HM7hfaXoS+lb5jf0Ijr beIDyPvCNnXkOzw00xzyhl0J4h4SEcPQrPtVUI6viB28LSIlR0cOkbXTQeZSYttGCqIA AJ0miV9L7ONMbDOK3qFpbDSfhT/hoeYc5884bup5zZf3g7mHgqGXG3BnU71B5xTNaJmv zK8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005276; x=1703610076; 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=iFJnc/mxwT7AOuXgJJftqh12jwZWWgTZW7pO4s+kLaU=; b=JQ5uthhCWrXTHbudElQI70dgaAwQ7+VVPdICyrn83Kl9rwI4tj44XUG2kWx+rTqYEl VTGCZypDGuBRNPa88Q2lUJSrl2pVodLAH6ebKVVAF9f0f/AZFiywYOB13E/uFHbgBOdy NGq8iszCIaKYl2hMEgOU1F7kI4X5biYGJ3xPewlNuL3CK87AQ0YJCMSsT/i1WLyq6/um 8aewBxZD5pg3907tDBMpjblgSgGckRFhR6WOwhEMW6RnvhOR+Q1sGEiTOkBUWStOoPxn BWKYpZlvrGBy1junyF2N5M/lzeZ+KrGGSi1V7gp/Rl2RjE9HBsy9huSisaZXEJQdVbaS pJ2w== X-Gm-Message-State: AOJu0YxIpFWPV3XTGO/fAnetbQsIR2Gyko0XWfagFEzjH01XJNpOMbPA UYtbHylXDt2NoUxhp+2DRw== X-Received: by 2002:a7b:cbd1:0:b0:40c:32b6:866c with SMTP id n17-20020a7bcbd1000000b0040c32b6866cmr10082301wmi.68.1703005276391; Tue, 19 Dec 2023 09:01:16 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:16 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 10/29] drm/rockchip: inno_hdmi: Remove useless input format Date: Tue, 19 Dec 2023 18:00:40 +0100 Message-ID: <20231219170100.188800-11-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730689899134402 X-GMAIL-MSGID: 1785730689899134402 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 Tested-by: Alex Bee [made checkpatch happy] Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - none 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 Tue Dec 19 17:00:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181126 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2086705dyi; Tue, 19 Dec 2023 09:11:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHahnj0+mmowUxrR9BnM0Idl+93nJjEIjkXdvqD3kQm1AKHrJHRFzoAuQVa7QzyOgBINqtk X-Received: by 2002:a17:906:530b:b0:a23:7364:a3e8 with SMTP id h11-20020a170906530b00b00a237364a3e8mr641595ejo.157.1703005882478; Tue, 19 Dec 2023 09:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005882; cv=none; d=google.com; s=arc-20160816; b=id8UWYZFbcmig8QiPbGGM6RaXOJ/oe45pWO9DQtQxtRnc+v7wosL4f5XH+dehUla35 5fUO05gVf1A3mg3iLMvVX1m6fT7f8426+YX8idacuJybak1dWWv0v+Th0uleQ5rUbUE8 8a2b+EuEmy8OxwLSwxNVyCZiIUptAfsm8illaYoXD5YszcoItXxJXV1oBoR4/NcUGOvq sb/F7ABPNkeaBSv9mjcdF3K5eBBsDI5jCWVVAgDNKC1psvg68uV3pzcknQR9vzrPC7SJ bgdh5jOIkOi+sR7BFx9sCgaMmx1us8dpHNDonoQ5GkNXMHnenHAf6ns6zEM8UP85aQR1 qHEw== 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=Vfw1A5kPCqeEpvkS0qSDCc84V56+/woGo5pclCQd9uw=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=Ytie0qzWr7c9VKr+yBoYwjg97ZtEUNGRtyBBRap2NFekf6Y266birQ+k5+e+2uY9J1 5LpP96uiGZVs7BXTU8PXPM3ApqxRbZmP1aX75aAAhcjY+vNffowyO2+gLPY69Dyvc08X wwJtIRiWMs+ro2jctFOrmmKKvpjHbAPTw6TnWw7oZ4/ZVyfT5yl+vGwj+zC0wiRH8kYM 6u4CpBEYKIaJ6Kpv9bTAeWb8CjAsfIRKvkO4qzM6ctSa+fCUJq2LdvDVbU6xj5fMdQ88 qSeV15nd8og8QEYEZaHNx/zBQWlyQzvfR0fF/N+tcviLZJcY+eXeojVac2lQxgSRawTf uw6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mqk8Zjok; spf=pass (google.com: domain of linux-kernel+bounces-5629-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5629-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. [147.75.80.249]) by mx.google.com with ESMTPS id gx15-20020a170906f1cf00b00a236051750fsi1556024ejb.547.2023.12.19.09.11.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:11:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5629-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mqk8Zjok; spf=pass (google.com: domain of linux-kernel+bounces-5629-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5629-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 B52B81F28865 for ; Tue, 19 Dec 2023 17:05:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F46C39AFE; Tue, 19 Dec 2023 17:01:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mqk8Zjok" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D530837D27; Tue, 19 Dec 2023 17:01: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-wr1-f46.google.com with SMTP id ffacd0b85a97d-3367601a301so577366f8f.2; Tue, 19 Dec 2023 09:01:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005277; x=1703610077; 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=Vfw1A5kPCqeEpvkS0qSDCc84V56+/woGo5pclCQd9uw=; b=mqk8ZjokHBOmxIt8RKtFh7E76Fwny4r3nE8piPw2oCUKFxphSWbN/a0IQQC9n8t5Ie Sve05zS3Iq6tgQmp0q4rcjHGCjoAUribwz3IeF20VcryMs3CN9XL65Cbp5omgQC7gUVN iOV5MrF6CMwfCODHZHalExoJaUojYYMCQKq6crkeKcNL61HloFdDZaFDEOwZd52XbbIt oR3ve0QzjiLT5KMNagdgP8B6MBkiIPqCauR8HGHY2PLaPeyKQKvWXGnjm2t6tG2PxrJV hfeuxRsu3GRwHRmlralsbsUwT0wEKRnBIdP1qzmQZk7iXQiRZOpHR3Fg9pWzgM2eWA2T jiMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005277; x=1703610077; 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=Vfw1A5kPCqeEpvkS0qSDCc84V56+/woGo5pclCQd9uw=; b=krif/+lkD5hw9rPqvJDWaD+j+VQeLHJfD5Mp/pFfwrjQjBee4+65cJjVMxQ3VCBl4I +APRJpUkYebiq4LQtKq8PE363GwWBF4h31Hk/WuxxlIvs0Cuwe1gIDTr9Xpvh0Uz46QP ByhyN6Odzw4hk3ezTd/7Mvc83ywfXL5vRB2xg5CsLnajo2BWmkrcYbL58rr9z8PsPbbw RWX2EPQDUdgYVABxbsSRsCnYuJeKpduZ9Zq2yzZNyhFJF6cS2oPcEvZhsc2FCTC5sQuI rTDtft7lNyf2ycwcHMbx2fyGGAC7a88DxwMKI0dFZpYl5mEK0R1w/VCkIsOxTa+Y7riK Uayg== X-Gm-Message-State: AOJu0Yxyv4WW7bUWDaMgjku4uuJADaqy8BLFtlutOFOZPqH198Ue5ldM etj4A3vdK0vW8TMC2dSRKA== X-Received: by 2002:a05:600c:5115:b0:40c:6924:5172 with SMTP id o21-20020a05600c511500b0040c69245172mr3185004wms.92.1703005277195; Tue, 19 Dec 2023 09:01:17 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:16 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 11/29] drm/rockchip: inno_hdmi: Remove YUV-based csc coefficents Date: Tue, 19 Dec 2023 18:00:41 +0100 Message-ID: <20231219170100.188800-12-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785731096221343925 X-GMAIL-MSGID: 1785731096221343925 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 changes in v3: - none 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 Tue Dec 19 17:00:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2081671dyi; Tue, 19 Dec 2023 09:05:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0Yvnm5DZTFD32h3i4WoOZF0CY4+qSf0VQTJ//2YEZm3Fr2HbxxjQqoG2LQUa+1REmsG/y X-Received: by 2002:a50:8a86:0:b0:553:33b6:36d9 with SMTP id j6-20020a508a86000000b0055333b636d9mr2706769edj.51.1703005533883; Tue, 19 Dec 2023 09:05:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005533; cv=none; d=google.com; s=arc-20160816; b=tarDxeoTzQXaq/oIVRT4rrEvC2JJ2FgSls8cp37HYdtbETXO56z7jEUMY2PMuv+V7W DgU5tvRQeU9c8IUmUhNRp3qbnvzbsPvnDZatYmzpTefGy9fi2EN6jjDWzefZHge1kF+g LqqyuD6c+A9edC/U5OoYBUoHAykHBEDbucbhPEfz/M5H6llZyXv/JcFrh+e0oFq009mR dzKrudRn3cDykk21el/1MOLS2NTA9CmrcWFleyhoPZmpoE9Jm8t0w9xaJyQbu9TLn+2m YlJtr16lvkP5RNXXwhD1umqr/ZvKVew6BSeze7hbFlLIZVBqwu4qUK1TiMy0rPWnoeAl u3dQ== 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=pIuIHzK0qm/T7D2HzJVN2+t1kaAcSj5o4LHFrFwAH3M=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=UdbLKUBQ7rfHPXF1zNzOOhrQdhq4fAp4HCTZa04Aewl8VzVTI+GfjurNJsiaJb+Nth vQ5fYo6826Yb5ZkPdud7Rjq5rVsu6L4qT9ES8tM0C2ww+WqZynC8wew++Ih6+uDv5VFv 4k7OE0ojN+EpHYNk2tF3YKhsG+dwRQkDluB5nYbI/FA6y245F19bOohoCAOb/dx7dlhW JLV1Fq+YswyIO6l6DRzUmqN3cEaWtrVIgfpZwrv1MPORqSmpOImlAj690zpQEokJqpJl MI/fllWz0PLlSSqLTss+BwT2t2J8i9QcPYGCLYxnrgQ21YqPmlc60Skufxshy8/ad+2c DaFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="P1ibjq/R"; spf=pass (google.com: domain of linux-kernel+bounces-5630-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5630-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 b6-20020a056402350600b0054c943a07c4si11641397edd.394.2023.12.19.09.05.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:05:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5630-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="P1ibjq/R"; spf=pass (google.com: domain of linux-kernel+bounces-5630-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5630-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 755B51F28907 for ; Tue, 19 Dec 2023 17:05:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53BB43B287; Tue, 19 Dec 2023 17:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P1ibjq/R" 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 A96C3381A9; Tue, 19 Dec 2023 17:01: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-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40c6a71e88cso60302615e9.0; Tue, 19 Dec 2023 09:01:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005278; x=1703610078; 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=pIuIHzK0qm/T7D2HzJVN2+t1kaAcSj5o4LHFrFwAH3M=; b=P1ibjq/R21sfJDyK+rfVUceom9FZBEnr5vIe7SF41/ZXhbT6VCiifAgRVvMtJGxqxb mw4IhoZEixJ9XrUaCTDWD9EBg617sz0rPRvbwI4CBYfs18YjcXaZ76G4C6o781j/O5qz 7kBrW4B0a8aWBXNBxIfQXRR38cLWUmzxrhv9H90u4WJ/aima1y+C7vVEpDSGQsBdzSV+ ihDQkEBMVykNazRUrst6svrr/vMN5XXlBXSZb6UXJi4PFj+q7P5WZgcotujijyXwW8EV DNYtbi7dp6bKxhWKuHCkBsvwG8aSLvyePabn+bV6Uzn2OJNZBzVQRzZt1TMJsSkZy0e0 N+Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005278; x=1703610078; 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=pIuIHzK0qm/T7D2HzJVN2+t1kaAcSj5o4LHFrFwAH3M=; b=mPJLljKL/qnp5gVwUBWuFWqg1N9Wn9bdC3T40XzFrdwO1encbtqDP2creb779Qaq/5 QrFow4kZdOTpKc2MeoVeRK9bBGQlqQPs6HnYYwdPwPCkzB7uEZjTl3+lKpC3uuwY3U24 rjL4IIgiw6OfXOUXBumzTRaJE3r1Y/tzw6RcOvcdHhqx0Z/bItuh8QW4IT2+xnlg3OX9 b9nTBarpOcgcM6cfO49Kym1Fk5esoEMi5eEH6jOXmZdaj3FaxvphKcYg+NA2BRIieJt8 D0X/4mO/QyFvwS158fKY+qSKNW1FGy6AOb5mlkfhkQ3EF96CGTm8hLegdE9TjXIK2AfJ HtMQ== X-Gm-Message-State: AOJu0Yy03Vo7zr2cWcUwrqozXz2ZOGzW2u2KTUKIWQV2imRQ00aRJ7QB QTkNExUQGq5xactyjuMv+Q== X-Received: by 2002:a05:600c:a01c:b0:40d:2df0:ba12 with SMTP id jg28-20020a05600ca01c00b0040d2df0ba12mr458869wmb.83.1703005277928; Tue, 19 Dec 2023 09:01:17 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:17 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 12/29] drm/rockchip: inno_hdmi: Remove tmds rate from structure Date: Tue, 19 Dec 2023 18:00:42 +0100 Message-ID: <20231219170100.188800-13-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730730769279933 X-GMAIL-MSGID: 1785730730769279933 From: Maxime Ripard The tmds_rate field in the inno_hdmi structure is used mostly to configure the internal i2c controller divider through a call to the inno_hdmi_i2c_init() function. We can simply make that rate an argument to that function, which also removes a workaround to initialize the divider at probe time when we don't have a mode yet. Signed-off-by: Maxime Ripard Tested-by: Alex Bee Signed-off-by: Alex Bee --- changes in v3: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 04344ee1265d..102195837206 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -56,8 +56,6 @@ struct inno_hdmi { struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; - unsigned int tmds_rate; - struct hdmi_data_info hdmi_data; }; @@ -134,11 +132,11 @@ static inline void hdmi_modb(struct inno_hdmi *hdmi, u16 offset, hdmi_writeb(hdmi, offset, temp); } -static void inno_hdmi_i2c_init(struct inno_hdmi *hdmi) +static void inno_hdmi_i2c_init(struct inno_hdmi *hdmi, unsigned long long rate) { - int ddc_bus_freq; + unsigned long long ddc_bus_freq = rate >> 2; - ddc_bus_freq = (hdmi->tmds_rate >> 2) / HDMI_SCL_RATE; + do_div(ddc_bus_freq, 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); @@ -421,8 +419,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_hdmi_i2c_init(hdmi); + inno_hdmi_i2c_init(hdmi, mode->clock * 1000); /* Unmute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, @@ -800,8 +797,7 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, * 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); + inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->pclk)); ret = inno_hdmi_register(drm, hdmi); if (ret) From patchwork Tue Dec 19 17:00:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181111 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2082628dyi; Tue, 19 Dec 2023 09:06:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEV9PUH6XfczbvWrJqI/wraZl9Bx2hGLzVvWaPVxWDLr1MLEfYT6vdxNKiqf9Fb6IzBdqpi X-Received: by 2002:a2e:9c81:0:b0:2cc:6dde:b9be with SMTP id x1-20020a2e9c81000000b002cc6ddeb9bemr2199975lji.18.1703005593337; Tue, 19 Dec 2023 09:06:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005593; cv=none; d=google.com; s=arc-20160816; b=FgeX3+Ha+BdNfubcwB/GQ7gkHpQZrrHrZTaBMSJssj4Koi/iOjgh+C7XkB7qaNBUAt 4gYZOL6pPldt0iGuK5GYNuJpZkf+ckw/JPDqATsBx/nkUIUGPW/bHnSbKyCFT/UqOux5 kRd8kLAV00n/iJUDhQ+nNQ+mMhQOzg1+SW9ix45RgTP/UV9y0BN9aaei4o03RGrS1hR8 LTubCNHrhfudg58gMCoXoEKpkvCV/ZGo1nNmf3CNwI10YiiIyNrHRumnmR+8+0hyzN8J Hpy/TOJmYz7IC/4ROqWPj2SkKu9ntlrYyizeLxa9eeLMWcgXb+2yWvqG+E6lqWA/lFv1 G1NA== 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=3jFSrF2ePa7xhmT4OxproAZh4Ygmdhf+/ONdKCw7fIs=; fh=ILBpZrHrAGk3RqnooEwjJ7i7l1xdG2UMpjp4Y/yk/eE=; b=EpT9GiotGTtuacafwRmZjhTSeRTba51XqymzfbYSwtWEmOj7i+Woh7CZ6H5v7w2eeG hPrq1nbGV3Q1xRM5au1K//ThXiBP81yd/9Lun/sNQYEmGDjr+39He3wfgSgS0etNNsDg llYhLjTkroyWX5uIw8K5NS/eXihuRYw90OTp+y4x4NTdowD5fLJ2dquHaP59QLKPQIOn v7FjBZ3clQEsAD3/WfKRzbkZMxumarbRS3CrqaZIKFi9V6VixM8KuKybfIVXqXNLo3JM uQNrYDU6meYV/IPxnyCSsyPS8PF9BUS06AQMAp7xGb9WD2GHah7YLQYYKthBhtGeZE5s bqtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LT+z87q5; spf=pass (google.com: domain of linux-kernel+bounces-5631-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5631-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 z1-20020a05640240c100b00553a50492e4si508280edb.388.2023.12.19.09.06.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:06:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5631-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=LT+z87q5; spf=pass (google.com: domain of linux-kernel+bounces-5631-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5631-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 89D371F25D36 for ; Tue, 19 Dec 2023 17:06:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B16A93D0AE; Tue, 19 Dec 2023 17:01:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LT+z87q5" 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 9DE9938F8A; Tue, 19 Dec 2023 17:01: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-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40b5155e154so60384185e9.3; Tue, 19 Dec 2023 09:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005279; x=1703610079; 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=3jFSrF2ePa7xhmT4OxproAZh4Ygmdhf+/ONdKCw7fIs=; b=LT+z87q5RAbrmVLOBn5lhiUoSb3CS8JXqumeL2MBDd4oOeCKMigpW+oRyThw+/ch7O XjZRXILO1+PFqSpfZlAzn0d8AbtQljZq24iHKDSKE+H+fHmusCeYZUXX+r6XSroeMvR0 ApryE6WSH2KD39wFrqhD4QOHsYzf/83jDpmMXGUGO1NvnS+32vcgOdtPR5Q4N2NKywvA 96ai4Njlb+ve73hVQkLzvcDZIo1J/QcQgwzsGQQzdTwqSBDfU3zMohFVy1rHPVrFwwbU upxlu3CbS0po8Vq9MolDH6C1ti9WjGdDL/qJUJlhziCdx9/P/DqhvaRymRxqZ5EkxH5s 5wuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005279; x=1703610079; 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=3jFSrF2ePa7xhmT4OxproAZh4Ygmdhf+/ONdKCw7fIs=; b=nunpS2o9zYlfupEnZy1wJ1E7BM7SFMxZATYl0MsVzXs74dBFgMOOvSq/La/jGrgfEz muo67FR4BGvmdrlxZXId51mX3RqoVkE3vppzgthIT1m/xllN3BenniRTKuUQd+0/7TFy ImBuTG4IW77AB6PKcobgGe69pT5RA/ZsbcZfqCI1sdVVMund0rW1BXoOPm8M57+YSCI7 Fyo2V0WN2YbfZ3vCiMrUI9NMXOZxuHSPOGyc0gXON7SZsanGWwv6o6Ja8+yl0vkTZt1+ W9x+XJ4CsjPIB3U5P8uPE0oYHPPCjmM6Ddqpc5aspHOyYondpKFQHvDZ6J9zPaxJUynw 0fag== X-Gm-Message-State: AOJu0YxRaSAA0PgGMAnLpkn8RAX0HvWbuDS3rTWoYhg6qW7usUEguegv qbonbHfJvICeMGlBroZFTg== X-Received: by 2002:a05:600c:4917:b0:40b:5e4a:4060 with SMTP id f23-20020a05600c491700b0040b5e4a4060mr8802782wmp.128.1703005278839; Tue, 19 Dec 2023 09:01:18 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:18 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Jonker , Alex Bee Subject: [PATCH v3 13/29] drm/rockchip: inno_hdmi: Drop HDMI Vendor Infoframe support Date: Tue, 19 Dec 2023 18:00:43 +0100 Message-ID: <20231219170100.188800-14-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730792890921388 X-GMAIL-MSGID: 1785730792890921388 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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 102195837206..5c9f1325441f 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -206,11 +206,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); @@ -226,28 +230,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) { @@ -265,7 +252,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) @@ -408,10 +395,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 Tue Dec 19 17:00:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181119 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2085247dyi; Tue, 19 Dec 2023 09:09:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDVjbtHhmP0DEYLcZhTmsSKRtuP1rfRemHN5zYxa9VWXpcL/Rwz3j5S1Kj7SHWOr0+8j9B X-Received: by 2002:a17:90b:2415:b0:28b:4a9b:cf5c with SMTP id nr21-20020a17090b241500b0028b4a9bcf5cmr3240358pjb.67.1703005774877; Tue, 19 Dec 2023 09:09:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005774; cv=none; d=google.com; s=arc-20160816; b=lsIotQnsrHHyeqhSl1Pet61ecF53HbMtzaQNsWJeIp+IQLTjLXkgY+3q675aJxmBZW kFG/FRh1vykUnFA75Kcm3e020DZE5ONpIuBD23MtjsX56DxnuBCU62MU5wZZpABxWMSS AR4Fzxu6F8Ik9T7l13IdrnqNfQnemqhzZBx2ht2Wub/lJVzeuR7R93cKEB/gi8xUqApn zNi1ps60rGIq+8EklORGjAYat9Z7ZiQSTLnds5oX76BpyGXVPOoa6fr9ZtftEW1uLXXC HTPMdvFvjVlnz514cOv9754rNNUMYzLWil7x2EFuXN6JhVdtmAv+q9b16ixy12gjDGKy 2+hg== 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=WLVOVeutPpE/o943uN9J0cWjrEPzXhsU4YUzCWYMJxA=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=nQmfFZ3SI7NzCLR36V05EtCAi5bkzYfaW1gGJPEoMDxF9o0b8m1QijsNFDVGc1tODD DtGVvXZk38W1ZhzOsL3C/IRMXmoJzUA1LFx7LR+SjR+xjRu0XFdGTwi6Yg+sL0uAkpPd nqc8RJPVj41qicLPCpUzg+ojgOMb/BPRa19CcM6IRXb1s8qGMyYrr3lrjqqxgC4ZE8DK qVMYNo9CuuEiVsoFcpKK3QZtZUipDvAUHHVpgcVmj/3qu3LRgigwYb0/8j8lnygoxBuz w53G3CvdWob7j2q3YdN5Vmh40yK5ux+DQ9T/wf4Hp5C+HGlhybzRE4ZpbNBy3Lh6Efpu PdRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ag++kioa; spf=pass (google.com: domain of linux-kernel+bounces-5633-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5633-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 nb18-20020a17090b35d200b0028bc7cefee2si383092pjb.34.2023.12.19.09.09.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:09:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5633-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=Ag++kioa; spf=pass (google.com: domain of linux-kernel+bounces-5633-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5633-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 DBD53B259D8 for ; Tue, 19 Dec 2023 17:06:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC96C3DB8C; Tue, 19 Dec 2023 17:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ag++kioa" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A14D839859; Tue, 19 Dec 2023 17:01: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-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40c2308faedso56872875e9.1; Tue, 19 Dec 2023 09:01:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005280; x=1703610080; 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=WLVOVeutPpE/o943uN9J0cWjrEPzXhsU4YUzCWYMJxA=; b=Ag++kioaLZBYMy6gi5yNznCDfCzXI5BLHTDlDjl+Hyq5w0pt3GKiBg9GZpT2NL0kgK WI0kvk7AEKiJVv91A2xLH2VPjC3Pv7dYZcqakz6G+dmp2aP0H0YLjUMdZk2P5nP9owLT AeHhDhttcz1XMy1GmzSEf87Ho6IrlhP8FWMd3ks4SikoQiXAqiNsDn4G4rcNAguOapvT HDQkzCOnsnemociZXIwliqbTWz26uOA7iC+zvBU8v4iKXh8ND/hrn+9gsJULV8uCrqU5 w7POzw71aoholSplG8coI+kEyAs6J5iBH22Hdyskr4YmG/k8ZjbWKU/7UY1mY0l58vmO LHBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005280; x=1703610080; 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=WLVOVeutPpE/o943uN9J0cWjrEPzXhsU4YUzCWYMJxA=; b=o2gRRc9D3ANTTon72jWEMq7BGOZbZQKiuWAIxwihQWonyH0kWjRSSlBI8V0Qjz+5fW IgNlr4rEgYmRaxNr0al8ZU8eC1tNXL/CG3UAo0rhb+TqwEVBDgJncQ91LD0WyZEQQOiA oWQl5xr9o877+GNhUVwaJITIbYJtUk7EQMoEBg6xxDsB1wGMem1EbofEQMg891cexolI H0zI5MkHwHeP3/GAjme715OrFDew7x6gh/X94I4Gt0mD4jOSxUCJkg05I5rFAXNPjswD 6wAp5kWMoDq652Js6BLk0/ItzC8zb7ZWkvOpqVD8wqtM5ABHguBACXupTyUB8Pcbdjax kDTQ== X-Gm-Message-State: AOJu0Yyftt1GqhIt/D/GWVUs3B3s6zM1/C8qDguWwHNnyRW8P0HWsnxh cPYoKFJ4TfPzG8/AA66NnQ== X-Received: by 2002:a05:600c:808e:b0:40b:5e59:c581 with SMTP id ew14-20020a05600c808e00b0040b5e59c581mr9903834wmb.171.1703005279654; Tue, 19 Dec 2023 09:01:19 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:19 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 14/29] drm/rockchip: inno_hdmi: Move infoframe disable to separate function Date: Tue, 19 Dec 2023 18:00:44 +0100 Message-ID: <20231219170100.188800-15-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730983656442217 X-GMAIL-MSGID: 1785730983656442217 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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 5c9f1325441f..10466c2aa520 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -205,34 +205,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, @@ -244,6 +254,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; @@ -252,7 +266,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 Tue Dec 19 17:00:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2082804dyi; Tue, 19 Dec 2023 09:06:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEs9fnVUOZfEjL5ULpyjz2TyYKo2yO20xAUSSyhX3VI4sWGfxJ/NOFiUcACiSy0hXMayBzo X-Received: by 2002:a50:a6de:0:b0:552:f57d:ac8c with SMTP id f30-20020a50a6de000000b00552f57dac8cmr1537063edc.12.1703005606569; Tue, 19 Dec 2023 09:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005606; cv=none; d=google.com; s=arc-20160816; b=rBahnadRWDVy6kngFmGwX15B/VG3sqN0zfB1os800M4P86W3OQKlIAmDWQyBmxSNeq XcKiTJCGzr9trQO5t9WANG9hyoleZBEIbDAt/VW9qTCjfsbatW6OOW/Xyhs2bgMlka1J 2MlMi5nkyMajzkj6l8f3k4wdLAP0bFEjMn4L5U9yclun6SMm64l+WrQGgOXc4kHZHVdZ vlNZvQ4acVP9z5Zcjtrg+tJP7D0j47V5Jxm24S31zWhXd8mpfVois/nmue4x6AITQw6E vox6bz0CNoufBaqVrQ5PIS55AYRfbYdqrhEE9NUc2mdKt5myNw8w3jArrVrj/LSlzhiW mowg== 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=61BEi2enFRPw/8EyUZ5EsB7jHaGAUQBqgpyqmRd+nco=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=RaTwhe7CPj6nQEL58H0N+jpduHKDhbwXsryU+etQYlDWkZohZA9kff0hmklrP+YR7Q ewtvfT+t66WR1LDjJB58CmQxGSGlvKNVtG1G7HIk1tpzoXPrLoFxL16rYdusqRaGujWr 0n4Cc6L/+K3z42rv4XHSw+FM1txRT9Hmkog3OzzyiCRDmIX7mfWrL7jDxnK9oZAiH1++ f6SQzK9gwqy8trnP5ph+iM3wS4jPn84vsAEtOSM9ZvtAREtlG/5esQBkMo2qR2qWq6zF PKJQoT7EZZm9xJiO7/CZtm6Kx7XvTwsQgE80272z2CwVgtCgT6q8UQ8xGjAFy/AiqVJR EE2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FLbv3sZm; spf=pass (google.com: domain of linux-kernel+bounces-5632-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5632-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 q11-20020a056402518b00b0054c5de6b545si10953148edd.346.2023.12.19.09.06.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:06:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5632-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=FLbv3sZm; spf=pass (google.com: domain of linux-kernel+bounces-5632-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5632-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 5CFDD1F25455 for ; Tue, 19 Dec 2023 17:06:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5894A3D0D5; Tue, 19 Dec 2023 17:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FLbv3sZm" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.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 8715C39877; Tue, 19 Dec 2023 17:01: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-wr1-f52.google.com with SMTP id ffacd0b85a97d-3364c9ff8e1so2641744f8f.0; Tue, 19 Dec 2023 09:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005281; x=1703610081; 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=61BEi2enFRPw/8EyUZ5EsB7jHaGAUQBqgpyqmRd+nco=; b=FLbv3sZmaHeMsOJGz89aw+ajYYJIQLnOqmbvvjp2YFgEMPSZVF+YZBxV1lTZHZ0jMz b+PCfITFr9L0bRKBu+SUtf9ASjBPwlyhd82QEQO7aM3Flj1nhmUgI1A+ouj5qPigQRKc F9HrM+qCi2oAVLYWu7rTV3jBjW1Zuo+rJ+PCQLhHLhIDwwbrDJYXoo+IMWOOAPC1P5tf twZWwPnHr+4nMPS7U+soZmEJlBhYds8+ssRwm8B/iGgeKDyjUr0rJCmS/eH4bnIMNiM0 LUX8EJsXP3+wtkmvl8cuiSwPpFSfsd5jHkl/45Xe6zXGU0N0lnR+YIrfKfLZf3MYDMv1 j1Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005281; x=1703610081; 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=61BEi2enFRPw/8EyUZ5EsB7jHaGAUQBqgpyqmRd+nco=; b=nsBknzUrwB3ZuQJu7kplAD+i6LS5H8XZxEy+rke2zWtAsPxrgmutEV5T34M3C04rTf u83pxascYUyaM/GfEsXbbE2dPfjdKlalqnw+SrYiRGTTaZN1deBKoo+3cvqHmCT1cn7O UvyGcTOVicgEexp+FVAb89hPqnSmf3FzsMXK6S1ESwHKGwWS0qXJQEXl4uAryPQwGIhH L+97KnIWMRd+pO6Y4XxQP0kYoQYhkkbVMbZv9M3KWWGUAZ5wBFqPeyIuJRHlap0zVNUY WLQkGN/QNs++hHb+yAWOh1rJvy9UCeLi3mnRCIfKO6ldcxo+tGnNiZeHmBdeDLSbQbGE TnCg== X-Gm-Message-State: AOJu0YwpNehEVwipItIyNvnvUlwa9RCMYVx2RkhsyMaXybuR3t8dwrX8 zzVULPcVn5YAPPvtPRY9Hg== X-Received: by 2002:a05:600c:3115:b0:40d:177b:c3b3 with SMTP id g21-20020a05600c311500b0040d177bc3b3mr847099wmo.18.1703005280608; Tue, 19 Dec 2023 09:01:20 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:20 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 15/29] drm/rockchip: inno_hdmi: Switch to infoframe type Date: Tue, 19 Dec 2023 18:00:45 +0100 Message-ID: <20231219170100.188800-16-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730806859322183 X-GMAIL-MSGID: 1785730806859322183 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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 10466c2aa520..49367ca24125 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -205,33 +205,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)); @@ -255,7 +256,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; } @@ -266,7 +267,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 Tue Dec 19 17:00:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181113 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2083025dyi; Tue, 19 Dec 2023 09:07:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IElAq/p8PpoLoyKQEhPAtFUcQUeNTEA72F5/W4cDgyYXE9NyZLPaqByyU+iMyTb44VYGtBL X-Received: by 2002:a50:9f21:0:b0:553:828d:3f21 with SMTP id b30-20020a509f21000000b00553828d3f21mr738446edf.35.1703005621559; Tue, 19 Dec 2023 09:07:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005621; cv=none; d=google.com; s=arc-20160816; b=tv99xoHgiHKSan05l5jfC1eXJMk5dFmR4D4wia9yrQ9uiAc31AcuxgL/vYAfJRDK4o Og4qsFx97s0j0VVBd4j7jJqglRZbZP6rg0IbU400Q6qZWCPuxuu3wdhcMw7pDRi4rkOp ggXPm48ytGC7+/ADKwxzMcYSjHTDdxGyxMnnk5trlrIskXEYJJ9wOuiHVRWG8fwvNSKx pR0M4ApuW2wquQY1elaklIxVO/fSDe511BFzToAKEYcoIGU2C869zFD3APXPDRuERYfD sKCuYMvRHJ+v/9MgVRC0ggOqgbJvtJExAUewlI3pAkmzUeG9PKo7dCTDT58Q+OAPYjkI flGQ== 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=+s72CnTe6ZV2IMv3pM/65G6mJvxbtoIjfslzb5tL7Ro=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=Ouc9Zs/mK11PPcUyaWX3h993gVYLx6rqE7ETtY8A7ry0uDFvZhGUc/hjKjlUAUaOmK LWX2TUPOVvpkmm50RG4Ppca0d7dnk14mEkt+Qsbep681P/MZhwNmcNawxNRSYkrEX1bO CyjkyB0nlRsq8XFRQDIUliuth7Bep4RQDZ82WMSgKCghYbn9WrEC7XbuborZKdVU6oDB CRao7HfPJt7cLuzMRBWSyKCE3Sqqv1ifFQ2tbG0c0DEu85ufUGLtdoaAyMxbW5QsxqFj NUpq/qYDCyWISj6CVGt196sUfIcYBvyA2yYXCfkCom+ytreV0sdHz38kM2W2JMf2vAO0 lm5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=B4cNKGq4; spf=pass (google.com: domain of linux-kernel+bounces-5634-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5634-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 b6-20020a056402350600b0054c943a07c4si11641397edd.394.2023.12.19.09.07.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:07:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5634-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=B4cNKGq4; spf=pass (google.com: domain of linux-kernel+bounces-5634-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5634-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 2B6E31F22290 for ; Tue, 19 Dec 2023 17:07:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32ADA3EA87; Tue, 19 Dec 2023 17:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B4cNKGq4" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.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 96F3238DED; Tue, 19 Dec 2023 17:01: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-f50.google.com with SMTP id 5b1f17b1804b1-40c3ca9472dso55022775e9.2; Tue, 19 Dec 2023 09:01:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005282; x=1703610082; 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=+s72CnTe6ZV2IMv3pM/65G6mJvxbtoIjfslzb5tL7Ro=; b=B4cNKGq42qhvQhHz/Moc41Si/KshZlja9rqQUGM/4NLOj4mn5PkduV2wT4Mmv/onlc sU2mCcJ32TQ0cJwZwJaVUMNb9JyEheKVxfyNi6GA36P6SBHKHGX/G215WRA2EBWCJRgZ /XsTdbJja0Ue+QyGj3f4oeWue5oJ6tU7KkbqTT+QzxyKbLVzpj9PNWLpfWb/lGySJ9Ci +T7AIIncghCU/rdz88r0xlVlS/4ilzeNUc91ndWaAtJwRPzFVtnXWT+Q1eO95VXyFjxg zQKf9dpqX+MdEVQTSBnZO7jaPFTzJ9jSH6+f0INKRLRp4OdH8x5WowS0uE44DNUWgM0F ZRlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005282; x=1703610082; 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=+s72CnTe6ZV2IMv3pM/65G6mJvxbtoIjfslzb5tL7Ro=; b=gSidN2+t2mzSh7o7r1Nxd6LSb4nnbTsnwsmk+53Qu5lW3FH0L2RiUL8UephLF2bP1F irqDopWNx30FrgLRpImEpR7dUS6VuMoQQQmEnqbKB2qxO8HIc8m2mkPSvnncefoAdbOk nBU5eIGkjMer/22gQJugr8v7jpKduU07DNtziiVDywd7Q4Te60pvCkjEAws4fjUS5BEx e8DuzokhrQmxJNczxwN3chVebhGeGydMK77NxxPvlGMZ7RhH9apVPXN+foZh6G8THbJz w+U3KkIAXVVQCMD49BUjhIgvNQ1xYph+tiPaxulcGg3Y2k0HA94Z3tY8IwVSdPOCQ0TI Hvrg== X-Gm-Message-State: AOJu0YwaZalEKXTEz3TZcZIV0KgdlC8HmaNFfPIh5nnx3A1RniBp1IKg udJhaRpa2CH3+AUc++KRYA== X-Received: by 2002:a05:600c:244:b0:40c:2b4c:623f with SMTP id 4-20020a05600c024400b0040c2b4c623fmr6217351wmj.82.1703005281769; Tue, 19 Dec 2023 09:01:21 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:21 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 16/29] drm/rockchip: inno_hdmi: Remove unused drm device pointer Date: Tue, 19 Dec 2023 18:00:46 +0100 Message-ID: <20231219170100.188800-17-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730822752309906 X-GMAIL-MSGID: 1785730822752309906 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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 49367ca24125..51c1a69dfcc0 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; @@ -757,7 +756,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 Tue Dec 19 17:00:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181122 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2085653dyi; Tue, 19 Dec 2023 09:10:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhmBe4pAJNuZtKQNBYWWz0rMoRSbsqTSLpY9+QD2Zi7BD/Pls2ABkAWICA0lMAvLsqFURK X-Received: by 2002:a17:90a:bb8b:b0:28b:b20d:91e4 with SMTP id v11-20020a17090abb8b00b0028bb20d91e4mr1256403pjr.37.1703005802087; Tue, 19 Dec 2023 09:10:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005802; cv=none; d=google.com; s=arc-20160816; b=LbQfW4xBaJaGWKyPG2XOBtOrpN84fyXVRLJ4rfU3J3+0e0W0M3QcxH8MFDdMHzvWCa 1cMj7UWSJYDhfNph3VZEuWZj1zjdQTpoCXSRxfnkqlK1ROmdAzuYy41xfQyJgp7G/2Ts 4kVZuyKHjsFxAyimGfiJSr5bSj2VceVrL26dVa2JuVdPsw/DtuhoP9MWd5tcS7xCImi3 V041pSVvQfnnyvEVyipTS7uWhN1K64CUmNQ7m+lCxy/5ouNfvhbQyqDrNzJHNrAkR7/Y GntnMM2yEbAW3gtAC0iODfFnYmJ4muGxgokRR96iDXlogdZB7rFUO72fdcUrn9yrsP98 IQTg== 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=0WseMEHOavtmxykYRA2JtvMxiK/FtoaZXXQqi1uMlW0=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=grJSZwRRDht9nubGn2EVVu8YE5cyFOPFSgcntX4rqpKZ1aNarIIbl1ymgdQBCkswgM fYs0axn+bCAbvzxmdO4rA7rOsKAJL72WaWx/Chlm4R3N4w7j/bxE2yWcHRYa2ddYwaTq 0g4W6633GER30kx8QN6HhfhLTKHjdmFCz2l3sVr4R2+f2jJlmPK64VHHFjGJ7DoXwbWE +HtLeiJkpRquFbQTPGXxhmHA8q4iUAFburxsOt1/bHTpwixbOnmRw58AFLFVrI61CHPo jIFGuhRvFTK642iw49P/VLOvE71GfSQBo/LR+wAHL+Uk+9UbWkcy8UeVRsMRVcXnfTAK RndA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=my7jBsKQ; spf=pass (google.com: domain of linux-kernel+bounces-5636-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5636-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 bk5-20020a17090b080500b0028bb7117584si1507256pjb.85.2023.12.19.09.10.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:10:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5636-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=my7jBsKQ; spf=pass (google.com: domain of linux-kernel+bounces-5636-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5636-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 0DEE8B23CE9 for ; Tue, 19 Dec 2023 17:07:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FBE03FB08; Tue, 19 Dec 2023 17:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="my7jBsKQ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 A2F3C39AE3; Tue, 19 Dec 2023 17:01: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-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40c3f68b69aso45414625e9.1; Tue, 19 Dec 2023 09:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005283; x=1703610083; 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=0WseMEHOavtmxykYRA2JtvMxiK/FtoaZXXQqi1uMlW0=; b=my7jBsKQdDFXLbbckrB98UxQDRddpPZR3N1nusiIUa+okYJQmi9W8kGrhNH7l3mSxL 2PrjRkzwC+sgfDrnqOtiKLe14Uz4vo+gnr+hm/y5+lB+Px0GvBrAwSvoVjbvTKzCbp86 aM4aRDJ/XxqjoAYQFkk6NKFjyvViFoyEYa97OU1kY/OIyhPYFK7AsTEOZAmJzuAbepQW jHd+LiV+sN10uFIW8dt42BFGOdQGyyrYnQ3O22i2PPkIIB3I8caljibcc/EXUPPVbpfs iwSjCvCw/W+lgmDWOzQa6mAOeILzG7AqdgGw/04A9mrbzNL/ssomAVNjSVDKibyqPAwS RZ1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005283; x=1703610083; 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=0WseMEHOavtmxykYRA2JtvMxiK/FtoaZXXQqi1uMlW0=; b=rh2biJZHoDAJ6EeeZaK6OQ7TlQU0bDTjilsawC+HDDcKGCMbQrsSqw4xt1at2xvr/s vYdgsVNumJBynAgFvNyDzTRZ8Yt5eR3WUqvU2GFxFPxU7EmSr9ySaTbt4r9Hqsg7ARC6 Yjqq2ZbzdE3jnadf1FLxz+3yc6i42cD/2gozCgHBPtcYcLl0H+bESW52HGMpBK0PMXvr N3UrmvxoRmj8q9GK8q1+mP69Uk+TTfCg8Kn35quSGnm7cSkw/4Tz8kYrDQgM+BILmXXG /GMIVZH5Oa5QOOXHqBVYxeMj2G7GsRwx1Nf7Y0HWlOCnM5ZWD98lS2a+Ju2JukLyc8wW KKGg== X-Gm-Message-State: AOJu0YwfKbk69VQf/D1yqeUThWVVkkh1E29neEzyyDlgDdLXzKqpee1z 0Ilu9FVi5nY1umyue0j8ig== X-Received: by 2002:a05:600c:1d10:b0:40c:50c:9f3f with SMTP id l16-20020a05600c1d1000b0040c050c9f3fmr10565023wms.95.1703005282571; Tue, 19 Dec 2023 09:01:22 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:22 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 17/29] drm/rockchip: inno_hdmi: Drop irq struct member Date: Tue, 19 Dec 2023 18:00:47 +0100 Message-ID: <20231219170100.188800-18-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785731012049372480 X-GMAIL-MSGID: 1785731012049372480 The struct member irq isn't used anywhere. Drop it. Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - new patch changes in v3: - collect RB 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 51c1a69dfcc0..138cd4287dea 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 Tue Dec 19 17:00:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181114 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2083758dyi; Tue, 19 Dec 2023 09:07:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTM/DB2GZ20eFbt4tjRqS+psWjeJjb3TNbLHRRnMHercbF9jp58hNoNJ9w1ljjwOtfvDAV X-Received: by 2002:ac2:46f7:0:b0:50e:41ff:c078 with SMTP id q23-20020ac246f7000000b0050e41ffc078mr407002lfo.187.1703005667824; Tue, 19 Dec 2023 09:07:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005667; cv=none; d=google.com; s=arc-20160816; b=iuDXdysUEW3AEPkNwoUYSB3Mh7XqX4yF3Ygo/Dup2WckS3ZgaZ3JaPkI/0+CJJJSaS jc7OdKeUv0ISlwUmQ498Ry48R2n+M5G044HA0lCDYSuYhiMzA+4Dw17tk+PFIHHOkffg CIWe6Irummc8Z/4WCdCZW2SqzMQJHic1xHiWvpF8JPcqmwDBbPr4xQktDDt7AmlGbIFE XMsmI3jdm2i9OIuYRjJOu4L2s1ZlxPC5/V2D+eC2TJB59Nc+BHpydyaoviVMJIJUTlbF Ie2evPSkJRuOL3t6PZ8+80rIsHBPXDeuvCLIsYYWR8spRO1IdmiO2T9kiGS8q+/TvGGH Ljlg== 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=lK+KwYJlEuYLJRgnAK/weBabBFLF0yUxX6bkfoGTqMQ=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=qwVpNybzFOVRosfMbYTERxYAhEweAYFmAtTKZ0QiF5aXqpnWt8hDEGsPh//PJ/1znD 0fV/IaUYD9+lbR7RcK44ZVxF89RfBi3S1S97OhXTJtRerNtgACD7g5OvM+C+cJJobTAL i8M7ukFACvbEkCmHMW9oTQ4UUYfU77n/NQG3NkjEdnE3iBCVEsllaQ7WtflD4jOBeSKy eN4sS/2qb2AaxgDxoLKAYK/ntbRcZjE6xoadjceG/t28CPeH/bhc26h5JEXDRrsW3JYi ufg3DASWCFn8ddFEWTXOpLDNdwztosd/a/YosPhzKYRJG61BJ5JEEDyqHeGy1l6ygv1Z yMyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MJTpj7t0; spf=pass (google.com: domain of linux-kernel+bounces-5638-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5638-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 a14-20020a509b4e000000b0054c9694d110si11201620edj.199.2023.12.19.09.07.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:07:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5638-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=MJTpj7t0; spf=pass (google.com: domain of linux-kernel+bounces-5638-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5638-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 43C5A1F21FAF for ; Tue, 19 Dec 2023 17:07:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9221340BF7; Tue, 19 Dec 2023 17:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MJTpj7t0" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.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 7AE4B3A269; Tue, 19 Dec 2023 17:01: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-f53.google.com with SMTP id 5b1f17b1804b1-40d12b56a38so39144415e9.2; Tue, 19 Dec 2023 09:01:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005285; x=1703610085; 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=lK+KwYJlEuYLJRgnAK/weBabBFLF0yUxX6bkfoGTqMQ=; b=MJTpj7t0+gXxEYXmiaM9UA8Pl2Qgvsc/mDXOBiVrn9++BL+MhkhYcvHFMaWd/EELMs v1CUxGZBoA+tRJ6K7I44ST0JxF0sDlFl+N8/SPLwrdPqUsKv+fj/7Esh47zNE/GsLj98 Gl4sl82hAmRNm2bmMzz1ygkkGfB0YyTccgzW2ayQq5iI07XDO39YR8fKZsc5W/eFT78Q B6kMvu+FfdVec3MEzPEmb0+OFaqRobEg6b/sDflVTjrl34bdSIm1+9hyfUgkEphiFBnO uJeQ2QdsNoEjkmjH48v1QhCfI+jJUAUJwbfnRanBfoiUmIkkg/Zg5iwHrCm++l3E0b8P 81AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005285; x=1703610085; 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=lK+KwYJlEuYLJRgnAK/weBabBFLF0yUxX6bkfoGTqMQ=; b=Y0ihTF6zrN+qwiYuYcYdk0gB48KwGBaCKUB4kTeOltbfErJVbsXpY8KzRg+cP+X/jZ x1e8QV7WQg+9Eu6oFsiJzP/r1xQ51bXB74+VbHBJiWSr1UCH4rll9C0dmVyTYuzaU3DX 0Ko0O0pVMza64G3QJGXDTjE4/SBGVfKJiEZ4hEiXnAg68+L38ir3lYBt/3nu0W1KI0yA DROumg7YRhGbY0G2Ny18V1Dz4pi/8QeXuDqvSANuYGzZOJTdcEcnQo9y2RZ25J+4Vsba yQ6gHinQ40KpzU2CFMfGoHsFN/lrXp1+bNZAekZ5mX8JRyvyXK+JhZubOwu6Z5hacCJE qeaw== X-Gm-Message-State: AOJu0Yy5YzfdSewGA9fWLAj/2umvB6VR5BCMG8m+fVQc6YpnZfBZk7AW NcJujuIQ4k4c/eBVS0hZtQ== X-Received: by 2002:a05:600c:4c8a:b0:40b:5f03:b3d6 with SMTP id g10-20020a05600c4c8a00b0040b5f03b3d6mr4719088wmp.248.1703005284670; Tue, 19 Dec 2023 09:01:24 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:24 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 19/29] drm/rockchip: inno_hdmi: Subclass connector state Date: Tue, 19 Dec 2023 18:00:49 +0100 Message-ID: <20231219170100.188800-20-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730870796520179 X-GMAIL-MSGID: 1785730870796520179 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 changes in v3: - added missing customizations of reset and atomic_destroy_state connector hooks - moved inno_conn_state member assignments to atomic_check drivers/gpu/drm/rockchip/inno_hdmi.c | 111 ++++++++++++++++++++------- 1 file changed, 84 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index c306db90832a..7ce5836fc80d 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; @@ -52,8 +47,12 @@ struct inno_hdmi { struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; +}; - 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) @@ -68,6 +67,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(conn_state) \ + container_of_const(conn_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, @@ -246,6 +248,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; @@ -257,9 +263,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; @@ -269,7 +275,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; @@ -287,7 +296,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); @@ -298,15 +307,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; @@ -383,17 +392,6 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { struct drm_display_info *display = &hdmi->connector.display_info; - u8 vic = drm_match_cea_mode(mode); - - hdmi->hdmi_data.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; - else - hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; /* Mute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, @@ -458,10 +456,24 @@ 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 drm_display_mode *mode = &crtc_state->adjusted_mode; + u8 vic = drm_match_cea_mode(mode); + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); s->output_mode = ROCKCHIP_OUT_MODE_P888; s->output_type = DRM_MODE_CONNECTOR_HDMIA; + if (vic == 6 || vic == 7 || + vic == 21 || vic == 22 || + vic == 2 || vic == 3 || + vic == 17 || vic == 18) + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_601; + else + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; + + inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; + return 0; } @@ -519,13 +531,58 @@ static void inno_hdmi_connector_destroy(struct drm_connector *connector) drm_connector_cleanup(connector); } +static void inno_hdmi_connector_reset(struct drm_connector *connector) +{ + struct inno_hdmi_connector_state *inno_conn_state; + + inno_conn_state = kzalloc(sizeof(*inno_conn_state), GFP_KERNEL); + if (!inno_conn_state) + return; + + __drm_atomic_helper_connector_reset(connector, &inno_conn_state->base); + + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; + inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; +} + +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 void +inno_hdmi_connector_destroy_state(struct drm_connector *connector, + struct drm_connector_state *state) +{ + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(state); + + __drm_atomic_helper_connector_destroy_state(&inno_conn_state->base); + kfree(inno_conn_state); +} + 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_destroy_state = drm_atomic_helper_connector_destroy_state, + .reset = inno_hdmi_connector_reset, + .atomic_duplicate_state = inno_hdmi_connector_duplicate_state, + .atomic_destroy_state = inno_hdmi_connector_destroy_state, }; static struct drm_connector_helper_funcs inno_hdmi_connector_helper_funcs = { From patchwork Tue Dec 19 17:00:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181115 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2083958dyi; Tue, 19 Dec 2023 09:08:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQIZwwtYt+ivs+pCS0zzSyfLLynIecQhPVLLI3X5W1DcWAQ5rke7G5ZW/ghQrbv4UCu2zs X-Received: by 2002:a50:99da:0:b0:553:4841:9c3e with SMTP id n26-20020a5099da000000b0055348419c3emr2344655edb.55.1703005680999; Tue, 19 Dec 2023 09:08:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005680; cv=none; d=google.com; s=arc-20160816; b=HCoKG7ej9Nv03N9Oz9QJAtwLIu+5zUUvq/k8R6JVGZHSrXxt2RTCbVpjZDHlWEjQ7o pJ/OHGYeAUlBgHJgbpzIqPT9z2dnu3GmYZ9tP4oAyzCChTiuFlVaIYIf7rtTXSnnjjHQ SKYZXafQToJtF6SFsJrKdGMzWRkE2DCOffhMyEoAzCfUn0KL8QNctYsKiQFG+6+T62bj IShyH+5QmP/M67Ro9ERoOLVMnUjQEMjR0uSOwnR941NAmziIgC/dEtvl8679V/SijwoU FkQ4zLQiByggk8BaSv7fvuDJzXfy/HmbaK/tMsWgPvCXRKn/fMDlgsBMcWGvQ6lhy3u2 fjBA== 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=XAqGTQIWGOGvPcvI30gGZkG+UcVd1X4ARFNZ3GdyHUM=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=UZI+hJZM3vKrAV8giEeHTNS3wqc7hQJ2BPPoCGGz7vf0tWBHuhiuDWaIpjpAzhTc3Z F59EpWXOUbZlz79UdOuiWjk2GfKp2iFpioGS3akCHFAf6/qxh0KSOmUN5BVfaDiRZa7Y tH5nMwyj9tzdWFx7vB1WHCaB5nF5p3SmMG7Rxlrn/H0RzmvxTHKMZyhg5GH9NsZrnKDW GX+vAfxTMb2U3iL6UsNgf/vZt5NYon8AS3ffkP0mJ3FsPqHWzj3W/G9SCFVK70A4/E9u 5Fr1byjPtOpC7rkeOEUPZ3GkZM3dJFg3sVnPeZbrIYj0qFj7QozsaDtCfbIoAI3wzgIf ZgDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VAM4IcSY; spf=pass (google.com: domain of linux-kernel+bounces-5639-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5639-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 q21-20020a50cc95000000b00553429d5597si2196347edi.271.2023.12.19.09.08.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:08:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5639-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=VAM4IcSY; spf=pass (google.com: domain of linux-kernel+bounces-5639-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5639-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 7307A1F22CE4 for ; Tue, 19 Dec 2023 17:08:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33BA222331; Tue, 19 Dec 2023 17:01:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VAM4IcSY" 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 7856D3B2A5; Tue, 19 Dec 2023 17:01:27 +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-40c48d7a7a7so45245385e9.3; Tue, 19 Dec 2023 09:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005285; x=1703610085; 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=XAqGTQIWGOGvPcvI30gGZkG+UcVd1X4ARFNZ3GdyHUM=; b=VAM4IcSYWkyTcOjVaSfOt98LjymzjxhGteAPPd8uxijcs/v3S9k0f4TInY6aiOS8f+ TKbvZBVgB4oIoi9+7zS8Iq7OiESZWinp1WxuGI5ykhsmo9tRXW1uuX79721NMZSjGOuQ XEk4LzQNTjivkO/IP2WfZcBQwwA08IZVbdXygCglenUAPISTAvZ6T3HBhKuTs2mzPexP fttmQ7rN0rKbcY1Z5Z2e1uYU6xb09WKTtJfATqNtF7/eXawfF0ByHAwg51fZwm9MHhu8 A8DQjyPFfB8BWYa22zdZsPtU+V7UW+veAUPsQd0Awws2OSR3PTOrXwwZoAA5IJp7Edmp zXzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005285; x=1703610085; 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=XAqGTQIWGOGvPcvI30gGZkG+UcVd1X4ARFNZ3GdyHUM=; b=Q4Uf5Bo1p2VWmEvzgWesohO/WN5QPGy+XoNwq9JXQNBVNCfrC2cMG51j+eU3Sx90EC bhWHaCwGMroMtVJvsGCnBDcxGf241MFG2b7mX4bPoh6hEW3nP3knDR/AUm5sOgYFCpCA dOyLoF6GTCY+XPedEg1TdrgC9D09dHdchDtZkNo6GyxMsgz4udn98d5IUQ7lw8arfdne 16B7whYsFsvZzHLAm0FygyEL/OO4xD5Wx7Q94Mt6mOd/cSWIIo83GJahSYOpW1yLwMdg jMl6tFCZKKln3HJ3eoWJSqBX26LyTg2nf2y7SLojKRp0Gd0Tsw6ngTPg5Wtd0OlBgr+Q NMeg== X-Gm-Message-State: AOJu0YwgyJCLkZGzTjc4HJxb+DM8QJtao6+vkE1s+1Z6niTwkdggzKh9 dX2EHF23GWQXg+biHunNTQ== X-Received: by 2002:a05:600c:3b06:b0:40c:3158:6467 with SMTP id m6-20020a05600c3b0600b0040c31586467mr10786965wms.1.1703005285545; Tue, 19 Dec 2023 09:01:25 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:25 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 20/29] drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range Date: Tue, 19 Dec 2023 18:00:50 +0100 Message-ID: <20231219170100.188800-21-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730884850048853 X-GMAIL-MSGID: 1785730884850048853 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 changes in v3: - moved assignment of rgb_limited_range to atomic check 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 7ce5836fc80d..e6d37772500c 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -53,6 +53,7 @@ struct inno_hdmi_connector_state { struct drm_connector_state base; unsigned int enc_out_format; unsigned int colorimetry; + bool rgb_limited_range; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -270,6 +271,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); } @@ -297,29 +310,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; + } } } @@ -473,6 +494,8 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; + inno_conn_state->rgb_limited_range = + drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED; return 0; } @@ -543,6 +566,7 @@ static void inno_hdmi_connector_reset(struct drm_connector *connector) inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; + inno_conn_state->rgb_limited_range = false; } static struct drm_connector_state * From patchwork Tue Dec 19 17:00:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181116 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2084441dyi; Tue, 19 Dec 2023 09:08:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJeTDkafF8/3F6TX95uTMhYr2qyJqacUeFvlXg5FXnw0eJzJyTRfCynF9+0oMaKdXzHb95 X-Received: by 2002:a50:c31d:0:b0:553:af37:d5d0 with SMTP id a29-20020a50c31d000000b00553af37d5d0mr323206edb.79.1703005716930; Tue, 19 Dec 2023 09:08:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005716; cv=none; d=google.com; s=arc-20160816; b=uWeiAa0qveFCJ4WFPkYBJzPwPhcepxkRYyPiEc3GPNTVgVHm4I5i86iOwHPjHM6q7o D9P17t2NZeneXbcd0eYsxoTMyEzLlwGvlxW8BTl6UjGFfuY/R0lz8brThCVb1Bg7Q2+T 1Z/ssEe+Fhv7IqAX1DoGSbXKf2lW+4Du17AkZ58qZTXpgO3/xm9zxYO6tkQCTLndtr6V m3QzFKnDNaqDRbPwpreg2TU/2qLEbvaWL2vVZ6eVlQ2N3YubT0PvkVj4isjlBf1xw8kg XpL++RrH7fVOzRCkH7Iqyu7ePMIRAlAhwLHKe35SefUpXNIbg/k46/fninAEc/DJ2LtH cBWg== 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=QlneokmKF1TajoqU6rsqTKLh9Q2KoTuUiBV9HAc+RDM=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=Ymbd8S8FmAjVHXA9tPLLaba3obPiIEqs40csF8C8B4Ar3EQoozokeekRsQ0vPTffc0 bj8BPhPZNlEba7Ry2/xJ6PVEE7IQTzIgfHuU0JbXGuXM9EKdHiTpcWdIAd5LtBSpB6cj l7HSbik+f89xKkdIH2n8XeLoUfIdogKMNEQkVoxi+Lh3D1sT+exYu21M6mKqs4UMSGKF 24UN6DbRrVfnKhTmh94NP4gZ14NdNtwQfO2cDztEWTzUiqQBA/IrPQccbFM8ZoHP8RZU bYVsjhT3IUdKdhVjdGv7pI77llqj0QEqUSfIXXK0Lene7S4N75NFDVDY7sLaGhmHPiMg 4hiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ah44Db2w; spf=pass (google.com: domain of linux-kernel+bounces-5641-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5641-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 a14-20020a509b4e000000b0054c9694d110si11201620edj.199.2023.12.19.09.08.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:08:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5641-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=ah44Db2w; spf=pass (google.com: domain of linux-kernel+bounces-5641-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5641-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 519611F24CBE for ; Tue, 19 Dec 2023 17:08:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0485D225CA; Tue, 19 Dec 2023 17:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ah44Db2w" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.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 57AF93D0CD; Tue, 19 Dec 2023 17:01:29 +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-f49.google.com with SMTP id 5b1f17b1804b1-40c38de1ee4so48018385e9.0; Tue, 19 Dec 2023 09:01:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005287; x=1703610087; 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=QlneokmKF1TajoqU6rsqTKLh9Q2KoTuUiBV9HAc+RDM=; b=ah44Db2wrbv2BqVMt+FErRXDRvYOsk/W1wIWNrEY2QFeTOoyEX2ZVmlpwziD4KEEAM CStPOomJPkSjtC7QYWXbZjP3DoTpn7jPyb0/jRzFvS/IO/UANYlF1prr6JPzXEqXBkuL IO9YCgDM/hJHunn/pWQB48BfVFqEAcFtnUQAyfdaL07pWyKxuSZzNiMc+fumPTN0eeT4 wf6bFt/xVbFke4S+DusW56UHpileZDaaEzUxWxbpuuBbgbfhdK2ih1abE60shuD2XeAx LlJP2KOkvWg9TXAvgBijihT2X+MUZRw6BU9Yd0Yoo4fivFWN3bQ+8luTFkx2J/7ikuzx iezQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005287; x=1703610087; 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=QlneokmKF1TajoqU6rsqTKLh9Q2KoTuUiBV9HAc+RDM=; b=dgnkvnibdk5s25QPCu5XAknzVwXxD43shmqtUYqTEZuPT23YInQUFXGQ/sogsjzU7+ 8V+49PABlcnOVgwlsQb4IfVgpbiskC7Q3FWDkRZwSC7GQIO2YxxkCJmYxOZCRloMzBO8 e1bMTLSDvbrwTcN7w1J9MtnPgR+SNi3ZHwDGDuo1h6dmFMRVrT0gpnrZrvQqZiwhN+pN rL0s/IvMVDmv4u+qlqiL6lycdO6Jduv9h4rUDE+8Dg/7ICNspFnuWIipzGtG+RFxmJJA EI1pXTRi1OKJm7q3h42bGjZ0MBdn6c9Y+hyW4JAsBxDGGU54GlObDPfNzzXrDB0RO6zy m3Ew== X-Gm-Message-State: AOJu0YwDJuwIy9z9LD0RyjYZzjxJUSs5GtR4jVyxO908cJTBFhWJ/B5k tcKdpvZAGj9ONcU8X8w4QA== X-Received: by 2002:a05:600c:3502:b0:40d:18e2:895 with SMTP id h2-20020a05600c350200b0040d18e20895mr2209578wmq.98.1703005287566; Tue, 19 Dec 2023 09:01:27 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:27 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 22/29] drm/rockchip: inno_hdmi: Split power mode setting Date: Tue, 19 Dec 2023 18:00:52 +0100 Message-ID: <20231219170100.188800-23-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730922520690321 X-GMAIL-MSGID: 1785730922520690321 This splits setting the power mode of the controller / phy in two functions. It's done in preparation of setting up the phy based on the pixelclock. No functional changes intended. Signed-off-by: Alex Bee --- changes in v3: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 54 +++++++++++++--------------- drivers/gpu/drm/rockchip/inno_hdmi.h | 5 --- 2 files changed, 24 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 9fea464b6234..e21f6d7aeee6 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -154,38 +154,31 @@ static void inno_hdmi_sys_power(struct inno_hdmi *hdmi, bool enable) hdmi_modb(hdmi, HDMI_SYS_CTRL, m_POWER, v_PWR_OFF); } -static void inno_hdmi_set_pwr_mode(struct inno_hdmi *hdmi, int mode) +static void inno_hdmi_standby(struct inno_hdmi *hdmi) { - switch (mode) { - case NORMAL: - inno_hdmi_sys_power(hdmi, false); + inno_hdmi_sys_power(hdmi, false); - hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x6f); - hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0xbb); - - hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); - hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x14); - hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x10); - hdmi_writeb(hdmi, HDMI_PHY_CHG_PWR, 0x0f); - hdmi_writeb(hdmi, HDMI_PHY_SYNC, 0x00); - hdmi_writeb(hdmi, HDMI_PHY_SYNC, 0x01); - - inno_hdmi_sys_power(hdmi, true); - break; + hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0x00); + hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x00); + hdmi_writeb(hdmi, HDMI_PHY_CHG_PWR, 0x00); + hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); +}; - case LOWER_PWR: - inno_hdmi_sys_power(hdmi, false); - hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0x00); - hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x00); - hdmi_writeb(hdmi, HDMI_PHY_CHG_PWR, 0x00); - hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); +static void inno_hdmi_power_up(struct inno_hdmi *hdmi) +{ + inno_hdmi_sys_power(hdmi, false); - break; + hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x6f); + hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0xbb); + hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); + hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x14); + hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x10); + hdmi_writeb(hdmi, HDMI_PHY_CHG_PWR, 0x0f); + hdmi_writeb(hdmi, HDMI_PHY_SYNC, 0x00); + hdmi_writeb(hdmi, HDMI_PHY_SYNC, 0x01); - default: - DRM_DEV_ERROR(hdmi->dev, "Unknown power mode %d\n", mode); - } -} + inno_hdmi_sys_power(hdmi, true); +}; static void inno_hdmi_reset(struct inno_hdmi *hdmi) { @@ -202,7 +195,7 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) val = v_REG_CLK_INV | v_REG_CLK_SOURCE_SYS | v_PWR_ON | v_INT_POL_HIGH; hdmi_modb(hdmi, HDMI_SYS_CTRL, msk, val); - inno_hdmi_set_pwr_mode(hdmi, LOWER_PWR); + inno_hdmi_standby(hdmi); } static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, @@ -441,6 +434,8 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, v_AUDIO_MUTE(0) | v_VIDEO_MUTE(0)); + inno_hdmi_power_up(hdmi); + return 0; } @@ -460,7 +455,6 @@ static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, return; inno_hdmi_setup(hdmi, &crtc_state->adjusted_mode); - inno_hdmi_set_pwr_mode(hdmi, NORMAL); } static void inno_hdmi_encoder_disable(struct drm_encoder *encoder, @@ -468,7 +462,7 @@ static void inno_hdmi_encoder_disable(struct drm_encoder *encoder, { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); - inno_hdmi_set_pwr_mode(hdmi, LOWER_PWR); + inno_hdmi_standby(hdmi); } static int diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.h b/drivers/gpu/drm/rockchip/inno_hdmi.h index 93245b55f967..a7edf3559e60 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.h +++ b/drivers/gpu/drm/rockchip/inno_hdmi.h @@ -10,11 +10,6 @@ #define DDC_SEGMENT_ADDR 0x30 -enum PWR_MODE { - NORMAL, - LOWER_PWR, -}; - #define HDMI_SCL_RATE (100*1000) #define DDC_BUS_FREQ_L 0x4b #define DDC_BUS_FREQ_H 0x4c From patchwork Tue Dec 19 17:00:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2084709dyi; Tue, 19 Dec 2023 09:08:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8aFCCix8a1YwS7LlwfxPRwqbp+E4r/0G0v/89mpduwBTcLf7sWEEtb4lx1Zhlam7ShPsc X-Received: by 2002:a17:902:e88f:b0:1d0:6ffd:e2da with SMTP id w15-20020a170902e88f00b001d06ffde2damr22891285plg.116.1703005733808; Tue, 19 Dec 2023 09:08:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005733; cv=none; d=google.com; s=arc-20160816; b=PPxBy2tXcGLK3Vz1aXgqjf3PSJA1kIfchwR4YoiU1MMz3b0SdYCJwAh1/it5j0MPyI qBFVmd95eu6/zQl7dwPF0N/tKbJoMbpNo5JLSdtc9mQNo35kGmkwodbBoiBim/mEa3ZO cV7R8SnzhWCfjyuWgU4g0kNoCCjRknNQLGg3yJ5PZLczloYwk7UiN6JAKsIrr0q0Y3AL 3xRHn0U3BXf5ZkkvDsutPdsarnwGXUWfQi9ms+xdQMTCjJbQuydGnmWOQ2nx6gs/oFcZ 1BwbMVqTBcmJn62QWtHlBYeDjPcuCuNLP2QoCsjHxz6KHwDuIyTXbPE4wgBKvb+KfqNs A6NQ== 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=6i2p9YgvuxkTu14agPnwE9rj1vc0S1z9mKZiq597B/g=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=Hvmn/ZXxz2QXE1MPCx5A6Qv6D9RoXyYZFSrHGL/JWquF/nq2mS2M1D0Z5Aa8Ue6Okm F1m/hncKX0hE05J+jIn0RflATVsFg9ae0zTIs6HzMcE+oHNMA2CUg94MT6f+KMFoffNG vph5hDKIfejGuYmPWz4g5dob5uIW3eUA3le2LCrqmCeSxrB8P0GpYDZcrSrEKWumLLUg /uMUTytOUUKeP6S1G64E9oN/qF+BTBOiGDvZ+Ou61ijPsJqyfGNWeKnnbPlb6ksJEYLg o0EaP6Cr2WxTn5pfppZML7OkKgZJcnOcdXCIEs+6agQE9ZmjVuJMMhbRYiobp5JBRjw+ oXGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hDVMarUX; spf=pass (google.com: domain of linux-kernel+bounces-5642-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5642-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u9-20020a17090341c900b001cfd5a36b31si20644925ple.495.2023.12.19.09.08.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:08:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5642-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hDVMarUX; spf=pass (google.com: domain of linux-kernel+bounces-5642-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5642-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 87E16285BAC for ; Tue, 19 Dec 2023 17:08:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C84B341743; Tue, 19 Dec 2023 17:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hDVMarUX" 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 2E7F43EA7F; Tue, 19 Dec 2023 17:01:29 +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-40c236624edso52674115e9.1; Tue, 19 Dec 2023 09:01:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005288; x=1703610088; 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=6i2p9YgvuxkTu14agPnwE9rj1vc0S1z9mKZiq597B/g=; b=hDVMarUXjYkRfpoTSkbQgZjwX9ibXocGTKvV2wb0vILQ2bZFdn5EFRvchEUMLx/YzX dScIannKKTeWdY3Jhzn9sPbRiSRavGE5T1ILPqU7SEYkFsIkVtGzUmntpdqckD5ZXfFv hudDjSikpWsnntNH7QuuYrgwPBNlzfjPpdDIn1wKv9Hj7LISoTdYn+2AtJL3Ev/2TTQc jlJ4B+oub1S0BMyEShRV7azYipZGjXYpwKrclijpASC7rsIz3UzfDo2OOqkU3/mfhq0d /a2Be4kO4uL1KuPv/LBwZnHHBLJgpUA3yiB6tV9q+lAVl4Y17uelFGSoNwyUurlvry3y j5sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005288; x=1703610088; 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=6i2p9YgvuxkTu14agPnwE9rj1vc0S1z9mKZiq597B/g=; b=d9FarpnoTU0A4rGN4F93buWgfCRwX0HWdsPooW7Yxh/QaH/Ho3d0nvdsNB1tGSOjER vlz93RVWRbkwcvmamZkPJ75VV60w6cWKrvt+57kanrEYrjZgJe02dZt893XbtFpoFUEy V0qQfqQk/1IoRSG8+x0mmbfsyApfOhFW40viPT8ymFd5cXVX2LOoKxEilTr3RUPKMGWT s2LDcO1RFUxW7ZO9NlcaVhfEfabvvPW1aTpEf5x8bN0ZCtpbK6fBMkxGdFQm41RCFALo wCGI0+HF9lBLkjbRaa7Q2sZSl3DERux28cBiVfDF7kYqh9GUuzFMeF7C5hZfw981QTfd js8g== X-Gm-Message-State: AOJu0YxHSFBFnHeQKTJkodtsgBWQxL0Sv2Y5h9LMHqplbg1jZvanLUzX iT7aHztRDNoFPC5u7oBexYSBrUiQzA== X-Received: by 2002:a05:600c:1d12:b0:40c:93f:5da2 with SMTP id l18-20020a05600c1d1200b0040c093f5da2mr9354501wms.33.1703005288338; Tue, 19 Dec 2023 09:01:28 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:28 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 23/29] drm/rockchip: inno_hdmi: Add variant support Date: Tue, 19 Dec 2023 18:00:53 +0100 Message-ID: <20231219170100.188800-24-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730940302714329 X-GMAIL-MSGID: 1785730940302714329 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 changes in v3: - adapt to the newly introduced inno_hdmi_power_up / inno_hdmi_standby functions drivers/gpu/drm/rockchip/inno_hdmi.c | 74 ++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index e21f6d7aeee6..df979bab9abd 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 { @@ -113,6 +126,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); @@ -164,12 +201,25 @@ static void inno_hdmi_standby(struct inno_hdmi *hdmi) hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); }; -static void inno_hdmi_power_up(struct inno_hdmi *hdmi) +static void inno_hdmi_power_up(struct inno_hdmi *hdmi, + unsigned long mpixelclock) { + struct inno_hdmi_phy_config *phy_config; + int ret = inno_hdmi_find_phy_config(hdmi, mpixelclock); + + if (ret < 0) { + phy_config = hdmi->variant->default_phy_config; + DRM_DEV_ERROR(hdmi->dev, + "Using default phy configuration for TMDS rate %lu", + mpixelclock); + } else { + phy_config = &hdmi->variant->phy_configs[ret]; + } + inno_hdmi_sys_power(hdmi, false); - 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); hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x10); @@ -406,6 +456,7 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { struct drm_display_info *display = &hdmi->connector.display_info; + unsigned long mpixelclock = mode->clock * 1000; /* Mute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, @@ -428,13 +479,13 @@ 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. */ - inno_hdmi_i2c_init(hdmi, mode->clock * 1000); + inno_hdmi_i2c_init(hdmi, mpixelclock); /* Unmute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, v_AUDIO_MUTE(0) | v_VIDEO_MUTE(0)); - inno_hdmi_power_up(hdmi); + inno_hdmi_power_up(hdmi, mpixelclock); return 0; } @@ -821,6 +872,7 @@ 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; @@ -830,6 +882,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 +981,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 Tue Dec 19 17:00:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181118 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2085207dyi; Tue, 19 Dec 2023 09:09:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHk6TPR1FyrQGvlRG2BjICwOfOKZdqJIbbgRn5DfgUp0JAuTTdIcmIQ0CjHnxcPZs01uF0M X-Received: by 2002:a17:90b:180a:b0:28b:aab3:ad45 with SMTP id lw10-20020a17090b180a00b0028baab3ad45mr1785875pjb.71.1703005772252; Tue, 19 Dec 2023 09:09:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005772; cv=none; d=google.com; s=arc-20160816; b=CdH/fDks+UHWu1hQ6z05670ID1+/Z8N41smOoEFzKnw66QN/uy6yj9DpiSPP+qn4x0 Om3HhkdhYm/18QtWqGPT7F7AniMvUxus2gvbYgucONspMR05dWGgraGBvvypfH1C2sQ/ +80jAK5tHRuWQ1DYMCUF9D8iW69LxDGu5ennYrouw+qrpIRaHEeh5oB5dLUyWXcuNGrN XyRDllHuUkEy5vxMBzMkbNuukCo07iTNggSAufZh+vUfG7Bwq4VRDJi+LhsnNtgAGv5N XY3Qechk82gRKLrPPZpyucb1rDuBoYpxbX174H8qbrcy9yeT+Tk1iJeAxQ1/NK1cJnck NE2A== 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=yPHQ4Axf1Zj8/9D5WH9YQvs+oHeh2coMc0soFZ2d7Pc=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=iwQ86HcAkFJgELSeozh/QizO+bz134ONuakgrcbtFZRH1YPUD2/rb9JVzIlF/J0YuD RGUv1qKcKqqN0Q2iFxQDK8o08fbPv0nYkufTJc2/1idSOk3gLJIi0GeEMA0dql4r7Zws XeHQnb6jRZugFeHVYHNjo3ozuqgAgHf1YAO9uV3jy+zxGjbBrF2GF8ow52qY5LaPUESS ZEx0hzkY/T28zPcwp6tHSzIv6V1YyV0YvYwpa6zuGKLTo+alJ5bNBpW7+8B8HksPAdPv LftW/qlYy3WkUpFSXQeMChcwnX1Zs6Wsr966f6Mp/Lhd7fH9pr0gj2RY7c+NocVCW0Ri Uh0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SuEqlBue; spf=pass (google.com: domain of linux-kernel+bounces-5643-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5643-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c21-20020a17090a8d1500b0028bc058d350si907311pjo.163.2023.12.19.09.09.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:09:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5643-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SuEqlBue; spf=pass (google.com: domain of linux-kernel+bounces-5643-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5643-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 E4008285CA5 for ; Tue, 19 Dec 2023 17:09:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5367842062; Tue, 19 Dec 2023 17:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SuEqlBue" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 1E11840BE8; Tue, 19 Dec 2023 17:01:31 +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-f51.google.com with SMTP id 5b1f17b1804b1-40d31116dbeso617565e9.3; Tue, 19 Dec 2023 09:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005290; x=1703610090; 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=yPHQ4Axf1Zj8/9D5WH9YQvs+oHeh2coMc0soFZ2d7Pc=; b=SuEqlBueYYAPCOfrwNoyduvyb6y8VuQy8DnRXpKZhrMjqaw/slOw6kSClqFBM39NOo K5KRd7KRA7tyk9fMLpjLADObKyvS+F7ApE6krdcLbwMLOn20jNOIFJvm8Ho9/S9665Xb nVJ5f8LgJjZ8dDBdF1jq2oqyDYNhwnPLLaVZCjTK4veQlbUCeCbfCrxiLKla4NsKlG5k +a4auZdUCd6xEBREUQxw8meU2/0eZBM98w5jtg5w3c/l46Bq5TlhWBj9M7J4sFZ5jvBH iexU4THgkd173Z8PjAtPo9i7E8H9S5gphA7Jlwi2jfQRz4pxysaFnNO7jG5WsSsU8c5w blGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005290; x=1703610090; 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=yPHQ4Axf1Zj8/9D5WH9YQvs+oHeh2coMc0soFZ2d7Pc=; b=l5gVJhQif+BFzqXtWxA7nEAiC74bCWimC7hcICVPoCjU1aCbTpHgJBHHdxQvxpEl4N RaHn+XylsM7xHt7O2tJCTS+C10kOXFVhWC+tQcTBjsOp98OjlPINgLvIi88b+1zsreya 30mMK4eWRILk4KuKsPovnhUOL3Pw6mrvmlUGCvcd3rInL2ACXXlV081P9wwJd9cvS6v4 s+LnTLLB6j/erq0wbj/H56nmgoJ0pywYmkNP3aSsl9kwTadhpuCVAM/rNI+bfQMPiLJS F82ol8ynGU3G6LrBa1gapJvHjpdhWM/LoyDtux6p4CYBzMR0CqQJseqROItZuGx0hW1L IHIA== X-Gm-Message-State: AOJu0YxvPTqwOks2BFOzZZTuF4TZKKsyyJFesHT5bsi7glEcBvBTriAW gYDlIZAhVkj+apQJzN8zLg== X-Received: by 2002:a05:600c:538e:b0:40d:2055:8088 with SMTP id hg14-20020a05600c538e00b0040d20558088mr938934wmb.158.1703005290201; Tue, 19 Dec 2023 09:01:30 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:28 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 24/29] drm/rockchip: inno_hdmi: Add RK3128 support Date: Tue, 19 Dec 2023 18:00:54 +0100 Message-ID: <20231219170100.188800-25-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730980370196563 X-GMAIL-MSGID: 1785730980370196563 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 changes in v3: - 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 df979bab9abd..8a1a2320749a 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; @@ -132,6 +133,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) { @@ -905,6 +912,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; @@ -921,12 +942,16 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, } /* - * 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 the 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. */ - inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->pclk)); + if (hdmi->refclk) + inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->refclk)); + else + inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->pclk)); ret = inno_hdmi_register(drm, hdmi); if (ret) @@ -950,6 +975,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; } @@ -963,6 +990,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); } @@ -986,10 +1014,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 Tue Dec 19 17:00:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181120 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2085468dyi; Tue, 19 Dec 2023 09:09:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgqMlJ6fHEr0NKIqeJoZ5kO078JyUG3zWq5fPCR6IQgxVwnFao7Duopbac61hTiOMbRLRs X-Received: by 2002:a05:622a:92:b0:425:9a02:4d76 with SMTP id o18-20020a05622a009200b004259a024d76mr30084247qtw.30.1703005789988; Tue, 19 Dec 2023 09:09:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005789; cv=none; d=google.com; s=arc-20160816; b=ZitQLilUPM+hEEnqlmqq3axRGstpA/88QVgPr16ZoM/hDf8ixIuIdmfauHznmrVoMv jIPvFNupQaxv5VzMSBquyaSA7yjXaoY5RY7WGHU1G0mPoW/EZiAWVXSLrg+lrLMRcuHM kPd2NkXySizL9a5Iyq9dSjYw4/NT/0kJ5d7ztN4sdWvDoAiJHf5nX/Zb/IycyB8rR0wt FARPOJ71eJaSQFDXOHsOlSuTuoNF7golKsopgB64wln0YLh9oCmYmSEiTUhBK+QGdIWW i90r/TgLz6bB/x6N5roHa5/1Y8RWunk+xxhu1zDtKmdiecy6yBHTTJpEnEX9tXp5RCay wx1w== 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=lg73sX3i9a8aQACa3LQIeyAKZ2sxvdHhoE4dFqwZeRk=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=J0+0VfN/6vsuvPyXD1aBt7eB92Wacr7zV0ltFkZHvGmn0sFbWWR8F3H92d4TjR5QSR mnrRNgW0NZCTfotb6zbixzj9Sy2wZ9+K2h47xr7GOomaZBcf0hmFOR5uN0N7gXLQlvrQ dMOQrYHa+zPMF8MARpjn9oe7+qTctXQiVQ4FljwpSL2xkYBFljITriaTNpQ75uxl43DT Q7ywvcucW1M8SPzwfSfvaTIcppUSNxrNyIZexUfCALbPy1dS+JlDEdG2n/etoWFzoDYA SsufrnvZE/3FKhcxw9B95OjzULeN0SS6TnFS5o8KU6ozv0/JO5MJ2MCiZKyH3BwY0Gf0 gxhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XlocDPac; spf=pass (google.com: domain of linux-kernel+bounces-5644-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5644-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 en11-20020a05622a540b00b0042753e679dfsi1433638qtb.587.2023.12.19.09.09.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:09:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5644-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=XlocDPac; spf=pass (google.com: domain of linux-kernel+bounces-5644-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5644-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 3426F1C24E42 for ; Tue, 19 Dec 2023 17:09:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B31F24207E; Tue, 19 Dec 2023 17:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XlocDPac" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.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 CC75040BFE; Tue, 19 Dec 2023 17:01:32 +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-f42.google.com with SMTP id 5b1f17b1804b1-40d12b56a38so39146185e9.2; Tue, 19 Dec 2023 09:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005291; x=1703610091; 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=lg73sX3i9a8aQACa3LQIeyAKZ2sxvdHhoE4dFqwZeRk=; b=XlocDPacYVHgSupznSKk4CKMDwHhcuRui0K1xzG19Z3UgDJ2lW+Yf7UxK3vyTXm08V Qm0+rTx80yjhqeR5HU/FpSVbnt7kGc4qXjjA7M5PANM+ebViri1nVDM8+7eUKLWT4k7k 8YUWZyaqS2gyuxe3QPdTe350EdmKCr1putAzlL7PDUR428Nz0fCxKTOyD2BqnknPnvxC m5l9D4pfO0oPMa1w5msSWD0XJSS8fjgCqkFmhv5iRglGr8hOJZd3lzrQYJgVN9k+/iIJ 14tPYheQ0aVmngizn+gsQRi7DhqDYHNq2I7jAFBiNN7eTnUpln2RcZlM4JBJeB47ppdL NN9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005291; x=1703610091; 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=lg73sX3i9a8aQACa3LQIeyAKZ2sxvdHhoE4dFqwZeRk=; b=ir+yfOiWGOnY4iQ82h0mjcIJyxeKV3oVi4IUmyW42q92imjdMTIBYfIoIhKfjTVlmu T3E1sJ5fOHo4VKmBTzKjx0AqlgkQIsPc9yG6lYnmfDpR4B0mMU9locw+fnJVDmCp6hM4 Ek+dwj79W/Xlj1cQbLCOxKlj2KH/pim6RYSpjimXTxyyuf86SFKPVKagpBnuaLIcoWgu whTt2rpEUiaymIa9nFbbneO6myLhvWMwmeb9OsNMoUl1rJRCtT5KHsUPbY8ete2jsgf4 iWfrSAtfFdn24PjBn+HIYVfEy7K2N1ntTXsvZOcQRK4fR3zChZC/nmaqeepAO3KbQsT9 EkKg== X-Gm-Message-State: AOJu0YzOY/o6GmDRZqxzTfU+y4pB8hqTkrazij0whjnbT0AvH20XpcdY u7z1Bq6+/8H5NA5VFi028A== X-Received: by 2002:a1c:6a0a:0:b0:40c:386e:6aa2 with SMTP id f10-20020a1c6a0a000000b0040c386e6aa2mr5197610wmc.55.1703005290969; Tue, 19 Dec 2023 09:01:30 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:30 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 25/29] drm/rockchip: inno_hdmi: Add basic mode validation Date: Tue, 19 Dec 2023 18:00:55 +0100 Message-ID: <20231219170100.188800-26-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730999082474565 X-GMAIL-MSGID: 1785730999082474565 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 changes in v3: - collect RB 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 8a1a2320749a..a2a9e54b76c0 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; @@ -497,6 +499,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) { @@ -529,6 +563,7 @@ 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); struct drm_display_mode *mode = &crtc_state->adjusted_mode; u8 vic = drm_match_cea_mode(mode); struct inno_hdmi_connector_state *inno_conn_state = @@ -549,7 +584,8 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, inno_conn_state->rgb_limited_range = drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED; - 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 = { @@ -590,7 +626,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 Tue Dec 19 17:00:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2085586dyi; Tue, 19 Dec 2023 09:09:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEolhPUt12LxVnac1Ib76wTqKMYIYIXb73zeWKy3ZFmgi2M13ZILWAzxcObw1AA6Om5cR2u X-Received: by 2002:a05:620a:45:b0:77f:6bb6:a50e with SMTP id t5-20020a05620a004500b0077f6bb6a50emr1885039qkt.12.1703005797394; Tue, 19 Dec 2023 09:09:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005797; cv=none; d=google.com; s=arc-20160816; b=ERgZF8/x8+/7RiR7FxWN5iDdBhF/4fHxnVSujt1Dna9AWouUBQ6s/dEXUK40SBgLvN yyc3BKRmAhlujaJm5V8s0Qt5y/rzawzMZ4uz0ITcZuzoG+cnjzi6c7eS89af44rJVBSI yJvKb6W+rSU4jeN+ZlvEJHLpNolmqRN6xSxG/ImoPUFIhg6oTQj0E7lEJ5VrsDrlTqOd kQXdAgfJ2qv6Q9qH2p0OF/xKuualHxAnm2JWgw/o+Bzhy8QCgXBaTzpRyri3v9n+NlKR xY1or5j5PLHtfLlMEoJUeYwCg6qrs22SCMei5LTk9VQFMAJk+c2Z8ZxNmXmqRbK7+PVy DSfg== 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=arQ8xIKVUtWj1nUwdouDUReL6yFeDt+BlaNGpwFH10c=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=P8MI/xziTnCckd5UHsXZUkTejpeYen0HhYhbO6OYBxWTqH4qJOWjr4WP8RWrnH/+mk nzXo8LcvrKdQOdQWxOMuz3hE5RqoTXQ3Xf4lzZheFwdCgLj34uDrlWmISvwVcXjk7Qqi cGdEizsdz17499KhoNQVH4wmGly9BrvmNE3UwpjtP4rwHXXkiEi6P7G/B1kRawBsX8dF rqJft9Kuxal/+lddJ+jezLD9xPAqqLQBDnXLrxZo+W7dLww1CCjCeGkF1oCfvE4rmlq5 pj1kiD4KpFWRjiQBAQj7g4kF46Shh+K+pjwiBdChJ7rTHQzDp/bTNqigRf0HuQ/bRFEw jK9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RbTs8Oo7; spf=pass (google.com: domain of linux-kernel+bounces-5645-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5645-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 e11-20020ad4536b000000b0067ef4df6098si14747738qvv.127.2023.12.19.09.09.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:09:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5645-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=RbTs8Oo7; spf=pass (google.com: domain of linux-kernel+bounces-5645-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5645-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 308A61C20B9E for ; Tue, 19 Dec 2023 17:09:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A19644C98; Tue, 19 Dec 2023 17:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RbTs8Oo7" 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 8970C40C09; Tue, 19 Dec 2023 17:01:33 +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-40c2308faedso56875975e9.1; Tue, 19 Dec 2023 09:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005292; x=1703610092; 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=arQ8xIKVUtWj1nUwdouDUReL6yFeDt+BlaNGpwFH10c=; b=RbTs8Oo7u6lWQN4ritpdDDtCnEZyYNqr3daLnGr3XpV1bsq24lQMnl6xaFRlc0Vmry lWaMXh57LHQqN+Asnv6Lps9gJb1mjKoP7e4DFObAwbE1hdzrzQOQ17D5op3/SFya+obg HJtuEXY5vtEImSmti0fqPLnGLXc6GOrkb3wBO1ibeNX5FkZP6waVw2IFEnJvq4Zgxyje OthXovLYBf3dale2ZvJ3GGh4rlgI/q8Ju63KHrczvWCD3DxvqBhu9v+o74fZ9EqHK0ty h5VqcmKzbQ0DT0rdS9TvSShMyVIfY/I/xq0SgjxneJlorPIu1ZGl+hwKwFaVRyseipC+ /p9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005292; x=1703610092; 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=arQ8xIKVUtWj1nUwdouDUReL6yFeDt+BlaNGpwFH10c=; b=MvpTSOV/JzNJLJN6CWfiv1aCGdBHqcBVSRx2mTatLH8IcV8U948Unrpx0rKNykG7y1 3cF1YYpQ6TQj84ruh6OSWqpScf1AHARxe7HXbIxXgQ0gQrAlJdKWxz+ZA+ElxOGYGdhD Gawg3klC5pJlog+DPAQXj2nKv8ePExcpXQF7AayAV+4yFCUcJQB9XBsGBRqNYl8d9IzR 34i5WX7BaW8AiL95W5i6xkxbX9eoq4lduBJaV2mhf4fjzzEJrZxQGzmgfnf8kgJKdY3x JiYUxEXjM+FnWGMmHQwGHjqTWIbcXPwIksnNA7P6ulTGvWZ5zHB2H7yPN2u1nJTI7oCr oC2Q== X-Gm-Message-State: AOJu0Ywq7Iex7av+xEAGYormncQf7FhZC5+0SNKj7DhPMESMi+rR0EhB SdIx3kbqi9bDrY4bBh0F1Q== X-Received: by 2002:a05:600c:4f52:b0:40b:5e21:d362 with SMTP id m18-20020a05600c4f5200b0040b5e21d362mr9931502wmq.107.1703005291752; Tue, 19 Dec 2023 09:01:31 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:31 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 26/29] drm/rockchip: inno_hdmi: Drop custom fill_modes hook Date: Tue, 19 Dec 2023 18:00:56 +0100 Message-ID: <20231219170100.188800-27-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785731007371175502 X-GMAIL-MSGID: 1785731007371175502 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 changes in v3: - collect RB 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 a2a9e54b76c0..29a2c1b87294 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -631,13 +631,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); @@ -691,7 +684,7 @@ inno_hdmi_atomic_destroy_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 = inno_hdmi_connector_reset, From patchwork Tue Dec 19 17:00:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181123 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2085736dyi; Tue, 19 Dec 2023 09:10:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGc0yzXVPiAK2UfsrJt7Qb8EJXk+y3OYU7Eeg1HTMVvxRtkGnEMChj2TGloB8kpaUfeAFlp X-Received: by 2002:a17:902:e746:b0:1d3:c405:e829 with SMTP id p6-20020a170902e74600b001d3c405e829mr2532145plf.119.1703005809479; Tue, 19 Dec 2023 09:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005809; cv=none; d=google.com; s=arc-20160816; b=WvrbO55kOTu6EBGvtPndhSx2n5GuVLSzv/Vo71FxHiI44TCcFwgottH724AZz+KtWZ 4iFvkMKEY60C5kwnGINCiKDax4ND+rJyFkxhHewHlaCcDKHu/TPzAR4Lcp2XDjL+kzHx UxVCxD4UY91CkQyRH737o+7MxuKm8eCnWTfmGhoMNkklqyLx1BE0+ZUrBiSrGWg4oUO9 bfmrINy27zdY/uzpWytUqFiTdcYNa1BNgN/QkYbDi3vEPA1HuFcqVWUXg6OCY5zdIKxV Ome1N6sqBb5a7OOKYP42MMZfr5lGV7+24XOr9xOcooNLTPYHfGYwAQz6TSFOAnolDwDk ADEQ== 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=Fkhg2+aCs7jdMgzfxvYxQH9D4wpiG0MxQ7esIiT4Fss=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=PrwjH7B7NcaEK5zhr+1aJrruPUeynjmdZRqccQJ9Lfzd7oPRlyCUt+zV+4QZG9OZUl btQklZA2b3jv2VB5RlyTpEbXXMGDbWYnbMS9VbVtT79Hui9LtOJkVBfx3KBjwEerpBv0 yVPjdP5geBw1zw/PZAnpEcq4e4uAsje1KEnC7GCeCt+SAtkXarIEisaweLbUNTK2Xwuz L9Xknyo2jQySS2yBVqgWE0FG4WT68YE0D9xoo7Vt/jOIgVgWes02DzCZZ0xxI2EdslKw KudiojSqCniHzWhVI0uBCgu0Ox9xavsMwFRPDZUyEqgmtq8EhWcYnDAP3K+fpWTCYJXf spFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HWVyosnY; spf=pass (google.com: domain of linux-kernel+bounces-5646-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5646-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jv11-20020a170903058b00b001d3de593a25si1284420plb.365.2023.12.19.09.10.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:10:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5646-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HWVyosnY; spf=pass (google.com: domain of linux-kernel+bounces-5646-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5646-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 457B1282D16 for ; Tue, 19 Dec 2023 17:10:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACB7D45C10; Tue, 19 Dec 2023 17:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HWVyosnY" 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 3428A4122C; Tue, 19 Dec 2023 17:01:34 +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-40c236624edso52675025e9.1; Tue, 19 Dec 2023 09:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005292; x=1703610092; 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=Fkhg2+aCs7jdMgzfxvYxQH9D4wpiG0MxQ7esIiT4Fss=; b=HWVyosnYBT9qd7Siw2XO6SRefXBcxmMm0GWL7vf5MNPyjxV00ZX5NY3rH0uB4jMCF3 Et98m9PSx+GQKKcUSHfGMRX6MYd7N+jvxhOzkw4XfVuxaOgb395C9dY9/aB33JBuUU7O W6k6fxCthPO+Kw50jBTgvvdBq+O5KyEeGtlhSmNajr7IMl81Q7EZnlJk4CWlmLTlqOIE MQV3v4iXZXiu+wPy2VAF0DIiAhlPvmf7OWvsylptxNP+3PXWLx2XDUMF5Kg5EznsCgkz /c36loJP9sDltJTCOXrYBVfycDeKjgMwL5iWb/oZXZ6UMWKTTYNE+kchNOEFkXNSAfZJ NJhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005292; x=1703610092; 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=Fkhg2+aCs7jdMgzfxvYxQH9D4wpiG0MxQ7esIiT4Fss=; b=tEnNId9PMN/86vefeb2LtYPl/3GRM3Vv+5oVomifr6hBORSItTPWX/wtPsLRKLZJT8 oJdeya+WFl8bjK/WK5nPG4q0WcUyr0JzxZ+MypW3I3bmmUUey/fVjVKpfdr098uYdmPn snlmh8EEbgNS89hTmmwlCJqXC5JFFf5VL6YFxHso3Mo32f/uozTIcenmDLYCx98qNWBr tKkn0DQk/sIsPgihWJyPgXEVcyikF7PwOMcLvfh8EP47IZ4/zQoOEeybLK1e2FMfmD0a 7NuYSabjDEmcB/lv0LAjmH4l6VVqR2q10xX4WCzwtH9kgI74dyD2rmdZPHZEzSuNdAWv E32Q== X-Gm-Message-State: AOJu0YxvNtm4WfVC6u1IQISBl3CYRGKgCgNZvLWOd64vI58jUzGJz12s aYHK4vD/K2G1IRgO3vgEGw== X-Received: by 2002:a05:600c:4710:b0:40c:6b6c:6867 with SMTP id v16-20020a05600c471000b0040c6b6c6867mr3950390wmo.178.1703005292435; Tue, 19 Dec 2023 09:01:32 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:32 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 27/29] ARM: dts: rockchip: Add display subsystem for RK3128 Date: Tue, 19 Dec 2023 18:00:57 +0100 Message-ID: <20231219170100.188800-28-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785731019727646559 X-GMAIL-MSGID: 1785731019727646559 Add vop and display-subsystem nodes to RK3128's device tree. Signed-off-by: Alex Bee --- changes in v2: - no changes changes in v3: - 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 Tue Dec 19 17:00:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181124 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2085874dyi; Tue, 19 Dec 2023 09:10:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlx0JlwFmKLPt971fN4UBrQjXqBzX//R16838pjz6hnr6IdkxYgqOJGwhpw6bIDZ+ISX+5 X-Received: by 2002:a05:622a:148d:b0:427:7ad1:2e61 with SMTP id t13-20020a05622a148d00b004277ad12e61mr1150901qtx.20.1703005819803; Tue, 19 Dec 2023 09:10:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005819; cv=none; d=google.com; s=arc-20160816; b=bPlp/5rwH41uO+/uKzuXn/Qi7upXAKr79/K3We0awIRaLNMvTfyjBpBY1AH3EnghBW dQIY3enMhBLalWkvktZZKhNVDi8yeVb+6JryqxdF/OO2ZuuTc5GPehCtkoPA0mDRndar YCouASiwRSRHFWJGBUb2iJk9K9yy9bchPc4WSrIS0PoFQ3tmy5Waq3b6UWbijXQYZxT2 P1rhWc2eBigWz53tW+UsgMxv69D8wBOZnDHn9e/icdBq+cfrdvQ/WRhgzm5W2Yf21JCP cC/9ONc22djDYL6jeAIiaUcfiX3XVlO3OadKF2mUd63iPsmEPbZNgFd73zNAIHijz69S jbxA== 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=824x2Bpa+BljPPIuTHpPefnYLDXHrvCUJjy6fbKwCl4=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=0388w6x+fTielO2JMq+LH4C4ISOq8Z8Umfk8o4DFWNp8xYrnVbx7V7HiR3lzOqxhXx wq+q/1RILIh102sWme/qVMQZ3EL6rG2gvbHJHz/uh5xtXEpUAB3lEIS7lW7bVg6zfgmB tyPrxYjSS1S1At/khOZCdMXG2T2rXCYpxEHa+gRhxbSf60aGfaUIMdGRZiiUBkJbUr1e jHSroYB1dJaYw4a2AhoESA1EGFxhiKbtIFU6J7lK1O6owuxuGbsCN4vt+srbm4J66Q34 mfNBh7h/EIJ5vP/0GTCZVYjY2nbE94B2saZ6LFyQDo6PvJ5lNEFM/mzhXIFka1KfWxBH ADYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NHKcMzD5; spf=pass (google.com: domain of linux-kernel+bounces-5647-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5647-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 ga26-20020a05622a591a00b004236ece3e88si29325150qtb.217.2023.12.19.09.10.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:10:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5647-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=NHKcMzD5; spf=pass (google.com: domain of linux-kernel+bounces-5647-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5647-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 8CFE21C210CC for ; Tue, 19 Dec 2023 17:10:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6728746439; Tue, 19 Dec 2023 17:01:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NHKcMzD5" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE9D241765; Tue, 19 Dec 2023 17:01:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40c48d7a7a7so45246655e9.3; Tue, 19 Dec 2023 09:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005293; x=1703610093; 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=824x2Bpa+BljPPIuTHpPefnYLDXHrvCUJjy6fbKwCl4=; b=NHKcMzD5kz4JJBN9t/AiBafNPcinA9wVedX1l7eCk+auyXL/DiXTmrrM+2xPJHkw+t U4i6fvrCUtxdsQhLISin4vKRe5B4DsQp2uYONVoJ4/HiPUPeB2gmQz/kP+AdDPNrgrX/ I52o995huN3kO9yPQMobuBWNzPpP5tuQxEISgGojiWsTQDHN67jY2EbRS2if7gIq0VKw htL7z3QJqXUfwbzzba5NcQ3mzVr1+X/bnFQkC3HZv9ZgIqurf3s2Tcp0XD8tUZsSHzeV HoqFW00YnsQhsVZW9iDo1KRHvERrq8FgB1enyJS2Q4O6hdZo2AsKToa07pQEsXl+ITAY GEog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005293; x=1703610093; 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=824x2Bpa+BljPPIuTHpPefnYLDXHrvCUJjy6fbKwCl4=; b=XkujLbyTPpx+bZ9HhaDza6E9zChuMK1KDpZIB3makN3k4335HaDrh8Gfqa2K1LSW9d cwHYh1xY4S6syP875dc7DrOSUFdYgUmVTuRkomfUh67Xz5ES/wey77Jn5N9GczVh5s2Y MdPYxco7eEGgMFeYJWAYm+yUW6oASncKtcDGH086fC+mfcelgQLlyNeHMNKV4y4luomg JobP7GUXnGW6KdkDHli3ZI6yHp8cd/s5cN80tdivJLimCOMvFiGDy00BSdvFeEGl/BV2 tOLaL+qqxu7cGNmWlzSieOq7KhWTFxjfjeRRjFwqSW7WTTRJeRwtvksMgEJhdn5WmaLH MbEg== X-Gm-Message-State: AOJu0YxGydSoaKW7r7Y3uyqVS1PyvdLwJ+FiVp/qSG8vBI8bWbLza5FN bozSNdV2zPq2h34MmVcptg== X-Received: by 2002:a05:600c:4c8a:b0:40c:d3a:2447 with SMTP id g10-20020a05600c4c8a00b0040c0d3a2447mr11436802wmp.87.1703005293173; Tue, 19 Dec 2023 09:01:33 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:32 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 28/29] ARM: dts: rockchip: Add HDMI node for RK3128 Date: Tue, 19 Dec 2023 18:00:58 +0100 Message-ID: <20231219170100.188800-29-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785731030568882865 X-GMAIL-MSGID: 1785731030568882865 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 changes in v3: - 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 Tue Dec 19 17:00:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181125 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2085983dyi; Tue, 19 Dec 2023 09:10:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyjaZquC+JMiPfe+RM8Mnbifh4NR948chrvolGjIe3NAei3oHznNBb0Nb/UxzlQD+k0eOi X-Received: by 2002:a05:622a:1a9b:b0:427:8376:a2d with SMTP id s27-20020a05622a1a9b00b0042783760a2dmr313499qtc.67.1703005827348; Tue, 19 Dec 2023 09:10:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005827; cv=none; d=google.com; s=arc-20160816; b=E13YD7x9EZGakH8qlDvTzJCpR0rCf2ZwcnSACalLP6g6bbcBovJwigS6wXcsAVOeC1 Q8N5qPDFYmuY+7LPMUSUoyw5MYUrlzg0nKdkEewhLAzkZxOv06GwrLFfDOAT/pu8b22f snyf/5yMv2/I1gJhpEa4heF1eQyXzwvsAcTw7911GXiFSMBeTacQVE5dt0bza0M2T7q7 DtGtOGb54gKiKUDqhBq8DO1rnOM8Y/bjxVO/psETObU/XSxbNgSdYI1nWfbWnNwa21wT DuRHRN40s8AkOEdELYyxHYhm1L9ap5vtwty5J2j7w4WSs9pSe+MiSc19nGGE2TsWh1C1 JkkQ== 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=DcvRB7T9fUAwMybq5GgUQQU8bu+Y05ebI2TjIjKog/c=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=ZRRwD/OTtGUmHuLvnTN3B8SRc+5iSiN2PTixgFC8mO+8HqlxVssvQBijB0m1GdBcK5 7njIIoG77FNMjWV4+aF0PogIt9CSpvwHSDCyK4gq0MsVmP8bm98bn3LvV7Z4ywfctCdQ tk34CCsPK5+jDJRoPYcC61uNGvae2ruKMeKc5Lr7C2M1WU2h3U5VNznHn0Ub5KAN7vDZ mcCh3YxEsbmJ8AHjgGofnimjZIrgQecXqh1uvCs6p5bS0buw8B1kbGWYEtVYF1p1xtAU YsSkjdgJ2uN+hoYavCeC0OsqnLyLggRdE05xJYWG32yB/vhnVpHreIOsW27d3ZFvbqG2 WO7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=j8lZdZ0d; spf=pass (google.com: domain of linux-kernel+bounces-5648-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5648-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 bw13-20020a05622a098d00b0042540184032si28265801qtb.336.2023.12.19.09.10.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:10:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5648-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=j8lZdZ0d; spf=pass (google.com: domain of linux-kernel+bounces-5648-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5648-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 23F701C21405 for ; Tue, 19 Dec 2023 17:10:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39C5847A53; Tue, 19 Dec 2023 17:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="j8lZdZ0d" 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 BEF7A3D0CD; Tue, 19 Dec 2023 17:01:35 +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-40c580ba223so60191405e9.3; Tue, 19 Dec 2023 09:01:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005294; x=1703610094; 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=DcvRB7T9fUAwMybq5GgUQQU8bu+Y05ebI2TjIjKog/c=; b=j8lZdZ0dWNbkJjNjWdpoR7Sq5N2+WsPqhjfDPTYNw0/osbeikjFrURkBs3T375koqJ tL2vMmY3Io5SVPXnPvsZUkkDNjYSdp8OiQXOv0SOs02pEKhj9MWwvqRNz+PVfYnWsx1y 9a3qEcgQCr9vtcbZ30ubodk33XElhLxldhwOXSPb6uXfnQCR+61YbMerK+tN4TD+3Zok Et+z9dplwGUy/WxbB+lDK+wiMnC1qhUlvDR5EliQbBhomWUbD90KevryJGKSXvb5HORW Iiierd/i5ks57dO7Ng3LDebTD/fZYA0fsjPDMZmszgPnVkgMA0SMAl3HgLdE5j0LWGfl nx+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005294; x=1703610094; 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=DcvRB7T9fUAwMybq5GgUQQU8bu+Y05ebI2TjIjKog/c=; b=vcR4IkPAADdwteu98XyiYq6w6p+fMTaXgklt2ZI/ZVWP/2I8wAAbpNg+TtLIVrLoRV oeSY6ej2j9zFVuuyeY3cDnzlR+7W66MUkLK2jSqw4SQovMk012E+d4XdyDTzT5XkRhJa syYeznYxsf+6akAW/asDqkIsQ2Nkp+eCK1EmewS0TPOmc4ELmBfMO4EUAw/+hgiBvHEv 1aYViLGO+fHe6X2hSX6UkeI/6oiFAaBQ5uldo+jpfp/hUyKxdojU1qKemYg6Tmw8H0wt QhYWARRTHn0fimx+ChpBTurV55wkjNDSqNZxwZDxppAu/g8mjs7lI0nI1ZvXUnzTJFHd zyNA== X-Gm-Message-State: AOJu0YxT059MkROAJt7v3pdPkIaMkk4Lja1yHipgbebkp1bEZqf81G3C u8QMsSNI6M8/DVRFhxXFdw== X-Received: by 2002:a05:600c:354e:b0:40b:5e21:dd49 with SMTP id i14-20020a05600c354e00b0040b5e21dd49mr10028636wmq.119.1703005293973; Tue, 19 Dec 2023 09:01:33 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:33 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 29/29] ARM: dts: rockchip: Enable HDMI output for XPI-3128 Date: Tue, 19 Dec 2023 18:00:59 +0100 Message-ID: <20231219170100.188800-30-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785731038475395129 X-GMAIL-MSGID: 1785731038475395129 Add an hdmi-connector node and enable the hdmi, display-subsystem and vop nodes. Signed-off-by: Alex Bee --- changes in v2: - no changes changes in v3: - 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"; +};