[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <11d3b6d4-3e31-05cc-c021-22e1497f02d1@suse.de>
Date: Mon, 7 Feb 2022 13:44:31 +0100
From: Thomas Zimmermann <tzimmermann@...e.de>
To: Ilia Mirkin <imirkin@...m.mit.edu>
Cc: linux-fbdev <linux-fbdev@...r.kernel.org>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Javier Martinez Canillas <javierm@...hat.com>,
dri-devel <dri-devel@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>,
Noralf Trønnes <noralf@...nnes.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Maxime Ripard <maxime@...no.tech>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Sam Ravnborg <sam@...nborg.org>
Subject: Re: [PATCH v2 1/4] drm/format-helper: Add drm_fb_{xrgb8888,
gray8}_to_mono_reversed()
Hi
Am 04.02.22 um 22:02 schrieb Ilia Mirkin:
> On Fri, Feb 4, 2022 at 10:53 AM Thomas Zimmermann <tzimmermann@...e.de> wrote:
>>
>> Hi
>>
>> Am 04.02.22 um 14:43 schrieb Javier Martinez Canillas:
>>> Add support to convert XR24 and 8-bit grayscale to reversed monochrome for
>>> drivers that control monochromatic panels, that only have 1 bit per pixel.
>>>
>>> The drm_fb_gray8_to_mono_reversed() helper was based on the function that
>>> does the same in the drivers/gpu/drm/tiny/repaper.c driver.
>>>
>>> Signed-off-by: Javier Martinez Canillas <javierm@...hat.com>
>>> ---
>>>
>>> (no changes since v1)
>>>
>>> drivers/gpu/drm/drm_format_helper.c | 80 +++++++++++++++++++++++++++++
>>> include/drm/drm_format_helper.h | 7 +++
>>> 2 files changed, 87 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/drm_format_helper.c b/drivers/gpu/drm/drm_format_helper.c
>>> index 0f28dd2bdd72..cdce4b7c25d9 100644
>>> --- a/drivers/gpu/drm/drm_format_helper.c
>>> +++ b/drivers/gpu/drm/drm_format_helper.c
>>> @@ -584,3 +584,83 @@ int drm_fb_blit_toio(void __iomem *dst, unsigned int dst_pitch, uint32_t dst_for
>>> return -EINVAL;
>>> }
>>> EXPORT_SYMBOL(drm_fb_blit_toio);
>>> +
>>> +static void drm_fb_gray8_to_mono_reversed_line(u8 *dst, const u8 *src, size_t pixels)
>>> +{
>>> + unsigned int xb, i;
>>> +
>>> + for (xb = 0; xb < pixels / 8; xb++) {
>>
>> In practice, all mode widths are multiples of 8 because VGA mandated it.
>> So it's ok-ish to assume this here. You should probably at least print a
>> warning somewhere if (pixels % 8 != 0)
>
> Not sure if it's relevant, but 1366x768 was a fairly popular laptop
> resolution. There's even a dedicated drm_mode_fixup_1366x768 in
> drm_edid.c. (Would it have killed them to add 2 more horizontal
> pixels? Apparently.)
D'oh!
Do you know how the text console looks in this mode? Fonts still expect
a multiple of 8.
Best regards
Thomas
>
> Cheers,
>
> -ilia
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)
Powered by blists - more mailing lists