Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp332300lqz; Fri, 29 Mar 2024 20:59:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXIeXYeZjrXLaMw3YTHL1rfZdgQqRrZN5pJv4Te8Sx6e6ujO19JZwc/SxkUtyf8sH2C3gT2gkxwmhHwFZ/UNpr0toNd+IwZ2/f5iIbyCg== X-Google-Smtp-Source: AGHT+IEIMENhTNHscncY07KNKDhCLXymjxSHAg/ES8H6QnDs+km7WbCbs3flC/k1esaNtAAxp8KX X-Received: by 2002:a05:6358:3388:b0:183:630a:a88e with SMTP id i8-20020a056358338800b00183630aa88emr5016242rwd.7.1711771198259; Fri, 29 Mar 2024 20:59:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711771198; cv=pass; d=google.com; s=arc-20160816; b=kw2mkU4xiYf7EKKFaTOwY1peJLFK7A2cPjJ7JAuqSQt4Td6nPSX4uSVIi5vr3fl1ei 5xRn+e4kvr3lNgDP8yPVROzab4xlCZehmNjeeUxv9MKc6OIMOeQ/lM/E0dWffljAMRSJ qtfRaDedCiA6Xu6dv6t/CHOWjknKLyHtM+uLv0981PUvWGCTohpmm2We9p+GhluUhf6c 3lQ7Oxgdx0l9azgKblu3iJKJXjVurOeAHKxEwD1gZif2PPRfnZYW9/T5y2YpVTXPIl9l 7QpRJxJo/8vjoV4T0Dbn2SB+UNv9OS6vEo2veLWGnD+sioNY/f3zJwC3Btr/1Y2Brh2I OOTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=gXi248XgYEI1aNqzH18MSPcwgnE2Ghs0byyxqmpezB8=; fh=3+twfEsudZ8joK9eUOW5d19a3XOLX/KerMcCQisOb8Y=; b=YaDuSjcoOsfk+hrSO8S95r2lShp+nqwUogv/dw4YPxJrOPVz2hZnLHOruLPqnMW2rM YzmoBVXY/4SH3XBDOxRtbGAugz6A9EnAwmg6ted3sPPido2/3DLENw1NIBASSwT7Pv1F NwTklMfSc6hbHJcBkuXrh5bKzC+nvlbTGm6cgzqvkWkrwSuwrfIdhQnqp7fJMEF8evAJ CaADJ0T5mpfBAUOIf4o4scoe9VN8d5a/EGfKb/RUIhv4vY8Q1NmmxJuKmZDauloe949z KLDQqobRGmn0bm2qPXd+jcMIvfexqAqSBpTXsVWLuUppp6VEWv7IlDboBKHyzyaOQGoZ vb4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wbXSA4pc; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-125594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125594-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bm1-20020a656e81000000b005ed0deb5a66si5322207pgb.120.2024.03.29.20.59.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 20:59:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wbXSA4pc; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-125594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125594-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D5D0B28368B for ; Sat, 30 Mar 2024 03:59:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6235DB672; Sat, 30 Mar 2024 03:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wbXSA4pc" Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.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 8801B79FE for ; Sat, 30 Mar 2024 03:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711771175; cv=none; b=Y13ne6ofSLtTV8ntkgnFXKwrUuM+8Kjx1/m6JvyMOw8Tl61CFP3+XzSo8Y86AWpegIAv0Yn/D7tjdRnf+LdWD3DfxPFS2GMkVk/Kz2pFXIvBm2kEsQ0J7HkfN6JB4oBFg7VUBCZ+eSqav598a+kJXVmn3e5mDPEZmWkiho3Jvq0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711771175; c=relaxed/simple; bh=1dHUwNPq/ZE2lZqujLo0paqKG5T8bLmbO34BUbpj00o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T0djsg8rd2aKjhkahSKwZIq0ZiYNkKaCdGCTwjPskSGqdQKuXyyadaXBhkXjdbHUtHEIQt0zDX1a8kvQbcS86SR5P2fYntuOjOgc01T4HqPGIVB5vb/KJFFQ4WGdXckTrn1hgQmEPphzJ0gdYT+Gi6bOu/ncMF1+0c3lXS6/2k0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=wbXSA4pc; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-515c50dc2afso2712422e87.1 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=vger.kernel.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=wbXSA4pceBAT+JanKxYoSV0QT1ODm2PVY6mSOjfJUVpirr789WP7mcSeYGWKudR2lK C+Wpw9eUVt3jAV2xuZ3zB98ee5A/ORFEt1GNsmH/PwrrVhwWE5uEe1xDODrGuH2JgXEg YwmaJjKkdzmgTNGDl3bQrcXVVL1SwDaIQyWEAq5TDPO/DhRXi0hWX5x3GxZyg7CnAPVM P3nQbJBBD+TTzC9FY8ijqNU8f+61Yy/LVVP5W30TvGSQtwGMf8LrmnM0OjaH8tXPk+jO 2A9859m9YcfDMLfrs+pZHmsZPFF1EVoGpsAQ0ng35H+yzvKt+wF5QbRAJjH4+y/KRsc4 Wgvw== 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=OeuzfmXiBnbsAYPKtf0VE3d9m/eWdGpjPSR0ue4qDaH9Ska7U6aBp6wJB/Oxyzaomm j5Rfz8gzrDwJGuAnliK0H89q3YX6ecvRY5WYfIqhlvd+osrUK7XzymW6OQckoX9bDLKV NgEm79aUP6+aJQ8COE7/3D8N48B3gxt11tMgwHBtrhrZ4j3hi8nuynMDGDciH97iXyUp BdZ0fRa/xxSyNiZv1AyjQswBAazhMHkB80M5We01ZQadEobtwmVaEin/XTDKbkpCS/xy zhyer0IiDMe2QfcpPCW5QFqxLAEiUPHRM0sG7qErvqJcgQA4RYX6wGhfbXwgKheJjrIj P1UQ== X-Forwarded-Encrypted: i=1; AJvYcCWny27rZ1UmPU6lCa6LGSQEIXZlqMvPNmx2gGX8127xWo/MLEHjNz6I7jUYZLpl9sJ6Lc6yS1C7SQ1PEDJLcc9ZJTvVSH4Pi0aL/oAO X-Gm-Message-State: AOJu0Yxnpf/tnI/l5DOwAdlwTD3QB4R+zRvEZ6IU6Tbbl3TuA/ZU13nk r80iuPDWJXpp82a3tkhmI/T8vlLQZKk2LHQqZjxGkOUmL9deBgglBQSRJtp2WYY= 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() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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); -- 2.39.2