devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Thomas Zimmermann <tzimmrmann@suse.de>,
	Javier Martinez Canillas <javierm@redhat.com>
Subject: Re: [PATCH v6 2/3] drm/st7571-i2c: add support for Sitronix ST7571 LCD controller
Date: Tue, 29 Apr 2025 08:15:44 +0200	[thread overview]
Message-ID: <aBBukAqH3SKV9_Gl@gmail.com> (raw)
In-Reply-To: <CAMuHMdUsP5gcTyvqJM4OUFL3VutzDrX-V23uYRfnfgzotD8+rg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]

Hello Geert,

On Thu, Apr 24, 2025 at 10:38:33AM +0200, Geert Uytterhoeven wrote:

[...]

> > +                       /*
> > +                        * As the display supports grayscale, all pixels must be written as two bits
> > +                        * even if the format is monochrome.
> > +                        *
> > +                        * The bit values maps to the following grayscale:
> > +                        * 0 0 = White
> > +                        * 0 1 = Light gray
> > +                        * 1 0 = Dark gray
> > +                        * 1 1 = Black
> 
> That is not R2, but D2?
> include/uapi/drm/drm_fourcc.h:
> 
>     /* 2 bpp Red (direct relationship between channel value and brightness) */
>     #define DRM_FORMAT_R2             fourcc_code('R', '2', ' ', ' ')
> /* [7:0] R0:R1:R2:R3 2:2:2:2 four pixels/byte */
> 
>     /* 2 bpp Darkness (inverse relationship between channel value and
> brightness) */
>     #define DRM_FORMAT_D2             fourcc_code('D', '2', ' ', ' ')
> /* [7:0] D0:D1:D2:D3 2:2:2:2 four pixels/byte */
> 
> So the driver actually supports D1 and D2, and XRGB8888 should be
> inverted while converting to monochrome (and grayscale, which is not
> yet implemented).

The display supports "reverse" grayscale, so the mapping becomes
1 1 = White
1 0 = Light gray
0 1 = Dark gray
0 0 = Black
instead.

So I will probably add support for D1 and D2 formats and invert the
pixels for the R1, R2 and XRGB8888 formats.

Could that work or are there any side effects that I should be aware of?

Best regards,
Marcus Folkesson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2025-04-29  6:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 19:03 [PATCH v6 0/3] Add support for Sitronix ST7571 LCD controller Marcus Folkesson
2025-04-23 19:03 ` [PATCH v6 1/3] dt-bindings: display: Add Sitronix ST7571 LCD Controller Marcus Folkesson
2025-04-23 19:03 ` [PATCH v6 2/3] drm/st7571-i2c: add support for Sitronix ST7571 LCD controller Marcus Folkesson
2025-04-23 19:35   ` Javier Martinez Canillas
2025-04-24  8:38   ` Geert Uytterhoeven
2025-04-28  7:11     ` Marcus Folkesson
2025-04-29  6:15     ` Marcus Folkesson [this message]
2025-04-29  6:39       ` Geert Uytterhoeven
2025-04-29  7:42         ` Javier Martinez Canillas
2025-04-23 19:03 ` [PATCH v6 3/3] MAINTAINERS: add entry for Sitronix ST7571 LCD Controller Marcus Folkesson
2025-04-23 19:49 ` [PATCH v6 0/3] Add support for Sitronix ST7571 LCD controller Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aBBukAqH3SKV9_Gl@gmail.com \
    --to=marcus.folkesson@gmail.com \
    --cc=airlied@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=javierm@redhat.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=tzimmrmann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).