From patchwork Sun Apr 7 23:53:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13620313 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 60CA0CD128A for ; Sun, 7 Apr 2024 23:54:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0327010FDF2; Sun, 7 Apr 2024 23:54:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="gnX2y8+K"; dkim-atps=neutral Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by gabe.freedesktop.org (Postfix) with ESMTPS id BB3AB10FDEF for ; Sun, 7 Apr 2024 23:53:54 +0000 (UTC) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2d886f17740so6997881fa.1 for ; Sun, 07 Apr 2024 16:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712534033; x=1713138833; 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=OOB/W2al4fAWY1hZvIX+eyNZGmg0uhdq3Rfxx+fRp2E=; b=gnX2y8+KZaz8fnvdvHwCNo2FMGztlVX1DJRlzCnfBGNRx3SGY4Bhf/LDIUfSfOMxx8 aX/NYxKUAOJ0n57oyL8+p5LPJBmgjPe+djrVU/0jJhe5l8vOFxFjs0yQ7b2dUW1Jrw0r IYuGxv4CVOOZWDloTLKf+cA8WIYJk06AYeVjeOrETv+0RTBUOiZw48D20jiv+vP041r2 +MR63B/cZVCI73jiZZrHswjN6waDaBki4KGJQnwsreekgydItPrGkJieCgb5KOYpeVU/ nWGd7UzmPpZwLhweMWh+x6xiB9hzzy3MULieaqtgnjHi1a64BsMIsaDV6DsoPfp9Rw2o rRpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712534033; x=1713138833; 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=OOB/W2al4fAWY1hZvIX+eyNZGmg0uhdq3Rfxx+fRp2E=; b=sqIehuaHixXKDuT7FFasZwqQI4kNicFaeloX03WJ2OLEMy5eTxCO/QGHn100lM9OIc haaZYbIqservIjL5kPK1r9hc+8/+qgQgAbZ24xyXMie+571zr1mTu3wMt2nVHBsWQ++D zgEcGA34F8Kr0xObLJDPHbIKnhriSNXZSuIsEUgdR8590aUvRvv0XkotPBBwo/S/iuM0 X7/ZpkYfLVFKu/kc0QbPAc0Ky6r1Getp00K9+LsCIfi/AJNL1gWRWhReq2JIqZcmhHnL lJTGJQQJWdgG/3yKJNAN8yDfwQZF2/ZFjZ0WfvuLavDmUI1HmlfALHORN3C9vumzWooz VnQg== X-Gm-Message-State: AOJu0YxpNtE24/KXAboMRs+pUvIJrtmO6H2m3MbKLUfuazFhoILIwi6G hVZ/hT6mp2zFJJYJWtV/eprm0U6cyGIwgYb1FeLqOz+VuaHjm23kzGQSBO7vjik= X-Google-Smtp-Source: AGHT+IGD0r3TWDMnfJz85tZs40iCQ3bJgYJGGYfvxWOghAuoLrX29Zx8JuwsRwlnBsTyog5reBPcXQ== X-Received: by 2002:ac2:44d9:0:b0:514:b624:5d36 with SMTP id d25-20020ac244d9000000b00514b6245d36mr2217144lfm.32.1712534032652; Sun, 07 Apr 2024 16:53:52 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t27-20020ac2549b000000b00516b07fdc26sm965696lfk.109.2024.04.07.16.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 16:53:52 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 08 Apr 2024 02:53:50 +0300 Subject: [PATCH v5 1/4] dt-bindings: panel: Add LG SW43408 MIPI-DSI panel MIME-Version: 1.0 Message-Id: <20240408-lg-sw43408-panel-v5-1-4e092da22991@linaro.org> References: <20240408-lg-sw43408-panel-v5-0-4e092da22991@linaro.org> In-Reply-To: <20240408-lg-sw43408-panel-v5-0-4e092da22991@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 , Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2202; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=GwVgZdE26NDUHVKCdQIs4DldqMTJkpU3Pk/WgyxXJjg=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmEzIOsWZE0K6uxILhzHgEr/EN647OWFab82UmR AyrlutwlYCJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZhMyDgAKCRCLPIo+Aiko 1cfEB/9qTNSpJTLxEWDO34OifP37mWXh2knrveFUXkNPOwZnHoUWkEILGgPqYqazzTe3OuH6umb pydAY9tIgE+K9P8+dnKNxHOoL4glYzY3UBc3Y9mnbYmMC8avnPvzmZUYGmEuVlM5DtEC9zNJfdQ ap/+i87+GYqE+zyPmK1vKsuFf+ez2Z/LSmgt2jbCSEHkQ1wKhNMwCEYBzvmORhHWosl824MEOCO wU/NYpatsxsPS+B1K4xt+wjROTH9iU1buyX99DKQX2Bn6GyQ8GBo4Y/j/V31WQuPghZW0SNYPQv z1z+v6cYP/a6OxQ04iIpiW7Hl55SUgtCEj/tR4Ba4gobAJg8 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 Reviewed-by: Krzysztof Kozlowski 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 Sun Apr 7 23:53:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13620310 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 99F60CD128A for ; Sun, 7 Apr 2024 23:53:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED9BE10FDEF; Sun, 7 Apr 2024 23:53:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Wz2XmcNe"; dkim-atps=neutral Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3416110FDF0 for ; Sun, 7 Apr 2024 23:53:55 +0000 (UTC) Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-516c97ddcd1so4335213e87.2 for ; Sun, 07 Apr 2024 16:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712534033; x=1713138833; 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=04Dqjw56oztOKjOx6AEdYJc7ELzz7GKlpOl6o5T2ns4=; b=Wz2XmcNeXT6rZ7ZcR0+qSR7mbdTzxdFyWgIaohdLbPlXDl2Bqtw2Lg3warrNbyCpfQ bbbDd56vPGIGNWevAJvhSa7D24DDCKFs4tZQXyWDg9ha6WQ+8g+jM9wtV/+6IpHRp2Al ykYlTPa3D+oCDWjUeGFdkhZpUpPjLL1Q/ORFr4fCQt3CAab78dE+Fk6pmkjL5hLV8IPa LJYp7A5SaiHLI7dt7M32holxkWeLom9LLm2iotIvGff4Z4LCQ4PE7zQfn/JYknV6/YTu 8A0boerJMf8abGxeF3/CSjsyJ7GJze4k9raPKJaElkHT6V9ThULTSbw3fPQXBjyErH/k lXnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712534033; x=1713138833; 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=04Dqjw56oztOKjOx6AEdYJc7ELzz7GKlpOl6o5T2ns4=; b=XNcedklBf6pAZen7eWvkFz+iajmTsBWLJVzFpWpANLZzZNEg3yMlnD2H1clo0Iq7dZ yEOKaHhS14PjS6GauC4e2jikI68zynfckcFXAy4SQAJ5lS/TlqzjnAzDtev38t3FVtBc XZjMWw+qe+7dJYqRL9on/I3YPKC9Jz4rO0kUgDUsW1P9F27HCzYoQsE2JPG9jmqZPYgc 8HtpQXTj0j4yYlQYXDicu9zZkPMBqB3nx0wQJJgsmpMW41gJjhi0wU+ixUSDiaSi6KQi oxSwEt/YlZSEkCw1mPTrQS6Pj6VHIMDUv0GLSU3w+tZKY2aP5qCMLMAQ942W4XF/X6af BpzA== X-Gm-Message-State: AOJu0YzuQ8MuspQ/QZZlvk4bk0I39Fto1PTrZ3DwT6ygBy9J42xkqdZf 3G4bZt1kkJVhirW6NGLX1+nekr5/4+56scsTodSzfrwa19Z3eavK98P+sV35TpfWeVsubABSPbE Z X-Google-Smtp-Source: AGHT+IGGJI2Ba92TUEzGsRtkoxj8sHZIcavmkHqfKJNlxt+JCsOBzcXsH1wevqOOTob8rUMw+YY75w== X-Received: by 2002:a05:6512:510:b0:516:9efc:6c38 with SMTP id o16-20020a056512051000b005169efc6c38mr4664785lfb.44.1712534033332; Sun, 07 Apr 2024 16:53:53 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t27-20020ac2549b000000b00516b07fdc26sm965696lfk.109.2024.04.07.16.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 16:53:52 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 08 Apr 2024 02:53:51 +0300 Subject: [PATCH v5 2/4] drm/mipi-dsi: use correct return type for the DSC functions MIME-Version: 1.0 Message-Id: <20240408-lg-sw43408-panel-v5-2-4e092da22991@linaro.org> References: <20240408-lg-sw43408-panel-v5-0-4e092da22991@linaro.org> In-Reply-To: <20240408-lg-sw43408-panel-v5-0-4e092da22991@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, Marijn Suijten X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2601; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=Jn//Iw9esRD8TM8P085ElFyT7MDokBKCt93Vkd/VJlo=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ5qwER+vpasEz4a1AuuUvyk/ClxTNZ9XrWfPkpYzrNpn7 ly+eWl/J6MxCwMjF4OsmCKLT0HL1JhNyWEfdkythxnEygQyhYGLUwAmYmrL/leumqn/090ehhMb Vl2yDBa4cWavqbey7s/rqycqn7jPJvcpo+jfw+hXBTstnTzTFp0MYPWKdPZhiV53S0CM3S8ie3G ltprHZHkH+YdCTlzHni2xP/hlqn3e9NklJ88EHJy04ZJMdNXzuvr/v1xOhdvvnDgl+HcuW/H04I MywfXXrDeum613xVtLRjzV41zvWSNdmxOTFn9i8XrncTeB85+raztbJdOb7W9mB/TOnGZ48MIJj kj7iIC4Xdm9U8u1Lni12Mk9TEkILVe5UH71pJjCqlcsZ9N4Z/xZoBbqf1h+Mlf1JsHopFfNdmqW DyKM/Sxuugv29XptVHg0ZWdVnWEcx29eN9k1Mw2CObRSAA== 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") Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Reviewed-by: Jessica Zhang --- 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 Sun Apr 7 23:53:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13620314 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 DD25FCD1292 for ; Sun, 7 Apr 2024 23:54:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 175E210FDF4; Sun, 7 Apr 2024 23:54:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="s+4zSLiY"; 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 D667810FDEE for ; Sun, 7 Apr 2024 23:53:55 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-516a01c8490so4182638e87.1 for ; Sun, 07 Apr 2024 16:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712534034; x=1713138834; 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=+T+p5YoQyUiQemU/jDWxQz+rt6jIm9aQcddIMzbzpGw=; b=s+4zSLiYEZnrxRr6+QrfxJZndQ2VXRaGEOjfX4tAaDkyaL8Y4xsloQ9JNjx5G0y0Y6 yLvI0o6BfV6LM8aP8Q3oqL7WcSglZBUuu09rwl7BKRK8j+jOMe1aGHBC6BnpnzhrICat Pnv4L2rCPYdq7H/G3kp3pZf/gX0HmIptNtinumMCRUq1OPTZVMFjJvVz0enrbpK4JfPP GGOPyyPz5/AnsCbOiIyJKPFNhhYYD6MqCk6jstSjOBaDXaw5SfXSAI1ldtw7CU/ov+Ci +cQOhDYkyePwL00jyiBYlWp4qU6sbICtyIkHK0gVbgGZqy5mTR8pWFezKWbL98k2Re6L lJwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712534034; x=1713138834; 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=+T+p5YoQyUiQemU/jDWxQz+rt6jIm9aQcddIMzbzpGw=; b=Fuk4fZxtVFWmZSRCb4DkCq+edGa2QV/thMrelq8pbPu/Vtjf3rEkcwxnQi1pWFwjyR fwQfth/dzWErR1ohain5ciB3M3HsXm24TSAVGftem96BWLi8kTYVg5jXf7ZVqLmWrhsb bs61lJNXULgL15hZeusUPd21ft8NwpofT1NGwRxvEOOR2D6qZR1ri9GG4k4ws8qv5h9D sigSGi5F0eu9hW4WI5GcZep2HjKwLUA2ZesV0NLLXn8QU2lvxFTOgCXxbWkB1L187Ajg Omma1ZZxIbz4mWGCQIMnr3+/lxWwrxUB7f2CeSBUVsXbix1d2xn8GhzyrSoSBObBHRBs OYag== X-Gm-Message-State: AOJu0Yx00UWTwad9d0rPlJgaT1MPrTrbfC/cBT9xMpqBj783+JI42//X jv5Ew4xRxo7IojM7ySK7i/G90oFbxrS1GSh3zAdJKBleeErlI1ugjsLc5Gk12us= X-Google-Smtp-Source: AGHT+IFOPggYsdEAgsgSafAdrankSogyBfbRUSleUWj3/m04vN64SUwJX1Bv63VVzB7X6fP4EbkVIw== X-Received: by 2002:a05:6512:370b:b0:513:e29d:6840 with SMTP id z11-20020a056512370b00b00513e29d6840mr2497793lfr.15.1712534033985; Sun, 07 Apr 2024 16:53:53 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t27-20020ac2549b000000b00516b07fdc26sm965696lfk.109.2024.04.07.16.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 16:53:53 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 08 Apr 2024 02:53:52 +0300 Subject: [PATCH v5 3/4] drm/mipi-dsi: add mipi_dsi_compression_mode_ext() MIME-Version: 1.0 Message-Id: <20240408-lg-sw43408-panel-v5-3-4e092da22991@linaro.org> References: <20240408-lg-sw43408-panel-v5-0-4e092da22991@linaro.org> In-Reply-To: <20240408-lg-sw43408-panel-v5-0-4e092da22991@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=3976; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=ir5CM+jVaND4C9bLuSFQauIuwSNRo2ScqG2rMJDBLjA=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmEzIP+Sa4hTKtHUTbPcjnH4GFR9b+OZoj1rSMO uBvi7Ady7qJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZhMyDwAKCRCLPIo+Aiko 1UDlCACseKdDfogzr5q8q3Y4B7gkbVojQes4xCZF8bzA9bqA0iW1aUeZz+6+de6uvxs903c/uBq l+1cLoAf7omzcfnk0GrbLqr68QSmZmoym8brUNToqNELFbdOP2XTwZ54jqaafjlwEw7DG2FJkE3 EWmkK8cwb/UX9i423ee2yMYSUAmYQIgS5TDIsHhw97B8RMwWlLp7YYpPkdAaCvaQZY8RT9SY4xG 5tGtk3trlF6aKGGn/U3m9YzvsF8V3echPB3tzswzSewJvSXN7uQPMCJq9jk+o5s2FqMgzM9HAcV nEP4ngQl39JNqaUGL2u6OwcRu01pYporYP9jc5+/8L1hsI9v 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 Reviewed-by: Marijn Suijten --- drivers/gpu/drm/drm_mipi_dsi.c | 41 ++++++++++++++++++++++++++++++++++------- include/drm/drm_mipi_dsi.h | 9 +++++++++ 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 9874ff6d4718..795001bb7ff1 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -645,29 +645,56 @@ 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 compression algorithm + * @pps_selector: Select PPS from the table of pre-stored or uploaded PPS entries * - * 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 tx[2] = { }; struct mipi_dsi_msg msg = { .channel = dsi->channel, .type = MIPI_DSI_COMPRESSION_MODE, .tx_len = sizeof(tx), .tx_buf = tx, }; - int ret = mipi_dsi_device_transfer(dsi, &msg); + int ret; + + if (algo > 3 || pps_selector > 3) + return -EINVAL; + + tx[0] = (enable << 0) | + (algo << 1) | + (pps_selector << 4); + + ret = mipi_dsi_device_transfer(dsi, &msg); 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, MIPI_DSI_COMPRESSION_DSC, 0); +} EXPORT_SYMBOL(mipi_dsi_compression_mode); /** diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 3011d33eccbd..82b1cc434ea3 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, + enum mipi_dsi_compression_algo algo, + unsigned int pps_selector); int mipi_dsi_picture_parameter_set(struct mipi_dsi_device *dsi, const struct drm_dsc_picture_parameter_set *pps); From patchwork Sun Apr 7 23:53:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13620312 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 370F6CD1299 for ; Sun, 7 Apr 2024 23:54:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1C3910FDEE; Sun, 7 Apr 2024 23:54:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="RK+FRkzc"; dkim-atps=neutral Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id D271A10FDEE for ; Sun, 7 Apr 2024 23:53:56 +0000 (UTC) Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-516cdb21b34so4835349e87.1 for ; Sun, 07 Apr 2024 16:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712534035; x=1713138835; 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=W8cZ4HjrT4QF3C+ZxK/HOdz80vfMrRJrlKKl1sb7th0=; b=RK+FRkzcOIJvwn07CRCnMrUtSNK8AYkvsX1wNFgcKqcVhA3bsIr+p6t399lrzvs7Hd 7tyLB5O9YM8rGhCih4+M2X+GE+HpABVfLb5GFF9slvCJbdGEYp+N/uX3xM0BXhC0NQaF MvRl1dMzuZIS8eRbrljpwQKv0B8i5l68JwGHOdUWXs0A2E1ljwCvUuSw4HhZK5Pv4mJw 71TF8gFp3TxjW6vTnwA81mHwxtURHEZ8LUy+aFy96FZUoVI6fbGoQmlZLFYXYsBfa5xY v55Hi/EvHAUCA9OdgZgkbIreZjQmyCkjxBREmairTGP0dIKV8alSFgyShUfrxBoJycE1 aQ8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712534035; x=1713138835; 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=W8cZ4HjrT4QF3C+ZxK/HOdz80vfMrRJrlKKl1sb7th0=; b=OUbvZv9NnilW3TWTGafPN7Lv53pRXzcw7WHgUhZg/VwZpOheVWiUcIiHTLisz0Eyje QmK8t8v8gUe/0KU2UJRSDFSlzCWz6IjDee5X4mxq0kaAFy+n+/ge8b8WtQ9AVlQQKkvA sd/cdk027OzJb9fl/XeeGT3LsNAckjvsrN0Alj+7jE9jmx/UQ6lzQMlfKakf+V77ntiX DQHeN7YH29MALY3cBrWGtKJxIDnkggdrZtYW0b2w3pV6iuO9Hx7EQxMbm6eggwqYlXir 3oaLxM0XBRaqVJ169MXJc+kodJ/nERPQ+ALkoa5pDShv27VmMCkrJkIR0lqx/voP0yid QeXQ== X-Gm-Message-State: AOJu0YwZxzQuCA4OYqDA3MNHoM1pb8+nFWy/7GKlKLuPxaBjV8Q+u8rt j9NRbE0ZZsrfcvWWcQ3v4h4uSyuEA4RWYWH/06xCofY+4jKCampvqZGJE88hjmo= X-Google-Smtp-Source: AGHT+IGiQL48SbF9mS4ZUaUS76FlhKARUM82x95vG2t1oJnSlY1a/ukS/BXqh/gz+PTf47yHFEXVhQ== X-Received: by 2002:ac2:514c:0:b0:515:d0e6:a141 with SMTP id q12-20020ac2514c000000b00515d0e6a141mr4730217lfd.40.1712534034799; Sun, 07 Apr 2024 16:53:54 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t27-20020ac2549b000000b00516b07fdc26sm965696lfk.109.2024.04.07.16.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 16:53:54 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 08 Apr 2024 02:53:53 +0300 Subject: [PATCH v5 4/4] drm: panel: Add LG sw43408 panel driver MIME-Version: 1.0 Message-Id: <20240408-lg-sw43408-panel-v5-4-4e092da22991@linaro.org> References: <20240408-lg-sw43408-panel-v5-0-4e092da22991@linaro.org> In-Reply-To: <20240408-lg-sw43408-panel-v5-0-4e092da22991@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 , Marijn Suijten X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=12311; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=rBO0yC8UpgMVwvLTQTxZhiafy7u8OGxH1e/YYI9RoRg=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmEzIPVSR9B6y/jl9SjHHOD6e1y+5UOJtLZGSGE meJBTYYLU6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZhMyDwAKCRCLPIo+Aiko 1crWB/0c/JWNIrhM/3rJ8TpqKfuBOX5Ax4nmpJbllKt4HwF+rqaV88KP7T3TNVJ3m0ldFDwJI+A 1PvXReP1ttFEVQBP+4zvIqyzgP1t6xkQmRjU5BA/CoNkd7bXQa4fZv1ckXuwbarQxT9mh9ATq/H iBbq7AeHdEVOUJ13Mb8wXipLLC3Dw5rXmLF5efIXQW7uxy5aYwyZ1aztb8XUowcLpqGgmeykVQE VCxVTNdzNOAQHRcijy1NMmim3ShqhGleyIh6oSqIOVOSxLJTR6UnC/qW1T6WCT998RnMejCWEpn Vr37VHvuOxak5wyLN17EHFEUtHUAi3Mtd3Lkn05qhyczpjbT 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@60Hz, 4-lane MIPI-DSI panel, used in some Google Pixel-3 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] Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- MAINTAINERS | 8 + drivers/gpu/drm/panel/Kconfig | 11 ++ drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-lg-sw43408.c | 323 +++++++++++++++++++++++++++++++ 4 files changed, 343 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..4dc435fd9a44 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@60Hz 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..bd9706ae7615 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c @@ -0,0 +1,323 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-2024 Linaro Ltd + * Author: Sumit Semwal + * Dmitry Baryshkov + */ + +#include +#include +#include +#include +#include +#include + +#include