Re: [PATCH 2/5] drm/format-helper: Fix XRGB888 to monochrome conversion

2022-03-15 Thread Andy Shevchenko
On Tue, Mar 15, 2022 at 01:18:00PM +0100, Javier Martinez Canillas wrote: > On 3/15/22 12:07, Geert Uytterhoeven wrote: > > + for (i = 0; i < bits; i++, pixels--) { > > I think is worth to add a comment here explaining that the pixel is set to > 1 for brightness > 127 and to 0 for brigh

Re: [PATCH 2/5] drm/format-helper: Fix XRGB888 to monochrome conversion

2022-03-15 Thread Andy Shevchenko
On Tue, Mar 15, 2022 at 12:07:04PM +0100, Geert Uytterhoeven wrote: > The conversion functions drm_fb_xrgb_to_mono() and > drm_fb_gray8_to_mono_line() do not behave correctly when the > horizontal boundaries of the clip rectangle are not multiples of 8: > a. When x1 % 8 != 0, the calculated p

Re: [PATCH 2/5] drm/format-helper: Fix XRGB888 to monochrome conversion

2022-03-15 Thread Geert Uytterhoeven
Hi Javier, On Tue, Mar 15, 2022 at 1:18 PM Javier Martinez Canillas wrote: > On 3/15/22 12:07, Geert Uytterhoeven wrote: > > The conversion functions drm_fb_xrgb_to_mono() and > > drm_fb_gray8_to_mono_line() do not behave correctly when the > > horizontal boundaries of the clip rectangle are

Re: [PATCH 2/5] drm/format-helper: Fix XRGB888 to monochrome conversion

2022-03-15 Thread Javier Martinez Canillas
On 3/15/22 12:07, Geert Uytterhoeven wrote: > The conversion functions drm_fb_xrgb_to_mono() and > drm_fb_gray8_to_mono_line() do not behave correctly when the > horizontal boundaries of the clip rectangle are not multiples of 8: > a. When x1 % 8 != 0, the calculated pitch is not correct, >

[PATCH 2/5] drm/format-helper: Fix XRGB888 to monochrome conversion

2022-03-15 Thread Geert Uytterhoeven
The conversion functions drm_fb_xrgb_to_mono() and drm_fb_gray8_to_mono_line() do not behave correctly when the horizontal boundaries of the clip rectangle are not multiples of 8: a. When x1 % 8 != 0, the calculated pitch is not correct, b. When x2 % 8 != 0, the pixel data for the last byte