From patchwork Mon Apr 1 23:51:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13613141 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 8F4EFCD1288 for ; Mon, 1 Apr 2024 23:51:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6ECB210F69A; Mon, 1 Apr 2024 23:51:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="WPNh7rmS"; dkim-atps=neutral Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0944C10F65D for ; Mon, 1 Apr 2024 23:51:16 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-5157af37806so4927298e87.0 for ; Mon, 01 Apr 2024 16:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712015475; x=1712620275; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+eEH0u79NHtVDKA13PPuTSc6hJlgwppuYqct0Olpnw0=; b=WPNh7rmS1XUZyen8mWLQK5faYJ6ekdsJ2yH/n6U2emSpYzeWKFZ53idvU0gFMPqsZg keaWqQh4y8s2odVeFCyIzihRAhAASspWyNChUuJlKsePmhqTVNBnV8WDrYUdg1jqkAqJ 3QRedaFtN/mQaADUb7qSQx5DM0SBt47p7WovFlEvuqJDdPS5HtCMAS/M1Scot0bvHBSp R9aRt5QH1SDuZMF4U3zKaNRw71MNcgHVwYYGkWZDxpvYIL6/k8zgXAU/rSHTRcHscGwo bdZ/39XlfLhYqwGhfOnr57pf4n2pkxOnD9yXWQgAqzJQfxfzEzfxdCaZ1s0PSYCinXSv 8YYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712015475; x=1712620275; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+eEH0u79NHtVDKA13PPuTSc6hJlgwppuYqct0Olpnw0=; b=Cic8NuzNa0KTBZ9ngLxpClrGpcNIy2vS3OgjrW5tYC6w6tUpnakmB5z3rP7u3tlSpT +KBUEg/4I4Z0swSPvF/x0EUVwe/m12Dgf7jFKUAucUbdCXxPykag4BcCD+TsS4tvA19x QZjujDL3FD6JGwKQOY0PMk/rYq0oeTV+vi5AJ1efv1u5NDUu2AgNtROWIKHSSNKoMi0z N8BuBp915XyMRAxu9cWtRZ+1iXlVAWtDfswPj47HMz62kl6LeRCMGq954ozqVEPSS2nE 4sVhZ33GHQTjTWSY0j0vy7lZDAaKMrtP15bfv8J8BQ0RzV8/XrqSicC79+GuidpPaVSA eu1Q== X-Gm-Message-State: AOJu0Yw1rCyBjpSTJvPt8aD25j3A1cuFSEvwHzOHC8ORaWCSJ1FeJ3oY B3pemHiNLpYLqczfCkQG9oswTqlS9vKXZeHHNxMseS8mffizVpuvNAEJvzL/DfI= X-Google-Smtp-Source: AGHT+IGTCwDowGTdalqVrCQ0Eu46a7Gmg5+5Tr1UPwFjEX8KSGSLgiPW2uINmMR67uy9bjuZ6puTAA== X-Received: by 2002:a05:6512:3688:b0:515:d4c7:d23 with SMTP id d8-20020a056512368800b00515d4c70d23mr5121851lfs.67.1712015474994; Mon, 01 Apr 2024 16:51:14 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id g28-20020a0565123b9c00b00515d127a399sm1176135lfv.58.2024.04.01.16.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 16:51:14 -0700 (PDT) From: Dmitry Baryshkov Date: Tue, 02 Apr 2024 02:51:12 +0300 Subject: [PATCH v3 1/4] dt-bindings: panel: Add LG SW43408 MIPI-DSI panel MIME-Version: 1.0 Message-Id: <20240402-lg-sw43408-panel-v3-1-144f17a11a56@linaro.org> References: <20240402-lg-sw43408-panel-v3-0-144f17a11a56@linaro.org> In-Reply-To: <20240402-lg-sw43408-panel-v3-0-144f17a11a56@linaro.org> To: Sumit Semwal , Caleb Connolly , Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vinod Koul , Caleb Connolly X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2135; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=12rUl+2HnN8d7afCUpo5jilPDeMfLdH1F3n7T397uIk=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmC0hwBbAPFoe4VO+0i+xUCjCnUrwhXAUz8gChl BvoLM78kO6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgtIcAAKCRCLPIo+Aiko 1SReCACowHvqNUvZGrCCOaGMgmIDhg8ZmYUdtAAvvyl2y4/6Oo664vzHuoX8LODxS80H/VENCRC uJiG08iJrDMUDE5HgSuGA+fqiKmfNF5Qe4zcUPTvr/Rs1mWiNsWy8NEOcoh5GRPTM7mZ/H5Tw5C kLO/KI7SZRV6H2dBX4NFa27DPEuPdFswYpTxjUWxIhNyUG2Fvue9WXDgluiS1cvHw8ZAkC9LKNQ Z7Bv7MJ/AQnRfvNF9G8nHN4jEE7MX7fUE7mAFflg1OBvDWtJh3++Ph8aHgtPSLvj+gwD3q9E1uN anNOwBmd6YkWQQe3zt2s2trXJGsp95RfTO3b8VFJs8zPYIu3 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sumit Semwal LG SW43408 is 1080x2160, 4-lane MIPI-DSI panel present on Google Pixel 3 phones. Signed-off-by: Vinod Koul Signed-off-by: Sumit Semwal [caleb: convert to yaml] Signed-off-by: Caleb Connolly Signed-off-by: Dmitry Baryshkov --- .../bindings/display/panel/lg,sw43408.yaml | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/lg,sw43408.yaml b/Documentation/devicetree/bindings/display/panel/lg,sw43408.yaml new file mode 100644 index 000000000000..1e08648f5bc7 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/lg,sw43408.yaml @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/lg,sw43408.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: LG SW43408 1080x2160 DSI panel + +maintainers: + - Caleb Connolly + +description: + This panel is used on the Pixel 3, it is a 60hz OLED panel which + required DSC (Display Stream Compression) and has rounded corners. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + items: + - const: lg,sw43408 + + reg: true + port: true + vddi-supply: true + vpnl-supply: true + reset-gpios: true + +required: + - compatible + - vddi-supply + - vpnl-supply + - reset-gpios + +additionalProperties: false + +examples: + - | + #include + + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "lg,sw43408"; + reg = <0>; + + vddi-supply = <&vreg_l14a_1p88>; + vpnl-supply = <&vreg_l28a_3p0>; + + reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>; + + port { + endpoint { + remote-endpoint = <&mdss_dsi0_out>; + }; + }; + }; + }; +... From patchwork Mon Apr 1 23:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13613142 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 EAF5DCD128A for ; Mon, 1 Apr 2024 23:51:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 94A6810F6B0; Mon, 1 Apr 2024 23:51:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="kfRdHn16"; dkim-atps=neutral Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id C318110F65D for ; Mon, 1 Apr 2024 23:51:17 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-515a81928faso5594734e87.1 for ; Mon, 01 Apr 2024 16:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712015476; x=1712620276; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=mpzfYidIvNvRN3cBwlHro7O/6yl5AJp4jLHzEWJGefo=; b=kfRdHn165vGVWs2YxiexbLNgLtFKldrsXwVya/uVSEg5Vb1IDRo9v6kqgMsq2QB/If WZ18yggZe9zJfacyLsMPwUWZFGhZtS+O2PEkxlrZYRaWvNPvUqBSDJXGk8tfCQnbnYgW o38q3sE3a6Q3t3NPWj2hgap7rTLEq4ofgD0oeI+movBSmx+oa0RucR1SPjnPPmre2SmP 69qWaSZcc06tN9cybNYGboNVuEP2S0UGmId1GgGbj/ZGofSDGNs9CQ+8QRX8Uk6kyo+M XmSyr3PpZdKjmLSOXjdsayqH+h5xyCnnbMAI9q1/710798OZ10BpZN9H8Ex5XH9vfKLA 3fzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712015476; x=1712620276; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mpzfYidIvNvRN3cBwlHro7O/6yl5AJp4jLHzEWJGefo=; b=uUH7w14RhZ+GD45vOnXDAXPB8vWLKKapmI/dxrlX6tJUrRU/P/yur+J9ttslp9LrDn m3kI11JxdVEhknUAGmuiH6vidBukt2VR01YEWq7zvOLYJuIftJ2O50XcyqIHVMZkA29i 49TLlYkDHsr0n4T9A/joAm4YOEsSO4j0zEPWttxV8HyD0a3DoLQYOAkLKGWGKA8hHQw6 gO+S83G1dHbsnJLqHX/fjcvUAS5e9TI+3UsfpTxzcrwpgP4KsEZ/HrMbqf8YAlIPYcwG nKNOYOfEaqQNzn0a9eon1I8Xkj5LcLFwpkcudO2g/SScZRMBldiM2RFIqD68lUqrVyZF Odpg== X-Gm-Message-State: AOJu0YzNLniI8l1ci2/jRRUoimsgRu3q3NrYkvFSDLiwMGwnUWT9Mj03 Eh4YsKVCt1sFl85EzkUqQ/Wc3+ZalEZTsQxgVnaVsz4vNbb/11B8q6zpgvVo6yc= X-Google-Smtp-Source: AGHT+IEB2QzZuXS4R7In8uUvOplVuIkx/5QcTjBrAkrqWljwAWGeuJ4Uw8lPhznuCpa/fGL+cqKnOw== X-Received: by 2002:a05:6512:3b0:b0:513:bf23:ce3 with SMTP id v16-20020a05651203b000b00513bf230ce3mr6870634lfp.62.1712015475781; Mon, 01 Apr 2024 16:51:15 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id g28-20020a0565123b9c00b00515d127a399sm1176135lfv.58.2024.04.01.16.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 16:51:15 -0700 (PDT) From: Dmitry Baryshkov Date: Tue, 02 Apr 2024 02:51:13 +0300 Subject: [PATCH v3 2/4] drm/mipi-dsi: use correct return type for the DSC functions MIME-Version: 1.0 Message-Id: <20240402-lg-sw43408-panel-v3-2-144f17a11a56@linaro.org> References: <20240402-lg-sw43408-panel-v3-0-144f17a11a56@linaro.org> In-Reply-To: <20240402-lg-sw43408-panel-v3-0-144f17a11a56@linaro.org> To: Sumit Semwal , Caleb Connolly , Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2540; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=rOvOaoNrEOh1JwJ8A0R+xJN2bNlhVIkJiYWXEFZjcZQ=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmC0hwGj7vMo/Qzh0+3TBiCZLL4baY6KAU+dlyE vw+6BoHZOyJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgtIcAAKCRCLPIo+Aiko 1Zv+B/9wd2V5+AZfCycvRGBF4noHw+StvkzjCmm8/yNBKOTXw92ECQQeXQyhdCDfxWuJSNcfdhH z3MjqZwynJX76c3byfFHg3E4Y16BAv21oi7lfKZXZCD3eotB7i448jq6ObfxKEBWEae3rT/+nKs GoP9NlqdeuTpURnhpCqqb+Xt9/cfmyyavxioTm0vhtfT8PzGPiIh54S3UZkSJqZ9j6pqY/ugBAM bsC1MPWunq1bMRstUGrwHypdSHdHgGXfR5cbU2Qd2sfYfJmUgiTOdoMppG0NmmtILsToesdm/q/ RxDM0+dlz8tfLJOi90XWEi8jRA9un1FqARRV9Vbz/7aW/duX X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The functions mipi_dsi_compression_mode() and mipi_dsi_picture_parameter_set() return 0-or-error rather than a buffer size. Follow example of other similar MIPI DSI functions and use int return type instead of size_t. Fixes: f4dea1aaa9a1 ("drm/dsi: add helpers for DSI compression mode and PPS packets") Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten --- drivers/gpu/drm/drm_mipi_dsi.c | 6 +++--- include/drm/drm_mipi_dsi.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index ef6e416522f8..9874ff6d4718 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -654,7 +654,7 @@ EXPORT_SYMBOL(mipi_dsi_set_maximum_return_packet_size); * * Return: 0 on success or a negative error code on failure. */ -ssize_t mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable) +int mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable) { /* Note: Needs updating for non-default PPS or algorithm */ u8 tx[2] = { enable << 0, 0 }; @@ -679,8 +679,8 @@ EXPORT_SYMBOL(mipi_dsi_compression_mode); * * Return: 0 on success or a negative error code on failure. */ -ssize_t mipi_dsi_picture_parameter_set(struct mipi_dsi_device *dsi, - const struct drm_dsc_picture_parameter_set *pps) +int mipi_dsi_picture_parameter_set(struct mipi_dsi_device *dsi, + const struct drm_dsc_picture_parameter_set *pps) { struct mipi_dsi_msg msg = { .channel = dsi->channel, diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index c0aec0d4d664..3011d33eccbd 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -241,9 +241,9 @@ int mipi_dsi_shutdown_peripheral(struct mipi_dsi_device *dsi); int mipi_dsi_turn_on_peripheral(struct mipi_dsi_device *dsi); int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi, u16 value); -ssize_t mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable); -ssize_t mipi_dsi_picture_parameter_set(struct mipi_dsi_device *dsi, - const struct drm_dsc_picture_parameter_set *pps); +int mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable); +int mipi_dsi_picture_parameter_set(struct mipi_dsi_device *dsi, + const struct drm_dsc_picture_parameter_set *pps); ssize_t mipi_dsi_generic_write(struct mipi_dsi_device *dsi, const void *payload, size_t size); From patchwork Mon Apr 1 23:51:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13613143 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 D6388CD1288 for ; Mon, 1 Apr 2024 23:51:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7275B10F6B7; Mon, 1 Apr 2024 23:51:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="sm2Nb8sS"; dkim-atps=neutral Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 440A210F69A for ; Mon, 1 Apr 2024 23:51:18 +0000 (UTC) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-513e89d0816so5322463e87.0 for ; Mon, 01 Apr 2024 16:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712015476; x=1712620276; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=aWH1PpmsAIit2qpLVPFipp6RvFkcic0ChCVLomLjuIA=; b=sm2Nb8sSl7x7kPvu3m+WYrP+xYO75knbyE+yx0jiw+goBSSMi1FfD9RujKnUlqxSXB KNEcrhOEq3NMW9Y4wDLolFhkTwD6Z2Y2kTG8MyZGyT0JNvE4/IrclQsKLfHphvFXpFGY Hm4MkPpQ4ONJEiHOlg8Zep6ZlzxiM57pcWfgTkp5Q8mufob36/OSMNVSpUz0V2PfyaYR 8PNNe2j0POLrb1UMhXe+yDQ7vC7yQAMfAeUwgs9/niNZfxuoRcAMhLqTqHR0+RrFVl8S cFrKaDy/8msYKUNmVslRUok96G/wvzKPqXww6DA30RsQwf6zMFgKnl1sZOXajt44xw69 H6Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712015476; x=1712620276; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aWH1PpmsAIit2qpLVPFipp6RvFkcic0ChCVLomLjuIA=; b=Pj0M6CPai/Mj4i1Td2oe++cNhhCK/l1D0EyHKZIvEhc9htwc9+4Qo6aXjXDn8rAZ38 dD7Y2dedPcFi1PLvCiY5Chb1i3xkZMCCNQIoxiCa5WLPTcfS0uWjVaZnaU+eHZwl4Qus D3/ca4lA2ArYksZYL7xL52jeMYwsiW60GdNnGkHTg4mlfhLNYhSIw9pE24YUaAiUFNXa yN8ArC4vUHm6M/wDOEu06UO97kXf+UYNVyjtgmxgf/i4RKc513G11qM3W+5EHq1n2V8m 3jTtbzMerxLSGM8/4Ha6F9o392qTOUJx0OrCyBBqYFHh9sxHyY0cnhWei8OrdpxZKaBu /njQ== X-Gm-Message-State: AOJu0YzeH7XvCa8ImJ/6X0gRuwQzr81m7iGHEMbHJeNMgJGxzR0KjPa3 dZGnKwg0+CHTm1cycE+QAQF3tA7HTeWCcUBvQrg8B7ENe0EKWU3JH2Qz6gHKN4nMKv9d/rl9CNG I X-Google-Smtp-Source: AGHT+IHU8mhblcnj0F+VJOhDLMZHAjM00+bPIg7rgW4CAgCcVLhJ1LgBJh1dQJEcXWjzKc7YQu5jtA== X-Received: by 2002:a05:6512:400c:b0:513:2b35:2520 with SMTP id br12-20020a056512400c00b005132b352520mr7110658lfb.58.1712015476466; Mon, 01 Apr 2024 16:51:16 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id g28-20020a0565123b9c00b00515d127a399sm1176135lfv.58.2024.04.01.16.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 16:51:16 -0700 (PDT) From: Dmitry Baryshkov Date: Tue, 02 Apr 2024 02:51:14 +0300 Subject: [PATCH v3 3/4] drm/mipi-dsi: add mipi_dsi_compression_mode_ext() MIME-Version: 1.0 Message-Id: <20240402-lg-sw43408-panel-v3-3-144f17a11a56@linaro.org> References: <20240402-lg-sw43408-panel-v3-0-144f17a11a56@linaro.org> In-Reply-To: <20240402-lg-sw43408-panel-v3-0-144f17a11a56@linaro.org> To: Sumit Semwal , Caleb Connolly , Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3789; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=WTwI7tKciTN5NWHCt4BqSsgA7bUxADqHjwO+LN7NrqI=; b=owEBbAGT/pANAwAKAYs8ij4CKSjVAcsmYgBmC0hwJvacY4ehW/Ceu7lfTrySVrrn13d1CLQyM ZRQJ/KbnwuJATIEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgtIcAAKCRCLPIo+Aiko 1U7vB/dh2BGQN/Mm6O0WkvrdCXjfTFIvnx8fEkf+KBWt4phogk6quGH/qbIOx9BrjKb4QLG6o4d 4nwaEtlFEsxntWlts4n04MRDmIkj0l8f61WG0D+3V5oIOlYbUqHqkRLfZkvKamNMRQWpJJ8w8IG oo+FwMm0BRsWdv6jKZS7NSgbIUeL3ujuwobCdeuKSnZBioObB00bmPsSVBM7nms6EYGdHyMBLoC EXRijraGYfsQL9Z90AA/vFsQRYUkCvJxrfS2nc5adbnFzDjZBCP550wPMIY5KP6y7tQmK9Q1TQF HO6tLOu8r16FqZIE5SDgVR3K1++eJqWJF0wesdt87aomAHc= X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add the extended version of mipi_dsi_compression_mode(). It provides a way to specify the algorithm and PPS selector. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_mipi_dsi.c | 33 +++++++++++++++++++++++++++------ include/drm/drm_mipi_dsi.h | 9 +++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 9874ff6d4718..0ecbc811eb7a 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -645,19 +645,24 @@ int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi, EXPORT_SYMBOL(mipi_dsi_set_maximum_return_packet_size); /** - * mipi_dsi_compression_mode() - enable/disable DSC on the peripheral + * mipi_dsi_compression_mode_ext() - enable/disable DSC on the peripheral * @dsi: DSI peripheral device * @enable: Whether to enable or disable the DSC + * @algo: Selected algorithm + * @pps_selector: The PPS selector * - * Enable or disable Display Stream Compression on the peripheral using the - * default Picture Parameter Set and VESA DSC 1.1 algorithm. + * Enable or disable Display Stream Compression on the peripheral. * * Return: 0 on success or a negative error code on failure. */ -int mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable) +int mipi_dsi_compression_mode_ext(struct mipi_dsi_device *dsi, bool enable, + enum mipi_dsi_compression_algo algo, + unsigned int pps_selector) { - /* Note: Needs updating for non-default PPS or algorithm */ - u8 tx[2] = { enable << 0, 0 }; + u8 data = (enable << 0) | + (algo << 1) | + (pps_selector << 4); + u8 tx[2] = { data, 0 }; struct mipi_dsi_msg msg = { .channel = dsi->channel, .type = MIPI_DSI_COMPRESSION_MODE, @@ -668,6 +673,22 @@ int mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable) return (ret < 0) ? ret : 0; } +EXPORT_SYMBOL(mipi_dsi_compression_mode_ext); + +/** + * mipi_dsi_compression_mode() - enable/disable DSC on the peripheral + * @dsi: DSI peripheral device + * @enable: Whether to enable or disable the DSC + * + * Enable or disable Display Stream Compression on the peripheral using the + * default Picture Parameter Set and VESA DSC 1.1 algorithm. + * + * Return: 0 on success or a negative error code on failure. + */ +int mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable) +{ + return mipi_dsi_compression_mode_ext(dsi, enable, 0, MIPI_DSI_COMPRESSION_DSC); +} EXPORT_SYMBOL(mipi_dsi_compression_mode); /** diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 3011d33eccbd..78cb7b688b1d 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -226,6 +226,12 @@ static inline int mipi_dsi_pixel_format_to_bpp(enum mipi_dsi_pixel_format fmt) return -EINVAL; } +enum mipi_dsi_compression_algo { + MIPI_DSI_COMPRESSION_DSC = 0, + MIPI_DSI_COMPRESSION_VENDOR = 3, + /* other two values are reserved, DSI 1.3 */ +}; + struct mipi_dsi_device * mipi_dsi_device_register_full(struct mipi_dsi_host *host, const struct mipi_dsi_device_info *info); @@ -242,6 +248,9 @@ int mipi_dsi_turn_on_peripheral(struct mipi_dsi_device *dsi); int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi, u16 value); int mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable); +int mipi_dsi_compression_mode_ext(struct mipi_dsi_device *dsi, bool enable, + unsigned int pps_selector, + enum mipi_dsi_compression_algo algo); int mipi_dsi_picture_parameter_set(struct mipi_dsi_device *dsi, const struct drm_dsc_picture_parameter_set *pps); From patchwork Mon Apr 1 23:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13613144 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 7767ECD1292 for ; Mon, 1 Apr 2024 23:51:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE12B10F6B8; Mon, 1 Apr 2024 23:51:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="wN2BUhSl"; dkim-atps=neutral Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1656510F6B7 for ; Mon, 1 Apr 2024 23:51:19 +0000 (UTC) Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-515a68d45faso4966706e87.3 for ; Mon, 01 Apr 2024 16:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712015477; x=1712620277; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TImHaMPxC7KJyi9PLNXdSBnin8efgauOGmSl1YeMQhA=; b=wN2BUhSlQdcbrJa6ra9SJVx83rf4K1b39V/77D1yZaYQroj2xnyn+d7snqtoHGLXZG vcTgKEgA/95HrZJ6rZ6snByRLj6/zny2HT9YhIsWYTIKmGpiP+hSmpUMn7cYxLOIO4uz QWh+Cltd7CFOxI0djo1r41H0R3jHBdkixC8vKo9lWCU5lrojZxo/QYvVukwBo95KH16E q4TxxPp5HIPYzRuUVEC8SA7Q8LEwd2sIs4CaseTHzUnBqqbXdfhZYNpCHA4/GEumoX6D vH6/3cTnRWHZtNySk7tv7W6Xrb9MmkvhS9M6oL5KLFrXHo744U3IN0fuD2EKrzBuvw4d 77OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712015477; x=1712620277; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TImHaMPxC7KJyi9PLNXdSBnin8efgauOGmSl1YeMQhA=; b=bwqoGt8hqzTwiRS27SENUhS7pOZAqilA75zq+6ISig5Y8BbA6CyliHYA2cALCe6se+ H7TkjJQ/vSZLUuFmJSfxJdeOSkH28iW1D3wJvMu3sSeOYOWA7iAhF7zFJbiPorsQlB84 drn6zl/nMlIV6+jdcgH0AN9AmfCBzAPzSidF9LRgDrydA7VqfpgFcsL6OXeg5aDUOmX1 1Cfi+qGyOy2v7L53V2efs8Vs7B3FHY/8HLPueh1rByZV1woB2D6KKFMjvJz/JJ63bnpo ZI7WsYAwFzDlBrt4l6uSbB1yyAqZrHbk1iWZDrEqdoRNDKIjHdS0ARYmiQcNpIyxeQzg VVRg== X-Gm-Message-State: AOJu0Yz1lmwPxnrWaupX79V3aF/aOprsFV+53zhus+DSDu4tGaNY4Tfa LZetxjMdpc0EluyYRxUSyvO78DhHR3WwguBcM0wEZpjyhZaSsdjN8rdqJzMpzZI= X-Google-Smtp-Source: AGHT+IFObr6upbk19CsbEk/hrnyseYTlL0kj+Bsy3TgaYS/NP7yMDUmNKlQBbbdk2H0Hrr++1Rq8mA== X-Received: by 2002:a05:6512:3b9d:b0:515:d16b:5ce5 with SMTP id g29-20020a0565123b9d00b00515d16b5ce5mr8784160lfv.7.1712015477198; Mon, 01 Apr 2024 16:51:17 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id g28-20020a0565123b9c00b00515d127a399sm1176135lfv.58.2024.04.01.16.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 16:51:16 -0700 (PDT) From: Dmitry Baryshkov Date: Tue, 02 Apr 2024 02:51:15 +0300 Subject: [PATCH v3 4/4] drm: panel: Add LG sw43408 panel driver MIME-Version: 1.0 Message-Id: <20240402-lg-sw43408-panel-v3-4-144f17a11a56@linaro.org> References: <20240402-lg-sw43408-panel-v3-0-144f17a11a56@linaro.org> In-Reply-To: <20240402-lg-sw43408-panel-v3-0-144f17a11a56@linaro.org> To: Sumit Semwal , Caleb Connolly , Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vinod Koul , Caleb Connolly X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=12340; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=MNtQocnhPbn21d01nTwkNNinrQdzLkyr8DRma9TIYVw=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmC0hxpRxbtYshJNrsXySDiZuVd/ph6njfNGCw8 UwfIDVBJuKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgtIcQAKCRCLPIo+Aiko 1RUqCACOH3WnFeD5VAvBwRUPH8zFdYMJMfHVIdncB+aoeA3We0Xr4uzyWrGO5WlU+pHiFRiL/Yy nM47AFrfLzljAjlowxd3NaAZdB3NPRznfSP0zUTxkWN/DN43T6KbdBnJjoRgmpiHjgIEXWqR7pe u8R4iA45lOBIUm4IRNsV/t5T5vMhN8JKItNZ02Z3ofnJZMer9fObN9kaLa71aRViy9apI8GEbEU dQzCgRPHhcgxJS+6+H0o49iqee4Xn7rWoCWADCsDFX56PjZDwxGKpVONBpe1D5YK/AM7blAlgIm /w1RvK4RyZBLVcDehP6H/dKAa4HzjAqNHipE6J/iGIFkINED X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sumit Semwal LG SW43408 is 1080x2160, 4-lane MIPI-DSI panel, used in some Pixel3 phones. Signed-off-by: Sumit Semwal [vinod: Add DSC support] Signed-off-by: Vinod Koul [caleb: cleanup and support turning off the panel] Signed-off-by: Caleb Connolly [DB: partially rewrote the driver and fixed DSC programming] Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten --- MAINTAINERS | 8 + drivers/gpu/drm/panel/Kconfig | 11 ++ drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-lg-sw43408.c | 326 +++++++++++++++++++++++++++++++ 4 files changed, 346 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d36c19c1bf81..4cc43c16e07e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6789,6 +6789,14 @@ S: Maintained F: Documentation/devicetree/bindings/display/panel/jadard,jd9365da-h3.yaml F: drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +DRM DRIVER FOR LG SW43408 PANELS +M: Sumit Semwal +M: Caleb Connolly +S: Maintained +T: git git://anongit.freedesktop.org/drm/drm-misc +F: Documentation/devicetree/bindings/display/panel/lg,sw43408.yaml +F: drivers/gpu/drm/panel/panel-lg-sw43408.c + DRM DRIVER FOR LOGICVC DISPLAY CONTROLLER M: Paul Kocialkowski S: Supported diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 6dc451f58a3e..a55e9437c8cf 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -335,6 +335,17 @@ config DRM_PANEL_LG_LG4573 Say Y here if you want to enable support for LG4573 RGB panel. To compile this driver as a module, choose M here. +config DRM_PANEL_LG_SW43408 + tristate "LG SW43408 panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for LG sw43408 panel. + The panel has a 1080x2160 resolution and uses + 24 bit RGB per pixel. It provides a MIPI DSI interface to + the host and has a built-in LED backlight. + config DRM_PANEL_MAGNACHIP_D53E6EA8966 tristate "Magnachip D53E6EA8966 DSI panel" depends on OF && SPI diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 24a02655d726..0b40b010e8e7 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -34,6 +34,7 @@ obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W) += panel-leadtek-ltk050h3146w.o obj-$(CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829) += panel-leadtek-ltk500hd1829.o obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) += panel-lg-lb035q02.o obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o +obj-$(CONFIG_DRM_PANEL_LG_SW43408) += panel-lg-sw43408.o obj-$(CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966) += panel-magnachip-d53e6ea8966.o obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3051D) += panel-newvision-nv3051d.o diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/panel/panel-lg-sw43408.c new file mode 100644 index 000000000000..c7611bfa796b --- /dev/null +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c @@ -0,0 +1,326 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-2024 Linaro Ltd + * Author: Sumit Semwal + * Dmitry Baryshkov + */ + +#include +#include +#include +#include +#include +#include + +#include