From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 051853F54CC; Tue, 17 Mar 2026 17:07:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773767257; cv=none; b=fAjVR5qwPjJQag8E+yDV27gC/Ho3STEI62++2k8Y6P6tIhNDEI93yyndM658PWj/Q3WeICo3EaQgbybtwqinz+3KJ4E/fjUWtpwWsBsOEwYrEOKd5X9wp8tuGISMYh56KwjzzDKqBtLsP+qLMMIFISeiCn0tmmtaXrqCuYp1w7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773767257; c=relaxed/simple; bh=L06UK78W4Chihhu98aKPBY7sNR3egVNvrof7lSmNKxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iCCeqUlAonTaE/AdVtRs6iWnPpGiKIrSYjjL+76dCGnb5ZT0K0nmCm4vpIwzpn6a5c4J5bTViuchTEJEaTPOsaBJxikkJpJ2OL5r3Bd84hRPbvVrKF3Z4ZybZzSI947MPVvl3jzxmHWGhbkU/ATT4+ZnM3ntQDy7JiatLo5YPvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=luMhOWOZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="luMhOWOZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20EE0C4CEF7; Tue, 17 Mar 2026 17:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773767256; bh=L06UK78W4Chihhu98aKPBY7sNR3egVNvrof7lSmNKxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=luMhOWOZ044KpymjM8mEaCS4zDlZ37MHq+ZaobkjnvPz3d4X5dFCeqaUpFv9g2Jjw JZmodd2Iqol+GG3UyYDeXsBtOD8LTaJTfzal8Z9vksqVqnHurmDCTkpgEAKsDMm5ze ucI1Tb/yd39fNqnIU726c6DVlHkTqjl2caDOlikA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thomas Zimmermann , Javier Martinez Canillas , David Lechner , Sasha Levin Subject: [PATCH 6.18 049/333] drm/sitronix/st7586: fix bad pixel data due to byte swap Date: Tue, 17 Mar 2026 17:31:18 +0100 Message-ID: <20260317163001.183762430@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260317162959.345812316@linuxfoundation.org> References: <20260317162959.345812316@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Lechner [ Upstream commit 46d8a07b4ae262e2fec6ce2aa454e06243661265 ] Correctly set dbi->write_memory_bpw for the ST7586 driver. This driver is for a monochrome display that has an unusual data format, so the default value set in mipi_dbi_spi_init() is not correct simply because this controller is non-standard. Previously, we were using dbi->swap_bytes to make the same sort of workaround, but it was removed in the same commit that added dbi->write_memory_bpw, so we need to use the latter now to have the correct behavior. This fixes every 3 columns of pixels being swapped on the display. There are 3 pixels per byte, so the byte swap caused this effect. Fixes: df3fb27a74a4 ("drm/mipi-dbi: Make bits per word configurable for pixel transfers") Acked-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Signed-off-by: David Lechner Link: https://patch.msgid.link/20260228-drm-mipi-dbi-fix-st7586-byte-swap-v1-1-e78f6c24cd28@baylibre.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/sitronix/st7586.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/sitronix/st7586.c b/drivers/gpu/drm/sitronix/st7586.c index a29672d84eded..055383497aae7 100644 --- a/drivers/gpu/drm/sitronix/st7586.c +++ b/drivers/gpu/drm/sitronix/st7586.c @@ -346,6 +346,12 @@ static int st7586_probe(struct spi_device *spi) if (ret) return ret; + /* + * Override value set by mipi_dbi_spi_init(). This driver is a bit + * non-standard, so best to set it explicitly here. + */ + dbi->write_memory_bpw = 8; + /* Cannot read from this controller via SPI */ dbi->read_commands = NULL; @@ -355,15 +361,6 @@ static int st7586_probe(struct spi_device *spi) if (ret) return ret; - /* - * we are using 8-bit data, so we are not actually swapping anything, - * but setting mipi->swap_bytes makes mipi_dbi_typec3_command() do the - * right thing and not use 16-bit transfers (which results in swapped - * bytes on little-endian systems and causes out of order data to be - * sent to the display). - */ - dbi->swap_bytes = true; - drm_mode_config_reset(drm); ret = drm_dev_register(drm, 0); -- 2.51.0