Re: [PATCH] staging: sm750fb: fix mono image source stride mismatch in lynxfb_ops_imageblit()

From: Dan Carpenter

Date: Sat Jul 18 2026 - 01:44:26 EST


On Sat, Jul 18, 2026 at 09:56:41AM +0500, Muhammad Bilal wrote:
> sm750_hw_imageblit() advances its monochrome source pointer by
> src_delta per scanline, and computes the correct rounded-up stride
> internally as:
>
> bytes_per_scan = (width + start_bit + 7) / 8;
>
> Its only caller, lynxfb_ops_imageblit(), instead passes src_delta as
> image->width >> 3. For widths not a multiple of 8 this under-counts
> the stride, so the source pointer falls further behind the real
> per-scanline layout on every line, corrupting the rendered image.
>
> Use DIV_ROUND_UP() so the stride passed in matches what
> sm750_hw_imageblit() already assumes.
>
> Signed-off-by: Muhammad Bilal <meatuni001@xxxxxxxxx>

Looks reasonable. Add a Fixes tag.

You have this hardware and are finding these with testing?

It would be better to move the source delta calculation into
the the sm750_hw_imageblit() since it's just width rounded up
(or rounded down if you want to be wrong I suppose).

regards,
dan carpenter