From: Geert Uytterhoeven Date: Thu, 13 Jul 2023 13:17:09 +0000 (+0200) Subject: drm/ssd130x: Fix pitch calculation in ssd130x_fb_blit_rect() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=27564c61ab1dbd47ba232949f87c8a1043210993;p=linux.git drm/ssd130x: Fix pitch calculation in ssd130x_fb_blit_rect() The page height must be taken into account only for vertical coordinates and heights, not for horizontal coordinates and widths. Fixes: 179a790aaf2a ("drm/ssd130x: Set the page height value in the device info data") Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/54deec2ec533e90544faa8c60a0c2518c58f3e9c.1689252746.git.geert@linux-m68k.org --- diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index afb08a8aa9fcd..b4c3769626295 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -596,7 +596,7 @@ static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb, const struct iosys_m rect->y1 = round_down(rect->y1, page_height); rect->y2 = min_t(unsigned int, round_up(rect->y2, page_height), ssd130x->height); - dst_pitch = DIV_ROUND_UP(drm_rect_width(rect), page_height); + dst_pitch = DIV_ROUND_UP(drm_rect_width(rect), 8); ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE); if (ret)