From patchwork Sat Dec 16 16:26:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9021BC46CA2 for ; Sat, 16 Dec 2023 16:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BtfMH7kCgklcol1DdRC7ZVWRDGhhx1J6T0o+GuI+lVA=; b=UbiIIJ4NmvbRpa QduLwkn5yMe+l/PU6nyesXycSku5mpWM2Gs56IUmEdVxXj+Jbiu6AReVDNocnLh8U5z9lB61/AWzv JoY4EluSNcxyUyEyKmioroDq28DklkxlhM8RceA2BZVxqo+Tdm1jgocX6r5MY3pPqa3nDxMdLnwMR i6Jq/K/q6lWxFrbvvWVjhYQ8MaIJoup7PvqDMdC0wnsG3RWs1Ux9dwbmEGl71/a659iqol9BDorxL 8Z4l9m6DI9hOpB+Rfl/Jg7sVeR/h2Br8C3T9Tp0UWNJhlnB0G9pHQoRH98LCJt0vVMTxk6Sz8RCwS KbBin5ukyH6keIsHIhbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVY-006JxK-0I; Sat, 16 Dec 2023 16:27:20 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVP-006Jmz-1b; Sat, 16 Dec 2023 16:27:13 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40c6ea99429so12370495e9.3; Sat, 16 Dec 2023 08:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744026; x=1703348826; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=obq8YELyZEbke3rZFXNs+HxX85EVdqoEFqpud8UWY9A=; b=FhZydKrg3Q3p0YUgtcI55ejuucLXXNTBxJD9AsARqkKIf1vTM+/Ryx+6X5d3WdWeV1 Ts7AXP/wR8e5SD2/YjY8CJvgSMjGfWkG99cttEJt1gS/pl1Sk44aY8yT7XRJMh22B2hF V7Ehs0y0/DtFsl5TWnteYHa1WHnExMct/3goT2NaVyUHJ8lhTJLCKtMfdn3ejqFaDSZJ GaK00fdSLUWb4x1gNBVlZpFX5qOPmkHrP19mtAzEBt4if44n1h4HQvkq6DKn3TzY/ofD 9adOosp49Awf91wL1Uh0ogqmGHPsWz9Tp1y8RStfHd/dr3sWHxWI8KniE0qvkAdcjliz Zenw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744026; x=1703348826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=obq8YELyZEbke3rZFXNs+HxX85EVdqoEFqpud8UWY9A=; b=IX9rlB47bhSYndNdWF8t/xgDW9aW/2yPowp+G3VR9Iw5DcT+fdhGD+dwcFhK1PkzVC YQv4GIwX1fn9tHAcNwr8uTpzwFeusmI8nz6S+PRWjxz30NmpQPdpQxx4EBKwtH3Hm3ko kcV5pXno57qd0+VCehV/fnL+kgy9DKSWKaOFX7zSNaqz4zTbHsFS30WX/j7XWz9mSX5E lLQA8uL2PSqvzvxRIKFKovJMPPkHRVwKosFfE2ZAjBwU1Nm0cy91YB9JYGX94PsLUeA9 9SVk311GX+m7VO4N6Bl7hAwreZvKsM0vkKWIK/GsfNU8A7/UachzM3ZgellAK5i+xSIN 3eGw== X-Gm-Message-State: AOJu0YwMZSoUXhWeUKB3CNS/m2Er17yINKGjTJm2n93XuC9ETsB7gN5x m/dkLt0VPQQcWLVVD+UdQg== X-Google-Smtp-Source: AGHT+IGnNQencjmVxcsF2n4BTXIbiDj3zIdsmRa4iZ0r/ILDY0raJeyfz2VYhdxmAd1idrgHfog51w== X-Received: by 2002:a7b:c4c7:0:b0:40c:6567:1d85 with SMTP id g7-20020a7bc4c7000000b0040c65671d85mr1569882wmk.232.1702744026333; Sat, 16 Dec 2023 08:27:06 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:06 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 01/27] dt-bindings: display: rockchip,inno-hdmi: Document RK3128 compatible Date: Sat, 16 Dec 2023 17:26:12 +0100 Message-ID: <20231216162639.125215-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082711_535872_0FE5D095 X-CRM114-Status: GOOD ( 10.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The integration for this SoC is different from the currently existing: It needs it's PHY's reference clock rate to calculate the DDC bus frequency correctly. The controller is also part of a powerdomain, so this gets added as an mandatory property for this variant. Signed-off-by: Alex Bee Reviewed-by: Conor Dooley --- changes in v2: - clarify that the controller itself is part of the powerdomain - simplify clock-names - made power-domains property only allowed (and required) for new variant .../display/rockchip/rockchip,inno-hdmi.yaml | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml index 96889c86849a..be78dcfa1c76 100644 --- a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml @@ -14,6 +14,7 @@ properties: compatible: enum: - rockchip,rk3036-inno-hdmi + - rockchip,rk3128-inno-hdmi reg: maxItems: 1 @@ -22,10 +23,19 @@ properties: maxItems: 1 clocks: - maxItems: 1 + minItems: 1 + items: + - description: The HDMI controller main clock + - description: The HDMI PHY reference clock clock-names: - const: pclk + minItems: 1 + items: + - const: pclk + - const: ref + + power-domains: + maxItems: 1 ports: $ref: /schemas/graph.yaml#/properties/ports @@ -55,6 +65,32 @@ required: - pinctrl-names - ports +allOf: + - if: + properties: + compatible: + contains: + const: rockchip,rk3036-inno-hdmi + + then: + properties: + power-domains: false + + - if: + properties: + compatible: + contains: + const: rockchip,rk3128-inno-hdmi + + then: + properties: + clocks: + minItems: 2 + clock-names: + minItems: 2 + required: + - power-domains + additionalProperties: false examples: From patchwork Sat Dec 16 16:26:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495646 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF99EC46CCD for ; Sat, 16 Dec 2023 16:28:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0K31xU0PlGWf4/tcHWxT1XvYjLkSHU3fVoOpGa8g1Xk=; b=SB8CRdkWBqkMwQ 3dH9HTgbENisbjuqGS1Z90yftfIeVgknekvj+zyUPqrg7pvX2Ha2G9p41meolOXR1hCGs9J5o+zmD 7gVaZoCXqNIopgGyUUbfRqNoh73qZ7koheUR6vDXat6w7k4RD6iig9VHRMdea2C4JCO24WVv9nYBH 8YB9uZ2Lx8sWQl0g8Ka0VZ5tSRMTksDV2jVQPVBSfkEWBmmggw0mfrdU7gpW6IUpxtm+zvXh4gjDB CN2+kzvDkgr3ztYnnJFasJF1/CRSNCzmV0Vjx0j9zJw5TEEh3r6DStVIymzmdqMlXQklb7cw0hBS+ iIlAyFSgfu8svcp/Nr5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVp-006KDv-1d; Sat, 16 Dec 2023 16:27:37 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVQ-006JnC-08; Sat, 16 Dec 2023 16:27:13 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a1e2ded3d9fso193178666b.0; Sat, 16 Dec 2023 08:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744027; x=1703348827; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4Lm26+4tm6Q9dy5TiKyQzH1wZ/PMiBfYpwbeTXzDXzY=; b=g9g3rr6irULjB9mBOwDHq3VNJFtOIuae5gTZCNEDtOJFQfEv2KaGyO7Lqn6LaLU6av W4uN711jNQ9Kh/kdU0Y/ElOpAPjZ24CbhWrAi6urC8YwgNOrcg76kaEf1WBiPuu+Ejc8 3T/eRTuAzE75iYUTKzZNeArC2fhGnDVMGeTx+9Qgp9VFzb+MD3O1Viy72dkvtONlORGC Wnt26P2NMy7UsqVBit89DC2Weywa9OX19RWfx8nQ4ugc33KvKnIsRWQm68hYzXHBibas 9z7RwZGKsPg2Z3WsOUVnEB2uDcDlXChgaNExxoIbrfCucNH6QiEHgHuiDr33NsBOo36U bPng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744027; x=1703348827; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Lm26+4tm6Q9dy5TiKyQzH1wZ/PMiBfYpwbeTXzDXzY=; b=avOM4wDvyxUtuMWCaS4Xm9DC7CAO7x4XyTDSoroMFNefYV7pQiFJvS+R3iHTmHZSCK GKKook6of4WLTrnvnwfdR65BBgRUqbwZihcrQ/HSbBsD7H7fFJAirGtwdExmjVZZj4Pr i4L5X02YjcY5tZk4KcBMmeWkSC6G2YEf7QzzmrftZAZTQ7J+gjU42nv00835eIzeHX3M ZyELUkTHBfhT3gr5CmRZthX3moWAbnSyUzxDK9ObqOV/8sf6dXl7iDR0q2pkRutuq4ra 0a/gyK+/3WTBvyanC+1NWyt/AEZ6qgVmEe5afwhjxgmaXdRsTjyEG8H2UNHul79EROIR 50BQ== X-Gm-Message-State: AOJu0Yx4AsOG6kvZe76K/TKsr/jXFqAqycWA7PDSbhl53wueA+tRdftJ g9CFKQ6P3XyK2HvOjZcDFg== X-Google-Smtp-Source: AGHT+IGZ7VeNHGWq+1VZP4LYh9qX3NgWRdPWJnURnN0HnbB2LJH1KRm9aL1BAMwgow9ZPeylMhQF8w== X-Received: by 2002:a17:907:208f:b0:a19:a19b:78a7 with SMTP id pv15-20020a170907208f00b00a19a19b78a7mr7159079ejb.106.1702744027021; Sat, 16 Dec 2023 08:27:07 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:06 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 02/27] drm/rockchip: vop: Add output selection registers for RK312x Date: Sat, 16 Dec 2023 17:26:13 +0100 Message-ID: <20231216162639.125215-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082712_108313_DAD06D55 X-CRM114-Status: GOOD ( 12.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In contrast to RK3036, RK312x SoCs have multiple output channels such as RGB (i.e. LVDS TTL), LVDS, DSI and HDMI. In order to support that, this splits output from RK3036 and defines an separate one for RK3126 with the registers required to enable the appropriate output and setup the correct polarity. Signed-off-by: Alex Bee --- changes in v2: - rephrase commit message drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 13 ++++++++++++- drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index c51ca82320cb..b9ee02061d5b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -227,11 +227,22 @@ static const struct vop_win_data rk3126_vop_win_data[] = { .type = DRM_PLANE_TYPE_CURSOR }, }; +static const struct vop_output rk3126_output = { + .pin_pol = VOP_REG(RK3036_DSP_CTRL0, 0xf, 4), + .hdmi_pin_pol = VOP_REG(RK3126_INT_SCALER, 0x7, 4), + .hdmi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 22), + .hdmi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 23), + .rgb_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 24), + .rgb_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 25), + .mipi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 28), + .mipi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 29), +}; + static const struct vop_data rk3126_vop = { .intr = &rk3036_intr, .common = &rk3036_common, .modeset = &rk3036_modeset, - .output = &rk3036_output, + .output = &rk3126_output, .win = rk3126_vop_win_data, .win_size = ARRAY_SIZE(rk3126_vop_win_data), .max_output = { 1920, 1080 }, diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h index 406e981c75bd..fbf1bcc68625 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h @@ -872,6 +872,9 @@ /* rk3036 register definition end */ /* rk3126 register definition */ +#define RK3126_INT_SCALER 0x0c + +/* win1 register */ #define RK3126_WIN1_MST 0x4c #define RK3126_WIN1_DSP_INFO 0x50 #define RK3126_WIN1_DSP_ST 0x54 From patchwork Sat Dec 16 16:26:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19AE8C46CA2 for ; Sat, 16 Dec 2023 16:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fbzcJAfVzbfdfg53zD9Yf42Zr3e0Hd8lSVKlWzO1U70=; b=LGUUOOwqmM0qLX OVC01ZyGCs5+wfiqxr7+xbrfhT/HV5jhWj6kIuSMLDORryz+loNXsz+AAtshI6M+79i66+LPT9qPR JvHYzDoJ7gz8BYrC9NW2iVhAHvWSN7JcR7HsUJGVg8M+4vZHKXSgP1Q3HnO18O1Vw6tyEX/9ztrOY gMDqARQ2aWfLCZInHCt7IKxSI/Y6nDmgGQyD2RKFispVw4iEqfwZOJO2AsVW+y4DJf8CjS4jbqGwy VtgfbQ7wCmgrQ9HjvEkJsJIWpSc2TPvuL19YiFr33pgmx2w54OTbEMC9rll0xBwv+tVixdJIJ+2Nh myRuWpJG0HedLmJ42c4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVr-006KG4-2Q; Sat, 16 Dec 2023 16:27:39 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVQ-006JnD-1O; Sat, 16 Dec 2023 16:27:15 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5531c36ed2bso95346a12.0; Sat, 16 Dec 2023 08:27:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744028; x=1703348828; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qyAWfNkXQL+v/gZSDlmmFF5ztG5yHb26ZkJxvxzB8Hc=; b=nlNIvu0b6w5uA+0iL7FvJXG/uYnZyYuw4ISCZgcVoHP358/Vbxte6p0jUZPfLPlsxh x3YG7x9dkiX4oYDIEjk6zYHgahtEmVOnQk1ur8wYZ4J18ZM8QqTKgbuFF1jEonl7vm16 V1BxqtrmkIVOw6RP8y5UbCWvir/o6BD8AbzCWRtieKo6f1lnV5Pbao8oNTcX2JNhFXdB suDyuS0MgDNM6L7G8Bqfh6gPPbGoX3RgWr420xAkEMSZthpM+6eP/BaG1A6gy96E/Kum yMuiQzT00WlWULwJAhiNgmDORdXpFN7/7vb/kkqo3saxRvVqPw/CiU1irQHWIM+Kg0Kb XD2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744028; x=1703348828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qyAWfNkXQL+v/gZSDlmmFF5ztG5yHb26ZkJxvxzB8Hc=; b=L8AkwPuARbkvCPpUzXDGsyiyqgfhpub1L8trXd5yhaaChK/IDAjWedIGs38yHQA3aa s4TkuD7gh2t9yaEb/we6pfLIGujYlH0nqQR+usM/hZ+m7pjDowPE9JCO4AGq7abi83va jgYrNytcYfFJongRrZL601034225KfurB3aDgSdpmGV+UnKwPhA98rggiGyyRWcwhjxr uD71JwuWtIZT3uyzOSl3/sHtJzxVLugd/A7kDbYKFwBGrBvlLoM23LQpnB8UT41Rier/ kRuyQb2XnRB+52+BVJTjm3OQILPkEVVED6bOnISPfX4yAwqSNZJk9ODU0CeGtgFRyl+m turQ== X-Gm-Message-State: AOJu0Yz99B487KfhMbWsgnFIZe04UZjshNZFvWcnPMOUX7jbJoOvsawO D6nT+nP6m/G9I7Az/eOJQw== X-Google-Smtp-Source: AGHT+IG3ytNKpYhW3AxvamdKVLTOk5M5VW41roA7N2pAlKA2C2kww6MnweL75Ttzw+MUjezGDENIdQ== X-Received: by 2002:a17:906:6a1d:b0:9c2:2d0a:320c with SMTP id qw29-20020a1709066a1d00b009c22d0a320cmr8522242ejc.46.1702744027873; Sat, 16 Dec 2023 08:27:07 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:07 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee , Zheng Yang Subject: [PATCH v2 03/27] drm/rockchip: inno_hdmi: Fix video timing Date: Sat, 16 Dec 2023 17:26:14 +0100 Message-ID: <20231216162639.125215-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082712_466420_29730169 X-CRM114-Status: GOOD ( 11.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The controller wants the difference between *total and *sync_start in the HDMI_VIDEO_EXT_*DELAY registers. Otherwise the signal is very unstable for certain non-VIC modes. See downstream commit [0]. [0] https://github.com/rockchip-linux/kernel/commit/8eb559f2502c Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support") Co-developed-by: Zheng Yang Signed-off-by: Zheng Yang Signed-off-by: Alex Bee --- changes in v2: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6e5b922a121e..345253e033c5 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -412,7 +412,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_H, (value >> 8) & 0xFF); - value = mode->hsync_start - mode->hdisplay; + value = mode->htotal - mode->hsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_H, (value >> 8) & 0xFF); @@ -427,7 +427,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, value = mode->vtotal - mode->vdisplay; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VBLANK, value & 0xFF); - value = mode->vsync_start - mode->vdisplay; + value = mode->vtotal - mode->vsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VDELAY, value & 0xFF); value = mode->vsync_end - mode->vsync_start; From patchwork Sat Dec 16 16:26:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6DA6C46CD4 for ; Sat, 16 Dec 2023 16:27:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ua3Xg9WT7mAbuMvhLEY6X1dagWd9RnF6vWD3sh3gp1E=; b=nfRLsl2FM8N1gF a+oBSyTCBU588xO8P4OqJ3EJxKYeaXMp+wO38u129rp0YFoKpiie1cg/fdG3ZGXs15QbqgJrgPsLq +0HXtlgpls86cIufJDjmwYvZPADN6wbuCm2sbobtpS2tp6OwBfmVT9A62yhmK2AHzWIxYr9ZFXBaZ ZhHdA6+3llBZ90/DYq5axXqHtVgkXRUHXXpIkunCQJDLH1VBndr6kWq6Oy70zzUOSgLKQrxbPLE2R xke3vSXK9m7cjPwuwMgwXLvEI8i5rVDJvGreL8MpGFrx4Z619+ETqOhZtC9cAFdQLXsNJSWyzmtyf CahuWNujEqNfJa/tGgpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVV-006JuT-1M; Sat, 16 Dec 2023 16:27:17 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVO-006JnQ-1s; Sat, 16 Dec 2023 16:27:11 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50bdec453c8so1858427e87.3; Sat, 16 Dec 2023 08:27:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744028; x=1703348828; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ujhT/xhztHbY8JzCzlkbXu+iQMCJG+MMsIZQaYuJZKs=; b=SUtfAFMIbl1jKLXicM/GuMSQNGnoxRpGmMcVVccvMHb/1nwRF9kIsnAGMjucWmOq9W l+aBWfbGShGd/2Y2q3Hgq9eDsMpjlCKh1Qhwhx8lnfspW2m1acBvFglLxc9TPOiwy12a 6R00eQ+apNg1lJLTMA0izgw48ZGZr0W1jHGXYDFsykMR/k2fnamPOHztxH3YWgCMqHMc 7MxBMlEtMzusX5VdBOCbtORmPhC1X9funXgbYVL0yzML2jHPFSTXWXBrEMj7KZ5TfwvB Yev3NoFCzxQ1pHPg1hetmtBR8nnawg7nrnvRmq/NHRqrbKjdg+gndkqevbERYIqw0EET xjLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744028; x=1703348828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ujhT/xhztHbY8JzCzlkbXu+iQMCJG+MMsIZQaYuJZKs=; b=s4yiAOvtRt7EqVOa1ixXkwkCQsWUd2gutQ18LRHDKdwsCw1B/E7pAC14NEQh+WhXJ0 JXkr44iFFvWX7nHVogDrDwf10389374LNmq/YHN118fZ9E5kM6Pz1xK7HNtIvG4MHTPj YWSi783NXRbz4d0EX71aGARR+ZGjaQeN2VUawZh5pEQ8p5wDaGwBjA0VxnQYueiQF8+r GsrX6jWLmDkP89rKVXM6tT0Xp4oB1kFmyK1aFvliAUWUUUmPpYkPTTFqR3HxYxW97IzD 89mba+jn4YMi5x+DKme6AHb+0BYW+lwwz1EIpiTlhQhoZnqxN67hGvNdzx4V5gviA6fA B3GQ== X-Gm-Message-State: AOJu0YzpNGoO4nl0z7KgpZFPwzEOo0ypJ26W5/y8MiKz7MeYg/Z/yKpH J9JB+TvKOLRoFldkdbNhag== X-Google-Smtp-Source: AGHT+IEoZS1JzzGc12YB/MN689Vsdo/GX0yIsCmhRzmI2mChIP6YnFGPdCsy2rPk5UV5T25TnOSVWw== X-Received: by 2002:a19:8c0d:0:b0:50b:f55b:abb9 with SMTP id o13-20020a198c0d000000b0050bf55babb9mr6923253lfd.94.1702744028520; Sat, 16 Dec 2023 08:27:08 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:08 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 04/27] drm/rockchip: inno_hdmi: Remove useless mode_fixup Date: Sat, 16 Dec 2023 17:26:15 +0100 Message-ID: <20231216162639.125215-5-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082710_641370_1F02FF46 X-CRM114-Status: GOOD ( 10.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The mode_fixup implementation doesn't do anything, so we can simply remove it. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 345253e033c5..0b1740b38c7b 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -517,13 +517,6 @@ static void inno_hdmi_encoder_disable(struct drm_encoder *encoder) inno_hdmi_set_pwr_mode(hdmi, LOWER_PWR); } -static bool inno_hdmi_encoder_mode_fixup(struct drm_encoder *encoder, - const struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) -{ - return true; -} - static int inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, @@ -540,7 +533,6 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { .enable = inno_hdmi_encoder_enable, .disable = inno_hdmi_encoder_disable, - .mode_fixup = inno_hdmi_encoder_mode_fixup, .mode_set = inno_hdmi_encoder_mode_set, .atomic_check = inno_hdmi_encoder_atomic_check, }; From patchwork Sat Dec 16 16:26:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495648 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BDE0EC46CD3 for ; Sat, 16 Dec 2023 16:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oydn9pHa0HcKgpF7JnsYc9fmWxlNiNDs9p4phvP70fg=; b=Q9EGDdGtu4KRfT VF+zU9vsvHFajXksqroteJJWvzb/xrlaS7hVutv4lRijovSTx2ZISn/UaDFTZZAhA7k735TKY8sWA xhPWUmiM3+qXf/TFvswBprQ1aJcYhiVLSH3GnbJ6MZfwD1a5i52eT93njOMjjZi/vIt8s5UjcJ/x8 eSzRcf7AzlCM9UHYzoHZg5aBjliLQqPG7zC/hSqmQOAj+NgJuO7If9K2IcnEVxuPgFERgAIcTM42C hL1vRZ/v7SLvdjhsbrz5LUlpcYnWzKhXbN3F029PIj9pgE0cdD4vLspO83M4imlY4mZ+JtPlXCGsY OS1ErN1W7vYntYmEKx3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVq-006KFS-31; Sat, 16 Dec 2023 16:27:38 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVQ-006JnS-0y; Sat, 16 Dec 2023 16:27:15 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-552d39ac3ccso2600941a12.0; Sat, 16 Dec 2023 08:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744030; x=1703348830; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+K0So3uuQGg3yr+y8AKU1btAl7C7H8qZH5jAq4CxfOw=; b=XMRRoC5B6D6XN6Ex/IuT8rwNUpP+seeeAdiaRR/wlkAEn8z9vL1XBzD/UhO/yxd8vC EqpHOfWQZJo7fcJ9cC4go/SOgKuu9NV5qrss/FwbnBHqUWIIcNsUDZh4jysSqqhxU7Lx zG4Z6a5sUlqBAy6W6FmSJ+PfGsEJftoPqgHUb0xbwK6j+WQhmnRyJ2uX2usltrhh8mhn z6TistTYnD27c57P/yYvTIpwZ7YK7WLhpUf7kkeHp+GpucI9hJHFzYIeuKOKl4wwlrLt ZLx0J8374bQTnpCW5BiP0xBgTAQWKkY4pI5kOiInlaUlr2OBCZe0SoQC+IHtwXx56ygy XepQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744030; x=1703348830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+K0So3uuQGg3yr+y8AKU1btAl7C7H8qZH5jAq4CxfOw=; b=PWGlSByeiR1McXaixGW04C0cPVuR8Igxi8YUxnXorSYtqW1CS25nSSqbN1hjj05A9p hYUdIArfCGoTnfw3UTzAP9JzeVFzO27jaxAa6jVS9iO6/cWjibddOQ0KnMvOHhr2XOmZ q8ygSOkswyEI47FZ/vVqDaLxtxRWhIlUnIuFWnQUiJuw8hg/w42KVaVLZggghMnS7jYb TzJCurwLQlG5fflkfKVyo7r8mDMB+aFamCq1jq9CEfY/Zp4nozsKtXbK00utA3bjgw6z Xexlr5xr2wpOhOfCD1Y5TIK9QrqKvjUFKehNdEnnUf8Kw9FHDvFKae87UG+9Crc+E662 HnmA== X-Gm-Message-State: AOJu0YxlvgtvuMuyKnwuaHeUecTZleppQ78MEivbK4jEcfNcGS/oW2gu EDDmw9arxXCh//rcGLpYrw== X-Google-Smtp-Source: AGHT+IExRugXG74sxCB2Guilb/nSJFlUmZY/5iuQd+cooSuE643BRC/59xoXydHOjqZElMPX6y5FtQ== X-Received: by 2002:a17:906:101e:b0:a01:ae9a:c1d3 with SMTP id 30-20020a170906101e00b00a01ae9ac1d3mr13645179ejm.11.1702744029174; Sat, 16 Dec 2023 08:27:09 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:08 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 05/27] drm/rockchip: inno_hdmi: Remove useless copy of drm_display_mode Date: Sat, 16 Dec 2023 17:26:16 +0100 Message-ID: <20231216162639.125215-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082712_340576_3718A239 X-CRM114-Status: GOOD ( 11.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The driver maintains a copy of the adjusted mode but doesn't use it anywhere. Remove it. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 0b1740b38c7b..14d2ba92a606 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -62,7 +62,6 @@ struct inno_hdmi { unsigned int tmds_rate; struct hdmi_data_info hdmi_data; - struct drm_display_mode previous_mode; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -498,9 +497,6 @@ static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_setup(hdmi, adj_mode); - - /* Store the display mode for plugin/DPMS poweron events */ - drm_mode_copy(&hdmi->previous_mode, adj_mode); } static void inno_hdmi_encoder_enable(struct drm_encoder *encoder) From patchwork Sat Dec 16 16:26:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7EF8C46CA2 for ; Sat, 16 Dec 2023 16:28:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o3updcnoD4tw/oS7GbpImGMzZwCbVcC6Uzgc7bt0GnA=; b=DqpNaKZaMUGLqB lsr6XcvK0KDQt4S4PN7kA8yVHi/Bbz83Fd/XDb7jtZ2TK1bwqDzitWX3wxvCGfFAqiz0TsueGp11S KZsuQVfqtLFLFt6t46wM+hodC+P8LgFx2o2iE/jepSRNBAUZt1vXcUjFC3ZRaRq3EaJUdkMIUgjyA Tqj4eJCMMIEVCfritvkUg2qbbByLlHCiqWUb9dB4CbfLZuD99kIPoi/XBiCue72f03F+bO+xfzvQ3 hgzyHGf4waB2piJrwm1QR3s4JCCFbJjDG7fqNm3EmBsydt7vDi/8B6TV2F6ea6GPcqU885/G1zmYF +9mDBJLXUX9deu/BxGjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVq-006KEQ-0V; Sat, 16 Dec 2023 16:27:38 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVQ-006JnX-2e; Sat, 16 Dec 2023 16:27:14 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a2331caab22so26553466b.3; Sat, 16 Dec 2023 08:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744030; x=1703348830; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hqi83IjE0rGQjBdIOPd+5QjMZSA3M3R/UCn49KPkLl0=; b=CpqVMpzZ9Of1LYj9Q/Wp7asv3m2gUIP4pYR8RVZS/8YLCx01W+fF+/VeGT6ArJTAbb j2DnzJjeALDTVOzuS+c0AyxP94YlnS0oF2+7wWXg7zdEn2ZdbpGDRXHEf9emzdqVNbTH deoQ7Z3++39hpOEUQ6/ul6PUqjPAlok9eoAWOk26vrKV8EG1pHOsq1A5/8cbDAhpgSxA MArLqPdwQk1otOXBBCncquVQTtzklN4MLresWrbvS+H3K8p8RxmRPpai5hSqo+jEgUdY VGTLkRBPfA0CM5f+QDzS82wieGsq171xwnMOZrwvitKu5GaGaXA8KWiKwKTA+gASUryC eQOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744030; x=1703348830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hqi83IjE0rGQjBdIOPd+5QjMZSA3M3R/UCn49KPkLl0=; b=q47HkO/VeNgFLaKbb04uDiRpN3Wu/RJpJtqXS5pvXJgnc9bMnPQ9MGkwV4B4nnv2sn 18R6zIMaNSdEIXNNOHeHNOCCBIVDC7G9hLJYs7LnEMdoQyasFqAbnji12iOScg2VfEOO 2hc9i0L4mleCbQ5WmKuiMn4cU+rKPe3kLjr3gjUpmxav31FulIS1g476i9qiF8BdZ9Ma SfHP8ZQJE4aAmSe2/twW3f576qVqBOxOR79TJxL+ErIghBsH1JisYBkLL+6O4oR9EvYk 3B1frSTNvkDW5tghyr5+pE+Fj7x/3hFfDYCQ9IDlngbqtWN16HKfg+CDk11Ob2/gNNgH XlBg== X-Gm-Message-State: AOJu0YxQrVHTXX2eZ+Shcm/6WHAzG4rwSG7WU8AvAY2PPMb/uXdy8afa JC+8UUDnfp1sRUohVJUgzA== X-Google-Smtp-Source: AGHT+IHHkaSV0PLeGLYtGjjthyyJAnEZDrIREkjriPjfZBjDTW6VbnTr3UAM7Dj/3F63T9YuXxGXpg== X-Received: by 2002:a17:906:5352:b0:a1f:9617:99a with SMTP id j18-20020a170906535200b00a1f9617099amr4768328ejo.94.1702744029988; Sat, 16 Dec 2023 08:27:09 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:09 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 06/27] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic Date: Sat, 16 Dec 2023 17:26:17 +0100 Message-ID: <20231216162639.125215-7-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082712_859805_7490A455 X-CRM114-Status: GOOD ( 12.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The inno_hdmi encoder still uses the !atomic variants of enable, disable and modeset. Convert to their atomic equivalents. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 14d2ba92a606..48c4f010b260 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -491,22 +491,25 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, } static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) { + struct drm_display_mode *adj_mode = &crtc_state->adjusted_mode; struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_setup(hdmi, adj_mode); } -static void inno_hdmi_encoder_enable(struct drm_encoder *encoder) +static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static void inno_hdmi_encoder_disable(struct drm_encoder *encoder) +static void inno_hdmi_encoder_disable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); @@ -527,10 +530,10 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, } static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { - .enable = inno_hdmi_encoder_enable, - .disable = inno_hdmi_encoder_disable, - .mode_set = inno_hdmi_encoder_mode_set, - .atomic_check = inno_hdmi_encoder_atomic_check, + .atomic_check = inno_hdmi_encoder_atomic_check, + .atomic_enable = inno_hdmi_encoder_enable, + .atomic_disable = inno_hdmi_encoder_disable, + .atomic_mode_set = inno_hdmi_encoder_mode_set, }; static enum drm_connector_status From patchwork Sat Dec 16 16:26:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB41AC46CA2 for ; Sat, 16 Dec 2023 16:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jubkFjVFK7P8EvFa0jzWQAKEdycZWeWGOHNh2qUnRPY=; b=CCzPfmt993LS5G BZZFRA+A4tKSdwzIV0lcep2eLuS8VENYJcUGcoP2a54gcN2Le20Qfs4fBBSbJQ+t76bwXsH9dFf1L 6o2wvHU7g6hd09vygkK7YMSi3lsq36/0NlrqCvxZQs+9Wb2/RZfN9XXwRQAuXSrfo4AMqpzsTQxNi VjbPzVKC5PSBibX2u91y4rVOhR393hvoE//w60W5Ws8O/iLRMTGKe7SCQHC3I1doRcPcSTmxBwaHo FyYm2Q5xYdN8ove+5iblTsotd9ieYgIhQIUVlWn0Qg/Xhz7Qks3HkzDprx+AZ+oVHVfF73FoiN1JT DXJNjxJRzprX6M2QxR7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVs-006KH9-1u; Sat, 16 Dec 2023 16:27:40 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVR-006Jnq-1Y; Sat, 16 Dec 2023 16:27:15 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-552ff8d681aso883978a12.1; Sat, 16 Dec 2023 08:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744030; x=1703348830; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=enGw8p8B5CzjGv0S8y8E93U6rzPMRXDY8CyOli66yco=; b=RjZQghqdG8OtAJ7ZmyBO5XUGm9f0ycNgHwLZsjU+h4aVA2VBwWfz5EGIWlLSXoUmy0 HFUGZ/tEdewmjVOQ/awnvgwnKKcE7vtoKPLbaE+La+KlrNAtygOf+OcqsjQ5a26UMlkV TlZgfFpxeEVtKsakkvMunywhLqtMus3pvG8KelzvWSDWrVBwBu1IXuVqzgwJuXHc9lGO pYQ5Xl7v/f/Dwru2IUxSPz1yha4zbJU6oQl4Jsx8wv4RDhb6ifo1WBPmQ15yLTnvTGsG jXlTJJng3xbQoTrs9ta+rPNqByd5tIgme9cmZD26Isw/tugqVGQf+imKB0unVxCn/cpS zjEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744030; x=1703348830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=enGw8p8B5CzjGv0S8y8E93U6rzPMRXDY8CyOli66yco=; b=tymqGmMYg2XOifQ5frxWSkofUfZ0SG6xF4L5q8M2J+iD6LfB98uCOigHloafOVzeSj cmTfa3E0xCVing8JxgNQ24VO5uTiZ++EoRfDVCkSxnb6nuooWWSWpe3fYkJJL5VMPby7 Lr6ZsM6CICuK6BtyarEtHUdih8tzPkY1/7oFHM/VJ1cj4ZZu9uXazD3jl12P3lTshlhB nHw4YWLARvSIwwJ0yt61/Ndl3FYteh4P82xYuQ1RrmeSwLR6yb5gpc7nMEVJbfTj8K2S ahnel0VpYcKBJxSEVbCuf2jo2CVulV8QnrItjz7SYtCSNcvHOjBnIdg9w80zDgeLRwLo wKSw== X-Gm-Message-State: AOJu0YwSwY8xDtFbORFO7E8KWkL0ZF/WfNQe1BGmEcKnelDGeqX12Ocj OC/4t4Gr2AtCrnlrBjEX9w== X-Google-Smtp-Source: AGHT+IGw7FiYDghqDzTy3nLXlydCF1Rdkl1jTzgPRe5Ngs12gDtlJP7mEFvi4eD8tZOZvQbZfPvCdw== X-Received: by 2002:a17:907:5c7:b0:a23:f56:98e1 with SMTP id wg7-20020a17090705c700b00a230f5698e1mr5449054ejb.18.1702744030650; Sat, 16 Dec 2023 08:27:10 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:10 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 07/27] drm/rockchip: inno_hdmi: Get rid of mode_set Date: Sat, 16 Dec 2023 17:26:18 +0100 Message-ID: <20231216162639.125215-8-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082713_540873_DCB38B9D X-CRM114-Status: GOOD ( 14.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard We're not doing anything special in atomic_mode_set so we can simply merge it into atomic_enable. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 48c4f010b260..299770e481b7 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -490,21 +490,22 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, return 0; } -static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_crtc_state *crtc_state, - struct drm_connector_state *conn_state) -{ - struct drm_display_mode *adj_mode = &crtc_state->adjusted_mode; - struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); - - inno_hdmi_setup(hdmi, adj_mode); -} - static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); + struct drm_connector_state *conn_state; + struct drm_crtc_state *crtc_state; + + conn_state = drm_atomic_get_new_connector_state(state, &hdmi->connector); + if (WARN_ON(!conn_state)) + return; + + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); + if (WARN_ON(!crtc_state)) + return; + inno_hdmi_setup(hdmi, &crtc_state->adjusted_mode); inno_hdmi_set_pwr_mode(hdmi, NORMAL); } @@ -533,7 +534,6 @@ static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { .atomic_check = inno_hdmi_encoder_atomic_check, .atomic_enable = inno_hdmi_encoder_enable, .atomic_disable = inno_hdmi_encoder_disable, - .atomic_mode_set = inno_hdmi_encoder_mode_set, }; static enum drm_connector_status From patchwork Sat Dec 16 16:26:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62F02C46CCD for ; Sat, 16 Dec 2023 16:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DnZxT62rZZaUu7ipQBcN7wz1PwRBVFEYOrW3vxSBlZc=; b=D1JZ7/i5K7gIq3 NUhQvZfcTclDc1lx0jR+KbSwB5T/UaV6CUDRWi9diukWYGUW/kD/rPInab47cvlxFmUjd+XHuU4xS g2lt1l/MgrUF6ieGW+D9QcLl6b7OxeE6Uea+B0FyryZkAbjFm2rZHatOFKo+yM8iVMkQnMnA0PilP mVtheB6I/OIDearaokTyZLvlfYHKFuoigambiII/v04kE8jgwaRPEu6fq6a8wo9tE/AwakWtpmFWe iL5pM+zGbGuf+LMsiNUo5Qy6fytJ4izqajGBAI6j0Ku9LlJpTZitZ82GDLWMN8ogofRM2oWHPpx9M mkn8pMdCNxxUAJ4R3p8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVv-006KKH-0s; Sat, 16 Dec 2023 16:27:43 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVS-006JoJ-0L; Sat, 16 Dec 2023 16:27:16 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a22f59c6ae6so214831466b.1; Sat, 16 Dec 2023 08:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744031; x=1703348831; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xnlt5lgm9qwa/3Pu0kcziAAeIBysCmQzwYaw/MNqgTo=; b=cOabJcOssXD4ARdTWwDKypEn4Z8QiWe/4MvzMr9wPKaTUGXgO+J7GoCUdgdW2KS7Cm v+JKZ+Ul6VVnRT6yAdU74cWJRXSJx5A+GXUI/vcpSzv78XB+QDIkMNhHRIImEikCANWN 2/tvv+qwISV8wD/DGdNw0bHlIp8p33x/oQ93GVv4QqB1dGjSIWWIhhNx5YJA6UoZlgx7 9WliXso8Bk7NNxr/279qrWf6Cb0HRpZggolznfswdaBGszXJVbNeGJZ0Pm9vtLhu30BL zm6ln+QzvakFcspXfWFM7990yMJ/L2uy/nSoWDOMT3MyOjMF/26AcRqs/gjZlaSsyXO7 n4IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744031; x=1703348831; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xnlt5lgm9qwa/3Pu0kcziAAeIBysCmQzwYaw/MNqgTo=; b=A/a0hbBiltYQxJQfqW8ry62DVgqywkl0049RIxFX0TuM8U0XIdcdubjUZC9J9M4dME QFc/jRYSiAHBa/gt9/T+WGlmHiHAdk+D2bm1jwWF5gpmnrNNA5gi00zTA1R60Qu8Lpm0 IcIlgftQbpq5+e8eMq7dZMcb79Fe0qYuF4Xip1nWERj6HU81d7lyDzVmxEXc0rVoNKtn s5gu6m58TgzXGnmaG1BPlAb2+hFz1Rh85MxxybXtNOLlbrTi4+sJ2GQcuKB8DpuqeqA6 WR58Uu+iE6F3Ii1GARLSuNME4kfGaNI1vT21sXLyPgvYJYoJCtXICFZm6h+v/ICjvwDF QJiA== X-Gm-Message-State: AOJu0Ywu/E00ZvU2Ne78qK0oggoaBJljeSTBoDIyZlYaXGKfeDo+7JFH 5ilqLaPM0CfDC084V4Xhgg== X-Google-Smtp-Source: AGHT+IFv2/zw0ooG1yd0ojMj7vmNs6hU7B/IUbAwB2DH7Qa5Ghq8j9jjVMSVxr66g2NaXt7MFLjh6w== X-Received: by 2002:a17:907:3da9:b0:a1c:898e:6a0c with SMTP id he41-20020a1709073da900b00a1c898e6a0cmr3708081ejc.210.1702744031312; Sat, 16 Dec 2023 08:27:11 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:11 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 08/27] drm/rockchip: inno_hdmi: no need to store vic Date: Sat, 16 Dec 2023 17:26:19 +0100 Message-ID: <20231216162639.125215-9-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082714_196956_5E4F992B X-CRM114-Status: GOOD ( 12.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The mode's VIC is only ever used in the inno_hdmi_setup() function so there's no need to store it in the main structure. Signed-off-by: Maxime Ripard [made checkpatch happy] Signed-off-by: Alex Bee Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 299770e481b7..d99896f1a73a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - int vic; bool sink_has_audio; unsigned int enc_in_format; unsigned int enc_out_format; @@ -443,16 +442,15 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { struct drm_display_info *display = &hdmi->connector.display_info; - - hdmi->hdmi_data.vic = drm_match_cea_mode(mode); + u8 vic = drm_match_cea_mode(mode); hdmi->hdmi_data.enc_in_format = HDMI_COLORSPACE_RGB; hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; - if ((hdmi->hdmi_data.vic == 6) || (hdmi->hdmi_data.vic == 7) || - (hdmi->hdmi_data.vic == 21) || (hdmi->hdmi_data.vic == 22) || - (hdmi->hdmi_data.vic == 2) || (hdmi->hdmi_data.vic == 3) || - (hdmi->hdmi_data.vic == 17) || (hdmi->hdmi_data.vic == 18)) + if (vic == 6 || vic == 7 || + vic == 21 || vic == 22 || + vic == 2 || vic == 3 || + vic == 17 || vic == 18) hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; else hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; From patchwork Sat Dec 16 16:26:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5564CC46CD3 for ; Sat, 16 Dec 2023 16:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YkSo99h06OoEOAXxHBv9OGIXFa73EN+lwzx4LTy8S3o=; b=2lrmTX3L9lB0BS 6eIAo2h2p3Xe4MKMmilKKEO3A85Edu4c90G1K6N5gN0bGfwD2bj4Br8df7pOhNzEaVvG8j68G6NSB N3FdeYo5ylBVrQYFOEWIyRQbbbo0a11sf6DebF0HUteinqpA3TWYYiWemK+MMrz9moCvg1Vs+YWGP nf0k8FRKKp9dOBPgECb+9DwkJ8At8xv+XhQaI+OGxySkMlWmR5UuF6IWCwWdjfQgO8r3Vg+IDuN6m Z2s1B87Ao6hmafzjjKypV/OKNCuUu/VgvSqEO6HySK3ceJ6//b3LZSrpMTsLAfLJ4E9Lsx12Agvan 9aJ8IA9GP2aaUlCRHD7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVy-006KNX-1z; Sat, 16 Dec 2023 16:27:46 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVT-006JpJ-2y; Sat, 16 Dec 2023 16:27:17 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a2331caab22so26555366b.3; Sat, 16 Dec 2023 08:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744032; x=1703348832; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4O+Q+uG5M/KTzI1PKwCAfiw017Nj6I11OqkfEb5dgI8=; b=aqOtE6mqltB64IJ769T9WgxvGecmkFXm1qAoKGO7l9QXfF73JZcHs/jvwsN6yEa8Q6 1tOS4/c1Ty1jr2va1DgRcf4geTZ7xlG4Ss8pVRWNXci/DOQBeaNAfThtfkLkuCqoHV7A LqkOTIm8C9lNIv/tvccgK7qGbHjJ5d89mzIoJRCIJA/9yC0oSWRADO69djt7nBsIIaTs UCZsKR84rYwGkqK1IZ9WYpv21IwRf8A7jbXYdNkmKcGCZmYj2eHh4k90XtEw+HdWXKhj fj70VOfrs9UIqMbuNu/zh6FLlv66EKyxBaKdLsvjZRcoQmldWZU+LR88skwxKMS1x69l Xghw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744032; x=1703348832; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4O+Q+uG5M/KTzI1PKwCAfiw017Nj6I11OqkfEb5dgI8=; b=qraddvPxkRRLahS5C4IpPtKXmThJjRINshvhcFCA5wPYJCWTRaI1zgMZNVylbxOfPL Zf5HKdR7ywhwzGkpWiYbO8PvjcTE34gEFaLsnfdEwx1La3xL8Q0IEnvhT27+jY4pBfCA KH3iddRXuCn9SPpkEanbLoXaEiqaWBzJz4qF6EIVdIwijqc294jUPau4tjnWmRQo+Hlp g2n774GNBIK/5/YCOu2bH/JXcMVBhsG/HkDB9uJkmjfVCl46kZrVvBo5hlUSH7Wp7pli i+JXYXFBcUl3rfV2CUdn5HtVSRvb3/HBSoaFaT16LMrtQVaWVZ2n9jRUnHpxuzBQmc4c v21g== X-Gm-Message-State: AOJu0YywHDGVaitjFpcHetS8BqIEK1jvkbycaE1FxkXBFEOLatp4m9rY 8QNkSn/HckR0zwHXMLGf6g== X-Google-Smtp-Source: AGHT+IFyQOJtDkKfP/aGpoVbX9uCAPLdCE/IT1cjuph553xK4Po40z2xou+CG3MWlJoPZyeCd1bl/w== X-Received: by 2002:a17:906:d4:b0:a0a:f739:ad6e with SMTP id 20-20020a17090600d400b00a0af739ad6emr5182343eji.31.1702744032054; Sat, 16 Dec 2023 08:27:12 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:11 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 09/27] drm/rockchip: inno_hdmi: Remove unneeded has audio flag Date: Sat, 16 Dec 2023 17:26:20 +0100 Message-ID: <20231216162639.125215-10-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082716_011254_F5951C79 X-CRM114-Status: GOOD ( 11.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The sink_has_audio flag is not used anywhere in the driver so let's get rid of it. It's redundant with drm_display_info.has_audio anyway. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index d99896f1a73a..58aff7a9c09a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - bool sink_has_audio; unsigned int enc_in_format; unsigned int enc_out_format; unsigned int colorimetry; @@ -554,7 +553,6 @@ static int inno_hdmi_connector_get_modes(struct drm_connector *connector) edid = drm_get_edid(connector, hdmi->ddc); if (edid) { - hdmi->hdmi_data.sink_has_audio = drm_detect_monitor_audio(edid); drm_connector_update_edid_property(connector, edid); ret = drm_add_edid_modes(connector, edid); kfree(edid); From patchwork Sat Dec 16 16:26:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5064EC46CA2 for ; Sat, 16 Dec 2023 16:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=utdWYR2sINJ2k4J19lb2UI5tdDgcudw5697+t+wzyLw=; b=bpid26dpsmpRMU Po+cKpyloa8goMNRt7TcXxV4axVZNx1eCVb0lzUlI+wiYotWrH3XF/qpAxRFsAxhSkqBE1cFkgwKX QAI6gVWgSERxeANDS99qsFLFkUperiZHJOHEtTYXfHBHbPo8+JcCPU/hQ2qFIWpRLK+vljwZX3H4J QAQA8faktHTml7axlym9mhyiHeEXPqPfhJ1KKQysrfY/giPUxN6iuGEmLCJHrPD8+vCgFEUGrSn0k I+/URkeGo+n+cIF40q99Z+bolzF63R33ZoLUZIkleTGzGesytZLx48u193as3EfA6aNRg2MNHuY4Z 2REeoNKavAyjQfbAYrCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXX1-006LUl-38; Sat, 16 Dec 2023 16:28:51 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVU-006Jpm-0Z; Sat, 16 Dec 2023 16:27:18 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40c824b199fso5375565e9.1; Sat, 16 Dec 2023 08:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744033; x=1703348833; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KAoRz0wHCs8LYRbt4lNTAJ8vx4780AGy/20pu4Etj/0=; b=XqJDyUIMQsMzrrK+Dd4E+fgR5pyb/8LUPOH+ZdbPIKiOblNaKVHRaSm1K3c0TTkbyf QPehdWjrkA17qMpQPIw405bZYalt3px+q2dZV4fhXqeij8RkSJaJhtJLRnzxhP3sz7lz 3DtPTK2q/PRzgkA+C3jorZnpnFujHskBQ7UXXXi9Z5XOBaxkk4uG5JGl9GTS7B7HiosP pjF4hfyyNoURXUWT4BJMjMn6+EwGGNnJ1vDwHhRTifbLodPW7vCnYDswLZ9k764cH0VI U0pMPcJFw9LYXv22w+RuwiOmH5hOS7XYPROi4E6CAmYGGrbHKVhRrwwnHRw9mz8wAkNr 2orQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744033; x=1703348833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KAoRz0wHCs8LYRbt4lNTAJ8vx4780AGy/20pu4Etj/0=; b=O6nmF3Pw6jRJ/08cZp3wwVXRjXu9c5xcZAurmOOgA9mgDHuDgW2GdAHzKvB8u1LXgb W726ukpXOtw8V8rDw39s72rYpD1YM6eym9zzP/aa4BtkA4G458Kiibqq+oKPZPm4Vmd8 +/C1uRwd697jFPGULQe/+JrWLiMEMRLK1wFOgEWf7CfHs6gYdcadnJMpPWjxVqOmGgCG eDm4xypOulS7aZrp6h8PljdhuSISGcmZ9gCfZHo2y4pWZwVy5qrzvakYoyDiCo801Cjy 7T3bsaUUiJmwIM/o04elhHXnKsZy5P0vIg4ONIct06J38cBFtzfeCQbRb6xW0whZ0VcC yWEA== X-Gm-Message-State: AOJu0YyJWLsOrGhlF8HZTu5w+Bqy/RmDW0DcyaLmuXc6OpyRRk1WTTFF XvRI4RTPJZoUqRTtyaWIFg== X-Google-Smtp-Source: AGHT+IG0Hmya+9f+E9zucCIpHt7tAYGl7L/GXaMKN6CpdCLNuo7NhmcAilRqP2ZxOhD8YSjMeDmc/A== X-Received: by 2002:a05:600c:474e:b0:40c:4be1:be09 with SMTP id w14-20020a05600c474e00b0040c4be1be09mr4886690wmo.186.1702744032805; Sat, 16 Dec 2023 08:27:12 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:12 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 10/27] drm/rockchip: inno_hdmi: Remove useless input format Date: Sat, 16 Dec 2023 17:26:21 +0100 Message-ID: <20231216162639.125215-11-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082716_472545_E61E4757 X-CRM114-Status: GOOD ( 14.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The driver has a lot of logic to deal with multiple input formats, but hardcodes it to RGB. This means that most of that code has been dead code, so let's get rid of it. Signed-off-by: Maxime Ripard [made checkpatch happy] Signed-off-by: Alex Bee Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 41 ++++++++-------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 58aff7a9c09a..7c75feedacad 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - unsigned int enc_in_format; unsigned int enc_out_format; unsigned int colorimetry; }; @@ -328,47 +327,30 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) v_VIDEO_INPUT_CSP(0); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); - if (data->enc_in_format == data->enc_out_format) { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) || - (data->enc_in_format >= HDMI_COLORSPACE_YUV444)) { - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); - - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, - m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, - v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | - v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); - return 0; - } + if (data->enc_out_format == HDMI_COLORSPACE_RGB) { + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); + hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); + + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, + m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, + v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | + v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); + return 0; } if (data->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) && - (data->enc_out_format == HDMI_COLORSPACE_YUV444)) { + if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; - } else if ((data->enc_in_format == HDMI_COLORSPACE_YUV444) && - (data->enc_out_format == HDMI_COLORSPACE_RGB)) { - csc_mode = CSC_ITU601_16_235_TO_RGB_0_255_8BIT; - auto_csc = AUTO_CSC_ENABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_DISABLE; } } else { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) && - (data->enc_out_format == HDMI_COLORSPACE_YUV444)) { + if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; - } else if ((data->enc_in_format == HDMI_COLORSPACE_YUV444) && - (data->enc_out_format == HDMI_COLORSPACE_RGB)) { - csc_mode = CSC_ITU709_16_235_TO_RGB_0_255_8BIT; - auto_csc = AUTO_CSC_ENABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_DISABLE; } } @@ -443,7 +425,6 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_info *display = &hdmi->connector.display_info; u8 vic = drm_match_cea_mode(mode); - hdmi->hdmi_data.enc_in_format = HDMI_COLORSPACE_RGB; hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; if (vic == 6 || vic == 7 || From patchwork Sat Dec 16 16:26:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2449C46CD3 for ; Sat, 16 Dec 2023 16:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hrT6aiFpYWCKv9DXwF+3W0XGFsKYCU7csXXdmq/uZyQ=; b=2RVbrPWoM17RMD Qr/wQQYqWciOQMP/Z0xeOOdVCm8SHVERavsySEMoD3ESaJ6ajxFEX6jdL0tDbvuWTapQADqo6Nw+7 dXHelGqhep8O0mRVkRoxvczjKeXqFJPHo/kgYgSMwe8V2nG6mTGxR0ZWbk0wXdzN0YYIQX2CEntgd EKyhOCKY05NwmBazq538g1hFcFY/YkcbUF414IQvTwZ40tMSUuMGzT9OkT5KAR1v3H1j6Gczk8h4Y ZCqsB7NLX7s63pOwcZBKigz++1rko/NCDBlgwTxAnp843JyOZL93XQ4dXmgUa7kyWxfVAQPXYSvWQ ahQ1+5mWkTJ1Cz3KdYig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXW7-006KZ2-29; Sat, 16 Dec 2023 16:27:55 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVV-006Jqw-1x; Sat, 16 Dec 2023 16:27:19 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a2339262835so7676166b.3; Sat, 16 Dec 2023 08:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744034; x=1703348834; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=droXS1VwLjQHMIbiZwuYM0gMqlIpmFeRVQnM5SEX4co=; b=YIOgX/2wOEyitfDcLWt8sumUzmjGLMTXnVnws+09qQI1NuZYe8IhUh+VqhQ8NgDqy4 moaN/JzO95CJ77CTwZAkY1mQBbXHqCuR7N7oGfwzfnp56iRIEBkRHABFbAbZUh6sowdC nYf1zZ9MGTJn6MlLz9b81YuyJJHR7jL8EXiZz3uIlLVqzCdYelmqHUGy6Snxo1NYVGJd bmpEK3HKRsresMhqrugIA2mYzxrR4OAw0lHjcZDlQCCWHaCYh06S8YUKNLWbhJWeuGX6 8iLeexFWqvEQsnuzDPZW6nuHqvJPCQHh4m4tsVwl2SlBQhhjFtd1kdWujoDQdHiqVI1m rlIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744034; x=1703348834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=droXS1VwLjQHMIbiZwuYM0gMqlIpmFeRVQnM5SEX4co=; b=S26DjRVt/KMK0P0I1kGk6W2uyZ0GkL93k/Hpckb7cz2p7K5cNMmS9PcdZQp+ioTrXk FBRJa8NNTpRf+7oo/mBihSN74ZcKa2PTTqigqHjCdJ6ULf62hXnOt55i1h0TnRUm3guT nRYydJhwIMKNFQZHO7r4LZ/67MXsmZB0ASzu+T36/lUm9Yv+h3mEHlGG21ABL1K5nijQ 9MRKMqtjdKrlNlxQuAFAhScvXmQXsiyrzzzgIrFjWFfWpQMfTtvyLIC4VkiOdLOG4yZA eAsyzZhTnMfp4BXfDdSGxduTGu8fdZtkbNsAtzO7oIg6+KONkakawHAmYJXxoLpW5geM xBCQ== X-Gm-Message-State: AOJu0YwWmOSf8u4J1ucHehuOU6HsZ2N3ss2oSHxdqTLXfD6cwI4Wn+3i XScqxHc5sCWDaCGNTZdOfQ== X-Google-Smtp-Source: AGHT+IGCbJ2pPaCyxT0gqr9ykpy0r+mCHKKQDsnV4NSzT5q0D0O1ZspxzFhMLbO9gd0Z2KHRy7XNxg== X-Received: by 2002:a17:906:142:b0:a22:faf0:3bbc with SMTP id 2-20020a170906014200b00a22faf03bbcmr3702764ejh.139.1702744033851; Sat, 16 Dec 2023 08:27:13 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:13 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 11/27] drm/rockchip: inno_hdmi: Remove YUV-based csc coefficents Date: Sat, 16 Dec 2023 17:26:22 +0100 Message-ID: <20231216162639.125215-12-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082717_696910_8EFFE66C X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that the unneeded support for YUV based input formats is gone, the csc coefficients for those formats can be dropped as well. Signed-off-by: Alex Bee --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 37 ---------------------------- 1 file changed, 37 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 7c75feedacad..04344ee1265d 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -74,49 +74,12 @@ static struct inno_hdmi *connector_to_inno_hdmi(struct drm_connector *connector) } enum { - CSC_ITU601_16_235_TO_RGB_0_255_8BIT, - CSC_ITU601_0_255_TO_RGB_0_255_8BIT, - CSC_ITU709_16_235_TO_RGB_0_255_8BIT, CSC_RGB_0_255_TO_ITU601_16_235_8BIT, CSC_RGB_0_255_TO_ITU709_16_235_8BIT, CSC_RGB_0_255_TO_RGB_16_235_8BIT, }; static const char coeff_csc[][24] = { - /* - * YUV2RGB:601 SD mode(Y[16:235], UV[16:240], RGB[0:255]): - * R = 1.164*Y + 1.596*V - 204 - * G = 1.164*Y - 0.391*U - 0.813*V + 154 - * B = 1.164*Y + 2.018*U - 258 - */ - { - 0x04, 0xa7, 0x00, 0x00, 0x06, 0x62, 0x02, 0xcc, - 0x04, 0xa7, 0x11, 0x90, 0x13, 0x40, 0x00, 0x9a, - 0x04, 0xa7, 0x08, 0x12, 0x00, 0x00, 0x03, 0x02 - }, - /* - * YUV2RGB:601 SD mode(YUV[0:255],RGB[0:255]): - * R = Y + 1.402*V - 248 - * G = Y - 0.344*U - 0.714*V + 135 - * B = Y + 1.772*U - 227 - */ - { - 0x04, 0x00, 0x00, 0x00, 0x05, 0x9b, 0x02, 0xf8, - 0x04, 0x00, 0x11, 0x60, 0x12, 0xdb, 0x00, 0x87, - 0x04, 0x00, 0x07, 0x16, 0x00, 0x00, 0x02, 0xe3 - }, - /* - * YUV2RGB:709 HD mode(Y[16:235],UV[16:240],RGB[0:255]): - * R = 1.164*Y + 1.793*V - 248 - * G = 1.164*Y - 0.213*U - 0.534*V + 77 - * B = 1.164*Y + 2.115*U - 289 - */ - { - 0x04, 0xa7, 0x00, 0x00, 0x07, 0x2c, 0x02, 0xf8, - 0x04, 0xa7, 0x10, 0xda, 0x12, 0x22, 0x00, 0x4d, - 0x04, 0xa7, 0x08, 0x74, 0x00, 0x00, 0x03, 0x21 - }, - /* * RGB2YUV:601 SD mode: * Cb = -0.291G - 0.148R + 0.439B + 128 From patchwork Sat Dec 16 16:26:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47650C46CA2 for ; Sat, 16 Dec 2023 16:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LAvk1B4Gp6YGV58LtbdkjUc4M63PkRrz6lVra7dp274=; b=WcO9aZFrncQXoe V2XHBdoT9u/tntazx0zb9ZxxqVFfEnDv6JKmhVcCaPshNFUYZKfVvG8vzzLhkjxkbnGEziwD47ueI W6Zx9WWhHm50q5O/WpynZG/zNnvOZ2+fAl+AX5WwZrlgvFCK0wZ8YNZfDEya90n04lndIwSBSbbtD nssgn5X7tyvhA0Whg1ILgN1Co5RPArV/og9M1XqMns2rHf5pj49zrSZkD8a54vjxPbv1BaiEFfHYv 3onj2KtxQbsTyavsLnAXMqdeNnJa2s+uyBFg/EVTSByMahHcjigPgtyckPUQ2rsHxCw6MtKZDxVJl h9VeaRV9uOBvLyJeP4og==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXW3-006KTZ-0p; Sat, 16 Dec 2023 16:27:51 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVU-006Jrv-0g; Sat, 16 Dec 2023 16:27:18 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a233bf14cafso3904166b.2; Sat, 16 Dec 2023 08:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744035; x=1703348835; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ECr4TU+4dWwEpyi0MRJHLZRYm5yt9s85NOlMMczFD3o=; b=eL1mZzIJCvG99O1lk22r19R6J2Hqp+vBNoq5jiK3ccEV2ucZf1PDfGtT3h/4sSx9sU yp9xcQenBvZQrBxEct5SMrKef5aJAhGT90SBBjdc9a9bvzekol8yycEQk56a476yjDNo n3URQCfJYGiG08g1FLzblIpu33NhzaXwKl3ukbCM5yoEnobpxfIANSHiIcP49IjqYpoj 6XxcMIYI506OFjaDf+gSKZNAsQTE+/Ktbp4pNZ/mSfZmJ6s0VWP1bI/alWtru8nLzWNX pX5EpfYh/qYZqzaXVKD2f9t+i//CqXXiM3hi8Cpb8P/v3bzgJn7mSC1sxx1LufXj6/MX T+Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744035; x=1703348835; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ECr4TU+4dWwEpyi0MRJHLZRYm5yt9s85NOlMMczFD3o=; b=mTCx7XR8jOIsTba0bqAACmop7iFNHoGGgnNfsgJXehcu3Mldf4odViQHnWwWXaaqRr 7Q7929Cjq36UOZzMlTbwj9mPH9FoVwxct51LnSzPqHbEt6UZyM+/MyhBSeD5lxQmk8/H o5T8aXN95RBrKo5CqaBD4+M6xcu84114h9Gzwn1oClb3VfUh4eA2GgRXbvkicRm159hz xuaRcPBx+FdRaADPuSm4jNZ5Al3CaFL8WRYuceck82k9CQfACGG5eWq+De/Ee/cpDNL0 GIXzWEBB1EkU+vFejCZ5VTFv4RcMj1gKUzEppj50Wirnlc7ispwL9wI+Uhaeh0JezWCY cuqA== X-Gm-Message-State: AOJu0YyvGde/CGDVn2b9ctZNRdYua2hJLqx/u05IIBmmyF3zde1ktOuE Z9bpwMnZeSzBBGUxmu+0QQ== X-Google-Smtp-Source: AGHT+IGGXCXV7iuVsJthNs7xfU7rsSHw66Q2y9j042wi558zp4keY2U5j+cevcIqQYjVqvV5U3yloQ== X-Received: by 2002:a17:906:e8d:b0:a19:a19b:c736 with SMTP id p13-20020a1709060e8d00b00a19a19bc736mr6780924ejf.134.1702744034682; Sat, 16 Dec 2023 08:27:14 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:14 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Jonker , Alex Bee Subject: [PATCH v2 12/27] drm/rockchip: inno_hdmi: Drop HDMI Vendor Infoframe support Date: Sat, 16 Dec 2023 17:26:23 +0100 Message-ID: <20231216162639.125215-13-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082716_450111_AAD39D09 X-CRM114-Status: GOOD ( 14.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The HDMI vendor infoframe is only meant to be sent with 4k60 modes and higher, but the controller doesn't support them. Let's drop them from the kernel. Suggested-by: Johan Jonker Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 35 ++++++++-------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 04344ee1265d..1dd757845547 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -208,11 +208,15 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) } static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, int setup_rc, - union hdmi_infoframe *frame, u32 frame_index, - u32 mask, u32 disable, u32 enable) + union hdmi_infoframe *frame, u32 frame_index) { - if (mask) - hdmi_modb(hdmi, HDMI_PACKET_SEND_AUTO, mask, disable); + struct drm_connector *connector = &hdmi->connector; + + if (frame_index != INFOFRAME_AVI) { + drm_err(connector->dev, + "Unsupported infoframe type: %u\n", frame_index); + return 0; + } hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); @@ -228,28 +232,11 @@ static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, int setup_rc, for (i = 0; i < rc; i++) hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, packed_frame[i]); - - if (mask) - hdmi_modb(hdmi, HDMI_PACKET_SEND_AUTO, mask, enable); } return setup_rc; } -static int inno_hdmi_config_video_vsi(struct inno_hdmi *hdmi, - struct drm_display_mode *mode) -{ - union hdmi_infoframe frame; - int rc; - - rc = drm_hdmi_vendor_infoframe_from_display_mode(&frame.vendor.hdmi, - &hdmi->connector, - mode); - - return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_VSI, - m_PACKET_VSI_EN, v_PACKET_VSI_EN(0), v_PACKET_VSI_EN(1)); -} - static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { @@ -267,7 +254,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI, 0, 0, 0); + return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) @@ -410,10 +397,8 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, inno_hdmi_config_video_csc(hdmi); - if (display->is_hdmi) { + if (display->is_hdmi) inno_hdmi_config_video_avi(hdmi, mode); - inno_hdmi_config_video_vsi(hdmi, mode); - } /* * When IP controller have configured to an accurate video From patchwork Sat Dec 16 16:26:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9BDF7C46CCD for ; Sat, 16 Dec 2023 16:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0d2cCnEAdIuYiXu71VDYQEPtmIT+0rvuQ8GS+jhphaA=; b=Y3cUsImNfJAPjq G50gTp5pn5/5rEkYISJkwD8KJ+LQCzpo1dEfRR6g+Q1yF1ep3OCdb6lBt+AiQp/kyrztT03SufMEd fNaB9GDgy80SHjStRI9DX87DL0sd9QjCB7/XsLknsjCMxNZAgJCtc+dLOPMVFBKRskGBTjyYPq39o oabwErwq3zx1D1Ndqq9fQlNg/AR6VT4QFRHMY7qZUwAIoOIl654Fo262wPHcgKXPna/k/P66PEAeZ X/WUdVOFPpXRqspIpuLjV9yaXGOJDB+72epaJze4M53yUUxDeSWhQ3uVVJpfDjr0wjCGoEgAo6o9r zUO8r40FqkB1qBOappWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXW4-006KUs-0q; Sat, 16 Dec 2023 16:27:52 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVU-006Jsp-2D; Sat, 16 Dec 2023 16:27:18 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-552d39ac3ccso2601010a12.0; Sat, 16 Dec 2023 08:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744035; x=1703348835; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i9QZuywAC4EI3NrqImc1jlnBGMQF6PpPHDhHez7fyFw=; b=RrGQin5WOPqgGlz6adnyrxljMQ/RLeHgqMwSMJtjksa4jscLQnBpoZdkCqaIaqeUM4 oVzrYv4q+UufQXGY17bHz5hE4Eebs3CacRepKQHWRFw03O/dDFdPGE7FZmT8m24+JDdI KcrgH4zyJzk0mAWL77XU0hkG/EEFkyK8ZoXrA8fw29TN4nK7BVpxaqAzIRN7UXoiyAPg LUMXVop6QZbupNGvrBHs5UB/4DCwTdGjs1cyZnYlB1uXxU9mKBLfjpLGNfqC2OeyByEY MKlVDxahv0UZAlv+7JLlltzHLC16jiy/0Qtbv/KwVpivXP69NLNrDthezQjS9a6PLypK 3d8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744035; x=1703348835; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i9QZuywAC4EI3NrqImc1jlnBGMQF6PpPHDhHez7fyFw=; b=bJ0R3rO3hEBn7jXmpPeZaEpjUuJXTkI/LhrAuQt1a07dU+PFL/8r58NsAzBYK2AIqV 0gn+D42V2kBF3SuM+c0isbfxznBIZJrH6wLKOUZ7JW9y3yjnTusVH4OFmWHQvz6VFX6m opZ8lP9TjE0ren13pKQJ9XHSkFaUxvRWm9Y20MKGZrN/tQivQRqvF1EUjilmslWY9MeY Yp5Y3kCBFrU2epViDiNAHn48lDq0YR5WeMVDtz6m1e2X9Zji645NmiVJOoaeT5CNGFJQ LJW0A/hduLaq8vSJsArCdGkeVdlyaWYBj1RwVmQhoNqvp/L/fjls1jpg5tYwkX/2cTog eSng== X-Gm-Message-State: AOJu0Yxd7Eg7TeWGFcP15126sCIaG/IjIxl8W/tGyIkwcU5LhSkOWEKX Zvo/BJHWgOwmY8t0GoAJzw== X-Google-Smtp-Source: AGHT+IHGbh6ggRb8WI42dSTU+fAZTkS0f9QpcbJqWKC6qLhps1dmDmupPrITbbQTUiS7sKzLN0d+eQ== X-Received: by 2002:a17:906:610:b0:a19:a409:37dc with SMTP id s16-20020a170906061000b00a19a40937dcmr14010099ejb.53.1702744035357; Sat, 16 Dec 2023 08:27:15 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:15 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 13/27] drm/rockchip: inno_hdmi: Move infoframe disable to separate function Date: Sat, 16 Dec 2023 17:26:24 +0100 Message-ID: <20231216162639.125215-14-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082716_755734_6FE68BA4 X-CRM114-Status: GOOD ( 17.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The code to upload infoframes to the controller uses a weird construct which, based on the previous function call return code, will either disable or enable that infoframe. In order to get rid of that argument, let's split the function to disable the infoframe into a separate function and make it obvious what we are doing in the error path. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 46 ++++++++++++++++++---------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 1dd757845547..6354949bfd8e 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -207,34 +207,44 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, int setup_rc, - union hdmi_infoframe *frame, u32 frame_index) +static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, u32 frame_index) { struct drm_connector *connector = &hdmi->connector; if (frame_index != INFOFRAME_AVI) { drm_err(connector->dev, "Unsupported infoframe type: %u\n", frame_index); - return 0; + return; } hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); +} - if (setup_rc >= 0) { - u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; - ssize_t rc, i; - - rc = hdmi_infoframe_pack(frame, packed_frame, - sizeof(packed_frame)); - if (rc < 0) - return rc; +static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, + union hdmi_infoframe *frame, u32 frame_index) +{ + struct drm_connector *connector = &hdmi->connector; + u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; + ssize_t rc, i; - for (i = 0; i < rc; i++) - hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, - packed_frame[i]); + if (frame_index != INFOFRAME_AVI) { + drm_err(connector->dev, + "Unsupported infoframe type: %u\n", frame_index); + return 0; } - return setup_rc; + inno_hdmi_disable_frame(hdmi, frame_index); + + rc = hdmi_infoframe_pack(frame, packed_frame, + sizeof(packed_frame)); + if (rc < 0) + return rc; + + for (i = 0; i < rc; i++) + hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, + packed_frame[i]); + + return 0; } static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, @@ -246,6 +256,10 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, &hdmi->connector, mode); + if (rc) { + inno_hdmi_disable_frame(hdmi, INFOFRAME_AVI); + return rc; + } if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) frame.avi.colorspace = HDMI_COLORSPACE_YUV444; @@ -254,7 +268,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI); + return inno_hdmi_upload_frame(hdmi, &frame, INFOFRAME_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) From patchwork Sat Dec 16 16:26:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A644BC46CA2 for ; Sat, 16 Dec 2023 16:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eolrY6BHAoMXVEb9XCAKTrC/hvsSl9I13vh3ml4HqKQ=; b=sXWEfrFd44q5XP F4K+AS9cMjqjwbEjQAeon1kp0oB9hMPLVvJ6XnJ/+pHbQgSoFqdZKpfeQjRJEzn/B7X5ysb2vKdIm 21cEjRkX7djrZJuNGrC2jHi6/GrIqKeYeTaAWYQTgyrhYxztsddhqzLfc/R/z0BDP90O/zvVB21x2 QgauJcoj0fUfhM4pwoC6F75RDQI0LUBO8jm79lxI1RXcBMyUJ1yApTmX04ZRy5yTTartLVW3I5HxQ Yh5WAjXy7uYypY1/zVeD52RJ8MTwuhDaadC7dGAEZXJfwY4zlriHbw5PmupgL7PYkYyrgRSgdC8az q7Q2fh0I6jc4Eg6onYHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXX5-006LYd-26; Sat, 16 Dec 2023 16:28:55 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVW-006Jtj-1Q; Sat, 16 Dec 2023 16:27:20 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40c317723a8so19897155e9.3; Sat, 16 Dec 2023 08:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744036; x=1703348836; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mG1054x2y8+5VXwex9KrJL2EhA9y28dmW4DfXU50wTY=; b=RqoRVPu/Cu6qU4NaMR2gGIkJEAn0w+uMRLdaMFlltHkLCo2nOvR/Mn47DXPMwPhCMV HtLRKcyKtD+N/Qsd5NM+DKDCCmgw1yXEjaSSxV0cvx2P8PpqUZXxoVKF2kfEv/lnENgJ 7HzSSfuFiFwYC8d/npgWH2K5dZQ1DA7MEJVzvGxcsU+t9lCC2p9uMo73ADfF+k8bX8zW ZKTvMx7qDMdpBk/0Q54vaZnG7YK0+X7UNR6Jw0k6nXembisS/2YmMJoSlMP7eS7kLTI3 HZBIRkM8axuOe/9Rm79cabT5WWr0dEBhwG58snZtOfWkUtPqpij5Yj9kqyJd2Ek9N9GB Qeew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744036; x=1703348836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mG1054x2y8+5VXwex9KrJL2EhA9y28dmW4DfXU50wTY=; b=OMTEVd0mHzV95IxfHyH0W3pyjFAmgDkdswEgA1H7UHjkabOsKek8e/8tSHtDkBwa4E YfLILhLEpd3y3WKESGerLUzGv92urU9UjpoXJOVhu9p/bqCtwkQ7W18VQ+3NcgX3KEaX VDXiOBSooa/Mvsdk1faDdsa4+nk6bjXNZyDNEryxwIlanHXGoe6mc6KVrSSyYtByTqfT RMMAW1v+eJB++rdHZ3kG79gO3kYhzUsqZs64aihtzezGHEGj85zBP//ARQ8JjnU8vx2E lK6xGaCDxRrTtib1EFoI4uBnMcscgUEt0BX+ZZowsRodAs+FjJOkU1tOClOCoOLztSjg KUqg== X-Gm-Message-State: AOJu0YxGvARNxaR2T+VnhpUia8OD2mCXInzdTGSIMcCko54VM6nTI+21 xMcI5ZZs4vaFCiPYqXIY5A== X-Google-Smtp-Source: AGHT+IF5X6IwmDt2ZPPo2v31K2XP7aYkHF2OwxSE29V+DEh/kHK4gFeglJFBDfi5S8oMxOTw9YPbPA== X-Received: by 2002:a05:600c:3596:b0:40c:ab87:9d9c with SMTP id p22-20020a05600c359600b0040cab879d9cmr547390wmq.53.1702744036134; Sat, 16 Dec 2023 08:27:16 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:15 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 14/27] drm/rockchip: inno_hdmi: Switch to infoframe type Date: Sat, 16 Dec 2023 17:26:25 +0100 Message-ID: <20231216162639.125215-15-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082718_488107_2BCDCAEA X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The inno_hdmi driver relies on its own internal infoframe type matching the hardware. This works fine, but in order to make further reworks easier, let's switch to the HDMI spec definition of those types. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6354949bfd8e..b6b34f4b8cda 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -207,33 +207,34 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, u32 frame_index) +static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, + enum hdmi_infoframe_type type) { struct drm_connector *connector = &hdmi->connector; - if (frame_index != INFOFRAME_AVI) { + if (type != HDMI_INFOFRAME_TYPE_AVI) { drm_err(connector->dev, - "Unsupported infoframe type: %u\n", frame_index); + "Unsupported infoframe type: %u\n", type); return; } - hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); + hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, INFOFRAME_AVI); } static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, - union hdmi_infoframe *frame, u32 frame_index) + union hdmi_infoframe *frame, enum hdmi_infoframe_type type) { struct drm_connector *connector = &hdmi->connector; u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; ssize_t rc, i; - if (frame_index != INFOFRAME_AVI) { + if (type != HDMI_INFOFRAME_TYPE_AVI) { drm_err(connector->dev, - "Unsupported infoframe type: %u\n", frame_index); + "Unsupported infoframe type: %u\n", type); return 0; } - inno_hdmi_disable_frame(hdmi, frame_index); + inno_hdmi_disable_frame(hdmi, type); rc = hdmi_infoframe_pack(frame, packed_frame, sizeof(packed_frame)); @@ -257,7 +258,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, &hdmi->connector, mode); if (rc) { - inno_hdmi_disable_frame(hdmi, INFOFRAME_AVI); + inno_hdmi_disable_frame(hdmi, HDMI_INFOFRAME_TYPE_AVI); return rc; } @@ -268,7 +269,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, &frame, INFOFRAME_AVI); + return inno_hdmi_upload_frame(hdmi, &frame, HDMI_INFOFRAME_TYPE_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) From patchwork Sat Dec 16 16:26:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD119C46CCD for ; Sat, 16 Dec 2023 16:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A1Lqr4BK9G8DfkCoj1ubAXbUqqvW87vSM5kGr0R9kHk=; b=Afys87KaQLo4kF HAOqTQCZm/GQ3uxHvauIxuYHmUJnyLIXBIAi+wI/ECSu+bXtZgEo6uTWOfrlpBlxQ+D1OAXB5HmQM 9DzB6rbSVpeYYaSZEKHZu6OQ74SHZq01tZ7mqbkXy5eaR+0m7CbiSvPqA2TX94bgYEsM48FR97anR X8l4vhhgVULbWm8Hj3rmoZh199U5lMt6TpgEYD4eZz1JMye93A4V6M8nYOmyPJtftGOpsWCaTp2S8 4/DORDORxlLP8myIwgImBM13tuNf5T9BrUc7C1PPS2TE5DQ1lhl9GvNldXa7N49WzBWb5XZEqg2pR yNlQ5rVJioxCB97Sp80Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXWb-006L5n-2z; Sat, 16 Dec 2023 16:28:26 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVY-006Jul-1w; Sat, 16 Dec 2023 16:27:22 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a1f8510883aso214228966b.3; Sat, 16 Dec 2023 08:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744037; x=1703348837; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=73XUcSiZm29Hst8BGY/CNDIJrl23XpjPpmNwnFVb4KY=; b=VM48+TUCDxwgtiLORsKbnkGrKAtYatWO96OYCXxE1Wrx162UZ4sG0FJW4ecpa5G/a3 ZJ1+vZRROm22ug3B2W6MbBht/7AdDKw1yN2O1pl0xtiskMeJTRr3N5VvMd+nchYt4UbB ZHCsnl1u5fxmG+035jxXsC7TnDpfCnGq73xLKGn0viauQ6iR/FPskwqxGOpoAqP96LaW sbaQzwTl9yrkxCuAtb3Ta50jSyPUjGno3UrJfjJCtXe/cfwZ3LsNDNcA4rHR1xkJxDJr wadCfR3EO82fWs5bOX1IsgEAs81eISqP8MtvjhFn5FrFJyxwLhZ94dRf3/q8eEFYf6LY u1VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744037; x=1703348837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=73XUcSiZm29Hst8BGY/CNDIJrl23XpjPpmNwnFVb4KY=; b=XgHLE17SIS8rmeKWGReXXmf03DQ5VUby4rDIovQLv6hGpJtTAnFZ1CcfG1gbD5iNGJ pn/+sbBcI9pu427RyXbOFGxC/Cpx7WOLJCkrSYPUPl2/93NbFPzF/q6uMS2h80YVeXTD 5JgnVaJul9rxKKAobX9RPTU16Eeq6yHd6gNjtMAMMNTnOAArCEY7uNSRrF+j3DJZbN3e ZnldxIIJtUUhlr6ip8H0gvr3yPK79ra6YRlm5L8N4hbjE+cuiGWMG8SZWfWw8j7G6ue/ UB6/3p8s2cJWUPmByrsoiLdDswf1zPfGRS90UmPpMh6B2BLKDsAtSl4cNoNANTZuFOK2 uMGA== X-Gm-Message-State: AOJu0YyDWTYRKH+2fCO9pUwJACUeOOvuTCvXqOFJgyjvUBkac1uyCMEc fnOov6QWc745ek+d91nMPUautTcpiw== X-Google-Smtp-Source: AGHT+IFqBPxW/2QVy0WrDKBDbe9uYBS+XAaayLmej63jccZiISHw1g3uoqKtiDcxw89fuZb28tBdPQ== X-Received: by 2002:a17:907:724d:b0:a1c:a39d:dcbd with SMTP id ds13-20020a170907724d00b00a1ca39ddcbdmr4339820ejc.232.1702744036964; Sat, 16 Dec 2023 08:27:16 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:16 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 15/27] drm/rockchip: inno_hdmi: Remove unused drm device pointer Date: Sat, 16 Dec 2023 17:26:26 +0100 Message-ID: <20231216162639.125215-16-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082720_671472_9AB93A87 X-CRM114-Status: GOOD ( 12.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Maxime Ripard The drm_dev field in the inno_hdmi struct stores a pointer to the DRM device but is never used anywhere in the driver. Let's remove it. Signed-off-by: Maxime Ripard Tested-by: Alex Bee --- changes in v2: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index b6b34f4b8cda..e37023d8fa39 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -44,7 +44,6 @@ struct inno_hdmi_i2c { struct inno_hdmi { struct device *dev; - struct drm_device *drm_dev; int irq; struct clk *pclk; @@ -760,7 +759,6 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, return -ENOMEM; hdmi->dev = dev; - hdmi->drm_dev = drm; hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) From patchwork Sat Dec 16 16:26:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0498DC46CA2 for ; Sat, 16 Dec 2023 16:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OZEHzvKKxO1MJk3yWhWckpN1WcByVlXAwNffWi8+AAE=; b=gp4aWYuU8nNUrS oBVJsjYLSGc7ELhfzFY7fbJnp75yZiuHPTvNDXfr/3u3UUq2IJt0ltD3DCtgmCwSSVBgZoaMOjvo8 0xY3maMVl+IUuWs+T3d01xTqS2VTVWMG1/bNzMtJLPZjrfsNQqdwGFey8Mm/JFHtZYFFmw8HmqfXJ WWPvLuxHmyFHlfOc8UF7y6m0VcUzBRMddERfso41HSwQql40IbWDo5AAqLwXptHalRg4Y7t1JjooD 07Oc+rIjRdejnsvhGhK+ALnZotkgXmD78zMS51rLdiwN4h+MQJA0n8kCo1Nc9c+cDR2A4gXAJAnMi yC6V3/VaIpKpCnSvI9oA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXWc-006L7V-2q; Sat, 16 Dec 2023 16:28:26 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVY-006Jva-2g; Sat, 16 Dec 2023 16:27:22 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a1ef2f5ed02so180415366b.1; Sat, 16 Dec 2023 08:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744038; x=1703348838; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XVVbI3UTdjEdNjMJt0TLf0s4Teux8aF6Z8rzwOg5CSc=; b=fEwKPXz+Sat0IDzyjkam3IrvFdVqw10KesI5nF4vsjDp6qDmGhNV1D+l2zzH5T3rKX +5Cw8Pcs6Rs9221zIlZkvWgRoaX7EL0mZ3L2AfBq/UAE8bhCh2gz/q0/jvT4/J1JHZuj avMb7PBpxv0uRUGUSYwttM+vtqaqwF/kygxnidfVH23FYqqb2WGRSL2H+BZE1F8RVtsW 9+LTW+noPhtJ/zDCehY05M4NpPAun18P0ABlmI269xcZz9HJV3DajD0EOxbZSDn0DwrC 148qJUVXePPQPMVP5vfwr2s6diAhPM2OqcuEwJxuDSR9y9wl5ybh1EOdx0Toldde5Gx6 wwzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744038; x=1703348838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XVVbI3UTdjEdNjMJt0TLf0s4Teux8aF6Z8rzwOg5CSc=; b=lv4ZBHW3IUR7AI7Heizq19RDCY5STbnVcZa+kclIv8yKNCVtKeD6Nw2v7hRR3fs8d4 zAAqWVDVhHBDFpC3wfBnuqjskoqR+NNKwbPXcx7QpZ/8mixFx54Aj6IFdsTZo3BsFXjG dEzcCHay8NNwJpS7ngoMxMpgs60sOaek8UIqjj6TfLySRTsj1kzgNggnZ9OwL0WRI/Qs z4ht6H6QLW/DNZCbGCwghhyNC5Bbd/2DHqT0Hsj1pfZZBlrXiKT3qruVOCKEAlIIDb7R vEGnfujSiCpJnk6mfgZikl0xqxVt+Y9taw4Q7AOUEUh6vzifAOGPbNfrOI7Ms1QX6Gfr lmCQ== X-Gm-Message-State: AOJu0YyghezlvA11STx/20CP1GD/ZqNyXW+/xCAqBAVQKZAX7VyIRXIL 3ZYx31LYsxkwwxdAvixVBQ== X-Google-Smtp-Source: AGHT+IHHs7PgwtHCDlp/FqUXAIhufy7iNz+SxosjtQiOzqhHkLXHcAd6A1Uk8Np38VLThP5p396hkg== X-Received: by 2002:a17:906:287:b0:a23:2ccc:8eb1 with SMTP id 7-20020a170906028700b00a232ccc8eb1mr368904ejf.134.1702744037655; Sat, 16 Dec 2023 08:27:17 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:17 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 16/27] drm/rockchip: inno_hdmi: Drop irq struct member Date: Sat, 16 Dec 2023 17:26:27 +0100 Message-ID: <20231216162639.125215-17-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082720_883159_E22AD3EC X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The struct member irq isn't used anywhere. Drop it. Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index e37023d8fa39..d9eb8cdc0148 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -45,7 +45,6 @@ struct inno_hdmi_i2c { struct inno_hdmi { struct device *dev; - int irq; struct clk *pclk; void __iomem *regs; From patchwork Sat Dec 16 16:26:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E775C46CCD for ; Sat, 16 Dec 2023 16:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A6w4jczOMu5IGu13/DoYx/xPXFrpIP4Em/GUerVdB0o=; b=B2pRc7gYwzwGn+ 6XJ/jdWAFvL5f70+QCRb1ka6NfoPIYVtlQq9cyyvJZZiPY5WpFUsrVtjeK/jWCbuAIn+buq4ttdLa +CoApw4ZuOGlDPSqMxPq6KUmQh35TEcjbOIKlk4vQTom8AsPvi10ytAhME+qSPLjVF8Mn+gy/qoD2 KpygL/NcghNoX/bsFm+FId4nUgMmgPttyGUJ3qE6v1vq800iywuNAbifYmchkpCt7VCPc0wBzeN9c 7NNK5iHMhRDoE+2fGle4E1DYSsUN44j6Q2LfHbohLRBIpCegiHuT4GSiGzMABXNspdnSRpuZA+doW dPf4MRhW7OMBz1tDcfOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXWU-006KyO-0L; Sat, 16 Dec 2023 16:28:18 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVX-006JwA-1y; Sat, 16 Dec 2023 16:27:20 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a1ca24776c3so523898666b.0; Sat, 16 Dec 2023 08:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744038; x=1703348838; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uYVqczyH7NXnPG1SGiVfMuDstNC9AVi+qa/g94ih5J4=; b=iK7mwAbQoFjYSxl8GWpa/xqeyJbvyNhTkIZexxE95zbc4ZHiowX//yF5j8rYVFWZOw T7fbH5ve4rlS8z53AWx8oJeCXct+lknWbG28RFQPwOcfSnDOoArLuG8YM4b7itW7Zs+s 7sTyf2QYPD0YbxQ58slj/3GzNxWH5OMOLhAmO/CZ69AIzen8d4s/XzWacbF+FnhjwLRG ZicrPt0DGfLjmLSFjAaFvTya6C9H/tKwq6wMGBMi3vg8MrBUlTaWxDtELYyAilk+fM/t hX1OPkXSKpjsd6HLyid/DC09rJBv0nHrvkyxgaKQzXTguZp/s3D55TvhqN47OLPjt9nl 2X4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744038; x=1703348838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uYVqczyH7NXnPG1SGiVfMuDstNC9AVi+qa/g94ih5J4=; b=NFwJ39/q+2oV2t2FlEuu0KJJOmowBQ6G5hKzgrnB6T01Nv2Bin2hlym22VCr/6Ouaa cMDjAECVVPWlcr+yu4i6/uPHrmn8rRMhfZCNjDNImDX12JHnjjk0XaZpEOgQw5PBu+HD tylJyDlQmAKu+xdAfiS5wKoNyYMG9GZ1WS4t3ro6CT1PuqayWcavTHlpmbjv1fetIPwf 1xWFxe3eLbbHtCBYTR5/vdW5tw/ATi7n7gcR/5/I/SeAGd6oFtN5q5+sdD96GHLF1afX 0TOrc3FVlyAOsJ0vdHX/aYtBek9loGxAAS5QqGUh/F3WsdqU9vEqz1xPBnKP5CAasLIa Hs9g== X-Gm-Message-State: AOJu0YxQGBtRNfBjkvD5Rnvoot9IKAs5xXoCcQ9e0ypi0jsfaBLdyPj2 URSJNxV6TGLyUJkPpFJaVw== X-Google-Smtp-Source: AGHT+IFQguCjqhAt5YMtNc7JRxmN3MqTnMpRgT1krDRhGkQTlTpXIYTPCKozsi5nGRJMmdtgCFPTcg== X-Received: by 2002:a17:907:12d6:b0:a23:3828:573c with SMTP id vp22-20020a17090712d600b00a233828573cmr157926ejb.3.1702744038296; Sat, 16 Dec 2023 08:27:18 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:18 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 17/27] drm/rockchip: inno_hdmi: Remove useless include Date: Sat, 16 Dec 2023 17:26:28 +0100 Message-ID: <20231216162639.125215-18-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082719_683367_34602CF5 X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The inclusion syscon.h isn't used anywhere. Remove it. Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index d9eb8cdc0148..62c7e2275246 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include From patchwork Sat Dec 16 16:26:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9AFEAC46CA2 for ; Sat, 16 Dec 2023 16:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=r3GKREWOptlaa4XI2YWxTQm3kvOR1T2dqSlLekNoDH8=; b=yYPEPQUPHluOVn 3QoU6ap2dD64oH7YecO/u0r+r1MBsO/VAPP5SYrb4no8Ume0IzK7G5XLhKmTw6ejpNlj2YjWVX6jc NfEP/b6VbkvRNUEewPQ+HBE5nfyR1cA+9R5s1cfgI9Y1b6sSlGwDnawei+x3ro9LhLUMlaU3ihayJ 9iQ0RnmztnU/Kf2fD0xpDv0jOujdN5osuesUtHJalBx8u93NYV6YMh/4jSyoet/OLMPrptPc/nYwR l7BihESkKd0ruoYFR6wZAJYeM3STPUERJjnYpq4lv9HGWN3+yEVdHryYz3eg+XyBaMPytZMW0wqOO 4yg6lR1opZv+x5sF6Gvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXXB-006LdC-1D; Sat, 16 Dec 2023 16:29:01 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVb-006Jwu-2U; Sat, 16 Dec 2023 16:27:25 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a2331e7058aso33486866b.2; Sat, 16 Dec 2023 08:27:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744039; x=1703348839; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R/eFbXWfaMM0I74IrKyTPfTKiYx+jg35hR0AyiA/w9A=; b=YY+agYe0JqVhkXKsbq4Q0uWH12Lj5IaKcL2aR7U3abHBkgKcpaSDeA0/PWqCA0pZH2 /Bn37pApO9SNKJrxYC3jb54t4KAYmtVjF5exn9CAq4T56cjjzHC2qDgjjb5v7luiJ2t/ J2XMpwPvf0gcmlxpZoW0ZoQFZxu7yje8fCGLewRaauMtymMl4SAbK8JSLmBH2Eakz5vN lvrcjywBbtZkKcOUwxbS6ZlCh4pOB/rRed/CUmzGiztQQ+31pa6uaI8TRvm1MIj8JAfT JyWMyHOQeu6/rxPxkyMyu1oDJwgYTQinCyk22QDY22lS0ZBPLMgBrQnI1pwysQlfEd4M +t3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744039; x=1703348839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R/eFbXWfaMM0I74IrKyTPfTKiYx+jg35hR0AyiA/w9A=; b=d0znh1JHdD/PRnAJtzCp0dxcyKbF/JmjEn77s4PhII69fIoOk1K6M7DRgemRF8xo67 KJkHu5V+C7aWUqgShuIzNunGJwtp1OFcY/oeRE9IPTo9o+IarrWxdmXeOdOJ54ZdSWg4 jlaKxe0AXEfzAuuCXbSoberhtIO54cH4qo6Wm828iImn8k+n5KaK7fp5mcASahUPuxIE jI4vOxMsSyWZkOS1L+UQK7fDuxL4D0ZtHrxyDyxD+CMPoVmgID5XT1IPu8x8u72H8M1i m4BrpOqIR6wjSrG0qIl6b8UvakrTLQ+Eqoqe743QaMqGCh7XWDUIkDK2jRUsMxxpq0db fL1A== X-Gm-Message-State: AOJu0YxPU4wvJqXw64DnInx5L+dhJXfMnowapBHi9lAb0zGz9/KmMa9G fQvJ/Eou27eLezgRNUgI1g== X-Google-Smtp-Source: AGHT+IFcXZmVFLxYHlvqMbP/xbdnhMTM7dR1bMRRMLYfTq4p6bSRSS6zHWkOWzhS8av038yeCD6ZRw== X-Received: by 2002:a17:907:cbc8:b0:a19:a1ba:bae1 with SMTP id vk8-20020a170907cbc800b00a19a1babae1mr4432738ejc.135.1702744039030; Sat, 16 Dec 2023 08:27:19 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:18 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 18/27] drm/rockchip: inno_hdmi: Subclass connector state Date: Sat, 16 Dec 2023 17:26:29 +0100 Message-ID: <20231216162639.125215-19-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082723_829720_3976B4F9 X-CRM114-Status: GOOD ( 17.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The data which is currently hold in hdmi_data should not be part of device itself but of the connector state. Introduce a connector state subclass and move the data from hdmi_data in there. Suggested-by: Maxime Ripard Signed-off-by: Alex Bee --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 67 +++++++++++++++++++++------- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 62c7e2275246..f9bfae1e97a2 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -26,11 +26,6 @@ #include "inno_hdmi.h" -struct hdmi_data_info { - unsigned int enc_out_format; - unsigned int colorimetry; -}; - struct inno_hdmi_i2c { struct i2c_adapter adap; @@ -54,8 +49,12 @@ struct inno_hdmi { struct i2c_adapter *ddc; unsigned int tmds_rate; +}; - struct hdmi_data_info hdmi_data; +struct inno_hdmi_connector_state { + struct drm_connector_state base; + unsigned int enc_out_format; + unsigned int colorimetry; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -70,6 +69,9 @@ static struct inno_hdmi *connector_to_inno_hdmi(struct drm_connector *connector) return container_of(connector, struct inno_hdmi, connector); } +#define to_inno_hdmi_conn_state(_state) \ + container_of_const(_state, struct inno_hdmi_connector_state, base) + enum { CSC_RGB_0_255_TO_ITU601_16_235_8BIT, CSC_RGB_0_255_TO_ITU709_16_235_8BIT, @@ -248,6 +250,10 @@ static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); union hdmi_infoframe frame; int rc; @@ -259,9 +265,9 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, return rc; } - if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) frame.avi.colorspace = HDMI_COLORSPACE_YUV444; - else if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV422) + else if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV422) frame.avi.colorspace = HDMI_COLORSPACE_YUV422; else frame.avi.colorspace = HDMI_COLORSPACE_RGB; @@ -271,7 +277,10 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) { - struct hdmi_data_info *data = &hdmi->hdmi_data; + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); int c0_c2_change = 0; int csc_enable = 0; int csc_mode = 0; @@ -289,7 +298,7 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) v_VIDEO_INPUT_CSP(0); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); - if (data->enc_out_format == HDMI_COLORSPACE_RGB) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_RGB) { value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); @@ -300,15 +309,15 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) return 0; } - if (data->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { + if (inno_conn_state->colorimetry == HDMI_COLORIMETRY_ITU_601) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; } } else { - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; @@ -386,16 +395,20 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, { struct drm_display_info *display = &hdmi->connector.display_info; u8 vic = drm_match_cea_mode(mode); + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); - hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; + inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; if (vic == 6 || vic == 7 || vic == 21 || vic == 22 || vic == 2 || vic == 3 || vic == 17 || vic == 18) - hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_601; else - hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; /* Mute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, @@ -522,12 +535,32 @@ static void inno_hdmi_connector_destroy(struct drm_connector *connector) drm_connector_cleanup(connector); } +static struct drm_connector_state * +inno_hdmi_connector_duplicate_state(struct drm_connector *connector) +{ + struct inno_hdmi_connector_state *inno_conn_state; + + if (WARN_ON(!connector->state)) + return NULL; + + inno_conn_state = kmemdup(to_inno_hdmi_conn_state(connector->state), + sizeof(*inno_conn_state), GFP_KERNEL); + + if (!inno_conn_state) + return NULL; + + __drm_atomic_helper_connector_duplicate_state(connector, + &inno_conn_state->base); + + return &inno_conn_state->base; +} + static const struct drm_connector_funcs inno_hdmi_connector_funcs = { .fill_modes = inno_hdmi_probe_single_connector_modes, .detect = inno_hdmi_connector_detect, .destroy = inno_hdmi_connector_destroy, .reset = drm_atomic_helper_connector_reset, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_duplicate_state = inno_hdmi_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; From patchwork Sat Dec 16 16:26:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A90CC46CA2 for ; Sat, 16 Dec 2023 16:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+mAewhcOZ/QbLoceG297bfco4fYVPxR6zeB/ug59t5I=; b=IN3B4dSMMWrvuT 7zLaV2SN9DzBHbYFB9VSEe4m4DY2bc7+f/vjhbkhoTZiNnRa6mSq+xU0NOYYDbeLXSKPBpstwqJ40 inQXvA1AC2S2qGorNM6ILDe6Ba5NMur/a54p8d51r4/LGcl3WiwKdPi5yIHggrAHao/uoj5ICqn/h uuh3WVblV1+ZTAS0Hec0SAFd5oekPeAvbNFVOWSFRVphnC6EsOcLmolKGSryUb6awnBit9lf4NLyJ YKVx5WeID8eplYv+/9L74krnOJbdKvb1KFxoaIp9Vl46wheNZ6rHC3eOfcZvbxAbVaWYWnV6oOzXK UcFp1n7n+GKerwJshZHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXWh-006LCH-2v; Sat, 16 Dec 2023 16:28:31 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVZ-006Jxk-07; Sat, 16 Dec 2023 16:27:22 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a22ed5f0440so204937266b.1; Sat, 16 Dec 2023 08:27:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744039; x=1703348839; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xquaKm3YPbbfHci/n27FNskS85Fe2FEHpYLHWs9wnrA=; b=PIUnFdpHgsm7H/3IHbHR83F16lsynnqHdAHBwb1lMvruddqyTg01KGX31fcy0J16AT B+a8AscEfIGBuendb1t33BGNCQraORtMTBqv1Gx9RbxdOP5trdROAcvZXAWlklqJZbGf mOHarELy0OA2p1U4P9Nvk8dPYw2zTOxWTOCSGhIMIuc55zX4yQymBzwP5JFcMo34QtFo WOMdKwCOr5nDvDJ/QswUsIfFFtgCuaOx4Nu5tvW6kO8sCrb8l+I8Gu4RjSPvgjtHf9DA pUu3x2N6bQlQO5ly1oki34rGph9rndFeZBq6HzuXTC1nZ0EQr3g/NhP++ewtbTXdA67D BGJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744039; x=1703348839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xquaKm3YPbbfHci/n27FNskS85Fe2FEHpYLHWs9wnrA=; b=RlC30ekjj7J7XUJN0JWGFUvzqlZazWYHEeaxLXqgDMLkx5iYYRjaI6/lCYA8K24/yp F5Lqkz6+RT8ZAfl6XYwgXAyI8kLi36TQoxsyEDsRNf8suBvN31NiwcBrodYruF/PPUQi /0i23yuTbIFVDanplchPlCidJBat8SU9BvruL4azma+JmYwq9HrvwQncXKb21txg2emJ +Ms6vioWYFkuIYy4RwNNPqru7Jm8z1q/wt+BIS7hz/FuW/O1j3n4p8BVXNUgZUPx86M3 ShGgTNsTIxYyU7NDMcEsLEuVLof7rmHsIO8/xxmEJcOu6TwPFfp6FYTQiWSVDVLrVnqH fbuw== X-Gm-Message-State: AOJu0YwOuhPim/U0SYOLL/EbTi7aLbrKuDygnCNz/3N5PmUHZFQxBq8g cOi6mgmwMw6bCouhXfuBiw== X-Google-Smtp-Source: AGHT+IFUzerbBkuL8ogyxF7tayR3DeWeoAa4xKPEYCPluQhDzstDriEv+K+qp24yTyj3tqDUtQcT3Q== X-Received: by 2002:a17:906:2c7:b0:a23:2aa7:d48b with SMTP id 7-20020a17090602c700b00a232aa7d48bmr212918ejk.14.1702744039643; Sat, 16 Dec 2023 08:27:19 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:19 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 19/27] drm/rockchip: inno_hdmi: Move tmds rate to connector state subclass Date: Sat, 16 Dec 2023 17:26:30 +0100 Message-ID: <20231216162639.125215-20-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082721_112413_8A1CDA54 X-CRM114-Status: GOOD ( 19.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Similar to the othter members of inno_hdmi_connector_state the tmds_rate is not a property of the device, but of the connector state. Move it to inno_hdmi_connector_state and make it a long to comply with the clock framework. To get arround the issue of not having the connector state when inno_hdmi_i2c_init is called in the bind path, getting the tmds rate is wrapped in function which returns the fallback rate if the connector doesn't have a state yet. Signed-off-by: Alex Bee --- changes in v2: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 36 +++++++++++++++++++--------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index f9bfae1e97a2..6799d24501b8 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -47,14 +47,13 @@ struct inno_hdmi { struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; - - unsigned int tmds_rate; }; struct inno_hdmi_connector_state { struct drm_connector_state base; unsigned int enc_out_format; unsigned int colorimetry; + unsigned long tmds_rate; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -133,11 +132,33 @@ static inline void hdmi_modb(struct inno_hdmi *hdmi, u16 offset, hdmi_writeb(hdmi, offset, temp); } +static unsigned long inno_hdmi_tmds_rate(struct inno_hdmi *hdmi) +{ + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state; + + if (conn_state) { + inno_conn_state = to_inno_hdmi_conn_state(conn_state); + return inno_conn_state->tmds_rate; + } + + /* + * When IP controller haven't configured to an accurate video + * timing, then the TMDS clock source would be switched to + * PCLK_HDMI, so we need to init the TMDS rate to PCLK rate, + * and reconfigure the DDC clock. + */ + + return clk_get_rate(hdmi->pclk); +} + static void inno_hdmi_i2c_init(struct inno_hdmi *hdmi) { int ddc_bus_freq; + unsigned long tmds_rate = inno_hdmi_tmds_rate(hdmi); - ddc_bus_freq = (hdmi->tmds_rate >> 2) / HDMI_SCL_RATE; + ddc_bus_freq = (tmds_rate >> 2) / HDMI_SCL_RATE; hdmi_writeb(hdmi, DDC_BUS_FREQ_L, ddc_bus_freq & 0xFF); hdmi_writeb(hdmi, DDC_BUS_FREQ_H, (ddc_bus_freq >> 8) & 0xFF); @@ -431,7 +452,7 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, * DCLK_LCDC, so we need to init the TMDS rate to mode pixel * clock rate, and reconfigure the DDC clock. */ - hdmi->tmds_rate = mode->clock * 1000; + inno_conn_state->tmds_rate = mode->clock * 1000; inno_hdmi_i2c_init(hdmi); /* Unmute video and audio output */ @@ -823,13 +844,6 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, goto err_disable_clk; } - /* - * When IP controller haven't configured to an accurate video - * timing, then the TMDS clock source would be switched to - * PCLK_HDMI, so we need to init the TMDS rate to PCLK rate, - * and reconfigure the DDC clock. - */ - hdmi->tmds_rate = clk_get_rate(hdmi->pclk); inno_hdmi_i2c_init(hdmi); ret = inno_hdmi_register(drm, hdmi); From patchwork Sat Dec 16 16:26:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A37EC46CA2 for ; Sat, 16 Dec 2023 16:29:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UPG73FLGTRF2jwhPn+a3Q5zqhN3bqwkMcVZxQmLZWyg=; b=a6dKfoj0yLqeaj c9xBs9r9Zk7xBD30/mTG9OvZpdUbXX0BCb0ejKrCR4P2RD3Rqlp4xCCmQx0qw28sVedwIrQZ2tIBx yo4HtSbJchSb64ZXqLj+1ICxjMbCxylHxBALPZqA0P11JHxLYaAiPQBWiM56+McDCxwvN1Y+G2pvD J43IvKMPYgAqr172fnOiYumECZ0Ou/rWjI/j0jHpJhcCBJ01OQNptFBphjD4wfIaacP6L3kqk1Sas dXe+ybmR/mCO6I10T8joI6ZmNQCHvdFg5KxtPZDv4+DgpYiYjMjW6DPqZ+SXJzidlpJbkYEMxGaZu ECzfnoq7FatZtLI1eK1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXWm-006LHP-02; Sat, 16 Dec 2023 16:28:36 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVZ-006JyR-1q; Sat, 16 Dec 2023 16:27:23 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a2331e7058aso33488666b.2; Sat, 16 Dec 2023 08:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744040; x=1703348840; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eeP9TO9V+vEKe4+An2VukwFpdenqcBYIdbA3kdqXnt8=; b=H8Ej5Qj+Iu1zyzz4J7+R52od4hRwvq1yz8005v5vTww8Q6oivyCLPAQYxXsbTs6PEs 8Rga3QRDorKg/M7z2nXYyX9tQGBgAg7Z2umT/vwsTZ34xz6BJxWVN6tCkYkSJItEC1cN u2WzCP/K0yuVqX6mQPesFi8lbyngjFt5PIIT8St2uDUJYCIzNVqj/J0xXvmhEW1ZPk5A dDbGN7evOVgxR0dLlfD0AtvV7txNt+c9VmH6jiTQLe9iDG0cxjUohvvGCXzgs5oTo2ew 0H8p5NFuAFTyyH8d7K9N17xuSB/IETKHQa66fGmayN1fZ6RI6Go1lZX5ymMOGn2S6GqW 0vRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744040; x=1703348840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eeP9TO9V+vEKe4+An2VukwFpdenqcBYIdbA3kdqXnt8=; b=dsxxaRHgV37enwoVQC926eVjfHrSa8bzF5URXDist7nlcPbDN8pjUNWjyiIqHHk1cb 4MRbrVbPNN4XGF90tiar7OzS27ysGgLQFlsy7ZIIAwM7xcv1RMyY2hlc7bE6LaEBZgOu dQXjxG8teYkTv7+phRHSfOzxeq9TaUW6CEMbY1BpA+dQ4h9+BqKNKoZdljq79NDycy26 JowzV6dele0DOaZRALXJcFtUeB+/orGrwX70g0miabJc31SM+DfDs5VCBJNC1V80lutY cOjZa8eVRa4ZyqJyGTgceKusTKDBxgfiC9ReUxvWUpHB9xTCR1aHT+v7fZR4yq5ghwWw a7yw== X-Gm-Message-State: AOJu0Yy/jj01gmNR6eD+PyehhhGwIBiMSx3x/wc/5JZ2d/nHW9CUvxJk QjPhQnglWN2BtNIXpZgTcw== X-Google-Smtp-Source: AGHT+IEy38X0xbtf3xBfqjoxplLyZkqC6IMsseY2tnTm+ch8eIhob3KOfE1WsE0GkDI5Mc3Qu6NtmA== X-Received: by 2002:a17:906:24e:b0:a1d:b7b9:3274 with SMTP id 14-20020a170906024e00b00a1db7b93274mr3725525ejl.169.1702744040255; Sat, 16 Dec 2023 08:27:20 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:20 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 20/27] drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range Date: Sat, 16 Dec 2023 17:26:31 +0100 Message-ID: <20231216162639.125215-21-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082721_645683_3B13112F X-CRM114-Status: GOOD ( 14.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The display controller will always give full range RGB regardless of the mode set, but HDMI requires certain modes to be transmitted in limited range RGB. This is especially required for HDMI sinks which do not support non-standard quantization ranges. This enables color space conversion for those modes and sets the quantization range accordingly in the AVI infoframe. Signed-off-by: Alex Bee --- changes in v2: - made rgb_limited_range part of the new custom connector state drivers/gpu/drm/rockchip/inno_hdmi.c | 60 +++++++++++++++++++--------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6799d24501b8..9f27a5faf12d 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -54,6 +54,7 @@ struct inno_hdmi_connector_state { unsigned int enc_out_format; unsigned int colorimetry; unsigned long tmds_rate; + bool rgb_limited_range; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -293,6 +294,18 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_RGB) { + drm_hdmi_avi_infoframe_quant_range(&frame.avi, + connector, mode, + inno_conn_state->rgb_limited_range ? + HDMI_QUANTIZATION_RANGE_LIMITED : + HDMI_QUANTIZATION_RANGE_FULL); + } else { + frame.avi.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT; + frame.avi.ycc_quantization_range = + HDMI_YCC_QUANTIZATION_RANGE_LIMITED; + } + return inno_hdmi_upload_frame(hdmi, &frame, HDMI_INFOFRAME_TYPE_AVI); } @@ -320,29 +333,37 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_RGB) { - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); - - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, - m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, - v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | - v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); - return 0; - } - - if (inno_conn_state->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { - csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; + if (inno_conn_state->rgb_limited_range) { + csc_mode = CSC_RGB_0_255_TO_RGB_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; + + } else { + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); + hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); + + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, + m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, + v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | + v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); + return 0; } } else { - if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { - csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; - auto_csc = AUTO_CSC_DISABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_ENABLE; + if (inno_conn_state->colorimetry == HDMI_COLORIMETRY_ITU_601) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { + csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; + auto_csc = AUTO_CSC_DISABLE; + c0_c2_change = C0_C2_CHANGE_DISABLE; + csc_enable = v_CSC_ENABLE; + } + } else { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { + csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; + auto_csc = AUTO_CSC_DISABLE; + c0_c2_change = C0_C2_CHANGE_DISABLE; + csc_enable = v_CSC_ENABLE; + } } } @@ -431,6 +452,9 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, else inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; + inno_conn_state->rgb_limited_range = + drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED; + /* Mute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, v_AUDIO_MUTE(1) | v_VIDEO_MUTE(1)); From patchwork Sat Dec 16 16:26:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A14E2C46CD4 for ; Sat, 16 Dec 2023 16:29:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FOyPzKqqrNjLqvrv/HDuM3G1DEZqF3bgYf1owXXnbeo=; b=gptc00tgFhXs3v d+DC6+KlWDyUdtDxVcQ6gqOr7AmOc1I2jL6GQjIlaMj9YF6Yr0bncTfHHLTv3p9ou45iMK8rqqpNX zOYRJTm+moCMqzHzHZCXJ8cNpHO4GHfY0XdnkZQUqrduFUJGcFsFUMD6XTgcd78ZAgaAybltTCt3O 1KkbqSOY30rfgL2oxgR4TDOQaJe6ptrXbgUGlm9NSSPSDOE0KUXkxeFoCY7Myt6GNP4y7/CrTjXCQ g2IuzVY2E4KzlWkTW00HbrH9K4nVXdKRCNetb3VuUNjj7OYLefxwQ3rTKTb3jFirW8VoJPezwXPh0 eko1VGuuBhYSTatinDhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXXQ-006LpS-1C; Sat, 16 Dec 2023 16:29:16 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVd-006JzR-0C; Sat, 16 Dec 2023 16:27:27 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40b5155e154so20432095e9.3; Sat, 16 Dec 2023 08:27:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744041; x=1703348841; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PQiEPu38i3aFFXbXmZDuj9Z5I3dO6tjlHXJ/GQ5qAv8=; b=Fc7wpdhsh7EyZL547haqIWhtX+bh/QcUVTasat+/Vju4dxI7KIVNEyvusv8giKB2Ed kbT+1FIw+O8fiQLg20tJRC3a5yTKTzcaagJL7wtA45svMQbMabJLdOTfA4+15VoILbnr S7wZRpaWt7dGSNG80P6Np86dnxHbmKRpqwdUZZue0dJoUP7S3DArSdNjvlAnDxPXBMKc p6yK0WukKmmbsN/5XHxMC6gTBysGG1tiEHcUUFRV82tZg15nhSCI/T4x5NbT+m12JJ5W mLtAIFJu9tsMQt90PCZZS1RL5ocTRgjFrlvsVlYtnZNIlNYb8NtSVe1OZ1WqYZJxJVZC I+7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744041; x=1703348841; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PQiEPu38i3aFFXbXmZDuj9Z5I3dO6tjlHXJ/GQ5qAv8=; b=kZFCFgAHIQr6vMhPXpsgWNvPJc/HConkFU1KMJHoPZFGNAuA18kJRvELc9ovkOHfQI It+mCspnPPYpiWuVAavKEZ/mUJvdW82hoRwAaClrovZjP1PeCBWM/Jr+O6ss/dczKuuc HLuejnhKvUF2YqfYYFtQSJ8bP2cFnmIPLM/sukg+RBNjUhy22/qJ5ex8g0HeXxM7ID4H Oolis2mxfREdP6jhuFab1/1p0Nbzj5yOSmTW5TwJVoiosKoSdh6Fqg2wzoIaw4GqUsMk HKTwuhA6nxrlTZOaGEa2wtM546tlGdLV3kSOsC9dF9k1n0hJugqzMkuEIc6ZpSEDnaUl DDdg== X-Gm-Message-State: AOJu0YwnCMJw+iah0mNrq4KCq33SqrGKXNVerbEmyZ7qZXJCZLUytQYo scILjFB58jh1DqAVEhlnXA== X-Google-Smtp-Source: AGHT+IGQCWmeafdHQEypddGMm/p+SelPFJgQl85DV9NvkhBX+hUyEJqHE51Oq1RSeni9fFl9ZjpDOw== X-Received: by 2002:a05:600c:524e:b0:40c:18e9:d610 with SMTP id fc14-20020a05600c524e00b0040c18e9d610mr6278994wmb.71.1702744040982; Sat, 16 Dec 2023 08:27:20 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:20 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 21/27] drm/rockchip: inno_hdmi: Add variant support Date: Sat, 16 Dec 2023 17:26:32 +0100 Message-ID: <20231216162639.125215-22-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082725_109089_6B3DAC2F X-CRM114-Status: GOOD ( 21.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In preparation to support RK3128's integration of the controller, this patch adds a simple variant implementation. They mainly differ in the phy configuration required, so those are part of the match_data. The values have been taken from downstream. The pixelclocks in there are meant to be max-inclusive. Signed-off-by: Alex Bee --- changes in v2: - no changes drivers/gpu/drm/rockchip/inno_hdmi.c | 69 +++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 9f27a5faf12d..579baba6a61b 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -26,6 +26,17 @@ #include "inno_hdmi.h" +struct inno_hdmi_phy_config { + unsigned long pixelclock; + u8 pre_emphasis; + u8 voltage_level_control; +}; + +struct inno_hdmi_variant { + struct inno_hdmi_phy_config *phy_configs; + struct inno_hdmi_phy_config *default_phy_config; +}; + struct inno_hdmi_i2c { struct i2c_adapter adap; @@ -47,6 +58,8 @@ struct inno_hdmi { struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; + + const struct inno_hdmi_variant *variant; }; struct inno_hdmi_connector_state { @@ -114,6 +127,30 @@ static const char coeff_csc[][24] = { }, }; +static struct inno_hdmi_phy_config rk3036_hdmi_phy_configs[] = { + { 74250000, 0x3f, 0xbb }, + { 165000000, 0x6f, 0xbb }, + { ~0UL, 0x00, 0x00 } +}; + +static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi, + unsigned long pixelclk) +{ + const struct inno_hdmi_phy_config *phy_configs = + hdmi->variant->phy_configs; + int i; + + for (i = 0; phy_configs[i].pixelclock != ~0UL; i++) { + if (pixelclk <= phy_configs[i].pixelclock) + return i; + } + + DRM_DEV_DEBUG(hdmi->dev, "No phy configuration for pixelclock %lu\n", + pixelclk); + + return -EINVAL; +} + static inline u8 hdmi_readb(struct inno_hdmi *hdmi, u16 offset) { return readl_relaxed(hdmi->regs + (offset) * 0x04); @@ -179,12 +216,26 @@ static void inno_hdmi_sys_power(struct inno_hdmi *hdmi, bool enable) static void inno_hdmi_set_pwr_mode(struct inno_hdmi *hdmi, int mode) { + struct inno_hdmi_phy_config *phy_config; + int ret; + unsigned long tmds_rate; + switch (mode) { case NORMAL: inno_hdmi_sys_power(hdmi, false); + tmds_rate = inno_hdmi_tmds_rate(hdmi); + ret = inno_hdmi_find_phy_config(hdmi, tmds_rate); + if (ret < 0) { + phy_config = hdmi->variant->default_phy_config; + DRM_DEV_ERROR(hdmi->dev, + "Using default phy configuration for TMDS rate %lu", + tmds_rate); + } else { + phy_config = &hdmi->variant->phy_configs[ret]; + } - hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x6f); - hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0xbb); + hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, phy_config->pre_emphasis); + hdmi_writeb(hdmi, HDMI_PHY_DRIVER, phy_config->voltage_level_control); hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x14); @@ -827,6 +878,8 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, struct platform_device *pdev = to_platform_device(dev); struct drm_device *drm = data; struct inno_hdmi *hdmi; + const struct inno_hdmi_variant *variant; + int irq; int ret; @@ -836,6 +889,12 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, hdmi->dev = dev; + variant = of_device_get_match_data(hdmi->dev); + if (!variant) + return -EINVAL; + + hdmi->variant = variant; + hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) return PTR_ERR(hdmi->regs); @@ -923,8 +982,14 @@ static void inno_hdmi_remove(struct platform_device *pdev) component_del(&pdev->dev, &inno_hdmi_ops); } +static const struct inno_hdmi_variant rk3036_inno_hdmi_variant = { + .phy_configs = rk3036_hdmi_phy_configs, + .default_phy_config = &rk3036_hdmi_phy_configs[1], +}; + static const struct of_device_id inno_hdmi_dt_ids[] = { { .compatible = "rockchip,rk3036-inno-hdmi", + .data = &rk3036_inno_hdmi_variant, }, {}, }; From patchwork Sat Dec 16 16:26:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495686 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9EDFEC46CD3 for ; Sat, 16 Dec 2023 16:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5IEpRzPrx84bxvUXv97+dTF/j1yn0DzXK3+9XaRvotA=; b=3O5ipOffgwHv00 iiRVZXZLCvgx/u4fRFF1uZvq4LwALH6lZXGzGWJV7bLsqAxy6fA6zH+Y0s4bo/t2s+r5POsoeWFDr CN84D5rUZtfvDJfX6coPEgeNibMa1vKoKQc4tzJe0Pd/GcqT0AzHFLO+nIeipjh9FV5ZJYuoJ4DBD dFEoJdNXFKIk/7wTxD7ey8hQGCOeu6wF3v/rvz8zeAZIfvLNV8Ru3v2fYiPxn5cKJaDJO+MI5WepP aAvylAyAuzCe8dAs/XDlQS7iwRW6LksM7w68NhIilgC1rsyjm8MeXjYt8XfzMWxIt53d+ajCAhhVt KtU3ePlNKGofJPy8Q14A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXXW-006Luy-0W; Sat, 16 Dec 2023 16:29:22 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVc-006K0A-2F; Sat, 16 Dec 2023 16:27:27 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40d12b56a38so3244065e9.2; Sat, 16 Dec 2023 08:27:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744041; x=1703348841; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BFps/f+CAs2Nk6z2SsJd+Q0Norbs9x1sCDtq35o8jMc=; b=OaMhc6hOcWyI3EcwC07sfQHmS61QhAzmhYKWOk0UYaRQQz9qQ8GCKaVsUPsG1iYeIN /A63PGEhDuWq9PEhsLSaXf9UTKn5mg/piy4kUpljirv0whM8CA/viG2HzeIIbideRrNn dAaBVgfoJzvAt3IvPvtaYIEqFFQvtwzenn8RUyMwt2xeJ32FEJ9+F7J9zSPyqVrfBRSI BzzqrSgwvSPJuIVBeGuMiiU1/+cRF3smUBtMGpLlESBaRuBkOn5TTrxSlITvWyY26TKD qUEY/FmRFGIdLlmm8GJyuAqc+5klREWDrAFKyvSEHzal8LPStXMcwQs/6WtrbwKDENNr /E9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744041; x=1703348841; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BFps/f+CAs2Nk6z2SsJd+Q0Norbs9x1sCDtq35o8jMc=; b=jMqQZQvr5PUFdfwnQb/kS7j1Ys/izWOXl5jQ/3ziNMhSLAmXrF7/vhQCR+X7ZvM3Fc 2z/7+RTYSjbklaiVyAVyHDUbpMMU0DTS5a0Egx3jzgPYLA+sxU8V1F4l3UmM81CkcFGV nwsna6opMPuLsltdw1ymWiS1LktxN6wm+AzaRgjPWUco4BgL4GNYUdV9XVHCyk0Q64WH IMiYP2kDCSnZe78Ojva7QbHBgSN0l2A0YCcsk4MTtnJejJby0E9l0q8d/WH36795slZB IseJ9UVSFZBopJjvkfynHRUnCn/2CF0T8sprPGDFYTag7xs5FipqpWi52Ae+lmavheiu ppfg== X-Gm-Message-State: AOJu0YxNF6Tgp2LBuKeOwQhf20c1rbuSQLCZ/j5+V7ZFsVK49calBOEk g2S9D0XVnxUknfFfiTloPg== X-Google-Smtp-Source: AGHT+IGBF4gaRoU/EL0I7tI8RwIyRSfbuxuXO3TR0CaxGjhOjNNy6BcBWFK0VOilT5H96GBjjIme0g== X-Received: by 2002:a05:600c:3d10:b0:40c:dda4:3582 with SMTP id bh16-20020a05600c3d1000b0040cdda43582mr264470wmb.314.1702744041618; Sat, 16 Dec 2023 08:27:21 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:21 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 22/27] drm/rockchip: inno_hdmi: Add RK3128 support Date: Sat, 16 Dec 2023 17:26:33 +0100 Message-ID: <20231216162639.125215-23-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082724_745948_D975F8DA X-CRM114-Status: GOOD ( 20.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This variant requires the phy reference clock to be enabled before the DDC block can work and the (initial) DDC bus frequency is calculated based on the rate of this clock. Besides the only difference is phy configuration required to make the driver working for this variant as well. Signed-off-by: Alex Bee --- changes in v2: - no changes drivers/gpu/drm/rockchip/inno_hdmi.c | 46 +++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 579baba6a61b..792e5fad09bf 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -51,6 +51,7 @@ struct inno_hdmi { struct device *dev; struct clk *pclk; + struct clk *refclk; void __iomem *regs; struct drm_connector connector; @@ -133,6 +134,12 @@ static struct inno_hdmi_phy_config rk3036_hdmi_phy_configs[] = { { ~0UL, 0x00, 0x00 } }; +static struct inno_hdmi_phy_config rk3128_hdmi_phy_configs[] = { + { 74250000, 0x3f, 0xaa }, + { 165000000, 0x5f, 0xaa }, + { ~0UL, 0x00, 0x00 } +}; + static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi, unsigned long pixelclk) { @@ -182,13 +189,17 @@ static unsigned long inno_hdmi_tmds_rate(struct inno_hdmi *hdmi) } /* - * When IP controller haven't configured to an accurate video - * timing, then the TMDS clock source would be switched to - * PCLK_HDMI, so we need to init the TMDS rate to PCLK rate, - * and reconfigure the DDC clock. + * When IP controller isn't configured to an accurate + * video timing and there is no reference clock available, + * then the TMDS clock source would be switched to PCLK_HDMI, + * so we need to init the TMDS rate to PCLK rate, and + * reconfigure the DDC clock. */ - return clk_get_rate(hdmi->pclk); + if (hdmi->refclk) + return clk_get_rate(hdmi->refclk); + else + return clk_get_rate(hdmi->pclk); } static void inno_hdmi_i2c_init(struct inno_hdmi *hdmi) @@ -912,6 +923,20 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, return ret; } + hdmi->refclk = devm_clk_get_optional(hdmi->dev, "ref"); + if (IS_ERR(hdmi->refclk)) { + DRM_DEV_ERROR(hdmi->dev, "Unable to get HDMI reference clock\n"); + ret = PTR_ERR(hdmi->refclk); + goto err_disable_pclk; + } + + ret = clk_prepare_enable(hdmi->refclk); + if (ret) { + DRM_DEV_ERROR(hdmi->dev, + "Cannot enable HDMI reference clock: %d\n", ret); + goto err_disable_pclk; + } + irq = platform_get_irq(pdev, 0); if (irq < 0) { ret = irq; @@ -951,6 +976,8 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, err_put_adapter: i2c_put_adapter(hdmi->ddc); err_disable_clk: + clk_disable_unprepare(hdmi->refclk); +err_disable_pclk: clk_disable_unprepare(hdmi->pclk); return ret; } @@ -964,6 +991,7 @@ static void inno_hdmi_unbind(struct device *dev, struct device *master, hdmi->encoder.encoder.funcs->destroy(&hdmi->encoder.encoder); i2c_put_adapter(hdmi->ddc); + clk_disable_unprepare(hdmi->refclk); clk_disable_unprepare(hdmi->pclk); } @@ -987,10 +1015,18 @@ static const struct inno_hdmi_variant rk3036_inno_hdmi_variant = { .default_phy_config = &rk3036_hdmi_phy_configs[1], }; +static const struct inno_hdmi_variant rk3128_inno_hdmi_variant = { + .phy_configs = rk3128_hdmi_phy_configs, + .default_phy_config = &rk3128_hdmi_phy_configs[1], +}; + static const struct of_device_id inno_hdmi_dt_ids[] = { { .compatible = "rockchip,rk3036-inno-hdmi", .data = &rk3036_inno_hdmi_variant, }, + { .compatible = "rockchip,rk3128-inno-hdmi", + .data = &rk3128_inno_hdmi_variant, + }, {}, }; MODULE_DEVICE_TABLE(of, inno_hdmi_dt_ids); From patchwork Sat Dec 16 16:26:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F058BC46CCD for ; Sat, 16 Dec 2023 16:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Omr5yEGir3aWd7p6AAJBpb3/uJ5pU7SXurjOU52FpK4=; b=rAnKMh6vcL0HwE 8TWYdg3oxBjVvVXGXVN7rh7cDyptwyreb3OgIzDAcysKBdjDJ7OB41HIWZZpG6x13XQU0vw6vL5yG UjW9gP+E/Po0OHWs/gzaLjcnw5LlwXOv8l7SnuyZJTN5c3dFM882sSeWOV7JQbhCpGk9ninN7eKi/ 2ncEHNbl3AmX3SGYYGLp5/5DUs6Bh3sEENMBzcV+FliScQBb4YL991HYAXwUFZS5z2t8w64LDpQuL m4XtR1iTPY8Kaw0622qBGjtyUecC+m9nm5K3lfeZc5u2Q/mVwhEE5cmrj0AW5x5hlfEfTMIkDm4go DsAii6bxStBlnFGUmeJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXXk-006M73-2e; Sat, 16 Dec 2023 16:29:36 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVf-006K0p-0L; Sat, 16 Dec 2023 16:27:30 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50be24167efso1826363e87.3; Sat, 16 Dec 2023 08:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744042; x=1703348842; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E8OEv0l6dNVJqHF1ONziiRRjeg+pBs39OamlQeNnAzk=; b=ah+NS0akpDQivM/VNoB0ewnfKlMZ2ncwRzYas/4OMtLdi7bIAP6UBPn/k6sjwHGaqM sXnEn4mWrYDZmqG6OHnWbtA+wB/2GDlDWQilApZPfurffYl6trKREXVsjBXhqvkeOFWc 2fgmJWekD95wgNrD3IowUPbLoXdRIbh3L91NJuWDYh5Gv8+oN0W5RS8N01fz7O8Un5Fl TPVIIN3HflE7jVMZFJzO8hv/M6kijJeM7IrYEpH10o+VWAMLpA14+GL8fKjaTM6ZxIoJ lwqanbUf/ZTjk4cyW6LoeWeHddzPucFXEsnAiMuEacKeMckvYUUsrL1evPwM7/x91fDc Q0zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744042; x=1703348842; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E8OEv0l6dNVJqHF1ONziiRRjeg+pBs39OamlQeNnAzk=; b=ojPYJtMq1TzyrDZnwry1LEJ0uPV/SiGrMM9EYwET/9tRSdNXa9q2N+NJ2FpL0tsPTX 1ZxLqXeJoXvGggb/66CYwTNEJARG2J8gIuh24hQE5I/MSNmvU/23c7wBIAkKsbaXbBZf HCZ/E21pmHcUR4lX5sx0BGQ7IJdVqFwnsHpnHw3HeG6UCUglgy+4J+pVggFG7P0fUs/C knzw7QmmAAU0SIKnGMKkLYH2g1sLcws+bYcFwuFhgat1tKlY865KHG5rRANSMsPVSt5M XS2UdYuIVU8WudaXyeNePgkrwztznTJbYzNI70MHQHYCXRly9PvpHxP0HarzW25e0/H1 2yng== X-Gm-Message-State: AOJu0YwkyFLu3IL/0gWqutiZ0+SHAt4Gz7GLhEVdxkZM5sThGMXmqV8V BAeQmsw+RNJO4hE4E9QNGA== X-Google-Smtp-Source: AGHT+IFEHvRQbTKnZvTIoMFV/ssuD2uNon+ejyGS9XyVQHiyLyghPQz2Vh5IUyEFL7l0qFs8Pgr0pg== X-Received: by 2002:a05:6512:1327:b0:50d:6249:17cc with SMTP id x39-20020a056512132700b0050d624917ccmr3309272lfu.245.1702744042393; Sat, 16 Dec 2023 08:27:22 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:22 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 23/27] drm/rockchip: inno_hdmi: Add basic mode validation Date: Sat, 16 Dec 2023 17:26:34 +0100 Message-ID: <20231216162639.125215-24-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082727_147807_56EB2063 X-CRM114-Status: GOOD ( 17.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As per TRM this controller supports pixelclocks starting from 25 MHz. The maximum supported pixelclocks are defined by the phy configurations we have. Also it can't support modes that require doubled clocks. If the variant has a phy reference clock we can additionally validate against VESA DMT'srecommendations. Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - rename inno_mode_valid -> inno_hdmi_display_mode_valid - fixed max_tolerance calculation - use abs_diff() instead of abs() - call in inno_hdmi_display_mode_valid in atomic_check drivers/gpu/drm/rockchip/inno_hdmi.c | 42 ++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 792e5fad09bf..14473ca96e0f 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -26,6 +26,8 @@ #include "inno_hdmi.h" +#define INNO_HDMI_MIN_TMDS_CLOCK 25000000U + struct inno_hdmi_phy_config { unsigned long pixelclock; u8 pre_emphasis; @@ -548,6 +550,38 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, return 0; } +static enum drm_mode_status inno_hdmi_display_mode_valid(struct inno_hdmi *hdmi, + struct drm_display_mode *mode) +{ + unsigned long mpixelclk, max_tolerance; + long rounded_refclk; + + /* No support for double-clock modes */ + if (mode->flags & DRM_MODE_FLAG_DBLCLK) + return MODE_BAD; + + mpixelclk = mode->clock * 1000; + + if (mpixelclk < INNO_HDMI_MIN_TMDS_CLOCK) + return MODE_CLOCK_LOW; + + if (inno_hdmi_find_phy_config(hdmi, mpixelclk) < 0) + return MODE_CLOCK_HIGH; + + if (hdmi->refclk) { + rounded_refclk = clk_round_rate(hdmi->refclk, mpixelclk); + if (rounded_refclk < 0) + return MODE_BAD; + + /* Vesa DMT standard mentions +/- 0.5% max tolerance */ + max_tolerance = mpixelclk / 200; + if (abs_diff((unsigned long)rounded_refclk, mpixelclk) > max_tolerance) + return MODE_NOCLOCK; + } + + return MODE_OK; +} + static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { @@ -581,11 +615,13 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, struct drm_connector_state *conn_state) { struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state); + struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); s->output_mode = ROCKCHIP_OUT_MODE_P888; s->output_type = DRM_MODE_CONNECTOR_HDMIA; - return 0; + return inno_hdmi_display_mode_valid(hdmi, + &crtc_state->adjusted_mode) == MODE_OK ? 0 : -EINVAL; } static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { @@ -626,7 +662,9 @@ static enum drm_mode_status inno_hdmi_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - return MODE_OK; + struct inno_hdmi *hdmi = connector_to_inno_hdmi(connector); + + return inno_hdmi_display_mode_valid(hdmi, mode); } static int From patchwork Sat Dec 16 16:26:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC5F3C46CCD for ; Sat, 16 Dec 2023 16:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zi82labu1/7sB5OpPQnIioxF6mM+rPdU+6PTTZACCCc=; b=UaFkov6zRcjgvB JIhsjdqTo0H3nU4HQj13GDGhr3tFVeM7Igv5liZBRnYpglOAXC8zrZp172M1pVLF1vuATDSgTf8lb mooOeLzxDFLNlLUzbT5hGpFiba1cg05yk6TpvavjSaswcRrbLRmPse723stKCk1Hovurg8OHCc3pR G4ZqKFIinjU7GBIIIs6Y/eiI/P25S7U6z+yyQKSIyMqRFqRecpN9uI42KkofsbjB2SMOkndcnsO6R TrheyVIOC1wvvUgbPS+FlG0FLUUun5A92jm1ZgeIIDCf0/B4a+Y4okLSLHlIX30IRKP9qjnU/8Vt9 JwlwStn7SEWSIImKZ2Ug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXXE-006Lfz-0d; Sat, 16 Dec 2023 16:29:04 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVc-006K16-1g; Sat, 16 Dec 2023 16:27:25 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50be24167efso1826372e87.3; Sat, 16 Dec 2023 08:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744043; x=1703348843; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EMBynW0XhMl+E8jO2xYw0fAFMrIK4HAqJAW8qk9Tvbk=; b=YJ2n9+wRzrp4n+fDKlFaDwwA/NQuuYWRCA0sk3+0L7KqS7dZ92twHIp54XddzbBWn1 p7yyzy77Yp1Z3XNkmasB1CV3t+9GlPJp8znzszHOlm2WlgcP8wVQ/7a5oVDVDcMHik5A AWIJXjNU86ZxgOiOC3UPVMcn2oZWZ5VBQzWsMMBt6WoiLLYkPM6vjmZqN8pcUuBmkn0/ syeBDfHZC82EZ8OMNbUwyPx7FH+z025bv0sdBTCl8Fo/el7biC5vlAPb8HLRkS/AClnC I/xR9kjTDARnabURHTJ0KAU6TTlAYGVC6iERAN6EEvhRM2AONuWZ5Et6uRrB0i/vPjQr MpAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744043; x=1703348843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EMBynW0XhMl+E8jO2xYw0fAFMrIK4HAqJAW8qk9Tvbk=; b=Eg6IW0yzbIgiLdfE/CZtuq3pyM9itW7oyx5KfeF+tijm/QxghSwC5IRUG2xYxbHv6u 0QmaIv1NNohnaeGxTPuOIzBHicGbyDlGDbu9vhZ7QdtVH8iQNAmTAfk+TFgq0PKwR7T8 8xBcr9ELKTbWt9wiaGOkptcBanwt6wOEtLLYcz65+moa9zWUxxfsfRO2HenXeiUBJqVA 3dOF3TwJomPxND7dt/Nhs8pq5/+mfRzih+R12SIrhrl6OhVBUdcGdig4Lv9oosQ2dtFU dfPk/ROFRA22kUQR6ruBb6qXpMryNxRvspBiEWab8q39jQdNnHa3JWwZMJFLA1C7C/AU khhw== X-Gm-Message-State: AOJu0YylsrCp/0VKluqHj9+vVxwzl/uoO9GHaGN7Dr2Zc/hQ7t9KzHrb GXb/Wv9lxbP73Ns3+5s2iQ== X-Google-Smtp-Source: AGHT+IETdaeg0faWSQ1kmwbaQCOpBidvPKReyG1VUQs/IwAoTIeCSP7GXEKcKNtGmATpxPyBDsVDVg== X-Received: by 2002:a05:6512:2352:b0:50e:1b0c:1143 with SMTP id p18-20020a056512235200b0050e1b0c1143mr1151682lfu.53.1702744043055; Sat, 16 Dec 2023 08:27:23 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:22 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 24/27] drm/rockchip: inno_hdmi: Drop custom fill_modes hook Date: Sat, 16 Dec 2023 17:26:35 +0100 Message-ID: <20231216162639.125215-25-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082724_558049_8E7A92DA X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that we have proper pixelclock-based mode validation we can drop the custom fill_modes hook. CRTC size validation for the display controller has been added with Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to hardware capabilities") Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - no changes drivers/gpu/drm/rockchip/inno_hdmi.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 14473ca96e0f..d477d2872195 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -667,13 +667,6 @@ inno_hdmi_connector_mode_valid(struct drm_connector *connector, return inno_hdmi_display_mode_valid(hdmi, mode); } -static int -inno_hdmi_probe_single_connector_modes(struct drm_connector *connector, - uint32_t maxX, uint32_t maxY) -{ - return drm_helper_probe_single_connector_modes(connector, 1920, 1080); -} - static void inno_hdmi_connector_destroy(struct drm_connector *connector) { drm_connector_unregister(connector); @@ -701,7 +694,7 @@ inno_hdmi_connector_duplicate_state(struct drm_connector *connector) } static const struct drm_connector_funcs inno_hdmi_connector_funcs = { - .fill_modes = inno_hdmi_probe_single_connector_modes, + .fill_modes = drm_helper_probe_single_connector_modes, .detect = inno_hdmi_connector_detect, .destroy = inno_hdmi_connector_destroy, .reset = drm_atomic_helper_connector_reset, From patchwork Sat Dec 16 16:26:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A5E9C46CA2 for ; Sat, 16 Dec 2023 16:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EIJ/SMSI13NYfi+w2WGn+PFGkSDqNCJNxqnlXxv/MNg=; b=hdtyWDr5nVDMnU 19oOuR86BpxHvSofOjx8FOJrFvjYoLwGP3KHIQSDP294ALmyoEbXo6PGZlVc7P+OnoV1nJcZDFZQy Lrq5OOxnKkOv/pT61bJta53YTRktXP5pmi2711suwIz7Iee3aHuqrXuRBy4fyXIbVsb7bPmWtfeH9 h20SrvHNVC/P3yUi1OXsyFzkdo7r1Hm2+L9uVxM8ydfgCIGjQO76vBr9aQ/V7n9V7wbc/XYx+ePLU 5rA8i1UwRGWfgYJtb0WtHMq9xQ1j2BKgwfM4cHPqfayj+slKuXLshe5zuslLuAUkrauBTEKNWCHdV yr2tLpePCA5sjDU1LXPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXY0-006MMj-39; Sat, 16 Dec 2023 16:29:52 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVf-006K1i-12; Sat, 16 Dec 2023 16:27:29 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-50e30b28c1aso174954e87.0; Sat, 16 Dec 2023 08:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744044; x=1703348844; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hsk09sD/JLCR2XzE8w6SDzRrfieu6a8GLQCzTQyHXNU=; b=XnDb1ipxBcRJTN3t49aPpvRxphhHvbXLHGXAC30QQya/tDYFxSZYgZvaViXJFjj9zV 7BW3N8LV7rX19M/JtKNVDpK+bYF8yL94YovEBz57Qd6iZaAP1f0jy4PjVS/p8g9MM9uJ B4+d6+iy0dVLu+r/Q9XCELbgwPqPvYXdGEpYz7kG50SM+vrB+m2FdBO7i8A3YVHGOqCj Qd3InYVaGioea2nTLTJTCX+BN1vyp8ZYIzUUZROjSAFvv6Q/6h3ZwzmFVLNu9AYLrf6X 9fRC/hH/OdJ8MkpIsdA5c0uvRIj6mpkZBwDAMreakcxVCveiU8uVNj2+7n2mZHAN8Hv7 Ws0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744044; x=1703348844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hsk09sD/JLCR2XzE8w6SDzRrfieu6a8GLQCzTQyHXNU=; b=fpjRSU65nlXBrz2S43JvxoCV0++FUabgKfPeYt1JWfNdExQ1yH+cWac+52D8L1axWI MjvARm6iNQZQeAdvZm4ZoYTxzMURxYxG/Y06udHYZro9o+gDbSN1a3kFdEONkAveBiO+ 9MSO0D1Ix2kE5iG+VNV6WW26hU9o66QpgziqiCTaiwkeGXH2l27j9XPhzsooDSCQemxR OXqYGbbdRsxaSBiP0dDKeRjF2CPsGl0bKVdBO4XAein16Uhmunzk87yE6ra+v5SzacfY XANx+efU4HeylX4op1R1r5exUDNI3hQ/zu3cu9HrYjKf7vF/OTM5merclhrb2LTc+UGl O0pw== X-Gm-Message-State: AOJu0YzY+tfU5VqIKXLtwk0OaOJ0ZHir/9NxfrhZzRJig3uKMdEJ4tBj 1LQauKsYViy/B1HWBarXoQ== X-Google-Smtp-Source: AGHT+IFQnfl2cq6EqsmtxXsPX3+nF6bpvttzxEQVr2y36+9o0INXQQPP8fOuEmzzU29lPjunAhL3Kg== X-Received: by 2002:a05:6512:3b0d:b0:50e:d07:597c with SMTP id f13-20020a0565123b0d00b0050e0d07597cmr5112150lfv.66.1702744043722; Sat, 16 Dec 2023 08:27:23 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:23 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 25/27] ARM: dts: rockchip: Add display subsystem for RK3128 Date: Sat, 16 Dec 2023 17:26:36 +0100 Message-ID: <20231216162639.125215-26-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082727_358683_F7D27CBA X-CRM114-Status: GOOD ( 11.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add vop and display-subsystem nodes to RK3128's device tree. Signed-off-by: Alex Bee --- changes in v2: - no changes arch/arm/boot/dts/rockchip/rk3128.dtsi | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index e2264c40b924..1a3bc8b2bc6e 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -115,6 +115,12 @@ opp-1200000000 { }; }; + display_subsystem: display-subsystem { + compatible = "rockchip,display-subsystem"; + ports = <&vop_out>; + status = "disabled"; + }; + gpu_opp_table: opp-table-1 { compatible = "operating-points-v2"; @@ -246,6 +252,27 @@ power-domain@RK3128_PD_GPU { }; }; + vop: vop@1010e000 { + compatible = "rockchip,rk3126-vop"; + reg = <0x1010e000 0x300>; + interrupts = ; + clocks = <&cru ACLK_LCDC0>, <&cru DCLK_VOP>, + <&cru HCLK_LCDC0>; + clock-names = "aclk_vop", "dclk_vop", + "hclk_vop"; + resets = <&cru SRST_VOP_A>, <&cru SRST_VOP_H>, + <&cru SRST_VOP_D>; + reset-names = "axi", "ahb", + "dclk"; + power-domains = <&power RK3128_PD_VIO>; + status = "disabled"; + + vop_out: port { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + qos_gpu: qos@1012d000 { compatible = "rockchip,rk3128-qos", "syscon"; reg = <0x1012d000 0x20>; From patchwork Sat Dec 16 16:26:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85895C46CA2 for ; Sat, 16 Dec 2023 16:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HVR2/HbUfzUvSYeFq9O0rdpHLm4gVrsIHBO7TrebSJ8=; b=HpJQ+CmabVYzkA mbELnXx34UXBxG4jTOP6UDcvB3cf6fbmzFLmaYmYErrsV1UbvoOP1R0mYaH8fErL4ddXoEdWVe/8o 9IvMMz1chhIOY9USo9B6AJkpSnjVWWxZArOJnTQHZ5O2kuUl9ahPXksWHBm+76iiCmKCDsIaZM0zh yaW5So4b2y4VWgTKQk3H5Qp1ie9nnhSb3M0+5+WtsSyqejQN9iESHBYjjnN7BaUpS0TjNztc14vfD 96SDRbLN5sY/jxAMeHAt4XCZk4kJqJRLg1C17IfTUWFsHioCP52LF4cLub/65VNj3sKnY27uY54Kl aAmZ2PYi862MyoJ9StzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXXb-006Lyz-2l; Sat, 16 Dec 2023 16:29:27 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVd-006K2W-2M; Sat, 16 Dec 2023 16:27:27 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a1e35c2807fso191394666b.3; Sat, 16 Dec 2023 08:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744044; x=1703348844; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gBYs3PhPVI6eUxnSZWKmlMF4qjz6lpemR7OHeO6knFA=; b=kA+IyIU9gMB8GcEpVuU4G3py3SHFbQ3GOf0wdS/ZY2h+baih5ZpnO9zp/gIunAl2Pn o7rPsI7d+2i9hF8BaTd16zgLnW5gORFiTdr/GN4FsQJLcJl8pkVCV3ze1wrioWGVr+gt Uhk3kgmzZWYuYr6aw69aboQ0bdQeFd9+Ybah5PMUC5HiU/eMDcxFPaxnpuFzrIsvhDoy dgXsFI08IfYgLj6MLO8YiM8usKxfYmnqPOMaPrRklibO7UjsNPgSezmiFptlToBHUsFP zQ0MYkRB5IyKSoCigfd7MX9MEO2T98XO2x4wznIB88h3szbb31bM95/O6lr4nlT3zxoH Kx7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744044; x=1703348844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gBYs3PhPVI6eUxnSZWKmlMF4qjz6lpemR7OHeO6knFA=; b=iaG1V7pdPROwNxqi/7zUvhCFFciUsBvSfTXwAfpg+LyPBAZcTVab7SYWIr0rhzfeJQ Gla7H4UlRkf9juTnPPI+o3R8x+QKjpMKYWD1B0YNRZdYuvziASEPyhu/2XSmV4ud0mij i+3zzGa3ym7B5tXJYx07QJqVQvZoKlxTcBoA00KIuYbVS5rPdQQOTnP6wOWFFGwBQ8Ph Q2aYlhWxfxkgQtFajTeEATreNdfqGhGzs1ELCcejSkhi9WQbayS4EAehQBfZcxR0+5R4 18xnVvnE6WxPDHHpnkFJWAPObEOkgp9G86jT86yXebvsfydWlgBFDEe09Gmap8GS/9zn aRRg== X-Gm-Message-State: AOJu0YzTzw01mNb1ERsl0fDt1btmrib9TKHDnSGHpO4/XECiNGLZ0+7u lnbS0BfyL30EJUECLWUbnQ== X-Google-Smtp-Source: AGHT+IFL//jIxTYByWAR+rnaaAeoTcePi2y7wDdwHT2lbXxpOe8v9YhxlqSjIVwsz6sRq5BVkqL4xw== X-Received: by 2002:a17:906:3199:b0:a23:2e05:8465 with SMTP id 25-20020a170906319900b00a232e058465mr339276ejy.6.1702744044454; Sat, 16 Dec 2023 08:27:24 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:24 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 26/27] ARM: dts: rockchip: Add HDMI node for RK3128 Date: Sat, 16 Dec 2023 17:26:37 +0100 Message-ID: <20231216162639.125215-27-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082725_794437_24FC59A0 X-CRM114-Status: GOOD ( 12.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org RK3128 has Innosilicon based HDMI TX controller similar to the one found in RK3036. Add it and the respective port nodes to the SoC device tree. Signed-off-by: Alex Bee --- changes in v2: - no changes arch/arm/boot/dts/rockchip/rk3128.dtsi | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index 1a3bc8b2bc6e..fb98873fd94e 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -270,6 +270,11 @@ vop: vop@1010e000 { vop_out: port { #address-cells = <1>; #size-cells = <0>; + + vop_out_hdmi: endpoint@0 { + reg = <0>; + remote-endpoint = <&hdmi_in_vop>; + }; }; }; @@ -463,6 +468,34 @@ usb2phy_otg: otg-port { }; }; + hdmi: hdmi@20034000 { + compatible = "rockchip,rk3128-inno-hdmi"; + reg = <0x20034000 0x4000>; + interrupts = ; + clocks = <&cru PCLK_HDMI>, <&cru DCLK_VOP>; + clock-names = "pclk", "ref"; + pinctrl-names = "default"; + pinctrl-0 = <&hdmii2c_xfer &hdmi_hpd &hdmi_cec>; + power-domains = <&power RK3128_PD_VIO>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + hdmi_in: port@0 { + reg = <0>; + hdmi_in_vop: endpoint { + remote-endpoint = <&vop_out_hdmi>; + }; + }; + + hdmi_out: port@1 { + reg = <1>; + }; + }; + }; + timer0: timer@20044000 { compatible = "rockchip,rk3128-timer", "rockchip,rk3288-timer"; reg = <0x20044000 0x20>; From patchwork Sat Dec 16 16:26:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13495688 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD1E2C46CCD for ; Sat, 16 Dec 2023 16:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I38gItDnZwtovP4OJDr2XQ+V7XsR3zmqWlkl4jPwrwI=; b=uqmoTBdC6peoyp UgCWfuuPsHWEoPc8a3LQRPFYmG7/21NYXDs28pWn6AQjXScvGCWjqfDRT0d16WxblqX2ZOn8jp5tT jCLMB6ya35ZLEoEd9jWRy4xF5X4DHzFWg3yeyiNxq4ybugGNBGK96idsxPMY/f8YZGdux/qT0woTN KYUFyF4sShWE/Xqcy/xLmw3qVzUmkue/q62AD6Dh0GwIgTKXIpNYfdwzcyXFqGJTbNt1lhKu+FhKG 1NBTdc/TWlgRqZ1XFB9iIzVzdcLRSvhIhDnAfyZgnhHlK8NpBgXF2415NDD5lb8xmxJwfc++nXdjR muwrtNIC29IWoJJYmRGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rEXXu-006MGV-1O; Sat, 16 Dec 2023 16:29:46 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rEXVg-006K39-0K; Sat, 16 Dec 2023 16:27:31 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40c339d2b88so18155385e9.3; Sat, 16 Dec 2023 08:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744045; x=1703348845; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S3iOjCbwZExjH9kB2lsGfCX5u0yghPXFIA3BH7zrUI8=; b=H2uUALg3tlyGUyfBVSjpyIeWlrFr+ddR4g6e74qdPHe1BNqcbDv9ruL5ruDksBI4gs NkDF+QSvQz3dw8ARhtwHLECxEJ+svhzgvD+MTkd1+DSBKXMxtWRkt/2RzsxI1cVnuzVm lGFlVfsGPoHCK95mSRNN+HGKgN29BeTEpQLWm9Z8FxBSJDLTuD3NDBiwld57aK3xh+Ph 5Z5XcEvGYCnTXlkc2a3FvN4OqCfDtdoMnG538lIOaIZuOTLL6zl3mjsXmhRK89wWmx/r G6mQl2huRBm3/W46B+4ZBm5o0ZQDUWmeoct2VFEn56TFz9Qwa9OnR+k5cJJm9giOeGDS hFIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744045; x=1703348845; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S3iOjCbwZExjH9kB2lsGfCX5u0yghPXFIA3BH7zrUI8=; b=N7yHipZbDjhXxQL++ALW/x7/yrpKopMSkNZj1WfqiNlnNitrrn0joiDJ2BJBqGcT0p OMZR16lNAeTQJEPw/PwcjUxmQmkGC8iMxquzWQ526U8ijHEkrtUpk4O4oDFmbk3JdwNZ +oi3yMRngtHzeyDjCf4mYEAuKMQo6psgxxD5C4aeN+lQy7q3BRmW4K2sB/mS3lY74Ncg SoDA3nwP+h2j2YspCgtPLJr1ywThShb9/urIgfE2Y1VcleA5SBvIU+19p0OvGRv2wYrU OvRZNkIpK4Iyw1wa7gBtLkYqAOLufroCOb58cHefffdnRRV4JePEcAycCLyqpuydx0jl KvEA== X-Gm-Message-State: AOJu0YxHsLqCM39D7+eXhqHxQW9/hOwkFLN9bynQaYGUP+wY8NNQemUR UgIA6MOF7Kh0Kd3jidA3S132yiqmaQ== X-Google-Smtp-Source: AGHT+IEiefvMCshqhAareV6PB6nvkF+yNy6rY3P4T12kiqX015mu1E2d8HLFar6wnBfSX8rNq1mToA== X-Received: by 2002:a05:600c:4ca7:b0:40c:2871:9729 with SMTP id g39-20020a05600c4ca700b0040c28719729mr7088382wmp.188.1702744045068; Sat, 16 Dec 2023 08:27:25 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:24 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 27/27] ARM: dts: rockchip: Enable HDMI output for XPI-3128 Date: Sat, 16 Dec 2023 17:26:38 +0100 Message-ID: <20231216162639.125215-28-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231216_082728_194237_5E112AA3 X-CRM114-Status: GOOD ( 11.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add an hdmi-connector node and enable the hdmi, display-subsystem and vop nodes. Signed-off-by: Alex Bee --- changes in v2: - no changes .../arm/boot/dts/rockchip/rk3128-xpi-3128.dts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts b/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts index 03a97881519a..21c1678f4e91 100644 --- a/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts +++ b/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts @@ -47,6 +47,17 @@ dc_5v: dc-5v-regulator { regulator-boot-on; }; + hdmi-connnector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&hdmi_connector_out>; + }; + }; + }; + /* * This is a vbus-supply, which also supplies the GL852G usb hub, * thus has to be always-on @@ -239,6 +250,10 @@ &cpu0 { cpu-supply = <&vdd_arm>; }; +&display_subsystem { + status = "okay"; +}; + &emmc { bus-width = <8>; vmmc-supply = <&vcc_io>; @@ -328,6 +343,16 @@ &gpu { status = "okay"; }; +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_connector_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; +}; + &mdio { phy0: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22"; @@ -423,3 +448,7 @@ &usb2phy_host { &usb2phy_otg { status = "okay"; }; + +&vop { + status = "okay"; +};