From patchwork Fri Dec 22 17:41: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: 182734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1222591dyi; Fri, 22 Dec 2023 09:43:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKl7C7MaRr2RTyAE33Y4vGe/scsXVs/w4h2vC2xs1udVIYah1dlhsopku8tczPcgM2hcbX X-Received: by 2002:a05:6a20:1446:b0:195:5816:c788 with SMTP id a6-20020a056a20144600b001955816c788mr103548pzi.69.1703267003949; Fri, 22 Dec 2023 09:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267003; cv=none; d=google.com; s=arc-20160816; b=QzlCa4v4gDmW0OBNbiBSEUEbefX4MS91t0x8iJOGwyxwc2ZQjtMT8/I/HJM7Q71CfT 9kxyzU9glz2A9YgtmdVoCTd79ZezEbcH3yWCPm7F5m26wwlX/kfqldmpCBG0xPRwXsqp Y4sVZhr7RN6X9h0ff65kWl0/hAYWNh34AsswfDlq745dOC4IVQMZRGA9VhvtA1AK70FR 9acWYLPh+d1RUSsye7VLT5mo+MLGH8+iNR3x+gtRoo+r/M0MvqHgNjgRpUVjl4CjiVcQ BMIf7uSZqQk0RSTMLk8MOlJclymg7xvpHkB1DgpdSPe4EIta3Hb19JyduouGbci5cD5d NDqA== 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=xcMMn1wo5ecoqzzFfZ/NThvc+Exg7NREzlaFXx0npiA=; fh=AI7vKBwTnYJSXpanaofkzZCBO2pgxuTrrwjgcPUJ6tU=; b=ZicUIBFour7Aurry7ain1XM3s1uGCmgQOEjDL73ymeEzvV7d7BLWtxF/pfw3tEa78l +ZNCcgH3JPbUywe3veNbIZ+OMsR+TAzErweXHTBcxWHFroJfzGAf0eyXsiqOomQ/fytK 4IkkdWrWVEWxESXAf5mcqzjCaY8dAS39FiMOmSUV94CcCLjEoe7IVcMHt3RwNO8U/ELr TpkVeQeGzW+7z5+1+8Tv0y+4Vb2g1pgMSkDwp9jx0ySsTm7nCl5ftk+2qjeYBxrh6iRy YYBY49xRWXhDbdW8RrkGGG6HEcdAJjXEkJCKiAEiVPW0xtkfN619mdGzhHDmoJ1Y6uqk 0l1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YZvAyPix; spf=pass (google.com: domain of linux-kernel+bounces-9949-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9949-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 y10-20020a634b0a000000b005cdc9b091a4si3516441pga.40.2023.12.22.09.43.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:43:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9949-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=YZvAyPix; spf=pass (google.com: domain of linux-kernel+bounces-9949-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9949-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 990C7286806 for ; Fri, 22 Dec 2023 17:43:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D73D02E822; Fri, 22 Dec 2023 17:42:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YZvAyPix" 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 C89D32C188; Fri, 22 Dec 2023 17:42: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-wr1-f46.google.com with SMTP id ffacd0b85a97d-336746c7b6dso1673114f8f.0; Fri, 22 Dec 2023 09:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266943; x=1703871743; 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=xcMMn1wo5ecoqzzFfZ/NThvc+Exg7NREzlaFXx0npiA=; b=YZvAyPixlMQtq36mNN6T+kSNM7T7SmI6b26dVE07xaIQZYnOd0+dLrGLEUN+7BlGYt UlK1tUjkk9yJWWJ6H3+h9wFKkiCwQSksJItdCErFEdh1/1kFus7BS4byporKRp/zWeGL 08VYTlh86qyMw2nKfF995t8FaiHRg2B7Rb6Gz8Q9wN+PMxsHm9P+3fMySvfRrdpm+ETD +yo3HUERartESOzrJVKPa9Bp8JQCEk1I7p59/A8ZZff46b7Gfbvs+cDJgEMsY/iZhXtg iTpvRdYNibIdzCQQD7BJAvE+fcmIY3pe1k2UdkMCZvg6YJskkjV+wnTH3fpaTCR30Ylm Slvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266943; x=1703871743; 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=xcMMn1wo5ecoqzzFfZ/NThvc+Exg7NREzlaFXx0npiA=; b=WGi32pBxN1XKu/sp6uJgFiXg2Tz5WvvvfTKFKQzCbW4T/WEfA8RnMohEoDsCirk/jr RIlxx2S+BelInDkCIAH7r9IspKTUO3OXl5i1GToO7p9BFfoQANlTqYyOmHdsoYFFLWSV Gf0lIHezvSBWpkUrdgjZNY7SxV8QGjcmLZyQfsWPQy1Ax4Zncfisxsk0YZF00GpYs26L RNkNLgmd7ol5NUHajUKLjR+OCsIsab/LBQFU7WIPSsUNKoWV3OrrP/74yhVbQsSbWU6U k1KvpNIQA7gg/AQUa9VFibttTBZfaAmokg5GtUtup2CajYR8HMeGgQuo8I/vJ2DGPjAS Lmeg== X-Gm-Message-State: AOJu0YxWDUW3IKsv24k6dOImoDZj1MxNtmL7MguV1FHlImZQeD+uiRlA i7u3UdMELgKkHV1oV0gYDA== X-Received: by 2002:a5d:6546:0:b0:336:7794:4475 with SMTP id z6-20020a5d6546000000b0033677944475mr992813wrv.109.1703266943072; Fri, 22 Dec 2023 09:42:23 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42: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 , Conor Dooley Subject: [PATCH v4 01/29] dt-bindings: display: rockchip,inno-hdmi: Document RK3128 compatible Date: Fri, 22 Dec 2023 18:41:52 +0100 Message-ID: <20231222174220.55249-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786004902380243219 X-GMAIL-MSGID: 1786004902380243219 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 changes in v4: - none .../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 Fri Dec 22 17:41: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: 182735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1222771dyi; Fri, 22 Dec 2023 09:43:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGD1eizUwvIFuNsq9U11N9nlf1jAFSgXnWOtplQxLLJSC46ZH6F/Fg4zECw5UqyNOFuojJm X-Received: by 2002:a05:6e02:1989:b0:35f:deea:1c86 with SMTP id g9-20020a056e02198900b0035fdeea1c86mr1692033ilf.3.1703267024162; Fri, 22 Dec 2023 09:43:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267024; cv=none; d=google.com; s=arc-20160816; b=mhOwbtkqY3WITABEE9IDDmvrnVqBWjYIpOnTyqf990dKF1gzW9tkix5BlUBdiHxhp2 lxKVTUYr6Ep8StT5gt9R6Qq/6exkiRh5Gl5BvBq9fkuHnUWSCBSrnOKoIp+Rwj/yGD/z 4ySCQLCNqLvKlEitv3OPOln7ay8XK5syqUVLSJFDwm2vPR8ynRg5nTIaV+dlCym1TONs 2YXJCbuMn0FoECcf10VvuzJs2y/C0zw6eIZr9aLqG0cC7avyBbML2Ezu6PFhxExM3btS /4NdcbuajVtJUyOWScVOWcr8XfZ4CYZrYf1p8ugu0Z8DDw2KUQo2mh5RpfbjafmBBHWv nB1A== 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=S0neXejdyKcMYrQeMYfWnn6/UkX9PKjLjeZy6MNbiAE=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=rrCnQ7AAsa+2z1i3at4v715Zcxe/eQo/uCp4D872po+1tAKNTyD8NSnupNGJ/jaYyK XTAb7woxR6H2IH1IORm87Hdvzozaa8pkYPPma0Xaw+ORXfB06+qkXSYGXAaIxi5LnSnu aBRUmWlSEiqF8UrsEmCWl2dPnU7Rdv7MAihY4Sqqw19nfDk9Q8IYjcxHWvHuj1rg/BbV 5pa4e7R4h5OFDcp5714e3ncOA7kUF1n9i3npPrk5Yz3o/iibRJM8jg9IVlNXi0QBqBwJ wT68MUqM+nyBWVSc5xAeaQP3OObGcA4TofrLSSLbGkDs2Mb77AqD/CS9Adysw1ek+M4r QGwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dwJU9ftp; spf=pass (google.com: domain of linux-kernel+bounces-9951-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9951-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 c2-20020a6566c2000000b005cdff1f4809si331581pgw.244.2023.12.22.09.43.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:43:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9951-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=dwJU9ftp; spf=pass (google.com: domain of linux-kernel+bounces-9951-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9951-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 E7CDE2866DC for ; Fri, 22 Dec 2023 17:43:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CAEB42E859; Fri, 22 Dec 2023 17:42:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dwJU9ftp" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.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 B7C8228DD2; Fri, 22 Dec 2023 17:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3368d1c7b23so1336666f8f.0; Fri, 22 Dec 2023 09:42:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266944; x=1703871744; 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=S0neXejdyKcMYrQeMYfWnn6/UkX9PKjLjeZy6MNbiAE=; b=dwJU9ftp43M/s8kTuFvinvim4AUho8Bbhu9R087+4ZiDt2sey5MxfFFgmvgKQcd3CH wyvuKkwWlTbD+87sh0PDF9sW0pTR7eNhMagLV0EflKnivZ8u5KpXD+TvD6AAjvCDBkfF imRVWpGniu+kK4cbHEOKrXWEhhIizyrk8K6a/WCapaWjoDSLHD+LU1TYF1PzJ5YepEhX 9MHbEKMo/p4Gt4ZIrRN+XZGtmIkkR6HwyUjY7/2+0SSxYjhRQ5Ibx6iADJTPgDuvadBn 0Qv5oTkteUBgz1x0N3+PNxpQYgz7vkya12PvyS03pm+OFEdYEcrNOiVzjQtbwIC1zhQq gO+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266944; x=1703871744; 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=S0neXejdyKcMYrQeMYfWnn6/UkX9PKjLjeZy6MNbiAE=; b=nqlBtGMibJLhHrTRWR/KG8LqhXMoNJng8+h9C4r57fG7OXUYuu1rOpl/pQrLcxZT0l 8ekuq3YzOUKWFaM/kZwLeIxRvC2cVwKRlHq33TEyCBsofilV2rHN7gnL0Cmzk4XCX8dY bH+06PW+OZAXLd+rMnjTwTa+fAoI4j3O7aUCC828nd0v5AALr0u9xH11C35hkSLH23lz C5/zz0c+KBG43gA2hPbMKl0JNkJKwgdCEc9fbnlWW9e+kwxpWeCzTX5CvxKALpd3b757 6/cSQEGzzVgrU4SVs/XNhsWgoE3ZB61IyjuYAHelPGCV1yq3Zi6XFzoKeyZiLbK6Gsaz stcQ== X-Gm-Message-State: AOJu0Yw06xnWBY82Xdo8VPMLynkdGrkH55i33RKaF9aRp/Wk16oxMqXH jsqIOXnPiFHlFBf/ySI9nA== X-Received: by 2002:a5d:5341:0:b0:336:8485:d870 with SMTP id t1-20020a5d5341000000b003368485d870mr954023wrv.65.1703266943886; Fri, 22 Dec 2023 09:42:23 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:23 -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 v4 02/29] drm/rockchip: vop: Add output selection registers for RK312x Date: Fri, 22 Dec 2023 18:41:53 +0100 Message-ID: <20231222174220.55249-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786004923213218888 X-GMAIL-MSGID: 1786004923213218888 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 changes in v4: - 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 Fri Dec 22 17:41: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: 182736 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1222908dyi; Fri, 22 Dec 2023 09:44:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSk9Nf4jzPTm1+BeU/Y9VuCcZl81S4SvlBXsxrxmt/heOCVsgmkvAgpqIfz3DOmVGjQyGe X-Received: by 2002:a05:6808:bc3:b0:3bb:701e:b16a with SMTP id o3-20020a0568080bc300b003bb701eb16amr2090948oik.2.1703267040025; Fri, 22 Dec 2023 09:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267040; cv=none; d=google.com; s=arc-20160816; b=dtHEPTpOFy/g0j9jp+cRmsrtClR4cXijNhLuYklnSPcHEun8RfgGVCv1UdBX+PARDi CbewNtMmSlQkfq7PbcTBVZx617uQcthihrnQzNmTr+tZEpREbRAUg5hK7FM2Gma/N+Vc NafuOlaDpIEkwjd0EE8Rc3TSz4Gbq7Fjc6efGd5zhlctEVp2jWOV/wLoz7i+4e9lawoH YpqF6K7TQp6amu4StqVRTfoWq5WO3vvOpXAZlQYZ9t5qHbbWpfiof9kqZFMcgfmkFy/a od8ZJKe8tpCpv0TLtD3wolmR34vi1kV4bhEZKjfnbhch6hfNIo5w2n1ejFbtO8T11OB7 D/PA== 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=U2HtmTELSCmQNqADg2Zx1cwuvSj7RPiUvZpCNIv/8+8=; fh=ofylbV+bzQmJfsy0tRuyz0Yfc9dw4CDRyyw48UzeJ8A=; b=G0jQbsipOcGhY0joDJ9e11Wk9uvGcJE2bacR1LWzE4yuFXnzEnmIlkjt5reKIdI/nz 9Ifv546qOCgqDaKaJAM3Q7ey7K7YFw5I+ay7Ewff/OgwUfnX0cSn4LC30tV+E9yN+eUN 9SlsBOa/il4RnF4l1PoyzeYxHyZFVtqXryHB9j7qmwWQ+xLMVT+lfhzmgD+tgW3zPw8a 5E1DKvT13W6j3PV9l6EL9DmGdoktc3MMT244pFJAJ9+d1o3lDGBMcZT8vppTHJYLGYIJ ak8LSPDt7IJTK8ucpNpTOtxCTfWoPNxBpL794AaK9sFOM5Y34ohsZPR28ReOslFhzHwQ 4cZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aFlrU6rx; spf=pass (google.com: domain of linux-kernel+bounces-9952-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9952-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 v20-20020a0cdd94000000b0067a21682426si4726231qvk.60.2023.12.22.09.43.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:43:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9952-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=aFlrU6rx; spf=pass (google.com: domain of linux-kernel+bounces-9952-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9952-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 C81BB1C21D5F for ; Fri, 22 Dec 2023 17:43:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87CBF2EAF8; Fri, 22 Dec 2023 17:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aFlrU6rx" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 638D928E0F; Fri, 22 Dec 2023 17:42: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-wr1-f47.google.com with SMTP id ffacd0b85a97d-336990fb8fbso479621f8f.1; Fri, 22 Dec 2023 09:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266944; x=1703871744; 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=U2HtmTELSCmQNqADg2Zx1cwuvSj7RPiUvZpCNIv/8+8=; b=aFlrU6rxyla4IxXOsIeCl7F/7d6bITx3266c0l5z7qislwEgZ0TIoaR/H1EIWvwQlK rRQKfGl37/nd+j/rN7A3AMufdCl8YKMLmCtK0bH8Mtq/lyITyvXOuVbr9p0ylFRXoL87 posnWcjs9KtlkfSNlqsnu++MACaF5X2xTU/F/UuWsHN0Ubp2/hXaw/SEh8LQWoiwK3Jr BdjaKlaCZIsUGdQdYOMjzWT9z5v5/3NiuUxrNFURAEOAZXr2qAi177tOpn6sl4qCF26L 1knk/ZEpLhoTWagxZm7t2KG4I4iWQGSQPZZh6a0m8XNLmMbW6TZPPAx8qLVs8D55FyjP Zq6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266944; x=1703871744; 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=U2HtmTELSCmQNqADg2Zx1cwuvSj7RPiUvZpCNIv/8+8=; b=vlfzoCC1PL3aSW3yHT2qXhADsKckxXtdhpA+WXr+Nu2bbt22rnH8K2cROwwDdTMEed VJjEgigVR4qMjk2err4jMc7t9hOAARJYlmicDI1fWnYN2xIPVlZp90HkWGsHQ8TbpzBj qjAcAi7ZQL+3YkrKmwgPggqsZ6/iPSOAKQ4CS+TdM/KdvM6BX/yUV43qfkgxE/qAoTOz RYmOnygHNFfJpvo3abucf81edi4Uxc2HHuWnZx0k50NwoCr1RcojPC6M0LdqbeXegeDN oKBFKpbttM8r5Ox98xAxPlqxVndU6JH9m7IpyPG2h5s/6r9pIG4Xbxlk8vePBMf5Tw0b If9g== X-Gm-Message-State: AOJu0YyHelIJ8nrwlIpU8nxlpHlNm7OGsF9XX6qMsfaKUy5M6CddsC3R 4/gNPH+dNFjOuKEr8hW5sA== X-Received: by 2002:adf:dd8c:0:b0:336:77a3:2fbf with SMTP id x12-20020adfdd8c000000b0033677a32fbfmr947364wrl.31.1703266944629; Fri, 22 Dec 2023 09:42:24 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42: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 , Zheng Yang Subject: [PATCH v4 03/29] drm/rockchip: inno_hdmi: Fix video timing Date: Fri, 22 Dec 2023 18:41:54 +0100 Message-ID: <20231222174220.55249-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786004939933838234 X-GMAIL-MSGID: 1786004939933838234 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 changes in v4: - 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 Fri Dec 22 17:41: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: 182737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1223309dyi; Fri, 22 Dec 2023 09:44:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFltDSJsjTYojcill7QtkjOF3Du0Yygte98tOeiQA3JQaZ9hAEF+is47eOg1fgreeYQ50Qv X-Received: by 2002:a05:620a:4083:b0:77f:9b4:a0e1 with SMTP id f3-20020a05620a408300b0077f09b4a0e1mr3115534qko.38.1703267087800; Fri, 22 Dec 2023 09:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267087; cv=none; d=google.com; s=arc-20160816; b=psq+Y+dgeefI8r4/s6ejM9aTEuHiR1cePiUVxfkKKdATHjEDflpfXJeYKKLTRl73b8 ecCs1WmDfvjPD4WWjNyzqvU5fGXTbcdq8Z7cDhuEfTdI+f6oQIKzTVrnKPBfhhtCTAyH 9Fm/HrwNFO722f5fVYFH6siPJoAw291fUz7JENivodmW1/xvwgMYJLUeUe5JJ7bnXwnY Lg7wpfIfT3QIlYoAMZYK3GTjAR75F2R/stI2tlz2nP9D/gBqOeO2fCC/hWd1K+2ouTq+ EDqNkb+jvgJNjNMfauYn483mnAmHMWLTONYUAWL4UElx4WFT3i4ISqWoqn2sOcxHjUzr /LdQ== 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=oTMG9bpN8fCN8EPMeR+JAUJcfO1Vw55kh4J57dK4YOA=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=P5vZNHnxWzO5UFJxKz5yomGlP0gMiKfdGONYWyKDO85zjZPFstB+Tjyb5JwTwnvSOw b40OfWH/tAfNCVtwu3cLWSr1MIpfkVPKFSHB1nbhLfMTAxMkvOs88VMXJ6WcySF95b6w 50mTOMnOwY0BhVmquG/Yd5mzSthr4it2NG0uBYngF197tiCezwH+SJglWeItWSRsIkbA xHioQ3287huHd3KQhHuaMNZctdm92A4dL7BV3cXKdbqTn0IZsWhmyaHKSBPvrTcK/IhU dMWQTCm8CX+HN6im22AxfK22PV85diuga2m8L9yMBMcxb089/5nSVFoDtc88WsvMAzo3 zI6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cXa9anQf; spf=pass (google.com: domain of linux-kernel+bounces-9955-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9955-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 j12-20020a05620a146c00b0077dbbb75232si4537217qkl.567.2023.12.22.09.44.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:44:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9955-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=cXa9anQf; spf=pass (google.com: domain of linux-kernel+bounces-9955-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9955-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 291921C20881 for ; Fri, 22 Dec 2023 17:44:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3E8A3159A; Fri, 22 Dec 2023 17:42:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cXa9anQf" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.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 7DE282E636; Fri, 22 Dec 2023 17:42:28 +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-f50.google.com with SMTP id ffacd0b85a97d-3368b9bbeb4so1508525f8f.2; Fri, 22 Dec 2023 09:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266947; x=1703871747; 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=oTMG9bpN8fCN8EPMeR+JAUJcfO1Vw55kh4J57dK4YOA=; b=cXa9anQfKgRisLavyIIrZwnuhzDbmeqZQh/10O0tH5mdrpJFKIjW0/c+0MYFILBZf3 NrluJOTGe+OvC8vuUAFWJQIi072y/E1ciK9PHpLISSz0U2LtiAKoZ40InfuaZfcAnSeI aU107C87PdxCzCONdn68AoeMZEMGNZOdpvb4SeO8iViyM96mtzNv9tEzjeaDha2ppZZw a6yUd9k/VW4KA3kXlJb2t5VDCFC800ApgqHaoscMFVIQCV2XBOGPBIN9tMiMbf6ZRrqb mbPWDXbiqmSCkTaQcENDI/6+OanjQGLgI9Kg4a/0qzLJxluxxPaPPGA2VKDZtcP7G1ZL tvJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266947; x=1703871747; 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=oTMG9bpN8fCN8EPMeR+JAUJcfO1Vw55kh4J57dK4YOA=; b=Kz/mCFLu1swk9d4b2FKB+nj08QFBsGED0KyJONyA0cQhowM2Ul6pNNcheGIWzkdA/r +X2Ls2GuPr2CB85GpIQuvLbLOVsPYaHQdBkB3m4bdLu6PDEWzbjgE0nB/DVCj91xMAmX iae3pAylnukaUiYaQoT2yaLDke0ITqctzCx+Ug3+yLJEbat5ElJvhNAwjVbXXGP/UEV8 0uy4p/iDkijtKivNg0zxciXnl988XTluP5YbLgEUwFN/5s6E2Are6Am+/CN300/WkGEq VtMEL2sRCBZUp26WjRRSIebylDss5bjfamkTiRnFY2nrPJFBTapKJhWl+Nac1EKJtvNS I+bA== X-Gm-Message-State: AOJu0YxLrd2/rSRqX+kSYEQBGJVNxeizz9j4TDluYOM2F8tlsEg2OWQN FOskup/x37903G1FQ4yRgw== X-Received: by 2002:adf:e5c7:0:b0:336:607f:4bab with SMTP id a7-20020adfe5c7000000b00336607f4babmr607801wrn.187.1703266946623; Fri, 22 Dec 2023 09:42:26 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:26 -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 v4 06/29] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic Date: Fri, 22 Dec 2023 18:41:57 +0100 Message-ID: <20231222174220.55249-7-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786004989555431837 X-GMAIL-MSGID: 1786004989555431837 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 changes in v4: - none 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 Fri Dec 22 17:42:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182738 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1223823dyi; Fri, 22 Dec 2023 09:45:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfzXeEbSfAPKT5aUce6iSb6iPFucoZNJW72NBN2lofMDOA/FnpZX1+9BECtmD0SEuZLKNB X-Received: by 2002:a17:902:650d:b0:1d3:ec6f:14d7 with SMTP id b13-20020a170902650d00b001d3ec6f14d7mr1418055plk.19.1703267141456; Fri, 22 Dec 2023 09:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267141; cv=none; d=google.com; s=arc-20160816; b=xndAYkyfXLqvfpJGFzk8OfIFYR66ACEAtxJ5ZkEDJ24VkTJGSMuKjk/ScCaLglavhb mUikTtIOVTVCc+voVReTocjMYC7ypFGduNk56X6TDzznoTivEjXeeE6bRDiiytaLo4mT i1fLuGFtM9kmrt6cRlHssTPk0f43ogiibQK6KAGm0JziX8AZulmaySglrkywAn+/VtmK fh88DRwvq6djLb6jcZtFnhIQ9PIDboYM+vp7IikE/JbTOFXQmgv89v5f3bfyqmEoZjrA qYzAyZL4TiCw8ykbJfSSVCVNAXtWzjQI+Padl/yblWyNZ1uUBy+U7nZhhLKv3zEzGdrS boLw== 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=18puqwXb3goOQbFDudDa/Se4Vi5XO1rypLRUSz/S/Ls=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=TQoo8Yt/45hinsTrieF/s1boAUWnKYGvvoQ198qxKz7xxHkiqoQ+zeiGtj+d6d8Fi/ Kfbo/HfN5t8GHGT4JM+kl8YNfKJ5bcjnhw6nmTa+fLaUkIsMavO7pVRTetq/u+8zFpc3 OTuD508qj9T6k3LsqoX3Te5NWbBEWBFFAEsGtIA/+9wWrG10957wAGuPoq3asZa8VuOu QdB7dYij9Lbl+t0vrGTXK2NGINgtJ97bcaxIPGkxff9U23cbE4peVYu5tr3rAMOtqrrs 8edMIx2QFFOQkknRu4UmWV+Q2XPDi/HLW8I52m5E6Yqm4m+9VJhyM+Eqqi02o4Wf0jc/ wi6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UqBH+jvu; spf=pass (google.com: domain of linux-kernel+bounces-9959-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9959-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 d18-20020a170902ced200b001d0c442d76dsi3543045plg.246.2023.12.22.09.45.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:45:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9959-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=UqBH+jvu; spf=pass (google.com: domain of linux-kernel+bounces-9959-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9959-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 E2FD1280EBE for ; Fri, 22 Dec 2023 17:45:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 825FE33CE4; Fri, 22 Dec 2023 17:42:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UqBH+jvu" 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 5990E2FC32; Fri, 22 Dec 2023 17:42:30 +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-3366e78d872so1831080f8f.3; Fri, 22 Dec 2023 09:42:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266949; x=1703871749; 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=18puqwXb3goOQbFDudDa/Se4Vi5XO1rypLRUSz/S/Ls=; b=UqBH+jvueCrYvBL4exg1GGPny87AagLrwzZ032y/kJr44KBytmCpjYS33xda4ZUddt 6Y/v15XjEBZPOVhAx62U93n6ZxHPC3MYKhyiWLcwJnK0DK1MFcA8+gfvddUsWQR0RZIS fg+s0T7RbgTzlbWmBTDFCE3RtTibup+30/RlLnucnkCvdllecdyo3CLa3H8xs5VNOdLt DnyjJT5R67b0KtETXPenfnW6F9XiLhl+Hej1fGJmaV5kPWSOFB6eNF0+Q1GwPbxgi+2u q4GSy98X3DM+d9AwDyEZVy+SaZ1G68AcwUnT/20tLADJJG50eypZ/OmFTURBR4nzPdAQ c0fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266949; x=1703871749; 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=18puqwXb3goOQbFDudDa/Se4Vi5XO1rypLRUSz/S/Ls=; b=GIqnyIFA21aL8G+q+fvXuy7Um0h8cy9HPqq20WPyjfRp4A3iNje/sztPghKeYGHkzD SzY8PIAk4rz8uVQv0E1W5e5llwbUf1Aiti6p40RQO7c65nWifUxdbmRcZvX6KkP/PnLU O7yidZ7B7UndOyXb86A4+ws4i61GBNhbTbUP85wMN83BMFA1yu8M4Tf/8c/keludNa2q flJD1KiSRoYl+kCmsVcMoZD7fW+Hw2ryusT6pqZGeVPwI+oJ2V2Q5nCmdpvJNpv4GUfE 0jgXFTMNrbSFuBaNYwv82gW1Y8fy0KUy/u71fmPniS5gias5I3sIB0T+y1TttOmf+VDf HCNA== X-Gm-Message-State: AOJu0YxvlRlarJTwqK5biRo87yekUC9L0bsMxd9oRe4zTlviOvHqt0Qd MslYRsrW2zaBq2ygrUSsPQ== X-Received: by 2002:adf:f7cb:0:b0:333:3bc9:e246 with SMTP id a11-20020adff7cb000000b003333bc9e246mr513195wrq.33.1703266949433; Fri, 22 Dec 2023 09:42:29 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:29 -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 v4 10/29] drm/rockchip: inno_hdmi: Remove useless input format Date: Fri, 22 Dec 2023 18:42:01 +0100 Message-ID: <20231222174220.55249-11-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005045833597677 X-GMAIL-MSGID: 1786005045833597677 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 changes in v4: - 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 Fri Dec 22 17:42:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1223941dyi; Fri, 22 Dec 2023 09:45:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7s/mV5dV+xVurwk91v3EaMSOnjMHQnwafPpbTfY7T4sK8O8YMPZ9zUdtiygjcXKfZQgZv X-Received: by 2002:a05:622a:134a:b0:41e:453a:4dfe with SMTP id w10-20020a05622a134a00b0041e453a4dfemr2080390qtk.36.1703267151818; Fri, 22 Dec 2023 09:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267151; cv=none; d=google.com; s=arc-20160816; b=kLb0r8FJqdvQ1RtJ3ySemnAlIL0oxP4qL2drEI11cLMrorzWptSXhm67qKckhzGQ+L duKtvh9+hDAju5FDlW5dENQcZVm5icPhCsih5ca+/iUBWKGzuGTUxQYITsQaHsZlIbAM SAgkIYOuf4cXK1zG94Nd5JDasTiF1Gu8A9gvtV0XilfwTLYq16fy5agGGniAntQyFKeT gBN3NT58/JBJUcHPHY/cTIuz5MVEKKunBmoRZvnP4f3kmWeQZLNeLOZcZkAD0T9mYi4x fTrE03VgP51DDWxiFkrvhm/qq9QiDr3sUy4/u6xMJzkHO1e3HM/+kTAO2ZLnuficS+iJ CMWA== 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=mvwlyAlnXeNL9AzDIrE6gEzR9A8598VoqwlyqljJPww=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=0/15jE2+v6SHdljD6Jf8Cf6ZaZMrVNLd8FF2ktUEJFWIi3LGIJYGOD25CIjPCxXpEa IcaXvFIZ7Ezu6Y1Im6mUp6SiEiT1hypSf0xjnVU5Dooy7QVBe0n3SSdDCjYrpsXJ8SYc B1GGilc3mIrZoqOolyuy8X1CvlTAXPFm6mKHLjngximtCCCmsou4EPD03ggt6u727bOe P/qMrZTeNRLYezqIwnUUZ9mGl+hp8EAqbSVNsM4TomNJ0YWi22vC6H5KCqbSDPjsqc8l g3AiGY3QoTsUUtlGHSO3TGFyObfIycWEmcRiHS5d5MEgG0BfCX6N+9ixZ0S/RPP7Ly/L F9NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="mIHED4K/"; spf=pass (google.com: domain of linux-kernel+bounces-9960-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9960-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 19-20020ac85913000000b004277e68ec3dsi4632337qty.446.2023.12.22.09.45.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:45:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9960-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="mIHED4K/"; spf=pass (google.com: domain of linux-kernel+bounces-9960-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9960-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 96D811C224F0 for ; Fri, 22 Dec 2023 17:45:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2127228DD3; Fri, 22 Dec 2023 17:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mIHED4K/" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.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 05CEC2FC5B; Fri, 22 Dec 2023 17:42: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-wr1-f45.google.com with SMTP id ffacd0b85a97d-336755f1688so1824551f8f.0; Fri, 22 Dec 2023 09:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266950; x=1703871750; 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=mvwlyAlnXeNL9AzDIrE6gEzR9A8598VoqwlyqljJPww=; b=mIHED4K/XVxWagcSpVCqUAMd/NOEuH+mtHLhJljAtZ07jZI9P/IAlSqg8KbJCC0Mj/ lVb5IxBfnEWGdsKAM8tg4IY185AxWGeS4OTF4LKpUfRWAQ5rUGD9C0eBpfas0eVR2Rzb nIQCM0G/rGUmQgP3BM7KXrnn8OB6EOxNbgp+7f37Q2708GKs0hPmv6G8PUA0KgP+R6w3 MD5iV5oMsdwp0Bcx5zOxVrxakeohclaWc3/0p38IWwZd8OFp7kZRGURRp6CvW06hQDg/ ldcJWBy8/m3cRluSFBaOX/qpHck82Ynx2dwzQcTDORe1nQbBuaSKa053WAn2uTvbx5Ve atsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266950; x=1703871750; 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=mvwlyAlnXeNL9AzDIrE6gEzR9A8598VoqwlyqljJPww=; b=BTdqBA2dytuCcjm9VEBLz0lZpW0R1GF50uYXcTZGB9LaphMF5wP/O4RVVqSf88UanV yUugCrPwhh2gyLREb3HAnLPtJeB1f9n9OuZU6MUx83QMx15vYZq7G0eQVS8tWQ587U6D H8cW/8uew86y7sfbHEirsIvvAG2Hgqrgn53n4j24GzNRPrL5scPnF/Xs2Ibk0EUDriFA D3NK/cMAVcRdLsdV9lrAgkOE5lx8CsmRzEh/O/KBfh0L6ZFOYyEbOcK8ewE72s5dHBuw rV3hsXaH5meTZbJ3n3+Oc/YcLjNO56aa9ztzS9S3z8Lg1tLSDl2yu3ubOqqXfR1CxWU+ yHgQ== X-Gm-Message-State: AOJu0YxOEWQlPilidy3WK7AIi7R7W3mMfNtzky1BU2D3J01XAeIDL4u2 aPjHf77ERIlliLetEDOESQ== X-Received: by 2002:adf:cd89:0:b0:334:b2bb:6d1e with SMTP id q9-20020adfcd89000000b00334b2bb6d1emr1133231wrj.17.1703266950277; Fri, 22 Dec 2023 09:42:30 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:29 -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 v4 11/29] drm/rockchip: inno_hdmi: Remove YUV-based csc coefficents Date: Fri, 22 Dec 2023 18:42:02 +0100 Message-ID: <20231222174220.55249-12-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005056506786517 X-GMAIL-MSGID: 1786005056506786517 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 changes in v4: - 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 Fri Dec 22 17:42:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182740 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1224096dyi; Fri, 22 Dec 2023 09:46:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGHMI8C0OxnZkeSvqh6tKJ1EnbQBrzFFWHataicMufMNia4moixQ4zV6OUgoK7M7OZ6E3e X-Received: by 2002:ac2:4c23:0:b0:50e:70b0:6e90 with SMTP id u3-20020ac24c23000000b0050e70b06e90mr74775lfq.113.1703267171871; Fri, 22 Dec 2023 09:46:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267171; cv=none; d=google.com; s=arc-20160816; b=1Amz6kYENZF3L42SWZviWkbtP1qrWm+m/UTZEQt3ivDBQ72UvjrbuuuTAO/ZqfQ3Oo cnjDH7SXkjY3d7h1PIeNCb254Vut7VL0lDdlat/Au/GUZ5OUaZemWvQWKyBp6KGn8h0p MtjRWrJta8NmmslF5qvGgs1DqbibJqSEB0s0nCjCztAyDePFf77xVfMTXAKJ52gKGbWW Vx99f8HdBnVzS/AqRYyEZ/dX49YR9EGSJL9kpt+Gt7q9R1AVZefmKCbqkPV6t8Y0Cbe8 hcDfyEoui07UiyJKean2Gs1tbhfcGGRbCZtXI+UMPQB/tLAHV1KNUjxN1WJYDe76SOx4 F5rQ== 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=W4073SJzbMTg0LalE15NpNk7khJfelMofNbr9L2QfJw=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=SYPPfQmblbCX95+Ip6HzaTZAXXO731NmAwhJPSoCu1wKJ9j771z3y/R8UqfrfG9smq JjZz3vbDhuT32015yGV6wSFfqMtP4oMtHQ8v9KJ9G3I7il7EJqIxh6BYYcftWpo9LBeK doSMa3wTB1lGb51JkSM8JTsQfq5k42IdZnYPR5nnjra2EZSembFuS3RYoZXU/sibk8uM e2oIErGrewcyWtreuN+yS8hNyeUSpWs8bz1CSIcDHqrn1oQ9rWnzGHBqEeZpseTmsANx pzrtOb1kbDu33wFSy+LgME0dUNCsUkzTgj0UH5ZtszuFWIV0f3AJIOjnxMN3moTbIbjc useQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kCWtWR6I; spf=pass (google.com: domain of linux-kernel+bounces-9961-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9961-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 g4-20020a1709064e4400b00a1dcf3d7806si1934922ejw.287.2023.12.22.09.46.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:46:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9961-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=kCWtWR6I; spf=pass (google.com: domain of linux-kernel+bounces-9961-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9961-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 7877A1F217C5 for ; Fri, 22 Dec 2023 17:46:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16021364AC; Fri, 22 Dec 2023 17:42:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kCWtWR6I" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.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 EF23131720; Fri, 22 Dec 2023 17:42: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-wr1-f49.google.com with SMTP id ffacd0b85a97d-3368b9bbeb4so1508576f8f.2; Fri, 22 Dec 2023 09:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266951; x=1703871751; 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=W4073SJzbMTg0LalE15NpNk7khJfelMofNbr9L2QfJw=; b=kCWtWR6IFnjNHrZP4QFAiXJ9l4zIfi90Z5RCrIOWIrbJthrlHDDIb+orwxVLug8t9c CsDl/Hkzz2kuX95P0R+h/uaEzuRcLuHe8d9BZEGmZQVvHzM5Y+HySQrcycuvk/2ivNKA 4bZyeVAfqMQyqudAfuOl4QsMzqIgo0qo2WLU1Yvm53AIRUJUYeTBSLeJQK4lw4h7XMrn C5sRNVuLEYr1xhb7eoQSgBFBskauoyYC/MxBP5xhQFaIjwGxF+zMaX4g3pVdls37DdfP r7rdD1wGj0PSTFw2J/eiMl++f/a78SIr3fiFqI0hts2nGDEMVZ/FYVNU9SO1q0NOJDen w9Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266951; x=1703871751; 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=W4073SJzbMTg0LalE15NpNk7khJfelMofNbr9L2QfJw=; b=Sg8q72lfa6UjfYl9iZ3jTcbInIcp4J1sDTZul8cH6ko6vMonleyfuFGIp/9a5TqViB JTUzbPJ9vpJf1lKL5sVGvo1xMOK6jgCUXHeVTgs/G4ogsursRRIekcb2MsvH+t4iMAq6 glwPyxqVBDXUa9amdDF2X0cy7J0D5nryklrUVv5sr3KlEHpOtj4+Y+wiOAYlOBSG/1Zb Ez1oE0acGMRFKW0SJVFwsSctkSL8w5XMicji79m+3+G44+Xn5g9ExtsRSzAJNLeJYTQC hgVAhFwfZWS19d3z75PLj8rs7PGMteW7RCSuzmSIYb1kkFAQd8nkQOszFyw6k0SSbdYd 4pCg== X-Gm-Message-State: AOJu0Ywlr/YPOCfX0STsli3JB86Wo3ChPcQQG4IuxFXHaaMzarcVsOPA 2CBAACc37EwZzTmE6eSxNvJ4ZzaOOg== X-Received: by 2002:adf:e74d:0:b0:336:9067:c656 with SMTP id c13-20020adfe74d000000b003369067c656mr575213wrn.262.1703266950919; Fri, 22 Dec 2023 09:42:30 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42: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 v4 12/29] drm/rockchip: inno_hdmi: Remove tmds rate from structure Date: Fri, 22 Dec 2023 18:42:03 +0100 Message-ID: <20231222174220.55249-13-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005078425977152 X-GMAIL-MSGID: 1786005078425977152 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 changes in v4: - none 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 Fri Dec 22 17:42:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182741 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1224218dyi; Fri, 22 Dec 2023 09:46:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpFkeONTL2vH5fhc7lBEkrqxUZaw7AGl6QFR0Qty+C8Fqy988s2ZtazbYWtHLOGlG2Tfq2 X-Received: by 2002:a05:620a:3954:b0:77f:6baa:b730 with SMTP id qs20-20020a05620a395400b0077f6baab730mr1894861qkn.156.1703267182995; Fri, 22 Dec 2023 09:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267182; cv=none; d=google.com; s=arc-20160816; b=seFLKOsru5hCISYGb9b/R9uj/DGGWQ6HrxdB623GPUC/ZknCvRt82DGqNUysUXjO1p h5uwWu2NBreAHLYIP68oMemxogf1EvqbVmTwDdfVbK3bdElFipO6i1NBGn6rgo49Ax7x B7wTB2vL9hwZQZS2WRBvPQismj3YI3tYeUkF7L24bntN5jqIR8syMcjdxuAfbEvvNRgH iw/KZ3vipsiwSw/SfigXoY6jpKLGGAweFs3lucfUPCv2bVIrahY0iZkJASsMKd9GtqJX ILnPU/oxfemeK/auseSG+yk+1VkhGbPorQMCO5D0fMhE6jxJIM8n2JxduZ4fI/Ax8+vT vtBA== 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=LfMKOfn5qhMsr90aHA0q/zpw4x0Di/ZdGH16UYVoiok=; fh=ILBpZrHrAGk3RqnooEwjJ7i7l1xdG2UMpjp4Y/yk/eE=; b=Hgt0Ic4yMFxJhC9Vuo2s++RsyWL4Rv4scL11bEnnyuQJjqfD60CmOVqk6rNWGuaJ4N 1Dm8uqOa920l30+XwLAa/zkCdvpYVd08HmgTa4xILGtsJR8KjuiLM2S9RZRTmOpokqBI M/GbZVK/Sua4ql3GXJmtRKfE2104gebGeFr1Vx4cv02/9J36Qb3eBY3LYA5Tam6ni+h9 4KfsIyzqoIsiQiIJycfmdm2uzzOF9ERV3oRGVgE9qwf4soGTnYZ0IhckxOvL50WCIJjq cKnNL1X/eQ1poAqjhH/lymSu++gMm40/yTu/QfYwrz6YlhRHKfGu+Qn/tYUTZISL7AAj jHoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bR1HT6OQ; spf=pass (google.com: domain of linux-kernel+bounces-9962-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9962-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 e9-20020a05620a014900b007811cc3b343si4264052qkn.120.2023.12.22.09.46.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:46:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9962-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=bR1HT6OQ; spf=pass (google.com: domain of linux-kernel+bounces-9962-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9962-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 C38961C224F3 for ; Fri, 22 Dec 2023 17:46:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1E97381CB; Fri, 22 Dec 2023 17:42:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bR1HT6OQ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.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 7658931750; Fri, 22 Dec 2023 17:42: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-wr1-f43.google.com with SMTP id ffacd0b85a97d-33666fb9318so1833330f8f.2; Fri, 22 Dec 2023 09:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266951; x=1703871751; 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=LfMKOfn5qhMsr90aHA0q/zpw4x0Di/ZdGH16UYVoiok=; b=bR1HT6OQCga+s2dH5iI9/3UWB7DUa3iF4Wrx1kk8Vt0VSAyw00e9I/V8m99sdQ5rkO YXpsKkAUh0yTsEHw7RNEDKPhhH8Ef2qHdvzsZII4GRM8SbR6te0K51rTuXduGb5ZhugQ IsW1010ODyYyHKIDXVhZomSDxku4MpY6Q3F1Z9vPq1nFUbq+EwBakhEqvHuW4EHs0zgJ 9ZL0Jmh5m4mT7E2HVewSvXovQ15ER89sk63dD6FV6ddn4tL43f6mkG4JQFNq7HX8JJQ0 akCDC7AYPtfEsXz/16suYNGdX9gijn2FmPR11GtZox+NiBRXtwDYboDtaVfghUHX/fTh CXhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266951; x=1703871751; 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=LfMKOfn5qhMsr90aHA0q/zpw4x0Di/ZdGH16UYVoiok=; b=UVDs77r0NoHDwyegvdsuOXP80oynOsZcIeRPLhUFYkO3VLcuEchbx0SIsMg5dNT4eS tMxyjU40tJUR/aLrrBJtB82D9Tg4N5tfRzUzswsn6VhQeeXe8AJR7MFEAGfnHPB4oZS4 2f8Ildf3uUqog8m9etGjZ/miVym9Rvzmx/TSrZrTLKaAulvJH6uu71ITKb3ImgNIcvMa 4TLwSvGjh8EYdGXmFVH37ibG/SVv5BbJDA9NvtLNQlAyk27CJXlmmsdiJSh2zRNI+PRw g7LuM6gIEleqclYK3s6Twz1UTbC2J1lN2YYmytJbIkcJHhmPhUqmC0+tcoDQ3rThYzSD 6olw== X-Gm-Message-State: AOJu0Yw76ED49QsL6qa2etOx3no1rZ5biat9dObiBeyGRJP1794vQioG FfgcLD9B0ZpRp6HaPVBD1Q== X-Received: by 2002:a05:6000:235:b0:333:12a3:644a with SMTP id l21-20020a056000023500b0033312a3644amr946812wrz.18.1703266951663; Fri, 22 Dec 2023 09:42:31 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42: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, Johan Jonker , Alex Bee Subject: [PATCH v4 13/29] drm/rockchip: inno_hdmi: Drop HDMI Vendor Infoframe support Date: Fri, 22 Dec 2023 18:42:04 +0100 Message-ID: <20231222174220.55249-14-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005089678229352 X-GMAIL-MSGID: 1786005089678229352 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 changes in v4: - none 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 Fri Dec 22 17:42:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182742 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1224368dyi; Fri, 22 Dec 2023 09:46:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZHItWWcTJ3UvxO+8O6WQ49ZCSl1Vseqnm+zQw58Q9CERSaYutEuQ3SGKaWGNtz4Au3Mug X-Received: by 2002:a05:6a20:e116:b0:195:54ad:79fe with SMTP id kr22-20020a056a20e11600b0019554ad79femr321267pzb.120.1703267198317; Fri, 22 Dec 2023 09:46:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267198; cv=none; d=google.com; s=arc-20160816; b=tKY0oQtsZD8IhGD1hW9LFiow9/N85+aWe+QkhngvkUP+3/s9Yk3TZhnTS5cJJ4wml4 2Tdjx0cVMUh/3I5KdG/bfnAs1WTHWpXZJiRsiu5k0geBM23AXScVZqbPaMO3MrNx0Z+f ilSBvEguto1Y+zbnzwbMj9Kb3wsmsUbWt0CPchxLdF/NdZE7Ebg2W/EEcqmng0/S8rvY YytORMHFJKzIl8PSQ34oO4UCeT61hswSpFim5YevaenUTJKNch+nDn1oU3cn9b8AiHZh CRQsl4kygZZNcuBxfbk5o9WiqEMIFeHkReEhTnhUZ3xfZnpqb2KOXiNzp/Z2wf7GqplX zd1w== 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=hxV163vg4WaEsUhoUGEXFBcX2Ll0vd6Pc97F0FYEm9Q=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=GqK+Yz8Yu3VYDpvQEQTiOK5H6D3fODWdl060RU91hiHfMlT5IDkcNpmT+ZAiOv6Yg3 /EKmrEludlb1bphwzykulHLB+pOJW7kVivfAciOYyx32HyaurPkpPHMg0GdkwoJIGzY/ iqjTkgv0H0oEO7de3EzynJTfx25DQYRFt7labjxEWs6apXjEo9wMV6kyf4Pf5JY798gF zQsDWF2TRrR1IQTF83CcMSfp81QiIrx+jAPj0/KHGDKFBHpQ+azJlM/4Bb5guudc/8LR 4iZwoDdrmjkyKiA+RIC+YRlpJF2ibOxZ1LkCH2jzTWUIPF1fSTx5UivqOPotXCmS+bkG rEow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fSeZit46; spf=pass (google.com: domain of linux-kernel+bounces-9963-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9963-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 y14-20020a17090a134e00b0028bbdf5c434si3571164pjf.103.2023.12.22.09.46.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:46:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9963-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=fSeZit46; spf=pass (google.com: domain of linux-kernel+bounces-9963-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9963-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 1BE38282BB7 for ; Fri, 22 Dec 2023 17:46:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5562C31750; Fri, 22 Dec 2023 17:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fSeZit46" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.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 1C5B033060; Fri, 22 Dec 2023 17:42: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-wr1-f50.google.com with SMTP id ffacd0b85a97d-336979a566aso574617f8f.1; Fri, 22 Dec 2023 09:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266952; x=1703871752; 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=hxV163vg4WaEsUhoUGEXFBcX2Ll0vd6Pc97F0FYEm9Q=; b=fSeZit465fX7FzYQ8pKLFqekXEZnFXH3RNRFU2mMU5ZrHnz8h0tP4V+VD3yTXA10oC d2Bn7EbX+31XkAex8+39zKrHOp+szwZn8/v8diM9HOydt8du+YDk78lzzjnLbMgqxnEb EBAMM1VVFNV7X6V49GxkQ7axRDY9URCBxRva+qfVuikB3+VBMTf3HBoLnany5WpUAq5W aZcVjG17xObmTedR7CdFfjJMPqra4mA00u/WqjcZm2FkvNeGYx1+t6Fshd5oHtrXHK53 M/y4iwc1gKHPakCykaq1kiFGjHmO0HvCKui2O1d/H5O7HBaisWbAQ7c9J9/Dt/yhw5fr 1gvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266952; x=1703871752; 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=hxV163vg4WaEsUhoUGEXFBcX2Ll0vd6Pc97F0FYEm9Q=; b=fQBc1m+zKZitdJrqTCuyI+7YA8PpGRMDOMUUZQ2trtWMS0EZLCiROT3o+hHd3OR7AW M21OPAe5d+u0q9oxyl1ILHe5KI8//7vvaYGoBhwVCdtFIY3fUxZIV3tkEXODMBfz4+Pr 8ua/n6BX0eOwwltorRufWb7rbuzyfRLu3t0pZYW7tMIxb2pYxKUpRZeyCUEhwTg7pBia kFcAyxOK0ZFTG9WqmixsFprwLDRBgY4qgPWirFGl/A6vD/OT0E0S2LquBeh+695ln99A 0062o7LhZF/jqJaCJYQhqRF76PQBSFaco2N53ZZfenWggmORwXGWlK3yUXm1vD/dTThB rsLQ== X-Gm-Message-State: AOJu0Yzzm8uXhMyA2m/GT13T6hazJgpWYlLjcsKOMIWnKtBvIlSZ/UiT uE7uCZ3iapOfcyuuGbw4ew== X-Received: by 2002:adf:e4d1:0:b0:336:5fac:d845 with SMTP id v17-20020adfe4d1000000b003365facd845mr1065480wrm.34.1703266952323; Fri, 22 Dec 2023 09:42:32 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42: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 v4 14/29] drm/rockchip: inno_hdmi: Move infoframe disable to separate function Date: Fri, 22 Dec 2023 18:42:05 +0100 Message-ID: <20231222174220.55249-15-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005105391226660 X-GMAIL-MSGID: 1786005105391226660 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 changes in v4: - none 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 Fri Dec 22 17:42:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1224404dyi; Fri, 22 Dec 2023 09:46:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGubvdayvywE2zcxocT05X3flS0hHj25qvAuGT0SSDmJTQyiMiN8bq4MticOT0A3C3MkuzG X-Received: by 2002:a05:620a:1185:b0:77f:89e:986d with SMTP id b5-20020a05620a118500b0077f089e986dmr3608918qkk.78.1703267204150; Fri, 22 Dec 2023 09:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267204; cv=none; d=google.com; s=arc-20160816; b=m4Dt288BG3jLjgDfYTlFVQ8tDx+YvelkNK5A7zzQBUwnXojFo0L5CsXtJBMQGqZlRC 6mN5pI5nRWRwPpRhSFaU0c/Weh7zhszzInzM5K2OUxowaHoEfsCRa/Dg6Q7p7zKaTYuf KitkaVcYRs1m8VcZEPZiwA2mEJtoVqm2hFHdX+Oe6pLlHoF0Mdy/Y2l042OxhxE2TPeY A6J1OTeM/vCo3Ritoh1R/UXdHPkx7kOkNQ8til/r3ObputpkGwt5VVX0soRXT2zjQNEg AYNIgTp75Do37i/xM5d3D/6ugLcnRUFtLyBcxyWxu13pRCwSJT1DYWAX0YzucB3wKrG9 9s7Q== 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=Sgl1aYbfeN4t6iirxrjmyWdX/BacrfEEhrH3G2xuU9s=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=e7WilUSfBxowgzB9qW5gjYD87YLsYI0v2TCM0rlyQBPzAAdaZgitUh+Z0l5p4l+I03 Ksr65iQhGrTyf9veEiaMiLXYAjtGXK5srYFzE0d2dTeF+Ud2/zVUcsMf8cXrbEDC+IEW UUutkrkbss8Zcu2EGqDkkaj2QfrIZSPPrIMVE2SdUFxmIhPjXA8vGDt7TwIJUdA6wmTb FYwEJKiIdd5j0s17XOMP9MjM9S8a8fPoznfZxWyyf4wKLWzIkygFJ3Lc4nuNUiyY3d7C AyypDUWFmC9oUrLpTlDsdtzilbvNhST772TxS0WQPOS63wQLN37BMwJlNFVz80oRZFHv /cTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Hbr/wFZP"; spf=pass (google.com: domain of linux-kernel+bounces-9964-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9964-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 a18-20020a0ca992000000b0067f518ca817si724187qvb.353.2023.12.22.09.46.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:46:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9964-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="Hbr/wFZP"; spf=pass (google.com: domain of linux-kernel+bounces-9964-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9964-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 EA24D1C2248A for ; Fri, 22 Dec 2023 17:46:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 912F839FED; Fri, 22 Dec 2023 17:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hbr/wFZP" 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 75ACF33077; Fri, 22 Dec 2023 17:42: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-wr1-f46.google.com with SMTP id ffacd0b85a97d-33687627ad0so1708173f8f.2; Fri, 22 Dec 2023 09:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266953; x=1703871753; 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=Sgl1aYbfeN4t6iirxrjmyWdX/BacrfEEhrH3G2xuU9s=; b=Hbr/wFZP8bW2McHeAiywbFLntm3k/cMV9c7Diwtaaq+DkPSQ22HvAmRh1VumQTCMXK iYbR7QHUaYLvm6xZxzE0XNBDsYr3QTUuArKXazo5yV+n2pWc91B2W6i2ZjXwOvOa2PCQ 8h/7ebwJlnDR/iARF0PrPNWTHCH9mrTqUzdV8B1DGcBHR92oOV5g+bCk1eBZ/+3R0iOY 7KgcL9xpmbl5npgNHFUCInLuwb7xawEJUPcijXWFRemQhOaUdWtNtXVB24QrgD8Fx5HA P3AQi2PcQ6qC2FW2vGmlUPv2FbxZntKmmAEUAzYrT9ufcPn4rOqMhW2GtbPOvef2DKFX OacA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266953; x=1703871753; 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=Sgl1aYbfeN4t6iirxrjmyWdX/BacrfEEhrH3G2xuU9s=; b=PgNVoNzZ5In8WACBj5j039xbzXX3jIq24N/ZkSRumm1zjtqguy7MOtTwQdhfHDDGyo x0OhtKsvgZZ/9K8tyJX3LMMaLqV3BzZedFBrbh+8cTU/XnSdBycUXAewbnZe9lAmRUzf M6xhZpvmK67rnCtkosEPEIiQ6MCqimMFuovUfhk7HzXb+9liCOg1AqzErkK6wzRP8ZYB sGmK9AQ2uAbHd3F8CLfek4qJ8asWfOyxn7JtSczO/yRBvIBYUeJ/xT/3qQN4wa4yqiDc hm59heCDhin65gvL64qtVy95OWcMc0bhCFG5qgnUjsv5rOP6XZtcvQrDFjNOcbXD41On R7xQ== X-Gm-Message-State: AOJu0Yz6S/ToKLogVzOQqkpCtSmEFEfDiqutre768iRGdHDFVJfrQ2EF vw2OcEnWSSmAp2l33/ZFKGvovDADRA== X-Received: by 2002:a05:6000:230:b0:336:774c:d0f5 with SMTP id l16-20020a056000023000b00336774cd0f5mr1070493wrz.10.1703266952968; Fri, 22 Dec 2023 09:42:32 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42: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 v4 15/29] drm/rockchip: inno_hdmi: Switch to infoframe type Date: Fri, 22 Dec 2023 18:42:06 +0100 Message-ID: <20231222174220.55249-16-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005112083552397 X-GMAIL-MSGID: 1786005112083552397 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 changes in v4: - none 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 Fri Dec 22 17:42:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1225143dyi; Fri, 22 Dec 2023 09:47:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsUjgnMAMKdlvjrU/ZeX5tDNZeXMPhQEoqQdTXuyj5bs+s0baOHcPSsaXFgGQox4D14CiZ X-Received: by 2002:a05:6a20:28a9:b0:18f:97c:9783 with SMTP id q41-20020a056a2028a900b0018f097c9783mr1480040pzf.107.1703267279370; Fri, 22 Dec 2023 09:47:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267279; cv=none; d=google.com; s=arc-20160816; b=QzLyXchu4L6AJXFDR5HHtAajdA7J/RBLeraAmU8JRx0ft4Ws+1zQ4SiOG9okPPD+Mg r6ijY+9022tUysXDBDTWfdHL8OiHGybGVIGdIubfq4h709dJHpBGfhRuBA9BKOTVsSNp vO0S3gpFlxINntncCvEGDHcY2PLOSHEoysBzTAmdpM8oQOJSo6fGXpnUPiXIpTaikv1f JwxefsfP0n8GJVNucYjNikPHZmTRmjOkKBTnuLe2nyRcUCLSr09w+K/MTDhBvvc3dl6Q eA0YViwf7Tcs0qDnYTZZ3WzVg34CwbeEvH/uChrwqZy6Jp/7NT4s4uj07nniI2YNLc/W XR4A== 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=fVOgOlLPAvEr0sLISb9E6/KYZz//LU2ejxtiVGPulEQ=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=YB2utMpHqO0xJzNq9OlMRRgK5Qh4rkNpCDqiVX0hxGopzZgGKcKeqZwzP09s1nh1q1 WbP0cKe1R01N5IRxQdcQ4paQs2OE2C12cyJz0EFP7/4IKXabn9a0xnx13/MHS/QS4mvr FQCrSzEGXNoiNa3D7gLIEHywFFH9VDJkC50XAvN1jUfxZgVjRnQ5IOYuaBC/2usYZ8aS cdtZ1HNBRjspaQ9C/OZ5N5Cvytmo3uuzC78WDW2kBzMxgG26zUv7bPiljG6D6GUHEGYb 20J19v/oI06LBG61fTjdK6ZR2h8nVvgel5iTMC79MQrL5/EGhp37wmMEIvun+1Vi9Peh LjFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DVq0kSZ3; spf=pass (google.com: domain of linux-kernel+bounces-9966-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9966-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 a127-20020a624d85000000b006d93b1d9b38si518344pfb.226.2023.12.22.09.47.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:47:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9966-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=DVq0kSZ3; spf=pass (google.com: domain of linux-kernel+bounces-9966-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9966-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 DA708B247A8 for ; Fri, 22 Dec 2023 17:47:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D49D3F8F5; Fri, 22 Dec 2023 17:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DVq0kSZ3" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 1841035EEB; Fri, 22 Dec 2023 17:42: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-wr1-f41.google.com with SMTP id ffacd0b85a97d-336746a545fso1256661f8f.0; Fri, 22 Dec 2023 09:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266954; x=1703871754; 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=fVOgOlLPAvEr0sLISb9E6/KYZz//LU2ejxtiVGPulEQ=; b=DVq0kSZ3Gi2uNQEj24tCvX8m5HTjKxRFhMlYeehzN2dKuam8p1auBI0t/REFkWvLjS /6VuLMr/vVs/8uPIEUs+xmsW99QJ+wLi2K697ZMF6OUlGRRHVbXdc1Yi7hrdDK9sPziz 2bS0FJ/8z+3+IltDrNPscv0J7orEuxe060N/rfyHWfvDGVWSMaLHmm4CHrLs1CVuKmkN W6/gE8RE9j1AjVWsIEYXUrJ4tmXl41dXdb+mzR9BYW1Gx7xln8qNLWt7zkUK8oBwC0AV XNA8wt/dDEq+bVo3QB1jJ8ZdHx/eyU7qfxH0qamOoxivHpt6spa9lkjMQCuiY+8tw4s9 GJsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266954; x=1703871754; 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=fVOgOlLPAvEr0sLISb9E6/KYZz//LU2ejxtiVGPulEQ=; b=t/PRUDPpUqq4KaHEOH9giibOPvYo18HyD8h5Jx8pmBFLK30C7/BcXNfHGcExnblhn5 KtvFnVveeXF6uN5k6l5q0UIPI/KN89iUu0J9WowCAzb29XZc4QeR+L9fq44uJ5qw2KgH AgOsNHWGwm4DXqWnNvBoyiHN8aWrw+3K6MFeZzPs+ei9L1s/28XDwMtpbxBQdzPJ6nVD xzajJH30IdWIkg2+iOQ9LwsFlztmagpuI3wqJYr2MA7X7uWdDQFsusiWuPOKyF472ML2 SZn4vuXu3vti3L280USW4MMYiFmnDC4xstnAoNxQwBvuN9vJv3YfTEZoza7n+4LbNl9l 3q3g== X-Gm-Message-State: AOJu0Yy1uLkHqWEI1HefKNqtMgQtTPrWSED99uFn+M2tctHJ7rpQ149O 6pxoHTj5ZH1GcQw3exX0+w== X-Received: by 2002:adf:f74a:0:b0:336:8030:214d with SMTP id z10-20020adff74a000000b003368030214dmr748542wrp.19.1703266954331; Fri, 22 Dec 2023 09:42:34 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:34 -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 v4 17/29] drm/rockchip: inno_hdmi: Drop irq struct member Date: Fri, 22 Dec 2023 18:42:08 +0100 Message-ID: <20231222174220.55249-18-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005190186938070 X-GMAIL-MSGID: 1786005190186938070 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 changes in v4: - none 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 Fri Dec 22 17:42:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182746 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1225264dyi; Fri, 22 Dec 2023 09:48:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3KMd3HTL+gHzemyQV6Q6g3a7QVFaxufHgbfg1Qpd1xa9TyWhfnCJXqZTlNUsfin6gUBfU X-Received: by 2002:a05:6a00:4e4b:b0:6d9:999b:3785 with SMTP id gu11-20020a056a004e4b00b006d9999b3785mr173818pfb.30.1703267290485; Fri, 22 Dec 2023 09:48:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267290; cv=none; d=google.com; s=arc-20160816; b=0mtlRRA4yIHx0cV0lC4D+Se3dGbOZ3AJzi/vP6eR0jDZQgGfVj16sE+zjecDAiBwRP y/SLoy72KCA/YXl1UJ9owr4o1juo8AKmKaWGY3LGIN1NRDXivyMwhZu6pYU6MdNowruM ygTmA58DOpYih5J4CMfbEyRdq05B6xghbIO89ROiPf4/pIl3qyMbcSSJE0+3CFkQ4WLp aK6q612hgSRm/66FGV1PXZlI70u3y7VuI7KKac9gDyq1KXEoP3XFbnkV0SRjAS3CMFK0 CCOy2hOi+DeuSIHLWzev3Bj4X6PbVId8gchwl+f7OT0RUrjEhoQmYlvk5scdEnlQhQpT Ajkw== 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=EoHup+tJ34Km8AW+9n07V9L+jLAh9fwpCrHBqqRCe/E=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=oyx64o+sM0g6IfRFvbkycGjshHE0cGo5gVLjzoC3Z2qtYz1nZYkgx5QkDwAZGBhB0X 6znUANTvne0BzM3nqKKjM9U3dEKDZDbX1Q9sTp9YqwbE1ei73SEMLahOVt2acVHOIAz9 jFYmpllDv4yHXAGTGyI0IeE9mYApIghfJ6xX5YcKBxb4kj7C4DX4lV96HVK8fE078Sm1 en7q1kPsxNCE3I7mil3NIE2+tnZtquSI79dSwWsQ3vvTB4OmZ980Cr3MHro5rmNdD8oK U0s9UC1DTUUnNLTW+frO+VmGAhVd+oT+7l2MjLWI0kWQIXbeuI9XQXF3h5kwN3FqAbdm BWaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DqPUl6h+; spf=pass (google.com: domain of linux-kernel+bounces-9967-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9967-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 o13-20020a635d4d000000b005cdaf95abefsi3573429pgm.506.2023.12.22.09.48.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:48:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9967-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=DqPUl6h+; spf=pass (google.com: domain of linux-kernel+bounces-9967-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9967-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 7949BB2444F for ; Fri, 22 Dec 2023 17:47:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6FE4446A6; Fri, 22 Dec 2023 17:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DqPUl6h+" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 9CFA635F1C; Fri, 22 Dec 2023 17:42:36 +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-f41.google.com with SMTP id ffacd0b85a97d-33666fb9318so1833376f8f.2; Fri, 22 Dec 2023 09:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266955; x=1703871755; 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=EoHup+tJ34Km8AW+9n07V9L+jLAh9fwpCrHBqqRCe/E=; b=DqPUl6h+jeKUhEhX7g3uF44PAkkTMAUGKkL1G4MuZGHH/QiQWJr0L1TZCpHo/RCP1h 0wocgZocYFrVYY5KPYizuXdGZdRbbYHdOY4zroZ/NPxJFxXpKXk+i4sRKlqRqVSFl56A qHQHYN7psI/Kv8VjbiH7xY1QsostTvRT41QZeeT3vAqTVS9RPcaQf4FEkCWNYhw025qE RfV+XzBBN4Bce27+ZiOsLljtKvWFnivvIYiSrcmUtHcbnMl8jgfzLLq/kOvjUPp23kMY DXwwkHfpyLxUpILDGZTFurMMqCey+q5d2J0xf30vA77njMSD21W7iQY168oU1dXZZ6Ta kJcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266955; x=1703871755; 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=EoHup+tJ34Km8AW+9n07V9L+jLAh9fwpCrHBqqRCe/E=; b=c/MJok5O1A9nwdzJUOwe+MJMs8Ooq1MUqowm0mCNzevSZFiTBvyAQptCA9Owc8khKi Lkrr+D17Xrqzl5D4VX1zzbu7L3D956ONlXBz0wg+Ik34uA9hGY3Bfgkv1lLoL4+q+COd KDNHAYNZimfVuZLf6bGkDAbHqjpp9wWb+h8iUQ5Zdpb9juhH14dthIddBOfLIHiclLwz XBehu+ZtHqq5YY9TlnRecYpKd3OihWvSjcN30PuDvV7yjQyRor1Fb+vbkRsJDuyiX6Tm Vq9KGTvGVHiq84K3TK4aBBXT3hsXnIcaYa9w5KJlSSxGgGe4wXLMqv0hdUKFqTvCKfSR APtQ== X-Gm-Message-State: AOJu0Yz7kmzS33qPiANxFoJ3A2ShW7xGNTwLt4h47cIleucALvvKQJJz Dd7NVpJjVsmZrMi2r3L+Zg== X-Received: by 2002:a5d:400f:0:b0:336:8063:e066 with SMTP id n15-20020a5d400f000000b003368063e066mr798319wrp.52.1703266954984; Fri, 22 Dec 2023 09:42:34 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:34 -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 v4 18/29] drm/rockchip: inno_hdmi: Remove useless include Date: Fri, 22 Dec 2023 18:42:09 +0100 Message-ID: <20231222174220.55249-19-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005202523606119 X-GMAIL-MSGID: 1786005202523606119 The inclusion syscon.h isn't used anywhere. Remove it. Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - new patch changes in v3: - collect RB changes in v4: - none 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 138cd4287dea..c306db90832a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include From patchwork Fri Dec 22 17:42:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182744 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1225090dyi; Fri, 22 Dec 2023 09:47:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxEK2XbDIB72Xy8CuQj0iUbnx0F4dyFqlGtXG1/NZlAV0shfMN2djRg5QLNdaG1deltOtO X-Received: by 2002:a17:903:32c8:b0:1d3:f8de:3bb6 with SMTP id i8-20020a17090332c800b001d3f8de3bb6mr1561998plr.133.1703267272680; Fri, 22 Dec 2023 09:47:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267272; cv=none; d=google.com; s=arc-20160816; b=GHWuZJOgiutWzx3zxnj3jwQ0GNhdzNhaQhxZS9lVeBoVVAzHYNkVl+qT0TXkIaIPqW UKwbUora0yNqBBLbAaM1lSELNyQ9yY9U2wCks9r1ApwhwYeqYE4qWNAli/KvNiJ9FNSe uj/lRVFdqpvWsfSM1rcAylpvv2u0TaYi8B2yIT5yTt8q/HIZu+e5eSwZapw0/qUV9QcA eXskko5KBcP3qCNETGNfZ7/3R6sEiqfGciTSiHTuS6WcXHtcjSAETv/gBXI8Bq+xYHjk MsvQy1K2YD1Fvz/u72IW3ZY0jMd8D/Vb6TgzO2xgbGh8nI2YO5SCliQUjW1VqKU/nyqH sjPA== 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=nTJLdrH0LrbSbPhi76eSCJAOBnRdB++mitsqsoondcw=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=mNPdG/rtjL0SodajlZdTaKdmS0L0p6eUQo3a27xxc0loqcZw67taiy0t08o6PyGUgH c6QzNIebEHf7DvP17LQs+9See0NEwLxe9ohRX4h5WzFXez16T1Ik2wyHrYbQF6zpL6iQ ZDg47Y/7NlyIcLGmcs7EMabjTc6gPlNYv7uGCGLbbL7IFsJEzNwgOxzuYyT/+OB2X9Ka 8TdtN8gptVUyRtnqoB1DBPhdWK8f97eV8SWIgcVLOUDnbeyhJ/ubiC0WGYCJlaWRTt7W Ob7Rbriw8E7NPtMy/QyN7SuTUt9G3wYhigjR5f7Vqyg4oIQG3o/id12MrO+nwTyagD5C uNbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YAFRndZi; spf=pass (google.com: domain of linux-kernel+bounces-9968-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9968-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 h4-20020a170902748400b001c88fc3c593si3418739pll.560.2023.12.22.09.47.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:47:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9968-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=YAFRndZi; spf=pass (google.com: domain of linux-kernel+bounces-9968-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9968-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 6F7202814B7 for ; Fri, 22 Dec 2023 17:47:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFBE6487BA; Fri, 22 Dec 2023 17:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YAFRndZi" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.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 A936E381CF; Fri, 22 Dec 2023 17:42:37 +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-f45.google.com with SMTP id ffacd0b85a97d-33621d443a7so2019738f8f.3; Fri, 22 Dec 2023 09:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266956; x=1703871756; 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=nTJLdrH0LrbSbPhi76eSCJAOBnRdB++mitsqsoondcw=; b=YAFRndZi0g13Jf1g2/ncQ66LWlkNdnlNYu9ecbT3C/YTjPFjpZ9UX06V/9mLMi52jL cXLEPpI6FG31C3TX2cl3a65TMycowe7orBPtnZaDBtZGYBfjwzBQmDgp8GlPkg+wZnP1 wxHvf5hDzrLijHOC9K2VsGH3Zy51F4cMrtrRJdh+pjovzYNIaoCIVUx25bbh8XEs7llG IjQxMp+RZGwtcOINMVkXuEynoQ9XiPrznHhAvXPQwBO0+rITmWfcpAtZlscOQFazwLgk 5HswGgPKNBWfnMR7xkFRBndUSWMlnMeOXvwpNLj+eiunoHBbMy0Nz5zpZoWjt84JH0YN ZblQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266956; x=1703871756; 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=nTJLdrH0LrbSbPhi76eSCJAOBnRdB++mitsqsoondcw=; b=HEBNz5R9Pua7PYym2XWG7zHJCfkjcmd/ntbhd+MSvL+gis3dtB9ywWnQdS4N3Zj7ao c1O6U3YIoGPmpw/ZPr+vglik5kpvIiq+kUtc7oMsmfo6eaN5ASwlJfwEOE1tD9tM2RdR nsTGBjqnLj8YGZ6u0XzeaCAaMCHxpP7K53rDW0Pa9q2WXok9jowidPBcXRtDRKQLg/JE Ft1tk0ms4tRY3SzRwcOui2NsHmVPkDPgK7Zb0g7y4YNm5QLv/ZWBtR230fEN2S0uKSe9 j7P41qsxLIbQuY0p/MfZ0qdBo+2gac7qabY/dnJNtOPg9E7qyy6YzCsMVeVVvHA0zzSW pQmA== X-Gm-Message-State: AOJu0YyM7wOuteVQrGeR8Lcgg+lUGle7feYgF4AAdeWHTiNo+otr6Hfl evJAzzaDS0rXIdc0cgUmGA== X-Received: by 2002:adf:b318:0:b0:336:7a35:4115 with SMTP id j24-20020adfb318000000b003367a354115mr868279wrd.0.1703266955745; Fri, 22 Dec 2023 09:42:35 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:35 -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 v4 19/29] drm/rockchip: inno_hdmi: Subclass connector state Date: Fri, 22 Dec 2023 18:42:10 +0100 Message-ID: <20231222174220.55249-20-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005183575257944 X-GMAIL-MSGID: 1786005183575257944 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 changes in v4: - added missing state destroy in reset hook drivers/gpu/drm/rockchip/inno_hdmi.c | 117 ++++++++++++++++++++------- 1 file changed, 90 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index c306db90832a..e43fce968310 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,63 @@ static void inno_hdmi_connector_destroy(struct drm_connector *connector) drm_connector_cleanup(connector); } +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 void inno_hdmi_connector_reset(struct drm_connector *connector) +{ + struct inno_hdmi_connector_state *inno_conn_state; + + if (connector->state) { + inno_hdmi_connector_destroy_state(connector, connector->state); + connector->state = NULL; + } + + 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 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 Fri Dec 22 17:42:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1225487dyi; Fri, 22 Dec 2023 09:48:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVdjYhZDfQ4U+yQf/ZzZ/922TTqaA9m9yXMTmyZ1b0WNHgn2K3Hd7A2zd14UFCEo6D1bMv X-Received: by 2002:a05:6a20:8407:b0:194:978a:6e42 with SMTP id c7-20020a056a20840700b00194978a6e42mr1730075pzd.78.1703267318371; Fri, 22 Dec 2023 09:48:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267318; cv=none; d=google.com; s=arc-20160816; b=s0sp3tHxle0L4kvK7iOqZ/ftMz8+ah/xFcaxPwAL8dRjbcexr62+nqKRzBYcT+F6uc 3Eengh0R9NnDqaP0LVY4kNSRPRWZpIrSQNda9MaDtgphcE9vdcCajgaIAAGnilFgNKss jXvXIQUF/6509t6mtS7JimYyj8ZI5isub5WeboJNYJ/mCXyVATFRELyWbGiPxFxs7Foz 9oBwFgdcv4JqjFmdfhoxAeBXI9ftq2Ql3yHVTrX1XGIOBi9Nno2yzCfJCVcm8VZEVivw 9SLQ1yr24seVme4h9YUJ4G+iglU84O0dvv7e+RRNEi/B8k7nFBzBIr6IOrcVMvzhuuoG o2sA== 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=SzkYbwlGueFkeXw8MQWVExgytplkJ2Nf/UnR4OES2p8=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=jDAc6hwWUiDLRrXpXyJE59bFBn+a005MqhFq+9XSH10u5yLioVFNoj5a/gQrihEUGe c0JvoOJsUt9L3NlqU7G1Vj+50v06G4j/nOu5drkKsctGp/dlR4uJj4ttMKhU7R2h9GDm nCMu9ppKcicMAjKyupac8eWMj1htrUvrE+lQo60nb3eaudkue2lX0QkHTBNWSGeX1I8D t9rp9qnVjiUh1gnJ0zp24p/pa4l2K0u3NZjxkCi5nkWZU8WE8TkhIyqeQAtzh12NhR3Y HxYhSlCFa4ugnVfXrAwUxRn01TyivCVUrcpJ0JG22M6B3vdOAIfNw6tHxW0rRi8dPCyx vyKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=M3SWqONi; spf=pass (google.com: domain of linux-kernel+bounces-9969-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9969-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 l62-20020a632541000000b005cdb0622c89si351140pgl.16.2023.12.22.09.48.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:48:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9969-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=M3SWqONi; spf=pass (google.com: domain of linux-kernel+bounces-9969-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9969-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 DFBABB246D2 for ; Fri, 22 Dec 2023 17:48:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3527B498A7; Fri, 22 Dec 2023 17:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M3SWqONi" 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 2AAA938FA3; Fri, 22 Dec 2023 17:42:38 +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-40d48304efdso4205555e9.0; Fri, 22 Dec 2023 09:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266956; x=1703871756; 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=SzkYbwlGueFkeXw8MQWVExgytplkJ2Nf/UnR4OES2p8=; b=M3SWqONiCNGloE3SGnpEhyq0l3y9cuz9EtsSlWRrZFNhKVOJ8Ia7K4337/ukErlIQD KxvAhr2xYW/LRMb5hplGOxSx+M5KO+BIZ+WF0JY16e/Fkturyd7UWxxK/R/NczulmXX1 HmuDrvc+N/+QUOv9T9eD9KqaHoPVvZA+FkSFJGnFrMr3taJLLBiP97hnPFoQwkyONZ84 B9KayxYmMbDU01UjA7EgJEPpipgCZA9sOEtVb6n9b5RsDpY3fHbIo6vX4T1nc9jeMjjV w/rJQNuJkYb3SOxjMhVJi66FMy5TNWp7533nnPun3adZs0uPzQBDQ9rg9ZR6tUo8n1PW nrDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266956; x=1703871756; 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=SzkYbwlGueFkeXw8MQWVExgytplkJ2Nf/UnR4OES2p8=; b=GlhkX9MKYXDGBYVZ2G16urtd0HzS5KgPgEcWAE7klrCnmgQk2krnUgcUxovho5pXY2 6eZPoZ7e9MYvQYeo34M15NQFg4Yl0xGHcQAUvYqGZAdk2m+Ktm6VnAe6KvMnxdZ5CW2Z KYLPVHEFh10NSy2zFrsgwJ0/BwGTIymc1YWuybZ8g6oAwWi/lwCPE1bEhHPp0ptlVBzc RHH8E82IKnNFd6jp02EJvbZgO+qbyJ0223nmHQishbbC32IVP7OzJYY909P0luY2vXPk MfLd/IJFHFtb3fj34y5Bx59W9mQ/fTvC9zOqZDAu+ZgOLL0o8UT3flvOqW8p8m0swQZJ rCyA== X-Gm-Message-State: AOJu0YzecwHhSBrqTwY2hjBoTPifn5EU4Er9mCYUbXEfniXADXaciPMB icLmZxDTkP8e4LmObpnkFg== X-Received: by 2002:a05:600c:4e87:b0:40b:4808:5d0a with SMTP id f7-20020a05600c4e8700b0040b48085d0amr983939wmq.17.1703266956443; Fri, 22 Dec 2023 09:42:36 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:36 -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 v4 20/29] drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range Date: Fri, 22 Dec 2023 18:42:11 +0100 Message-ID: <20231222174220.55249-21-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005231563866865 X-GMAIL-MSGID: 1786005231563866865 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 changes in v4: - none 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 e43fce968310..f3b90b479ab9 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; } @@ -559,6 +582,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 Fri Dec 22 17:42:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1225428dyi; Fri, 22 Dec 2023 09:48:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGF74QQPfi0LiUwKiGaWoRRp4aK55iB18FqIIu8+fstHTRfCchAuk3+J3l95PVE9XQ3Bb+H X-Received: by 2002:a17:903:2b07:b0:1d4:1d01:b12 with SMTP id mc7-20020a1709032b0700b001d41d010b12mr1806393plb.79.1703267310665; Fri, 22 Dec 2023 09:48:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267310; cv=none; d=google.com; s=arc-20160816; b=QCXxwfubndzjZljZ3Eu47wd/oCrZvfYL7S8tc7DKZiM0tOjUTRT0ZM0mUx7iZ5XjSG hUaaauKADbNRUt90kmTEq0Ltsnctu0YLlcG7EHtiSzrE0ybkN1SvNmgpcL13bIwz2uJF 8VBjpbhJ18HF8pmVgZkDDmzadvdGulZnB5E6vgSCO4u5IvZ7t++xZb6C+CL9jmMk6A/1 07yU9EsjQbwb83yMUzzIy5k0MIyvqSpc6lmOsuKaJjyOqxs/4U0hc+3H7HY+ZTv/oVgM GkGMWYXh9KJRxLem5/3YEdsTeUcF3V4Mjm5IVKfBFVli2BIh2JqsKAMJYFe0UJLV8Y1X 9EaQ== 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=nfTDEigy6tmq2Mn9E1wnnsAPUxEbWwuqi0N9nc+qdGo=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=fzPvkr1BLIEl2ynQmqH0XFTKkZXCSUdKRQHedr855HQvIkLp7cgA2vbY5Sn5dmW/ZY G6M8lTtkM/dCJrnm9/vff5Q57ujD5t0kF8cZts16DtEtrctLVEqFY+Y8FL2MywM1oLEV Y/IJULpVPMUGp7mennCHnyJBpJp7C3gjpSE6/G75GADhPJc66tarEdhsYAhE2BEkUK4j eFkpAHXRGv1B5myo/xMPCW2yqW2hGz5dl5jlJlIX2a3Dh/SMflZw90Y1TCBikQI9RP1G z5xyXwCzx2FVRLb5O0agJ56QCNh7SrTlAI76Jij6mFF8So+xWoUAU2LiFaCtlAnr8qIa dK2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jYdOF7vz; spf=pass (google.com: domain of linux-kernel+bounces-9971-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9971-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 e12-20020a170902ed8c00b001d3a297f9e0si3467071plj.185.2023.12.22.09.48.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:48:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9971-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=jYdOF7vz; spf=pass (google.com: domain of linux-kernel+bounces-9971-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9971-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 64035286E81 for ; Fri, 22 Dec 2023 17:48:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E9904BAAC; Fri, 22 Dec 2023 17:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jYdOF7vz" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.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 82DF73B19D; Fri, 22 Dec 2023 17:42:39 +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-f44.google.com with SMTP id ffacd0b85a97d-33687627ad0so1708236f8f.2; Fri, 22 Dec 2023 09:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266958; x=1703871758; 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=nfTDEigy6tmq2Mn9E1wnnsAPUxEbWwuqi0N9nc+qdGo=; b=jYdOF7vzKRhpy8++/ZXyEzpvN0070HBaPQg7+JDxaJw4nsK8XDguLnMrriun1sHzQE jdGlJsrFY3bgnsvqnsqMCMtJ7pZjU1aSLlq1O4y+10RzKb33EYIx2UlDNN81RpBH83VE 711nJjgM4KTiHJwKFA9jbPfZLC5FcBwefjnrdSficY1qYVteE0DJvJooTXUWQ3JCjQvL Zksf+rYNBP6OzweW4jGbzF/mUhMmKj3qLoiX9x3LlKjNmYu4blyY2puaZHHWBV4m2Uzo 7AtNfyBUgx973PZMD4tpW36b2OnKE9AS/g8cz9eZOkwXfQJ7JWSRSK2ECQmTkegjlTVF FtIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266958; x=1703871758; 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=nfTDEigy6tmq2Mn9E1wnnsAPUxEbWwuqi0N9nc+qdGo=; b=Y6O795ECjaD0xKMu+A8rhOAH2yybZAuta1TJr6DZdvLGD62r4gtlgs9Cp6RzXCVTdS aafHjPjgwwY0jd1v1O43s1d9R92V5AIDHH7kzR1QwqvX74sfNVs1C4u8oDPGQIvCn6L1 9dd5qWGfi6ex1X8zfJW75nDmtGa2khELXaxEJ3vPorrnk8ApgVpQKnHwtBYeO4ARSAe+ N6n+nKEIey669qbHyWI95wYV6MbAXStd2gQC0OWV7CMtYyN1XpUzoXYfs9TpdYZxuWSN oRv8h7KfEq4QNj28RLb/mlfcqSi0zASblB10hso00JXgLdjR7ZpE7u4eBlZj7wmKwBL1 bXMQ== X-Gm-Message-State: AOJu0YwGSY7TkDGfhq+WLaWPzB5R1tgirBJf6WfPGx/R9353RfVYQlGk vMDHJflhGNhsfhlLDY1m5A== X-Received: by 2002:adf:e74b:0:b0:332:e667:4277 with SMTP id c11-20020adfe74b000000b00332e6674277mr1205025wrn.40.1703266957871; Fri, 22 Dec 2023 09:42:37 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:37 -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 v4 22/29] drm/rockchip: inno_hdmi: Split power mode setting Date: Fri, 22 Dec 2023 18:42:13 +0100 Message-ID: <20231222174220.55249-23-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005223958389631 X-GMAIL-MSGID: 1786005223958389631 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 changes in v4: - none 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 52b49f44a4f4..44c311e7e2d3 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 Fri Dec 22 17:42:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182749 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1225577dyi; Fri, 22 Dec 2023 09:48:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnf5dDsZ1S9PJRrWnZjJdglUBj5M2zfe3X6zW2tF77NkYYpWlu749Fz/0N8R/arM+I+rRs X-Received: by 2002:a37:ad0c:0:b0:77f:2f80:9a57 with SMTP id f12-20020a37ad0c000000b0077f2f809a57mr1890718qkm.35.1703267330477; Fri, 22 Dec 2023 09:48:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267330; cv=none; d=google.com; s=arc-20160816; b=sHY24U1MlzKRtK7kUjDf8/qxjzatHpB8s3THUCYk+azCXUcI7mGTrkQ8Qvs5nCbFV7 u5uDIAT6GH51hErN9B/2ofgHLII/C2FOtCnYWKdJx98pkxpTAEtDEKONS2FCwTRnXYz2 IHk08BrdLWAUy8r9jE5i/yGGV/1eKToPiWO53Jxcu106kvdjMMjiHxsmpq9zxaz+pFBh L/3s0+YL9kr7AKpkIF2ZKVMLPQY+dW0CVH6UIyRy9rpkAUvpvmZEtL4TNHWfCEqcM0PR AKsn7rVN0udWFB9YGaRl3d3NVvslmSmYOcDhsDe9oMvKg0ylQemGrpyLyVqKc7IHTJYF BqVA== 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=OuPa/UCZ+S+tpMXY2+ZSGIMlsWF9xT2DWjDbU4B7UZI=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=m5lwZPPzsItO609cY4dMZ9g33VkceCra+FE6vktRtDei+2PHRC81rz1Bog+4mFWMdQ 2F0QCQVW/DVY7oCyQfk3PylwL1Aw3lNytdjjVYFXM7aQEUeKi5ylfKOZVYLvDeh/Ae9j JeOKNZJyqt1zriZb5cfh77D60NADrzg6r5P6tnQZHIXDj2x7QErguFMWQ6iveQloY5Xu jrkmqO+lzVkyBiOQ/Xn/ZkF1dYsjYh9tR3Hr40PTLCkDa1/2fODKxq9kCY8A8pACC6RO aJGOQA3Kke1pf0x9WTO8jNLv8voS5UbNneStxCer12W3PoBlM+2J8Gzcd6/JkENnDW5T CbRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Sve8O9Kl; spf=pass (google.com: domain of linux-kernel+bounces-9972-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9972-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 r4-20020a05620a298400b0078130838b0bsi1194305qkp.471.2023.12.22.09.48.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:48:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9972-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=Sve8O9Kl; spf=pass (google.com: domain of linux-kernel+bounces-9972-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9972-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 3720D1C225F4 for ; Fri, 22 Dec 2023 17:48:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 802234C609; Fri, 22 Dec 2023 17:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Sve8O9Kl" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 5651541740; Fri, 22 Dec 2023 17:42:40 +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-f41.google.com with SMTP id ffacd0b85a97d-336746a545fso1256686f8f.0; Fri, 22 Dec 2023 09:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266958; x=1703871758; 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=OuPa/UCZ+S+tpMXY2+ZSGIMlsWF9xT2DWjDbU4B7UZI=; b=Sve8O9Kl1AxBAf+S33RJOOmXK4QuNDROQYUVtamTi7ETSSu8bBoLc6rzsCB77DYTxq RYVIazZaazud7nsZ3zcvwDU8U96dU5TL8o3ZFy38Xm3FhtCRO+yKWeJkB/QU//TBAMJ3 HEp1eZ1EEyLsQgSUOZscRoRRn6BfZ2tfHiTrEQls3bt3iD+Igak/ulOG//dH9x6pqJqX 0QOe4IfOMKFR9gh88w9Wemcrh9T1u9dq3LlSBHHbWQaCqhAjvl4mQS1n+kJ4qrrd19v3 2BJbs0BArmb6EMyYQ7k0FwO0ToKFXG0lDd/JR17hIGOQQcqmkl3DyuCvhpXlDrcqnAof CyLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266958; x=1703871758; 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=OuPa/UCZ+S+tpMXY2+ZSGIMlsWF9xT2DWjDbU4B7UZI=; b=VYaecsPKs27vZiH+ftJXYzWftb7A/+8qp2RVdZ4id+p5bTImlS12KXthEyNMcPDYAK 3GogjP4Fz4WRpvydAG3M9qgSB/bJZngD99r+XRVehZ+Z90ZSgQOyupcV56F1Q7e32uPw rqB3F95hADuYsu+pzRHuXo+E8/cQER3sSgBZFCcnWDEHBgVCFiydBq8DqNmiyygX/Pfj PgYWl/NmKVn2z71FMDQ+5/Jv1FEk7sGLhAZ5SqVe7ZrT4t6Ba2eSiPZWgPdfDAgpoL/z waeEdeGlmztq8gXOlqwtld+uy719mCSiOXIr9IUh5z4+qx6hoR6mRSKXjvx5VmFa2mF8 Ed2Q== X-Gm-Message-State: AOJu0YzzMjvdFXLgcGAPPSTyYedV60yW8pUc3MvGDQu8xhZVluLzMP/b sHwgBgoIbg5MSP8vxBFQiQ== X-Received: by 2002:a05:6000:1c9:b0:336:6dd3:bfd3 with SMTP id t9-20020a05600001c900b003366dd3bfd3mr1061282wrx.37.1703266958541; Fri, 22 Dec 2023 09:42:38 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:38 -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 v4 23/29] drm/rockchip: inno_hdmi: Add variant support Date: Fri, 22 Dec 2023 18:42:14 +0100 Message-ID: <20231222174220.55249-24-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005244369882008 X-GMAIL-MSGID: 1786005244369882008 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 changes in v4: - none 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 44c311e7e2d3..34f0358e8d7b 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; } @@ -827,6 +878,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; @@ -836,6 +888,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); @@ -929,8 +987,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 Fri Dec 22 17:42:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182750 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1225717dyi; Fri, 22 Dec 2023 09:49:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGr4ROgsy2lL3MWte5kPJLp05nlobXPO/+Z2qpiritPrTH8RbG4pb5Y/UYy79A4L8xRECqA X-Received: by 2002:a50:bacd:0:b0:553:faf6:4c8d with SMTP id x71-20020a50bacd000000b00553faf64c8dmr932752ede.35.1703267349002; Fri, 22 Dec 2023 09:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267348; cv=none; d=google.com; s=arc-20160816; b=pU/GqnwtrOxkPxCv6Y6bRYVC+0LDp/HQfpS6tL7Z61ylgyHdjiShK8ub9jyAzXGCvK iDEGHrG4N1P+V/nUlJOFdVJPmrQc1SKi0qRELXj4RY6+i8Ii/hssEBeGlsI0oAxD9/Nf GQ1eIsbOexmJoVPsMX6JkdoW22Cg3BPOL3rnIpoGg2PAObOYf1xiIC3qX5MIt+A6q4uy CIXVdVUthNIi70K/OfvR4NZ4bxV27HgQtvYVRFP9iIXaVd7YJ8LKQp3FmaP42MlNLUiR PsPEp5efV9xrDELa/vQ8WNz+C2G/LEMGK8P8Uk7mB6EkZ3/H7oKQ6nXI4kSQpb0bCMbL n2tw== 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=PRDLrc4Pqc9q8YV3BNYLNdW1nNQ91cRb/kLeFqZo5Z4=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=068g0bHAEdaZtMZo2gazdcqFBFSeUxgc9gKJ2ix/IfSGbgAWP+wxLZyyydCdvAWRWz /sz0QCK1FHBfapVDwPY/SRZQ8hSgctiIPLfTRUQHaezrasSU8KgQqGmb/sPh96LKV9R9 p4EWEukwsfPNZtnCWhiUdC6G7YaC6gN5X5P8pS4U/P2xGLfxyxxWRMO3me/4EZMIt/o1 AKGQPbDXyo50djK9LWVzGF3YZxsEtKjaMACOf3/wPTKTmPiGonLJJehFShV52MKS8nFL fK2kYXPOTCGRZhQkutRRqj/wkEXnQC1azZqzSUfHGPsxjGVO874DP4qnkJOPf+5EGZFC fmEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LR7K5+E7; spf=pass (google.com: domain of linux-kernel+bounces-9973-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9973-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 dd16-20020a056402313000b0055468afa603si412082edb.396.2023.12.22.09.49.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:49:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9973-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=LR7K5+E7; spf=pass (google.com: domain of linux-kernel+bounces-9973-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9973-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 782BB1F23B6D for ; Fri, 22 Dec 2023 17:49:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58D5E4CB2A; Fri, 22 Dec 2023 17:42:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LR7K5+E7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.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 19E1A446C3; Fri, 22 Dec 2023 17:42:40 +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-f53.google.com with SMTP id ffacd0b85a97d-3367903b4dcso1994251f8f.1; Fri, 22 Dec 2023 09:42:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266959; x=1703871759; 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=PRDLrc4Pqc9q8YV3BNYLNdW1nNQ91cRb/kLeFqZo5Z4=; b=LR7K5+E7qWUu6IM23FVY2fu583rdm10wZUP14OqI0o+AZ+Sw6hiruj3KCqof+EaktR 6f2mbOj1fKGvKWPLG6piOTf6jbAjdjVA8fkIHVDnxL4COKYZWX9asv25WsCc03/T+P64 Yt6MKyESi/pmAZjk1qMn0YRPxPFYtI9Tqvnj+7+lTB1UYIC6QA56WmspbAwVnGkOlmmJ hHHJH/YqURYW3gOYKCnvwJ7tnYlRjMmMABT/2IXtknmz3/AITNGi6HHIbNL3UuFhrcFd UIkpkZ/D428ohsKaUfPMXFaDTULlSt0p2alr79Z8+6NTUjGRB71jY+r3hud/J+UmEttE DbEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266959; x=1703871759; 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=PRDLrc4Pqc9q8YV3BNYLNdW1nNQ91cRb/kLeFqZo5Z4=; b=k5jbc6OcOpMZFxOgscxInIxymePvahcqTY8osu+oMyyhnzYhkGeAgbzfio4FKkA5SK mtZw3pvosHPD5bqq5V+9fvCA1EIsYdhMOYBCthXbVgmKe5Er3cj2SMx2fSQQQgciC+BQ rxo7G+3PjimMztKvvSc9wYpywoQFGP6sQfPz3buvoQmaLrC7oIPlRdPec1jN23VAo7Ag p1iX6mGU7ZQoQMrFoKGsUHXDdGhe2pCdF2F0rexau+ueM7N1C3JpGn+TkpidL98mv8aE oY5PXxduLGh9Q7XDiJN69AGbce9OcHCU9MbnanmxpbaJRSTfoJA92oZTwDzm6wW5ojx0 vIfw== X-Gm-Message-State: AOJu0YyR2IYDuke2UQfZmg5Am6+awDKtKTw/GsngWtIHSgpKxh0pmGnw MJZH3/+ZDuY4zzsTa5VqPg== X-Received: by 2002:a5d:66c6:0:b0:336:7a37:27ed with SMTP id k6-20020a5d66c6000000b003367a3727edmr931646wrw.20.1703266959411; Fri, 22 Dec 2023 09:42:39 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:38 -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 v4 24/29] drm/rockchip: inno_hdmi: Add RK3128 support Date: Fri, 22 Dec 2023 18:42:15 +0100 Message-ID: <20231222174220.55249-25-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005263568758075 X-GMAIL-MSGID: 1786005263568758075 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 changes in v4: - none 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 34f0358e8d7b..3b76929deefe 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) { @@ -911,6 +918,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; @@ -927,12 +948,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) @@ -956,6 +981,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; } @@ -969,6 +996,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); } @@ -992,10 +1020,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 Fri Dec 22 17:42:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1230462dyi; Fri, 22 Dec 2023 09:59:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgF97p2vbVbcHVjNiPEHRbvxYcj0bRRRqdx3DSwa3yNRe8qcZbXreoOj7VZO3ZUNrRGJt7 X-Received: by 2002:a17:90b:3655:b0:28a:e9a7:3281 with SMTP id nh21-20020a17090b365500b0028ae9a73281mr1378357pjb.9.1703267968151; Fri, 22 Dec 2023 09:59:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267968; cv=none; d=google.com; s=arc-20160816; b=oo8BHuV+2BIl3axmg9zmyqc9zQDs8c6E+jVC1wn1Mac9YFovkejvup0dtjcS+iT2qL m7iNnNofM/Ks6d7k1GTBJMPHndymdUKed2fSZrWiwlNRJjQ6at+o+0wueuClYeC8cVlz fwtY/UeDpbm60cbyuMsgemRb3Y3M7ritdG9C/3BYTdcsNrYAxdfotOexymDiiXtanK4o VmQgQ/1rX/wGSNNomw5Zs0S4TYe48pBTISGabc3B9i6efYdbB+i7xVfoeZ65PeI9Xm9P 6A9UJrwmykbn012Pn2SftrxMdVMhLqgbKLPTj/38kkyYHl1Q0OwG3B9WzU6I9duNXuvd adNQ== 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=UAPEf6VCNcNpH+vS9Jy42mEPmnbb20QERJ8qe9km2VY=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=y+1Nokv4jeUB7halcxAv92Wdhma8pLRZTa3t9vaOAC4zeVjgJijpScE03xKw1P0lMF XiZvU0BF8ATw1YqtNednZXVzSDMUuODqNd3OLetpvyPexGX4/9R3OJGpDU0EfHitrcbQ bAbjFL8df0wUo/YwY9WnMI7wyTLOd/6kmM3eBkeoNs5/Vv1J79YslQ3orHQK8eH81KEa ja1iy7m4L60cGBUD+oXPHi5aRHNJnflJbjZxofkeHxdivobLXUeTdMXXzjhF0tsemcoQ ipEpItCaI3WiaqBo+rQ41juZl0DjRjRpiOwT+vxR9uToXKaQJsgSoo7uhZ/rhyp3j3cz StdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DCVK1nRD; spf=pass (google.com: domain of linux-kernel+bounces-9974-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9974-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 t23-20020a17090aba9700b0028b6b12bcc0si3706118pjr.13.2023.12.22.09.59.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:59:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9974-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=DCVK1nRD; spf=pass (google.com: domain of linux-kernel+bounces-9974-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9974-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 DE4B928732B for ; Fri, 22 Dec 2023 17:49:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C17124CB4C; Fri, 22 Dec 2023 17:42:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DCVK1nRD" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.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 B52B848788; Fri, 22 Dec 2023 17:42:41 +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-f53.google.com with SMTP id ffacd0b85a97d-33687627ad0so1708269f8f.2; Fri, 22 Dec 2023 09:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266960; x=1703871760; 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=UAPEf6VCNcNpH+vS9Jy42mEPmnbb20QERJ8qe9km2VY=; b=DCVK1nRDcOTtlQ4GZ8a9kVSvqA51q76OqpYuGQNhujoTa9FQDuA5sxP1IDIb/99iTC FEZpjWCCEKQ5kndlP3lTniHXh4vtvKpj6fzc1XM+CDIDmO6cp0wX1iMTaV4SwIr2oOin YA58sibHR1Ns2t5lzQSZFOnhlCFM+hvWx1QXe5OfB4V7+WVMVNx12VgMlN4XNaDMmzpB TuSqspMHRFblJHVgyJN2ik6tiZbSY4JDxdYpX0H4e1/5K/oTU7UEsD2ChrlHNianxduD CuDw/x6+nW6tS4UPJaa3zKNWHkJBMCi5iB0oPglgK098DZxIXIFZd6onmhl6CYucf7c3 2uuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266960; x=1703871760; 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=UAPEf6VCNcNpH+vS9Jy42mEPmnbb20QERJ8qe9km2VY=; b=ahKwLTK1Tx+veUmtwXJErGJnrckMgG7ht1Q+r3My7VDOJG5qD5plDucqtK6fi8XGl3 uhvmKGuLrGjJNgaiFoDwD8ayf2GOl+0EBmr7M/zVljwML3sWV/bR9FBGAp/NXEZzWpCL jvqg+Dd/THf4xwfE2LVfjf3FOhLdQqsWQkdfftkry6cdUnFmdv39JdmTzphaNtlg+gwm +UG+0YFZyjZaXTJUswtQlGNJ/p9/nTAeSZC1FYZ+YRUGTFzPYg/NNE3ulnzr+dnkY1X/ r7jcNfMhDfjTPRYNX0nQ28uvWWobRJrf0lHkkPFIsF6DKFDNgrLZrLEAXePjtuHXtYlo gTuA== X-Gm-Message-State: AOJu0Yxwm3tvh0DoDpahhxEGQPxTuNZ28o3Q4S2uB/7icRTSfYXC2fPU nBjnY7XbmEOTJqQDQ77YAA== X-Received: by 2002:a5d:4fcd:0:b0:336:5f15:5533 with SMTP id h13-20020a5d4fcd000000b003365f155533mr1181108wrw.54.1703266960101; Fri, 22 Dec 2023 09:42:40 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:39 -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 v4 25/29] drm/rockchip: inno_hdmi: Add basic mode validation Date: Fri, 22 Dec 2023 18:42:16 +0100 Message-ID: <20231222174220.55249-26-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005912861233912 X-GMAIL-MSGID: 1786005912861233912 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 changes in v4: - none 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 3b76929deefe..a074451a0c49 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 Fri Dec 22 17:42:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182751 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1225922dyi; Fri, 22 Dec 2023 09:49:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IE91ZnIE88Iw4mcGjBot/tjvxtYIsrVOhpmKySTzdEWAZx+8KIufxVtdaCiZB0yKMLhdX8n X-Received: by 2002:a17:906:2929:b0:a17:f7ca:b375 with SMTP id v9-20020a170906292900b00a17f7cab375mr812549ejd.0.1703267372133; Fri, 22 Dec 2023 09:49:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267372; cv=none; d=google.com; s=arc-20160816; b=Kmvj5MVpzOwsHK6VtStQ48duJqEu/hrv09GAY2LGDu/ScLg6yAju8kreQnp2xNysDr JULcVT0ePZW1cgJOTUpawoi0Z0PmJ79laVmvrNc7CG2UN/vx3pIqRwGCguhf53O+pAhO /OsLRLK+z6QeG1lTMX4WUvr+03pac5glh6ySsp8xEoi4ckH56oZOd3KJefmHDkteUxfx ZfQ8vcpjp6muh/rL+QEeIZc1vM45FTfKvyOgbO5xZb4EzTFlWKha7v5Pl+B6OvbyUQc8 Ihb7LDXGCdu1ILJZGAuwV4dEbKDPNfNhDM5UkCZOX/D5aL436mc/J6e891Esak6Tn0tj rjKg== 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=34BUg2B4LjsKRfrLMHkMQRe61oTuxBkBwcQpvuibjEM=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=Zou6T0isIR2606II9FcNCuWUgSQ8Bsvt0tmOi50AUDjBD9y+1YdBHDgyxRRQHbp/0d 8Tlz7RFGeAUzuM64d1rFqbbfyj0yUqASOxOKu1a9ntBv8P+ohtDwbMGpCSUGM2ZFAeNz 6NMlUOOruqfMRA6sU0j09SOg6T2aFOsy8nTBhHITwIRkcynNbN6aNXXJ02wUHKzyBHy3 b1lR/Prr09RsZLb39m+yTNfFIUA9KaGenZqBXJWyxDMnRPtx0l523bc6mxxEgZupSjbz D/jPuewA2vobUp2qtJ/XKIAmLaLp4+7NUXNvlTIbcMP1NmcfxxzXQPvw1ln5LStWGPa8 ajgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SJ87EL41; spf=pass (google.com: domain of linux-kernel+bounces-9975-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9975-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 o9-20020a17090637c900b00a26a9598d51si1639725ejc.41.2023.12.22.09.49.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:49:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9975-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=SJ87EL41; spf=pass (google.com: domain of linux-kernel+bounces-9975-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9975-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 BE9401F23C98 for ; Fri, 22 Dec 2023 17:49:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 64C034CE06; Fri, 22 Dec 2023 17:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SJ87EL41" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.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 5717928E18; Fri, 22 Dec 2023 17:42:42 +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-f53.google.com with SMTP id ffacd0b85a97d-336746c7b6dso1673345f8f.0; Fri, 22 Dec 2023 09:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266960; x=1703871760; 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=34BUg2B4LjsKRfrLMHkMQRe61oTuxBkBwcQpvuibjEM=; b=SJ87EL41OA5aeB5Cl2TcRdpScY2Jw00p35WdvucvXNM8p0PaVhHaUyPK1JylutDivR g7paADpEd0BYGaMvFkZyWi1LE/hVd8piPl3EvfkwsZzO2aAnB30CBPlwqpY5acSnOhIz I2w4U33YeNKUZMV6ZJvIDi1bSBEC1tdga5OZZQW2rvHzdNayKZB/zG1S2UX/kYVYFX3G nz6PSBVe/EBkje8hz4vj/PB0fftr3EvkYlVXRJlNionyx2z9eGnjWhlwo7E8O7luHJ0m ft3KJZ7VrQDjlOkFXvnqtuYY9gTlYFcNUkMhj5txFlFabJr8AogliQ0Qcl3Fo7InkK7j Cz4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266960; x=1703871760; 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=34BUg2B4LjsKRfrLMHkMQRe61oTuxBkBwcQpvuibjEM=; b=syyRLyhMeRluHZao7LKg9RqwN+3Fy/5b3cqZ/UdvVMVLyk+wNw0Bvb16t3t/stcoj8 DIjYGzHY8i2c+qop+9LAAzskxHhxZ8I7ddPYfYukABT/tnFEdX3gPYOfcb9cAB8KLSeX gQdPhHOc7s1DmmRicAaTprx0xMhr4U2vfsgNyGBA21+Eaa60jD+D7OjyJk+7KdsoLlAv qLjk12NvKPPjtmCaxAi86tm3CdsBDSGuDh8fR+Dtp0KlU4iuMYHZa4anyW46lH4RdYKi l7cHaKvJvYE/ousOLnxzW0XkNDugGcdhjj2tFYo5vAJU85eAnmEBDSXXU+oFWMQ+QUVm sC8Q== X-Gm-Message-State: AOJu0YzIENrS9LTYp6LsWQB+RjuZyGmeIbDzCdfDC1txabuG2SbxVFwP 8H9RAGCvfUZ5r6mG0Pn2bDdYWoXW0g== X-Received: by 2002:adf:e7c7:0:b0:336:619f:4647 with SMTP id e7-20020adfe7c7000000b00336619f4647mr905229wrn.108.1703266960737; Fri, 22 Dec 2023 09:42:40 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:40 -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 v4 26/29] drm/rockchip: inno_hdmi: Drop custom fill_modes hook Date: Fri, 22 Dec 2023 18:42:17 +0100 Message-ID: <20231222174220.55249-27-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005288424567797 X-GMAIL-MSGID: 1786005288424567797 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 changes in v4: - none 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 a074451a0c49..d7453c36d37a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -630,13 +630,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); @@ -695,7 +688,7 @@ inno_hdmi_connector_duplicate_state(struct drm_connector *connector) } static const struct drm_connector_funcs inno_hdmi_connector_funcs = { - .fill_modes = inno_hdmi_probe_single_connector_modes, + .fill_modes = drm_helper_probe_single_connector_modes, .detect = inno_hdmi_connector_detect, .destroy = inno_hdmi_connector_destroy, .reset = inno_hdmi_connector_reset, From patchwork Fri Dec 22 17:42:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1226045dyi; Fri, 22 Dec 2023 09:49:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJ7alWgtInTkSpq7AHEGZV5QnmwwyAcvIPsqM2O/g1y1SxV+htyse4uRzZimFA6wrV0PTo X-Received: by 2002:a17:906:20dd:b0:a23:f17a:163c with SMTP id c29-20020a17090620dd00b00a23f17a163cmr1636603ejc.64.1703267385043; Fri, 22 Dec 2023 09:49:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267385; cv=none; d=google.com; s=arc-20160816; b=rCe55g/KnBFQrRMNXMATxEm/x/A93F5C7eCTbhJhoAevU/bKQAmgU3jihl8Ur9XqvV lz85/YW2rq99tQmIsEhwjKqFz9zE0jPpHxDKh1j8e1leTyUo1vyRwmEyjL9+gB7nizNj K5zMmeoioC7Vkb0x7sAkhW+OsOjRSGDCrOVrBvpwoMRy+5xjBRWhc/+1ujND5LElH90O QGujX2dcY/+QOTGp8QqJhmhFOVmPcnt/hdwA7BwfIVKGUE3N6q5vlf0hePmnm7VEioNw Cfk20URSIud3VsBsNz5oNFqXWFXCnlvtmff/6mcq3gqnc/K3d88HJL3DiGf1aPHJBRp7 LVZQ== 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=rLzYp4+k7Wco/dLyvbXtMOp2x7OPvW43+Ey3FkfhV04=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=h76TAhUeazeyPdxtgjoqDbbph9782Ylg5ae8Mpp7fY+y2nX6hXJ6bx366pwsgoKHkK +10z6NqS3ImaJ3pj/rf8ZiyMtvnqILZDWV8b3OJ6RymLK4dxl9XicsJ3vuLJLAXwwGRM jbXqst9iKoE0nqMnmIwp+7OsUZriqTOuv5T32z6auTqupanfInuDJZIlT6GrdDCK8n6c TeUU7LAlXJltd16Bg/PhuUBVTuutvlbD/X/KvqE3MV2IHugDfM4LEwIymeXNrTvQIylN KD4lK3Ci34dsbTVW00J4pTPt6wPj/iyDZ5MtjlO6INO0hqPTvE0q8NGLAk8BmelCLMu5 oTmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HJBJX406; spf=pass (google.com: domain of linux-kernel+bounces-9976-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9976-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 e2-20020a17090681c200b00a26ae4379d8si1274187ejx.3.2023.12.22.09.49.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:49:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9976-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=HJBJX406; spf=pass (google.com: domain of linux-kernel+bounces-9976-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9976-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 7E3951F21279 for ; Fri, 22 Dec 2023 17:49:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F9D54D125; Fri, 22 Dec 2023 17:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HJBJX406" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.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 278814BA80; Fri, 22 Dec 2023 17:42:42 +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-f51.google.com with SMTP id ffacd0b85a97d-33697caf9a6so423074f8f.1; Fri, 22 Dec 2023 09:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266961; x=1703871761; 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=rLzYp4+k7Wco/dLyvbXtMOp2x7OPvW43+Ey3FkfhV04=; b=HJBJX4064ItY7m0sOVKX0/6ZuYm39OTR3kE/VOMLDktoXydxnt59RDOWeVbY+pC2yU +sL1u5C6qyOK85zsXLhjJDWJ2tu4Yv5VSxdTad0KXQmLrIdojGJjtHIaan5iw5DDjFTp 0KEZXzc8zPfsDP9dWHblNRDtGujceOxS2ipDYTKCUgaGwAW6vM4fgiQVT2T3KKGy75PV HVomIKXlk5ghEMVQEV5nXAQpJhytmwaSOHeHfhiE9WjlzgRpIK7NecRjBxI6kz2X/cUn gsDfH3hXJvJ1J/i5161FkDrScTfuuT/bu6Kwp8q2Jwk6S7gdg5AdMTXSKBrYPDmtSvi6 mbJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266961; x=1703871761; 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=rLzYp4+k7Wco/dLyvbXtMOp2x7OPvW43+Ey3FkfhV04=; b=AdzPvKo8Dk1bOMzDbOq18WKMwkfrlMGMUzwksPB6imC5IiJqpphQVB4sNTctUErWvP xzVdAiGYBvTAUeSa0+4S6la6QrbzrTqmMEj/FuGVShu/5pZhI+SVmRGcnpBHc/rh7Nvg R63kTtfKckbHjxuO3cFb4yfekM6YnRdWB5YE+5s5DjgTlLjlrupjFy68ezAaJM9H5JzK g9zlwylgzBhb8OPxKnTKj25f61201ue/lvIhENfJ+cCIKR1onUwqVTDLXFnGbyI06NEp d6fYBxuDYzuVzaiiyqKytGmXfxT+HEK9Jn/5V0tSFwTww98qtbRA426AekvspdPSxYnb pimg== X-Gm-Message-State: AOJu0YwWpTDnYVVG7hYh2e1CIyCJdqHEquhl0/D4+iAA7s09odR9UJzt Gs3HKS8RoRNsIujDpFhZ8w== X-Received: by 2002:a5d:6046:0:b0:336:8d2e:77a1 with SMTP id j6-20020a5d6046000000b003368d2e77a1mr945167wrt.47.1703266961379; Fri, 22 Dec 2023 09:42:41 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:41 -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 v4 27/29] ARM: dts: rockchip: Add display subsystem for RK3128 Date: Fri, 22 Dec 2023 18:42:18 +0100 Message-ID: <20231222174220.55249-28-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005301487859498 X-GMAIL-MSGID: 1786005301487859498 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 changes in v4: - none 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 Fri Dec 22 17:42:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182755 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1230489dyi; Fri, 22 Dec 2023 09:59:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IH79HgGiP0QIvkoGw7xtZjuo1Yhw64UGMK3Q4F8L1tdjvg+TsgcDpIMEbvfwKOhfrZy0akm X-Received: by 2002:a05:6359:672f:b0:172:fe94:735e with SMTP id sp47-20020a056359672f00b00172fe94735emr1567895rwb.59.1703267972467; Fri, 22 Dec 2023 09:59:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267972; cv=none; d=google.com; s=arc-20160816; b=gAZ3VzP65hPmp++OQgareyNsY8ojyDDl/BqYrnH8TK+uc0PmV83ixhP2AL2tcTDwQ0 b0K0Nd+CjD+t89X4tJZsLsd9yQfLRJYHfFb7CJ1E/mtQhC5h1qAmjflK6Qgi8x9q7hwb LGDiejSpp0aoF95r0f/zcYbyIKVLtX1d8waqLqYxTBS6jjMBUruTXO0uuK1So9QUDVPl Pk+BmhIbWpTcRY9msBaM7x8YpP9c8Idv6jHhwmBbgtMJCPAQqj2xCNoo3w3rf77PjNop i3rPY/K2/QZJChEtlq90/8qrZetJzn2QsTu6wLe5Y4h91rcUMx4qRkMQ3Xnxv1DR4Ghx uH+g== 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=gRLz1zrBuFNm0Af22mx0D2/7q2j0Q/CWyrbrvtrtVPY=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=wr7TZKW25uC2pIha2i0L8Nnt8SyATnXdVVhPMf7DcfpNCE0JJFXURGwBi8Un2b9tUS BbmChGQ/Wrioy4jRKC+j5dNdwHy9ZTOqGRU8h7otdaQNGduAe/2s+SaVjhOhzmh3TK9O aQfKjp29jp0MjSklTq9KX1IsiZ/Q4eSFa/3LLj6it6NgqWQ61biCRfJy/aG1W2Vjbxhj 3M3fiM50NGaUSw+x0oU8+1jhfPGaTV3TyQ7t1+Yyyiv3+2df97hlj1otuZjmXU0Ye7wr 8wXs4wyfWGYoHptSG7MCRawKnNpIEKM7Q3h+IvYoTFegZ+Dxf+wKg4ooceJgT/69QYOx nt3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IQvqrBuX; spf=pass (google.com: domain of linux-kernel+bounces-9977-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9977-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 p26-20020aa79e9a000000b006d4d439e6f7si3522860pfq.391.2023.12.22.09.59.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:59:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9977-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=IQvqrBuX; spf=pass (google.com: domain of linux-kernel+bounces-9977-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9977-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 D4E1A288941 for ; Fri, 22 Dec 2023 17:49:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C7554D598; Fri, 22 Dec 2023 17:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IQvqrBuX" 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 01AA64C3BD; Fri, 22 Dec 2023 17:42:43 +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-40d3c4bfe45so20995465e9.1; Fri, 22 Dec 2023 09:42:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266962; x=1703871762; 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=gRLz1zrBuFNm0Af22mx0D2/7q2j0Q/CWyrbrvtrtVPY=; b=IQvqrBuX1Gbwts2bdRJiK0/oYpTqptzaZVw6pLSntKSCfAApvbpPz2j/nqWv9CULkg 64u/P5KicooPaSKAgtxLJRitGT5tw1KuwVqrRq8UELJveJrMfR9jOHMGYtKBnv+nJ9Ms C96oInaa/4krNSR4XsKtWArJv4Bd5Z55Tt8g3G4YGClTBp214c6D3K0RD17O611M81i+ NVKIajVhXrlE6IjM/hE2t8q9KJ5rN1G+ivn+bx7rDzSylncJ6zVqcSvXLr/RPk3Jc9jH pPdla6gJNf/5QQ5cTKgGxc56C7g6hhTMgHaNZGM4/AK6U0JKwstqdi/6s012AE1r/lmb RNtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266962; x=1703871762; 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=gRLz1zrBuFNm0Af22mx0D2/7q2j0Q/CWyrbrvtrtVPY=; b=oRuMKD+5YyOuWZebNJSoOWd8hFzi0vx5j1Byg3A7mfQGkR8h+D+/R18TkQPvwG6E+k dtGxHdrek3ftefReU9fGVPFWXWAUHLRNtMfu7YzIX3PdePzpfW8juBUnWzT+q1380lVI G+0Pj7neL5kRzw9krNXFV4usxwYEkvGRVpBZ/OYcIFgp5Kap9lt0ZtI/D9RhQpTEc/rI HuDAqUE67v1eskWywtJNMz02QsFHEz6zq2gjbw7X000EH9/OwtMfWqn+co2srC+w5V5l e9uJPeqJ7pC16k3dbz7amaWTsSaYHpBvk+Ljz+t5O81Iysl96rUq97rOd87j9impjsBy ZOLg== X-Gm-Message-State: AOJu0Ywz8R+2ga8tMCrZB6V6EIcuyo9cfWFfDDSLbkx+JtBOcozE3a8B fysssyxQwduenP98K9X2fg== X-Received: by 2002:a05:600c:a02:b0:40d:3868:6b85 with SMTP id z2-20020a05600c0a0200b0040d38686b85mr544367wmp.198.1703266962256; Fri, 22 Dec 2023 09:42:42 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:41 -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 v4 28/29] ARM: dts: rockchip: Add HDMI node for RK3128 Date: Fri, 22 Dec 2023 18:42:19 +0100 Message-ID: <20231222174220.55249-29-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005917521014964 X-GMAIL-MSGID: 1786005917521014964 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 changes in v4: - none 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 Fri Dec 22 17:42:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182753 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1226570dyi; Fri, 22 Dec 2023 09:50:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5BZSk9o+v5vV4UGfF2EEky+OtMBqMwO5sDEeOZRj0xIiQOwI6Q4aS7vPZFnd3XrH2A7jH X-Received: by 2002:a05:6a20:78a2:b0:194:a32d:b6aa with SMTP id d34-20020a056a2078a200b00194a32db6aamr1599610pzg.122.1703267444781; Fri, 22 Dec 2023 09:50:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267444; cv=none; d=google.com; s=arc-20160816; b=ci7HPnpl2pw2Pym+4V4TAVl3MbUxhQXKIfuZF3c/WAfA+DpXg6Qd79BjNwuA9urbnd GtUxis87+ocNANooA5u61/Ssb99uwlng6He680vOPkDfKYCrdKtnzPnutj9BZIddPfse McQk2hQ2MZa9sqIv7tkxxgSR24OCVqWGt5jdsswv3SEx7tfR29W075VTFwx4sgMsLxM4 oerUkiq1N3zehHLicaGkN5RHkc+GHXw2LWgoNnm9SkyjzwVBfL3NB3UwWwpAjm8tkDNI H5lkCCGcHXrGdsPf75JWVkHfNe9vprlR3fp7V320ztEm0UExKUqtqnmBm22UG7kPCnji KeuA== 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=DSehpxE7VFQUy0YWI/0+kwR1zv6c+kt9jZ6SUI8YNPA=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=uD1MFebH97U3CmEqJYBWwNsL06lLUVLsBs0p+Nqfc6Yh2fb5EOP+x4v+ScH485Mk7j 3QmQp0KhKt0pfE8qgW0PG8CM1zmKruMiW4uauOXWde3cagRFp8A6isJfZ24vWryc4wNK TIDRxjj4wuIE7V3vaeCrmBmcNFRFFIE5HtzKYAVWGhzrv6c6xKKqGK6uTjFB47CtpPUc vfi8YUBb6SRXv6Ai7HKgmqPvcLr7J64h8ICHL9nOpsAYv4vjZu6Y9ma0gPBadjBvSR6D bPsIIamP1hhWdpE5npD3BPbuxSgCNTDNCU8WEfw1yBAGUIyOZqeho2qIfQZtOhbU0rJB 0DxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DNrsA2GV; spf=pass (google.com: domain of linux-kernel+bounces-9978-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9978-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 bv71-20020a632e4a000000b005cda25b2bedsi3486135pgb.430.2023.12.22.09.50.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:50:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9978-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=DNrsA2GV; spf=pass (google.com: domain of linux-kernel+bounces-9978-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9978-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 56DBDB24686 for ; Fri, 22 Dec 2023 17:49:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 955844D5B6; Fri, 22 Dec 2023 17:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DNrsA2GV" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.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 A615D4C618; Fri, 22 Dec 2023 17:42:44 +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-f42.google.com with SMTP id ffacd0b85a97d-336897b6bd6so1795736f8f.2; Fri, 22 Dec 2023 09:42:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266963; x=1703871763; 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=DSehpxE7VFQUy0YWI/0+kwR1zv6c+kt9jZ6SUI8YNPA=; b=DNrsA2GV7j+BqN527P2MlgiifrPCHya3w1+jh2y07aAM/BmAX34bI4La17bjdnv3Ye uOy/4XTkjudE8DRnGqQavrNYuQHMqmWYuQ74WsKIWS6tSYTy18BLMZARmj78a84PvJpT H2eSMZjy6mPF4YVlpO5uEtWpwQcJiJFamrDDfGEH4yDW2sC6gQTzqIY9F2O2n8K9tiFa suHr0s8VyRWaX6W7KYUjl3v+VvtpYAE96O7mkPI0P176AXL5O7ZiBXh45XKb2X46cF/o mHjyvBdA+Qen16fNd2+/XHR4g2Tz78kQWpRK+I9sHzhoRftHyYc1/QeFCoNskKyPWKJi Xjnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266963; x=1703871763; 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=DSehpxE7VFQUy0YWI/0+kwR1zv6c+kt9jZ6SUI8YNPA=; b=LyYmfZvcx1P4htsmcZrbzM7x6EKXeR8vRSO5nJ8sW3FNPyLYHoy9BUC7fHIwFsddJ0 i6v28pnWTFbkVCbViUONrVGfWneGILIemToFhFeeClWsLGQA7+XKRBIbAQArRNuW6gcf F7GvvQi2EZvNES3BvvrwofliLr0zFHp7AraCwVJ+sMgzE/FW9El+jeh8VASSUGrETrZO 2RaQYqKDXN7NUsSlIpf7gNvvQThS5/jGglpaQ2mwUGgk8Wo7SjcXtPTBRP8i7PHn/yOh Q7HD99ANxcLIXaYx0RIbhwD127Oh2fxrrG/biSEsx6uRVIttfAGClSRKAEghQkjyI9EA vgJw== X-Gm-Message-State: AOJu0Yz1/Oh++PjHnEotwmA51rDSVl3aT0F7eXajfCCGWavj8QKw0Aaj 8R8ADgZxE3pe4v/f+MhqjA== X-Received: by 2002:adf:ed47:0:b0:332:e337:7c5f with SMTP id u7-20020adfed47000000b00332e3377c5fmr904774wro.61.1703266963000; Fri, 22 Dec 2023 09:42:43 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:42 -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 v4 29/29] ARM: dts: rockchip: Enable HDMI output for XPI-3128 Date: Fri, 22 Dec 2023 18:42:20 +0100 Message-ID: <20231222174220.55249-30-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005364502551218 X-GMAIL-MSGID: 1786005364502551218 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 changes in v4: - none .../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"; +};