Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ssd130x: ensure ssd132x pitch is correct

The bounding rectangle is adjusted to ensure it aligns to
SSD132X_SEGMENT_WIDTH, which may adjust the pitch. Calculate the pitch
after aligning the left and right edge.

Fixes: fdd591e00a9c ("drm/ssd130x: Add support for the SSD132x OLED controller family")
Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250115110139.1672488-3-jkeeping@inmusicbrands.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>

authored by

John Keeping and committed by
Javier Martinez Canillas
229adcff 1e144846

+3 -1
+3 -1
drivers/gpu/drm/solomon/ssd130x.c
··· 1037 1037 struct drm_format_conv_state *fmtcnv_state) 1038 1038 { 1039 1039 struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->dev); 1040 - unsigned int dst_pitch = drm_rect_width(rect); 1040 + unsigned int dst_pitch; 1041 1041 struct iosys_map dst; 1042 1042 int ret = 0; 1043 1043 ··· 1045 1045 rect->x1 = round_down(rect->x1, SSD132X_SEGMENT_WIDTH); 1046 1046 rect->x2 = min_t(unsigned int, round_up(rect->x2, SSD132X_SEGMENT_WIDTH), 1047 1047 ssd130x->width); 1048 + 1049 + dst_pitch = drm_rect_width(rect); 1048 1050 1049 1051 ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE); 1050 1052 if (ret)