From patchwork Sat Mar 30 03:59:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13611436 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 D38AAC6FD1F for ; Sat, 30 Mar 2024 03:59:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 388F410E39D; Sat, 30 Mar 2024 03:59:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hCbLKlj1"; dkim-atps=neutral Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id E763310E39D for ; Sat, 30 Mar 2024 03:59:32 +0000 (UTC) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-513d247e3c4so2389678e87.0 for ; Fri, 29 Mar 2024 20:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711771171; x=1712375971; 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=nEHv7161rF10nD2iZaJbFgvPRz2VUElIFclun8j93Iw=; b=hCbLKlj1sdJbeW/ZCAmaiBOfaICaO8ac5FX6OJFGOk5x2L76kF7mh+8AyCu1KKIHua OaL+XYBSkJZMpfknwRNHmjChseQ2D0726/7UZWfn4IiHPAhnwbOfr+cR6WpARFbSI5cZ JOcf5cXcQg4apNL6MsG+cG9Ol3SaYW/JNiaJzFhySaujzpASsBFbV21LpRyvs2UL9BtL RR06FaRIxU7ouEZffDKRjxBZl90Of0GPlgHbsD+xUqcelXM0oIlE2qyWf74M9r4bywg/ US8g3hacHt/AcDegW3AROuhBfAL5CTWbBFpnuhNf7dUf7T1PlvvYKPaplEdANZPiPq1w x2DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711771171; x=1712375971; 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=nEHv7161rF10nD2iZaJbFgvPRz2VUElIFclun8j93Iw=; b=lkjHh0e+VF8cjgm0fzwWf6D3in1laLoiphThEIAu8FFVFmOtojutX0EUMZzPNWbcsU +V36b/55TBT8V8y3wH+PzBFmncK4mrDLnUuxME8ANs18SDgY/lM631slcg4r2ZREF3kw up6J391quPsbVsPBmKFJ0VBlZj4kZGcx9gc+VFwixpQdxYGGpUT0xuNOR3YNKTK/FYv9 QAuN1yk3qwVUUxLt8QojkFIIUn/EaN89F1lKFARc8ZBe11fPNbtWkj4HMbZZcBWZOvaY 4vnPxIW0rp2Y+VsF/ENwns/UV81zx5ib0iK2hSZNa+U/2L3CB2i9NWPTqAb7nVI2hT+V PQNg== X-Gm-Message-State: AOJu0Yz1yBEgJlCzoqiNC2N1QmxOA9Hv+pIBpw4C8mzcfJ1ceBL+iM4A H2t3Xt3q0k+z1ms5HzRXmqCG2JsNKDjMDq16xzFA9Q6wQ83kXgtHQxp61RmNMP4= X-Google-Smtp-Source: AGHT+IE1ThAnidcAuJUVgaWX29h3ZaFTTmFMn3wvVDDkWWIpuaRfERN6frP0sFDgQn0vjwNXMb6wXw== X-Received: by 2002:a05:6512:3b8d:b0:513:922a:4334 with SMTP id g13-20020a0565123b8d00b00513922a4334mr1661298lfv.1.1711771171043; Fri, 29 Mar 2024 20:59:31 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id br2-20020a056512400200b00515d1393f3csm423957lfb.104.2024.03.29.20.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 20:59:30 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 30 Mar 2024 05:59:28 +0200 Subject: [PATCH 1/3] dt-bindings: panel: Add LG SW43408 MIPI-DSI panel MIME-Version: 1.0 Message-Id: <20240330-lg-sw43408-panel-v1-1-f5580fc9f2da@linaro.org> References: <20240330-lg-sw43408-panel-v1-0-f5580fc9f2da@linaro.org> In-Reply-To: <20240330-lg-sw43408-panel-v1-0-f5580fc9f2da@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=1583; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=LJ+girYe4vykYjxl7S4n4qmMz70uzdqbzojIgAwohpA=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmB44hkYXDEZ4U1NN773kLK8OhcQ/ESozP9fWl1 6XuWJvjcSuJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgeOIQAKCRCLPIo+Aiko 1YwHCACTsVHb+AVpPFVAJZeqrxDPnebzaXXZ/O+m+gWCihSTksXW7Gac675ctl4z+1HouDBncPg c8NqCesf1zSkhB6cZ9frhnjvw0ruayMxBT5Zc4BRNohFGv7Urz6TZ1/++ylmGBCZVpvvvEIiP4O 1dkz1t1/EH6Vn3l9deKIiHqsVZxErRmZHWU96y95BJJc6Fd3dwlipgy6iSBZJorrrokMw5E2gTJ IdnD2wX3506sW1Vq0T80gc35BydEVKi502pYN2itI8nv5pHrMvyeEEnZLMqp9s4I02EgxoSAhWI zDqreN34UTlIpRoy5sWYQ2kmxkIVp1GoEnkdCHNr886ueVko 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 | 37 ++++++++++++++++++++++ 1 file changed, 37 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..f3c9c9343c4f --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/lg,sw43408.yaml @@ -0,0 +1,37 @@ +# 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 + +additionalProperties: false + +required: + - compatible + - vddi-supply + - vpnl-supply + - reset-gpios +... From patchwork Sat Mar 30 03:59:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13611435 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 327C5C47DD9 for ; Sat, 30 Mar 2024 03:59:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E4BF10E392; Sat, 30 Mar 2024 03:59:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="b8ZzowwU"; dkim-atps=neutral Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id B92CE10E39D for ; Sat, 30 Mar 2024 03:59:33 +0000 (UTC) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-515d55ab035so343115e87.2 for ; Fri, 29 Mar 2024 20:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711771172; x=1712375972; 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=gXi248XgYEI1aNqzH18MSPcwgnE2Ghs0byyxqmpezB8=; b=b8ZzowwU6HPkbdJJr1nd2thcQ3yY3KK+kvYv4bCx3wukzWLg8NqRwgE5KUOsnVzDjU Q9YyoSbfBpwNKNKCBujrDEPXNHDDDXn98bbBAC7iCFMBxcymDT5zvofTc/ZhCj/Jnvl4 568Ka+6DgXKNERGtiD34HH0WZb9b6Q4zq3V6j7wbPLyaaptSJzj0u7eiQCIiRl7AeAmv jEyrEupa5sdFaoDKZ8a77ydsRoeWw39LJULPoGm/70Lv5TdoQAdDBqS64pOhdBwkFkuH c3T2VDnwWrX4i/BmtZxDItouhuXVfyT7W75zSv9hkYcMGt2MuI8UfmHiovccRF/EfbIv iGyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711771172; x=1712375972; 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=gXi248XgYEI1aNqzH18MSPcwgnE2Ghs0byyxqmpezB8=; b=KNa8bCWhkCYJKeP1hlSYl0JixboQK+r95z5xznC/yeAABzSFrf1fUFpabhqV2M2yaj o2+sejfuqUq4KPxbXl3UP3W/rkOoHu0tajvZng1JnpBfNaMj9+JzXzHbBm8oy0uVsYfz 18x8d5jCwufY4vsyNaMLhOFSfC8W5az/Hj+b38JKjj6Evatn/RJA4+C8mnDNmjgvsFu3 tH6K1T/G9kqDfzOLWF8JKT23A3m/TAiT0rTrh503J7fjJbiK3EkUQtWUh3raB6ccHVvv FQPZH4pp5KQDwRKW9orQrgWLfbKHq/We5RWxePeQ9RVS+IEY2tKeRjaGc8C99nHSCTla JPrg== X-Gm-Message-State: AOJu0YxgN9ARlaY8R7o9HhKlvb/3e8Y+WhZ1FxA0eu1sd3bwaX04JLTD yVBvQtkaaYSOTxGRXsb8YVNXKKN74hHxfB3zBqErXht6ruUReh8lvBA7LWo+tPE= X-Google-Smtp-Source: AGHT+IExcqjcMc4gAFYkWcvF9qS8XkNUfR5sfZy2OcV9JbTxQHLoeNf+8x0CjweH/JN0g99cIN+OxA== X-Received: by 2002:a05:6512:48d:b0:513:cb0a:9632 with SMTP id v13-20020a056512048d00b00513cb0a9632mr2244206lfq.50.1711771171680; Fri, 29 Mar 2024 20:59:31 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id br2-20020a056512400200b00515d1393f3csm423957lfb.104.2024.03.29.20.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 20:59:31 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 30 Mar 2024 05:59:29 +0200 Subject: [PATCH 2/3] drm/mipi-dsi: add mipi_dsi_compression_mode_raw() MIME-Version: 1.0 Message-Id: <20240330-lg-sw43408-panel-v1-2-f5580fc9f2da@linaro.org> References: <20240330-lg-sw43408-panel-v1-0-f5580fc9f2da@linaro.org> In-Reply-To: <20240330-lg-sw43408-panel-v1-0-f5580fc9f2da@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=3402; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=1dHUwNPq/ZE2lZqujLo0paqKG5T8bLmbO34BUbpj00o=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQxp7n2LDer59c2eE62z6cLjhcvt1pn18ebOVrm3jbOacZ XOrNXp6J6MxCwMjF4OsmCKLT0HL1JhNyWEfdkythxnEygQyhYGLUwAm8oeJ/a9MuG3iCbHu+3Y/ ivvue7oeWlJ+I/HySrsnf+J/5AcJvXoqIOivkp8c9urdu3iRhXyT/P4uO82181qg+b32U591bby N1dZJcProb4/sUuk2Td1+RCC9Ymt/G1PW6yxNdzGLkEOyTNFX1JXnVPpfjzu/uF3xtmvKpYdXis ybTuUWZy9Sr0uvnV7z8li88pZdcxLfOTmXLpfRfNjTM1N18bmazvhn10xCXTwm6QbP9+yavOn03 ObZutxeF46d9eXUvapwZAOH4cKulZpWQmmmoaoWv8J4c2Yc99+7+uGrtv47sfzSdf3bzc5HHLlW evmzq6zyvcgQVrOIwD2XIs0bllVu2Zt391DC1/KVE+WNAA== 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 LG SW43408 panel requires sending non-standard data as a part of the MIPI_DSI_COMPRESSION_MODE packet. Rather than hacking existing mipi_dsi_compression_mode() add mipi_dsi_compression_mode_raw(), which accepts raw data buffer and length. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_mipi_dsi.c | 34 ++++++++++++++++++++++++++-------- include/drm/drm_mipi_dsi.h | 1 + 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index ef6e416522f8..f340d1e0a9a5 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -645,29 +645,47 @@ 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_raw() - control DSC on the peripheral * @dsi: DSI peripheral device - * @enable: Whether to enable or disable the DSC + * @data: data to be sent to the device + * @len: size of the data buffer * - * Enable or disable Display Stream Compression on the peripheral using the + * Control the 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. */ -ssize_t mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable) +ssize_t mipi_dsi_compression_mode_raw(struct mipi_dsi_device *dsi, void *data, size_t len) { - /* Note: Needs updating for non-default PPS or algorithm */ - u8 tx[2] = { enable << 0, 0 }; struct mipi_dsi_msg msg = { .channel = dsi->channel, .type = MIPI_DSI_COMPRESSION_MODE, - .tx_len = sizeof(tx), - .tx_buf = tx, + .tx_len = len, + .tx_buf = data, }; int ret = mipi_dsi_device_transfer(dsi, &msg); return (ret < 0) ? ret : 0; } +EXPORT_SYMBOL(mipi_dsi_compression_mode_raw); + +/** + * 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. + */ +ssize_t 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 }; + + return mipi_dsi_compression_mode_raw(dsi, tx, sizeof(tx)); +} EXPORT_SYMBOL(mipi_dsi_compression_mode); /** diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index c0aec0d4d664..321d2b019687 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -242,6 +242,7 @@ 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_compression_mode_raw(struct mipi_dsi_device *dsi, void *data, size_t len); ssize_t mipi_dsi_picture_parameter_set(struct mipi_dsi_device *dsi, const struct drm_dsc_picture_parameter_set *pps); From patchwork Sat Mar 30 03:59:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13611437 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 7A25FC47DD9 for ; Sat, 30 Mar 2024 03:59:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41F8010E416; Sat, 30 Mar 2024 03:59:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qdhb5B/Z"; dkim-atps=neutral Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 57A0210E392 for ; Sat, 30 Mar 2024 03:59:34 +0000 (UTC) Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-515c3eeea5dso2680332e87.1 for ; Fri, 29 Mar 2024 20:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711771172; x=1712375972; 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=WjzjJkPLaf/5sU8SH37VcIsolFjmu0UrsFouDXMFkec=; b=qdhb5B/ZKxBrHhc+hNwVVxou4DFLE6wgM7biHUZnGNjrAaO+Igk/7WtZc/u30fx4GP 6GG02XtI1v+hbmGLnqjRUE+55E9bt/lRCLI55vNnfJaLO+NYiLcSZwUaExLf3RWHzOvX PxA9KSUOxJ16koAWZpIafZCeXvbNr6C/T/xBZ9m3I7hIFjhJEEEj2zpEgYHdJJCXOOBa pL1LDFNwbwpYQLvrcL5uh5qG2qFE24/7xrwt47blPSc3eSPiRslGQK0YuOWrg8wCIOV3 zWXGRRCCkKS8Apq6fZDHGO2z7kwtFSvUnHkNx7CfAFuASHQTrpaS+U0r/BbxSpfQEMTk Qa5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711771172; x=1712375972; 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=WjzjJkPLaf/5sU8SH37VcIsolFjmu0UrsFouDXMFkec=; b=sGfUN4xvD12x6dD7djNwobtIFLQRRGjeMCA+qutcbX5DmJOOPlinnkXPqheNjlM9G0 yGbUptrWQd3Se3mtTSQOGg2kBGZaCJU0HrMG4W2sIvqqejpaHVCNoOH0UTUahfr7MVrJ FkpD9EsDcRyfUT4E3yMsCKG6izt09uTE9OjhbVUth6vWjlXt+NU34XGkXEc9HAsloswg YboiJqK+s0tPXktp8koMW0MJAZ8UyGxoE9fPwtWNQjK6R+cO1w2n63iOqeEgQ3YhxH0T cbwr304KBukoCeiJKZ9kvAlS3dOTbhps375oeI8epf/fm7v1opT7t69xs2KuaFTlN1CJ yX8g== X-Gm-Message-State: AOJu0Yy+yv8Gccy/f4lGKvPG2JiNkxgkyyQ013PHRR7oJ5OxXW81J3E5 6Ccuoa/IuyDhW3A9xgTed8AmLZGyHbKEHDO7t9vDdko63PmGtCOQs76+PGVTTb0= X-Google-Smtp-Source: AGHT+IGqVPCCB3/eyVQg9oHRpBYxv5wUfYVbFTb1Te1jY1NNi0uT35uP6k6LWlpa/PFZlqz6q6RHXA== X-Received: by 2002:a05:6512:5c9:b0:513:b30c:53c7 with SMTP id o9-20020a05651205c900b00513b30c53c7mr2646887lfo.10.1711771172614; Fri, 29 Mar 2024 20:59:32 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id br2-20020a056512400200b00515d1393f3csm423957lfb.104.2024.03.29.20.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 20:59:31 -0700 (PDT) From: Dmitry Baryshkov Date: Sat, 30 Mar 2024 05:59:30 +0200 Subject: [PATCH 3/3] drm: panel: Add LG sw43408 panel driver MIME-Version: 1.0 Message-Id: <20240330-lg-sw43408-panel-v1-3-f5580fc9f2da@linaro.org> References: <20240330-lg-sw43408-panel-v1-0-f5580fc9f2da@linaro.org> In-Reply-To: <20240330-lg-sw43408-panel-v1-0-f5580fc9f2da@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=12464; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=YF+FNs4wpu9U2rfxEq/PVlcJ4tLwN+tWipMzmBnmhFI=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQxp7n+K+iexlj0y5mdXnTGmYIqmQobNV6/IT+8wTu7kDz 818cW1WJ6MxCwMjF4OsmCKLT0HL1JhNyWEfdkythxnEygQyhYGLUwAmkjKd/Z+ho+12o/rVeQ/8 dDICi017bv+ZFLjO0f62olecq9L+3WuL3SbkeHQ+La0K7S851b7r2MJt4s/8A/Wbkg/0b7lTo+e x5dx3mWtViml+x547JRsoyR/qeOusbHtlSaNH3hoRFo49LvxXLnUH9mRs3suvPavp1nuJfb/Vs7 dbXDBp+Dz/29yiKnPjB1n7v+s4vs9Oy+II8jwU/fyqSdG/VzVutTlO6wK2Tgt80NP9vchw/m27N 4lJ03v4f8jteB7ifr7AhfXRTANJ76qXmX8YdKssjBRjr2eluUTZ+8Up9iWEbdRXOZbAL1xq7XDr 7rOfSRLsd7b9epqYYcfD/2bBpoqbvRWNxw/PUzBiqa0GAA== 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. Whatever init sequence we have for this panel isn't capable of initialising it completely, toggling the reset gpio ever causes the panel to die. Until this is resolved we avoid resetting the panel. The disable/unprepare functions only put the panel to sleep mode and disable the backlight. 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 --- MAINTAINERS | 8 + drivers/gpu/drm/panel/Kconfig | 11 ++ drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-lg-sw43408.c | 322 +++++++++++++++++++++++++++++++ 4 files changed, 342 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 4b511a55101c..f4cf7ee97376 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6755,6 +6755,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 d037b3b8b999..f94c702735cb 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 f156d7fa0bcc..a75687d13caf 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..365d25e14d54 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c @@ -0,0 +1,322 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-2024 Linaro Ltd + * Author: Sumit Semwal + * Dmitry Baryshkov + */ + +#include +#include +#include +#include +#include +#include + +#include