Skip to content

Commit 1a8bc0f

Browse files
rcloranmripard
authored andcommitted
drm/mipi-dbi: Fix blanking for non-16 bit formats
On r6x2b6x2g6x2 displays not enough blank data is sent to blank the entire screen. When support for these displays was added, the dirty function was updated to handle the different amount of data, but blanking was not, and remained hardcoded as 2 bytes per pixel. This change applies almost the same algorithm used in the dirty function to the blank function, but there is no fb available at that point, and no concern about having to transform any data, so the dbidev pixel format is always used for calculating the length. Fixes: 4aebb79 ("drm/mipi-dbi: Add support for DRM_FORMAT_RGB888") Signed-off-by: Russell Cloran <rcloran@gmail.com> Link: https://lore.kernel.org/r/20250415053259.79572-1-rcloran@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
1 parent 48ccf21 commit 1a8bc0f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpu/drm/drm_mipi_dbi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,16 @@ static void mipi_dbi_blank(struct mipi_dbi_dev *dbidev)
404404
u16 height = drm->mode_config.min_height;
405405
u16 width = drm->mode_config.min_width;
406406
struct mipi_dbi *dbi = &dbidev->dbi;
407-
size_t len = width * height * 2;
407+
const struct drm_format_info *dst_format;
408+
size_t len;
408409
int idx;
409410

410411
if (!drm_dev_enter(drm, &idx))
411412
return;
412413

414+
dst_format = drm_format_info(dbidev->pixel_format);
415+
len = drm_format_info_min_pitch(dst_format, 0, width) * height;
416+
413417
memset(dbidev->tx_buf, 0, len);
414418

415419
mipi_dbi_set_window_address(dbidev, 0, width - 1, 0, height - 1);

0 commit comments

Comments
 (0)