[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YjCXHg9lWs8LVAGs@smile.fi.intel.com>
Date: Tue, 15 Mar 2022 15:39:42 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Javier Martinez Canillas <javierm@...hat.com>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Noralf Trønnes <noralf@...nnes.org>,
Pekka Paalanen <pekka.paalanen@...labora.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] drm/format-helper: Fix XRGB888 to monochrome
conversion
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 brightness < 128. Or as kernel-doc for
> this helper function.
>
> > + if (*src++ & BIT(7))
>
> Pekka also mentioned that if (*src++ > 127) would make this easier to read.
>= 128 ?
> > + byte |= BIT(i);
> > }
> > *dst++ = byte;
> > }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists