From patchwork Tue Dec 19 17:00:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498583 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 B962FC46CD4 for ; Tue, 19 Dec 2023 17:01:58 +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=Qx+xi+tIPKaew6M/DSmNLRqGY4ciAgraL8jTUZMlGEM=; b=Q+m44fSrsGj4iB ABD8nWe3L+EU3W+rOdjnZD229b3bxPfXexx4KOhMxk0v7loE8R0lDzjPP4LsbTbSc+Jjx0WPxHxuQ qctG/oFhOCUXpF+oHneuaGhyEzTkX7gtcLJ+xo18ahN/uiGV+Zz5sqzzRvmj0vrbdKka7r5JFjb3U TEUCIjlQnoOVUT5y3hS/Cr9ojkDH4zrrqpi8NmkQLcxd6lLrHY999/W/dCjFYKZ5ewaQwmHU0JD5c gV4kHERB+iuYvl4Z8oUQ6raC/tcb+WVxel0lY4ZZyBoqvBwVaMcIYs2nVGPdHdBanIhuo3sbwsLj+ AlQVHDCtHDHG7vg7z7mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdSy-00Enz4-2o; Tue, 19 Dec 2023 17:01:12 +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 1rFdSw-00Enx3-0K; Tue, 19 Dec 2023 17:01:12 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40d2764c0f2so11335135e9.2; Tue, 19 Dec 2023 09:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005268; x=1703610068; darn=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=LuKwY9nW5+R7DeHCNpC77KMqCvSYagjOBXGDTeiO2JI=; b=PGXrVQxWHjwtI5DeuJ7BjNgXjGdJMnRRORAkgOPu1/EMsnqc4iIoHj+253sgljb16x Ic3dhIV2k+2ffshXpJRiMQ/mtvkalzClipdmrsYdxi1mzN1MT8gpdiIg828UWLUjPvXC poWCviBecA5FAIJrfOgLLrjevghyemnjE30WkAx7FBz/mKoT7KnJof65rv5t2s5QUQDg gK1F8f385ltZfEnHE3mc0kshd8QByKoMCAgAp2OCE35Kym/uoycjpLKzmvq6WH/qBgQK 0Kv+1GB+5Wqv726fGqah+M6nQXZAWvIDe+t30qJ+nCzkPsMng+pmd5Tz71rztDnVeq5O 6ItA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005268; x=1703610068; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LuKwY9nW5+R7DeHCNpC77KMqCvSYagjOBXGDTeiO2JI=; b=NRlpCldAbvzKpRTpm47Mx6kbrmO2STYx62de+Zk8gO28fZhuz4AdCX3ogaXsQjPnCS MtpMLgDBkhm1+Hy5aZ+/XelQfh8Y2anPi7tdyP9sITquq3BRbPuzt/SPFf3DIH33NBBy F+Csr78LgKHpyeAy/acxmt+CA8q/FwH3QfLbUuv1xyTSnQwrWhUyk8ss4dd2QQGWcpUT yzSt4zobJGT7jyu20lGxC6ZUdwX051jVcte9q5Ah27n683kmGYJtQse75/l6x3+0eMkl M3aUVeRoGfyAzejm6DzZrv0JC9CoVFKZPRlOV9vbaA9a1hlQ7LSwrKL+U3nHHPGRdpFZ WJlw== X-Gm-Message-State: AOJu0Yy3kcORGlg+jzraF9edUTFqJFQjoqjHS9ZqvtoYWhwDu44dThaT SZ/u4rypVQErqDwjikNp0g== X-Google-Smtp-Source: AGHT+IHjyJcBo9pFgVWTlwbgCdScLicwo5eWIY6pSPcbe8l2hqtFhG18/pJv3xIxu5MSaFiQGfmU6A== X-Received: by 2002:a05:600c:5408:b0:40d:3084:e66b with SMTP id he8-20020a05600c540800b0040d3084e66bmr127509wmb.163.1703005267997; Tue, 19 Dec 2023 09:01:07 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:07 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee , Conor Dooley Subject: [PATCH v3 01/29] dt-bindings: display: rockchip,inno-hdmi: Document RK3128 compatible Date: Tue, 19 Dec 2023 18:00:31 +0100 Message-ID: <20231219170100.188800-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090110_136617_A2B93C60 X-CRM114-Status: GOOD ( 11.24 ) 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 changes in v3: - collect RB .../display/rockchip/rockchip,inno-hdmi.yaml | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml index 96889c86849a..be78dcfa1c76 100644 --- a/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,inno-hdmi.yaml @@ -14,6 +14,7 @@ properties: compatible: enum: - rockchip,rk3036-inno-hdmi + - rockchip,rk3128-inno-hdmi reg: maxItems: 1 @@ -22,10 +23,19 @@ properties: maxItems: 1 clocks: - maxItems: 1 + minItems: 1 + items: + - description: The HDMI controller main clock + - description: The HDMI PHY reference clock clock-names: - const: pclk + minItems: 1 + items: + - const: pclk + - const: ref + + power-domains: + maxItems: 1 ports: $ref: /schemas/graph.yaml#/properties/ports @@ -55,6 +65,32 @@ required: - pinctrl-names - ports +allOf: + - if: + properties: + compatible: + contains: + const: rockchip,rk3036-inno-hdmi + + then: + properties: + power-domains: false + + - if: + properties: + compatible: + contains: + const: rockchip,rk3128-inno-hdmi + + then: + properties: + clocks: + minItems: 2 + clock-names: + minItems: 2 + required: + - power-domains + additionalProperties: false examples: From patchwork Tue Dec 19 17:00:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498587 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 D2CD7C46CCD for ; Tue, 19 Dec 2023 17:02:24 +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=elcdy5IMOQWzT4F+lP7fOY5kdsUDCEBKgl8SC6UXkQc=; b=L/dapFWAK5Uyc7 TknCYQoz9ob1J4oLRdRrdJv+CdeduLOXoJL5gRReuUjvYwsWZljOLQnm/0bZslhM9VDPZu4ZLGGPm 9AjBJEBeFKqSt+2pBIRO1cQSm6w8dUDZ0X2xCLfVhltB/9maE9PGl9ttRhPNjJfaPH7pNdHnQzOs/ bh09pDCTUI06Ee4Zcuzy+P4aGh36W0Re/Rhn66NJi6cfWKmTXEbxTP/b475nyxo8Bh6UYyydhNuhh ma9tAC1MQnajLofn0oj1Ss5Rl7jRYChHKFpzidN249nr9eQQfp2gphzuidQPNXUaGo0c+L9zeuXIE h26100G2HVkch8IwtxbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTb-00EobH-1f; Tue, 19 Dec 2023 17:01:51 +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 1rFdT2-00EnxA-0Z; Tue, 19 Dec 2023 17:01:19 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40c39ef63d9so52485495e9.3; Tue, 19 Dec 2023 09:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005269; x=1703610069; 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=tvxDLNOYjKdWlkXmI7fVu1cGUQmdpgYMh9GlbetV5JM=; b=QA+Or+0l9KX9nZ8tM7VGoTXlbrhkr+vU/XuvnVP9DElUwYhTEGemO3HWHB8WsgqT6X j8NluhqXHnLLrEmX/3LjYRWHrp37E8dQDvyHJPt1fpplvG1mgcI2ghP/rVLp8iFq26yQ VfvCS2ynnzGDb7ReAPTXiyrAQ79CJMkj7u70FIXx5NgZHynnt1ITrVAFJ/zHil+M8Egd 63eeTrk6BIzJtHXR46wf2baST3YqlR5kEJ990ykpWuH0hf7gS/ITFWETVwuRmOw25c9s 2EJ4GfkpKmsDEmtIFBX5r01wcRRgu2R2hSkb9/kdKRbVrsv4mXKZx/603snW/fK3+bSI jMZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005269; x=1703610069; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tvxDLNOYjKdWlkXmI7fVu1cGUQmdpgYMh9GlbetV5JM=; b=lkkRVJe219M/6vAW4JGauyTMdVvLLgaEWItg+mmVda/nYwqbvnzi+z13kQaJbQtIgP UU2czLXIYz7jdUt07I++SEigxPxu2uz2eMlpF/guet04Lr176CGN2X0NAG5FRHwyYMFe gSaQk/a1PF7FOmXr3I9OTMCA0PKxX/MI0/6HA5T6kGIwws+EJTVpG9d72ZBRanhvgO2O iqIOJqedVNG9wHwH0po+lkn0ZAI56txyfmd110uGB3P1Oq/txlskyLu9CPSmWI7Nxjdv ZIfDzlqdiGS8yWIqn6zA+/Je+zQL2OBLTywM2qBtuiZ55PQuSxGz+ukUOJSF9xIiYSU2 afug== X-Gm-Message-State: AOJu0YyrnGt9brVQhvZWgkLxlPMxQ4KwC/CuSpOxCPuKm6QL2WP+AAvw XbTIAA21Wu6oLE1CjwKfuQ== X-Google-Smtp-Source: AGHT+IGsWNsaajXe5v4hjIqM1EZLyrRrx1NOmjW0Jf66/vPQv93o4u79++vXB9ZEkUXdq2ViVM1Bow== X-Received: by 2002:a05:600c:1d1f:b0:40c:f7b:67e5 with SMTP id l31-20020a05600c1d1f00b0040c0f7b67e5mr8969956wms.37.1703005268722; Tue, 19 Dec 2023 09:01:08 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:08 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 02/29] drm/rockchip: vop: Add output selection registers for RK312x Date: Tue, 19 Dec 2023 18:00:32 +0100 Message-ID: <20231219170100.188800-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090116_274480_461FCC29 X-CRM114-Status: GOOD ( 13.04 ) 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 changes in v3: - none drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 13 ++++++++++++- drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index c51ca82320cb..b9ee02061d5b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -227,11 +227,22 @@ static const struct vop_win_data rk3126_vop_win_data[] = { .type = DRM_PLANE_TYPE_CURSOR }, }; +static const struct vop_output rk3126_output = { + .pin_pol = VOP_REG(RK3036_DSP_CTRL0, 0xf, 4), + .hdmi_pin_pol = VOP_REG(RK3126_INT_SCALER, 0x7, 4), + .hdmi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 22), + .hdmi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 23), + .rgb_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 24), + .rgb_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 25), + .mipi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 28), + .mipi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 29), +}; + static const struct vop_data rk3126_vop = { .intr = &rk3036_intr, .common = &rk3036_common, .modeset = &rk3036_modeset, - .output = &rk3036_output, + .output = &rk3126_output, .win = rk3126_vop_win_data, .win_size = ARRAY_SIZE(rk3126_vop_win_data), .max_output = { 1920, 1080 }, diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h index 406e981c75bd..fbf1bcc68625 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h @@ -872,6 +872,9 @@ /* rk3036 register definition end */ /* rk3126 register definition */ +#define RK3126_INT_SCALER 0x0c + +/* win1 register */ #define RK3126_WIN1_MST 0x4c #define RK3126_WIN1_DSP_INFO 0x50 #define RK3126_WIN1_DSP_ST 0x54 From patchwork Tue Dec 19 17:00:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498585 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 5D31AC41535 for ; Tue, 19 Dec 2023 17:02:01 +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=BoPp/rtuBtO8bCkH1zx2eSv6vOyAmooWPd4LNV7nBDo=; b=tYspAP7kaGAdIu 8F+shr0p2r8rsrD04gFQ4BGPZWZqqwNYNLTmbk9plDRw7LY/WXMEnaxupU7BVgZ3zpgBY4eNJW3NJ vjl/q+kjuR8kcmEMs4P350bV/RxWH+BhStFZ/upvJNCXR6iRzWKxcvi5rN/9/uRr34/m5sbBSZI6e byw2xyVf0pLYq3yU5xsopLEXfcxV7ZFzrL2OK3Cpg6W/6GZFbXX/b0hg9yqczdr2JcRJxiiDfCBLh msA/YGoWM/Ius0nX8Gfb3Kf65R7f+X66os955yBPyK4lNw8ecHnVU9SPAzxLM+k9i1KzVGXdm7btl qGg5rhsz0uYwysdWE3TQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTE-00EoHT-2r; Tue, 19 Dec 2023 17:01:28 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdT0-00Enxg-0V; Tue, 19 Dec 2023 17:01:16 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40d31116dbeso612105e9.3; Tue, 19 Dec 2023 09:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005269; x=1703610069; darn=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=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; b=nHWZla9jDMDomZqx7OsrStTdb4EfDCN8MRHtNO59BlLtgXDEkVOiwIS1lTs+lRCAOZ xkQ0x9f1uO1UmpNCkYGPPHUFq503/imfkYaPtloDr0WpaAywpPEl/ovdexjtl0vCTg3u iUP/5ec8CWWMep4tBbHUUVX7U5Xz4t+izYK8YObYHFUWyOjc2oBKlqHN7TORbTxYaVC/ 1QOLRNPoJ5Ef3MLvhma2IdKmUDRuYGweIZOeqAhoQDPWGk+2EETZn0AfRLmEp/zzhH7B JvsYqOoQjA4jy5+VbrVi1DDUQiM70B3lV9CcsuMpzHihlCiEsJXz1nNvNSV+hXCpVoKE G+bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005269; x=1703610069; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; b=mkgdoJyfM2tJepLioElYHTNDZy30PNM/fIxwI6PANLGmQbCKHHZmSAGvnIWuQldtWn TfPECOrWvlraTslmmcxwVm1PFY6Jn4JieZFwI6hiVzpfAT3XxGuxX9Uc9/Yw2LLp79fx gCGE8cM97NRvTWgP2AV6/WbwcqMhGAmJqVH/MAf/jD377B6LMNuxRCKePKNEun50ZwTD vTZyUuS/qzyj/M9QZH0P2DBpxEM7KeQozWFuRX1Dr0Lfhtn8YPpuZZfr9JIBejhh5TIy eL5s+6NFVIM4swvOQFliFOBv9Xh8zv+2a3/bjdliop5IwkzxxIXf0wDh1SYQZwyiwd77 VfCg== X-Gm-Message-State: AOJu0Yz+qPuVuczzU0Iy+G7fLfj1KwepofTzZwDqbNjNuem1g5HHZcir krC1RA7a2QSyh2/9H82pHg== X-Google-Smtp-Source: AGHT+IFjM19BzeJ7opBdpwxu2A1HFwreYdOm1l3GDNQQNs3Nw6kKgPMgszKGHl0AEjwpNwVYqeSAcA== X-Received: by 2002:a05:600c:2212:b0:40c:6160:98f7 with SMTP id z18-20020a05600c221200b0040c616098f7mr5158875wml.17.1703005269466; Tue, 19 Dec 2023 09:01:09 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:09 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee , Zheng Yang Subject: [PATCH v3 03/29] drm/rockchip: inno_hdmi: Fix video timing Date: Tue, 19 Dec 2023 18:00:33 +0100 Message-ID: <20231219170100.188800-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090114_214587_4AB25E33 X-CRM114-Status: GOOD ( 12.52 ) 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 changes in v3: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6e5b922a121e..345253e033c5 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -412,7 +412,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_H, (value >> 8) & 0xFF); - value = mode->hsync_start - mode->hdisplay; + value = mode->htotal - mode->hsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_H, (value >> 8) & 0xFF); @@ -427,7 +427,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, value = mode->vtotal - mode->vdisplay; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VBLANK, value & 0xFF); - value = mode->vsync_start - mode->vdisplay; + value = mode->vtotal - mode->vsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VDELAY, value & 0xFF); value = mode->vsync_end - mode->vsync_start; From patchwork Tue Dec 19 17:00: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: 13498584 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 7066BC46CCD for ; Tue, 19 Dec 2023 17:01:58 +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=wWQOyPISIzwEghTNJYGgRGJLQ49vjjxZ1b7rGmfxsvI=; b=zMFqQLAM1w2Z6B kUJXCRWayHa6H3VWYvApWrtfybCthlPBAlX0HmgQXzypA2ktHCwLb3Ni3cY6e/+joPHLe4bcyLgeI qz4JlskDFK5pAga6l3TFoHPj1iCe+/2IaIO8sUkJUDOnuZs1BvA3fiYj5XsADdflRzX/sHsAY1OS0 I+FmNC/FAZe3athoI7chv5XIyNQQ3lJtOjEHgKthSCpQ2W5LWg+OmsphJgMomgIX/3zVe6Y4Uu4wH B98PJxPeV/K0/VGftp/UHkWo5vZKcHu2npUrRhsvfzxOCzA43S3AKJeJ0/DnAzQMk//GLepBtTPb2 msgY1fGgXwDtZjc8p5NA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTH-00EoKS-1e; Tue, 19 Dec 2023 17:01:31 +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 1rFdT0-00Eny7-0S; Tue, 19 Dec 2023 17:01:17 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40d2764c0f2so11335655e9.2; Tue, 19 Dec 2023 09:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005270; x=1703610070; 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=qdMgjNjNBTOoBWK3IcfrwTBNKKERl2lF+r21sur0UJs=; b=Z2Xv7uwB6tXpEZAvpyzjELEWsmhbx7McsEbiK31qGvFvwaNTDBUaAPc8zDCJtLtmKi D+H2LjwIW2ZeyDS1N+ehh6bJboVQ4rhPwCD21tGiDa5SrlOONJ4QBSG/lkG/FLZAFGdG 7XIShiNfSCkzUVSijtMJb1e/bor8XAKeKUBl0uQ4wQV9a4lQudSMCtkD0TnpPZbL5G5c MuBaxSS9cueSbXq1DVnBy5i41DevHKV8ei/h99AB4pSMJVf73KykNPwhgAujq6NkI0AD yPk4J9Y1sY6+P0p64VfaaTEkhBEJbzoygEmLjjIMdJP0lQLvHlJSmkBfzZnTi3JMU3Ag nu1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005270; x=1703610070; 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=qdMgjNjNBTOoBWK3IcfrwTBNKKERl2lF+r21sur0UJs=; b=LHcHPA0NdnorG1q8Gw5/j7g0rP2eNxPaSGKnY1CacIfDqatKnorRUMvDoBJffaq+9J AIGr68MmCm6tD0IamT2Mbe+26EzcIF7Pe6XlChoSqW5gOBmweUmrPNrnGRfdXR8iuvqs eNOt9EjBukRkaHLF9zTQfy0Tx90PryMlrfg7vnaRU+sUQud2tRUznDqmqkuevHaLf2Yj 3ueJNiEoleweBAsJwBTp5bbTDM3DwJmeX0P4IBcbTFglGUlKE7LPGcJ8+HlT58y+nmsr KQQqSHnQcfs5dulIfN3E8j0g7f8/xRarlKSkG/N7b3baCGewTCVCghy6jboq1whTutAh Xk7w== X-Gm-Message-State: AOJu0YyZimrO623J2wxEA0BxQ15RaQShDmW4Rv3r8p1tayzJOJfBQ57v Tl4HKSerti5WqJtXh21ipw== X-Google-Smtp-Source: AGHT+IEkfFJDXwsv4Zfxm5NA1za7VpADdznfWYCyodddd8eXDeufpwxwQM+20Je7C3cazgS46y7cEw== X-Received: by 2002:a1c:7218:0:b0:40c:317e:7cb0 with SMTP id n24-20020a1c7218000000b0040c317e7cb0mr8717116wmc.158.1703005270277; Tue, 19 Dec 2023 09:01:10 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:09 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 04/29] drm/rockchip: inno_hdmi: Remove useless mode_fixup Date: Tue, 19 Dec 2023 18:00:34 +0100 Message-ID: <20231219170100.188800-5-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090114_225308_4462C3E5 X-CRM114-Status: GOOD ( 11.24 ) 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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 Tue Dec 19 17:00:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498586 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 11ED7C41535 for ; Tue, 19 Dec 2023 17:02: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=wCyfi5AkIxcKcrDO/wEbyYTlDOnIVKJYxT13SUPH1+w=; b=vpReBS8QroypfJ 2j0kcecU7v0iQgoZooshDp/Ihm8WmkMKimovIW82jiuHxvD5AZ/6jfC6HjbO5kv4jz1Tm22hG4GdO OpoeJtftXfmZQP1qbZ1bD/7FRJDxmo8XMca3so6cmm62EAH66J58sqI4tsb8sQXO8k6bugjzN4BW0 1oerSz3vgdUksQqKh4W28M6dGetQWJKAxdOBXOOE7bt1XE1ucjR/wozsOH2jUYl71SX+s8Dz/wt16 GcbkQqK+jI67oXfhr++vshsn6SxzXJ7Ien3mNA9wFoHUw0p3An3QAtpCLe+fdRNG2Ih+7I3+WRuDP IiipscRfGHNqIXRbCYBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTL-00EoPU-27; Tue, 19 Dec 2023 17:01:35 +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 1rFdT2-00Enyy-0N; Tue, 19 Dec 2023 17:01:17 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40c29f7b068so52844545e9.0; Tue, 19 Dec 2023 09:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005272; x=1703610072; darn=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=qH39RMJfndGmJ2yo6EAj0TEb5im2nG8g4/g1kbQG1h8=; b=B9XAw5X76jV72Vv0aFU7VsUclsKOq63mOEMt9df4QT3iKDStre59Vt46lJ7IYYO3p6 VYgMGOYx3OKZQLHgNzPFRq5JRUiD9ngD331vRuNkFL/1QQcSWuuGzmQP2q/ovqvpezgR 4qGQ7spcbTaXr1L1gPzfNF7lojtsi1Y/Mfe2FJwHwMYkYjVPYfPrs+AYJgW+rKvXFGww QEClWjs6GOb17L8o5p9Ffs/o0ozUm8YI0WGBCs/IkimR4G2S6xO0EaIMhbRAc4H20U1y CCcLE67WD3eGbwHZaHc8f4msv6jnpkN/+NwK8U/3EjfXtn4Ya3IRGoGYdqi1Qky3hSyh G7qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005272; x=1703610072; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qH39RMJfndGmJ2yo6EAj0TEb5im2nG8g4/g1kbQG1h8=; b=iBNnmFVsrJ1j1Xz5lCiqZ2VeihvGgttcAFycZ2H0uhXZhmgoBfVDr3UeUtCTt7ZkfQ bQp9SGzTsSgdeLdCI5C56n5yLy1vMG7Mg0LLQ2tpIxDwV1c/cUkjJzeA0CkXd8tZruNw g/clXEQeJzIMpN2aN88/3Uye0Hz8T23xGfeQhywbohRGMOWrgh6D0L6xonKcePPbXAFG YAswkM1iYIodIhK/xiRGCip0Rc5AuxDQKYAAEuYF/vf1nFuBgAzUVaDOr3ZzViI6Be82 UtAOOHGK3H8A4x4zLjv4YMPj7cFdYVdmm1A32LhpJB/zL7SiiMfri9Vh8zVnZP7+0Uze Np+g== X-Gm-Message-State: AOJu0YxsSB+dJgnOnnJWP4u+FU0e+VW48ucAaMsG0AS90ZPXpg6Dmdv9 1yOffsWgY64GhWCbKK7CEQ== X-Google-Smtp-Source: AGHT+IGtFrexi9uVeaZK/6ydPyM1BX9m1o9MELmkYq+IF/YlCMbmQvGLdQPCk5LCS9UJ76GWt9oJsw== X-Received: by 2002:a05:600c:b99:b0:40d:27fb:2f27 with SMTP id fl25-20020a05600c0b9900b0040d27fb2f27mr601599wmb.111.1703005271769; Tue, 19 Dec 2023 09:01:11 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:11 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 05/29] drm/rockchip: inno_hdmi: Remove useless copy of drm_display_mode Date: Tue, 19 Dec 2023 18:00:35 +0100 Message-ID: <20231219170100.188800-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090116_184223_16936CCE X-CRM114-Status: GOOD ( 12.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 From: Maxime Ripard The driver maintains a copy of the adjusted mode but doesn't use it anywhere. Remove it. Signed-off-by: Maxime Ripard Tested-by: Alex Bee Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB drivers/gpu/drm/rockchip/inno_hdmi.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 0b1740b38c7b..14d2ba92a606 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -62,7 +62,6 @@ struct inno_hdmi { unsigned int tmds_rate; struct hdmi_data_info hdmi_data; - struct drm_display_mode previous_mode; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -498,9 +497,6 @@ static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_setup(hdmi, adj_mode); - - /* Store the display mode for plugin/DPMS poweron events */ - drm_mode_copy(&hdmi->previous_mode, adj_mode); } static void inno_hdmi_encoder_enable(struct drm_encoder *encoder) From patchwork Tue Dec 19 17:00:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498590 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 E6A09C46CD4 for ; Tue, 19 Dec 2023 17:02: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=O6NqfoviNszBF5+HzYL+qEnFWLpx+aqF1GFp1PcF7iA=; b=ZxE/XkB9vKp8eM oiIVyOJUdr2Y8gkPvCqCx57KapPJWhLF4gbs4E0fQSXR0sWEIMgNrL1+WaYzsAqyU8+UcE4cpHETo Dr598mI+lu/jW0LnN3ETQ2WrbLn+blAj3BOWQIrNJwSl5uGuepXA+NL0FpsEQf6lML8WNMpYtGL89 hkGufcASlIDGhQpi57ZJmRGJTvZDrFUC41+wB3PZQARxlG1zF6GvTeKD2cW08FRsDwJr+VkoWZmKT PSKRNBdQZ69qEPO+sIHKbdIA15fM6QTB7/ViY7UI6px9tOgYyKipJz3uc0WmZtDqurJ2LL8SEp4pl 4qTm5L9nbeKz5BGDcaog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTh-00Eojo-3D; Tue, 19 Dec 2023 17:01:58 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdT2-00EnzR-1b; Tue, 19 Dec 2023 17:01:19 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40d2376db79so9386645e9.0; Tue, 19 Dec 2023 09:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005272; x=1703610072; darn=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=RIgfmp308cBqMuCcRmTUeRZ4zCPkbcPIGR4mbqru0jg=; b=FzhpErDlc4VJF1SqA5q9/46sSojuBSyyDXv+EyehswysAGGuMboAb8T7eg7pCBWMw5 cWqOKJRDPYhwDxz/Vb8VlRSwh2Da4wgYzAy1jDH0Wv+IXVAN7h9HYvRObWx59dZfwlIi pulpnKvBsHSs34v2NO2ZfQIZNP6dfLR/tVkecgFky/Qc2/v69BbrJb0hJQeMvWVDL8mf tkMz9ezA6LXt86JwXMk5qqHAJHemgaU35LWedFBHMjyjB6N5no3zn//Hf3aUMo3+wn+P P5rX7xbI96dVPJZwM7wjOfkqCPguotK3dbqZ4jV/p5uRYyoRc0v3fOEMQk3KXtA0wMVO p/PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005272; x=1703610072; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RIgfmp308cBqMuCcRmTUeRZ4zCPkbcPIGR4mbqru0jg=; b=RAOTUCOi7XDlXG5Ww6HNQ1UUFg1KoygBi3K+9WXlw4eYmvDBQCZguhOYt7IHPPAsnK kDoQkxkh1hbr4Dws/CQqEEKhxkQhf0+DpJZNt9BLGIE0SPSxDJzPWpHMcyMkvchYaaMg +rIVIv7g7+f15b2I7woB01bklO7gFpJ7EfRmWF9rPsz8RRI3VGQCo987ojsi1asvvTzK dQpVRrBIPlQbNa5hp5itRvBgyWZHwyi4fFB194s39I+HhKyWXxMsvgjExJgrxXnX65aQ qbo2z9DPMkTQI545G2aqZHm8xFYRoJG9+cZoWVRqkz/zS8ZHUzqAbTW1Bn/Ov3TF/25A I/WA== X-Gm-Message-State: AOJu0YyjspevEKuSKnHehporMdN8eF/tvWgkyIf0jU5RUBYZxbasfn0C 3ETUdMm9OKS18wuGjppz7w== X-Google-Smtp-Source: AGHT+IF3b1/JU9tAm07Sg1XZchb8/7FxPCLIba3ZjkniGfDHlfMXAWV5VO8s7wGCwYmnKH7GS0JXkA== X-Received: by 2002:a7b:c7ca:0:b0:40b:5e1b:54ac with SMTP id z10-20020a7bc7ca000000b0040b5e1b54acmr11372528wmk.56.1703005272560; Tue, 19 Dec 2023 09:01:12 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:12 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 06/29] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic Date: Tue, 19 Dec 2023 18:00:36 +0100 Message-ID: <20231219170100.188800-7-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090116_554031_1968B5DE X-CRM114-Status: GOOD ( 12.85 ) 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB drivers/gpu/drm/rockchip/inno_hdmi.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 14d2ba92a606..48c4f010b260 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -491,22 +491,25 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, } static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) { + struct drm_display_mode *adj_mode = &crtc_state->adjusted_mode; struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_setup(hdmi, adj_mode); } -static void inno_hdmi_encoder_enable(struct drm_encoder *encoder) +static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static void inno_hdmi_encoder_disable(struct drm_encoder *encoder) +static void inno_hdmi_encoder_disable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); @@ -527,10 +530,10 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, } static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { - .enable = inno_hdmi_encoder_enable, - .disable = inno_hdmi_encoder_disable, - .mode_set = inno_hdmi_encoder_mode_set, - .atomic_check = inno_hdmi_encoder_atomic_check, + .atomic_check = inno_hdmi_encoder_atomic_check, + .atomic_enable = inno_hdmi_encoder_enable, + .atomic_disable = inno_hdmi_encoder_disable, + .atomic_mode_set = inno_hdmi_encoder_mode_set, }; static enum drm_connector_status From patchwork Tue Dec 19 17:00:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498795 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 BC5E7C41535 for ; Tue, 19 Dec 2023 18:02: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=I9+MMZ9t2/v3eOq5VwMAuKT5z4aM5bm4bsS7NYE8iKQ=; b=Iu4wgbCBrgTpJZ 1KLWiudOa7s4CuAup0UghwKliQJZjirhQIzHlp2HRPIlSOSFSzVCtay1358gtzNcDOKNZnERt3gxL 1AoeQ/etabXwjPwJfsPL4aJyJA/Qt+/NO1BgGZPHEHwyqgtr0ox6Cep9ijd8RKW45KY19deSHgPpo BtLmSaetGhjaphBUPj0RqUvhrrFLthbiPcbnTqV2btXCvYlBJbYkYoOEfrFbJzAm5WgfZgrg0NmMw iGMikhRBHxTYSNGfp3Fb0DDnpTK0Z837UrGQZmbYCutxRiQ6mrsYCUAjngeicaI34snz3fYEhzmKP PkecXJCZbHChdcGlwqIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFePZ-00F6ic-1T; Tue, 19 Dec 2023 18:01:45 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdT0-00Eo0y-2u; Tue, 19 Dec 2023 17:01:17 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40c3f68b69aso45412965e9.1; Tue, 19 Dec 2023 09:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005273; x=1703610073; 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=15Kg5P/kPo3OprJxF+EVJ+2okgIdyNf3FbH+CrQD8yI=; b=ZKWH/+ubuPhnAMnF7qnFsiMs+ctm/bi2Y3nPCaNX4uk5UFV8SKg8nd/YRlfp68RYPl 2OYbxzB+DhN0oKjDxzg9ZPmzfotLanilZ6J8iWDicvQtI0/8TMWVvGT2xHEIsMUJqlSh d0exGvsrazVXEueUNZKkcZbBxhhgiW6ghTnpUVHyLkiTt9cqEzVwOCQKydt1tJW1ZpnC ups7CZnTN5O0VhE8iKCdSDhZvmZ7OApci5scFnqTrhVEY8czuZ4su6FrHn4DfGgkddug NrVYdglYOQ9+ASAGNuJbC+worwmYVOarNxEzEmFUwz20Ganiq0wdj7+ftU7S599n/lbx OqwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005273; x=1703610073; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=15Kg5P/kPo3OprJxF+EVJ+2okgIdyNf3FbH+CrQD8yI=; b=U3Vh2l94tPisGjmEwBaUxdrUokBwsmxVQCbC6fjk/e6TSUajaJzprvGxf0EDThlRYc gLCbdYRYHWXiti0qFnZGh+hBWmtM1BTPenZ/WzNjxWCLPewsK8cmEJVS81j+Jaa7bsJK j2g8uYuhoLGRyqKO7te5kRL/o7njytTDwUZwbU5Yye2tSCUfEdG9EVQnP3V1qvqYFr7g MeKWbVEOr7XNCsXPJydcsC4CNJKw0uUqPDH5qR3HcwvDsfKyGWURVzOhMEKl1QOHJzgx +PRhspa+43oV1UqVkRQ7jLhvOaxLZ72md+aNiYF1w31kJWgvy5tBgnbhKb2SAv0Iu8um A2ww== X-Gm-Message-State: AOJu0Yw7/0Hp3qzEU+jzAqKy1UunXUMe5ulnHNn/fmNhnpv6W4UVDaLs C17RtznRcmcPEgYNf+syFA== X-Google-Smtp-Source: AGHT+IGqScOQaAnjGHqWFCShb5yiDE0Yh5BBJo/U5oIdxgSiH15NWOTLCcGXNGOGRQDcRHbogYVnVg== X-Received: by 2002:a05:600c:4595:b0:40d:129f:d59c with SMTP id r21-20020a05600c459500b0040d129fd59cmr3033478wmo.79.1703005273480; Tue, 19 Dec 2023 09:01:13 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:13 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 07/29] drm/rockchip: inno_hdmi: Get rid of mode_set Date: Tue, 19 Dec 2023 18:00:37 +0100 Message-ID: <20231219170100.188800-8-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090114_946580_93C81A28 X-CRM114-Status: GOOD ( 15.06 ) 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB drivers/gpu/drm/rockchip/inno_hdmi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 48c4f010b260..299770e481b7 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -490,21 +490,22 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, return 0; } -static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_crtc_state *crtc_state, - struct drm_connector_state *conn_state) -{ - struct drm_display_mode *adj_mode = &crtc_state->adjusted_mode; - struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); - - inno_hdmi_setup(hdmi, adj_mode); -} - static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); + struct drm_connector_state *conn_state; + struct drm_crtc_state *crtc_state; + + conn_state = drm_atomic_get_new_connector_state(state, &hdmi->connector); + if (WARN_ON(!conn_state)) + return; + + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); + if (WARN_ON(!crtc_state)) + return; + inno_hdmi_setup(hdmi, &crtc_state->adjusted_mode); inno_hdmi_set_pwr_mode(hdmi, NORMAL); } @@ -533,7 +534,6 @@ static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { .atomic_check = inno_hdmi_encoder_atomic_check, .atomic_enable = inno_hdmi_encoder_enable, .atomic_disable = inno_hdmi_encoder_disable, - .atomic_mode_set = inno_hdmi_encoder_mode_set, }; static enum drm_connector_status From patchwork Tue Dec 19 17:00:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498588 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 7331AC41535 for ; Tue, 19 Dec 2023 17:02:29 +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=vAztKpeG+9gCniPEoxeZefH7OakiwFNuqisKHSROXOU=; b=JtH+hMXPkkCzWs ibGWvTl7B8O7D+/smAc3PsbtzBVI95lYMlz3x+l0rsCOvjLHEAehkiP+B/lHXyfhCdcyTPCY8Nmgn fGOMGDGKwZc1D5IEERQNXTMM8UA6Coh+nyWp1HrJiwXFrKLBxkl5i5dK0Y9Rd7KB1Vhp3XjybOhwx Kizkfz8gDtFk+MxnKqQyUkhWE1HbSH3Rpsd0+A9jNzJlJQV3Zk/n9zf9/DlAPf7FND6zgVUgG5o7g /Y/qApx2JoAeCEPK7y7oX5NU6P7dpGR254wGHnTDwB/tBgLRWdhAcaAs0Fab63wuzMSChGSKelVTG cOo/Og9oyRr6Hxj+eEJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTV-00EoUM-2c; Tue, 19 Dec 2023 17:01:45 +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 1rFdT2-00Eo2T-0d; Tue, 19 Dec 2023 17:01:18 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40c39e936b4so54777885e9.1; Tue, 19 Dec 2023 09:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005275; x=1703610075; 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=VvJhWTUaZ1kAS2FjYOCcewK/+2L6xqjKsMInEMuEacc=; b=cP+urzIA+tiJljZUtAbkMXoLm0/Tts5beGTQKYcSRw0iTxi6a5PsNcpiI4TN0AInup egngGK/6Ot6rI3MMKBaQErilJmSQSVbZVTJ0Em2kC2oIDvF0Al6oyJ5nECz3OBCkUI0T iKJltdH6LDw4wO7GqzP3uPDcr+96aRtIC9lMkP2+TSEfHYB4noTh4zl8OPs/q42h0oka ORVojZco/vyfq7iNGRFTuoBIxlg4ypDQllIBkxrnenPSPOuCcEqh4VOPN0xt4G8u3eby QZIwQIZn1kFSgu6liHM5G8zCxWH/GuozqZcSoPhUItZeC3UUWtmlxL5SaN9k3A0pJqx8 hGrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005275; x=1703610075; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VvJhWTUaZ1kAS2FjYOCcewK/+2L6xqjKsMInEMuEacc=; b=rVED95uLVARL9aKuEkM1V2Gn9vHOywkTycGkgkQ40CUGzq9Mp9/nWsRVioD8d658kU 038moOMRXar5vE1ZjWsvBmPYFR5OUBhvh0VA2+dThgXOyl3UK2oUTzH2sMLTsxbm+Lwv WBurQTZaujhxICl7xd0hF0RiR5St/YZJOTAAX3m2wHVmKxHT4R6NWluP4HvqJMys4N4f epiuIjhDHjBBT/KITcTOyvblfAsEY4QCEk4FIqgfRiZw04f+Pyo3J4A8+djny/5l8Fwo Olec3GSuPz2pIzVULoFCgEtz7WhsJbsC6RGsS0hj3cPjEnJs7sE8uKrPra0+GaM53Oo3 bptg== X-Gm-Message-State: AOJu0YxNdQJwnQcgiFcEWHod2pBfW5rmpSKbhK1uKl0yFgirCBgUdU7x PrTrPwHIB6vGMKoHrQkR/A== X-Google-Smtp-Source: AGHT+IGSTG2bZEzpSu8nSWJckWftmgfOLD5ECMR1O8HR3EFeEhnatTb8aS+6tL1yBM93D+staL9K0w== X-Received: by 2002:a7b:ce8f:0:b0:40c:2205:e5f6 with SMTP id q15-20020a7bce8f000000b0040c2205e5f6mr5185131wmj.293.1703005274526; Tue, 19 Dec 2023 09:01:14 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:14 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 08/29] drm/rockchip: inno_hdmi: no need to store vic Date: Tue, 19 Dec 2023 18:00:38 +0100 Message-ID: <20231219170100.188800-9-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090116_273405_20DB8354 X-CRM114-Status: GOOD ( 13.19 ) 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 Tested-by: Alex Bee [made checkpatch happy] Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 299770e481b7..d99896f1a73a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - int vic; bool sink_has_audio; unsigned int enc_in_format; unsigned int enc_out_format; @@ -443,16 +442,15 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { struct drm_display_info *display = &hdmi->connector.display_info; - - hdmi->hdmi_data.vic = drm_match_cea_mode(mode); + u8 vic = drm_match_cea_mode(mode); hdmi->hdmi_data.enc_in_format = HDMI_COLORSPACE_RGB; hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; - if ((hdmi->hdmi_data.vic == 6) || (hdmi->hdmi_data.vic == 7) || - (hdmi->hdmi_data.vic == 21) || (hdmi->hdmi_data.vic == 22) || - (hdmi->hdmi_data.vic == 2) || (hdmi->hdmi_data.vic == 3) || - (hdmi->hdmi_data.vic == 17) || (hdmi->hdmi_data.vic == 18)) + if (vic == 6 || vic == 7 || + vic == 21 || vic == 22 || + vic == 2 || vic == 3 || + vic == 17 || vic == 18) hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; else hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; From patchwork Tue Dec 19 17:00:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498589 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 16398C46CCD for ; Tue, 19 Dec 2023 17:02: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=vcq5T+agC9Htuhr+OQelpTadLhsGbIV1OOTBgIxNijU=; b=npInA6LIEFGGq6 h4izPd4B8zWlamzjKnRlmrTs8Ht7svl79VZzGR9kWE7YtM/dRgh5hVBZxvzDhYbRv5YV3Q/1hjH5O hAV1uIvL/8CaSif0iP4rogIl6jrKS9lYKV5LCTcNfzRPecwa5nF3yf00rV4Jsjm5BqEVtM9jw6PVu 8qpwuIVCAhSbLyrNRF7v9G+mezviQz44MqokoAYRS0hqBbEyZ5zwFVXTeinf1ACjxCK7U3cPWiw/1 yjs4hKD+fyNfMCrBKXAVHv1xVteCKM1GURBV4l2+D/RFSpApbuNpMah39glTTcWvOF6RU/7pW/9TW yoZXMFwrE2YZJaBSNtag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTi-00Eoks-2g; Tue, 19 Dec 2023 17:01:59 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdT3-00Eo2r-1p; Tue, 19 Dec 2023 17:01:19 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40d22d3e751so5939665e9.1; Tue, 19 Dec 2023 09:01:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005275; x=1703610075; darn=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=SMIbD+dY7Kjgg6ECXdMxWD6N2Rzqy4kZE/eQIX1m8rA=; b=mQHMsUvprhvY+HlZxy6n3WsunqxQDnuF5a9PM2Aoyr7a0z8OsmdRG2HhcP8U6sltpK iFdHRa+kL2wZLGOyhw/IFIBDlxZKEuMKiLQ6+dl+eSYpmqsE0gr4/r4rddPq4YPlSyTJ 4nHM/xHhlaEWb4aJyT28nGn3I9ecC+wwzPJkEqEcMFaN0/6208hdDg3CxtF/5CsolIWV D0WrCq4s4uYgU5ugzk0Jl20NRxQic63ACJlh2HhEIwvfP6XyUhlJwNiD2HpG6hgfR058 QmyHHm2Y49rCVF3vwqbWELVteNn4WdnCsr/cs94xCfxnun4pvi6x5zu2Ppxpl2XwfsZk g4nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005275; x=1703610075; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SMIbD+dY7Kjgg6ECXdMxWD6N2Rzqy4kZE/eQIX1m8rA=; b=Inlerd6KChWpKfCmwvcfT6OZw15roJKezogecdIuQBI5t7fCPhGVcz16LZv718GesW UHHTyB1ecgBgD+R+Vn623qGMQWHHcJV89hxkAOndww0h2T1kV1MKSDZwzHCFJulha1Dq iFe+xvVRVL79T0V0IRv9S4FZduyzPnpUQ8iYf5yGoVU+wuI3pMYFG2YVtOBSi5xZxF3Q gp6ipsWw7i/1gem2gix99ZAgAuqafU+IvQkV0f98SJ8GTh0g49zYenvkRWuFk8iZP818 neCc743YIR/3xokmyr+SuSHR2MH1Ocn2pMXUKB9zXGbrR5602QhTDZe2g5qcRZ0VeCXn eaIA== X-Gm-Message-State: AOJu0YwzwZq+0cZMQjMMEDUW+5SuvhtlQwWdVOO3VkK8umIWzCmuan0u X+/6UILIE+knqEyqqCC05A== X-Google-Smtp-Source: AGHT+IFd/r09bOpDmnqqwNJVgTHnXa/6FuakfAQjMYF9yiMWHDt7k1Pyk+VRkFPu8kUv7M2V8n7jSg== X-Received: by 2002:a05:600c:6988:b0:40b:5e4a:233e with SMTP id fp8-20020a05600c698800b0040b5e4a233emr768909wmb.64.1703005275517; Tue, 19 Dec 2023 09:01:15 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:15 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 09/29] drm/rockchip: inno_hdmi: Remove unneeded has audio flag Date: Tue, 19 Dec 2023 18:00:39 +0100 Message-ID: <20231219170100.188800-10-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090117_626042_308A03DA X-CRM114-Status: GOOD ( 12.33 ) 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB drivers/gpu/drm/rockchip/inno_hdmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index d99896f1a73a..58aff7a9c09a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - bool sink_has_audio; unsigned int enc_in_format; unsigned int enc_out_format; unsigned int colorimetry; @@ -554,7 +553,6 @@ static int inno_hdmi_connector_get_modes(struct drm_connector *connector) edid = drm_get_edid(connector, hdmi->ddc); if (edid) { - hdmi->hdmi_data.sink_has_audio = drm_detect_monitor_audio(edid); drm_connector_update_edid_property(connector, edid); ret = drm_add_edid_modes(connector, edid); kfree(edid); From patchwork Tue Dec 19 17:00:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498592 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 06670C41535 for ; Tue, 19 Dec 2023 17:02:34 +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=WetzL6zPNuJDccHDMzJ/FKgIhaAGYWgBgBt65rQPva4=; b=dUxOHFx0oomp5B Wf26QwaQzm4WuPZ8ftNn0YEoAwcdhENbKKMkkwnpXpDSzZUJMQi5cmNT6aXYjfXinTquby2/Y+49e tvi8laC3gQ6rM77jeN+soeOU9ZUa+sHuU0b1OFZZJxQDz5Xatd1Z/Cb9+7oT+IK8Ga3hToLsr7tth Pc/TG9W2+As/LMBWKaUeNcYWnd5odZ2cdGci4Kkr0i5zxC40ksbx52S0cYjYPFfi89lIMDTRd0QKF B0weVDDZ6xGGrrx3DAGGOmorHZRDT91hdLMu7DEX7hTcC7/78d8Jv2sERrm92jXVXMCyNi+IYuIXE b6yuu/GoSM7YJADThOMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTl-00Eop4-3A; Tue, 19 Dec 2023 17:02:01 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdT3-00Eo4a-2V; Tue, 19 Dec 2023 17:01:21 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40c339d2b88so51520385e9.3; Tue, 19 Dec 2023 09:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005276; x=1703610076; darn=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=iFJnc/mxwT7AOuXgJJftqh12jwZWWgTZW7pO4s+kLaU=; b=cVl5YWd7xKD7LiWRG15+NGAlFCKrlBuxXB941pYMKM+D7xk7/ma5Y/rpJM8myT7jv7 OiIhkxP5Ns4Wb6cErZVwQBBOotVrCD99Ut5+bCpFnuajlY+j8YAvqJdGHpaV2OAcy6b2 1uE8xeqNknxtGr9h4tBU5bqA8A+EeVvO8IZ9PLMQ3HegnmHymHX6SztYNhxMOB1+pqLu qKXIRejWmz79JjEX9F3EYZdm/0LMH0UmjSRE7PDjYyB9+ttB7R0DfufGx5JOI7YCL9/3 yxmeHZj5V99q0XZSk2tBJPi6DPPU1taRR1BnnIMg9PqLC20x/HXYWuSce9tGUhflf+xn IqOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005276; x=1703610076; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iFJnc/mxwT7AOuXgJJftqh12jwZWWgTZW7pO4s+kLaU=; b=q0jivb+vHOnDxcyuBLncjgT6RJGnFYYhi/HL/23h5xO2tzRaTA8hjqufmREWv/QDqF 00WvO7qXzQq7cbAeY9Lve9LhXd0TF43crlbnhodhykWrMjKo4zlhufvhawN1cwfvY/jm cf6rfCTL8FdN0N1OQ1cqR/BLkvFponYB7sL5PEmkstGQoU2i8StNGBRqdXaE7uNeuJg6 Axl7ZKUPoiEe0e+kddAke1VJ3OJXo7droB7id9WT6Kcq+CZNOGpUSISIGFy4ypJMxuE3 yODGvzu/i/m4DfEpzSgeleOMERqQSj+aP6me69TEDwnEDa/B5ckigdy9Dnfehnu9YFVj EfJg== X-Gm-Message-State: AOJu0YyCx3amLeO1u/QHI3xwiHXYqocmAOSyHCDHSATZ3khzVC30cAAC BclpIilyJMCv4DSTXYpb3g== X-Google-Smtp-Source: AGHT+IEbPw77YvJcAXZpRTG+THyzCBpu8TjojgDNiNM8LfkQxoe6a5lRkYeVjQYnPtzFk5poHXDo2w== X-Received: by 2002:a7b:cbd1:0:b0:40c:32b6:866c with SMTP id n17-20020a7bcbd1000000b0040c32b6866cmr10082301wmi.68.1703005276391; Tue, 19 Dec 2023 09:01:16 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:16 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 10/29] drm/rockchip: inno_hdmi: Remove useless input format Date: Tue, 19 Dec 2023 18:00:40 +0100 Message-ID: <20231219170100.188800-11-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090117_845724_8F26C699 X-CRM114-Status: GOOD ( 15.15 ) 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 Tested-by: Alex Bee [made checkpatch happy] Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 41 ++++++++-------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 58aff7a9c09a..7c75feedacad 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - unsigned int enc_in_format; unsigned int enc_out_format; unsigned int colorimetry; }; @@ -328,47 +327,30 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) v_VIDEO_INPUT_CSP(0); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); - if (data->enc_in_format == data->enc_out_format) { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) || - (data->enc_in_format >= HDMI_COLORSPACE_YUV444)) { - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); - - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, - m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, - v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | - v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); - return 0; - } + if (data->enc_out_format == HDMI_COLORSPACE_RGB) { + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); + hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); + + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, + m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, + v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | + v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); + return 0; } if (data->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) && - (data->enc_out_format == HDMI_COLORSPACE_YUV444)) { + if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; - } else if ((data->enc_in_format == HDMI_COLORSPACE_YUV444) && - (data->enc_out_format == HDMI_COLORSPACE_RGB)) { - csc_mode = CSC_ITU601_16_235_TO_RGB_0_255_8BIT; - auto_csc = AUTO_CSC_ENABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_DISABLE; } } else { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) && - (data->enc_out_format == HDMI_COLORSPACE_YUV444)) { + if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; - } else if ((data->enc_in_format == HDMI_COLORSPACE_YUV444) && - (data->enc_out_format == HDMI_COLORSPACE_RGB)) { - csc_mode = CSC_ITU709_16_235_TO_RGB_0_255_8BIT; - auto_csc = AUTO_CSC_ENABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_DISABLE; } } @@ -443,7 +425,6 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_info *display = &hdmi->connector.display_info; u8 vic = drm_match_cea_mode(mode); - hdmi->hdmi_data.enc_in_format = HDMI_COLORSPACE_RGB; hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; if (vic == 6 || vic == 7 || From patchwork Tue Dec 19 17:00:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498591 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 48445C46CCD for ; Tue, 19 Dec 2023 17:02:33 +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=WO/LJZlxrQhcdfVtQjGZzsxgB2pG5iQB9v7dYomDbSA=; b=a2/AWGIkWKcy8L nFG/FSHOuV78X4hz9s7RXTPVZzdTeMiBT3d6ezxaPvwQMNZtN6v1LKrXWzzd/TYHwootpxysNrub8 Yoq0eVkxBDxSMYeuhnsrNzwpGtuI2Zq1Ecp0XINebAy0Ve0Q+gJfCAm0i9PGN4ST6pOIy4OVMpmr9 HqoZHARuqL4iu1yTu+jEYrf8CEQ/ZZKnw2ohzLt41h5FAQIY8s2T22bJuWoGsBcAVmWpwCaNt53xn l+/g68uwUoKwzmyBhX2KL5LmyS+OvOsUT53NhP/SzNzvZeBIt0tDAL314r+MIqRLnYmNvOLPAn1NL BNDtx1R8VnSDu6116BiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTm-00Eoq5-33; Tue, 19 Dec 2023 17:02:02 +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 1rFdT4-00Eo5G-1o; Tue, 19 Dec 2023 17:01:21 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40c6ea99429so48500085e9.3; Tue, 19 Dec 2023 09:01:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005277; x=1703610077; darn=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=Vfw1A5kPCqeEpvkS0qSDCc84V56+/woGo5pclCQd9uw=; b=b7NAYHTuuMWBqmBXhf0yeaJe4aGe/9EusayLZwaE0YGSCP5lnOYMpF8A6IM8iGf+zi xbMmTqFWIGcnt7tanv40AotB3cvjmU63ZfATd0ehSikeU1dRbSMx7dmFHksBHp6/fa92 8iOo1bavEAQVsMUrJSC8u88cchvnClFbKnsj6Yy7q6CO3I6Ajrnw1MfJTKOjbDxqAmvr uevOCvCTZ0b34b1Geo0VnxKmm5sxdgmWTSrrsOvL7UzrCnCibJaHLDb3bY/qt0R6cBvc 0reVeaLE7oLYWsCIl7/ZfxmhFF25gOg3P2Zno3z1p8N4FXVIMzIxXgshM0b3opIsiHES jf1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005277; x=1703610077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vfw1A5kPCqeEpvkS0qSDCc84V56+/woGo5pclCQd9uw=; b=mm30ycGdQsIBYB17vb+InXomdSv+VEip/vvGxu50YvI52rISRNBiLwkTadKX64NQm/ Yr6bPctKmtZ4gfe/P6dZh3Jzsm705w3qlF13nC3w+bPOXoNTkagE8xrN1c1Yb0zhjT9b bNa2WWmG3c28JCGsBBpAlN0OiGASEdj+eFYhXj4xGqzbpxSAYZJTuRuVv4U3To8Methq TdwPffQedoo1VMzq+Iqr0FaBUCwqSC1BxR0gMVLvZWTTtnNG3Fh0FDlYQC/cmxs7I+mh 0K28unLRMDBFPjIu8djCymX9AB/rvdfcd3EjvY66TxrGW13kMIb0EZ+1HJV0hSTPlGw2 Zptw== X-Gm-Message-State: AOJu0Yw/ayN5koJa9cl5/MLzvSk07fcuWslYAlBh3aE79sE+M+eVqiDb zO7s2G5ePK/6H6N6gQxyew== X-Google-Smtp-Source: AGHT+IEoAr6dXqLAHpqmd1Dg8MViO9ibFuLzxT2b+W8ygqu4NI2IAAxTliP/CtM0Lm8338Mg9O8/2g== X-Received: by 2002:a05:600c:5115:b0:40c:6924:5172 with SMTP id o21-20020a05600c511500b0040c69245172mr3185004wms.92.1703005277195; Tue, 19 Dec 2023 09:01:17 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:16 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 11/29] drm/rockchip: inno_hdmi: Remove YUV-based csc coefficents Date: Tue, 19 Dec 2023 18:00:41 +0100 Message-ID: <20231219170100.188800-12-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090118_631166_456D7529 X-CRM114-Status: GOOD ( 11.65 ) 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 changes in v3: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 37 ---------------------------- 1 file changed, 37 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 7c75feedacad..04344ee1265d 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -74,49 +74,12 @@ static struct inno_hdmi *connector_to_inno_hdmi(struct drm_connector *connector) } enum { - CSC_ITU601_16_235_TO_RGB_0_255_8BIT, - CSC_ITU601_0_255_TO_RGB_0_255_8BIT, - CSC_ITU709_16_235_TO_RGB_0_255_8BIT, CSC_RGB_0_255_TO_ITU601_16_235_8BIT, CSC_RGB_0_255_TO_ITU709_16_235_8BIT, CSC_RGB_0_255_TO_RGB_16_235_8BIT, }; static const char coeff_csc[][24] = { - /* - * YUV2RGB:601 SD mode(Y[16:235], UV[16:240], RGB[0:255]): - * R = 1.164*Y + 1.596*V - 204 - * G = 1.164*Y - 0.391*U - 0.813*V + 154 - * B = 1.164*Y + 2.018*U - 258 - */ - { - 0x04, 0xa7, 0x00, 0x00, 0x06, 0x62, 0x02, 0xcc, - 0x04, 0xa7, 0x11, 0x90, 0x13, 0x40, 0x00, 0x9a, - 0x04, 0xa7, 0x08, 0x12, 0x00, 0x00, 0x03, 0x02 - }, - /* - * YUV2RGB:601 SD mode(YUV[0:255],RGB[0:255]): - * R = Y + 1.402*V - 248 - * G = Y - 0.344*U - 0.714*V + 135 - * B = Y + 1.772*U - 227 - */ - { - 0x04, 0x00, 0x00, 0x00, 0x05, 0x9b, 0x02, 0xf8, - 0x04, 0x00, 0x11, 0x60, 0x12, 0xdb, 0x00, 0x87, - 0x04, 0x00, 0x07, 0x16, 0x00, 0x00, 0x02, 0xe3 - }, - /* - * YUV2RGB:709 HD mode(Y[16:235],UV[16:240],RGB[0:255]): - * R = 1.164*Y + 1.793*V - 248 - * G = 1.164*Y - 0.213*U - 0.534*V + 77 - * B = 1.164*Y + 2.115*U - 289 - */ - { - 0x04, 0xa7, 0x00, 0x00, 0x07, 0x2c, 0x02, 0xf8, - 0x04, 0xa7, 0x10, 0xda, 0x12, 0x22, 0x00, 0x4d, - 0x04, 0xa7, 0x08, 0x74, 0x00, 0x00, 0x03, 0x21 - }, - /* * RGB2YUV:601 SD mode: * Cb = -0.291G - 0.148R + 0.439B + 128 From patchwork Tue Dec 19 17:00:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498593 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 B4829C41535 for ; Tue, 19 Dec 2023 17:02:40 +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=GLKwDjdTFGLTkjZG1Pzv2hZTavEvkWowKaKVnxFiwTk=; b=wDwUjqXP9YJMe9 2kqXbEiRTkqqTydIKp6xSE3LOKPoSdUUQevesEXAq8WCAxrIllywarFoRJWajHqeYlPctiVdSANtF bEQlWvEMAZ1RAJuQ3xWuvgFrNV7oAN7AhRFM0MuarfE4RVkRD/9Th1HYLpZnhQipJBqOFIG4OHLdG htFHepNegfBo8wKPBeGHBVhR04lVaFqISM+HeRK5/aQJl93Ma8ZND0R4YzRtDC1FxxbPfYKg0TyWy BTwlnE96LNDYX42OUg232NwORTyvdHD5G5nsZi8ZKF3pOrJUC6QOVRUIEiJMfE3c10ITVtwxvLk6h IA31NzlmS/nX0og4fhmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTq-00Eosk-1P; Tue, 19 Dec 2023 17:02:06 +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 1rFdT5-00Eo68-28; Tue, 19 Dec 2023 17:01:22 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40c6a71e88cso60302625e9.0; Tue, 19 Dec 2023 09:01:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005278; x=1703610078; darn=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=pIuIHzK0qm/T7D2HzJVN2+t1kaAcSj5o4LHFrFwAH3M=; b=MbsisazqgKBVx02sgocIIDTvE5nCiD7GQFed60x28Y1ibjgq3MiiJ9q6OS/pkQ04EE D5ob7KtCcGOhSZmMpV6SYqKenpuVxBBjY577GdGtn3bOcKG630LDFzIu9lvdtTHq0ext /OIdrrDiwKKzmlVbDTq6Cj6qEIkriin+TwXiZox9exVRMNFzIppeVjcrefrQ1v3yZvFJ HIhq/e5R/wtvc6ShzT0Hi+qCsKdio/vH8irBIl5j0nXyFwmW+arUWs33SglVSSI5HV4l pGpG0wIE4K5KPUu2zQp+BB2aaxbQtlYDqrjbR0/29Le4kM3ZusnYXl+RZNSh+2hbuhOv zXiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005278; x=1703610078; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pIuIHzK0qm/T7D2HzJVN2+t1kaAcSj5o4LHFrFwAH3M=; b=Sh4623ybpoUJLNg2SrJvgrqaDgu/A+dAb6caz+JyoSVXXhK1hJdxtFYBB86j/nxZm2 9Xeaes4pimBKp+xx+K/1XWpRzgYbLQ/JJ4+AtIKpjf97wqB/ZgGmSEq6VNWEwipFb3yG RoqFv3jDv8wDXOJdAO5qmgswtkn+fRzYpQoAN7wU9s/LId/YX4l6wT9uMipxU83PdPnq tTYBIy0Dl2EmbSBnIqT7e86fDcVs/3thPU2inboqOqDffDchApIlg++3v+cWTLGz02Lp sYOVeIPclXJNhgnWzum3iEoFScLDSOuvMd9hfk3l741ofbtfsDwGbUaNk5gBxY1rY3at ncAg== X-Gm-Message-State: AOJu0Yy3sZJCONPa3ddhumj4HmnIS0JeV9uEdyIqnpXIPt481V/MvSpx LZOKP4BuGbfx4wANDW3rLg== X-Google-Smtp-Source: AGHT+IG+MKZvHdr0LdojEJTOnBVthAxDJ27zyg41YEqLHjuX3KtlEV2RPBM3XFk88GAaBr0tl3d3Kg== X-Received: by 2002:a05:600c:a01c:b0:40d:2df0:ba12 with SMTP id jg28-20020a05600ca01c00b0040d2df0ba12mr458869wmb.83.1703005277928; Tue, 19 Dec 2023 09:01:17 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:17 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 12/29] drm/rockchip: inno_hdmi: Remove tmds rate from structure Date: Tue, 19 Dec 2023 18:00:42 +0100 Message-ID: <20231219170100.188800-13-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090119_749270_208C12FB X-CRM114-Status: GOOD ( 14.24 ) 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 tmds_rate field in the inno_hdmi structure is used mostly to configure the internal i2c controller divider through a call to the inno_hdmi_i2c_init() function. We can simply make that rate an argument to that function, which also removes a workaround to initialize the divider at probe time when we don't have a mode yet. Signed-off-by: Maxime Ripard Tested-by: Alex Bee Signed-off-by: Alex Bee --- changes in v3: - imported patch drivers/gpu/drm/rockchip/inno_hdmi.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 04344ee1265d..102195837206 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -56,8 +56,6 @@ struct inno_hdmi { struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; - unsigned int tmds_rate; - struct hdmi_data_info hdmi_data; }; @@ -134,11 +132,11 @@ static inline void hdmi_modb(struct inno_hdmi *hdmi, u16 offset, hdmi_writeb(hdmi, offset, temp); } -static void inno_hdmi_i2c_init(struct inno_hdmi *hdmi) +static void inno_hdmi_i2c_init(struct inno_hdmi *hdmi, unsigned long long rate) { - int ddc_bus_freq; + unsigned long long ddc_bus_freq = rate >> 2; - ddc_bus_freq = (hdmi->tmds_rate >> 2) / HDMI_SCL_RATE; + do_div(ddc_bus_freq, HDMI_SCL_RATE); hdmi_writeb(hdmi, DDC_BUS_FREQ_L, ddc_bus_freq & 0xFF); hdmi_writeb(hdmi, DDC_BUS_FREQ_H, (ddc_bus_freq >> 8) & 0xFF); @@ -421,8 +419,7 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, * DCLK_LCDC, so we need to init the TMDS rate to mode pixel * clock rate, and reconfigure the DDC clock. */ - hdmi->tmds_rate = mode->clock * 1000; - inno_hdmi_i2c_init(hdmi); + inno_hdmi_i2c_init(hdmi, mode->clock * 1000); /* Unmute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, @@ -800,8 +797,7 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, * PCLK_HDMI, so we need to init the TMDS rate to PCLK rate, * and reconfigure the DDC clock. */ - hdmi->tmds_rate = clk_get_rate(hdmi->pclk); - inno_hdmi_i2c_init(hdmi); + inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->pclk)); ret = inno_hdmi_register(drm, hdmi); if (ret) From patchwork Tue Dec 19 17:00:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498594 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 30018C46CA2 for ; Tue, 19 Dec 2023 17:02: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=U2fKQO1YD7iWYllVH7k7/VXeNH5y2rOGqnbLKuCvKkU=; b=CFg0vEcU8W35Kn SbJasttEMMPV09KCXrNWlihXhlK004gka8489wtWhLvum+Yj+tQPgTueWD5eh1iU90eA+SBmwxjN2 HNJbmBo7ehoMDpUJxAYlJOaDdQ322NAF7TdSIjRTRtexaabzASeNQnUtTx+gotzm9kRCklG00Ge5l H+Db85qllBV4sHiTTMQUOJoHpNh1VOFPHDXq4WNMhKUTvROl3niQaGXuXXhDuRjXz2ZFOgrstgNvq 992ykttH5ySfL8cC1b7wkCdX7Gld2EQ81vzdR+qws2uh970XV3aH9KqWPPWFkPsroJcYVOqdMNUvD Q+jO5nXIyxmj5xZ65uVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTt-00Eoxn-25; Tue, 19 Dec 2023 17:02:09 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdT6-00Eo6w-2F; Tue, 19 Dec 2023 17:01:23 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40d2764c0f2so11338075e9.2; Tue, 19 Dec 2023 09:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005279; x=1703610079; darn=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=3jFSrF2ePa7xhmT4OxproAZh4Ygmdhf+/ONdKCw7fIs=; b=bGoDlLP40SdFP47FCJjktnjZ/o2D23vLsD7EEBMkA0gGpCrVeZqIpUv5mZLfMmvsiV AYobcPTdMpeYG50yd+bLoINVi8mmxSH+3oTwfZJ81y6JDzEPKHnLHwShofvhfm5RyPL+ BvI7HujpiNGDuus/StVo9CkTDhz05155E5PYLm+zbzq1hcNYZIklsNs/M8FOEFgn/+Cr 6QOwfZ3tGmePHEgg1I823dJuD6dZ+Vxkffq151nKKqkagonu1Pi0CEnpT/on4YeiBrDE XnGhPLSeuDP02PkTCRULY1Pmo08FIv9pcbfFCOJ9kmej9ed0bil3pLYFyJ2z0mhfYi6s bLww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005279; x=1703610079; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3jFSrF2ePa7xhmT4OxproAZh4Ygmdhf+/ONdKCw7fIs=; b=pW6Sckf6kjsBM3DTfLF+X4xsvBUUI4K0lUPyJrycMMEENLYY4NlYj5l4/z0/iMcZGI bZ2/Seq2Dqnw6JzqvZSBZaWaw/PEcrDPNVJUoy1trwKBSZy9C45tk/gc2nJ9lZEiiHmQ I+/analhMKVXAho879eS9GcsrliUMRwAEkxGqLblfsNIDApAheP4au1vB6yDqHgDlRjO JryY7VdFuEv0boWwfI40/45eqzDbMrKawpzviflKxiyEP8XoeYCKotgAB3K7jE8dSFJ4 ovBJsfP7NYTRShprahNWypciqhtsHir/2oNr/H4ji8Hw0aVe64pHxAbfGUoGbJMB1P9+ VmCA== X-Gm-Message-State: AOJu0YwYAbniVzODXt2fkw2QXGEGEwZblhj5xJXivmxIZgfKS0dpXCVm 4aDXoSqGqf53/51wSOwFHA== X-Google-Smtp-Source: AGHT+IE+D/wsUHtpUCKDcNtLx2i2uZszTMnUPPGc/pYOfbpmGpnDQa/hE8nWdBHI/JGmbVOwIEoXtQ== X-Received: by 2002:a05:600c:4917:b0:40b:5e4a:4060 with SMTP id f23-20020a05600c491700b0040b5e4a4060mr8802782wmp.128.1703005278839; Tue, 19 Dec 2023 09:01:18 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:18 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Jonker , Alex Bee Subject: [PATCH v3 13/29] drm/rockchip: inno_hdmi: Drop HDMI Vendor Infoframe support Date: Tue, 19 Dec 2023 18:00:43 +0100 Message-ID: <20231219170100.188800-14-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090120_797738_E57D5585 X-CRM114-Status: GOOD ( 15.46 ) 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB drivers/gpu/drm/rockchip/inno_hdmi.c | 35 ++++++++-------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 102195837206..5c9f1325441f 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -206,11 +206,15 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) } static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, int setup_rc, - union hdmi_infoframe *frame, u32 frame_index, - u32 mask, u32 disable, u32 enable) + union hdmi_infoframe *frame, u32 frame_index) { - if (mask) - hdmi_modb(hdmi, HDMI_PACKET_SEND_AUTO, mask, disable); + struct drm_connector *connector = &hdmi->connector; + + if (frame_index != INFOFRAME_AVI) { + drm_err(connector->dev, + "Unsupported infoframe type: %u\n", frame_index); + return 0; + } hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); @@ -226,28 +230,11 @@ static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, int setup_rc, for (i = 0; i < rc; i++) hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, packed_frame[i]); - - if (mask) - hdmi_modb(hdmi, HDMI_PACKET_SEND_AUTO, mask, enable); } return setup_rc; } -static int inno_hdmi_config_video_vsi(struct inno_hdmi *hdmi, - struct drm_display_mode *mode) -{ - union hdmi_infoframe frame; - int rc; - - rc = drm_hdmi_vendor_infoframe_from_display_mode(&frame.vendor.hdmi, - &hdmi->connector, - mode); - - return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_VSI, - m_PACKET_VSI_EN, v_PACKET_VSI_EN(0), v_PACKET_VSI_EN(1)); -} - static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { @@ -265,7 +252,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI, 0, 0, 0); + return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) @@ -408,10 +395,8 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, inno_hdmi_config_video_csc(hdmi); - if (display->is_hdmi) { + if (display->is_hdmi) inno_hdmi_config_video_avi(hdmi, mode); - inno_hdmi_config_video_vsi(hdmi, mode); - } /* * When IP controller have configured to an accurate video From patchwork Tue Dec 19 17:00:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498595 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 A78F9C46CA2 for ; Tue, 19 Dec 2023 17:02: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=AngtmApZHSZfRIRk1KciabO97Oxme64UMqROsLo9Tes=; b=ygsqwuwMZFoByc /EaBG7ueYNwWUdDFxChYcptLx//f02Fnmwl+OLZIwXPwegXCVMICm0nimKEFtn49K/OnCMjiadxf6 BUMoR6P1bh+JgH25+emyuKFvQ9EF/o/+XPLSHVD4I4d8C0tJre0kXV/dgkzZ+j1PP265tRWuVS9/R 47qukNiSv9PuLlxMe/nQBKEN54O6M6YfJDWbDePuSTKJcE6xhVINJXboR93P3e083/oXtJsg4iBLN GBU7Oc1iaiotVQgTY59foaR9Z9PyhLH6Xu6kHCVVQwV7XIr/s5MDsZJQUy1QbhZ0reKteVy9yHGn4 pascQtOIMXlpGXt1AGlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTv-00Ep0h-25; Tue, 19 Dec 2023 17:02:11 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdT7-00Eo86-14; Tue, 19 Dec 2023 17:01:25 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40c60dfa5bfso56960505e9.0; Tue, 19 Dec 2023 09:01:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005280; x=1703610080; darn=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=WLVOVeutPpE/o943uN9J0cWjrEPzXhsU4YUzCWYMJxA=; b=eoM1LoadhScn6zSA6RCyD7FhsESXC6Mx3j5q8Gj9ODWasOcRLMZ4MWceWebQPJ6oEc rW8sklXdmA11ip4yz4M6FLlLMmIBoVK1WHqNURge15Lbfh+WocSMqrHhmdo/OXaDM3IG D7erdP9wY8qagHNsEc1FzOtJXvNbsiqAEBY8DKejeDBhOXSeIqEqmGmxnLvRutntGglH A++oMhuv5bPKY43+q6LdThtHPepnL4CZM1VstDXuGLBfkK5bN1YCPNV4GCFEDtBO+gZ/ QdBYUW+lTkfJMULq8XHeq3hwAUHnQA+iTmvxgLKkhUXo9TQPY2rLGqdnzrVjIDrbMkPH lKvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005280; x=1703610080; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WLVOVeutPpE/o943uN9J0cWjrEPzXhsU4YUzCWYMJxA=; b=hd3fn2zBgVV96wbwLkzNc7+BCaxWb0KkYd47yWh4o9WFHBAWnSUicfn5KRbEOdYkzu xS+dda1I1dNDqE6FRhVkI54zNTjgBnXmROk+TgsvEyyVu5VRss2EC6K/hixRHoWoY2Wo 6reDV93BUh6JOo0rWhMV/KN1Y9dEW71GfzdO7ssPwP8w6HNZCsE2JKaCxdpMu2fieTwR W+kemyTbNTIUKdVb6WlWl0htV2VEQtotLOiIYqqhqweNavgaui371Ra09tgo+FLJBhe6 MhO9uDtEndZ01ZIPgZdMIMW+5gqoFUKHAEaK2hyu9Nnbglw7PxDBg4IEcFHR4Vf/vswk gq9A== X-Gm-Message-State: AOJu0YxUVK4TmP5jtkjQQPWoNHUqLmgIPmbPSYjS2qZlme7dd7E8d8+v 4ytXz0wDtiLnFZGVoqRe4Q== X-Google-Smtp-Source: AGHT+IGRlC9Raac+QygKKLDkdfOeiYrk+nrbVIe+Lff6n3kh+jfvi6jEh6b9PVLAsBO1Ls90F8sAzQ== X-Received: by 2002:a05:600c:808e:b0:40b:5e59:c581 with SMTP id ew14-20020a05600c808e00b0040b5e59c581mr9903834wmb.171.1703005279654; Tue, 19 Dec 2023 09:01:19 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:19 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 14/29] drm/rockchip: inno_hdmi: Move infoframe disable to separate function Date: Tue, 19 Dec 2023 18:00:44 +0100 Message-ID: <20231219170100.188800-15-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090121_390771_A932011C X-CRM114-Status: GOOD ( 18.31 ) 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB drivers/gpu/drm/rockchip/inno_hdmi.c | 46 ++++++++++++++++++---------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 5c9f1325441f..10466c2aa520 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -205,34 +205,44 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, int setup_rc, - union hdmi_infoframe *frame, u32 frame_index) +static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, u32 frame_index) { struct drm_connector *connector = &hdmi->connector; if (frame_index != INFOFRAME_AVI) { drm_err(connector->dev, "Unsupported infoframe type: %u\n", frame_index); - return 0; + return; } hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); +} - if (setup_rc >= 0) { - u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; - ssize_t rc, i; - - rc = hdmi_infoframe_pack(frame, packed_frame, - sizeof(packed_frame)); - if (rc < 0) - return rc; +static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, + union hdmi_infoframe *frame, u32 frame_index) +{ + struct drm_connector *connector = &hdmi->connector; + u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; + ssize_t rc, i; - for (i = 0; i < rc; i++) - hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, - packed_frame[i]); + if (frame_index != INFOFRAME_AVI) { + drm_err(connector->dev, + "Unsupported infoframe type: %u\n", frame_index); + return 0; } - return setup_rc; + inno_hdmi_disable_frame(hdmi, frame_index); + + rc = hdmi_infoframe_pack(frame, packed_frame, + sizeof(packed_frame)); + if (rc < 0) + return rc; + + for (i = 0; i < rc; i++) + hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, + packed_frame[i]); + + return 0; } static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, @@ -244,6 +254,10 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, &hdmi->connector, mode); + if (rc) { + inno_hdmi_disable_frame(hdmi, INFOFRAME_AVI); + return rc; + } if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) frame.avi.colorspace = HDMI_COLORSPACE_YUV444; @@ -252,7 +266,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, rc, &frame, INFOFRAME_AVI); + return inno_hdmi_upload_frame(hdmi, &frame, INFOFRAME_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) From patchwork Tue Dec 19 17:00:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498596 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 9B380C41535 for ; Tue, 19 Dec 2023 17:02: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=5XBH5al7O+fGRZjBDAbuUezL5JntfM0kcG1CVzfjymE=; b=afeSZk87G+dKAf JWu9yhIdPbE+mz9C2ME9ZB7Ty5aRPpJXfeE/pWZcqIAF/+9yqaE6Jdes5/BKO7W3tGe9OSiyKaEDr fmcIvD942RoknOADOR21KELzqwtz+Ad6NBn1DO9iCxjg9gJviAVWlmEn3komAlQLv2TrrQftm8GsL CPbYfbxw+4/icX9wld07GE9cqWHE62edw0/XqlLb4RMg3eKcpIVbIDokDZLavgCaVxHHhdF/n2ZYa QpnMZD/dGXaVtbMw+HsGxkgt5qc7nQqWa2UBU8RZNEQvp6Q5jnkHvBqZq36QSHSZyOleIYY+3ZyxL ygSRxfNy9/qAxRrX1I+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTx-00Ep2v-1H; Tue, 19 Dec 2023 17:02:13 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdT8-00Eo93-1I; Tue, 19 Dec 2023 17:01:25 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3364c9ff8e1so2641743f8f.0; Tue, 19 Dec 2023 09:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005281; x=1703610081; darn=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=61BEi2enFRPw/8EyUZ5EsB7jHaGAUQBqgpyqmRd+nco=; b=Z7+zvUzty6NbnRgPHMh40Xh8tz6+2BlnOItYMIyVvLWOJLMWOnDrlP2arKWKwNxr3L ZjLwbF49iq7dJyBrnDwLjvqNd55LwuwSWe+qyPgq/HQYmjldofS5GCaUrtPsSv2KQbHp cJ8hc28XABBB3njeAhL1ss6OruQ9zS60wBh4gPg5yjuX3Ac3qKmFRz19m5bTsli5q5ZD km/PFK5SJOs4exvxsCiSTEw5QWWQgbwpGCKXlWn67AM0+k+JjMI81hsdLCQEhsoJXV0q en2myyGCJBYpbTSuUeH7t0fubzaq7YjeHzbbEYNOVrXBChsfcO1N+2b6NXDEpOJ0n7aF bQyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005281; x=1703610081; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=61BEi2enFRPw/8EyUZ5EsB7jHaGAUQBqgpyqmRd+nco=; b=h3BDPSS9Thkz4LQ05blpYzSIdIHK+hP6fY/sylw/OM7tYVMAhk9tBsgc7ptSn2g2oL /YMqdNxDsWS2lIIZZEtJZTYXRUZ8m/erGjaQKDR2JALwW7MLP6MDP2BJsj80Fs/Z6PlH sbozWKIwh/tCH7XJ06nMRx6vxDjDuxhjZup1B7PmDrdKfbcsIQI7DqTQnGpWPbjeciS0 +01cQAcHubqeDsOiN7ejPD7CsaGdVxM3clVTt9vBrc1Hf3d39OtWIo5DlQHm9YvDCn9j n7d72PmfHBL0ohBWi8WJa07i7KaY9lRhhZperN9r/Wahd0ulHH724ITpRZCEuZqXxgqR VxcA== X-Gm-Message-State: AOJu0YwT3aQVMTDsqeudhJSBOWTlwmAl5KC1n0Cb/IVUs5Q8LuHOu2c+ q0H3MyP7lJy7g6zTMXAKeA== X-Google-Smtp-Source: AGHT+IFvZaeGlrEwLMNNw21eXmXhkFIQZ/fJCEgjVKuGgxweCAiX31aApdPOXaMkdZasYRNKTPgA7w== X-Received: by 2002:a05:600c:3115:b0:40d:177b:c3b3 with SMTP id g21-20020a05600c311500b0040d177bc3b3mr847099wmo.18.1703005280608; Tue, 19 Dec 2023 09:01:20 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:20 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 15/29] drm/rockchip: inno_hdmi: Switch to infoframe type Date: Tue, 19 Dec 2023 18:00:45 +0100 Message-ID: <20231219170100.188800-16-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090122_480688_BF70B47B X-CRM114-Status: GOOD ( 13.60 ) 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB drivers/gpu/drm/rockchip/inno_hdmi.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 10466c2aa520..49367ca24125 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -205,33 +205,34 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, u32 frame_index) +static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, + enum hdmi_infoframe_type type) { struct drm_connector *connector = &hdmi->connector; - if (frame_index != INFOFRAME_AVI) { + if (type != HDMI_INFOFRAME_TYPE_AVI) { drm_err(connector->dev, - "Unsupported infoframe type: %u\n", frame_index); + "Unsupported infoframe type: %u\n", type); return; } - hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); + hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, INFOFRAME_AVI); } static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, - union hdmi_infoframe *frame, u32 frame_index) + union hdmi_infoframe *frame, enum hdmi_infoframe_type type) { struct drm_connector *connector = &hdmi->connector; u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; ssize_t rc, i; - if (frame_index != INFOFRAME_AVI) { + if (type != HDMI_INFOFRAME_TYPE_AVI) { drm_err(connector->dev, - "Unsupported infoframe type: %u\n", frame_index); + "Unsupported infoframe type: %u\n", type); return 0; } - inno_hdmi_disable_frame(hdmi, frame_index); + inno_hdmi_disable_frame(hdmi, type); rc = hdmi_infoframe_pack(frame, packed_frame, sizeof(packed_frame)); @@ -255,7 +256,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, &hdmi->connector, mode); if (rc) { - inno_hdmi_disable_frame(hdmi, INFOFRAME_AVI); + inno_hdmi_disable_frame(hdmi, HDMI_INFOFRAME_TYPE_AVI); return rc; } @@ -266,7 +267,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, &frame, INFOFRAME_AVI); + return inno_hdmi_upload_frame(hdmi, &frame, HDMI_INFOFRAME_TYPE_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) From patchwork Tue Dec 19 17:00:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498597 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 2D5EBC46CA2 for ; Tue, 19 Dec 2023 17:03: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=2UN8X71ICwtvLerQNcLYHCaSefas9RSQDOs4eu9MqpM=; b=0uaAqdlHkfuw4Q 4ZMEOsUj/BIJj4BZlGQOwbIJ0rwujWIF8BxERG552cuM44kGVwMD5ENEjWhpPf60gzuSPpAXbLPkz NX8nvID3BUXeks6vf/tlWG4c5DmdMbjRWY4sJe2EGRoHP057LOpdyyvqRCuIjvE/FSjnSH+0qaV32 Bga1ByH2u5IxNzipF5cmBRAdmwtUEeEjRTfiyg3RxluennUHsDvhhobFTvixL1g5HnJHAzovW6eRs H7yUXk3gPkYRCAEOCeukZCVR2AtwhrGgPtiHPuum52VgqejJhBWyG3tc2c3+kw10jgCCkUoMp5iB6 +ftbBrIesc6D+5yEO3gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdU8-00EpDw-2N; Tue, 19 Dec 2023 17:02:24 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdT9-00EoAS-0q; Tue, 19 Dec 2023 17:01:27 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40c6ea99429so48500975e9.3; Tue, 19 Dec 2023 09:01:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005282; x=1703610082; darn=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=+s72CnTe6ZV2IMv3pM/65G6mJvxbtoIjfslzb5tL7Ro=; b=JKzSfwPTDQ1dFYGtxuofS+qLMLMKYqE0jzcHyXQ593PZAf4451yulNpWOmU+mNVdAh Feaxa3lGfdghrJ06Pkbellz0JZ/XfpLSXtFAsipBxcC0olb+lSQYcOtaN4PpA/jvU/qg QOelVImog3XuJjFip/NK8PPpqzi0+BI7b29zzlpcAU/CzYM+I5+RM4YA19KSDCLaRrSt JFjlpsIrHevl2F+cLEeLdNDestNQCn9sVLHt0U+BbPONqCu3dzs9KwxuX+94pcEsXjlL JVSGZfqCmO86G/WGSf9kMBvKbS6UNY5INxQpmADdqD7QEpEq9y95Qoorh2YJnW8riDHm HMSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005282; x=1703610082; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+s72CnTe6ZV2IMv3pM/65G6mJvxbtoIjfslzb5tL7Ro=; b=qpGfuqsK6PICvd8oipfqDtpjPD3H8ewgAwJEubdQoF5+4iDi++SCnEYmH2GaDibSXU iY4cq0doF2Zp4nki2iZOUc5S3ckBoc1AbXzedQBGaOC0Noq01jpdO51UWM369tEbXZaa cVsv5T41BTbYEskoRJ/l9Hbz4Isvu687degFYNsrfHvCxFGqM965RwY8xkX3kdlh7TV/ INCYw2qzw0zbrefgAoaxdV7RXljv7/HCuhCF1/6UtdimCSbs89+eckRdb1qpQ4Km6jfr q+acaOuYZGMI3aEnvOvJKQ3KmH3c0M1KTEI2U6sYq+20RolH3av958SbH46Ypz5xkm1v VdPg== X-Gm-Message-State: AOJu0Yx9o/kt4tfhK0WRV2+UuF7NBgXkmYdP25grJ3j7KsRuZ4SExXtg qrskGov1w/5jMY/mGa64Xw== X-Google-Smtp-Source: AGHT+IF42FDcOro97JAPmk/FhpAyFJfar6DWOBNmBzFRzZO3M20X58L49lSjppkjM2XFoVbHdGgTNw== X-Received: by 2002:a05:600c:244:b0:40c:2b4c:623f with SMTP id 4-20020a05600c024400b0040c2b4c623fmr6217351wmj.82.1703005281769; Tue, 19 Dec 2023 09:01:21 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:21 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 16/29] drm/rockchip: inno_hdmi: Remove unused drm device pointer Date: Tue, 19 Dec 2023 18:00:46 +0100 Message-ID: <20231219170100.188800-17-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090123_333562_90F60153 X-CRM114-Status: GOOD ( 13.17 ) 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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB drivers/gpu/drm/rockchip/inno_hdmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 49367ca24125..51c1a69dfcc0 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -44,7 +44,6 @@ struct inno_hdmi_i2c { struct inno_hdmi { struct device *dev; - struct drm_device *drm_dev; int irq; struct clk *pclk; @@ -757,7 +756,6 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, return -ENOMEM; hdmi->dev = dev; - hdmi->drm_dev = drm; hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) From patchwork Tue Dec 19 17:00:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498598 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 2AE28C41535 for ; Tue, 19 Dec 2023 17:03: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=b2IAJTFHYb/Edixg19xK/lyzT5fj9LZGEoJEPUnng8I=; b=xpsTp2DUUYho6x +LyV9v7m9jhlyvS6BqQenuSolJeSN8HjndOq3hxrTGilf9ZT6+UJiHsc+AOAA0oCccUhRioOIEu+F 7+3VhfeYd9tTJUwfMEqCyDKQwA91LZpEo9Cl7NyXdpar58Zp3PCsgYU12etsrDOuzWqMMNn9W332h ST6L5LkhRaQPvIRHKyVqCb3ljhv1uKtmKdaCUvwlfW1YQJvvRJ5RCBNaf5tIOvqwTvNHXGEaRknRV pFbhhqJrU0rewJSvt7NNr82duUHH0nbyWxerFhFm/dWjSwKW3S69I+GMV373Nm9lWmLl/82V6+p12 xmTuBLcWXhCK9Ds3+Rtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdUD-00EpJs-2E; Tue, 19 Dec 2023 17:02:29 +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 1rFdTA-00EoB8-2B; Tue, 19 Dec 2023 17:01:27 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40d2376db79so9388585e9.0; Tue, 19 Dec 2023 09:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005283; x=1703610083; darn=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=0WseMEHOavtmxykYRA2JtvMxiK/FtoaZXXQqi1uMlW0=; b=iodhWeKMQXQ/FCfmnzaG2VGlmaUIKHQgAve5CSvHG5CVaNEiSmKxI4YIE2A0Q6+hXW CWNOV5tRXzEpU6WltfSZtEB2MgSs6mIpyUBHDNH3ZxarFfKVepH+5nJXvq3fre+NL/Sh M941na5QtkuVsq1yfmmTWZlg+TwxciQ3LiQAmzY5JYErsXY5DLWIxTrJisshBBWNFYmc CVozfkHcNIHgCqGSQjcr0HIWqIED6YnkqP8g3ghT0tAPbC6YZS50v7DapxBzou6iOzuJ 6Sd9ay+UkRWsCdymYGr4FoclIskmIhX7RMgnjSRyZp/HXWrDGtRA+MM/ieZ7g6ErEGN/ 6AYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005283; x=1703610083; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0WseMEHOavtmxykYRA2JtvMxiK/FtoaZXXQqi1uMlW0=; b=THkRcbmOmQj78clqhIKbLrEOEgQieEqoE0pz5zVsWSBkCBQqgdiFAFBBfz+5Bt/raw jIUuFq8rAMtFmUOmDrRjSLJQH8Rf31Pm3CGmBQqbkp1RGmAe3zkaT1vvWFI5wbtnX94F nZdBIgngZEJw3mPPnN7s3AL3G5jeX9d1WVLRcupGZx4x6quv0y4lmLUuYSZB0t5XOmQu O1RLENsa8xyBeaHhMkWRWIj4Obv2kFylzr1goHMPBEsrOsgQr1WmBU1hF+WHeEGdJgq3 HLwcSe26PK+XnnhWNqDN/pNo3T0T+AKXVlR8zAqwB7T5+S2wvbZODgJczjzA09K7x0FU lPCw== X-Gm-Message-State: AOJu0YwcipldWkFz0A6pus6/bIXUUoCPBNyIBeTXSiSQTWoQnI7RJB80 2Ktp+z8iWjIFzvzzXydHHw== X-Google-Smtp-Source: AGHT+IGOZJZnOnuHfdIdouJRryXsfventVWMJzlbA9qGEmVPHmZahIRRyc0+LTqlmnQmmG0gfJFPiw== X-Received: by 2002:a05:600c:1d10:b0:40c:50c:9f3f with SMTP id l16-20020a05600c1d1000b0040c050c9f3fmr10565023wms.95.1703005282571; Tue, 19 Dec 2023 09:01:22 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:22 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 17/29] drm/rockchip: inno_hdmi: Drop irq struct member Date: Tue, 19 Dec 2023 18:00:47 +0100 Message-ID: <20231219170100.188800-18-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090124_767064_2322150D X-CRM114-Status: GOOD ( 10.68 ) 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 changes in v3: - collect RB drivers/gpu/drm/rockchip/inno_hdmi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 51c1a69dfcc0..138cd4287dea 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -45,7 +45,6 @@ struct inno_hdmi_i2c { struct inno_hdmi { struct device *dev; - int irq; struct clk *pclk; void __iomem *regs; From patchwork Tue Dec 19 17:00:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498599 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 A02D6C41535 for ; Tue, 19 Dec 2023 17:03: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=Am7npwC0c76WSlfQchaYI80N9TT9ys8+fGql1mDRhoo=; b=H1EKwP0Ve+J9HJ XoTsbUEHP1DI2B+YCnI64DCoKIoG8dMoqDkVs3Ft+J/5wgwxEAXzqyRXfgUdal+HFVvlTe3pTuKrO D262uw6rm5s8tpBxO0Jz7igDyrGuZdRcI9Z3aE9FS9M4pZoBJhNfDNFYfgUNmSGJFAB1/lUMdu86R zCz5/cS9wMre0+mR08d+V48vnt0KuxFXZJ17QcyOsieiYWhCg7pDX7zIA4rm1VPKGq2AbEHaXbrnU 1yyQMvyfMM7Ymn9x9NkDtQWThcuwmYVAt5KmLOHkMpyNx6P0CVVKXfC454yJ1kF4q9C94Ngwd234D b8SP18r+4n1K/59W1mWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdUL-00EpUF-2k; Tue, 19 Dec 2023 17:02:37 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTB-00EoCB-2M; Tue, 19 Dec 2023 17:01:29 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40d12b56a38so39143915e9.2; Tue, 19 Dec 2023 09:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005283; x=1703610083; darn=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=bc0b+TzRBYlgBswaLzZiZATkVZXs4jtzYrqChWAdmP8=; b=X14rFBnEdNkx8opFqWdZFUDavNIg+Qljdcv+r/APPMka61McxY7e/JIMMTqwNn6aPb HfTRuv1N9KQ+/Cjco9q7BGVZFMm2Cej/LlpwTZLr4FUtqrsO64KOXVtMfckZsmemB5B5 dv2VOL6WG7mwGRz9FqM454HyT0t4/nZXObIyeb/X48TvYeUxr4fd6zaPS9K/hSGPwI8G ofi524lce7dki3k6QZj/FRplDFhB4dAK1TdjGR0RwvQ71C0JASseeEVX2dAbUtvTQSdY VxpiHDxkCPhfGb9PBrn5o3VWsQCflGc5of9pg8ToEVb1g9LVpHgGUAxkKUZMO2Cm+khL vaIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005283; x=1703610083; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bc0b+TzRBYlgBswaLzZiZATkVZXs4jtzYrqChWAdmP8=; b=YzbJ+qzCi7MO35ezvU6kSFlJ4fjpKnHBGr79MZzc5C9dXVQOTP4Zr+ODnGtd25Gdyd WyNaRKAfWKhm9k3H6maQVBJVGBlnrHHN2NJZjTMsQ83MzHv7LtNDTwbMiGLIu1FawvkQ b4lyalz2F3e+3s+5p5ySUZahTt1Sk8O2y6861+d0od58rCwOct7Qijhr3aGEd0gmKoOZ lDBwo8PJtkqNvLqBukGUD7p0tb8G24epAF/mPBsHoV69gHa8PW8wru+ND3Jip2ps1BLe S9byz5TvPDx95/Hj6jiibXfrRIfzTSkyn57Uy6QkMSLyCrjT3mlil3qroSVnVgsNlRRK Ndkw== X-Gm-Message-State: AOJu0YxOJ6I9ceRBjnWaMuP8A1FaxTTncm/KfvODEj6yEJDmrGxa288h C7RFlEkCPN7arDfok1AUzg== X-Google-Smtp-Source: AGHT+IGsXiyRLPSKTLiCmb5HKcIoTm/Gx4nMKjVc/FhMnHN1ip8FwDTTR8xwruHseC++DoM215yynw== X-Received: by 2002:a05:600c:4588:b0:40c:6b55:2a0f with SMTP id r8-20020a05600c458800b0040c6b552a0fmr2064612wmo.224.1703005283542; Tue, 19 Dec 2023 09:01:23 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:23 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 18/29] drm/rockchip: inno_hdmi: Remove useless include Date: Tue, 19 Dec 2023 18:00:48 +0100 Message-ID: <20231219170100.188800-19-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090125_803915_C12A499E X-CRM114-Status: GOOD ( 10.33 ) 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 changes in v3: - collect RB drivers/gpu/drm/rockchip/inno_hdmi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 138cd4287dea..c306db90832a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include From patchwork Tue Dec 19 17:00:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498601 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 E8769C46CA2 for ; Tue, 19 Dec 2023 17:03:20 +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=Lj1qvBTvOF2jCTpESeX2E7UwHULRPbp8SOUJrx9WQQ8=; b=Fap6fG8N0yeVBC AQ4T87UtBuEgLLoqiGmDWnFffLgAI/7uYPsMxBlNqoYT+k5El9R1/XHwrsb7tyHejwcipI8gWWiI0 nso5xOGS8lZ6C185C3UZ4rodPlDSYitk6NWhdVuSWhTET+afjNzP2DBQyTAWXGec9Xyeu2jtAg5+c ZONnxu2AP2HoTMrIXPWhbhWnBCCyiZLerZVvlz2GNIF23myrT7h5rTtPMPfigEx2IZGtTejYjv1qN u/Rjv5FyVqXsTD+hCkh4TmEyM4fuuRv/zASAjmtEPnmVyTNQeFcPWHVA5fkSqLlbTtGzmE6DWV+zE tVkg0Ww372nDCtJWwqtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdUT-00Epc0-3C; Tue, 19 Dec 2023 17:02:46 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTC-00EoDm-07; Tue, 19 Dec 2023 17:01:30 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40c39e936b4so54780665e9.1; Tue, 19 Dec 2023 09:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005285; x=1703610085; 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=lK+KwYJlEuYLJRgnAK/weBabBFLF0yUxX6bkfoGTqMQ=; b=TrN15kuhQbj7hwjFKSw0mis09h9CUGwI/MAqOXmCokxwStmmfgSkOY3LRNrY4OI5pR mU2GrkciocKZ2PTw+AOqNGQBLLrH6LY8mvp83L6RybAL+sJBky5QbTiaQMiWIVub56kn TMNIe0PNtOqGoi1FaU0VdvZeVLqQNERI7P2up+BFFcj6fpBqjdp993QyEX13kHfnw0uV w8oYy5iDI4MRz9Jeojee2Tw6UjeJ01icX+Q409oZi/TpgFRmUpkIpgxUSNHvAVFP2glY S1X8BBzzy0Itcsm1RJHJHD5bl2LKqpH6KwmZrIMabZiYUbz6Ef2iyLGSdNKIXXjZdodO MQHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005285; x=1703610085; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lK+KwYJlEuYLJRgnAK/weBabBFLF0yUxX6bkfoGTqMQ=; b=qn5a321Mlt4J/2OZ/D4v3Wmeg/bchm8e1EYLP2IJ2tfHReFzEDL0tlERKXgEDz5pAX jhzMMy7pfaVq9BY3abZ/QiRtYygwf9kZAgXaFfYS2aoWrGO0KFhmKiQfH6BHnjNVc64+ B19cm5FXWiwY4aQA/QBVcTGdNQQ+GFbQwLIu9on6FKL8bK4NIHxe8CCJr7Iv7bZ9mbLD hHTqth9SmGWB8zPN1WvZKnc/lJNhdgHH8RTH5z1Cx6lD32vPyh+Nfod8wOyZSYp1wDPt irv5vYC+d4XCAHZ3MXc1Wjp8nEfwNc5s+jAUgDeSKZEOldz5DbRuDJVJ/FvGHgDzC9mX MjqA== X-Gm-Message-State: AOJu0YyGYdDg7yEjbqDn0k09Vw3LoHzlEC696i818uk/gA5RwwjOGuq8 znVIgZXypF+owtWL6x0TTw== X-Google-Smtp-Source: AGHT+IETQmMzH+henkOgliDkz1y5rywNaPyW9KekS+gO8IgEZVGyMFIqPXmM3wVLtN835ZWXDX1vsg== X-Received: by 2002:a05:600c:4c8a:b0:40b:5f03:b3d6 with SMTP id g10-20020a05600c4c8a00b0040b5f03b3d6mr4719088wmp.248.1703005284670; Tue, 19 Dec 2023 09:01:24 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:24 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 19/29] drm/rockchip: inno_hdmi: Subclass connector state Date: Tue, 19 Dec 2023 18:00:49 +0100 Message-ID: <20231219170100.188800-20-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090126_115913_1434678B X-CRM114-Status: GOOD ( 18.65 ) 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 changes in v3: - added missing customizations of reset and atomic_destroy_state connector hooks - moved inno_conn_state member assignments to atomic_check drivers/gpu/drm/rockchip/inno_hdmi.c | 111 ++++++++++++++++++++------- 1 file changed, 84 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index c306db90832a..7ce5836fc80d 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -26,11 +26,6 @@ #include "inno_hdmi.h" -struct hdmi_data_info { - unsigned int enc_out_format; - unsigned int colorimetry; -}; - struct inno_hdmi_i2c { struct i2c_adapter adap; @@ -52,8 +47,12 @@ struct inno_hdmi { struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; +}; - struct hdmi_data_info hdmi_data; +struct inno_hdmi_connector_state { + struct drm_connector_state base; + unsigned int enc_out_format; + unsigned int colorimetry; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -68,6 +67,9 @@ static struct inno_hdmi *connector_to_inno_hdmi(struct drm_connector *connector) return container_of(connector, struct inno_hdmi, connector); } +#define to_inno_hdmi_conn_state(conn_state) \ + container_of_const(conn_state, struct inno_hdmi_connector_state, base) + enum { CSC_RGB_0_255_TO_ITU601_16_235_8BIT, CSC_RGB_0_255_TO_ITU709_16_235_8BIT, @@ -246,6 +248,10 @@ static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); union hdmi_infoframe frame; int rc; @@ -257,9 +263,9 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, return rc; } - if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) frame.avi.colorspace = HDMI_COLORSPACE_YUV444; - else if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV422) + else if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV422) frame.avi.colorspace = HDMI_COLORSPACE_YUV422; else frame.avi.colorspace = HDMI_COLORSPACE_RGB; @@ -269,7 +275,10 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) { - struct hdmi_data_info *data = &hdmi->hdmi_data; + struct drm_connector *connector = &hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); int c0_c2_change = 0; int csc_enable = 0; int csc_mode = 0; @@ -287,7 +296,7 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) v_VIDEO_INPUT_CSP(0); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); - if (data->enc_out_format == HDMI_COLORSPACE_RGB) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_RGB) { value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); @@ -298,15 +307,15 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) return 0; } - if (data->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { + if (inno_conn_state->colorimetry == HDMI_COLORIMETRY_ITU_601) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; } } else { - if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; @@ -383,17 +392,6 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { struct drm_display_info *display = &hdmi->connector.display_info; - u8 vic = drm_match_cea_mode(mode); - - hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; - - if (vic == 6 || vic == 7 || - vic == 21 || vic == 22 || - vic == 2 || vic == 3 || - vic == 17 || vic == 18) - hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; - else - hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; /* Mute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, @@ -458,10 +456,24 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, struct drm_connector_state *conn_state) { struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state); + struct drm_display_mode *mode = &crtc_state->adjusted_mode; + u8 vic = drm_match_cea_mode(mode); + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(conn_state); s->output_mode = ROCKCHIP_OUT_MODE_P888; s->output_type = DRM_MODE_CONNECTOR_HDMIA; + if (vic == 6 || vic == 7 || + vic == 21 || vic == 22 || + vic == 2 || vic == 3 || + vic == 17 || vic == 18) + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_601; + else + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; + + inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; + return 0; } @@ -519,13 +531,58 @@ static void inno_hdmi_connector_destroy(struct drm_connector *connector) drm_connector_cleanup(connector); } +static void inno_hdmi_connector_reset(struct drm_connector *connector) +{ + struct inno_hdmi_connector_state *inno_conn_state; + + inno_conn_state = kzalloc(sizeof(*inno_conn_state), GFP_KERNEL); + if (!inno_conn_state) + return; + + __drm_atomic_helper_connector_reset(connector, &inno_conn_state->base); + + inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; + inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; +} + +static struct drm_connector_state * +inno_hdmi_connector_duplicate_state(struct drm_connector *connector) +{ + struct inno_hdmi_connector_state *inno_conn_state; + + if (WARN_ON(!connector->state)) + return NULL; + + inno_conn_state = kmemdup(to_inno_hdmi_conn_state(connector->state), + sizeof(*inno_conn_state), GFP_KERNEL); + + if (!inno_conn_state) + return NULL; + + __drm_atomic_helper_connector_duplicate_state(connector, + &inno_conn_state->base); + + return &inno_conn_state->base; +} + +static void +inno_hdmi_connector_destroy_state(struct drm_connector *connector, + struct drm_connector_state *state) +{ + struct inno_hdmi_connector_state *inno_conn_state = + to_inno_hdmi_conn_state(state); + + __drm_atomic_helper_connector_destroy_state(&inno_conn_state->base); + kfree(inno_conn_state); +} + static const struct drm_connector_funcs inno_hdmi_connector_funcs = { .fill_modes = inno_hdmi_probe_single_connector_modes, .detect = inno_hdmi_connector_detect, .destroy = inno_hdmi_connector_destroy, - .reset = drm_atomic_helper_connector_reset, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, + .reset = inno_hdmi_connector_reset, + .atomic_duplicate_state = inno_hdmi_connector_duplicate_state, + .atomic_destroy_state = inno_hdmi_connector_destroy_state, }; static struct drm_connector_helper_funcs inno_hdmi_connector_helper_funcs = { From patchwork Tue Dec 19 17:00:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498603 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 92EA3C46CCD for ; Tue, 19 Dec 2023 17:03:31 +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=X/Etv4HG72Eg0XrWw2J+dGpD3LGjjZA1EAUKFkUppOk=; b=ksUL2OKq9AA0J0 5FvP7MdoZjsRPQQjk8WXRjHw9jz5TjDwjj8Z0/vX9ih+deI2DDrT4hklo5/r4h5rx1hg6T6dBZY84 t8i11FgtKvVDLQrOVsBbgF83xLsg+JOpkZM5q0njRwFALkehfQgx9rNk4QQ+TIGNrbG4JlUcdGFV5 2dOpXY9c1kpghFy0sOAwIMmMKqjSv2aT2EMQb8FDCLHcNKC6I1Y14XPT5pmeInq6foM1dyFDNLAUC pCuHc16EymTHQEoHuO/b3fSMgSIZNehDNImDpon/ehb0t/U9Ny0mWEnXv9ucSiIJDmOv1am3IbXo7 h8blmDGzgrpzP/D8kcRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdUd-00EpkA-0A; Tue, 19 Dec 2023 17:02:55 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTD-00EoF9-1I; Tue, 19 Dec 2023 17:01:31 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40d2376db79so9389085e9.0; Tue, 19 Dec 2023 09:01:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005285; x=1703610085; darn=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=XAqGTQIWGOGvPcvI30gGZkG+UcVd1X4ARFNZ3GdyHUM=; b=cLPwgLpda0joXYFdBIK6rX8r2aoCXkuh3oinc4c+FtqxVNxmldhUyhwzzbQul1R+Cn eFxjCSwd/Fsu8x3uheNDN5owX7K3CpPtg4Y6wYx8E7t4UHmxcJSjnMmZ6kCbvWqWL3PG 7oOBeLtE+G+FKiq1KPKhSSssYQ4qEakAw+Yd2zsSwvWdvKaf41n8HE6+yWQE6pQjAJAg 9xQSaEq5LChVIlnIXemfrL1LtLDAXNmVWg1cVkRvc/iXTOZkc88VT8qjNiX+fUAYb22m Yi45qno8aTXzscbUx1/NVJGlgi5HOZBEBsfFUjjtV3pcc/IRHaD48JuLYp9j34uIQtyO GCCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005285; x=1703610085; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XAqGTQIWGOGvPcvI30gGZkG+UcVd1X4ARFNZ3GdyHUM=; b=UpK+eynT5qfGMcBHL9Vh9AngyMJvc8rrw0Ap2iqsPqerXPR4AaXfnAEIhaaLX3avg4 fmyJV2C72ngNpgzNYcfKE+c/lDMoj/HXDwvfOwi/oyykXSgnUmVUkGRqVV6Zpz2im15h NlftKYL47AauIrywsAkaF/L1WxI4ir6GJcB34KFZvg0N7ombmD4VkvEZRRaT6RUXZuqV wa3QBvKjuUurXFm+v3H1fK9+TTEVHudBBTgSBUtvtrVcC0kZJc37ggEfJfqkMpDOWIJF sfdXlCyDqzVVWv8wQIVh9xRt49r9oKPJlH4l3UvMGq7Wu9cWkpmRslix1yloESDcX0kq xjGA== X-Gm-Message-State: AOJu0YzawQswtCDJW8xqvrgf6vxnNs+ya1Y16jLPRCbqfmzJRs1U0ylh ey8vEW2WX79r9MHCLcEdug== X-Google-Smtp-Source: AGHT+IH+E5UeGRN5eSjeOL+7FoXZ7yugNnZYROlsSGPz8s7Ex5qjyxn+jCN6zIVj9hVPz9tQj3kqMw== X-Received: by 2002:a05:600c:3b06:b0:40c:3158:6467 with SMTP id m6-20020a05600c3b0600b0040c31586467mr10786965wms.1.1703005285545; Tue, 19 Dec 2023 09:01:25 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:25 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 20/29] drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range Date: Tue, 19 Dec 2023 18:00:50 +0100 Message-ID: <20231219170100.188800-21-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090127_589626_B1F6AE85 X-CRM114-Status: GOOD ( 15.46 ) 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 changes in v3: - moved assignment of rgb_limited_range to atomic check drivers/gpu/drm/rockchip/inno_hdmi.c | 60 +++++++++++++++++++--------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 7ce5836fc80d..e6d37772500c 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -53,6 +53,7 @@ struct inno_hdmi_connector_state { struct drm_connector_state base; unsigned int enc_out_format; unsigned int colorimetry; + bool rgb_limited_range; }; static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) @@ -270,6 +271,18 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_RGB) { + drm_hdmi_avi_infoframe_quant_range(&frame.avi, + connector, mode, + inno_conn_state->rgb_limited_range ? + HDMI_QUANTIZATION_RANGE_LIMITED : + HDMI_QUANTIZATION_RANGE_FULL); + } else { + frame.avi.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT; + frame.avi.ycc_quantization_range = + HDMI_YCC_QUANTIZATION_RANGE_LIMITED; + } + return inno_hdmi_upload_frame(hdmi, &frame, HDMI_INFOFRAME_TYPE_AVI); } @@ -297,29 +310,37 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_RGB) { - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); - - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, - m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, - v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | - v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); - return 0; - } - - if (inno_conn_state->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { - csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; + if (inno_conn_state->rgb_limited_range) { + csc_mode = CSC_RGB_0_255_TO_RGB_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; + + } else { + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); + hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); + + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, + m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, + v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | + v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); + return 0; } } else { - if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { - csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; - auto_csc = AUTO_CSC_DISABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_ENABLE; + if (inno_conn_state->colorimetry == HDMI_COLORIMETRY_ITU_601) { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { + csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; + auto_csc = AUTO_CSC_DISABLE; + c0_c2_change = C0_C2_CHANGE_DISABLE; + csc_enable = v_CSC_ENABLE; + } + } else { + if (inno_conn_state->enc_out_format == HDMI_COLORSPACE_YUV444) { + csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; + auto_csc = AUTO_CSC_DISABLE; + c0_c2_change = C0_C2_CHANGE_DISABLE; + csc_enable = v_CSC_ENABLE; + } } } @@ -473,6 +494,8 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; + inno_conn_state->rgb_limited_range = + drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED; return 0; } @@ -543,6 +566,7 @@ static void inno_hdmi_connector_reset(struct drm_connector *connector) inno_conn_state->colorimetry = HDMI_COLORIMETRY_ITU_709; inno_conn_state->enc_out_format = HDMI_COLORSPACE_RGB; + inno_conn_state->rgb_limited_range = false; } static struct drm_connector_state * From patchwork Tue Dec 19 17:00:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498600 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 537A8C41535 for ; Tue, 19 Dec 2023 17:03: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=/ylaN4vKeDMx8ggmkBcAmmvkc+POsQgebQSbY4Yu514=; b=Us3Lt9X7eEQYse 679Okf1I/Hl28ADgK8R8qTbioKrfrWD55OT924690RzpeAU/JdhNcIfUn8Ltwg0M6DUVWGjEQJ9sY Z4O6zfGVYt8dYigILcR+qOX2n3fc9OLXJMDpgfGSNqz4Xj/iX0lSJe6xWHzfJxhN60/cI2Osudn2K H3qcQdif8hI0rDye8SonFFkuMUjXOe6bSc7I2cnfFzSDnRz0PMQ0SPfNN12TMUxElK3jjnfbJoHMU IyiUNSzGRhtfiP1a4CUumfMFmujr4yxgJvPuF/lT7hA7XmSAKgmOyTSHnUwnTgbOn+dJzXNRzwxh3 gQwWIUJyuSk40V22LE+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdUY-00Epg3-04; Tue, 19 Dec 2023 17:02:50 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTE-00EoFW-15; Tue, 19 Dec 2023 17:01:31 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-33677fb38a3so110956f8f.0; Tue, 19 Dec 2023 09:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005286; x=1703610086; 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=h8JOWn9GU9Nla83BWtTSRAknxxtN8+L8TovD6+V8Mi4=; b=nR5RC1OZoAg2sDh8WqgMXq5zY4EduZPTh5NAWq0IjQf+QCXlWpfgNnXJxFIDgeJVta 3diU7hqMgIQYgcWcC01Jk/G/Asr/tXlKPDVO2pZsXRferjEYoAmd1e5HfeKMnwyu52Nl gpz1MtzSv6OXgxw3Hl3sTkQojJL6Gd3jyE1F48THilEErCCZOsLSnla+TTqjqcDbuD0J lZSnzaj65E6BNkGF2gAKTBL7vN3cXadIoKuXLOEmQlq3vpk8YqQphiyHbA/DVoIeMApW 4Abo5GrVKDQuShboA8fSt1qF7t/+YojGFzJGYH0kHLy3HcwZYYNp6ycqycqct1JOZpEO qaZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005286; x=1703610086; 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=h8JOWn9GU9Nla83BWtTSRAknxxtN8+L8TovD6+V8Mi4=; b=QFWyIFctAzeKZFDNPKTIxt6VnsJj3vK4rvkL3gBZSHST5ZhiioLOdEyXR0iZ0iVjJt beCas1DYyQQ9qSaP2M5yDac+ZWlXv4rlXhIFj59zCnwE+zIG1gOUBtmEb3b+RQtnUNsc rEmWLhtEeEPe97WpPOmYXH+XWkn8bFBH57fpXEJqJ0DKjbnoD3G9f6b3DCMbBusYyR94 zhK7HHTZxOm3ITnMCSB3ECKXlQdXLjV8BT2SwUZyAlaEMY7PBcC5Zyf0ER2ek5jBfZZ4 Rb4DSyxrsW9zMATuPolKPWwIG/GCOv1udyye7JT99l6/EIEvKAFeqJ6IsUhKUlUdW6Fz AAzw== X-Gm-Message-State: AOJu0YyRq+XgKhagyoTLOPEelpoq1PaOPMoJvrxfgciIapRNhn5XgGqi SmMExOxFI8AFHENKxSMD/A== X-Google-Smtp-Source: AGHT+IFvESFKFDDj+P6Hp56SjNt5xISbZzFocZziXX7FumH32R2Au9gUTKsNb6b63EcE9fIlyJTiZg== X-Received: by 2002:a05:600c:2492:b0:40c:5583:c6b7 with SMTP id 18-20020a05600c249200b0040c5583c6b7mr6324639wms.109.1703005286360; Tue, 19 Dec 2023 09:01:26 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:26 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 21/29] drm/rockchip: inno_hdmi: Don't power up the phy after resetting Date: Tue, 19 Dec 2023 18:00:51 +0100 Message-ID: <20231219170100.188800-22-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090128_403436_F87EE949 X-CRM114-Status: GOOD ( 14.44 ) 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 inno_hdmi_reset is only ever called when initializing the controller. At this point it’s completely uneccessary to power up the PHY, since all what has to work at this point is the DDC bus. The phy will be powered up correctly when a mode is set in inno_hdmi_encoder_enable and disabled in inno_hdmi_encoder_disable. Set it to LOWER_PWR after resetting the controller. Signed-off-by: Alex Bee --- changes in v3: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index e6d37772500c..9fea464b6234 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -202,7 +202,7 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) val = v_REG_CLK_INV | v_REG_CLK_SOURCE_SYS | v_PWR_ON | v_INT_POL_HIGH; hdmi_modb(hdmi, HDMI_SYS_CTRL, msk, val); - inno_hdmi_set_pwr_mode(hdmi, NORMAL); + inno_hdmi_set_pwr_mode(hdmi, LOWER_PWR); } static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, From patchwork Tue Dec 19 17:00:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498602 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 62841C41535 for ; Tue, 19 Dec 2023 17:03: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=1moVjZ58ARIGVcXsYxs359kjVO3sDw7fDdnBjNbPyko=; b=mbUCSpbTPsUzAr 6o1305P1Zs76lwnMuxfvB/bXHpucYOKg42JrrwJWy2bWhtbG2CGmyEq2/HiC8jGqnuz2m43AKHEyz dTElvLYpsc/mLyeozLrCG6Wkv1QtTaIJsojSg51DkuIbKnh98Y/clJjcIKCYcAGSI9um5krEa7Yu4 4fljcs2pdUUfGEMdPmqUA40NW6gNBViZlaTZZO3AcZrxnMYh/9L5xreb4SQE060/jKNKX1xGFlfLz /sfeQJOZOIFNUR2vx4NOYrMiMNoX4k//mfpp4iiCWauxFGZD+bn/UHRvIUGiLTzMch5DBDnBHM0s2 fpDaaT8WiZyL8MkR97UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdUg-00Epnm-02; Tue, 19 Dec 2023 17:02:58 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTE-00EoGf-39; Tue, 19 Dec 2023 17:01:33 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40c69403b3eso47782495e9.3; Tue, 19 Dec 2023 09:01:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005287; x=1703610087; 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=QlneokmKF1TajoqU6rsqTKLh9Q2KoTuUiBV9HAc+RDM=; b=ZpNRA+iiqCPJ+f7+QnHWtwtg3Q18y8vd91KsE0j79La2jTX0/FrCTsDvTREA0YexCY 0ePwQmrevChXaUi42E4TKs8RTQq17Q36h68vM77hUidZpwPpTS6BlewYa2DpSwj+r/y0 hZcdveibiiN6GunQFhM80dQzVG/PyahBQ/1gLg6noBC6z8fw3DYVSPjA7ghLg0+Mwh3K 117Antj4v+ikQYERuwf2YdOKsKKQNGOOKPKyeR8OzJl1jgHH/mdu4ftp43voH0bfLwGc V2GAUsQ5gmOhQIhL6Jx3m5G+hWrizOBmMq3SU9yrP+NSloL6D1cjSNOxNrY+YfrhGObt wSnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005287; x=1703610087; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QlneokmKF1TajoqU6rsqTKLh9Q2KoTuUiBV9HAc+RDM=; b=Wky+tiSDSZvsj8wQyhpp4uz+mS4oolQZh+vBfhgDEkzk/WV/WgIzG/gT2jDA6WOxbX H2BMJF4G31ksbn/Am+vqj8ookbodHqV75/EGWQIny3A1mWkMTpLCEiayvV2cr7P1KMGd qvtHxt6qDg+klmEbkDnnxtXP11V6SVreXHvdCZFIVR8MJjGum7PWWae1OXN5qCRkmRxp SPqfHopqbfWga7Ml+bGztCcdM8/Nts+0lbGPMzwUnPIgPCXHHmM+FZo934wklKBtpbMd SVpAbbTinI/1GPKtJa3V09FJfkknr8zc05hUI6Y1zLd41s+Dk0z1eRG2CEjmPYFTW8ZS nNSQ== X-Gm-Message-State: AOJu0Yy8RAtIRd11DDB5IMHoF471EZO39m5YiZnKRcYmyaTeKFhcGRXd 6Grq7JzItsljL01q19VADw== X-Google-Smtp-Source: AGHT+IFgNag5RzBVfRt1FyfNQwZdIW7ZbFhF5a9fbzOs0v3zV+7ntZcb1IJiL0G1mPdw1hfxZoM6rA== X-Received: by 2002:a05:600c:3502:b0:40d:18e2:895 with SMTP id h2-20020a05600c350200b0040d18e20895mr2209578wmq.98.1703005287566; Tue, 19 Dec 2023 09:01:27 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:27 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 22/29] drm/rockchip: inno_hdmi: Split power mode setting Date: Tue, 19 Dec 2023 18:00:52 +0100 Message-ID: <20231219170100.188800-23-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090129_036177_2DDDBBC9 X-CRM114-Status: GOOD ( 13.07 ) 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 splits setting the power mode of the controller / phy in two functions. It's done in preparation of setting up the phy based on the pixelclock. No functional changes intended. Signed-off-by: Alex Bee --- changes in v3: - new patch drivers/gpu/drm/rockchip/inno_hdmi.c | 54 +++++++++++++--------------- drivers/gpu/drm/rockchip/inno_hdmi.h | 5 --- 2 files changed, 24 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 9fea464b6234..e21f6d7aeee6 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -154,38 +154,31 @@ static void inno_hdmi_sys_power(struct inno_hdmi *hdmi, bool enable) hdmi_modb(hdmi, HDMI_SYS_CTRL, m_POWER, v_PWR_OFF); } -static void inno_hdmi_set_pwr_mode(struct inno_hdmi *hdmi, int mode) +static void inno_hdmi_standby(struct inno_hdmi *hdmi) { - switch (mode) { - case NORMAL: - inno_hdmi_sys_power(hdmi, false); + inno_hdmi_sys_power(hdmi, false); - hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x6f); - hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0xbb); - - hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); - hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x14); - hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x10); - hdmi_writeb(hdmi, HDMI_PHY_CHG_PWR, 0x0f); - hdmi_writeb(hdmi, HDMI_PHY_SYNC, 0x00); - hdmi_writeb(hdmi, HDMI_PHY_SYNC, 0x01); - - inno_hdmi_sys_power(hdmi, true); - break; + hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0x00); + hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x00); + hdmi_writeb(hdmi, HDMI_PHY_CHG_PWR, 0x00); + hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); +}; - case LOWER_PWR: - inno_hdmi_sys_power(hdmi, false); - hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0x00); - hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x00); - hdmi_writeb(hdmi, HDMI_PHY_CHG_PWR, 0x00); - hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); +static void inno_hdmi_power_up(struct inno_hdmi *hdmi) +{ + inno_hdmi_sys_power(hdmi, false); - break; + hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x6f); + hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0xbb); + hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); + hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x14); + hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x10); + hdmi_writeb(hdmi, HDMI_PHY_CHG_PWR, 0x0f); + hdmi_writeb(hdmi, HDMI_PHY_SYNC, 0x00); + hdmi_writeb(hdmi, HDMI_PHY_SYNC, 0x01); - default: - DRM_DEV_ERROR(hdmi->dev, "Unknown power mode %d\n", mode); - } -} + inno_hdmi_sys_power(hdmi, true); +}; static void inno_hdmi_reset(struct inno_hdmi *hdmi) { @@ -202,7 +195,7 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) val = v_REG_CLK_INV | v_REG_CLK_SOURCE_SYS | v_PWR_ON | v_INT_POL_HIGH; hdmi_modb(hdmi, HDMI_SYS_CTRL, msk, val); - inno_hdmi_set_pwr_mode(hdmi, LOWER_PWR); + inno_hdmi_standby(hdmi); } static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, @@ -441,6 +434,8 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, v_AUDIO_MUTE(0) | v_VIDEO_MUTE(0)); + inno_hdmi_power_up(hdmi); + return 0; } @@ -460,7 +455,6 @@ static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, return; inno_hdmi_setup(hdmi, &crtc_state->adjusted_mode); - inno_hdmi_set_pwr_mode(hdmi, NORMAL); } static void inno_hdmi_encoder_disable(struct drm_encoder *encoder, @@ -468,7 +462,7 @@ static void inno_hdmi_encoder_disable(struct drm_encoder *encoder, { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); - inno_hdmi_set_pwr_mode(hdmi, LOWER_PWR); + inno_hdmi_standby(hdmi); } static int diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.h b/drivers/gpu/drm/rockchip/inno_hdmi.h index 93245b55f967..a7edf3559e60 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.h +++ b/drivers/gpu/drm/rockchip/inno_hdmi.h @@ -10,11 +10,6 @@ #define DDC_SEGMENT_ADDR 0x30 -enum PWR_MODE { - NORMAL, - LOWER_PWR, -}; - #define HDMI_SCL_RATE (100*1000) #define DDC_BUS_FREQ_L 0x4b #define DDC_BUS_FREQ_H 0x4c From patchwork Tue Dec 19 17:00:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498604 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 78755C46CA2 for ; Tue, 19 Dec 2023 17:03:41 +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=cjO9GwboUXIce1FqaOyClylRWBLDZtEqV2pnTO5KjkU=; b=HTCcTRuSeXg3nF H8OUTIZWDKcG01gE9j8bcn61+gHnvHuWDa2qpxZLgMXHfSurK+rQadB3CIxjoWEi5Asgvc3EMdR30 gfhs/K9p7Qe0NyJqrTOYytDiLpieeDxJKSmEUo1rKV1TyGKf3evVFNSSDO7NfhdqErvHS4U4wvZB9 fyix2bacdZBgJt9rfTyJ3QP0rHDqO5F2kg3E5/WWHDzbW1HzQBUzhQXmzFmf/067eX82UDnIguzOp /TW2pruQRq/TrUIJUnbYQqmFMZg7BE2E8SBt+2FTxitlbGwVnXcDcPq0DfLNJQ7uRxz/4u+ea9IEX 7ld+Mn1S8RwIKNdU2/tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdUl-00Epsk-1H; Tue, 19 Dec 2023 17:03:03 +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 1rFdTF-00EoHW-2Q; Tue, 19 Dec 2023 17:01:34 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40c29f7b068so52847795e9.0; Tue, 19 Dec 2023 09:01:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005288; x=1703610088; 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=6i2p9YgvuxkTu14agPnwE9rj1vc0S1z9mKZiq597B/g=; b=VfPPgm0Jexa3PFJWjt1Tna9NXHLJkFMsAmws+CqnjUY//mjHCOjY3rRcTL6z4XBKus ELTQ/SrEHekzZD3BlefVqWAHnNa3bZPzjB7TijO4EeaElAs0MVZpYhLIa3b9/YLcIBbw ZrUMu7/6NThG+9v7rAudIg06I2O+n1MPirVslzxWKqfbd4AVXfdCZAqs5NJdAhIOwit+ rggtO7A9Xw9d43SgZrrUiEf77WLVhqYFHcwjIocFmNS8/PYi/YJIG59kULLlEgPpHpsw 8zcYmJqFuoc5NVvfusVNa8oZIy0C5p0CzLYv5txSYC7Sij+7z3KqdpN0Lb/s3PMfqfxX ufDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005288; x=1703610088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6i2p9YgvuxkTu14agPnwE9rj1vc0S1z9mKZiq597B/g=; b=H69X9Lp+aN0SDnv9kTYTNMhEHXJIIayXwWmIfK6mvDLpY3Zaa52MI0Rvz+9dBu2wHn teyFP4RSo5CHZ69bSWq30IvIIzewjUA2RFqoopueseo5MmCeEr8uj7XjxiBwk9OSrVJR NdIbSyalaOrp1Unuhc6BQA4baC412oQ7bQiFhb2eqLFJc5nxsp4zrjhC5WB/pnBza/z0 6YXIZriPDGDxMZ8Vjp0vBlWaajvnIyB9F0b1bzZ5gWFhIP8W76AcItBLAFtlyE4k9W/Z P+Az9R8+YiNDPNQCkQHZ62aJtcA/6S96TjF04y7AvIBHBuYBZBJ9AiCClDJatNVNCEmw y14Q== X-Gm-Message-State: AOJu0YwzkhvGK9Mh1Hg6zfSkqDrNGZbXYCHBH10IAqkEx3BdNMKufV29 mUQwFZzMYV+caWcU2sFqBg== X-Google-Smtp-Source: AGHT+IFnEzt1e8cd8Dpw4x8T7LBa0FeImTMH77k+VZIjyFeGojZteErqLo30v/LfPauu0pS6MS1jtg== X-Received: by 2002:a05:600c:1d12:b0:40c:93f:5da2 with SMTP id l18-20020a05600c1d1200b0040c093f5da2mr9354501wms.33.1703005288338; Tue, 19 Dec 2023 09:01:28 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:28 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 23/29] drm/rockchip: inno_hdmi: Add variant support Date: Tue, 19 Dec 2023 18:00:53 +0100 Message-ID: <20231219170100.188800-24-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090129_927343_2C542B0B X-CRM114-Status: GOOD ( 23.53 ) 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 changes in v3: - adapt to the newly introduced inno_hdmi_power_up / inno_hdmi_standby functions drivers/gpu/drm/rockchip/inno_hdmi.c | 74 ++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index e21f6d7aeee6..df979bab9abd 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -26,6 +26,17 @@ #include "inno_hdmi.h" +struct inno_hdmi_phy_config { + unsigned long pixelclock; + u8 pre_emphasis; + u8 voltage_level_control; +}; + +struct inno_hdmi_variant { + struct inno_hdmi_phy_config *phy_configs; + struct inno_hdmi_phy_config *default_phy_config; +}; + struct inno_hdmi_i2c { struct i2c_adapter adap; @@ -47,6 +58,8 @@ struct inno_hdmi { struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; + + const struct inno_hdmi_variant *variant; }; struct inno_hdmi_connector_state { @@ -113,6 +126,30 @@ static const char coeff_csc[][24] = { }, }; +static struct inno_hdmi_phy_config rk3036_hdmi_phy_configs[] = { + { 74250000, 0x3f, 0xbb }, + { 165000000, 0x6f, 0xbb }, + { ~0UL, 0x00, 0x00 } +}; + +static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi, + unsigned long pixelclk) +{ + const struct inno_hdmi_phy_config *phy_configs = + hdmi->variant->phy_configs; + int i; + + for (i = 0; phy_configs[i].pixelclock != ~0UL; i++) { + if (pixelclk <= phy_configs[i].pixelclock) + return i; + } + + DRM_DEV_DEBUG(hdmi->dev, "No phy configuration for pixelclock %lu\n", + pixelclk); + + return -EINVAL; +} + static inline u8 hdmi_readb(struct inno_hdmi *hdmi, u16 offset) { return readl_relaxed(hdmi->regs + (offset) * 0x04); @@ -164,12 +201,25 @@ static void inno_hdmi_standby(struct inno_hdmi *hdmi) hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); }; -static void inno_hdmi_power_up(struct inno_hdmi *hdmi) +static void inno_hdmi_power_up(struct inno_hdmi *hdmi, + unsigned long mpixelclock) { + struct inno_hdmi_phy_config *phy_config; + int ret = inno_hdmi_find_phy_config(hdmi, mpixelclock); + + if (ret < 0) { + phy_config = hdmi->variant->default_phy_config; + DRM_DEV_ERROR(hdmi->dev, + "Using default phy configuration for TMDS rate %lu", + mpixelclock); + } else { + phy_config = &hdmi->variant->phy_configs[ret]; + } + inno_hdmi_sys_power(hdmi, false); - hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, 0x6f); - hdmi_writeb(hdmi, HDMI_PHY_DRIVER, 0xbb); + hdmi_writeb(hdmi, HDMI_PHY_PRE_EMPHASIS, phy_config->pre_emphasis); + hdmi_writeb(hdmi, HDMI_PHY_DRIVER, phy_config->voltage_level_control); hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x15); hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x14); hdmi_writeb(hdmi, HDMI_PHY_SYS_CTL, 0x10); @@ -406,6 +456,7 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { struct drm_display_info *display = &hdmi->connector.display_info; + unsigned long mpixelclock = mode->clock * 1000; /* Mute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, @@ -428,13 +479,13 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, * DCLK_LCDC, so we need to init the TMDS rate to mode pixel * clock rate, and reconfigure the DDC clock. */ - inno_hdmi_i2c_init(hdmi, mode->clock * 1000); + inno_hdmi_i2c_init(hdmi, mpixelclock); /* Unmute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, v_AUDIO_MUTE(0) | v_VIDEO_MUTE(0)); - inno_hdmi_power_up(hdmi); + inno_hdmi_power_up(hdmi, mpixelclock); return 0; } @@ -821,6 +872,7 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, struct platform_device *pdev = to_platform_device(dev); struct drm_device *drm = data; struct inno_hdmi *hdmi; + const struct inno_hdmi_variant *variant; int irq; int ret; @@ -830,6 +882,12 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, hdmi->dev = dev; + variant = of_device_get_match_data(hdmi->dev); + if (!variant) + return -EINVAL; + + hdmi->variant = variant; + hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) return PTR_ERR(hdmi->regs); @@ -923,8 +981,14 @@ static void inno_hdmi_remove(struct platform_device *pdev) component_del(&pdev->dev, &inno_hdmi_ops); } +static const struct inno_hdmi_variant rk3036_inno_hdmi_variant = { + .phy_configs = rk3036_hdmi_phy_configs, + .default_phy_config = &rk3036_hdmi_phy_configs[1], +}; + static const struct of_device_id inno_hdmi_dt_ids[] = { { .compatible = "rockchip,rk3036-inno-hdmi", + .data = &rk3036_inno_hdmi_variant, }, {}, }; From patchwork Tue Dec 19 17:00:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498619 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 162A8C46CA2 for ; Tue, 19 Dec 2023 17:04: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=mXDJu/53KtfEbFVgjF6ms3RAUS9mp/etzIqXYr/2yG8=; b=to5htvtJDiYOyu faJRmD5uwFFhCab/KkAqMjsNW5297YymL1pYQhjnttyhgUyxLkjolmJbxvbkoVnQdHQKVqBdCVF+E IUYxdFKn8Lc5dGey+oHwCux1M4njUlIJhDu8eI1YbWP5VfMH1xvLZq//xD6vm3BFTFSfJjaBZ0WCb Gv13tOYTOIi4AxlQ5fVRE9gkKDb+BtbOQEGjPFLhHiCVR/Y3sH2TXMRhMaLwnBx4mf0E7KuNiL0t8 8rBo50Wcx7W0V9hdmBASU7DbdPo1cPlC7KaFd21gJM8Gtx+WhsU/KNZR5WRZtD1jt+vW/8euKs5ZM zoD39ORX1jCwxmK/0Usw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdVF-00EqKS-1G; Tue, 19 Dec 2023 17:03:33 +0000 Received: from mail-wm1-f53.google.com ([209.85.128.53]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTI-00EoKX-1B; Tue, 19 Dec 2023 17:01:37 +0000 Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40c60dfa5bfso56963365e9.0; Tue, 19 Dec 2023 09:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005290; x=1703610090; darn=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=yPHQ4Axf1Zj8/9D5WH9YQvs+oHeh2coMc0soFZ2d7Pc=; b=h3iieqLdEceAAVF59rg0yhTHzi2AIGWYqhUcZ3HllqLUT2dJE2oQZQnZLXvu0cAYju oo/Ex7pYq2IXk8rRxGbZaHsJRO6XVWaTVhfKTzm7PjxqEaxdyS46AkcSogwAaaCPbRXI LJhKudAqinDT/jrW6pan3dd4yDAUKvU5ZGcmu9FdEl8RPArcvm0Xn9r2YgyVey6nWmV+ phUdHY6I5qSFRftpNc4LIM/LIOCDcnV0jDP2ZZfXUsdFF0wyg8aGCyA9GjMAJc/5OiID qURinQ+HZLLSlFzthrxGr2d0uy6dkkUXbv1wrGv7HB1u6e2XwQi2fkMqnnfHXe+lTQV1 72Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005290; x=1703610090; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yPHQ4Axf1Zj8/9D5WH9YQvs+oHeh2coMc0soFZ2d7Pc=; b=fR9dZ2Dse3NWFOOjeEJyPDpYLGjvEtSWPXmymNobqRhffvmWZ9YV0LXg5Q2HVQQG/r ip1zfxYz7tG4B2ucvCzgiZ/QE/gRo/RL0S9Jx9pNqrtH9G3fHZ+AjcHK2U0i7RjsPi3z xq+75W/Mh2atNC7PiEKC6cUF3kmyTAfodVvzDhiL7j99HPVIt7kr+s9D34c6MgSd7SD1 bDMd8IVXKFNLFXH/qphQ+1Q8CfMflRCKLnM5ELIF9FNeBfffP3wISjQwma881/cdBbJS NoO+wSWUJ2canggQvSL83lN+lBrcqhtMZokmI+XrbvQUdkmk6Z8nge3bxj5AJHDSCwDF zgiQ== X-Gm-Message-State: AOJu0YyCml/m5usWgZ3Pb/M/Rv3O4PJvYKq0meTBqNyrTjecvaOi1uyK 6qEnGra0gOBlF0JtQAqQ2Q== X-Google-Smtp-Source: AGHT+IE4eDamrkaqHIRmRipnXIk9NA5k22v04gAX2DztUoFzEGsVq5zIRkBu0fqdPB7W0SQaCaXYPA== X-Received: by 2002:a05:600c:538e:b0:40d:2055:8088 with SMTP id hg14-20020a05600c538e00b0040d20558088mr938934wmb.158.1703005290201; Tue, 19 Dec 2023 09:01:30 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:28 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 24/29] drm/rockchip: inno_hdmi: Add RK3128 support Date: Tue, 19 Dec 2023 18:00:54 +0100 Message-ID: <20231219170100.188800-25-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090132_473221_0F5213E0 X-CRM114-Status: GOOD ( 20.94 ) 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 changes in v3: - no changes drivers/gpu/drm/rockchip/inno_hdmi.c | 46 +++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index df979bab9abd..8a1a2320749a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -51,6 +51,7 @@ struct inno_hdmi { struct device *dev; struct clk *pclk; + struct clk *refclk; void __iomem *regs; struct drm_connector connector; @@ -132,6 +133,12 @@ static struct inno_hdmi_phy_config rk3036_hdmi_phy_configs[] = { { ~0UL, 0x00, 0x00 } }; +static struct inno_hdmi_phy_config rk3128_hdmi_phy_configs[] = { + { 74250000, 0x3f, 0xaa }, + { 165000000, 0x5f, 0xaa }, + { ~0UL, 0x00, 0x00 } +}; + static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi, unsigned long pixelclk) { @@ -905,6 +912,20 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, return ret; } + hdmi->refclk = devm_clk_get_optional(hdmi->dev, "ref"); + if (IS_ERR(hdmi->refclk)) { + DRM_DEV_ERROR(hdmi->dev, "Unable to get HDMI reference clock\n"); + ret = PTR_ERR(hdmi->refclk); + goto err_disable_pclk; + } + + ret = clk_prepare_enable(hdmi->refclk); + if (ret) { + DRM_DEV_ERROR(hdmi->dev, + "Cannot enable HDMI reference clock: %d\n", ret); + goto err_disable_pclk; + } + irq = platform_get_irq(pdev, 0); if (irq < 0) { ret = irq; @@ -921,12 +942,16 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, } /* - * When IP controller haven't configured to an accurate video - * timing, then the TMDS clock source would be switched to - * PCLK_HDMI, so we need to init the TMDS rate to PCLK rate, - * and reconfigure the DDC clock. + * When the controller isn't configured to an accurate + * video timing and there is no reference clock available, + * then the TMDS clock source would be switched to PCLK_HDMI, + * so we need to init the TMDS rate to PCLK rate, and + * reconfigure the DDC clock. */ - inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->pclk)); + if (hdmi->refclk) + inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->refclk)); + else + inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->pclk)); ret = inno_hdmi_register(drm, hdmi); if (ret) @@ -950,6 +975,8 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, err_put_adapter: i2c_put_adapter(hdmi->ddc); err_disable_clk: + clk_disable_unprepare(hdmi->refclk); +err_disable_pclk: clk_disable_unprepare(hdmi->pclk); return ret; } @@ -963,6 +990,7 @@ static void inno_hdmi_unbind(struct device *dev, struct device *master, hdmi->encoder.encoder.funcs->destroy(&hdmi->encoder.encoder); i2c_put_adapter(hdmi->ddc); + clk_disable_unprepare(hdmi->refclk); clk_disable_unprepare(hdmi->pclk); } @@ -986,10 +1014,18 @@ static const struct inno_hdmi_variant rk3036_inno_hdmi_variant = { .default_phy_config = &rk3036_hdmi_phy_configs[1], }; +static const struct inno_hdmi_variant rk3128_inno_hdmi_variant = { + .phy_configs = rk3128_hdmi_phy_configs, + .default_phy_config = &rk3128_hdmi_phy_configs[1], +}; + static const struct of_device_id inno_hdmi_dt_ids[] = { { .compatible = "rockchip,rk3036-inno-hdmi", .data = &rk3036_inno_hdmi_variant, }, + { .compatible = "rockchip,rk3128-inno-hdmi", + .data = &rk3128_inno_hdmi_variant, + }, {}, }; MODULE_DEVICE_TABLE(of, inno_hdmi_dt_ids); From patchwork Tue Dec 19 17:00:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498836 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 7610DC41535 for ; Tue, 19 Dec 2023 18:16: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=Ykh0KH9D9y4/OgyvwfDEpW+/9joBW5UdhQD/PC2+M20=; b=DW4qfEW1hDmR1y 2yOJ3kE0LU60mOQfMnMpfmlEDSN6aPegwObCsXt/6A0G38CCvt8nN1inc4arLJDEeFJ1/zYDPq+zw 1WbJh0QwFSc2Mpgld+3G4UPW9CRWqLJvJhKC3cyyNnWZEVCqRA0p2Ee1/fJpuoooxJa/Ihrnbo3pV oKlm8WzPpTsWSt5I4VU3+tGUgCHQbC2+dgvFsEX5fGNsCyPp/sjXzIK1rXpejWvKJxCLjNs78IXDg Okh/4ZIGWeYuxHjohSbETxarfUatUw90i2aS2rWoCG5XQxAcwWj/kcDsSoVJjWQJo0grjwGXTk4ic MMXtOeyXDcJOvZ5BDpDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFee5-00FALE-1g; Tue, 19 Dec 2023 18:16:45 +0000 Received: from mail-wm1-f46.google.com ([209.85.128.46]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTJ-00EoLF-1n; Tue, 19 Dec 2023 17:01:38 +0000 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40c39e936b4so54782475e9.1; Tue, 19 Dec 2023 09:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005291; x=1703610091; darn=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=lg73sX3i9a8aQACa3LQIeyAKZ2sxvdHhoE4dFqwZeRk=; b=l+h9DhsY9k0t4TBaG6Y3m/aQvH/amoiEJgb1/wEzlJk/qE3tLg9dYp6JLBOwxN04MF VTURV+H1MlIExU9h4SkqjSsarMfaycHiqWSKqfUqO6BKDRAEeyJif5hHJ9UPoEK3zpB/ //VHYcULDfa7S4FZuydqS3envzkdXwVLTCgiL/9J5C1NV0pI06FmUchMTySIfAmv52Bv 9AAq8bK53hIS/YYWaIL6qnNaWoAxqFivzTXdjKvZQYPWd0kLRZCNFLOtwJa7mVZVuOTP D1/WFYE4aSX6f5Q3hzhhra1AN3/DMaA5p9K44YFdBY/astHyMtZsnTd+79rRqfHMxq0b V8Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005291; x=1703610091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lg73sX3i9a8aQACa3LQIeyAKZ2sxvdHhoE4dFqwZeRk=; b=Zh5zeGw+ImA55gSqJ9hSCuqcUfdHM9tD2jixqNl0j2o014MI5wi5IAOKzwNiCblRhN UypBQX7U0upqwLryl5z5jLAPsO3BwDkqmxsy21H4x+MBZHsZvp2RyLFzQbyokPktyS6c HGr1gP2V40xmMzj4DIh7PmSdU78Qw4kIbSyW6Eh5qjaM9YnAwYvwOaex9/90Z9Wb543K 3YshaFMen/2BNvNQxpgJ6AKyILDRH9dFzHXt0xeTo0Nn4CEy11OWtvOSgMVokvPxofn/ H4whgd/o/4vSQksSjTxJWTUZ8eb7EUt9clSA/Xs62n37CyufvC4ZOLmgPVHYoSdKQ+Lu tEGA== X-Gm-Message-State: AOJu0YzwG4K7efUpUQJmjup3/9JHiW+wKdzoVvbA4XRfinuKXM5ImfCd cBX8mV+OYl3o+JAr7bPjVw== X-Google-Smtp-Source: AGHT+IHXi6Ragi4oBQ3GZNtFDmz9icVV62tivi8tCjIWJeMUtr3MMODMzP3LpyoP4WMp+2GJb/Pgbw== X-Received: by 2002:a1c:6a0a:0:b0:40c:386e:6aa2 with SMTP id f10-20020a1c6a0a000000b0040c386e6aa2mr5197610wmc.55.1703005290969; Tue, 19 Dec 2023 09:01:30 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:30 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 25/29] drm/rockchip: inno_hdmi: Add basic mode validation Date: Tue, 19 Dec 2023 18:00:55 +0100 Message-ID: <20231219170100.188800-26-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090133_624311_D75DD43C X-CRM114-Status: GOOD ( 17.77 ) 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 changes in v3: - collect RB drivers/gpu/drm/rockchip/inno_hdmi.c | 42 ++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 8a1a2320749a..a2a9e54b76c0 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -26,6 +26,8 @@ #include "inno_hdmi.h" +#define INNO_HDMI_MIN_TMDS_CLOCK 25000000U + struct inno_hdmi_phy_config { unsigned long pixelclock; u8 pre_emphasis; @@ -497,6 +499,38 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, return 0; } +static enum drm_mode_status inno_hdmi_display_mode_valid(struct inno_hdmi *hdmi, + struct drm_display_mode *mode) +{ + unsigned long mpixelclk, max_tolerance; + long rounded_refclk; + + /* No support for double-clock modes */ + if (mode->flags & DRM_MODE_FLAG_DBLCLK) + return MODE_BAD; + + mpixelclk = mode->clock * 1000; + + if (mpixelclk < INNO_HDMI_MIN_TMDS_CLOCK) + return MODE_CLOCK_LOW; + + if (inno_hdmi_find_phy_config(hdmi, mpixelclk) < 0) + return MODE_CLOCK_HIGH; + + if (hdmi->refclk) { + rounded_refclk = clk_round_rate(hdmi->refclk, mpixelclk); + if (rounded_refclk < 0) + return MODE_BAD; + + /* Vesa DMT standard mentions +/- 0.5% max tolerance */ + max_tolerance = mpixelclk / 200; + if (abs_diff((unsigned long)rounded_refclk, mpixelclk) > max_tolerance) + return MODE_NOCLOCK; + } + + return MODE_OK; +} + static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { @@ -529,6 +563,7 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, struct drm_connector_state *conn_state) { struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state); + struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); struct drm_display_mode *mode = &crtc_state->adjusted_mode; u8 vic = drm_match_cea_mode(mode); struct inno_hdmi_connector_state *inno_conn_state = @@ -549,7 +584,8 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, inno_conn_state->rgb_limited_range = drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED; - return 0; + return inno_hdmi_display_mode_valid(hdmi, + &crtc_state->adjusted_mode) == MODE_OK ? 0 : -EINVAL; } static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { @@ -590,7 +626,9 @@ static enum drm_mode_status inno_hdmi_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { - return MODE_OK; + struct inno_hdmi *hdmi = connector_to_inno_hdmi(connector); + + return inno_hdmi_display_mode_valid(hdmi, mode); } static int From patchwork Tue Dec 19 17:00:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498618 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 B0036C41535 for ; Tue, 19 Dec 2023 17:03: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=oR7Jm1aR+Ql9QkhtvmmMh3Rm5xMnR5+qlPrSV4Y1NHk=; b=bM9Vm+W7jAcVFx xlGjQOaNbXj3uRc9zTMTKpJvvXUydxjEZvlznk0jsI9C3TcGlj36VoU0rxJd+2Cz9XdQE3cplmq2g tOW8DYzvrYhdSkWR6WQbLYasHDdOR5BfbpPS6jagMCry5F9d8sh29SNGNnLB6EiLc4Kv/VNulap3e pFEaliZDMyqrp/z6FDgqMNVM6NG4gQcgZFiKHB0OAtLZijcoAWX81S2yhl5mh2fHN4+RYX40tEr/m XcyzMxK+pnjZNm5Ss/g1GcirNX0pplrYxdgk8WTrlxmdJ25xmud8WtuPe4zeWLQjLnVWKAMndkhXs 1UaFatC1SLqIqwWR9+9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdV5-00EqAz-2m; Tue, 19 Dec 2023 17:03:24 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTJ-00EoLo-0W; Tue, 19 Dec 2023 17:01:37 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40d31116dbeso618035e9.3; Tue, 19 Dec 2023 09:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005292; x=1703610092; darn=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=arQ8xIKVUtWj1nUwdouDUReL6yFeDt+BlaNGpwFH10c=; b=Ol++Gc2ug0d6koNV5yfH8AVFGrJjoxsWhA8/zhOfX+Roe3TIVx0lkXF7+15z3lZ2Eg KgmVieJ25SuJWx4syvJJkxhwvjKD6rsFAgETgXhjCdLkR7cxQUVbjs63BQw1qnHwhc6Y hdNHuhyKYYbA6DoQOL1iJb2H0jp9xm4En8SEjMJ/9Om+f0p+5wSYACceaJ8u+ugap1J3 7JvCtv65yroajj8z/dgkmyVyMJ1ijvMpRMkMhZiI+/NFcew1AUbu/ZJGogu3XAcjeFJD SE7trglzgVpTNOa/v8m9kLGaNiaP2aMjHQAj04cIiy9ltS07un7pCxuDoKgkkZwFZgZQ ZNfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005292; x=1703610092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=arQ8xIKVUtWj1nUwdouDUReL6yFeDt+BlaNGpwFH10c=; b=aE3GCZYkEGkvMAMqrwSkQtkqc+qWJGIAez0VmzQQVC5JsqKzQjNf2dc0L8WHtIWSZ9 yUEgkZ81tHWd5/E5M9+vTGRdIZpnzOa+Ex1DBv5RY5W4I/YkX1iio+3n2Jx4CX6r+Heb C1Xhl/esKRH0dVgMU+TBeYWu3eeniIftURASmkD7N15cV0zUFxPkbmTJum3BJDJd+6vg A8kFVkN8icFwqlNkhGsPBMAOTq1fvTfVzwsIMcRiBLS/eqzv4fuRUQzBTe05euFdvdC3 xAu2BN4IwE5fjN0tNEP0dfxM+TV6DJQBEC1f9Q+mEJJDVYyFelfnHLsVGvzlcWp3CiiS /fiQ== X-Gm-Message-State: AOJu0YxgAigPwLW2uTvP7OFFs5ALecwCeoOgs+RtfKKh+zjfixxtx9+T VRDCLGMGl0bV6MIU7Uw6RA== X-Google-Smtp-Source: AGHT+IEm8HS6oHyVinKk2y2E+36YVQQ/TKqJ6BvNP4pRKrkPrVlgTtkIQOEcQo7tQa1nD+AR7BZaTw== X-Received: by 2002:a05:600c:4f52:b0:40b:5e21:d362 with SMTP id m18-20020a05600c4f5200b0040b5e21d362mr9931502wmq.107.1703005291752; Tue, 19 Dec 2023 09:01:31 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:31 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 26/29] drm/rockchip: inno_hdmi: Drop custom fill_modes hook Date: Tue, 19 Dec 2023 18:00:56 +0100 Message-ID: <20231219170100.188800-27-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090133_236470_3B9DC898 X-CRM114-Status: GOOD ( 11.82 ) 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 changes in v3: - collect RB drivers/gpu/drm/rockchip/inno_hdmi.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index a2a9e54b76c0..29a2c1b87294 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -631,13 +631,6 @@ inno_hdmi_connector_mode_valid(struct drm_connector *connector, return inno_hdmi_display_mode_valid(hdmi, mode); } -static int -inno_hdmi_probe_single_connector_modes(struct drm_connector *connector, - uint32_t maxX, uint32_t maxY) -{ - return drm_helper_probe_single_connector_modes(connector, 1920, 1080); -} - static void inno_hdmi_connector_destroy(struct drm_connector *connector) { drm_connector_unregister(connector); @@ -691,7 +684,7 @@ inno_hdmi_atomic_destroy_state(struct drm_connector *connector, } static const struct drm_connector_funcs inno_hdmi_connector_funcs = { - .fill_modes = inno_hdmi_probe_single_connector_modes, + .fill_modes = drm_helper_probe_single_connector_modes, .detect = inno_hdmi_connector_detect, .destroy = inno_hdmi_connector_destroy, .reset = inno_hdmi_connector_reset, From patchwork Tue Dec 19 17:00:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498606 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 4F636C46CCD for ; Tue, 19 Dec 2023 17:03:44 +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=QmJ3Qod5JRVgOxWkgyTcs1olZtb4/MvHhfw81g4KySc=; b=YD3P0KuegUbsQ7 Xtyapzh+L//dDb2CDmqrYMJjjhDinbmFM/ihD0/6+ebJdoML7g/Sm0dVTr8GBI5qOyvJu46g+y0iK wTMS8w6RSLHOFzWtqM/1VIfQB/WTHQDyf/CHjod72HoxAWJb6CoHgvIPARe6n2vrjswxMHBk6DYQQ tDscxhiS+4X8UvrUPBFRUU5CDxhX9Pth/QQl23WlrhKo49AZ5TWxOE6COnfSx2UaQ55O20FHxpfhK gJ8Ign8KoV6enyKbQ0GSntv85/5mhy9Blvy2psRIlQOVrHeboXIjHTjRBaxoKoTePN23QviAkkQ2A VRUvFfIL/4psMh0rVpSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdUs-00Epza-05; Tue, 19 Dec 2023 17:03:10 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTP-00EoQq-1I; Tue, 19 Dec 2023 17:01:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Fkhg2+aCs7jdMgzfxvYxQH9D4wpiG0MxQ7esIiT4Fss=; b=ImEEOrQbBs7hoSPkuWWSg9QKTv VPSBCUSH9t1KKB33v95B9ihV3Pgf+t9mETIxjgPLP8yQIcDTHR+C+Kh6hZMst4YsiZDE8q3wUQfg2 uoo/a56x7WwgcER7Q/+2NoYVVdt/PZA9jSKC6LQzAUmeghP6FdYjZR1eBkn3AmC1heFSxCP1FWB2k uO3LPPk5QZoeUrbB/e+lxhO1kfHyS8PfudDczEHOsDZGdifT1i4DHWYpxalQBTPTgwPp4Bjk1nWpo 84Htyyhgdavme742aFvxTz2yh50f7a8XgeR4TiR8i60kXl9S7Cg82Z84M7q/1SJh0fDmBjyQfdnOh nUfUTukQ==; Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTM-00DXOH-0F; Tue, 19 Dec 2023 17:01:38 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40c3fe6c1b5so52527285e9.2; Tue, 19 Dec 2023 09:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005292; x=1703610092; 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=Fkhg2+aCs7jdMgzfxvYxQH9D4wpiG0MxQ7esIiT4Fss=; b=NQS5CarGwvemLOkuRDB2VoTEacHZp153HZlk+Rquf5ndDn7LTKUs//Mj/KtQCnsqBf 9wPQxQ4K/eKdcSUZZfT/5qdO9m4kKPHYdhAcvUkU+dnQDrVn+NVdrScxMbb0gEeQQ1wp DGB14EsyGwYc+e+vKLo9K7BSOHlY900zjWPEh6tvpMpWjeL4F9LcJwjiVbzZRWXEvz/r PM2m5NoqpvR18Tuk3vcmXdAq7cD+e55d4mPg/3F34nZNXjzBoSxu7mFdTeH+aW8CIHAG t6oFWJAe3KzeGkMo1+fhRv7GiAwcsy+LUms21p2uK4ownAXeiv0rf3ARpTLIqYEKTtNw MHtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005292; x=1703610092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fkhg2+aCs7jdMgzfxvYxQH9D4wpiG0MxQ7esIiT4Fss=; b=UmNyunUQCgNnt7n8fsuG6a2fGm8NXoGvI+4gBEKOXeNV2IDI2Paa4rO5wWPlbp79Co RFbfVJMmyAc9wmgfzJLYUAO+LQt74eJHpS1bY50TZ0+5wHW4H2DnD2YQ1c2khydSaxKW wOEd/uMuMmQ5EjvzjHRTmldIRgsriOiXpXIdxkpe0f69tsX19Xv7dkZAsogtIFoIxzxs +R+rin3lxS0e1XgoCxUt0jSw0dLu8PA/NHblHJXsmvWXKeyoF+c7UyYczofeRp/pBn8N w0U76vyfMG4LyzjSLEM3WeUHZG3usFNByEMZAADN7oHJzpfLY4XG305yxP6ppp6gHrDF GkCg== X-Gm-Message-State: AOJu0Yy+1cIpHIQQxwojfOhH4+4Z7walHuFzQ+c+sBVC+OPRo3Xo+s6A S6fjH3S6ADojXSbNsoZ6Rg== X-Google-Smtp-Source: AGHT+IGcO6yQrlw/IQJbarilDOyEAsYRP2fJCi+GiVdt/rewnkpVpso4E0zT/HF1QyL68nY60lqA1A== X-Received: by 2002:a05:600c:4710:b0:40c:6b6c:6867 with SMTP id v16-20020a05600c471000b0040c6b6c6867mr3950390wmo.178.1703005292435; Tue, 19 Dec 2023 09:01:32 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:32 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 27/29] ARM: dts: rockchip: Add display subsystem for RK3128 Date: Tue, 19 Dec 2023 18:00:57 +0100 Message-ID: <20231219170100.188800-28-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_170136_212656_B85F69B3 X-CRM114-Status: GOOD ( 11.65 ) 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 changes in v3: - no changes arch/arm/boot/dts/rockchip/rk3128.dtsi | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index e2264c40b924..1a3bc8b2bc6e 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -115,6 +115,12 @@ opp-1200000000 { }; }; + display_subsystem: display-subsystem { + compatible = "rockchip,display-subsystem"; + ports = <&vop_out>; + status = "disabled"; + }; + gpu_opp_table: opp-table-1 { compatible = "operating-points-v2"; @@ -246,6 +252,27 @@ power-domain@RK3128_PD_GPU { }; }; + vop: vop@1010e000 { + compatible = "rockchip,rk3126-vop"; + reg = <0x1010e000 0x300>; + interrupts = ; + clocks = <&cru ACLK_LCDC0>, <&cru DCLK_VOP>, + <&cru HCLK_LCDC0>; + clock-names = "aclk_vop", "dclk_vop", + "hclk_vop"; + resets = <&cru SRST_VOP_A>, <&cru SRST_VOP_H>, + <&cru SRST_VOP_D>; + reset-names = "axi", "ahb", + "dclk"; + power-domains = <&power RK3128_PD_VIO>; + status = "disabled"; + + vop_out: port { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + qos_gpu: qos@1012d000 { compatible = "rockchip,rk3128-qos", "syscon"; reg = <0x1012d000 0x20>; From patchwork Tue Dec 19 17:00:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498605 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 7B5C7C41535 for ; Tue, 19 Dec 2023 17:03:43 +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=2wOTZrmtj+xp2z9bPkb61mHbTlXPqxgm+oLWEeYwnSA=; b=kzgDGB43ZD9cKe OqPVfGHYWHjO2yayfapWMIqAIOdv4YDWpmplsBVaKtzLBM+LmpNODF3PbInLAVyzpKqosI3j7I3eV f/4f1nI+d6Ej/rmaqjzO/qKJdyQQe4iMGug4qyiUT//TUcgWXOMj/PsU0kJm4V284OXC8RBmlo0uY Rxuw+Vs7J01ZYMhox/c/6urzB3wVtIjGHKYgPNBo+FfAKEIbNdaz4dKp//i4dBahSph3vythQZtrn 3DT/96m+OT/VFXFGnkA+ya+DrAnY2RGlSZWSbC9/TZf5Q4YPepj08IANvqgz1khkms60ojcbWHDNa Bp8AxtBmDd208qGd3+dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdUq-00Epx1-1F; Tue, 19 Dec 2023 17:03:08 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTS-00EoQw-15; Tue, 19 Dec 2023 17:01:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=824x2Bpa+BljPPIuTHpPefnYLDXHrvCUJjy6fbKwCl4=; b=jVHIPTDAM2poDg+Cgg3Dq0Ea9Z ve47DFmn51XSPLiaKQGptFjDJgZZ6BjIGnGqZ/7RkB3eiUM17jql/CYinumU2GNSvNFBPAp+ojtgq H6/tS0bGWiOzYt1lbFKZfyByNJ41q3wwiNoT3sQVhsupDsqq74O43cNAmUl7XjBmL/vYj5p2aitdv ne/F0T6fGpvd6vItXEFBlSyhVGF6poRkFWjU9nnCnkNNaig4k4UobdasF7zhHhNQeWdBVJHkdDgdg ZjRIqID14oQZuDWtsQyGCtkODAg+jNXM4SPKfrI5CfIAHhayEfK5sWcqaZlJfujLjL75xGTl66355 GscAp+mQ==; Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFdTO-00DXOI-0Y; Tue, 19 Dec 2023 17:01:40 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40c48d7a7a7so45246665e9.3; Tue, 19 Dec 2023 09:01:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005293; x=1703610093; 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=824x2Bpa+BljPPIuTHpPefnYLDXHrvCUJjy6fbKwCl4=; b=JKAVLkcpR98sJL79JsfJ5LIDbieATYJyepffcw/54vo8HdAVSPAptB/NeG3V91Hn2V nWOUaWwzPDMOut+opuYh/vQVjqNI4Mk+Q7M16qtm5p8jM/zIL3B/gVXM8fMEpgwVc0W0 TOgtWxFrHVuKHLmi3IOvVwlaqdZizTg0Mk06TshDVcNLRw+fFD+Elzkq8fDhPzkegKmF HyZTGkN7vhWzoqsJFGL01fbvLlzwCb2WPubwYs3cYwpQQ9VNJmc2PAZQj7OrrjAqhuHu 45gt5iwcbXmmM9Ry+kqJ0cOhTPi6HoJEQnQfUbiC075KzcTPyA+yW62Om0VMLfbAIzz4 CkHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005293; x=1703610093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=824x2Bpa+BljPPIuTHpPefnYLDXHrvCUJjy6fbKwCl4=; b=kcwy0X/ljXMttkOBnXT8c/z/Kx/h1Ebip95lSHjUjx5OS9OCs0p3cT9Y9vF/hx9D// nmVKynOJsItZfT1RE8WuYq1AtjXSH+GtZ3VfXJU8M1koS/wB4HAGqSA2gRbVWR2XZFk4 4WBLsrBRrk957qPYUMu2IrfHsA6gyKq8LjhzvB1upFRwEd/Ng3nhKMgfzXGYOiZL1nO7 p/Iq4msG2PMVrThu1Wk+mqkbFKBI2i0EclxbdlQSLfYLeGPa7AlOTqJhg1J9UBDxRz8h y3Ggfm0n0wX1cxrB6zIk7r21iCvXCpeJx6GThX5U56RLj9EFgtRkdMBzKefQs71azGHB 6Ypw== X-Gm-Message-State: AOJu0YxQxHrLL6wAjjKjSsWTzSyEDWdKgS/oXcoRzyarY65ycvu9F6zU cZ9iQRaas2QK2+D2dVAcDA== X-Google-Smtp-Source: AGHT+IHgcqfEoRYVHjhmsr69xyQlznMp/1EOCdyz0OLbPaZ9r38nDcrP4sBWbdQwF4XoayjoM4b1fw== X-Received: by 2002:a05:600c:4c8a:b0:40c:d3a:2447 with SMTP id g10-20020a05600c4c8a00b0040c0d3a2447mr11436802wmp.87.1703005293173; Tue, 19 Dec 2023 09:01:33 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:32 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 28/29] ARM: dts: rockchip: Add HDMI node for RK3128 Date: Tue, 19 Dec 2023 18:00:58 +0100 Message-ID: <20231219170100.188800-29-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_170138_284740_D71D605F X-CRM114-Status: GOOD ( 13.07 ) 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 changes in v3: - no changes arch/arm/boot/dts/rockchip/rk3128.dtsi | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index 1a3bc8b2bc6e..fb98873fd94e 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -270,6 +270,11 @@ vop: vop@1010e000 { vop_out: port { #address-cells = <1>; #size-cells = <0>; + + vop_out_hdmi: endpoint@0 { + reg = <0>; + remote-endpoint = <&hdmi_in_vop>; + }; }; }; @@ -463,6 +468,34 @@ usb2phy_otg: otg-port { }; }; + hdmi: hdmi@20034000 { + compatible = "rockchip,rk3128-inno-hdmi"; + reg = <0x20034000 0x4000>; + interrupts = ; + clocks = <&cru PCLK_HDMI>, <&cru DCLK_VOP>; + clock-names = "pclk", "ref"; + pinctrl-names = "default"; + pinctrl-0 = <&hdmii2c_xfer &hdmi_hpd &hdmi_cec>; + power-domains = <&power RK3128_PD_VIO>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + hdmi_in: port@0 { + reg = <0>; + hdmi_in_vop: endpoint { + remote-endpoint = <&vop_out_hdmi>; + }; + }; + + hdmi_out: port@1 { + reg = <1>; + }; + }; + }; + timer0: timer@20044000 { compatible = "rockchip,rk3128-timer", "rockchip,rk3288-timer"; reg = <0x20044000 0x20>; From patchwork Tue Dec 19 17:00:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13498620 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 561D4C41535 for ; Tue, 19 Dec 2023 17:04: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=daCyWyobr7kxtBDxIBRI1NxeqnczHvlKVvV9JdgsLC0=; b=FwhJecRJPQwH2T VB8ZU/B2etigHyWYdMgYWNHM68I0fTF+rNnbwyyb5WC+Lt7+bZjcxr0RJSB+u99K/2BnVrbJF7vUS hCd5jRVKVth3mALaLZhoUfj/9EzdVZZM5bgSYwm5+5tgz67M0ds459YG4tF5/u7LJGo2TSiJXgrrQ BnfcqNeloGbNE0AppB1yVuov2j4n4BivJWXDNgRGfGHQPrHw9mS2tgA1/qQCmQWgDF2Sv3Xj9CUUm H9ZNjh7mQ+0/bb/+F4Hly3ATsjThg+906FTDOzAf4Wu3Hej2U1qiAxhQg2wrYDugBfzYmEw8h4FmW sO0AWszfoIWOdB6whOyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFdVM-00EqRd-2M; Tue, 19 Dec 2023 17:03:40 +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 1rFdTL-00EoP8-2E; Tue, 19 Dec 2023 17:01:38 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40c2db2ee28so60209575e9.2; Tue, 19 Dec 2023 09:01:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005294; x=1703610094; darn=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=DcvRB7T9fUAwMybq5GgUQQU8bu+Y05ebI2TjIjKog/c=; b=Xx4iiaOZxE2+LldPI/bPL0jQ5pUFeYfIKS973cdbFg5JcYN6XER3L/m7SZKr3tSMd5 mrO1lYsprXcPyCueCbwCom+dqEgs8wPAVZqSGKvMbeY92KxYBxU0f+BXn1yZOjXI9mR0 ihyqEtltrBDj2/k2cWeip0Y7c1HBtdAJjTJHfUXomP5d0Ihfs3ddVb9xHBRUdAmK3wQy DOtTn00bEQsuYKOXl17ACNeIEkRIGgW5GYNxklc3Tpb0YUz1Locu37Ab55N1gaTUFeya rpnw3jSwKrd0PrZA7ootGv9z5yxj64uVQReU5rmBzw+HbNnN7lmYlsQzQ0r9ibUOErI7 mhcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005294; x=1703610094; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DcvRB7T9fUAwMybq5GgUQQU8bu+Y05ebI2TjIjKog/c=; b=FixRo0scVIuFGmUi0DmdYHwHlqq/9smSp6cWIsQf31WH8jPvN/AlZv97na96FWvp3J iIqjvM9JVCC6LN4lzZ4IFLs6MsjH4XLNmvSifray6hgV00W6KNj21SxFilgNW+tiVpsi L0mAyzTIW4ZHOpmVERyfJN/bvuEUN1xQn9nKYiV24yBh+hRCdmN6Dyq52wG+9C2PAE1k +uB2xpB76UoSIhQOEkDGaZonTHuDC2eTACPWQgj/ISD7ixK6eHfqBnro2RM45lvhhz9/ AgO1bz9WNgJaXem29JWQFA4mk5peTt5hnG28+8MZuUGX/c9p+pxtxCwlSsq3fYCqE/7F vSuQ== X-Gm-Message-State: AOJu0YzeUlMNO2xzMPhl/7GL/YrvWBY1LG1TBVSrHpwokZzkKMSct9Nw 8F75rBhm8ESwc41sl4yMWg== X-Google-Smtp-Source: AGHT+IGrAcc7/m62H6UhRJS1mgnAg6bEsa9UDyoPGrhboqs/G4K/oMz4JwX4/2A9/ksnAk+nV2p4PQ== X-Received: by 2002:a05:600c:354e:b0:40b:5e21:dd49 with SMTP id i14-20020a05600c354e00b0040b5e21dd49mr10028636wmq.119.1703005293973; Tue, 19 Dec 2023 09:01:33 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:33 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 29/29] ARM: dts: rockchip: Enable HDMI output for XPI-3128 Date: Tue, 19 Dec 2023 18:00:59 +0100 Message-ID: <20231219170100.188800-30-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_090135_794059_B2D844A4 X-CRM114-Status: GOOD ( 12.29 ) 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 changes in v3: - no changes .../arm/boot/dts/rockchip/rk3128-xpi-3128.dts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts b/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts index 03a97881519a..21c1678f4e91 100644 --- a/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts +++ b/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts @@ -47,6 +47,17 @@ dc_5v: dc-5v-regulator { regulator-boot-on; }; + hdmi-connnector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&hdmi_connector_out>; + }; + }; + }; + /* * This is a vbus-supply, which also supplies the GL852G usb hub, * thus has to be always-on @@ -239,6 +250,10 @@ &cpu0 { cpu-supply = <&vdd_arm>; }; +&display_subsystem { + status = "okay"; +}; + &emmc { bus-width = <8>; vmmc-supply = <&vcc_io>; @@ -328,6 +343,16 @@ &gpu { status = "okay"; }; +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_connector_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; +}; + &mdio { phy0: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22"; @@ -423,3 +448,7 @@ &usb2phy_host { &usb2phy_otg { status = "okay"; }; + +&vop { + status = "okay"; +};