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

Configure Feed

Select the types of activity you want to include in your feed.

drm/fb-helper: Fix clipping when damage area spans a single scanline

When the damage area resulting from a dirty memory range spans a single
scanline, the width of the rectangle is calculated dynamically because it
may not coincide with the framebuffer width.
If the dirty range ends exactly at the end of the scanline, the `bit_end`
variable is incorrectly assigned a 0 value, which results in a bogus clip
rectangle where the x2 coordinate is 0. This prevents the dirty scanline
from being flushed to the hardware.
Change the calculation of the `bit_end` value to fix the x2 coordinate
value in the above edge case.

Fixes: ded74cafeea9 ("drm/fb-helper: Clip damage area horizontally")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260210173545.733937-1-flavra@baylibre.com

authored by

Francesco Lavra and committed by
Thomas Zimmermann
c28c22c8 8acd2d7e

+1 -1
+1 -1
drivers/gpu/drm/drm_fb_helper.c
··· 490 490 * the number of horizontal pixels that need an update. 491 491 */ 492 492 off_t bit_off = (off % line_length) * 8; 493 - off_t bit_end = (end % line_length) * 8; 493 + off_t bit_end = bit_off + len * 8; 494 494 495 495 x1 = bit_off / info->var.bits_per_pixel; 496 496 x2 = DIV_ROUND_UP(bit_end, info->var.bits_per_pixel);