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: 756100 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D908F35295; Tue, 19 Dec 2023 17:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aCKPCWwF" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40b5155e154so60381055e9.3; Tue, 19 Dec 2023 09:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005268; x=1703610068; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LuKwY9nW5+R7DeHCNpC77KMqCvSYagjOBXGDTeiO2JI=; b=aCKPCWwFAIn0DirJIaeFdefNIuMSwxFOFd0C3HuKU7TB57A6dN3TlntUSuZQ0d9KSY vJzX6VeBEk4NA8WH9ngm1xxJx7CePA5OIq5MMnefF3gcKA9TqgbRN5rU2ZDjWTaLFXdH K2vJUABGtraa2cv+4/zLqGv5boBiYyl+C/oBlET7z8vg7Th7sHwgWgKZDNESg4fcSg9X XzI5aoXBwnE+8vRtIunIe/363C7ZGI3nrlVIQ1Sq2ZKYtmTsjc3bO55UIdUYqxGBFF3A Ag+1jJ6XuVaOxTvyywD0sUewh07DVWVwfRn81PQiJM7WIiSCj3R9kpqec5M2oaXjDTtR Gugg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005268; x=1703610068; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LuKwY9nW5+R7DeHCNpC77KMqCvSYagjOBXGDTeiO2JI=; b=vRqctI+jvMeD5EVcdkJkBDuIBme9FNoAwtg97Xd6p43DTvTjC1+3Tj1HmBFReOBn97 Ju1zhc/8Pun5gwVM1gQJKDMyGThckyqlKY8Q5hWFUf9lxufzghzWxEiDLYceFTacUuBm RLsm4h3It7Ck1a6Y9zqZbyhvgoGoFvVSaj98N5L1q4i4J0G8q6aYNy1HWxpWLhhdZBZB zws2C732J5wU5YVyym6+BrY3F1BqQYNwsmf++cHC4THJ+bCvzs2k5Uw7UedbvYF4hHKr 2zqRIOVOMZy1JFm0WyKAF8T8Tj/8hVjd1oGMyx2RVWgbWCz/dnyHf9HE0wwzc2gDyGM7 XFZw== X-Gm-Message-State: AOJu0YwsRVTJhDFn6otHsbRFhVCS2hEFaQZpPAgMvki53+qmXygS0H8u VvOSxZJysqDj8nR7ZvuR9Q== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756099 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41BF620DE0; Tue, 19 Dec 2023 17:01:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PTe2ZN4f" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40c60dfa5bfso56957465e9.0; Tue, 19 Dec 2023 09:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005269; x=1703610069; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; b=PTe2ZN4fgiZ06579gZZOQFCsE+SlG3Kij9e/UIQ0/9apXPXF3/qbWInkmFuULsScDJ /Re70XvtGsOHayTMEat3Wug0ZYmpW6viRawc/uYAa8ZCxr0g9h6Zny+N6OD/EZWCyz1G CDB4N3FbQZsOighRD/LmQLQG3g33jn0a3GkY54bkoy6B2KD8VUpeExziEtB7Cdrf0SNC 9oEJ9a5umSP//bXTpGHL5EOuDvJzMYogUrbUYPmXpf6EO7/JNbiftG0vTJST7f71J497 N0vjT0SEQ3ntGASc/R78xhEDmBx6kddHwPBvffBbi3iWYs644/iC9h6UjvCNm2GoFBDf PjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005269; x=1703610069; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; b=bW1Y65SCECURu4e5Hk+Gyu4Qe72iTlumu8XIFwur5D46l4YFU0wj9xUrU3YqNeX/7G r9ioULlKeY/5AtaSQhtkzdXDAzJBtiEW3/bpkndu1NsWYdbA8GgQyBGH7wI7JpDdAv2j KXTWj+lWVXI64WsQ45uonK0hkH/Z3eY/DKHR2QOHV/5lT+Jg32sriJ9LLVSrVCqLgUaX CzEnZScMHhjYXA7W8/QMtFdU61RwHrpC6jSRodQTKCfHQywpIcVBJ+VY7qzNXMW+CTRe E9znlWCIXCEUapxF/1BQyUKBkRZyAFh+shIbS2y9SJ9pD9EFX+RQAs/HN/+QU4XXZLBA bVSg== X-Gm-Message-State: AOJu0Ywh4o0msj5XGWrm1S+alNffA7+NGDrLEC7IKXQ9K221eYWiSOER XzAAPtAltf0vsjZoEqJW3g== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The controller wants the difference between *total and *sync_start in the HDMI_VIDEO_EXT_*DELAY registers. Otherwise the signal is very unstable for certain non-VIC modes. See downstream commit [0]. [0] https://github.com/rockchip-linux/kernel/commit/8eb559f2502c Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support") Co-developed-by: Zheng Yang Signed-off-by: Zheng Yang Signed-off-by: Alex Bee --- changes in v2: - none changes in v3: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6e5b922a121e..345253e033c5 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -412,7 +412,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_H, (value >> 8) & 0xFF); - value = mode->hsync_start - mode->hdisplay; + value = mode->htotal - mode->hsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_H, (value >> 8) & 0xFF); @@ -427,7 +427,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, value = mode->vtotal - mode->vdisplay; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VBLANK, value & 0xFF); - value = mode->vsync_start - mode->vdisplay; + value = mode->vtotal - mode->vsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VDELAY, value & 0xFF); value = mode->vsync_end - mode->vsync_start; From patchwork Tue Dec 19 17:00:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 756098 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC57031A74; Tue, 19 Dec 2023 17:01:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mZMaMjCZ" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40c236624edso52670395e9.1; Tue, 19 Dec 2023 09:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005272; x=1703610072; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qH39RMJfndGmJ2yo6EAj0TEb5im2nG8g4/g1kbQG1h8=; b=mZMaMjCZvrsGp5stWFYqLD6tBEGoQjtF5o0m8xa7fWwjseseKxvWUlZCHvl2jXPXEZ ZKLhC0yw2+4FwBgH+MfcLGmcBjxpcslkLQ5V2+AfQ1hUQAIeAn3wtxSArKQcIBQ1ZkMt ARwUAaMiE1vYgbCGMlNmvRYcgL8AB4vLctwbcA/EC5FVbj4BuqByRIvcQPL+iDYN2Lry 6F1s6VmbgPMMMbyFnfsPF5RLxtzQu0Ihu/lN6v5AaMlvN++DU0UixTrRDs8o0AyygCbo iya/vFCFRqRdPZSeE3V+MKrmFaMrQxEO2dBBlhym+/Fj4rkI5HiUtbLbpNXRz6iLmBNz OPNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005272; x=1703610072; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qH39RMJfndGmJ2yo6EAj0TEb5im2nG8g4/g1kbQG1h8=; b=idxCJ6Ouos622kj35jcGZQaGYRz9w4x17VMJQJGw7Qz/5Vm9dnBsw6exQnn7XoCecC rT8OKAw1jdOdl1/BUEzi/J2i1qbE7OY0lZ0jStLObDrqso9Uhb8nBXQNEyJgsgryb6Xt +MYQvZ6nhqrfSEoeHo7c6C5GnnVwj0n7Pt+Wd/e7BgFm5zQnNetYKFzYX8arw4A0ip9Y 9OdtIrO70d9ssdtFFZETRszEykm8zSVD6+Be7aQk+D/qKwlYqKWsDt7drd+Mz2wnAIBI B/D5nPV4IMTyJnGecwhIyBSUZqdfTCpQkW8LorCWBlEiLWdniZog7Zhq25RRB08ol43f rimA== X-Gm-Message-State: AOJu0Yw+/1CSPE2GKnFxCj4VFr168M9KbGLK0KrNYJ7BTWraYESGiX5V JVBx5rwUlTwR8guXD7dGlg== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756097 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 447FF2EB12; Tue, 19 Dec 2023 17:01:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FRUDjZDE" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40c48d7a7a7so45243185e9.3; Tue, 19 Dec 2023 09:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005273; x=1703610073; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=15Kg5P/kPo3OprJxF+EVJ+2okgIdyNf3FbH+CrQD8yI=; b=FRUDjZDEjovrt1xIwCkp1lRhmHoMSPGZU//xVVN1+F6q6/7pAAeI7hrSnm02XyBrK0 Z36CquvYkTyWVkss8GI4rGm0s0eppPZlxGfj0PBGBG8cp9MmFgL2UlS+WpJHeML2i75E cNQHEMAqQ/DoJ1t6LOFzGej1tG9Hyml2+YsYpb10vupiSbauB+P57Ryn6H5QpFS9tw+1 uMa6oAsZVPVq23YceEg5wBCVH+asJp9xDFCutCUTTEfE4VRzg9ciIE9GZzS/Qm9m2g5v RAHJd9jN5MGCXU8ua4LuKkwet2IGuFrsbp43zCLGSS99RkwauaMbMIbV9VyB9zhqxQl5 PpPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005273; x=1703610073; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=15Kg5P/kPo3OprJxF+EVJ+2okgIdyNf3FbH+CrQD8yI=; b=h9hT6dJso3UJ22WEtvdVcqYvVcAdDfPD44zgcZ5RBZBwsGXnAhcFGM8nEGApF56S9V PLyxD4W0RtZJBvBV33fA3UXI6GQcnjyhEAGh25yUEE6CY9NKS8ZU3ez6DsWaw6GL+znJ nEynQ+JKrQvFHJnJ2faddLtOeCZ8QB9BQh2/g6sUaV9oYfS/bS4MRsj8tB9yrmCWzApn Iky68eYuy3IAXDv+0RIyhY2WifVs+x6VwyyblqCjB0Z1zlGKyn+R/+Q4expTgy0x/vVw BLZyCnZjneBQmZFk7DxcahMYwtJtdnylgcIl0HInb696u3QGCVoQkwthpvqeEVVfrCcF hcYw== X-Gm-Message-State: AOJu0YzaifUs/iBr9K8wzpX/1rOU5sN+yGxqPBvN3wzDDPFNfkpFI3u4 ZfGO6t+6ymuiTiS1pLKr/g== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756096 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43CC7374D6; Tue, 19 Dec 2023 17:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N2wiOP4l" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40d2e56f3a6so2740315e9.1; Tue, 19 Dec 2023 09:01:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005275; x=1703610075; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SMIbD+dY7Kjgg6ECXdMxWD6N2Rzqy4kZE/eQIX1m8rA=; b=N2wiOP4l4aUAfqAZSwo1LPcCMf/dqsKI0fl+SYWpkz1g2kKsWeebO9pL/F51Jjqg1t y41X7SZ57umzATIaH0/DbUjRBXtIrzDVjAeS2qsPmaA532HVE28m/Ix1ue/gOo9S/5Gz UlH/yNtPMxLQRGC2Vp2LtCKvo2sS3ZN+HlzaUv3FNkb3bSRA9jtyr1geRyNPyPZviD6L WIrUdxBbBvXeKRYAgQCOUPemBgSlqPuALFeruMxQ95CRtI4k/P4ZFewiCztReV5tXLmE +djTloKC7PrCypugqLbbAt2fGBu4RbEb9IIsPgX2laGn2a6eodk0N2VQsi73GaDRs9rg rugQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005275; x=1703610075; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SMIbD+dY7Kjgg6ECXdMxWD6N2Rzqy4kZE/eQIX1m8rA=; b=VnU3bkYRxOu+XCTEWn24Blz71ghYyL38KlyMlFe9IFYGO9NLBhKC7Ee6YWlP83gNcM 5tOyckJdG4YtHCQLyQJ6epdxJ0dMZX1XSmOV4m2QumyIrErDHuFDZ++5F1VlXy+57o9L ajDuE0rYI0gWxpHfslJbpFYWMc/KqmZlevUE/MPPoq3Gc6JblnvoUhCoEdUfTH7mnm9k WaHUYLrBLPGi91GXsQWqSm/fp4LNjHaF3PhOToEmGjLiFSNbo8ieksmkivCnevulLAwx YguZnBaCQVyWQbvq2benbirqafcFf+hxZoTY90pR6YGdpPbAlsuVrTM7VFdtUzLvwYvG DyMg== X-Gm-Message-State: AOJu0Yx2C2cU94CMzycf0gIHvi6RixRiTmwycOYu21CM84bbcR+7t8rF Bp89WllE6d05LjI1ksFp9V/jcE51yA== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756095 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D530837D27; Tue, 19 Dec 2023 17:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mqk8Zjok" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3367601a301so577366f8f.2; Tue, 19 Dec 2023 09:01:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005277; x=1703610077; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Vfw1A5kPCqeEpvkS0qSDCc84V56+/woGo5pclCQd9uw=; b=mqk8ZjokHBOmxIt8RKtFh7E76Fwny4r3nE8piPw2oCUKFxphSWbN/a0IQQC9n8t5Ie Sve05zS3Iq6tgQmp0q4rcjHGCjoAUribwz3IeF20VcryMs3CN9XL65Cbp5omgQC7gUVN iOV5MrF6CMwfCODHZHalExoJaUojYYMCQKq6crkeKcNL61HloFdDZaFDEOwZd52XbbIt oR3ve0QzjiLT5KMNagdgP8B6MBkiIPqCauR8HGHY2PLaPeyKQKvWXGnjm2t6tG2PxrJV hfeuxRsu3GRwHRmlralsbsUwT0wEKRnBIdP1qzmQZk7iXQiRZOpHR3Fg9pWzgM2eWA2T jiMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005277; x=1703610077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vfw1A5kPCqeEpvkS0qSDCc84V56+/woGo5pclCQd9uw=; b=krif/+lkD5hw9rPqvJDWaD+j+VQeLHJfD5Mp/pFfwrjQjBee4+65cJjVMxQ3VCBl4I +APRJpUkYebiq4LQtKq8PE363GwWBF4h31Hk/WuxxlIvs0Cuwe1gIDTr9Xpvh0Uz46QP ByhyN6Odzw4hk3ezTd/7Mvc83ywfXL5vRB2xg5CsLnajo2BWmkrcYbL58rr9z8PsPbbw RWX2EPQDUdgYVABxbsSRsCnYuJeKpduZ9Zq2yzZNyhFJF6cS2oPcEvZhsc2FCTC5sQuI rTDtft7lNyf2ycwcHMbx2fyGGAC7a88DxwMKI0dFZpYl5mEK0R1w/VCkIsOxTa+Y7riK Uayg== X-Gm-Message-State: AOJu0Yxyv4WW7bUWDaMgjku4uuJADaqy8BLFtlutOFOZPqH198Ue5ldM etj4A3vdK0vW8TMC2dSRKA== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756094 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DE9938F8A; Tue, 19 Dec 2023 17:01:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LT+z87q5" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40b5155e154so60384185e9.3; Tue, 19 Dec 2023 09:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005279; x=1703610079; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3jFSrF2ePa7xhmT4OxproAZh4Ygmdhf+/ONdKCw7fIs=; b=LT+z87q5RAbrmVLOBn5lhiUoSb3CS8JXqumeL2MBDd4oOeCKMigpW+oRyThw+/ch7O XjZRXILO1+PFqSpfZlAzn0d8AbtQljZq24iHKDSKE+H+fHmusCeYZUXX+r6XSroeMvR0 ApryE6WSH2KD39wFrqhD4QOHsYzf/83jDpmMXGUGO1NvnS+32vcgOdtPR5Q4N2NKywvA 96ai4Njlb+ve73hVQkLzvcDZIo1J/QcQgwzsGQQzdTwqSBDfU3zMohFVy1rHPVrFwwbU upxlu3CbS0po8Vq9MolDH6C1ti9WjGdDL/qJUJlhziCdx9/P/DqhvaRymRxqZ5EkxH5s 5wuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005279; x=1703610079; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3jFSrF2ePa7xhmT4OxproAZh4Ygmdhf+/ONdKCw7fIs=; b=nunpS2o9zYlfupEnZy1wJ1E7BM7SFMxZATYl0MsVzXs74dBFgMOOvSq/La/jGrgfEz muo67FR4BGvmdrlxZXId51mX3RqoVkE3vppzgthIT1m/xllN3BenniRTKuUQd+0/7TFy ImBuTG4IW77AB6PKcobgGe69pT5RA/ZsbcZfqCI1sdVVMund0rW1BXoOPm8M57+YSCI7 Fyo2V0WN2YbfZ3vCiMrUI9NMXOZxuHSPOGyc0gXON7SZsanGWwv6o6Ja8+yl0vkTZt1+ W9x+XJ4CsjPIB3U5P8uPE0oYHPPCjmM6Ddqpc5aspHOyYondpKFQHvDZ6J9zPaxJUynw 0fag== X-Gm-Message-State: AOJu0YxRaSAA0PgGMAnLpkn8RAX0HvWbuDS3rTWoYhg6qW7usUEguegv qbonbHfJvICeMGlBroZFTg== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 756093 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A14D839859; Tue, 19 Dec 2023 17:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ag++kioa" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40c2308faedso56872875e9.1; Tue, 19 Dec 2023 09:01:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005280; x=1703610080; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WLVOVeutPpE/o943uN9J0cWjrEPzXhsU4YUzCWYMJxA=; b=Ag++kioaLZBYMy6gi5yNznCDfCzXI5BLHTDlDjl+Hyq5w0pt3GKiBg9GZpT2NL0kgK WI0kvk7AEKiJVv91A2xLH2VPjC3Pv7dYZcqakz6G+dmp2aP0H0YLjUMdZk2P5nP9owLT AeHhDhttcz1XMy1GmzSEf87Ho6IrlhP8FWMd3ks4SikoQiXAqiNsDn4G4rcNAguOapvT HDQkzCOnsnemociZXIwliqbTWz26uOA7iC+zvBU8v4iKXh8ND/hrn+9gsJULV8uCrqU5 w7POzw71aoholSplG8coI+kEyAs6J5iBH22Hdyskr4YmG/k8ZjbWKU/7UY1mY0l58vmO LHBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005280; x=1703610080; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WLVOVeutPpE/o943uN9J0cWjrEPzXhsU4YUzCWYMJxA=; b=o2gRRc9D3ANTTon72jWEMq7BGOZbZQKiuWAIxwihQWonyH0kWjRSSlBI8V0Qjz+5fW IgNlr4rEgYmRaxNr0al8ZU8eC1tNXL/CG3UAo0rhb+TqwEVBDgJncQ91LD0WyZEQQOiA oWQl5xr9o877+GNhUVwaJITIbYJtUk7EQMoEBg6xxDsB1wGMem1EbofEQMg891cexolI H0zI5MkHwHeP3/GAjme715OrFDew7x6gh/X94I4Gt0mD4jOSxUCJkg05I5rFAXNPjswD 6wAp5kWMoDq652Js6BLk0/ItzC8zb7ZWkvOpqVD8wqtM5ABHguBACXupTyUB8Pcbdjax kDTQ== X-Gm-Message-State: AOJu0Yyftt1GqhIt/D/GWVUs3B3s6zM1/C8qDguWwHNnyRW8P0HWsnxh cPYoKFJ4TfPzG8/AA66NnQ== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756092 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2F3C39AE3; Tue, 19 Dec 2023 17:01:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="my7jBsKQ" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40c3f68b69aso45414625e9.1; Tue, 19 Dec 2023 09:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005283; x=1703610083; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0WseMEHOavtmxykYRA2JtvMxiK/FtoaZXXQqi1uMlW0=; b=my7jBsKQdDFXLbbckrB98UxQDRddpPZR3N1nusiIUa+okYJQmi9W8kGrhNH7l3mSxL 2PrjRkzwC+sgfDrnqOtiKLe14Uz4vo+gnr+hm/y5+lB+Px0GvBrAwSvoVjbvTKzCbp86 aM4aRDJ/XxqjoAYQFkk6NKFjyvViFoyEYa97OU1kY/OIyhPYFK7AsTEOZAmJzuAbepQW jHd+LiV+sN10uFIW8dt42BFGOdQGyyrYnQ3O22i2PPkIIB3I8caljibcc/EXUPPVbpfs iwSjCvCw/W+lgmDWOzQa6mAOeILzG7AqdgGw/04A9mrbzNL/ssomAVNjSVDKibyqPAwS RZ1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005283; x=1703610083; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0WseMEHOavtmxykYRA2JtvMxiK/FtoaZXXQqi1uMlW0=; b=rh2biJZHoDAJ6EeeZaK6OQ7TlQU0bDTjilsawC+HDDcKGCMbQrsSqw4xt1at2xvr/s vYdgsVNumJBynAgFvNyDzTRZ8Yt5eR3WUqvU2GFxFPxU7EmSr9ySaTbt4r9Hqsg7ARC6 Yjqq2ZbzdE3jnadf1FLxz+3yc6i42cD/2gozCgHBPtcYcLl0H+bESW52HGMpBK0PMXvr N3UrmvxoRmj8q9GK8q1+mP69Uk+TTfCg8Kn35quSGnm7cSkw/4Tz8kYrDQgM+BILmXXG /GMIVZH5Oa5QOOXHqBVYxeMj2G7GsRwx1Nf7Y0HWlOCnM5ZWD98lS2a+Ju2JukLyc8wW KKGg== X-Gm-Message-State: AOJu0YwfKbk69VQf/D1yqeUThWVVkkh1E29neEzyyDlgDdLXzKqpee1z 0Ilu9FVi5nY1umyue0j8ig== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The struct member irq isn't used anywhere. Drop it. Signed-off-by: Alex Bee Reviewed-by: Maxime Ripard --- changes in v2: - new patch changes in v3: - collect RB drivers/gpu/drm/rockchip/inno_hdmi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 51c1a69dfcc0..138cd4287dea 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -45,7 +45,6 @@ struct inno_hdmi_i2c { struct inno_hdmi { struct device *dev; - int irq; struct clk *pclk; void __iomem *regs; From patchwork Tue Dec 19 17:00:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 756091 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AE4B3A269; Tue, 19 Dec 2023 17:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MJTpj7t0" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40d12b56a38so39144415e9.2; Tue, 19 Dec 2023 09:01:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005285; x=1703610085; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lK+KwYJlEuYLJRgnAK/weBabBFLF0yUxX6bkfoGTqMQ=; b=MJTpj7t0+gXxEYXmiaM9UA8Pl2Qgvsc/mDXOBiVrn9++BL+MhkhYcvHFMaWd/EELMs v1CUxGZBoA+tRJ6K7I44ST0JxF0sDlFl+N8/SPLwrdPqUsKv+fj/7Esh47zNE/GsLj98 Gl4sl82hAmRNm2bmMzz1ygkkGfB0YyTccgzW2ayQq5iI07XDO39YR8fKZsc5W/eFT78Q B6kMvu+FfdVec3MEzPEmb0+OFaqRobEg6b/sDflVTjrl34bdSIm1+9hyfUgkEphiFBnO uJeQ2QdsNoEjkmjH48v1QhCfI+jJUAUJwbfnRanBfoiUmIkkg/Zg5iwHrCm++l3E0b8P 81AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005285; x=1703610085; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lK+KwYJlEuYLJRgnAK/weBabBFLF0yUxX6bkfoGTqMQ=; b=Y0ihTF6zrN+qwiYuYcYdk0gB48KwGBaCKUB4kTeOltbfErJVbsXpY8KzRg+cP+X/jZ x1e8QV7WQg+9Eu6oFsiJzP/r1xQ51bXB74+VbHBJiWSr1UCH4rll9C0dmVyTYuzaU3DX 0Ko0O0pVMza64G3QJGXDTjE4/SBGVfKJiEZ4hEiXnAg68+L38ir3lYBt/3nu0W1KI0yA DROumg7YRhGbY0G2Ny18V1Dz4pi/8QeXuDqvSANuYGzZOJTdcEcnQo9y2RZ25J+4Vsba yQ6gHinQ40KpzU2CFMfGoHsFN/lrXp1+bNZAekZ5mX8JRyvyXK+JhZubOwu6Z5hacCJE qeaw== X-Gm-Message-State: AOJu0Yy5YzfdSewGA9fWLAj/2umvB6VR5BCMG8m+fVQc6YpnZfBZk7AW NcJujuIQ4k4c/eBVS0hZtQ== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756090 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C0A73C087; Tue, 19 Dec 2023 17:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Al2e0YvO" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40b5155e154so60386005e9.3; Tue, 19 Dec 2023 09:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005286; x=1703610086; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h8JOWn9GU9Nla83BWtTSRAknxxtN8+L8TovD6+V8Mi4=; b=Al2e0YvO08Yx5vbGmdiCLzVSqo1QSvU7dfCzZG35xxH0q5z4jMChpRRZFZC7Qrp2bx VZbxxwcIxW21tXSg27VrN+z12oHfcR5OiBbObpTZJeX3FaD4PFK+JOKnC7ISKkus41ni rKzbRB97rk7inY2cbsc9AC8c9zBLDNIR3edFoEEn2xaroeNIPOTVZMWyAD7sB9btrXzc QOOBVSBlZrHRPzWm4wHMBNJr5aPhj3BDmB8rQUk/goEUiAmsNxa9ZliiQjt6Qxb+0KNn GEonyjv2GoVoUFUsi76p1qDTlYgVKsEUyCBrXmMi7p2cHOXJ0yVuErx56CRwjM+/aQ1B mqKQ== 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=noGJ/P3ljibZ4lvVxXjlFS6rUyusS07m0kyfHU3moDy5rLupQwQtWtoBxfF9ooJZnz dt/6UpIsItctojw6sOiczRtTXpNkMWuS2Hlm+TUnbw7BC+R2UaVW26B1cUvZTkvY4uye WXHNUQXPEKAsbeouBERdw2N8aO2Gu70D/Y6XgAkyOV+RQZYKOFziGi/nMPdy5zLSyuyM duJ823dKNtzaekOY3K+C3pIW6RQHvWh57MXG1X2tAEdhDOBnWufVqmxEv9FszU1bjLJ9 BsHTg+rEVPFJq9t17Mq2NEqzEFZmv84qbGaFHsioMbU2z2vNYdS3NDNuYWfxi4OPSlu8 HjOw== X-Gm-Message-State: AOJu0YwUy0+oB2i72zpKDZxglZPFdQdxkv56yjgFdvdzn704bbwu8HTy /rf1ZeWIL224uCqqQCycWABC9WYj9w== 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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756089 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E7F43EA7F; Tue, 19 Dec 2023 17:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hDVMarUX" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40c236624edso52674115e9.1; Tue, 19 Dec 2023 09:01:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005288; x=1703610088; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6i2p9YgvuxkTu14agPnwE9rj1vc0S1z9mKZiq597B/g=; b=hDVMarUXjYkRfpoTSkbQgZjwX9ibXocGTKvV2wb0vILQ2bZFdn5EFRvchEUMLx/YzX dScIannKKTeWdY3Jhzn9sPbRiSRavGE5T1ILPqU7SEYkFsIkVtGzUmntpdqckD5ZXfFv hudDjSikpWsnntNH7QuuYrgwPBNlzfjPpdDIn1wKv9Hj7LISoTdYn+2AtJL3Ev/2TTQc jlJ4B+oub1S0BMyEShRV7azYipZGjXYpwKrclijpASC7rsIz3UzfDo2OOqkU3/mfhq0d /a2Be4kO4uL1KuPv/LBwZnHHBLJgpUA3yiB6tV9q+lAVl4Y17uelFGSoNwyUurlvry3y j5sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005288; x=1703610088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6i2p9YgvuxkTu14agPnwE9rj1vc0S1z9mKZiq597B/g=; b=d9FarpnoTU0A4rGN4F93buWgfCRwX0HWdsPooW7Yxh/QaH/Ho3d0nvdsNB1tGSOjER vlz93RVWRbkwcvmamZkPJ75VV60w6cWKrvt+57kanrEYrjZgJe02dZt893XbtFpoFUEy V0qQfqQk/1IoRSG8+x0mmbfsyApfOhFW40viPT8ymFd5cXVX2LOoKxEilTr3RUPKMGWT s2LDcO1RFUxW7ZO9NlcaVhfEfabvvPW1aTpEf5x8bN0ZCtpbK6fBMkxGdFQm41RCFALo wCGI0+HF9lBLkjbRaa7Q2sZSl3DERux28cBiVfDF7kYqh9GUuzFMeF7C5hZfw981QTfd js8g== X-Gm-Message-State: AOJu0YxHSFBFnHeQKTJkodtsgBWQxL0Sv2Y5h9LMHqplbg1jZvanLUzX iT7aHztRDNoFPC5u7oBexYSBrUiQzA== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756088 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC75040BFE; Tue, 19 Dec 2023 17:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XlocDPac" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40d12b56a38so39146185e9.2; Tue, 19 Dec 2023 09:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005291; x=1703610091; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lg73sX3i9a8aQACa3LQIeyAKZ2sxvdHhoE4dFqwZeRk=; b=XlocDPacYVHgSupznSKk4CKMDwHhcuRui0K1xzG19Z3UgDJ2lW+Yf7UxK3vyTXm08V Qm0+rTx80yjhqeR5HU/FpSVbnt7kGc4qXjjA7M5PANM+ebViri1nVDM8+7eUKLWT4k7k 8YUWZyaqS2gyuxe3QPdTe350EdmKCr1putAzlL7PDUR428Nz0fCxKTOyD2BqnknPnvxC m5l9D4pfO0oPMa1w5msSWD0XJSS8fjgCqkFmhv5iRglGr8hOJZd3lzrQYJgVN9k+/iIJ 14tPYheQ0aVmngizn+gsQRi7DhqDYHNq2I7jAFBiNN7eTnUpln2RcZlM4JBJeB47ppdL NN9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005291; x=1703610091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lg73sX3i9a8aQACa3LQIeyAKZ2sxvdHhoE4dFqwZeRk=; b=ir+yfOiWGOnY4iQ82h0mjcIJyxeKV3oVi4IUmyW42q92imjdMTIBYfIoIhKfjTVlmu T3E1sJ5fOHo4VKmBTzKjx0AqlgkQIsPc9yG6lYnmfDpR4B0mMU9locw+fnJVDmCp6hM4 Ek+dwj79W/Xlj1cQbLCOxKlj2KH/pim6RYSpjimXTxyyuf86SFKPVKagpBnuaLIcoWgu whTt2rpEUiaymIa9nFbbneO6myLhvWMwmeb9OsNMoUl1rJRCtT5KHsUPbY8ete2jsgf4 iWfrSAtfFdn24PjBn+HIYVfEy7K2N1ntTXsvZOcQRK4fR3zChZC/nmaqeepAO3KbQsT9 EkKg== X-Gm-Message-State: AOJu0YzOY/o6GmDRZqxzTfU+y4pB8hqTkrazij0whjnbT0AvH20XpcdY u7z1Bq6+/8H5NA5VFi028A== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756087 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3428A4122C; Tue, 19 Dec 2023 17:01:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HWVyosnY" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40c236624edso52675025e9.1; Tue, 19 Dec 2023 09:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005292; x=1703610092; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Fkhg2+aCs7jdMgzfxvYxQH9D4wpiG0MxQ7esIiT4Fss=; b=HWVyosnYBT9qd7Siw2XO6SRefXBcxmMm0GWL7vf5MNPyjxV00ZX5NY3rH0uB4jMCF3 Et98m9PSx+GQKKcUSHfGMRX6MYd7N+jvxhOzkw4XfVuxaOgb395C9dY9/aB33JBuUU7O W6k6fxCthPO+Kw50jBTgvvdBq+O5KyEeGtlhSmNajr7IMl81Q7EZnlJk4CWlmLTlqOIE MQV3v4iXZXiu+wPy2VAF0DIiAhlPvmf7OWvsylptxNP+3PXWLx2XDUMF5Kg5EznsCgkz /c36loJP9sDltJTCOXrYBVfycDeKjgMwL5iWb/oZXZ6UMWKTTYNE+kchNOEFkXNSAfZJ NJhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005292; x=1703610092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fkhg2+aCs7jdMgzfxvYxQH9D4wpiG0MxQ7esIiT4Fss=; b=tEnNId9PMN/86vefeb2LtYPl/3GRM3Vv+5oVomifr6hBORSItTPWX/wtPsLRKLZJT8 oJdeya+WFl8bjK/WK5nPG4q0WcUyr0JzxZ+MypW3I3bmmUUey/fVjVKpfdr098uYdmPn snlmh8EEbgNS89hTmmwlCJqXC5JFFf5VL6YFxHso3Mo32f/uozTIcenmDLYCx98qNWBr tKkn0DQk/sIsPgihWJyPgXEVcyikF7PwOMcLvfh8EP47IZ4/zQoOEeybLK1e2FMfmD0a 7NuYSabjDEmcB/lv0LAjmH4l6VVqR2q10xX4WCzwtH9kgI74dyD2rmdZPHZEzSuNdAWv E32Q== X-Gm-Message-State: AOJu0YxvNtm4WfVC6u1IQISBl3CYRGKgCgNZvLWOd64vI58jUzGJz12s aYHK4vD/K2G1IRgO3vgEGw== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: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: 756086 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEF7A3D0CD; Tue, 19 Dec 2023 17:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="j8lZdZ0d" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40c580ba223so60191405e9.3; Tue, 19 Dec 2023 09:01:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005294; x=1703610094; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DcvRB7T9fUAwMybq5GgUQQU8bu+Y05ebI2TjIjKog/c=; b=j8lZdZ0dWNbkJjNjWdpoR7Sq5N2+WsPqhjfDPTYNw0/osbeikjFrURkBs3T375koqJ tL2vMmY3Io5SVPXnPvsZUkkDNjYSdp8OiQXOv0SOs02pEKhj9MWwvqRNz+PVfYnWsx1y 9a3qEcgQCr9vtcbZ30ubodk33XElhLxldhwOXSPb6uXfnQCR+61YbMerK+tN4TD+3Zok Et+z9dplwGUy/WxbB+lDK+wiMnC1qhUlvDR5EliQbBhomWUbD90KevryJGKSXvb5HORW Iiierd/i5ks57dO7Ng3LDebTD/fZYA0fsjPDMZmszgPnVkgMA0SMAl3HgLdE5j0LWGfl nx+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005294; x=1703610094; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DcvRB7T9fUAwMybq5GgUQQU8bu+Y05ebI2TjIjKog/c=; b=vcR4IkPAADdwteu98XyiYq6w6p+fMTaXgklt2ZI/ZVWP/2I8wAAbpNg+TtLIVrLoRV oeSY6ej2j9zFVuuyeY3cDnzlR+7W66MUkLK2jSqw4SQovMk012E+d4XdyDTzT5XkRhJa syYeznYxsf+6akAW/asDqkIsQ2Nkp+eCK1EmewS0TPOmc4ELmBfMO4EUAw/+hgiBvHEv 1aYViLGO+fHe6X2hSX6UkeI/6oiFAaBQ5uldo+jpfp/hUyKxdojU1qKemYg6Tmw8H0wt QhYWARRTHn0fimx+ChpBTurV55wkjNDSqNZxwZDxppAu/g8mjs7lI0nI1ZvXUnzTJFHd zyNA== X-Gm-Message-State: AOJu0YxT059MkROAJt7v3pdPkIaMkk4Lja1yHipgbebkp1bEZqf81G3C u8QMsSNI6M8/DVRFhxXFdw== X-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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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"; +};